@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600&display=swap');
/* ═══════════════════════════════════════════════════════════════════════
   CounselConnect Cases — Redesign Suite 16 · "The Kiosk"
   Public-signage legibility: airport/ATM clarity + bold flat 2026.
   White field, near-black ink, THICK 3px black borders, one signage
   yellow. Touch-first FIXED BOTTOM TAB BAR replaces top navigation.
   Light + dark themes. Shared prototype class vocabulary + kiosk
   components. Archivo (signage) + IBM Plex Mono (case numbers).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tokens · light ────────────────────────────────────────────────── */
:root {
  --font-sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Archivo', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --bg: #FFFFFF;            /* white field */
  --bg2: #F3F3F1;           /* near-white well */
  --surface: #FFFFFF;       /* card surface */
  --surface2: #F1F1EE;      /* inset / zebra surface */
  --ink: #111111;           /* near-black ink  */
  --ink2: #26262B;
  --ink3: #55555A;          /* mid grey */
  --line: #D3D3D8;          /* hairline (structure uses --ink at 3px) */
  --line2: #B4B4BC;

  --accent: #111111;        /* ink-track: arrows, inline accents, bar fills */
  --accent-strong: #26262B;
  --on-accent: #FFFFFF;     /* text sitting on an accent fill (light bg) */
  --accent-soft: #ECECE7;   /* pale well for hover/soft chips */
  --accent-ink: #111111;

  --yellow: #F5B700;        /* signage yellow — fill only, never yellow text */
  --yellow-strong: #D9A400;
  --yellow-soft: #FFF3C4;
  --gold: #F5B700;
  --gold-strong: #111111;

  --ok: #1E7D3E;            /* positive green (allowed/positive status) */
  --ok-ink: #0F5C27;        /* green that clears AA on white */
  --ok-soft: #E1F0E4;
  --warn: #7A4F00;          /* amber-brown warn text on white */
  --warn-ink: #111111;
  --warn-soft: #FBECC9;
  --danger: #111111;        /* negative = solid ink plate (word + icon) */
  --danger-ink: #111111;
  --danger-soft: #ECECE7;

  --focus: #F5B700;         /* yellow halo */
  --focus-ring: #111111;    /* black core ring on light */

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 0 rgba(17,17,17,.0);
  --shadow-sm: 0 0 0 0 transparent;
  --header-h: 66px;
  --tabbar-h: 78px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ── Tokens · dark ─────────────────────────────────────────────────── */
:root[data-theme='dark'] {
  --bg: #141414;
  --bg2: #191919;
  --surface: #1D1D1D;
  --surface2: #272727;
  --ink: #F5F5F5;           /* borders + primary text = #F5F5F5 */
  --ink2: #C9C9CF;
  --ink3: #A0A0A9;
  --line: #3C3C44;
  --line2: #63636B;

  --accent: #F5F5F5;
  --accent-strong: #C9C9CF;
  --on-accent: #111111;
  --accent-soft: #2A2A2F;
  --accent-ink: #F5F5F5;

  --yellow: #F5B700;        /* unchanged on both themes */
  --yellow-strong: #FFCE3A;
  --yellow-soft: #4A3B00;
  --gold: #F5B700;
  --gold-strong: #F5F5F5;

  --ok: #3DA35D;            /* lifted green */
  --ok-ink: #86D39B;
  --ok-soft: #1D3323;
  --warn: #F5B700;          /* yellow reads on near-black */
  --warn-ink: #111111;
  --warn-soft: #44360D;
  --danger: #F5F5F5;
  --danger-ink: #F5F5F5;
  --danger-soft: #2A2A2F;

  --focus: #F5B700;
  --focus-ring: #F5F5F5;
}

/* ── Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 19px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
body.kiosk {
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.16;
  margin: 0 0 .45em;
  color: var(--ink);
}
h1 { font-size: clamp(26px, 3.6vw, 34px); }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: 22px; }
h4 { font-size: 19px; }
p { margin: 0 0 1em; }
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 3px; }
svg { display: inline-block; vertical-align: middle; }
img { max-width: 100%; }
code, .mono { font-family: var(--font-mono); }
.mono { font-size: 1em; letter-spacing: .01em; }
.muted { color: var(--ink3); }
.small { font-size: 17px; }
.strong-link { font-weight: 800; }
.num { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 14px; top: -90px; z-index: 400;
  padding: 14px 22px; background: var(--ink); color: var(--bg);
  font-weight: 800; font-size: 18px; border-radius: var(--radius);
  text-decoration: none; transition: top .18s var(--ease);
}
.skip-link:focus { top: 14px; }
::selection { background: var(--yellow); color: #111; }

/* Focus — thick ring: ink core + yellow halo, visible on both themes */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus);
  border-radius: 4px;
}
/* Remove the halo shadow side-effects for full-bleed rows */
.navlink:focus-visible, .k-task:focus-visible, .result:focus-visible { box-shadow: none; }

.divider { border: 0; border-top: 2px solid var(--ink); margin: 2rem 0; }

/* Layout containers */
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 22px; }
.wrap-narrow { max-width: 900px; }
.wrap-wide { max-width: 1380px; }
.sec { padding: 56px 0; }
.sec-tight { padding: 34px 0; }

.grid-2, .grid-3, .grid-4 { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(430px,100%),1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(300px,100%),1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(240px,100%),1fr)); }
.stack > * + * { margin-top: 18px; }

