/* ==========================================================================
   Data Center Policy Tracker — styles.css
   ==========================================================================
   Color tokens live on :root + [data-theme="dark"]. Per CLAUDE.md, never
   hard-code colors elsewhere — read CSS vars via getComputedStyle in JS.
   ========================================================================== */

/* Civic-record palette (v2): cool paper, near-black ink, one deep signal blue.
   Deliberately NOT the warm cream the source page uses — a warm-cream-and-gold
   editorial look reads as a consumer AI product, and this is a public record.
   Cool paper reads as a registry or an investigative newsroom, which is what
   the site actually is. The pledge's STRUCTURE is what we borrowed (Roman
   numeral commitments, letterspaced kickers, big display serif); the colour is
   ours.

   Every value below is a literal in BOTH this block and the dark block
   (DESIGN.md 12.12: a `var()` alias in :root only computes on :root and does
   NOT propagate the dark override to descendants). */
:root {
  /* v3 civic palette, taken from whitehouse.gov's own presets (extracted from
     the live site 2026-08-03): white paper, charcoal ink (#293340), deep navy
     (#0D132D / #151A30 / #141F4D), signal red (#B50000), amber (#FFBD00 —
     10.9:1 on the navy band, 1.7:1 on white, so it is a MARK color on light
     surfaces and a text color only on the band), stone (#E8E6E0) and
     pale-gray (#D9DEE8). Every text pairing below was contrast-computed
     before landing; see the commit message for the table. */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --text: #293340;
  --text-muted: #5a6572;
  --border: #d9dee8;
  --border-strong: #8a8a8a;
  --accent: #141f4d;
  --accent-soft: #e3e7f2;
  /* Deliberately NOT --accent's navy: navy-on-white text and this navy link
     color compute to ~1.23:1 contrast against each other, so a link with no
     other visual cue (many use text-decoration: none at rest, underline only
     on :hover) reads as indistinguishable body copy. #2563eb keeps AA against
     white (5.17:1) while roughly doubling the link/text separation (~2.48:1)
     — the practical ceiling given how dark --text already is; 3:1 would need
     --text itself to lighten, out of scope here. */
  --link: #2563eb;

  /* ONE structural accent (2026-08-24, user-directed): the deep navy that
     links, the tab underline and tile rules already used. The old separate
     red mark/rule pair made the chrome read as alarm; whitehouse.gov red
     survives only where color carries a data meaning — the
     failed/rejected/negative status tokens. */

  /* The inked band — the dark section the commitments render on. Deliberately
     dark in BOTH themes (it is a figure, not a surface), so its own foreground
     tokens travel with it rather than inheriting the page theme. */
  --band-bg: #0d132d;
  --band-text: #ffffff;
  --band-text-muted: #abb4c4;
  --band-accent: #ffbd00;
  --band-hairline: rgba(255, 255, 255, 0.18);

  --hairline: rgba(41, 51, 64, 0.16);

  /* Per-stance colors (community responses) */
  --stance-positive: #25663f;
  --stance-positive-soft: #d8eadd;
  --stance-mixed: #8a5410;
  --stance-mixed-soft: #f0e2c9;
  --stance-negative: #a3372f;
  --stance-negative-soft: #f0d4d1;

  /* Delivered-vs-promised palette (v1.13). Mirrors stance hues so that
     "delivered ↔ positive", "shortfall ↔ negative", "partial / contested ↔
     mixed" read consistently across the dashboard. */
  --delivered-delivered: #25663f;
  --delivered-delivered-soft: #e2f0e7;
  --delivered-partial: #46657a;
  --delivered-partial-soft: #e0e8ee;
  --delivered-contested: #8a5410;
  --delivered-contested-soft: #f0e2c9;
  --delivered-shortfall: #a3372f;
  --delivered-shortfall-soft: #f0d4d1;

  /* Ratepayer Protection Pledge palette (v1.15). affirmed ↔ delivered green,
     pledge_only ↔ neutral blue-grey, contested ↔ amber — consistent with the
     delivered/stance signal language. */
  --ratepayer-affirmed: #25663f;
  --ratepayer-affirmed-soft: #e2f0e7;
  --ratepayer-pledge_only: #46657a;
  --ratepayer-pledge_only-soft: #e0e8ee;
  --ratepayer-contested: #8a5410;
  --ratepayer-contested-soft: #f0e2c9;

  /* Tariff status + coverage colors (v1.17). Light values here; dark overrides
     in the [data-theme="dark"] block below — same pattern as --stance /
     --delivered (DESIGN.md: colors live in tokens with dark-mode overrides, not
     hard-coded per rule). approved↔positive, proposed↔mixed, rejected↔negative;
     included↔positive, partial↔mixed. */
  --tariff-approved: #25663f;
  --tariff-approved-soft: #d8eadd;
  --tariff-proposed: #8a5410;
  --tariff-proposed-soft: #f0e2c9;
  --tariff-rejected: #a3372f;
  --tariff-rejected-soft: #f0d4d1;
  --tariff-included: #25663f;
  --tariff-included-soft: #d8eadd;
  --tariff-partial: #8a5410;
  --tariff-partial-soft: #f0e2c9;
  --tariff-federal: #2f5d8a;
  --tariff-federal-soft: #f1f0ea;

  /* Moratorium status — three-state hue language shared with tariffs/stance:
     enacted↔in-effect (green), proposed↔pending (amber), failed↔struck (red).
     Literal values in BOTH :root blocks per DESIGN.md 12.12 (a var() alias in
     :root only won't inherit the dark override to descendants). */
  --moratorium-enacted: #25663f;
  --moratorium-enacted-soft: #d8eadd;
  --moratorium-proposed: #8a5410;
  --moratorium-proposed-soft: #f0e2c9;
  --moratorium-failed: #a3372f;
  --moratorium-failed-soft: #f0d4d1;
  --moratorium-lifted: #4b5563;
  --moratorium-lifted-soft: #e5e7eb;

  /* Per-company subtle accent (NOT brand colors — neutral palette so we
     don't imply endorsement). Used for left borders / chips, not fills. */
  --co-meta: #4a6b8e;
  --co-google: #7a6233;
  --co-microsoft: #3d6b50;
  --co-amazon: #8a5a2c;
  --co-openai: #4a4a4a;
  --co-anthropic: #8e6a4a;
  --co-xai: #2c2c2c;
  --co-oracle: #6b3838;
  --co-wonder-valley: #6b4a8e;
  --co-qts: #2f6e7a;
  --co-crusoe: #8e6b4a;
  --co-coreweave: #5b4a8e;
  --co-prologis: #7a5a3a;
  --co-nscale: #4a5d7a;
  --co-segro: #6b5a7a;
  --co-goodman: #5a7a5f;
  --co-softbank-corp: #5a6a8a;
  --co-nextdc: #6a5a4a;
  --co-xtx-markets: #4a6a6a;
  --co-naver: #3a7a4a;
  --co-mitsui-fudosan: #6a4a7a;
  --co-colt-dcs: #4a7a8a;
  --co-sesterce: #8a5a3a;
  --co-kakao: #8a7a1a;
  --co-lg-uplus: #a02a5a;
  --co-ecodatacenter: #2a7a5a;
  --co-cloudhq: #3a5a9a;
  --co-pampa-energia: #9a5a2a;
  --co-adaniconnex: #3a6a8a;
  --co-reliance: #7a4a5a;
  --co-nxtra: #8a6a3a;
  --co-sb-energy: #8e4a6b;
  --co-brookfield: #5a6b3a;

  /* Per-theme accent (used as left border on theme chips + matrix headers) */
  --theme-jobs: #2f5d8a;
  --theme-tax_revenue: #6b4a8a;
  --theme-energy: #8a6a2f;
  --theme-water: #2f7a8a;
  --theme-community_grants: #25663f;
  --theme-infrastructure: #5b6471;
  --theme-education: #8a4a5b;
  --theme-engagement: #4a8a6b;

  /* Exactly TWO families (2026-08-24, user-directed): one sans for body, UI
     and labels; one serif for the masthead, headings and display numbers.
     The old third (mono, for kickers/dates/counts) and fourth (a separate
     display serif) read as four competing voices on one page. whitehouse.gov
     names Instrument first; naming it costs nothing (it engages when locally
     installed) and the stacks fall back to system faces — still no web
     fonts, per the perf budget. */
  --font-sans:
    "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-serif:
    "Instrument Serif", Georgia, "Iowan Old Style", "Palatino Linotype",
    Palatino, "Book Antiqua", "Times New Roman", serif;

  /* Type scale (2026-09-23). Every font-size in this sheet is one of these;
     a new size is a design decision, not a styling one. */
  --fs-2xs: 0.6875rem; /* 11px: uppercase labels, pills */
  --fs-xs: 0.75rem; /* 12px: meta, notes, table headers */
  --fs-sm: 0.8125rem; /* 13px: secondary text, card body */
  --fs-base: 0.875rem; /* 14px: tables, lists, body UI */
  --fs-md: 1rem; /* 16px: deks, reading text */
  --fs-lg: 1.125rem; /* 18px: card titles */
  --fs-xl: 1.28rem; /* section headings */
  --fs-2xl: 1.4rem; /* view headings */
  --fs-3xl: 1.55rem; /* masthead, stat numerals */

  /* Spacing scale (2026-10-19): the rhythm every card, section and pill gap
     draws from. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* Civic document: square-cornered hairline boxes, no drop shadows. */
  --radius-sm: 2px;
  --radius: 2px;
  --shadow-sm: none;
  --shadow: 0 4px 16px rgba(17, 21, 28, 0.1);
}

[data-theme="dark"] {
  --bg: #0d132d;
  --surface: #151a30;
  --surface-2: #141f4d;
  --text: #e8e6e0;
  --text-muted: #9aa4b6;
  --border: #2a3450;
  --border-strong: #3e4a6b;
  --accent: #ffbd00;
  --accent-soft: #33290a;
  /* Same fix as the light-mode --link: the previous amber-adjacent value
     (#ffcb33) sits at ~1.22:1 contrast against --text (#e8e6e0) — both are
     light, so a link with no static underline was nearly indistinguishable
     from body copy. #4d84ff keeps AA against --bg (5.2:1) and separates from
     --text at ~2.82:1. */
  --link: #4d84ff;

  /* The band goes darker still in dark mode so it stays a distinct figure
     against the already-dark page rather than blending into it. */
  --band-bg: #070d1f;
  --band-text: #ffffff;
  --band-text-muted: #abb4c4;
  --band-accent: #ffbd00;
  --band-hairline: rgba(255, 255, 255, 0.18);

  --hairline: rgba(232, 230, 224, 0.16);

  --stance-positive: #6cc18a;
  --stance-positive-soft: #1d3a28;
  --stance-mixed: #d6a44c;
  --stance-mixed-soft: #3a2e15;
  --stance-negative: #e07a72;
  --stance-negative-soft: #3a1f1c;

  --delivered-delivered: #6cc18a;
  --delivered-delivered-soft: #1d3a28;
  --delivered-partial: #9bb4cc;
  --delivered-partial-soft: #1f2a36;
  --delivered-contested: #d6a44c;
  --delivered-contested-soft: #3a2e15;
  --delivered-shortfall: #e07a72;
  --delivered-shortfall-soft: #3a1f1c;

  --ratepayer-affirmed: #6cc18a;
  --ratepayer-affirmed-soft: #1d3a28;
  --ratepayer-pledge_only: #9bb4cc;
  --ratepayer-pledge_only-soft: #1f2a36;
  --ratepayer-contested: #d6a44c;
  --ratepayer-contested-soft: #3a2e15;

  /* Tariff status + coverage colors — dark overrides (mirror --stance dark). */
  --tariff-approved: #6cc18a;
  --tariff-approved-soft: #1d3a28;
  --tariff-proposed: #d6a44c;
  --tariff-proposed-soft: #3a2e15;
  --tariff-rejected: #e07a72;
  --tariff-rejected-soft: #3a1f1c;
  --tariff-included: #6cc18a;
  --tariff-included-soft: #1d3a28;
  --tariff-partial: #d6a44c;
  --tariff-partial-soft: #3a2e15;
  --tariff-federal: #7eb6e8;
  --tariff-federal-soft: #1f2630;
  --moratorium-lifted: #a3a8b3;
  --moratorium-lifted-soft: #2a2f3a;

  --co-meta: #7eb6e8;
  --co-google: #d6b86a;
  --co-microsoft: #6cc18a;
  --co-amazon: #d6a060;
  --co-openai: #b8b8b8;
  --co-anthropic: #d6b08a;
  --co-xai: #888888;
  --co-oracle: #d68a8a;
  --co-wonder-valley: #b48ad8;
  --co-qts: #7ec1cf;
  --co-crusoe: #d6b08a;
  --co-coreweave: #a896d8;
  --co-prologis: #c89a6a;
  --co-nscale: #8fa6c8;
  --co-segro: #b29cc8;
  --co-goodman: #9cc8a2;
  --co-softbank-corp: #9aaac8;
  --co-nextdc: #c8b09a;
  --co-xtx-markets: #9ac8c8;
  --co-naver: #8cc89a;
  --co-mitsui-fudosan: #b49ac8;
  --co-colt-dcs: #9ac4d4;
  --co-sesterce: #d4aa8a;
  --co-kakao: #e0d26a;
  --co-lg-uplus: #e08ab0;
  --co-ecodatacenter: #7ad0aa;
  --co-cloudhq: #8aaae0;
  --co-pampa-energia: #e0aa7a;
  --co-adaniconnex: #8ab4d4;
  --co-reliance: #cc9aaa;
  --co-nxtra: #d4b47a;
  --co-sb-energy: #d68ab0;
  --co-brookfield: #a8c47a;

  --theme-jobs: #7eb6e8;
  --theme-tax_revenue: #b48ad8;
  --theme-energy: #d6b86a;
  --theme-water: #7ec1d8;
  --theme-community_grants: #6cc18a;
  --theme-infrastructure: #a3adba;
  --theme-education: #d68aa3;
  --theme-engagement: #8acfb0;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Scale runs DOWN from the masthead: the site title is the biggest type on
   the page (news-masthead convention, and 2026-08-24 user direction — view
   headings must never outrank it). h1 1.5 > h2 1.4 > .acc-title 1.28 > h3 1.2. */
h1 {
  font-size: var(--fs-3xl);
  line-height: 1.2;
}

h2 {
  font-size: var(--fs-2xl);
  line-height: 1.2;
}

h3 {
  font-size: var(--fs-lg);
}

h4 {
  font-size: var(--fs-md);
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-muted);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover,
a:focus-visible {
  text-decoration-thickness: 2px;
}

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
select:focus-visible,
[role="tab"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--text-muted);
  font-style: italic;
}

/* ==========================================================================
   Draft banner — thin strip above the topbar
   ========================================================================== */

/* draft-banner removed v1.16 — last-refresh date moved to topbar sub-heading */

/* ==========================================================================
   Skip link (accessibility)
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

/* In dark mode --accent is amber (#ffbd00) — white text on it is ~1.68:1,
   the failing ratio the palette comment documents for amber-on-white. This
   is the first thing a keyboard/AT user focuses, so it needs real contrast:
   --band-bg is near-black navy, ~10.9:1 on the amber background. */
[data-theme="dark"] .skip-link {
  color: var(--band-bg);
}

/* ==========================================================================
   Topbar
   ========================================================================== */

/* The header is just the title row + tab bar (v2.1): the pledge landing band
   used to live here too, which pushed the tabs below the fold on load. It now
   renders as the "Overview" tab's content inside <main> instead, so the whole
   header is short enough that every tab is reachable without scrolling. The
   tab bar keeps its own sticky wrapper (.tabbar-sticky below) so it stays
   reachable once a tall view (e.g. Overview itself) scrolls past the header. */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px 8px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.topbar-title {
  flex: 1;
  min-width: 0;
}

.topbar-sub {
  margin: 4px 0 0;
  font-size: var(--fs-md);
  color: var(--text-muted);
}

.topbar-controls {
  display: flex;
  gap: 8px;
}

#theme-toggle {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  font-size: var(--fs-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tabbar {
  display: flex;
  gap: 0;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;
}

/* Sticky wrapper so the tab bar survives the hero scrolling past. The
   background lives here rather than on .tabbar because the sticky element must
   be opaque edge-to-edge, not just under the 1280px content column. */
