/* ==========================================================================
   TND Group — Monitoring Tool
   Brand taken from tnd-group.eu: near-black #141414 with the deep navy
   #080A26 and gold #BC8522 as the single accent. Montserrat for UI and
   figures, Raleway for titles. Squared corners, hairline rules, no gloss.

   Chart series colours are a validated categorical set in a fixed order,
   never cycled, met het brandgoud op slot 1. Beide modes halen de CVD-,
   chroma- en lichtheidsgates (slot 1-3 all-pairs, want geen grafiek toont
   meer dan drie reeksen); de twee light-mode tinten onder 3:1 komen altijd
   met legende, directe labels en een tabelweergave.
   Jaarhistoriek gebruikt geen categorische kleuren maar de ordinale
   navy-ramp in dashboard.js: jaren zijn een geordende reeks, geen
   identiteiten.
   ========================================================================== */

:root {
  color-scheme: light;

  /* brand */
  --brand-dark:  #141414;
  --brand-navy:  #080a26;
  --gold:        #bc8522;
  --gold-soft:   rgba(188, 133, 34, .15);

  /* surfaces & ink */
  --page:        #f2f2f2;
  --surface:     #ffffff;
  --surface-sunk:#ebebeb;
  --ink:         #141414;
  --ink-2:       #4f4f4f;
  --ink-muted:   #858585;
  --hairline:    rgba(20, 20, 20, .13);
  --hairline-2:  rgba(20, 20, 20, .07);
  --grid:        #e4e4e4;
  --baseline:    #c4c4c4;

  /* the rail carries the brand black; dark mode switches it to the navy */
  --rail:        #141414;
  --rail-2:      #242424;
  --rail-line:   rgba(255, 255, 255, .10);
  --rail-ink:    #ffffff;
  --rail-ink-2:  #9b9b9b;

  /* categorical series — fixed order, TND goud op slot 1.
     Slot 1-3 zijn all-pairs gevalideerd (max 3 reeksen per grafiek). */
  --s1: #bc8522;  --s2: #1baf7a;  --s3: #4a3aa7;  --s4: #e87ba4;
  --s5: #008300;  --s6: #e34948;  --s7: #2a78d6;  --s8: #eb6834;

  /* reserved status colours */
  --good:      #0ca30c;
  --warning:   #fab219;
  --serious:   #ec835a;
  --critical:  #d03b3b;
  --good-text: #006300;

  --radius: 4px;
  --radius-sm: 3px;
  --shadow: 0 1px 1px rgba(20, 20, 20, .03);

  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Raleway", "Montserrat", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page:        #0a0a0a;
    --surface:     #181818;
    --surface-sunk:#212121;
    --ink:         #f5f5f5;
    --ink-2:       #b9b9b9;
    --ink-muted:   #858585;
    --hairline:    rgba(255, 255, 255, .13);
    --hairline-2:  rgba(255, 255, 255, .07);
    --grid:        #2b2b2b;
    --baseline:    #3b3b3b;
    --rail:        #080a26;
    --rail-2:      #14183a;
    --gold-soft:   rgba(188, 133, 34, .22);
    --s1: #bc8522; --s2: #199e70; --s3: #9085e9; --s4: #d55181;
    --s5: #12a012; --s6: #e66767; --s7: #3987e5; --s8: #d95926;
    --good-text: #0ca30c;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page:        #0a0a0a;
  --surface:     #181818;
  --surface-sunk:#212121;
  --ink:         #f5f5f5;
  --ink-2:       #b9b9b9;
  --ink-muted:   #858585;
  --hairline:    rgba(255, 255, 255, .13);
  --hairline-2:  rgba(255, 255, 255, .07);
  --grid:        #2b2b2b;
  --baseline:    #3b3b3b;
  --rail:        #080a26;
  --rail-2:      #14183a;
  --gold-soft:   rgba(188, 133, 34, .22);
  --s1: #bc8522; --s2: #199e70; --s3: #9085e9; --s4: #d55181;
  --s5: #12a012; --s6: #e66767; --s7: #3987e5; --s8: #d95926;
  --good-text: #0ca30c;
  --shadow: none;
}

