/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* LEAP brand colours (official palette from Galaxy Design System).
     The blog's primary blue is a slate blue (#374F6B). Navy is reserved for
     LEAP Enterprise and is no longer used here. The --navy / --navy-light and
     --cobalt / --cobalt-dark tokens keep their names for stability (they cascade
     through ~90 rules) but resolve to the slate palette. --cobalt is the base
     accent; --cobalt-dark is a deeper slate used on large white-text surfaces
     (site/admin header, footer, icon chip, court badge, table headers);
     --navy-light is the lighter hover shade. White text is >= WCAG AA on all
     three (base ~8.4:1, deep ~10.8:1, hover ~4.7:1). */
  --cobalt:      #374F6B;
  --cobalt-dark: #2C3F56;
  --navy:       var(--cobalt);
  --navy-light: #5C7696;
  --gold:       #F69139;
  --gold-light: #FDAA67;
  --text:       #1f2937;
  --text-muted: #6b7280;
  --border:     #e5e7eb;
  --bg:         #f8f9fb;
  --bg-white:   #ffffff;
  --tag-bg:     #FFF1E2;
  --tag-text:   #D97B2B;
  --radius:     8px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
}

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

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--cobalt-dark);
  border-bottom: 3px solid var(--gold);
  padding: 20px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
}

/* ── LEAP Criminal Law lockup (left of the divider) ──────────────────────────
   The icon (leap-icon-white.svg) is the live logo, unchanged. The orange LEAP
   wordmark + "Criminal Law" form the vertical lockup; a hairline divider
   separates the brand from the publication title on its right. */
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
}
.brand-wordmark {
  height: 21px;
  width: auto;
  display: block;
}
/* Sized so the two lines of the lockup land at a similar width: the LEAP
   wordmark (~21px tall, ~67px wide) sits close to "Criminal Law".
   Font: LEAP brand face Suisse Int'l where installed, else the brand-sanctioned
   Arial / Helvetica grotesque fallback (much closer to Suisse than the body
   stack). Weight 500 to match the Regular/Medium weight of the vertical logo. */
.brand-vertical {
  font-family: "Suisse Int'l", "Suisse Intl", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: #e6ecf4;
  letter-spacing: 0.005em;
  line-height: 1;
  /* Pull the text left by the capital "C" left side bearing so its ink edge
     lines up exactly with the flush "L" of the LEAP wordmark above it. */
  margin-left: -0.045em;
}
.brand-divider {
  width: 1px;
  align-self: stretch;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.logo-img {
  height: 44px;
  width: auto;
  border-radius: 6px;
  flex-shrink: 0;
}

/* White LEAP app-icon (leap-icon-white.svg) on a navy chip — used where the
   page background is light, so the white mark stays visible and on-brand. */
.leap-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cobalt-dark);
  border-radius: 12px;
  padding: 8px;
}
.leap-icon-chip img { display: block; }
/* Empty-state watermark variant; parent .empty-icon already sets opacity. */
.leap-icon-chip--ghost { border-radius: 16px; padding: 10px; }

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.logo-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-style: italic;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.45);
  color: #fff;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.site-nav a:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.75); color: #fff; }

/* ── Main ─────────────────────────────────────────────────────────────────── */
.site-main {
  flex: 1;
  padding: 48px 0 64px;
}

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 2rem;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-intro {
  margin-top: 8px;
  color: var(--text-muted);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 1rem;
}

.last-updated {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
}

.staleness-banner {
  background: #fff8e6;
  border: 1px solid #f6c84b;
  border-radius: 6px;
  color: #7a5800;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.88rem;
  padding: 10px 16px;
  margin-bottom: 20px;
}

/* ── Post grid ────────────────────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.post-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s, transform 0.15s, background-color 0.15s ease;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background-color: rgba(255, 140, 0, 0.07);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.court-badge {
  background: var(--cobalt-dark);
  color: #ffffff;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.court-badge--large {
  font-size: 0.75rem;
  padding: 4px 10px;
}

.court-badge--unknown {
  background: #c0392b;
}

.post-date {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Grid-only date line. In grid view the date is lifted out of the top band and
   shown on its own line under the title (see #post-container.post-grid rules),
   so a long court name can never push the bookmark down or shift the title.
   Hidden by default; list and compact views keep the date in the top band. */
.card-grid-date {
  display: none;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -2px;
}

.post-card-title {
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--navy);
}

.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--gold); }

.post-citation {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Crime-type category chips (clickable, filter the homepage). Distinct from the
   grey catchword tags: slate-tinted, and darken on hover to read as links. */
.card-categories,
.post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.post-categories {
  margin-top: 12px;
}
.cat-chip {
  display: inline-block;
  background: rgba(55, 79, 107, 0.10);
  color: var(--navy, #374F6B);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid rgba(55, 79, 107, 0.18);
  transition: background 0.12s ease, color 0.12s ease;
}
.cat-chip:hover {
  background: var(--navy, #374F6B);
  color: #fff;
}

.card-links {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.read-more {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  transition: color 0.15s;
}

.read-more:hover { color: var(--gold); }

/* ── Results toolbar (count + view toggle) ───────────────────────────────── */
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.results-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── View toggle buttons ──────────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
}

.view-btn {
  background: none;
  border: none;
  border-radius: 4px;
  width: 32px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}

.view-btn svg { width: 18px; height: 18px; }

.view-btn[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
}

.view-btn:hover:not([aria-pressed="true"]) {
  background: var(--bg);
  color: var(--navy);
}

/* ── List view layout ─────────────────────────────────────────────────────── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-list .post-card {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  grid-template-areas:
    "meta title    link"
    "meta citation link"
    "meta snippet  link"
    "meta tags     link";
  column-gap: 20px;
  row-gap: 4px;
  padding: 16px 20px;
  align-items: start;
}

.post-list .post-card-meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.post-list .post-card-title {
  grid-area: title;
  font-size: 1rem;
  margin: 0;
}

.post-list .post-citation {
  grid-area: citation;
  margin: 0;
}

.post-list .smart-snippet {
  grid-area: snippet;
  margin: 0;
}

.post-list .post-tags {
  grid-area: tags;
  margin-top: 2px;
}

.post-list .card-links,
.post-list .smart-card-links {
  grid-area: link;
  margin-top: 0;
  align-self: center;
  align-items: flex-end;
}
/* Advanced cards keep their footer (links + authority + bookmark) in the right
   column in list view, stacked and right-aligned. */
.post-list .smart-card-links {
  flex-direction: column;
  gap: 6px;
}

.post-list .read-more {
  white-space: nowrap;
}

/* ── Search bar ───────────────────────────────────────────────────────────── */
.search-bar {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

/* Row 1: text input + action buttons, always on one line */
.search-primary-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.search-primary-row .search-field--text { flex: 1 1 0; min-width: 0; }

/* Action buttons: all inline, never wrapping */
.search-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 1px; /* optical align with input bottom */
}

/* Row 2: filter controls */
.search-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

/* Keep the old .search-row for any legacy use */
.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-field label {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

.search-field--text  { flex: 1 1 280px; }
.search-field--court { flex: 1 1 170px; }
.search-field--date  { flex: 0 1 140px; }
.search-field--sort  { flex: 0 1 180px; }

.search-input-wrap {
  position: relative;
}

.search-icon-svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Citation-only toggle pill */
.citation-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  gap: 7px;
}

.citation-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Sliding track */
.citation-toggle-track {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border-radius: 20px;
  background: #c8cdd5;
  transition: background 0.22s ease;
}

/* Sliding thumb */
.citation-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22), 0 0 0 0.5px rgba(0,0,0,0.06);
  transition: transform 0.22s ease;
}

/* ON state */
.citation-toggle input:checked + .citation-toggle-track {
  background: var(--navy);
}
.citation-toggle input:checked + .citation-toggle-track .citation-toggle-thumb {
  transform: translateX(16px);
}

/* Label */
.citation-toggle-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.2s;
}
.citation-toggle input:checked ~ .citation-toggle-label {
  color: var(--navy);
  font-weight: 600;
}