.split { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 30px; align-items: start; }
.split-main { min-width: 0; }
@media (max-width: 1020px) { .split { grid-template-columns: 1fr; } .split-side { order: -1; } }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 10px; }
.toolbar .count { color: var(--ink3); font-size: 18px; margin: 0; }
.toolbar .count strong { color: var(--ink); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ═══════ Suite 16 · "The Kiosk" chrome ───────────────────────────── */
/* Slim TOP strip — brand · My account · Help · theme only */
.k-top {
  background: var(--bg);
  border-bottom: 3px solid var(--ink);
  position: sticky; top: 0; z-index: 90;
}
.k-top-inner {
  max-width: 1380px; margin-inline: auto; padding: 8px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--header-h);
}
.brand, .k-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover, .k-brand:hover { text-decoration: none; }
.brand-mark, .k-brand-mark {
  width: 44px; height: 44px; flex: none; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--yellow); color: #111;
  border: 3px solid var(--ink);
}
.brand-mark svg, .k-brand-mark svg { width: 24px; height: 24px; }
.brand-name, .k-brand-name { font-weight: 900; font-size: 21px; letter-spacing: .015em; white-space: nowrap; color: var(--ink); }
.brand-name .brand-sub, .brand .brand-sub, .k-brand-name .brand-sub { font-family: var(--font-mono); font-weight: 600; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }

.k-top-actions { display: flex; align-items: center; gap: 6px; }
.k-toplink {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 14px; font-weight: 800; font-size: 17px;
  color: var(--ink); border-radius: var(--radius);
}
.k-toplink svg { width: 20px; height: 20px; }
.k-toplink:hover { background: var(--surface2); text-decoration: none; }
.k-theme { margin-left: 8px; }

/* Main content zone */
.k-main { min-height: 60vh; }
.k-main > .wrap, .k-main > .page-head, .k-main > article { }
.k-content { max-width: 1200px; margin-inline: auto; padding: 26px 22px 60px; }

/* Page openings shared with fragments */
.page-head { padding: 34px 0 8px; }
.page-title { margin-bottom: .18em; letter-spacing: .01em; }
.page-sub { color: var(--ink3); font-size: 19px; margin: 0; max-width: 72ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink3); margin-bottom: 12px;
}
.eyebrow::before { content: ''; height: 20px; width: 8px; background: var(--yellow); }
.lede { font-size: 20px; color: var(--ink3); max-width: 64ch; }

/* ── FIXED BOTTOM TAB BAR — the signature ─────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  display: grid; grid-template-columns: repeat(5, minmax(0,1fr));
  background: var(--surface);
  border-top: 3px solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 0 0 var(--yellow);
}
.navlink {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: calc(var(--tabbar-h) - 6px);
  min-height: 72px;
  padding: 8px 4px 10px;
  color: var(--ink2); background: transparent;
  text-decoration: none;
  border-top: 6px solid transparent; margin-top: -3px;
  font-family: var(--font-sans);
}
.navlink:hover { background: var(--surface2); color: var(--ink); text-decoration: none; }
.navlink.active {
  background: var(--yellow); color: #111111;
  border-top-color: var(--ink);
  text-decoration: none;
}
.tab-ico { display: grid; place-items: center; }
.tab-ico svg { width: 26px; height: 26px; }
.tab-label {
  font-size: 17px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  line-height: 1.05; text-align: center; white-space: nowrap;
}

/* ── Footer (scrolls above the fixed bar) ─────────────────────────── */
.k-foot {
  margin-top: 46px;
  background: var(--surface2);
  border-top: 3px solid var(--ink);
}
.k-foot-cols {
  max-width: 1380px; margin-inline: auto; padding: 34px 22px 8px;
  display: grid; grid-template-columns: 2.2fr repeat(4, 1fr); gap: 30px;
}
.k-foot-brand p { color: var(--ink2); max-width: 46ch; }
.k-foot-col h4 {
  font-size: 17px; margin: 0 0 12px; letter-spacing: .1em;
  display: flex; align-items: center; gap: 8px;
}
.k-foot-col h4::before { content: ''; width: 8px; height: 14px; background: var(--yellow); }
.k-foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.k-foot-col a { color: var(--ink2); font-weight: 600; font-size: 17px; }
.k-foot-col a:hover { color: var(--ink); }
.k-help {
  max-width: 1380px; margin: 26px auto 8px; padding: 20px 24px;
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--surface);
}
.k-help h4 { margin-bottom: 8px; }
.k-help p { margin: 0; color: var(--ink2); }
.k-foot-disclaimers {
  max-width: 1380px; margin-inline: auto; padding: 24px 22px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.k-disclaimer { margin: 0; color: var(--ink2); max-width: 80ch; }
.k-disclaimer strong { color: var(--ink); }
.k-foot-legal {
  max-width: 1380px; margin-inline: auto; padding: 14px 22px 8px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 2px solid var(--line);
}
.k-foot-legal p { margin: 0; color: var(--ink3); font-size: 17px; }
@media (max-width: 1100px) { .k-foot-cols { grid-template-columns: 1fr 1fr 1fr; } .k-foot-brand { grid-column: 1 / -1; } }
@media (max-width: 640px) { .k-foot-cols { grid-template-columns: 1fr 1fr; } }

/* ═══════ Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 26px;
  font-family: var(--font-sans); font-size: 18px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; line-height: 1.15;
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none;
  transition: background .14s var(--ease), color .14s var(--ease), transform .14s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--yellow); color: #111; border-color: var(--ink); }
.btn-primary:hover { background: var(--yellow-strong); }
.btn-outline { background: var(--surface); color: var(--ink); }
.btn-outline:hover { background: var(--surface2); }
.btn-ghost { background: transparent; color: var(--ink2); border-color: transparent; }
.btn-ghost:hover { background: var(--surface2); color: var(--ink); }
.btn-inverse { background: var(--ink); color: var(--bg); }
.btn-inverse:hover { background: var(--accent-strong); color: var(--bg); }
.btn-danger { background: var(--ink); color: var(--bg); }
.btn-danger:hover { background: var(--yellow); color: #111; }
.btn-lg { min-height: 64px; padding: 16px 34px; font-size: 21px; }
.btn-sm { min-height: 48px; padding: 8px 18px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; }
.btn-arrow::after { content: '→'; margin-left: 2px; }
.link-more { font-weight: 800; }
.link-more::after { content: ' →'; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0;
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  cursor: pointer; font-family: var(--font-sans);
  transition: background .14s var(--ease);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--yellow); color: #111; }
.icon-btn .kbd { font-family: var(--font-mono); font-size: 15px; }
/* Theme icons: show the icon of the INACTIVE (target) theme */
:root:not([data-theme='dark']) .theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }

/* ═══════ Chips · tags · badges ────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 12px 20px;
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-family: var(--font-sans); font-size: 17px; font-weight: 700; line-height: 1.2;
  cursor: pointer; text-decoration: none;
  transition: background .14s var(--ease), color .14s var(--ease);
}
a.chip { color: var(--ink); }
.chip:hover { background: var(--yellow-soft); text-decoration: none; }
.chip.active { background: var(--yellow); color: #111; border-color: var(--ink); }
.chip .cnt { font-family: var(--font-mono); font-weight: 600; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 14px;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-size: 17px; font-weight: 700; text-decoration: none;
  transition: background .14s var(--ease);
}
.tag:hover { background: var(--yellow); color: #111; text-decoration: none; }
.tag.active { background: var(--yellow); color: #111; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 5px 13px;
  border-radius: var(--radius);
  font-size: 16.5px; font-weight: 800; line-height: 1.3; letter-spacing: .03em;
  text-transform: uppercase; white-space: nowrap;
  border: 2px solid var(--ink);
  background: var(--surface); color: var(--ink);
}
.badge-info { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.badge-success { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-ink); }
.badge-warn { background: var(--yellow); color: #111; border-color: var(--ink); }
.badge-danger { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.badge-neutral { background: var(--surface2); color: var(--ink); border-color: var(--ink); }
.badge-outcome { font-size: 17px; letter-spacing: .05em; }
.status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: currentColor; flex: none; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
/* queue tones on admin */
.badge-queue { font-family: var(--font-mono); text-transform: none; letter-spacing: 0; }

/* ═══════ Cards · panels ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 24px;
}
.card-hover { transition: background .14s var(--ease), transform .14s var(--ease); text-decoration: none; color: inherit; display: block; }
a.card-hover:hover { text-decoration: none; transform: translateY(-2px); }
.panel { background: var(--surface); border: 3px solid var(--ink); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 20px; }
.panel-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 22px; margin: 0 0 14px; color: var(--ink);
}
.panel-title::before { content: ''; width: 10px; height: 24px; flex: none; background: var(--yellow); }

.recent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px,100%),1fr)); gap: 20px; }
.brief-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.brief-card .courtline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brief-card h3 { font-size: 21px; margin: 0; }
.brief-card p { color: var(--ink2); font-size: 18px; margin: 0; flex: 1; }

/* ═══════ Signals · notes · empty ──────────────────────────────────── */
.note, .note-warn, .note-danger, .alert-banner {
  border-radius: var(--radius); padding: 16px 20px;
  font-size: 18px; line-height: 1.55;
  border: 3px solid var(--ink); margin: 18px 0;
  background: var(--surface); color: var(--ink);
}
.note { background: var(--yellow-soft); }
.note-warn { background: var(--warn-soft); }
.note-danger { background: var(--danger-soft); }
.alert-banner { display: flex; gap: 14px; align-items: flex-start; }
.alert-banner > div { min-width: 0; }
.empty {
  text-align: center; padding: 64px 26px;
  border: 3px dashed var(--ink); border-radius: var(--radius);
  background: var(--bg2);
}
.empty svg { width: 52px; height: 52px; color: var(--ink); }
.empty-title { font-size: 24px; margin: 16px 0 6px; }
.empty-text { color: var(--ink3); max-width: 52ch; margin: 0 auto 20px; font-size: 18px; }

/* ═══════ Search + filters + results ──────────────────────────────── */
.searchbar {
  display: flex; gap: 12px;
  background: var(--surface);
  border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 8px 8px 8px 22px;
  align-items: center;
}
.searchbar:focus-within { box-shadow: 0 0 0 4px var(--yellow); }
.searchbar-input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font: inherit; font-size: 20px; color: var(--ink); padding: 10px 0;
}
.searchbar-input::placeholder { color: var(--ink3); opacity: 1; }
.searchbar-input:focus { outline: none; box-shadow: none; }
.searchbar .btn { flex: none; }