/* -------------------------------------------------------------- base ---- */

* { box-sizing: border-box; }

/* our flex/grid display rules would otherwise beat the UA's [hidden] */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }

/* the editorial register: small letterspaced caps for every label */
.eyebrow {
  font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted);
}

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); padding: 10px 16px; }
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------------------- shell ---- */

.shell { display: grid; grid-template-columns: 254px minmax(0, 1fr); height: 100vh; }

/* ----------------------------------------------------------- sidebar ---- */

.sidebar {
  background: var(--rail);
  color: var(--rail-ink);
  display: flex; flex-direction: column;
  padding: 26px 0 18px;
  overflow-y: auto;
}

.brand { padding: 0 22px 22px; border-bottom: 1px solid var(--rail-line); }

.brand-mark {
  font-family: var(--sans);
  font-size: 27px; font-weight: 700; letter-spacing: .1em;
  line-height: 1; color: #fff;
}
/* the gold hairline under the wordmark is the one brand flourish */
.brand-rule { width: 30px; height: 2px; background: var(--gold); margin: 9px 0 8px; }
.brand-sub {
  font-size: 8.5px; font-weight: 500; letter-spacing: .19em;
  text-transform: uppercase; color: var(--rail-ink-2);
}

.rail-section { padding: 20px 22px 6px; }

.nav { display: flex; flex-direction: column; padding: 0 12px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px;
  color: var(--rail-ink-2);
  text-decoration: none;
  font-size: 12.5px; font-weight: 500; letter-spacing: .015em;
  border-left: 2px solid transparent;
  transition: color .12s ease, background .12s ease;
}
.nav-item:hover { color: var(--rail-ink); background: var(--rail-2); }
.nav-item.is-active {
  color: #fff; background: var(--rail-2); border-left-color: var(--gold);
}
.nav-item.is-active .nav-icon { color: var(--gold); }

.nav-icon {
  width: 15px; height: 15px; flex: none; display: inline-block;
  background: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}

/* portfolio company the dashboard is currently reporting on */
.rail-client { margin: 22px 22px 0; padding: 14px 0 0; border-top: 1px solid var(--rail-line); }
.rail-client .name {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #fff; margin-top: 6px;
}
.rail-client .name::before {
  content: ""; width: 5px; height: 5px; background: var(--gold); flex: none;
}
.rail-client .meta { font-size: 11px; color: var(--rail-ink-2); margin-top: 2px; }

.sidebar-foot { margin-top: auto; padding: 18px 22px 0; border-top: 1px solid var(--rail-line); }
.src-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.src { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--rail-ink-2); }
.src .dot { width: 6px; height: 6px; flex: none; background: var(--ink-muted); }
.src--ok .dot      { background: var(--good); }
.src--down .dot    { background: var(--critical); }
.src--pending .dot { background: var(--warning); }

/* ------------------------------------------------------------ topbar ---- */

.main-wrap { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 26px; flex-wrap: wrap;
  padding: 26px 34px 18px;
  background: var(--page);
  border-bottom: 1px solid var(--hairline);
}

.topbar-title h1 {
  font-family: var(--display);
  font-size: 26px; font-weight: 600; letter-spacing: -.01em;
  line-height: 1.15;
}
.topbar-title .eyebrow { display: block; margin-bottom: 7px; }
.topbar-title p { color: var(--ink-2); font-size: 12.5px; margin-top: 6px; max-width: 60ch; }

.filters { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 9.5px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-muted); }

.field select, .btn {
  font: inherit; font-family: var(--sans); font-size: 12.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0 11px; height: 33px;
  cursor: pointer;
}
.field select { min-width: 138px; }

