/* Obligation Radar v2 — single stylesheet.
   Design language: warm editorial paper, hairline borders, one serif for numbers and titles,
   one sans for the interface, one mono for micro labels. Colour carries meaning only
   (urgency, state); everything else is ink on paper.
   bg #F3F1EB · rail #ECE9E1 · card #FCFBF8 · ink #1C1B19 · green #3C7A4E · red #C1362B ·
   amber #B87A16 · steel #3E5C86 */

:root {
  --paper: #F3F1EB;
  --paper-2: #ECE9E1;
  --card: #FCFBF8;
  --card-2: #F7F5EF;
  --ink: #1C1B19;
  --ink-2: #4A4741;
  --ink-3: #6B675F;   /* was #8A867E (2.99:1) - WCAG AA fix, audit C7 2026-09-23 */
  --ink-4: #B3AFA6;
  --line: rgba(var(--ink-rgb), 0.10);
  --line-2: rgba(var(--ink-rgb), 0.18);
  --line-3: rgba(var(--ink-rgb), 0.30);
  --green: #3C7A4E;
  --green-dim: rgba(60, 122, 78, 0.11);
  --red: #C1362B;
  --red-dim: rgba(193, 54, 43, 0.10);
  --amber: #B87A16;
  --amber-dot: #C0821A;
  --amber-dim: rgba(184, 122, 22, 0.12);
  --steel: #3E5C86;
  --steel-dim: rgba(62, 92, 134, 0.11);
  --link: #B4552E;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --rail-w: 272px;
  --rail-w-min: 60px;
  --topbar-h: 56px;
  /* channels: every ink-tinted wash, scrim and shadow derives from these, so a theme
     switch only has to redefine the channel, never the hundred rules that use it */
  --ink-rgb: 28, 27, 25;
  --scrim-rgb: 28, 27, 25;
  --shadow-rgb: 28, 27, 25;
  /* "solid" = the high-contrast fill (primary button, active chip, avatar, toggle) and the
     text that sits on it. Deliberately NOT --ink: --ink flips to light in dark mode, a fill
     must not, or every active control turns light-on-light. */
  --solid: #1C1B19;
  --solid-hover: #2E2C28;
  --on-solid: #F5F3EE;
  --knob: #FFFFFF;
  --red-solid: #C1362B;      /* stays dark red in both themes: it carries white text */
  /* border- and fill-strength variants of the meaning colours (the -dim tokens are too
     faint for a 1px border or a chart polygon) */
  --green-line: rgba(60, 122, 78, 0.55);
  --red-line: rgba(193, 54, 43, 0.35);
  --amber-line: rgba(184, 122, 22, 0.35);
  --amber-line-2: rgba(184, 122, 22, 0.50);
  --steel-line: rgba(62, 92, 134, 0.35);
  --steel-fill: rgba(62, 92, 134, 0.18);
  --steel-fill-2: rgba(62, 92, 134, 0.35);
  --amber-fill: rgba(192, 130, 26, 0.14);
  --amber-fill-2: rgba(192, 130, 26, 0.30);
  --topbar-bg: rgba(243, 241, 235, 0.88);
  --shadow-1: 0 1px 2px rgba(var(--shadow-rgb), 0.04);
  --shadow-2: 0 6px 20px rgba(var(--shadow-rgb), 0.08);
  --shadow-3: 0 24px 60px rgba(var(--shadow-rgb), 0.18);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; color: var(--ink); }
a { color: var(--link); }
small { color: var(--ink-3); }
svg { display: inline-block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(var(--ink-rgb), 0.16); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.eyebrow {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3);
}
.mono { font-family: var(--font-mono); font-size: 11.5px; }
.muted { color: var(--ink-3); font-size: 12px; }

.view-center {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 16px; gap: 22px;
}

/* ---------- brand mark ---------- */
.mark { width: 30px; height: 30px; color: var(--ink); flex: 0 0 auto; }
.mark-lg { width: 56px; height: 56px; }
.radar-needle { transform-origin: 20px 20px; animation: sweep 9s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.wordmark {
  font-family: var(--font-display); font-size: 21px; letter-spacing: -0.2px; color: var(--ink);
  white-space: nowrap; line-height: 1;
}

/* ---------- buttons & fields ---------- */
.btn {
  font-family: var(--font-ui); font-weight: 500; font-size: 13px;
  border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink);
  padding: 9px 14px; cursor: pointer; line-height: 1.2;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.btn-primary:hover { background: var(--solid-hover); border-color: var(--solid-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(var(--ink-rgb), 0.06); border-color: transparent; color: var(--ink); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn .bi { width: 14px; height: 14px; }
.btn-google { background: var(--card); border-color: var(--line-2); padding: 11px 16px; font-size: 13.5px; }
.btn-google:hover { border-color: var(--ink); }

.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--ink-3); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(var(--ink-rgb), 0.07); color: var(--ink); }
.text-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--link);
}
.text-btn:hover { text-decoration: underline; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline;
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-2);
}
.link-btn:hover { color: var(--ink); }

