/* ===================================================================
   MARYLAND JUVENILE CASE LAW — "The Brief" Design System

   An editorial, content-forward design using the Maryland flag palette:
   Black (#000000) for text, Crimson (#7B2332) for accent,
   Gold (#c8a415) for interactive highlights, White (#fcfbf8) surfaces.

   Fonts: Playfair Display (serif headings) + DM Sans (sans-serif body)
   =================================================================== */

/* ---------------------------------------------------------------------------
   I. DESIGN TOKENS — Maryland flag palette, typography, spacing
   --------------------------------------------------------------------------- */

:root {
  /* ── Maryland flag palette ── */
  --md-black:           #000000;
  --md-black-soft:      #000000;
  --md-black-muted:     #000000;
  --md-crimson:         #7B2332;
  --md-crimson-light:   #943a4a;
  --md-crimson-dark:    #5c1a26;
  --md-crimson-pale:    #f3e4e7;
  --md-gold:            #c8a415;
  --md-gold-bright:     #ddb321;
  --md-gold-pale:       #f5ecc8;
  --md-gold-wash:       #faf5e4;
  --md-white:           #fcfbf8;

  /* ── Surface & background ── */
  --surface-primary:    #fcfbf8;
  --surface-card:       #ffffff;
  --surface-sidebar:    #f5f1e8;
  --surface-hover:      #f0eadf;
  --surface-accent:     #eee5d5;
  --surface-code:       #f8f5ee;

  /* ── Text hierarchy ── */
  --text-primary:       #000000;
  --text-secondary:     #000000;
  --text-muted:         #000000;
  --text-faint:         #000000;
  --text-inverse:       #fcfbf8;

  /* ── Borders & separators ── */
  --border-light:       #e6e0d4;
  --border-medium:      #d6cfc0;
  --border-strong:      #bfb7a6;

  /* ── Semantic colors ── */
  --success-bg:         #f0f7f0;
  --success-border:     #8fbc8f;
  --success-text:       #2d5a2d;
  --warning-bg:         #fef9ee;
  --warning-border:     #d4a84b;
  --warning-text:       #7a5c1f;
  --info-bg:            #f0f4fa;
  --info-border:        #6b8cbc;
  --info-text:          #2c4a6e;

  /* ── Tag category colors — muted legal palette ── */
  --color-topic:        #2b5797;
  --color-topic-bg:     #e8eff8;
  --color-stage:        #3a6b4a;
  --color-stage-bg:     #e6f2ea;
  --color-constitutional: #7a3b2e;
  --color-constitutional-bg: #f5e8e5;
  --color-remedy:       #8b6914;
  --color-remedy-bg:    #faf3e0;
  --color-standard:     #5b3d7a;
  --color-standard-bg:  #f0eaf5;
  --color-statute:      #556270;
  --color-statute-bg:   #ebeef1;

  /* ── Court badge colors — heraldic differentiation ── */
  --color-scm:          var(--md-black);
  --color-scm-text:     var(--md-gold-bright);
  --color-acm:          var(--md-crimson);
  --color-acm-text:     var(--md-white);

  /* ── Typography ── */
  --font-serif:         'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-sans:          'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:          'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* ── Spacing ── */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-xxl: 3rem;

  /* ── Border radius ── */
  --radius-sm:  2px;
  --radius-md:  5px;
  --radius-lg:  8px;
  --radius-xl:  12px;

  /* ── Shadows ── */
  --shadow-subtle:  0 1px 3px rgba(35,35,35,0.05);
  --shadow-card:    0 2px 8px rgba(35,35,35,0.07);
  --shadow-lifted:  0 4px 16px rgba(35,35,35,0.1);
  --shadow-deep:    0 8px 32px rgba(35,35,35,0.12);
}

/* ---------------------------------------------------------------------------
   II. BASE RESET & GLOBAL STYLES
   --------------------------------------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--surface-primary);
  color: #000000;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Force all text elements black */
body, p, span, div, li, td, th, dt, dd, label,
h1, h2, h3, h4, h5, h6,
blockquote, figcaption, details, summary,
.text-muted, .text-small,
.prose-block, .prose-reasoning, .prose-lead,
.prose-list li, .prose-facts p,
.editorial-section, .editorial-section p,
.holding-statement, .holding-detail,
.rule-of-law, .rule-of-law .prose-block,
.practice-note, .practice-note .prose-block,
.enrichment-summary-text,
.issue-text, .holdings-summary,
.statute-title, .statute-subsection,
.version-info, .stat-num, .stat-label,
.toc-link, .toc-issue-text,
.disposition-text .prose-block,
.reference-only-notice,
.verification-banner {
  color: #000000;
}

/* Override Pico's defaults */
:root {
  --pico-font-family: var(--font-sans);
  --pico-border-radius: var(--radius-md);
  --pico-background-color: var(--surface-primary);
  --pico-color: var(--text-primary);
  --pico-muted-color: var(--text-muted);
  --pico-muted-border-color: var(--border-light);
  --pico-secondary: var(--text-secondary);
  --pico-primary: var(--md-crimson);
  --pico-primary-hover: var(--md-crimson-light);
}

a {
  color: var(--md-crimson);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--md-gold);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

/* Container override for max-width */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}


/* ---------------------------------------------------------------------------
   III. NAVIGATION — Gold stripe + black bar (The Banner header)
   --------------------------------------------------------------------------- */

.header-accent {
  height: 3px;
  background: var(--md-gold);
}

header.site-header {
  background: var(--md-black);
  position: sticky;
  top: 0;
  z-index: 200;
}

header.site-header .container {
  padding-top: 0;
  padding-bottom: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-inverse);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.site-brand:hover { color: var(--md-gold-bright); }

.brand-seal {
  color: var(--md-gold-bright);
  flex-shrink: 0;
  display: block;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav-links a {
  display: flex;
  align-items: center;
  height: 3.5rem;
  padding: 0 var(--space-lg);
  color: rgba(252, 251, 248, 0.7);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.site-nav-links a:hover,
.site-nav-links a[aria-current="page"] {
  color: var(--md-gold-bright);
  border-bottom-color: var(--md-gold);
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--md-gold-bright);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  margin: 0;
  line-height: 1;
}

/* Brand tagline */
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: var(--text-inverse);
}
.brand-text span {
  color: inherit;
}
.brand-tagline {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(200, 164, 21, 0.5);
  margin-top: 1px;
}

/* Tools dropdown */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  height: 3.5rem;
  padding: 0 var(--space-lg);
  color: rgba(252, 251, 248, 0.7);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  gap: 0.3rem;
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger[aria-current="page"] {
  color: var(--md-gold-bright);
  border-bottom-color: var(--md-gold);
}
.dropdown-caret {
  font-size: 0.6rem;
  transition: transform 0.15s;
}
.nav-dropdown.open .dropdown-caret {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 190px;
  background: var(--md-black);
  border: 1px solid rgba(252, 251, 248, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  list-style: none;
  padding: var(--space-xs) 0;
  margin: 0;
  z-index: 300;
}
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.55rem 1.2rem;
  color: rgba(252, 251, 248, 0.8);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: none;
  height: auto;
  transition: background 0.12s, color 0.12s;
}
.nav-dropdown-menu a:hover {
  background: rgba(252, 251, 248, 0.06);
  color: var(--md-gold-bright);
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav { flex-wrap: wrap; height: auto; padding: var(--space-sm) 0; }
  .site-brand { font-size: 0.95rem; }
  .brand-tagline { display: none; }
  .site-nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: var(--space-sm) 0;
  }
  .site-nav.nav-open .site-nav-links { display: flex; }
  .site-nav-links li { width: 100%; }
  .site-nav-links a {
    height: 2.5rem;
    padding: 0 var(--space-md);
    font-size: 0.78rem;
    justify-content: flex-start;
  }
  /* Mobile: dropdown becomes inline */
  .nav-dropdown-trigger {
    height: 2.5rem;
    padding: 0 var(--space-md);
    font-size: 0.78rem;
    justify-content: flex-start;
    width: 100%;
  }
  .nav-dropdown-menu {
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    min-width: 0;
    padding: 0;
  }
  .nav-dropdown.open .nav-dropdown-menu,
  .site-nav.nav-open .nav-dropdown-menu {
    display: block;
  }
  .nav-dropdown-menu a {
    padding: 0.4rem var(--space-md) 0.4rem calc(var(--space-md) + 1rem);
    font-size: 0.75rem;
    color: rgba(252, 251, 248, 0.6);
  }
}

