/* ════════════════════════════════════════════════════════════════════
   CounselConnect Cases — Redesign Suite 2 · “Civic Registry”
   Government-grade monochrome: charcoal ink, paper-white registry sheets,
   hairline rules, one restrained cobalt accent. Grotesk type, tabular data.
   Light + dark themes. Shared prototype class vocabulary.
   ════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');0,8..60,700;1,8..60,600;1,8..60,700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400;1,600&family=IBM+Plex+Mono:wght@400;500&display=swap');500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Tokens · light · modern legal research, red-branded ──────────── */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Archivo', 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --bg: #f6f7f8;
  --bg2: #eceef1;
  --surface: #ffffff;
  --surface2: #f2f3f5;
  --ink: #1a1b1e;
  --ink2: #3f444d;
  --ink3: #5f6670;
  --line: #dde0e5;
  --line2: #c4c9d1;

  --accent: #c8102e;
  --accent-strong: #9f0d25;
  --on-accent: #ffffff;
  --accent-soft: #fdeeef;
  --accent-ink: #a20d24;
  --link: #b60e2a;
  --gold: #46608c;
  --gold-strong: #2e4a78;

  --oxblood: #7f1d1d;
  --ok: #157f4c;
  --warn: #96600a;
  --danger: #b3261e;
  --ok-soft: #e4f2ea;
  --warn-soft: #f8efd8;
  --danger-soft: #fbe9e7;

  --focus: #0a4ac4;
  --shadow: 0 1px 2px rgba(20,21,24,.05), 0 12px 32px -18px rgba(20,21,24,.22);
  --shadow-sm: 0 1px 1px rgba(20,21,24,.05);
  --radius: 8px;
  --radius-sm: 6px;
  --header-h: 62px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ── Tokens · dark (deep courtroom charcoal, ember red) ───────────── */
:root[data-theme='dark'] {
  --bg: #14161a;
  --bg2: #191c21;
  --surface: #1d2026;
  --surface2: #242830;
  --ink: #f0f1f4;
  --ink2: #c6cbd4;
  --ink3: #929aa6;
  --line: #2b3038;
  --line2: #3b424c;
  --accent: #e5484d;
  --accent-strong: #f2686c;
  --on-accent: #ffffff;
  --accent-soft: #3c1e22;
  --accent-ink: #f69ba0;
  --link: #f2686c;
  --gold: #6e87b5;
  --gold-strong: #a5b9dd;
  --oxblood: #b35454;
  --ok: #6fbf88;
  --warn: #e0b45e;
  --danger: #ef7f75;
  --ok-soft: #1c2c22;
  --warn-soft: #35301a;
  --danger-soft: #3a201d;
  --focus: #8fb0ff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 40px -20px rgba(0,0,0,.7);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
}

/* ── Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.16; letter-spacing: -.022em; margin: 0 0 .45em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
h3 { font-size: 1.18rem; }
h4 { font-size: .92rem; font-family: var(--font-sans); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--ink2); }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
img, svg { display: inline-block; vertical-align: middle; }
code, .mono { font-family: var(--font-mono); font-size: .9em; font-variant-numeric: tabular-nums; }
.mono { letter-spacing: 0; }
.muted { color: var(--ink2); }
.small { font-size: .85rem; }
.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: 10px; top: -70px; z-index: 200; padding: 11px 16px; background: var(--accent); color: var(--on-accent); border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; font-size: .9rem; transition: top .2s var(--ease); }
.skip-link:focus { top: 10px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.wrap-narrow { max-width: 880px; }
.wrap-wide { max-width: 1420px; }
.sec { padding: 60px 0; }
.sec-tight { padding: 36px 0; }

.sec-head { max-width: 760px; margin-bottom: 28px; }
.sec-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink3); margin-bottom: 12px;
}
.eyebrow::before { content: '▪'; font-size: .55rem; color: var(--accent); }
.sec-head.center .eyebrow::after { content: ''; }
.sec-head .title { margin-bottom: .3em; }
.lede { font-size: 1.08rem; color: var(--ink2); max-width: 62ch; }
.sec-head.center .lede { margin-inline: auto; }

.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(420px,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(230px,100%),1fr)); }
.stack > * + * { margin-top: 14px; }

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

/* ── Top strip ────────────────────────────────────────────────────── */
.topstrip { background: var(--ink); color: #cfd3da; font-size: .82rem; text-align: center; }
:root[data-theme='dark'] .topstrip { background: #0b0d10; }
.topstrip p { margin: 0; padding: 6px 14px; }
.topstrip a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ── Header ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center;
  background: var(--ink); color: #fff;
}
:root[data-theme='dark'] .brand-mark { background: var(--surface2); color: var(--ink); border: 1px solid var(--line2); }
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; text-decoration: none; }
.brand:hover .brand-name { text-decoration: none; }
.brand-name .brand-sub { color: var(--ink3); font-weight: 600; }

