/* SF Promises — Civic Record San Francisco Design System */
/* Editorial Serif + DM Sans Clean Modern Aesthetic */

:root {
  --bg: #0f1a26;
  --surface: #162636;
  --surface-alt: #1c3044;
  --surface-highlight: #223a52;
  --ink: #edf3f5;
  --ink-dim: #d8e4ea;
  --muted: #b5cad8;
  --line: #324656;
  --line-soft: #213344;
  --blue: #7bb2ef;
  --blue-dark: #3a75b5;
  --blue-soft: #1a324d;
  --kept: #77d4a7;
  --kept-bg: #193d2c;
  --kept-border: #2e664c;
  --broken: #ff9c8f;
  --broken-bg: #472722;
  --broken-border: #753932;
  --purple: #c2a4ec;
  --purple-bg: #2b2140;
  --purple-border: #5a3e80;
  --orange: #ffcf8f;
  --orange-bg: #3a2a16;
  --orange-border: #6e4c22;
  --bg-surface: #121f2d;
  --surface-light: #182838;
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select, textarea, a {
  font: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.font-mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Page Shell & Container */
.shell {
  min-height: 100vh;
  width: 100%;
  padding-top: var(--safe-area-inset-top);
  background: var(--bg);
  overflow-x: clip;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Topbar */
.topbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--blue);
  color: #0f1a26;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.topbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.freeze-tag {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--line-soft);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 500;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--surface);
  transition: all 0.15s;
}

.github-link:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  text-decoration: none;
}

/* Hero Section */
.hero {
  padding: 44px 0 36px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 12px;
}

.hero h1 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--ink);
}

.subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 18px;
}

.promise-line {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 24px;
  max-width: 52ch;
  text-wrap: pretty;
}

::placeholder {
  color: var(--muted) !important;
  opacity: 1;
}

/* Tally Banner: Hero Stat Box */
.tally-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.tally-hero-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  font-size: 1.12rem;
  color: var(--ink);
}

.tally-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.tally-item strong {
  font-weight: 700;
  font-size: 1.25rem;
}

.tally-item.total strong {
  color: var(--blue);
}

.tally-target {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.tally-sep {
  color: var(--line);
}

.dot-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-kept { background: var(--kept); }
.dot-in_progress { background: var(--blue); }
.dot-broken { background: var(--broken); }
.dot-stalled { background: var(--orange); }
.dot-undecided { background: var(--muted); }

.tally-subline {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Discrepancies & Audit Alert Banner */
.audit-alert-banner {
  background: rgba(255, 207, 143, 0.08);
  border: 1px solid var(--orange-border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.audit-alert-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: #ffdfba;
}

.audit-warning-icon {
  flex: 0 0 auto;
  color: var(--orange);
}

.audit-alert-left strong {
  color: #fff;
}

.btn-open-discrepancies {
  border: 1px solid var(--orange-border);
  background: var(--orange-bg);
  color: var(--orange);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-open-discrepancies:hover {
  background: #4a341b;
  border-color: var(--orange);
}

/* Featured Promise Section (P02) */
.featured-section {
  padding: 34px 0 38px;
  border-bottom: 1px solid var(--line);
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--blue);
}

.promise-card-featured {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.promise-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.promise-id-badge {
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--line-soft);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.verdict-chip {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.verdict-chip.kept {
  background: var(--kept-bg);
  color: var(--kept);
  border: 1px solid var(--kept-border);
}

.verdict-chip.broken {
  background: var(--broken-bg);
  color: var(--broken);
  border: 1px solid var(--broken-border);
}

.verdict-chip.in_progress {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid var(--line);
}

.verdict-chip.stalled {
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid var(--orange-border);
}

.verdict-chip.undecided {
  background: var(--line-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.verdict-chip.quarantined {
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid var(--orange-border);
}

.verdict-chip.kept_then_reversed {
  background: rgba(234, 88, 12, 0.15);
  color: #fdba74;
  border: 1px solid rgba(234, 88, 12, 0.4);
}

.verdict-chip.delayed_or_partial {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}


.badge-verified {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--kept-bg);
  color: var(--kept);
  border: 1px solid var(--kept-border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.entity-tag {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-dim);
}

.btn-inspect-modal {
  background: var(--surface-alt);
  color: var(--blue);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-inspect-modal:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.promise-quote-featured {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.35;
  color: #fff;
  margin: 0 0 16px;
  font-style: italic;
}

.meta-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--line-soft);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.meta-field-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-field-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.meta-field-val {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 500;
}

.evidence-source-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 0.88rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.source-url-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-weight: 600;
}

.hash-display-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--ink-dim);
  font-size: 0.8rem;
}

.btn-copy-micro {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
}

.btn-copy-micro:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--blue);
}

/* Interactive Pipeline Demonstration */
.pipeline-interactive-section {
  padding: 44px 0 48px;
  border-bottom: 1px solid var(--line);
}

.pipeline-header {
  margin-bottom: 24px;
}

.pipeline-header h2 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2rem, 3.8vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 4px 0 10px;
  font-weight: 600;
}

.pipeline-lead {
  color: var(--muted);
  font-size: 1rem;
  max-width: 56ch;
  text-wrap: pretty;
  margin: 0;
}

.pipeline-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-pipeline-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-run-p02 {
  background: var(--blue);
  color: #0f1a26;
}

.btn-run-p02:hover:not(:disabled) {
  background: #8fc0f5;
}

.btn-run-n01 {
  background: var(--broken-bg);
  border-color: var(--broken-border);
  color: var(--broken);
}

.btn-run-n01:hover:not(:disabled) {
  background: #5c302a;
}

.btn-step-next {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn-step-next:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-pipeline-reset {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn-pipeline-reset:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.btn-pipeline-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Visual Node Flow Track */
.pipeline-flow-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flow-node-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  transition: all 0.25s ease;
  position: relative;
}

.flow-node-card.active {
  border-color: var(--node-accent, var(--blue));
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  background: var(--surface-alt);
}

.flow-node-card.done {
  border-color: var(--line);
  background: var(--surface);
}

.flow-node-card.failed {
  border-color: var(--broken);
  background: rgba(71, 39, 34, 0.4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.flow-node-card.warning-node {
  border-color: var(--orange);
  background: rgba(58, 42, 22, 0.4);
}

.node-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.node-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.node-step-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--node-accent, var(--blue));
  background: var(--line-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.node-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.node-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.node-pulse-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--blue);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.node-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.node-status-badge.pass {
  background: var(--kept-bg);
  color: var(--kept);
}

.node-status-badge.warning {
  background: var(--orange-bg);
  color: var(--orange);
}

.node-status-badge.fail {
  background: var(--broken-bg);
  color: var(--broken);
}

.node-description {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 10px;
}

.node-io-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
  margin-top: 8px;
  font-size: 0.82rem;
}

.node-io-item dt {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.node-io-item dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

/* Relevance Score Visualizer in Step 2.5 */
.relevance-bars-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  background: var(--line-soft);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.rel-metric-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rel-metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
}

.rel-metric-score {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--blue);
}

.rel-progress-bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.rel-fill {
  height: 100%;
  background: var(--blue);
  width: 100%;
}

/* Advocate Parallel Sandboxes Split */
.split-connector-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.split-connector-label::before,
.split-connector-label::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
  max-width: 180px;
}

.advocates-split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  position: relative;
}

.advocate-sandbox-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  transition: all 0.25s;
}

.advocate-sandbox-card.kept-sandbox {
  border-color: rgba(16, 185, 129, 0.4);
}

.advocate-sandbox-card.broken-sandbox {
  border-color: rgba(239, 68, 68, 0.4);
}

.advocate-sandbox-card.active {
  background: var(--surface-alt);
  box-shadow: 0 0 0 2px var(--blue);
}

.isolation-lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--line-soft);
  padding: 3px 8px;
  border-radius: 999px;
  margin-top: 8px;
}

.staging-file-chip {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.78rem;
  padding: 4px 10px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-dim);
}

/* Arbitrator Check Tick List */
.arbitrator-checks-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 12px;
  background: var(--line-soft);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.check-tick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink);
}

.check-tick-item.passed .tick-icon {
  color: var(--kept);
  font-weight: 700;
}

.check-tick-item.failed .tick-icon {
  color: var(--broken);
  font-weight: 700;
}

/* Final Pipeline Destination Outputs */
.outputs-fork-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
}

.output-destination-box {
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid transparent;
  transition: all 0.25s;
}

.output-destination-box.kept-dest {
  background: var(--kept-bg);
  border-color: var(--kept-border);
  color: var(--kept);
}

.output-destination-box.quarantine-dest {
  background: var(--orange-bg);
  border-color: var(--orange-border);
  color: var(--orange);
}

.output-destination-box.active-destination {
  box-shadow: 0 0 0 3px #fff;
  transform: translateY(-2px);
}

.dest-details strong {
  display: block;
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 2px;
}

