/* Huisstijl Termijnrente.nl: a daily rate bulletin. Paper and ink, rules instead of boxes,
   Newsreader for headings and figures, Libre Franklin for text, labels and tables.
   See docs/huisstijl.md. */
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin-opsz-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin-opsz-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin-latin-700-normal.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }

:root {
  color-scheme: light;
  /* Brand colours: the same in light and dark mode */
  --brand: #0b6e69;
  --gold: #f2b33d;
  --on-brand: #ffffff;
  /* Paper and ink */
  --page: #faf8f4;
  --surface: #ffffff;
  --text: #17191a;
  --text-2: #5b5f5b;
  --rule: #17191a;
  --rule-soft: #c9c4b8;
  --border: rgba(23, 25, 26, 0.14);
  --grid: #e4e0d6;
  --axis: #bdb7aa;
  --accent: #0a5f5a;
  --row-hover: #f3f0e9;
  --tag-bg: #efece4;
  --good: #1d6b2a;
  --good-bg: #dcebd6;
  --bad: #a8302a;
  --bad-bg: #f3ddd6;
  --s1: #2563b8;
  --s2: #d0592a;
  --s3: #0a8a74;
  --s4: #b98300;
  --curve: #0a6b66;
  --curve-prev: #8a877c;
  /* Rating chips (tint per grade band) */
  --r-aaa: #d2e9d3; --r-aa: #dfedcf; --r-a: #ebecc8; --r-bbb: #f6e5bf; --r-bb: #f6d7bd; --r-b: #f1cdc6;
  /* Map: land without banks, then 1 / 2-3 / 4-6 / 7+ banks */
  --land: #e9e5db; --map-1: #8ec7bc; --map-2: #4fa297; --map-3: #1f7b71; --map-4: #0b4d49;
  --radius: 0;
  --font: "Libre Franklin", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #131412; --surface: #1b1c19; --text: #ebe8df; --text-2: #a19d92; --rule: #ebe8df; --rule-soft: #45453f;
    --border: rgba(235, 232, 223, 0.16); --grid: #2d2e2a; --axis: #4a4a44; --accent: #6cc7bb;
    --row-hover: #1c1d19; --tag-bg: #24251f;
    --good: #6cc46f; --good-bg: #1a2e1b; --bad: #f08a80; --bad-bg: #3a1d1a;
    --s1: #5b9cf0; --s2: #ec7a45; --s3: #2fb89b; --s4: #e0a92a; --curve: #4cbcae; --curve-prev: #85827a;
    --r-aaa: #1b3a25; --r-aa: #243a1d; --r-a: #363a1b; --r-bbb: #433419; --r-bb: #462c1a; --r-b: #472321;
    --land: #2a2b26; --map-1: #2a6964; --map-2: #2f8b80; --map-3: #3eb3a4; --map-4: #86e0d2;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #131412; --surface: #1b1c19; --text: #ebe8df; --text-2: #a19d92; --rule: #ebe8df; --rule-soft: #45453f;
  --border: rgba(235, 232, 223, 0.16); --grid: #2d2e2a; --axis: #4a4a44; --accent: #6cc7bb;
  --row-hover: #1c1d19; --tag-bg: #24251f;
  --good: #6cc46f; --good-bg: #1a2e1b; --bad: #f08a80; --bad-bg: #3a1d1a;
  --s1: #5b9cf0; --s2: #ec7a45; --s3: #2fb89b; --s4: #e0a92a; --curve: #4cbcae; --curve-prev: #85827a;
  --r-aaa: #1b3a25; --r-aa: #243a1d; --r-a: #363a1b; --r-bbb: #433419; --r-bb: #462c1a; --r-b: #472321;
  --land: #2a2b26; --map-1: #2a6964; --map-2: #2f8b80; --map-3: #3eb3a4; --map-4: #86e0d2;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15.5px/1.55 var(--font);
  font-feature-settings: "tnum" 1, "lnum" 1;
}
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- Masthead and dateline ---------- */
.site-header { background: var(--page); border-bottom: 1px solid var(--rule-soft); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; min-height: 68px; padding-top: 10px; padding-bottom: 10px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; line-height: 1; letter-spacing: -0.01em;
}
.brand .tld { font-weight: 400; font-style: italic; }
.brand-mark { width: 30px; height: 30px; flex: none; display: block; }
.brand:hover .brand-name { color: var(--accent); }
.site-header nav { display: flex; gap: 2px 4px; flex-wrap: wrap; }
.site-header nav a {
  color: var(--text-2); text-decoration: none; padding: 6px 9px; font-size: 0.95rem; font-weight: 500;
}
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.dateline { border-bottom: 1px solid var(--rule-soft); }
.dateline .wrap {
  display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 7px; padding-bottom: 7px;
  font-size: 0.82rem; color: var(--text-2);
}
.dateline a { color: inherit; }
.dateline span + span::before { content: "·"; margin-right: 12px; }
.dateline .dl-right { margin-left: auto; color: var(--text-2); }
.dateline .dl-right::before { content: none; }