.nav-main { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav-item {
  position: relative; padding: 10px 13px; border-radius: 6px;
  font-size: .9rem; font-weight: 600; color: var(--ink2); text-decoration: none; white-space: nowrap;
}
.nav-item:hover { color: var(--ink); background: var(--surface2); text-decoration: none; }
.nav-item.active { color: var(--ink); }
.nav-item.active::after { content: ''; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 2px; background: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }

/* ── Buttons & icon buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font-sans); font-size: .95rem; font-weight: 600; line-height: 1.25;
  cursor: pointer; text-decoration: none; transition: all .16s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-outline { background: var(--surface); border-color: var(--line2); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); background: var(--surface2); }
.btn-ghost { background: transparent; color: var(--ink2); }
.btn-ghost:hover { background: var(--surface2); color: var(--ink); }
.btn-inverse { background: #fff; color: var(--ink); }
.btn-inverse:hover { background: var(--surface2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-sm { padding: 6px 13px; font-size: .86rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-arrow::after { content: '→'; transition: transform .16s var(--ease); }
.btn-arrow:hover::after { transform: translateX(3px); }
.link-more { font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--line2); padding-bottom: 1px; }
.link-more::after { content: ' →'; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--ink2); cursor: pointer; transition: all .14s var(--ease);
  font-family: var(--font-sans);
}
.icon-btn:hover { background: var(--surface2); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .kbd { font-family: var(--font-mono); font-size: .7rem; color: var(--ink3); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 4px; background: var(--surface); }

:root:not([data-theme='dark']) .theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }
.login-link { text-decoration: none; white-space: nowrap; }

@media (max-width: 1080px) {
  .menu-btn { display: inline-flex; width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: var(--surface2); color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
  .menu-btn svg { width: 21px; height: 21px; }
  .nav-main {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    flex-direction: column; align-items: stretch; padding: 8px 14px 14px; gap: 2px; margin: 0;
  }
  .nav-toggle-input:checked ~ .nav-main { display: flex; }
  .nav-item { border-radius: var(--radius-sm); padding: 11px 13px; }
  .nav-item.active::after { display: none; }
}

/* ── Hero (home) ──────────────────────────────────────────────────── */
.hero { padding: clamp(36px, 6vw, 76px) 0 0; }
.hero-title { font-size: clamp(2.3rem, 5.4vw, 4rem); letter-spacing: -.035em; line-height: 1.05; }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-lede { margin-top: 20px; max-width: 60ch; font-size: 1.13rem; color: var(--ink2); }
.hero-lede strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.pill-verified {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink2); font-size: .85rem; font-weight: 600;
}
.pill-verified svg { width: 15px; height: 15px; color: var(--accent); }
.trust-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; color: var(--ink2); font-size: .92rem; }
.trust-row strong { color: var(--ink); font-weight: 700; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--bg); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-weight: 700; font-size: .78rem; letter-spacing: .02em; flex: none;
}
.avatar-sm { width: 32px; height: 32px; font-size: .68rem; }
.avatar-lg { width: 68px; height: 68px; font-size: 1.3rem; }
.avatar-alt { background: var(--ink3); }
.avatar-gold { background: var(--accent); }

.feature-stack { display: grid; gap: 10px; }
.fli {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; transition: all .16s var(--ease); text-decoration: none;
}
.fli:hover { border-color: var(--line2); box-shadow: var(--shadow-sm); text-decoration: none; }
.fli-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.fli-icon svg { width: 18px; height: 18px; }
.fli-body strong { display: block; font-size: .94rem; color: var(--ink); margin-bottom: 1px; }
.fli-body span { font-size: .86rem; color: var(--ink2); line-height: 1.5; }
.fli-arrow { margin-left: auto; color: var(--line2); align-self: center; transition: transform .16s var(--ease); }
.fli:hover .fli-arrow { transform: translateX(3px); color: var(--accent); }