.btn { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.btn:hover { border-color: var(--gold); }
.btn--icon { padding: 0 9px; }
.btn .nav-icon { width: 14px; height: 14px; color: var(--ink-2); }

/* ----------------------------------------------------------- content ---- */

.content { padding: 26px 34px 44px; }

.grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.card--half { grid-column: span 6; }
.card--full { grid-column: span 12; }

@media (max-width: 1180px) { .card--half { grid-column: span 12; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; height: auto; }
  .sidebar { flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; }
  .sidebar-foot, .rail-client, .rail-section { display: none; }
  .brand { border: 0; padding: 0 16px 0 6px; }
  .nav { flex-direction: row; }
  .nav-item { border-left: 0; border-bottom: 2px solid transparent; }
  .nav-item.is-active { border-left: 0; border-bottom-color: var(--gold); }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

/* -------------------------------------------------------------- hero ---- */

.hero {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 0; margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.hero-skeleton { grid-column: 1 / -1; color: var(--ink-muted); padding: 30px; }

/* stat cells share one slab, divided by hairlines — reads as a report header */
.stat {
  padding: 18px 20px 17px;
  border-left: 1px solid var(--hairline-2);
  display: flex; flex-direction: column; gap: 5px;
  position: relative;
}
.stat:first-child { border-left: 0; }
.stat::after {
  content: ""; position: absolute; top: 0; left: -1px; width: calc(100% + 1px); height: 2px;
  background: var(--accent, var(--gold));
}
.stat-label {
  font-size: 9.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-muted);
  display: flex; align-items: center; gap: 7px; min-height: 26px;
}
.stat-value {
  font-size: 31px; font-weight: 600; letter-spacing: -.025em; line-height: 1.05;
  /* proportional figures: tabular-nums reads loose at display sizes */
}
.stat-value .unit { font-size: 14px; color: var(--ink-2); margin-left: 3px; font-weight: 500; }
.stat-delta { font-size: 11.5px; color: var(--ink-2); font-weight: 500; }
.stat-delta.is-good { color: var(--good-text); }
.stat-delta.is-bad  { color: var(--critical); }

/* -------------------------------------------------------------- card ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  min-width: 0; scroll-margin-top: 110px;
}

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; padding: 16px 20px 12px;
  border-bottom: 1px solid var(--hairline-2);
}
.card-title h2 {
  font-family: var(--display); font-size: 16.5px; font-weight: 600; letter-spacing: -.005em;
}
.card-title p { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; }

.card-tools { display: flex; align-items: center; gap: 5px; flex: none; }

.chip {
  font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 7px; color: var(--ink-2);
  border: 1px solid var(--hairline); border-radius: 2px;
  white-space: nowrap;
}

.badge--demo {
  font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 2px;
  color: var(--gold); background: var(--gold-soft);
  border: 1px solid rgba(188, 133, 34, .45);
}

.icon-btn {
  width: 27px; height: 27px; flex: none; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 2px;
  cursor: pointer; color: var(--ink-muted);
}
.icon-btn:hover { color: var(--ink); border-color: var(--hairline); }
.icon-btn[aria-pressed="true"] { color: var(--gold); border-color: rgba(188,133,34,.45); background: var(--gold-soft); }
.icon-btn .nav-icon { width: 14px; height: 14px; }

.card-note {
  margin: 0; padding: 12px 20px;
  font-size: 12px; color: var(--ink-2);
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--hairline-2);
  border-left: 2px solid var(--gold);
}

.card-body { padding: 14px 20px 18px; flex: 1; min-width: 0; }

.card-loading { display: flex; align-items: center; gap: 9px; color: var(--ink-muted);
  font-size: 12.5px; padding: 34px 0; }
.spinner { width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--grid); border-top-color: var(--gold); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card-error {
  padding: 13px 14px; border-radius: 2px;
  background: rgba(208, 59, 59, .07);
  border: 1px solid rgba(208, 59, 59, .3);
  color: var(--critical); font-size: 12px;
}

.chart-wrap { position: relative; height: 262px; }
.card--full .chart-wrap { height: 316px; }
.chart-wrap canvas { position: absolute; inset: 0; }

/* held at reduced opacity on refetch — no skeleton flash, no layout jump */
.card.is-refreshing .chart-wrap,
.card.is-refreshing .table-wrap { opacity: .45; transition: opacity .15s ease; }

/* ------------------------------------------------------------ legend ---- */

.legend { display: flex; flex-wrap: wrap; gap: 5px 18px; padding: 0 0 14px; }
.legend-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 500; letter-spacing: .02em; color: var(--ink-2);
  background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
}
.legend-item.is-off { opacity: .35; text-decoration: line-through; }
.legend-swatch { width: 9px; height: 9px; flex: none; }
.legend-swatch--line { height: 3px; width: 15px; }

/* ------------------------------------------------------------- table ---- */

.table-wrap { overflow-x: auto; max-height: 430px; overflow-y: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 12px;
  font-variant-numeric: tabular-nums; }
.data-table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 600; font-size: 9.5px;
  text-transform: uppercase; letter-spacing: .13em; color: var(--ink-muted);
  padding: 9px 22px 9px 0; background: var(--surface);
  border-bottom: 1px solid var(--baseline); white-space: nowrap;
}
.data-table td { padding: 8px 22px 8px 0; border-bottom: 1px solid var(--hairline-2); color: var(--ink-2); }
.data-table tbody tr:hover td { background: var(--surface-sunk); }
.data-table td:first-child, .data-table th:first-child { padding-left: 2px; }
.data-table td:first-child { color: var(--ink); font-weight: 500; }
.data-table .num { text-align: right; }
.data-table td:last-child, .data-table th:last-child { padding-right: 2px; }