/* Hover */
.citation-toggle:hover .citation-toggle-track {
  background: #b0b7c2;
}
.citation-toggle:hover input:checked + .citation-toggle-track {
  background: var(--navy-light, #5C7696);
}

/* Focus ring */
.citation-toggle input:focus-visible + .citation-toggle-track {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.search-field input[type="text"],
.search-field input[type="date"],
.search-field select {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.search-field input[type="text"] { padding-left: 34px; }

.search-field input:focus,
.search-field select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(55,79,107,0.18);
}

.btn-search {
  background: var(--navy);
  color: #fff;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 9px 22px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-search:hover { background: var(--navy-light); }

.btn-clear {
  display: inline-block;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 9px 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-clear:hover { color: var(--navy); }

/* ── Results header ───────────────────────────────────────────────────────── */
.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.results-count {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  background: var(--navy);
  color: #fff;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Post layout (sidebar + article) ─────────────────────────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 780px);
  gap: 0 2.5rem;
  align-items: start;
  max-width: 1060px;
  margin: 0 auto;
}

/* ── TOC sidebar ──────────────────────────────────────────────────────────── */
.post-toc {
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 0;
}

.post-toc-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
  padding: 0;
}

.post-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-toc-list a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 10px;
  border-left: 2px solid var(--border);
  line-height: 1.35;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.post-toc-list a:hover {
  color: var(--navy);
  border-left-color: var(--navy);
  background: var(--bg);
}

.post-toc-list a.toc-active {
  color: var(--navy);
  border-left-color: var(--gold);
  font-weight: 600;
  background: #fffbf0;
}

/* ── Full post ────────────────────────────────────────────────────────────── */
.post-full {
  min-width: 0;
}

/* ── Collapsible post sections ────────────────────────────────────────────── */
/* The section owns the vertical rhythm, so the gap between sections is uniform
   whether a section is open or collapsed (it does not inherit the markdown h2's
   2em top margin or a body's trailing paragraph margin). */
.post-section { margin-top: 1.75rem; }
.post-section:first-child { margin-top: 0.5rem; }

/* Override the markdown h2 margins (.post-body h2) — needs .post-body scope to
   win on specificity. Spacing above/below the heading is owned by the section
   and the body, not the heading. The gold underline + padding are kept. */
.post-body .post-section-heading {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0;
  margin-bottom: 0;
}

.post-section-heading:hover { opacity: 0.8; }

.post-section-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  font-style: normal;
}

.post-section.collapsed .post-section-chevron {
  transform: rotate(-90deg);
}

/* Collapse via grid-template-rows 1fr -> 0fr. Unlike a max-height/scrollHeight
   transition, the body collapses to a genuine 0px height (no measured value to
   go stale and leave the body occupying space and overlapping the heading
   above), and there is nothing to recompute in JS. The inner wrapper must clip
   its own overflow and allow itself to shrink below content size (min-height:0). */
.post-section-body {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: 0.85rem;
  opacity: 1;
  transition: grid-template-rows 0.28s ease, opacity 0.18s ease, margin-top 0.28s ease;
}

.post-section-body-inner {
  min-height: 0;
  overflow: hidden;
}

/* Kill the trailing paragraph margin so an open section has no dead space below
   its last line inflating the gap to the next section. */
.post-section-body-inner > *:last-child { margin-bottom: 0; }

.post-section.collapsed .post-section-body {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
}

.post-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--border);
}

.back-link {
  display: inline-block;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  transition: color 0.15s;
}

.back-link:hover { color: var(--navy); }