/* ---------------------------------------------------------------------------
   III-B. EDITORIAL HOMEPAGE — "The Brief"
   --------------------------------------------------------------------------- */

/* Editorial Header */
.editorial-header {
  text-align: center;
  padding: var(--space-md) 0 var(--space-sm);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-sm);
}
.editorial-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--md-black);
}
.editorial-desc {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto var(--space-sm);
  line-height: 1.5;
}
.editorial-search {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
}
.editorial-search input[type="search"] {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  font-family: var(--font-sans);
  color: var(--md-black);
  margin-bottom: 0;
}
.editorial-search button {
  padding: 0.5rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--md-crimson);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  letter-spacing: 0.03em;
  transition: background 0.15s;
  width: auto;
}
.editorial-search button:hover {
  background: #5a1520;
}
.editorial-search input[type="search"]:focus {
  border-color: var(--md-gold);
  box-shadow: 0 0 0 3px rgba(200,164,21,0.08);
  outline: none;
}
.editorial-search input[type="search"]::placeholder {
  color: #888;
  font-style: italic;
}

/* Two-column homepage grid */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-xl);
  align-items: start;
}
.home-sidebar {
  position: sticky;
  top: 5rem;
}

/* Latest Opinions — article-style entries */
.opinion-entry {
  padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
  border-left: 3px solid var(--md-crimson);
  margin-bottom: var(--space-md);
  transition: border-color 0.15s;
  /* Override PicoCSS article defaults */
  background: none;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
}
.opinion-entry:hover {
  border-left-color: var(--md-gold);
}
.opinion-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
}
.opinion-date {
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.opinion-reported {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-family: var(--font-sans);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}
.opinion-reported.reported {
  background: var(--success-bg);
  color: var(--success-text);
}
.opinion-reported.unreported {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.opinion-entry h3 {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}
.opinion-entry h3 a {
  color: var(--md-black);
  text-decoration: none;
}
.opinion-entry h3 a:hover {
  color: var(--md-crimson);
}
.opinion-snippet {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}
.opinion-tags {
  display: flex;
  gap: var(--space-xs);
}

/* Practice Areas — text list */
.practice-area-list {
  padding: 0;
  margin: 0 0 var(--space-lg);
}
.practice-area-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
  color: var(--md-black);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.practice-area-row:last-child {
  border-bottom: none;
}
.practice-area-row:hover {
  color: var(--md-crimson);
}
.practice-count {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* By the Numbers — sidebar charts */
.numbers-chart {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-sidebar { position: static; }
  .editorial-header h1 { font-size: 1.8rem; }
}
/* (numbers-chart base is defined in homepage section above) */
.numbers-chart h3 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* Search Tabs */
.search-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--border-light);
}
.search-tab {
  padding: 0.6rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.search-tab:hover {
  color: var(--md-black);
}
.search-tab.active {
  color: var(--md-crimson);
  border-bottom-color: var(--md-crimson);
}

/* About Page */
.about-page {
  max-width: 760px;
}
.about-lede {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  border-left: 3px solid var(--md-crimson);
  padding-left: var(--space-md);
  font-style: italic;
}
.about-page h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
}
.about-page p {
  line-height: 1.65;
  margin-bottom: var(--space-sm);
  font-size: 0.92rem;
}
.about-page ul {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-lg);
}
.about-page li {
  line-height: 1.6;
  margin-bottom: var(--space-xs);
  font-size: 0.92rem;
}
.about-page li::marker {
  color: var(--md-crimson);
}

/* ---------------------------------------------------------------------------
   IV. FOOTER — Crimson stripe + black bar
   --------------------------------------------------------------------------- */

.footer-crimson-bar {
  height: 3px;
  background: var(--md-crimson);
}

footer.site-footer {
  margin-top: var(--space-xxl);
  padding: var(--space-xl) 0;
  background: var(--md-black);
  color: rgba(252, 251, 248, 0.92);
  font-size: 0.78rem;
  line-height: 1.6;
}
footer.site-footer strong {
  color: rgba(252, 251, 248, 0.92);
  font-weight: 400;
}

/* Footer flag motif: gold-crimson-gold mini bars */
.footer-flag {
  display: flex;
  gap: 3px;
  margin-bottom: var(--space-md);
}
.footer-flag .ff-gold {
  width: 1.5rem;
  height: 2px;
  background: var(--md-gold);
  border-radius: 1px;
}
.footer-flag .ff-red {
  width: 1rem;
  height: 2px;
  background: var(--md-crimson);
  border-radius: 1px;
}

/* Legacy footer-rule support */
footer.site-footer .footer-rule {
  width: 3rem;
  height: 2px;
  background: var(--md-gold);
  border: none;
  margin: 0 0 var(--space-md) 0;
}
footer.site-footer p {
  margin: 0 0 var(--space-sm) 0;
  color: rgba(252, 251, 248, 0.92);
}


/* ---------------------------------------------------------------------------
   V. TAG PILLS — Muted, professional
   --------------------------------------------------------------------------- */

.tag-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  margin: 0.1rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.tag-topic        { background: var(--color-topic-bg); color: var(--color-topic); border-color: #c8d9ef; }
.tag-stage        { background: var(--color-stage-bg); color: var(--color-stage); border-color: #c2dcc9; }
.tag-constitutional { background: var(--color-constitutional-bg); color: var(--color-constitutional); border-color: #e2ccc7; }
.tag-remedy       { background: var(--color-remedy-bg); color: var(--color-remedy); border-color: #e8dbb8; }
.tag-standard     { background: var(--color-standard-bg); color: var(--color-standard); border-color: #d8cceb; }
.tag-statute      { background: var(--color-statute-bg); color: var(--color-statute); border-color: #d1d5db; }

/* Court badges — heraldic differentiation */
.court-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: var(--font-sans);
}
.court-scm { background: var(--color-scm); color: var(--color-scm-text); }
.court-acm { background: var(--color-acm); color: var(--color-acm-text); }

/* Reported / Unreported status badges */
.reported-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  vertical-align: middle;
}
.reported-badge.reported {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.reported-badge.unreported {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* Source type badges — golden copy provenance */
.source-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  vertical-align: middle;
}
.source-badge.golden {
  background: var(--md-gold-pale);
  color: #7a5c1f;
  border: 1px solid var(--md-gold);
}
.source-badge.reference_only {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-border);
}
.source-badge.pipeline {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

/* Reference-only notice banner */
.reference-only-notice {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  color: var(--info-text);
  font-size: 0.85rem;
  line-height: 1.6;
}
.reference-only-notice strong { color: var(--md-black); }


/* ---------------------------------------------------------------------------
   VI. DASHBOARD / LANDING PAGE
   --------------------------------------------------------------------------- */

/* Hero section */
.hero-section {
  text-align: center;
  padding: var(--space-xxl) 0 var(--space-xl);
}
.hero-section h1 {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--md-black);
  margin-bottom: var(--space-xs);
}
.hero-section .hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

/* Maryland flag-inspired divider bar */
.hero-flag-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-bottom: var(--space-lg);
}
.hero-flag-bar .bar-segment {
  height: 3px;
  border-radius: 1px;
}
.bar-black { background: var(--md-black); width: 2.5rem; }
.bar-gold  { background: var(--md-gold); width: 1.5rem; }
.bar-red   { background: var(--md-crimson); width: 1rem; }

.hero-section form {
  max-width: 560px;
  margin: 0 auto;
}
.hero-section input[type="search"] {
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  background: var(--surface-card);
  color: var(--md-black);
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hero-section input[type="search"]::placeholder {
  color: var(--text-secondary);
}
.hero-section input[type="search"]:focus {
  border-color: var(--md-gold);
  box-shadow: 0 0 0 3px rgba(200, 164, 21, 0.1);
  outline: none;
}

/* Stats bar */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.stat-card {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
}
.stat-card .stat-value {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--md-black);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--md-crimson);
  margin-top: var(--space-xs);
}

/* Section headings with mini flag bar */
.section-heading {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--md-black);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.section-heading::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: linear-gradient(180deg, var(--md-gold) 0%, var(--md-gold) 40%, var(--md-crimson) 40%, var(--md-crimson) 100%);
  border-radius: 1px;
  flex-shrink: 0;
}
.section-heading .heading-rule {
  flex: 1;
  height: 1px;
  background: var(--border-light);
  margin-left: var(--space-sm);
}

/* Recent cases */
.recent-cases h3 {
  font-size: 1rem;
  margin-bottom: var(--space-xs);
}
.recent-cases h3 a {
  text-decoration: none;
}
.recent-cases h3 a:hover {
  color: var(--md-crimson-light);
}


/* ---------------------------------------------------------------------------
   VI-B. CHART COMPONENTS — donut + timeline (used on homepage)
   --------------------------------------------------------------------------- */

/* ── Topic Donut Chart ── */
.donut-container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.donut-svg { flex-shrink: 0; }
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .75rem;
}
a.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  padding: .15rem .3rem;
  border-radius: var(--radius-sm);
  transition: background .1s;
  color: var(--md-black);
  text-decoration: none;
}
a.legend-item:hover { background: var(--surface-hover); color: var(--md-crimson); }
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-count {
  margin-left: auto;
  font-weight: 700;
  color: var(--md-black);
  font-family: var(--font-serif);
  padding-left: var(--space-xs);
  font-size: .75rem;
}

