/* styles-bills.css — slice 1034–3622 of the former styles.css (split 2026-07-06).
   Contents: bill card internals, quotes, carousel, patch spine, favorites, tablet+phone responsive.
   LOAD ORDER MATTERS: every page loads shared → bills → pages, preserving the
   original cascade exactly. Do not reorder or per-page prune without testing. */
/* Card header row — 3-column grid */
.bill-header {
  display: grid;
  grid-template-columns: 48px 1fr 40px;
  gap: 14px;
  align-items: stretch;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
}
.bill-header { transition: background 0.12s; }
.likelihood-footer { transition: background 0.12s; }

/* Left columns */
.bill-left { display: contents; }
.bill-rank-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.bill-portrait-wrap {
  margin: auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Sponsor portrait in header */
.sponsor-portrait {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: var(--border);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* Stage badge — now shown inline in meta row */
.stage-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-3);
  white-space: nowrap;
}
.badge-senate     { background: var(--blue-bg);  color: var(--blue-text); }
.badge-house      { background: var(--green-bg); color: var(--green-text); }
.badge-signed     { background: var(--teal-bg);  color: var(--teal-text); }
.badge-committee  { background: var(--amber-bg); color: var(--amber-text); }
.badge-introduced { background: var(--surface-2); color: var(--text-3); }
.badge-conference { background: #EEF0FB; color: #3A4DB7; }
.badge-default    { background: var(--surface-2); color: var(--text-3); }

/* Legacy mini-pipeline markup still emitted by renderBill — permanently hidden */
.mini-pipe { display: none; }

/* Footer pipeline dots — CSS-class driven so dark mode works */
.fp-dot { border-radius: 50%; flex-shrink: 0; transition: all 0.2s; }
.fp-dot-done    { background: var(--text); }
.fp-dot-active  { background: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
.fp-dot-pending { background: var(--border); }
.fp-line { height: 1.5px; width: 14px; flex-shrink: 0; }
.fp-line-done    { background: var(--text); }
.fp-line-pending { background: var(--border); }

/* Title block (center column) */
.bill-right { display: contents; }
.bill-title-block { min-width: 0; }
/* Bill title block */
.bill-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.bill-version-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--text-3);
}
.bill-updated {
  font-size: var(--fs-2xs);
  color: var(--text-3);
}
.bill-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 5px;
}
.bill-summary {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 5px;
}
.bill-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Likelihood column (4th grid item) */
.bill-likelihood-col {
  text-align: right;
  min-width: 88px;
}
.likelihood-pct {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
  line-height: 1;
}
.likelihood-lbl {
  font-size: var(--fs-2xs);
  color: var(--text-3);
  margin-top: 4px;
}
.likelihood-bar-sm {
  width: 80px;
  height: 4px;
  background: #c8c7c3;
  border-radius: 2px;
  margin-top: 6px;
  margin-left: auto;
  overflow: hidden;
}
.likelihood-bar-fill { height: 100%; border-radius: 2px; }

/* Star and chevron share identical 40px containers */
.bill-actions-col,
.footer-chevron-col {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Actions col mirrors the rank col: status badge (ENACTED) on top, star centered below */
.bill-actions-col {
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
}
.bill-actions-col .star-btn { margin: auto 0; }

/* Chevron — CSS-drawn in footer row, controllable stroke */
.chevron {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-right: 2.5px solid #0c0c0d;
  border-bottom: 2.5px solid #0c0c0d;
  opacity: 0.28;
  transform: rotate(45deg);
  transition: transform 0.22s ease, opacity 0.15s;
  flex-shrink: 0;
  margin: 1px;
}
.chevron.open {
  transform: rotate(225deg);
  margin-bottom: -3px;
}

/* ---- DEMO BADGE ---- */
.status-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  display: inline-block;
}
.status-demo {
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.status-enacted {
  background: var(--green);
  color: #fff;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}
.status-omnibus {
  background: var(--amber);
  color: #ffffff;
  font-size: var(--fs-2xs);
  letter-spacing: 0.04em;
}
/* Neutral structural classification (legislative form). Deliberately muted —
   it describes what kind of bill this is, not how important it is.
   Constrained to the 48px rank column with wrapping so long labels never spill. */
.status-type {
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  font-size: 0.5rem;
  letter-spacing: 0.02em;
  font-weight: 700;
  padding: 2px 5px;
  white-space: nowrap;
}
.bill-card--omnibus {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--amber) 35%, transparent), var(--shadow);
}
.bill-card--enacted {
  border-color: var(--green);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 35%, transparent), var(--shadow);
}
/* Hoverable tags (type chips, OMNIBUS, ENACTED) carry a plain-English data-tip */
.status-badge[data-tip] { cursor: help; }
/* Type chip: rank column on desktop; moves inline into the meta row on mobile */
.bill-meta-row .status-type { display: none; }
@media (max-width: 640px) {
  .bill-rank-col .status-type { display: none; }
  .bill-meta-row .status-type { display: inline-block; }
  /* Free the meta line for the type chip: drop the stage words (shown by the
     ENACTED badge + footer dots anyway) so the chip fits on the same line. */
  .meta-stage { display: none; }
}

/* ---- STAR BUTTON — SVG star, crisp at any size ---- */
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #0c0c0d;
  opacity: 0.28;
  transition: color 0.15s, opacity 0.15s;
  padding: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.star-btn svg { display: block; }
.star-btn:hover    { opacity: 0.65; color: var(--star); }
.star-btn.watching { opacity: 1;    color: var(--star); }

/* ---- COMPACT META BADGE ---- */
.bill-meta-compact {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-3);
  letter-spacing: 0.01em;
}