.tabbar-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* ==========================================================================
   Home briefing (v3)
   ==========================================================================
   The site's front door, using the SAME .hero block every other tab opens
   with (2026-08-24: the old oversized display hero + mono kicker made Home
   speak a different language from its own tabs, and outranked the masthead).
   Numbers are rendered from data by renderPledgeHero() — never baked into
   the markup, because the roster is a moving target. */

/* --- stat quartet ------------------------------------------------------- */

/* Same boxed tile language as every other tab's stat row (.rp-stat) —
   Home was the one view with its own open-band, serif-numeral tile style,
   which is exactly the cross-tab inconsistency the 2026-08-24 pass killed. */

/* Stats that deep-link are buttons; the rest are plain <li>. Only the
   interactive ones get affordances. */

/* --- the briefing: what's next beside what changed ---------------------- */

.home-latest {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

/* --- explore the record: one card per tab ------------------------------- */

.home-cards {
  display: grid;
  /* Seven cards, one per tab. Four columns give a 4+3 split instead of a
     lone card on a third row. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 1100px) {
  .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* An odd last card spans the row instead of sitting alone in a column. */
  .home-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .home-cards {
    grid-template-columns: 1fr;
  }
}

.home-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title num" "sub num";
  align-items: center;
  gap: 3px;
  text-align: left;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.home-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.home-card-title {
  grid-area: title;
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  line-height: 1.2;
  color: var(--text);
}


.home-card-num {
  grid-area: num;
  font-family: var(--font-sans);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.home-card-sub {
  grid-area: sub;
  font-size: var(--fs-xs);
  color: var(--text);
  font-weight: 600;
  min-height: 1em;
}

.home-card-title {
  order: -1;
}

@media (max-width: 880px) {
  .home-latest {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-card {
    transition: none;
  }
  .home-card:hover {
    transform: none;
  }
}

.tabbar::-webkit-scrollbar {
  display: none;
}

.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: var(--fs-md);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab:hover {
  color: var(--text);
}

/* ==========================================================================
   Main / hero
   ========================================================================== */

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 32px;
}

.hero {
  margin: 16px 0 24px;
  max-width: 720px;
}

.eyebrow {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text);
  margin: 0 0 6px;
  font-weight: 600;
}

.hero-title {
  margin: 0 0 8px;
}

.hero-dek {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-md);
  line-height: 1.5;
}

/* ==========================================================================
   Theme legend
   ========================================================================== */

/* ==========================================================================
   Comparison matrix
   ========================================================================== */

.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}

.matrix th,
.matrix td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: middle;
}

.matrix th:last-child,
.matrix td:last-child {
  border-right: none;
}

.matrix tbody tr:last-child td {
  border-bottom: none;
}

.matrix thead th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

.matrix .col-company {
  width: 160px;
  font-weight: 600;
  background: var(--surface);
}

.matrix .col-theme-head {
  border-bottom: 3px solid var(--theme-color, var(--accent));
  text-align: center;
  min-width: 88px;
}

.matrix .cell {
  text-align: center;
  cursor: pointer;
  transition: background 100ms ease;
}

.matrix .cell:hover,
.matrix .cell:focus-visible {
  background: var(--accent-soft);
}

.matrix .cell.empty {
  color: var(--text-muted);
  font-style: italic;
  cursor: default;
}

.matrix .cell.empty:hover {
  background: transparent;
}

.matrix .cell.active {
  background: var(--accent-soft);
  font-weight: 600;
}

.matrix .count {
  display: inline-block;
  min-width: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.company-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--co-color, var(--accent));
  flex-shrink: 0;
}

.claims-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.claim-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--co-color, var(--accent));
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-base);
}

/* Compact variant — used inside the project detail pane (and anywhere
   claim cards appear as supporting context rather than the headline read).
   Reduces font, padding, and drops the box-shadow so density goes up. */
.claims-list.compact {
  gap: 6px;
}

.claims-list.compact .claim-card {
  padding: 8px 12px;
  font-size: var(--fs-base);
  box-shadow: none;
}

.claim-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.3;
}

.claim-company {
  font-weight: 600;
  color: var(--text);
}

.claim-theme {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 600;
}

.claim-theme::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--theme-color, var(--accent));
}

.claim-quote {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  line-height: 1.4;
  margin: 0 0 4px;
  color: var(--text);
}

.claim-quote::before {
  content: "\201C";
  margin-right: 1px;
  color: var(--text-muted);
}

.claim-quote::after {
  content: "\201D";
  margin-left: 1px;
  color: var(--text-muted);
}

.claims-list.compact .claim-quote {
  font-size: var(--fs-base);
  line-height: 1.35;
}

.claim-source {
  font-size: var(--fs-xs);
  margin: 0;
}

.claims-list.compact .claim-source {
  font-size: var(--fs-2xs);
}

.claim-source a {
  color: var(--text-muted);
}

.claim-source a:hover {
  color: var(--link);
}

.claim-metric {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  color: var(--text);
}

/* Delivered-vs-promised panel attached to claim cards (v1.13). The panel
   uses CSS-var-driven hues so dark mode and per-status palettes stay in
   sync with the existing stance palette. */
.claim-delivered {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid currentColor;
  background: var(--surface-2);
  font-size: var(--fs-xs);
  color: var(--text);
}

.claims-list.compact .claim-delivered {
  font-size: var(--fs-xs);
  padding: 6px 8px;
  margin-top: 8px;
}

.claim-delivered.delivered-delivered {
  color: var(--delivered-delivered);
  background: var(--delivered-delivered-soft);
}
.claim-delivered.delivered-partial {
  color: var(--delivered-partial);
  background: var(--delivered-partial-soft);
}
.claim-delivered.delivered-contested {
  color: var(--delivered-contested);
  background: var(--delivered-contested-soft);
}
.claim-delivered.delivered-shortfall {
  color: var(--delivered-shortfall);
  background: var(--delivered-shortfall-soft);
}

.delivered-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.delivered-badge {
  display: inline-block;
  padding: 1px 8px;
  background: currentColor;
  color: var(--surface);
  border-radius: 999px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  /* Dark-mode bump: when currentColor is a light token (delivered/positive
     etc), the contrast against --surface needs the surface to be the *light*
     surface variant; matching what the soft backgrounds already do. */
}

[data-theme="dark"] .delivered-badge {
  color: var(--bg);
}

.delivered-label {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  font-weight: 600;
}

.delivered-date {
  margin-left: auto;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.delivered-summary {
  margin: 0;
  color: var(--text);
  line-height: 1.4;
}

.delivered-source {
  margin: 6px 0 0;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

.delivered-source a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.delivered-source a:hover {
  color: var(--link);
}

/* ==========================================================================
   Explorer view
   ========================================================================== */

.explorer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-base);
}

.filter span {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.filter-search {
  flex: 1 1 260px;
}

.filter-search input {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font: inherit;
}

.filter select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  min-width: 160px;
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: var(--fs-base);
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.explorer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr);
  gap: 16px;
  min-height: 480px;
}

.map {
  width: 100%;
  height: 520px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-style: italic;
}

/* Map legend (Leaflet control) */
.map-legend {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: var(--fs-xs);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-legend h3 {
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
}

.legend-content {
  color: var(--text);
}

.legend-section {
  margin-bottom: 8px;
}

.legend-section strong {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin: 6px 0 4px;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: var(--text);
}

.legend-dot {
  display: inline-block;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-item-opacity-40 {
  color: var(--accent);
  opacity: 0.4;
  font-size: var(--fs-lg);
}

.legend-item-opacity-65 {
  color: var(--accent);
  opacity: 0.65;
  font-size: var(--fs-lg);
}

.legend-item-opacity-90 {
  color: var(--accent);
  opacity: 0.9;
  font-size: var(--fs-lg);
}

.legend-item-opacity-12 {
  color: var(--accent);
  opacity: 0.12;
  font-size: var(--fs-lg);
}

.explorer-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  max-height: 520px;
  overflow-y: auto;
}

.list-meta {
  font-size: var(--fs-base);
  color: var(--text-muted);
  margin: 0 0 8px;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.project-card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--co-color, var(--accent));
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: background 100ms ease;
}

.project-card:hover,
.project-card:focus-within {
  background: var(--accent-soft);
}

.project-card.active {
  background: var(--accent-soft);
}

.project-card-btn {
  all: unset;
  cursor: pointer;
}
.project-card-btn::after {
  content: "";
  position: absolute;
  inset: 0;
}
.project-card-btn:focus-visible {
  outline: none;
}
.project-card:has(.project-card-btn:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-name {
  font-weight: 600;
  margin: 0 0 2px;
  font-size: var(--fs-md);
}

.project-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

/* ==========================================================================
   Comparison view: matrix help line + company-detail pop-out
   ========================================================================== */

.matrix-help {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: var(--fs-base);
  line-height: 1.45;
  max-width: 720px;
}

.company-detail {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--co-color, var(--accent));
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  box-shadow: var(--shadow);
  animation: fadein 180ms ease-out;
  max-width: 760px;
}

.company-summary {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text);
}

.company-summary.muted {
  color: var(--text-muted);
  font-style: italic;
  font-size: var(--fs-md);
}

.detail-cta {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Project detail — At-a-glance per-theme summary block
   ========================================================================== */

.at-a-glance {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.at-a-glance h4 {
  margin: 0 0 4px;
}

.at-a-glance-sub {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.at-a-glance-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.at-a-glance-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  font-size: var(--fs-base);
}

.at-a-glance-row:last-child {
  border-bottom: none;
}

.at-a-glance-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 600;
}

.at-a-glance-theme::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--theme-color, var(--accent));
  flex-shrink: 0;
}

.at-a-glance-text {
  color: var(--text);
  line-height: 1.4;
}

.at-a-glance-text.curator-override::after {
  content: "";
}

@media (max-width: 640px) {
  .at-a-glance-row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px 0;
  }
}

/* ==========================================================================
   Project detail
   ========================================================================== */

.project-detail,
.moratorium-detail {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--co-color, var(--accent));
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  box-shadow: var(--shadow);
}

.detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  font-size: var(--fs-2xl);
  line-height: 1;
  color: var(--text-muted);
}

.detail-close:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.detail-header {
  margin-bottom: 8px;
  padding-right: 36px;
}

.detail-sub {
  color: var(--text-muted);
  font-size: var(--fs-base);
  margin: 4px 0 0;
}

/* Detail-panel tab strip — same visual language as the top-level tabs but
   one tier smaller. Per CLAUDE.md "[hidden] trap": .dpane[hidden] needs an
   explicit display:none rule (we have a global one in the reset) plus the
   transition is intentionally instant — content swaps, no fade competing
   with the panel's own fade-in. */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 12px 0 16px;
}

.dtab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px 9px;
  margin-bottom: -1px;
  color: var(--text-muted);
  font-size: var(--fs-base);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dtab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.dtab:hover {
  color: var(--text);
}

.dtab-count {
  display: inline-block;
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0 7px;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.dtab[aria-selected="true"] .dtab-count {
  background: var(--accent-soft);
  color: var(--text);
}

.dpane {
  animation: fadein 150ms ease-out;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px 16px;
  margin: 0;
  font-size: var(--fs-base);
}

.kv dt {
  color: var(--text-muted);
  font-weight: 500;
}

.kv dd {
  margin: 0;
  color: var(--text);
}

.kv dd.muted-cell {
  color: var(--text-muted);
  font-style: italic;
}

.response-help {
  margin: 0 0 12px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.45;
}

.response-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.response-card {
  border-left: 4px solid var(--stance-color, var(--text-muted));
  background: var(--stance-soft, var(--surface-2));
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: var(--fs-base);
}

.response-card.positive {
  --stance-color: var(--stance-positive);
  --stance-soft: var(--stance-positive-soft);
}

.response-card.mixed {
  --stance-color: var(--stance-mixed);
  --stance-soft: var(--stance-mixed-soft);
}

.response-card.negative {
  --stance-color: var(--stance-negative);
  --stance-soft: var(--stance-negative-soft);
}

.response-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.response-stance {
  font-weight: 600;
  color: var(--stance-color, var(--text));
}

.response-summary {
  margin: 0 0 6px;
  color: var(--text);
  line-height: 1.4;
}

.response-source {
  font-size: var(--fs-sm);
}

.response-source a {
  color: var(--text-muted);
}

.badge-single-source {
  display: inline-block;
  padding: 0 6px;
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  max-width: 1280px;
  margin: 24px auto 0;
  padding: 16px 20px 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-base);
}

.site-footer p {
  margin: 0;
}

/* ==========================================================================
   Toast
   ========================================================================== */

#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 100;
}

#toast.visible {
  opacity: 1;
}

/* ==========================================================================
   Responsive: tablet
   ========================================================================== */

@media (max-width: 1100px) {
  .tabbar {
    display: grid;
    /* Columns size to their longest label so a one-word name
       ("International") never breaks mid-word; two-word names wrap. */
    grid-template-columns: repeat(5, auto);
    justify-content: space-between;
    overflow-x: visible;
  }
  /* Full names at every width (one name per tab): two-word labels wrap
     inside their cell instead of overflowing into the next one. */
  .tab { min-width: 0; padding-inline: 4px; white-space: normal; line-height: 1.1; text-align: center; }
}

@media (max-width: 960px) {

  .explorer-layout {
    grid-template-columns: 1fr;
  }

  .map {
    height: 360px;
  }

  .explorer-list {
    max-height: 360px;
  }
}

/* ==========================================================================
   Responsive: mobile
   ========================================================================== */

@media (max-width: 640px) {
  main {
    padding: 12px 14px 32px;
  }

  .topbar-inner {
    padding: 10px 14px 6px;
  }

  /* Every tab visible, no sideways scrolling. The interaction-cost UAT
     (tools/interaction_cost.py) counted one to two side-swipes to reach
     Moratoriums or Sites when the bar scrolled. Two rows of short labels
     cost ~44px of sticky height and remove them. */
  .tabbar {
    flex-wrap: wrap;
    overflow-x: visible;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 0 8px;
  }

  .tab {
    min-height: 44px;
    padding: 4px 2px;
    font-size: var(--fs-xs);
    min-width: 0;
  }

  /* Sites: the list is what a phone reader scrolls for; the map follows it.
     Theme chips stay one swipeable row instead of three wrapped rows. */
  .explorer-list {
    order: -1;
    max-height: none;
  }

  .map {
    height: 300px;
  }

  #theme-filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }

  .theme-filter-chip {
    flex-shrink: 0;
  }

  h2 {
    font-size: var(--fs-2xl);
  }

  .hero {
    margin: 8px 0 16px;
  }

  .matrix {
    font-size: var(--fs-xs);
  }

  .matrix th,
  .matrix td {
    padding: 8px 6px;
  }

  .matrix .col-company {
    width: 110px;
  }

  .matrix .col-theme-head {
    min-width: 56px;
  }

  .kv {
    grid-template-columns: 120px 1fr;
  }

  .filter select {
    min-width: 0;
    width: 100%;
  }

  .explorer-filters .filter {
    flex: 1 1 calc(50% - 6px);
  }
}

/* ==========================================================================
   Ratepayer Protection Pledge view (v1.15)
   ========================================================================== */

/* Stat tiles */
/* Tiles size to their content and wrap, rather than stretching a row of
   four numbers across the full page width. */
.rp-stats {
  list-style: none;
  margin: 4px 0 12px;
  padding: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  border-bottom: 1px solid var(--border);
}

.rp-stat {
  --rp-color: var(--accent);
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 2px 6px;
}
.rp-stat-value { font-size: var(--fs-lg); font-weight: 700; line-height: 1.2; color: var(--rp-color); }
.rp-stat-label { font-size: var(--fs-sm); color: var(--text); line-height: 1.3; }
.rp-stat-breakdown {
  grid-column: 1 / -1;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 0.1rem;
}

/* ================= MORATORIUM SUMMARY CHARTS ================= */
/* Pure CSS/DOM charts (no library). Colors are CSS custom properties so they
   re-theme automatically on the dark swap. */
.mor-charts {
  margin: 0 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mor-chart {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.15rem 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mor-chart-title {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.mor-chart-sub {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-muted);
}

.mor-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 720px) {
  .mor-chart-row {
    grid-template-columns: 1fr;
  }
}

/* ---- Legend (shared) ---- */
.mor-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.8rem;
}