.dest-details span {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Live Narration Box */
.live-narration-banner {
  margin-top: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.narration-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  background: var(--blue);
  color: #0f1a26;
  padding: 4px 8px;
  border-radius: 4px;
  flex: 0 0 auto;
}

.narration-text {
  font-size: 0.95rem;
  color: var(--ink);
}

/* Tab Navigation: All Promises Table vs Quarantine Registry */
.table-section {
  padding: 44px 0 54px;
  border-bottom: 1px solid var(--line);
}

.tabs-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

/* View Mode Switcher Toggle */
.view-mode-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.btn-view-mode {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-view-mode:hover {
  color: var(--ink);
}

.btn-view-mode.active {
  background: var(--surface-raised);
  color: var(--cyan);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Editorial Promise Explorer Cards */
.promises-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
  margin: 16px 0 28px;
}

.editorial-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  text-align: left;
}

.editorial-card:hover,
.editorial-card:focus-visible {
  border-color: var(--line-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  outline: none;
}

.card-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.74rem;
}

.card-rank {
  font-weight: 700;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.card-category-tag {
  color: var(--ink-dim);
  background: var(--surface-raised);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
}

.card-neighborhood-tag {
  color: var(--muted);
  font-size: 0.72rem;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editorial-card .verdict-chip {
  margin-left: auto;
}

.card-quote {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.06rem;
  line-height: 1.48;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-speaker-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.82rem;
}

.card-speaker-name {
  font-weight: 600;
  color: var(--ink);
}

.card-speaker-role {
  color: var(--muted);
  font-size: 0.75rem;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-outcome {
  font-size: 0.83rem;
  line-height: 1.42;
  color: var(--ink-dim);
  margin: 0 0 14px;
  flex-grow: 1;
}

.card-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.74rem;
  color: var(--muted);
}

.card-dates {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-card-inspect {
  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.editorial-card:hover .btn-card-inspect {
  background: var(--blue);
  color: #fff;
}

/* Accordion details styling for methodology */
.methodology-accordion {
  margin: 36px 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.methodology-accordion summary {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
  user-select: none;
  background: var(--surface-raised);
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

.methodology-accordion summary:hover {
  color: var(--ink);
}

.methodology-accordion[open] summary {
  border-bottom-color: var(--line);
  color: var(--ink);
}

.methodology-content {
  padding: 18px 20px;
}

.tab-buttons-group {
  display: flex;
  gap: 8px;
}

.tab-nav-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-nav-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-nav-btn:hover:not(.active) {
  color: var(--ink);
}

.tab-badge {
  background: var(--line-soft);
  color: var(--ink);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
}

/* Table Filters Bar */
.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.filters-dropdowns-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.filter-select, .search-input {
  background: var(--line-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
  box-sizing: border-box;
}

.filter-select:focus, .search-input:focus {
  outline: none;
  border-color: var(--blue);
}

.search-input {
  width: 100%;
  font-size: 1rem; /* 16px avoids iOS zoom on focus */
  min-height: 44px;
}

/* Promises Data Table */
.data-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

/* 4-Column Table Proportions (>= 768px) */
@media (min-width: 768px) {
  #promises-table-container .data-table {
    min-width: 720px;
    table-layout: fixed;
    width: 100%;
  }
  #promises-table-container .data-table th:nth-child(1),
  #promises-table-container .data-table td:nth-child(1) { width: 22%; }
  #promises-table-container .data-table th:nth-child(2),
  #promises-table-container .data-table td:nth-child(2) { width: 50%; }
  #promises-table-container .data-table th:nth-child(3),
  #promises-table-container .data-table td:nth-child(3) { width: 12%; }
  #promises-table-container .data-table th:nth-child(4),
  #promises-table-container .data-table td:nth-child(4) { width: 16%; }

  #promises-table-container .data-table th,
  #promises-table-container .data-table td {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

.table-id-cell {
  font-weight: 700;
  color: var(--blue);
  font-size: 0.92rem;
}

.table-entity-cell .table-entity-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.94rem;
}

.table-entity-cell .table-entity-role {
  color: var(--blue);
  font-size: 0.78rem;
  margin-top: 2px;
}

.table-promise-cell {
  line-height: 1.5;
}

.table-promise-text {
  font-family: "Newsreader", Georgia, serif;
  font-size: 0.98rem;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: max-height 0.2s ease;
}

.promise-row.is-expanded .table-promise-text {
  -webkit-line-clamp: unset;
  display: block;
}

.expand-chevron {
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.2s ease;
  display: inline-block;
  margin-left: 2px;
}

.promise-row.is-expanded .expand-chevron {
  transform: rotate(180deg);
  color: var(--blue);
}

.expand-hint-text {
  font-size: 0.75rem;
  color: var(--blue);
  opacity: 0.85;
  cursor: pointer;
}

.promise-row.is-expanded .expand-hint-text {
  display: none;
}

/* Density Compact Mode */
.density-compact .data-table td {
  padding: 8px 12px !important;
}

.density-compact .data-table th {
  padding: 8px 12px !important;
}

.density-compact .table-promise-text {
  -webkit-line-clamp: 1;
  font-size: 0.9rem;
}

.density-compact .table-pill-row {
  margin-top: 3px !important;
}

/* Sticky Headers & Sortable TH */
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0f172a;
}

.data-table thead th {
  background: #0f172a;
  border-bottom: 2px solid var(--line);
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sortable-th:hover {
  background: var(--surface-raised) !important;
  color: var(--blue);
}

.th-content {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-icon {
  font-size: 0.74rem;
  color: var(--muted);
}

.sortable-th[aria-sort="ascending"] .sort-icon {
  color: var(--blue);
}

.sortable-th[aria-sort="descending"] .sort-icon {
  color: var(--blue);
}

/* Active Filter Chips Tray */
.active-chips-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: -4px 0 12px;
}

.chips-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.chips-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
}

.filter-chip-remove {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.filter-chip-remove:hover {
  color: #fff;
}

.btn-clear-all {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: auto;
}

.btn-clear-all:hover {
  background: var(--surface-raised);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Density Toggle Group */
.table-results-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -6px 0 14px;
  font-size: 0.82rem;
  color: #E2E8F0;
  flex-wrap: wrap;
  gap: 10px;
}

.status-count-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.active-filter-indicator {
  font-size: 0.78rem;
  color: var(--blue);
}

.density-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.density-label {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0 4px;
  font-weight: 700;
}

.btn-density {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-density.active {
  background: var(--blue);
  color: #030712;
  font-weight: 700;
}

/* In-Line Accordion Rows */
.promise-accordion-row {
  background: var(--surface-alt);
}

.promise-accordion-row.hidden-accordion {
  display: none !important;
}

.promise-row.is-expanded {
  background: var(--surface-raised) !important;
  border-bottom: none !important;
}

.accordion-cell {
  padding: 0 !important;
  border: none !important;
}

.accordion-panel {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.85);
  border-left: 3px solid var(--blue);
  border-right: 1px solid var(--line);
  border-bottom: 2px solid var(--line);
  margin-bottom: 2px;
}

.accordion-panel-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
}

.accordion-kicker {
  font-size: 0.7rem;
  color: var(--blue);
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 6px;
}

.accordion-full-quote {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 12px;
  padding: 0;
  border: none;
}

.accordion-provenance-meta {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}

.accordion-provenance-meta a {
  color: var(--blue);
  word-break: break-all;
}

.meta-label {
  font-weight: 700;
  color: var(--ink-dim);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.hash-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hash-code {
  font-size: 0.74rem;
  color: var(--ink-dim);
  word-break: break-all;
}

.btn-copy-hash {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  cursor: pointer;
}

.btn-copy-hash:hover {
  background: var(--surface-raised);
  color: var(--ink);
}

.advocate-summary-box {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.adv-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
}

.adv-badge.pass {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.adv-badge.fail {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.advocate-summary-box p {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-dim);
  margin: 4px 0 0;
}

.accordion-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.btn-open-inspect-deep {
  background: var(--blue);
  color: #030712;
  border: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-open-inspect-deep:hover {
  background: #38BDF8;
}

.btn-collapse-row {
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-collapse-row:hover {
  background: var(--surface-raised);
  color: var(--ink);
}

.table-timeline-cell {
  font-size: 0.82rem;
  color: var(--muted);
}

.timeline-due {
  color: var(--ink-dim);
  font-size: 0.78rem;
  margin-top: 3px;
}

.table-verdict-cell {
  text-align: left;
}

.verdict-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.verdict-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.score-pill {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.btn-inspect-inline {
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.data-table tbody tr.promise-row:hover .btn-inspect-inline {
  color: #93c5fd;
  text-decoration: underline;
}

/* Keep verdict chips on single lines */
#promises-table-container .data-table td:nth-child(5) {
  white-space: nowrap;
}

/* Inline case-reference buttons (limitations section → inspect modal). */
.case-ref-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.case-ref-link:hover {
  color: var(--ink);
}

.case-ref-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-radius: 2px;
}

/* Clickable promise rows */
.data-table tbody tr.promise-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.data-table tbody tr.promise-row:hover,
.data-table tbody tr.promise-row:focus-visible {
  background-color: rgba(255, 255, 255, 0.05);
  outline: none;
}

.btn-table-inspect {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #edf3f5;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-table-inspect:hover {
  background: var(--blue);
  color: #071120;
  border-color: var(--blue);
}

@media (prefers-reduced-motion: reduce) {
  .data-table tbody tr.promise-row {
    transition: none;
  }
}

#quarantine-table-container .data-table th:nth-child(1) { width: 7%; }
#quarantine-table-container .data-table th:nth-child(2) { width: 35%; }
#quarantine-table-container .data-table th:nth-child(3) { width: 18%; }
#quarantine-table-container .data-table th:nth-child(4) { width: 26%; }
#quarantine-table-container .data-table th:nth-child(5) { width: 14%; }

.data-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #162636;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: middle;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.data-table tr:hover {
  background: var(--surface-alt);
}

.table-promise-cell {
  white-space: normal;
  line-height: 1.45;
  word-break: break-word;
}

.table-promise-text {
  font-weight: 500;
  color: var(--ink);
}

.table-entity-cell {
  white-space: normal;
  word-break: break-word;
}

.table-entity-name {
  font-weight: 600;
  color: var(--ink);
}

.table-entity-role {
  font-size: 0.78rem;
  color: var(--muted);
}

.source-clean-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
}

.source-clean-link {
  color: #38BDF8;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}

.source-clean-link:hover {
  text-decoration: underline;
}

.badge-verified-subtle {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.18);
  color: #A7F3D0;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.relevance-collapsed-card {
  padding: 12px 0 4px;
}

.relevance-score-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.relevance-hero-score {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
}

.relevance-hero-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.relevance-hero-fill {
  height: 100%;
  background: #10B981;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.btn-table-inspect {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--blue);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-table-inspect:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}

/* Agent Roles Section (From Landing Page) */
.agents-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
}

.agents-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.agent-role-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  transition: all 0.15s;
}

.agent-role-card:hover {
  border-color: var(--agent-color);
  background: var(--surface-alt);
}

.agent-role-card.selected {
  box-shadow: 0 0 0 2px var(--agent-color);
  background: var(--surface-alt);
}

.agent-sandbox-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
}

.agent-role-card h3 {
  font-size: 1.15rem;
  margin: 6px 0 8px;
}

.agent-role-desc {
  font-size: 0.88rem;
  color: var(--ink-dim);
  line-height: 1.5;
  margin: 0;
}

.agent-isolation-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 8px 0 0;
}

.agent-cta-text {
  margin-top: auto;
  padding-top: 14px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--agent-color);
}

.agent-expanded-detail {
  margin-top: 18px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.92rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Built With & Inspired By Section */
.built-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
}

.two-col-plain {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 20px;
}

.two-col-plain h3 {
  font-size: 1.05rem;
  margin: 0 0 14px;
  color: var(--ink);
}

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

.plain-credits-list li {
  font-size: 0.92rem;
  color: var(--muted);
}

.plain-credits-list strong {
  color: var(--ink);
}

/* Footer */
.app-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 28px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand-title {
  font-weight: 700;
  color: var(--ink);
}

.footer-links-group {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links-group a,
.btn-footer-link {
  background: transparent;
  border: none;
  color: var(--blue);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.footer-links-group a:hover,
.btn-footer-link:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: underline;
}

/* Modal Backdrops & Dialogs */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 28, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 999;
}

.hidden {
  display: none !important;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-dialog-large {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-header-bar {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}

.modal-header-left h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

/* Modal Plain-English Summary Card */
.modal-summary-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.modal-summary-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 8px;
  font-weight: 600;
}

.modal-summary-quote {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #fff;
  font-style: italic;
  margin: 0 0 14px 0;
  padding: 8px 0;
}

.modal-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.modal-summary-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.modal-summary-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--muted);
}

.modal-summary-val {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 500;
}

/* Modal Source Media / Image Preview */
.modal-media-container {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.modal-media-header {
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.modal-media-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  display: block;
  background: #0b131e;
}

.modal-media-caption {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Collapsible Technical Provenance & Audit Logs Drawer */
.tech-audit-drawer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  overflow: hidden;
}

.tech-audit-summary {
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  user-select: none;
}

.tech-audit-summary:hover {
  color: var(--ink);
  background: rgba(15, 23, 42, 0.9);
}

.tech-audit-badge {
  font-size: 0.72rem;
  color: var(--blue);
}

.tech-audit-content {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--line-soft);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}

.modal-close-btn:hover {
  color: var(--ink);
}

.modal-scrollable-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* 4-Part Detail Breakdown inside Modal */
.inspection-bundle-box {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}

.bundle-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bundle-flat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flat-data-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.88rem;
}

.flat-key-name {
  font-weight: 600;
  color: var(--muted);
  min-width: 110px;
  flex: 0 0 auto;
}

.flat-val-content {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.advocates-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.advocate-bundle-half {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.advocate-bundle-half h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.claim-quote-box {
  font-size: 0.85rem;
  color: var(--ink-dim);
  background: var(--line-soft);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-top: 8px;
  font-style: italic;
}

/* Discrepancy Card Style */
.discrepancy-card {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.discrepancy-card h4 {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 0.95rem;
}

.discrepancy-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .advocates-split-container {
    grid-template-columns: 1fr;
  }
  .agents-grid {
    grid-template-columns: 1fr 1fr;
  }
  .two-col-plain {
    grid-template-columns: 1fr;
  }
  .advocates-modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .wrap {
    padding: 0 16px;
  }
  .topbar {
    padding: 14px 16px;
  }
  .agents-grid {
    grid-template-columns: 1fr;
  }
  .outputs-fork-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SF PROMISES — CITYWIDE SHOWCASE & 6-STAGE PIPELINE ANIMATION SYSTEM
   Directly ported and enhanced from Sf-Promises-Pipeline-Animation.html
   ========================================================================== */

/* Keyframe Animations */
@keyframes stampIn {
  0% { transform: scale(2.2) rotate(-14deg); opacity: 0; }
  60% { transform: scale(0.96) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(-4deg); opacity: 1; }
}

@keyframes stampInAmber {
  0% { transform: scale(2.2) rotate(-14deg); opacity: 0; }
  60% { transform: scale(0.96) rotate(-2deg); opacity: 1; }
  100% { transform: scale(1) rotate(3deg); opacity: 1; }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.12); filter: brightness(1.25); }
}

/* One-shot highlight when the showcase card content swaps. */
.showcase-pulse {
  animation: showcasePulse 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes showcasePulse {
  0% { transform: scale(0.99); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-pulse {
    animation: none;
  }
}

@keyframes pulseGlowGreen {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.12); filter: brightness(1.25); }
}

@keyframes pulseGlowAmber {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.12); filter: brightness(1.25); }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* --------------------------------------------------------------------------
   SF SHOWCASE: ACROSS THE CITY (Interactive City Spectrum)
   -------------------------------------------------------------------------- */
.sf-showcase-section {
  padding: 38px 0 44px;
  border-bottom: 1px solid var(--line);
}

.showcase-header {
  margin-bottom: 22px;
}

.showcase-header h2 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 4px 0 10px;
  font-weight: 600;
  color: var(--ink);
}

.showcase-lead {
  color: var(--muted);
  font-size: 1rem;
  max-width: 68ch;
  text-wrap: pretty;
  margin: 0;
  line-height: 1.55;
}

/* Tabs Bar */
.showcase-tabs-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.showcase-tab-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-dim);
}

