/* OctoAlerts, "Simple" design (chosen 5 Dec 2026). Reasoning and tokens: DESIGN.md.
   One deep green ground, rounded panels, one friendly font, one yellow for actions.
   Price band colours match prices/display.py and are tested in alerts/tests/test_palette.py. */

@font-face {
  font-family: "Gabarito";
  src: url("../fonts/gabarito.c19057d06654.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0A2E2A;
  --panel: #12403A;
  --panel-deep: #0D3530;
  --line: #2C5C55;
  --text: #F4F1E8;
  --muted: #C9D8D2;
  --soft: #A3BDB5;
  --accent: #FFD62E;
  --on-accent: #0A2E2A;
  --band-ink: #031512;
  --field: #F4F1E8;
  --paid: #3A86FF;
  --cheap: #1ED3A0;
  --fair: #8D887E;
  --pricey: #FF9433;
  --peak: #F2453A;
  --error: #FF8A7F;
  --font: "Gabarito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --wrap: 1120px;
  --radius: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 var(--font);
  font-feature-settings: "tnum" 1;
}
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 999px; font-weight: 800; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Header --------------------------------------------------------------------------------- */

.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 900; font-size: 24px; letter-spacing: -0.4px; }
.wordmark:hover { color: var(--text); }
.wordmark svg { flex: 0 0 auto; }
.nav { display: flex; align-items: center; gap: 26px; font-weight: 600; font-size: 16px; }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }
.nav .nav-account { padding: 9px 18px; border-radius: 999px; border: 2px solid var(--text); }
.nav .nav-account:hover { border-color: var(--accent); }
.nav .nav-account[aria-current="page"] { border-color: var(--accent); }
.menu { display: none; position: relative; }
.menu summary { list-style: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 999px; background: var(--panel); cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--accent); color: var(--on-accent); }
.menu nav { position: absolute; right: 0; top: 56px; z-index: 20; min-width: 220px; display: grid; padding: 8px; border-radius: 22px; background: var(--panel); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.menu nav a { text-decoration: none; font-weight: 700; font-size: 18px; padding: 12px 16px; border-radius: 14px; }
.menu nav a[aria-current="page"] { background: var(--panel-deep); color: var(--accent); }

/* --- Page blocks ---------------------------------------------------------------------------- */

.page { display: flex; flex-direction: column; gap: 20px; padding-top: 8px; padding-bottom: 48px; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 34px 36px; min-width: 0; }
.panel-accent { background: var(--accent); color: var(--on-accent); }
.panel-accent a { color: var(--on-accent); }
.panel-outline { background: none; border: 2px solid var(--line); }
.panel-attention { border: 2px solid var(--accent); }
.duo { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.page-head { padding: 22px 0 6px; }
.page-head .lead { max-width: 60ch; }

.label { margin: 0; font-size: 18px; font-weight: 500; color: var(--muted); }
.panel-accent .label { color: var(--on-accent); font-weight: 600; }
.headline { margin: 0; font-size: clamp(34px, 5vw, 52px); line-height: 1.04; font-weight: 800; letter-spacing: -1.2px; }
.h2 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -0.3px; }
.lead { margin: 10px 0 0; font-size: 20px; line-height: 1.4; color: var(--muted); }
.small { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.muted { color: var(--muted); font-size: 15px; }
.on-ink { color: var(--text); }

.price-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; }
.big-price { margin: 0; font-size: clamp(84px, 13vw, 132px); line-height: 1; font-weight: 800; letter-spacing: -4px; }
.big-time { margin: 6px 0 0; font-size: clamp(40px, 5vw, 52px); line-height: 1.02; font-weight: 800; letter-spacing: -1.5px; }
.says { margin: 10px 0 0; font-size: 20px; line-height: 1.4; max-width: 34ch; }
.panel-accent .says { max-width: none; }
.push-down { margin-top: auto; padding-top: 22px; }

/* Price bands. Text on a band colour is always the dark ground: 5:1 or better on every band. */
.pill { display: inline-block; font-weight: 800; font-size: 18px; line-height: 1; padding: 9px 16px; border-radius: 999px; color: var(--band-ink); white-space: nowrap; }
.chip { display: inline-block; font-weight: 700; font-size: 13px; line-height: 1; padding: 6px 11px; border-radius: 999px; color: var(--band-ink); white-space: nowrap; text-align: center; }
.band-paid { background: var(--paid); }
.band-cheap { background: var(--cheap); }
.band-fair { background: var(--fair); }
.band-pricey { background: var(--pricey); }
.band-peak { background: var(--peak); }

/* --- Buttons and forms ---------------------------------------------------------------------- */

.btn { display: inline-block; font: 800 18px/1.2 var(--font); padding: 15px 26px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { color: var(--on-accent); filter: brightness(1.06); }
.btn-quiet { background: none; color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.btn-quiet:hover { color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.btn-danger, .btn-danger:hover { background: var(--peak); color: var(--band-ink); }
.panel-accent .btn { background: var(--on-accent); color: var(--accent); }
.link-button { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button:hover { color: var(--accent); }
.danger { color: var(--error); }

.inline-form { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form label { width: 100%; font-size: 16px; color: var(--muted); }
.inline-form input { flex: 1 1 160px; min-width: 0; }
.inline-form .note { width: 100%; font-size: 14px; color: var(--soft); margin: 4px 0 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
  font: 500 18px var(--font); padding: 14px 20px; border-radius: 999px; border: 2px solid transparent;
  background: var(--field); color: var(--on-accent); width: 100%;
}
input::placeholder { color: #5E6F6A; }
input:focus, select:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
select {
  appearance: none; cursor: pointer; padding-right: 46px;
  background-image: linear-gradient(45deg, transparent 50%, var(--on-accent) 50%), linear-gradient(135deg, var(--on-accent) 50%, transparent 50%);
  background-position: calc(100% - 24px) 54%, calc(100% - 18px) 54%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.inline-select { display: inline-block; width: auto; font: inherit; color: var(--text); background-color: var(--panel-deep); padding: 6px 40px 6px 14px; border: 0;
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 22px) 54%, calc(100% - 16px) 54%; }

.field { display: grid; gap: 8px; margin: 0 0 20px; }
.field label { font-weight: 700; font-size: 16px; }
.field.has-error input, .field.has-error select { border-color: var(--error); }
input[type="file"] { font: 500 16px var(--font); color: var(--text); max-width: 100%; }
input[type="file"]::file-selector-button { font: 800 16px var(--font); margin-right: 14px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--text); color: var(--on-accent); cursor: pointer; }
.field label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.choices { border: 0; padding: 0; margin: 8px 0 20px; min-width: 0; }
.choices legend { padding: 0; margin: 0 0 8px; font-weight: 800; font-size: 18px; }
.choices > .help { margin-bottom: 16px; }
.choices .field { gap: 4px; margin-bottom: 14px; }
.help { margin: 0; font-size: 15px; color: var(--muted); }
.error, .form-error { margin: 0; font-size: 15px; font-weight: 700; color: var(--error); }
.form-error { margin: 0 0 18px; padding: 12px 18px; border-radius: 18px; border: 2px solid var(--error); }
.form-panel { max-width: 620px; }
.narrow { max-width: 660px; } /* 620px panels plus the wrap's padding, centred */
.narrow-wide { max-width: 800px; }
.narrow .form-panel, .narrow-wide .panel { max-width: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.notice { margin: 16px 0 0; padding: 14px 20px; border-radius: 20px; background: var(--panel-deep); border: 2px solid var(--line); font-size: 16px; }
.notice p { margin: 0; }
.notice-error { border-color: var(--error); }
.notice-success { border-color: var(--cheap); }
.choose { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px !important; }
.choose a { text-decoration: none; font-weight: 800; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }

/* --- Tabs ----------------------------------------------------------------------------------- */

.panel-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.tabs { display: inline-flex; background: var(--panel-deep); border-radius: 999px; padding: 4px; }
.tabs a { text-decoration: none; padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: 16px; }
.tabs a.on { background: var(--text); color: var(--on-accent); font-weight: 700; }
.tab-note { font-weight: 400; font-size: 13px; opacity: 0.85; }
.view-tabs { margin: 4px 0 14px; border-radius: 22px; }
.view-tabs a { font-size: 15px; border-radius: 18px; text-align: center; }

/* --- Chart ---------------------------------------------------------------------------------- */

.chart { margin: 26px 0 0; }
.chart-plot { height: 230px; display: flex; flex-direction: column; }
.has-negative .chart-plot, .has-negative .ticks { margin-right: 28px; } /* room for the 0p label */
.zone { display: flex; gap: 3px; }
.zone-pos { position: relative; flex: 0 0 var(--pos, 100%); align-items: flex-end; }
.has-negative .zone-pos { border-bottom: 2px solid var(--line); }
.zero { position: absolute; left: 100%; bottom: -9px; padding-left: 6px; font-size: 13px; font-weight: 700; line-height: 16px; color: var(--muted); }
.zone-neg { flex: 0 0 var(--neg, 0%); align-items: flex-start; }
.bar { position: relative; flex: 1 1 0; height: var(--h); min-width: 0; }
.zone-pos .bar { border-radius: 4px 4px 0 0; }
.zone-neg .bar { border-radius: 0 0 4px 4px; }
.bar.past { background: #3B6961; } /* gone: no band colour needed */
.bar.now { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); z-index: 1; }
.bar:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--text); color: var(--on-accent); font-size: 14px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); z-index: 3; pointer-events: none;
}
.zone-pos .bar:hover::after { bottom: calc(100% + 10px); }
.zone-neg .bar:hover::after { top: calc(100% + 10px); }
.ticks { display: flex; gap: 3px; margin-top: 10px; height: 18px; }
.ticks span { flex: 1 1 0; min-width: 0; position: relative; }
.ticks i { position: absolute; left: 0; font-style: normal; font-size: 14px; color: var(--muted); white-space: nowrap; }
.legend { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 0; margin: 20px 0 0; font-size: 15px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 99px; flex: 0 0 auto; }
.ref-line { position: absolute; left: 0; right: 0; bottom: var(--ref); border-top: 2px dashed var(--muted); z-index: 2; pointer-events: none; }
.ref-line i { position: absolute; left: 0; bottom: 4px; font-style: normal; font-size: 13px; font-weight: 700; background: var(--panel); padding: 0 8px 0 0; }
.chart-daily { height: 190px; }

.more { margin-top: 18px; border-top: 2px solid var(--line); }
.more summary { cursor: pointer; font-weight: 700; padding: 14px 0 0; list-style-position: inside; }
.more[open] summary { padding-bottom: 8px; }
.more p { color: var(--muted); max-width: 70ch; }
.prices { width: 100%; border-collapse: collapse; font-size: 16px; margin-top: 8px; }
.prices th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 0; border-bottom: 2px solid var(--line); }
.prices td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.prices tr.gone td { color: var(--soft); }
.num { font-weight: 700; }
.status { margin: 0; font-size: 15px; color: var(--soft); }
.warn { color: var(--accent); font-weight: 700; }

/* --- Tracker -------------------------------------------------------------------------------- */

.version-form { margin-top: 18px; display: grid; gap: 8px; max-width: 560px; }
.version-form label { font-size: 16px; color: var(--muted); }
.fuel-price { margin: 4px 0 0; font-size: clamp(64px, 9vw, 104px); line-height: 1; font-weight: 800; letter-spacing: -3px; }
.fuel-next { margin: 18px 0 0; padding-top: 16px; border-top: 2px solid var(--line); font-size: 18px; }
.fuel-next b { font-size: 22px; }

/* --- Tariff table --------------------------------------------------------------------------- */

.tariff-list { list-style: none; margin: 14px 0 0; padding: 0; }
.tariff { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--line); }
.tariff-name { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.25; }
.tariff-meta { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.tariff-price { text-align: right; }
.tariff-rate { margin: 0; font-size: 22px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tariff.reference { box-shadow: inset 4px 0 0 var(--accent); padding-left: 14px; }

/* --- Account and alerts --------------------------------------------------------------------- */

.link-list { list-style: none; margin: 14px 0 0; padding: 0; }
.link-list li { padding: 14px 0; border-top: 2px solid var(--line); font-weight: 600; }
.link-list form { margin: 0; }
.alert-list { list-style: none; margin: 14px 0 0; padding: 0; }
.alert-list li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 18px; align-items: center; padding: 16px 0; border-top: 2px solid var(--line); }
.alert-list form { margin: 0; }
.alert-name { font-weight: 700; font-size: 18px; }
.alert-sub { display: block; font-weight: 400; font-size: 14px; color: var(--muted); }
.alert-state { font-size: 14px; font-weight: 800; padding: 5px 12px; border-radius: 999px; background: var(--cheap); color: var(--on-accent); }
.is-paused .alert-name { color: var(--soft); }
.is-paused .alert-state { background: none; color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.presets form { margin: 0; }
.preset { display: grid; gap: 4px; width: 100%; height: 100%; text-align: left; font: inherit; color: var(--text); padding: 18px 20px; border-radius: 22px; border: 2px solid var(--line); background: var(--panel-deep); cursor: pointer; }
.preset:hover, .preset:focus-visible { border-color: var(--accent); }
.preset b { font-size: 18px; }
.preset b::before { content: "+ "; color: var(--accent); }
.preset span { font-size: 15px; color: var(--muted); }
.stack-top { margin-top: 24px; }
[data-for][hidden] { display: none; }

/* Account, alerts and unsubscribe pages: a heading block, then panels. */
.hero { padding: 26px 0 8px; }
.eyebrow { margin: 0; font-size: 18px; font-weight: 500; color: var(--muted); }
.headline-gap { margin-top: 8px; max-width: 22ch; }
.hero-sub { margin: 12px 0 0; font-size: 19px; line-height: 1.45; color: var(--muted); max-width: 62ch; }
.hero-sub b, .hero-sub a { color: var(--text); }
.sheet { padding: 18px 0 48px; }
.sheet .wrap > * + * { margin-top: 20px; }
.small-caps { font-size: 14px; color: var(--muted); margin-right: 10px; font-weight: 600; }

/* --- Footer --------------------------------------------------------------------------------- */

.site-footer { padding: 26px 0 48px; border-top: 2px solid var(--line); font-size: 14px; color: var(--soft); }
.site-footer p { margin: 0 0 8px; max-width: 80ch; }
.site-footer strong { color: var(--muted); }
.footer-credits { font-size: 13px; }

/* --- Phones --------------------------------------------------------------------------------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .masthead-inner { min-height: 68px; }
  .masthead .nav { display: none; }
  .menu { display: block; }
  .duo, .split { grid-template-columns: minmax(0, 1fr); }
  .page { gap: 16px; }
  .version-form select { font-size: 16px; }
  .panel { padding: 24px 22px; border-radius: 24px; }
  .big-price { letter-spacing: -3px; }
  .says, .lead { font-size: 18px; }
  .chart-plot { height: 160px; }
  .zone, .ticks { gap: 2px; }
  .ticks:not(.ticks-daily) span:nth-child(12n+7) i { display: none; } /* every 6 hours */
  .alert-list li { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .alert-list .alert-state { grid-row: 1; grid-column: 2; }
  /* On a phone the price goes under the name. */
  .tariff { grid-template-columns: minmax(0, 1fr); }
  .tariff-price { text-align: left; }
}

/* Smart meter readings calendar (linked accounts) */
.btn-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; cursor: pointer; }
.meter-key { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.meter-key li { display: flex; align-items: center; gap: 8px; }
.meter-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin: 18px 0 0; }
.meter-month { margin: 0; }
.meter-month figcaption { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.meter-grid { display: grid; grid-template-columns: repeat(7, 28px); gap: 4px; }
.meter-day { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--panel-deep); font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-key .meter-day { width: 18px; height: 18px; border-radius: 5px; }
.meter-full, .meter-partial, .meter-missing { color: var(--band-ink); }
.meter-full { background: var(--cheap); }
.meter-partial { background: var(--pricey); }
.meter-missing { background: var(--peak); }
.meter-waiting { background: none; box-shadow: inset 0 0 0 2px var(--line); }
.meter-none { background: var(--panel-deep); }
.meter-pad { background: none; }
@media (forced-colors: active) {
  .meter-full { background: CanvasText; }
  .meter-partial { background: GrayText; }
  .meter-missing { background: Canvas; box-shadow: inset 0 0 0 2px CanvasText; }
}

/* Tariff comparison (up to four sets over a year). Series colours were checked for the dark
   panel (#12403A) with the dataviz palette validator: lightness band, chroma, colour-blind
   separation of neighbours and 3:1 contrast. Each set also has its own dash and marker shape. */
:root { --series-1: #C99400; --series-2: #3A86FF; --series-3: #E8655A; --series-4: #22A6C9; }
.compare-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.compare-pick.is-working { opacity: 0.6; pointer-events: none; transition: opacity 0.2s; }
.compare-set select { width: 100%; }
.compare-period { grid-column: 1 / -1; max-width: 280px; }
.compare-version { margin-top: 8px; }
.compare-set label { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 0 0 6px; }
.series-swatch { width: 34px; height: 12px; flex: none; overflow: visible; }
.series-swatch .series-line { stroke-width: 2.5; fill: none; }
.series-swatch .series-dot { stroke: var(--panel); stroke-width: 1.5; }
.series-line.series-1 { stroke: var(--series-1); }
.series-line.series-2 { stroke: var(--series-2); stroke-dasharray: 7 5; }
.series-line.series-3 { stroke: var(--series-3); stroke-dasharray: 2 4; }
.series-line.series-4 { stroke: var(--series-4); stroke-dasharray: 9 4 2 4; }
.series-dot.series-1 { fill: var(--series-1); }
.series-dot.series-2 { fill: var(--series-2); }
.series-dot.series-3 { fill: var(--series-3); }
.series-dot.series-4 { fill: var(--series-4); }
.set-key { display: inline-block; width: 24px; height: 0; border-top: 3px solid; flex: none; }
.series-1-key { border-color: var(--series-1); }
.series-2-key { border-color: var(--series-2); border-top-style: dashed; }
.series-3-key { border-color: var(--series-3); border-top-style: dotted; }
.series-4-key { border-color: var(--series-4); border-top-style: double; border-top-width: 4px; }
.compare-verdict { margin: 24px 0 0; }
.set-cards { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.set-card { background: var(--panel-deep); border-radius: 20px; padding: 16px 18px; border: 2px solid transparent; }
.set-card.is-best { border-color: var(--cheap); }
.set-card p { margin: 0; }
.set-card-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.set-card-name { margin: 6px 0 2px; font-size: 18px; }
.set-card-total { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.series-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.series-legend li { display: flex; align-items: center; gap: 10px; }
.estimate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 18px; margin-top: 12px; align-items: start; }
.estimate-grid .field:first-child { grid-column: 1 / -1; max-width: 520px; }
[hidden] { display: none !important; }
.estimate-form .form-error p { margin: 0; }
.postcode-change { margin-top: 18px; }
.postcode-change summary { cursor: pointer; color: var(--muted); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.postcode-change .inline-form { margin-top: 10px; }
.quiet-more { margin-top: 20px; }
.quiet-more summary { cursor: pointer; color: var(--muted); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.quiet-more p { margin: 8px 0 0; max-width: 70ch; }
.trend { margin: 12px 0 0; }
.trend svg { display: block; width: 100%; height: auto; }
.trend-grid { stroke: var(--line); stroke-width: 1; }
.trend-label { fill: var(--soft); font-size: 13px; font-family: var(--font); }
.trend-year { font-weight: 700; }
.trend-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-dot { stroke: var(--panel); stroke-width: 2; }
.trend-hit { fill: transparent; }
.trend-hit:hover { fill: rgba(244, 241, 232, 0.06); }
.table-scroll { overflow-x: auto; margin: 18px 0 0; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.compare-table th, .compare-table td { padding: 8px 10px; text-align: right; border-top: 1px solid var(--line); }
.compare-table th:first-child { text-align: left; }
.compare-table thead th { color: var(--muted); font-weight: 600; border-top: 0; }
.is-cheaper { color: var(--cheap); font-weight: 700; }
@media (forced-colors: active) {
  .series-line { stroke: CanvasText; }
  .series-dot { fill: CanvasText; }
  .set-key { border-color: CanvasText; }
}

/* Is my Direct Debit right? Two balance lines (series 1 and 2, dashed), a firmer zero line,
   and a tooltip for the month under the pointer or keyboard focus. Colours are the site's own
   variables, so the chart follows whatever scheme the page is in. */
input[type="date"] { font: 500 18px var(--font); padding: 12px 20px; border-radius: 999px; border: 2px solid transparent; background: var(--field); color: var(--on-accent); width: 100%; }
.dd-result .big-time { margin-top: 0; }
.dd-result .says { max-width: 60ch; }
.dd-owe { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.dd-questions { padding-left: 20px; }
.dd-questions li { margin: 0 0 10px; max-width: 70ch; }
.balance-chart { position: relative; }
.balance-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.balance-zero { stroke: var(--muted); stroke-width: 1.5; }
.balance-chart .trend-hit:focus { outline: none; fill: rgba(244, 241, 232, 0.08); stroke: var(--accent); stroke-width: 2; }
.chart-tip { position: absolute; top: 0; margin: 0; max-width: 260px; padding: 8px 12px; border-radius: 14px; background: var(--text); color: var(--on-accent); font-size: 14px; font-weight: 600; line-height: 1.35; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); pointer-events: none; z-index: 3; }
@media (max-width: 1000px) {
  .masthead .nav { gap: 16px; font-size: 15px; }
}