/* ── Timeline Bar Chart ── */
.timeline-chart {
  position: relative;
  height: 130px;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border-light);
}
.timeline-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  height: 100%;
  justify-content: flex-end;
}
.timeline-bar {
  display: block;
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: filter .15s;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  min-height: 2px;
}
.timeline-bar:hover { filter: brightness(1.2); }
.timeline-bar::after {
  content: attr(data-count);
  position: absolute;
  top: -1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .6rem;
  font-weight: 700;
  color: var(--md-crimson);
  opacity: 0;
  transition: opacity .15s;
  white-space: nowrap;
}
.timeline-bar:hover::after { opacity: 1; }
.timeline-year {
  position: absolute;
  bottom: -1.2rem;
  font-size: .6rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Recent Cases Strip (3-column grid) ── */
.recent-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.recent-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  transition: all .2s;
  text-decoration: none;
  color: inherit;
}
.recent-card:hover {
  border-color: var(--md-gold);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
  color: inherit;
}
.recent-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.rc-court {
  font-size: .6rem; font-weight: 700;
  letter-spacing: .08em;
  padding: .15rem .5rem;
  border-radius: var(--radius-sm);
}
.rc-court.acm { background: var(--md-crimson); color: #fff; }
.rc-court.scm { background: var(--md-black); color: var(--md-gold-bright); }
.rc-reported {
  font-size: .55rem; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
}
.rc-reported.reported { background: #d1fae5; color: #065f46; }
.rc-reported.unreported { background: #fef3c7; color: #92400e; }
.rc-date { font-size: .75rem; color: var(--text-muted); margin-left: auto; }
.recent-card h4 {
  font-size: .95rem;
  font-weight: 600;
  margin: var(--space-xs) 0 0;
}
.recent-card .rc-snippet {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-card .rc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  margin-top: var(--space-xs);
}
.rc-tag {
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .1rem .4rem;
  border-radius: var(--radius-sm);
  background: var(--color-topic-bg);
  color: var(--color-topic);
}

/* ── Dashboard Search ── */
.dash-search {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-md);
}
.dash-search form {
  width: 100%;
  max-width: 560px;
  position: relative;
}
.dash-search-inner {
  width: 100%;
  max-width: 560px;
  position: relative;
}
.dash-search input {
  width: 100%;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: .65rem 1.25rem .65rem 2.5rem;
  font-size: .95rem;
  font-family: var(--font-sans);
  background: var(--surface-card);
  color: var(--md-black);
  box-shadow: var(--shadow-subtle);
  transition: border-color .15s, box-shadow .15s;
}
.dash-search input::placeholder { color: var(--text-muted); }
.dash-search input:focus {
  border-color: var(--md-gold);
  box-shadow: 0 0 0 3px rgba(200,164,21,.1);
  outline: none;
}
.search-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 1rem;
}

/* ── Homepage Responsive ── */
@media (max-width: 640px) {
  .donut-container { flex-direction: column; }
}


/* ---------------------------------------------------------------------------
   VII. SEARCH PAGE LAYOUT
   --------------------------------------------------------------------------- */

.search-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-md) var(--space-xl);
  align-items: start;
}
.search-main {
  min-width: 0;  /* prevent grid blowout */
}
.search-bar-row {
  position: relative;
  margin-bottom: var(--space-md);
}
.search-bar-row .search-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 1rem;
}
.search-bar-row input[type="search"] {
  width: 100%;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: .65rem 1.25rem .65rem 2.5rem;
  font-size: .95rem;
  font-family: var(--font-sans);
  background: var(--surface-card);
  color: var(--md-black);
  box-shadow: var(--shadow-subtle);
  transition: border-color .15s, box-shadow .15s;
  margin-bottom: 0;
}
.search-bar-row input[type="search"]::placeholder { color: var(--text-muted); }
.search-bar-row input[type="search"]:focus {
  border-color: var(--md-gold);
  box-shadow: 0 0 0 3px rgba(200,164,21,.1);
  outline: none;
}
@media (max-width: 768px) {
  .search-layout { grid-template-columns: 1fr; }
}

/* Filter sidebar */
.filter-sidebar {
  position: sticky;
  top: 4.25rem;  /* below header */
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-subtle);
}
.filter-section {
  margin-bottom: var(--space-lg);
}
.filter-section h4 {
  margin-bottom: var(--space-sm);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
}
.filter-section label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
  cursor: pointer;
  padding: 0.25rem 0.3rem;
  border-radius: var(--radius-sm);
  transition: background 0.1s, color 0.1s;
}
.filter-section label:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.filter-sidebar input[type="checkbox"] {
  margin: 0;
  width: 0.85rem !important;
  height: 0.85rem !important;
  min-width: 0.85rem;
  accent-color: var(--md-crimson);
  cursor: pointer;
  flex-shrink: 0;
}
/* Override Pico's checkbox padding and sizing within filters */
.filter-sidebar label > input[type="checkbox"] {
  margin-block: 0;
  margin-inline: 0;
}
.filter-section input[type="date"] {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}
.filter-sort-select {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
}
.statute-filter-input {
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.statute-list-scroll {
  max-height: 200px;
  overflow-y: auto;
}

/* Search input on search pages */
.search-input {
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  background: var(--surface-card);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
  border-color: var(--md-gold);
  box-shadow: 0 0 0 3px rgba(200, 164, 21, 0.08);
  outline: none;
}

/* Page heading */
.page-heading {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--md-black);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Active filter chips */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.active-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.2rem 0.55rem;
  background: var(--md-black);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}
.active-filter .remove {
  cursor: pointer;
  font-weight: 700;
  opacity: 0.7;
}
.active-filter .remove:hover { opacity: 1; }


/* ---------------------------------------------------------------------------
   VIII. CASE RESULT CARDS
   --------------------------------------------------------------------------- */

.case-card {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.case-card:last-child { border-bottom: none; }
.case-card:hover {
  background: var(--surface-hover);
  margin: 0 calc(-1 * var(--space-md));
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  border-radius: var(--radius-md);
}
.case-card h3 {
  margin-bottom: var(--space-xs);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
}
.case-card h3 a {
  text-decoration: none;
  color: var(--md-black);
}
.case-card h3 a:hover {
  color: var(--md-crimson);
}
.case-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.case-snippet {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.55;
}

/* Result count */
.results-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}

/* Pagination */
.pagination {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}
.pagination a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--md-black);
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: background 0.15s, border-color 0.15s;
}
.pagination a:hover {
  background: var(--md-gold-wash);
  border-color: var(--md-gold);
  color: var(--md-black);
}
.pagination span {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.85rem;
}
.pagination .current {
  background: var(--md-black);
  color: var(--md-gold-bright);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Holdings in search results — grouped by case */
.holding-case-group {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
}
.holding-case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-page);
  border-bottom: 1px solid var(--border-light);
}
.holding-case-header a {
  font-weight: 600;
  color: var(--md-crimson);
  font-size: 0.95rem;
}
.holding-case-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}
.holding-result {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.holding-result:last-child {
  border-bottom: none;
}
.holding-result:hover {
  background: var(--md-gold-wash);
}
.holding-result-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.holding-result-meta a {
  font-weight: 600;
  color: var(--md-crimson);
}
.holding-result-statement {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}


/* ---------------------------------------------------------------------------
   IX. CASE DETAIL PAGE
   --------------------------------------------------------------------------- */

/* Page grid */
.case-detail-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-xl);
  align-items: start;
}
@media (max-width: 900px) {
  .case-detail-layout { grid-template-columns: 1fr; }
  .case-toc { display: none; }
  .case-toc-mobile { display: block !important; }
}