input, select, textarea {
  background: var(--card); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: 8px; padding: 9px 12px; font-family: var(--font-ui); font-size: 13px;
  outline: none; width: 100%;
}
input::placeholder { color: var(--ink-4); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%238A867E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* ---------- auth ---------- */
.auth-card {
  width: min(400px, 100%);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 40px 36px 24px;
  box-shadow: var(--shadow-1), var(--shadow-2);
}
.auth-brand { text-align: center; margin-bottom: 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.auth-lede { font-family: var(--font-display); font-size: 16px; line-height: 1.4; color: var(--ink-2); margin: 0; max-width: 300px; }
.auth-lede em { font-style: italic; color: var(--ink); }
.auth-note { font-size: 12px; color: var(--ink-3); text-align: center; margin: 12px 0 0; line-height: 1.5; }
.auth-alt { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.auth-alt summary {
  cursor: pointer; list-style: none; text-align: center; font-size: 12px; color: var(--ink-3);
  user-select: none;
}
.auth-alt summary::-webkit-details-marker { display: none; }
.auth-alt summary:hover { color: var(--ink); }
.auth-alt[open] summary { color: var(--ink); }
#auth-alt > summary { display: none; }   /* form always open (2026-09-27) */
#auth-alt { padding-top: 6px; }
.auth-alt form { margin-top: 6px; }
.auth-alt .link-btn { display: block; margin: 12px auto 0; font-size: 11.5px; color: var(--ink-3); }
.auth-card label, #setpw-form label { display: block; margin: 12px 0 5px; }
.auth-card label, #setpw-form label, .drow label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 1.2px;
}
.auth-card form .btn-block { margin-top: 16px; }
#setpw-code { font-family: var(--font-mono); font-size: 12px; }
/* email sign-up (2026-09-27) */
.auth-seg { display: flex; gap: 4px; padding: 3px; margin: 12px 0 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); }
.auth-seg button {
  flex: 1; border: 0; background: none; border-radius: 7px; padding: 7px 10px; cursor: pointer;
  font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-3);
}
.auth-seg button:hover { color: var(--ink); }
.auth-seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.auth-switch { margin: 16px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.auth-switch .link-btn { font-size: 12.5px; color: var(--ink); }
.auth-divider { margin-top: 22px; }
.auth-fine { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; margin: 12px 0 0; }
.auth-alt form .link-btn { display: block; margin: 12px auto 0; font-size: 11.5px; color: var(--ink-3); }
.auth-preview {
  margin: 12px 0 0; text-align: center; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--amber, var(--ink-3));
}
.auth-envelope { width: 56px; height: 56px; color: var(--ink); }
.auth-steps { margin: 0 0 4px; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 9px; }
.auth-steps li { counter-increment: st; display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.auth-steps li::before {
  content: counter(st); flex: 0 0 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
}
#cm-resend { margin-top: 16px; }
#cm-email { display: block; margin-top: 6px; color: var(--ink); font-weight: 600; font-family: var(--font-ui); font-size: 14px; font-style: normal; overflow-wrap: anywhere; }
.auth-notice {
  margin-top: 14px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.45;
  background: var(--amber-dim); border: 1px solid var(--amber-line); color: var(--ink-2);
}
.auth-error {
  margin-top: 14px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.45;
  background: var(--red-dim); border: 1px solid var(--red-line); color: var(--red);
}
.auth-foot { margin-top: 18px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.mode-badge { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--ink-4); text-transform: uppercase; }
.mode-badge.supabase { color: var(--green); }
.auth-credit { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.6px; color: var(--ink-4); text-align: center; margin: 0; text-transform: uppercase; }

/* ---------- wizard ---------- */
.wizard-card {
  width: min(780px, 100%);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-1), var(--shadow-2);
}
.wizard-head { display: flex; align-items: center; gap: 16px; padding: 22px 28px; border-bottom: 1px solid var(--line); }
.wizard-titles { min-width: 0; }
.wizard-head h2 { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.2px; line-height: 1.1; }
.wizard-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 12.5px; }
.wizard-steps { margin-left: auto; display: flex; gap: 5px; flex: 0 0 auto; }
.wstep { width: 22px; height: 3px; border-radius: 3px; background: rgba(var(--ink-rgb), 0.14); transition: background .2s; }
.wstep.active { background: var(--solid); }
.wizard-body { padding: 22px 28px; min-height: 300px; max-height: 58vh; overflow-y: auto; }
.step-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.wizard-body h3 { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.1px; }
.step-hint { color: var(--ink-3); font-size: 12.5px; margin: 3px 0 0; }
.chip-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 12px; border-radius: 999px; cursor: pointer; user-select: none;
  border: 1px solid var(--line-2); background: var(--card);
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  transition: border-color .12s var(--ease), background .12s var(--ease), color .12s var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--line-3); color: var(--ink); }
.chip.on { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.chip small { font-family: var(--font-mono); font-size: 10.5px; color: inherit; opacity: .6; }
.chip-pinned { border-style: dashed; color: var(--ink-3); cursor: default; background: transparent; }
.chip.chip-soon { opacity: .6; border-style: dashed; }
.terr-details { margin-top: 16px; }
.terr-details summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); user-select: none; }
.terr-details summary:hover { color: var(--ink); }
.terr-block { border: 1px solid var(--line); background: var(--card-2); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.terr-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.terr-head strong { font-size: 13px; font-weight: 500; }
.terr-note { font-size: 11.5px; color: var(--ink-3); margin: 0 0 9px; line-height: 1.5; }
.terr-note b { color: var(--ink-2); font-weight: 500; }
.terr-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.terr-grid .chip { font-size: 12px; padding: 5px 10px; }
.terr-tag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .6px; text-transform: uppercase;
  background: var(--steel-dim); color: var(--steel); border-radius: 4px; padding: 1px 5px;
}
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.entity-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line-2); background: var(--card);
  border-radius: 10px; padding: 14px 16px; cursor: pointer;
  font-weight: 500; font-size: 13px; color: var(--ink-2);
  transition: border-color .12s var(--ease), background .12s var(--ease), color .12s var(--ease);
}
.entity-card:hover { border-color: var(--line-3); color: var(--ink); }
.entity-card.on { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.entity-icon { font-size: 18px; }
.wizard-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 28px; border-top: 1px solid var(--line); background: var(--card-2);
}
.wizard-count { margin-left: auto; color: var(--ink-3); font-size: 12px; font-family: var(--font-mono); }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail-w); flex: 0 0 auto;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--paper-2); border-right: 1px solid var(--line);
  transition: width .22s var(--ease);
  overflow: hidden;
}
.rail-top { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 16px; height: var(--topbar-h); }
.rail-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; flex: 1; }
.rail-brand .wordmark { font-size: 19px; overflow: hidden; text-overflow: ellipsis; }
.rail-toggle { margin-left: auto; }

.rail-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 10px; }
.nav-tab {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer;
  font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--ink-2); text-align: left;
  transition: background .15s var(--ease), color .15s var(--ease);
  white-space: nowrap;
}
.nav-tab svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-tab:hover { background: rgba(var(--ink-rgb), 0.06); color: var(--ink); }
.nav-tab.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); border: 1px solid var(--line); padding: 7px 9px; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-tab .np {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  background: rgba(var(--ink-rgb), 0.07); border-radius: 999px; padding: 1px 7px; margin-left: auto;
}
.nav-tab.on .np { color: var(--ink); }

.rail-filters { flex: 1; overflow-y: auto; padding: 8px 14px 16px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); }
.rail-section-head { display: flex; align-items: baseline; justify-content: space-between; padding-top: 8px; }
.search-field { position: relative; display: block; }
.search-field svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-4); pointer-events: none; }
.search-field input { padding-left: 32px; font-size: 12.5px; border-color: var(--line); background: var(--card); }
.search-field input:focus { border-color: var(--ink); }

.toggles { display: flex; flex-direction: column; gap: 6px; }
.toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 12.5px; color: var(--ink-2); padding: 2px 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .tg {
  width: 28px; height: 16px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.16); position: relative; flex: 0 0 auto;
  transition: background .15s var(--ease);
}
.toggle .tg::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--knob); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s var(--ease);
}
.toggle input:checked + .tg { background: var(--solid); }
.toggle input:checked + .tg::after { transform: translateX(12px); }
.toggle input:focus-visible + .tg { outline: 2px solid var(--ink); outline-offset: 2px; }
.toggle .tl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggle-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }

.facet { border-top: 1px solid var(--line); padding-top: 10px; }
.facet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.facet-body { display: flex; flex-direction: column; gap: 1px; }
.frow {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 6px;
  padding: 4px 6px; cursor: pointer; font-family: var(--font-ui);
  font-size: 12.5px; font-weight: 400; color: var(--ink);
  transition: background .12s var(--ease);
}
.frow:hover { background: rgba(var(--ink-rgb), 0.06); }
.frow:not(.on) { color: var(--ink-4); }
.frow-check {
  flex: 0 0 auto; width: 14px; height: 14px; border-radius: 4px;
  border: 1px solid var(--line-3); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; line-height: 1; color: var(--on-solid);
}
.frow.on .frow-check { background: var(--solid); border-color: var(--solid); }
.frow-check.partial { background: var(--card); border-color: var(--ink); color: var(--ink); font-size: 11px; }
.frow-flag { font-size: 13px; flex: 0 0 auto; }
.frow-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }
.frow-all { font-weight: 500; color: var(--ink); position: sticky; top: 0; z-index: 1; background: var(--paper-2); border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; }
.frow-all:not(.on) { color: var(--ink); }
.frow.frow-sub { padding-left: 24px; font-size: 12px; }
.facet-note { font-family: var(--font-mono); font-size: 9.5px; line-height: 1.5; color: var(--ink-4); padding: 1px 6px 6px 28px; margin-top: -2px; }
.facet-note b { color: var(--ink-3); font-weight: 500; }
.facet-note.pending { padding-left: 6px; padding-top: 8px; border-top: 1px dashed var(--line); margin-top: 6px; }
.facet-note.pending + .facet-note.pending { border-top: none; margin-top: 0; padding-top: 0; }

.rail-foot { padding: 8px 10px 12px; border-top: 1px solid var(--line); }
.rail-filter-btn { display: none; }

/* collapsed rail */
.shell.rail-collapsed .rail { width: var(--rail-w-min); }
.shell.rail-collapsed .rail-top { padding: 14px 0 10px; justify-content: center; }
.shell.rail-collapsed .rail-brand { display: none; }
.shell.rail-collapsed .rail-toggle { margin: 0; }
.shell.rail-collapsed .rail-nav { padding: 4px 10px 10px; }
.shell.rail-collapsed .nav-tab { justify-content: center; padding: 9px 0; }
.shell.rail-collapsed .nav-tab.on { padding: 8px 0; }
.shell.rail-collapsed .nav-label, .shell.rail-collapsed .nav-tab .np { display: none; }
.shell.rail-collapsed .rail-filters { display: none; }
.shell.rail-collapsed .rail-filter-btn { display: flex; }
.shell.rail-collapsed .rail-foot { margin-top: auto; }
.rail-filter-btn.has-filters svg { color: var(--green); }