.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  background: var(--surface);
  border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 16px 20px; margin: 18px 0 22px;
}
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-label { font-size: 17px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); }
.filter-group + .filter-group { padding-left: 18px; border-left: 2px solid var(--ink); }

.results { display: grid; gap: 20px; }
.result { display: block; padding: 22px 24px; text-decoration: none; color: inherit; }
a.result:hover { text-decoration: none; }
a.result:hover h3 { text-decoration: underline; text-decoration-thickness: 3px; }
.result-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.result h3 { font-size: 24px; margin: 0 0 10px; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; color: var(--ink3); font-size: 17px; }
.result-meta .sep { opacity: .6; }
.result-snippet { color: var(--ink2); font-size: 18px; margin: 14px 0 0; line-height: 1.6; }
.result-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.result-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.courtline .badge, .result-meta .badge { text-transform: none; }

/* Pager — huge numbered squares */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30px 0 12px; flex-wrap: wrap; }
.page-btn {
  min-width: 56px; height: 56px; padding: 0 12px;
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-family: var(--font-sans); font-weight: 800; font-size: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
a.page-btn:hover { background: var(--yellow); text-decoration: none; }
.page-btn.active { background: var(--yellow); color: #111; }
.page-btn.disabled { opacity: .5; pointer-events: none; }

/* Tabs & segmented */
.tabs { display: flex; gap: 6px; border-bottom: 3px solid var(--ink); margin: 18px 0 22px; overflow-x: auto; padding-bottom: 0; }
.tab {
  padding: 12px 20px; font-size: 17px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  color: var(--ink2); text-decoration: none;
  border: 3px solid transparent; border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: -3px; white-space: nowrap; display: inline-flex; align-items: center; gap: 10px;
}
.tab:hover { color: var(--ink); background: var(--surface2); text-decoration: none; }
.tab.active { color: #111; background: var(--yellow); border-color: var(--ink); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface2); border: 3px solid var(--ink); border-radius: var(--radius); padding: 4px; gap: 4px; }
.seg-item {
  min-height: 48px; padding: 10px 18px; border-radius: var(--radius-sm);
  border: 3px solid transparent; background: transparent; color: var(--ink2);
  font-family: var(--font-sans); font-size: 17px; font-weight: 800;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .02em;
}
a.seg-item { display: inline-flex; align-items: center; }
.seg-item:hover { color: var(--ink); background: var(--surface); }
.seg-item.active { background: var(--yellow); color: #111; border-color: var(--ink); }

/* ═══════ Tables ───────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 18px; min-width: 640px; }
.tbl th {
  text-align: left; padding: 14px 18px;
  font-size: 16.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink); background: var(--surface2);
  border-bottom: 3px solid var(--ink); white-space: nowrap;
}
.tbl td { padding: 14px 18px; border-bottom: 2px solid var(--line); vertical-align: middle; color: var(--ink2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--yellow-soft); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.tbl th.num { text-align: right; }
.tbl a.strong-link { font-weight: 800; color: var(--ink); }
.th-sort { cursor: pointer; }
.th-sort::after { content: ' ↕'; font-size: .9em; }
.th-sort.asc::after { content: ' ↑'; }
.th-sort.desc::after { content: ' ↓'; }
caption.sr-only { position: absolute; }

/* ═══════ Forms ────────────────────────────────────────────────────── */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.label { font-size: 17px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); }
.label .req { color: var(--ink); }
.input, .select, .textarea {
  width: 100%; padding: 14px 16px; font: inherit; font-size: 18px; color: var(--ink);
  background: var(--surface); border: 3px solid var(--ink); border-radius: var(--radius);
  min-height: 54px;
}
.select { appearance: none; -webkit-appearance: none; background-image: none; }
.input::placeholder, .textarea::placeholder { color: var(--ink3); opacity: 1; }
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.check, .radio { display: inline-flex; align-items: center; gap: 12px; font-size: 18px; cursor: pointer; color: var(--ink); }
.check input, .radio input { width: 22px; height: 22px; accent-color: var(--yellow); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px,100%),1fr)); gap: 0 20px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.help { font-size: 17px; color: var(--ink3); }

/* ═══════ KPI · charts · viz ───────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px,100%),1fr)); gap: 20px; }
.kpi { padding: 22px 24px; }
.kpi-label { font-size: 17px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); display: flex; align-items: center; gap: 10px; }
.kpi-num { font-family: var(--font-sans); font-weight: 900; font-size: clamp(30px, 3.4vw, 46px); color: var(--ink); line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-num small { font-size: .6em; font-weight: 700; color: var(--ink3); }
.kpi-delta { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 800; margin-top: 10px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: var(--radius); }
.kpi-delta.up { color: var(--ok-ink); background: var(--ok-soft); }
.kpi-delta.down { color: var(--bg); background: var(--ink); }
.kpi-delta.flat { color: var(--ink3); background: var(--surface2); }

.chart-card { padding: 22px 24px; }
.chart-title { font-weight: 900; color: var(--ink); margin: 0 0 6px; display: flex; align-items: center; gap: 12px; text-transform: uppercase; letter-spacing: .02em; }
.chart-sub { color: var(--ink3); font-size: 17px; margin-bottom: 18px; }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 12px; }
.chart-bars .col { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 100%; align-items: end; text-align: center; min-width: 0; }
.chart-bars .col .v { font-size: 16.5px; color: var(--ink3); font-family: var(--font-mono); }
.bar { border: 2px solid var(--ink); min-height: 6px; border-radius: 3px 3px 0 0; }
.bar.up { background: var(--yellow); }
.bar.down { background: var(--ink); }
.bar.neutral { background: var(--line2); }
.col .lbl { font-size: 16.5px; color: var(--ink3); font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-size: 17px; color: var(--ink2); }
.legend-item { display: inline-flex; align-items: center; gap: 10px; }
.legend-swatch { width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 4px; display: inline-block; }
.viz-box { border: 3px solid var(--ink); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.viz-box svg { display: block; width: 100%; height: auto; }
.progress { height: 16px; background: var(--bg2); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--yellow); }
.spark { display: inline-block; vertical-align: middle; }

/* ═══════ Prose · quotes · citations ───────────────────────────────── */
.prose { line-height: 1.72; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose p { margin: .95em 0; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: .45em 0; }
.passage {
  border: 3px solid var(--ink); border-left: 12px solid var(--yellow);
  padding: 18px 22px; margin: 16px 0;
  background: var(--surface); border-radius: var(--radius);
}
.passage p { font-style: italic; color: var(--ink); margin: 0; font-size: 19px; }
.passage-src { display: block; margin-top: 10px; font-size: 17px; font-family: var(--font-mono); color: var(--ink3); }
.quote-block {
  border: 3px solid var(--ink); margin: 20px 0; padding: 22px 24px;
  background: var(--yellow-soft); border-radius: var(--radius); position: relative;
}
.quote-block p { font-size: 21px; font-weight: 600; line-height: 1.6; color: var(--ink); margin: 0; }
.quote-block::before { content: '“'; font-size: 60px; font-weight: 900; line-height: .6; color: #111; display: block; margin-bottom: 10px; }
.quote-meta { margin-top: 14px; font-size: 17px; color: var(--ink3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quote-meta .tag { margin-right: 2px; }
.hl-mark { background: var(--yellow-soft); padding: 1px 4px; border-radius: 3px; }
.annot-note { margin-top: 12px; font-size: 18px; color: var(--ink); background: var(--yellow-soft); padding: 12px 16px; border-radius: var(--radius); border-left: 8px solid var(--yellow); }
.cite-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border: 3px solid var(--ink); border-radius: var(--radius); padding: 14px 18px;
  background: var(--surface); margin: 10px 0;
}
.cite-ref { font-family: var(--font-mono); font-size: 18px; color: var(--ink); }
.cite-actions { display: flex; gap: 10px; }

/* TOC */
.toc { padding: 20px 22px; }
.toc-title { font-size: 17px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; color: var(--ink3); margin-bottom: 10px; }
.toc-link { display: block; padding: 10px 0 10px 18px; border-left: 6px solid var(--line); color: var(--ink2); text-decoration: none; font-size: 18px; font-weight: 700; }
.toc-link:hover { border-left-color: var(--yellow); color: var(--ink); }
.toc-link.active { border-left-color: var(--ink); color: var(--ink); }

/* Meta grid */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px,100%),1fr)); gap: 2px; background: var(--ink); border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.mg-item { background: var(--surface); padding: 14px 18px; }
.mg-label { font-size: 16.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); margin-bottom: 6px; }
.mg-value { font-weight: 800; color: var(--ink); font-size: 18px; }
.mg-value .mono { font-weight: 600; }

