/* ════════════════════════════════════════════════════════════════════
   CaseHub · casehub.co.ke
   Built to match openworklabs.com, whose values below were MEASURED from
   its computed styles and DOM rather than eyeballed:

     container        max-width 1176px, 24px gutters
     section rhythm   120px between sections
     page / tonal     #fcfdfe / #f0f4f9
     ink / body       #011627 headings+card copy, #4b5563 paragraphs
     border           #e5e7eb hairlines, no shadows anywhere
     radius           pills 9999 · panels 24px · shells 16px · chips 12px
     h1               52px / 500 / -0.045em / 1.08
     h2               44px / 300 / -0.015em / 1.14  (36/42 below md)
     body             16px/24px · section lede 16px/25px max 640px
     nav              14px · meta 13px · card copy 15.5px/23px
     buttons          pill, weight 400, 44px tall, 0 22px padding
                      primary = ink navy · secondary = grey #e9edf2
     header           sticky, 97px, transparent, no border, no blur
     blue #2563eb     a tint only — never text, never an action colour

   Light + dark. No build step, no server: open any page directly.
   ════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;1,14..32,300;1,14..32,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── TOKENS · LIGHT ───────────────────────────────────────────────── */
:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --page:      #fcfdfe;
  --tonal:     #f0f4f9;
  --white:     #ffffff;
  --shell-top: #fafbfe;

  --ink:       #011627;   /* headings, card copy, nav active */
  --body:      #4b5563;   /* paragraphs, section ledes */
  --muted:     #6b7280;   /* kickers, labels, meta */
  --faint:     #9ca3af;   /* tertiary */

  --border:    #e5e7eb;
  --border-2:  #d5dde6;

  /* actions */
  --cta:       #011627;
  --cta-hover: #0b1e30;
  --cta-soft:  #e9edf2;
  --cta-soft-hover: #dfe5ec;

  /* blue: tint + focus only */
  --tint:      #eff6ff;
  --tint-line: #dbeafe;

  /* One restrained hue per court. Used only as a dot, a tinted badge and a
     2px row accent — never as a fill or as body text, so the page stays as
     quiet as the reference. */
  --court-kesc:   #6d28d9;   /* Supreme Court — violet */
  --court-keca:   #0f766e;   /* Court of Appeal — teal */
  --court-kehc:   #1d4ed8;   /* High Court — blue */
  --court-keelrc: #b45309;   /* ELRC — amber */
  --court-kelc:   #15803d;   /* Environment & Land — green */
  --court-scc:    #9f1239;   /* Small Claims — rose */
  --court-keic:   #7c2d12;   /* Industrial Court — rust */

  --ok:        #059669;
  --ok-soft:   #ecfdf5;
  --warn:      #b45309;
  --warn-soft: #fffbeb;
  --danger:    #dc2626;
  --danger-soft:#fef2f2;

  --light-red: #ff5f56;
  --light-amber:#ffbd2e;
  --light-green:#27c93f;

  --r-pill: 9999px;
  --r-panel: 24px;
  --r-shell: 16px;
  --r-chip: 12px;
  --r-sm: 10px;

  --wrap: 1176px;
  --gut: 24px;
  --header-h: 97px;
  --rhythm: 120px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --focus: 0 0 0 3px rgba(37, 99, 235, .3);

  color-scheme: light;
}

/* ── TOKENS · DARK ────────────────────────────────────────────────── */
html[data-theme="dark"] {
  --page:      #011627;
  --tonal:     #0a2942;
  --white:     #07203a;
  --shell-top: #0c2b47;

  --ink:       #f1f5f9;
  --body:      #c3cede;
  --muted:     #94a3b8;
  --faint:     #7b8ca3;

  --border:    #1a3a58;
  --border-2:  #24506f;

  --cta:       #f1f5f9;
  --cta-hover: #ffffff;
  --cta-soft:  #12304d;
  --cta-soft-hover: #17405f;

  --tint:      #0c2b47;
  --tint-line: #1b4570;

  --court-kesc:   #a78bfa;
  --court-keca:   #2dd4bf;
  --court-kehc:   #60a5fa;
  --court-keelrc: #fbbf24;
  --court-kelc:   #4ade80;
  --court-scc:    #fb7185;
  --court-keic:   #fb923c;

  --ok:        #34d399;
  --ok-soft:   #052e26;
  --warn:      #fbbf24;
  --warn-soft: #3a2a07;
  --danger:    #f87171;
  --danger-soft:#3a1416;

  --focus: 0 0 0 3px rgba(96, 165, 250, .38);
  color-scheme: dark;
}