/* Likelihood footer */
.likelihood-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.footer-stage-dots {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.footer-likelihood-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.likelihood-label {
  font-size: var(--fs-2xs);
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.likelihood-track {
  flex: 1;
  min-width: 0;
  height: 4px;
  border-radius: 2px;
  background: #c8c7c3;
  overflow: hidden;
}
.likelihood-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.likelihood-value {
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 110px;
  text-align: right;
  font-family: var(--font-mono);
}

/* ---- EXPANDED BODY ---- */
.bill-body { display: none; border-top: 1px solid var(--border); }
.bill-body.open { display: block; }

/* ---- MINOR EXPAND (first click) ---- */
.bill-body-minor {
  display: none;
  border-top: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.bill-body-minor.open { display: block; }

/* Underreported teaser in minor expand */
.underreported-teaser {
  margin: 0.85rem 1.1rem 0;
  background: var(--amber-bg);
  border: 1px solid rgba(176,106,0,0.2);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}
.underreported-badge {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--amber);
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.underreported-headline {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--amber-text);
  margin: 0.2rem 0 0.25rem;
}
.underreported-preview {
  font-size: var(--fs-sm);
  color: var(--amber-text);
  opacity: 0.85;
  line-height: 1.45;
}

/* Quote cards row — 2-column grid inside expanded bill cards */
.quote-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.75rem 1.1rem 0;
}
.quote-card {
  border-radius: var(--radius-md);
  padding: 0.85rem;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.quote-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.quote-card-rep {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.quote-portrait {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
  background: var(--portrait-bg);
}
.quote-card-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.quote-card-name > span:first-child {
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quote-stance {
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}
.quote-stance.stance-support {
  background: var(--green-bg);
  color: var(--green-text);
  border: 1px solid rgba(45,122,58,0.2);
}
.quote-stance.stance-oppose {
  background: var(--surface-2);
  color: #4a4a52;
  border: 1px solid var(--border);
}
.quote-text {
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
  font-style: italic;
}

/* Quote carousel — bill full page */
.quote-carousel {
  margin: 0.75rem 1.1rem 0.75rem;
}
.quote-carousel .quote-card:only-child {
  flex: 0 0 100%;
}
.quote-carousel-viewport {
  overflow: hidden;
}
.quote-carousel-track {
  display: flex;
  gap: 0.65rem;
  transition: transform 0.28s ease;
}
.quote-carousel .quote-card {
  flex: 0 0 calc(50% - 0.325rem);
  min-width: 0;
  box-sizing: border-box;
}
.quote-carousel .quote-text {
  -webkit-line-clamp: unset;
  max-height: none;
  overflow: visible;
}
@media (max-width: 639px) {
  .quote-carousel .quote-card {
    flex: 0 0 100%;
  }
}
.quote-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.qc-arrow {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.qc-arrow:hover {
  background: var(--surface-2);
  color: var(--text);
}
.qc-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.qc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s, transform 0.18s;
}
.qc-dot.qc-dot-active {
  background: var(--purple);
  transform: scale(1.35);
}

/* Expand-to-full button */
.expand-full-btn {
  display: block;
  width: calc(100% - 2.2rem);
  margin: 0.85rem 1.1rem 1rem;
  padding: 0.5rem;
  background: var(--purple);
  border: 1px solid var(--purple);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.expand-full-btn:hover {
  background: var(--purple-text);
  border-color: var(--purple-text);
  color: #fff;
}

/* ---- SHOCK QUOTES SECTION ---- */
.shock-quotes-section {
  max-width: 960px;
  margin: 0 auto 1.25rem;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.shock-quotes-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.shock-quotes-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-3);
  font-family: var(--font-body);
}
.shock-quotes-see-all {
  font-size: var(--fs-xs);
  color: var(--purple);
  text-decoration: none;
}
.shock-quotes-grid {
  overflow-x: clip;
  overflow-y: visible;
  cursor: grab;
  padding: 4px 2px;
  position: relative;
}
.shock-quotes-grid::before,
.shock-quotes-grid::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10%;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.2s ease;
}
.shock-quotes-grid::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}
.shock-quotes-grid::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}
@media (hover: hover) and (pointer: fine) {
  .shock-quotes-grid.sq-expanding::before,
  .shock-quotes-grid.sq-expanding::after { opacity: 0; }
}
.shock-quotes-track {
  display: flex;
  flex-direction: row;
  gap: 0.65rem;
}
.shock-quotes-grid.dragging { cursor: grabbing; user-select: none; }
.shock-quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: grab;
  width: 248px;
  flex-shrink: 0;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}
/* Hover bridges across the inter-card gap (track gap is 0.65rem). Two thin
   strips that live ONLY in the gap — never over card content — so moving the
   mouse card→card never drops :has(:hover) (which would collapse the row and
   re-trigger the 500ms expand delay = the stutter). Each strip is 0.45rem so a
   pair overlaps (0.9rem > 0.65rem gap) with no dead pixel, yet stays clear of
   the neighbouring card's body, keeping links + acronym tooltips clickable.
   Interactive on desktop hover only. */
.shock-quote-card::before,
.shock-quote-card::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0.45rem;
  pointer-events: none;
}
.shock-quote-card::before { left: -0.45rem; }
.shock-quote-card::after  { right: -0.45rem; }
@media (hover: hover) and (pointer: fine) {
  .shock-quote-card::before,
  .shock-quote-card::after { pointer-events: auto; }
}
.shock-quotes-grid.dragging .shock-quote-card { cursor: grabbing; }
.shock-quote-card.is-tracked {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.shock-quote-card.is-featured {
  border-color: var(--amber);
}
[data-theme="dark"] .shock-quote-card.is-featured {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px #fbbf2440;
}
.shock-quote-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.shock-quote-rep-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}
.shock-quote-rep-text { min-width: 0; }
.shock-quote-card > .shock-quote-text {
  /* Sizes to its own content (NOT flex:1) so the empty space on a short card
     falls between the quote and the footer — the footer is pinned to the bottom
     by `.shock-quote-foot { margin-top:auto }`. Do NOT set display:flex here —
     that would override the base display:-webkit-box, breaking line-clamp and
     laying out injected acronym <span>s as horizontal flex items (the "2
     columns" / gap bug on quotes containing acronyms like FISA/CRA/TPS). */
  min-height: 5.5rem;
}
/* Footer row: bill title (truncates) on the left, date pinned right.
   Floor-page carousel uses date only (no bill) — it still sits right. */