/* Avatars */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  font-weight: 900; font-size: 19px; letter-spacing: .02em; flex: none;
  border: 3px solid var(--ink);
}
.avatar-sm { width: 44px; height: 44px; font-size: 17px; }
.avatar-lg { width: 96px; height: 96px; font-size: 30px; }
.avatar-alt { background: var(--surface); color: var(--ink); }
.avatar-gold { background: var(--yellow); color: #111; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -12px; border-color: var(--bg); }
.avatar + .avatar { margin-left: -12px; }

/* Feature list rows */
.fli { display: flex; gap: 16px; align-items: flex-start; }
.fli-icon {
  width: 54px; height: 54px; border-radius: var(--radius); flex: none;
  display: grid; place-items: center;
  background: var(--yellow); color: #111; border: 3px solid var(--ink);
  font-weight: 900;
}
.fli-icon svg { width: 24px; height: 24px; }
.fli-body strong { display: block; font-size: 19px; color: var(--ink); margin-bottom: 4px; }
.fli-body span, .fli-body > span { font-size: 18px; color: var(--ink2); line-height: 1.55; }
.fli-arrow { font-weight: 900; color: var(--ink); }

/* Stat bands / plates */
.stat-band { border-block: 3px solid var(--ink); background: var(--bg2); }
.stat-band .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 10px; text-align: center; padding-block: 30px; }
.stat-num { font-weight: 900; font-size: clamp(34px, 5vw, 60px); color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 8px; color: var(--ink3); font-size: 17px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

/* Breadcrumb */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 18px; color: var(--ink3); padding: 20px 0 4px; }
.crumb { color: var(--ink2); text-decoration: none; font-weight: 700; }
.crumb:hover { color: var(--ink); }
.crumb.current { color: var(--ink3); font-weight: 800; }
.breadcrumb .sep { opacity: .7; }