/* stage */
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h); padding: 0 24px;
  position: sticky; top: 0; z-index: 400;
  background: var(--topbar-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-menu { display: none; }
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-title h1 { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.2px; line-height: 1; white-space: nowrap; }
.topbar-title small { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-summary { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 6px; }
.ps-chip {
  font-size: 11.5px; font-weight: 500; padding: 4px 10px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-2);
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.ps-chip:hover { border-color: var(--ink); color: var(--ink); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.usermenu { position: relative; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--solid); color: var(--on-solid); font-family: var(--font-display); font-size: 16px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  text-transform: uppercase; line-height: 1;
}
.avatar:hover { box-shadow: 0 0 0 3px rgba(var(--ink-rgb), 0.10); }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 500;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow-3);
}
.usermenu-who {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.usermenu-item {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 7px;
  padding: 8px 10px; cursor: pointer; font-family: var(--font-ui); font-size: 13px; color: var(--ink);
}
.usermenu-item:hover { background: rgba(var(--ink-rgb), 0.06); }

.content { padding: 22px 24px 8px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
#pane-radar, #pane-register { display: flex; flex-direction: column; gap: 18px; }
.block { min-width: 0; }
.block-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.block-head h3 { font-family: var(--font-display); font-size: 19px; letter-spacing: -0.1px; display: inline-flex; align-items: center; gap: 8px; }
.list-head { justify-content: space-between; }
.count-pill { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-3); background: rgba(var(--ink-rgb), 0.06); border-radius: 999px; padding: 2px 8px; }
.list-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.list-tools select { width: auto; padding: 6px 28px 6px 10px; font-size: 12px; border-radius: 7px; border-color: var(--line); background-color: transparent; color: var(--ink-2); }
.list-tools select:hover { border-color: var(--line-3); }
.active-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 11.5px; }
.active-filters span { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); padding: 3px 9px; border-radius: 999px; font-weight: 500; }

/* timeline */
.timeline { display: flex; align-items: stretch; gap: 4px; height: 118px; }
.tl-col {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  gap: 5px; cursor: pointer; border-radius: 8px; padding: 4px 2px 6px; min-width: 0;
  transition: background .12s var(--ease);
}
.tl-col:hover { background: rgba(var(--ink-rgb), 0.05); }
.tl-col.focused { background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-1); }
.tl-count { font-family: var(--font-display); font-size: 14px; color: var(--ink-2); line-height: 1; min-height: 14px; }
.tl-bar { width: 100%; max-width: 40px; border-radius: 3px 3px 1px 1px; background: var(--ink); min-height: 2px; opacity: .85; }
.tl-col.peak .tl-bar { background: var(--amber-dot); opacity: 1; }
.tl-col.live .tl-bar { background: var(--ink-4); }
.tl-label { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4); text-align: center; line-height: 1.25; min-height: 24px; letter-spacing: 0.2px; }
.tl-col.peak .tl-label { color: var(--amber); }
.tl-col.focused .tl-label { color: var(--ink); }

/* cards */
.reg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.reg-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px 12px; cursor: pointer;
  transition: box-shadow .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
  display: flex; flex-direction: column; gap: 8px; position: relative; min-width: 0;
}
.reg-card:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); transform: translateY(-1px); }
.reg-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.reg-flag { font-size: 14px; line-height: 1; }
.reg-country { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-2); }
.reg-theme {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .3px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}
.reg-theme::before { content: "·"; margin-right: 6px; color: var(--ink-4); }
.badge {
  font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .5px;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap; text-transform: uppercase;
}
.badge-new { background: var(--green-dim); color: var(--green); }
.badge-watch { background: var(--steel-dim); color: var(--steel); }
.badge-verified { background: var(--green-dim); color: var(--green); }
.badge-register { background: var(--steel-dim); color: var(--steel); }
.badge-changed { background: var(--amber-dim); color: var(--amber); }
.badge-reviewed { background: rgba(var(--ink-rgb), 0.07); color: var(--ink-2); }
.badge-unclassified { background: var(--amber-dim); color: var(--amber); }
.badge-probable { background: transparent; color: var(--green); border: 1px dashed var(--green-line); }
.badge-removed { background: var(--red-dim); color: var(--red); }
.badge-superseded { background: var(--steel-dim); color: var(--steel); }
.reg-card h4 {
  font-size: 13.5px; font-weight: 500; line-height: 1.4; color: var(--ink); letter-spacing: -0.1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.reg-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.reg-regulator { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dchip {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; padding: 3px 8px; border-radius: 999px;
  white-space: nowrap; letter-spacing: 0.1px; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
}
.dchip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dchip.hot { background: var(--red-dim); color: var(--red); }
.dchip.warn { background: var(--amber-dim); color: var(--amber); }
.dchip.ok { background: var(--green-dim); color: var(--green); }
.dchip.live { background: rgba(var(--ink-rgb), 0.06); color: var(--ink-2); }
.dchip.tbd { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-2); }
.dchip.tbd::before { display: none; }
/* a superseded chip can name a long title (an unnumbered replacing instrument, 2026-09-24): wrap, never overflow the card */
.dchip.tbd, .due.tbd { white-space: normal; max-width: 100%; }
.review-toggle {
  margin-left: auto; flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 6px; padding: 0;
  font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: transparent;
  transition: border-color .12s, background .12s, color .12s, opacity .12s;
  opacity: 0;
}
.reg-card:hover .review-toggle, .review-toggle.on, .review-toggle:focus-visible { opacity: 1; }
.review-toggle:hover { border-color: var(--ink); color: var(--ink); }
.review-toggle.on { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.reg-card.reviewed { opacity: 0.5; }
.reg-card.reviewed:hover { opacity: 0.85; }
.reg-card.in-register { border-color: var(--steel-line); }
.reg-card.in-register::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 2px; background: var(--steel); border-radius: 2px; }
.reg-card.superseded { opacity: 0.55; }
.reg-card.superseded:hover { opacity: 0.9; }
.reg-card.superseded h4 { text-decoration: line-through; text-decoration-color: var(--ink-4); }
.prob { font-family: var(--font-mono); font-size: 10px; letter-spacing: .3px; padding: 1px 5px; border-radius: 3px; color: var(--green); border: 1px dashed var(--green-line); cursor: help; }
.prob-removed { color: var(--amber); border-color: var(--amber-line-2); text-decoration: line-through; }

.empty-state, .empty-reg {
  grid-column: 1/-1; text-align: center; color: var(--ink-3); padding: 44px 16px; font-size: 13px; line-height: 1.7;
  border: 1px dashed var(--line-2); border-radius: 12px;
}
.empty-state .btn { margin-top: 12px; }

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--ink-4); font-size: 10.5px; padding: 18px 24px 16px;
  font-family: var(--font-mono); letter-spacing: 0.2px;
}