/* ---------- Type ---------- */
main { padding: 8px 16px 56px; }
section { margin-top: 56px; }
section.intro { margin-top: 32px; }
h1, h2, .tile-value, .facts dd.big { font-family: var(--font-display); }
h1 { font-size: clamp(1.85rem, 4vw, 2.6rem); line-height: 1.12; font-weight: 500; letter-spacing: -0.015em; margin: 0 0 12px; }
h2 {
  font-size: 1.45rem; line-height: 1.25; font-weight: 500; letter-spacing: -0.005em; margin: 0 0 6px;
  border-top: 1px solid var(--rule-soft); padding-top: 18px;
}
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 6px; }
.lead { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.5; color: var(--text); margin: 0 0 8px; max-width: 40em; }
.muted { color: var(--text-2); }
section > p.muted { font-size: 0.92rem; max-width: 52em; }
.small { font-size: 0.875rem; }
.empty { color: var(--text-2); border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 12px 0; }
.crumbs { margin-top: 24px; color: var(--text-2); font-size: 0.85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kicker { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-2); margin: 0 0 6px; }

/* ---------- Front page: headline and lead sentence, the barometer in a side column ---------- */
.front { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 0 40px; margin-top: 28px; align-items: start; }
.front section.intro { margin-top: 0; }
.deck { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.45; margin: 18px 0 0; max-width: 32em; }
.deck strong { font-weight: 600; }
.deck a { color: inherit; text-decoration-color: var(--accent); }
.front-side { border-left: 1px solid var(--rule-soft); padding-left: 28px; }

/* ---------- Figures: a ruled row instead of tiles ---------- */
/* Cells of a ruled row: a rule left of every cell but the first in a row (--cols per row),
   and above every cell after the first row. */
.tiles, .facts {
  --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); margin-top: 24px;
  border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft);
}
.tiles > *, .facts > div { padding: 10px 16px 12px; min-width: 0; border-left: 1px solid var(--grid); border-top: 1px solid var(--grid); }
.tiles > :nth-child(-n + 4), .facts > div:nth-child(-n + 4) { border-top: 0; }
.tiles > :nth-child(4n + 1), .facts > div:nth-child(4n + 1) { border-left: 0; padding-left: 0; }
.facts:has(> div:nth-child(5):last-child) { --cols: 5; }
.facts:has(> div:nth-child(5):last-child) > div { border-top: 0; border-left: 1px solid var(--grid); padding-left: 16px; }
.facts:has(> div:nth-child(5):last-child) > div:first-child { border-left: 0; padding-left: 0; }
.tile-label { font-size: 0.85rem; font-weight: 500; color: var(--text-2); }
.tile-value { font-size: 1.75rem; font-weight: 500; line-height: 1.2; margin: 2px 0; }
.tile-value-sm { font-size: 1.5rem; }
.tile-sub { color: var(--text-2); font-size: 0.85rem; }
.tile.feature .tile-value { color: var(--accent); }
.tile.feature .tile-label::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); margin-right: 6px; vertical-align: 1px;
}