/* Accordion */
details.card { padding: 0 20px; }
details.card summary {
  cursor: pointer; font-weight: 800; font-size: 19px; padding: 18px 0;
  list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: '+'; font-size: 26px; font-weight: 900; flex: none; }
details.card[open] summary::after { content: '–'; }
details.card[open] summary { border-bottom: 2px solid var(--line); margin-bottom: 14px; }

/* Steps / stepper (admin pipeline) */
.stepper { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.step { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; color: var(--ink3); padding: 8px 16px; border-radius: var(--radius); border: 3px solid var(--ink); background: var(--surface); }
.step .step-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); font-size: 15px; font-family: var(--font-mono); }
.step.done { color: var(--ok-ink); }
.step.done .step-num { background: var(--ok); color: #fff; }
.step.active { color: #111; background: var(--yellow); }
.step.active .step-num { background: var(--ink); color: var(--bg); }
.step-arrow { color: var(--ink3); font-weight: 900; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px,100%),1fr)); gap: 20px; }
.step-card { position: relative; padding: 24px; }
.step-card h3 { margin: 0 0 8px; padding-left: 60px; position: relative; }
.step-card h3::before {
  content: attr(data-n);
  position: absolute; left: 0; top: -8px; width: 46px; height: 46px;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--yellow); color: #111; border: 3px solid var(--ink);
  font-family: var(--font-mono); font-weight: 800; font-size: 19px;
}
.step-card p { color: var(--ink2); font-size: 18px; margin: 0; }

/* Log viewer — fixed dark console on both themes */
.log-viewer {
  background: #161616; color: #F0F0F0;
  border-radius: var(--radius); border: 3px solid var(--ink);
  padding: 18px 20px; font-family: var(--font-mono); font-size: 17px; line-height: 1.7;
  overflow-x: auto; white-space: pre;
}
.log-viewer .ok { color: #7CD68F; }
.log-viewer .err { color: var(--yellow); }
.log-viewer .dim { opacity: .72; }

/* Meta helpers */
.kbd { font-family: var(--font-mono); font-size: .9em; border: 2px solid var(--ink); border-radius: 6px; padding: 3px 8px; background: var(--surface); color: var(--ink); }
.filelabel { margin: 0 0 8px; font-family: var(--font-mono); font-size: 15.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }
.price-features { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.price-features li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink2); }
.price-features li::before { content: '✓'; font-weight: 900; color: var(--ok-ink); flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ═══════ Kiosk custom components ──────────────────────────────────── */
/* Billboard hero (home) */
.k-hero { padding: clamp(30px, 6vw, 70px) 22px clamp(26px, 5vw, 56px); max-width: 1200px; margin-inline: auto; }
.k-hero-kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 17px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink3); margin-bottom: 18px; border: 2px solid var(--ink); padding: 8px 16px; border-radius: var(--radius);
}
.k-hero-title {
  font-family: var(--font-sans); font-weight: 900; text-transform: none; letter-spacing: -.01em;
  font-size: clamp(44px, 8.6vw, 108px); line-height: .98; margin: 0 0 6px;
}
.k-hero-title .k-hl {
  background: var(--yellow); color: #111;
  padding: .02em .18em .08em; margin-left: .08em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.k-hero-sub { font-size: clamp(20px, 2.2vw, 26px); color: var(--ink3); max-width: 46ch; margin: 22px 0 0; font-weight: 500; }
.k-hero-sub strong { color: var(--ink); }

/* Giant home search */
.k-hero-search { display: flex; gap: 14px; margin: 30px 0 0; max-width: 980px; flex-wrap: wrap; }
.k-hero-search .searchbar { flex: 1 1 460px; padding-left: 26px; }
.k-hero-search .searchbar-input { font-size: clamp(21px, 2vw, 26px); min-height: 56px; }
.k-hero-search .btn { flex: none; }
.k-hero-note { margin: 14px 0 0; color: var(--ink3); font-size: 17px; }
.k-hero-note a { font-weight: 800; }

/* Big task cards */
.k-sec { max-width: 1200px; margin-inline: auto; padding: 40px 22px 8px; }
.k-sec-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
  font-size: clamp(22px, 2.6vw, 30px); color: var(--ink);
}
.k-sec-head::before { content: ''; width: 14px; height: 30px; flex: none; background: var(--yellow); border: 2px solid var(--ink); }
.k-task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(255px,100%),1fr)); gap: 20px; }
.k-task {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 24px; text-decoration: none; color: var(--ink);
  min-height: 210px; transition: background .14s var(--ease), transform .14s var(--ease);
}
a.k-task:hover { text-decoration: none; background: var(--yellow-soft); transform: translateY(-2px); }
.k-task-ico {
  width: 62px; height: 62px; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--yellow); color: #111; border: 3px solid var(--ink);
}
.k-task-ico svg { width: 30px; height: 30px; }
.k-task h3 { font-size: 21px; margin: 0; }
.k-task p { color: var(--ink2); font-size: 17.5px; margin: 0; flex: 1; }
.k-task-go { font-weight: 900; font-size: 17px; text-transform: uppercase; letter-spacing: .04em; }

