/* yieldcurveus — focused, data-tool aesthetic. Themeable (Dark / Light / Code). */

/* ---- Structural / non-themed vars ---- */
:root {
  --radius: 6px;
  --radius-sm: 4px;
  --maxw: 1080px;
  --sidebar-w: 248px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --font: var(--sans);
}

/* ---- DARK (default) ---- */
:root,
:root[data-theme="dark"] {
  --bg: #0a0e1a;
  --surface: #111827;
  --surface-2: #0d1424;
  --sidebar-bg: #070b14;
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --ink-faint: #7a8699;
  --border: #1e2638;
  --border-strong: #2d3a52;
  --accent: #38bdf8;           /* sky-400 */
  --accent-deep: #0ea5e9;
  --brand-accent: var(--accent); /* color for the "interest" run in the wordmark */
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --green-soft: rgba(52, 211, 153, 0.14);
  --red-soft: rgba(251, 113, 133, 0.14);
  --accent-soft: rgba(56, 189, 248, 0.16);
  --accent-area: rgba(56, 189, 248, 0.06);
  --grid: #1a2235;
  --tooltip-bg: #0d1424;
  --tooltip-border: #1e2638;
  --markline: #64748b;
  --chart-line-1: #38bdf8;
  --chart-line-2: #fbbf24;
  --chart-line-3: #34d399;
  --chart-line-4: #e879f9;
  --chart-line-5: #fb7185;
  --font: var(--sans);
}

/* ---- LIGHT ---- */
:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #fafbfc;
  --surface-2: #f1f5f9;
  --sidebar-bg: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-faint: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #0284c7;           /* sky-600 */
  --accent-deep: #0369a1;
  --brand-accent: var(--accent);
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --green-soft: rgba(5, 150, 105, 0.12);
  --red-soft: rgba(220, 38, 38, 0.10);
  --accent-soft: rgba(2, 132, 199, 0.12);
  --accent-area: rgba(2, 132, 199, 0.08);
  --grid: #eef2f7;
  --tooltip-bg: #ffffff;
  --tooltip-border: #e2e8f0;
  --markline: #94a3b8;
  --chart-line-1: #0891b2;
  --chart-line-2: #d97706;
  --chart-line-3: #059669;
  --chart-line-4: #c026d3;
  --chart-line-5: #e11d48;
  --font: var(--sans);
}

/* ---- CODE (Monokai-inspired) ---- */
:root[data-theme="code"] {
  --bg: #272822;
  --surface: #1e1f1c;
  --surface-2: #2d2e28;
  --sidebar-bg: #1a1b16;
  --ink: #f8f8f2;
  --ink-soft: #cfcfc2;
  --ink-faint: #75715e;
  --border: #3e3f3a;
  --border-strong: #5b5b50;
  --accent: #a6e22e;
  --accent-deep: #66d9ef;
  --brand-accent: var(--accent);
  --green: #a6e22e;
  --red: #f92672;
  --amber: #fd971f;
  --green-soft: rgba(166, 226, 46, 0.14);
  --red-soft: rgba(249, 38, 114, 0.14);
  --accent-soft: rgba(166, 226, 46, 0.18);
  --accent-area: rgba(166, 226, 46, 0.06);
  --grid: #353630;
  --tooltip-bg: #1e1f1c;
  --tooltip-border: #3e3f3a;
  --markline: #75715e;
  --chart-line-1: #66d9ef;
  --chart-line-2: #fd971f;
  --chart-line-3: #a6e22e;
  --chart-line-4: #ae81ff;
  --chart-line-5: #f92672;
  --font: var(--mono);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ============================================================
   Brand wordmark (sidebar + mobile topbar)
   ============================================================ */
.brand {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--ink);
}
.brand-mark {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--accent);
  flex-shrink: 0;
}
.brand-mark svg path { stroke: var(--accent); }
.brand-word {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
  font-family: var(--mono);
}
/* The middle "interest" run gets the brand-accent color so the wordmark reads
   us<accent>interest</accent>rates. brand-us kept as alias for older markup. */
.brand-accent,
.brand-us { color: var(--brand-accent); }

/* ============================================================
   App shell — sidebar + main column
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}
.sidebar-brand {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-nav {
  flex: 1 1 auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}
.sidebar-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 8px 10px;
}
.nav-link {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font);
  width: 100%;
  text-align: left;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.nav-link:hover { color: var(--ink); background: var(--surface); }
.nav-link.active {
  color: var(--ink);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
.nav-parent {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 13.5px;
  padding: 7px 12px;
  margin-top: 4px;
}
.nav-parent:hover { color: var(--ink); background: var(--surface); }
.nav-parent .nav-chevron {
  font-size: 9px;
  color: var(--ink-faint);
  transition: transform .18s ease;
  display: inline-block;
}
.nav-parent[aria-expanded="true"] .nav-chevron { transform: rotate(90deg); }
.nav-group.has-active > .nav-parent { color: var(--ink); }

/* Collapse/expand uses the grid-template-rows 0fr/1fr trick. The pattern only
   works with a SINGLE direct child of the grid container — otherwise grid
   auto-creates rows for each child and the 0fr constraint only applies to the
   first row, leaving the rest visible. We wrap the child links in a single
   .nav-children-inner div so collapse works reliably across themes / browsers. */
