:root {
  color-scheme: light;
  --paper: #eef0f7;
  --surface: #fff;
  --ink: #19213b;
  --dim: #4d5770;
  --line: #c7cedf;
  --accent: #4535aa;
  --accent-soft: #e3dfff;
  --danger: #a12648;
  --top: #19213b;
  --wash: #e3e6f4;
  --hover: #f8f7ff;
  --chip: #ece9fb;
  --primary: #4535aa;
  --primary-hover: #372889;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
@supports (color: light-dark(white, black)) {
  :root {
    color-scheme: light dark;
    --paper: light-dark(#eef0f7, #141827);
    --surface: light-dark(#fff, #202537);
    --ink: light-dark(#19213b, #edf0fb);
    --dim: light-dark(#4d5770, #b7bfd5);
    --line: light-dark(#c7cedf, #49536e);
    --accent: light-dark(#4535aa, #cabeff);
    --accent-soft: light-dark(#e3dfff, #363052);
    --danger: light-dark(#a12648, #ffafc1);
    --top: light-dark(#19213b, #101320);
    --wash: light-dark(#e3e6f4, #262d41);
    --hover: light-dark(#f8f7ff, #2a3047);
    --chip: light-dark(#ece9fb, #322c4b);
    --primary: light-dark(#4535aa, #5040af);
    --primary-hover: light-dark(#372889, #604ec3);
  }
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: .16em; }
a:hover { text-decoration-thickness: .13em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }
.skip { position: absolute; left: .75rem; top: -6rem; z-index: 2; padding: .5rem; background: var(--surface); }
.skip:focus { top: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.top { background: var(--top); color: white; }
.top-inner {
  max-width: 76rem; padding: .65rem clamp(1rem, 4vw, 2.5rem); margin: auto;
  min-height: 3.8rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.top nav, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.top nav { justify-content: flex-end; }
.top nav a, .top nav button { color: white; }
.top :focus-visible { outline-color: #cabeff; }
.theme-switch { display: inline-flex; gap: .16rem; padding: .15rem; border: 1px solid #8490ae; border-radius: .4rem; }
.theme-switch button {
  display: grid; place-items: center; width: 2.25rem; min-height: 2.25rem;
  border: 0; border-radius: .27rem; background: transparent; font-size: 1.17rem;
}
.theme-switch button:hover { background: #3e4662; }
.theme-switch button[aria-pressed="true"] { background: #cabeff; color: #19213b; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 720; color: white; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 1.9rem; height: 1.9rem;
  font: bold 1.27rem Georgia, serif; color: #19213b; background: #cabeff; border-radius: .34rem;
}
.page { max-width: 76rem; margin: auto; padding: clamp(1.4rem, 4vw, 3.2rem) clamp(1rem, 4vw, 2.5rem) 5rem; }
.narrow { max-width: 46rem; }
.reading { max-width: 59rem; }
.login { max-width: 30rem; }
.heading, .result-heading, .item-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem;
}
h1 { font: 700 clamp(2rem, 5vw, 3.2rem)/1.05 Georgia, "Times New Roman", serif; margin: 0 0 .7rem; }
h2 { font-size: 1.18rem; margin: 0 0 .45rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 .3rem; }
p { margin: .45rem 0 .85rem; }
.secondary, .byline, .helptext { color: var(--dim); }
.byline { display: block; font-size: .84rem; }
.date { display: inline-block; padding-left: .45rem; }
.heading { margin-bottom: 1.25rem; }
.heading p { margin-bottom: 0; }
.back { display: inline-block; margin-bottom: 1.2rem; }
.button, .quiet {
  min-height: 2.65rem; padding: .55rem .85rem; display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: .44rem; background: var(--surface);
  text-decoration: none; color: var(--ink); font-weight: 650; line-height: 1.2;
}
.button:hover { border-color: var(--accent); background: var(--hover); }
.primary { background: var(--primary); color: white; border-color: var(--primary); }
.primary:hover { background: var(--primary-hover); color: white; }
.quiet { background: transparent; border-color: transparent; padding-left: .3rem; padding-right: .3rem; }
.quiet:hover { text-decoration: underline; }
.danger { color: var(--danger); }
.search {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, 12rem) auto;
  align-items: end; gap: .8rem; background: var(--wash); border-left: 4px solid var(--accent);
  padding: .95rem; margin-bottom: 1.6rem; border-radius: .35rem;
}
label { display: block; font-weight: 650; font-size: .92rem; margin-bottom: .25rem; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea {
  display: block; width: 100%; min-width: 0; min-height: 2.65rem; padding: .55rem .65rem;
  border: 1px solid var(--line); border-radius: .35rem; background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--dim); }
.library { display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr); gap: 1.6rem; }
.sections h2 { padding-left: .65rem; }
.section-list, .note-list, .plain-list { list-style: none; padding: 0; margin: 0 0 .75rem; }
.section-list a { display: block; padding: .48rem .65rem; color: var(--ink); text-decoration: none; border-radius: .36rem; }
.section-list a:hover { background: var(--wash); }
.section-list a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.minor-link { font-size: .92rem; }
.sections .minor-link { display: inline-block; padding: .45rem .65rem; }
.results { min-width: 0; }
.note-list { border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); }
.note-list li { padding: .85rem 1rem; }
.note-list li + li, .plain-list li + li { border-top: 1px solid var(--line); }
.note-list li > a { display: block; font-size: 1.12rem; font-weight: 690; }
.note-list li p { margin: .3rem 0 0; color: var(--dim); white-space: pre-line; }
.chip { display: inline-block; background: var(--chip); color: var(--accent); padding: .12rem .5rem; margin-bottom: .26rem; border-radius: 1rem; font-size: .78rem; }
.empty { padding: 1.3rem; border: 1px dashed #9aa5bd; border-radius: .55rem; color: var(--dim); }
.empty p { margin-bottom: 0; }
.editor { display: grid; gap: .5rem; }
.editor p { margin: .15rem 0 .45rem; }
.helptext { display: block; margin-top: .35rem; font-size: .86rem; }
.notice, .errorlist { color: var(--danger); font-weight: 640; }
.notice { padding: .7rem .8rem; border-left: 3px solid var(--danger); background: var(--surface); }
.prose {
  min-width: 0; padding: clamp(1rem, 4vw, 2rem); border: 1px solid var(--line);
  background: var(--surface); border-radius: .55rem; font-size: 1.05rem; line-height: 1.65;
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { max-width: 72ch; }
.prose pre { max-width: 100%; overflow: auto; padding: .8rem; background: var(--paper); border-radius: .3rem; }
.prose blockquote { margin-left: 0; padding-left: 1rem; color: var(--dim); border-left: 3px solid var(--accent-soft); }
.panel { margin-top: 1.15rem; padding: .95rem 0; border-top: 1px solid var(--line); }
.plain-list .item-row, .files li { padding: .65rem 0; }
.files img { display: block; max-width: min(100%, 30rem); max-height: 29rem; object-fit: contain; border-radius: .4rem; margin-bottom: .4rem; }
details summary { cursor: pointer; }
.grants { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: .75rem; }
.grants fieldset { min-width: 0; margin: 0; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .35rem; }
.grants legend { font-weight: 700; padding: 0 .3rem; }
.grants label { cursor: pointer; padding: .2rem 0; }
.grants input { margin-right: .3rem; accent-color: var(--accent); }
.section-all { border-bottom: 1px solid var(--line); margin-bottom: .4rem; }
.key-issued { border-left: 4px solid var(--accent); background: var(--wash); padding: 1rem; }
.rotate-key { max-width: 17rem; }
.rotate-key summary, .revoked-keys summary { display: list-item; }
.revoked-keys { margin-top: 1rem; }
.revoked-keys .plain-list { margin-top: .5rem; }
@media (max-width: 46rem) {
  .library { grid-template-columns: minmax(0, 1fr); }
  .library .sections { order: 2; border-top: 1px solid var(--line); padding-top: 1rem; }
  .section-list { display: flex; flex-wrap: wrap; gap: .25rem; }
  .search { grid-template-columns: minmax(0, 1fr) auto; }
  .search-term { grid-column: 1 / -1; }
  .heading { align-items: flex-start; }
}