/* Stats band */
.stat-band { border-block: 1px solid var(--line); background: var(--bg2); }
.stat-band .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 4px; text-align: center; padding-block: 24px; }
.stat-num { font-weight: 700; font-size: clamp(1.8rem, 3vw, 2.5rem); color: var(--ink); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 6px; color: var(--ink3); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

/* Courts dark band */
.band-dark { background: var(--ink); color: #e4e7ec; padding: clamp(44px, 6vw, 80px) 0; }
:root[data-theme='dark'] .band-dark { background: #0c0e11; }
.band-dark .eyebrow { color: #aab2bf; }
.band-dark .eyebrow::before { color: var(--accent); }
.band-dark h2 { color: #fff; }
.court-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 10px; max-width: 940px; margin: 0 auto; }
.court-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 16px; border: 1px solid #3a3f48; border-radius: var(--radius-sm);
  color: #e4e7ec; text-decoration: none; transition: all .16s var(--ease);
}
.court-card:hover { background: #262a32; border-color: var(--accent); text-decoration: none; }
.court-card strong { display: block; font-size: .96rem; font-weight: 600; }
.court-card .mono { font-size: .72rem; color: #9aa2ad; letter-spacing: .06em; }
.court-card .arr { color: #9aa2ad; transition: transform .16s var(--ease); }
.court-card:hover .arr { transform: translateX(3px); color: #fff; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-hover { transition: all .16s var(--ease); text-decoration: none; color: inherit; display: block; }
.card-hover:hover { border-color: var(--line2); box-shadow: var(--shadow-sm); transform: none; text-decoration: none; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-title { font-size: 1.02rem; margin-bottom: 14px; color: var(--ink); display: flex; align-items: center; gap: 9px; letter-spacing: -.01em; }
.panel-title::before { content: ''; width: 3px; height: 16px; border-radius: 2px; background: var(--accent); }

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

/* ── Search & results ─────────────────────────────────────────────── */
.page-head { padding: 34px 0 6px; }
.page-title { margin-bottom: .12em; }
.page-sub { color: var(--ink2); font-size: 1.03rem; margin: 0; max-width: 70ch; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 0 6px; }
.toolbar .count { color: var(--ink2); font-size: .92rem; }
.toolbar .count strong { color: var(--ink); }

.searchbar { display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 6px 6px 18px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.searchbar-input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 1.03rem; color: var(--ink); min-width: 0; }
.searchbar-input::placeholder { color: var(--ink3); }
.searchbar-input:focus { outline: none; }
.searchbar .btn { border-radius: var(--radius-sm); }

.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin: 12px 0 18px;
}
.filter-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.filter-label { font-family: var(--font-mono); font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--ink3); }
.filter-group + .filter-group { padding-left: 14px; border-left: 1px solid var(--line); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--line2); background: var(--surface);
  color: var(--ink2); font-size: .86rem; font-weight: 600; cursor: pointer;
  font-family: var(--font-sans); text-decoration: none; transition: all .14s var(--ease); line-height: 1.3;
}
.chip:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .cnt { opacity: .65; font-size: .76rem; font-family: var(--font-mono); }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 4px; background: var(--surface2); border: 1px solid var(--line); color: var(--ink2); font-size: .78rem; font-weight: 600; text-decoration: none; }
.tag:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }

.results { display: grid; gap: 12px; }
.result { display: block; padding: 18px 20px; text-decoration: none; color: inherit; border-left: 3px solid transparent; }
.result:hover { border-left-color: var(--accent); text-decoration: none; }
.result-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.result h3 { font-size: 1.14rem; margin: 0 0 7px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 5px 16px; color: var(--ink3); font-size: .86rem; font-family: var(--font-mono); }
.result-meta .sep { opacity: .5; }
.result-snippet { color: var(--ink2); font-size: .95rem; margin: 11px 0 0; line-height: 1.62; }
.result-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 13px; }
.result-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Badges & outcomes */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 4px;
  font-size: .78rem; font-weight: 700; line-height: 1.5; letter-spacing: .02em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-success { 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-info { background: var(--accent-soft); color: var(--accent-ink); }
.badge-neutral { background: var(--surface2); color: var(--ink2); border-color: var(--line); }
.badge-outcome { font-weight: 700; font-size: .82rem; border-radius: 4px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* Notes / alerts / empty */
.note, .note-warn, .note-danger, .alert-banner {
  border-radius: var(--radius-sm); padding: 13px 16px; font-size: .94rem; line-height: 1.55;
  border: 1px solid; margin: 14px 0;
}
.note { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--ink); }
.note-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 32%, transparent); color: var(--ink); }
.note-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 32%, transparent); color: var(--ink); }
.alert-banner { display: flex; gap: 11px; align-items: flex-start; }
.empty {
  text-align: center; padding: 60px 22px; border: 1.5px dashed var(--line2);
  border-radius: var(--radius); background: var(--surface);
}
.empty svg { width: 40px; height: 40px; color: var(--ink3); opacity: .7; }
.empty-title { font-size: 1.3rem; margin: 12px 0 5px; letter-spacing: -.01em; }
.empty-text { color: var(--ink2); max-width: 46ch; margin: 0 auto 16px; font-size: .95rem; }

/* Breadcrumbs */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: .86rem; color: var(--ink3); padding: 16px 0 0; }
.crumb { color: var(--ink2); text-decoration: none; font-weight: 600; }
.crumb:hover { color: var(--ink); text-decoration: underline; }
.crumb.current { color: var(--ink3); font-weight: 600; }
.breadcrumb .sep { opacity: .6; }

/* Tabs & segmented */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px 0 20px; overflow-x: auto; }
.tab {
  padding: 10px 16px; font-size: .92rem; font-weight: 600; color: var(--ink2);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg-item { padding: 6px 14px; border-radius: 4px; border: 0; background: transparent; color: var(--ink2); font-size: .88rem; font-weight: 600; cursor: pointer; font-family: var(--font-sans); text-decoration: none; white-space: nowrap; }
.seg-item:hover { color: var(--ink); }
.seg-item.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 620px; }
.tbl th {
  text-align: left; padding: 11px 15px; font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink3);
  background: var(--bg2); border-bottom: 1px solid var(--line2);
  white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 13px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink2); }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg2) 55%, transparent); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--accent-soft); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: .88em; }
.tbl th.num { text-align: right; }
.tbl a.strong-link { font-weight: 700; color: var(--ink); text-decoration: none; }
.tbl a.strong-link:hover { color: var(--accent-ink); text-decoration: underline; }
.th-sort { cursor: pointer; }
.th-sort::after { content: ' ↕'; opacity: .55; font-size: .85em; }
.th-sort.asc::after { content: ' ↑'; }
.th-sort.desc::after { content: ' ↓'; }
.row-actions { display: flex; gap: 7px; justify-content: flex-end; }

/* Pager */
.pager { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 24px 0 6px; }
.page-btn {
  min-width: 38px; height: 38px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line2); background: var(--surface); color: var(--ink2);
  font-weight: 600; font-size: .9rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
}
.page-btn:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.page-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-btn.disabled { opacity: .45; pointer-events: none; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.label { font-size: .88rem; font-weight: 600; color: var(--ink); }
.label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; font: inherit; font-size: .96rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line2); border-radius: var(--radius-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
.check, .radio { display: inline-flex; align-items: center; gap: 9px; font-size: .93rem; cursor: pointer; color: var(--ink2); }
.check input, .radio input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px,100%),1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.help { font-size: .82rem; color: var(--ink3); }