.nav-children {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .18s ease;
  overflow: hidden;
}
.nav-children > .nav-children-inner { min-height: 0; }
.nav-children-inner {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-children[data-expanded="true"] { grid-template-rows: 1fr; }
.nav-child {
  font-size: 13px;
  padding: 6px 12px 6px 22px;
  color: var(--ink-soft);
}
.nav-child:hover { color: var(--ink); }
.nav-child.active {
  color: var(--ink);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-version {
  font-size: 11px;
  color: var(--ink-faint);
  font-family: var(--mono);
  letter-spacing: 0.2px;
  text-align: center;
}

/* Theme switcher (now lives in sidebar foot) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--ink-soft); font-family: inherit;
  font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
  width: 100%;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }
.theme-toggle .theme-icon { font-size: 13px; line-height: 1; }
.theme-toggle .theme-name { letter-spacing: 0.2px; }

/* Main column wrapper */
.main-column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app {
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 40px) 40px;
  min-height: 60vh;
  flex: 1 0 auto;
}
.site-footer {
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 14px clamp(18px, 4vw, 40px) 24px;
  border-top: 1px solid var(--border);
  color: var(--ink-faint);
  font-size: 12px;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--border-strong); }
.site-footer a:hover { color: var(--accent); }

/* ============================================================
   Mobile topbar + hamburger
   ============================================================ */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
}
.hamburger {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}
.hamburger-bar {
  display: block;
  width: 16px; height: 2px;
  background: var(--ink);
  border-radius: 1px;
  margin: 2px 0;
}
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 25;
}
.sidebar-backdrop.show { opacity: 1; }

/* ============================================================
   View header (tight title row on every page)
   ============================================================ */
.view-head {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.view-head-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.view-head h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.view-head .view-updated {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.view-head .view-desc {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 4px 0 0;
  max-width: 70ch;
}
.view-head .view-source {
  color: var(--ink-faint);
  font-size: 12px;
  margin: 6px 0 0;
}
.view-head .view-source a {
  color: var(--ink-faint);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
}
.view-head .view-source a:hover { color: var(--accent); }

/* ============================================================
   Panels (chart shells)
   ============================================================ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.chart { width: 100%; height: 420px; }
.chart-sm { width: 100%; height: 280px; }

/* ============================================================
   Home (compact)
   ============================================================ */
.home-head h1 {
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.home-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.home-row {
  display: flex; align-items: baseline; gap: 14px;
  margin: 14px 0 10px;
  flex-wrap: wrap;
}
.home-spread-badge {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}
.home-spread-badge.green { background: var(--green-soft); color: var(--green); }
.home-spread-badge.red { background: var(--red-soft); color: var(--red); }
.home-asof {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 12px;
}
.home-links {
  margin: 18px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 13.5px;
}
.home-links a { color: var(--accent); text-decoration: none; }
.home-links a:hover { text-decoration: underline; }
.home-source {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
}
.home-source a { color: var(--ink-faint); text-decoration: underline; text-decoration-color: var(--border-strong); }
.home-source a:hover { color: var(--accent); }

/* ============================================================
   Curve scrubber controls
   ============================================================ */
.curve-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.spread-badge {
  font-family: var(--mono); font-size: 13.5px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-sm);
}
.spread-badge.green { background: var(--green-soft); color: var(--green); }
.spread-badge.red { background: var(--red-soft); color: var(--red); }
.asof { color: var(--ink-faint); font-size: 12px; font-family: var(--mono); }

.quick-views {
  margin: 12px 0 6px;
  padding: 12px 0 0;
  border-top: 1px dashed var(--border);
}
.quick-views-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ink-faint);
  margin: 0 0 8px;
}
.preset-row {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin-bottom: 8px;
}
.preset-row:last-child { margin-bottom: 0; }
.preset-row-event { gap: 10px; }
.preset-row-label {
  font-size: 11px; color: var(--ink-faint); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
  flex: none;
}
.preset-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.preset-btn:hover { color: var(--ink); border-color: var(--accent); background: var(--surface); }
.preset-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.preset-select {
  flex: 1; min-width: 200px;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--ink);
  font-family: inherit; font-size: 12.5px;
  padding: 7px 32px 7px 12px; border-radius: var(--radius-sm); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%237a8699' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M1.5 1.75 L6 6.25 L10.5 1.75'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 10px 7px;
}
.preset-select:hover { border-color: var(--accent); }
.preset-select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.preset-select option { background: var(--surface); color: var(--ink); }