/* ---------- Tables ---------- */
/* Savings accounts above the terms in the best-rate table, set apart by a rule. */
.best tr.group-row > th { padding: 16px 0 6px; font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; text-align: left; }
.best tr.group-row > th span { font-family: var(--font); font-size: 0.85rem; color: var(--text-2); margin-left: 8px; }
.best tr.group-row:first-child > th { padding-top: 8px; }
table.savings td.notes { white-space: normal; min-width: 12em; color: var(--text-2); font-size: 0.85rem; }
tr.note-row > td { padding-top: 0; border-top: 0; }
tr:has(+ tr.note-row) > * { border-bottom: 0; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
tr > :first-child { padding-left: 0; }
tr > :last-child { padding-right: 0; }
thead th {
  font-weight: 500; color: var(--text-2); font-size: 0.82rem;
  border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--page);
}
tbody tr:last-child > * { border-bottom: 1px solid var(--rule-soft); }
tbody a, tbody a.country-link, tbody a.country-link .with-flag, .events a { text-decoration: none; }
tbody a:hover, tbody a.country-link:hover, tbody a.country-link:hover .with-flag, .events a:hover { text-decoration: underline; }
tbody tr:hover { background: var(--row-hover); }
tbody th { font-weight: 500; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; }
td.num.strong { font-weight: 600; }
td.num.strong a { color: var(--text); }
thead th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
thead th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
thead th button::after { content: "↕"; opacity: 0.35; font-size: 0.9em; }
thead th[aria-sort="ascending"] button::after { content: "▲"; opacity: 1; }
thead th[aria-sort="descending"] button::after { content: "▼"; opacity: 1; }
.linkish { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.linkish:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
tbody .linkish { text-decoration: none; }
tbody .linkish:hover { text-decoration: underline; }
td.prose-cell { white-space: normal; min-width: 240px; line-height: 1.5; }
/* Several rating chips wrap within their cell instead of widening the table */
td.chips { white-space: normal; min-width: 8em; max-width: 15em; }
/* Long bank names in the sortable bank list wrap rather than widen it */
.sortable td:first-child .with-logo > span { white-space: normal; overflow: visible; max-width: 13em; }
td.chips .rating { margin: 2px 4px 2px 0; }
td.chips .rating + .rating { margin-left: 0; }

/* Bank icons sit on a white tile in both themes, so every logo stays legible.
   Banks without a usable icon get a letter tile in the brand colour. */
.with-logo { display: inline-flex; align-items: center; gap: 0.5em; vertical-align: bottom; max-width: 100%; }
.with-logo > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.logo { flex: none; width: 20px; height: 20px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 1px var(--border); }
.logo.mono {
  display: inline-grid; place-items: center; background: var(--brand); color: var(--on-brand);
  font: 700 11px/1 var(--font); box-shadow: none; text-decoration: none;
}
.logo.big { width: 44px; height: 44px; border-radius: 6px; }
.logo.big.mono { font-size: 22px; }
h1.with-logo { display: flex; gap: 14px; }

/* A bank's full logo on a white plate next to the title: white in both themes, so logos stay legible */
.bank-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.plate {
  flex: none; display: flex; align-items: center; justify-content: center;
  min-width: 190px; min-height: 84px; padding: 14px 22px; margin-top: 8px;
  background: #fff; border: 1px solid var(--grid);
}
.plate img { display: block; max-width: 100%; height: auto; }
@media (max-width: 700px) {
  .bank-intro { flex-direction: column-reverse; gap: 4px; }
  .plate { min-width: 0; min-height: 0; padding: 10px 16px; margin: 0; }
}

/* ---------- Filters and form fields ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 500; color: var(--text-2); }
.filters select, .filters input, .existing-row select, .existing-row input {
  font: inherit; font-size: 0.95rem; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text);
  background: var(--surface); border: 1px solid var(--axis); border-radius: 0; padding: 7px 10px; min-width: 170px;
}
.filters select:focus, .filters input:focus, .existing-row select:focus, .existing-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.filters label.check {
  flex-direction: row; align-items: center; gap: 8px; align-self: flex-end; min-height: 38px; cursor: pointer;
  font-size: 0.95rem; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text);
}
.filters label.check input { min-width: 0; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--accent); }

/* Tags and change markers (icon + label, never color alone) */
.tag {
  display: inline-block; font-size: 0.78rem; font-weight: 500; padding: 0 6px; border-radius: 2px;
  background: var(--tag-bg); color: var(--text);
}
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }

/* Country flags */
.with-flag { display: inline-flex; align-items: center; gap: 0.45em; }
.flag { flex: none; width: 18px; height: 12px; border-radius: 1px; box-shadow: 0 0 0 1px var(--border); }