/* ---------- drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(var(--scrim-rgb), 0.28); z-index: 900; backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 950;
  width: min(820px, 96vw);
  background: var(--paper); border-left: 1px solid var(--line-2);
  border-top: 3px solid var(--green);
  transform: translateX(103%); transition: transform .22s var(--ease);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-3);
}
.drawer.open { transform: translateX(0); }
/* expanded: centred, near full-screen, same drawer, same content (2026-09-22, Daniel's UX ask) */
.drawer.expanded {
  top: 20px; bottom: 20px; right: 50%; width: min(1180px, calc(100vw - 40px));
  transform: translateX(50%) translateY(6px); border-radius: 16px; border-left: 1px solid var(--line-2);
  transition: transform .22s var(--ease), width .22s var(--ease), top .22s var(--ease), bottom .22s var(--ease);
}
.drawer.expanded.open { transform: translateX(50%) translateY(0); }
.drawer.expanded .drawer-body { padding: 26px 40px 40px; }
.drawer.expanded .dcols { grid-template-columns: 1fr 1fr; }
.drawer-tools { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.drawer-nav { display: flex; align-items: center; gap: 0; margin-right: 6px; padding-right: 8px; border-right: 1px solid var(--line); }
.drawer-nav .flip { transform: scaleX(-1); }
.drawer-pos { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); min-width: 64px; text-align: center; white-space: nowrap; letter-spacing: .3px; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.drawer-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.drawer-badges .reg-country { font-size: 12px; }
.drawer-close { margin-left: 0; }
.drawer-body { padding: 22px 26px 32px; overflow-y: auto; }
.drawer-body h3 { font-family: var(--font-display); font-size: 24px; font-weight: 400; line-height: 1.25; letter-spacing: -0.2px; margin-bottom: 18px; }
.drow { margin-bottom: 14px; }
.drow label { display: block; margin-bottom: 4px; }
.drow div { font-size: 13px; line-height: 1.6; white-space: pre-line; color: var(--ink-2); }
.decide { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 20px; box-shadow: var(--shadow-1); }
.decide .assess-h { margin-bottom: 10px; }
.assess-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.assess-h, .diffbox .dl, .note .nh, .stat .k, .rtable thead th, .hz .hzl {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-3);
}
.assess-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 6px 12px;
  cursor: pointer; font-family: var(--font-ui); font-size: 12px; font-weight: 500; color: var(--ink-2);
  transition: border-color .12s var(--ease), background .12s var(--ease), color .12s var(--ease);
}
.seg button:hover { border-color: var(--line-3); color: var(--ink); }
.seg button.on { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.seg button.on[data-v="na"] { background: var(--ink-3); border-color: var(--ink-3); }
.meta-strip { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 18px; }
.meta-chip { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.5; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; color: var(--ink-2); }
.meta-chip b { color: var(--ink-4); font-weight: 500; text-transform: uppercase; letter-spacing: .6px; margin-right: 6px; font-size: 9px; }
.dcols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; align-items: start; }
.dcols .drow { margin-bottom: 15px; }
.drawer .btn-block { margin: 6px 0 4px; }
.assess { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.notefeed { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.note { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.note .nh { margin-bottom: 4px; display: flex; gap: 10px; }
.note .nb { font-size: 12.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; }
.note .nx { margin-left: auto; background: none; border: none; color: var(--ink-4); cursor: pointer; font-size: 13px; padding: 0; line-height: 1; }
.note .nx:hover { color: var(--red); }
.diffbox { background: var(--amber-dim); border: 1px solid var(--amber-line); border-radius: 10px; padding: 11px 13px; font-size: 12.5px; margin-bottom: 16px; }
.diffbox .dl { color: var(--amber); margin-bottom: 6px; }
.diffbox s { color: var(--ink-3); }
.drawer textarea { resize: vertical; min-height: 68px; }
.decide-note { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin: 8px 0 0; line-height: 1.5; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.stamp { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); line-height: 1.6; }

/* ---------- register ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 10px; box-shadow: var(--shadow-1); }
.stat .v { font-family: var(--font-display); font-size: 30px; line-height: 1; margin-top: 6px; color: var(--ink); letter-spacing: -0.5px; }
.stat.hot .v { color: var(--red); } .stat.warn .v { color: var(--amber); } .stat.ok .v { color: var(--green); } .stat.steel .v { color: var(--steel); }
.sync-status { display: block; font-size: 11px; color: var(--ink-4); margin: -8px 0 0; min-height: 14px; font-family: var(--font-mono); }
.sync-status.ok { color: var(--green); }
.sync-status.warn { color: var(--amber); }
.alert { display: flex; gap: 12px; align-items: flex-start; background: var(--amber-dim); border: 1px solid var(--amber-line); border-radius: 12px; padding: 13px 16px; margin-bottom: 14px; }
.alert.muted { opacity: .85; }
.alert h4 { font-size: 13.5px; font-weight: 500; margin-bottom: 2px; }
.alert p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.alert .btn { margin-left: auto; flex: 0 0 auto; }
.gone-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; }

.horizon { display: flex; gap: 6px; align-items: flex-end; min-height: 92px; }
.hz { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; border-radius: 8px; padding: 4px 2px; transition: background .12s var(--ease); }
.hz:hover { background: rgba(var(--ink-rgb), .05); }
.hz.on { background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-1); }
.hz .hzn { font-family: var(--font-display); font-size: 14px; color: var(--ink-2); line-height: 1; }
.hz .hzb { width: 100%; max-width: 64px; border-radius: 3px 3px 1px 1px; min-height: 3px; background: var(--ink); opacity: .85; }
.hz.b-over .hzb, .hz.b-30 .hzb { background: var(--red); }
.hz.b-90 .hzb { background: var(--amber-dot); }
.hz.b-180 .hzb { background: var(--green); }
.hz.b-later .hzb { background: var(--ink-4); }
.hz.b-tbd .hzb { background: var(--steel); }
.hz .hzl { font-size: 9px; letter-spacing: .5px; text-align: center; line-height: 1.3; }

.viewseg { display: inline-flex; gap: 0; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--card); }
.viewseg button {
  border: 0; background: transparent; border-radius: 999px; padding: 5px 12px;
  cursor: pointer; font-family: var(--font-ui); font-size: 12.5px; font-weight: 500; color: var(--ink-3);
}
.viewseg button.on { background: var(--solid); color: var(--on-solid); }
.viewseg .mono { font-size: 11px; opacity: .7; margin-left: 5px; }

.rtable { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rtable thead th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card-2); }
.rtable tbody tr { border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s var(--ease); }
.rtable tbody tr:last-child { border-bottom: 0; }
.rtable tbody tr:hover { background: rgba(var(--ink-rgb), .03); }
.rtable td { padding: 11px 12px; vertical-align: middle; }
.rtable td.tname { max-width: 420px; }
.tname .n { font-weight: 500; line-height: 1.4; }
.tname .m { font-size: 11px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tname .m .reg-theme::before { display: none; }
.rtable .flag { font-size: 14px; margin-right: 6px; }
.due { font-family: var(--font-mono); font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.due.hot { background: var(--red-dim); color: var(--red); }
.due.warn { background: var(--amber-dim); color: var(--amber); }
.due.ok { background: var(--green-dim); color: var(--green); }
.due.live { background: rgba(var(--ink-rgb), 0.06); color: var(--ink-2); }
.due.tbd { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-2); }
.notedot { color: var(--link); font-family: var(--font-mono); font-size: 11px; }
.lastnote { font-size: 12px; color: var(--ink-2); font-style: italic; }
.lastnote.none { color: var(--ink-4); font-style: normal; }

/* ---------- dropdown (details-based, no JS to open) ---------- */
.dd { position: relative; }
.dd > summary { list-style: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary .bi { transform: rotate(90deg); width: 12px; height: 12px; }
.dd[open] > summary { border-color: var(--ink); }
.dd-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 500; min-width: 300px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-3);
}
.dd-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; font-family: var(--font-ui); color: var(--ink); }
.dd-item:hover { background: rgba(var(--ink-rgb), 0.06); }
.dd-item b { display: block; font-weight: 500; font-size: 13px; }
.dd-item small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; line-height: 1.4; white-space: normal; }
.dd-item:disabled { opacity: .4; cursor: not-allowed; }
.rtable td.tname { min-width: 240px; }
.row-acts { display: inline-flex; gap: 10px; margin-left: 4px; }
.row-act { background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font-ui); font-size: 11px; color: var(--ink-4); text-decoration: underline dotted; text-underline-offset: 2px; }
.rtable tbody tr:hover .row-act { color: var(--ink-3); }
.row-act:hover { color: var(--ink) !important; }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(var(--scrim-rgb), .32); z-index: 960; display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(2px); }
.modal { width: min(680px, 100%); max-height: 88vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-3); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-family: var(--font-display); font-size: 22px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 22px 6px; }
.modal-foot { padding: 14px 22px 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal-foot .sp { margin-left: auto; }
.optrow { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); background: var(--card-2); border-radius: 10px; padding: 12px 14px; cursor: pointer; margin-bottom: 8px; transition: border-color .12s var(--ease); }
.optrow:hover { border-color: var(--line-3); }
.optrow.on { border-color: var(--ink); background: var(--card); }
.optrow .rad { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-3); flex: 0 0 auto; margin-top: 3px; }
.optrow.on .rad { border-color: var(--ink); border-width: 4.5px; }
.optrow b { font-size: 13px; display: block; font-weight: 500; }
.optrow small { color: var(--ink-3); font-size: 12px; }
.callout { border-left: 2px solid var(--green); background: var(--green-dim); padding: 10px 13px; border-radius: 0 9px 9px 0; font-size: 12.5px; margin-top: 12px; color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .profile-summary { display: none; }
}
@media (max-width: 900px) {
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 800; height: 100vh;
    width: min(300px, 86vw) !important; transform: translateX(-102%);
    transition: transform .22s var(--ease); box-shadow: var(--shadow-3);
  }
  .shell.rail-open .rail { transform: translateX(0); }
  .rail-scrim { position: fixed; inset: 0; background: rgba(var(--scrim-rgb), 0.3); z-index: 790; }
  .rail-toggle { display: none; }
  .shell.rail-collapsed .rail-brand { display: flex; }
  .shell.rail-collapsed .rail-top { padding: 14px 12px 10px 16px; justify-content: flex-start; }
  .shell.rail-collapsed .nav-label, .shell.rail-collapsed .nav-tab .np { display: initial; }
  .shell.rail-collapsed .nav-tab { justify-content: flex-start; padding: 8px 10px; }
  .shell.rail-collapsed .rail-filters { display: flex; }
  .shell.rail-collapsed .rail-filter-btn { display: none; }
  .topbar-menu { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px 16px 8px; }
  .timeline { height: 100px; }
  .tl-label { font-size: 8.5px; }
  .dcols { grid-template-columns: 1fr; }
  #reg-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rtable { min-width: 640px; }
  .rtable td.tname { max-width: 260px; }
  .drawer { width: 100vw; }
  .drawer.expanded { top: 0; bottom: 0; right: 0; width: 100vw; transform: none; border-radius: 0; }
  .drawer.expanded.open { transform: none; }
  .drawer.expanded .drawer-body { padding: 22px 20px 32px; }
  .drawer.expanded .dcols { grid-template-columns: 1fr; }
  .drawer-pos { min-width: 0; }
  .auth-card { padding: 32px 22px 20px; }
  .wizard-head, .wizard-body, .wizard-foot { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .radar-needle { animation: none; }
  .rail, .drawer, .reg-card { transition: none; }
}

