/* Policy review site. Layout: sticky top bar; left rail lists the 78 documents by section; right pane is the reader (or the overview when nothing is open). */
html, body { margin: 0; padding: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:root {
  --bg: #f7f5f4;
  --surface: #ffffff;
  --sunken: #f0eceb;
  --ink: #1d1718;
  --ink-2: #4a4042;
  --muted: #776b6d;
  --line: #e5dddc;
  --accent: #9e1b22;
  --accent-ink: #ffffff;
  --accent-soft: #f6e6e6;
  --good: #1d7547;
  --good-soft: #e1f1e7;
  --warn: #855600;
  --warn-soft: #faefd6;
  --blank: #fdeeb0;
  --blank-ink: #5c4300;
  --f-display: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --bar-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131011; --surface: #1b1718; --sunken: #231d1e; --ink: #f2edec; --ink-2: #d0c6c7;
    --muted: #9d9193; --line: #322b2c; --accent: #ec6a70; --accent-ink: #1a0d0e; --accent-soft: #3a1c1f;
    --good: #5cc48e; --good-soft: #15301f; --warn: #e9b95e; --warn-soft: #382a10; --blank: #4b3d0d; --blank-ink: #f8df8a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131011; --surface: #1b1718; --sunken: #231d1e; --ink: #f2edec; --ink-2: #d0c6c7;
  --muted: #9d9193; --line: #322b2c; --accent: #ec6a70; --accent-ink: #1a0d0e; --accent-soft: #3a1c1f;
  --good: #5cc48e; --good-soft: #15301f; --warn: #e9b95e; --warn-soft: #382a10; --blank: #4b3d0d; --blank-ink: #f8df8a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-in { height: var(--bar-h); display: flex; align-items: center; gap: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.brand b { font-family: var(--f-display); font-weight: 700; font-size: 18px; letter-spacing: 0.01em; white-space: nowrap; }
.brand span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.me-progress { display: grid; gap: 4px; justify-items: end; }
.me-progress .label { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.me-progress .label strong { color: var(--ink); }
.meter { width: 160px; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--good); border-radius: 3px; transition: width .3s ease; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--sunken); }

.notice { padding: 9px max(16px, env(safe-area-inset-right, 0px)) 9px max(16px, env(safe-area-inset-left, 0px)); font-size: 13.5px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); }