.shock-quote-foot {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: auto; /* pin to the card bottom; empty space lands above it (between quote and footer) */
}
.shock-quote-foot .shock-quote-bill { flex: 1; min-width: 0; }
.shock-quote-foot-date {
  flex-shrink: 0;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-3);
  white-space: nowrap;
}
.shock-quote-bill {
  font-size: var(--fs-2xs);
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shock-quote-card:hover .shock-quote-bill { color: var(--purple); }
.shock-quote-bill--link {
  text-decoration: none;
  cursor: pointer;
}
.shock-quote-bill--link:hover { text-decoration: underline; }
@media (hover: hover) and (pointer: fine) {
  /* On expand (after the 0.5s dwell) stack the footer into a column: the bill
     name gets the full container width and wraps to the full title; the date
     drops to its own row, bottom-left. Delays match the text/bill-unwrap 0.5s
     so the whole card reflows together. (flex-direction isn't transitionable,
     so the change is applied via a 0.001s/0.5s-delay animation like the unwrap.) */
  .shock-quotes-track:has(.shock-quote-card:hover) .shock-quote-foot {
    animation: sq-foot-stack 0.001s 0.5s forwards;
  }
  .shock-quotes-track:has(.shock-quote-card:hover) .shock-quote-bill {
    animation: sq-bill-unwrap 0.001s 0.5s forwards;
  }
  .shock-quotes-track:has(.shock-quote-card:hover) .shock-quote-foot-date {
    animation: sq-date-stack 0.001s 0.5s forwards;
  }
}
@keyframes sq-bill-unwrap {
  to { white-space: normal; overflow: visible; text-overflow: unset; flex: none; width: 100%; }
}
@keyframes sq-foot-stack {
  to { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}
@keyframes sq-date-stack {
  to { margin-left: 0; }
}
.shock-quote-portrait {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: var(--portrait-bg);
  flex-shrink: 0;
}
.shock-quote-name {
  font-size: var(--fs-2xs);
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: 1.25;
  word-break: break-word;
}
.shock-quote-source {
  font-size: var(--fs-2xs);
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-top: 4px;
}
.shock-quote-text {
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-2);
  font-style: italic;
  overflow-wrap: break-word;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  max-height: 5.8rem;
  transition: max-height 0.25s ease-out 0.08s;
}
@media (hover: hover) and (pointer: fine) {
  .shock-quotes-track:has(.shock-quote-card:hover) .shock-quote-text {
    -webkit-line-clamp: 100;
    max-height: 20rem;
    transition: max-height 0.25s ease-out 0.5s;
  }
  .shock-quotes-track:has(.shock-quote-card:hover) .shock-quote-card {
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    transition: box-shadow 0.2s ease 0.5s;
  }
}

/* Close-X button (formerly the progress ring) — X lines defined below.
   Stays hidden until a card is expanded; the dwell indicator is now the
   corner brackets. The .sq-ring element + click target are unchanged so the
   expand/close mechanics keep working. */
.sq-ring {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

/* Hover-intent dwell indicator — four corner brackets draw inward to frame
   the card. Same triggers/timing as the old fill ring (0.5s hover, 1s touch). */
.sq-corner {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  border-color: var(--orange);
  border-style: solid;
  border-width: 0;
}
.sq-corner-tl { top: 7px;    left: 7px;  border-top-width: 2px;    border-left-width: 2px;  border-top-left-radius: 3px; }
.sq-corner-tr { top: 7px;    right: 7px; border-top-width: 2px;    border-right-width: 2px; border-top-right-radius: 3px; }
.sq-corner-bl { bottom: 7px; left: 7px;  border-bottom-width: 2px; border-left-width: 2px;  border-bottom-left-radius: 3px; }
.sq-corner-br { bottom: 7px; right: 7px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 3px; }
@media (hover: hover) and (pointer: fine) {
  .shock-quote-card:hover .sq-corner {
    opacity: 1;
    animation: sq-corner-draw 0.5s ease forwards;
  }
}
@keyframes sq-corner-draw {
  from { width: 0;    height: 0; }
  to   { width: 16px; height: 16px; }
}
/* Once any card is expanded the dwell brackets are no longer relevant */
.shock-quotes-track:has(.shock-quote-card.sq-expanded) .sq-corner {
  opacity: 0;
  animation: none;
  width: 0;
  height: 0;
}

/* X lines inside ring SVG — hidden by default, shown on mobile when expanded */
.sq-x-line {
  fill: none;
  stroke: var(--text-2);
  stroke-width: 2;
  stroke-linecap: round;
  display: none;
}

/* ── Mobile / touch expansion ─────────────────────────────────────────────── */
@keyframes sq-x-draw {
  to { stroke-dashoffset: 0; }
}

@media (pointer: coarse) {
  /* Bill link disabled until card is expanded — tap goes to gauge, not the link */
  .shock-quote-card:not(.sq-expanded) .shock-quote-bill--link {
    pointer-events: none;
  }

  /* Corner brackets draw in while touching (sq-filling) */
  .shock-quote-card.sq-filling .sq-corner {
    opacity: 1;
    animation: sq-corner-draw 1s ease forwards;
  }

  /* All cards expand text when any is expanded — matches desktop :has() pattern */
  .shock-quotes-track:has(.shock-quote-card.sq-expanded) .shock-quote-text {
    -webkit-line-clamp: 100;
    max-height: 20rem;
    transition: max-height 0.35s ease;
  }
  .shock-quotes-track:has(.shock-quote-card.sq-expanded) .shock-quote-bill {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  /* Expanded footer stacks: full-width wrapping bill name, date on its own row */
  .shock-quotes-track:has(.shock-quote-card.sq-expanded) .shock-quote-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  .shock-quotes-track:has(.shock-quote-card.sq-expanded) .shock-quote-foot .shock-quote-bill {
    flex: none;
    width: 100%;
  }
  .shock-quotes-track:has(.shock-quote-card.sq-expanded) .shock-quote-foot-date {
    margin-left: 0;
  }

  /* All cards show X ring while any card is expanded */
  .shock-quotes-track:has(.shock-quote-card.sq-expanded) .sq-ring {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
  }

  /* Non-expanded siblings: X appears immediately */
  .shock-quotes-track:has(.shock-quote-card.sq-expanded) .shock-quote-card:not(.sq-expanded) .sq-x-line {
    display: block;
  }

  /* Expanded card: X draws in */
  .shock-quote-card.sq-expanded .sq-x-line {
    display: block;
    stroke-dasharray: 14;
    stroke-dashoffset: 14;
    animation: sq-x-draw 0.2s ease 0.05s forwards;
  }
}

/* ---- WHAT CHANGED patch blocks ---- */
.what-changed-section {
  padding: 0 18px 16px;
}
.what-changed-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 8px;
  margin-top: 16px;
}
.what-changed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.patch-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
}
.patch-block-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.patch-block-symbol {
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1;
}
.patch-block-items { display: flex; flex-direction: column; gap: 5px; }
.patch-block-item {
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: var(--text-2);
  position: relative;
  padding-left: 13px;
}
.patch-block-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.patch-block-item--none { font-style: italic; color: var(--text-3); padding-left: 0; }
.patch-block-item--none::before { display: none; }
/* Quiet cards: color lives only in the label + per-item dot (no saturated fill) */
.patch-block--added    .patch-block-label { color: var(--green); }
.patch-block--added    .patch-block-item::before { background: var(--green); }
.patch-block--modified .patch-block-label { color: var(--amber); }
.patch-block--modified .patch-block-item::before { background: var(--amber); }
.patch-block--removed  .patch-block-label { color: var(--red); }
.patch-block--removed  .patch-block-item::before { background: var(--red); }

/* ---- VERSION TIMELINE (bill page) ---- */
.version-timeline-section {
  margin: 0 1.1rem 0.85rem;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.vt-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 11px;
}
.vt-summary {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.5;
}
.vt-track {
  position: relative;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--border-inner);
}
.vt-node {
  position: relative;
  padding-left: 18px;
  padding-bottom: 13px;
}
.vt-node:last-child { padding-bottom: 0; }
/* connecting line between dots */
.vt-node::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 7px;
  bottom: -6px;
  width: 1px;
  background: var(--border);
}
.vt-node:last-child::before { display: none; }
.vt-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--purple);
}
.vt-node--last .vt-dot { background: var(--purple); }
.vt-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); line-height: 1.3; }
.vt-label a { color: inherit; text-decoration: none; }
.vt-label a:hover { text-decoration: underline; text-decoration-color: var(--purple); text-underline-offset: 2px; }
.vt-date { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); margin-top: 1px; }