/* ---------- v2 accounts (2026-09-22): bell, settings, reset ---------- */
.bell { position: relative; }
.bell-btn { position: relative; }
.bell-badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--red-solid); color: #F5F3EE; font-family: var(--font-mono);
  font-size: 9.5px; line-height: 16px; text-align: center; border: 2px solid var(--paper);
}
.bell-btn.has-unread { color: var(--ink); }
.bell-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(400px, calc(100vw - 32px)); z-index: 500;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow-3); display: flex; flex-direction: column; max-height: min(560px, 80vh);
}
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 17px; }
.bell-list { overflow-y: auto; padding: 4px 0; }
.bell-empty { padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.bell-run { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-4); padding: 10px 14px 4px; }
.bell-item {
  display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 14px 11px; cursor: pointer;
  font-family: var(--font-ui); color: var(--ink);
}
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: rgba(var(--ink-rgb), 0.04); }
.bell-item .dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; background: var(--ink-4); }
.bell-item.unread .dot { background: var(--amber-dot); }
.bell-item .kind { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase; }
.bell-item .kind.new { color: var(--green); } .bell-item .kind.changed { color: var(--amber); }
.bell-item .kind.deadline { color: var(--red); } .bell-item .kind.superseded, .bell-item .kind.removed { color: var(--steel); } .bell-item .kind.system { color: var(--ink-3); }
.bell-item .t { font-size: 12.5px; font-weight: 500; line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bell-item.unread .t { color: var(--ink); } .bell-item:not(.unread) .t { color: var(--ink-2); font-weight: 400; }
.bell-item .b { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.bell-item .b s { color: var(--ink-4); }
.bell-foot { border-top: 1px solid var(--line); padding: 9px 14px; font-size: 12px; }

#pane-settings { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
#pane-profile { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.prof-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 12px; }
.prof-chips .pc { font-size: 12px; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; color: var(--ink-2); background: var(--card); }
.prof-chips .pc.k { border-style: dashed; color: var(--ink-3); }
.prof-queue-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.prof-queue-row:hover .t { text-decoration: underline; }
.prof-queue-row .m { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); letter-spacing: .3px; }
.prof-queue-row .t { font-size: 13px; font-weight: 500; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prof-more { display: flex; gap: 10px; align-items: center; padding: 12px 0 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.prof-more .btn { margin-left: auto; }
.prof-empty { padding: 14px 0 12px; color: var(--ink-3); font-size: 12.5px; border-top: 1px solid var(--line); }
.prof-cov { display: flex; flex-direction: column; padding-bottom: 8px; }
.cov-row { display: grid; grid-template-columns: 200px 1fr 150px; gap: 14px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.cov-row .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cov-row .bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(var(--ink-rgb), .07); }
.cov-row .bar i { display: block; height: 100%; }
.cov-row .bar .r { background: var(--steel); } .cov-row .bar .d { background: var(--ink-4); } .cov-row .bar .u { background: var(--amber-dot); }
.cov-row .n { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); text-align: right; white-space: nowrap; }
.cov-row .n b { color: var(--ink-2); font-weight: 500; }
.cov-legend { display: flex; gap: 14px; padding: 6px 0 8px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.cov-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.spider { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 18px; align-items: center; padding: 6px 0 12px; }
.spider svg { width: 100%; max-width: 520px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.spider .grid { fill: none; stroke: var(--ink); stroke-opacity: .10; }
.spider .axis { stroke: var(--ink); stroke-opacity: .12; }
.spider .lbl { font-family: var(--font-ui); font-size: 10.5px; fill: var(--ink-2); }
.spider .lbl.n { font-family: var(--font-mono); font-size: 9px; fill: var(--ink-4); }
.spider .poly-app { fill: rgba(var(--ink-rgb), .05); stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 3 3; }
.spider .poly-reg { fill: var(--steel-fill); stroke: var(--steel); stroke-width: 1.5; }
.spider .poly-und { fill: var(--amber-fill); stroke: var(--amber-dot); stroke-width: 1.5; }
.spider .dot-reg { fill: var(--steel); } .spider .dot-und { fill: var(--amber-dot); }
.spider-legend { display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.spider-legend span { display: flex; align-items: center; gap: 8px; }
.spider-legend i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.spider-legend i.app { border: 1px dashed var(--ink-3); background: rgba(var(--ink-rgb), .05); }
.spider-legend i.reg { background: var(--steel-fill-2); border: 1px solid var(--steel); }
.spider-legend i.und { background: var(--amber-fill-2); border: 1px solid var(--amber-dot); }
.spider-legend small { color: var(--ink-4); font-size: 11px; }
@media (max-width: 700px) { .spider { grid-template-columns: 1fr; } .spider-legend { flex-direction: row; flex-wrap: wrap; gap: 8px 14px; } }
.sugg { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.sugg .why { flex: 1; font-size: 13px; }
.sugg .why small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
@media (max-width: 700px) {
  .cov-row { grid-template-columns: 1fr; gap: 6px; }
  .cov-row .n { text-align: left; }
  .sugg { flex-wrap: wrap; }
}
.settings-block { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 6px; box-shadow: var(--shadow-1); }
.settings-block .block-head { align-items: baseline; }
.block-hint { font-size: 12.5px; color: var(--ink-3); flex-basis: 100%; margin-top: -6px; }
.settings-rows { display: flex; flex-direction: column; }
.srow { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.srow-main { flex: 1; min-width: 0; }
.srow-main b { display: block; font-weight: 500; font-size: 13.5px; }
.srow-main small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; line-height: 1.45; overflow-wrap: anywhere; }
.srow-toggle { cursor: pointer; }
.srow-toggle .toggle { padding: 0; }
.srow.sub { padding-left: 18px; }
.srow-group.off { opacity: .45; pointer-events: none; }
.text-input {
  font-family: var(--font-ui); font-size: 13px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 11px; min-width: 200px;
}
.text-input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.srow .text-input { width: 260px; max-width: 45%; flex: 0 0 auto; }
.pill-chip { font-family: var(--font-mono); font-size: 10.5px; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; color: var(--ink-2); }
.settings-block.danger { border-color: var(--red-line); }
.settings-block.danger h3 { color: var(--red); }
.btn-danger { background: var(--red-solid); border-color: var(--red-solid); color: #F5F3EE; }
.btn-danger:hover { background: #A52D23; border-color: #A52D23; }
.btn-danger:disabled { background: var(--red-solid); border-color: var(--red-solid); }
.modal-sm { width: min(520px, 100%); }
.warnbox { display: flex; gap: 12px; align-items: flex-start; background: var(--red-dim); border: 1px solid var(--red-line); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.warnbox .bi { width: 20px; height: 20px; color: var(--red); flex: 0 0 auto; margin-top: 1px; }
.warnbox b { color: var(--ink); font-weight: 500; }
.reset-summary { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.7; }
.reset-hint { font-size: 12.5px; color: var(--ink-2); margin: 14px 0 6px; }
.reset-hint b { font-family: var(--font-mono); font-weight: 600; }
#reset-confirm { width: 100%; font-family: var(--font-mono); letter-spacing: 2px; text-transform: uppercase; }
.reset-error { color: var(--red); font-size: 12.5px; margin: 8px 0 0; }
@media (max-width: 600px) {
  .bell-pop { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) + 6px); width: auto; max-height: min(70vh, 560px); }
  .srow { flex-wrap: wrap; }
  .srow .text-input { min-width: 0; width: 100%; max-width: none; }
}

/* ---------- dark theme (2026-09-22) ----------
   Same warm editorial language, inverted: near-black paper instead of cream, the meaning
   colours lifted until they hold their contrast on a dark ground. Applied by `data-theme`
   on <html>, set before first paint by the inline script in index.html. */
:root[data-theme="dark"] {
  --paper: #1A1917;
  --paper-2: #141311;
  --card: #201E1B;
  --card-2: #262421;
  --ink: #EDEAE2;
  --ink-2: #C0BAAE;
  --ink-3: #8F8A80;
  --ink-4: #66615A;
  --ink-rgb: 237, 234, 226;
  --scrim-rgb: 0, 0, 0;
  --shadow-rgb: 0, 0, 0;
  --green: #6FB183;
  --green-dim: rgba(111, 177, 131, 0.15);
  --red: #E8776B;
  --red-dim: rgba(232, 119, 107, 0.15);
  --amber: #D9A63F;
  --amber-dot: #D9A63F;
  --amber-dim: rgba(217, 166, 63, 0.16);
  --steel: #8AAAD8;
  --steel-dim: rgba(138, 170, 216, 0.15);
  --link: #E09468;
  --green-line: rgba(111, 177, 131, 0.55);
  --red-line: rgba(232, 119, 107, 0.40);
  --amber-line: rgba(217, 166, 63, 0.40);
  --amber-line-2: rgba(217, 166, 63, 0.55);
  --steel-line: rgba(138, 170, 216, 0.40);
  --steel-fill: rgba(138, 170, 216, 0.22);
  --steel-fill-2: rgba(138, 170, 216, 0.40);
  --amber-fill: rgba(217, 166, 63, 0.18);
  --amber-fill-2: rgba(217, 166, 63, 0.35);
  --topbar-bg: rgba(26, 25, 23, 0.88);
  --solid: #EDEAE2;
  --solid-hover: #FFFFFF;
  --on-solid: #1A1917;
  --knob: #1A1917;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.42);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.60);
  color-scheme: dark;
}
/* theme control: a switch, so it reads as one at a glance. The knob slides to the side
   that is active and the icon under it takes full ink; the other side stays muted. Both
   states work in both themes because the knob is --card against a wash of --ink. */
.theme-switch { background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; flex: 0 0 auto; }
.ts-track {
  position: relative; display: inline-flex; align-items: center; gap: 0;
  width: 52px; height: 26px; border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.08); border: 1px solid var(--line-2);
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.theme-switch:hover .ts-track { border-color: var(--line-3); }
.theme-switch:focus-visible .ts-track { outline: 2px solid var(--ink); outline-offset: 2px; }
.ts-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease);
}
.theme-switch[aria-checked="true"] .ts-knob { transform: translateX(24px); }
.ts-ico { position: relative; z-index: 1; width: 13px; height: 13px; flex: 0 0 auto; transition: color .15s var(--ease); }
.ts-ico.sun { margin-left: 5.5px; }
.ts-ico.moon { margin-left: 12px; }
/* the icon sitting on the knob is the live one */
.theme-switch[aria-checked="false"] .sun { color: var(--ink); }
.theme-switch[aria-checked="false"] .moon { color: var(--ink-4); }
.theme-switch[aria-checked="true"] .sun { color: var(--ink-4); }
.theme-switch[aria-checked="true"] .moon { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .ts-knob { transition: none; } }

/* =====================================================================================
   v3 look (2026-09-23): the website's visual language brought into the app.
   Same tokens, same meaning colours. What changes: a paper grain, layered "card" shadows with
   an inset highlight, panels on a soft vertical gradient, pill buttons, mono code chips instead
   of emoji flags (Windows has no flag glyphs), urgency dots with a halo ring, the ink sign-in
   screen that the site's last block leads into, line icons in the profile wizard, and the
   drawer laid out as the site's "one row" record. Everything below overrides earlier rules;
   nothing above was deleted, so this layer can be removed in one cut.
   ===================================================================================== */
:root {
  --shadow-card: 0 1px 0 rgba(255,255,255,.75) inset, 0 1px 2px rgba(28,27,25,.04), 0 28px 60px -36px rgba(28,27,25,.30);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.75) inset, 0 2px 4px rgba(28,27,25,.05), 0 18px 36px -22px rgba(28,27,25,.32);
  --panel: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  --ink-ground: #1C1B19;
  --milk: #F5F3EE;
  --milk-2: rgba(245,243,238,.66);
  --milk-3: rgba(245,243,238,.40);
  --r-card: 16px;
  --r-panel: 20px;
}
:root[data-theme="dark"] {
  --shadow-card: 0 1px 0 rgba(255,255,255,.04) inset, 0 1px 2px rgba(0,0,0,.30), 0 28px 60px -30px rgba(0,0,0,.75);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.05) inset, 0 2px 4px rgba(0,0,0,.35), 0 18px 36px -20px rgba(0,0,0,.8);
  --ink-ground: #121110;
}

/* paper grain: one static texture, never repainted */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 2000; opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::before { opacity: .07; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
::selection { background: rgba(193,54,43,.18); }

/* ---------- shared atoms ---------- */
.code {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 17px; padding: 0 5px;
  border-radius: 5px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; font-style: normal;
  letter-spacing: .4px; line-height: 1; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line);
  flex: 0 0 auto; vertical-align: middle;
}
.chip.on .code, .entity-card.on .code { background: rgba(245,243,238,.14); border-color: transparent; color: inherit; }
:root[data-theme="dark"] .chip.on .code { background: rgba(26,25,23,.12); }
.btn, .btn-sm, .dd > summary.btn { border-radius: 999px; }
.btn { padding: 9px 16px; }
.btn-sm { padding: 6px 12px; }
.btn-primary { box-shadow: 0 10px 24px -14px rgba(var(--shadow-rgb), .7); }
:root[data-theme="dark"] .btn-primary { box-shadow: none; }
.btn:not(.btn-ghost):not(.btn-primary):not(.btn-danger) { background: var(--card); }
.icon-btn { border-radius: 999px; }
input, select, textarea, .text-input { border-radius: 10px; }
.list-tools select { border-radius: 999px; padding-left: 12px; }
.search-field input { border-radius: 999px; }

/* ---------- sign in: the ink block the website ends on ---------- */
/* every sign-in / sign-up screen shares the ink block (2026-09-27: the new screens had been left on paper, hiding the light-coloured logo, pill and credit) */
#view-login, #view-setpw, #view-signup, #view-checkmail, #view-confirm, #view-forgot { position: relative; background: var(--ink-ground); overflow: hidden; isolation: isolate; }
#view-login::before, #view-setpw::before, #view-signup::before, #view-checkmail::before, #view-confirm::before, #view-forgot::before {
  content: ""; position: absolute; left: 50%; top: 42%; width: 1100px; height: 720px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(245,243,238,.11), transparent 72%); pointer-events: none; z-index: -1;
}
.auth-back {
  position: absolute; top: 22px; left: 26px; display: inline-flex; align-items: center; gap: 10px;
  color: var(--milk-2); text-decoration: none; font-family: var(--font-display); font-size: 19px; transition: color .2s var(--ease);
}
.auth-back:hover { color: var(--milk); }
.auth-back .mark { width: 24px; height: 24px; color: currentColor; }
.auth-back small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--milk-3); margin-left: 4px; }
.auth-card {
  width: min(420px, 100%); border-radius: 24px; padding: 42px 38px 26px; border: 1px solid rgba(255,255,255,.08);
  background: var(--panel); box-shadow: 0 40px 90px -40px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.5) inset;
}
:root[data-theme="dark"] .auth-card { border-color: rgba(255,255,255,.07); box-shadow: 0 40px 90px -40px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.05) inset; }
.auth-brand { gap: 14px; margin-bottom: 30px; }
.auth-brand .wordmark { font-size: 24px; }
.auth-lede { font-size: 23px; line-height: 1.15; color: var(--ink); max-width: 320px; letter-spacing: -.01em; }
.auth-lede em { font-style: italic; }
.btn-google { border-radius: 999px; padding: 13px 18px; font-size: 14px; box-shadow: var(--shadow-1); }
.auth-credit { color: var(--milk-3); }
.auth-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 999px;
  border: 1px solid rgba(245,243,238,.14); color: var(--milk-2);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
}
.live-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #3C7A4E; flex: 0 0 auto; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid #3C7A4E; opacity: 0; animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }

