/* ------------------------------------------------------------------
       DISCTALE admin — the paper control room.

       The product's own palette (design/Disctale Kit): paper FBF8F2, ink
       14110C, electric blue 2D4BFF as the one accent, orange FF5C1F for
       heat, green 1DB954 / red FA243C for verdicts. The product's own
       typefaces, served from this origin: Space Grotesk for words, Azeret
       Mono for every number. Light is the default, as in the product; the
       toggle chooses Light / Dark / Auto and remembers.

       Anatomy of a page: the question, then the answer as one figure, then
       the evidence, then where it comes from. No external asset is ever
       fetched — an admin tool phones nobody.
       ------------------------------------------------------------------ */
@font-face {
  font-family: "Space Grotesk";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/SpaceGrotesk-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/SpaceGrotesk-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/SpaceGrotesk-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Azeret Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/AzeretMono-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Azeret Mono";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/AzeretMono-SemiBold.ttf") format("truetype");
}

/* One set of tokens (A3, 16/10/2026): the colours of the approved A2
   prototype, from the Kit. Paper is the default and never follows the
   system setting; Graphite is chosen with the switch. Text colours reach
   WCAG AA on every ground (tests/test_a3_overview.py). --faint is text-safe;
   --decor is for strokes and dashes only. */
:root {
  --paper: #fbf8f2;
  --paper-deep: #f2ede4;
  --card: #ffffff;
  --tile: #f6f2ea;
  --ink: #14110c;
  --muted: #655d51;
  --faint: #655d51;
  --decor: #a39b8c;
  --line: #e8e1d4;
  --card-edge: #e8e1d4;
  --chip: #14110c0d;
  --solid: #14110c;
  --solid-text: #fbf8f2;
  --rail: #14110c;
  --rail-text: #f2ede4;
  --rail-muted: #a39b8c;
  --accent: #2d4bff;
  --accent-ink: #2440e0;
  --accent-soft: #2d4bff14;
  --accent-wash: #2d4bff0a;
  --blue: #2d4bff;
  --lime: #b8f03c;
  --orange: #ff5c1f;
  --pink: #ff3d8b;
  --heat: #ff5c1f;
  --heat-soft: #ff5c1f1a;
  --good: #0f6f33;
  --good-soft: #12813d17;
  --warn: #a13d0e;
  --bad: #b8172a;
  --bad-soft: #c2182b14;
  --led-good: #1db954;
  --led-warn: #ff5c1f;
  --led-bad: #fa243c;
  --hint-bg: #14110c;
  --hint-text: #fbf8f2;
  --skel: #eae3d7;
  --mark-bar: #14110c;
  --mark-band: #2d4bff;
  --chart-ink: #14110c;
  --chart-grid: #e8e1d4;
  --grid-hover: #f6f2ea;
  --grid-selected: #2d4bff14;
  --shadow: 0 1px 2px rgba(20, 17, 12, 0.04), 0 18px 40px -30px rgba(20, 17, 12, 0.35);
  --r-card: 26px;
  --r-tile: 20px;
  --sans: "Space Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --mono: "Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #18140f;
  --paper-deep: #14110c;
  --card: #1d1913;
  --tile: #26211a;
  --ink: #f2ede4;
  --muted: #b3ab9c;
  --faint: #b3ab9c;
  --decor: #6e6659;
  --line: #332d24;
  --card-edge: #332d24;
  --chip: #f2ede414;
  --solid: #f2ede4;
  --solid-text: #14110c;
  --rail: #0c0a07;
  --accent: #8b9cff;
  --accent-ink: #a6b3ff;
  --accent-soft: #8b9cff1f;
  --accent-wash: #8b9cff0d;
  --heat: #ff8a57;
  --heat-soft: #ff8a5722;
  --good: #5fd18a;
  --good-soft: #5fd18a1f;
  --warn: #ff8a57;
  --bad: #ff6b7d;
  --bad-soft: #ff6b7d1f;
  --hint-bg: #f2ede4;
  --hint-text: #14110c;
  --skel: #262019;
  --mark-bar: #c4bcad;
  --mark-band: #e9e24b;
  --chart-ink: #f2ede4;
  --chart-grid: #332d24;
  --grid-hover: #26211a;
  --grid-selected: #8b9cff1f;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  height: 100%;
}
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01";
}
code,
.mono,
.figure,
td.num,
th.num,
.meter-scale,
.kpi-value,
.hero-figure,
.rail-answer,
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
a {
  color: var(--accent-ink);
}
a:hover {
  color: var(--accent);
}