.post-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.post-title {
  font-size: 1.75rem;
  line-height: 1.3;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.post-citation-large {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

/* Parallel / authorised report citations, e.g. "(2015) 91 NSWLR 258". Reads as a
   continuation of the medium neutral citation above it, so it inherits the muted
   italic treatment; the authorised series (NSWLR, CLR) is weighted slightly
   heavier because that is the one a court expects to be cited. */
.post-parallel-citations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: -4px 0 12px;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.88rem;
}

.parallel-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.post-parallel-citations .parallel-citation {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  font-style: italic;
}

.post-parallel-citations .parallel-citation--authorised {
  font-style: normal;
  font-weight: 600;
  color: var(--navy, #374F6B);
}


/* Text pill. It shares .btn-copy-citation with the icon buttons for the copy
   handler, but that rule (inline in post.html, so it loads after this file) is a
   28px square with zero padding, which squeezed the label out of the box. The
   extra selector depth is what lets this win; the explicit auto size and
   padding are what undo the square. */
.post-parallel-citations .btn-copy-full-citation {
  width: auto;
  height: auto;
  padding: 3px 11px;
  white-space: nowrap;
  line-height: 1.4;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--navy, #374F6B);
  background: rgba(55, 79, 107, 0.08);
  border: 1px solid rgba(55, 79, 107, 0.18);
  border-radius: 20px;
  cursor: pointer;
}

.post-parallel-citations .btn-copy-full-citation:hover {
  background: rgba(55, 79, 107, 0.16);
  border-color: rgba(55, 79, 107, 0.32);
  color: var(--navy, #374F6B);
}

.post-parallel-citations .btn-copy-full-citation.copied {
  color: #059669;
  border-color: rgba(5, 150, 105, 0.4);
}

/* Card variant: one line, the highest-ranked citation only. */
.card-parallel-citation {
  margin: 4px 0 0;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
}

.post-action-btns {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  padding: 0 16px;
  height: 32px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.source-link:hover {
  background: var(--navy);
  color: #ffffff;
}

/* ── Treatment / currency warnings ──────────────────────────────────────── */
.treatment-alert {
  border-radius: 6px;
  border: 1px solid transparent;
  border-left-width: 4px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.treatment-alert--danger {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: #dc2626;
  color: #7f1d1d;
}
.treatment-alert--warning {
  background: #fff7ed;
  border-color: #fed7aa;
  border-left-color: #ea580c;
  color: #7c2d12;
}
.treatment-alert--caution {
  background: #fefce8;
  border-color: #fde68a;
  border-left-color: #ca8a04;
  color: #713f12;
}
/* Neutral/informational variant: a post has been updated or corrected. */
.treatment-alert--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #2563eb;
  color: #1e3a5f;
}
.treatment-alert-heading {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}
.treatment-details { margin-top: 8px; }
.treatment-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.8;
}
.treatment-details summary:hover { opacity: 1; }
.treatment-detail-list {
  margin: 6px 0 0 1rem;
  padding: 0;
  font-size: 0.85rem;
  list-style: disc;
}
.treatment-detail-list li { margin-bottom: 4px; }
.treatment-type-badge-inline {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}
.badge--overruled            { background: #fee2e2; color: #991b1b; }
.badge--doubted              { background: #fef3c7; color: #92400e; }
.badge--limited              { background: #fef9c3; color: #854d0e; }
.badge--not_followed         { background: #f3e8ff; color: #6b21a8; }
.badge--superseded_legislation { background: #fff7ed; color: #c2410c; }
.treatment-evidence          { color: inherit; opacity: 0.8; }

/* ── Post disclaimer ─────────────────────────────────────────────────────── */
.post-disclaimer {
  background: #fffbf0;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 32px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.post-disclaimer strong {
  display: block;
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

/* ── Post body (rendered markdown) ───────────────────────────────────────── */
.post-body {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}

.post-body h2 {
  font-size: 1.3rem;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
}

.post-body h3 { font-size: 1.1rem; }

.post-body p { margin-bottom: 1.1em; }

.post-body ul,
.post-body ol {
  margin: 0.8em 0 1.1em 1.5em;
}

.post-body li { margin-bottom: 0.35em; }

.post-body strong { color: var(--navy); font-weight: 700; }

.post-body em { font-style: italic; }

.post-body code {
  font-family: 'Courier New', monospace;
  font-size: 0.88em;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-body blockquote {
  border-left: 4px solid var(--gold);
  margin: 1.5em 0;
  padding: 12px 20px;
  background: #fffbf0;
  color: var(--text-muted);
  font-style: italic;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.post-body a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}

.post-body a:hover { color: var(--gold); }

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.9rem;
  margin: 1.5em 0;
}

.post-body th {
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

.post-body td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.post-body tr:nth-child(even) td { background: var(--bg); }

/* ── Cited-by panel (LCRIM-331) ──────────────────────────────────────────── */
.cited-by-panel {
  margin-top: 40px;
  padding: 24px 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
}

.cited-by-heading {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 16px;
}

.cited-by-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cited-by-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.cited-by-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cited-by-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.cited-by-link:hover .cited-by-title {
  color: var(--gold);
  text-decoration: underline;
}

.cited-by-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

.cited-by-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cited-by-citation,
.cited-by-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.court-badge--small {
  font-size: 0.7rem;
  padding: 1px 7px;
}

.cited-by-more {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Post footer ──────────────────────────────────────────────────────────── */
.post-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.attribution-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.attribution-box strong {
  display: block;
  color: var(--navy);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.attribution-box p { margin-top: 6px; }

.attribution-box a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

.disclaimer {
  font-style: italic;
  color: #9ca3af;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h2 {
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 10px;
}

.empty-state p {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  margin-bottom: 20px;
}

.smart-suggest {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.btn-link-inline {
  background: none;
  border: none;
  padding: 0;
  color: var(--navy);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.empty-state code {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn:hover { background: var(--navy-light); color: #fff; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--cobalt-dark);
  border-top: 3px solid var(--gold);
  padding: 24px 0;
  color: #cbd5e1;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.8rem;
  text-align: center;
}

.site-footer p { margin-bottom: 4px; }

.site-footer a { color: var(--gold-light); }
.site-footer a:hover { color: #fff; }

.footer-disclaimer { color: #64748b; font-style: italic; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 959px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
  .post-toc { display: none; }
}

@media (max-width: 640px) {
  .site-header .container { flex-direction: column; align-items: flex-start; gap: 12px; }
  .logo-title { font-size: 1.1rem; }
  /* Stack the publication title under the LEAP Criminal Law lockup; drop the
     vertical divider so nothing overflows on narrow screens. */
  .site-logo { flex-wrap: wrap; gap: 10px 14px; }
  .brand-divider { display: none; }
  .logo-text { flex-basis: 100%; }
  .post-grid { grid-template-columns: 1fr; }
  .post-title { font-size: 1.4rem; }
  .page-header h1 { font-size: 1.5rem; }

  /* ── Search bar: stack on mobile ────────────────────────────────────────── */
  .search-bar { padding: 14px 16px; }
  .search-primary-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-primary-row .search-field--text { flex: none; width: 100%; }
  .search-actions { flex-wrap: wrap; gap: 6px; }
  .search-actions .btn-search { flex: 1; min-height: 44px; }
  .search-actions .btn-smart-trigger { flex: 1; min-height: 44px; font-size: 0.82rem; padding: 9px 10px; }
  .search-actions .btn-clear { min-height: 44px; padding: 9px 16px; }

  /* ── Collapsible filter row ──────────────────────────────────────────────── */
  #btn-toggle-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
    width: 100%;
    justify-content: center;
    margin-bottom: 0;
    transition: border-color 0.15s, color 0.15s;
  }
  #btn-toggle-filters:hover,
  #btn-toggle-filters.filters-open { border-color: var(--navy); color: var(--navy); }
  #btn-toggle-filters .filter-chevron {
    display: inline-block;
    transition: transform 0.2s;
  }
  #btn-toggle-filters.filters-open .filter-chevron { transform: rotate(180deg); }

  .search-filter-row {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin-top 0.2s;
    margin-top: 0;
    pointer-events: none;
  }
  .search-filter-row.filters-open {
    max-height: 500px;
    opacity: 1;
    margin-top: 10px;
    pointer-events: auto;
  }
  .search-filter-row .search-field { width: 100%; flex: none; }
  .search-field--court,
  .search-field--date,
  .search-field--sort { flex: none; width: 100%; }

  /* Touch targets for date inputs and selects */
  .search-field input[type="date"],
  .search-field select { min-height: 44px; }

  /* Hide list view toggle on mobile — tile and compact are sufficient */
  #btn-list, #btn-smart-list { display: none; }

  /* ── Results toolbar: wrap exports to second line ────────────────────────── */
  .results-toolbar { flex-wrap: wrap; gap: 8px; }
  .results-left { flex: 1 1 100%; }
  .results-toolbar .smart-bar-right { width: 100%; order: 3; }
  .results-toolbar .view-toggle { margin-left: auto; }
  .btn-export { flex: 1; text-align: center; min-height: 40px; font-size: 0.8rem; padding: 8px 10px; }

  /* ── List view: stack on mobile ─────────────────────────────────────────── */
  .post-list .post-card {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "meta  link"
      "title link"
      "citation link"
      "snippet snippet"
      "tags tags";
    column-gap: 12px;
    row-gap: 3px;
    padding: 14px 16px;
  }
  .post-list .post-card-meta {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .post-list .post-card-title { font-size: 0.95rem; }
  .post-list .card-links { align-self: start; }
}

/* ── Advanced Search trigger button ──────────────────────────────────────── */
.btn-smart-trigger {
  position: relative;
  background: transparent;
  color: var(--navy);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid var(--navy);
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.btn-smart-trigger:hover {
  background: var(--navy);
  color: #fff;
}

/* Tooltip bubble shown on hover */
.btn-smart-trigger[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}

.btn-smart-trigger[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}

.btn-smart-trigger[data-tooltip]:hover::after,
.btn-smart-trigger[data-tooltip]:hover::before {
  opacity: 1;
}

/* ── Advanced Search modal overlay ───────────────────────────────────────── */
.smart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* display is toggled by JS */
}

.smart-modal {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Modal header */
.smart-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--navy);
  flex-shrink: 0;
}

.smart-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
}

.smart-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.smart-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* Modal body */
.smart-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.smart-hint {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.55;
}

.smart-textarea {
  width: 100%;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 150px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.smart-textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(28, 52, 97, 0.1);
}

/* Terms preview */
.smart-terms-section {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.smart-terms-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.smart-terms-lbl {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.smart-reparse-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.smart-reparse-btn:hover { border-color: var(--navy); color: var(--navy); }

.smart-terms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.smart-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--navy);
  color: #fff;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.78rem;
  padding: 3px 4px 3px 9px;
  border-radius: 20px;
  max-width: 280px;
  word-break: break-word;
}

.smart-chip-x {
  background: rgba(255, 255, 255, 0.22);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.12s;
}
.smart-chip-x:hover { background: rgba(255, 255, 255, 0.4); }

/* Modal footer */
.smart-modal-ftr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}

.smart-status {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Threshold selector row */
.smart-threshold-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.smart-threshold-lbl {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.smart-threshold-sel {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  flex: 1;
}
.smart-threshold-sel:focus { border-color: var(--navy); }

.smart-modal-btns { display: flex; align-items: center; gap: 8px; }

.btn-smart-cancel {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.btn-smart-cancel:hover { border-color: var(--navy); color: var(--navy); }

.btn-smart-run {
  background: var(--gold);
  color: #fff;
  border: none;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 8px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-smart-run:hover:not(:disabled) { background: var(--gold-light); }
.btn-smart-run:disabled { background: var(--text-muted); cursor: not-allowed; opacity: 0.7; }

/* ── Advanced Search results banner ──────────────────────────────────────── */
.smart-bar {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  background: var(--navy);
  border-radius: var(--radius);
  margin-bottom: 20px;
  /* display:flex toggled by JS */
}

.smart-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.smart-bar-tag {
  background: var(--gold);
  color: #fff;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
}

.smart-bar-count {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.btn-show-all {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn-show-all:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.7);
}

.smart-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-export {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn-export:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.65);
}
.btn-export:disabled { opacity: 0.5; cursor: not-allowed; }

/* Export buttons placed in the light results toolbar (not on the dark banner) */
.results-toolbar .btn-export {
  background: var(--bg-white);
  color: var(--navy);
  border-color: var(--border);
}
.results-toolbar .btn-export:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--navy);
}

.btn-smart-clear {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn-smart-clear:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

/* ── Advanced Search result card extras ──────────────────────────────────── */

/* Score badge + ? button group */
.smart-score-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* ? button — 16px visible circle with a 44×44px invisible touch target (WCAG 2.5.5) */
.score-why-btn {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  color: #fff;
  border: none;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s;
  padding: 0;
}
.score-why-btn::before {
  content: '';
  position: absolute;
  top: -14px; right: -14px; bottom: -14px; left: -14px;
}
.score-why-btn:hover { background: var(--navy); }

/* ── "Why relevant" mini-dialog ──────────────────────────────────────────── */
.why-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.why-dialog {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.28);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.why-dialog-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: var(--navy);
  color: #fff;
}

.why-dialog-title {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.why-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s;
}
.why-close:hover { color: #fff; background: rgba(255,255,255,0.15); }

.why-dialog-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

.why-citation {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

.why-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.why-score-lbl {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.why-section {
  margin-bottom: 10px;
}

.why-section-lbl {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  margin-bottom: 5px;
}

.why-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.why-term {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.8rem;
  padding: 3px 9px;
  border-radius: 20px;
}

.why-term--exact   { background: #d4edda; color: #155724; }
.why-term--partial { background: #fff3cd; color: #856404; }

.why-case {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.why-score-line {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--text);
  margin: 0 0 12px;
}
.why-none {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Prose paragraph in the relevance popup */
.why-para {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 14px;
}
.why-para:last-child { margin-bottom: 0; }

/* Inline term highlight inside the prose */
.why-inline-term {
  font-weight: 600;
  color: var(--navy);
}

/* Excerpt blockquote */
.why-excerpt {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--light-grey, #BBBDBF);
  background: var(--bg-alt, #F3F3F3);
  border-radius: 0 4px 4px 0;
  font-size: 0.83rem;
  line-height: 1.6;
  color: #555;
  font-style: italic;
}

/* Relevance score badge */
.smart-score {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  flex-shrink: 0;
}
.score-high { background: #d4edda; color: #155724; }
.score-mid  { background: #fff3cd; color: #856404; }
.score-low  { background: #e9ecef; color: #495057; }

/* Authority badge — marks results lifted in rank by citation authority */
.authority-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--gold-light);
  white-space: nowrap;
  cursor: default;
}

/* One-line legend above semantic results explaining authority-boosted ranking */
.smart-legend {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.smart-legend .authority-badge { cursor: default; }

/* Snippet excerpt */
.smart-snippet {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Bottom links row */
.smart-card-links {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.smart-ext-link {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  transition: color 0.15s;
}
.smart-ext-link:hover { color: var(--gold-light); }

/* ── Advanced/semantic result cards: structured-slot layout (grid view) ─────
   Every tile keeps the same anatomy regardless of court-name length, date
   length, an authority badge, or a citation count. The top band never wraps
   (court badge left, relevance right); the date and citation count fold into
   one muted meta line under the title; the authority badge and bookmark live
   in the footer, so optional elements never reflow the rest of the card.
   Scoped to #smart-container.post-grid so list, compact, and the normal listing
   are untouched. */

/* Date + citation-count line — grid view only (list/compact show the date in
   their own meta rail). */
.smart-cardmeta { display: none; }
#smart-container.post-grid .smart-cardmeta {
  display: block;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -4px;
}

/* Top band: one line. Court badge can shrink with an ellipsis as a last-resort
   safety valve (real court names fit), so the relevance pill stays pinned
   right and the band can never wrap or overflow. */
#smart-container.post-grid .bm-meta-left {
  flex-wrap: nowrap;
  min-width: 0;
}
#smart-container.post-grid .post-date { display: none; }
#smart-container.post-grid .court-badge {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Title clamps to two lines so every tile shares the same rhythm. */
#smart-container.post-grid .post-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer is a single row: actions left, authority badge + bookmark right. */
#smart-container.post-grid .smart-card-links {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
#smart-container.post-grid .smart-auth-slot {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

/* ── Normal browse cards: structured-slot layout (grid view) ────────────────
   Same discipline as the smart tiles above, so every tile has the identical
   anatomy regardless of court-name length or title length. The top band is a
   single row that never wraps (court badge left, bookmark pinned right); the
   date is lifted onto its own line under the title; the title clamps to two
   lines. A long court name (e.g. Court of Criminal Appeal) can therefore never
   push the bookmark onto a second line or move where the title starts.
   Scoped to #post-container.post-grid so list and compact are untouched. */
#post-container.post-grid .post-card-meta { flex-wrap: nowrap; }
#post-container.post-grid .bm-meta-left {
  flex-wrap: nowrap;
  min-width: 0;
}
#post-container.post-grid .post-date { display: none; }
#post-container.post-grid .card-grid-date { display: block; }
/* Court badge is the last-resort shrink target with an ellipsis safety valve;
   real court names fit, so this only ever engages at the narrowest column. */
#post-container.post-grid .court-badge {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Title clamps to two lines so long case names truncate instead of blowing out
   the tile height or forcing large line breaks between tiles. */
#post-container.post-grid .post-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Court multi-select dropdown ──────────────────────────────────────────── */
.court-multisel {
  position: relative;
}

.court-multisel-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
}
.court-multisel-btn:focus,
.court-multisel-btn[aria-expanded="true"] {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(28, 52, 97, 0.1);
}

#court-label {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.court-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: 6px 0;
  max-height: 220px;
  overflow-y: auto;
}

.court-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  transition: background 0.1s;
  white-space: nowrap;
}
.court-option:hover { background: var(--bg); }
.court-option input[type="checkbox"] { accent-color: var(--navy); cursor: pointer; }

/* Select-all / clear row at the top of the crime-type filter panel. */
.cat-panel-actions {
  display: flex;
  gap: 8px;
  padding: 4px 14px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.cat-panel-actions button {
  background: none;
  border: none;
  padding: 2px 2px;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  text-decoration: underline;
}
.cat-panel-actions button:hover { color: var(--navy-light, #5C7696); }

/* ── Advanced search modal: filter bar ───────────────────────────────────── */
.smart-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.smart-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
}

.smart-filter-lbl {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.smart-court-cbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.smart-court-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.smart-court-option input[type="checkbox"] { accent-color: var(--navy); }

.smart-filter-dates {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  flex: 0 1 auto;
}

.smart-date-input {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 5px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s;
}
.smart-date-input:focus { border-color: var(--navy); }

/* ── Responsive: Advanced Search ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .smart-modal { max-height: 95vh; width: calc(100vw - 24px); border-radius: 10px; }
  .smart-modal-body { padding: 14px 16px; overflow-y: auto; }
  .smart-textarea { min-height: 100px; }
  .smart-close-btn { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .smart-modal-ftr { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; }
  .smart-threshold-wrap { flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; }
  .smart-threshold-sel { width: 100%; min-height: 44px; }
  .smart-modal-btns { flex-direction: column; gap: 6px; }
  .btn-smart-cancel { width: 100%; min-height: 44px; text-align: center; }
  .btn-smart-run { width: 100%; min-height: 44px; }
  .smart-filter-bar { flex-direction: column; gap: 10px; }
  .smart-filter-group { flex-wrap: wrap; }
  .smart-date-input { min-height: 44px; }

  .smart-bar { flex-direction: column; align-items: flex-start; }
  .smart-bar-right { width: 100%; flex-wrap: wrap; }
  .btn-smart-clear { flex: 1; text-align: center; min-height: 40px; }
  .smart-chip-x { width: 28px; height: 28px; }
}


/* Admin area
   ─────────────────────────────────────────────────────────────────────────── */

.admin-body { background: #f0f2f5; display: block; min-height: 100vh; }

/* Header */
.admin-header { background: var(--cobalt-dark); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 100; }
.admin-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.admin-logo-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.admin-site-name { font-size: 15px; font-weight: 600; color: #fff; }
.admin-area-badge { background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; }
.admin-nav { display: flex; align-items: center; gap: 4px; }
.admin-nav-link { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 5px; display: flex; align-items: center; gap: 6px; transition: background 0.15s, color 0.15s; }
.admin-nav-link:hover { background: rgba(255,255,255,0.12); color: #fff; }
.admin-nav-link--subtle { opacity: 0.7; }
.admin-nav-link--logout { margin-left: 8px; border: 1px solid rgba(255,255,255,0.3); }
.admin-nav-link--logout:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.6); }
.admin-nav-count { background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; min-width: 20px; text-align: center; }
.admin-nav-count--warn { background: #dc2626; }
.admin-nav-user { color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 600; padding: 0 8px; white-space: nowrap; }

/* Flash messages */
.admin-flashes { display: flex; flex-direction: column; }
.admin-flash { padding: 12px 24px; font-size: 14px; font-weight: 600; }
.admin-flash--success { background: #d1fae5; color: #065f46; border-bottom: 1px solid #6ee7b7; }
.admin-flash--error   { background: #fee2e2; color: #991b1b; border-bottom: 1px solid #fca5a5; }
.admin-flash--info    { background: #dbeafe; color: #1e40af; border-bottom: 1px solid #93c5fd; }
.admin-flash--warning { background: #fef3c7; color: #92400e; border-bottom: 1px solid #fcd34d; }

/* Main */
.admin-main { padding: 32px 0 64px; }
.admin-page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.admin-page-title { font-size: 22px; font-weight: 700; color: var(--navy); margin: 0; }

/* Dashboard stats */
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 40px; }
.admin-stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; text-decoration: none; display: block; transition: box-shadow 0.15s; border-left: 4px solid var(--navy-light); }
.admin-stat:hover { box-shadow: var(--shadow-md); }
.admin-stat--alert { border-left-color: var(--gold); }
.admin-stat--warn  { border-left-color: #f59e0b; }
.admin-stat--muted { border-left-color: #d1d5db; }
.admin-stat-value { font-size: 36px; font-weight: 700; color: var(--navy); line-height: 1; margin-bottom: 6px; }
.admin-stat--alert .admin-stat-value { color: var(--gold); }
.admin-stat-label { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.admin-stat-hint { font-size: 12px; color: var(--text-muted); }

/* Quick links */
.admin-quick-links { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.admin-quick-links h2 { font-size: 15px; color: var(--navy); margin-bottom: 12px; }
.admin-quick-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.admin-quick-links li { font-size: 14px; color: var(--text-muted); }
.admin-quick-links a { color: var(--navy); font-weight: 600; }

/* Section */
.admin-section { margin-bottom: 48px; }
.admin-section-title { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.admin-section-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.admin-count-badge { background: var(--gold); color: #fff; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 2px 10px; }
.admin-count-badge--muted { background: #9ca3af; }

/* Queue cards */
.admin-queue-list { display: flex; flex-direction: column; gap: 12px; }
.admin-queue-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; border-left: 4px solid var(--navy-light); }
.admin-queue-card--risk { border-left-color: #f59e0b; background: #fffbeb; }
.admin-queue-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-queue-citation { font-size: 15px; font-weight: 700; color: var(--navy); }
.admin-queue-court    { font-size: 13px; color: var(--text-muted); }
.admin-queue-date     { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.admin-queue-reason { font-size: 13px; color: #374151; margin-bottom: 8px; }
.admin-risk-badge { display: inline-flex; align-items: center; gap: 4px; background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; border: 1px solid #fcd34d; border-radius: 3px; padding: 2px 8px; margin-right: 8px; }
.admin-risk-warning { font-size: 12px; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 4px; padding: 8px 12px; margin-bottom: 10px; }
.admin-queue-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Buttons */
.admin-btn { display: inline-flex; align-items: center; border-radius: 5px; font-family: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s; white-space: nowrap; }
.admin-btn--sm { font-size: 13px; padding: 6px 14px; }
.admin-btn--md { font-size: 14px; padding: 8px 18px; }
.admin-btn--primary { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.admin-btn--primary:hover { background: var(--navy-light); border-color: var(--navy-light); }
.admin-btn--danger { background: #dc2626; color: #fff; border: 1px solid #dc2626; }
.admin-btn--danger:hover { background: #b91c1c; border-color: #b91c1c; }
.admin-btn--ghost { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.admin-btn--ghost:hover { background: #f9fafb; border-color: #9ca3af; }

/* Table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-table th { background: var(--cobalt-dark); color: #fff; text-align: left; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #f8f9fb; }
.admin-table a { color: var(--navy); }
.post-row--unpublished td { opacity: 0.65; }
.post-row--unpublished:hover td { opacity: 1; }

/* Status badges */
.admin-status-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 9px; border-radius: 10px; }
.admin-status-badge--published    { background: #d1fae5; color: #065f46; }
.admin-status-badge--unpublished  { background: #fee2e2; color: #991b1b; }
.admin-status-badge--approved     { background: #d1fae5; color: #065f46; }
.admin-status-badge--rejected     { background: #fee2e2; color: #991b1b; }
.admin-status-badge--pending_review { background: #fef3c7; color: #92400e; }

/* Empty state */
.admin-empty { color: var(--text-muted); font-size: 15px; padding: 32px 0; }

/* Login page */
.admin-login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--navy); }
.admin-login-wrap { width: 100%; max-width: 400px; padding: 20px; }
.admin-login-card { background: #fff; border-radius: 10px; padding: 36px 32px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.admin-login-logo { text-align: center; margin-bottom: 20px; }
.admin-login-title { font-size: 20px; font-weight: 700; color: var(--navy); text-align: center; margin-bottom: 4px; }
.admin-login-sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 24px; }
.admin-login-error { background: #fee2e2; color: #991b1b; border-radius: 5px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.admin-login-form { display: flex; flex-direction: column; gap: 12px; }
.admin-login-form label { font-size: 13px; font-weight: 600; color: var(--navy); }
.admin-login-form input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; font-family: inherit; outline: none; transition: border-color 0.15s; }
.admin-login-form input[type=password]:focus { border-color: var(--navy); }
.admin-login-form button { background: var(--navy); color: #fff; border: none; border-radius: 6px; padding: 11px; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.15s; }
.admin-login-form button:hover { background: var(--navy-light); }

/* Approve loading state */
.btn-approve[data-loading] { opacity: 0.6; pointer-events: none; }
.btn-approve[data-loading]::after { content: " — processing..."; }

/* Responsive */
@media (max-width: 768px) {
  .admin-header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .admin-nav { flex-wrap: wrap; gap: 2px; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-page-header { flex-direction: column; align-items: flex-start; }
}

/* Duplicate queue card */
.admin-queue-card--dupe { border-left-color: #6366f1; background: #f5f3ff; }
.admin-dupe-notice { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.admin-dupe-badge { background: #ede9fe; color: #4c1d95; font-size: 11px; font-weight: 700; border: 1px solid #c4b5fd; border-radius: 3px; padding: 2px 8px; }
.admin-dupe-notice a { font-size: 13px; color: #4c1d95; }
.admin-count-badge--warn { background: #6366f1; }
.admin-status-badge--duplicate { background: #ede9fe; color: #4c1d95; }

/* ═══════════════════════════════════════════════════════════════════════════
   SUBSCRIBE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── "Subscribe" header nav button (mirrors .btn-saved-header) ────────────── */
.btn-subscribe-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.45);
  color: #fff;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  padding: 0 14px;
  height: 27px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-subscribe-header:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.75); }

/* ── Subscribe / unsubscribe modal ─────────────────────────────────────────── */
.sub-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sub-modal {
  background: var(--bg-white);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  animation: subModalIn 0.2s ease-out both;
}
@keyframes subModalIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sub-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.sub-modal-title { font-size: 1rem; font-weight: 700; color: var(--cobalt-dark); }
.sub-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.sub-modal-close:hover { color: #111827; }
.sub-modal-tabs { display: flex; border-bottom: 1px solid #e5e7eb; }
.sub-tab-btn {
  flex: 1 1 auto;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.sub-tab-btn--active { color: var(--cobalt); border-bottom-color: var(--cobalt); }
.sub-modal-body { padding: 18px 20px 22px; }
.sub-form-intro { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 14px; line-height: 1.45; }
.sub-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin: 14px 0 6px;
}
.sub-field-hint { font-weight: 400; color: var(--text-muted); text-transform: none; }
.sub-form input[type=email] {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.9rem;
  font-family: inherit;
}
.sub-form input[type=email]:focus { outline: none; border-color: var(--cobalt); }
.sub-checkbox-group { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.sub-checkbox-group--grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.sub-checkbox { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: #374151; cursor: pointer; }
.sub-honeypot { position: absolute; left: -9999px; top: -9999px; }
.sub-submit-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 9px 14px;
  background: var(--cobalt);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.sub-submit-btn:hover { background: var(--cobalt-dark); }
.sub-submit-btn:disabled { opacity: 0.6; cursor: default; }
.sub-result { margin: 12px 0 0; font-size: 0.85rem; }
.sub-result--ok { color: #166534; }
.sub-result--error { color: #b91c1c; }

/* ═══════════════════════════════════════════════════════════════════════════
   BOOKMARKS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── "Saved (N)" header nav button ─────────────────────────────────────────── */
.btn-saved-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.45);
  color: #fff;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  padding: 0 14px;
  height: 27px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-saved-header:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.75); }
.bm-count-badge {
  background: var(--gold);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  transition: opacity 0.15s;
}
.btn-saved-header[data-count="0"] .bm-count-badge { display: none; }

/* ── Bookmark icon button on cards ─────────────────────────────────────────── */
.post-card-meta { align-items: center; }
.bm-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.btn-bookmark {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  transition: color 0.15s, background 0.12s;
  flex-shrink: 0;
  margin-left: auto;
}
.btn-bookmark:hover { background: var(--bg); color: var(--gold); }
.btn-bookmark[aria-pressed="true"] { color: var(--gold); }
.btn-bookmark svg { width: 18px; height: 18px; pointer-events: none; display: block; }

/* ── Bookmark button on post detail page ───────────────────────────────────── */
.btn-bookmark-post {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-bookmark-post:hover { background: var(--navy); color: #fff; }
.btn-bookmark-post[aria-pressed="true"] { background: var(--navy); color: #fff; }
.btn-bookmark-post svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Note modal ─────────────────────────────────────────────────────────────── */
.bm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.bm-modal {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
}
.bm-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--navy);
  border-bottom: 1px solid var(--border);
}
.bm-modal-title { font-size: 0.95rem; font-weight: 700; color: #fff; }
.bm-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.bm-modal-close:hover { color: #fff; background: rgba(255,255,255,0.15); }
.bm-modal-body { padding: 18px 20px; }
.bm-modal-case-title { font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.bm-modal-case-meta { font-size: 0.8rem; color: var(--text-muted); font-style: italic; margin-bottom: 14px; }
.bm-note-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.bm-note-textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bm-note-textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(55,79,107,0.18); }
.bm-modal-ftr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  gap: 10px;
  flex-wrap: wrap;
}
.bm-remove-btn {
  background: none;
  border: 1.5px solid var(--border);
  color: #dc2626;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.bm-remove-btn:hover { background: #fee2e2; border-color: #dc2626; }
.bm-modal-actions { display: flex; gap: 8px; }
.bm-cancel-btn {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.bm-cancel-btn:hover { border-color: var(--navy); color: var(--navy); }
.bm-save-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 7px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.bm-save-btn:hover { background: var(--gold-light); }

/* ── Saved decisions panel (right-edge drawer) ──────────────────────────────── */
.bm-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1050;
  display: flex;
  justify-content: flex-end;
}
.bm-panel {
  background: var(--bg-white);
  width: 100%;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.18);
  animation: bmSlideInRight 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes bmSlideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.bm-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  flex-shrink: 0;
}
.bm-panel-title { font-size: 1rem; font-weight: 700; color: #fff; }
.bm-panel-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.bm-panel-close:hover { color: #fff; background: rgba(255,255,255,0.15); }
.bm-panel-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.bm-panel-export-btn {
  background: var(--bg-white);
  color: var(--navy);
  border: 1.5px solid var(--border);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.bm-panel-export-btn:hover:not(:disabled) { background: var(--bg); border-color: var(--navy); }
.bm-panel-export-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bm-panel-clear-btn {
  margin-left: auto;
  background: none;
  border: 1.5px solid var(--border);
  color: #dc2626;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.bm-panel-clear-btn:hover { background: #fee2e2; border-color: #dc2626; }
.bm-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.bm-panel-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.bm-panel-empty-icon { margin-bottom: 16px; }
.bm-panel-empty-icon svg { width: 48px; height: 48px; opacity: 0.35; }
.bm-panel-empty p { font-size: 0.9rem; margin-top: 6px; }
.bm-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--bg-white);
  box-shadow: var(--shadow);
}
.bm-entry-title { font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.bm-entry-title a { color: inherit; text-decoration: none; }
.bm-entry-title a:hover { color: var(--gold); }
.bm-entry-meta { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin-bottom: 8px; }
.bm-entry-note {
  font-size: 0.82rem;
  color: var(--text);
  background: var(--tag-bg);
  border-left: 3px solid var(--gold);
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.bm-entry-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bm-entry-link { font-size: 0.78rem; color: var(--navy); font-weight: 600; text-decoration: none; }
.bm-entry-link:hover { color: var(--gold); }
.bm-entry-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
}
.bm-entry-edit-btn:hover { color: var(--navy); }
.bm-entry-remove-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
}
.bm-entry-remove-btn:hover { color: #991b1b; }

/* ── External link warning dialog ───────────────────────────────────────────── */
.bm-warn-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.bm-warn-dialog {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 20px;
  text-align: center;
}
.bm-warn-icon { font-size: 2.5rem; margin-bottom: 10px; }
.bm-warn-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.bm-warn-body { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.55; }
.bm-warn-actions { display: flex; flex-direction: column; gap: 8px; }
.bm-warn-export {
  background: var(--gold);
  color: #fff;
  border: none;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.bm-warn-export:hover { background: var(--gold-light); }
.bm-warn-continue {
  background: var(--navy);
  color: #fff;
  border: none;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.bm-warn-continue:hover { background: var(--navy-light); }
.bm-warn-stay {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.bm-warn-stay:hover { border-color: var(--navy); color: var(--navy); }

@media (max-width: 640px) {
  .bm-panel { max-width: 100%; }
}

/* ── Back-to-top button ──────────────────────────────────────────────────────── */
#btn-back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.15s;
}
#btn-back-to-top.btt-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#btn-back-to-top:hover { background: var(--navy-light); }
#btn-back-to-top svg { width: 20px; height: 20px; }

@media (max-width: 640px) {
  #btn-back-to-top { bottom: 20px; right: 20px; }
}

/* ── "What's New" widget (round launcher -> toast stack, bottom-left) ───────── */
#whatsnew-fab {
  position: fixed; left: 32px; bottom: 32px; z-index: 900;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(23, 37, 66, 0.30);
  transition: background 0.12s ease, transform 0.12s ease;
}
#whatsnew-fab:hover { background: var(--navy-light); transform: translateY(-2px); }
#whatsnew-fab svg { width: 24px; height: 24px; }
.whatsnew-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--orange, #FF7F19); color: #1a1205;
  font-size: 11px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-white, #fff);
}
#whatsnew-panel {
  position: fixed; left: 32px; bottom: 32px; z-index: 901;
  width: 330px; max-width: calc(100vw - 40px);
  background: var(--bg-white, #fff); border: 1px solid var(--border, #e6e9f0);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(23, 37, 66, 0.22); overflow: hidden;
}
.whatsnew-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border, #e6e9f0); }
.whatsnew-spark { width: 15px; height: 15px; color: var(--orange, #FF7F19); flex-shrink: 0; }
.whatsnew-lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy); flex: 1; }
.whatsnew-collapse { background: none; border: none; cursor: pointer; color: var(--text-muted, #6b7686); padding: 4px; border-radius: 6px; line-height: 0; }
.whatsnew-collapse:hover { color: var(--navy); background: var(--bg, #f0f3f7); }
.whatsnew-collapse svg { width: 13px; height: 13px; }
.whatsnew-items { max-height: 320px; overflow-y: auto; }
.whatsnew-item { position: relative; padding: 13px 40px 13px 16px; border-bottom: 1px solid var(--border, #e6e9f0); }
.whatsnew-item:last-child { border-bottom: none; }
.whatsnew-x { position: absolute; top: 11px; right: 10px; background: none; border: none; cursor: pointer; color: var(--text-muted, #6b7686); padding: 4px; border-radius: 6px; line-height: 0; }
.whatsnew-x:hover { color: var(--navy); background: var(--bg, #f0f3f7); }
.whatsnew-x svg { width: 13px; height: 13px; }
.whatsnew-title { margin: 0 0 3px; font-size: 14px; font-weight: 700; color: var(--text, #1f2733); }
.whatsnew-body { margin: 0 0 5px; font-size: 13px; color: #56606e; line-height: 1.5; }
.whatsnew-link { font-size: 12.5px; font-weight: 600; color: var(--navy); text-decoration: none; }
.whatsnew-link:hover { text-decoration: underline; }
/* id+attr specificity beats the class display rules above */
#whatsnew-fab[hidden], #whatsnew-panel[hidden] { display: none; }
@media (max-width: 640px) {
  #whatsnew-fab { left: 20px; bottom: 20px; }
  #whatsnew-panel { left: 20px; bottom: 20px; }
}

/* ── Archive pages (LCRIM-555) ─────────────────────────────────────────────── */
.archive-crumbs { font-size: 0.85rem; color: #6b7280; margin: 0.5rem 0 0.25rem; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.archive-crumbs a { color: #374F6B; text-decoration: none; }
.archive-crumbs a:hover { text-decoration: underline; }
.archive-crumbs [aria-current] { color: #111827; font-weight: 600; }
.archive-header .archive-page-status { color: #6b7280; font-size: 0.9rem; margin: 0.25rem 0 0; }
.archive-list { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid #e5e7eb; }
.archive-item { border-bottom: 1px solid #e5e7eb; }
.archive-link { display: block; padding: 0.8rem 0.25rem; text-decoration: none; color: inherit; }
.archive-link:hover .archive-title { color: #374F6B; text-decoration: underline; }
.archive-title { display: block; font-weight: 600; color: #111827; }
.archive-meta { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.25rem; font-size: 0.85rem; color: #6b7280; }
.archive-citation { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #374151; }
.archive-pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.archive-pager-link { color: #374F6B; font-weight: 600; text-decoration: none; }
.archive-pager-link:hover { text-decoration: underline; }
.archive-pager-link--disabled { color: #9ca3af; }
.archive-pager-status { color: #6b7280; font-size: 0.9rem; }
.archive-back { margin: 1rem 0 2rem; }
.archive-section { margin: 1.75rem 0; }
.archive-section h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
.archive-court-heading { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
.archive-court-heading a { color: #374F6B; text-decoration: none; }
.archive-court-heading a:hover { text-decoration: underline; }
.archive-facets { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.archive-facets li { white-space: nowrap; }
.archive-facets a { color: #374F6B; font-weight: 600; text-decoration: none; }
.archive-facets a:hover { text-decoration: underline; }
.archive-facets--compact a { font-weight: 400; }
.archive-count { color: #9ca3af; font-size: 0.8rem; }
.related-browse a { color: #374F6B; }

/* Breadcrumb trail (LCRIM-558), rendered by base.html above the page content */
.breadcrumbs { font-size: 0.85rem; color: #6b7280; margin: 0.6rem 0 0.25rem; }
.breadcrumbs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.breadcrumbs-item + .breadcrumbs-item::before { content: "\203A"; margin-right: 0.35rem; color: #9ca3af; }
.breadcrumbs a { color: #374F6B; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current] { color: #111827; font-weight: 600; }
.post-layout .breadcrumbs { margin-bottom: 0; }