/* ── RESET ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  overflow-x: hidden;              /* as the reference does on <body> */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--cta); color: var(--page);
  padding: 10px 18px; border-radius: var(--r-pill); font-size: 14px;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 14px; }

/* ── LAYOUT ───────────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
main { display: block; }
.section { margin-top: var(--rhythm); }
.section-tight { margin-top: 64px; }
.stack > * + * { margin-top: 16px; }

/* ── TYPOGRAPHY ───────────────────────────────────────────────────── */
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
h1 {
  font-size: clamp(2.125rem, 1.2rem + 3.9vw, 3.25rem);   /* -> 52px */
  font-weight: 500; letter-spacing: -.045em; line-height: 1.08;
}
h2 {
  font-size: clamp(2.25rem, 1.8rem + 1.6vw, 2.75rem);    /* 36px -> 44px */
  font-weight: 300; letter-spacing: -.015em; line-height: 1.14;
  text-wrap: balance;
}
h3 { font-size: 1.0625rem; font-weight: 500; letter-spacing: -.012em; line-height: 1.35; }
h4 { font-size: .9375rem; font-weight: 500; letter-spacing: -.008em; }
p { margin: 0; }
.lede { font-size: 16px; line-height: 25px; color: var(--body); max-width: 640px; }
.copy { font-size: 15.5px; line-height: 23px; color: var(--ink); }
.reply { font-size: 15px; line-height: 23px; color: var(--body); }
.kicker { font-size: 15px; font-weight: 400; color: var(--muted); }
.meta { font-size: 13px; line-height: 1.5; color: var(--muted); }
.note { font-size: 12.5px; color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--font-mono); font-size: .86em; font-variant-ligatures: none; }
.muted { color: var(--muted); }
.balance { text-wrap: balance; }
strong, b { font-weight: 500; color: var(--ink); }

a.underline, .prose a, .reply a, .lede a, td a, li a {
  text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px;
}
a.underline:hover, .prose a:hover, .reply a:hover, .lede a:hover, td a:hover, li a:hover {
  text-decoration-color: currentColor;
}

/* ── HEADER · 97px, transparent, no border, no blur ───────────────── */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--page); }
.header-grid {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  min-height: var(--header-h); padding-block: 16px; gap: 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: var(--cta); color: var(--page);
}
html[data-theme="dark"] .brand-mark { color: #011627; }
.brand-mark svg { width: 19px; height: 19px; }
.brand-name { font-size: 1.0625rem; font-weight: 500; letter-spacing: -.03em; color: var(--ink); white-space: nowrap; }
.brand-name span { font-family: var(--font-mono); font-size: .68rem; font-weight: 400; color: var(--faint); margin-left: 5px; letter-spacing: 0; }

.nav { display: flex; align-items: center; justify-content: flex-start; gap: 28px; padding-left: 40px; font-size: 14px; font-weight: 400; }
.nav a { color: var(--muted); transition: color .14s var(--ease); white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--ink); }
.nav .nav-new {
  font-family: var(--font-mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
  padding: 1px 6px; border-radius: var(--r-pill); margin-left: 6px;
}
.header-actions { grid-column: 3; display: flex; align-items: center; gap: 16px; }
.menu-btn {
  display: none; width: 38px; height: 38px; place-items: center; cursor: pointer;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--ink);
}
.menu-btn svg { width: 18px; height: 18px; }
.nav-toggle { display: none; }

