:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1d1f;
  --muted: #5b5f66;
  --border: #d9dbdf;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --danger: #b42318;
  --warn-bg: #fff6e0;
  --ok: #157f3b;
  --radius: 10px;
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416;
    --surface: #1c1e21;
    --text: #e9eaec;
    --muted: #a3a8b0;
    --border: #34373c;
    --accent: #7b9cff;
    --accent-text: #0d1020;
    --danger: #ff8a7f;
    --warn-bg: #3a3020;
    --ok: #5fd38a;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem; z-index: 10; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.1rem; }
.top nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

main { padding: 1.5rem 1.25rem 3rem; margin: 0 auto; }
main.wide { max-width: 60rem; }
main.narrow { max-width: 36rem; }
.foot { color: var(--muted); font-size: .85rem; text-align: center; padding: 1rem; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: .5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
.lead { font-size: 1.15rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }
code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .9em; }
pre.exact { white-space: pre-wrap; word-break: break-word; margin: 0; background: var(--bg); padding: .5rem; border-radius: 6px; border: 1px solid var(--border); max-height: 24rem; overflow: auto; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; }
.panel.attention { border-color: var(--accent); }
.panel.paused { background: var(--warn-bg); }
.panel.untrusted blockquote { margin: .5rem 0 0; padding: .5rem .75rem; border-left: 4px solid var(--border); white-space: pre-wrap; }
.panel h2 { margin-top: 0; }

.cards { list-style: none; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.list { padding-left: 1.1rem; }
.list li { margin: .35rem 0; }
.permissions { list-style: none; padding: 0; }
.permission { border-top: 1px solid var(--border); padding: .6rem 0; }
.permission ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.points li { margin: .3rem 0; }
.codes { columns: 2; font-size: 1.05rem; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
@media (max-width: 34rem) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .5rem; } .codes { columns: 1; } }

.badge { display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--border); vertical-align: middle; }
.badge.cimd, .badge.preregistered { border-color: var(--ok); color: var(--ok); }
.badge.dcr, .badge.high { border-color: var(--danger); color: var(--danger); }
.badge.elevated { background: var(--warn-bg); }

table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
@media (max-width: 34rem) { table, thead, tbody, tr, th, td { display: block; } thead { display: none; } tr { border-bottom: 1px solid var(--border); padding: .4rem 0; } td { border: 0; padding: .15rem .6rem; } }

form.stack, .stack { display: flex; flex-direction: column; gap: .5rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0 0 1rem; background: var(--surface); display: flex; flex-direction: column; gap: .45rem; }
legend { font-weight: 700; padding: 0 .3rem; }
label { font-weight: 600; }
label.check { font-weight: 400; display: flex; gap: .5rem; align-items: baseline; }
input, select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); width: 100%; }
input[type="checkbox"] { width: auto; }
form.inline { display: inline; }

button, .button { font: inherit; font-weight: 600; display: inline-block; padding: .6rem 1rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; min-height: 2.75rem; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; min-height: auto; font-weight: 400; text-decoration: underline; }
button:disabled { opacity: .6; cursor: progress; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