/* Case header */
.case-header {
  margin-bottom: var(--space-md);
}
.case-header h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--md-black);
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.case-header .case-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}
.case-header .case-meta strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Participants (judge, parties, attorneys) */
.case-participants {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
  font-size: 0.84rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.participant-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  flex-wrap: wrap;
}
.participant-label {
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 6rem;
  flex-shrink: 0;
}
.participant-value {
  color: var(--text-body);
}
.participant-panel {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.party-chip {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-light);
  margin-right: 0.3rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
}
.party-chip small {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.participant-attorneys {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.attorney-entry {
  line-height: 1.5;
}
.attorney-entry em {
  color: var(--text-muted);
  font-style: italic;
}
.attorney-entry small {
  color: var(--text-muted);
}

/* Sticky banner */
.case-sticky-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--md-black);
  border-bottom: 2px solid var(--md-gold);
  padding: var(--space-sm) 0;
  transform: translateY(-100%);
  transition: transform 0.2s ease;
}
.case-sticky-banner.visible {
  transform: translateY(0);
}
.banner-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.banner-title {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--text-inverse);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.banner-meta {
  font-size: 0.75rem;
  color: rgba(252,251,248,0.6);
}
.banner-pdf {
  font-size: 0.75rem;
  margin-left: auto;
  white-space: nowrap;
  color: var(--md-gold-bright);
  text-decoration: none;
}
.banner-pdf:hover { color: #fff; }

/* Quick stats bar */
.case-stats-bar {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.case-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.case-stat-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--md-black);
  line-height: 1.2;
}
.case-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--md-crimson);
}
.case-stat-disposition .case-stat-value {
  font-size: 0.85rem;
  color: var(--color-stage);
}

/* Stats strip (case detail page) */
.stats-strip {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.stats-strip .stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stats-strip .stat-num {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--md-black);
  line-height: 1.2;
}
.stats-strip .stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--md-crimson);
}

/* Tags bar */
.case-tags-bar {
  margin-bottom: var(--space-lg);
}

/* Table of Contents sidebar */
.case-toc {
  position: sticky;
  top: 4.25rem;
}
.toc-nav {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-subtle);
}
.toc-heading {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
}
.toc-link {
  display: block;
  padding: 0.3rem var(--space-sm);
  margin-bottom: 1px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.toc-link:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.toc-link.toc-active {
  background: var(--md-gold-pale);
  color: var(--md-black);
  border-left-color: var(--md-gold);
  font-weight: 600;
}
.toc-link-primary {
  font-weight: 600;
  margin-top: var(--space-sm);
}
.toc-link-issue {
  padding-left: var(--space-md);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.toc-issue-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--border-light);
  color: var(--text-secondary);
  border-radius: 50%;
  flex-shrink: 0;
}
.toc-active .toc-issue-num {
  background: var(--md-black);
  color: var(--md-gold-bright);
}
.toc-issue-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.toc-count {
  font-size: 0.6rem;
  font-weight: 600;
  background: var(--border-light);
  border-radius: 9999px;
  padding: 0.05rem 0.35rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.toc-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}
.toc-btn {
  flex: 1;
  padding: 0.3rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.toc-btn:hover {
  background: var(--md-gold-pale);
  color: var(--md-black);
  border-color: var(--md-gold);
}

/* Mobile TOC */
.toc-nav-mobile {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
}
.toc-nav-mobile a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem var(--space-sm);
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.toc-nav-mobile a:hover { background: var(--surface-hover); }
.toc-issue-link { padding-left: 1.25rem !important; }


/* Issue groups */
.issue-group {
  margin-bottom: var(--space-lg);
}
.issue-header {
  cursor: pointer;
  padding: var(--space-md) var(--space-md);
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.15s;
}
.issue-header:hover {
  border-color: var(--border-medium);
}
.issue-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.issue-title-row h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--md-black);
}
.issue-chevron {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
}
.issue-holding-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-sidebar);
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  margin-left: auto;
}
.issue-text {
  margin: 0.4rem 0 0 1.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
}
.issue-collapsed .issue-header { margin-bottom: 0; }

/* Holdings summary */
.holdings-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Holding cards — accordion */
.holding-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.holding-card.holding-expanded {
  border-color: var(--md-black-muted);
  box-shadow: var(--shadow-card);
}
.holding-card .holding-header {
  cursor: pointer;
  padding: var(--space-md) 1.25rem;
}
.holding-title-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}
.holding-chevron {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 1rem;
  padding-top: 0.15rem;
}
.holding-statement {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
  margin: 0;
  color: var(--text-primary);
}
.holding-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 0.4rem;
  padding-left: 1.5rem;
  flex-wrap: wrap;
}
.holding-id {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.holding-pages {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.holding-detail {
  padding: 0 1.25rem 1.25rem 2.75rem;
}
.holding-tags {
  margin-top: var(--space-sm);
}

/* Deep link highlight */
.holding-highlight {
  animation: holdingPulse 3s ease;
}
@keyframes holdingPulse {
  0%   { box-shadow: 0 0 0 3px rgba(200, 164, 21, 0.3); }
  100% { box-shadow: var(--shadow-subtle); }
}


/* ---------------------------------------------------------------------------
   IX-B. CASE DETAIL V2 — Hero header redesign
   --------------------------------------------------------------------------- */

/* Dark hero header for case detail */
.case-hero {
  background: var(--md-black);
  color: var(--text-inverse);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: 3px solid var(--md-gold);
  position: relative;
}
.case-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: radial-gradient(ellipse at 20% 50%, rgba(123,35,50,0.15), transparent 60%);
  pointer-events: none;
}
.case-hero-back {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--md-gold-bright);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s;
  position: relative;
  z-index: 1;
}
.case-hero-back:hover {
  opacity: 1;
  color: #fff;
}
.case-hero-badges {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  position: relative;
  z-index: 1;
}
.case-hero h1 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin: 0 0 var(--space-sm) 0;
  position: relative;
  z-index: 1;
}
.case-hero-meta {
  font-size: 0.82rem;
  color: rgba(252, 251, 248, 0.85);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  align-items: baseline;
  position: relative;
  z-index: 1;
}
.case-hero-meta .case-hero-meta-item {
  color: rgba(252, 251, 248, 0.85);
}
.case-hero-meta .case-hero-meta-sep {
  color: rgba(252, 251, 248, 0.35);
}
.case-hero-meta strong {
  color: rgba(252, 251, 248, 0.5);
  font-weight: 600;
}
.case-hero-meta a,
a.case-hero-pdf {
  color: var(--md-gold-bright);
  text-decoration: none;
}
.case-hero-meta a:hover,
a.case-hero-pdf:hover {
  color: #fff;
}

/* Participants inside hero */
.case-hero .case-hero-participants {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(252, 251, 248, 0.12);
  font-size: 0.82rem;
  position: relative;
  z-index: 1;
  color: rgba(252, 251, 248, 0.85);
}
.case-hero .case-hero-participants .participant-row {
  color: rgba(252, 251, 248, 0.85);
}
.case-hero .case-hero-participants .participant-label {
  color: var(--md-gold-bright);
  font-weight: 600;
  min-width: 6rem;
}
.case-hero .case-hero-participants .participant-value {
  color: rgba(252, 251, 248, 0.85);
}
.case-hero .case-hero-participants .participant-panel {
  color: rgba(252, 251, 248, 0.5);
}
.case-hero .party-chip {
  background: rgba(252, 251, 248, 0.1);
  border-color: rgba(252, 251, 248, 0.15);
  color: rgba(252, 251, 248, 0.9);
}
.case-hero .party-chip small {
  color: rgba(252, 251, 248, 0.5);
}
.case-hero .participant-attorneys {
  color: rgba(252, 251, 248, 0.85);
}
.case-hero .participant-attorneys .attorney-entry {
  color: rgba(252, 251, 248, 0.85);
}
.case-hero .attorney-entry em,
.case-hero .attorney-entry small {
  color: rgba(252, 251, 248, 0.6);
}