/* ---- STAGE STRIP ---- */
.stage-strip {
  display: flex;
  align-items: center;
  padding: 12px 18px 4px;
}
.stage-strip-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
}
.stage-strip-dot {
  border-radius: 50%;
  transition: all 0.2s;
}
.stage-strip-dot.done { background: var(--accent); }
.stage-strip-dot.active { background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--accent); }
.stage-strip-dot.pending { background: var(--border); }
.stage-strip-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stage-strip-connector {
  height: 2px;
  flex: 1;
  margin-top: -22px;
}
.stage-strip-connector-done    { background: var(--accent); }
.stage-strip-connector-pending { background: var(--border); }
.stage-strip-label-on { color: var(--text) !important; font-weight: 600; }

.full-pipeline {
  padding: 0.7rem 1.1rem;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  overflow-x: auto;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.pipe-pill {
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.pipe-done    { background: #C6E6C8; color: var(--green-text); }
.pipe-active  { background: var(--blue); color: #fff; }
.pipe-pending { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
.pipe-arrow   { font-size: var(--fs-xs); color: var(--text-3); padding: 0 5px; }

/* Analysis tag — marks interpretive fields (underreported, gaps, likelihood) */
.analysis-tag {
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-style: italic;
  color: var(--text-3);
  font-family: var(--font-mono);
  opacity: 0.7;
  margin-left: 0.4em;
  vertical-align: middle;
}

/* Bill reference links — inline cross-bill links in prose fields */
.bill-ref-link {
  color: var(--purple);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  font-weight: 500;
  cursor: pointer;
}
.bill-ref-link:hover { text-decoration-style: solid; }
.bill-self-ref {
  font-style: italic;
  color: var(--text-2);
}
@keyframes bill-flash {
  0%   { background: transparent; }
  20%  { background: rgba(95, 82, 221, 0.10); }
  100% { background: transparent; }
}
.bill-ref-flash { animation: bill-flash 1.2s ease; }
@keyframes bt-section-flash {
  0%   { background: transparent; }
  15%  { background: rgba(95, 82, 221, 0.25); }
  100% { background: transparent; }
}
.bt-section-flash { animation: bt-section-flash 1.5s ease; }

/* Top lines — H1-equivalent bill overview */
.top-lines {
  margin: 0.65rem 18px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.top-lines-brief {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.45;
  padding: 10px 14px 9px;
  border-bottom: 1px solid var(--border-inner);
  font-style: italic;
}
.top-line-item {
  padding: 11px 16px;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.top-line-item:last-child { border-bottom: none; }
/* Dash bullet removed — the bold headline + hairline now carries the section */
.top-line-bullet {
  display: none;
  color: var(--purple);
  flex-shrink: 0;
  font-size: var(--fs-base);
  line-height: 1.35;
  font-weight: 400;
  margin-top: 1px;
}
.top-line-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.top-line-headline {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border-inner);
}
.top-line-headline-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.top-line-headline-link::after {
  content: ' ↓';
  font-size: 0.7em;
  font-weight: 400;
  opacity: 0.3;
  transition: opacity 0.15s;
}
.top-line-headline-link:hover { text-decoration: underline; text-decoration-color: var(--purple); text-underline-offset: 3px; }
.top-line-headline-link:hover::after { opacity: 0.65; }
.top-line-sub {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.45;
  position: relative;
  padding-left: 15px;
}
.top-line-sub::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 0.62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--purple);
}
/* Figures (%, $amounts, day/year counts) bolded so the substance of a bill pops */
.fig { color: var(--text); font-weight: 700; }

/* Likelihood detail */
.likelihood-detail {
  margin: 0.85rem 1.1rem 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--purple-bg);
  border: 1px solid var(--purple-border);
  border-left: 3px solid var(--purple);
}
.likelihood-detail-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--purple);
}
.likelihood-detail-text {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--purple-text);
  line-height: 1.5;
}

/* Likelihood readout (V2) — a mono "spec-sheet" verdict line instead of a tinted
   pill box. The card already meters likelihood up top; this states the verdict.
   margin is set inline per call site. */
.likelihood-readout {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}
.lr-row {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.4;
}
.lr-key   { color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.lr-arrow { color: var(--text-3); opacity: 0.55; }
.lr-val   { font-weight: 700; font-size: var(--fs-sm); }
.lr-lab   { font-weight: 600; }
.lr-note  { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); margin-top: 5px; }

/* Patch notes */
.patch-notes {
  margin: 1rem 1.1rem 0.85rem;
  padding: 10px 14px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.patch-notes-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}