/* "More ways in" bordered chip strip */
.k-more { display: flex; flex-wrap: wrap; gap: 12px; }
.k-more-link {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 14px 22px;
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-weight: 800; font-size: 18px; text-decoration: none;
}
a.k-more-link:hover { background: var(--yellow); color: #111; text-decoration: none; }

/* Stats plates */
.k-plates { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px,100%),1fr)); gap: 20px; }
.k-plate {
  background: var(--surface); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 26px; position: relative; overflow: hidden;
}
.k-plate::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 10px; background: var(--yellow); }
.k-plate.hot { background: var(--yellow); }
.k-plate.hot::before { background: var(--ink); }
.k-plate-num { font-weight: 900; font-size: clamp(44px, 7vw, 84px); line-height: .95; color: var(--ink); font-variant-numeric: tabular-nums; }
.k-plate-label { margin-top: 10px; font-size: 18px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.k-plate-note { margin: 8px 0 0; color: var(--ink3); font-size: 17px; }

/* Home disclaimers */
.k-verify-band {
  max-width: 1200px; margin: 30px auto 0; padding: 22px;
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--surface);
}
.k-verify-band h4 { margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.k-verify-band h4 svg { width: 22px; height: 22px; }
.k-verify-band p { margin: 0 0 10px; color: var(--ink2); }
.k-verify-band p:last-child { margin-bottom: 0; }

/* Numbered case-brief panels */
.k-case-wrap { max-width: 1200px; margin-inline: auto; padding: 0 22px 20px; }
.k-panel {
  background: var(--surface); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 26px; margin: 0 0 24px; scroll-margin-top: 90px;
}
.k-panel-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.k-panel-num {
  width: 58px; height: 58px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-weight: 600; font-size: 26px;
  border-radius: var(--radius);
}
.k-panel-head h2 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); }
.k-panel-body > *:last-child { margin-bottom: 0; }
.k-panel-body p { color: var(--ink2); }
.k-panel-body p strong { color: var(--ink); }

/* Billboard case header */
.k-case-billboard { margin-bottom: 26px; }
.k-bb-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.k-bb-plate {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 12px 22px;
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-size: 18px; font-weight: 800;
}
.k-bb-plate .mono { font-weight: 600; }
.k-bb-plate.court { background: var(--surface2); }
.k-bb-outcome {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 12px 30px;
  background: var(--yellow); color: #111;
  border: 3px solid var(--ink); border-radius: var(--radius);
  font-family: var(--font-sans); font-weight: 900; font-size: 22px;
  letter-spacing: .06em; text-transform: uppercase;
}
.k-bb-outcome.danger { background: var(--ink); color: var(--bg); }
.k-bb-outcome svg, .k-bb-plate svg { width: 24px; height: 24px; }
.k-case-num {
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(22px, 3vw, 34px); letter-spacing: .01em; margin: 14px 0 6px;
}
.k-bb-title { text-transform: none; font-weight: 900; letter-spacing: -.005em; font-size: clamp(30px, 4.6vw, 56px); line-height: 1.02; margin: 0; }
.k-bb-sub { color: var(--ink3); font-size: 19px; margin-top: 12px; }
.k-bb-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

/* Signage outcome plate (big) */
.k-signage {
  display: inline-flex; align-items: center; gap: 16px;
  background: var(--yellow); color: #111;
  border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 18px 34px;
  font-weight: 900; text-transform: uppercase; letter-spacing: .1em;
  font-size: clamp(20px, 2.4vw, 28px); line-height: 1.1;
}
.k-signage svg { width: 30px; height: 30px; flex: none; }

/* Bordered quotable extract with page-pin */
.k-extract {
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 22px; margin: 16px 0;
  position: relative;
}
.k-extract blockquote { margin: 0; }
.k-extract blockquote p { font-size: 19px; font-style: italic; color: var(--ink); margin: 0; }
.k-extract-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.k-pin {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-weight: 600; font-size: 17px;
  color: var(--ink); background: var(--yellow-soft);
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 6px 14px; text-decoration: none;
}
a.k-pin:hover { background: var(--yellow); text-decoration: none; }
.k-pin svg { width: 18px; height: 18px; }