/* short screens (a 768px-tall laptop): the sign-up card must fit without scrolling (2026-09-27) */
@media (max-height: 900px) {
  .view-center { padding: 18px 16px; gap: 12px; }
  .auth-card { padding: 26px 34px 18px; }
  .auth-brand { gap: 8px; margin-bottom: 16px; }
  .auth-brand .mark-lg { width: 42px; height: 42px; }
  .auth-brand .wordmark { font-size: 22px; }
  .auth-lede { font-size: 19px; }
  .auth-card label, #setpw-form label { margin: 9px 0 4px; }
  .auth-card input { padding-top: 8px; padding-bottom: 8px; }
  .auth-card form .btn-block { margin-top: 12px; }
  .auth-fine { margin-top: 8px; }
  .auth-divider { margin-top: 14px; padding-top: 8px; }
  .auth-switch { margin-top: 10px; }
  .auth-preview { margin-top: 8px; }
  .auth-steps { gap: 6px; }
}

/* ---------- profile wizard ---------- */
.wizard-card { border-radius: 24px; background: var(--panel); box-shadow: var(--shadow-card); border-color: var(--line); }
.wizard-head { padding: 24px 30px; }
.wizard-head h2 { font-size: 30px; font-weight: 400; letter-spacing: -.02em; }
.wizard-head p { font-size: 13px; }
.wstep { width: 28px; height: 4px; }
.wizard-body { padding: 26px 30px; }
.wizard-body h3 { font-size: 26px; font-weight: 400; letter-spacing: -.015em; }
.chip { padding: 6px 12px 6px 7px; font-size: 13px; background: var(--card); }
.chip:not(:has(.code)) { padding-left: 12px; }
.chip.on { box-shadow: 0 8px 18px -12px rgba(var(--shadow-rgb), .8); }
.entity-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.entity-card { border-radius: 14px; padding: 15px 16px; gap: 14px; font-size: 13.5px; background: var(--card); }
.entity-card:hover { border-color: var(--ink); }
.entity-icon {
  width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; flex: 0 0 auto;
  background: var(--paper-2); border: 1px solid var(--line); font-size: 0;
}
.entity-icon svg { width: 21px; height: 21px; stroke: var(--ink-2); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.entity-card.on .entity-icon { background: rgba(245,243,238,.12); border-color: transparent; }
:root[data-theme="dark"] .entity-card.on .entity-icon { background: rgba(26,25,23,.10); }
.entity-card.on .entity-icon svg { stroke: var(--on-solid); }
.wizard-foot { padding: 16px 30px; background: transparent; }

/* ---------- shell ---------- */
.rail { background: var(--paper-2); }
.nav-tab { border-radius: 999px; padding: 8px 12px; }
.nav-tab.on { border-radius: 999px; padding: 7px 11px; background: var(--card); box-shadow: var(--shadow-lift); }
.shell.rail-collapsed .nav-tab, .shell.rail-collapsed .nav-tab.on { border-radius: 12px; }
.frow { border-radius: 8px; }
.frow-flag { display: inline-flex; }
.frow-flag .code { height: 16px; min-width: 22px; font-size: 9px; background: var(--card); }
.frow:not(.on) .frow-flag .code { opacity: .55; }
.topbar { height: 60px; }
.topbar-title h1 { font-size: 26px; font-weight: 400; letter-spacing: -.02em; }
.topbar-title small#data-freshness {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 10px; letter-spacing: .3px; color: var(--ink-2);
}
.topbar-title small#data-freshness::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); flex: 0 0 auto; }
.ps-chip { padding: 5px 11px; }
.avatar { box-shadow: 0 6px 14px -8px rgba(var(--shadow-rgb), .8); }
.usermenu-pop, .bell-pop, .dd-pop { border-radius: 16px; box-shadow: var(--shadow-3); border-color: var(--line-2); }
.usermenu-item, .dd-item { border-radius: 10px; }