/* Flash when a top-line headline scrolls to its spine section */
.patch-section.spine-flash { animation: spine-flash 1.4s ease; border-radius: 6px; }
@keyframes spine-flash {
  0%, 15% { background: var(--purple-bg); }
  100% { background: transparent; }
}
/* Bill-page shortcut under "Further Analysis" — mobile only */
.view-bill-link-mobile { display: none; }
.patch-section { margin-bottom: 1rem; }
.patch-section-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 7px;
}
.patch-section-title-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.patch-section-title-link::after {
  content: ' ↓';
  opacity: 0.4;
  transition: opacity 0.15s;
}
.patch-section-title-link:hover { text-decoration: underline; text-decoration-color: var(--purple); text-underline-offset: 3px; }
.patch-section-title-link:hover::after { opacity: 0.75; }
.patch-item {
  margin-bottom: 8px;
  position: relative;
  padding-left: 15px;
}
.patch-item::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 0.7em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--purple);
}
.patch-item-main {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
}
.patch-amount { font-weight: 500; color: var(--blue); }
.comment-chips { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: var(--fs-2xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: default;
}
.chip-d { background: var(--blue-bg); color: var(--blue-text); border-color: rgba(26,86,160,0.2); }
.chip-r { background: var(--red-bg);  color: var(--red-text);  border-color: rgba(192,57,43,0.2); }
.chip-i { background: var(--green-bg); color: var(--green-text); border-color: rgba(58,122,79,0.2); }
.chip-n { background: var(--surface-2); color: var(--text-2); }

.more-btn {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  display: block;
  margin-top: 3px;
}
.more-btn:hover { color: var(--text-2); }

.item-detail {
  display: none;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.55;
}
.item-detail.open { display: block; }
.item-detail-comment {
  margin-top: 5px;
  padding: 4px 8px;
  border-left: 2px solid var(--border-strong);
  font-size: var(--fs-xs);
  color: var(--text-2);
}

/* Sections breakdown — numbered spine + folded admin (2026-06-30 rework) */
.patch-spine { margin-top: 2px; }
.patch-spine .ps-row,
.patch-spine .ps-admin-strip { position: relative; padding-left: 46px; padding-bottom: 16px; }
.ps-rail { position: absolute; left: 16px; top: 24px; bottom: -2px; width: 2px; background: var(--border); }
.patch-spine .ps-last .ps-rail { display: none; }
.ps-num {
  position: absolute; left: 0; top: 0; min-width: 32px; height: 21px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 700; color: var(--purple);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; box-sizing: border-box;
}
.ps-num.admin { color: var(--text-3); }
.ps-dot { position: absolute; left: 12px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--purple); }
.ps-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text); margin-bottom: 5px; }
.ps-adm .ps-title { color: var(--text-2); }
/* neutralize the legacy bullet/indent inside the spine */
.patch-spine .patch-section { margin-bottom: 0; }
.patch-spine .patch-item { padding-left: 0; margin-bottom: 6px; }
.patch-spine .patch-item::before { display: none; }
.ps-adm .patch-item-main { color: var(--text-2); }
/* folded admin strip */
.ps-admin-strip { cursor: pointer; }
.ps-admin-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); padding-top: 2px; }
.ps-admin-strip:hover .ps-admin-label { color: var(--text-2); }
.ps-admin-sub { font-weight: 500; opacity: 0.85; }
.ps-caret { font-family: var(--font-mono); margin-left: 6px; opacity: 0.7; }
.ps-admin-kids { display: none; }
.ps-admin-kids.open { display: block; }
/* quieter details affordance within the spine */
.patch-spine .more-btn { text-decoration: none; color: var(--text-3); }
.patch-spine .more-btn:hover { color: var(--text-2); }
.patch-spine .item-detail { background: none; border-left: 2px solid var(--border); border-radius: 0; padding: 4px 0 4px 11px; }

/* Divider */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 1.1rem 0.85rem;
}

/* Criticism section */
.criticism-section {
  margin: 0 1.1rem 0.85rem;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(192,57,43,0.2);
  background: var(--red-bg);
}
.criticism-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--red);
  margin-bottom: 7px;
}
.criticism-item {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
  padding-left: 9px;
  border-left: 2px solid rgba(192,57,43,0.35);
}
.criticism-item:last-child { margin-bottom: 0; }
.criticism-who { font-weight: 500; color: var(--red); }

/* Underreported section */
.underreported-section {
  margin: 0 1.1rem 0.85rem;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(176,106,0,0.28);
  background: rgba(255,243,205,0.8);
}
.underreported-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  margin-bottom: 10px;
  color: #7a5500;
}
.underreported-item {
  padding: 10px 0;
  border-top: 1px solid rgba(176,106,0,0.2);
}
.underreported-item:first-child { border-top: none; }
.underreported-section-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #714d05;
  margin-bottom: 4px;
}
.underreported-summary,
.underreported-why {
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
}
.underreported-why { color: #6b4700; margin-top: 6px; }

/* Positions section */
.positions-section {
  margin: 0 1.1rem 0.85rem;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(26,86,160,0.15);
  background: var(--surface-2);
}
.positions-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 10px;
}
.position-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid rgba(0,0,0,0.05);
}
.position-row:first-child { border-top: none; }
.position-row.tracked { background: rgba(255,243,205,0.7); border-left: 4px solid rgba(176,106,0,0.65); padding-left: 10px; }
.position-name { font-size: var(--fs-sm); color: var(--text); }
.position-role {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.role-yes       { background: var(--green-bg);  color: var(--green-text); }
.role-no        { background: var(--amber-bg);  color: var(--amber-text); }
.role-sponsored { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.role-grey      { background: var(--surface-2); color: var(--text-3); }
/* Gaps section */
.gaps-section {
  margin: 0 1.1rem 0.85rem;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(176,106,0,0.28);
  background: var(--amber-bg);
}
.gaps-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--amber-text);
  margin-bottom: 9px;
}
.gaps-item {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
  padding-left: 9px;
  border-left: 2px solid rgba(176,106,0,0.35);
}
.gaps-item:last-child { margin-bottom: 0; }

/* ── Omnibus division blocks (bill page only) ── */
.omnibus-divisions {
  margin: 0 1.1rem 0.85rem;
}
.omnibus-divisions-header {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--purple);
  padding: 0.55rem 0 0.55rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.division-block {
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.division-block-header {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.6rem 0.85rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.division-key-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--purple);
  background: var(--purple-bg);
  border: 1px solid var(--purple-border);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.division-block-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.division-summary {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.55;
  padding: 0.6rem 0.85rem 0.35rem;
}
/* Division inner blocks inherit patch-notes styling but are nested */
.division-block .patch-notes {
  margin: 0 0.6rem 0.65rem;
}
.division-block .top-lines {
  margin: 0 0.6rem 0.65rem;
}
.division-block .what-changed-section {
  padding: 0 0.6rem 10px;
}
.division-block .underreported-section,
.division-block .criticism-section,
.division-block .gaps-section {
  margin: 0 0.6rem 0.65rem;
}

/* View full bill link */
.view-bill-link-row {
  padding: 0.3rem 1.1rem 0.8rem;
  text-align: right;
}
.view-bill-link-row a {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--purple);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.view-bill-link-row a:hover { text-decoration: underline; }

/* Analysis toggle (bill.html) */
#analysis-toggle-row { text-align: center; margin: 0.5rem 0; }
.analysis-toggle-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0.75rem;
  letter-spacing: 0.02em;
}
.analysis-toggle-btn:hover { color: var(--purple); }
.share-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 12px;
  transition: color 0.15s, border-color 0.15s;
}
.share-btn:hover { color: var(--purple); border-color: var(--purple); }
.share-btn--copied { color: var(--green) !important; border-color: var(--green) !important; }

