/* =====================================================================
   Lucent Style Guide v2 — "Forest + Copper"
   Palette and role assignments verified against the source PDF
   (~/Desktop/Lucent Style Guide v2.pdf, section "02 — Color", swatch
   labels: Forest Deep / Forest / Copper / Copper Light / Cream Canvas /
   Surface / Body Text / Muted / Success Sage / Redline*).
   ===================================================================== */
:root {
  --forest-deep: #24402F;   /* Forest Deep  — dark surfaces: header, footer, sidebar */
  --forest:      #2E4A3A;   /* Forest       — primary: headings, buttons, links */
  --copper:      #B67A3A;   /* Copper       — signature accent, one thing per view */
  --copper-light:#CE9A5E;   /* Copper Light — hover states, on-dark accents, rules */
  --cream:       #F1ECDF;   /* Cream Canvas — page background */
  --surface:     #FCFAF3;   /* Surface      — card / alt background */
  --text-body:   #2C3A30;   /* Body Text */
  --muted:       #6E6A5B;   /* Muted        — secondary text, borders */
  --sage:        #4C7A5E;   /* Success Sage — positive/success semantic only */

  /* Type families (Google Fonts, loaded via <link> in base.html — same CDN
     pattern this app already uses for htmx). */
  --font-display: 'Libre Caslon Display', 'Libre Caslon Text', Georgia, serif;
  --font-serif:   'Libre Caslon Text', Georgia, serif;
  --font-sans:    'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  /* --------------------------------------------------------------------
     RESERVED — do not repurpose, do not replace with new-palette colors.
     The style guide's own "Redline*" / oxblood (#8B3A3A) swatch names
     this exact role (functional deletion color inside NDAA Redline diffs)
     and its own worked example recolors our diffs entirely (oxblood
     strike / sage insert). That is a deliberate, explicit rejection for
     THIS app — amendment-diff coloring is a pre-existing product decision
     (prd.md:51, changelog.md:569) and is out of scope for this rebrand.
     -------------------------------------------------------------------- */
  --red-amendment: #cc0000;  /* RESERVED for amendment text only */
  --red-brand: #b91c1c;      /* RESERVED — the word "Redline" only */
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--cream); color: var(--text-body); line-height: 1.6; }

/* Headings default to the sans "workhorse" unless a rule below opts into
   the serif display face for a deliberate, large moment (Do — reserve
   Caslon for the largest, most deliberate moments; never below 20px). */
h1, h2, h3 { font-family: var(--font-sans); }