.coverage-table td:first-child { white-space: nowrap; color: var(--ink-2); font-weight: 500; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px;
  border: 1px solid var(--hairline); color: var(--ink-2);
  white-space: nowrap;
}
.pill::before { content: ""; width: 5px; height: 5px; background: currentColor; }
.pill--good     { color: var(--good-text); border-color: rgba(12,163,12,.35); }
.pill--warning  { color: #8a6100;          border-color: rgba(250,178,25,.45); }
.pill--serious  { color: #a2410f;          border-color: rgba(236,131,90,.45); }
.pill--critical { color: var(--critical);  border-color: rgba(208,59,59,.35); }
.pill--live     { color: var(--good-text); border-color: rgba(12,163,12,.35); }
.pill--demo     { color: var(--gold);      border-color: rgba(188,133,34,.45); background: var(--gold-soft); }
.pill--pending  { color: var(--ink-muted); }

:root[data-theme="dark"] .pill--warning,
:root:not([data-theme="light"]) .pill--warning { color: var(--warning); }
:root[data-theme="dark"] .pill--serious,
:root:not([data-theme="light"]) .pill--serious { color: var(--serious); }

/* -------------------------------------------------------------- tiles --- */

.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 0; border: 1px solid var(--hairline-2); }
.tile {
  border-left: 1px solid var(--hairline-2);
  padding: 15px 16px; display: flex; flex-direction: column; gap: 3px;
}
.tile:first-child { border-left: 0; }
.tile-label { font-size: 9.5px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-muted); }
.tile-value { font-size: 26px; font-weight: 600; letter-spacing: -.025em; margin-top: 4px; }
.tile-value .unit { font-size: 13px; color: var(--ink-2); margin-left: 2px; }

/* ------------------------------------------------------------ tooltip --- */

