/* Wattson — softened editorial identity.
   A warm cream "page" background, muted structural borders, subtle
   rounded corners, and all-caps mono labels run through the visual
   language: Anton for headlines/scores/costs, IBM Plex Mono for every
   other piece of type, and a warm burnt-orange accent doing all the
   pointing. Shadows and border-radius keep the newspaper feel while
   easing the stark brutalist edge. */

/* -------------------- Self-hosted type -------------------- */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/anton-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo Black';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/archivo-black-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-600.woff2') format('woff2');
}

:root {
  --font-display: 'Anton', 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  /* Backward-compat alias: everything that used to reach for a body
     typeface now reaches for the mono stack — the whole page is monospace. */
  --font-body: var(--font-mono);
}

/* -------------------- Design tokens (light, default) -------------------- */
:root {
  --plane: #f5f3ef;
  --surface: #f5f3ef;
  --surface-2: #eceae5;
  --ink: #3b3f42;
  --ink-2: rgba(59, 63, 66, 0.65);
  --muted: rgba(59, 63, 66, 0.5);
  --accent: #2a9d8f;
  --green: #52b788;
  --grid: rgba(59, 63, 66, 0.1);
  --baseline: rgba(59, 63, 66, 0.22);
  --border: rgba(59, 63, 66, 0.16);
  --border-strong: rgba(59, 63, 66, 0.35);
  --series: #3b3f42;
  --series-wash: rgba(42, 157, 143, 0.12);
  --peak-wash: rgba(224, 122, 95, 0.1);
  --away-wash: rgba(59, 63, 66, 0.05);
  --shadow: 0 1px 3px rgba(59, 63, 66, 0.08);
  --radius: 3px;

  --hot: #e07a5f;
  --sun: #e07a5f;
  --mint: #52b788;
  --sky: #3b3f42;
  --good: var(--green);
  --bad: #e07a5f;
  --on-accent: #f5f3ef;
}

@media (prefers-color-scheme: dark) {
  :root {
    --plane: #1a1e21;
    --surface: #22272b;
    --surface-2: #2a3035;
    --ink: #ddd9d2;
    --ink-2: rgba(221, 217, 210, 0.65);
    --muted: rgba(221, 217, 210, 0.5);
    --accent: #4ecdc4;
    --green: #6dd5a0;
    --grid: rgba(221, 217, 210, 0.08);
    --baseline: rgba(221, 217, 210, 0.2);
    --border: rgba(221, 217, 210, 0.12);
    --border-strong: rgba(221, 217, 210, 0.25);
    --series: #ddd9d2;
    --series-wash: rgba(78, 205, 196, 0.15);
    --peak-wash: rgba(224, 122, 95, 0.12);
    --away-wash: rgba(221, 217, 210, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    --radius: 3px;

    --hot: #e8967e;
    --sun: #e8967e;
    --mint: #6dd5a0;
    --sky: #ddd9d2;
    --good: var(--green);
    --bad: #e8967e;
    --on-accent: #1a1e21;
  }
}

:root[data-theme='light'] {
  --plane: #f5f3ef;
  --surface: #f5f3ef;
  --surface-2: #eceae5;
  --ink: #3b3f42;
  --ink-2: rgba(59, 63, 66, 0.65);
  --muted: rgba(59, 63, 66, 0.5);
  --accent: #2a9d8f;
  --green: #52b788;
  --grid: rgba(59, 63, 66, 0.1);
  --baseline: rgba(59, 63, 66, 0.22);
  --border: rgba(59, 63, 66, 0.16);
  --border-strong: rgba(59, 63, 66, 0.35);
  --series: #3b3f42;
  --series-wash: rgba(42, 157, 143, 0.12);
  --peak-wash: rgba(224, 122, 95, 0.1);
  --away-wash: rgba(59, 63, 66, 0.05);
  --shadow: 0 1px 3px rgba(59, 63, 66, 0.08);
  --radius: 3px;

  --hot: #e07a5f;
  --sun: #e07a5f;
  --mint: #52b788;
  --sky: #3b3f42;
  --good: var(--green);
  --bad: #e07a5f;
  --on-accent: #f5f3ef;
}

:root[data-theme='dark'] {
  --plane: #1a1e21;
  --surface: #22272b;
  --surface-2: #2a3035;
  --ink: #ddd9d2;
  --ink-2: rgba(221, 217, 210, 0.65);
  --muted: rgba(221, 217, 210, 0.5);
  --accent: #4ecdc4;
  --green: #6dd5a0;
  --grid: rgba(221, 217, 210, 0.08);
  --baseline: rgba(221, 217, 210, 0.2);
  --border: rgba(221, 217, 210, 0.12);
  --border-strong: rgba(221, 217, 210, 0.25);
  --series: #ddd9d2;
  --series-wash: rgba(78, 205, 196, 0.15);
  --peak-wash: rgba(224, 122, 95, 0.12);
  --away-wash: rgba(221, 217, 210, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  --radius: 3px;

  --hot: #e8967e;
  --sun: #e8967e;
  --mint: #6dd5a0;
  --sky: #ddd9d2;
  --good: var(--green);
  --bad: #e8967e;
  --on-accent: #1a1e21;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  touch-action: manipulation;
}

body {
  background: var(--plane);
  color: var(--ink);
  font-family: var(--font-mono);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app {
  position: relative;
}

a {
  color: var(--accent);
}
a:hover {
  color: var(--ink);
}

svg text {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

button {
  font-family: inherit;
}

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

/* -------------------- Masthead / persistent top bar -------------------- */
.app-topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--on-accent);
  border-bottom: 2px solid var(--border-strong);
}
.app-topnav-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.12em;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  text-transform: uppercase;
}
.brand-wordmark .bolt {
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
}
.topnav-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--on-accent) 50%, transparent);
  white-space: nowrap;
}
.app-topnav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* -------------------- Theme toggle -------------------- */
.theme-toggle {
  display: flex;
  gap: 0;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--on-accent) 30%, transparent);
  border-radius: var(--radius);
  padding: 0;
  flex-shrink: 0;
  overflow: hidden;
}
.theme-toggle button {
  border: none;
  background: transparent;
  color: color-mix(in srgb, var(--on-accent) 50%, transparent);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  cursor: pointer;
  min-height: 24px;
  text-transform: uppercase;
}
.theme-toggle button[aria-pressed='true'] {
  background: color-mix(in srgb, var(--on-accent) 15%, transparent);
  color: var(--on-accent);
  font-weight: 600;
}
@media (max-width: 480px) {
  .theme-toggle button {
    padding: 4px 6px;
    font-size: 8.5px;
  }
}