/* Header */
header {
  background: var(--forest-deep);
  color: var(--surface);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
header a.site-title {
  color: var(--surface);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
header a.site-title:hover { color: var(--copper-light); }

/* Logo mark — original Lucent prism mark (navy/copper "as delivered" mark,
   not the green-recolored variant), cropped tight to the glyph with a
   transparent background so it sits directly on the header/footer color
   with no boxed-in chip. */
.brand-mark {
  height: 36px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
footer .brand-mark { height: 26px; }

/* Layout */
.layout {
  display: flex;
  min-height: calc(100vh - 120px);
}

/* Sidebar — a "dark surface" per the style guide (Forest Deep), matching
   its own Navigation pattern (dark nav rail, copper marks the active row). */
.sidebar {
  width: 260px;
  min-width: 220px;
  background: var(--forest-deep);
  color: var(--surface);
  border-right: 1px solid rgba(206, 154, 94, 0.25); /* copper-light rule, per guide */
  padding: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
}
.sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(206, 154, 94, 0.25);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
}
.sidebar-footer a { color: var(--copper-light); text-decoration: none; }
.sidebar-footer a:hover { color: var(--surface); text-decoration: underline; }

/* Content */
.content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

/* Footer */
footer {
  background: var(--forest-deep);
  color: rgba(252, 250, 243, 0.7);
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Amendment text (red is reserved for this only — see :root note above) */
.insert { color: var(--red-amendment); font-weight: normal; }
.delete { color: #000; text-decoration: line-through; }

/* Utility */
.placeholder-text { color: var(--muted); font-style: italic; }

/* TOC Sidebar */
.toc-container { font-size: 0.85rem; }
.toc-title { margin-bottom: 0.25rem; }
.toc-title-header {
  cursor: pointer;
  font-weight: 600;
  color: var(--surface);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  padding: 0.25rem 0;
  list-style: none;
  user-select: none;
}
.toc-title-header::-webkit-details-marker { display: none; }
.toc-title-header::before { content: "▶ "; font-size: 0.7rem; }
details[open] > .toc-title-header::before { content: "▼ "; }
.toc-section-list { list-style: none; padding-left: 1rem; margin: 0.25rem 0; }
.toc-section-item { padding: 0.15rem 0.3rem; line-height: 1.3; border-radius: 4px; }
.toc-section-item a { color: rgba(252, 250, 243, 0.82); text-decoration: none; }
.toc-section-item a:hover { color: var(--copper-light); text-decoration: underline; }
.toc-active { background: var(--copper); }
.toc-active a { color: var(--forest-deep); font-weight: 700; }
.toc-active a:hover { color: var(--forest-deep); }

/* Section Detail Page */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--forest); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.section-heading {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 2.125rem; /* H1 / Caslon — 34px per style guide type scale */
  color: var(--forest);
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--muted);
  padding-bottom: 0.5rem;
}
/* Sub-section headings (settings page etc.) — H2 / Public Sans per the
   type scale. Caslon is reserved for 20px+; these run smaller, so they
   stay in the sans family rather than shrinking the serif below its floor. */
.subsection-heading {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.375rem; /* H2 / Public Sans — 22px */
  color: var(--forest);
  margin-bottom: 0.75rem;
}
.usc-panel { background: var(--surface); border-left: 4px solid var(--forest); padding: 1rem 1.25rem; margin-bottom: 1.5rem; border-radius: 0 6px 6px 0; }
.usc-panel-title { font-size: 1rem; color: var(--forest); margin-bottom: 0.5rem; }
.usc-text { font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; font-variant-numeric: tabular-nums; }
.redline-body { margin-top: 1.5rem; line-height: 1.7; font-size: 0.95rem; }
.redline-para { font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-bottom: 1rem; }
.export-bar { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--muted); display: flex; gap: 0.75rem; align-items: center; }
.btn-export { background: var(--forest-deep); color: var(--surface); border: none; padding: 0.5rem 1.25rem; border-radius: 6px; cursor: pointer; font-family: var(--font-sans); font-weight: 600; font-size: 0.9rem; }
.btn-export:hover { background: var(--forest); }

/* ndaa-redline-yoh.9 (P5c) — "Compare with House/Senate" link on the section
   detail page's export-bar, gated server-side (other_chamber_has_section) so
   it only ever appears when the other chamber actually has this section.
   Styled as a secondary/outline action (copper border, transparent fill) so
   it reads as a peer of Export/Print without competing with it as the
   primary action. display:inline-block + text-decoration:none because this
   is an <a>, not a <button>, unlike .btn-export. */
.btn-compare {
  display: inline-block;
  background: transparent;
  color: var(--forest-deep);
  border: 1px solid var(--copper);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.btn-compare:hover { background: rgba(182, 122, 58, 0.1); border-color: var(--copper-light); }

/* Header Search Bar */
.header-search { display: flex; gap: 0.25rem; align-items: center; }
.header-search input[type="search"] { padding: 0.35rem 0.6rem; border: 1px solid var(--muted); border-radius: 6px; font-family: var(--font-sans); font-size: 0.85rem; width: 200px; background: var(--surface); color: var(--text-body); }
.header-search input[type="search"]:focus { outline: none; box-shadow: 0 0 0 3px rgba(182, 122, 58, 0.16); border-color: var(--copper); }
.header-search button { background: var(--forest); color: var(--surface); border: none; border-radius: 6px; padding: 0.35rem 0.6rem; cursor: pointer; font-size: 1rem; }
.header-search button:hover { background: var(--copper); }

/* Admin Pages */
.admin-form { max-width: 480px; }
.admin-form label {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.3rem;
  margin-top: 0.75rem;
}
.admin-form input[type="file"] { width: 100%; padding: 0.4rem; margin-bottom: 1rem; border: 1px solid var(--muted); border-radius: 6px; }
.admin-error { color: var(--red-brand); background: #fff0f0; border: 1px solid var(--red-brand); padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.stat-card { background: var(--surface); border-left: 4px solid var(--forest); padding: 0.75rem 1rem; border-radius: 0 6px 6px 0; }
.stat-card .stat-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 2rem; font-weight: 600; color: var(--forest); }
.stat-card .stat-label { font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 0.2rem; }

/* Search Results */
.search-results { margin-top: 0.5rem; }
.search-result { padding: 1rem 0; border-bottom: 1px solid var(--muted); }
.search-result:last-child { border-bottom: none; }
.search-result-title { font-size: 1.05rem; color: var(--forest); font-weight: 700; }
.search-result-title a { color: var(--forest); text-decoration: none; }
.search-result-title a:hover { text-decoration: underline; }
.search-result-meta { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0; }
.search-result-excerpt { font-size: 0.9rem; line-height: 1.5; margin-top: 0.4rem; }
.search-result-excerpt mark { background: #fff3cd; padding: 0 2px; border-radius: 2px; }

/* Fiscal Year Selector */
.fy-selector-wrap { display: flex; align-items: center; gap: 0.5rem; }
.fy-label { color: var(--copper-light); font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.fy-selector {
  background: var(--forest);
  color: var(--surface);
  font-family: var(--font-mono);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.fy-selector:focus { outline: 2px solid var(--copper-light); outline-offset: 1px; }

/* Epic 9 — Inline Amendment Weave */
.woven-text { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap; }
.source-law-disclosure { margin-top: 1.5rem; }
.source-law-disclosure summary { cursor: pointer; color: var(--forest); font-size: 0.85rem; }

/* Epic 10 — Multi-citation panels */
.citation-panel { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--muted); }
.citation-panel:first-of-type { margin-top: 1rem; border-top: none; padding-top: 0; }
.statute-heading { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.05rem; color: var(--forest); margin-bottom: 0.75rem; }
/* Epic 11 iv5.6 — inline catchline redline in the panel heading. The del/ins
   spans reuse the shared .delete/.insert classes (already print-mirrored); these
   rules only ensure the redline inherits the heading's size/weight so struck and
   inserted catchline text sit on the same line as the unchanged catchline. */
.statute-heading .delete { color: #000; text-decoration: line-through; font-size: inherit; font-weight: inherit; }
.statute-heading .insert { color: var(--red-amendment); font-weight: inherit; font-size: inherit; }
.statute-heading a { color: inherit; text-decoration: underline; }

/* ndaa-redline-e5a.5 — Public Law panels (uncodified amendments). act_name is a
   muted sub-line under the heading; the baseline badge mirrors .cross-ref-badge's
   quiet, informational tone (not a warning) since it's provenance metadata, not
   an error state. */
.pl-act-name { font-size: 0.85rem; color: var(--muted); font-style: italic; margin: -0.4rem 0 0.6rem; }
.pl-baseline-badge {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.6rem;
}

/* Epic 10 — Amendment completeness banner. Warn/ok are functional semantic
   colors (like the reserved amendment red), not brand chrome — banner-warn
   keeps a conventional amber; banner-ok adopts the style guide's own
   "Success Sage" role, which names this exact use case. */
.amendment-banner { padding: 0.75rem 1rem; margin-bottom: 1.5rem; border-radius: 6px; border-left: 4px solid; font-size: 0.9rem; }
.banner-warn { background: #fff3cd; border-color: #ffc107; color: #664d03; }
.banner-ok { background: rgba(76, 122, 94, 0.12); border-color: var(--sage); color: var(--forest-deep); }

/* Epic 11 — Routed pure insertions + full-section rewrite */
.full-rewrite-banner { background: #fff3cd; border-left: 4px solid #ffc107; color: #664d03; padding: 0.6rem 1rem; margin-bottom: 0.75rem; border-radius: 0 6px 6px 0; font-size: 0.9rem; font-weight: bold; }
/* ndaa-redline-0y2 — statute created in full by this Act. Info (blue) tone so it
   reads as "this is new, by design", distinct from the warn/ok amendment banners. */
.new-section-banner { background: #e7f1ff; border-left: 4px solid #0d6efd; color: #084298; padding: 0.6rem 1rem; margin: 0.25rem 0 0.75rem; border-radius: 0 6px 6px 0; font-size: 0.9rem; }
/* ndaa-redline-hhu — full-section repeal: red to signal removal from law. The
   struck old text sits collapsed inside .repeal-disclosure below the banner. */
.repeal-banner { background: #f8d7da; border-left: 4px solid #dc3545; color: #842029; padding: 0.6rem 1rem; margin: 0.25rem 0 0.75rem; border-radius: 0 6px 6px 0; font-size: 0.9rem; font-weight: bold; }
.repeal-disclosure { margin-top: 0.25rem; }
.repeal-disclosure summary { cursor: pointer; color: var(--forest); font-size: 0.85rem; }
/* The new statute text is the RESULTING law, not an insertion wall — render as
   normal statute text (not red <ins>). Carries no .insert/.del spans. */
.full-rewrite-text { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-body); }
/* ndaa-redline-7ef / gze.1 — structural/organizational amendments
   (redesignating, transferred). The amber card + badge pill were retired: these
   are law-text content, so they read inline like every other amendment. The
   target citation stays a link (verification affordance, not decoration). */
.structural-target { font-size: inherit; color: inherit; }

/* Auth nav */
.header-auth { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; }
.header-auth a { color: var(--surface); text-decoration: none; }
.header-auth a:hover { color: var(--copper-light); text-decoration: underline; }
.header-auth .nav-email { color: var(--copper-light); }

/* Auth forms (login/forgot/reset/register) */
.auth-form { max-width: 380px; margin: 2rem auto; }
.auth-form label {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.3rem;
  margin-top: 0.75rem;
}
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%; padding: 0.5rem; border: 1px solid var(--muted); border-radius: 6px; font-family: var(--font-sans); font-size: 0.95rem; background: var(--surface); color: var(--text-body);
}
.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="text"]:focus {
  outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(182, 122, 58, 0.16);
}
.auth-form .btn-export { margin-top: 1.25rem; width: 100%; }
.auth-form .auth-links { margin-top: 1rem; font-size: 0.85rem; text-align: center; }
.auth-form .auth-links a { color: var(--forest); }
.auth-message { background: rgba(76, 122, 94, 0.12); border: 1px solid var(--sage); color: var(--forest-deep); padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }

/* Admin sub-nav (Users | Whitelist) */
.admin-subnav { display: flex; gap: 1.25rem; font-size: 0.85rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--muted); padding-bottom: 0.75rem; }
.admin-subnav a { color: var(--forest); text-decoration: none; }
.admin-subnav a:hover { text-decoration: underline; }
.admin-subnav a.active { font-weight: bold; color: var(--red-brand); text-decoration: none; }

/* Admin tables */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--muted); }
.admin-table th { color: var(--muted); font-family: var(--font-sans); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; }
.admin-table .badge-locked { color: var(--red-brand); font-weight: bold; }
.admin-table .badge-admin { color: var(--forest); font-weight: bold; font-size: 0.75rem; }
.btn-delete { background: none; border: 1px solid var(--red-brand); color: var(--red-brand); border-radius: 6px; padding: 0.25rem 0.6rem; font-size: 0.8rem; cursor: pointer; }
.btn-delete:hover { background: var(--red-brand); color: var(--surface); }
.structural-target a { color: var(--forest); font-weight: bold; text-decoration: underline; }
.structural-target a::after { content: " \2197"; font-weight: normal; }
/* Prose of a structural amendment — normal reading text, not a mono redline,
   so it is un-boxed here rather than inheriting the .redline-para monospace. */
.structural-prose { font-family: var(--font-sans); color: var(--text-body); font-size: 0.9rem; line-height: 1.6; }

/* Epic 11 / gze.1 — anchored amendments whose anchor text was not found. The
   amber "verify manually" card was retired; the caption and its verification
   link now ride the shared .amendment-loc inline marker. The link keeps its
   forest/bold/↗ treatment — losing that affordance would be a correctness
   regression, not a style change. */
.unplaced-link { color: var(--forest); font-weight: bold; text-decoration: underline; }
.unplaced-link:hover { color: var(--copper); }
.unplaced-link::after { content: " \2197"; font-weight: normal; }
.unplaced-target { font-weight: bold; }

/* Print / PDF Export */
@media print {
  header, .sidebar, nav.breadcrumb, .export-bar, footer { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  body { font-size: 11pt; }
  .insert { color: #b91c1c !important; font-weight: normal; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .delete { color: #000 !important; text-decoration: line-through; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Epic 11 iv5.6 — mirror the heading catchline-redline (print parity). */
  .statute-heading .insert { color: #b91c1c !important; font-weight: inherit; font-size: inherit; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .statute-heading .delete { color: #000 !important; text-decoration: line-through; font-weight: inherit; font-size: inherit; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* ndaa-redline-gze.1 — the inline location markers replaced block headers that
     printed in full contrast. --muted is too light on paper, so darken them and
     keep un-anchorable amendments from splitting across a page break. */
  .amendment-loc { color: #444 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .woven-amendment { break-inside: avoid; page-break-inside: avoid; }
}

/* ===================================================================== */
/* Home / Landing Page (impl-2 — ndaa-redline-e8j / qsb)                 */
/* ===================================================================== */
.home {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
  text-align: center;
}

/* Hero */
.home-hero { margin-bottom: 2.5rem; }
.home-hero-line1 {
  font-size: 1.5rem;
  color: var(--text-body);
  margin-bottom: 0.25rem;
}
.home-hero-line2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 3rem; /* Display / Caslon — 48px */
  line-height: 1.1;
}
.home-hero-ndaa {
  font-weight: 400;
  color: var(--forest);
}
.home-hero-redline {
  color: var(--red-brand);
  font-style: italic;
  font-weight: bold;
}

/* Markup selector cards — styled as the style guide's "Primary action":
   Forest Deep fill, lighter Forest on hover. */
.markup-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.markup-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 260px;
  padding: 1.5rem 1.75rem;
  background: var(--forest-deep);
  color: var(--surface);
  text-decoration: none;
  border: 1px solid var(--forest);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.markup-card:hover {
  background: var(--forest);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.markup-card-label {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
}
.markup-card-subtitle {
  font-size: 0.9rem;
  opacity: 0.8;
}
.markup-card--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.markup-card--disabled:hover {
  background: var(--forest-deep);
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Stats bar */
.home-stats {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--text-body);
  opacity: 0.6;
  margin-bottom: 2rem;
}

/* Tool description */
.home-description {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
}

/* Empty state note */
.home-empty {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-body);
  opacity: 0.6;
}

/* ndaa-redline-9sa — cross-reference-only panels: cited but not amended */
.cross-ref-panel { margin-top: 0.25rem; }
.cross-ref-badge {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.35rem;
}
.cross-ref-panel details > summary {
  cursor: pointer;
  color: var(--forest);
  font-size: 0.85rem;
  margin-top: 0.1rem;
}
.cross-ref-panel details .woven-text {
  margin-top: 0.6rem;
}

/* impl-1 (ws1-weave-rewrite) — subtle inline marker flagging a subsection-boundary
   injection (an amendment whose exact anchor text was not found verbatim in the
   current code, woven in at its subsection marker instead). Small, gray,
   non-intrusive so it does not disrupt the reading flow of the statute. */
.inline-amendment-anchor {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: normal;
  vertical-align: 0.15em;
  letter-spacing: 0.02em;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ndaa-redline-gze.1 — amendment content that could not be anchored positionally
   in the statute body. Previously quarantined in bordered/tinted callout boxes
   below a dashed rule; now rendered as continuous document flow so the page
   reads as one traditional redline. Deliberately NO border, background, padding
   or border-radius — the only visual signal is the quiet inline location marker.
   Declared AFTER .redline-para so the margin override wins on equal specificity
   while the monospace/tabular-nums redline treatment is inherited. */
.woven-amendment {
  margin: 0.9rem 0 1rem;
}
/* Extends .inline-amendment-anchor (the in-body "[amend]" marker) for labels
   that are a full phrase rather than a two-word token: slightly larger and
   baseline-aligned so a sentence-length caption stays legible, still muted and
   italic so it never competes with the statutory text it introduces. */
.amendment-loc {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-style: italic;
  vertical-align: baseline;
}
.amendment-loc a { font-style: normal; }

/* ndaa-redline-yoh.5 — Legislative hierarchy hanging indents.
   app/services/statute_format.py wraps each line of woven/statute HTML in
   <div class="stx-line stx-d{0-5}">, one depth per U.S. Code nesting level:
   (a) -> (1) -> (A) -> (i) -> (I). Each depth level adds one more
   --stx-indent of hanging indent so multi-line clauses wrap back to the
   marker's column, not the page margin. Purely additive: does not modify
   .woven-text / .usc-text / any pre-existing rule, so those stay in force
   for the surrounding container (font, size, pre-wrap, etc.) exactly as
   before — these rules only govern the new per-line wrapper divs. */
:root {
  --stx-indent: 1.4em;
}
.stx-block {
  display: block;
}
.stx-line {
  display: block;
  /* Hanging indent: the block itself sits one level deeper than the marker
     (depth + 1), and text-indent pulls just the FIRST line (where the
     marker lives) back by one indent step, so wrapped continuation lines
     land flush under the marker's text, not under the marker itself. */
  padding-left: calc(var(--stx-indent) * (var(--stx-depth, 0) + 1));
  text-indent: calc(var(--stx-indent) * -1);
}
.stx-d0 { --stx-depth: 0; }
.stx-d1 { --stx-depth: 1; }
.stx-d2 { --stx-depth: 2; }
.stx-d3 { --stx-depth: 3; }
.stx-d4 { --stx-depth: 4; }
.stx-d5 { --stx-depth: 5; }

/* =====================================================================
   ndaa-redline-yoh.6 — Tablet / phone responsiveness.
   Primary use case: Hill staffer reading redlines on a tablet on a train.
   768-1024px (both orientations) is the polished target; phone (down to
   ~390px) just needs to be usable. Purely additive — no existing rule
   above this block is modified. Three breakpoints, mobile-first cascade
   (each narrower query layers on top of the wider ones before it).
   ===================================================================== */

/* Horizontal-scroll escape hatch for wide admin tables on narrow viewports. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hamburger button — only relevant at <=900px where the sidebar becomes an
   off-canvas drawer; hidden above that so desktop/large-tablet-landscape
   layouts are untouched. */
.drawer-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(252, 250, 243, 0.4);
  color: var(--surface);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.drawer-toggle:hover { border-color: var(--copper-light); color: var(--copper-light); }

/* Backdrop behind the off-canvas drawer. Only ever shown (opacity/visibility
   toggled via .drawer-backdrop--visible) at <=900px; JS adds/removes the
   modifier class, this block just defines its resting (hidden) state so it
   never paints or intercepts clicks above the drawer breakpoint or before
   JS toggles it. */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
}

/* ndaa-redline-yoh.9 (P5c) — finalized compare-view CSS. Replaces P5b's
   minimal verification scaffolding (grid + sticky heading proved correct,
   kept as-is) with the column divider and z-index polish it was
   intentionally left without. Two-column grid on desktop/tablet-landscape;
   the pre-existing Tier 2 (<=900px) !important override below still forces
   a single-column stack and is untouched by this phase. */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
/* Vertical divider between the House and Senate columns — a grid gap alone
   reads as ambiguous whitespace at this width; a hairline rule makes the
   two-column comparison intentional rather than looking like an accidental
   layout wrap. Only the second (Senate) column gets the border so a single
   divider sits in the gap, not two redundant lines. */
.compare-column:nth-child(2) {
  border-left: 1px solid var(--muted);
  padding-left: 1.5rem;
}
.compare-column-heading {
  position: sticky;
  top: 0;
  background: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--forest);
  padding: 0.4rem 0;
  margin: 0 0 0.5rem;
  border-bottom: 2px solid var(--copper-light);
  /* Below the off-canvas drawer (z-index 50) and its backdrop (z-index 40)
     so the sticky column heading can never paint over the drawer when it's
     open on a narrower viewport that hasn't yet hit the Tier 2 stack
     breakpoint's own layout changes; still above ordinary in-flow content
     (default stacking context) so it reliably occludes scrolled-past panel
     content beneath it. */
  z-index: 5;
}

/* ---------------------------------------------------------------------
   Tier 1 — <=1024px: tighten paddings, shrink sidebar + search input.
   Tablet landscape (1024x768) lands right at this boundary and should
   still show sidebar + content side by side, just snugger.
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {
  header { padding: 0.6rem 1rem; }
  .content { padding: 1.25rem 1.5rem; }
  .sidebar { width: 220px; min-width: 200px; }
  .header-search input[type="search"] { width: 160px; }
  .stat-grid { gap: 0.75rem; }
}

/* ---------------------------------------------------------------------
   Tier 2 — <=900px: tablet portrait, the important breakpoint. Sidebar
   becomes an off-canvas drawer (fixed, translated off-screen until
   opened); header wraps to two rows so the FY selector / search / auth
   nav don't get crushed into one unreadable line.
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  header {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  .header-center { order: 3; width: 100%; }
  .drawer-toggle { display: inline-block; order: 0; }

  .layout { position: relative; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 82vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
  }
  .sidebar--open {
    transform: translateX(0);
  }

  .drawer-backdrop {
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
  }
  .drawer-backdrop--visible {
    opacity: 1;
    visibility: visible;
  }

  .content { padding: 1rem; }

  /* Pre-added for P5 (gated, unbuilt): stack the compare view to a single
     column at tablet-portrait width and below. No .compare-grid element
     exists yet, so this is a harmless no-op today — it lets P5 ship
     without needing to touch this breakpoint again. */
  .compare-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---------------------------------------------------------------------
   Tier 3 — <=600px: phone-usable (not polished). Full single-column
   stack, smaller monospace text so statute lines wrap reasonably, and a
   tighter --stx-indent so hanging indents (P3b) don't eat the whole
   screen width on deeply nested clauses.
   --------------------------------------------------------------------- */
@media (max-width: 600px) {
  :root {
    --stx-indent: 1em;
  }
  .content { padding: 0.75rem; }
  .header-search input[type="search"] { width: 110px; }
  .fy-label { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .markup-card { width: 100%; }
  .usc-text,
  .woven-text,
  .redline-para,
  .full-rewrite-text {
    font-size: 0.85rem;
  }
}