/* bordered white pill with an icon + count, as in the reference header */
.pill-ghost {
  display: inline-flex; align-items: center; gap: 8px; height: 36px;
  padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--white);
  color: var(--muted); font-size: 14px; white-space: nowrap;
  transition: color .14s var(--ease), border-color .14s var(--ease);
}
.pill-ghost:hover { color: var(--ink); border-color: var(--border-2); }
.pill-ghost svg { width: 15px; height: 15px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-pill); color: var(--body);
  transition: background .14s var(--ease), color .14s var(--ease);
}
.icon-btn:hover { background: var(--tonal); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ── BUTTONS · pill, weight 400, 44px, no shadow ──────────────────── */
.btn, .btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border-radius: var(--r-pill);
  font-size: 16px; font-weight: 400; line-height: 1.2; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.btn-primary { background: var(--cta); color: var(--page); }
.btn-primary:hover { background: var(--cta-hover); color: var(--page); }
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .btn-primary:hover { color: #011627; }
.btn-secondary { background: var(--cta-soft); color: var(--ink); }
.btn-secondary:hover { background: var(--cta-soft-hover); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--body); min-height: 36px; padding: 0 14px; }
.btn-ghost:hover { background: var(--tonal); color: var(--ink); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 50px; padding: 0 26px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ── GIANT WORDMARK STRIP ─────────────────────────────────────────── */
.wordmark {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 40px; padding-top: 24px;
  font-size: clamp(3rem, calc(21vw - 11px), 13.5rem);
  line-height: 1; letter-spacing: -.06em; font-weight: 500;
  color: var(--ink); user-select: none;
}
.wordmark span { display: block; }

/* ── HERO · visual left, copy right, bottom-aligned ───────────────── */
.hero {
  display: grid; align-items: start; gap: 48px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
}
.hero-visual { min-width: 0; }
.hero-copy { display: flex; min-width: 0; align-items: flex-end; justify-content: flex-end; }
.hero-copy-inner { width: 100%; max-width: 520px; }
.hero h1 { margin-bottom: .36em; }
.hero-lede { font-size: 16px; line-height: 25px; color: var(--body); margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── SHELL · the light terminal/app frame with traffic lights ─────── */
.shell {
  overflow: hidden; border-radius: var(--r-shell);
  background: var(--white); border: 1px solid var(--border);
}
.shell-bar {
  position: relative; display: flex; align-items: center; height: 40px; padding-inline: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--shell-top) 90%, transparent), color-mix(in srgb, var(--shell-top) 60%, transparent));
}
.shell-lights { display: flex; gap: 6px; }
.shell-lights i {
  width: 10px; height: 10px; border-radius: 50%; display: block;
  border: 1px solid rgba(0, 0, 0, .12);
}
.shell-lights i:nth-child(1) { background: var(--light-red); }
.shell-lights i:nth-child(2) { background: var(--light-amber); }
.shell-lights i:nth-child(3) { background: var(--light-green); }
.shell-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
.shell-body { padding: 12px; }
.shell-foot {
  display: flex; flex-wrap: wrap; gap: 4px;
  border-top: 1px solid var(--border); padding: 12px;
}
.shell-caption { margin-top: 16px; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* inner panel + rail used inside shells */
.pane {
  border: 1px solid var(--border); border-radius: var(--r-chip);
  background: var(--tonal); padding: 8px;
}
.pane-flat { border: 1px solid var(--border); border-radius: var(--r-chip); background: var(--white); padding: 14px; }
.shell-split { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) { .shell-split { flex-direction: row; align-items: stretch; } }
.shell-side { display: none; }
@media (min-width: 640px) { .shell-side { display: flex; flex-direction: column; gap: 4px; width: 30%; min-width: 0; } }

/* list items inside a pane */
.pane-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 8px; border-radius: var(--r-chip);
  font-size: 12px; color: var(--body); cursor: pointer; text-align: left;
  background: transparent; border: 0; width: 100%;
  transition: background .13s var(--ease);
}
.pane-item:hover { background: var(--white); }
.pane-item.active { background: var(--white); color: var(--ink); font-weight: 500; }
.pane-item .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--ok); flex: none; }