.mor-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.mor-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ---- Timeline (stacked columns by quarter) ---- */
.mtl-plot {
  display: flex;
  align-items: flex-end;
  /* Gap BETWEEN quarters is wider than the gap within a pair, so the two
     parallel bars read as one group. */
  gap: 0.4rem;
  min-height: calc(var(--plot-h, 150px) + 34px);
  padding-top: 4px;
  /* Two bars per quarter doubles the width, so narrow viewports overflow. Keep
     the scrollbar VISIBLE (a hidden one silently clips data — see the auto-scroll
     in renderMoratoriumCharts, which parks the view on the most recent quarters). */
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.mtl-plot::-webkit-scrollbar {
  height: 6px;
}

.mtl-plot::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.mtl-col {
  flex: 1 1 0;
  min-width: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 560px) {
  .mtl-plot {
    gap: 0.25rem;
  }
  .mtl-col {
    min-width: 20px;
  }
  .mtl-label {
    font-size: 0.58rem;
  }
}

.mtl-total {
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--text-muted);
  font-feature-settings: "tnum" 1;
  min-height: 0.9rem;
  line-height: 1;
  margin-bottom: 3px;
}

.mtl-bar {
  width: 68%;
  min-width: 14px;
  display: flex;
  flex-direction: column-reverse; /* first child (enacted) sits at the base */
  border-radius: 3px 3px 0 0;
  overflow: hidden;
}

.mtl-seg {
  width: 100%;
  transition: height 200ms ease;
}

/* Chart header: title on the left, level toggle on the right. */
.mor-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.mor-chart-head .mor-chart-title {
  margin-bottom: 0;
}

/* Segmented control — jurisdiction level is a FILTER, not a visual encoding. */
.mor-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 2px;
  padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mor-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}

.mor-toggle-btn:hover {
  color: var(--text);
}

.mor-toggle-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.mor-toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.mor-toggle-count {
  font-weight: 500;
  opacity: 0.65;
  font-feature-settings: "tnum" 1;
}

.mtl-label {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  margin-top: 5px;
  white-space: nowrap;
  font-feature-settings: "tnum" 1;
}

/* ---- Horizontal bars (concerns, jurisdiction) ---- */
.mor-hbar-set {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mhb-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr 2rem;
  align-items: center;
  gap: 0.55rem;
}

.mhb-label {
  font-size: var(--fs-xs);
  color: var(--text);
  text-align: right;
  line-height: 1.2;
}

.mhb-track {
  display: flex;
  height: 16px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.mhb-fill {
  height: 100%;
  min-width: 2px;
  transition: width 200ms ease;
}

.mhb-val {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  text-align: left;
  font-feature-settings: "tnum" 1;
}

@media (max-width: 460px) {
  .mhb-row {
    grid-template-columns: 6.5rem 1fr 1.6rem;
    gap: 0.4rem;
  }
  .mhb-label {
    font-size: var(--fs-2xs);
  }
}

/* ==========================================================================
   SECTION LANGUAGE — one heading treatment for every tab.

   Before this each view had invented its own: .summary-section (no rules at
   all — it inherited the global serif h3), .agg-section-heading (1.05rem
   sans), the old Explorer rail title (1rem sans), .matrix-help (720px, no heading).
   Six tabs, five heading scales. The Ratepayer view's shape won — display
   serif at 400 weight, a muted 64ch dek — and the legacy class names are
   aliased onto it here rather than renamed, so no JS selector or test id
   has to move.

   Adding a new section? Use the .acc accordion below -- every section on the
   dashboard is one now. (.rp-section itself is gone: its last holder, the
   non-signatory block, became a sub-tab panel.) Don't add a sixth heading
   rule.
   ========================================================================== */

.acc-title {
  margin: 0 0 0.3rem;
  font-family: var(--font-serif);
  /* The display face carries weight optically; 600 makes it look printed
     twice. Same 400 the pledge band and .rp-subhead already use. */
  font-weight: 400;
  font-size: var(--fs-xl);
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--text);
  /* The global h4 rule uppercases + switches to sans; any heading in this
     family that happens to be an h4 has to opt back out. */
  text-transform: none;
}

.rp-section-sub,
.matrix-help,
.acc-sub {
  margin: 0 0 1rem;
  font-size: var(--fs-base);
  color: var(--text-muted);
  max-width: 64ch;
  line-height: 1.45;
}

/* ==========================================================================
   ACCORDION — the one collapsible-section component.

   Replaces three unrelated <details> skins that had grown up separately:
   .directory-section (a filled button-looking bar) and
   .rp-roster-details (a bare bold summary) now use this shared skin.

   Structure:
     <details class="acc" [open]>
       <summary><h3 class="acc-title">…</h3><span class="acc-count">…</span></summary>
       <div class="acc-body">…</div>
     </details>

   The heading lives INSIDE the summary so the section still appears in a
   screen reader's heading list; <details>/<summary> supplies the expand
   semantics natively, so no aria-expanded bookkeeping is needed.

   Don't put buttons in the summary — a click inside it toggles the panel.
   Export toolbars go in .acc-body. (The old .directory-section shipped its
   CSV/PDF buttons inside the summary and collapsed the table out from under
   the reader on every export click.)
   ========================================================================== */

.acc {
  margin: 0 0 1.5rem;
  border-top: 1px solid var(--border);
}

.acc > summary {
  display: flex;
  align-items: baseline;
  /* The count chip can carry an as-of date ("302 signatories · as of Jul 25,
     2026"), which is too wide to sit beside a title on a phone. Let it wrap to
     its own line rather than overflow or squeeze the heading. */
  flex-wrap: wrap;
  gap: 12px;
  padding: 0.9rem 0 0.75rem;
  cursor: pointer;
  user-select: none;
  /* Suppress the native disclosure triangle in both engines; .acc-chevron
     replaces it so the marker can sit on the right and animate. */
  list-style: none;
}

.acc > summary::-webkit-details-marker {
  display: none;
}

.acc > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.acc > summary:hover .acc-title {
  color: var(--accent);
}

.acc-title {
  /* Typography comes from the section-language rule above. */
  flex: 1 1 auto;
  min-width: 0;
}

/* Belt-and-braces against the <details>-collapse trap: an author `display:`
   rule on a direct child of <details> outranks the UA rule that hides content
   while closed, and a closed panel that keeps painting its body is a silent,
   total failure of the component. Nothing here sets `display` on .acc-body
   today — this makes sure nothing can. */
.acc:not([open]) > :not(summary) {
  display: none;
}

/* Count of what's inside, so the reader can judge a collapsed panel without
   opening it. Rendered by setAccCount() in app.js; stays empty (and hidden)
   until the data it counts has loaded. */
.acc-count {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 600;
}

/* Fires only when the count is genuinely unloaded -- a zero renders "0". */
.acc-count:empty {
  display: none;
}

.acc-chevron {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-left: 2px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.18s ease;
}

.acc[open] > summary .acc-chevron {
  transform: translateY(1px) rotate(225deg);
}

.acc-body {
  padding-bottom: 0.5rem;
  animation: acc-reveal 0.18s ease;
}

@keyframes acc-reveal {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .acc-chevron,
  .acc-body {
    transition: none;
    animation: none;
  }
}

/* ==========================================================================
   SUB-TABS — for sections that are ALTERNATIVES, not a sequence.

   Used in exactly two places, and the distinction is the whole rule:

     Ratepayer "Tracked sites" — Assessed / Awaiting / Before the pledge /
       Non-signatory are one list of sites bucketed four ways. You read one.
     Aggregate — By company / By signatory category / By state are three
       rollups of the same numbers. You read one.

   Everything else on the dashboard stays an .acc, because those sections are
   read together (the moratorium charts AND the directory) and sub-tabs would
   hide content from Ctrl-F and from the PDF exports, which walk the DOM.

   Don't add a sub-tab group to a tab whose sections are complementary. The
   test is: would a reader ever want two of these on screen at once? If yes,
   accordion.
   ========================================================================== */

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 1.1rem;
  border-bottom: 1px solid var(--border);
}

.subtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-base);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.subtab:hover {
  color: var(--text);
}

.subtab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.subtab[aria-selected="true"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.subtab-count {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 7px;
}

.subtab[aria-selected="true"] .subtab-count {
  color: var(--accent);
}

/* See .acc-count:empty -- a zero cohort renders "0", not blank. */
.subtab-count:empty {
  display: none;
}

/* 44px touch floor, coarse pointers only. At the desktop scale a sub-tab is
   ~37px tall (8px padding + 0.88rem text), which is fine for a mouse and below
   the floor for a thumb. Scoping to `pointer: coarse` keeps the desktop strip
   at its natural chip scale instead of bloating seven tabs into CTAs. */
@media (pointer: coarse) {
  .subtab {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* Panels are toggled with the `hidden` attribute. The global [hidden] rule
   carries !important, so this display value can't resurrect a hidden pane —
   see CLAUDE.md > "The [hidden] trap". */
.subtab-panel {
  display: block;
  animation: acc-reveal 0.18s ease;
}

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

/* --- Band variant: the pledge itself ------------------------------------
   The five commitments sit in the dark band (.rp-band). Collapsing it means
   the summary row has to read on the band's own background, not the page's,
   so the hairline and marker flip to the band palette. */

.acc--band {
  border-top: none;
}

.acc--band > summary {
  padding: clamp(20px, 3vw, 32px) clamp(18px, 3vw, 36px);
  align-items: center;
}

.acc--band > summary:hover .acc-title,
.acc--band > summary:hover .rp-band-title {
  color: var(--band-accent);
}

.acc--band .rp-band-title {
  margin: 0;
  max-width: 30ch;
}

.acc--band .acc-chevron {
  color: var(--band-accent);
  border-color: var(--band-accent);
  background: transparent;
}

.acc--band .acc-count {
  color: var(--band-accent);
}

.acc--band > summary:focus-visible {
  outline-color: var(--band-accent);
}

/* The band's own padding lives on the summary and this body, so the
   collapsed state is a single clean bar. */
.acc--band > .acc-body {
  padding: 0 clamp(18px, 3vw, 36px) clamp(20px, 3vw, 32px);
}

/* Signatory roster */
.rp-roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

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

/* Scorecard toolbar: legend chips + export button on the same row */
.rp-scorecard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

/* Status legend — renderRatepayerLegend() only emits chips for statuses
   actually present in the cohort (honest-absence principle). Chip color
   comes from --rp-color, set per-status in JS. */
.rp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rp-legend-chip {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  color: var(--rp-color);
  background: color-mix(in srgb, var(--rp-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--rp-color) 45%, transparent);
  white-space: nowrap;
}

/* Scorecard — multi-column so 11 sites don't become a tall single stack.
   Cards hold short content, so a ~340px min keeps two (often three) per row
   on desktop and collapses to one column on mobile. */
.rp-scorecard {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.7rem;
  align-items: start;
}

/* Expanded card spans all columns so it fills horizontal space first */
.rp-card:has(.rp-card-details[open]) {
  grid-column: 1 / -1;
}

.rp-card {
  --co-color: var(--accent);
  --rp-color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--co-color);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  box-shadow: var(--shadow-sm);
}

.rp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.rp-card-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.rp-card-company {
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--co-color);
}

.rp-card-name {
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.3;
}

.rp-card-loc {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.rp-card-dates {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Claim-basis badge + conflict flag — makes "individual vs company-wide"
   and "disputed by an independent report" legible without expanding the card. */
.rp-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.1rem 0;
}

.rp-basis {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-2xs);
  font-weight: 600;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.3;
}

.rp-basis--individual {
  color: var(--ratepayer-affirmed);
  background: var(--ratepayer-affirmed-soft);
  border-color: color-mix(in srgb, var(--ratepayer-affirmed) 30%, transparent);
}

.rp-basis--company-wide {
  color: var(--ratepayer-pledge_only);
  background: var(--ratepayer-pledge_only-soft);
  border-color: color-mix(in srgb, var(--ratepayer-pledge_only) 30%, transparent);
}

.rp-conflict-flag {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-2xs);
  font-weight: 700;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  color: var(--ratepayer-contested);
  background: var(--ratepayer-contested-soft);
  border: 1px solid color-mix(in srgb, var(--ratepayer-contested) 35%, transparent);
}

/* Conflicting-reports block inside an expanded card */
.rp-conflicts {
  margin: 0.75rem 0 0.5rem;
  border: 1px solid color-mix(in srgb, var(--ratepayer-contested) 30%, var(--border));
  border-left: 3px solid var(--ratepayer-contested);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ratepayer-contested-soft) 55%, var(--surface));
  padding: 0.6rem 0.8rem;
}

.rp-conflicts-head {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ratepayer-contested);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.rp-conflicts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.rp-conflict-summary {
  margin: 0 0 0.25rem;
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.4;
}

.rp-conflict-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

.rp-conflict-who {
  font-weight: 600;
  text-transform: capitalize;
}

.rp-conflict-single {
  color: var(--ratepayer-contested);
  font-style: italic;
}

.rp-conflict-meta a {
  color: var(--accent);
  font-weight: 600;
}

/* Pre-pledge section — compact one-line rows, not full scorecards */
.rp-pre-pledge-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rp-pre-card {
  --co-color: var(--accent);
  display: grid;
  grid-template-columns: 9rem 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  align-items: baseline;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--co-color);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  opacity: 0.85;
}

.rp-pre-company {
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--co-color);
  grid-column: 1;
  grid-row: 1;
}

.rp-pre-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  grid-column: 2;
  grid-row: 1;
}

.rp-pre-loc {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  grid-column: 3;
  grid-row: 1;
}

.rp-pre-dates {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  grid-column: 2 / -1;
  grid-row: 2;
}

@media (max-width: 640px) {
  .rp-pre-card {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
  }
  .rp-pre-company { grid-column: 1; grid-row: 1; }
  .rp-pre-name    { grid-column: 1; grid-row: 2; }
  .rp-pre-loc     { grid-column: 1; grid-row: 3; }
  .rp-pre-dates   { grid-column: 1; grid-row: 4; }
}

/* Collapsible card */
.rp-card-details {
  /* reset browser default triangle marker */
}
.rp-card-details > summary {
  list-style: none;
  cursor: pointer;
}
.rp-card-details > summary::-webkit-details-marker { display: none; }

.rp-card-body {
  padding-top: 0.6rem;
}

/* X/5 met pill — fixed width so all pills align regardless of digit */
.rp-met-pill {
  flex: none;
  font-size: var(--fs-2xs);
  font-weight: 700;
  padding: 0.2rem 0;
  border-radius: 999px;
  white-space: nowrap;
  min-width: 4.2rem;
  text-align: center;
}

.rp-met-pill--met {
  color: var(--ratepayer-affirmed);
  background: color-mix(in srgb, var(--ratepayer-affirmed) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ratepayer-affirmed) 45%, transparent);
}

.rp-met-pill--partial {
  color: var(--ratepayer-pledge_only);
  background: color-mix(in srgb, var(--ratepayer-pledge_only) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ratepayer-pledge_only) 45%, transparent);
}

.rp-met-pill--low {
  color: var(--ratepayer-contested);
  background: color-mix(in srgb, var(--ratepayer-contested) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ratepayer-contested) 45%, transparent);
}

.rp-card-summary {
  margin: 0.7rem 0 0;
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
}

.rp-principles {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.pp-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem;
  border-left: 3px solid;
  cursor: default;
}

.pp-row + .pp-row {
  border-top: 1px solid var(--border);
}

.pp-row-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.pp-row-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
}

.pp-row-note {
  font-size: var(--fs-xs);
  color: var(--text);
  line-height: 1.45;
}

.pp-row-status {
  font-size: var(--fs-2xs);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.05rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.pp-row-src {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: inherit;
  opacity: 0.7;
  text-decoration: none;
  line-height: 1;
}
.pp-row-src:hover {
  opacity: 1;
  text-decoration: underline;
}

.pp-row--met {
  border-left-color: var(--ratepayer-affirmed);
  background: color-mix(in srgb, var(--ratepayer-affirmed) 6%, transparent);
}
.pp-row--met .pp-row-status { color: var(--ratepayer-affirmed); }

.pp-row--partial {
  border-left-color: var(--ratepayer-pledge_only);
  background: color-mix(in srgb, var(--ratepayer-pledge_only) 6%, transparent);
}
.pp-row--partial .pp-row-status { color: var(--ratepayer-pledge_only); }

.pp-row--not_met {
  border-left-color: var(--ratepayer-contested);
  background: color-mix(in srgb, var(--ratepayer-contested) 6%, transparent);
}
.pp-row--not_met .pp-row-status { color: var(--ratepayer-contested); }

.pp-row--unknown {
  border-left-color: var(--border);
  background: transparent;
}
.pp-row--unknown .pp-row-status { color: var(--text-muted); }

/* Always-visible sources footer on every ratepayer site card (v1.17 fix) */
.rp-card-sources {
  margin-top: 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border);
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--text-muted);
}
.rp-card-sources .rp-sources-label {
  font-weight: 600;
  font-size: var(--fs-2xs);
  margin-right: 0.3rem;
}
.rp-card-sources a {
  color: var(--accent);
  text-decoration: none;
}
.rp-card-sources a:hover {
  text-decoration: underline;
}
.rp-card-sources .rp-src-sep {
  color: var(--border-strong, var(--text-muted));
}
/* The pre-pledge / unassessed card is a grid; let the sources span full width */
.rp-pre-card .rp-card-sources {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

/* Per-claim audit trail (v1.20): one row per claim tied to the site, each with
   its own source link. Sits above the project-level "Sources:" footer so every
   claim is individually traceable. */
.rp-card-claims {
  margin-top: 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border);
}
.rp-card-claims .rp-claims-label {
  display: block;
  font-weight: 600;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}