/* Two panes */
.main { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: start; }
.rail { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--bar-h)); height: calc(100vh - var(--bar-h) - env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); min-width: 0; }
.rail-head { padding: 14px 16px 10px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.search { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; }
.search::placeholder { color: var(--muted); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-btn .num { font-size: 11.5px; opacity: .75; margin-left: 4px; }
.list { overflow-y: auto; flex: 1; padding-bottom: 24px; overscroll-behavior: contain; }
.sec-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 6px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.sec-head .num { letter-spacing: 0; color: var(--muted); font-weight: 400; }
.row { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 16px 9px max(16px, env(safe-area-inset-left, 0px)); border: 0; background: transparent; text-align: left; cursor: pointer; border-left: 3px solid transparent; }
.row:hover { background: var(--sunken); }
.row[aria-current="true"] { background: var(--accent-soft); border-left-color: var(--accent); }
.row .no { font-family: var(--f-mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.row .t { font-size: 14px; font-weight: 500; line-height: 1.35; }
.row .e { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row .side { display: flex; align-items: center; gap: 6px; padding-top: 1px; }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.tick.on { background: var(--good); border-color: var(--good); }
.tick svg { width: 12px; height: 12px; }
.count { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); min-width: 1ch; }
.empty-list { padding: 24px 16px; color: var(--muted); font-size: 14px; }

/* Reader */
.pane { min-width: 0; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 80px 48px; }
.back { display: none; align-items: center; gap: 6px; border: 0; background: none; padding: 0; margin-bottom: 18px; color: var(--accent); font-weight: 500; cursor: pointer; }
.doc { max-width: 760px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow .num { letter-spacing: 0; color: var(--muted); font-weight: 400; }
h1.title { font-family: var(--f-display); font-weight: 700; font-size: clamp(26px, 3.4vw, 34px); line-height: 1.15; margin: 8px 0 6px; text-wrap: balance; }
.applies { color: var(--ink-2); margin: 0 0 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.fact { font-size: 12.5px; padding: 3px 9px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.fact.warn { background: var(--warn-soft); color: var(--warn); }
.fact.blank { background: var(--blank); color: var(--blank-ink); }

.review-box { display: grid; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 26px; }
.review-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-done { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.review-hint { font-size: 13px; color: var(--muted); }
.people { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.person { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.person .avatar { width: 24px; height: 24px; }
.person .when { color: var(--muted); font-size: 12.5px; }
.people-empty { font-size: 13.5px; color: var(--muted); }

details.toc { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 28px; }
details.toc summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; }
details.toc summary::-webkit-details-marker { display: none; }
details.toc summary::after { content: "Show"; font-weight: 400; color: var(--accent); font-size: 13px; }
details.toc[open] summary::after { content: "Hide"; }
.toc ol { list-style: none; margin: 0 0 14px; padding: 0; columns: 2 260px; column-gap: 24px; }
.toc li { break-inside: avoid; }
.toc button { border: 0; background: none; padding: 4px 0; text-align: left; cursor: pointer; color: var(--ink-2); font-size: 13.5px; line-height: 1.35; }
.toc button:hover { color: var(--accent); }

/* Document text */
.body { font-size: 16px; line-height: 1.65; color: var(--ink); }
.body h2 { font-family: var(--f-display); font-weight: 600; font-size: 23px; line-height: 1.25; margin: 40px 0 12px; text-wrap: balance; scroll-margin-top: calc(var(--bar-h) + 20px); }
.body h3 { font-size: 17px; font-weight: 600; margin: 26px 0 8px; line-height: 1.35; text-wrap: balance; }
.body p { margin: 0 0 12px; }
.body ul { margin: 0 0 14px; padding-left: 22px; }
.body ul li { margin-bottom: 6px; padding-left: 4px; }
.body ul li::marker { color: var(--accent); }
.body .ol { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); margin: 0 0 8px; }
.body .ol .n { font-family: var(--f-mono); font-size: 13.5px; color: var(--muted); padding-top: 2px; }
.body .note { margin: 16px 0; padding: 12px 16px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: 15px; }
.body .note .lbl { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); margin-bottom: 2px; }
.body .pg { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; color: var(--muted); font-family: var(--f-mono); font-size: 11.5px; }
.body .pg::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.body .pg:first-child { margin-top: 0; }
.body mark { background: var(--blank); color: var(--blank-ink); border-radius: 3px; padding: 0 3px; }
.tbl { overflow-x: auto; margin: 6px 0 18px; border: 1px solid var(--line); border-radius: 10px; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.45; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: pre-line; min-width: 7em; }
.tbl th { background: var(--sunken); font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.fig { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px; margin: 8px 0 18px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; }
.fig::before { content: "Diagram (text only)"; flex-basis: 100%; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.fig span { background: var(--sunken); padding: 3px 8px; border-radius: 6px; }
.doc-end { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.nav .btn { max-width: 100%; }
.nav .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loading, .error { color: var(--muted); padding: 24px 0; }
.error { color: var(--warn); }

/* Overview */
.ov { max-width: 820px; display: grid; gap: 32px; }
.ov h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; margin: 6px 0 10px; }
.ov .lede { color: var(--ink-2); max-width: 62ch; margin: 0; }
.ov h2 { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.mine { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 24px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.mine .big { font-family: var(--f-display); font-weight: 700; font-size: 44px; line-height: 1; grid-row: span 2; }
.mine .big small { font-size: 20px; color: var(--muted); font-weight: 500; }
.mine .meter { width: 100%; height: 8px; }
.mine .sub { font-size: 14px; color: var(--ink-2); }
.mine .btn { grid-column: 1 / -1; justify-self: start; margin-top: 10px; max-width: 100%; }
.mine .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sec { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; cursor: pointer; }
.sec:hover { border-color: var(--accent); }
.sec .n { font-size: 13.5px; font-weight: 500; }
.sec .meter { width: 100%; }
.sec .c { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.team { display: grid; gap: 2px; }
.member { display: grid; grid-template-columns: 28px minmax(0, 1fr) 140px auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .nm small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.member .meter { width: 100%; }
.member .c { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); text-align: right; min-width: 5ch; }
.callout { padding: 14px 16px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.callout b { color: var(--warn); }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 40; max-width: calc(100% - 32px); }

@media (max-width: 860px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; border-right: 0; }
  .list { overflow: visible; }
  .pane { padding: 20px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); }
  body.reading .rail { display: none; }
  body:not(.reading) .pane { display: none; }
  .back { display: inline-flex; }
  .brand span { display: none; }
  .meter { width: 90px; }
  .member { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .member .meter { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Initials in place of profile photos */
.avatar { display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; }
.person .avatar { font-size: 10px; }
.signout { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.signout:hover { border-color: var(--accent); color: var(--accent); }

/* Sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; display: grid; gap: 16px; padding: 28px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.login-card h1 { font-family: var(--f-display); font-weight: 700; font-size: 24px; line-height: 1.2; margin: 0; }
.login-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.login-card label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 500; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; }
.login-card input.code { font-family: var(--f-mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.login-card .btn { justify-content: center; width: 100%; }
.login-card .link { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13.5px; cursor: pointer; justify-self: start; }
.login-error { font-size: 13.5px; color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 8px; }
.login-foot { font-size: 12.5px; color: var(--muted); text-align: center; }

/* Audio */
.listen { display: grid; gap: 10px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 18px; }
.listen-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.listen-head b { font-size: 14px; }
.listen-head span { font-size: 12.5px; color: var(--muted); }
.listen audio { width: 100%; }
.listen .speeds { display: flex; gap: 6px; flex-wrap: wrap; }
.listen-note { font-size: 12.5px; color: var(--muted); }
.row .aud { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