.showcase-tab-btn:hover {
  background: var(--surface-alt);
  border-color: var(--blue);
  transform: translateY(-1px);
}

.showcase-tab-btn.active {
  background: var(--surface-alt);
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(110, 168, 232, 0.35);
  color: var(--ink);
}

.showcase-tab-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.showcase-tab-icon {
  font-size: 1.35rem;
  line-height: 1;
  padding-top: 2px;
}

.showcase-tab-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.showcase-tab-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  white-space: normal;
  line-height: 1.3;
}

.showcase-tab-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  white-space: normal;
  line-height: 1.35;
}

/* Active Showcase Card */
.showcase-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.showcase-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.showcase-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.domain-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink-dim);
}

.neighborhood-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--line-soft);
  color: var(--blue);
  border: 1px solid var(--line);
}

.showcase-quote {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.35;
  color: #fff;
  margin: 0 0 16px;
  font-style: italic;
}

.showcase-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.showcase-evidence-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

.evidence-fact-text {
  color: #c9e2f5;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   6-STAGE PIPELINE ANIMATION SYSTEM
   -------------------------------------------------------------------------- */
.pipeline-anim-wrapper {
  margin-top: 24px;
}

/* Top Progress & Mode Header */
.pipeline-top-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 16px;
}

.progress-track-wrapper {
  flex: 1;
  min-width: 200px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-track-fill {
  height: 100%;
  background: linear-gradient(to right, #10B981, #3B82F6, #F59E0B);
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.stage-status-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

/* Step Mode Controls Bar */
.pipeline-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.pipeline-actions-row .run-select {
  flex: 1 1 280px;
  max-width: 440px;
}

.pipeline-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-play-action {
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary-contextual {
  background: #10B981;
  color: #071120;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.btn-primary-contextual:hover:not(:disabled) {
  background: #34D399;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.btn-pipeline-reset-compact {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
}

.btn-pipeline-reset-compact:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.btn-pipeline-reset-compact:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-play-p02 {
  background: #10B981;
  color: #071120;
}

.btn-play-p02:hover:not(:disabled) {
  background: #34D399;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-play-n01 {
  background: #F59E0B;
  color: #1A1200;
}

.btn-play-n01:hover:not(:disabled) {
  background: #FBBF24;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-primary-filled {
  background: #10B981 !important;
  color: #071120 !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-primary-filled:hover:not(:disabled) {
  background: #34D399 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.btn-watchdog-pill {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #FDE68A !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
}

.btn-watchdog-pill:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.28) !important;
  border-color: #F59E0B !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-step-advance {
  background: #ffffff;
  color: #071120;
}

.btn-step-advance:hover:not(:disabled) {
  background: #edf3f5;
}

.btn-pipeline-reset-pill {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-pipeline-reset-pill:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.mode-hint-text {
  font-size: 0.82rem;
  color: var(--muted);
  margin-left: 6px;
}

/* Packet Transit Card */
.packet-transit-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.packet-transit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.packet-label {
  color: var(--muted);
  white-space: nowrap;
}

.packet-status-text {
  color: var(--muted);
  white-space: nowrap;
  font-weight: 700;
}

/* Transit Line & Milestones */
.packet-track-container {
  position: relative;
  height: 34px;
}

.packet-track-bg-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.packet-track-fill-line {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  background: #10B981;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
  width: 0%;
}

.packet-milestones-row {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.milestone-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.milestone-circle {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: #0A1628;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.milestone-circle.passed {
  background: #10B981;
  border-color: #10B981;
  color: #071120;
}

.milestone-circle.passed.failed {
  background: #EF4444;
  border-color: #EF4444;
  color: #ffffff;
}

.milestone-circle.active,
.milestone-circle.current {
  background: #0A1628;
  border-color: #FACC15;
  color: #FACC15;
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.25), 0 0 12px rgba(250, 204, 21, 0.4);
}

.milestone-circle.active.kept {
  background: #061F17;
  border-color: #10B981;
  color: #34D399;
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25), 0 0 12px rgba(16, 185, 129, 0.4);
}

.milestone-circle.active.broken {
  background: #1F1215;
  border-color: #EF4444;
  color: #F87171;
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25), 0 0 12px rgba(239, 68, 68, 0.4);
}

.milestone-circle.active.failed {
  background: #1F1215;
  border-color: #EF4444;
  color: #F87171;
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25), 0 0 12px rgba(239, 68, 68, 0.4);
}