/* Case detail section headings — editorial h2 with gold accent */
.case-content .editorial-section h2,
.case-content > section > h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--md-black);
  margin: var(--space-xl) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--md-gold);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.case-content .editorial-section h2::before,
.case-content > section > h2::before {
  content: '';
  width: 3px;
  height: 1.1em;
  background: var(--md-gold);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .case-hero {
    padding: var(--space-lg) var(--space-md);
  }
  .case-hero h1 {
    font-size: 1.25rem;
  }
  .case-hero-meta {
    flex-direction: column;
    gap: 0.2rem;
  }
}


/* ---------------------------------------------------------------------------
   X. EDITORIAL TYPOGRAPHY — Prose formatting system
   --------------------------------------------------------------------------- */

.prose-block {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-primary);
}
.prose-block p {
  margin: 0 0 0.75rem 0;
}
.prose-block p:last-child {
  margin-bottom: 0;
}

/* Lead sentence */
.prose-lead {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--md-black);
  line-height: 1.7;
}

/* Intro text before numbered lists */
.prose-intro {
  font-weight: 600;
  margin-bottom: 0.35rem !important;
}

/* Numbered lists from inline (1)...(2)... */
.prose-list {
  margin: 0.35rem 0 0 0;
  padding-left: 1.5rem;
  counter-reset: prose-counter;
  list-style: none;
}
.prose-list li {
  counter-increment: prose-counter;
  position: relative;
  padding-left: var(--space-xs);
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.65;
}
.prose-list li::before {
  content: counter(prose-counter);
  position: absolute;
  left: -1.5rem;
  width: 1.2rem;
  height: 1.2rem;
  background: var(--md-gold-pale);
  color: var(--md-black);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0.2rem;
}

/* Citation highlights */
cite.cite-statute,
cite.cite-rule {
  font-style: normal;
  font-weight: 600;
  color: var(--color-statute);
  background: var(--color-statute-bg);
  padding: 0.05rem 0.3rem;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  white-space: nowrap;
}
cite.cite-case {
  font-style: italic;
  font-weight: 500;
  color: var(--md-crimson);
}

/* Holdings — split ruling/reasoning */
.prose-holding p { margin: 0; }
.prose-ruling {
  font-weight: 500;
  color: var(--md-black);
  margin-bottom: 0.3rem !important;
}
.prose-reasoning {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding-left: var(--space-sm);
  border-left: 2px solid var(--border-medium);
}

/* Holding number badge */
.holding-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  background: var(--md-gold-pale);
  color: var(--md-black);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Facts — chronological narrative */
.prose-facts p {
  margin-bottom: 0.9rem;
  text-indent: 0;
}

/* Editorial section headers */
.editorial-section h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--md-black);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--md-gold-pale);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Verified quote blockquote */
.verified-quote {
  border-left: 3px solid var(--md-crimson);
  padding: var(--space-md);
  margin: var(--space-md) 0;
  font-style: italic;
  color: var(--text-secondary);
  background: var(--surface-sidebar);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.9rem;
  line-height: 1.7;
}
.quote-label {
  display: block;
  font-style: normal;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--md-crimson);
  margin-bottom: 0.35rem;
  opacity: 0.8;
}
.verified-quote .quote-source {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* Rule of law */
.rule-of-law {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--surface-code);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.rule-of-law h5 {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.rule-of-law h5::before {
  content: "\00A7";
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-standard);
  opacity: 0.5;
}
.rule-of-law .prose-block { font-size: 0.88rem; }

/* Practice note */
.practice-note {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--info-bg);
  border-left: 3px solid var(--info-border);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.practice-note h5 {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--info-text);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.practice-note h5::before {
  content: "\2696";
  font-size: 0.75rem;
}
.practice-note .prose-block { font-size: 0.88rem; }

/* Disposition box */
.disposition-box {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  padding: var(--space-md) var(--space-lg);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-lg);
}
.disposition-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.disposition-text .prose-block {
  font-weight: 500;
  color: var(--success-text);
}
.disposition-text .prose-block p { margin: 0; }

/* Pinpoint page badges */
.page-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: var(--surface-sidebar);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--text-secondary);
  margin: 0.1rem;
  font-family: var(--font-mono);
  transition: all 0.1s;
}
.page-badge:hover {
  background: var(--md-gold-pale);
  border-color: var(--md-gold);
  color: var(--md-black);
}

/* Verification banner — subtle inline indicator */
.verification-banner {
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  font-size: 0.75rem;
  font-weight: 500;
  max-width: fit-content;
  border-left: 3px solid;
}
.verification-draft {
  background: #fefce8;
  border-left-color: #ca8a04;
  color: #92400e;
}
.verification-verified {
  background: #f0fdf4;
  border-left-color: #16a34a;
  color: #166534;
}

/* Collapsible sections */
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
details[open] summary {
  margin-bottom: var(--space-md);
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--md-black);
  color: var(--md-gold-bright);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--md-black-soft);
}


/* ---------------------------------------------------------------------------
   X-B. ENRICHMENT SECTIONS (AI-generated metadata)
   --------------------------------------------------------------------------- */