/* Text fragment share tooltip (share-highlight.js) */
.share-hl-tip {
  position: fixed;
  display: none;
  align-items: center;
  gap: 5px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 11px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  user-select: none;
  pointer-events: auto;
}
.share-hl-tip:not(.share-hl-tip--below)::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}
.share-hl-tip--below::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--text);
}
.share-hl-tip--copied { background: var(--green); color: #fff; }
.share-hl-tip--copied::after { border-top-color: var(--green); }
.share-hl-tip--below.share-hl-tip--copied::after { border-bottom-color: var(--green); border-top-color: transparent; }
.share-hl-tip:hover { opacity: 0.88; }

/* Bill text viewer (bill.html) */
.bill-text-container {
  margin: 1rem 0 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.bill-text-header {
  padding: 14px 18px 16px;
  border-bottom: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bill-text-label {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--purple);
}
.bill-text-source {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
}
.bill-text-body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.9;
  color: var(--text);
  padding: 0 28px 28px;
  max-width: 760px;
  margin: 0 auto;
}
/* Preamble and epilogue blocks — metadata outside the statute text */
.bt-preamble,
.bt-epilogue {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.65;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  margin: 0 -28px 22px;
  word-break: break-word;
}
.bt-epilogue { border-top: 1px solid var(--border); border-bottom: none; margin-top: 28px; padding-top: 14px; margin-bottom: 0; }
/* Section and title headers — centered for document-style clarity */
.bt-title {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--purple);
  text-align: center;
  margin: 2.25em 0 0.5em;
  padding-top: 1.25em;
  border-top: 1px solid var(--border);
}
.bt-section {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin: 2em 0 0.6em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
  word-break: break-word;
  scroll-margin-top: 60px;
}
.bt-title { scroll-margin-top: 60px; }
/* Collapsible Table of Contents inside the bill text */
.bt-toc { margin: 6px 0 12px; }
.bt-toc > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  padding: 6px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.bt-toc > summary::-webkit-details-marker { display: none; }
.bt-toc > summary::before { content: '▸'; font-size: 0.85em; opacity: 0.7; }
.bt-toc[open] > summary::before { content: '▾'; }
.bt-toc-body { padding: 8px 0 2px 8px; opacity: 0.82; }
/* TOC entries: quiet the nested title/section headers so they read as a list */
.bt-toc-body .bt-title,
.bt-toc-body .bt-section {
  text-align: left;
  margin: 6px 0 2px;
  padding-top: 0;
  border-top: none;
  font-size: var(--fs-xs);
  color: var(--text-2);
}
/* Enacting clause */
.bt-enacting {
  font-style: italic;
  color: var(--text-2);
  font-size: var(--fs-md);
  margin: 0.25em 0 1.5em;
}
/* Subsection / paragraph items */
.bt-item {
  margin-bottom: 0.6em;
  word-break: break-word;
}
.bt-text {
  margin-bottom: 0.4em;
  word-break: break-word;
}
.bt-lbl {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--fs-xs);
  color: var(--text-2);
}
/* Indent levels */
.bt-l1 { margin-left: 1.5rem; }
.bt-l2 { margin-left: 1.5rem; padding-left: 1.1rem; border-left: 2px solid var(--border); }
.bt-l3 { margin-left: 1.5rem; padding-left: 2.3rem; border-left: 2px solid var(--border); }
.bt-l4 { margin-left: 1.5rem; padding-left: 3.5rem; border-left: 2px solid var(--border); }
/* Explicit spacer injected before each (a)(b)(c) subsection */
.bt-break { height: 1rem; }
/* Slight separation between numbered paragraphs (1)(2) */
.bt-item.bt-l2 { margin-top: 0.35em; }
/* Utility */
.bt-blank        { height: 0.6em; }
.bt-page-marker  { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); text-align: center; margin: 1em 0; opacity: 0.5; }
.bt-citation     { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); margin-bottom: 0.15em; }

/* ---- Bill text nav panel ---- */
.bill-nav-panel {
  position: fixed;
  top: 70px;
  right: 0;
  width: 210px;
  max-height: calc(100vh - 90px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 1px));
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
  scrollbar-width: thin;
}
.bill-nav-panel.bill-nav-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.bill-nav-header {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.bill-nav-list {
  display: flex;
  flex-direction: column;
}
.bill-nav-item {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  line-height: 1.35;
  padding: 6px 10px 6px 12px;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s, color 0.1s;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.bill-nav-item--title {
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
}
.bill-nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.bill-nav-item.active {
  color: var(--purple);
  background: var(--purple-bg);
  border-left-color: var(--purple);
}
@media (max-width: 1199px) {
  .bill-nav-panel { display: none; }
}

/* ---- Back to top button ---- */
.bill-back-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 38px;
  height: 38px;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.bill-back-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.bill-back-top:hover { background: var(--purple-text); }
[data-theme="dark"] .bill-back-top { color: var(--bg); }
@media (min-width: 1200px) {
  .bill-back-top { right: calc(210px + 1.25rem); }
}

/* AI analysis */
.ai-btn {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  margin: 0 1.1rem 0.85rem;
  transition: all 0.15s;
}
.ai-btn:hover { background: var(--surface-2); }
.ai-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-btn .dot-anim { display: inline-block; animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

.ai-output {
  margin: 0 1.1rem 0.85rem;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  display: none;
  font-family: var(--font-mono);
}
.ai-output.open { display: block; }

/* ---- FAVORITES BUTTON ---- */
.fav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.fav-btn:hover { color: var(--text); border-color: var(--text-3); }
.fav-btn.active {
  color: var(--star);
  border-color: var(--star);
  background: rgba(250, 204, 21, 0.1);
}
[data-theme="dark"] .fav-btn.active {
  color: var(--star);
  border-color: var(--star);
  background: rgba(250, 204, 21, 0.08);
}
.fav-btn.active svg polygon { fill: currentColor; }

.rep-star-btn {
  opacity: 0.35;
  padding: 4px;
  flex-shrink: 0;
}
.rep-star-btn:hover    { opacity: 0.7;  color: var(--amber); }
.rep-star-btn.watching { opacity: 1;    color: var(--amber); }
.rep-star-btn.watching svg polygon { fill: currentColor; }

/* ---- FAVORITES VIEW ---- */
.fav-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1.5rem 0 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.fav-section-header:first-child { margin-top: 0; }
.fav-section-body { display: none; margin-bottom: 0.5rem; }
.fav-section-body.open { display: block; }
.fav-chevron { margin-left: auto; }
.fav-section-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-3);
}
.fav-section-count {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  background: var(--surface-2);
  color: var(--text-3);
  padding: 1px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* Tracked rep cards */
.tracked-reps-list { display: flex; flex-direction: column; gap: 0.5rem; }
.tracked-rep-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--party-color, var(--border));
  border-radius: var(--radius-md);
  padding: 10px 12px 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.tracked-rep-portrait-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.tracked-rep-portrait {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid transparent;
  background: var(--portrait-bg);
}
.tracked-rep-info { flex: 1; min-width: 0; }
.tracked-rep-name {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tracked-rep-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-3);
  margin-bottom: 6px;
}
.tracked-rep-bills { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rep-bill-pill {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.rep-bill-more {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-3);
}
.tracked-rep-quote {
  font-size: var(--fs-xs);
  font-style: italic;
  color: var(--text-2);
  line-height: 1.45;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border-inner);
}