/* ---------- radar: horizon on a stage, cards like the website's rows ---------- */
#pane-radar { gap: 26px; }
.block-head { margin-bottom: 14px; }
.block-head h3 { font-size: 24px; font-weight: 400; letter-spacing: -.015em; }
.count-pill { font-size: 10.5px; padding: 3px 9px; background: var(--card); border: 1px solid var(--line); }
#pane-radar > .block:first-child, #pane-register > .block:not(:last-child) {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 22px 16px; box-shadow: var(--shadow-card);
}
.timeline { height: 150px; gap: 6px; position: relative; }
.tl-col { border-radius: 12px; padding: 6px 3px 6px; }
.tl-count { font-size: 19px; color: var(--ink); min-height: 19px; }
.tl-bar { max-width: 54px; border-radius: 6px 6px 2px 2px; opacity: .9; }
.tl-col.focused { background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-lift); }
.tl-label { font-size: 9.5px; color: var(--ink-3); }
.reg-list { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.reg-card {
  border-radius: var(--r-card); padding: 15px 16px 14px; gap: 10px; background: var(--panel); border-color: var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset;
}
:root[data-theme="dark"] .reg-card { box-shadow: 0 1px 0 rgba(255,255,255,.03) inset; }
.reg-card:hover { box-shadow: var(--shadow-lift); border-color: var(--line-2); transform: translateY(-2px); }
.reg-flag { display: inline-flex; font-size: 0; }
.reg-flag:empty { display: none; }
.reg-country { font-family: var(--font-ui); font-size: 12.5px; font-weight: 500; color: var(--ink); }
.reg-theme { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; }
.reg-card h4 { font-size: 14.5px; line-height: 1.42; }
.badge { border-radius: 999px; padding: 2px 8px; font-size: 8.5px; letter-spacing: .7px; }
.dchip { font-size: 10.5px; padding: 4px 10px 4px 9px; gap: 7px; }
.dchip::before { width: 6px; height: 6px; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
/* the dismiss tick sits in the corner, out of the flow: in the flow it wrapped onto its own line
   whenever the badges filled the row, leaving an empty gap above the title */
.review-toggle { border-radius: 999px; width: 22px; height: 22px; position: absolute; top: 12px; right: 12px; margin: 0; }
.reg-card-top { padding-right: 30px; }
.reg-card.in-register::before { top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; left: -1px; }
.empty-state, .empty-reg { border-radius: var(--r-panel); background: var(--card); }
.active-filters span { background: var(--card); }

/* ---------- drawer: the website's "one row" record ---------- */
.drawer { background: var(--paper); border-top-width: 3px; }
.drawer.expanded { border-radius: 24px; overflow: hidden; }
.drawer-head { padding: 14px 24px; background: var(--card-2); }
.drawer-badges .reg-flag .code { height: 19px; min-width: 26px; font-size: 10px; background: var(--card); }
.drawer-body { padding: 26px 28px 36px; }
.drawer-body h3 { font-size: 32px; line-height: 1.12; letter-spacing: -.02em; margin-bottom: 22px; }
.decide { border-radius: 18px; padding: 16px 18px; background: var(--panel); box-shadow: var(--shadow-card); margin-bottom: 18px; }
.seg button { padding: 8px 15px; font-size: 12.5px; }
.meta-chip { border-radius: 999px; padding: 4px 11px; }
.record {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden; margin: 0 0 18px; box-shadow: var(--shadow-card);
}
.drawer .record .dcols { display: block; }
.record .drow { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; margin: 0; padding: 15px 20px; border-top: 1px solid var(--line); }
.record .dcols .drow:first-child { border-top: 0; }
.record .drow label { margin: 2px 0 0; }
.record .drow div { font-size: 13.5px; color: var(--ink); }
.drawer .btn-block { border-radius: 999px; padding: 12px 18px; }
.assess { border-top: 0; margin-top: 26px; padding-top: 0; }
.note { border-radius: 14px; }
.diffbox { border-radius: 14px; }

/* ---------- register, profile, settings ---------- */
.stat-strip { gap: 10px; }
.stat { border-radius: var(--r-card); background: var(--panel); box-shadow: var(--shadow-card); padding: 14px 16px 12px; }
.stat .v { font-size: 34px; font-weight: 400; }
.horizon { min-height: 118px; }
.hz { border-radius: 12px; }
.hz .hzn { font-size: 18px; color: var(--ink); }
.hz .hzb { border-radius: 6px 6px 2px 2px; max-width: 70px; }
.rtable { border-collapse: separate; border-spacing: 0; border-radius: 18px; box-shadow: var(--shadow-card); }
.rtable thead th, .rtable td { border-bottom: 1px solid var(--line); }
.rtable tbody tr:last-child td { border-bottom: 0; }
.rtable tbody tr { border-bottom: 0; }
.rtable .flag { display: inline-flex; margin-right: 8px; font-size: 0; vertical-align: 1px; }
.viewseg { box-shadow: 0 1px 0 rgba(255,255,255,.6) inset; }
:root[data-theme="dark"] .viewseg { box-shadow: none; }
.settings-block { border-radius: var(--r-panel); background: var(--panel); box-shadow: var(--shadow-card); padding: 22px 24px 8px; }
.prof-chips .pc { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 6px; }
.prof-chips .pc:not(:has(.code)) { padding-left: 11px; }
.modal { border-radius: 24px; background: var(--panel); }
.bell-badge { border-color: var(--card); }

@media (max-width: 900px) {
  .record .drow { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; }
  .drawer-body h3 { font-size: 26px; }
  #pane-radar > .block:first-child, #pane-register > .block:not(:last-child) { padding: 16px 14px 12px; }
  .auth-back small { display: none; }
  .auth-pill { font-size: 8.5px; letter-spacing: .6px; padding: 5px 10px 5px 9px; }
  .auth-back { top: 16px; left: 18px; }
  .wizard-head h2 { font-size: 24px; }
  .wizard-body h3 { font-size: 22px; }
  .topbar-title small#data-freshness { display: none; }
}
@media (prefers-reduced-motion: reduce) { .live-dot::after { animation: none; } }

/* ---------- workplace edition (EDITION: "workplace" in js/config.js; see app.js) ---------- */
.ed-workplace #btn-google,
.ed-workplace .auth-back,
.ed-workplace #auth-alt > summary,
.ed-workplace [data-ed="accounts"],
.ed-workplace:not(.ed-bell) #bell,
.ed-workplace:not(.ed-bell) [data-ed="bell"] { display: none !important; }
.ed-workplace #auth-alt { margin-top: 0; }
.ed-workplace .rail-brand .wordmark { font-size: 17.5px; }   /* longer name fits the 203px rail */

/* workplace edition: the sign-in screen follows the theme instead of the website's ink block */
.ed-workplace #view-login, .ed-workplace #view-setpw, .ed-workplace #view-signup, .ed-workplace #view-checkmail, .ed-workplace #view-confirm, .ed-workplace #view-forgot { background: var(--paper); }
.ed-workplace #view-login::before, .ed-workplace #view-setpw::before, .ed-workplace #view-signup::before, .ed-workplace #view-checkmail::before, .ed-workplace #view-confirm::before, .ed-workplace #view-forgot::before { display: none; }
.ed-workplace .auth-pill { color: var(--ink-2); border-color: var(--line); }
.ed-workplace .auth-credit { color: var(--ink-3); }

/* ---------- demo edition (EDITION: "demo"; built by make_demo.py, 2026-09-24) ----------
   No backend and no account: everything that signs in, signs out, emails, notifies or resets an
   account is hidden, and so is the theme switch (the page hosting the demo owns the theme). */
.ed-demo #view-login, .ed-demo #view-setpw,
.ed-demo #bell, .ed-demo #btn-settings, .ed-demo #btn-signout, .ed-demo #pane-settings,
.ed-demo [data-ed="accounts"], .ed-demo #theme-btn, .ed-demo #reset-modal { display: none !important; }
.ed-demo .rail-brand { cursor: default; }
.demo-banner {
  position: sticky; top: 0; z-index: 401;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 24px; background: var(--paper-2); border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .2px; line-height: 1.5; color: var(--ink-2);
}
.demo-banner-text { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.demo-banner-btn {
  flex: 0 0 auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.demo-banner-btn:hover { border-color: var(--ink); }
.ed-demo .topbar { top: var(--demo-bh, 0px); }
.badge-sample { background: transparent; color: var(--ink-2); border: 1px dashed var(--line-3); }
.demo-dialog-msg { white-space: pre-line; margin: 4px 0 8px; font-size: 13.5px; color: var(--ink); }
.demo-export-lede { margin: 0 0 10px; color: var(--ink-2); }
.demo-export-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.demo-export-list b { color: var(--ink); margin-right: 6px; }
.demo-fail { margin: 24px 16px; font-family: var(--font-mono); font-size: 12px; color: var(--red); }
@media (max-width: 900px) { .demo-banner { padding: 6px 16px; } }
@media (max-width: 600px) {
  .demo-banner { padding: 5px 12px; gap: 6px; font-size: 9.5px; letter-spacing: 0; line-height: 1.4; }
  .demo-banner-btn { font-size: 9.5px; padding: 2px 8px; }
}