/* Case summary callout */
.enrichment-summary {
  background: linear-gradient(135deg, var(--md-gold-wash), var(--surface-card));
  border: 1px solid var(--md-gold-pale);
  border-left: 4px solid var(--md-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}
.enrichment-summary-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: 0.85rem;
}
.enrichment-icon {
  font-size: 1rem;
  color: var(--md-gold);
}
.enrichment-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--md-gold);
  background: var(--md-gold-pale);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
}
.enrichment-summary-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}
.enrichment-outcome {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}
.outcome-type {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-sidebar);
  color: var(--text-secondary);
}
.outcome-type.outcome-affirmed { background: #e8f5e9; color: #2e7d32; }
.outcome-type.outcome-reversed { background: #fce4ec; color: #c62828; }
.outcome-type.outcome-reversed-and-remanded { background: #fff3e0; color: #e65100; }
.outcome-type.outcome-vacated { background: #fff8e1; color: #f57f17; }
.outcome-type.outcome-remanded { background: #e3f2fd; color: #1565c0; }
/* Outcome chip — compact version for search result cards */
.outcome-chip {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: #f0f0f0;
  color: #555;
}
.outcome-chip.outcome-affirmed { background: #e8f5e9; color: #2e7d32; }
.outcome-chip.outcome-reversed { background: #fce4ec; color: #c62828; }
.outcome-chip.outcome-reversed-and-remanded,
.outcome-chip.outcome-reversed_and_remanded { background: #fff3e0; color: #e65100; }
.outcome-chip.outcome-vacated { background: #fff8e1; color: #f57f17; }
.outcome-chip.outcome-remanded { background: #e3f2fd; color: #1565c0; }
.outcome-chip.outcome-dismissed { background: #f3e5f5; color: #7b1fa2; }
.rc-outcome {
  margin-top: 0.25rem;
}
/* Standards of review tag colors */
:root {
  --color-standard-bg: #e8f4fd;
  --color-standard: #2563eb;
}
.outcome-party {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Enrichment sections in main content */
.enrichment-section {
  position: relative;
}
.enrichment-section::before {
  content: "AI";
  position: absolute;
  top: 0.4rem;
  right: 0;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--md-gold);
  background: var(--md-gold-pale);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

/* Key legal principles */
.legal-principles-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.legal-principles-list li {
  position: relative;
  padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-primary);
}
.legal-principles-list li:last-child {
  border-bottom: none;
}
.legal-principles-list li::before {
  content: "\2696";
  position: absolute;
  left: 0;
  top: var(--space-sm);
  font-size: 1rem;
  color: var(--md-crimson);
}

/* Related cases grid */
.related-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}
.related-case-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.related-case-card:hover {
  border-color: var(--md-gold);
  box-shadow: var(--shadow-card);
}
.related-case-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--md-crimson);
}
.related-case-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Statute detail cards */
.statute-detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.statute-detail-card {
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-sidebar);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--md-crimson);
  border-radius: var(--radius-md);
}
.statute-citation {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--md-crimson);
}
.statute-title {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-top: 0.15rem;
}
.statute-subsection {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-style: italic;
}


/* ---------------------------------------------------------------------------
   XI. TAXONOMY BROWSER
   --------------------------------------------------------------------------- */

/* --- Index page: category card grid --- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.topic-tile {
  display: flex;
  flex-direction: column;
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.topic-tile:hover {
  border-color: var(--md-crimson);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.topic-tile .topic-count {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--md-black);
  line-height: 1.1;
}
.topic-tile .topic-label {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--md-black);
  margin-top: var(--space-xs);
}
.topic-tile .topic-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.4;
}
.topic-tile .topic-tagged {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--md-crimson);
  margin-top: var(--space-sm);
}
.topic-tile .topic-top-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: var(--space-xs);
}
.topic-tile .topic-top-tag {
  font-size: 0.75rem;
  background: var(--surface-sidebar, #f7f5f0);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.5rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.topic-tile .topic-top-tag small {
  color: var(--text-muted);
  font-size: 0.68rem;
}

/* --- Detail page table --- */
.taxonomy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.taxonomy-table thead th {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 2px solid var(--md-black);
  text-align: left;
  background: var(--surface-sidebar);
}
.taxonomy-table tbody td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  background: var(--surface-card, #fff);
  color: var(--md-black);
}
.taxonomy-table tbody tr:hover td {
  background: var(--surface-hover, #faf9f6);
}
.taxonomy-table code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--surface-code);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  color: var(--md-crimson);
}
.taxonomy-table a {
  font-weight: 500;
  font-size: 0.82rem;
}
.taxonomy-table small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Column widths */
.tax-col-label  { width: 40%; }
.tax-col-count  { width: 8%; text-align: center; }
.tax-col-aliases { width: 30%; }
.tax-col-action  { width: 22%; }

/* Tag label + key in label column */
.tax-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
}
.tax-key {
  display: block;
  margin-top: 0.15rem;
}
.tax-aliases {
  line-height: 1.55;
}

/* Count badge */
.tax-count-cell { text-align: center; vertical-align: middle; }
.tax-count-badge {
  display: inline-block;
  min-width: 1.6rem;
  padding: 0.15rem 0.45rem;
  background: var(--md-crimson);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 999px;
  text-align: center;
}
.tax-count-zero {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Empty (zero-count) rows */
.tax-row-empty td {
  opacity: 0.45;
}
.tax-row-empty:hover td {
  opacity: 0.7;
}

/* "View N cases →" link */
.tax-search-link {
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  color: var(--md-crimson);
  text-decoration: none;
}
.tax-search-link:hover {
  text-decoration: underline;
}


/* ---------------------------------------------------------------------------
   XII. 404 PAGE
   --------------------------------------------------------------------------- */

.error-page {
  text-align: center;
  padding: var(--space-xxl) 0;
}
.error-page h1 {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--md-black);
  margin-bottom: var(--space-sm);
}
.error-page .error-code {
  font-family: var(--font-serif);
  font-size: 5rem;
  font-weight: 700;
  color: var(--border-medium);
  line-height: 1;
  margin-bottom: var(--space-sm);
}
.error-page p {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto var(--space-lg);
}
.error-page a {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: var(--md-black);
  color: var(--md-gold-bright);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.error-page a:hover {
  background: var(--md-black-soft);
  color: var(--md-gold-bright);
}


/* ---------------------------------------------------------------------------
   XIII. UTILITY CLASSES
   --------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.82rem; }
.serif { font-family: var(--font-serif); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: var(--space-md);
  transition: color 0.15s;
}
.back-link:hover {
  color: var(--md-crimson);
}

/* Gold accent rule */
.gold-rule {
  width: 3rem;
  height: 2px;
  background: var(--md-gold);
  border: none;
  margin: var(--space-md) 0;
}

/* Versioning footer */
.version-info {
  font-size: 0.75rem;
  color: var(--text-faint);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  margin-top: var(--space-xl);
}


/* Enrichment responsive */
@media (max-width: 640px) {
  .enrichment-summary { padding: var(--space-sm) var(--space-md); }
  .enrichment-section::before { display: none; }
  .related-cases-grid { grid-template-columns: 1fr; }
  .legal-principles-list li { padding-left: var(--space-lg); font-size: 0.85rem; }
}


/* ---------------------------------------------------------------------------
   XI-B. REFERENCE PAGE — header, stats, unified search bar
   --------------------------------------------------------------------------- */

/* Page header block */
.ref-page-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}
.ref-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.ref-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-xs);
}
.ref-disclaimer {
  background: var(--md-gold-pale, #fef9e7);
  border-left: 3px solid var(--md-gold);
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.5;
}

/* Horizontal stats row */
.ref-stats-row {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-xs);
}
.ref-stat {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.ref-stat-num {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--md-black);
}
.ref-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* Unified search bar — all controls in one row */
.ref-search-form {
  margin-bottom: var(--space-md);
}
.ref-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.ref-search-bar .search-icon {
  display: none;
}
.ref-search-bar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.8rem;
  font-size: 0.88rem;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--md-black);
  font-family: var(--font-sans);
  margin-bottom: 0;
}
.ref-search-bar input[type="search"]:focus {
  border-color: var(--md-gold);
  box-shadow: 0 0 0 3px rgba(200,164,21,0.08);
  outline: none;
}
.ref-search-bar input[type="search"]::placeholder {
  color: var(--text-muted);
  font-style: italic;
}
.ref-filter-select {
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--surface-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  max-width: 200px;
  margin: 0;
}
.ref-search-bar input[type="number"].ref-filter-year {
  padding: 0.45rem 0.5rem;
  font-size: 0.82rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--surface-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  width: 70px;
  max-width: 70px;
  min-width: 70px;
  flex: 0 0 70px;
  margin: 0;
  margin-bottom: 0;
}
.ref-filter-year::placeholder { color: var(--text-muted); }
.ref-search-bar button.ref-filter-go {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--md-crimson);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  margin: 0;
  width: auto;
  max-width: fit-content;
  flex: 0 0 auto;
}
.ref-search-bar button.ref-filter-go:hover { background: var(--md-crimson-dark, #5f1a26); }

@media (max-width: 768px) {
  .ref-stats-row { flex-wrap: wrap; gap: var(--space-md); }
  .ref-search-bar { flex-wrap: wrap; }
  .ref-search-bar input[type="search"] { min-width: 100%; flex: 1 1 100%; }
  .ref-filter-select { flex: 1; max-width: none; }
  .ref-search-bar input[type="number"].ref-filter-year { flex: 1; min-width: 0; width: auto; max-width: none; }
  .ref-search-bar button.ref-filter-go { flex: 0 0 auto; }
}


/* ---------------------------------------------------------------------------
   XI-D. REFERENCE MANUAL — Table, badges, search filters
   --------------------------------------------------------------------------- */

/* PDF download link */
.pdf-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--space-sm);
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--md-crimson);
  text-decoration: none;
  border: 1px solid var(--md-crimson);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}
.pdf-download-link:hover {
  background: var(--md-crimson);
  color: #fff;
}
.pdf-icon {
  font-size: 1rem;
}

/* (ref-search-filters replaced by ref-search-frame above) */

/* Clear link */
.ref-clear-link {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.ref-clear-link:hover {
  color: var(--md-crimson);
  background: var(--md-crimson-pale);
}

/* Results header */
.ref-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}
.ref-results-header .count {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.ref-results-header .filtered-label {
  font-size: 0.8rem;
}

/* Reference table — override PicoCSS dark table backgrounds */
.ref-table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
  background: var(--surface-base, #fff);
  color: var(--md-black);
}
.ref-table th {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface-sidebar);
  color: var(--md-black);
  padding: var(--space-sm);
  text-align: left;
  border-bottom: 2px solid var(--md-black);
}
.ref-table td {
  vertical-align: top;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border-light);
  background: transparent;
  color: var(--md-black);
}
.ref-table tbody tr {
  background: var(--surface-base, #fff);
  color: var(--md-black);
}
.ref-table tbody tr:nth-child(even) {
  background: var(--surface-card, #faf8f4);
}
.ref-table tbody tr:hover {
  background: var(--surface-hover);
}
.ref-table .col-chapter { width: 80px; }
.ref-table .col-topic   { width: 180px; font-weight: 500; }
.ref-table .col-holding  { min-width: 250px; }
.ref-table .col-case     { width: 200px; }
.ref-table .col-cite     { width: 160px; font-size: 0.8rem; color: var(--text-muted); }
.ref-table .col-year     { width: 50px; text-align: center; }

.ref-table .case-link { font-weight: 500; }
.ref-table .case-link a { text-decoration: none; }
.ref-table .case-link a:hover { text-decoration: underline; }
.ref-table .westlaw-icon {
  font-size: 0.7rem;
  vertical-align: super;
  color: #2563eb;
}

/* Chapter badges */
.chapter-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.chapter-badge.TPR         { background: #fee2e2; color: #991b1b; }
.chapter-badge.CINA        { background: #dbeafe; color: #1e40af; }
.chapter-badge.DELINQUENCY { background: #fef3c7; color: #92400e; }

/* Empty state text */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-xl);
}


/* ---------------------------------------------------------------------------
   XIII. DESIGN SYSTEM REFERENCE PAGE
   --------------------------------------------------------------------------- */

.ds-section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--md-black);
  margin: var(--space-xxl) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--md-gold);
}
.ds-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 0.9em;
  background: var(--md-gold);
  border-radius: 2px;
  margin-right: var(--space-sm);
  vertical-align: middle;
}