/* -- masthead ------------------------------------------------------ */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px 22px;
  padding: 11px 26px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: block;
  width: 23px;
  height: 27px;
  flex: none;
}
.brand-name {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
}
.wordmark small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font: 10.5px var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.masthead .meta {
  color: var(--faint);
  font: 11.5px var(--mono);
}
.masthead .spacer {
  margin-left: auto;
}
.identity-chip {
  display: grid;
  max-width: 260px;
  padding: 5px 11px;
  border-radius: 9px;
  background: var(--tile);
  line-height: 1.25;
}
.identity-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  font-weight: 500;
}
.identity-chip span {
  color: var(--muted);
  font: 9.5px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pillbutton {
  font: 500 12.5px var(--sans);
  background: none;
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}
.pillbutton:hover {
  border-color: var(--accent);
  color: var(--accent);
}
button.refresh {
  color: var(--accent-ink);
  border-color: var(--accent);
}
button.refresh:hover {
  background: var(--accent);
  color: #fbf8f2;
}
.refresh-form,
form.signout {
  display: inline;
  margin: 0;
}
form.signout button {
  background: none;
  border: 0;
  padding: 7px 4px;
  cursor: pointer;
  color: var(--muted);
  font: 500 12.5px var(--sans);
}
form.signout button:hover {
  color: var(--bad);
}
.theme-corner {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 20;
}

/* -- shell + the rail of questions ---------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  min-height: calc(100vh - 58px);
}
nav.sections {
  position: sticky;
  top: 57px;
  align-self: start;
  height: calc(100vh - 57px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 14px 28px;
  border-right: 1px solid var(--line);
  background: var(--paper-deep);
}
nav.sections .nav-group {
  margin: 18px 12px 6px;
  color: var(--faint);
  font: 600 10px var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
nav.sections .nav-group:first-child {
  margin-top: 0;
}
nav.sections a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--muted);
  font: 500 13.5px var(--sans);
  padding: 8px 12px;
  border-radius: 9px;
  border-left: 2px solid transparent;
}
nav.sections a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
nav.sections a.current {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
nav.sections a.question {
  padding: 9px 12px 9px 10px;
}
nav.sections .q-no {
  flex: none;
  width: 22px;
  color: var(--faint);
  font: 600 10.5px var(--mono);
  letter-spacing: 0.04em;
}
nav.sections a.current .q-no {
  color: var(--accent);
}
nav.sections .q-text {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
nav.sections .rail-answer {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
nav.sections a.current .rail-answer {
  color: var(--accent-ink);
}

/* -- page ------------------------------------------------------------ */
main {
  min-width: 0;
  padding: 34px clamp(20px, 2.8vw, 52px) 80px;
}
.measure {
  width: 100%;
  max-width: 1560px;
  margin-inline: auto;
}
.content-shell {
  min-width: 0;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px 40px;
  margin: 0 0 30px;
}
.page-head .titles {
  min-width: 0;
  max-width: 64ch;
}
.page-head .eyebrow {
  margin: 0 0 8px;
  color: var(--accent-ink);
  font: 600 10.5px var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.page-head h1 {
  margin: 0;
  font-size: clamp(27px, 2.5vw, 36px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.page-head .titles > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  text-wrap: pretty;
}
.page-head .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.freshness {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--tile);
  color: var(--muted);
  font: 11px var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.freshness .led {
  margin: 0;
}
.freshness.stale {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}

/* The question pages: a numbered question, one answer, then the evidence. */
.question-head {
  margin: 0 0 26px;
}
.question-head .q-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--accent-ink);
  font: 600 10.5px var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.question-head .q-eyebrow::after {
  content: "";
  width: 42px;
  border-top: 1px solid var(--accent);
  opacity: 0.5;
}
.question-head h1 {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(30px, 3.4vw, 50px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.question-head .answer-line {
  margin: 16px 0 0;
  max-width: 76ch;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
}
.question-head .answer-line strong {
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.question-head .answer-line .quiet {
  color: var(--muted);
}
.question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

/* The overview: five answers, one figure each. */
/* auto-fit: five columns when there is room, fewer when there is not.
       Every text inside a card may wrap at any point; nothing may leave it. */
.answers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(206px, 1fr));
  gap: 14px;
  margin: 0 0 34px;
}
.answer {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 236px;
  min-width: 0;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease;
}
.answer > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.answer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.85;
}
.answer.pending::before {
  background: var(--faint);
}
.answer.unavailable::before {
  background: var(--led-bad);
}
.answer:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.answer .a-no {
  color: var(--accent-ink);
  font: 600 10.5px var(--mono);
  letter-spacing: 0.2em;
}
.answer .a-q {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  min-height: 2.5em;
  text-wrap: balance;
}
.answer .a-figure {
  margin-top: 6px;
  font: 600 clamp(22px, 1.6vw, 30px) / 1.05 var(--mono);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.answer.pending .a-figure,
.answer.unavailable .a-figure {
  color: var(--faint);
}
.answer .a-unit {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: -2px;
}
.answer .a-line {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  text-wrap: pretty;
}
.answer .a-open {
  margin-top: auto;
  padding-top: 8px;
  color: var(--accent-ink);
  font: 600 11.5px var(--sans);
}
@media (max-width: 900px) {
  .answers {
    grid-template-columns: minmax(0, 1fr);
  }
  .answer {
    min-height: 0;
  }
}

.hero-figure {
  margin: 0;
  font: 600 clamp(40px, 4.4vw, 72px) / 1 var(--mono);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.hero-figure .unit {
  font-size: 0.38em;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 0.2em;
}
.hero-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 52ch;
}

.section {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.section:first-of-type {
  padding-top: 0;
  border-top: 0;
}
.section > h2,
.section-heading {
  margin: 0 0 8px;
  color: var(--muted);
  font: 600 12.5px/1.3 var(--sans);
  letter-spacing: 0.01em;
}
.section > h2 + p {
  max-width: 68ch;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13.5px;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-bottom: 18px;
}

/* -- KPI strip: the numbers before the detail --------------------- */
.kpis {
  display: grid;
  gap: 0;
  margin-bottom: 24px;
  grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.kpi {
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  padding: 16px 18px 14px;
}
.kpi:last-child {
  border-right: 0;
}
.kpi .kpi-label {
  display: block;
  color: var(--muted);
  font: 500 11.5px var(--sans);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.kpi .kpi-value {
  display: block;
  font-size: clamp(19px, 1.4vw, 25px);
  font-weight: 600;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.kpi .kpi-sub {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.kpi.emph {
  background: var(--accent-wash);
}
.kpi.emph .kpi-value {
  color: var(--accent-ink);
}

/* -- cards ------------------------------------------------------------ */
/* The 12-column grid: a card that forgets its span fails wide, never as
       a sliver. Kept for the Monitor pages that still declare spans. */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.grid > * {
  grid-column: span 12;
}
.span-3 {
  grid-column: span 3;
}
.span-4 {
  grid-column: span 4;
}
.span-6 {
  grid-column: span 6;
}
.span-8 {
  grid-column: span 8;
}
.span-12 {
  grid-column: span 12;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.cards > .wide {
  grid-column: span 2;
}
.cards .card {
  height: 100%;
}
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
/* A grid item defaults to min-width:auto, which lets a wide table push
       its card past the column. Zero it, so tables scroll inside the card. */
.cards > *,
.cards-3 > *,
.hero > *,
.split > *,
.grid > * {
  min-width: 0;
}
.card {
  min-width: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 14px;
  padding: 20px 22px 18px;
  box-shadow: var(--shadow);
}
.card .figure,
.card .caption,
.card .note,
.card .empty {
  overflow-wrap: anywhere;
}
.card > h2 {
  margin: 0 0 14px;
  font: 600 13px var(--sans);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}
.card > h2::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.split {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(0, 1.6fr);
  gap: 48px;
  align-items: start;
}
.split > .section {
  padding-top: 0;
  border-top: 0;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 48px;
  align-items: start;
  padding-bottom: 36px;
}

.figure {
  font-size: 30px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.figure .unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  font-family: var(--sans);
}
.caption {
  color: var(--muted);
  font-size: 13px;
  margin: 3px 0 0;
}
.led {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}
.led.good {
  background: var(--led-good);
}
.led.warn {
  background: var(--led-warn);
}
.led.bad {
  background: var(--led-bad);
}
.led.quiet {
  background: var(--faint);
}
.rows {
  display: grid;
  margin-top: 12px;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.row > span:first-child {
  color: var(--muted);
}
.row > span:last-child {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 12.5px;
}
.note {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  margin: 12px 0 0;
}
.bad {
  color: var(--bad);
}
.warn {
  color: var(--warn);
}
.good {
  color: var(--good);
}
.muted {
  color: var(--muted);
}
.empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--tile);
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13.5px;
}
.banner {
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  background: var(--tile);
  padding: 10px 14px;
  border-radius: 9px;
  margin-bottom: 18px;
  font-size: 13.5px;
}
.banner ul {
  margin: 6px 0 2px;
  padding-left: 18px;
}
.banner li.quiet {
  margin: 3px 0;
}
.bad-border {
  border-left-color: var(--bad);
  color: var(--bad);
}

/* -- pills and verdicts ---------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tile);
  color: var(--muted);
  font: 600 10.5px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill.good {
  color: var(--good);
  background: color-mix(in srgb, var(--good) 12%, transparent);
}
.pill.bad {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, transparent);
}
.pill.warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}
.pill.accent {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.pill.heat {
  color: var(--heat);
  background: var(--heat-soft);
}
.pill.tag {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--tile);
}
.status.active {
  color: var(--good);
  background: color-mix(in srgb, var(--good) 12%, transparent);
}
.status.waiting-for-paste {
  color: var(--accent);
  background: var(--accent-soft);
}
.status.used {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}
.status.revoked,
.status.expired,
.status.invite-expired {
  color: var(--muted);
}
.status.live {
  color: var(--good);
  background: color-mix(in srgb, var(--good) 12%, transparent);
}
.status.blocked {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, transparent);
}
.status.idle,
.status.deleted {
  color: var(--muted);
}
.status.feedback-bug {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, transparent);
}
.status.feedback-idea {
  color: var(--accent);
  background: var(--accent-soft);
}
.status.feedback-question {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}

/* -- charts: ink on paper, one accent ------------------------------- */
.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart .grid {
  stroke: var(--chart-grid);
  stroke-width: 1;
}
.chart .axis {
  fill: var(--faint);
  font: 10px var(--mono);
}
.chart .bar {
  fill: var(--accent);
}
.chart .bar.soft {
  fill: var(--accent-soft);
}
.chart .bar.heat {
  fill: var(--heat);
}
.chart .bar.ink {
  fill: var(--chart-ink);
}
.chart .bar.quiet {
  fill: var(--line);
}
.chart .line {
  fill: none;
  stroke: var(--chart-ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .line.accent {
  stroke: var(--accent);
}
.chart .line.dashed {
  stroke-dasharray: 3 4;
  stroke: var(--muted);
}
.chart .area {
  fill: var(--accent-soft);
}
.chart .dot {
  fill: var(--heat);
}
.chart .label {
  fill: var(--ink);
  font: 600 10.5px var(--mono);
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}
.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
  background: var(--accent);
}
.chart-legend span.soft::before {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.chart-legend span.heat::before {
  background: var(--heat);
}
.chart-legend span.ink::before {
  background: var(--chart-ink);
}
.chart-legend span.quiet::before {
  background: var(--line);
}

.meter {
  margin-top: 10px;
}
.meter .bar {
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--tile);
  border: 1px solid var(--card-edge);
}
.meter .bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.meter .bar > span.over {
  background: var(--led-bad);
}
.meter .bar > span.heat {
  background: var(--heat);
}
.meter .meter-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 3px;
  letter-spacing: 0.04em;
}

/* -- tables ----------------------------------------------------------- */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll > table {
  min-width: 560px;
}
table {
  display: table;
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  text-align: left;
  padding: 0 18px 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 500 12px/1.35 var(--sans);
}
.section > .table-scroll thead th,
.section thead th {
  background: var(--paper);
}
tbody td {
  padding: 10px 18px 10px 0;
  border-bottom: 1px solid var(--line);
  font: 12.5px/1.5 var(--mono);
  vertical-align: top;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr.emph td {
  background: var(--accent-wash);
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
td.prose,
td.wrap {
  font-family: var(--sans);
  font-size: 13.5px;
  white-space: normal;
  min-width: 200px;
  max-width: 360px;
  overflow-wrap: anywhere;
}
td .sub {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
tbody tr:hover td {
  background: var(--accent-wash);
}

/* -- the "i" ---------------------------------------------------------- */
.term {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.term > .i {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font: 600 9.5px var(--mono);
  cursor: help;
  user-select: none;
  align-self: center;
}
.term > .hint {
  display: none;
  position: absolute;
  bottom: calc(100% + 9px);
  left: 0;
  z-index: 30;
  width: min(300px, 74vw);
  background: var(--hint-bg);
  color: var(--hint-text);
  padding: 10px 12px;
  border-radius: 9px;
  font: 400 12.5px/1.55 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 6px 24px rgba(20, 17, 12, 0.25);
}
.term:hover > .hint,
.term:focus-within > .hint {
  display: block;
}

/* -- states ----------------------------------------------------------- */
.state {
  max-width: 74ch;
  padding: 24px 26px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--tile);
}
.state h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.state p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-wrap: pretty;
}
.state.error {
  border-style: solid;
  border-left: 3px solid var(--bad);
}
.state.loading {
  position: relative;
  overflow: hidden;
}
.source-summary {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: -14px 0 24px;
  color: var(--muted);
  font-size: 12.5px;
}
.source-state {
  display: flex;
  align-items: center;
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.refresh-line {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  overflow: hidden;
  background: var(--accent-soft);
}
.refresh-line > span {
  display: block;
  width: 28%;
  height: 100%;
  background: var(--accent);
  animation: sweep 1.15s linear infinite;
}
@keyframes sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(340%);
  }
}
details.section summary {
  cursor: pointer;
  color: var(--muted);
  font: 500 13px var(--sans);
}
details.section summary:hover {
  color: var(--ink);
}
pre {
  white-space: pre-wrap;
  font: 12.5px/1.55 var(--mono);
  margin: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-grid;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--tile);
  border: 1px solid var(--line);
  line-height: 1.3;
}
.chip {
  min-width: 0;
  max-width: 100%;
}
.chip strong {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.chip span {
  color: var(--muted);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

/* -- staggered reveal, once, on load -------------------------------- */
.reveal,
.page-head,
.question-head {
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .refresh-line > span,
  .disc {
    animation: none !important;
  }
}

/* -- forms (access, beta, accounts) ----------------------------------- */
.stack {
  display: grid;
  gap: 12px;
}
.stack label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font: 500 11.5px var(--sans);
}
.stack input,
.stack select,
.copyline textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--card-edge);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.45 var(--mono);
}
.stack input:focus,
.stack select:focus,
.copyline textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.copyline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
  margin-top: 16px;
}
.copyline textarea {
  resize: none;
}
.invite-once {
  margin-bottom: 18px;
  border-color: var(--good);
}
.steps {
  display: grid;
  gap: 12px;
}
.steps > div {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
}
.steps strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fbf8f2;
}
.danger-link {
  background: none;
  border: 0;
  padding: 7px 4px;
  color: var(--bad);
  cursor: pointer;
  font: inherit;
  min-height: 32px;
}
.access-list {
  display: grid;
  gap: 10px;
}
.access-member {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(150px, 210px) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.access-member:first-child {
  border-top: 0;
}
.access-member .identity {
  min-width: 0;
}
.access-member .identity strong {
  display: block;
  overflow-wrap: anywhere;
}
.access-member form {
  margin: 0;
}
.access-member .role-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.access-member select {
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--card-edge);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.row-actions form {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}
.typed-confirm input {
  width: 9ch;
  padding: 6px 8px;
  border: 1px solid var(--card-edge);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: 12.5px var(--mono);
}
.typed-confirm input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.feedback-list {
  display: grid;
  gap: 0;
}
.feedback-report {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.feedback-report:first-child {
  border-top: 0;
  padding-top: 0;
}
.feedback-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  font-size: 12px;
}
.feedback-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feedback-message {
  margin: 18px 0 14px;
  max-width: 900px;
  white-space: pre-wrap;
  font-size: 18px;
  line-height: 1.5;
}
.feedback-context {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.feedback-context span {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tile);
  color: var(--muted);
  font: 11px var(--mono);
}
.feedback-id {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 10px;
}
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 22px;
}
.filterchip {
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 13px var(--sans);
  cursor: pointer;
}
.filterchip:hover,
.filterchip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* -- login ------------------------------------------------------------ */
.gate {
  min-height: 82vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate .card {
  width: min(420px, 92vw);
  padding: 30px 32px 26px;
}
.gate h1 {
  font-size: 22px;
  letter-spacing: 0.12em;
  margin: 0 0 2px;
}
form.login {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
form.login label {
  font: 500 11.5px var(--sans);
  color: var(--muted);
}
input[type="password"] {
  font: 15px var(--mono);
  padding: 10px 12px;
  border: 1px solid var(--card-edge);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
}
input[type="password"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button.primary,
a.primary {
  font: 600 13px var(--sans);
  padding: 11px 18px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fbf8f2;
  cursor: pointer;
  text-decoration: none;
}
button.primary:hover,
a.primary:hover {
  filter: brightness(1.08);
}
.google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  text-align: center;
}
.google-mark {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #ffffff;
  color: #4285f4;
  font:
    700 14px system-ui,
    sans-serif;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
button,
summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
summary {
  min-height: 36px;
  cursor: pointer;
}
.skip,
.visually-hidden {
  position: absolute;
  left: -9999px;
}
.masthead-search {
  margin: 0;
  min-width: 0;
}
.masthead-search input {
  width: min(240px, 28vw);
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: 13px var(--sans);
}
.command-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
}
.command-board h2 {
  font: 600 18px/1.3 var(--sans);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.command-col .rows {
  margin-bottom: 22px;
}
@media (max-width: 900px) {
  .command-board {
    grid-template-columns: 1fr;
  }
  .masthead-search input {
    width: 140px;
  }
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 40;
  padding: 9px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
}
footer {
  padding: 26px clamp(20px, 2.8vw, 52px) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
footer > span {
  display: block;
  max-width: 110ch;
}

/* -- responsive ------------------------------------------------------- */
@media (max-width: 1280px) {
  .cards-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .app-shell {
    display: block;
    min-height: 0;
  }
  .masthead {
    gap: 12px;
  }
  .masthead .meta,
  .identity-chip {
    display: none;
  }
  nav.sections {
    position: sticky;
    top: 57px;
    z-index: 9;
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
  }
  nav.sections::-webkit-scrollbar {
    display: none;
  }
  nav.sections .nav-group,
  nav.sections .rail-answer {
    display: none;
  }
  nav.sections a {
    flex: none;
    padding: 12px 12px 10px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
  }
  nav.sections a.current {
    border-bottom-color: var(--accent);
    background: transparent;
  }
  .hero,
  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .cards,
  .cards-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .cards > .wide {
    grid-column: auto;
  }
  button,
  summary,
  select,
  input,
  textarea,
  .wordmark {
    min-height: 44px;
  }
  .danger-link,
  form.signout button {
    min-height: 44px;
    padding: 11px 4px;
  }
  .access-member {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
@media (max-width: 620px) {
  .form-pair,
  .copyline {
    grid-template-columns: 1fr;
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
  main {
    padding-top: 24px;
  }
  .masthead {
    padding-inline: 16px;
  }
  .wordmark small {
    display: none;
  }
  button.refresh {
    width: 40px;
    padding-inline: 8px;
    font-size: 0;
  }
  button.refresh::after {
    content: "↻";
    font:
      18px/1 system-ui,
      sans-serif;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .kpi:nth-child(2n) {
    border-right: 0;
  }
  .kpi:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .question-head h1 {
    font-size: 30px;
  }
}

/* Admin rebrand: larger text, working registers (tokens live at the top).
   Existing evidence fragments keep their semantic markup and source states. */
[hidden] {
  display: none !important;
}
body {
  font-size: 15px;
  line-height: 1.6;
}
button,
input,
select,
textarea {
  font-family: var(--sans);
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 242px;
  z-index: 25;
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 18px;
}
.admin-sidebar .wordmark {
  padding: 0 8px;
  gap: 12px;
}
.admin-sidebar .brand-name {
  font-size: 23px;
  letter-spacing: 0.04em;
}
.admin-sidebar .wordmark small {
  font-size: 10px;
  letter-spacing: 0.13em;
  margin-top: 4px;
}
.admin-sidebar .brand-mark {
  width: 28px;
  height: 35px;
}
.workspace-name {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 27px 8px 17px;
  font-size: 13px;
}
.workspace-name > span:last-child {
  margin-left: auto;
  font: 9px var(--mono);
  color: var(--muted);
}
.workspace-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
nav.sections {
  position: static;
  top: auto;
  height: auto;
  flex: 1;
  align-self: stretch;
  padding: 0 0 20px;
  background: none;
  border: 0;
  gap: 2px;
  scrollbar-width: thin;
}
nav.sections .nav-group {
  font-size: 10px;
  margin: 21px 12px 7px;
  letter-spacing: 0.13em;
  color: var(--muted);
}
nav.sections a {
  font-size: 14px;
  padding: 8px 12px;
  min-height: 38px;
  align-items: center;
  border: 0;
  border-radius: 5px;
  gap: 11px;
}
nav.sections a.current {
  background: var(--accent-soft);
  color: var(--ink);
}
.nav-symbol {
  font: 17px/1 var(--sans);
  width: 18px;
  flex: none;
  text-align: center;
  color: var(--muted);
}
nav.sections a.current .nav-symbol {
  color: var(--accent);
}
.sidebar-identity {
  border-top: 1px solid var(--line);
  padding: 17px 5px 0;
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.sidebar-identity > span:last-child {
  min-width: 0;
}
.sidebar-identity strong {
  display: block;
  font-size: 12px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.sidebar-identity small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.identity-avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 50%;
  flex: none;
  font: 12px var(--mono);
}
.admin-workspace {
  margin-left: 242px;
}
.masthead {
  height: 65px;
  position: sticky;
  padding: 0 34px;
  background: var(--paper);
  backdrop-filter: none;
  gap: 14px;
  z-index: 15;
}
.workspace-breadcrumb {
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
}
.workspace-breadcrumb span {
  margin-left: 10px;
  color: var(--ink);
}
#nav-toggle {
  display: none;
}
main {
  padding: 30px 34px 52px;
}
.measure {
  max-width: 1640px;
}
.page-head {
  margin-bottom: 26px;
  gap: 20px;
}
.page-head h1,
.question-head h1 {
  font: 600 35px/1.15 var(--sans);
  letter-spacing: -0.045em;
  max-width: 35ch;
}
.question-head {
  margin-bottom: 26px;
}
.question-head .q-eyebrow,
.page-head .eyebrow {
  font-size: 11px;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.question-head .q-eyebrow:after {
  display: none;
}
.question-head .answer-line {
  font: 15px/1.65 var(--sans);
  max-width: 95ch;
  margin-top: 12px;
}
.question-head .answer-line strong {
  font-family: var(--sans);
  font-weight: 600;
}
.page-head .titles > p:last-child {
  font-size: 15px;
  line-height: 1.65;
  max-width: 75ch;
}
.sample-banner {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0 13px;
  margin: 0 0 26px;
  font: 11px/1.6 var(--sans);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.pillbutton {
  border-radius: 6px;
  min-height: 36px;
  font-size: 13px;
  padding: 7px 12px;
}
.freshness {
  background: none;
  padding: 0;
  font-size: 11px;
  white-space: normal;
}
.section {
  margin: 30px 0;
}
.section-head {
  gap: 16px;
}
.section h2,
.section-head h2,
.card h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.section > p,
.card > p.caption {
  font-size: 14px;
  line-height: 1.65;
}
.card {
  padding: 22px 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  border-top: 1px solid var(--line);
}
.cards {
  gap: 30px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cards > .wide {
  grid-column: 1/-1;
}
.split {
  gap: 30px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  background: transparent;
  border: 0;
  border-block: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  gap: 0;
  margin-bottom: 26px;
}
.kpi {
  padding: 18px 18px;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: none !important;
}
.kpi:first-child {
  padding-left: 0;
}
.kpi:last-child {
  border-right: 0;
}
.kpi-label {
  font: 13px var(--sans);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.5;
  color: var(--muted);
}
.kpi-value {
  font: 600 30px/1.3 var(--sans);
  letter-spacing: -0.04em;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.kpi-sub {
  font: 12px/1.6 var(--sans);
  color: var(--muted);
  margin-top: 6px;
}
.hero-figure,
.figure {
  font-family: var(--sans);
  letter-spacing: -0.05em;
  font-weight: 600;
}
.hero-figure {
  font-size: 44px;
}
.hero-caption {
  font-size: 14px;
  max-width: 64ch;
}
.hero {
  gap: 32px;
  align-items: start;
  margin-bottom: 26px;
}
.hero .kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hero .kpi {
  border-bottom: 1px solid var(--line);
}
.hero .kpi:first-child {
  padding-left: 18px;
}
.hero .kpi:nth-child(2n) {
  border-right: 0;
}
.hero .kpi-value {
  font-size: 29px;
}
.figure {
  font-size: 35px;
}
.note,
.caption,
.sub,
.muted {
  color: var(--muted);
}
.note {
  font-size: 13px;
  line-height: 1.7;
}
.rows .row {
  font-size: 14px;
  gap: 20px;
}
.rows .row > span:last-child {
  overflow-wrap: anywhere;
}
.meter-scale,
.chart-legend {
  font-size: 12px;
}
.chart .axis {
  font-size: 12px;
}
.pill,
.status {
  font: 12px/1.4 var(--sans);
  padding: 3px 7px;
  border-radius: 4px;
  white-space: normal;
}
.pill.tag {
  overflow-wrap: anywhere;
}
.hint {
  font-size: 13px;
  max-width: min(320px, 80vw);
  line-height: 1.65;
  z-index: 40;
}
.i {
  font-size: 11px;
}
.answers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-block: 1px solid var(--line);
  margin-bottom: 28px;
}
.answer {
  padding: 18px;
  min-height: 0;
  background: none;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  gap: 7px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.answer:first-child {
  padding-left: 0;
}
.answer:last-child {
  border: 0;
}
.answer:before {
  display: none;
}
.answer:hover {
  transform: none;
  background: var(--accent-wash);
}
.answer .a-no {
  display: none;
}
.answer .a-q {
  min-height: 0;
  font: 13px/1.4 var(--sans);
  color: var(--muted);
}
.answer .a-figure {
  font: 600 clamp(24px, 2.1vw, 34px) / 1.25 var(--sans);
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
.answer .a-unit {
  font-size: 12px;
  line-height: 1.6;
}
.answer .a-line {
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}
.answer .a-open {
  font-size: 12px;
  margin-top: 8px;
}
.overview-work {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 34px;
  margin: 30px 0;
}
.overview-work > section + section {
  border-left: 1px solid var(--line);
  padding-left: 30px;
}
.overview-work h2 {
  font-size: 18px;
  margin-bottom: 18px;
}
.attention-item {
  display: block;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.attention-item strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}
.attention-item span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}
.attention-item:hover strong {
  color: var(--accent);
}
.details-toggle {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 20px 0;
  margin-top: 30px;
}
.details-toggle > summary {
  font-size: 16px;
  font-weight: 600;
  justify-content: flex-start;
  gap: 10px;
  display: list-item;
  list-style-position: inside;
  min-height: 38px;
}
.details-toggle > summary::marker {
  color: var(--accent);
}
.ui-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}
.ui-tabs button {
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  padding: 12px 0;
  font-size: 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  min-height: 44px;
}
.ui-tabs button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}
.ui-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.data-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
}
.data-toolbar input {
  width: min(320px, 100%);
  min-width: 200px;
  flex: 1;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 38px;
  font-size: 14px;
  padding: 8px 12px;
}
.data-toolbar .toolbar-end {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.data-grid {
  min-width: 0;
  width: 100%;
}
.data-count {
  font: 12px/1.6 var(--sans);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.data-count span:last-child {
  color: var(--muted);
}
.ag-header-cell-text {
  font-weight: 400 !important;
}
.ag-cell {
  display: flex;
  align-items: center;
  font-family: var(--sans);
  line-height: 1.5;
}
.ag-cell .ag-cell-wrapper {
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}
.ag-cell.numeric-cell {
  justify-content: flex-end;
  font: 13px var(--mono);
}
.ag-cell .cell-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  line-height: 1.5;
}
.ag-cell .cell-content > strong {
  line-height: 20px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.ag-cell .cell-content > .sub {
  line-height: 16px;
  margin: 0;
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.ag-cell .mono {
  font-size: 12px;
}
.ag-cell .pill,
.ag-cell .status {
  display: inline-flex;
  white-space: nowrap;
}
.ag-cell .open-record {
  background: transparent;
  border: 0;
  color: var(--accent);
  font: 13px var(--sans);
  min-height: 38px;
  padding: 7px 0;
}
.ag-cell .open-record:hover {
  text-decoration: underline;
}
.ag-cell-focus {
  outline-offset: -2px;
}
.table-scroll {
  max-width: 100%;
}
.grid-host {
  margin-bottom: 20px;
  min-width: 0;
}
.admin-dialog {
  inset: 0 0 0 auto;
  margin: 0;
  width: min(560px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100%;
  padding: 28px 32px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: -15px 0 60px #0003;
  overflow-y: auto;
}
.admin-dialog::backdrop {
  background: #0007;
}
.admin-dialog[open] {
  animation: admin-slide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.dialog-head .eyebrow {
  font: 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.admin-dialog h2 {
  font: 600 28px/1.25 var(--sans);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  margin: 0 0 22px;
}
.admin-dialog p {
  font-size: 14px;
  line-height: 1.75;
}
.detail-fields {
  margin: 0;
}
.detail-fields > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: 14px;
}
.detail-fields dt {
  color: var(--muted);
}
.detail-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.detail-fields .sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}
.detail-fields .mono {
  font-size: 13px;
}
.detail-fields pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.detail-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.detail-actions h3 {
  font-size: 16px;
  margin: 0 0 16px;
}
.detail-actions .row-actions {
  display: grid;
  gap: 20px;
}
.detail-actions .typed-confirm {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  gap: 12px;
}
.detail-actions .typed-confirm input {
  font: 14px var(--mono);
  min-height: 40px;
  width: 12ch;
}
.detail-actions form {
  margin: 12px 0;
}
.detail-actions button {
  min-height: 40px;
}
.detail-message {
  white-space: pre-wrap;
  font-size: 19px !important;
  line-height: 1.65 !important;
  color: var(--ink);
}
.column-choice {
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 14px;
}
.column-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.admin-dialog form.stack {
  margin-top: 20px;
}
.admin-dialog .section {
  margin: 0;
}
.admin-dialog input,
.admin-dialog select {
  max-width: 100%;
}
.admin-dialog .row-actions .role-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-dialog button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.filterchip {
  font-size: 14px;
  border-radius: 6px;
}
.login-scene {
  display: none;
}
.access-gate .gate {
  min-height: calc(100vh - 150px);
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  padding: 0;
  max-width: 1050px;
  margin: 40px auto;
}
.access-gate .gate > .card {
  width: 100%;
  max-width: 430px;
  border: 0;
  padding: 40px;
  background: none;
}
.gate h1 {
  font-size: 29px;
}
.gate .caption {
  font-size: 13px;
}
.gate input {
  min-height: 46px;
}
.access-gate .login-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  align-self: stretch;
  background: #b8f03c;
  color: #14110c;
  padding: 40px;
}
.login-scene > span {
  font: 12px var(--mono);
  letter-spacing: 0.1em;
}
.login-vinyl {
  width: min(290px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle,
    #181c19 0,
    #181c19 2px,
    #2c332b 3px,
    #181c19 4px
  );
  display: grid;
  place-items: center;
}
.login-vinyl > span {
  width: 31%;
  height: 31%;
  border-radius: 50%;
  background: #fbf8f2;
  display: grid;
  place-items: center;
  font: 10px var(--mono);
}
footer {
  display: flex;
  gap: 30px;
  justify-content: space-between;
  font-size: 11px;
  padding: 22px 34px;
}
footer > span:last-child {
  max-width: 90ch;
}
.reveal {
  animation: none;
}
.page-head,
.question-head {
  animation: admin-enter 0.2s ease-out;
}
.banner {
  font-size: 14px;
  line-height: 1.65;
}
#content:focus {
  outline: 0;
}
.source-summary {
  font-size: 13px;
}
.feedback-context {
  gap: 10px;
}
.feedback-context span {
  font-size: 12px;
}
.typed-confirm .danger-link {
  color: var(--bad);
}
@keyframes admin-slide {
  from {
    opacity: 0;
    transform: translateX(22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes admin-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1700px) {
  .kpi-value {
    font-size: 36px;
  }
  .answer .a-figure {
    font-size: 36px;
  }
}
@media (max-width: 1200px) {
  .admin-sidebar {
    width: 220px;
    padding-inline: 14px;
  }
  .admin-workspace {
    margin-left: 220px;
  }
  .admin-sidebar .brand-name {
    font-size: 21px;
  }
  main {
    padding: 28px 24px;
  }
  .masthead {
    padding: 0 24px;
  }
  .answers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .answer {
    border-bottom: 1px solid var(--line);
  }
  .answer:first-child {
    padding-left: 18px;
  }
  .kpi-value {
    font-size: 28px;
  }
  .cards {
    gap: 24px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero .kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .hero .kpi {
    border-bottom: 0;
  }
  .hero .kpi:nth-child(2n) {
    border-right: 1px solid var(--line);
  }
  .hero .kpi:last-child {
    border-right: 0;
  }
}
@media (max-width: 900px) {
  .admin-sidebar {
    width: 242px;
    transform: translateX(-100%);
    transition: transform 0.18s;
    box-shadow: none;
  }
  .admin-sidebar.is-open {
    transform: none;
    box-shadow: 20px 0 60px #0007;
  }
  .admin-workspace {
    margin-left: 0;
  }
  #nav-toggle {
    display: inline-flex;
  }
  .workspace-breadcrumb {
    display: none;
  }
  .masthead {
    height: 65px;
    padding-inline: 18px;
    gap: 9px;
  }
  nav.sections {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
  }
  nav.sections .nav-group {
    display: block;
  }
  nav.sections a {
    flex: none;
    border-bottom: 0;
    border-radius: 5px;
    white-space: normal;
    padding: 8px 12px;
  }
  nav.sections a.current {
    background: var(--accent-soft);
    border: 0;
  }
  .overview-work {
    grid-template-columns: 1fr;
  }
  .overview-work > section + section {
    border: 0;
    padding: 0;
    border-top: 1px solid var(--line);
    padding-top: 24px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .cards > .wide {
    grid-column: auto;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .access-gate .gate {
    grid-template-columns: 1fr;
    min-height: 70vh;
    max-width: 500px;
  }
  .access-gate .login-scene {
    display: none;
  }
  .data-toolbar .toolbar-end {
    margin-left: 0;
  }
  .hero .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi:first-child {
    padding-left: 18px;
  }
  .answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .answer:nth-child(2n) {
    border-right: 0;
  }
  .answer:last-child {
    grid-column: 1/-1;
  }
  .sample-banner {
    font-size: 12px;
  }
  .pillbutton {
    min-height: 40px;
  }
  button.refresh {
    width: auto;
    font-size: 12px;
    padding: 7px 10px;
  }
  button.refresh::after {
    display: none;
  }
  .sidebar-identity {
    font-size: 13px;
  }
  .admin-dialog {
    width: min(540px, 100%);
  }
  footer {
    flex-direction: column;
    gap: 10px;
  }
}
@media (max-width: 520px) {
  main {
    padding: 22px 18px 36px;
  }
  .page-head h1,
  .question-head h1 {
    font-size: 30px;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi {
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
  }
  .kpi-value {
    font-size: 27px;
  }
  .question-head .answer-line {
    font-size: 14px;
  }
  .answer {
    padding: 16px 12px;
  }
  .answer:first-child {
    padding-left: 12px;
  }
  .answer .a-figure {
    font-size: 28px;
  }
  .data-toolbar input {
    max-width: none;
    width: 100%;
    flex-basis: 100%;
  }
  .data-toolbar .pillbutton {
    font-size: 12px;
    padding: 7px 10px;
  }
  .admin-dialog {
    padding: 24px 20px;
  }
  .detail-fields > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .detail-message {
    font-size: 18px !important;
  }
  .ui-tabs {
    gap: 20px;
  }
  .freshness {
    font-size: 11px;
  }
  .page-head .actions {
    align-items: start;
  }
  .gate .card {
    padding: 26px !important;
  }
  .access-gate .gate {
    margin: 40px auto 0;
  }
  .sample-banner {
    align-items: flex-start;
  }
  footer {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.question-description {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin: 10px 0;
}
.summary-context > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 25px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.summary-context dt {
  color: var(--muted);
}
.summary-context dd {
  margin: 0;
  max-width: 90ch;
}
.admin-workspace footer {
  margin-top: 0;
}
.data-toolbar input {
  flex-grow: 0;
  max-width: 340px;
}
.data-toolbar .toolbar-end {
  margin-left: auto;
}
.answer .a-line {
  font-size: 13px;
  line-height: 1.6;
}
.answer .a-unit {
  font-size: 13px;
}
.answer .a-open {
  font-size: 13px;
}
.sample-banner {
  font-size: 12px;
}
.answer .a-figure {
  font-size: 32px;
}
.data-grid .ag-root-wrapper {
  border: 1px solid var(--line);
}
@media (max-width: 520px) {
  .summary-context > div {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .data-toolbar input {
    max-width: none;
  }
  .data-toolbar .toolbar-end {
    margin-left: 0;
  }
  .answer .a-figure {
    font-size: 27px;
  }
}
.detail-section-title {
  margin: 28px 0 6px;
  font-size: 16px;
  letter-spacing: -0.02em;
}
/* Metric typography overrides the legacy fragment's more specific selectors. */
.kpi .kpi-label {
  display: block;
  font: 400 13px/1.5 var(--sans);
  letter-spacing: 0;
}
.kpi .kpi-value {
  display: block;
  font: 600 clamp(26px, 2vw, 34px) / 1.25 var(--sans);
  letter-spacing: -0.04em;
  margin-top: 8px;
}
.kpi .kpi-sub {
  display: block;
  font: 400 13px/1.6 var(--sans);
  margin-top: 6px;
}

/* Keep the register close to its context and give each row a bounded two-line
   text block in both densities. Native details retain the complete evidence. */
.grid-host .ag-cell .cell-content { line-height: 20px; }
.inline-grid-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; width: 100%; }
.ag-cell .inline-grid-actions .danger-link { padding: 7px 0; min-height: 36px; font: 13px var(--sans); white-space: nowrap; }
body[data-section="beta"] .split > .section { margin-bottom: 0; padding-bottom: 0; }
body[data-section="beta"] .split + .section { margin-top: 24px; padding-top: 16px; }

/* Case history: one filter bar, readable evidence and compact command rows. */
.case-filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 14px;
  padding: 20px 0; margin-bottom: 18px; border-block: 1px solid var(--line);
}
.case-filters > div { display: grid; gap: 6px; min-width: 140px; }
.case-filters label { font-size: 12px; color: var(--muted); }
.case-filters .case-search { flex: 1; min-width: 210px; }
.case-filters input, .case-filters select {
  width: 100%; min-height: 42px; margin: 0; padding: 9px 12px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; font: 14px var(--sans);
}
.case-filters .pillbutton { min-height: 42px; }
.primary-action { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.primary-action:hover { background: var(--accent-ink); color: var(--paper); }
.filter-reset { padding: 10px 0; font-size: 13px; }
.register-summary { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 22px 0 12px; font-size: 13px; color: var(--muted); }
.register-summary p { margin: 0; }
.register-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.register-summary p > span { padding: 0 9px; }
.case-results { border: 0; margin-top: 0; padding-top: 0; }
.case-results .data-toolbar { justify-content: flex-end; padding-top: 0; }
.register-empty { padding: 42px 0; border-bottom: 1px solid var(--line); }
.register-empty h2 { font-size: 20px; margin: 0 0 8px; }
.register-empty p { color: var(--muted); margin: 0 0 16px; }
.register-scope { margin-top: 22px; }
.command-board { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 36px; }
.command-col { min-width: 0; }
.case-headline { display: flex; align-items: center; gap: 16px; margin: 22px 0; }
.case-headline > strong { font: 600 42px/1 var(--sans); letter-spacing: -.04em; }
.case-headline > span { color: var(--muted); font-size: 13px; }
.recent-case { display: flex; justify-content: space-between; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background-color 120ms ease; }
.recent-case:hover { background: var(--accent-wash); }
.recent-case > span:first-child { min-width: 0; }
.recent-case .sub { overflow-wrap: anywhere; }
.case-zone { margin-left: 10px; font-size: 12px; color: var(--muted); }
.case-sample { max-width: 60ch; color: var(--muted); font-size: 12px; }
.recent-case-meta { display: grid; align-content: start; gap: 5px; text-align: right; flex-shrink: 0; }
.recent-case-meta > strong { font: 500 21px var(--sans); }
.recent-case-meta time { font-size: 10px; color: var(--muted); }
.recent-case-meta > span { font-size: 12px; color: var(--accent-ink); }
.section-link { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding: 16px 0; border-top: 1px solid var(--line); font-size: 13px; text-decoration: none; }
.section-link > span { color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) { .command-board { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .case-filters > div { flex: 1 1 calc(50% - 14px); min-width: 0; }
  .case-filters .case-search { flex-basis: 100%; order: -1; min-width: 0; }
  .case-filters .pillbutton { flex: 1; }
  .case-filters .filter-reset { text-align: center; }
  .recent-case { gap: 10px; }
  .recent-case-meta time { max-width: 90px; }
}
@media (prefers-reduced-motion: reduce) { .recent-case { transition: none; } }
@media (max-width: 620px) {
  .masthead { height: auto; min-height: 65px; flex-wrap: wrap; gap: 8px; padding-block: 10px; }
  .masthead .spacer { display: none; }
  .masthead .refresh-form { margin-left: auto; }
  .masthead-search { order: 5; flex: 1 0 100%; }
  .masthead-search input { width: 100%; }
}
.case-time { display: flex; flex-direction: column; line-height: 20px; font-variant-numeric: tabular-nums; }
.case-time .sub { font-size: 11px; color: var(--muted); }