/* ── STRIP · 3-up bordered stat/CTA strip ─────────────────────────── */
.strip {
  display: grid; gap: 16px; padding-block: 24px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--body); margin-top: 48px;
}
@media (min-width: 640px) { .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; } }
.strip-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.strip-item:hover { color: var(--ink); }
.strip-item svg { width: 15px; height: 15px; flex: none; }
@media (min-width: 640px) {
  .strip-item + .strip-item { border-left: 1px solid var(--border); padding-left: 24px; }
  .strip-item:not(:last-child) { padding-right: 24px; }
}

/* ── SECTION HEAD · kicker + h2 left, action right ────────────────── */
.section-head {
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
}
@media (min-width: 768px) { .section-head { flex-direction: row; align-items: flex-end; } }
.section-head .kicker { margin-bottom: 12px; display: block; }
.section-action { flex: none; }
.section-lede { margin-top: 24px; max-width: 640px; font-size: 16px; line-height: 25px; color: var(--body); }
.section-body { margin-top: 40px; }

/* ── TONAL CARDS · 24px radius fill, white icon chip ──────────────── */
.tonal-grid { display: grid; gap: 24px; }
@media (min-width: 768px) { .tonal-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
                           .tonal-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
                           .tonal-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tonal-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  min-height: 260px; padding: 24px; border-radius: var(--r-panel);
  background: var(--tonal); color: var(--ink);
}
.tonal-card.short { min-height: 190px; }
.tonal-card.tall { min-height: 300px; }
.tonal-card a { display: contents; }
a.tonal-card { transition: background .15s var(--ease); }
/* NOTE: a color-mix whose percentages sum to less than 100% is partly
   transparent, which washed these cards out. Keep the stops at 100%. */
a.tonal-card:hover { background: color-mix(in srgb, var(--tonal) 92%, var(--ink) 8%); }
.icon-chip {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 50%; background: var(--white); color: var(--ink);
  transition: transform .15s var(--ease);
}
.icon-chip svg { width: 20px; height: 20px; }
.tonal-card:hover .icon-chip { transform: translateY(-2px) rotate(8deg); }
.tonal-label { font-size: 14px; color: var(--muted); }
.tonal-card .copy { margin-top: 8px; }

/* ── PLAIN PANEL · hairlines, flat ────────────────────────────────── */
.panel {
  border: 1px solid var(--border); border-radius: var(--r-shell);
  background: var(--white); padding: 24px;
}
.panel-flush { padding: 0; overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.panel-body { padding: 24px; }

/* ── ROWS · hairline-separated result rows (app screens) ──────────── */
.rows { border-top: 1px solid var(--border); }
.row {
  display: block; padding: 22px 0; border-bottom: 1px solid var(--border);
  transition: background .13s var(--ease);
}
.row:hover { background: var(--tonal); }
.row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.row-title { font-size: 1.0625rem; font-weight: 500; letter-spacing: -.012em; color: var(--ink); line-height: 1.35; }
.row:hover .row-title { text-decoration: underline; text-decoration-color: var(--border-2); }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.row-meta .sep { color: var(--border-2); }
.row-snippet { margin-top: 10px; font-size: 15px; line-height: 23px; color: var(--body); max-width: 78ch; }
.row-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }

/* ── TAGS / BADGES ────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: var(--r-sm); background: var(--tonal); color: var(--body);
  font-family: var(--font-mono); font-size: .72rem;
}
a.tag:hover { background: var(--tint); color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 400;
  background: var(--tonal); color: var(--body); white-space: nowrap;
}
.badge-ink { background: var(--cta); color: var(--page); }
html[data-theme="dark"] .badge-ink { color: #011627; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-tint { background: var(--tint); color: var(--ink); }

/* ── COURT COLOUR ─────────────────────────────────────────────────── */
/* Each court carries its own hue through a dot, a tinted badge and a thin
   row accent. Add class="court-kesc" (etc.) to a .court, .badge-court or a
   .row to pick the hue up from the shared --c custom property. */
.court-kesc   { --c: var(--court-kesc); }
.court-keca   { --c: var(--court-keca); }
.court-kehc   { --c: var(--court-kehc); }
.court-keelrc { --c: var(--court-keelrc); }
.court-kelc   { --c: var(--court-kelc); }
.court-scc    { --c: var(--court-scc); }
.court-keic   { --c: var(--court-keic); }