.rp-claims-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.rp-claim-src {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.rp-claim-theme {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 0 7px;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  line-height: 1.7;
  font-weight: 600;
}
.rp-claim-theme::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--theme-color, var(--text-muted));
}
.rp-claim-link {
  color: var(--accent);
  text-decoration: none;
}
.rp-claim-link:hover {
  text-decoration: underline;
}
.rp-claim-date {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
}
.rp-claim-flag {
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--ratepayer-affirmed, var(--accent));
  white-space: nowrap;
}
/* In the pre-pledge / unassessed grid card, span the full row. */
.rp-pre-card .rp-card-claims {
  grid-column: 1 / -1;
}

.rp-footnote {
  margin: 1.5rem 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 70ch;
  line-height: 1.45;
}

/* ── Ratepayer: tablet ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .rp-scorecard {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* ── Ratepayer: mobile ──────────────────────────────────────────────── */
@media (max-width: 560px) {
  /* Single column, full-width cards */
  .rp-scorecard {
    grid-template-columns: 1fr;
  }

  /* Stack badge under the title */
  .rp-card-head {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   Summary stats bar (v1.18 — ported), matrix CSV toolbar,
   Recently-Contested rail, theme-filter chips
   ========================================================================== */

/* Matrix CSV toolbar */
.matrix-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 8px 0 12px;
}

.matrix-toolbar .matrix-help {
  flex: 1;
  margin: 0;
}

.matrix-csv {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Theme-filter chips */
.theme-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.theme-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.theme-filter-chip:hover {
  background: var(--surface-2);
}

.theme-filter-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.theme-filter-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--theme-color, var(--accent));
  color: var(--text);
}

.theme-filter-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--theme-color, var(--accent));
}

@media (max-width: 640px) {
  .matrix-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .matrix-csv {
    align-self: flex-start;
  }
}

/* ==========================================================================
   Aggregate view
   ========================================================================== */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.agg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
  background: var(--surface);
}

.agg-table th {
  background: var(--surface-2, var(--surface));
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  text-align: left;
}

.agg-table th.num,
.agg-table td.num {
  text-align: right;
}

.agg-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
  color: var(--text);
}

.agg-table tbody tr:last-child td {
  border-bottom: none;
}

.agg-table tfoot td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  background: var(--surface-2, var(--surface));
  padding: 0.55rem 0.75rem;
  white-space: nowrap;
}

.agg-table tbody tr:hover td {
  background: var(--hover-bg, rgba(0,0,0,0.03));
}

.agg-table .name-col {
  text-align: left;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.co-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.responses-col {
  min-width: 8rem;
}

#agg-stats {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 720px) {
  #agg-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Moratoriums table - aligned with aggregate table styling */
.moratorium-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
  background: var(--surface);
}

.moratorium-table th {
  background: var(--surface-2, var(--surface));
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  text-align: left;
}

.moratorium-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.moratorium-table tbody tr:last-child td {
  border-bottom: none;
}

.moratorium-table tbody tr:hover td {
  background: var(--hover-bg, rgba(0,0,0,0.03));
}

[data-theme="dark"] .moratorium-table tbody tr:hover td {
  background: rgba(255,255,255,0.05);
}

/* ==========================================================================
   Utility Tariffs view (v1.17)
   ========================================================================== */

.tariff-table tbody tr {
  cursor: pointer;
}
.tariff-table tbody tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* --------------------------------------------------------------------------
   Moratorium detail modal — same overlay pattern as the tariff modal.
   -------------------------------------------------------------------------- */
.moratorium-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 6vh, 72px) 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.moratorium-modal[hidden] {
  display: none;
}
.moratorium-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
/* Override .moratorium-detail's inline layout so it becomes the centered dialog. */
.moratorium-modal__dialog.moratorium-detail {
  position: relative;
  z-index: 1;
  margin: auto;
  width: min(760px, 100%);
  max-height: calc(100vh - clamp(32px, 12vh, 144px));
  overflow-y: auto;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.38);
  animation: moratorium-modal-in 160ms ease-out;
}
@keyframes moratorium-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .moratorium-modal__dialog.moratorium-detail { animation: none; }
}
.moratorium-modal__dialog .detail-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -6px -10px 0 0;
  background: var(--surface);
  z-index: 2;
}
body.moratorium-modal-open {
  overflow: hidden;
}
@media (max-width: 640px) {
  .moratorium-modal { padding: 0; }
  .moratorium-modal__dialog.moratorium-detail {
    width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .moratorium-modal__dialog .kv {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .moratorium-modal__dialog .kv dd {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .moratorium-modal__dialog .kv .badge {
    max-width: 100%;
    white-space: normal;
  }
}

/* Stakeholders section inside the moratorium modal */
.moratorium-stakeholders {
  margin-top: 20px;
}
.moratorium-stakeholders h4 {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.mstakeholder-group {
  margin-bottom: 10px;
}
.mstakeholder-category {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.mstakeholder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mstakeholder-list li {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: var(--fs-sm);
  color: var(--text);
}
/* Opposed group gets a subtle red tint */
.mstakeholder-group[data-category="opposed"] .mstakeholder-list li {
  background: color-mix(in srgb, var(--stance-negative) 8%, var(--surface-2));
  border-color: color-mix(in srgb, var(--stance-negative) 20%, var(--border));
}

/* --------------------------------------------------------------------------
   Tariff detail modal (v1.19) — promotes the inline pop-out to a centered
   overlay so the full LBL element checklist + sources read as a real modal.
   -------------------------------------------------------------------------- */
.tariff-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 6vh, 72px) 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* [hidden] trap: an explicit display override would beat the attribute, so
   restore display:none for the hidden state. */
.tariff-modal[hidden] {
  display: none;
}
.tariff-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
/* Override .moratorium-detail's inline (margin-top, position:relative) layout
   so the shared card becomes the centered, self-scrolling dialog. */
.tariff-modal__dialog.tariff-detail {
  position: relative;
  z-index: 1;
  margin: auto;
  width: min(780px, 100%);
  max-height: calc(100vh - clamp(32px, 12vh, 144px));
  overflow-y: auto;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.38);
  animation: tariff-modal-in 160ms ease-out;
}
@keyframes tariff-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .tariff-modal__dialog.tariff-detail { animation: none; }
}
/* Keep the close control reachable while the dialog body scrolls. */
.tariff-modal__dialog .detail-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -6px -10px 0 0;
  background: var(--surface);
  z-index: 2;
}
/* Coverage count surfaced in the params heading. */
.td-elem-tally {
  font-weight: 500;
  font-size: var(--fs-base);
  color: var(--text-muted);
  margin-left: 0.4rem;
}
/* Lock the page behind the modal. */
body.tariff-modal-open {
  overflow: hidden;
}
@media (max-width: 640px) {
  .tariff-modal { padding: 0; }
  .tariff-modal__dialog.tariff-detail {
    width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}

.tariff-table th.num,
.tariff-table td.num {
  text-align: right;
  white-space: nowrap;
}
.tariff-row-name {
  font-weight: 600;
}
.tariff-row-type {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Status badges + row accent (approved↔green, proposed↔amber, rejected↔red) */
.badge-tariff-status-approved,
.badge-tariff-status-proposed,
.badge-tariff-status-rejected,
.badge-tariff-federal {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fs-base);
  font-weight: 500;
}
.badge-tariff-status-approved {
  background-color: var(--tariff-approved-soft);
  color: var(--tariff-approved);
}
.badge-tariff-status-proposed {
  background-color: var(--tariff-proposed-soft);
  color: var(--tariff-proposed);
}
.badge-tariff-status-rejected {
  background-color: var(--tariff-rejected-soft);
  color: var(--tariff-rejected);
}
.badge-tariff-federal {
  background-color: var(--tariff-federal-soft);
  color: var(--tariff-federal);
  border: 1px solid var(--border);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 0.3rem;
}
.tariff-status-approved td:first-child {
  box-shadow: inset 3px 0 0 var(--tariff-approved);
}
.tariff-status-proposed td:first-child {
  box-shadow: inset 3px 0 0 var(--tariff-proposed);
}
.tariff-status-rejected td:first-child {
  box-shadow: inset 3px 0 0 var(--tariff-rejected);
}
.tariff-table tbody tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* LBL element coverage grid */
.tariff-coverage-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}
.tariff-coverage-group-title {
  margin: 0 0 0.4rem;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 600;
}
.tariff-coverage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tariff-coverage-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tariff-coverage-card:hover {
  border-color: var(--border-strong, #888);
}
.tariff-coverage-card.active {
  border-color: var(--accent);
  background: var(--tariff-included-soft);
}
.tariff-coverage-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tariff-coverage-card.empty {
  opacity: 0.5;
}
.tariff-coverage-card .tcc-count,
.reason-card .tcc-count {
  min-width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2, rgba(0,0,0,0.06));
  border-radius: 50%;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tariff-coverage-card.active .tcc-count {
  background: var(--accent);
  color: var(--surface);
}

/* Coverage popout (which tariffs address an element) */
.tariff-coverage-popout {
  margin-top: 1rem;
}
.tariff-popout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  background: var(--surface);
}
.tariff-popout-title {
  margin: 0 0 0.25rem;
  font-size: var(--fs-md);
}
.tariff-popout-n {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.4rem;
}
.tariff-popout-desc {
  margin: 0 0 0.75rem;
  font-size: var(--fs-base);
  color: var(--text-muted);
}
.tariff-popout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.tariff-popout-item {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.tariff-popout-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.tpi-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: var(--fs-base);
}
.tpi-state {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}
.tpi-detail {
  margin: 0.25rem 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.tariff-partial-tag {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tariff-partial);
  background: var(--tariff-partial-soft);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-weight: 600;
}

/* Detail pop-out: per-element checklist */
.tariff-detail .tariff-params {
  margin-top: 1.25rem;
}
.tparam-group {
  margin-bottom: 1rem;
}
.tparam-group-title {
  margin: 0 0 0.4rem;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
  font-weight: 600;
}
.tparam-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.tparam-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.tparam-icon {
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-top: 0.05rem;
}
.tparam-included .tparam-icon {
  background: var(--tariff-included-soft);
  color: var(--tariff-included);
}
.tparam-partial .tparam-icon {
  background: var(--tariff-partial-soft);
  color: var(--tariff-partial);
}
.tparam-absent .tparam-icon {
  background: var(--surface-2, rgba(0,0,0,0.06));
  color: var(--text-muted);
}
.tparam-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.tparam-label {
  font-size: var(--fs-base);
  font-weight: 600;
}
.tparam-status {
  font-weight: 500;
  color: var(--text-muted);
}
.tparam-absent .tparam-label {
  color: var(--text-muted);
  font-weight: 500;
}
.tparam-detail {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.4;
}
.tparam-src {
  text-decoration: none;
  font-size: var(--fs-sm);
}

/* Additional terms + legislation lists */
.tariff-additional-list,
.tariff-legislation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.tariff-additional-list li,
.tariff-legislation-list li {
  font-size: var(--fs-base);
  line-height: 1.45;
}
.tleg-meta {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-left: 0.4rem;
}
.tleg-summary {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* v7: cross-record links, from links.json. */
.related-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
}
.related-kind {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 7.5rem;
}
.related-note {
  flex-basis: 100%;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.tleg-record {
  margin-left: 0.4rem;
  font-size: var(--fs-xs);
}
.record-permalink-row {
  margin: 1rem 0 0;
  font-size: var(--fs-xs);
}

/* ==========================================================================
   Print
   ========================================================================== */

/* ==========================================================================
   Matrix cell tooltip (v1.17)
   ========================================================================== */

.matrix-tooltip {
  position: absolute;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 10px 12px;
  max-width: 320px;
  pointer-events: none;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--text);
}

.mtt-theme {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--theme-color, var(--text-muted));
  margin-bottom: 6px;
}

.mtt-quote {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text);
}

.mtt-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