@media (max-width: 560px) {
  .preset-row-time { gap: 6px; }
  .preset-row-time .preset-btn { flex: 1 1 calc(50% - 3px); min-width: 0; }
  .preset-row-event { flex-direction: column; align-items: stretch; }
  .preset-row-event .preset-row-label { margin-bottom: 2px; }
  .preset-select { width: 100%; min-width: 0; }
}

.curves-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.curve-row { display: flex; align-items: center; gap: 10px; }
.curve-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.curve-label { font-family: var(--mono); font-size: 12.5px; min-width: 120px; color: var(--ink-soft); }
.curve-slider { flex: 1; min-width: 140px; accent-color: var(--accent); }
.curve-remove {
  background: none; border: none; color: var(--ink-faint);
  font-size: 16px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.curve-remove:hover { color: var(--red); }
.btn-add {
  margin-top: 10px; background: var(--surface-2);
  border: 1px solid var(--border-strong); color: var(--accent);
  font-size: 12.5px; font-weight: 600;
  padding: 7px 12px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit;
}
.btn-add:hover { border-color: var(--accent); }
.btn-add:disabled { opacity: .5; cursor: default; }

/* ============================================================
   Prose / learn / upcoming
   ============================================================ */
.prose { max-width: 70ch; }
.prose h2 { font-size: 16px; margin: 22px 0 6px; font-weight: 600; }
.prose p { color: var(--ink-soft); font-size: 14px; }
.prose .analogy {
  margin: 12px 0; padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0;
}

/* FOMC list */
.fomc-list { list-style: none; padding: 0; margin: 14px 0; }
.fomc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--surface);
}
.fomc-item.next { border-color: var(--accent); }
.fomc-date { font-family: var(--mono); font-weight: 600; min-width: 140px; font-size: 13px; }
.fomc-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; letter-spacing: 0.4px;
}
.fomc-note { color: var(--ink-faint); font-size: 12.5px; }

.ticker {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px; margin: 8px 0 16px;
}
.tick {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.tick .k { font-size: 11px; color: var(--ink-faint); }
.tick .v { font-family: var(--mono); font-size: 16px; font-weight: 600; margin-top: 2px; }
.tick .v.red { color: var(--red); } .tick .v.green { color: var(--green); }

/* ============================================================
   Chart header (title + CSV exports)
   ============================================================ */
.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  margin: 8px 0 6px;
}
.chart-title {
  color: var(--ink-faint);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.csv-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.csv-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
  font-family: inherit; font-size: 11.5px; font-weight: 500;
  padding: 5px 9px; border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: color .12s, border-color .12s, background .12s;
}
.csv-btn:hover { color: var(--ink); border-color: var(--accent); background: var(--surface); }
.csv-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.csv-btn .csv-icon { font-size: 12px; line-height: 1; }

/* ============================================================
   Source attribution (under chart and as a bottom block)
   ============================================================ */
.source-caption {
  color: var(--ink-faint);
  font-size: 11.5px;
  margin-top: 8px;
  line-height: 1.5;
}
.source-caption a {
  color: var(--ink-faint);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
}
.source-caption a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.sources-block { margin-top: 24px; padding-top: 14px; border-top: 1px dashed var(--border); }
.sources-block h3 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--ink-faint); margin: 0 0 8px;
}
.sources-block ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.sources-block li { color: var(--ink-faint); font-size: 12.5px; }
.sources-block a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
}
.sources-block a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ============================================================
   Big-number readout
   ============================================================ */
.big-number {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 12px; margin-bottom: 12px;
}
.big-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}
.big-context { color: var(--ink-faint); font-size: 13px; }
.mock-tag {
  display: inline-block; font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 2px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-soft);
}

/* Release selector (dot plot) */
.release-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 6px 0 12px;
}
.release-controls label {
  font-size: 11px; color: var(--ink-faint); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.release-controls .preset-select { flex: 1; min-width: 200px; max-width: 360px; }
.release-help { color: var(--ink-faint); font-size: 12px; line-height: 1.5; max-width: 60ch; }

/* Big-number secondary pills */
.big-secondary { display: flex; gap: 14px; flex-wrap: wrap; margin-left: 4px; }
.big-secondary .pill { display: flex; flex-direction: column; gap: 1px; }
.big-secondary .pill-label {
  font-size: 10px; color: var(--ink-faint); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.big-secondary .pill-value {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  color: var(--ink-soft); letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}

/* Series toggle chips */
.toggle-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 4px 0 10px;
}
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink-faint);
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: color .12s, border-color .12s, background .12s, opacity .12s;
  user-select: none;
}
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip .chip-dot {
  width: 9px; height: 9px; border-radius: 2px;
  background: currentColor; flex: none;
}
.chip.off { opacity: 0.5; background: transparent; }
.chip.off .chip-dot { opacity: 0.45; }
.chip.on { color: var(--ink); background: var(--surface); }