/* -------------------- Landing -------------------- */
.landing {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-landing {
  padding: 32px 16px 28px;
  border-bottom: 2px solid var(--border-strong);
}
.hero-headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  line-height: 0.94;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-transform: uppercase;
  font-weight: 400;
}
.hero-headline .accent {
  color: var(--accent);
}
.hero-lede {
  margin: 14px 0 0;
  max-width: 36ch;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  border-bottom: 2px solid var(--border-strong);
}
.btn-cta {
  appearance: none;
  cursor: pointer;
  border: none;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.06em;
  padding: 22px 16px;
  text-transform: uppercase;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 68px;
  transition: background 0.15s, filter 0.15s, transform 0.15s;
}
.btn-cta-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-bottom: 2px solid var(--border-strong);
}
.btn-cta-primary:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
}
.btn-cta-secondary {
  background: var(--ink);
  color: var(--on-accent);
}
.btn-cta-secondary:hover {
  filter: brightness(1.25);
  transform: translateY(-1px);
}

/* -------------------- How it works -------------------- */
.how-section {
  padding: 16px;
  border-bottom: 2px solid var(--border-strong);
}
.how-title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.how-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.how-card {
  padding: 12px 0;
  border-top: 1.5px solid var(--border-strong);
  border-left: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.how-grid .how-card:first-child {
  border-top: none;
}
.how-step {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
}
.how-card h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.how-card p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.how-utilities {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.how-utilities summary {
  font-family: var(--font-mono);
}
.how-utilities .util-body {
  margin: 4px 0 6px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* -------------------- Privacy badge -------------------- */
.privacy-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: none;
  border-radius: 0;
  background: transparent;
}
.privacy-badge .pb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: none;
  flex-shrink: 0;
}

/* -------------------- Drop overlay -------------------- */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--plane) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 2px solid var(--accent);
  margin: 0;
  border-radius: var(--radius);
  pointer-events: none;
}
.drop-overlay-text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--accent);
  text-align: center;
  padding: 0 24px;
  text-transform: uppercase;
}