[data-theme="dark"] .matrix-tooltip {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* ==========================================================================
   CBA / Formal agreement badge on claim cards (v1.17)
   ========================================================================== */

.claim-cba-badge {
  display: inline-block;
  font-size: var(--fs-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--stance-positive-soft);
  color: var(--stance-positive);
  border: 1px solid color-mix(in srgb, var(--stance-positive) 30%, transparent);
  vertical-align: 1px;
  cursor: default;
}

[data-theme="dark"] .claim-cba-badge {
  background: color-mix(in srgb, var(--stance-positive) 18%, transparent);
  color: var(--stance-positive);
  border-color: color-mix(in srgb, var(--stance-positive) 35%, transparent);
}

/* ==========================================================================
   Constituency response breakdown in company pop-out (v1.17)
   ========================================================================== */

.cd-responses-breakdown {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.cd-breakdown-heading {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.cb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: var(--fs-sm);
}

.cb-label {
  flex: 0 0 120px;
  color: var(--text);
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cb-bars {
  flex: 1;
  display: flex;
  height: 10px;
  border-radius: 3px;
  overflow: hidden;
  min-width: 40px;
  gap: 1px;
}

.cb-seg {
  min-width: 4px;
  border-radius: 2px;
}

.cb-seg.positive { background: var(--stance-positive); }
.cb-seg.mixed    { background: var(--stance-mixed); }
.cb-seg.negative { background: var(--stance-negative); }

.cb-total {
  flex: 0 0 20px;
  text-align: right;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cb-summary {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin: 8px 0 0;
}

/* ==========================================================================
   Aggregate table sort indicators (v1.17)
   ========================================================================== */

.agg-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.agg-table th.sortable:hover {
  background: var(--surface-2);
}

.sort-ind {
  font-size: 0.7em;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* ==========================================================================
   Print styles (v1.17 — expanded from v1.4 stub)
   ========================================================================== */

/* ---- Project Moratorium Badges ---- */

.project-moratoriums-row {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge-moratorium {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
}

.badge-moratorium-enacted {
  background-color: #d1fae5;
  color: #065f46;
  border-left: 3px solid #059669;
}

.badge-moratorium-proposed {
  background-color: #fef3c7;
  color: #78350f;
  border-left: 3px solid #d97706;
}

.badge-moratorium-failed {
  background-color: #fee2e2;
  color: #7f1d1d;
  border-left: 3px solid #dc2626;
}

/* ===================== Moratoriums View ===================== */

#moratoriums-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

#moratoriums-table thead {
  background-color: var(--bg-header);
}

#moratoriums-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  cursor: pointer;
}

#moratoriums-table th:hover {
  background-color: var(--bg-secondary);
}

#moratoriums-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#moratoriums-table tbody tr:hover {
  background-color: var(--bg-secondary);
}

#moratoriums-table td {
  padding: 0.75rem;
}

/* Status badge colors */
.moratorium-status-enacted {
  --status-color: #25663f;
}

.moratorium-status-proposed {
  --status-color: #f59e0b;
}

.moratorium-status-failed {
  --status-color: #dc2626;
}

.badge-moratorium-status-enacted {
  background-color: #d1fae5;
  color: #065f46;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fs-base);
  font-weight: 500;
}

.badge-moratorium-status-proposed {
  background-color: #fef3c7;
  color: #78350f;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fs-base);
  font-weight: 500;
}

.moratorium-status-lifted {
  --status-color: var(--moratorium-lifted);
}

.badge-moratorium-lifted,
.badge-moratorium-status-lifted {
  background-color: var(--moratorium-lifted-soft);
  color: var(--moratorium-lifted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fs-base);
  font-weight: 500;
}

.badge-moratorium-status-failed {
  background-color: #fee2e2;
  color: #7f1d1d;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fs-base);
  font-weight: 500;
}

/* Reason badges */
.badge-jurisdiction-type {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fs-base);
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.badge-reason-energy {
  background-color: #fef3c7;
  color: #78350f;
}

.badge-reason-water {
  background-color: #dbeafe;
  color: #0c2d6b;
}

.badge-reason-air_quality {
  background-color: #fee2e2;
  color: #7f1d1d;
}

.badge-reason-transparency {
  background-color: #f3e8ff;
  color: #4c1d95;
}

.badge-reason-noise {
  background-color: #e2e8f0;
  color: #1e293b;
}

.badge-reason-equity {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-reason-energy,
.badge-reason-water,
.badge-reason-air_quality,
.badge-reason-transparency,
.badge-reason-noise,
.badge-reason-equity {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 500;
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
}

/* Reason breakdown / summary */
#moratorium-summary {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

#moratorium-summary h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Theme cards grid — clickable theme pills */
.reason-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0;
  padding-bottom: 1rem;
}

.reason-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.reason-card:hover {
  border-color: var(--border-strong, #888);
}

.reason-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.reason-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.reason-card.active .tcc-count {
  background: var(--accent);
  color: var(--surface);
}

/* Theme detail pop-out — wide horizontal below grid */
.theme-popout {
  display: none;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: slideDown 0.3s ease;
}

.theme-popout.active {
  display: block;
}

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

.theme-popout-header {
  margin-bottom: 1.2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.8rem;
}

.theme-popout-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.3rem 0;
}

.theme-popout-desc {
  font-size: var(--fs-base);
  color: var(--text-muted);
  margin: 0;
}

.theme-evidence {
  display: grid;
  gap: 1.2rem;
}

@media (min-width: 768px) {
  .theme-evidence {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 767px) {
  .theme-evidence {
    grid-template-columns: 1fr;
  }
}

.evidence-item {
  padding: 1rem;
  background-color: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.evidence-moratorium {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.5rem 0;
}

.evidence-text {
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 0.8rem 0;
  font-style: italic;
}

.evidence-proposals {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.evidence-proposals li {
  font-size: var(--fs-base);
  line-height: 1.4;
  color: var(--text);
  padding-left: 1.2rem;
  position: relative;
}

.evidence-proposals li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--stance-positive);
  font-weight: bold;
}

/* Moratorium detail resources list */
.moratorium-resources {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.moratorium-resources h4 {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.resources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.resources-list li {
  margin: 0;
  padding: 0;
}

.resources-list a {
  color: var(--link);
  text-decoration: none;
  font-size: var(--fs-base);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.resources-list a:hover {
  text-decoration: underline;
}

.moratorium-summary {
  margin: 1rem 0;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
}

/* Bill number chip shown in the jurisdiction table cell */
.moratorium-bill-id {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* .gov badge on official government links in the resources list */
.badge-gov {
  display: inline-block;
  font-size: var(--fs-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--stance-positive, #1a7a4a);
  color: #fff;
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
  margin-right: 2px;
}


/* Export buttons for a directory table. These sit in .acc-body, never in the
   <summary> — a click inside a summary toggles the panel, so an export button
   there collapsed the table out from under the reader. */
.table-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media print {
  /* ---- Hide chrome ---- */
  .topbar-controls,
.tabbar,
.theme-filter-row,
.matrix-toolbar .matrix-csv,
#theme-toggle,
.skip-link,
.explorer-filters,
.detail-close,
.map,
#rp-export-csv,
.cd-responses-breakdown,
.detail-cta,
.matrix-tooltip,
button,
nav {
    display: none !important;
  }

  /* ---- Page setup ---- */
  @page {
    margin: 1.5cm 2cm;
  }

  body {
    font-size: 10pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  /* ---- Topbar: show site name and refresh date, strip nav ---- */
  .topbar {
    display: block;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0 0 12pt;
    margin-bottom: 12pt;
    border-bottom: 1pt solid #ccc;
  }
  .topbar-inner { padding: 0; }
  .topbar h1 { font-size: 14pt; margin: 0; }
  .topbar-sub { font-size: 9pt; color: #555; margin: 2pt 0 0; }

  /* ---- Show only the active (comparison) view for print ---- */
  /* All views hidden by default; unhide the comparison one */
  .view[hidden] { display: none !important; }
  #view-comparison { display: block !important; }

  /* ---- Matrix ---- */
  .matrix-wrap { overflow: visible; }
  .matrix { width: 100%; border-collapse: collapse; font-size: 9pt; }
  .matrix th, .matrix td { border: 0.5pt solid #ccc; padding: 4pt 6pt; }
  .matrix .cell.empty { color: #999; }
  .col-company { font-weight: 600; text-align: left; }

  /* ---- Company detail pop-out: hide if visible ---- */
  .company-detail { display: none !important; }

  /* ---- Claim cards ---- */
  .claim-card { break-inside: avoid; box-shadow: none; border: 0.5pt solid #ddd; }
  .claim-quote { font-size: 9pt; }

  /* ---- Links: show href after anchor text ---- */
  a[href]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }

  /* ---- Suppress animations ---- */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Ratepayer v2 — commitments band, coverage, roster, state panel
   ========================================================================== */

/* --- 1. The pledge: five commitments on an inked band -------------------- */

/* The band is dark in BOTH themes — it is a figure on the page, not a
   surface — so it carries its own foreground tokens rather than inheriting. */
.rp-band {
  background: var(--band-bg);
  color: var(--band-text);
  border-top: 2px solid var(--band-bg);
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.rp-band-title {
  margin: 0 0 24px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-2xl);
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--band-text);
  max-width: 26ch;
}

.rp-commit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--band-hairline);
}

.rp-commit {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: clamp(14px, 2.5vw, 32px);
  padding: 22px 0;
  border-bottom: 1px solid var(--band-hairline);
  align-items: start;
}

.rp-commit-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-3xl);
  line-height: 0.85;
  color: var(--band-accent);
}

.rp-commit-title {
  /* Overrides the global h4 (uppercase, sans, muted) — these are display
     headings quoting the pledge, not eyebrow labels. */
  text-transform: none;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-lg);
  line-height: 1.18;
  color: var(--band-text);
}

.rp-commit-dek {
  margin: 0 0 12px;
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--band-text-muted);
  max-width: 62ch;
}

.rp-commit-meter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rp-commit-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--band-hairline);
  font-size: var(--fs-xs);
  color: var(--band-text);
}

.rp-commit-chip-num {
  font-weight: 700;
}

.rp-commit-chip.is-met {
  border-color: var(--stance-positive);
  color: var(--stance-positive);
}
.rp-commit-chip.is-partial {
  border-color: var(--stance-mixed);
  color: var(--stance-mixed);
}
.rp-commit-chip.is-not_met {
  border-color: var(--stance-negative);
  color: var(--stance-negative);
}

.rp-commit-empty,
.rp-commit-chip.is-unknown {
  font-size: var(--fs-xs);
  color: var(--band-text-muted);
}

.rp-band-source {
  margin: 18px 0 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--band-text-muted);
}

.rp-band-source a {
  color: var(--band-accent);
}

/* --- 2. Coverage --------------------------------------------------------- */
/* Category counts render as the proportional roster bar + key (.pledge-bar /
   .pledge-bar-key, further down) — moved here from the Home band in v3. */

/* The source page disagrees with its own list; the note says so out loud. */
.rp-drift-note {
  margin: 0 0 20px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-muted);
}

.rp-subhead {
  /* Same override as .rp-commit-title — see the global h4 rule. */
  text-transform: none;
  letter-spacing: -0.01em;
  font-family: var(--font-serif);
  font-weight: 400;
  margin: 26px 0 6px;
  font-size: var(--fs-lg);
  color: var(--text);
}

/* The by-state grid is the 50-state strip (.pledge-state-strip, further
   down) — moved here from the Home band in v3. Every state gets a cell,
   including the ones we hold nothing for: a grid that only showed states
   with data would quietly imply national coverage we do not have. */

/* --- 3. Signatory roster ------------------------------------------------- */

/* The roster's collapsible skin is the shared .acc component; #rp-roster-details
   keeps its id because the render-on-first-expand wiring and the e2e suite
   both address it. */

.rp-roster-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.rp-roster-search input {
  min-width: 240px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--fs-base);
}

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

.rp-roster-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
}

.rp-roster-chip[aria-pressed="true"] {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
}

.rp-roster-chip-n {
  font-size: var(--fs-xs);
  opacity: 0.75;
}

.rp-roster-count {
  margin: 4px 0 10px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.rp-sig-row {
  display: grid;
  grid-template-areas: "name cat track domain";
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--fs-base);
}

.rp-sig-name {
  grid-area: name;
  color: var(--text);
  font-weight: 500;
}

.rp-sig-cat { grid-area: cat; }
.rp-sig-track { grid-area: track; }
.rp-sig-domain { grid-area: domain; }

.rp-sig-cat,
.rp-sig-track,
.rp-sig-domain {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.rp-sig-domain {
  overflow-wrap: anywhere;
}

.rp-sig-tracked {
  font-size: var(--fs-2xs);
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 700px) {
  .rp-sig-row,
  .rp-sig-row.has-lens {
    grid-template-areas: none;
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .rp-sig-row > * {
    grid-area: auto;
  }
}

/* --- 4. State panel ------------------------------------------------------ */

.state-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 6vh, 72px) 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* [hidden] trap: the display override above would beat the attribute. */
.state-modal[hidden] {
  display: none;
}

.state-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.state-modal__dialog {
  position: relative;
  z-index: 1;
  margin: auto;
  width: min(720px, 100%);
  max-height: calc(100vh - clamp(32px, 12vh, 144px));
  overflow-y: auto;
  padding: 22px 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.38);
  animation: state-modal-in 160ms ease-out;
}

@keyframes state-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

body.state-modal-open {
  overflow: hidden;
}

.state-detail .detail-header h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-2xl);
  margin: 2px 0 6px;
}

.sd-gov-name {
  color: var(--text);
}

.sd-gov-link {
  margin-left: 8px;
  font-size: var(--fs-xs);
}

.sd-gov-none {
  color: var(--text-muted);
  font-style: italic;
}

.state-detail-body {
  margin-top: 18px;
}

.sd-section {
  margin-bottom: 22px;
}

.sd-section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--fs-md);
  color: var(--text);
}

.sd-section-count {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.sd-empty {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-muted);
  font-style: italic;
}

.sd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sd-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
}

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

.sd-item-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 2px 0;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.sd-item-btn:hover .sd-item-label {
  color: var(--link);
}

.sd-item-label {
  font-size: var(--fs-base);
  color: var(--text);
}

.sd-item-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.state-loading {
  color: var(--text-muted);
  font-style: italic;
}

/* ==========================================================================
   Shape graphics + Home briefing chrome
   ==========================================================================
   The proportional roster bar and the 50-state strip render inside the
   Pledge tab's Coverage section (v3 — they moved out of the Home band, which
   now carries numbers, the briefing, and the per-tab cards). .pledge-panel-h
   survives as the kicker-style heading the Home briefing sections share.
   ========================================================================== */

/* --- coverage bar -------------------------------------------------------- */

.pledge-bar {
  display: flex;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface-2);
}

.pledge-bar-seg {
  min-width: 2px;
}

/* One accent, stepped by weight — categories are parts of a whole, not
   independent series, so they share a hue rather than getting five colours. */