.ds-example {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.ds-code {
  background: var(--md-black);
  color: var(--md-gold-bright);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.5;
}

.ds-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.ds-swatch {
  padding: var(--space-lg) var(--space-md) var(--space-md);
  border-radius: var(--radius-lg);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.ds-swatch-name {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}
.ds-swatch-var {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.7;
}
.ds-swatch-hex {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.5;
}

.ds-type-scale {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.ds-spacing-demo {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.ds-space-box {
  display: inline-block;
  height: 1rem;
  background: var(--md-crimson);
  border-radius: 2px;
  margin-right: var(--space-sm);
  vertical-align: middle;
}

.ds-radius-demo {
  width: 80px;
  height: 60px;
  background: var(--md-gold-pale);
  border: 2px solid var(--md-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--md-black);
}


/* ---------------------------------------------------------------------------
   XV. QUICK SHEET GENERATOR
   --------------------------------------------------------------------------- */

.qs-page { max-width: 1100px; margin: 0 auto; }

/* ── Header ── */
.qs-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}
.qs-header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.qs-back {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.qs-back:hover { color: var(--md-crimson); }
.qs-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-style: italic;
}

/* ── Filter form ── */
.qs-form {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}
.qs-filter-grid { display: flex; flex-direction: column; gap: var(--space-md); }
.qs-filter-group { display: flex; flex-direction: column; gap: 0.35rem; }
.qs-filter-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.qs-checkbox-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.qs-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-medium);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface-base, #fff);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  font-family: var(--font-sans);
}
.qs-chip:hover { border-color: var(--md-gold); color: var(--text-primary); }
.qs-chip-active {
  background: var(--md-gold-wash);
  border-color: var(--md-gold);
  color: var(--md-black);
  font-weight: 600;
}
.qs-filter-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: end;
}
.qs-filter-narrow { flex: 1; min-width: 110px; max-width: 160px; }
.qs-filter-narrow select,
.qs-filter-row .qs-filter-narrow input[type="date"] {
  font-size: 0.82rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--surface-base, #fff);
  color: var(--md-black);
  margin-bottom: 0;
  width: 100%;
  max-width: 160px;
  height: 34.5px;
  box-sizing: border-box;
  line-height: 1.2;
}
.qs-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}
.qs-actions button[type="submit"].qs-generate-btn {
  background: var(--md-crimson);
  color: #fff;
  border: none;
  padding: 0.5rem 1.4rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.02em;
  width: auto;
  max-width: fit-content;
  display: inline-flex;
  margin-bottom: 0;
}
.qs-actions button[type="submit"].qs-generate-btn:hover { background: #8a1525; }
.qs-clear-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}
.qs-clear-link:hover { color: var(--md-crimson); text-decoration: underline; }

/* ── Summary bar ── */
.qs-summary-bar {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  background: var(--md-black);
  color: #fff;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}
.qs-summary-stat { display: flex; align-items: baseline; gap: 0.35rem; }
.qs-summary-bar .qs-summary-num {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.qs-summary-bar .qs-summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.65);
  font-weight: 600;
}
.qs-summary-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}
.qs-summary-actions button.qs-print-btn,
.qs-summary-actions button.qs-copy-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
  width: auto;
  max-width: fit-content;
  display: inline-flex;
  margin-bottom: 0;
}
.qs-summary-actions button.qs-print-btn:hover,
.qs-summary-actions button.qs-copy-btn:hover { background: rgba(255,255,255,0.22); }

/* ── Sheet layout ── */
.qs-sheet-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-xl);
  align-items: start;
}
@media (max-width: 860px) {
  .qs-sheet-layout { grid-template-columns: 1fr; }
  .qs-statute-sidebar { order: -1; }
}

/* ── Holdings column ── */
.qs-case-divider {
  margin-top: var(--space-lg);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--md-gold);
  margin-bottom: var(--space-sm);
}
.qs-case-divider:first-child { margin-top: 0; }
.qs-case-link {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.qs-case-link:hover { color: var(--md-crimson); }
.qs-case-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.8rem;
}
.qs-case-date { color: var(--text-muted); }

.qs-holding-card {
  position: relative;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
}
.qs-holding-card:last-child { border-bottom: none; }
.qs-holding-statement {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-primary);
}
.qs-holding-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.qs-cite-btn {
  position: absolute;
  top: var(--space-sm);
  right: 0;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.qs-holding-card:hover .qs-cite-btn { opacity: 1; }
.qs-cite-btn:hover { border-color: var(--md-gold); color: var(--md-gold); }

/* ── Statute sidebar ── */
.qs-statute-sidebar {
  background: var(--surface-sidebar);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: var(--space-lg);
  position: sticky;
  top: 1rem;
}
.qs-sidebar-heading {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 var(--space-sm);
}
.qs-statute-list { display: flex; flex-direction: column; gap: 0.4rem; }
.qs-statute-item {
  display: flex;
  flex-direction: column;
  padding: 0.3rem 0;
  border-bottom: 1px dotted var(--border-light);
}
.qs-statute-item:last-child { border-bottom: none; }
.qs-statute-code {
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--md-black);
  background: var(--md-gold-wash, #fdf6e3);
  border: 1px solid var(--md-gold, #c8a415);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.15rem;
}
.qs-statute-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.qs-cases-list { display: flex; flex-direction: column; gap: 0.4rem; }
.qs-case-ref a {
  font-size: 0.82rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}
.qs-case-ref a:hover { color: var(--md-crimson); }
.qs-ref-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Welcome / empty state ── */
.qs-welcome {
  text-align: center;
  padding: var(--space-xxl) var(--space-lg);
  max-width: 560px;
  margin: 0 auto;
}
.qs-welcome-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}
.qs-welcome h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: var(--space-sm);
}
.qs-welcome p { color: var(--text-secondary); font-size: 0.9rem; }
.qs-welcome-suggestions { margin-top: var(--space-xl); }
.qs-welcome-suggestions h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.qs-quick-starts { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.qs-quickstart-chip {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}
.qs-quickstart-chip:hover {
  border-color: var(--md-gold);
  background: var(--md-gold-wash);
  color: var(--md-black);
}

.qs-empty {
  text-align: center;
  padding: var(--space-xxl) var(--space-lg);
  color: var(--text-muted);
}

/* ── Toast notification ── */
.qs-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--md-black);
  color: var(--md-white);
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  pointer-events: none;
}
.qs-toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Print-only header ── */
.qs-print-header { display: none; }


/* ---------------------------------------------------------------------------
   XIII-B. PAGINATION
   --------------------------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  margin-top: var(--space-md);
}
.pagination-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--md-crimson);
  text-decoration: none;
  transition: all 0.15s;
}
.pagination-link:hover {
  background: var(--md-crimson-pale);
  border-color: var(--md-crimson);
  color: var(--md-crimson);
}
.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* ---------------------------------------------------------------------------
   XIII-C. AI RESEARCH PAGE
   --------------------------------------------------------------------------- */