/* Case record list / timeline */
.k-record { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.k-record li {
  display: grid; grid-template-columns: 210px 1fr; gap: 18px;
  border-bottom: 2px solid var(--line); padding: 14px 0;
}
.k-record li:last-child { border-bottom: 0; }
.k-record .k-rec-date { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
@media (max-width: 620px) { .k-record li { grid-template-columns: 1fr; gap: 4px; } }

/* Giant NOT FOUND plate (404) */
.k-nf { max-width: 1100px; margin-inline: auto; padding: clamp(30px, 7vw, 90px) 22px; text-align: center; }
.k-nf-plate {
  display: inline-block;
  background: var(--yellow); color: #111;
  border: 4px solid var(--ink); border-radius: var(--radius);
  font-weight: 900; font-size: clamp(46px, 11vw, 120px);
  letter-spacing: .06em; padding: .12em .4em;
  line-height: 1.05; margin-bottom: 28px;
}
.k-nf-plate.outline { background: var(--surface); margin-left: 14px; }
.k-nf h1 { margin-bottom: 14px; }
.k-nf p.lede { margin-inline: auto; }
.k-nf-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* Search page — labelled big selects */
.k-filters {
  background: var(--surface);
  border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 22px; margin: 0 0 24px;
}
.k-filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px,100%),1fr)); gap: 14px 20px; }
.k-filters-grid .field { margin-bottom: 0; }
.k-filter-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.k-sort-row { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.k-chip-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Case title row on search results */
.k-result-title { margin: 0; }
a.card.result { text-decoration: none; }
a.card.result:hover h3 { text-decoration: underline; text-decoration-thickness: 3px; }
.k-result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.k-result-meta .mono { color: var(--ink3); }
.k-result-plate {
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 4px 12px; font-weight: 800; font-size: 16.5px; text-transform: uppercase; letter-spacing: .03em;
  background: var(--surface); color: var(--ink); white-space: nowrap;
}
.k-result-plate.court { background: var(--surface2); text-transform: none; letter-spacing: 0; font-weight: 700; }
.k-result-plate.ok { background: var(--ok-soft); color: var(--ok-ink); }
.k-result-plate.warn { background: var(--yellow); color: #111; }
.k-result-plate.danger { background: var(--ink); color: var(--bg); }
.k-result-plate svg { width: 18px; height: 18px; }
.k-open-btn { margin-left: auto; }

/* AI-generate verify banner (bordered notice) */
.k-verify {
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--yellow-soft); padding: 18px 22px; margin: 0 0 22px;
  display: flex; gap: 18px; align-items: flex-start;
}
.k-verify svg { width: 30px; height: 30px; flex: none; margin-top: 2px; }
.k-verify p { margin: 0; color: var(--ink); }
.k-verify p strong { font-weight: 900; }
.k-verify .btn { margin-top: 10px; }

/* ═══════ Admin shell (staff console — no tab bar) ─────────────────── */
body.admin { padding-bottom: 0; background: var(--bg); }
.admin-layout { display: grid; grid-template-columns: 286px minmax(0,1fr); min-height: 100vh; }
.sidebar {
  background: var(--surface2);
  border-right: 3px solid var(--ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 20px 16px; overflow-y: auto;
}
.sb-brand { padding: 4px 6px 18px; border-bottom: 3px solid var(--ink); }
.sb-brand .brand { display: flex; }
.sb-nav { display: grid; gap: 4px; padding-top: 18px; }
.sb-section { font-size: 16.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; color: var(--ink3); margin: 16px 10px 6px; }
.sb-link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; min-height: 52px;
  border-radius: var(--radius); border: 3px solid transparent;
  color: var(--ink2); text-decoration: none; font-weight: 800; font-size: 18px;
}
.sb-link:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.sb-link.active { background: var(--yellow); color: #111; border-color: var(--ink); }
.sb-link .sb-badge { margin-left: auto; }
.sb-label { flex: 1; }
.sb-foot { margin-top: auto; padding-top: 16px; border-top: 3px solid var(--line); display: grid; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.user-chip-text { display: grid; line-height: 1.3; min-width: 0; }
.user-chip-text strong { font-size: 18px; color: var(--ink); }
.user-chip-text small { font-size: 15.5px; color: var(--ink3); }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 30px;
  border-bottom: 3px solid var(--ink);
  background: var(--bg);
  position: sticky; top: 0; z-index: 60; flex-wrap: wrap;
}
.topbar-title h1 { margin: 0; font-size: clamp(22px, 2.4vw, 30px); }
.topbar-title .page-sub { font-size: 18px; margin: 4px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-main { padding: 28px 30px 90px; flex: 1; }
.admin-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px,100%),1fr)); gap: 20px; margin-bottom: 24px; }
.admin-main .stat-label { font-size: 17px; }

/* ═══════ Auth / login ─────────────────────────────────────────────── */
body.auth-page {
  padding: 0; min-height: 100vh;
  display: grid; place-items: center;
  background: var(--bg);
}
.auth-main { width: min(560px, calc(100% - 40px)); margin: 90px auto 40px; }
.auth-theme-toggle { position: fixed; top: 20px; right: 20px; z-index: 60; }
.login-card { padding: 44px 40px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-note { text-align: center; font-size: 17px; color: var(--ink3); margin-top: 18px; }
.auth-note a { font-weight: 800; }

/* ═══════ Responsive ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .admin-layout { grid-template-columns: 236px minmax(0,1fr); }
}
@media (max-width: 900px) {
  body.kiosk { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px); }
  .navlink { min-height: 66px; }
  .admin-layout { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 3px solid var(--ink); }
  .sb-foot { display: none; }
  .topbar { position: static; }
  .admin-main { padding: 22px 18px 70px; }
  .k-brand-name { font-size: 19px; }
  .tab-label { font-size: 15px; }
  .k-bb-outcome { font-size: 19px; padding: 12px 20px; }
}
@media (max-width: 640px) {
  .k-top-inner { padding: 8px 12px; }
  /* keep icon links accessible when the word labels collapse to icons */
  .k-toplink span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .k-toplink { padding: 10px 8px; }
  .tab-label { font-size: 14.5px; letter-spacing: .02em; }
  .k-task { min-height: 0; }
  .k-foot-legal { display: grid; gap: 6px; }
  .k-plate { padding: 20px; }
}
@media (max-width: 460px) {
  .k-brand-name { display: none; } /* scale-mark only — room for account/help/theme */
}
@media (max-width: 560px) {
  .k-top-inner { gap: 10px; }
}
/* ~360px phones: keep everything ≥ 320 wide */
@media (max-width: 360px) {
  .wrap, .k-case-wrap, .k-hero { padding-inline: 14px; }
  .tab-ico svg { width: 22px; height: 22px; }
  .navlink { min-height: 62px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