.court { display: inline-flex; align-items: center; gap: 7px; }
.court::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, var(--muted)); flex: none;
}
.badge-court {
  background: color-mix(in srgb, var(--c, var(--muted)) 12%, transparent);
  color: color-mix(in srgb, var(--c, var(--muted)) 88%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 24%, transparent);
}
/* a whisper of colour down the edge of a case row */
.row[class*='court-'], .raw-item[class*='court-'] { box-shadow: inset 2px 0 0 var(--c); }
.row[class*='court-'] { padding-left: 16px; border-radius: 0 6px 6px 0; }
.court-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.court-legend .court {
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--white); border: 1px solid var(--border);
  font-size: 13px; color: var(--body);
}

/* ── CHIPS / SEGMENTED ────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 14px; border-radius: var(--r-pill); font-size: 14px;
  background: var(--white); border: 1px solid var(--border); color: var(--body);
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--border-2); }
.chip.active { background: var(--cta); border-color: var(--cta); color: var(--page); }
html[data-theme="dark"] .chip.active { color: #011627; }
.chip .cnt { font-family: var(--font-mono); font-size: .78em; opacity: .7; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--tonal); }
.seg-item {
  padding: 6px 14px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap;
}
.seg-item:hover { color: var(--ink); }
.seg-item.active { background: var(--white); color: var(--ink); font-weight: 500; }

/* ── SEARCH INPUT ─────────────────────────────────────────────────── */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 6px 6px 6px 20px;
  transition: border-color .15s var(--ease);
}
.searchbar:focus-within { border-color: var(--ink); box-shadow: var(--focus); }
.searchbar svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.searchbar input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: var(--font-sans); font-size: 16px; color: var(--ink); padding: 12px 0;
}
.searchbar input::placeholder { color: var(--faint); }
.searchbar-lg { max-width: 720px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-label { font-size: 13px; color: var(--muted); }

/* ── FAQ · two-column <dl> with hairline tops ─────────────────────── */
.faq { display: grid; gap: 0; margin: 0; }
@media (min-width: 768px) { .faq { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; } }
.faq-item { border-top: 1px solid var(--border); padding-block: 24px; }
.faq dt { margin-bottom: 8px; font-size: 17px; font-weight: 500; color: var(--ink); }
.faq dd { margin: 0; font-size: 15px; line-height: 28px; color: var(--body); }

/* ── CTA PANEL · tonal, copy left, buttons right ──────────────────── */
.cta-panel {
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  border-radius: var(--r-panel); background: var(--tonal);
  padding: 48px 28px;
}
@media (min-width: 900px) {
  .cta-panel { flex-direction: row; align-items: center; padding: 72px 56px; }
}
.cta-panel h2 { font-size: clamp(2.125rem, 1.9rem + .6vw, 2.5rem); line-height: 1.2; }
.cta-panel .lede { margin-top: 16px; max-width: 640px; font-size: 15px; line-height: 23px; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; flex: none; }
@media (min-width: 640px) { .cta-actions-row { flex-direction: row; flex-wrap: wrap; } }
.cta-note { font-size: 12.5px; color: var(--muted); }

/* ── TABLE ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-shell); background: var(--white); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th {
  background: var(--tonal); color: var(--muted); font-weight: 400;
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--tonal); }
.table td.num, .table th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── FORMS ────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 14px; color: var(--ink); }
.input, .select, .textarea {
  width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--ink);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-chip);
  padding: 11px 14px; outline: 0;
  transition: border-color .15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: var(--focus); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--body); }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--cta); }

/* ── METRICS ──────────────────────────────────────────────────────── */
.metrics { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.metric-num { font-size: 2rem; font-weight: 300; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric-label { margin-top: 6px; font-size: 13px; color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; }
.bars > * { flex: 1 1 0; min-width: 0; border-radius: 4px 4px 0 0; background: var(--cta); opacity: .85; }
.bars > *:hover { opacity: 1; }
.progress { height: 6px; border-radius: var(--r-pill); background: var(--tonal); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--cta); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--cta); }

/* ── TABS / BREADCRUMB / PAGER ────────────────────────────────────── */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 12px 0; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--border-2); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 40px; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--white); color: var(--body); font-size: 14px;
}
.page-btn:hover { color: var(--ink); border-color: var(--border-2); }
.page-btn.active { background: var(--cta); border-color: var(--cta); color: var(--page); }
html[data-theme="dark"] .page-btn.active { color: #011627; }
.page-btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }

/* ── RAW CASES · object viewer + judgment document ────────────────── */
.raw-layout { display: grid; gap: 24px; }
@media (min-width: 1024px) { .raw-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; } }
.raw-list { max-height: 640px; overflow-y: auto; padding: 8px; }
.raw-item {
  display: block; padding: 14px; border-radius: var(--r-chip); border: 1px solid transparent;
  transition: background .13s var(--ease);
}
.raw-item + .raw-item { margin-top: 2px; }
.raw-item:hover { background: var(--tonal); }
.raw-item.active { background: var(--tonal); border-color: var(--border); }
.raw-item-title { font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.raw-item-meta { margin-top: 7px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.raw-key { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); word-break: break-all; }
.fmt {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 6px; border-radius: 6px; background: var(--tonal); color: var(--muted); border: 1px solid var(--border);
}
.fmt-akn { background: var(--tint); color: var(--ink); border-color: var(--tint-line); }
.fmt-html { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.fmt-xml { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.fmt-pdf { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }

.doc { padding: 40px 32px; background: var(--white); }
@media (max-width: 640px) { .doc { padding: 28px 20px; } }
.doc-head { padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.doc-head h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -.028em; line-height: 1.25; margin-bottom: 10px; }
.doc-cite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.doc-cite .sep { color: var(--border-2); }
.doc-meta { display: grid; gap: 18px 24px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 24px 0 0; }
.doc-meta dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.doc-meta dd { margin: 5px 0 0; font-size: 14px; color: var(--ink); line-height: 1.5; }
.doc-body { font-size: 15.5px; line-height: 28px; color: var(--body); max-width: 74ch; }
.doc-body p { margin: 0 0 1.1em; }
.doc-sec { margin: 36px 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.doc-para { position: relative; padding-left: 46px; scroll-margin-top: calc(var(--header-h) + 24px); }
.doc-para:target { background: var(--tonal); border-radius: var(--r-sm); box-shadow: 0 0 0 10px var(--tonal); }
.para-num { position: absolute; left: 0; top: .3em; font-family: var(--font-mono); font-size: 12.5px; color: var(--faint); }
.para-num:hover { color: var(--ink); text-decoration: underline; }
.hl { background: color-mix(in srgb, var(--warn) 22%, transparent); padding: 0 2px; border-radius: 3px; }
.doc-foot { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.doc-end {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px;
  padding: 16px 18px; border: 1px dashed var(--border-2); border-radius: var(--r-chip);
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.pair { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-shell); overflow: hidden; }
@media (min-width: 768px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pair > div { background: var(--white); padding: 22px; }
.pair-head { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 12px; }
.pair-raw { font-family: var(--font-mono); font-size: 13px; line-height: 1.75; color: var(--body); }

/* ── ADMIN · sidebar shell ────────────────────────────────────────── */
body.admin { background: var(--page); }
.admin-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { border-right: 1px solid var(--border); padding: 24px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sb-brand { padding: 4px 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sb-section { margin: 18px 10px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.sb-link { display: block; padding: 9px 12px; border-radius: var(--r-chip); font-size: 14px; color: var(--body); }
.sb-link:hover { background: var(--tonal); color: var(--ink); }
.sb-link.active { background: var(--tonal); color: var(--ink); font-weight: 500; }
.sb-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
.admin-main { padding: 40px 40px 80px; min-width: 0; }
.admin-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 40px; }
.admin-head h1 { font-size: 2rem; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--tonal); color: var(--ink); font-size: 12px; font-weight: 500; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* ── AUTH ─────────────────────────────────────────────────────────── */
/* Sign-in keeps the branded header, so centre only the card and drop the
   marketing footer and the redundant back link. */
body.auth { display: flex; flex-direction: column; min-height: 100vh; }
body.auth main { flex: 1; display: grid; place-items: center; padding: 48px 24px; }
body.auth .site-footer, body.auth .auth-back { display: none; }
.auth-card { width: 100%; max-width: 420px; }
.auth-back { position: fixed; top: 24px; left: 24px; font-size: 14px; color: var(--muted); }
.auth-back:hover { color: var(--ink); }

/* ── FOOTER ───────────────────────────────────────────────────────── */
.site-footer { margin-top: var(--rhythm); padding-top: 40px; padding-bottom: 56px; font-size: 14px; color: var(--muted); }
.footer-top { border-top: 1px solid var(--border); padding-top: 40px; display: flex; flex-direction: column; gap: 24px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); } }
.footer-col h4 { margin-bottom: 14px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 400; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--body); }
.footer-col a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border-2); }
.footer-brand p { font-size: 14px; line-height: 22px; color: var(--muted); max-width: 42ch; }
.footer-legal { border-top: 1px solid var(--border); padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--faint); }
.footer-legal p { max-width: 80ch; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 7px; }

/* ── MISC ─────────────────────────────────────────────────────────── */
.empty { padding: 64px 24px; text-align: center; color: var(--muted); }
.quote { margin: 28px 0; padding-left: 24px; border-left: 2px solid var(--ink); font-size: 17px; line-height: 1.6; color: var(--ink); }
.quote cite { display: block; margin-top: 12px; font-size: 13px; font-style: normal; color: var(--muted); }
.prose { font-size: 15.5px; line-height: 28px; color: var(--body); max-width: 74ch; }
.prose > * + * { margin-top: 1em; }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.split { display: grid; gap: 40px; }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.side { position: sticky; top: calc(var(--header-h) + 24px); }
.hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
::selection { background: var(--tint); }

/* ── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  :root { --rhythm: 88px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-copy { justify-content: flex-start; align-items: flex-start; }
  .hero-copy-inner { max-width: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-main { padding: 28px 24px 64px; }
}
/* The full nav plus the corpus pill plus the CTA do not fit below ~1180px,
   so the pill goes first and the nav collapses into the menu button. Without
   this the header pushed the page wider than the viewport. */
@media (max-width: 1180px) {
  .header-actions .pill-ghost { display: none; }
}
@media (max-width: 1080px) {
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 14px 24px 20px;
    background: var(--page); border-bottom: 1px solid var(--border);
  }
  .nav a { padding: 10px 4px; font-size: 15px; }
  .nav-toggle:checked ~ .nav { display: flex; }
  .menu-btn { display: grid; grid-column: 2; justify-self: end; }
  .site-header .container { position: relative; }
  .header-grid { grid-template-columns: auto 1fr auto; }
}
@media (max-width: 767px) {
  :root { --gut: 20px; --rhythm: 64px; }
  .wordmark { font-size: clamp(2.4rem, 19vw, 6rem); letter-spacing: -.05em; padding-bottom: 24px; }
  .tonal-card { min-height: 0; gap: 24px; }
  .faq { grid-template-columns: minmax(0, 1fr); }
  .strip { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta-panel { padding: 40px 24px; }
  .raw-list { max-height: 420px; }
  .doc-para { padding-left: 38px; }
  .seg { max-width: 100%; overflow-x: auto; }
  .seg-item { flex: none; }
  /* Let a toolbar's own children shrink, so a wide segmented control scrolls
     inside them instead of widening the page. */
  .toolbar > *, .filters > *, .section-action > * { min-width: 0; }
  .toolbar { gap: 12px; }
}
@media (max-width: 520px) {
  .header-actions .pill-ghost { display: none; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .doc { padding: 24px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .wordmark, .pager, .shell-bar,
  .sidebar, .admin-head, .seg, .chips { display: none !important; }
  .admin-layout { grid-template-columns: minmax(0, 1fr) !important; }
  body { background: #fff; color: #000; }
}