/* Credit ratings: the text is the rating, the tint shows the grade band */
.rating {
  display: inline-block; font-size: 0.8rem; font-weight: 600; line-height: 1.5; padding: 0 6px;
  border-radius: 2px; background: var(--tag-bg); color: var(--text); white-space: nowrap;
}
.rating.r-aaa { background: var(--r-aaa); }
.rating.r-aa { background: var(--r-aa); }
.rating.r-a { background: var(--r-a); }
.rating.r-bbb { background: var(--r-bbb); }
.rating.r-bb { background: var(--r-bb); }
.rating.r-b { background: var(--r-b); }
td .rating + .rating { margin-left: 4px; }
dd.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chg { font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg.up { color: var(--good); }
.chg.down { color: var(--bad); }
.chg.same { color: var(--text-2); }

/* ---------- Change log ---------- */
.day { margin-top: 20px; }
.day h3 { color: var(--text); border-bottom: 1px solid var(--rule-soft); padding-bottom: 6px; margin: 0; }
.day h3 a { color: inherit; text-decoration: none; }
.day h3 a:hover { color: var(--accent); text-decoration: underline; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 6px 0; border-bottom: 1px solid var(--grid); }
.events.plain time { color: var(--text-2); font-variant-numeric: tabular-nums; }
.events.card { margin-top: 12px; border-top: 1px solid var(--rule-soft); }
.pager { margin-top: 24px; }

/* ---------- Bank facts: a ruled row of figures ---------- */
.facts { margin: 24px 0 0; }
.facts dt { color: var(--text-2); font-size: 0.85rem; font-weight: 500; }
.facts dd { margin: 3px 0 0; font-weight: 500; }
.facts dd.big { font-size: 1.5rem; font-weight: 500; line-height: 1.2; }

/* ---------- Pros and cons on a bank page (raisin_site/proscons.py) ---------- */
.proscons {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin-top: 28px;
  border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); padding: 14px 0 8px;
}
.proscons h2 { border: 0; padding: 0; font-family: var(--font); font-size: 1rem; font-weight: 600; margin: 0 0 4px; }
.proscons ul { list-style: none; margin: 0; padding: 0; }
.proscons li { position: relative; padding: 5px 0 5px 22px; line-height: 1.45; }
.proscons li::before { position: absolute; left: 2px; top: 4px; font-weight: 700; font-size: 1.05rem; line-height: 1.4; }
.proscons .plus li::before { content: "+"; color: var(--good); }
.proscons .minus li::before { content: "−"; color: var(--bad); }
.proscons .none { color: var(--text-2); padding: 5px 0; }
.proscons + .facts { margin-top: 0; border-top: 0; }
.proscons-note { grid-column: 1 / -1; margin: 6px 0 0; font-size: 0.82rem; color: var(--text-2); }