/* Two-quote entries in tracked rep cards */
.tracked-rep-quote-entry {
  margin-top: 7px;
  padding: 6px 0 6px 8px;
  border-left: 2px solid var(--border);
  border-top: 1px solid var(--border-inner);
}
.tracked-rep-quote-entry:first-of-type { border-top: none; }
.tracked-rep-quote-entry.accent-oppose  { border-left-color: var(--red);    }
.tracked-rep-quote-entry.accent-support { border-left-color: var(--green);  }
.tracked-rep-quote-entry.accent-neutral { border-left-color: var(--border); }
.tracked-rep-quote-text {
  font-size: var(--fs-xs);
  font-style: italic;
  color: var(--text-2);
  line-height: 1.45;
  margin: 0 0 3px;
}
.tracked-rep-quote-ctx {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-3);
}

.tracked-rep-untrack {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.tracked-rep-untrack:hover { color: var(--red); background: var(--red-bg); }

/* Saved floor quote cards (inside favorites view) */
.fav-quote-card {
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  border-top: 1px solid var(--border-inner);
  border-left: 3px solid var(--border);
}
.fav-quote-card.accent-oppose  { border-left-color: var(--red);    }
.fav-quote-card.accent-support { border-left-color: var(--green);  }
.fav-quote-card.accent-neutral { border-left-color: var(--border); }
.fav-quote-text {
  font-size: var(--fs-md);
  color: var(--text);
  font-style: italic;
  line-height: 1.55;
  margin: 0 0 0.4rem;
}
.fav-quote-attr {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.fav-quote-portrait {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-2);
}
.fav-quote-speaker {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
}
a.fav-quote-speaker:hover { color: var(--purple); text-decoration: underline; }
.fav-quote-source {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-3);
  flex: 1;
}

/* Favorites empty states */
.fav-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-3);
}
.fav-empty-icon { margin-bottom: 0.5rem; }
.fav-empty-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.3rem;
}
.fav-empty-sub { font-size: var(--fs-sm); line-height: 1.5; }

/* ---- FOOTER ---- */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: var(--fs-xs);
  color: var(--text-3);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-2); }
.footer-note { margin-top: 4px; font-size: var(--fs-xs); }
.footer-only {
  color: #E8855A;
  font-weight: 700;
  font-style: italic;
}

/* ---- RESPONSIVE ---- */