/* -------------------- Session bar -------------------- */
.session-bar {
  padding: 8px 16px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.session-bar .footnote {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.restored-chip {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--green);
  border: 1.5px solid var(--green);
  padding: 2px 6px;
  border-radius: var(--radius);
  background: transparent;
}

/* -------------------- Results container -------------------- */
.results-wrap {
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* -------------------- Scroll reveal (one-shot) -------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* -------------------- Bill hero -------------------- */
/* Higher specificity than ".card, .sect" (the section carries both
   classes) so the taller hero padding wins regardless of source order. */
section.bill-hero {
  padding: 28px 16px 22px;
  text-align: center;
}
.bill-gauge-wrap {
  margin: 10px auto 2px;
  max-width: 280px;
}
.bill-gauge {
  display: block;
  width: 100%;
  height: auto;
}
.bill-gauge .gauge-track {
  stroke: var(--grid);
}
.bill-gauge .gauge-value {
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.bill-gauge[data-band='below'] .gauge-value {
  stroke: var(--good);
}
.bill-gauge[data-band='typical'] .gauge-value {
  stroke: var(--accent);
}
.bill-gauge[data-band='above'] .gauge-value {
  stroke: var(--bad);
}
.bill-hero-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.bill-figure {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 9vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.bill-figure small,
.bill-figure .unit {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.28em;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  margin-left: 4px;
}
.bill-benchmark {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--ink-2);
}
.bill-benchmark[data-band='above'] {
  color: var(--bad);
}
.bill-benchmark[data-band='below'] {
  color: var(--good);
}
.bill-benchmark[data-band='typical'] {
  color: var(--muted);
}
.bill-trend {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--bad);
}
.bill-trend[data-good='true'] {
  color: var(--good);
}
.bill-trend.flat {
  color: var(--muted);
}
.bill-substats {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.bill-share {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* -------------------- Section cards -------------------- */
.card {
  padding: 16px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
  border-bottom: 2px solid var(--border-strong);
}
.card:last-child {
  border-bottom: none;
}
.sect-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sect-meta {
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
}

.chart-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* -------------------- Patterns section -------------------- */
.patterns-hero-chart {
  position: relative;
}
.chart-caption {
  margin: 8px 0 0;
  padding: 2px 0 2px 10px;
  border-left: 2px solid var(--accent);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.patterns-chart {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.patterns-chart .chart-label {
  margin-bottom: 8px;
}

/* -------------------- Data quality notes -------------------- */
.data-notes {
  padding: 10px 16px;
  border-bottom: 2px solid var(--border-strong);
}
.card h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 4px;
  color: var(--ink);
}
.card .desc {
  font-size: 11.5px;
  color: var(--ink-2);
  margin: 0 0 12px;
  max-width: 72ch;
}
.chart-box {
  position: relative;
}
.chart-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  background: var(--ink);
  color: var(--on-accent);
  border: none;
  border-radius: calc(var(--radius) + 1px);
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.tooltip .t-date {
  color: color-mix(in srgb, var(--on-accent) 60%, transparent);
  font-size: 10px;
}
.tooltip .t-val {
  font-weight: 600;
}

details {
  margin: 6px 0 4px;
}
summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-2);
  list-style: none;
  padding: 3px 0;
  width: fit-content;
  min-height: 28px;
  display: flex;
  align-items: center;
}
summary::-webkit-details-marker {
  display: none;
}
summary::before {
  content: '▸';
  color: var(--muted);
  margin-right: 6px;
}
details[open] summary::before {
  content: '▾';
}
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tbl-scroll {
  overflow-x: auto;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table {
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11.5px;
  width: 100%;
}
th,
td {
  text-align: right;
  padding: 5px 10px;
  border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
th:first-child,
td:first-child {
  text-align: left;
}
th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.footnote {
  font-size: 11.5px;
  color: var(--muted);
  max-width: 82ch;
}

/* -------------------- Buttons -------------------- */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  min-height: 28px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  border-color: var(--ink);
}
.btn-primary {
  background: var(--ink);
  color: var(--on-accent);
  border-color: var(--ink);
}
.btn-primary:hover {
  filter: brightness(1.15);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* A .btn placed on the dark masthead reads in on-accent tones, matching
   the masthead's inverted surface in both light and dark theme. */
.app-topnav .btn {
  border-color: color-mix(in srgb, var(--on-accent) 30%, transparent);
  color: var(--on-accent);
}
.app-topnav .btn:hover {
  border-color: color-mix(in srgb, var(--on-accent) 60%, transparent);
}

.progress-state,
.error-state {
  padding: 40px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.error-state {
  border-color: var(--accent);
}
.progress-state .dz-title,
.error-state .dz-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.progress-state .spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--grid);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .progress-state .spinner {
    animation-duration: 2.4s;
  }
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .bill-gauge .gauge-value {
    transition: none;
  }
}
.progress-state .stage {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.error-state .msg {
  font-size: 13px;
  color: var(--ink-2);
  max-width: 56ch;
}

/* -------------------- Money rows -------------------- */
.money-rows {
  display: flex;
  flex-direction: column;
}
/* .money-label / .money-amount / .money-sentence / .money-action are
   direct children of .money-row (no header wrapper in the markup) — flex
   + wrap lets label/amount share a line while the sentence and action
   each force a new full-width line via flex-basis: 100%. */
.money-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.sect-head + .money-row {
  padding-top: 0;
}
.money-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.money-label {
  margin-right: auto;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}
.money-amount {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 5vw, 26px);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.money-sentence {
  flex-basis: 100%;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.money-action {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.money-action::before {
  content: '→ ';
  color: var(--accent);
}

/* -------------------- Plan verdict -------------------- */
.plan-verdict-lede {
  margin: 0 0 12px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
.plan-list {
  display: flex;
  flex-direction: column;
}
/* .plan-row's children are three bare <span>s in document order (label,
   cost, cheapest-chip-or-delta) — margin-right: auto on the label pushes
   cost + chip/delta to the right edge as a pair, instead of the 3-way
   spread justify-content: space-between would give. */
.plan-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.plan-list .plan-row:first-child {
  border-top: none;
}
.plan-row span:first-child {
  margin-right: auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
}
.plan-row span:nth-child(2) {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.plan-row[data-cheapest='true'] {
  margin: 0 -16px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--good) 14%, transparent);
}
/* :not(.cheapest-chip) keeps this row-level emphasis from overriding the
   chip's own accent-filled pill styling when it's the third span. */
.plan-row[data-cheapest='true'] span:not(.cheapest-chip) {
  color: var(--ink);
  font-weight: 600;
}
.plan-details {
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.plan-details > summary {
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

/* -------------------- Rate comparison -------------------- */
.rate-table-scroll {
  display: block;
  overflow-x: auto;
}
.rate-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
}
.rate-table th,
.rate-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--grid);
  text-align: right;
  white-space: nowrap;
}
.rate-table th:first-child,
.rate-table td:first-child {
  text-align: left;
  white-space: normal;
  min-width: 22ch;
  font-family: var(--font-mono);
}
.rate-table tbody tr[data-cheapest='true'] {
  background: var(--series-wash);
}
.rate-table .best {
  color: var(--good);
  font-weight: 700;
}
.cheapest-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 2px 6px;
}
.price-input {
  width: 60px;
  min-height: 28px;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.price-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.shift-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: nowrap;
}
.shift-slider label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  flex-shrink: 0;
  white-space: nowrap;
}
.shift-slider .footnote {
  display: none;
}
.shift-slider input[type='range'] {
  flex: 1;
  min-width: 140px;
  accent-color: var(--accent);
  min-height: 24px;
  touch-action: none;
}
.shift-slider .shift-value {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
}

/* -------------------- Month nav (reused by Bill hero) -------------------- */
.month-nav {
  background: none;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  padding: 4px 14px;
  min-width: 44px;
  min-height: 36px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.month-nav:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
}
.month-nav:disabled {
  opacity: 0.4;
  cursor: default;
}
/* -------------------- Heatmap -------------------- */
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
}
.heatmap-legend .swatches {
  display: flex;
}
.heatmap-legend .swatch {
  width: 12px;
  height: 8px;
}

/* -------------------- Share block (under the charts) -------------------- */
.share-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
  border-bottom: 2px solid var(--border-strong);
}
.share-preview {
  width: 100%;
  max-width: 440px;
}
.share-preview > summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------- Results footer -------------------- */
.share-preview pre {
  margin: 6px 0 0;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
}
.plan-note {
  margin: 10px 0 0;
}
.results-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 16px;
}
.results-footer .privacy-note {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}
.share-readout-btn {
  cursor: pointer;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius);
  padding: 10px 14px;
}
.share-readout-btn:hover {
  filter: brightness(1.15);
}

/* -------------------- Mobile -------------------- */
@media (max-width: 640px) {
  .wrap {
    padding: 0;
  }
  .card {
    padding: 14px;
  }
}
@media (max-width: 480px) {
  .money-amount {
    flex-basis: 100%;
    text-align: right;
  }
}