.chart-tip {
  position: fixed; z-index: 60; pointer-events: none;
  min-width: 140px; max-width: 270px;
  background: var(--brand-dark); color: #fff;
  border: 1px solid rgba(255,255,255,.12); border-radius: 2px;
  padding: 10px 12px; font-size: 11.5px;
  opacity: 0; transition: opacity .1s ease;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip h4 {
  margin: 0 0 7px; font-size: 9.5px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: var(--rail-ink-2);
}
.chart-tip .row { display: flex; align-items: center; gap: 9px; padding: 2px 0; color: #d8d8e2; }
.chart-tip .row .sw { width: 8px; height: 8px; flex: none; }
.chart-tip .row .val { margin-left: auto; font-weight: 600; color: #fff;
  font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- misc ---- */

.foot {
  margin-top: auto; display: flex; justify-content: space-between; gap: 16px;
  padding: 16px 34px 24px; color: var(--ink-muted); font-size: 10.5px;
  letter-spacing: .04em; border-top: 1px solid var(--hairline);
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 14px);
  background: var(--brand-dark); color: #fff; padding: 11px 18px; border-radius: 2px;
  font-size: 12.5px; border-left: 2px solid var(--gold);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
  z-index: 80;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media print {
  .sidebar, .filters, .card-tools, .toast { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .card { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Refinements: auth, section bands, card footer, headline, source states
   ========================================================================== */

/* ---------------------------------------------------------------- auth -- */

.auth-body { margin: 0; background: var(--brand-navy); }

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-plate {
  background: var(--brand-navy);
  color: #fff;
  padding: 46px 52px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
/* a single hairline grid, barely there: it reads as paper, not as decoration */
.auth-plate::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}
.auth-brand { position: relative; z-index: 1; }

.auth-plate-body { margin: auto 0; position: relative; z-index: 1; }
.auth-plate-body h1 {
  font-family: var(--display);
  font-size: clamp(36px, 4.6vw, 54px); font-weight: 600;
  line-height: 1.05; letter-spacing: -.015em; margin: 0 0 18px;
}
.auth-plate-body p {
  color: var(--rail-ink-2); font-size: 14px; max-width: 42ch; line-height: 1.6;
}

.auth-facts {
  list-style: none; margin: 0; padding: 22px 0 0;
  border-top: 1px solid var(--rail-line);
  display: flex; gap: 38px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.auth-facts li { display: flex; flex-direction: column; gap: 4px; }
.auth-facts span {
  font-size: 9.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--rail-ink-2);
}
.auth-facts strong { font-size: 15px; font-weight: 600; }

.auth-form-wrap {
  background: var(--surface);
  display: grid; place-items: center; padding: 40px 32px;
}
.auth-form { width: 100%; max-width: 360px; }
.auth-form h2 {
  font-family: var(--display); font-size: 29px; font-weight: 600;
  margin: 8px 0 10px;
}
.auth-intro { color: var(--ink-2); font-size: 12.5px; margin-bottom: 24px; }

.auth-field { display: block; margin-bottom: 15px; }
.auth-field > span {
  display: block; margin-bottom: 6px;
  font-size: 9.5px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-muted);
}
.auth-field input {
  width: 100%; height: 40px; padding: 0 12px;
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
}
.auth-field input:focus-visible { border-color: var(--gold); outline-offset: 1px; }

.btn--primary {
  width: 100%; justify-content: center; height: 40px;
  background: var(--brand-dark); color: #fff; border-color: var(--brand-dark);
  font-weight: 600; letter-spacing: .02em; margin-top: 6px;
}
.btn--primary:hover { background: var(--brand-navy); border-color: var(--brand-navy); }
:root[data-theme="dark"] .btn--primary,
:root:not([data-theme="light"]) .btn--primary {
  background: var(--gold); border-color: var(--gold); color: #141414;
}

.auth-foot {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--hairline-2);
  font-size: 11px; color: var(--ink-muted); line-height: 1.6;
}

.form-stack { display: block; max-width: 340px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-plate { padding: 30px 24px; }
  .auth-plate-body h1 { font-size: 34px; }
  .auth-facts { display: none; }
}

/* ------------------------------------------------------------- notices -- */

.notice {
  padding: 11px 14px; margin-bottom: 18px;
  font-size: 12.5px; line-height: 1.55;
  border-left: 2px solid var(--ink-muted);
  background: var(--surface-sunk);
}
.notice--error { border-left-color: var(--critical); color: var(--critical);
  background: rgba(208, 59, 59, .07); }
.notice--warn  { border-left-color: var(--gold); background: var(--gold-soft);
  color: var(--ink-2); }
.notice--good  { border-left-color: var(--good); background: rgba(12,163,12,.08);
  color: var(--good-text); }

/* ------------------------------------------------------- section bands -- */

.band { margin-bottom: 30px; }
.band:last-child { margin-bottom: 0; }

.band-head {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 14px;
}
.band-head h2 {
  font-size: 10.5px; font-weight: 600; letter-spacing: .15em;
  text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.band-rule { flex: 1; height: 1px; background: var(--hairline); }
.band-count {
  font-size: 10.5px; color: var(--ink-muted); white-space: nowrap;
  letter-spacing: .04em;
}
.band .grid { margin-bottom: 0; }

/* --------------------------------------------------------- card layout -- */

.card-head { align-items: flex-start; }

.card-headline {
  text-align: right; flex: none; padding-left: 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.hl-value {
  font-size: 21px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1;
  color: var(--ink);
}
.hl-delta { font-size: 11px; font-weight: 500; color: var(--ink-muted); }
.hl-delta.is-good { color: var(--good-text); }
.hl-delta.is-bad { color: var(--critical); }

.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 20px 12px;
  border-top: 1px solid var(--hairline-2);
  margin-top: auto;
}
.card-sources { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.card-actions { display: flex; align-items: center; gap: 4px; flex: none; }

.state-dot { width: 6px; height: 6px; flex: none; background: var(--ink-muted); }
.state-dot[data-state="live"] { background: var(--good); }
.state-dot[data-state="demo"] { background: var(--gold); }
.state-dot[data-state="pending"] { background: var(--baseline); }

.state-word {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 600;
}

.card.is-pending { background: var(--page); border-style: dashed; }
.card.is-pending .card-title h2 { color: var(--ink-2); }

.card-pending {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 26px 4px 20px; color: var(--ink-2);
}
.card-pending .nav-icon {
  width: 20px; height: 20px; flex: none; color: var(--baseline); margin-top: 2px;
}
.pending-title { display: block; font-size: 13px; color: var(--ink); }
.pending-detail { font-size: 12px; color: var(--ink-muted); margin-top: 3px; }

.card-note { margin: 0; border-top: 1px solid var(--hairline-2); border-bottom: 0; }

.tag {
  font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 5px; color: var(--gold); background: var(--gold-soft);
  border: 1px solid rgba(188,133,34,.4);
}

.stat.is-pending .stat-value { color: var(--baseline); }
.stat.is-pending::after { background: var(--baseline); }

/* -------------------------------------------------------- source cards -- */

.source-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius);
}
.source-card { padding: 16px 18px; border-left: 1px solid var(--hairline-2); }
.source-card:first-child { border-left: 0; }
.source-card header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.source-card strong { font-size: 13.5px; }
.source-card header .state-word { margin-left: auto; }
.source-note { font-size: 11.5px; color: var(--ink-2); margin-top: 7px; }
.source-detail { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.source-card.is-pending strong { color: var(--ink-2); }

/* -------------------------------------------------------- rail: source -- */

.src { display: grid; grid-template-columns: 6px 1fr auto; align-items: center; gap: 9px; }
.src-name { color: var(--rail-ink); font-size: 11.5px; }
.src-state {
  font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--rail-ink-2);
}
.src--live .dot { background: var(--good); }
.src--demo .dot { background: var(--gold); }
.src--pending .dot { background: #3b3b3b; }

/* ----------------------------------------------------------- rail: user - */

.rail-user {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--rail-line);
}
.rail-user-id { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  background: var(--gold); color: #141414;
  font-size: 12px; font-weight: 700;
}
.rail-user-id .who { display: flex; flex-direction: column; line-height: 1.25; }
.rail-user-id strong { font-size: 12.5px; color: #fff; }
.rail-user-id small {
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rail-ink-2);
}
.rail-user-actions { display: flex; gap: 14px; margin-top: 11px; }
.rail-user-actions a,
.rail-user-actions button {
  font: inherit; font-size: 11px; letter-spacing: .04em;
  color: var(--rail-ink-2); text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.rail-user-actions a:hover,
.rail-user-actions button:hover { color: #fff; }
.rail-user-actions form { display: inline; }

/* ------------------------------------------------------------- tweaks --- */

/* the nav no longer needs its own top padding: the client block sits above it */
.nav { padding-bottom: 6px; }
.rail-client { margin-top: 18px; border-top: 0; padding-top: 0; }

.card-title h2 { line-height: 1.25; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.coverage-table a { color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--hairline); }
.coverage-table a:hover { border-bottom-color: var(--gold); }