/* Tablet — modest tightening */
@media (max-width: 768px) {
  .stats-hero {
    grid-template-columns: 1fr 1fr;
  }
  .stats-hero-headline {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .stat-tile:nth-child(2) { border-right: 1px solid var(--border); }
  .stat-tile:nth-child(3) { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-tile:nth-child(4) { border-bottom: none; }
  .quote-cards-row { grid-template-columns: 1fr; }
}

/* Phone — full mobile layout */
@media (max-width: 640px) {

  /* === HEADER === */
  .header-inner { padding: 0 14px; }
  .header-track { gap: 8px; }
  .header-cta__label { display: none; }
  .app-store-badge__text { display: none; }
  .app-store-badge { padding: 8px 10px; gap: 0; }
  .logo-img { height: 72px; margin-bottom: -14px; }

  /* === CONTROLS === */
  .zip-display { display: none; }
  .bills-count-label { display: none; }
  .rep-strip-star { padding-bottom: 10px; }

  /* Nav fits on one row — tabs distribute evenly, no scroll */
  .controls-inner { padding: 6px 14px; }
  .site-nav { flex: 1; flex-shrink: 1; }
  .nav-link { flex: 1; text-align: center; padding: 5px 5px; letter-spacing: 0.02em; }
  .nav-hide-mobile { display: none; }
  /* Stage filter tabs scroll horizontally */
  .filter-row { flex-wrap: nowrap; }
  .filter-btn { flex-shrink: 0; }
  .bill-filter-bar { overflow-x: auto; scrollbar-width: none; padding: 8px 0 14px; }
  .bill-filter-bar::-webkit-scrollbar { display: none; }

  /* === REP STRIP: grid layout — strip fades into View all button === */
  .controls-rep-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 0;
    padding: 8px 14px 10px;
    max-height: 150px;
  }
  .rep-strip-label {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    padding-top: 0;
  }
  .rep-strip {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }
  .rep-more-btn {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }

  /* === MAIN === */
  .main { padding: 12px 12px 2rem; }

  /* === SHOCK QUOTES: single column === */
  .shock-quotes-section { padding: 0 12px; margin-bottom: 12px; }

  /* === BILL CARD HEADER: tighter 4-col grid === */
  .bill-header {
    grid-template-columns: 44px 1fr 34px;
    gap: 8px;
    padding: 12px 14px;
  }
  .bill-rank-col { gap: 3px; }
  .status-badge { font-size: 8px; padding: 2px 5px; }
  .sponsor-portrait { width: 36px; height: 36px; }
  .bill-title { font-size: var(--fs-md); }
  .bill-summary {
    font-size: var(--fs-xs);
  }
  .bill-meta { font-size: 9.5px; }
  .bill-meta-row { margin-bottom: 3px; }
  .bill-actions-col,
  .footer-chevron-col { width: 34px; }
  .star-btn svg { width: 22px; height: 22px; }

  /* === LIKELIHOOD FOOTER === */
  .likelihood-footer {
    gap: 8px;
    padding: 6px 14px;
  }
  .likelihood-label { display: none; }
  .fp-dot { width: 5px !important; height: 5px !important; }
  .fp-dot-active { width: 6px !important; height: 6px !important; }
  .fp-line { width: 8px; }
  .likelihood-value { min-width: 0; font-size: var(--fs-2xs); }

  /* === EXPANDED BODY: tighter horizontal margins === */
  .likelihood-detail,
  .top-lines,
  .underreported-teaser,
  .quote-cards-row { margin-left: 0.75rem; margin-right: 0.75rem; }
  .expand-full-btn {
    width: calc(100% - 1.5rem);
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }
  /* Drop the container frame on mobile — the spine's own rail + detail border
     already add vertical lines; a third (the box) is visual overload in the
     narrow column. Content sits unboxed, aligned with the rest of the card. */
  .patch-notes { margin-left: 0.75rem; margin-right: 0.75rem; padding: 0; border: none; background: none; }
  .view-bill-link-mobile { display: block; margin: 0.5rem 0.75rem 0.25rem; }
  /* Spine: reclaim the wide left gutter on narrow screens so text isn't cramped */
  .patch-spine .ps-row,
  .patch-spine .ps-admin-strip { padding-left: 32px; padding-bottom: 14px; }
  .patch-spine .ps-num { min-width: 26px; height: 19px; font-size: 0.6rem; padding: 0 3px; }
  .patch-spine .ps-rail { left: 12px; }
  .patch-spine .ps-dot { left: 9px; }
  .patch-spine .item-detail { padding-left: 8px; }
  .what-changed-section { padding: 0 0.75rem 12px; }
  .what-changed-grid { grid-template-columns: 1fr; }
  .section-divider { margin-left: 0.75rem; margin-right: 0.75rem; }
  .criticism-section,
  .underreported-section,
  .gaps-section,
  .positions-section { margin-left: 0.75rem; margin-right: 0.75rem; }
  .ai-btn  { margin-left: 0.75rem; margin-right: 0.75rem; }
  .ai-output { margin-left: 0.75rem; margin-right: 0.75rem; }
  .quote-cards-row { gap: 0.5rem; }

  /* === FLOOR PAGE: tighter on mobile === */
  .floor-search-row { padding: 0 0 12px; }
  .floor-cat-header { grid-template-columns: 38px 1fr 34px; gap: 10px; padding: 12px 14px; }
  .floor-cat-chip   { width: 34px; height: 34px; }
  .floor-entry      { padding: 0.75rem 14px; }
  .floor-entry-header { gap: 6px; }
  .floor-entry-portrait { width: 28px; height: 28px; }
  .floor-entry-date { display: none; }
}

/* ---- DARK MODE SLIDER TOGGLE ---- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.theme-toggle input:focus { outline: none; }
.theme-toggle input:focus-visible ~ .toggle-track {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.theme-icon {
  color: var(--text-3);
  flex-shrink: 0;
  margin-right: 5px;
  transition: color 0.22s ease;
}
.theme-toggle input:checked ~ .theme-icon {
  color: var(--purple);
}
.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.22s ease;
  flex-shrink: 0;
}
.theme-toggle input:checked ~ .toggle-track {
  background: var(--purple);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.22s ease;
}
.theme-toggle input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

/* ---- DARK MODE ---- */
[data-theme="dark"] {
  --bg:           #0f0f11;
  --surface:      #1a1a1f;
  --surface-2:    #242429;
  --border:       #2e2e38;
  --border-strong:#3a3a45;
  --border-inner: #252530;
  --text:         #f0f0f3;
  --text-2:       #b5b5c0;
  --text-3:       #9898a8;
  --shadow:       0 1px 3px rgba(0,0,0,0.4);

  /* Brand purple, lightened for dark surfaces */
  --purple:       #8f85eb;
  --purple-bg:    #1d1b38;
  --purple-text:  #c6c1f7;
  --purple-border:#3f3989;

  --orange:       #fb923c;

  --teal:         #14b8a6;
  --teal-bg:      #0d2926;
  --teal-text:    #5eead4;
  --teal-border:  #134e4a;

  --green:        #34d399;
  --green-bg:     #052e16;
  --green-text:   #6ee7b7;

  --amber:        #fbbf24;
  --amber-bg:     #1c1000;
  --amber-border: #78350f;
  --amber-text:   #fde68a;

  --accent:       #8f85eb;
  --red:          #f87171;
  --red-bg:       #2d0a0a;
  --red-text:     #fca5a5;

  --blue:         #60a5fa;
  --blue-bg:      #0a1a2e;
  --blue-text:    #93c5fd;
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .controls-bar,
[data-theme="dark"] .bill-card,
[data-theme="dark"] .stats-hero,
[data-theme="dark"] .shock-quote-card:not(.is-featured),
[data-theme="dark"] .quote-card,
[data-theme="dark"] .underreported-teaser,
[data-theme="dark"] .top-lines,
[data-theme="dark"] .patch-notes,
[data-theme="dark"] .likelihood-detail {
  border-color: var(--border);
}

[data-theme="dark"] .underreported-section {
  background: rgba(100,50,0,0.22);
  border-color: rgba(200,130,0,0.3);
}
[data-theme="dark"] .underreported-title {
  color: var(--amber);
}
[data-theme="dark"] .underreported-item {
  border-top-color: rgba(200,130,0,0.2);
}
[data-theme="dark"] .underreported-section-name {
  color: #fcd34d;
}
[data-theme="dark"] .underreported-summary {
  color: var(--text);
}
[data-theme="dark"] .underreported-why {
  color: #c9a96e;
}


[data-theme="dark"] .logo-mark {
  background: #f0f0f3;
  color: #0f0f11;
}


[data-theme="dark"] .filter-btn.active {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--bg);
}

[data-theme="dark"] .status-demo {
  background: var(--surface-2);
  color: var(--text-3);
  border-color: var(--border);
}

[data-theme="dark"] .status-omnibus {
  background: var(--amber-border);
  color: #fcd34d;
}
[data-theme="dark"] .bill-card--omnibus {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px #fbbf2430, var(--shadow);
}
[data-theme="dark"] .bill-card--enacted {
  border-color: var(--green);
  box-shadow: 0 0 0 1px #34d39930, var(--shadow);
}

[data-theme="dark"] .expand-full-btn {
  color: var(--bg);
}

[data-theme="dark"] .likelihood-track,
[data-theme="dark"] .likelihood-bar-sm {
  background: #3a3a45;
}


[data-theme="dark"] .bill-card:hover .bill-header,
[data-theme="dark"] .bill-card:hover .likelihood-footer {
  background: var(--surface-2);
}

[data-theme="dark"] .chevron {
  border-right-color: var(--text);
  border-bottom-color: var(--text);
  opacity: 0.5;
}

[data-theme="dark"] .star-btn {
  color: var(--text);
  opacity: 0.5;
}

[data-theme="dark"] .floor-search {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .floor-search:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(143, 133, 235, 0.18);
}
[data-theme="dark"] .floor-entry-chamber { color: var(--text-3); }
[data-theme="dark"] .party-dem { background: var(--blue-bg);  color: var(--blue-text); }
[data-theme="dark"] .party-rep { background: var(--red-bg);   color: var(--red-text);  }

[data-theme="dark"] .status-enacted {
  background: var(--green);
  color: #000;
}

[data-theme="dark"] .fp-dot-active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text);
}