.milestone-circle.active.quarantined {
  background: #241A06;
  border-color: #F59E0B;
  color: #FBBF24;
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25), 0 0 12px rgba(245, 158, 11, 0.4);
}

.packet-ball-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  pointer-events: none;
  left: 0%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.packet-ball-inner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FACC15;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.packet-ball-inner.kept,
.packet-ball-inner.kept-end {
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.packet-ball-inner.broken {
  background: #EF4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.packet-ball-inner.quarantined,
.packet-ball-inner.quarantine-end {
  background: #F59E0B;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

.milestone-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   THE 6 STAGE CARDS GRID (Col Spans: 4, 4, 4, 12, 7, 5)
   -------------------------------------------------------------------------- */
.pipeline-6stages-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.stage-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  transition: all 0.3s ease;
}

.stage-card.span-4 { grid-column: span 4; }
.stage-card.span-7 { grid-column: span 7; }
.stage-card.span-5 { grid-column: span 5; }
.stage-card.span-12 { grid-column: span 12; }

/* Stage Card Header */
.stage-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.stage-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-num-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-num-badge.blue { background: rgba(56, 189, 248, 0.2); color: #38BDF8; }
.stage-num-badge.yellow { background: rgba(250, 204, 21, 0.2); color: #FACC15; }
.stage-num-badge.green { background: rgba(16, 185, 129, 0.2); color: #10B981; }
.stage-num-badge.amber { background: rgba(245, 158, 11, 0.2); color: #F59E0B; }
.stage-num-badge.slate { background: rgba(56, 189, 248, 0.2); color: #38BDF8; }
.stage-num-badge.white { background: rgba(255, 255, 255, 0.1); color: #ffffff; }

.stage-heading {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.stage-state-pill {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
}

.stage-state-pill.running {
  background: #38BDF8;
  color: #071120;
  animation: pulse 1.5s infinite;
}

.stage-state-pill.done {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.stage-state-pill.failed {
  background: rgba(239, 68, 68, 0.25);
  color: #F87171;
}

.stage-lead-text {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin: 0 0 12px;
  line-height: 1.45;
}

/* Active Stage Card Highlight */
.stage-card.active-stage {
  border-color: rgba(56, 189, 248, 0.8);
  background: #0E2A44;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.stage-card.done-stage {
  border-color: rgba(56, 189, 248, 0.35);
  background: #0C1E33;
}

/* Stage 1 Content: Fetch */
.source-file-terminal {
  padding: 6px 0;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.source-fetch-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.source-fetch-fill {
  height: 100%;
  background: #38BDF8;
  transition: width 0.8s ease-out;
  width: 0%;
}

.source-verified-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #A7F3D0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Stage 2 Content: Extract */
.extract-quote-box {
  padding: 8px 0;
  margin-bottom: 10px;
}

.verbatim-quote-text {
  font-size: 0.92rem;
  line-height: 1.45;
  color: #fff;
  margin: 6px 0 10px;
}

.altered-word-highlight {
  background: rgba(239, 68, 68, 0.25);
  color: #F87171;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid rgba(239, 68, 68, 0.6);
  animation: pulse 1s infinite;
}

.flash-warning-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  line-height: 1.4;
}

/* Stage 3 Content: Relevance Gate */
.relevance-metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.rel-metric-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rel-metric-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
}

.rel-metric-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.rel-metric-fill {
  height: 100%;
  background: linear-gradient(to right, #10B981, #A7F3D0);
  border-radius: 999px;
  transition: width 0.7s ease-out;
  width: 0%;
}

.gate-status-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.gate-badge-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
  transition: all 0.3s;
}

.gate-badge-pill.open {
  background: #10B981;
  color: #071120;
}

.gate-badge-pill.closed {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

/* Stage 4 Content: Split Sandboxes */
.advocates-split-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
}

.advocate-sub-box {
  padding: 10px 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.advocate-sub-box.active-kept {
  border-left-color: #10B981;
}

.advocate-sub-box.active-broken {
  border-left-color: #EF4444;
}

.advocate-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bouncing-dots-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.bounce-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.bounce-dot.active-green {
  background: #10B981;
  animation: dotPulse 0.9s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

.bounce-dot.active-red {
  background: #EF4444;
  animation: dotPulse 0.9s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

/* Center Glowing Barrier */
.isolation-divider-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 4px;
}

.divider-glow-line {
  width: 2px;
  height: 44px;
  background: linear-gradient(to bottom, transparent, #F59E0B, transparent);
}

.isolation-lock-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #1A1200;
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 900;
  color: #FDE68A;
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.25;
}

.staging-chips-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  color: var(--muted);
}

.staging-file-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Stage 5 Content: Arbitrator */
.arbitrator-check-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.arb-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  transition: all 0.25s ease;
}

.arb-check-item:last-child {
  border-bottom: none;
}

.arb-check-item.passed {
  color: #A7F3D0;
}

.arb-check-item.failed {
  color: #FCA5A5;
}

.arb-check-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  flex-shrink: 0;
}

.arb-check-circle.passed {
  background: #10B981;
  color: #071120;
}

.arb-check-circle.failed {
  background: #EF4444;
  color: #ffffff;
}

.arb-check-name {
  font-weight: 700;
  color: #fff;
}

.arb-check-desc {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stage 6 Content: Output with Stamp */
.output-waiting-state {
  text-align: center;
  padding: 24px 10px;
  color: var(--muted);
}

.stamp-box-container {
  margin: 12px 0 16px;
  text-align: center;
}

.stamp-kept {
  border: 4px solid #10B981;
  color: #10B981;
  background: rgba(16, 185, 129, 0.1);
  font-size: clamp(1.8rem, 3.2vw, 2.3rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  padding: 8px 16px;
  border-radius: 10px;
  display: inline-block;
  animation: stampIn 0.5s ease-out forwards;
}

.stamp-quarantined {
  border: 4px solid #F59E0B;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.1);
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  border-radius: 10px;
  display: inline-block;
  animation: stampInAmber 0.5s ease-out forwards;
}

.stamp-caption {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 6px;
}

.stamp-caption.kept-color { color: #A7F3D0; }
.stamp-caption.amber-color { color: #FDE68A; }

.stamp-broken {
  border: 4px solid var(--broken);
  color: var(--broken);
  background: var(--broken-bg);
  font-size: clamp(1.8rem, 3.2vw, 2.3rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  padding: 8px 16px;
  border-radius: 10px;
  display: inline-block;
  animation: stampIn 0.5s ease-out forwards;
}

.stamp-in_progress {
  border: 4px solid var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  border-radius: 10px;
  display: inline-block;
  animation: stampIn 0.5s ease-out forwards;
}

.stamp-undecided {
  border: 4px solid var(--muted);
  color: var(--muted);
  background: var(--line-soft);
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  border-radius: 10px;
  display: inline-block;
  animation: stampIn 0.5s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .stamp-broken,
  .stamp-in_progress,
  .stamp-undecided {
    animation: none;
  }
}

.destination-result-card {
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 10px;
}

.destination-result-card.kept-style {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.destination-result-card.quarantine-style {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.destination-result-card.broken-style {
  background: var(--broken-bg);
  border: 1px solid var(--broken-border);
}

.destination-result-card.progress-style {
  background: var(--blue-soft);
  border: 1px solid var(--line);
}

.destination-result-card.undecided-style {
  background: var(--line-soft);
  border: 1px solid var(--line);
}

/* Pipeline run selector */
.run-select-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  align-self: center;
  white-space: nowrap;
}

.run-select {
  flex: 1 1 320px;
  width: 100%;
  max-width: 560px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0.5rem 2.5rem 0.5rem 0.875rem;
  background-color: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b5cad8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  cursor: pointer;
}

.run-select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* Bottom Explainer & Why This Design Grid */
.pipeline-footer-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-top: 18px;
}

.narrative-card {
  background: #0E1E33;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  gap: 16px;
}

.narrative-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.18);
  color: #93C5FD;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.narrative-body h3 {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
}

.narrative-body p {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

.why-design-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
}

.why-design-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 12px;
}

.why-design-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
}

.why-design-list li {
  display: flex;
  gap: 8px;
}

.why-design-list strong {
  color: #fff;
}

/* Domain Filter Pills for Tables */
.domain-filter-pills-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.domain-filter-pills-bar::-webkit-scrollbar {
  display: none;
}

.btn-domain-pill {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-domain-pill:hover {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: var(--blue);
}

/* Desktop Table spacing & right padding */
.data-table th:last-child,
.data-table td:last-child {
  padding-right: 24px;
}

.table-timeline-cell,
.timeline-date,
.timeline-due {
  white-space: nowrap !important;
}

.timeline-due {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-dim);
  margin-top: 3px;
}

/* Hero Split Grid */
.hero-split-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 32px;
  align-items: center;
}

.hero-narrative {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-stacked-chart-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stacked-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.proportional-stacked-bar {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.bar-segment.seg-kept, .legend-swatch.seg-kept {
  background: #10B981;
}

.bar-segment.seg-progress, .legend-swatch.seg-progress {
  background: #3B82F6;
}

.bar-segment.seg-broken, .legend-swatch.seg-broken {
  background: #EF4444;
}

.bar-segment.seg-undecided, .legend-swatch.seg-undecided {
  background: #F59E0B;
}

.stacked-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 0.78rem;
  color: var(--ink-dim);
}

.legend-col {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* Mission Intro Section */
.mission-intro-section {
  margin: 32px 0 44px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mission-problem-text {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

.mission-pillars-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mission-pillar-card {
  background: var(--surface-alt);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pillar-kicker {
  font-size: 0.7rem;
  color: var(--blue);
  letter-spacing: 0.05em;
  font-weight: 700;
}

.mission-pillar-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.mission-pillar-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Source Tier Pill */
.source-tier-pill {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.source-tier-official {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.source-tier-news {
  background: rgba(59, 130, 246, 0.12);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.source-tier-reference {
  background: rgba(245, 158, 11, 0.12);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Table Pagination Row */
.table-pagination-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 24px 0 12px;
}

.btn-pagination-action {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-show-more {
  background: var(--blue);
  color: #030712;
  border: 1px solid var(--blue);
}

.btn-show-more:hover {
  background: #38BDF8;
}

.btn-show-all {
  background: var(--surface-alt);
  color: var(--ink-dim);
  border: 1px solid var(--line);
}

.btn-show-all:hover {
  background: var(--surface-raised);
  color: var(--ink);
  border-color: var(--ink-dim);
}

.pagination-sub {
  font-size: 0.75rem;
  opacity: 0.85;
}

.hidden-page-row,
.data-table tbody tr.promise-row.hidden-page-row {
  display: none !important;
}

/* Stable ID & Rank wrappers */
.id-cell-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rank-num {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue);
}

.stable-id {
  font-size: 0.72rem;
  color: var(--muted);
}

.btn-domain-pill.active {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue);
  font-weight: 700;
}

/* Visibility Utilities */
.mobile-only {
  display: none !important;
}

@media (max-width: 540px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: inline !important;
  }
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN & MOBILE ADAPTATION
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .pipeline-6stages-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stage-card.span-4,
  .stage-card.span-7,
  .stage-card.span-5,
  .stage-card.span-12 {
    grid-column: span 2;
  }
  .pipeline-footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hero-split-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .mission-pillars-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .filters-dropdowns-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Layout Spacing */
  .wrap {
    padding: 0 16px;
  }

  /* Header & Hero */
  .hero h1 {
    font-size: clamp(2rem, 7vw, 2.6rem);
  }

  /* Showcase Tabs & Card */
  .showcase-tabs-bar {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    gap: 10px;
  }
  .showcase-tabs-bar::-webkit-scrollbar {
    display: none;
  }
  .showcase-tab-btn {
    flex: 0 0 250px;
    scroll-snap-align: start;
    min-height: 54px;
    padding: 10px 12px;
  }
  .showcase-card {
    padding: 20px 16px;
  }
  .showcase-meta-grid {
    grid-template-columns: 1fr 1fr;
    padding: 10px 12px;
    gap: 10px;
  }
  .showcase-evidence-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .btn-inspect-modal {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* Pipeline Interactive Section */
  .pipeline-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .run-select-label {
    display: none;
  }
  .run-select {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0.5rem 2.5rem 0.5rem 0.875rem !important;
    font-size: 0.88rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  .pipeline-btn-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .btn-primary-contextual {
    flex: 3 !important; /* ~75-80% width */
    min-height: 44px !important;
    justify-content: center !important;
    font-size: 0.92rem !important;
  }
  .btn-pipeline-reset-compact {
    flex: 1 !important; /* ~20-25% width */
    min-height: 44px !important;
    justify-content: center !important;
    font-size: 0.88rem !important;
    padding: 8px 10px !important;
  }
  .pipeline-actions-row .btn-play-action {
    min-height: 44px;
    justify-content: center;
  }
  .packet-transit-card {
    padding: 14px 16px;
  }
  .pipeline-6stages-grid {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }
  .stage-card {
    padding: 16px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .stage-card.span-4,
  .stage-card.span-7,
  .stage-card.span-5,
  .stage-card.span-12 {
    grid-column: span 1;
  }
  .advocates-split-grid {
    grid-template-columns: 1fr;
  }
  .isolation-divider-center {
    flex-direction: row;
    padding: 12px 0;
    gap: 12px;
    justify-content: center;
  }
  .divider-glow-line {
    width: 44px;
    height: 2px;
    background: linear-gradient(to right, transparent, #F59E0B, transparent);
  }
  .arbitrator-check-rows {
    gap: 10px;
  }

  /* Filters Bar */
  .filters-bar {
    padding: 14px;
  }

  /* Data Table -> Mobile Cards Transformation */
  .data-table-container {
    background: transparent;
    border: none;
    overflow-x: hidden;
  }

  .data-table {
    min-width: 0 !important;
    width: 100% !important;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table th,
  .data-table td,
  .data-table tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .data-table thead {
    display: none;
  }

  /* 4-Column CSS Grid Mobile Card Layout: Single-Source Semantic DOM */
  .data-table tbody tr.promise-row {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "speaker verdict"
      "quote quote"
      "timeline timeline" !important;
    row-gap: 6px;
    column-gap: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    width: 100% !important;
    cursor: pointer;
    transition: border-color 0.15s ease;
  }

  .data-table tbody tr.promise-row:hover,
  .data-table tbody tr.promise-row:focus-visible {
    border-color: var(--blue);
  }

  .data-table tbody tr.promise-row td {
    padding: 0 !important;
    border: none !important;
    min-width: 0;
  }

  /* Grid area: Speaker */
  .data-table tbody tr.promise-row td.table-entity-cell {
    grid-area: speaker !important;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .data-table tbody tr.promise-row .table-entity-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
  }

  .data-table tbody tr.promise-row .table-role-tag {
    font-size: 0.74rem;
    color: var(--blue);
  }

  .data-table tbody tr.promise-row .entity-geo-tag {
    font-size: 0.70rem;
    color: var(--muted);
  }

  /* Grid area: Verdict Chip */
  .data-table tbody tr.promise-row td.table-verdict-cell {
    grid-area: verdict !important;
    justify-self: end;
    align-self: flex-start;
  }

  /* Grid area: Quote & Outcome */
  .data-table tbody tr.promise-row td.table-quote-cell {
    grid-area: quote !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 1px;
  }

  .data-table tbody tr.promise-row .table-promise-block {
    margin: 0;
  }

  .data-table tbody tr.promise-row .table-quote-text {
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--ink);
    margin: 0;
  }

  .data-table tbody tr.promise-row .table-outcome-block {
    font-size: 0.78rem;
    line-height: 1.32;
    color: var(--ink-dim);
  }

  .data-table tbody tr.promise-row .table-outcome-kicker {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 700;
    margin-right: 4px;
  }

  /* Grid area: Timeline */
  .data-table tbody tr.promise-row td.table-timeline-cell {
    grid-area: timeline !important;
    font-size: 0.74rem;
    color: var(--muted);
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding-top: 5px !important;
    border-top: 1px solid var(--line-soft) !important;
    margin-top: 2px;
  }

  .data-table tbody tr.promise-row td.table-timeline-cell .timeline-row {
    display: inline-flex;
    gap: 3px;
  }

  .data-table tbody tr.promise-row td.table-timeline-cell .table-card-action {
    display: inline-flex !important;
    align-items: center;
    color: var(--blue, #3B82F6);
    font-weight: 600;
    font-size: 0.74rem;
    margin-left: auto;
  }

  /* Quarantine Registry Mobile Cards */
  #quarantine-table-container .data-table tbody tr {
    background: var(--surface);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  }

  #quarantine-table-container .data-table tbody tr td {
    padding: 0;
    border: none;
    white-space: normal !important;
  }
}

@media (max-width: 640px) {
  /* Topbar compact */
  .topbar {
    padding: 0 12px;
    height: 52px;
  }
  .topbar-left {
    gap: 8px;
  }
  .github-link {
    padding: 6px;
    border-radius: 50%;
    min-width: 32px;
    min-height: 32px;
    justify-content: center;
  }
  .github-link .github-link-text {
    display: none;
  }
  /* Tally Stat Grid on Mobile */
  .tally-card {
    padding: 16px;
  }

  .tally-hero-line {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .tally-hero-line .tally-sep {
    display: none !important;
  }

  .tally-item {
    background: var(--line-soft);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
  }

  .tally-item.total {
    grid-column: span 2;
    justify-content: center;
    font-size: 0.95rem;
    background: var(--surface-alt);
    border-color: var(--blue);
  }

  /* Filter dropdowns 1-column on small screens */
  .filters-dropdowns-row {
    grid-template-columns: 1fr;
  }

  /* Full Screen / Bottom Sheet Modal on Mobile */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-dialog-large {
    width: 100%;
    max-width: 100%;
    height: 92vh;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
  }

  .modal-header-bar {
    padding: 16px 20px;
  }

  .modal-close-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
  }

  .modal-scrollable-body {
    padding: 18px 16px;
    gap: 16px;
  }

  .inspection-bundle-box {
    padding: 14px;
  }

  .two-col-plain {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .showcase-meta-grid {
    grid-template-columns: 1fr;
  }
}





/* ==========================================================================
   STREAMLINED 7-SECTION LAYOUT, MOBILE CARDS, & 4-COLUMN DESKTOP TABLE
   ========================================================================== */

/* Sticky Navigation Bar */
.topbar.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 26, 38, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
}

.topbar-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--blue);
  color: #071120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.desktop-only {
  display: inline-flex;
}

@media (min-width: 768px) {
  .mobile-only,
  .mobile-nav-drawer {
    display: none !important;
  }
}

.nav-link {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  transition: color 0.15s ease;
  white-space: nowrap !important;
}

.nav-link:hover, .nav-link:focus {
  color: #fff;
  text-decoration: none;
}

.github-icon-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.github-icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.github-nav-text {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.mobile-menu-toggle {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--blue);
}

.mobile-nav-drawer {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  background: rgba(15, 26, 38, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 99;
  animation: slideDownMenu 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-drawer.hidden {
  display: none !important;
}

@keyframes slideDownMenu {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav-link {
  min-height: 44px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.mobile-nav-link:hover, .mobile-nav-link:active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
  color: #fff;
}

.mobile-nav-link.mobile-nav-github {
  color: var(--blue);
}

.mobile-nav-link.mobile-nav-hf {
  color: #FCD34D;
}

/* SECTION 1: HERO (<25 words on first screen) */
.hero-section {
  padding: 24px 0 16px;
  text-align: left;
}

.hero-headline {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.hero-subline {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 720px;
}

.hero-actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--blue-dark);
  color: #fff;
  border: 1px solid var(--blue);
}

.btn-primary:hover {
  background: #2b619d;
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--surface-alt);
  color: #fff;
  text-decoration: none;
}

/* SECTION 2: VERDICT BAR & LEGEND */
.verdict-bar-section {
  padding: 0 0 24px;
}

.stacked-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.interactive-bar {
  display: flex;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.interactive-bar .bar-segment {
  border: none;
  padding: 0;
  cursor: pointer;
  min-width: 8px;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.interactive-bar .bar-segment:hover {
  opacity: 0.85;
  filter: brightness(1.15);
}

.stacked-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.legend-btn {
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.legend-btn:hover {
  background: var(--surface-alt);
  border-color: var(--blue);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* SECTION HEADINGS */
.section-heading-group {
  margin-bottom: 20px;
}

.section-heading-group h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 600;
  margin: 0 0 6px;
  color: #fff;
}

.section-lead {
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
  max-width: 760px;
}

/* SECTION 4: FEATURED STORIES */
.stories-section {
  padding: 32px 0 24px;
}

.featured-stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.story-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease;
}

.story-card:hover {
  border-color: var(--blue);
}

.story-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.story-card-top .verdict-chip {
  flex-shrink: 0;
}

.story-entity {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.story-title {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: #fff;
  line-height: 1.35;
}

.story-promise-quote {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-dates-row {
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.story-outcome-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.story-outcome-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.story-outcome-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.story-provenance-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.btn-story-evidence {
  white-space: nowrap !important;
  flex-shrink: 0;
  min-height: 38px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-story-evidence:hover {
  background: var(--surface-alt);
  border-color: var(--blue);
  color: #fff;
}

/* Featured Stories Carousel Controls */
.carousel-controls-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding: 4px 0;
  white-space: nowrap;
  flex-wrap: nowrap;
}

@media (max-width: 768px) {
  .carousel-controls-bar {
    display: flex;
    white-space: nowrap;
    flex-wrap: nowrap;
  }
}

.carousel-arrow {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.carousel-arrow:hover {
  background: var(--surface-alt);
  border-color: var(--blue);
  color: #fff;
}

.carousel-dots-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.2);
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: var(--blue);
  border-color: var(--blue);
  transform: scale(1.25);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.carousel-counter {
  font-size: 0.8rem;
  color: var(--muted);
}

/* SECTION 5: EXPLORE & SEARCH */
.explore-section {
  padding: 32px 0 24px;
}

.explore-controls-wrapper {
  margin-bottom: 16px;
}

.search-row-full {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 14px;
}

.search-row-full .search-input {
  width: 100%;
  min-height: 46px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  font-size: 0.95rem;
}

.search-row-full .search-input:focus {
  outline: none;
  border-color: var(--blue);
}

.btn-mobile-filter {
  display: none;
  min-height: 46px;
  min-width: 46px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-filter-badge {
  background: var(--blue-dark);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 700;
}

/* DESKTOP 4-COLUMN TABLE */
.data-table th, .data-table td {
  padding: 14px 16px;
}

.table-entity-cell .entity-headline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-entity-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: #fff;
}

.stable-id-pill {
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.table-entity-role {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 3px;
}

.table-promise-text {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-dim);
}

/* MOBILE PROMISE CARDS LIST (<768px) */
.mobile-promise-cards-list {
  display: none;
}

.mobile-promise-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  min-height: 44px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mobile-promise-card:hover, .mobile-promise-card:focus {
  border-color: var(--blue);
  background: var(--surface-alt);
}

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mobile-card-speaker-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-card-speaker {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.mobile-card-id {
  font-size: 0.8rem;
  color: var(--muted);
}

.mobile-card-quote {
  font-size: 0.92rem;
  color: var(--ink-dim);
  line-height: 1.45;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mobile-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.mobile-card-link {
  color: var(--blue);
  font-weight: 600;
}

.hidden-page-card {
  display: none !important;
}

/* MOBILE FILTER SHEET (<768px) */
.mobile-filter-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
}

.mobile-filter-sheet {
  width: 100%;
  max-height: 85vh;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--line);
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.btn-close-sheet {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-filter-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.sheet-select {
  width: 100%;
  min-height: 44px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  padding: 0 12px;
  font-size: 0.95rem;
}

.sheet-footer {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-sheet-apply {
  flex: 2;
  min-height: 44px;
  background: var(--blue-dark);
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-sheet-reset {
  flex: 1;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

/* SECTION 6: HOW IT'S BUILT */
.how-it-works-section {
  padding: 36px 0 24px;
}

.steps-3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.step-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.step-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.tech-blocks-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.tech-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.tech-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.tech-block h3, .tech-block h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 6px;
}

.tech-block p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.built-heritage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

.built-heritage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.built-heritage-grid h4 {
  font-size: 1.05rem;
  color: #fff;
  margin: 0 0 10px;
}

/* SECTION 7: LIMITS (Collapsible) */
.limits-section {
  padding: 16px 0 32px;
}

.limits-accordion {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.limits-heading {
  padding: 18px 24px;
  font-size: 1.08rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  color: #fff;
  user-select: none;
}

.limits-chevron {
  transition: transform 0.2s ease;
}

.limits-accordion[open] .limits-chevron {
  transform: rotate(180deg);
}

.limits-body {
  padding: 0 24px 24px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}

.limits-body p {
  margin: 16px 0 10px;
}

.limits-body ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* BACK TO TOP */
.back-to-top-row {
  display: flex;
  justify-content: center;
  margin: 24px 0 12px;
}

.btn-back-to-top {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-back-to-top:hover {
  background: var(--surface-alt);
  color: #fff;
  text-decoration: none;
}

/* RESPONSIVE BREAKPOINT (<768px) */
@media (max-width: 768px) {
  #promises-table-container {
    display: block !important;
    overflow-x: hidden !important;
    width: 100% !important;
    margin-top: 10px;
  }

  .mobile-promise-cards-list {
    display: none !important;
  }

  /* Compact mobile section vertical spacing */
  .hero-section {
    padding: 16px 0 10px !important;
  }
  .verdict-bar-section {
    padding: 8px 0 12px !important;
  }
  .stories-section {
    padding: 18px 0 12px !important;
  }
  .stories-section .section-heading-group {
    margin-bottom: 12px !important;
  }
  .explore-section {
    padding: 18px 0 12px !important;
  }
  .explore-section .section-heading-group {
    margin-bottom: 12px !important;
  }
  .tabs-container {
    margin-bottom: 10px !important;
  }
  .explore-primary-controls {
    gap: 8px !important;
    margin-bottom: 8px !important;
  }
  .explore-status-line {
    margin: 6px 0 !important;
    padding: 4px 0 !important;
  }
  .watch-section {
    padding: 18px 0 12px !important;
  }
  .watch-section .section-heading-group {
    margin-bottom: 12px !important;
  }
  .how-it-works-section {
    padding: 18px 0 12px !important;
  }
  .how-it-works-section .section-heading-group {
    margin-bottom: 12px !important;
  }
  .steps-3-grid {
    gap: 8px !important;
    margin-top: 10px !important;
  }
  .step-card {
    padding: 12px 14px !important;
  }
  .step-title {
    font-size: 0.98rem !important;
    margin-bottom: 3px !important;
  }
  .step-desc {
    font-size: 0.84rem !important;
    line-height: 1.35 !important;
  }
  .origin-card {
    padding: 14px 16px !important;
    margin-top: 10px !important;
  }
  .origin-title {
    font-size: 1.05rem !important;
    margin-bottom: 4px !important;
  }
  .origin-text {
    font-size: 0.86rem !important;
    line-height: 1.38 !important;
  }
  .credits-accordion {
    margin-top: 8px !important;
  }

  .desktop-filters-panel {
    display: none !important;
  }

  .btn-mobile-filter {
    display: inline-flex !important;
  }

  .hero-section {
    padding: 18px 0 12px;
  }

  .hero-headline {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .topbar {
    padding: 0 16px !important;
    height: 56px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .topbar-bar-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 56px !important;
  }

  .brand {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .brand-mark {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
    flex-shrink: 0 !important;
  }

  .brand-text {
    display: inline !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    white-space: nowrap !important;
  }

  .desktop-nav {
    display: none !important;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .featured-stories-grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding: 6px 4px 14px 4px;
    -webkit-overflow-scrolling: touch;
  }

  .featured-stories-grid .story-card {
    flex: 0 0 85%;
    max-width: 320px;
    scroll-snap-align: start;
  }

  .mobile-card-tap-hint {
    color: var(--blue);
    font-size: 0.8rem;
    font-weight: 600;
  }
}

/* ==========================================================================
   ENHANCED UX, DETAIL DRAWER & REPLAY STYLES (Follow-up Brief)
   ========================================================================== */

/* Utility & Color Palette (P0/P1) */
.hidden {
  display: none !important;
}

:root {
  --verdict-kept: #10B981;
  --verdict-progress: #3B82F6;
  --verdict-broken: #EF4444;
  --verdict-undecided: #64748B;
  --verdict-quarantined: #F59E0B;
}

/* Primary Explore Controls Row */
.explore-primary-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 16px 0 12px;
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 260px;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input-wrapper .search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  transition: border-color 0.2s ease;
}

.search-input-wrapper .search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Segmented Verdict Filter Control */
.segmented-verdict-control {
  display: inline-flex;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.btn-seg-verdict {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  min-height: 40px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-seg-verdict:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.btn-seg-verdict.active {
  background: var(--surface-light);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-seg-verdict[data-verdict="kept"].active {
  color: var(--verdict-kept);
}

.btn-seg-verdict[data-verdict="in_progress"].active {
  color: var(--verdict-progress);
}

.btn-seg-verdict[data-verdict="broken"].active {
  color: var(--verdict-broken);
}

.btn-seg-verdict[data-verdict="undecided"].active {
  color: var(--verdict-undecided);
}

.btn-more-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-dim);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-more-filters:hover {
  background: var(--surface-light);
  color: var(--ink);
  border-color: var(--line-soft);
}

.more-filters-badge {
  background: var(--blue);
  color: #ffffff;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 10px;
}

/* More Filters Sheet / Panel */
.more-filters-panel {
  background: var(--surface-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  animation: fadeIn 0.2s ease-out;
}

.more-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.filter-rank-explainer {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

/* Explore Status Line */
.explore-status-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink-dim);
  margin: 10px 0 16px;
  padding: 0 4px;
}

.explore-status-line .status-sep {
  color: var(--line-soft);
}

.btn-clear-filters {
  background: transparent;
  border: none;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: 0.88rem;
}

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

/* Quarantine Header Status */
.quarantine-header-status {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0 16px;
}

.quarantine-header-line {
  margin: 0;
  color: #FCD34D;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Quarantine Diff & Content Elements */
.quarantine-badge-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quarantine-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: fit-content;
}

.quarantine-type-badge.test-case {
  background: rgba(245, 158, 11, 0.18);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.quarantine-type-badge.rejected-candidate {
  background: rgba(148, 163, 184, 0.15);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.quarantine-diff-row {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.quarantine-diff-row .diff-label {
  color: var(--muted);
  margin-right: 4px;
}

.quarantine-diff-row .diff-orig {
  color: #F87171;
  text-decoration: line-through;
}

.quarantine-diff-row .diff-alt {
  color: #34D399;
  font-weight: 700;
}

.quarantine-check-plain {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.quarantine-check-code {
  font-size: 0.74rem;
  color: var(--muted);
}

.quarantine-reason-text {
  font-size: 0.84rem;
  line-height: 1.45;
  color: #ffdfba;
  margin: 0 0 4px;
}

.quarantine-catcher-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.quarantine-outcome-status {
  font-size: 0.82rem;
  color: #FBBF24;
  font-weight: 600;
}

.quarantine-hash-row {
  font-size: 0.74rem;
  margin-top: 4px;
  color: var(--muted);
}

/* Unified Quarantine Cards List */
.quarantine-cards-container {
  margin-top: 14px;
}

.quarantine-cards-list,
.mobile-quarantine-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.quarantine-card,
.mobile-quarantine-card {
  background: var(--surface);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.quarantine-card:focus-visible,
.mobile-quarantine-card:focus-visible {
  outline: 2px solid var(--orange);
}

.quarantine-card-header,
.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.quarantine-card-footer,
.mobile-card-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.quarantine-claim-quote {
  font-size: 0.94rem;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
  font-style: italic;
}

.quarantine-check-block {
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: 6px;
  border-left: 3px solid var(--orange);
}

/* Pagination Buttons */
.pagination-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin: 28px 0;
  flex-wrap: wrap;
}

.btn-pagination-primary {
  min-height: 44px;
  padding: 0 24px;
  background: var(--blue);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-pagination-primary:hover {
  background: #2563EB;
}

.btn-pagination-tertiary {
  min-height: 44px;
  padding: 0 20px;
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pagination-tertiary:hover {
  background: var(--surface-light);
  color: var(--ink);
  border-color: var(--line-soft);
}

/* ==========================================================================
   4-PART DETAIL DRAWER (Desktop slide-over & Mobile bottom sheet)
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease-out;
}

.drawer-backdrop.hidden {
  display: none !important;
}

.drawer-panel {
  background: var(--bg-surface);
  color: var(--ink);
  width: min(640px, 100vw);
  height: 100%;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideUpBottom {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface-light);
}

.drawer-header-titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  line-height: 1.25;
}

.drawer-badges-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}

.drawer-id-badge {
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.drawer-horizon-badge {
  font-size: 0.74rem;
  background: rgba(168, 85, 247, 0.18);
  color: #C084FC;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.drawer-close-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-section-heading {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-section-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.drawer-field-label {
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.drawer-promise-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.drawer-quote {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  font-style: italic;
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.drawer-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-meta-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.drawer-meta-val {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 500;
}

.drawer-source-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-source-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
}

.drawer-source-link {
  color: var(--blue);
  text-decoration: underline;
  word-break: break-all;
}

.drawer-hash {
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
}

.drawer-media-box {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.drawer-media-header {
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
}

.drawer-media-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

.drawer-media-caption {
  padding: 8px 12px;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
  background: var(--surface);
}

.drawer-verdict-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-verdict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-decided-by {
  font-size: 0.78rem;
  color: var(--muted);
}

.drawer-plain-reason {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  font-weight: 500;
}

.drawer-outcome-quote-box {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--line-soft);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
}

.drawer-outcome-quote {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-dim);
  margin: 0;
  font-style: italic;
}

/* Advocates 2-column grid */
.drawer-advocates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .drawer-advocates-grid {
    grid-template-columns: 1fr;
  }
}

.drawer-adv-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-adv-col.kept-adv {
  border-top: 3px solid var(--kept);
}

.drawer-adv-col.broken-adv {
  border-top: 3px solid var(--red);
}

.drawer-adv-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-adv-body {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-dim);
}

/* Evidence items in Drawer Section 3 */
.drawer-evidence-item {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.drawer-evidence-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.drawer-evidence-quote {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 6px 0;
  font-style: italic;
}

.drawer-evidence-source {
  font-size: 0.72rem;
}

.drawer-evidence-domain-link {
  color: var(--blue, #38BDF8);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.drawer-evidence-domain-link:hover {
  text-decoration: underline;
}

/* Drawer Accordion for Checks */
.drawer-checks-accordion {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.drawer-checks-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.15);
  user-select: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.15s ease;
}

.drawer-checks-summary:hover {
  background: rgba(0, 0, 0, 0.25);
}

.checks-summary-icon {
  color: #10B981;
  font-weight: 700;
  font-size: 0.9rem;
}

.checks-summary-label {
  flex: 1;
}

.checks-summary-toggle {
  font-size: 0.76rem;
  color: var(--muted);
}

.drawer-checks-accordion .drawer-checks-list {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.table-card-action {
  display: none;
}

/* Arbitrator checks list in drawer */
.drawer-checks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checks-summary-banner {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checks-summary-banner.pass {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.checks-summary-banner.fail {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.contradiction-adjudication-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.contradiction-adjudication-box h4 {
  margin: 0 0 4px 0;
  font-size: 0.82rem;
  color: #F59E0B;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contradiction-adjudication-box p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.45;
}

.drawer-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.82rem;
}

.drawer-check-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.drawer-check-badge.pass {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.drawer-check-badge.fail {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
}

.drawer-check-desc {
  flex: 1;
  color: var(--ink-dim);
}

.drawer-relevance-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.drawer-rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.drawer-rel-item {
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-rel-name {
  font-size: 0.76rem;
  color: var(--muted);
}

.drawer-rel-score {
  font-size: 0.8rem;
  color: #38BDF8;
  font-weight: 700;
  white-space: nowrap !important;
}

.drawer-changelog-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
}

.drawer-receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.drawer-changelog-entry {
  font-size: 0.74rem;
  color: var(--muted);
  word-break: break-all;
}

/* Mobile Drawer Bottom Sheet (<768px) */
@media (max-width: 767px) {
  .drawer-panel {
    width: 100vw !important;
    height: 88vh !important;
    max-height: 88vh !important;
    background: #121f2d !important;
    border-radius: 16px 16px 0 0 !important;
    animation: slideUpBottom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .drawer-backdrop {
    align-items: flex-end !important;
  }

  .drawer-header {
    position: sticky !important;
    top: 0 !important;
    background: #182838 !important;
    z-index: 20 !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 12px 16px !important;
  }

  .drawer-title {
    font-size: 1.15rem !important;
    line-height: 1.25 !important;
    margin: 2px 0 4px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Replay Active CSS Grid Stack Layout (Zero Layout Shift) */
.active-stage-panel-wrapper {
  margin-top: 16px;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr !important;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.pipeline-progress-bar-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  z-index: 10;
  pointer-events: none;
}

.pipeline-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--blue, #3B82F6);
  transition: width 1800ms linear;
}

.active-stage-panel-wrapper .stage-card {
  grid-area: 1 / 1 !important;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.active-stage-panel-wrapper .stage-card.inactive-stage {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(4px);
  pointer-events: none !important;
  z-index: 1;
}

.active-stage-panel-wrapper .stage-card.active-stage {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0);
  pointer-events: auto !important;
  z-index: 2;
}

@media (max-width: 640px) {
  .active-stage-panel-wrapper .stage-card {
    padding: 18px;
  }
}

.stage-desc {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 12px 0 0;
}

.stage-quote {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #fff;
  margin: 12px 0 0;
  font-style: italic;
  border-left: 3px solid var(--blue);
  padding-left: 12px;
}

.pipeline-btn-group .btn-play-action {
  white-space: nowrap !important;
  min-width: 96px;
  justify-content: center;
  text-align: center;
}

.packet-transit-header {
  white-space: nowrap !important;
}

.packet-label,
.packet-status-text {
  white-space: nowrap !important;
}

.milestone-label-clickable {
  cursor: pointer;
  transition: color 0.15s ease;
}

.milestone-label-clickable:hover {
  color: #fff;
}

.milestone-node {
  cursor: pointer;
}

.milestone-node:hover .milestone-circle {
  border-color: var(--blue);
  transform: scale(1.08);
}

/* Project Origin & Purpose Card */
.origin-card {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.origin-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 8px;
}

.origin-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}

.origin-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0;
}

.origin-text strong {
  color: #fff;
}

/* Scannable 3-Line Footer */
.app-footer {
  border-top: 1px solid var(--line);
  padding: 28px 16px 36px;
  margin-top: 48px;
  text-align: center;
}

/* =========================================================================
   EXPLORE MULTI-VIEW PANEL & SWITCHER (Table | Map | Entities | Audit)
   ========================================================================= */
.view-mode-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  max-width: 100%;
}

.explore-view-panel.hidden {
  display: none !important;
}

.explore-view-panel {
  margin-top: 16px;
  margin-bottom: 24px;
}

.map-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sf-svg-map-card,
.district-coverage-card,
.audit-panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  min-width: 0;
}

.map-card-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.map-card-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: #fff;
}

.map-card-sub,
.audit-panel-sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--ink-dim);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pin-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.pin-dot.kept { background: #10B981; }
.pin-dot.broken { background: #EF4444; }
.pin-dot.in_progress { background: #F59E0B; }

.pin-ring {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px dashed #94A3B8;
  display: inline-block;
}

.sf-svg-canvas-wrap {
  width: 100%;
  overflow: hidden;
}

.sf-svg-map {
  width: 100%;
  height: auto;
  display: block;
}

.map-regional-strip {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.btn-regional-pin {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--ink);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  cursor: pointer;
}

.map-selected-card {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-selected-card.hidden {
  display: none;
}

.map-selected-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.map-selected-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.map-selected-outcome {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--ink-dim);
  line-height: 1.45;
}

.btn-map-inspect {
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.district-bars-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.district-bar-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
}

.district-code {
  color: #fff;
  font-weight: 600;
}

.district-bar-track {
  height: 9px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}

.district-bar-fill {
  height: 100%;
  background: var(--cyan);
  border-radius: 99px;
}

.district-bar-fill.gap {
  background: rgba(239, 68, 68, 0.35);
}

.district-bar-counts {
  color: var(--muted);
  white-space: nowrap;
}

.district-citywide-note {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--muted);
}

.entities-header-note {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.86rem;
  color: var(--ink-dim);
  line-height: 1.45;
}

.entities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.entity-profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.entity-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.entity-card-name {
  margin: 0 0 2px;
  font-size: 0.96rem;
  color: #fff;
}

.entity-card-cat {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}

.caution-badge-n1 {
  background: rgba(245, 158, 11, 0.14);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 0.7rem;
  white-space: nowrap;
}

.entity-count-pill {
  background: rgba(59, 130, 246, 0.14);
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 0.7rem;
  white-space: nowrap;
}

.entity-stacked-bar {
  height: 7px;
  width: 100%;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  background: rgba(255, 255, 255, 0.08);
}

.entity-verdict-summary {
  font-size: 0.74rem;
  color: var(--muted);
}

.entity-item-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-entity-promise-link {
  display: flex;
  gap: 8px;
  align-items: baseline;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink-dim);
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-entity-promise-link:hover {
  border-color: var(--cyan);
  color: #fff;
}

.audit-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.audit-kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.audit-kpi-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.audit-kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.audit-kpi-sub {
  font-size: 0.78rem;
  color: var(--ink-dim);
  line-height: 1.35;
}

.audit-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pillar-matrix-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
}

.pillar-matrix-row.gap-row .pillar-name {
  color: #FCA5A5;
}

.pillar-counts {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.audit-queue-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  margin-top: 8px;
  cursor: pointer;
}

.audit-queue-item:hover {
  border-color: var(--cyan);
}

.queue-priority-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.16);
  color: #FBBF24;
  white-space: nowrap;
}

.queue-item-head {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.queue-item-reason {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.contradiction-adjudication-box p + p {
  margin-top: 6px;
}

@media (max-width: 900px) {
  .map-layout-grid,
  .audit-two-col {
    grid-template-columns: 1fr;
  }
  .audit-kpis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .view-mode-switcher {
    width: 100%;
    justify-content: space-between;
  }
  .view-mode-switcher .btn-view-mode {
    flex: 1 1 auto;
    padding: 6px 8px;
    font-size: 0.72rem;
    text-align: center;
  }
  .audit-kpis-grid {
    grid-template-columns: 1fr;
  }
  .entities-grid {
    grid-template-columns: 1fr;
  }
  .district-bar-row {
    grid-template-columns: 30px 1fr auto;
    font-size: 0.7rem;
  }
}

.footer-scannable-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 600px;
  margin: 0 auto;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-line-brand strong {
  color: #fff;
}

.footer-line-date {
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-line-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-line-links a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.footer-line-links a:hover {
  text-decoration: underline;
  color: #fff;
}

.footer-dot {
  color: var(--line);
}

/* SECTION: VISUALIZATIONS — charts computed from the exported snapshot */
.viz-section {
  padding: 32px 0 24px;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.viz-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 18px 20px;
  min-width: 0;
}

.viz-card-wide {
  grid-column: 1 / -1;
}

.viz-card-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 2px;
  color: #fff;
}

.viz-card-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 14px;
}

.viz-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.viz-bar-row {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  align-items: center;
  gap: 10px;
}

.viz-bar-label {
  font-size: 0.88rem;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viz-bar-track {
  display: block;
  height: 14px;
  background: var(--blue-soft);
  border-radius: 4px;
  overflow: hidden;
}

.viz-bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
}

.viz-bar-count {
  font-size: 0.82rem;
  color: var(--ink);
  white-space: nowrap;
}

.viz-bar-pct {
  color: var(--muted);
}

#viz-timeline svg {
  display: block;
  width: 100%;
  height: auto;
}

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.viz-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.viz-empty {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

@media (max-width: 720px) {
  .viz-grid {
    grid-template-columns: 1fr;
  }

  .viz-bar-row {
    grid-template-columns: 110px 1fr auto;
    gap: 8px;
  }
}
