:root {
  --bg: #0f1012; --panel: #17191c; --line: #34373d; --ink: #efeadc; --mute: #b0ad9f; --dim: #8f8d82;
  --accent: #dcae55; --accent-ink: #17110a; --danger: #ec6b5c; --ok: #86bd8e;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs: 16px; --fs-s: .8125rem; --fs-b: 1rem; --fs-m: 1.25rem; --fs-l: 1.75rem; --fs-xl: 2.5rem;
}
html[data-size="s"] { --fs: 14.5px; } html[data-size="l"] { --fs: 19px; }
html.hc { --bg: #000; --panel: #0a0a0a; --line: #8a8a8a; --ink: #fff; --mute: #e2e0d6; --dim: #d0cec4; }
* { box-sizing: border-box; }
html { background: var(--bg); font-size: var(--fs); }
body { margin: 0; color: var(--ink); font: 1rem/1.55 var(--sans); min-height: 100vh;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; pointer-events: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; left: 8px; top: -80px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; } .skip:hover { color: var(--accent-ink); }

/* header */
.class-strip { margin: 0; background: #2a1512; border-bottom: 1px solid #6b2c25; padding: 6px 20px; font-size: var(--fs-s); color: #f3d6d1; }
.class-strip .mark { font: 600 var(--fs-s) var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--danger); margin-right: 10px; }
.top-row { display: flex; align-items: center; gap: 16px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font: 600 1.2rem/1.1 var(--serif); }
.brand small { display: block; font: var(--fs-s) var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who-name { color: var(--ink); margin-right: 8px; }
.menu-btn { display: none; }
.comfort { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.comfort[hidden] { display: none; }
.comfort fieldset { border: 0; margin: 0; padding: 0; display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
.comfort legend { float: left; margin-right: 16px; color: var(--mute); }
.comfort label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.comfort input { width: 20px; height: 20px; }

/* shell */
.frame { min-height: 100vh; display: flex; flex-direction: column; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); width: 100%; max-width: 1400px; margin: 0 auto; flex: 1; }
.shell:has(main.docmode) { max-width: none; }
.rail { padding: 20px 12px 24px 20px; display: flex; flex-direction: column; gap: 6px; align-self: start; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
.navgroup { border-top: 1px solid var(--line); padding: 4px 0; }
.navgroup summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font: var(--fs-s) var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--mute); list-style: none; padding: 0 12px; }
.navgroup summary::-webkit-details-marker { display: none; }
.navgroup summary::after { content: "+"; } .navgroup[open] summary::after { content: "\2013"; }
.nav a, .rail a { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; color: var(--mute); text-decoration: none; border-radius: 4px; }
.rail a:hover { color: var(--ink); background: var(--panel); }
.rail a[aria-current="page"] { color: var(--ink); background: var(--panel); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.rail-search { margin-bottom: 8px; }
main { padding: 24px clamp(16px, 3.5vw, 48px) 72px; min-width: 0; max-width: 1100px; width: 100%; }
main:focus { outline: none; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--mute); font-size: var(--fs-s); margin-bottom: 18px; }
.crumbs a { color: var(--mute); }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.head h1 { font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.15; max-width: 24ch; }
.head > div:last-child { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { font: var(--fs-s) var(--mono); letter-spacing: .04em; color: var(--accent); margin-bottom: 8px; }
.foot { border-top: 1px solid var(--line); padding: 18px 20px; display: flex; gap: 12px 28px; flex-wrap: wrap; color: var(--mute); font-size: var(--fs-s); justify-content: center; }
.keys div { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; } .keys dt { min-width: 3em; } .keys dd { margin: 0; color: var(--mute); }
kbd { font: 600 var(--fs-s) var(--mono); border: 1px solid var(--line); padding: 2px 8px; border-radius: 3px; }

/* controls */
.btn { background: var(--panel); border: 1px solid var(--line); padding: 10px 18px; min-height: 44px; line-height: 1.3; cursor: pointer; border-radius: 3px; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--mute); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #ecc072; color: var(--accent-ink); }
.btn.quiet { background: none; border-color: transparent; color: var(--mute); }
.btn.quiet:hover { color: var(--ink); border-color: var(--line); }
.btn:active { transform: translateY(1px); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 8px 12px; font-size: var(--fs-s); min-height: 44px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font: var(--fs-s) var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
.field input, .field select, .field textarea { background: #0a0b0c; border: 1px solid var(--line); padding: 10px 12px; min-height: 44px; border-radius: 3px; width: 100%; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid .wide { grid-column: 1 / -1; }
.search { max-width: 340px; }

/* roster */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: var(--fs-s) var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .1em; padding: 8px 12px; border-bottom: 1px solid var(--line); }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr:focus-visible { background: var(--panel); }
.mono { font-family: var(--mono); font-size: var(--fs-s); color: var(--mute); }
.tag { font: var(--fs-s) var(--mono); padding: 2px 8px; border: 1px solid var(--line); border-radius: 2px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.tag.on { color: var(--ok); border-color: #3b5a41; }
.tag.off { color: var(--dim); }
.panel { background: transparent; border-top: 1px solid var(--line); padding: 20px 0; margin-bottom: 24px; }
.empty { border-top: 1px solid var(--line); padding: 40px 0; text-align: left; max-width: 60ch; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--mute); margin: 0 0 20px; }

/* documents */
.section { margin-bottom: 36px; }
.section > h2 { font-size: 19px; padding-bottom: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.subhead { font: var(--fs-s) var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .1em; grid-column: 1 / -1; margin-top: 6px; }
.group { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; }
.group > .gl { font: var(--fs-s) var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
.item { border-top: 1px solid var(--line); padding: 16px 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); position: relative; }
.item .rm { position: absolute; top: 6px; right: 6px; }
.stickybar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 14px 0; display: flex; gap: 12px; align-items: center; }
.status { font: var(--fs-s) var(--mono); color: var(--mute); }
.status.err { color: var(--danger); }

/* auth */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .box { width: min(420px, 100%); }
.gate h1 { font-size: var(--fs-xl); line-height: 1.15; margin-bottom: 10px; }
.gate p { color: var(--mute); margin: 0 0 24px; }
.gate .btn { width: 100%; padding: 12px; }
.gate .err { color: var(--danger); font-size: 14px; margin-top: 14px; min-height: 20px; }
.qr { background: #fff; width: 220px; height: 220px; margin: 0 0 14px; padding: 6px; }
.code { font: 24px var(--mono); letter-spacing: .4em; text-align: center; }
.secret { font: var(--fs-s) var(--mono); color: var(--mute); word-break: break-all; margin-bottom: 18px; }

/* deterrents */
#veil { position: fixed; inset: 0; z-index: 90; background: rgba(8,8,9,.98); backdrop-filter: blur(30px); display: grid; place-items: center; text-align: center; color: var(--mute); }
#veil p { margin: 8px 0 20px; }
#veil[hidden] { display: none; }
#mark { position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: .09; }
#printblock { display: none; }
@media print { body > * { display: none !important; } body::before { content: "Printing is disabled."; display: block; padding: 40px; color: #000; background: #fff; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

a.btn { display: inline-block; text-decoration: none; text-align: center; }
.gate a.btn { display: block; }

.rail-search input { width: 100%; min-height: 44px; background: #0a0b0c; border: 1px solid var(--line); padding: 10px 12px; border-radius: 3px; }
.filters .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
th[aria-sort] { cursor: pointer; }
th[aria-sort="ascending"]::after { content: " ↑"; color: var(--accent); }
th[aria-sort="descending"]::after { content: " ↓"; color: var(--accent); }
.hit { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.hit:hover, .hit:focus-visible { background: var(--panel); }
.hit-t { font-family: var(--serif); font-size: 17px; }
.snip { color: var(--mute); font-size: var(--fs-b); max-width: 70ch; margin-top: 4px; }

.logo-sm { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.logo-lg { width: 112px; height: 112px; border-radius: 50%; display: block; margin: 0 0 22px; }
.gate .logo-lg + .eyebrow { margin-top: 0; }

/* documents */
.docwrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.docmain { min-width: 0; }
.doc-title { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); font: 600 28px var(--serif); padding: 4px 0 10px; margin-bottom: 14px; color: var(--ink); }
.doc-title:focus { outline: none; border-bottom-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tb { background: var(--panel); border: 1px solid var(--line); color: var(--ink); padding: 8px 10px; min-width: 44px; min-height: 44px; border-radius: 3px; cursor: pointer; font-size: var(--fs-s); }
.tb:hover { border-color: var(--mute); }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.page { -webkit-user-select: text; user-select: text; background: #f1ecde; color: #1b1a17; font: 17px/1.65 var(--serif); padding: clamp(24px, 5vw, 64px); min-height: 70vh; border-radius: 2px; overflow-wrap: anywhere; }
.page:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.page h1 { font-size: 30px; margin: 0 0 .6em; } .page h2 { font-size: 22px; margin: 1.4em 0 .4em; } .page h3 { font-size: 18px; margin: 1.2em 0 .3em; }
.page p { margin: 0 0 .8em; } .page ul, .page ol { padding-left: 1.4em; } .page blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid #b3402f; color: #4a463c; }
.page table { border-collapse: collapse; width: 100%; margin: 1em 0; } .page th, .page td { border: 1px solid #b9b19c; padding: 6px 10px; text-align: left; vertical-align: top; } .page th { background: #e3dcc7; }
.page img { max-width: 100%; height: auto; pointer-events: auto; } .page hr { border: 0; border-top: 1px solid #b9b19c; margin: 1.5em 0; }
.page a.rec { color: #8a2d20; text-decoration: underline dotted; cursor: pointer; }
.page .al-center { text-align: center; } .page .al-right { text-align: right; } .page .al-justify { text-align: justify; }
.docside { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--line); background: var(--panel); }
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--mute); padding: 12px 6px; min-height: 44px; font-size: var(--fs-s); cursor: pointer; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.sidebody { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card { border: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.card .q { margin: 0; padding-left: 8px; border-left: 2px solid var(--accent); color: var(--mute); font-size: var(--fs-s); cursor: pointer; }
.card .q.del { text-decoration: line-through; } .card .ins { color: var(--ok); }
.card .reply { border-left: 1px solid var(--line); padding-left: 8px; }
.card input, .sidebody textarea, .sidebody select { background: #0a0b0c; border: 1px solid var(--line); padding: 6px 8px; border-radius: 3px; width: 100%; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .row select { width: 120px; }
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 20px; overflow: auto; }
.modal .panel { width: min(520px, 100%); max-height: 90vh; overflow: auto; margin: 0; } .modal .panel.wide { width: min(820px, 100%); }
.modal .hit { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; color: inherit; }
@media (max-width: 960px) { .docwrap { grid-template-columns: 1fr; } .docside { position: static; max-height: none; } }

/* document view options */
.viewwrap { position: relative; display: inline-block; }
.viewmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 260px; background: var(--panel); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 12px; text-align: left; border-radius: 3px; }
.viewmenu[hidden] { display: none; }
.vgroup { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.vgroup legend { font: var(--fs-s) var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .08em; padding: 0 0 4px; width: 100%; }
.vopt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.modehint:empty { display: none; } .modehint { margin: -8px 0 12px; }
.docwrap.w-narrow .docmain .page, .docwrap.w-narrow .doc-title { max-width: 640px; }
.docwrap.w-standard .docmain .page, .docwrap.w-standard .doc-title { max-width: 820px; }
.docwrap.w-wide .docmain .page, .docwrap.w-wide .doc-title { max-width: none; }
.docwrap.t-dark .page { background: #17191c; color: #e2ddd0; box-shadow: inset 0 0 0 1px var(--line); }
.docwrap.t-dark .page th { background: #22262b; } .docwrap.t-dark .page th, .docwrap.t-dark .page td { border-color: #3a3e45; }
.docwrap.t-dark .page a.rec { color: var(--accent); } .docwrap.t-dark .page blockquote { color: var(--mute); }
.docwrap.t-sepia .page { background: #e9dcc0; color: #3a2f1c; }
.docwrap.s-s .page { font-size: 15px; } .docwrap.s-m .page { font-size: 17px; } .docwrap.s-l .page { font-size: 20px; }
.docwrap.focus { grid-template-columns: minmax(0, 1fr); } .docwrap.focus .docside { display: none; }
.docwrap.focus .docmain { margin: 0 auto; width: 100%; }

/* records */
.banner { border-top: 2px solid var(--accent); border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.banner.bad { border-top-color: var(--danger); } .banner.ok { border-top-color: var(--ok); }
.banner a { color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { border: 1px solid var(--line); padding: 14px 16px; background: var(--panel); } .stat .n { font: 600 32px var(--serif); }
.dash h2 { font-size: 18px; margin-bottom: 12px; } .panel.alertbox { border-color: var(--danger); }
.card.alert { border-color: var(--danger); }
.diff { margin: 6px 0; } .diff .q { margin: 2px 0; padding-left: 8px; border-left: 2px solid var(--danger); color: var(--mute); text-decoration: line-through; font-size: var(--fs-s); }
.diff .ins { padding-left: 8px; border-left: 2px solid var(--ok); font-size: var(--fs-s); }
.docside a { color: var(--accent); }

a.btn, .head a { color: inherit; }
.head a.btn:hover { color: var(--ink); }

.issue { font-size: var(--fs-s); } .issue::before { content: "Check: "; color: var(--accent); font-family: var(--mono); } .issue.block::before { content: "Blocked: "; color: var(--danger); }

/* full-page document canvas (word-processor layout) */
main.docmode { max-width: none; padding: 20px 0 0; }
main.docmode > .head, main.docmode > .modehint { margin-left: clamp(16px, 3vw, 40px); margin-right: clamp(16px, 3vw, 40px); }
main.docmode .docwrap { gap: 0; grid-template-columns: minmax(0, 1fr) 340px; min-height: calc(100vh - 120px); align-items: stretch; border-top: 1px solid var(--line); }
main.docmode .docwrap.nopanel, main.docmode .docwrap.focus { grid-template-columns: minmax(0, 1fr); }
main.docmode .docwrap.nopanel .docside { display: none; }
main.docmode .docmain { background: #0a0b0c; display: flex; flex-direction: column; align-items: center; padding: 0 clamp(8px, 2vw, 32px) 0; }
main.docmode .toolbar { align-self: stretch; margin: 0 calc(-1 * clamp(8px, 2vw, 32px)); padding: 8px clamp(12px, 3vw, 40px); background: var(--panel); }
main.docmode .doc-title { margin: 22px auto 14px; width: 100%; }
main.docmode .page { width: 100%; margin: 0 auto 0; min-height: max(1123px, calc(100vh - 220px)); }
main.docmode .docwrap.w-narrow .page, main.docmode .docwrap.w-narrow .doc-title { max-width: 640px; }
main.docmode .docwrap.w-standard .page, main.docmode .docwrap.w-standard .doc-title { max-width: 816px; }
main.docmode .docwrap.w-wide .page, main.docmode .docwrap.w-wide .doc-title { max-width: 1200px; }
main.docmode .stickybar { align-self: stretch; margin: 0 calc(-1 * clamp(8px, 2vw, 32px)); padding: 12px clamp(12px, 3vw, 40px); background: var(--panel); border-top: 1px solid var(--line); }
main.docmode .docside { position: sticky; top: 0; align-self: start; height: 100vh; max-height: none; border: 0; border-left: 1px solid var(--line); }
@media (max-width: 960px) { main.docmode .docwrap { grid-template-columns: 1fr; } main.docmode .docside { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- organisation layer ---------- */
.badge { background: var(--accent); color: #17130a; font: 600 11px var(--mono); padding: 0 6px; border-radius: 9px; min-width: 18px; text-align: center; }
.badge[hidden] { display: none; }
.prewrap { white-space: pre-wrap; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; max-height: 180px; overflow: auto; border: 1px solid var(--line); padding: 8px; background: #0a0b0c; }
.hit.unread .hit-t::before { content: "New · "; color: var(--accent); font: var(--fs-s) var(--mono); text-transform: uppercase; }
.tag.bad { color: var(--danger); border-color: #6b3128; }
.card.internal { border-style: dashed; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; } .filters select { background: #0a0b0c; border: 1px solid var(--line); padding: 8px 10px; border-radius: 3px; }
.docwrap2 { display: flex; flex-direction: column; }
.err { color: var(--danger); font-size: var(--fs-s); margin-top: 8px; min-height: 1em; }
.unitnode { margin-left: 0; } .unitnode .unitnode { margin: 14px 0 0 18px; padding-left: 14px; border-left: 1px solid var(--line); }
.unithead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow: auto; padding: 4px; }
.msg { border: 1px solid var(--line); padding: 10px 12px; background: var(--panel); max-width: 78%; align-self: flex-start; }
.msg.mine { align-self: flex-end; border-color: #4a3d1f; }
.thread + p + textarea, main > textarea { width: 100%; background: #0a0b0c; border: 1px solid var(--line); padding: 8px 10px; border-radius: 3px; }
.panel textarea, .modal textarea { width: 100%; background: #0a0b0c; border: 1px solid var(--line); padding: 8px 10px; border-radius: 3px; }
.panel .row input[type=text], .modal select { background: #0a0b0c; border: 1px solid var(--line); padding: 6px 8px; border-radius: 3px; }
.graph { width: 100%; height: auto; background: #0a0b0c; }
.gl { stroke: #3a3e45; stroke-width: 1; } .gl.alt { stroke: var(--danger); stroke-dasharray: 4 3; }
.gn { fill: var(--panel); stroke: var(--accent); stroke-width: 2; } .gn.case { fill: var(--accent); stroke: none; } .gn.hot { stroke: var(--danger); fill: #3a1914; }
.gt { fill: var(--ink); font: 11px var(--sans); pointer-events: none; } .graph a { cursor: pointer; } .graph a:hover .gn { stroke: var(--ink); }
.graph, .graph * { pointer-events: auto; }
.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 18px; display: flex; flex-direction: column; gap: 14px; }
.tl.event .mono::before, .tl.date .mono::before { color: var(--accent); content: "● "; } .tl.edit .mono::before { color: var(--dim); content: "○ "; }
.bars { display: grid; grid-template-columns: 80px 1fr; gap: 4px 10px; align-items: center; margin-bottom: 8px; }
.bar { display: block; padding: 2px 8px; font: var(--fs-s) var(--mono); min-width: 24px; grid-column: 2; } .bar.open { background: #3b3320; } .bar.closed { background: #26402c; }

/* ---------- public site ---------- */
.pub { min-height: 100vh; display: flex; flex-direction: column; }
.pubnav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px clamp(16px, 4vw, 56px); border-bottom: 1px solid var(--line); }
.pubnav nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; } .pubnav nav a:not(.btn) { color: var(--mute); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.pubnav nav a[aria-current="page"], .pubnav nav a:not(.btn):hover { color: var(--ink); border-bottom-color: var(--accent); }
.pubnav .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.pubmain { padding: 40px clamp(16px, 4vw, 56px) 60px; max-width: 980px; width: 100%; margin: 0 auto; flex: 1; }
.pubfoot { padding: 20px clamp(16px, 4vw, 56px); border-top: 1px solid var(--line); }
.hero { padding: 36px 0 44px; } .hero h1 { font-size: clamp(28px, 6vw, var(--fs-xl)); line-height: 1.05; margin: 8px 0 16px; max-width: 14ch; }
.hero .logo-lg { margin: 0 0 22px; max-width: 96px; } .lede { font-size: var(--fs-m); max-width: 56ch; color: var(--mute); margin: 0 0 24px; }
.panel.narrow { max-width: 640px; }
.refcode { font: 600 28px var(--mono); letter-spacing: .12em; color: var(--accent); padding: 14px 0; user-select: text; -webkit-user-select: text; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
input[type=checkbox], input[type=radio] { width: auto !important; flex: none; accent-color: var(--accent); }
.checks .vopt, .vopt { align-items: center; }

/* redaction */
.page .redact { background: rgba(196, 81, 63, .22); border-bottom: 1px dashed var(--danger); }
.page .redacted { background: #000; color: #000; user-select: none; -webkit-user-select: none; letter-spacing: -.05em; }
.docwrap.t-dark .page .redacted, .docwrap.t-sepia .page .redacted { background: #000; color: #000; }

/* ---------- page rules pass ---------- */
main:focus { outline: none; }
.mono { font-size: var(--fs-s); }
.tag { padding: 3px 8px; }
.badge { color: #17130a; }
.head p, .lede, .snip, .page { max-width: 75ch; }
.page { max-width: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* tables */
tbody th { text-align: left; font-weight: 500; padding: 14px 12px; border-bottom: 1px solid var(--line); }
td[data-label]::before { display: none; }

/* responsive */
@media (max-width: 960px) { .shell { grid-template-columns: 1fr; } .rail { position: static; max-height: none; padding: 8px 16px; } }
@media (max-width: 760px) {
  .menu-btn { display: inline-block; min-height: 44px; padding: 0 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
  .rail { display: none; background: var(--panel); border-bottom: 1px solid var(--line); }
  .rail.open { display: flex; }
  .who-name, .brand small { display: none; }
  .top-row { gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
  .who .btn { padding: 0 10px; white-space: nowrap; }
  .head > div:last-child .btn { flex: 1 1 100%; }
  table:not(.keep), table:not(.keep) thead, table:not(.keep) tbody, table:not(.keep) tr, table:not(.keep) th, table:not(.keep) td { display: block; }
  table:not(.keep) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table:not(.keep) tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table:not(.keep) th, table:not(.keep) td { border: 0; padding: 3px 0; }
  td[data-label]::before { display: inline; content: attr(data-label) ": "; font: var(--fs-s) var(--mono); color: var(--mute); text-transform: uppercase; }
  .hide-sm { display: inline-block !important; }
}
html.rm *, html.rm *::before, html.rm *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }

/* ---- cleaner shell: rail sections, tabs, command bar, account menu ---- */
.rail { padding: 20px 12px 24px 20px; gap: 2px; }
.rail a { font-size: var(--fs-b, 1rem); }
.sectabs { display: flex; flex-wrap: wrap; gap: 4px 20px; border-bottom: 1px solid var(--line); margin: -6px 0 22px; }
.sectabs a { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--mute); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sectabs a:hover { color: var(--ink); }
.sectabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.cmd-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; min-width: min(320px, 40vw); justify-content: space-between; color: var(--mute); background: #0a0b0c; border: 1px solid var(--line); }
.cmd-btn kbd, .keys kbd { font: var(--fs-s) var(--mono); border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; color: var(--mute); }
.cmd-btn + .who { margin-left: 0; }
.cmd { align-items: start; padding-top: 10vh; }
.cmd .panel { width: min(680px, 100%); }
.cmd input { width: 100%; min-height: 48px; background: #0a0b0c; border: 1px solid var(--line); padding: 10px 12px; border-radius: 3px; }
.cmd-status { min-height: 1.5em; margin: 8px 0 0; }
.cmd-item[aria-selected="true"] { background: var(--panel); box-shadow: inset 0 0 0 2px var(--accent); }
.cmd-item { display: block; }
.acct { position: relative; }
.acct > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; }
.acct > summary::-webkit-details-marker { display: none; }
.acct > summary::after { content: "\25BE"; margin-left: 8px; color: var(--mute); }
.acct-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(360px, 90vw); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 8px 0 14px; }
.acct-panel .comfort { padding: 10px 16px; border: 0; background: none; flex-direction: column; }
.acct-actions { display: flex; gap: 8px; padding: 0 16px; }
@media (max-width: 720px) { .cmd-btn { min-width: 0; flex: 1; margin-left: 0; } .cmd-btn kbd { display: none; } }
.cmd .panel { background: var(--panel); border: 1px solid var(--line); }

/* The formatting bar stays in view while a long document scrolls */
.toolbar { position: sticky; top: 0; z-index: 6; background: var(--panel, #1b1c20); }