/* KPI & charts */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px,100%),1fr)); gap: 14px; }
.kpi { padding: 18px 20px; }
.kpi-label { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--ink3); display: flex; align-items: center; gap: 7px; }
.kpi-num { font-weight: 700; font-size: clamp(1.7rem, 2.8vw, 2.3rem); color: var(--ink); line-height: 1.1; margin-top: 5px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-num small { font-family: var(--font-sans); font-size: .55em; font-weight: 600; color: var(--ink3); }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 700; margin-top: 7px; padding: 2px 9px; border-radius: 4px; }
.kpi-delta.up { color: var(--ok); background: var(--ok-soft); }
.kpi-delta.down { color: var(--danger); background: var(--danger-soft); }
.kpi-delta.flat { color: var(--ink3); background: var(--surface2); }
.chart-card { padding: 18px 20px; }
.chart-title { font-weight: 600; color: var(--ink); margin: 0 0 3px; display: flex; align-items: center; gap: 9px; letter-spacing: -.01em; font-size: 1rem; }
.chart-sub { color: var(--ink3); font-size: .84rem; margin-bottom: 16px; }
.chart-bars { display: flex; align-items: flex-end; gap: 5px; height: 180px; padding-top: 8px; }
.chart-bars .col { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 7px; height: 100%; align-items: end; text-align: center; }
.chart-bars .col .v { font-size: .7rem; color: var(--ink3); font-family: var(--font-mono); }
.bar { border-radius: 2px 2px 0 0; min-height: 4px; transition: filter .14s; }
.bar.up { background: var(--accent); }
.bar.down { background: var(--ink3); }
.bar.neutral { background: var(--line2); }
.bar:hover { filter: brightness(1.1); }
.col .lbl { font-size: .72rem; color: var(--ink3); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: .84rem; color: var(--ink2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.viz-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.viz-box svg { display: block; width: 100%; height: auto; }

/* Prose (brief body) */
.prose { line-height: 1.74; }
.prose h2 { font-size: 1.45rem; margin-top: 1.5em; padding-top: .3em; }
.prose h3 { font-size: 1.1rem; margin-top: 1.2em; }
.prose p { margin: .85em 0; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin: .35em 0; }
.passage {
  border-left: 3px solid var(--accent); padding: 13px 16px; margin: 13px 0;
  background: var(--bg2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.passage p { font-style: italic; color: var(--ink2); margin: 0; }
.passage-src { display: block; margin-top: 7px; font-size: .78rem; font-family: var(--font-mono); color: var(--ink3); }
.quote-block {
  border: 0; margin: 16px 0; padding: 18px 20px 12px; position: relative;
  background: var(--bg2); border-radius: var(--radius); border-left: 3px solid var(--accent);
}
.quote-block::before { content: '“'; font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--accent); opacity: .5; position: absolute; top: 4px; left: 12px; }
.quote-block p { font-size: 1.1rem; font-style: italic; line-height: 1.6; color: var(--ink); padding-left: 30px; margin: 0; }
.quote-meta { padding-left: 30px; margin-top: 8px; font-size: .8rem; color: var(--ink3); font-family: var(--font-mono); }
.hl-mark { background: color-mix(in srgb, var(--accent) 22%, transparent); padding: 0 2px; border-radius: 2px; }
.annot-note { margin-top: 9px; font-size: .86rem; color: var(--accent-ink); background: var(--accent-soft); padding: 9px 13px; border-radius: var(--radius-sm); border-left: 3px solid var(--accent); }
.cite-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 13px;
  background: var(--surface); margin: 7px 0;
}
.cite-ref { font-family: var(--font-mono); font-size: .86rem; color: var(--ink2); }
.cite-actions { display: flex; gap: 7px; }

/* TOC */
.toc { padding: 16px 18px; }
.toc-title { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--ink3); margin-bottom: 9px; }
.toc-link { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--ink2); text-decoration: none; font-size: .9rem; font-weight: 500; }
.toc-link:hover { border-left-color: var(--line2); color: var(--ink); text-decoration: none; }
.toc-link.active { border-left-color: var(--accent); color: var(--accent-ink); }

/* Meta grid */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px,100%),1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.mg-item { background: var(--surface); padding: 11px 15px; }
.mg-label { font-family: var(--font-mono); font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); margin-bottom: 3px; }
.mg-value { font-weight: 600; color: var(--ink); font-size: .95rem; }
.mg-value .mono { font-weight: 500; }

/* Steps / steppers */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px,100%),1fr)); gap: 14px; counter-reset: step; }
.step-card { position: relative; padding: 20px; }
.step-card h3 { margin: 0 0 5px; padding-left: 42px; position: relative; font-size: 1.02rem; }
.step-card h3::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: -4px; width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 4px;
  font-family: var(--font-mono); font-weight: 500; font-size: .8rem;
  color: var(--accent-ink); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.step-card p { color: var(--ink2); font-size: .92rem; margin: 0; }

/* Pricing */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px,100%),1fr)); gap: 18px; align-items: stretch; }
.price-card { padding: 26px 24px; display: flex; flex-direction: column; position: relative; }
.price-card.featured { border-color: var(--ink); box-shadow: var(--shadow); }
.price-card.featured::after { content: 'Most popular'; position: absolute; top: -11px; right: 18px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 12px; border-radius: 4px; }
.price-name { font-family: var(--font-mono); font-size: .76rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--ink3); }
.featured .price-name { color: var(--accent-ink); }
.price-amount { font-weight: 700; font-size: 2.5rem; line-height: 1.05; margin-top: 8px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.price-amount small { font-family: var(--font-sans); font-size: .9rem; font-weight: 600; color: var(--ink3); }
.price-features { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; flex: 1; }
.price-features li { display: flex; gap: 9px; align-items: flex-start; color: var(--ink2); font-size: .94rem; }
.price-features li::before { content: '✓'; font-weight: 700; color: var(--accent); flex: none; }
.price-cta { margin-top: 6px; }

/* CTA band */
.cta-band { text-align: center; padding: 64px 20px; }
.cta-band h2 { max-width: 20ch; margin-inline: auto; }
.cta-band h2 em { font-style: normal; color: var(--accent); }
.cta-band p { color: var(--ink2); max-width: 50ch; margin: 8px auto 24px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg2); margin-top: 56px; }
.foot-disclaimer { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-block: 16px; border-bottom: 1px solid var(--line); }
.foot-disclaimer-text { margin: 0; color: var(--ink2); font-size: .92rem; }
.foot-disclaimer-link { font-weight: 600; text-decoration: none; white-space: nowrap; }
.foot-grid { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr 1fr; gap: 30px; padding-block: 42px 30px; }
.foot-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink); margin: 0 0 13px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot-col a { color: var(--ink2); text-decoration: none; font-size: .93rem; }
.foot-col a:hover { color: var(--accent-ink); text-decoration: underline; }
.foot-brand p { color: var(--ink2); font-size: .9rem; max-width: 42ch; }
.foot-legal { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-block: 16px; }
.foot-legal p { margin: 0; color: var(--ink3); font-size: .82rem; }
@media (max-width: 980px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }

/* ── Admin ────────────────────────────────────────────────────────── */
body.admin { background: var(--bg); }
.admin-layout { display: grid; grid-template-columns: 248px minmax(0,1fr); min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #cdd2da;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px;
}
:root[data-theme='dark'] .sidebar { background: #0b0d10; }
.sb-brand { padding: 4px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sb-brand .brand-mark { background: #fff; color: var(--ink); }
.sb-brand .brand-name { color: #fff; }
.sb-brand .brand-name .brand-sub { color: #9aa2ad; }
.sb-nav { display: grid; gap: 2px; padding-top: 14px; overflow-y: auto; }
.sb-section { font-family: var(--font-mono); font-size: .66rem; font-weight: 500; text-transform: uppercase; letter-spacing: .16em; color: #7d8591; margin: 13px 8px 5px; }
.sb-link {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  border-radius: var(--radius-sm); color: #b9bfc9; text-decoration: none; font-weight: 500; font-size: .92rem;
}
.sb-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sb-link.active { background: var(--accent); color: #fff; }
.sb-link .sb-badge { margin-left: auto; }
.sb-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 4px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 8px; }
.user-chip .avatar { background: #fff; color: var(--ink); }
.user-chip-text { display: grid; line-height: 1.25; }
.user-chip-text strong { font-size: .88rem; color: #fff; font-weight: 600; }
.user-chip-text small { font-size: .72rem; color: #9aa2ad; }
.sb-foot .sb-link { color: #9aa2ad; }
.sb-foot .sb-link:hover { color: #fff; }
.content { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 26px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky; top: 0; z-index: 40; backdrop-filter: blur(8px); flex-wrap: wrap;
}
.topbar-title h1 { margin: 0; font-size: 1.5rem; }
.topbar-title .page-sub { font-size: .9rem; margin: 1px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.admin-main { padding: 22px 26px 56px; }
.admin-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px,100%),1fr)); gap: 12px; margin-bottom: 20px; }
.stepper { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.step { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: .74rem; font-weight: 500; color: var(--ink3); padding: 4px 10px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.step .step-num { width: 18px; height: 18px; border-radius: 3px; display: grid; place-items: center; background: var(--surface2); font-size: .64rem; }
.step.done { color: var(--ok); }
.step.done .step-num { background: var(--ok); color: #fff; }
.step.active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.step.active .step-num { background: var(--accent); color: #fff; }
.step-arrow { color: var(--ink3); }
.progress { height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.log-viewer { background: #16181c; color: #c6cbd4; border-radius: var(--radius-sm); padding: 14px 16px; font-family: var(--font-mono); font-size: .8rem; line-height: 1.7; overflow-x: auto; white-space: pre; }
.log-viewer .ok { color: #7cc58d; }
.log-viewer .err { color: #f08a80; }
.log-viewer .dim { color: #6b7380; }

/* ── Auth / login ─────────────────────────────────────────────────── */
body.auth-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(800px 480px at 50% -8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--bg); }
.auth-main { width: min(440px, calc(100% - 40px)); margin: 40px auto; }
.auth-theme-toggle { position: fixed; top: 16px; right: 16px; z-index: 30; background: var(--surface); border-color: var(--line); }
.login-card { padding: 34px 30px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.auth-note { text-align: center; font-size: .84rem; color: var(--ink3); margin-top: 14px; }
.auth-note a { font-weight: 600; }

/* ── Generic utility bits ─────────────────────────────────────────── */
.kbd { font-family: var(--font-mono); font-size: .8em; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; background: var(--surface); color: var(--ink2); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; }

/* Responsive */
@media (max-width: 1080px) {
  .header-inner { gap: 10px; }
  .login-link, .account-link { display: none !important; }
}
@media (max-width: 1180px) {
  .admin-layout { grid-template-columns: 210px minmax(0,1fr); }
}
@media (max-width: 900px) {
  .admin-layout { display: block; }
  .sidebar { position: static; height: auto; border-bottom: 1px solid var(--line); }
  .sb-foot { display: none; }
  .topbar { position: static; }
  .admin-main { padding: 18px 14px 46px; }
}

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


/* ═══ Suite 4 · Lexis/Westlaw-modern gestures (overrides) ═══ */
/* Strong crimson identity strip */
.topstrip { background: var(--accent); color: #fff; }
.topstrip a { color: #fff; }
:root[data-theme='dark'] .topstrip { background: #8f0b20; }

/* Serif display for titles + crimson accents on chrome */
h1, h2, h3 { font-family: var(--font-serif); letter-spacing: -.012em; }
.site-header { background: var(--surface); }
.brand-mark { background: var(--accent); }
.brand-name { font-family: var(--font-serif); letter-spacing: 0; }
.nav-item { font-weight: 600; }
.nav-item.active { color: var(--ink); }
.nav-item.active::after { background: var(--accent); height: 3px; }
.menu-btn { background: var(--surface); border: 1px solid var(--line2); }

/* Buttons: crimson primaries, subtle lift */
.btn-primary { background: var(--accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-inverse { background: var(--on-accent); color: var(--accent); }
.link-more { color: var(--accent-ink); border-bottom-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.seg-item.active::before { content: ''; }

/* Hero */
.pill-verified svg { color: var(--accent); }
.hero-title em { font-style: italic; color: var(--accent); }
.fli-icon { background: var(--accent-soft); color: var(--accent-ink); }
.fli-body strong { font-family: var(--font-serif); font-weight: 700; }
.fli:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.trust-row strong { color: var(--ink); }

/* Stat band */
.stat-band { background: var(--bg); }
.stat-num { color: var(--accent); font-family: var(--font-serif); }

/* Courts band: deep navy + red hairlines */
.band-dark { background: #1b2030; color: #eceef3; }
:root[data-theme='dark'] .band-dark { background: #0c0e14; }
.band-dark .eyebrow { color: #9db1d8; }
.band-dark .eyebrow::before { color: var(--accent); }
.band-dark h2 { color: #fff; }
.band-dark h2 em { color: #e8788a; }
.court-card:hover { border-color: var(--accent); }

/* Cards & case titles: serif, crimson hover text */
.brief-card h3, .result h3, .card h3 { font-family: var(--font-serif); }
.result { border-left: 3px solid transparent; }
.result:hover { border-left-color: var(--accent); }
.result:hover h3 { color: var(--accent-ink); }
.card-hover:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.panel-title::before { background: var(--accent); }
.panel-title { font-family: var(--font-serif); letter-spacing: 0; }

/* Pills & chips */
.badge-info { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.chip.active { background: var(--accent); }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.tag { color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.tag:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Tables: crisp white sheets, crimson header underline */
.tbl th { color: var(--ink2); border-bottom: 2px solid var(--accent); background: var(--surface); }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg2) 40%, transparent); }
.tbl tbody tr:hover td { background: var(--accent-soft); }
.tbl a.strong-link { font-family: var(--font-serif); letter-spacing: 0; }
.th-sort.asc::after, .th-sort.desc::after { color: var(--accent); }

/* Pagination + forms */
.page-btn.active { background: var(--accent); border-color: var(--accent); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.check input, .radio input { accent-color: var(--accent); }

/* Prose & quotations */
.passage { border-left: 4px solid var(--accent); }
.quote-block::before { color: var(--accent); }
.quote-block { border-left: 4px solid var(--accent); }
.hl-mark { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.annot-note { border-left: 4px solid var(--accent); }
.toc-link.active { border-left-color: var(--accent); color: var(--accent-ink); }
.toc-title { color: var(--ink2); }
.meta-grid { background: var(--line2); }
.mg-label { color: var(--ink3); }

/* Steps, pricing, avatars */
.step-card h3::before { background: var(--accent); color: #fff; border-color: var(--accent); }
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.price-card.featured::after { background: var(--accent); color: #fff; }
.price-amount { color: var(--ink); }
.avatar { background: var(--accent); }
.avatar-alt { background: var(--gold); }
.avatar-gold { background: #7f1d1d; color: #fff; }
.avatar-stack .avatar { border-color: var(--surface); }

/* Timeline dots & bars */
.step.done .step-num { background: var(--ok); }
.step.active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.step.active .step-num { background: var(--accent); color: #fff; }
.progress > span { background: var(--accent); }
.chart-bars .bar.up { background: var(--accent); }
.chart-bars .bar.down { background: var(--gold); }
.legend-swatch { border: 1px solid var(--line2); }

/* Admin: white sidebar, crimson active rail */
.sidebar { background: var(--surface); color: var(--ink2); border-right: 1px solid var(--line); }
.sb-brand .brand-name { color: var(--ink); }
.sb-brand .brand-name .brand-sub { color: var(--ink3); }
.sb-brand .brand-mark { background: var(--accent); }
.sb-section { color: var(--ink3); }
.sb-link { color: var(--ink2); border-left: 3px solid transparent; border-radius: 0 6px 6px 0; }
.sb-link:hover { background: var(--surface2); color: var(--ink); }
.sb-link.active { background: var(--accent-soft); color: var(--accent-ink); border-left-color: var(--accent); font-weight: 700; }
.user-chip-text strong { color: var(--ink); }
.user-chip-text small { color: var(--ink3); }
.sb-foot { border-top-color: var(--line); }
.topbar { border-bottom: 2px solid var(--line); }

/* Auth */
.login-card { border-top: 6px solid var(--accent); }
.auth-theme-toggle { background: var(--surface); border-color: var(--line2); }

/* Footer: navy bar with crimson accents */
.site-footer { border-top: 4px solid var(--accent); }
.foot-disclaimer-text strong { color: var(--ink); }
.foot-col h4 { color: var(--accent-ink); letter-spacing: .1em; }
.foot-col a:hover { color: var(--accent-ink); }

/* Citations & FAB-ish controls */
.cite-row { border-left: 4px solid var(--accent); }
.status-pill { color: var(--ink2); }

/* Accessible crimson focus ring on light, blue on dark handled via token */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

/* Editorial serif emphasis inside the brief */
.quote-block p { font-family: var(--font-serif); }
.prose .serif-para { font-family: var(--font-serif); }
.brief-card .courtline .badge { font-family: var(--font-sans); }


/* ═══════ Suite 05 · CaseDesk — left-rail workbench (red) ═══════ */
:root {
  --radius: 6px;
  --radius-sm: 4px;
  --rail-w: 234px;
}

/* App shell */
body.app { background: var(--bg); }
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }

/* Left rail */
.rail {
  width: var(--rail-w); flex: none; position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px 14px; overflow-y: auto; z-index: 60;
}
.rail-brand { padding: 2px 6px 16px; border-bottom: 1px solid var(--line); }
.rail-brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.rail-mark {
  width: 34px; height: 34px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #fff; box-shadow: var(--shadow-sm);
}
.rail-mark svg { width: 19px; height: 19px; }
.rail-word { font-family: var(--font-serif); font-weight: 800; font-size: .98rem; color: var(--ink); letter-spacing: -.01em; }
.rail-word em { font-style: normal; color: var(--accent); }
.rail-nav { display: grid; gap: 2px; padding-top: 12px; }
.rail-group { margin: 14px 8px 6px; font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink3); }
.rail-group:first-child { margin-top: 0; }
.rail-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink2); text-decoration: none; font-size: .9rem; font-weight: 600; line-height: 1.2;
}
.rail-link:hover { background: var(--surface2); color: var(--ink); }
.rail-link.active { background: var(--accent); color: #fff; }
.rail-ico { width: 18px; text-align: center; font-size: .95rem; flex: none; opacity: .85; }
.rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.rail-foot .theme-toggle { justify-content: flex-start; width: 100%; border: 0; background: transparent; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); }
.rail-foot .theme-toggle:hover { background: var(--surface2); }
.rail-foot .theme-toggle .rail-word { font-size: .9rem; font-weight: 600; color: var(--ink2); font-family: var(--font-sans); }

/* Command bar */
.rail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmdbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 24px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px); min-height: 54px;
}
.cmd-ctx { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); white-space: nowrap; }
.cmd-search {
  display: flex; align-items: center; gap: 10px; margin-left: auto; width: min(440px, 52%);
  background: var(--surface); border: 1px solid var(--line2); border-radius: 999px; padding: 7px 8px 7px 16px;
  color: var(--ink3); font: inherit; font-size: .9rem; cursor: text; text-align: left;
}
.cmd-search:hover { border-color: var(--accent); }
.cmd-search-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-toggle { display: none; }

/* App content */
.app-main { flex: 1; padding: 26px 28px 40px; width: 100%; }
.app-main > .wrap, .app-main .wrap { max-width: 1200px; }
.app-foot { border-top: 1px solid var(--line); background: var(--surface2); padding: 16px 28px; }
.app-foot p { margin: 0; font-size: .8rem; line-height: 1.6; color: var(--ink3); }
.app-foot a { font-weight: 700; }

/* CaseDesk typographic grain: file-style micro labels everywhere */
.page-head { padding: 6px 0 14px; }
.page-title { letter-spacing: -.02em; }
.eyebrow { font-family: var(--font-mono); font-weight: 500; letter-spacing: .18em; }
.panel-title { font-size: .74rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--accent-ink); }
.panel-title::before { background: var(--accent); }
.tbl th { letter-spacing: .1em; font-size: .7rem; }
.cmd-ctx + .cmd-search { }

/* Dashboard (home) helpers */
.dash { display: grid; gap: 22px; }
.dash-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.dash-kicker { margin: 0 0 4px; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 500; }
.dash h1 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.dash-lede { max-width: 60ch; color: var(--ink2); margin: 8px 0 0; }
.dash-cols { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 18px; align-items: start; }
.dash-cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px,100%),1fr)); gap: 18px; }
@media (max-width: 1050px) { .dash-cols { grid-template-columns: 1fr; } }
.filecard { padding: 18px 20px; }
.filelabel { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink3); font-weight: 500; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.filelabel::before { content: ''; width: 3px; height: 14px; background: var(--accent); border-radius: 2px; }
.stat-file { padding: 14px 16px; }
.stat-file .stat-num { font-size: 1.9rem; }
.docket-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.docket-row:last-child { border-bottom: 0; }
.docket-row:hover h3 { color: var(--accent-ink); }
.docket-row .docket-main { flex: 1; min-width: 0; }
.docket-row h3 { margin: 0 0 3px; font-size: 1.02rem; line-height: 1.35; }
.docket-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--font-mono); font-size: .74rem; color: var(--ink3); }
.docket-note { font-size: .88rem; color: var(--ink2); margin: 6px 0 0; }
.search-cols { display: grid; grid-template-columns: 292px minmax(0,1fr); gap: 20px; align-items: start; }
@media (max-width: 1080px) { .search-cols { grid-template-columns: 1fr; } }
.filter-panel { position: sticky; top: 76px; padding: 16px 16px 18px; }
.filter-panel .field { margin-bottom: 12px; }
.filter-panel .label { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); }
.filter-panel .chip { width: 100%; justify-content: flex-start; border-radius: var(--radius-sm); }
.case-file-card { padding: 18px 20px; }
.case-file-card .mg-label { font-family: var(--font-mono); font-size: .68rem; }
.verdict-ribbon { border-left: 6px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 0 0 16px; }
.verdict-ribbon p { margin: 0; font-weight: 700; color: var(--accent-ink); }

/* CaseDesk reskins on shared components */
.btn { border-radius: var(--radius-sm); font-weight: 700; }
.btn-primary { box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-1px); }
.chip, .badge, .tag, .page-btn { border-radius: var(--radius-sm); }
.card { box-shadow: var(--shadow-sm); }
.card-hover:hover { box-shadow: var(--shadow); }
.quote-block p { font-family: var(--font-sans); font-style: italic; }
.tabs .tab.active { border-bottom-width: 3px; }
.toc-link { font-size: .9rem; }
.result { padding: 16px 18px; }
.empty { border-style: solid; border-width: 1px; background: var(--surface); }
.stat-band .wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 12px; margin-block: 8px; }

/* Mobile: rail becomes an overlay drawer */
@media (max-width: 980px) {
  .rail { position: fixed; left: 0; top: 0; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .rail-main { width: 100%; }
  .app-shell.rail-open .rail { transform: translateX(0); }
  .rail-toggle { display: inline-flex; }
  .cmd-ctx { display: none; }
  .cmd-search { width: auto; flex: 1; }
  .app-main { padding: 18px 14px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* CaseDesk extras */
.chipbar { display: flex; flex-wrap: wrap; gap: 6px; }
.case-file { display: grid; gap: 14px; align-content: start; }


/* ═══ RED V2 — make the brand colour unmistakable ═══ */
/* Warm crimson-tinted canvas (light) */
:root {
  --bg: #fdf9f8;
  --bg2: #f7eeed;
  --line: #e8d3d4;
  --line2: #d5b6b9;
  --shadow: 0 1px 2px rgba(80,10,20,.05), 0 12px 32px -18px rgba(120,15,35,.25);
}
/* Warm charcoal with live ember accents (dark) */
:root[data-theme='dark'] {
  --bg: #171214;
  --bg2: #1e171a;
  --surface: #211a1d;
  --surface2: #2a2124;
  --line: #3a2a2e;
  --line2: #4d383d;
}
/* Chrome */
.site-header { border-bottom: 3px solid var(--accent); }
.eyebrow { color: var(--accent-ink); font-weight: 800; }
.eyebrow::before, .sec-head.center .eyebrow::after { background: var(--accent); }
.stat-num { color: var(--accent); }
.kpi-num { color: var(--accent); }
.kpi-delta.up { color: var(--ok); }
.result { border-left: 4px solid transparent; }
.result:hover { border-left-color: var(--accent); box-shadow: var(--shadow); }
.result:hover h3 { color: var(--accent-ink); }
.card-hover:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 16px 34px -20px color-mix(in srgb, var(--accent) 60%, transparent); }
.band-dark { border-top: 6px solid var(--accent); }
.quote-block { border-left: 5px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.quote-block::before { color: var(--accent); }
.quote-meta { color: var(--ink3); }
.step-card { border-top: 3px solid var(--accent); }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tabs { border-bottom: 2px solid var(--line); }
.page-btn.active { background: var(--accent); border-color: var(--accent); }
.breadcrumb .crumb:hover { color: var(--accent-ink); }
.fli-icon { background: var(--accent); color: #fff; }
.fli-body strong { color: var(--ink); }
.note { border-left: 4px solid var(--accent); }
.note-warn { border-left: 4px solid var(--warn); }
.note-danger { border-left: 4px solid var(--danger); }
.empty svg { color: var(--accent); }
.status-dot { border: 1px solid currentColor; }
/* Featured pricing becomes a solid red card */
.price-card.featured { background: linear-gradient(165deg, var(--accent), var(--accent-strong)); border-color: var(--accent); }
.price-card.featured .price-name { color: rgba(255,255,255,.8); }
.price-card.featured .price-amount { color: #fff; }
.price-card.featured .price-amount small { color: rgba(255,255,255,.75); }
.price-card.featured .price-features li { color: rgba(255,255,255,.92); }
.price-card.featured .price-features li::before { color: #ffd9de; }
.price-card.featured .btn-primary { background: #fff; color: var(--accent); }
.price-card.featured .btn-primary:hover { background: #ffe3e7; color: var(--accent-strong); }
/* Charts lean red */
.chart-bars .bar.up { background: var(--accent); }
.chart-bars .bar.neutral { background: color-mix(in srgb, var(--accent) 45%, var(--line2)); }
.chart-bars .bar.down { background: var(--gold); }
/* Tables: crimson-tinted header + hover wash */
.tbl th { color: var(--ink2); border-bottom: 2px solid var(--accent); }
.tbl tbody tr:hover td { background: var(--accent-soft); }
/* Dark-mode visibility boost */
:root[data-theme='dark'] .topstrip { background: #8a0d22; }
:root[data-theme='dark'] .site-header { border-bottom-color: var(--accent); }
:root[data-theme='dark'] .eyebrow { color: #f69ba0; }
:root[data-theme='dark'] .stat-num, :root[data-theme='dark'] .kpi-num { color: #f2686c; }
:root[data-theme='dark'] .result:hover h3 { color: #f69ba0; }
:root[data-theme='dark'] .band-dark { border-top-color: #e5484d; }
:root[data-theme='dark'] .quote-block { background: color-mix(in srgb, #3c1e22 55%, var(--surface)); }

/* Suite 5 · Case Desk: rail is crimson-lit, desk cards carry a red file tab */
.rail { border-right: 1px solid var(--line); }
.rail-brand { border-bottom: 2px solid var(--accent); }
.rail-word em { color: var(--accent); }
.cmdbar { border-bottom: 2px solid var(--line); }
.cmd-ctx { color: var(--accent-ink); }
.filelabel { color: var(--accent-ink); font-weight: 600; }
.dash-top { border-left: 6px solid var(--accent); padding-left: 18px; }
.filter-panel, .case-file-card, .filecard { border-top: 3px solid var(--accent); }
.stat-file { border-top: 3px solid var(--accent); }
.docket-row:hover h3 { color: var(--accent-ink); }
.docket-row:hover { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.grid-2 .grid-2 > div[style*="border"] { }
.tag { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
:root[data-theme='dark'] .rail-word em { color: #f2686c; }