.research-hero {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
}
.research-hero h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}
.research-hero p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}
.research-form {
  max-width: 700px;
  margin: 0 auto var(--space-xl);
}
.research-form .form-group { margin-bottom: var(--space-md); }
.research-form .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}
.research-form .form-group textarea,
.research-form .form-group select,
.research-form .form-group input[type="text"] {
  width: 100%;
  background: var(--surface-base, #fff);
  color: var(--md-black);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  margin-bottom: 0;
}
.research-form .form-group textarea {
  min-height: 100px;
  resize: vertical;
  border-radius: var(--radius-sm);
}
.research-form .form-group textarea::placeholder,
.research-form .form-group input::placeholder {
  color: var(--text-muted);
}
.research-form .form-group textarea:focus,
.research-form .form-group input[type="text"]:focus {
  border-color: var(--md-gold);
  box-shadow: 0 0 0 3px rgba(200,164,21,.1);
  outline: none;
}
.research-form button[type="submit"].primary,
.research-form button[type="submit"] {
  background: var(--md-crimson);
  color: #fff;
  border: none;
  padding: 0.6rem 1.6rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.02em;
  width: auto;
  max-width: fit-content;
  display: inline-flex;
  margin-bottom: 0;
}
.research-form button[type="submit"]:hover {
  background: var(--md-crimson-dark, #5a1a24);
}

.report-type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.type-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  background: var(--surface-card, #fff);
}
.type-card:hover {
  border-color: var(--md-crimson);
  background: var(--md-crimson-pale, #fdf0f2);
}
.type-card.selected {
  border-color: var(--md-crimson);
  background: var(--md-crimson-pale, #fdf0f2);
}
.type-card h3 { margin-bottom: var(--space-xs); font-size: 1rem; color: var(--md-black); }
.type-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.report-output {
  max-width: 800px;
  margin: var(--space-xl) auto;
  padding: var(--space-xl);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--surface-card, #fff);
  color: var(--md-black);
}
.report-output h2 { font-family: var(--font-serif); color: var(--md-black); }
.report-meta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.sources-list {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}
.sources-list h3 { font-size: 1rem; }
.source-item {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}
.source-item:last-child { border-bottom: none; }
.spinner { display: none; text-align: center; padding: var(--space-xl); }
.spinner.active { display: block; }
.spinner .dots::after { content: '...'; animation: research-dots 1.5s infinite; }
@keyframes research-dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}
.past-reports { margin-top: var(--space-xl); }
.past-reports h2 {
  font-family: var(--font-serif);
  color: var(--md-black);
  font-size: 1.3rem;
  margin-bottom: var(--space-md);
}
.past-reports table {
  font-size: 0.9rem;
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-card, #fff);
}
.past-reports table thead th {
  background: var(--md-black);
  color: #fff;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}
.past-reports table tbody td {
  background: var(--surface-card, #fff);
  color: var(--md-black);
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.past-reports table tbody tr:hover td {
  background: var(--surface-hover, #faf9f6);
}
.past-reports table a {
  color: var(--md-crimson);
  font-weight: 600;
  text-decoration: none;
}
.past-reports table a:hover {
  text-decoration: underline;
}
.research-disclaimer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xl);
  padding: var(--space-md);
  border-top: 1px solid var(--border-light);
}


/* ---------------------------------------------------------------------------
   XIV. MOBILE RESPONSIVE ENHANCEMENTS
   --------------------------------------------------------------------------- */

/* 5b–5d. Touch targets, responsive tables, mobile cards */
@media (max-width: 768px) {
  /* Touch targets ≥ 44px */
  .filter-section label {
    min-height: 44px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .filter-sidebar input[type="checkbox"],
  .filter-sidebar input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
  }
  .tag-pill {
    min-height: 32px;
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
  }
  .toc-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .qs-chip {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Responsive tables */
  .taxonomy-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .taxonomy-table .col-aliases { display: none; }
  .ref-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.82rem;
  }
  .ref-table .col-citation { display: none; }

  /* Mobile result cards */
  .recent-card {
    padding: var(--space-sm);
  }
  .recent-card h4 {
    font-size: 0.95rem;
  }
  .holding-result {
    padding: var(--space-sm);
    font-size: 0.88rem;
  }
  .holding-case-header {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
}


/* ---------------------------------------------------------------------------
   XV. MOBILE FILTER DRAWER
   --------------------------------------------------------------------------- */

/* Toggle button — hidden on desktop, shown at ≤768px */
.filter-drawer-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--md-black);
  background: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: var(--space-sm);
}
.filter-drawer-toggle .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--md-crimson);
  border-radius: 50%;
  padding: 0 0.35rem;
}
.filter-drawer-toggle .badge:empty { display: none; }

/* Overlay backdrop */
.filter-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 900;
}
.filter-drawer-overlay.open { display: block; }

/* Drawer panel */
.filter-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 340px);
  background: var(--surface-card);
  z-index: 901;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  padding: var(--space-md);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.filter-drawer.open {
  display: block;
  transform: translateX(0);
}
.filter-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--md-gold);
}
.filter-drawer-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-family: var(--font-serif);
}
.filter-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  line-height: 1;
}
.filter-drawer-apply {
  display: block;
  width: 100%;
  margin-top: var(--space-md);
  padding: 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--md-crimson);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.filter-drawer-apply:hover {
  background: var(--md-crimson-dark, #8b0000);
}

@media (max-width: 768px) {
  .filter-drawer-toggle { display: inline-flex; }
  .filter-sidebar { display: none !important; }
  .filter-sidebar.in-drawer { display: block !important; }
}


/* ---------------------------------------------------------------------------
   XVI. PRINT STYLES
   --------------------------------------------------------------------------- */

@media print {
  body { background: #fff; }

  header.site-header, footer.site-footer,
  .header-accent, .footer-crimson-bar, .footer-flag,
  .filter-sidebar, .hero-section form, .hero-flag-bar,
  .active-filters .remove, .page-badge,
  .case-toc, .case-toc-mobile, .case-sticky-banner,
  .back-to-top, .toc-actions, .back-link { display: none !important; }

  .container { max-width: 100%; padding: 0; }
  .search-layout, .case-detail-layout { grid-template-columns: 1fr; }
  .holding-card { break-inside: avoid; border-color: #ccc; box-shadow: none; }
  .holding-detail { display: block !important; }
  .issue-holdings { display: block !important; }

  .practice-note { border-left-color: #666; background: #f8f8f8; }
  .enrichment-summary { border-color: #ccc; background: #f5f5f0; }
  .enrichment-badge { display: none; }
  .enrichment-section::before { display: none; }
  .related-case-card { border-color: #ccc; box-shadow: none; }
  .statute-detail-card { border-color: #ccc; background: #f8f8f8; }
  .disposition-box { border-color: #999; background: #f5f5f5; }
  .verified-quote { border-left-color: #666; background: #f8f8f8; }
  cite.cite-statute, cite.cite-rule { background: none; padding: 0; }
  .prose-list li::before { background: #ddd; color: #333; }
  .prose-reasoning { border-left-color: #999; }

  details[open] > * { display: block; }

  .tag-pill { border-color: #ccc; }
  .recent-card { box-shadow: none; border-color: #ccc; }

  a { color: #333; }
  a[href]::after { content: none; }  /* Don't show URLs in print */

  /* Quick Sheet print layout */
  .qs-form, .qs-summary-actions, .qs-cite-btn,
  .qs-back, .qs-header, .qs-subtitle { display: none !important; }
  .qs-print-header {
    display: block !important;
    text-align: center;
    padding: 0.5rem 0 1rem;
    border-bottom: 2px solid #000000;
    margin-bottom: 1rem;
  }
  .qs-print-seal { font-size: 2rem; margin-bottom: 0.25rem; }
  .qs-print-title { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; }
  .qs-print-focus { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; margin: 0.3rem 0; }
  .qs-print-dates { font-size: 0.8rem; color: #555; }
  .qs-print-meta { font-size: 0.7rem; color: #888; margin-top: 0.2rem; }
  .qs-summary-bar {
    background: #f5f5f5 !important;
    color: #000000 !important;
    border: 1px solid #ccc;
    padding: 0.4rem 0.8rem !important;
    margin-bottom: 0.8rem !important;
  }
  .qs-summary-num { color: #000000 !important; font-size: 1.1rem !important; }
  .qs-sheet-layout { grid-template-columns: 1fr 220px; gap: 1rem; }
  .qs-statute-sidebar { background: #f8f8f8 !important; border-color: #ccc; position: static; }
  .qs-holding-card { break-inside: avoid; }
  .qs-case-divider { break-after: avoid; }
  .qs-case-link { color: #000000 !important; }
  .tag-pill { border-color: #ccc; font-size: 0.65rem; }
}