/* ---------- Chart ---------- */
.chart { margin-top: 12px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; padding: 0; font-size: 0.8rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 16px; height: 2px; }
.plot { position: relative; outline: none; }
.plot:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.grid { stroke: var(--grid); stroke-width: 1; }
.axis { stroke: var(--axis); stroke-width: 1; }
.tick { fill: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.dlabel { fill: var(--text-2); font-size: 11px; }
.dlabel .dv { fill: var(--text); font-weight: 600; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.s1 { stroke: var(--s1); background: var(--s1); }
.s2 { stroke: var(--s2); background: var(--s2); }
.s3 { stroke: var(--s3); background: var(--s3); }
.s4 { stroke: var(--s4); background: var(--s4); }
.crosshair { stroke: var(--axis); stroke-width: 1; visibility: hidden; }
.dot { stroke: var(--page); stroke-width: 2; }
.dot.s1 { fill: var(--s1); } .dot.s2 { fill: var(--s2); } .dot.s3 { fill: var(--s3); } .dot.s4 { fill: var(--s4); }
.tooltip {
  position: absolute; top: 0; pointer-events: none; z-index: 2;
  background: var(--surface); color: var(--text); border: 1px solid var(--rule);
  box-shadow: 3px 3px 0 var(--grid); padding: 8px 10px; font-size: 0.8rem; min-width: 180px;
}
.tooltip .tt-date { color: var(--text-2); margin-bottom: 4px; }
.tooltip .tt-row { display: grid; grid-template-columns: 12px auto 1fr; gap: 6px; align-items: center; }
.tooltip .tt-row strong { font-variant-numeric: tabular-nums; }
.tooltip .tt-row span:last-child { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-view { margin-top: 8px; font-size: 0.875rem; }
.table-view summary { cursor: pointer; color: var(--accent); }

/* ---------- Map of Europe (banks per country) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.europe { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 12px; }
.map-wrap { margin: 0; }
.map { position: relative; }
.map svg { display: block; width: 100%; height: auto; }
.map .bg { fill: var(--land); opacity: 0.55; stroke: var(--page); stroke-width: 0.8; }
.map .land { fill: var(--land); stroke: var(--page); stroke-width: 0.8; }
.map .cty path, .map .cty circle { stroke: var(--page); stroke-width: 0.8; transition: opacity 0.15s; }
.map .cty circle { stroke-width: 2; }
.map .cty:hover path, .map .cty:hover circle, .map .cty:focus path, .map .cty:focus circle { stroke: var(--text); stroke-width: 1.5; }
.map .cty:focus { outline: none; }
.m1 path, .m1 circle, .swatch.m1, .cbar.m1 { fill: var(--map-1); background: var(--map-1); }
.m2 path, .m2 circle, .swatch.m2, .cbar.m2 { fill: var(--map-2); background: var(--map-2); }
.m3 path, .m3 circle, .swatch.m3, .cbar.m3 { fill: var(--map-3); background: var(--map-3); }
.m4 path, .m4 circle, .swatch.m4, .cbar.m4 { fill: var(--map-4); background: var(--map-4); }
.swatch { display: inline-block; width: 14px; height: 14px; }
.swatch.land { background: var(--land); }
.map-legend { margin: 8px 0 2px; }
.map-wrap figcaption { font-size: 0.8rem; color: var(--text-2); }
.map .tooltip { min-width: 0; white-space: nowrap; }
.map .tooltip strong { display: block; font-size: 0.875rem; }
.country-table { margin-top: 0; }
.country-table th a { color: var(--text); text-decoration: none; }
.country-table th a:hover span:last-child, .country-table th a:hover { text-decoration: underline; }
.country-table th { font-weight: 500; }
.bar-cell { width: 40%; padding-left: 4px; }
.cbar { display: block; height: 10px; min-width: 4px; }
@media (max-width: 820px) {
  .europe { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule-soft); background: var(--page); color: var(--text-2); font-size: 0.875rem; }
.site-footer .wrap { padding-top: 18px; padding-bottom: 28px; }
.site-footer p { margin: 0 0 8px; max-width: 70em; }
.footer-brand {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--text);
}
.footer-brand svg { width: 22px; height: 22px; }

/* ---------- Explainer prose ---------- */
.prose { max-width: 44em; margin-top: 24px; }
.prose h2 { margin-top: 40px; }
.prose p, .prose li { line-height: 1.65; }
.prose li { margin: 4px 0; }
.prose > p:not(.muted):not(.lead), .prose li { font-size: 1.02rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
pre.code { background: var(--surface); border: 1px solid var(--grid); border-left: 3px solid var(--rule-soft); padding: 12px 16px; overflow-x: auto; font-size: 0.85rem; line-height: 1.5; }
.note-box { margin: 16px 0 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--gold); line-height: 1.6; }

/* ---------- Illustrations (raisin_site/art.py): line drawings in ink, no tiles ---------- */
.ink { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ink.soft { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.ink.fill { fill: var(--page); }
.ink.faint { stroke: var(--text-2); opacity: 0.6; }
.coin { fill: var(--gold); stroke: color-mix(in srgb, var(--gold) 70%, #7a5200); stroke-width: 1.5; }
.art-icon { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; }
.art-icon svg { width: 40px; height: 40px; }
h2.with-art { display: flex; align-items: center; gap: 12px; }
.art-figure { margin: 18px 0 8px; padding: 14px 0 10px; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.art-figure svg { display: block; width: 100%; height: auto; }
.art-figure figcaption { font-size: 0.85rem; color: var(--text-2); margin-top: 8px; line-height: 1.55; }
.art-figure .rung { fill: var(--brand); }
.art-figure .rung.next { fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 5 4; }
.art-figure .lbl { font-size: 14px; font-weight: 600; fill: var(--text); }
.art-figure .note { font-size: 12px; fill: var(--text-2); }
.art-figure .tick { font-size: 12px; fill: var(--text-2); }
.art-figure .grid { stroke: var(--grid); }
.flow { display: flex; align-items: stretch; gap: 10px; }
.flow-tile { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 4px 0 4px 14px; border-left: 1px solid var(--rule); font-size: 0.85rem; }
.flow-tile strong { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.15; }
.flow-tile.gold { border-left: 3px solid var(--gold); }
.flow-k { font-size: 0.85rem; font-weight: 500; color: var(--text-2); }
.flow-arrow { align-self: center; font-size: 1.4rem; color: var(--text-2); }
.not-found { text-align: center; padding: 24px 0 40px; }
.not-found h1 { margin-top: 8px; }
.art-404 { display: block; width: min(260px, 70%); margin: 0 auto 20px; }
@media (max-width: 600px) {
  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
}

/* ---------- Rentetrap ---------- */
.trap-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.trap-line.best { stroke: var(--curve); stroke-width: 2.5; }
.trap-line.median { stroke: var(--curve); stroke-width: 1.25; opacity: 0.55; }
.trap-line.prev { stroke: var(--curve-prev); stroke-width: 1.5; }
.trap-band { fill: var(--curve); opacity: 0.12; }
.chart .coin, .trap .coin { stroke: var(--page); stroke-width: 2; }
.key.trap-best { background: var(--curve); height: 3px; }
.key.trap-median { background: var(--curve); opacity: 0.55; }
.key.trap-prev { background: var(--curve-prev); }
.key.trap-band-key { height: 10px; border-top: 2px solid var(--curve); background: color-mix(in srgb, var(--curve) 14%, transparent); }
.dot.trap-best, .dot.trap-median { fill: var(--curve); }
.dot.trap-prev { fill: var(--curve-prev); }

/* ---------- Barometer ---------- */
.gauge { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; overflow: visible; }
.g-track, .g-fill { fill: none; stroke-width: 18; stroke-linecap: butt; }
.g-track { stroke: var(--grid); }
.g-fill.up { stroke: var(--good); }
.g-fill.down { stroke: var(--bad); }
.g-tick { stroke: var(--axis); stroke-width: 2; }
.g-needle { stroke: var(--text); stroke-width: 3.5; stroke-linecap: round; }
.g-end { fill: var(--text-2); font-size: 13px; }
.gauge .coin { stroke: var(--page); stroke-width: 3; }

.baro { display: grid; grid-template-columns: minmax(250px, 320px) 1fr; gap: 0 32px; margin-top: 24px; align-items: start; }
.baro-gauge { text-align: center; padding: 14px 0 12px; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.baro-mood { font-family: var(--font-display); font-size: 1.7rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; margin: 8px 0 2px; }
.baro-counts { margin: 0; font-size: 0.9rem; }
.baro .tiles { margin-top: 0; }
.baro-tiles { --cols: 2; }
.baro-tiles .tile-value .chg { font-family: var(--font); font-size: 0.9rem; vertical-align: middle; }

.baro-teaser { display: block; color: var(--text); text-decoration: none; }
.baro-teaser:hover strong { color: var(--accent); }
.baro-teaser:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.baro-teaser > span { display: flex; flex-direction: column; gap: 2px; }
.baro-teaser .gauge { width: 150px; max-width: 150px; margin: 0 0 6px; }
.baro-teaser .g-end { display: none; }
.baro-teaser .kicker { margin: 0; color: var(--text-2); }
.baro-teaser strong { font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; line-height: 1.2; }
.baro-teaser .muted { font-size: 0.9rem; margin-top: 4px; }
.baro-teaser .more { color: var(--accent); font-weight: 600; margin-top: 6px; font-size: 0.9rem; }

/* Biggest movers: diverging bars around a zero axis */
.movers { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule-soft); }
.movers li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(140px, 1fr) minmax(0, auto); gap: 8px 16px; align-items: center; padding: 8px 0; border-top: 1px solid var(--grid); }
.movers li:first-child { border-top: 0; }
.m-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-bar { position: relative; display: grid; grid-template-columns: 1fr 1fr; height: 14px; }
.m-bar::before { content: ""; position: absolute; left: 50%; top: -5px; bottom: -5px; width: 1px; background: var(--rule); }
.m-bar > span { height: 14px; }
.movers li.up .m-bar > span { grid-column: 2; justify-self: start; background: var(--good); }
.movers li.down .m-bar > span { grid-column: 1; justify-self: end; background: var(--bad); }
.m-val { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Bank context (raisin_site/context.py): newspaper columns ---------- */
.context { columns: 2 320px; column-gap: 48px; margin-top: 14px; }
.context-card { break-inside: avoid; margin-bottom: 18px; }
.context-card h3.with-art { display: block; margin: 0 0 4px; }
.context-card .art-icon { display: none; }
.context-card p { margin: 0; line-height: 1.6; }

/* ---------- Country pages (raisin_site/countries.py) ---------- */
/* The flag + name is an inline-flex box, which a link's underline does not reach: underline it directly. */
a.country-link, a.country-link .with-flag {
  color: inherit; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
a.country-link:hover, a.country-link:hover .with-flag { color: var(--accent); text-decoration-color: currentColor; }
.with-flag-h1 { display: flex; align-items: center; gap: 14px; }
.with-flag-h1 .flag { width: 36px; height: 24px; border-radius: 1px; flex: none; }
.tax-block + .tax-block { border-top: 1px solid var(--grid); margin-top: 20px; padding-top: 4px; }
.tax-block h3 { margin: 18px 0 6px; }
.country-list { line-height: 2.1; }
.country-list a { white-space: nowrap; }

/* ---------- Deposit ladder planner (raisin_site/ladder.py, static/ladder.js) ---------- */
.planner[data-js="off"] .js-only { display: none; }
.ladder-form { margin-top: 24px; padding: 18px 0 20px; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.ladder-main { display: grid; grid-template-columns: minmax(180px, 220px) 1fr; gap: 16px 32px; align-items: start; }
.ladder-amount label, .ladder-terms legend {
  display: block; margin-bottom: 6px; padding: 0;
  font-size: 0.85rem; font-weight: 500; color: var(--text-2);
}
.ladder-terms { border: 0; margin: 0; padding: 0; min-width: 0; }
.money { display: flex; align-items: center; border: 1px solid var(--axis); background: var(--surface); }
.money:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.money span { padding-left: 12px; color: var(--text-2); font-family: var(--font-display); font-size: 1.35rem; }
.money input {
  font: inherit; font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; color: var(--text);
  border: 0; background: transparent; padding: 4px 12px 4px 6px; width: 100%; min-width: 0;
}
.money input:focus { outline: none; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.preset {
  font: inherit; font-size: 0.85rem; color: var(--accent); background: transparent; cursor: pointer;
  border: 1px solid var(--axis); border-radius: 2px; padding: 3px 10px;
}
.preset:hover { background: var(--row-hover); }
.preset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.term-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.term-chip { position: relative; }
.term-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.term-chip span {
  display: inline-block; min-width: 3.2em; text-align: center; font-size: 0.9rem; font-variant-numeric: tabular-nums;
  padding: 6px 10px; border-radius: 2px; border: 1px solid var(--axis); background: var(--surface); cursor: pointer;
}
.term-chip span:hover { background: var(--row-hover); }
.term-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--page); font-weight: 500; }
.term-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.term-chip input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.ladder-form .filters { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--grid); }
.ladder-existing { margin-top: 14px; }
.ladder-existing summary { cursor: pointer; color: var(--accent); font-size: 0.95rem; }
.ladder-existing p { margin: 8px 0; }
.existing-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.existing-row select { min-width: 200px; }
.existing-row input { width: 130px; min-width: 0; }
.ladder-plan { margin-top: 36px; }
.ladder-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; border-top: 1px solid var(--rule-soft); padding-top: 18px; }
.ladder-head h2 { border: 0; padding: 0; }
.ladder-head h2:focus { outline: none; }
.ladder-share { display: flex; align-items: center; gap: 10px; }
#ladder-summary { margin: 4px 0 0; font-family: var(--font-display); font-size: 1.1rem; line-height: 1.45; max-width: 42em; }
.ladder-tiles { margin-top: 16px; }
.ladder-table tfoot th, .ladder-table tfoot td { border-top: 2px solid var(--rule); border-bottom: 0; font-weight: 700; }
.ladder-table tr.gap th { color: var(--text-2); }
.ladder-table th .tag { margin-left: 4px; vertical-align: 1px; }
.ladder-notes { margin: 14px 0 0; padding: 2px 0 2px 34px; border-left: 3px solid var(--gold); line-height: 1.6; }
.ladder-notes li { margin: 2px 0; }
.ladder-excluded { margin: 12px 0 0; font-size: 0.925rem; }
.ladder-figure { margin-top: 18px; }
.timeline { --lbl: 4.4em; --end: 18px; font-size: 0.875rem; }
.tl-body { position: relative; padding: 4px 0; }
.tl-grid, .tl-axis { position: absolute; left: var(--lbl); right: var(--end); }
.tl-grid { top: 0; bottom: 0; }
.tl-grid span { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--grid); }
.tl-row { position: relative; display: flex; align-items: center; height: 32px; }
.tl-lbl { flex: none; width: var(--lbl); padding-right: 12px; white-space: nowrap; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-track { position: relative; flex: 1; height: 16px; margin-right: var(--end); }
.tl-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); }
.tl-coin {
  position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: var(--gold); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--gold) 70%, #7a5200);
}
.tl-when { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 0.8rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl-when.in { color: var(--on-brand); font-weight: 600; }
.timeline > .tl-axis { position: relative; height: 22px; margin: 2px var(--end) 0 var(--lbl); left: auto; right: auto; border-top: 1px solid var(--axis); }
.tl-axis span { position: absolute; top: 4px; transform: translateX(-50%); font-size: 0.8rem; color: var(--text-2); white-space: nowrap; }
.ladder-h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; text-transform: none; letter-spacing: 0; margin: 28px 0 0; }
.ladder-compare td:last-child { white-space: normal; min-width: 16em; }
.planner + .prose { margin-top: 40px; }

.tiles.baro-tiles > :nth-child(n) { border-left: 1px solid var(--grid); padding-left: 16px; border-top: 1px solid var(--grid); }
.tiles.baro-tiles > :nth-child(odd) { border-left: 0; padding-left: 0; }
.tiles.baro-tiles > :nth-child(-n + 2) { border-top: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .front { grid-template-columns: 1fr; }
  .front-side { border-left: 0; border-top: 1px solid var(--rule-soft); padding: 14px 0 0; margin-top: 22px; }
  .deck { font-size: 1.2rem; }
  .baro { grid-template-columns: 1fr; }
  .baro .tiles { margin-top: 20px; }
  .dateline .wrap { gap: 2px 14px; }
  .dateline span + span::before { content: none; }
  .dateline span:not(:first-child) { display: none; }
  .tiles, .facts, .facts:has(> div:nth-child(5):last-child) { --cols: 2; }
  .tiles > :nth-child(n), .facts > div:nth-child(n), .facts:has(> div:nth-child(5):last-child) > div:nth-child(n) {
    border-left: 1px solid var(--grid); padding-left: 12px; border-top: 1px solid var(--grid);
  }
  .tiles > :nth-child(odd), .facts > div:nth-child(odd), .facts:has(> div:nth-child(5):last-child) > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .tiles > :nth-child(-n + 2), .facts > div:nth-child(-n + 2), .facts:has(> div:nth-child(5):last-child) > div:nth-child(-n + 2) { border-top: 0; }
  .proscons { grid-template-columns: 1fr; }
  .proscons > div + div { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--grid); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .site-header .wrap { min-height: 0; gap: 4px 16px; }
  .brand { font-size: 1.45rem; }
  .site-header nav { margin: 0 -8px; }
  .site-header nav a { padding: 5px 8px; font-size: 0.92rem; }
  h2 { font-size: 1.3rem; }
  th, td { padding: 6px 10px; }
  .filters label { flex: 1 1 140px; }
  .filters select, .filters input { min-width: 0; width: 100%; }
  .filters label.check { flex-basis: 100%; }
  .filters label.check input { width: 18px; }
  .tiles > *, .facts > div { padding-top: 8px; padding-bottom: 10px; }
  .tile-value { font-size: 1.5rem; }
  .facts dd.big { font-size: 1.35rem; }
  .baro-teaser .muted { display: none; }
  .movers li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .m-name { grid-column: 1 / -1; }
  .trap .tick { font-size: 21px; }
  .trap .xt.alt { display: none; }
  .trap .dlabel { font-size: 22px; }
  .ladder-main { grid-template-columns: 1fr; }
  .existing-row select { min-width: 0; flex: 1 1 160px; }
  .ladder-tiles .tile-value { font-size: 1.35rem; }
}
@media (forced-colors: active) {
  .line { stroke: CanvasText; }
  .s2.line { stroke-dasharray: 6 3; } .s3.line { stroke-dasharray: 2 3; } .s4.line { stroke-dasharray: 10 3 2 3; }
  .trap-line.prev { stroke-dasharray: 4 3; }
  .g-fill.up, .g-fill.down, .movers li .m-bar > span { forced-color-adjust: none; }
  .tl-bar { background: CanvasText; }
  .tl-when.in { color: Canvas; }
}