/* Section header (e.g., savings tab) */
.section-head { margin: 24px 0 8px; padding-top: 6px; border-top: 1px dashed var(--border); }
.section-head:first-of-type { margin-top: 4px; padding-top: 0; border-top: none; }
.section-head h2 { font-size: 16px; margin: 0 0 4px; color: var(--ink); font-weight: 600; letter-spacing: -0.2px; }
.section-head p { color: var(--ink-soft); font-size: 13px; margin: 0; max-width: 64ch; }

/* Discontinued-data banner (LIBOR) */
.discontinued-banner {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--red-soft); color: var(--red);
  border: 1px solid var(--red-soft);
  margin-left: 6px;
}

/* Reference Rates mode toggle */
.refrates-mode-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 4px 0 10px;
}
.mode-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.mode-btn {
  background: transparent; border: none; color: var(--ink-faint);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 5px 14px; border-radius: var(--radius-sm); cursor: pointer;
  transition: color .12s, background .12s;
}
.mode-btn:hover { color: var(--ink); }
.mode-btn.active { background: var(--accent-soft); color: var(--accent); }
.mode-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spread-base-wrap { display: inline-flex; align-items: center; gap: 8px; }
.spread-base-wrap label {
  font-size: 11px; color: var(--ink-faint); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.spread-base-wrap .preset-select { flex: none; min-width: 160px; max-width: 240px; }

.refrates-chips-wrap { margin: 4px 0 10px; }
.refrates-chips-toggle {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  width: 100%; text-align: left;
}
.refrates-chips-toggle:hover { color: var(--ink); border-color: var(--accent); }
.refrates-chips-toggle::after { content: " ▾"; color: var(--ink-faint); }
.refrates-chips-toggle[aria-expanded="true"]::after { content: " ▴"; }
.chip-mock-tag {
  display: inline-block; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 1px 5px; margin-left: 4px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}

/* Awaiting-feed chips (Tier C — SARON, €STR, TONA, etc.). The chip gets a
   dotted right border + a small ⚠ marker. Subtle treatment — same chip,
   one extra visual cue, no layout shift. */
.chip.awaiting {
  border-style: dashed;
}
.chip-awaiting-tag {
  display: inline-block; font-size: 10px; font-weight: 700;
  margin-left: 4px; color: var(--ink-faint);
  line-height: 1;
}
.chip.on.awaiting .chip-awaiting-tag { color: var(--accent); }

/* Inline awaiting-feed notice rendered below the chart. One row per
   currently-selected awaiting rate. Uses the same surface tone as the
   discontinued-banner so the visual language is consistent. */
.awaiting-notice {
  margin: 8px 0 4px;
  padding: 8px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 4px;
}
.awaiting-notice[hidden] { display: none; }
.awaiting-row { display: flex; align-items: flex-start; gap: 8px; }
.awaiting-icon {
  font-size: 13px; color: var(--ink-faint); flex: none; line-height: 1.5;
}
.awaiting-msg { flex: 1; line-height: 1.5; }
.awaiting-msg a { color: var(--accent); text-decoration: underline; }
.awaiting-msg a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 560px) {
  .refrates-chips-toggle { display: block; }
  .refrates-chips { display: none; margin-top: 8px; }
  .refrates-chips.open { display: flex; }
  .refrates-mode-row { gap: 10px; }
  .spread-base-wrap { width: 100%; }
  .spread-base-wrap .preset-select { flex: 1; max-width: none; }
}

/* ============================================================
   Mobile breakpoint — sidebar slides in from the left
   ============================================================ */
@media (max-width: 900px) {
  .mobile-topbar { display: flex; }
  .app-shell { display: block; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    height: 100vh;
    width: 84%; max-width: 300px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 40;
    box-shadow: 0 0 30px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }

  .main-column { display: flex; flex-direction: column; min-height: calc(100vh - 58px); }
}

@media (max-width: 640px) {
  .app { padding: 22px 16px 28px; }
  .view-head h1 { font-size: 18px; }
  .chart { height: 340px; }
  .panel { padding: 12px 12px; }
  .big-value { font-size: 24px; }
  .big-secondary .pill-value { font-size: 14px; }
  .site-footer { padding: 14px 16px 22px; font-size: 11.5px; }
}