.pledge-bar-seg.cat-cooperative { background: #1f4e79; }
.pledge-bar-seg.cat-utility     { background: #3d7ab0; }
.pledge-bar-seg.cat-developer   { background: #6ba3d6; }
.pledge-bar-seg.cat-hyperscaler { background: #11151c; }
.pledge-bar-seg.cat-governor    { background: #9dc2e3; }

[data-theme="dark"] .pledge-bar-seg.cat-cooperative { background: #4a8ec4; }
[data-theme="dark"] .pledge-bar-seg.cat-utility     { background: #6ba3d6; }
[data-theme="dark"] .pledge-bar-seg.cat-developer   { background: #8fbde4; }
[data-theme="dark"] .pledge-bar-seg.cat-hyperscaler { background: #e8ebf0; }
[data-theme="dark"] .pledge-bar-seg.cat-governor    { background: #b5d2ec; }

.pledge-bar-key {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.pledge-bar-key-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.pledge-bar-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--border-strong);
}

.cat-cooperative .pledge-bar-swatch { background: #1f4e79; }
.cat-utility     .pledge-bar-swatch { background: #3d7ab0; }
.cat-developer   .pledge-bar-swatch { background: #6ba3d6; }
.cat-hyperscaler .pledge-bar-swatch { background: #11151c; }
.cat-governor    .pledge-bar-swatch { background: #9dc2e3; }

[data-theme="dark"] .cat-cooperative .pledge-bar-swatch { background: #4a8ec4; }
[data-theme="dark"] .cat-utility     .pledge-bar-swatch { background: #6ba3d6; }
[data-theme="dark"] .cat-developer   .pledge-bar-swatch { background: #8fbde4; }
[data-theme="dark"] .cat-hyperscaler .pledge-bar-swatch { background: #e8ebf0; }
[data-theme="dark"] .cat-governor    .pledge-bar-swatch { background: #b5d2ec; }

.pledge-bar-key-n {
  color: var(--text);
  font-weight: 600;
}

.pledge-bar-note {
  flex-basis: 100%;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-style: italic;
}

.pledge-bar-loading {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-style: italic;
}

/* --- state strip --------------------------------------------------------- */

.pledge-state-strip {
  display: grid;
  grid-template-columns: repeat(25, minmax(0, 1fr));
  gap: 3px;
  margin-top: 12px;
}

.pledge-state-cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Four density steps rather than a continuous ramp — the counts are small and
   a smooth scale would imply precision the data doesn't carry. */
.pledge-state-cell.lvl-0 { background: var(--surface); }
.pledge-state-cell.lvl-1 { background: #dbe6f1; border-color: #c3d5e8; }
.pledge-state-cell.lvl-2 { background: #9dc2e3; border-color: #7fb0d8; }
.pledge-state-cell.lvl-3 { background: #3d7ab0; border-color: #2f6796; }

[data-theme="dark"] .pledge-state-cell.lvl-1 { background: #1c2f42; border-color: #27435e; }
[data-theme="dark"] .pledge-state-cell.lvl-2 { background: #2f6796; border-color: #3d7ab0; }
[data-theme="dark"] .pledge-state-cell.lvl-3 { background: #6ba3d6; border-color: #8fbde4; }

.pledge-state-cell:hover {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.pledge-state-abbr {
  font-size: 0.56rem;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--text);
}

.pledge-state-cell.lvl-3 .pledge-state-abbr { color: #ffffff; }
[data-theme="dark"] .pledge-state-cell.lvl-3 .pledge-state-abbr { color: #0e1117; }

/* Governor-signed states carry a corner mark, not a colour — colour is already
   carrying record density and must not do two jobs. */
.pledge-state-cell.is-gov::after {
  content: "★";
  position: absolute;
  top: -1px;
  right: 1px;
  font-size: 0.44rem;
  line-height: 1;
  color: var(--accent);
}

[data-theme="dark"] .pledge-state-cell.is-gov::after { color: #b5d2ec; }

.pledge-strip-key {
  margin: 8px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* --- activity feed ------------------------------------------------------- */

/* --- What's next: dated docket milestones on Home ------------------------ */


/* --- Utility rollup (aggregate "By utility" sub-tab) --------------------- */

.agg-utility-signed {
  display: inline-block;
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--tariff-approved);
  border: 1px solid var(--tariff-approved);
  border-radius: 4px;
  padding: 1px 6px;
}

/* --- Rate cases & proceedings (Tariffs tab) ------------------------------ */

.rc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rc-item {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 10px 12px;
}

.rc-item--empty {
  color: var(--text-muted);
  border-style: dashed;
}

.rc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rc-state {
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 600;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1px 6px;
}

.rc-state--fed {
  color: var(--tariff-federal);
  border-color: var(--tariff-federal);
}

.rc-title {
  font-weight: 600;
  font-size: var(--fs-base);
}

.rc-meta {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.rc-src,
.rc-perma {
  white-space: nowrap;
}

/* 44px touch floor, coarse pointers only — see the .subtab rule above for the
   same pattern. At the desktop scale this inline link inherits .rc-meta's
   0.75rem line box with no padding, well under the floor for a thumb. */
@media (pointer: coarse) {
  .rc-src,
  .rc-perma {
    display: inline-block;
    min-height: 44px;
    min-width: 44px;
    padding: 12px 4px;
    margin: -12px -4px;
  }
}

.rc-summary {
  margin: 6px 0 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  max-width: 78ch;
}

.rc-next {
  margin: 6px 0 0;
  font-size: var(--fs-xs);
}

.rc-next-lbl {
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--fs-2xs);
}

.rc-next-date {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .pledge-state-strip { grid-template-columns: repeat(13, minmax(0, 1fr)); }
}

/* 44px touch floor (AGENTS.md), gated on pointer so desktop stays dense.
   MUST come after the 760px rule above — same specificity, so source order
   is what lets the coarse override win on phones. auto-fill lets the grid
   pick however many ≥44px columns fit (7 on a 390px viewport) instead of
   forcing 13 ~23px cells; the aspect-ratio on the cell keeps them square. */
@media (pointer: coarse) {
  .pledge-state-strip {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  }
}

/* --- Scorecard filter bar (v2) --------------------------------------------
   Sticky under the tab bar. The scorecard runs to 39 cards and growing, and
   before this the only way to reach a site was to scroll past all of them
   (BACKLOG: "Long Ratepayer scorecard"). Sticky offset matches the tab bar's
   height so the two never overlap. */

.rp-filterbar {
  position: sticky;
  top: 41px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.rp-filter-search input {
  min-width: 220px;
  padding: 6px 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--fs-base);
}

.rp-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rp-filter-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  cursor: pointer;
}

.rp-filter-chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

/* Status chips carry the same hue language as the cards they filter. */
.rp-filter-chip.is-affirmed[aria-pressed="true"] {
  border-color: var(--ratepayer-affirmed);
}
.rp-filter-chip.is-pledge_only[aria-pressed="true"] {
  border-color: var(--ratepayer-pledge_only);
}
.rp-filter-chip.is-contested[aria-pressed="true"] {
  border-color: var(--ratepayer-contested);
}

.rp-filter-chip-n {
  font-size: var(--fs-xs);
}

.rp-filter-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
}

.rp-filter-count {
  margin: 0 0 0 auto;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .rp-filterbar {
    position: static;
  }
  .rp-filter-count {
    margin-left: 0;
  }
}

/* --- Signatory roster lens (v2, P5) ---------------------------------------
   The roster row IS the lens — no per-signatory pages for 300 organizations.
   A row only becomes expandable when we can say something concrete about it;
   most cooperatives stay flat, which is the honest state. */

.rp-sig-row.has-lens {
  grid-template-areas:
    "name cat track domain"
    "expand expand expand expand"
    "lens lens lens lens";
}

.rp-sig-expand {
  grid-area: expand;
  justify-self: start;
  margin-top: 2px;
  padding: 2px 0;
  background: none;
  border: none;
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--accent);
  cursor: pointer;
}

.rp-sig-expand:hover {
  text-decoration: underline;
}

.rp-sig-lens {
  grid-area: lens;
  margin: 6px 0 4px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
}

/* [hidden] trap: the block display above would beat the attribute. */
.rp-sig-lens[hidden] {
  display: none;
}

.rp-sig-lens-h {
  /* Overrides the global uppercase h4/h5 treatment. */
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--text-muted);
}

.rp-sig-lens-h + .rp-sig-lens-list {
  margin-bottom: 8px;
}

.rp-sig-lens-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rp-sig-lens-link {
  background: none;
  border: none;
  padding: 2px 0;
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--link);
  text-align: left;
  cursor: pointer;
}

.rp-sig-lens-link:hover {
  text-decoration: underline;
}

.rp-sig-lens-note,
.rp-sig-lens-loading {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--text-muted);
  font-style: italic;
}

/* ===================== Policies & Agreements View (v3.1) ===================== */
/* Reuses the tariff table/modal and the moratorium bar charts; only the bits
   that are new to this record type live here. */

.badge-cbf {
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

.policy-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.policy-theme {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  white-space: nowrap;
}
.policy-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.policy-captured {
  font-size: var(--fs-base);
  margin-top: 1rem;
}

.linkish {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}
.linkish:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.policy-table .badge {
  white-space: nowrap;
}

/* Delivered-vs-promised chip on a policy directory row: the claim palette,
   one token per status, in both themes via the existing --delivered-* vars. */
.policy-delivered {
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  vertical-align: middle;
}
.policy-delivered.delivered-delivered {
  color: var(--delivered-delivered);
  background: var(--delivered-delivered-soft);
}
.policy-delivered.delivered-partial {
  color: var(--delivered-partial);
  background: var(--delivered-partial-soft);
}
.policy-delivered.delivered-contested {
  color: var(--delivered-contested);
  background: var(--delivered-contested-soft);
}
.policy-delivered.delivered-shortfall {
  color: var(--delivered-shortfall);
  background: var(--delivered-shortfall-soft);
}
#pd-delivered {
  margin: 0.75rem 0;
}

/* ---- Policy playbook: principle cards + latest actions (v3.2) ---- */
#subpane-pol-principles { animation: none; }
.pb-principles {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem; align-items: start;
}
.pb-principle {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.pb-topic-toggle {
  cursor: pointer; padding: .65rem .75rem; color: var(--text);
  font-size: var(--fs-sm); font-weight: 600;
}
.pb-topic-toggle::marker { color: var(--accent); }
.pb-principle:has(details[open]) { grid-column: 1 / -1; }
.pb-topic-body { padding: 0 .75rem .5rem; }
.pb-examples { list-style: none; padding: 0; margin: 0; }
.pb-examples li { padding: .5rem 0; border-top: 1px solid var(--border); }
.pb-example-term { font-size: var(--fs-sm); }
.pb-principle-counts { font-size: var(--fs-xs); color: var(--text-muted); }
.pb-example-term { margin: .15rem 0; }
.pb-source, .pb-example-title, .pb-see-all, #policy-heat-abroad { font-size: var(--fs-sm); }
#policy-heat-abroad { margin-top: .4rem; }
.pb-action-where { font-size: var(--fs-2xs); font-weight: 600; color: var(--text-muted); }
@media (min-width: 700px) {
  .pb-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .85rem; }
}
@media (max-width: 600px) {
  .pb-principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pb-topic-toggle { padding: .45rem .5rem; }
}
@media (pointer: coarse) {
  .pb-topic-toggle, .pb-source, .pb-example-title, #policy-heat-abroad { min-height: 44px; box-sizing: border-box; }
  .pb-source { display: inline-flex; align-items: center; }
}

.pb-actions {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.pb-action {
  border-bottom: 1px solid var(--border);
}
.pb-action-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 7.5rem 3rem 1fr;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.pb-action-btn:hover .pb-action-text {
  color: var(--accent);
  text-decoration: underline;
}
.pb-action-date {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pb-action-text {
  font-size: var(--fs-base);
  line-height: 1.35;
}
.pb-action-note {
  grid-column: 3;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
@media (pointer: coarse) {
  .pb-see-all,
  .pb-action-btn {
    min-height: 45px;
  }
  .pb-see-all {
    display: inline-flex;
    align-items: center;
    padding: 0 0.35rem;
  }
}
@media (max-width: 560px) {
  .pb-action-btn {
    grid-template-columns: 5.6rem 1fr;
  }
  .pb-action-where {
    grid-column: 1;
    grid-row: 2;
  }
  .pb-action-note {
    grid-column: 2;
  }
}

/* Buttons, selects and inputs default to the platform's UI font, and
   Leaflet sets Helvetica Neue on the map: both inherit the site face. */
button,
input,
select,
textarea {
  font-family: inherit;
}
/* Leaflet's stylesheet lazy-loads AFTER this one and sets `font:` shorthands
   (Helvetica Neue; Lucida Console on the zoom buttons), so an equal-specificity
   rule here loses. The body prefix wins regardless of load order. */
body .leaflet-container,
body .leaflet-container .leaflet-bar a,
body .leaflet-container .leaflet-control-attribution {
  font-family: var(--font-sans);
}

/* ==========================================================================
   v5 (2026-10-08): view-level sub-tabs, Companies profiles + commitment
   depth, Sites contested pane + timelines, compact filter bars.
   ========================================================================== */

/* A view-level strip sits right under the hero, so the reader picks a pane
   before scrolling. Slightly heavier than an in-section strip. */
.subtabs--view {
  margin-top: 0.4rem;
}
.subtabs--view .subtab {
  font-size: var(--fs-md);
  padding: 9px 16px;
}

.btn-link {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--accent);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }
.btn-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Commitment depth: Specific / General / None found -------------------- */
.depth-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.depth-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.depth-chip {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.3;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
button.depth-chip { cursor: pointer; }
button.depth-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.depth-chip.depth-specific {
  background: var(--accent);
  color: var(--surface);
}
.depth-chip.depth-general {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}
.depth-chip.depth-none {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  font-weight: 400;
}
.depth-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  flex: none;
}
.depth-mark.depth-specific { background: var(--accent); }
.depth-mark.depth-general {
  background: var(--surface);
  border: 2px solid var(--accent);
}
.depth-mark.depth-none {
  border: 1px dashed var(--border-strong);
}
.matrix .cell .depth-mark { margin-right: 6px; }
.cell-none { font-size: var(--fs-xs); }
.matrix .cell.depth-cell-specific .count { color: var(--accent); }
.matrix .cell.depth-cell-general .count { color: var(--text); font-weight: 400; }
.theme-head-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: center;
}
.theme-head-btn:hover { color: var(--accent); text-decoration: underline; }
.theme-head-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Profiles ------------------------------------------------------------- */
.co-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.co-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
}
.co-card-head { display: flex; flex-direction: column; gap: 3px; }
.co-card-name {
  margin: 0;
  font-size: var(--fs-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.co-card-name .company-dot,
.tq-co .company-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--co-color, var(--accent));
  flex: none;
}
.co-sub {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 400;
}
.co-pledge {
  margin-top: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
}
.co-pledge.signed { color: var(--accent); }
.co-pledge.unsigned { color: var(--text-muted); }
.co-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 0;
}
.co-facts dt {
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--text-muted);
}
.co-facts dd {
  margin: 2px 0 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.co-label {
  margin: 0 0 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
}
.co-label .muted { font-weight: 400; }
.depth-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.co-response .co-sub { margin-top: 5px; }
.stance-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
}
.stance-bar .positive { background: var(--stance-positive); }
.stance-bar .mixed { background: var(--stance-mixed); }
.stance-bar .negative { background: var(--stance-negative); }
.sw { font-weight: 600; white-space: nowrap; }
.sw.positive { color: var(--stance-positive); }
.sw.mixed { color: var(--stance-mixed); }
.sw.negative { color: var(--stance-negative); }
.stance-words { font-size: var(--fs-xs); }
.agg-status-words {
  display: block;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
}
.co-card-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

/* ---- Commitments: quotes panel ------------------------------------------- */
.theme-quotes {
  margin-top: 1.6rem;
  scroll-margin-top: 80px;
}
.theme-quotes-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0.8rem;
}
.theme-quotes-title {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 400;
}
.theme-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-pick {
  font: inherit;
  font-size: var(--fs-sm);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--theme-color, var(--accent));
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-pick[aria-pressed="true"] {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
.theme-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-quotes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tq-row {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--co-color, var(--accent));
  border-radius: var(--radius);
  background: var(--surface);
}
.tq-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.tq-co {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}
.tq-n { font-size: var(--fs-xs); }
.tq-none { margin: 6px 0 0; font-size: var(--fs-sm); }
.tq-quotes {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tq-quote .claim-quote { margin: 0; }
.tq-meta {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}
.tq-fig {
  font-weight: 700;
  color: var(--accent);
  margin-right: 6px;
}
.tq-back { list-style: none; }
@media (max-width: 600px) {
  .co-cards { grid-template-columns: 1fr; }
}

/* ---- Compact filter bars (Sites, Tariffs) -------------------------------- */
/* Filters were a full accordion with a label above every select; the
   select's own first option already says what it filters ("All states"),
   so the visible label goes to screen readers only and the bar is a row. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
}
.filter-bar .theme-filter-row { margin-bottom: 0; }
.filter-bar .explorer-filters,
.filter-bar.filter-bar--slim {
  flex-direction: row;
}
.filter-bar .explorer-filters,
.filter-bar--slim {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 0;
  border: none;
  background: none;
  margin: 0;
}
.filter-bar .filter,
.filter-bar--slim .filter {
  display: inline-flex;
  flex: 0 1 auto;
  margin: 0;
}
.filter-bar select,
.filter-bar--slim select {
  font: inherit;
  font-size: var(--fs-sm);
  padding: 5px 8px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  max-width: 220px;
}
.filter-bar-meta {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.filter-bar--slim .filter-bar-meta { margin-left: auto; }

/* ---- Contested sites + timelines ----------------------------------------- */
.contested-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}
.contested-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--co-color, var(--accent));
  border-radius: var(--radius);
}
.contested-head { display: flex; flex-direction: column; gap: 3px; }
.contested-eyebrow {
  margin: 0;
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--text-muted);
}
.contested-name { margin: 0; font-size: var(--fs-lg); }
.contested-facts { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); }
.reason-chips {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.reason-chip {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--stance-negative-soft);
  color: var(--stance-negative);
}
.contested-next {
  margin: 0;
  font-size: var(--fs-sm);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.contested-foot { margin-top: auto; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  position: relative;
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding: 0 0 12px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  bottom: -2px;
  width: 2px;
  background: var(--border);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  z-index: 1;
}
.tl-item[data-kind="response"] .tl-dot { background: var(--surface); border: 2px solid var(--text-muted); }
.tl-item[data-stance="positive"] .tl-dot { border-color: var(--stance-positive); }
.tl-item[data-stance="mixed"] .tl-dot { border-color: var(--stance-mixed); }
.tl-item[data-stance="negative"] .tl-dot { border-color: var(--stance-negative); }
.tl-item[data-kind="lawsuit"] .tl-dot { background: var(--stance-negative); }
.tl-body p { margin: 0; }
.tl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.tl-kind {
  font-size: var(--fs-2xs);
  font-weight: 600;
}
.tl-flag {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.tl-flag-awaiting { border-color: var(--border-strong); color: var(--text-muted); }
.tl-title { font-size: var(--fs-sm); line-height: 1.4; margin-top: 2px !important; }
.tl-summary { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px !important; }
.tl-src { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px !important; }
.tl-more { list-style: none; padding-left: 24px; }
@media (max-width: 600px) {
  .contested-list { grid-template-columns: 1fr; }
  .filter-bar select { max-width: 100%; }
}

/* ---- Sites list cards ----------------------------------------------------- */
.project-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}
.status-pill {
  font-size: var(--fs-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.status-pill.status-operational { color: var(--stance-positive); background: var(--stance-positive-soft); }
.status-pill.status-construction { color: var(--stance-mixed); background: var(--stance-mixed-soft); }
.project-card .reason-chip { font-size: var(--fs-2xs); padding: 2px 7px; }
.project-stance-row { margin: 6px 0 0; }
.project-next {
  margin: 6px 0 0;
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: 600;
}

/* ---- Rate cases: clamped summaries ---------------------------------------- */
.rc-item .clampable {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.rc-item .rc-summary.clampable { -webkit-line-clamp: 3; line-clamp: 3; }
.rc-item.is-expanded .clampable {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}
.rc-next-lbl {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.rc-next-date { font-weight: 600; }
.rc-more { margin-top: 2px; }

/* ---- v5 mobile pass (2026-10-08) ----------------------------------------- */
/* Three view sub-tabs on one row at 390px instead of wrapping to two. */
@media (max-width: 600px) {
  .subtabs--view .subtab {
    padding: 8px 8px;
    font-size: var(--fs-base);
    gap: 4px;
  }
  .subtabs--view .subtab-count { padding: 1px 5px; }
}
/* Touch targets: chips and inline link-buttons were ~20px tall on a phone,
   under the 24px WCAG 2.5.8 minimum. Coarse pointers only, so the desktop
   chip scale is unchanged (same approach as the .subtab 44px floor). */
@media (pointer: coarse) {
  /* 44px, the repo's touch floor (AGENTS.md), not 32 (Codex, PR #62). */
  .depth-chip,
  .theme-pick,
  .btn-link {
    min-height: 44px;
  }
  .depth-chip { padding: 5px 10px; }
  .theme-head-btn {
    display: block;
    width: 100%;
    min-height: 44px;
  }
}
.contested-more {
  list-style: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 8px 0;
}

/* ---- Home v6 (2026-10-08): section headings + the two feeds -------------- */
/* A real heading, not an eyebrow: sentence case, full ink, readable size. */
.home-h {
  margin: 1.6rem 0 0.7rem;
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--text);
}
.home-body > .home-h:first-child { margin-top: 0.4rem; }
.home-latest { margin-top: 0.4rem; }
.home-latest .home-h { margin-top: 0.4rem; }
.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.feed-item { border-bottom: 1px solid var(--border); }
.feed-btn {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  grid-template-areas:
    "date type"
    "date title"
    "date place";
  column-gap: 12px;
  row-gap: 2px;
  width: 100%;
  padding: 10px 4px;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.feed-btn:hover .feed-title { color: var(--accent); text-decoration: underline; }
.feed-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.feed-date {
  grid-area: date;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.feed-type { grid-area: type; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.feed-title { grid-area: title; font-size: var(--fs-base); line-height: 1.4; color: var(--text); }
.feed-place { grid-area: place; font-size: var(--fs-xs); color: var(--text-muted); }
.feed-place:empty { display: none; }
#whats-next-more { margin-top: 8px; }
/* Phones: one compact row per section (name and sub-line left, number
   right). The 2x3 grid of tall cards pushed Latest two swipes and Coming up
   four swipes below the fold (tools/interaction_cost.py, 2026-10-08). */
@media (max-width: 600px) {
  #view-overview .hero-dek { font-size: var(--fs-base); }
  #view-overview .hero { margin-bottom: 10px; }
  .home-h { margin-top: 14px; }
  .home-cards { grid-template-columns: 1fr; gap: 6px; }
  #home-latest-list.is-capped > li:nth-child(n + 6) { display: none; }
  .home-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title num" "sub num";
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
    padding: 10px 14px;
  }
  .home-card-title { grid-area: title; font-size: var(--fs-md); }
  .home-card-num { grid-area: num; font-size: var(--fs-2xl); }
  .home-card-sub { grid-area: sub; }
  .feed-btn { grid-template-columns: 5.2rem minmax(0, 1fr); }
}

/* ---- Accordions you can see are accordions (2026-10-08, owner-directed) --
   The section header was a hairline, a thin serif title and a 9px chevron at
   the far edge: readers didn't see it as a heading or as something that
   opens. Now each section is a bordered card whose header is a tinted bar,
   the title carries weight, and the control says what it does ("Show" /
   "Hide"). The text is CSS-generated inside the aria-hidden chevron, so
   assistive tech still gets the native <details> expanded state instead. */
.acc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 0 0 1rem;
}
.acc > summary {
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.acc[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.acc > summary:hover { background: var(--accent-soft); }
.acc > .acc-body { padding: 14px 16px 16px; }
.acc-title {
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.acc-chevron {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: auto;
  margin-left: 0;
  padding: 4px 10px 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  transform: none;
  white-space: nowrap;
}
.acc[open] > summary .acc-chevron { transform: none; }
.acc-chevron::before { content: "Show"; }
.acc[open] > summary .acc-chevron::before { content: "Hide"; }
.acc-chevron::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease;
}
.acc[open] > summary .acc-chevron::after { transform: translateY(2px) rotate(225deg); }
.acc-count { font-size: var(--fs-xs); }
/* The dark pledge band keeps its own skin; it is already unmistakable. */
.acc.acc--band { border: none; background: var(--band-bg); }
.acc--band > summary {
  background: transparent;
  padding: clamp(20px, 3vw, 32px) clamp(18px, 3vw, 36px);
}
.acc--band > summary:hover { background: transparent; }
.acc--band .acc-title { color: var(--band-text); }
.acc--band[open] > summary { border-bottom: none; }
.acc--band > .acc-body { padding: 0 clamp(18px, 3vw, 36px) clamp(20px, 3vw, 32px); }
/* Headings throughout: one step heavier so they read as headings. */
.hero-title,
.theme-quotes-title { font-weight: 600; }

/* ---- Benefit agreements (#agreements, 2026-10-08) --------------------------
   One card per agreement. Full cards (Most complete) list all nine terms so a
   missing one is visible; compact cards (All) list only what is present and
   fold the terms into a disclosure. */
.cba-note {
  max-width: 64ch;
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: var(--fs-base);
  line-height: 1.5;
}
.cba-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.cba-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cba-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.cba-kind {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.cba-title {
  flex-basis: 100%;
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.3;
}
.cba-facts {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.cba-value {
  margin: 10px 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.cba-value-num {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.cba-feat-count {
  margin: 10px 0 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.cba-feats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cba-feat {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: var(--surface);
}
.cba-feat.is-on {
  color: var(--text);
  border-color: var(--delivered-delivered, var(--accent));
  background: var(--accent-soft);
}
.cba-summary {
  margin: 10px 0 0;
  font-size: var(--fs-base);
  line-height: 1.5;
}
.cba-terms {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.cba-src {
  margin: 8px 0 0;
  font-size: var(--fs-sm);
}
.cba-more {
  margin-top: 8px;
}
.cba-more > summary {
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
}
.cba-card .claim-delivered {
  margin-top: 10px;
}
.cba-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.cba-feature {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.cba-feature-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 600;
}
.cba-feature-test {
  margin: 6px 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.45;
}
.cba-feature-count {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.cba-feature-who {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: var(--fs-sm);
}
@media (pointer: coarse) {
  .cba-more > summary {
    min-height: 44px;
  }
}

/* The "Show N more" control only matters where the list is capped (phones). */
.home-latest-more { margin-top: 8px; }
@media (min-width: 601px) {
  .home-latest-more { display: none; }
}
.home-latest-more[hidden] { display: none; }

/* One line each on phones (owner, 2026-10-08): site title, sub-tab labels. */
.subtab { white-space: nowrap; }
@media (max-width: 640px) {
  .topbar h1 {
    font-size: var(--fs-xl);
    white-space: nowrap;
  }
  .hero-title,
  #view-overview .hero-title { font-size: var(--fs-lg); }
  .subtabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .subtab { padding: 8px 10px; }
  /* Stat tiles: an even two-column grid instead of a ragged wrap. */
  .rp-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .topbar h1 { font-size: var(--fs-lg); }
}

/* A rate case opened from Home is marked so the reader finds it in the list. */
.rc-item.is-target {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* Key provisions summary on the Benefits tab: a compact chip row, so the
   agreement cards stay within the swipe budget. */
.cba-prov-title { margin: 0.6rem 0 0.4rem; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.cba-prov-title .muted { font-weight: 400; color: var(--text-muted); }
.cba-prov-chips { list-style: none; margin: 0 0 0.8rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cba-prov-chip { font-size: var(--fs-xs); color: var(--text); background: var(--surface-2); border-radius: 999px; padding: 2px 10px; }
.cba-prov-num { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* A direct route to the editable plans from every dashboard view. */
.plans-entry { margin: 0 0 12px; }
.plans-entry a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 44px; padding: .6rem 1rem;
  border-radius: var(--radius-sm); color: var(--band-text); background: var(--band-bg);
  text-decoration: none;
}
.plans-entry strong { font: 600 var(--fs-xl)/1.25 var(--font-serif); }
.plans-entry a span span { color: var(--band-text-muted); margin-inline-start: .65rem; }
.plans-entry a > span:last-child { font-size: var(--fs-xl); color: var(--band-accent); }
.plans-entry a:is(:hover, :focus-visible) strong { text-decoration: underline; }
.plans-entry a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
@media (max-width: 640px) {
  .plans-entry a span span { display: block; margin: .1rem 0 0; font-size: var(--fs-sm); }
  /* Keep the one-tap link on topic pages without displacing their directories. */
  .plans-entry:has(+ #view-overview[hidden]) { margin-bottom: 0; }
  .plans-entry:has(+ #view-overview[hidden]) a { padding-block: 0; }
  .plans-entry:has(+ #view-overview[hidden]) #plans-entry-description { display: none; }
}

/* Planning tools share Frameworks routing; the guide module loads on demand. */
.home-tasks, .guide-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.home-tasks button, .guide-controls button, .guide-controls select {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit;
}
@media (pointer: coarse) {
  .guide-controls a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: .5rem; }
}
.home-tasks button, .guide-controls button { cursor: pointer; }
.home-tasks button:hover, .guide-controls button:hover { border-color: var(--accent); }
.home-tasks button:focus-visible, .guide-controls :focus-visible, .guide-clause summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.planning-guide { max-width: 900px; }
#subpane-pol-evidence > p { margin: 8px 0; }
.guide-notice { font-size: var(--fs-sm); color: var(--text-muted); }
.guide-decision { border-left: 3px solid var(--accent); padding-left: 12px; }
.guide-clause { border-bottom: 1px solid var(--border); padding: 6px 0; }
.guide-clause summary { min-height: 44px; padding: 10px 6px; cursor: pointer; font-weight: 600; }
.guide-clause p, .planning-guide > p { line-height: 1.55; }
.guide-clause dl { display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 8px; }
.guide-clause dt { font-weight: 600; }
.guide-clause dd { margin: 0; }
.planning-guide a { overflow-wrap: anywhere; }
#policy-stats[hidden] { display: none; }
#view-policies > .subtabs, #subpane-pol-agreements > .subtabs { flex-wrap: wrap; overflow-x: visible; }
@media (max-width: 640px) {
  .home-tasks { gap: 6px; }
  .home-tasks button { flex: 1; padding: 8px 6px; font-size: var(--fs-sm); }
  #view-policies > .subtabs .subtab, #subpane-pol-agreements > .subtabs .subtab { padding: 8px; font-size: var(--fs-sm); }
  .guide-controls select { max-width: 100%; }
  .guide-clause dl { grid-template-columns: 1fr; gap: 4px; }
  .guide-clause dd { margin-bottom: 8px; }
}

/* Policy detail: hand-off to the matching draft plan (#72). */
.pd-next p { margin: 0.25rem 0; }
.pd-next-note { font-size: var(--fs-sm); }

/* Phones: the Key Reasons badges wrapped into a tall column, making each of
   185 rows ~115px and the directory ~20 screens long. Reasons stay in the
   detail panel. */
@media (max-width: 600px) {
  .moratorium-table .mor-col-reasons { display: none; }
}
/* #78: an abandoned site stays on the record, visibly inactive. */
.status-pill.status-withdrawn { color: var(--text-muted); background: var(--surface-2, var(--surface)); text-decoration: line-through; }
.project-list-more { list-style: none; padding: 0.75rem 0; text-align: center; }
/* Paging controls are the only way to reach hidden rows: full touch target. */
@media (pointer: coarse) {
  .project-list-more .btn-ghost { min-height: 44px; padding-left: 1rem; padding-right: 1rem; }
}

/* ===================== International view (v6) ===================== */
.world-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.75rem;
}
.world-card-btn { width: 100%; text-align: left; }
.world-records { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.75rem; }
.world-quote { margin: 0.4rem 0; }
.world-translation { margin: 0.25rem 0 0; font-size: var(--fs-sm); }
.world-translation-label {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.world-formality-de_facto, .world-formality-administrative { font-style: italic; }
.world-responses { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.4rem; }
.world-context { margin: 0.5rem 0 1rem; padding-left: 1.1rem; }
.world-note { margin-top: 1.5rem; font-size: var(--fs-xs); }
.world-country { margin-bottom: 1rem; }
/* Phones: country cards as a compact list; the summary is on the country page. */
@media (max-width: 640px) {
  .world-cards { gap: 0.4rem; }
}
/* Nine tabs (v6) must still fit two rows on a 360-390px phone; a third row
   pushed every view's content down ~44px (interaction-cost regressions). */
@media (max-width: 640px) {
  .tab { padding-left: 2px; padding-right: 2px; }
}
@media (max-width: 380px) {
  .tab { padding-left: 2px; padding-right: 2px; font-size: var(--fs-2xs); }
}
/* v6: eight cards (International added). One column of eight pushed Home's
   Latest feed off the first phone screen, so phones get two columns with the
   number under the title. */
@media (max-width: 600px) {
  .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title num" "sub sub";
    align-items: start;
    padding: 8px 12px;
  }
  .home-card-num { font-size: var(--fs-xl); }
  .home-card-sub { font-size: var(--fs-xs); }
}

/* Plain-HTML summary written by refresh.py into the Home view so crawlers and
   no-JS readers get the answers the app otherwise paints from JSON. */


/* ==========================================================================
   UX consistency layer (2026-10-19, owner-directed)
   Model: the White House pledge page. A restrained civic document: serif
   headings, one sans, one navy accent, hairline rules, letterspaced kickers,
   plain copy. Everything below normalizes components shared across tabs
   rather than restyling one tab at a time.
   ========================================================================== */

.hero { position: relative; margin: 10px 0 14px; }

/* --- Theme toggle: a word, not a glyph ----------------------------------- */
#theme-toggle {
  width: auto;
  padding: 0 var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
}

/* --- ONE pill. Semantic colour (green / amber / red) or neutral hairline. -
   Every badge, status pill, chip and tag in the app shares this shape: square,
   11px, 600, uppercase, tracked. Colour appears only where it means a status;
   category tags (reason, jurisdiction type, source kind) are neutral. */
.badge,
.status-pill,
.reason-chip,
.rp-basis,
.rp-conflict-flag,
.rp-met-pill,
.rp-legend-chip,
.rc-next-lbl,
.rc-state,
.depth-chip,
.moratorium-bill-id,
.badge-moratorium,
.badge-tariff-federal,
.badge-jurisdiction-type,
.badge-reason-energy,
.badge-reason-water,
.badge-reason-air_quality,
.badge-reason-transparency,
.badge-reason-noise,
.badge-reason-equity {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
  margin-left: 0;
  border-left-width: 1px;
}
/* neutral category tags */
.badge-jurisdiction-type,
.badge-reason-energy,
.badge-reason-water,
.badge-reason-air_quality,
.badge-reason-transparency,
.badge-reason-noise,
.badge-reason-equity,
.badge-tariff-federal,
.badge-single-source,
.badge-gov,
.badge-cbf,
.moratorium-bill-id,
.rc-state {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.badge-reason-energy,
.badge-reason-water,
.badge-reason-air_quality,
.badge-reason-transparency,
.badge-reason-noise,
.badge-reason-equity {
  margin: 0 var(--sp-1) var(--sp-1) 0;
}
.moratorium-bill-id { padding: 2px 6px; }
.reason-chip { background: transparent; color: var(--text); border: 1px solid var(--border); }
/* Semantic colour kept where it encodes meaning (consolidation lost it):
   federal vs state, a contested-site concern, a community-benefits framework. */
.badge-tariff-federal,
.rc-state--fed {
  color: var(--tariff-federal);
  border-color: var(--tariff-federal);
  background: var(--tariff-federal-soft);
}
.rc-state--fed { background: transparent; }
.project-card .reason-chip {
  color: var(--stance-negative);
  border-color: var(--stance-negative);
}
.badge-cbf { color: var(--accent); border-color: var(--accent); }
.subtab-count { border-radius: var(--radius-sm); font-size: var(--fs-2xs); }
.acc-chevron { border-radius: var(--radius-sm); }
.btn-ghost { border-radius: var(--radius-sm); font-size: var(--fs-sm); }
.theme-filter-chip { border-radius: var(--radius-sm); font-size: var(--fs-xs); }

/* --- Cards: one hairline box ------------------------------------------- */
.project-card,
.cba-card,
.home-card,
.world-card-btn {
  box-shadow: none;
  border-radius: var(--radius-sm);
}
/* Site cards: the left stripe is the operator's identity colour (--co-color),
   not status chrome, so it stays. */
.project-card { background: var(--surface); }
.project-card.active,
.project-card:hover { border-color: var(--accent); border-left-color: var(--co-color, var(--accent)); }
/* Equal-height rows in the country grid, one gap in both directions. */
.world-cards { gap: var(--sp-3); }

/* --- Stat tiles: hairline, navy rule, no shadow -------------------------- */
.rp-stat { box-shadow: none; }

/* --- Section rhythm ------------------------------------------------------ */
.acc { margin-bottom: var(--sp-4); }

/* --- Filter bars: one control height, white fields ----------------------- */
.filter-bar input[type="search"],
.table-controls input[type="search"],
.filter-bar input[type="text"],
.table-controls input[type="text"] {
  font: inherit;
  font-size: var(--fs-sm);
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.filter-bar .btn-ghost,
.table-controls .btn-ghost { background: var(--surface); }

/* Pills whose text is quoted in sentences and read by assistive tech keep sentence case. */
.rp-basis,
.rp-conflict-flag { text-transform: none; letter-spacing: 0.02em; }

.world-card-btn { display: grid; align-content: start; gap: .25rem; height: 100%; padding: .6rem .75rem; border: 1px solid var(--border); color: var(--text); background: var(--surface); text-decoration: none; }
.world-card-btn:hover, .world-card-btn:focus-visible { border-color: var(--accent); }
.world-card-btn small { color: var(--text-muted); }
@media (max-width: 36rem) {
  .world-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.5rem), 1fr)); gap: .5rem; }
  .world-card-btn { padding: .4rem .5rem; gap: .125rem; min-height: 44px; }
}
.world-record { min-width: 0; overflow-wrap: anywhere; }
.world-record summary { cursor: pointer; padding-inline-end: 1.5rem; position: relative; list-style: none; }
.world-record summary::-webkit-details-marker { display: none; }
.world-record summary::after { content: "+"; position: absolute; right: .25rem; top: .25rem; }
.world-record details[open] > summary::after { content: "−"; }
.world-record details[open] > summary { margin-bottom: .75rem; }
@media (pointer: coarse) {
  .world-record summary, #world-country-back, #world-search, #d-company { min-height: 44px; }
}

/* Election results and the underlying statements share the site's neutral
   palette. Party names carry information without a second colour legend. */
.election-filters { flex-direction: row; align-items: end; flex-wrap: wrap; margin-block: 8px; }
.election-overview { margin-bottom: 12px; }
.election-totals { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; }
.election-totals button { display: flex; align-items: baseline; gap: 6px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 4px 0; border-radius: 0; text-align: left; font-size: var(--fs-sm); }
.election-totals strong { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.election-totals button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); }
.election-pause-links { display: flex; flex-wrap: wrap; gap: 0 16px; border-block: 1px solid var(--border); }
.election-pause-links a { display: inline-flex; align-items: center; min-height: 32px; font-size: var(--fs-sm); }
@media (pointer: coarse) { .election-pause-links a, .election-totals button { min-width: 44px; min-height: 44px; } }
#elections-meta { margin: 6px 0; color: var(--text); font-size: var(--fs-sm); font-style: normal; }
.election-filters label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.election-filters input { width: min(100%, 280px); }
.election-directory { min-width: 0; }
.election-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--fs-sm); }
.election-table th, .election-table td { padding: 10px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.election-table thead th { font-weight: 600; color: var(--text); }
.election-table thead th:first-child { width: 25%; }
.election-place { font-weight: normal; scroll-margin-top: 190px; }
.election-office, .election-role { display: inline; margin: 0; }
.election-office { color: var(--text); font-size: var(--fs-sm); }
.election-toggle { margin-top: 6px; padding: 4px 8px; text-align: left; }
.election-people p { margin: 4px 0; }
.election-people p:last-child { margin-bottom: 0; }
.election-role { color: var(--text); }
.election-topic, .election-missing { margin: 0 0 8px; }
.election-topic:last-child, .election-missing:last-child { margin-bottom: 0; }
.election-summary .election-source { white-space: nowrap; }
.election-detail-row[hidden] { display: none; }
.election-detail-row > td { padding: 0; }
.election-detail-row .election-card { border-left: 2px solid var(--border); padding: 8px 12px; background: var(--surface); min-width: 0; scroll-margin-top: 190px; overflow-wrap: anywhere; }
.election-card p { margin: 8px 0; }
.election-transition { font-size: var(--fs-sm); }
.election-changes h4 { margin: 16px 0 4px; font-size: var(--fs-base); }
.election-changes .muted { font-size: var(--fs-sm); }
.election-candidates { display: grid; grid-template-columns: 1fr; gap: 10px; }
.election-candidates.election-single { grid-template-columns: 1fr; }
.election-candidate { min-width: 0; border-top: 1px solid var(--border); padding-top: 12px; }
.election-candidate h4 { margin: 0 0 10px; font-size: var(--fs-base); }
.election-evidence blockquote { margin: 12px 0 4px; padding-left: 12px; border-left: 2px solid var(--border); font-family: var(--font-serif); }
.election-evidence h4 { margin-bottom: 6px; }
.election-evidence .muted { font-size: var(--fs-sm); }
.election-related { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: var(--fs-sm); }
.election-empty { padding: 16px; border: 1px solid var(--border); }
@media (max-width: 640px) {
  .election-table, .election-table tbody { display: block; }
  .election-table thead { display: none; }
  .election-table .election-row { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--border); }
  .election-table .election-row > th, .election-table .election-row > td { width: auto; border: 0; padding: 10px 8px; }
  .election-table .election-row > .election-summary { grid-column: 1 / -1; padding-top: 0; }
  .election-detail-row:not([hidden]), .election-detail-row > td { display: block; }
  .election-detail-row > td { padding: 0; }
  .election-candidates { grid-template-columns: 1fr; }
  .election-filters label { flex: 1 1 140px; min-width: 0; }
  .election-filters label:first-child { flex-basis: 100%; }
  .election-filters input, .election-filters select { width: 100%; min-width: 0; }
  .election-card { padding: 12px; }
  .tab { padding-inline: 2px; min-width: 44px; }
}
@media (pointer: coarse) {
  .election-filters input, .election-filters select, .election-filters button,
  .election-related a, .election-related button,
  .election-source, .election-toggle, .election-place-head > a { min-height: 44px; }
  .election-related a, .election-source, .election-place-head > a { display: inline-flex; align-items: center; min-width: 44px; }
}

/* Jurisdiction geometry and public DOE references, loaded on the Map pane. */
#jurisdiction-map-content { --map-pause: #6f7fa1; --map-pause-edge: #4f6084; --map-framework: #689e98; --map-framework-edge: #356e68; --map-both: #79799b; --map-both-edge: #465c77; }
[data-theme="dark"] #jurisdiction-map-content { --map-pause-edge: #b2c3e6; --map-framework-edge: #9dcac5; --map-both-edge: #c0b8db; }
.view-scope { margin: 6px 0 0; font-size: var(--fs-sm); }
.directory-filters { align-items: end; margin-bottom: 12px; gap: 10px 12px; }
.directory-filters .filter { flex-direction: column; gap: 3px; }
.filter-name { font-size: var(--fs-sm); }
.directory-filters .export-btns { margin-left: auto; align-self: end; }
.directory-more-filters { font-size: var(--fs-sm); }
.directory-more-filters summary { padding: 6px 0; cursor: pointer; }
.directory-more-filters[open] { flex-basis: 100%; }
.directory-more-filters .filter-bar { margin: 8px 0; }
.field-missing { color: var(--text-muted); font-size: var(--fs-sm); }
.jurisdiction-filters { display: flex; flex-direction: row; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin: 12px 0; }
.jurisdiction-filters label { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); }
.jurisdiction-filters > label:first-child { flex: 1 1 220px; }
.jurisdiction-filters input, .jurisdiction-filters select { min-width: 0; width: 100%; max-width: 100%; }
.map-filters { font-size: var(--fs-sm); }
.map-filters > summary { cursor: pointer; padding: 6px 0; }
.map-filters[open] { flex-basis: 100%; }
.map-filters .jurisdiction-filters { margin: 8px 0; }
.jurisdiction-layers { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; border: 0; font-size: var(--fs-sm); }
.jurisdiction-layers label { display: inline-flex; align-items: center; gap: 5px; }
.jurisdiction-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.jurisdiction-layout.has-selection { grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); }
.jurisdiction-detail[hidden] { display: none; }
.jurisdiction-canvas { position: relative; height: 500px; border: 1px solid var(--border); background: var(--surface-2); overflow: hidden; }
.jurisdiction-canvas > svg { width: 100%; height: 100%; touch-action: none; cursor: grab; }
.jurisdiction-canvas > svg:active { cursor: grabbing; }
.jurisdiction-canvas > svg:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.map-state-background path { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.map-jurisdiction { cursor: pointer; stroke-width: 1.3; fill-opacity: .24; }
.map-has-moratorium { fill: var(--map-pause); stroke: var(--map-pause-edge); }
.map-has-policy { fill: var(--map-framework); stroke: var(--map-framework-edge); }
.map-has-moratorium.map-has-policy { fill: var(--map-both); stroke: var(--map-both-edge); stroke-width: 2; }
.map-proposed { stroke-dasharray: 4 3; fill-opacity: .1; }
.map-inactive { stroke-dasharray: 1 3; fill-opacity: .06; stroke-opacity: .5; }
.map-jurisdiction:hover, .map-jurisdiction:focus-visible { fill-opacity: .5; stroke-width: 2; outline: none; }
.map-doe-point { cursor: pointer; }
.map-dot-hit { fill: transparent; }
.map-dot { fill: var(--text-muted); stroke: var(--surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.map-doe-point.has-announcement .map-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.map-doe-star { pointer-events: none; }
.map-doe-point:focus .map-dot { stroke: var(--text); stroke-width: 3; }
.map-key-moratoriums { color: #4f6084; }
.map-key-policies { color: #356e68; }
.map-key-announcements { color: var(--accent); }
[data-theme="dark"] .map-key-moratoriums { color: #b2c3e6; }
[data-theme="dark"] .map-key-policies { color: #9dcac5; }
.jurisdiction-zoom { position: absolute; top: 6px; left: 6px; display: flex; gap: 3px; }
.jurisdiction-zoom button { background: var(--surface); min-width: 36px; }
.jurisdiction-detail { min-width: 0; border: 1px solid var(--border); padding: 12px; max-height: 500px; overflow-y: auto; overflow-wrap: anywhere; }
.jurisdiction-detail section + section { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.jurisdiction-detail p, .map-announcement p { margin: 8px 0; }
.jurisdiction-detail h3, .map-announcements h3 { font-size: var(--fs-lg); }
.jurisdiction-detail h4, .map-announcement h4 { font-size: var(--fs-base); }
.map-detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.map-detail-heading button { min-width: 32px; flex-shrink: 0; }
.jurisdiction-tooltip { position: absolute; z-index: 2; max-width: min(310px, calc(100% - 16px)); padding: 8px 10px; border: 1px solid var(--text-muted); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-size: var(--fs-sm); pointer-events: none; }
.jurisdiction-tooltip strong, .jurisdiction-tooltip span { display: block; }
.jurisdiction-tooltip span { margin-top: 3px; }
.jurisdiction-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 10px 0 0; font-size: var(--fs-xs); }
.jurisdiction-legend li { display: inline-flex; align-items: center; gap: 6px; }
.map-swatch { display: inline-block; width: 16px; height: 12px; border: 1px solid; }
.map-swatch-moratorium { background: color-mix(in srgb, var(--map-pause) 24%, transparent); border-color: var(--map-pause-edge); }
.map-swatch-policy { background: color-mix(in srgb, var(--map-framework) 24%, transparent); border-color: var(--map-framework-edge); }
.map-swatch-both { background: color-mix(in srgb, var(--map-both) 24%, transparent); border-color: var(--map-both-edge); }
.map-swatch-proposed { border-style: dashed; }
.map-swatch-inactive { border-style: dotted; }
.map-swatch-doe, .map-swatch-announcement { border: 0; height: auto; font-size: var(--fs-lg); line-height: 1; color: var(--text-muted); }
.map-swatch-announcement { color: var(--accent); }
.map-record-link, .map-location-link { text-align: left; background: none; border: none; padding: 4px 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.map-record-link { font-weight: 600; }
.jurisdiction-caption { margin: 8px 0 16px; font-size: var(--fs-xs); color: var(--text-muted); }
.jurisdiction-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; margin: 8px 0 16px; padding: 0; }
.jurisdiction-results li { min-width: 0; padding: 5px 10px 5px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.map-announcements { margin-top: 20px; }
.map-announcement { padding: 12px 0; border-bottom: 1px solid var(--border); }
.map-coverage { margin-top: 16px; }
@media (max-width: 800px) {
  .jurisdiction-layout, .jurisdiction-layout.has-selection { grid-template-columns: 1fr; }
  .jurisdiction-canvas { height: 340px; }
  .jurisdiction-detail { max-height: 360px; }
  .jurisdiction-results { grid-template-columns: 1fr; }
  .jurisdiction-filters label { flex: 1 1 130px; min-width: 0; }
  .jurisdiction-filters label:first-child { flex-basis: 100%; }
}
.jurisdiction-filters > .map-filters[open] { flex-basis: 100%; }
#jurisdiction-map-meta { font-size: var(--fs-sm); font-style: normal; margin: 8px 0; }
@media (max-width: 640px) {
  #moratorium-stats { display: flex; gap: 2px 16px; }
  #moratorium-stats .rp-stat-breakdown { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .jurisdiction-layers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
  .directory-filters > .filter { flex: 1 1 130px; min-width: 0; }
  .directory-filters > .filter-search { flex-basis: 100%; }
  .directory-filters select, .directory-filters input[type="search"] { width: 100%; max-width: 100%; }
}
@media (pointer: coarse) {
  .jurisdiction-filters input, .jurisdiction-filters select, .jurisdiction-layers label,
  .jurisdiction-zoom button, .map-record-link, .map-location-link, .jurisdiction-detail a { min-height: 44px; }
  .jurisdiction-detail a { display: inline-flex; align-items: center; }
  .jurisdiction-zoom button, .map-record-link, .map-location-link { min-width: 44px; }
  .map-filters > summary { min-height: 44px; display: list-item; line-height: 44px; padding: 0; }
  .directory-more-filters summary { min-height: 44px; display: list-item; line-height: 44px; padding: 0; }
  .map-detail-heading button { min-width: 44px; min-height: 44px; }
}

/* Shared headings and summary strips retain contrast across view changes. */
h2, h3, h4, h5, thead th, .theme-quotes-title { color: var(--text); }
.rp-stats[hidden] { display: none; }
.election-place-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 4px; }
.election-place-head .election-office { display: inline; margin: 0; }
.election-place-head .election-toggle { margin-top: 0; }
.election-more-filters { font-size: var(--fs-sm); }
.election-more-filters > summary { padding: 8px 0; cursor: pointer; }
.election-secondary { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; }
@media (max-width: 640px) {
  .election-filters label:first-child { flex-basis: 100%; }
  .election-filters > label:not(:first-child) { flex: 1 1 140px; }
}
@media (pointer: coarse) { .election-more-filters > summary { min-height: 44px; display: list-item; line-height: 44px; padding: 0; } }

/* v7: moratorium call-out on the Policy tab, and moratorium rows in its
   directory. One accent rule; status colour stays in the badges. */
.mor-callout {
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}
.mor-callout-title {
  margin: 0 0 0.25rem;
  font-size: var(--fs-lg);
}
.mor-callout-counts {
  margin: 0;
  font-size: var(--fs-base);
}
.mor-callout-sub {
  margin: 0.5rem 0 0.15rem;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.mor-callout-latest {
  margin: 0;
  padding-left: 1.1rem;
  font-size: var(--fs-sm);
}
.mor-callout-more {
  margin: 0.5rem 0 0;
  font-size: var(--fs-sm);
}
.badge-instrument-moratorium {
  background: var(--surface-2);
  border: 1px solid var(--accent);
  color: var(--accent);
}
.is-moratorium-row td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* v7: LBL 2026 elements. Sub-elements sit under their parent; a provision's
   own words follow its one-line summary. */
.tariff-coverage-card.is-sub {
  margin-left: 1rem;
  border-style: dashed;
}
.tcc-lbl {
  display: block;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}
.tparam-sub {
  margin-left: 1.25rem;
}
.tparam-quote {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-serif);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.tariff-date {
  white-space: nowrap;
  font-size: var(--fs-sm);
}

/* v7: Power Costs brief. Reading text, hairline-separated items, one accent. */
.power-brief {
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0 0.5rem;
  margin: 0 0 1rem;
}
.power-brief-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}
.power-brief-title {
  margin: 0;
  font-size: var(--fs-xl);
}
.power-brief-asof {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.pbf-item {
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}
.pbf-item:first-child {
  border-top: 0;
}
@media (min-width: 960px) {
  #power-brief-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
  }
  .pbf-item:nth-child(2) {
    border-top: 0;
  }
}
.pbf-heading {
  margin: 0 0 0.2rem;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
.pbf-text {
  margin: 0;
  max-width: 72ch;
  font-size: var(--fs-md);
  line-height: 1.55;
}
.pbf-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin: 0.35rem 0 0;
  font-size: var(--fs-xs);
}
.pbf-srcs {
  color: var(--text-muted);
}
.pbf-src {
  display: inline-block;
  min-width: 1.2em;
  text-align: center;
}

/* Phones: the call-out keeps its counts and link; the latest-three list
   would push the directory two screens down (interaction budget). */
@media (max-width: 699px) {
  .mor-callout-sub,
  .mor-callout-latest {
    display: none;
  }
  .mor-callout {
    padding: 0.5rem 0.75rem;
  }
}
