:root {
  color-scheme: light;
  --background: #eef2f7;
  --surface: #ffffff;
  --surface-muted: #e3e3e3;
  --text: #313131;
  --muted: #606060;
  --border: #dfdfdf;
  --focus: #313131;
  /* Diverging cheap<->expensive scale: green vs warm red, neutral grey midpoint (owner
     2026-11-13: "green to red is most recognizable" for the bucket bars/legend).
     --price-cool stays blue for unrelated chrome (brand mark, hero gradient, cheapest-day
     borders) that reused it as a convenient accent shade, not as a price-level signal. */
  --accent: #1c5cab;
  --price-cool: #2a78d6;
  --price-hot: #e34948;
  --price-cheapest: color-mix(in srgb, var(--tint-good) 62%, var(--surface));
  --price-low: color-mix(in srgb, var(--tint-good) 28%, var(--surface));
  --price-typical: color-mix(in srgb, var(--text) 38%, var(--surface));
  --price-high: color-mix(in srgb, var(--price-hot) 28%, var(--surface));
  --price-expensive: color-mix(in srgb, var(--price-hot) 62%, var(--surface));
  --price-wash-cheapest: color-mix(in srgb, var(--tint-good) 10%, var(--surface));
  --price-wash-low: color-mix(in srgb, var(--tint-good) 5%, var(--surface));
  --price-wash-typical: color-mix(in srgb, var(--text) 3%, var(--surface));
  --price-wash-high: color-mix(in srgb, var(--price-hot) 6%, var(--surface));
  --price-wash-expensive: color-mix(in srgb, var(--price-hot) 15%, var(--surface));
  /* UI type (owner 2026-11-12: "the fonts are shit"; mockups are system sans, no mono anywhere).
     System stack = what renders the mockups; no font file, no network request. */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Kept for code-like text only; no longer the UI font. */
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sp-1: 5px;
  --sp-2: 10px;
  --sp-3: 15px;
  --sp-4: 20px;
  --sp-6: 30px;
  /* Card/app style (owner 2026-11-12, mockups in docs/design-reference/). */
  --radius-card: 18px;
  --radius-feature: var(--radius-card);
  --radius-pill: 999px;
  --shadow-ambient: 0 1px 2px color-mix(in srgb, #000 6%, transparent);
  --shadow-key: 0 4px 14px color-mix(in srgb, #000 7%, transparent);
  /* The one new hue: "good news" green for the savings line. Not derivable from the palette. */
  --tint-good: #1f7a4d;
  --tint-good-wash: color-mix(in srgb, var(--tint-good) 10%, var(--surface));
  /* Text set directly on a light --tint-good wash (.savings-card__eur, .pill-card--good's icon)
     fails AA at --tint-good's own value (design-lead review 2026-11-13); this darker shade is for
     text only, never for fills/borders where --tint-good itself still applies. Dark mode is fine
     as-is below. */
  --tint-good-ink: #15653e;
}

[data-theme="dark"] {
  --shadow-ambient: 0 1px 2px color-mix(in srgb, #000 40%, transparent);
  --shadow-key: 0 4px 16px color-mix(in srgb, #000 45%, transparent);
  --tint-good: #5cc28c;
  --tint-good-ink: #5cc28c;
  color-scheme: dark;
  --background: #181818;
  --surface: #222222;
  --surface-muted: #2a2a2a;
  --text: #ededed;
  --muted: #8a8a8a;
  --border: #3a3a3a;
  --focus: #ededed;
  --accent: #3987e5;
  --price-cool: #3987e5;
  --price-hot: #e66767;
}

/* Self-hosted, no third-party request (owner 2026-11: no Google Fonts CDN link).
   IBM Plex Mono (SIL OFL) backs --mono only (code-like text); since 2026-11-12 the UI font
   is the system sans (--font-ui), so these files load only where --mono is used.
   Copyright notice and full OFL 1.1 text: /public/fonts/OFL.txt. */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}

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

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

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="number"] {
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header__inner {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  min-height: 54px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  text-decoration: none;
}

.brand > span {
  color: var(--text);
  font-size: 20px;
}

.site-header nav,
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-header nav a,
footer nav a {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 14px;
  text-decoration: none;
}

.site-header nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
}

main,
footer {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.price-workspace {
  padding: 28px 0 0;
}

.workspace-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.workspace-heading h2,
.info-page h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.workspace-heading p,
.info-page > header p {
  max-width: 700px;
  margin: 10px 0 0;
  color: var(--muted);
}

.source-mark {
  flex: 0 0 auto;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto 1fr;
  gap: 14px;
  margin: 24px 0 14px;
  align-items: end;
}

.controls > label:not(.check-control) {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.controls input[type="number"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
}

.input-with-unit {
  position: relative;
  display: block;
}

.input-with-unit input {
  padding-right: 82px !important;
}

.input-with-unit small {
  position: absolute;
  top: 50%;
  right: 10px;
  overflow: hidden;
  max-width: 74px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-self: end;
  font-size: 14px;
}

.check-control {
  display: flex;
  min-height: 42px;
  padding: 0;
  border: 0;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.overview {
  display: grid;
  grid-template-columns: minmax(350px, .72fr) minmax(0, 1.28fr);
  grid-template-areas:
    "current visual"
    "summary visual"
    "cheapest visual";
  border: 1px solid var(--border);
  border-top: 2px solid var(--text);
}

.current-reading {
  grid-area: current;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-feature);
  background: var(--surface);
}

.current-reading p,
.current-reading > span,
.current-reading time {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Panel and stat labels: small tracked caps, matching /ennuste/ .hf dt. */
.current-reading p,
.day-summary dt,
.market-details dt,
thead th {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.current-reading__value {
  display: flex;
  margin: 5px 0 6px;
  align-items: baseline;
  gap: 8px;
}

.day-verdict {
  display: flex;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 2px 16px;
  font-size: 14px;
}

.day-verdict small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
}

.current-reading__value strong {
  font-family: var(--font-ui);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.price-unit {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.day-summary {
  display: grid;
  grid-area: summary;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border: 0;
}

.day-summary > div {
  padding: 26px 20px;
}

.day-summary > div:first-child {
  padding-left: 0;
}

.day-summary > div + div {
  border-left: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}

.day-summary dt {
  color: var(--muted);
  font-size: 12px;
}

.day-summary dd {
  margin: 8px 0 0;
  font-size: clamp(18px, 2.2vw, 25px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.day-summary time {
  color: var(--muted);
  font-size: 12px;
}

.cheapest-block {
  display: flex;
  grid-area: cheapest;
  padding: 16px 24px 16px 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cheapest-block h2 {
  margin: 0;
  font-size: 16px;
}

.cheapest-block p {
  display: flex;
  margin: 4px 0 0;
  align-items: baseline;
  gap: 8px;
}

.cheapest-block fieldset {
  display: flex;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 0;
}

.cheapest-block legend {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
}

.cheapest-block label,
.interval-switch label {
  cursor: pointer;
}

.cheapest-block input,
.interval-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Option switches share one square segmented style with /ennuste/ .prof: hairline cells, ink fill when on.
   Day tabs stay underlined, so "which day" and "which setting" do not look like the same control. */
.cheapest-block label,
.interval-switch label {
  margin-right: -1px;
}

.cheapest-block label span,
.interval-switch label span {
  display: flex;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  align-items: center;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.cheapest-block input:checked + span,
.interval-switch input:checked + span {
  position: relative;
  border-color: var(--text);
  background: var(--text);
  color: var(--background);
  font-weight: 700;
}

.cheapest-block input:focus-visible + span,
.interval-switch input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent);
  outline-offset: 2px;
}

.data-notes {
  display: flex;
  padding: 8px 2px 0;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumbs {
  display: flex;
  padding-top: 18px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs a {
  color: inherit;
}

.market-details {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.market-details > p {
  max-width: 820px;
  margin: 0 0 16px;
  color: var(--muted);
}

.market-details .data-downloads {
  margin: 12px 0 0;
  font-size: 13px;
}

.market-details dl {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 28px;
  background: transparent;
}

.market-details dl > div {
  padding: 0;
  background: transparent;
}

.market-details dt {
  color: var(--muted);
  font-size: 12px;
}

.market-details dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.market-details .history-date {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.data-section {
  padding: 34px 0;
  border-top: 1px solid var(--border);
}

.section-heading {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2,
.explainers h2,
.info-page h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.view-controls,
.tabs,
.interval-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.interval-switch {
  gap: 0;
}

.price-visual {
  display: flex;
  min-width: 0;
  grid-area: visual;
  border-left: 1px solid var(--border);
  flex-direction: column;
}

.price-visual__header {
  display: flex;
  min-height: 64px;
  padding: 13px 18px 10px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.price-visual__header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.price-visual__header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  border-bottom: 0;
}

.tabs button {
  min-height: 44px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  border-bottom-color: var(--text);
  color: var(--text);
  font-weight: 700;
}

.price-chart,
.history-chart {
  position: relative;
  width: 100%;
  min-height: 280px;
  border: 0;
  background: transparent;
}

.history-chart {
  min-height: 190px;
}

.price-visual .price-chart {
  min-height: 230px;
  border-bottom: 0;
}

.chart-plot {
  display: grid;
  width: 100%;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
}

.price-chart .chart-plot {
  height: 228px;
  min-height: 228px;
}

.chart-plot > svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.history-chart .chart-plot {
  height: 164px;
  min-height: 158px;
  flex: 1 1 164px;
}

.chart-y-axis {
  position: relative;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chart-y-axis span {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  line-height: 1;
  white-space: nowrap;
}

.chart-bar {
  fill: var(--price-typical);
  opacity: 0;
  animation: chart-bar-in 260ms ease-out forwards;
  animation-delay: calc(var(--bar-index, 0) * 3ms);
  transition: opacity 160ms ease, fill 160ms ease;
}

.chart-bar:hover {
  opacity: .72;
}

.chart-bar.price-cheapest { fill: var(--price-cheapest); }
.chart-bar.price-low { fill: var(--price-low); }
.chart-bar.price-typical { fill: var(--price-typical); }
.chart-bar.price-high { fill: var(--price-high); }
.chart-bar.price-expensive { fill: var(--price-expensive); }
.chart-bar.is-current {
  fill: var(--text);
  stroke: none;
}

.chart-cheapest-window {
  fill: color-mix(in srgb, var(--price-cheapest) 50%, transparent);
  stroke: none;
}

.chart-now-point {
  fill: var(--text);
  stroke: var(--surface);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.chart-zero {
  stroke: var(--muted);
  stroke-dasharray: 3 3;
  stroke-width: 1;
  opacity: .55;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
  opacity: .42;
}

@keyframes chart-bar-in {
  from { opacity: .18; }
  to { opacity: 1; }
}

.chart-label,
.chart-tooltip {
  fill: var(--text);
  font-family: inherit;
  font-size: 11px;
}

.chart-tooltip {
  font-size: 12px;
  font-weight: 700;
}

.chart-scale {
  display: flex;
  margin-inline: 52px;
  padding-top: 6px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.history-chart {
  display: flex;
  flex-direction: column;
}

.history-axis {
  display: grid;
  min-height: 26px;
  margin-inline: 52px;
  padding: 4px 5px 6px;
  align-items: end;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.history-axis span {
  overflow: visible;
  text-align: center;
  white-space: nowrap;
}

.price-legend {
  display: grid;
  grid-template-columns: auto 150px auto 1fr;
  margin-top: 8px;
  padding: 0 18px 12px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.price-legend__scale {
  display: grid;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  grid-template-columns: repeat(5, 1fr);
}

.price-legend__scale i {
  display: block;
}

.price-legend__scale .price-cheapest { background: var(--price-cheapest); }
.price-legend__scale .price-low { background: var(--price-low); }
.price-legend__scale .price-typical { background: var(--price-typical); }
.price-legend__scale .price-high { background: var(--price-high); }
.price-legend__scale .price-expensive { background: var(--price-expensive); }

.price-legend small {
  font-size: 11px;
  text-align: right;
}

.table-wrap {
  overflow-x: auto;
  border-top: 2px solid var(--text);
}

.precision-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.precision-control select {
  min-height: 32px;
  padding: 4px 28px 4px 8px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
}

td:last-child,
th:last-child {
  text-align: right;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.is-current td {
  font-weight: 700;
}

tbody tr.is-current td:first-child {
  border-left: 3px solid var(--text);
}

.hour-toggle {
  display: inline-flex;
  padding: 2px 0;
  border: 0;
  background: transparent;
  align-items: center;
  gap: 8px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.hour-toggle:focus-visible {
  border-radius: 0;
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.hour-chevron {
  display: inline-block;
  width: 12px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  transition: transform 140ms ease;
}

.hour-toggle[aria-expanded="true"] .hour-chevron {
  transform: rotate(90deg);
}

.hour-detail[hidden] {
  display: none;
}

.hour-detail > td {
  padding: 0;
  background: var(--surface-muted);
}

.quarter-list {
  padding: 4px 14px 6px 42px;
}

.quarter-list > div {
  display: grid;
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  grid-template-columns: 1fr auto;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.quarter-list > div:last-child {
  border-bottom: 0;
}

.quarter-price {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute !important;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.price-cell {
  background: transparent;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hour-row.price-cheapest td {
  background: var(--price-wash-cheapest);
}

.hour-row.price-low td {
  background: var(--price-wash-low);
}

.hour-row.price-typical td {
  background: var(--price-wash-typical);
}

.hour-row.price-high td {
  background: var(--price-wash-high);
}

.hour-row.price-expensive td {
  background: var(--price-wash-expensive);
}

.explainers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 36px 0 52px;
  border-top: 1px solid var(--border);
  gap: 34px 38px;
}

.explainers article {
  padding-top: 14px;
  border-top: 2px solid var(--text);
}

.explainers p,
.info-page p {
  margin: 8px 0 0;
  color: var(--muted);
}

footer {
  display: flex;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

footer p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.info-page {
  max-width: 760px;
  min-height: 70vh;
  padding: 56px 0 80px;
}

.info-page section {
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid var(--border);
}

.page-language {
  display: grid;
  width: min(220px, 100%);
  gap: 5px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.text-link {
  display: inline-block;
  margin-top: 24px;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-content: center;
  text-align: center;
}

.error-page p,
.error-page h1 {
  margin: 0 0 12px;
}

.price-flash {
  animation: price-flash 180ms ease;
}

@keyframes price-flash {
  from { opacity: .45; }
  to { opacity: 1; }
}

@media (max-width: 820px) {
  .site-header__inner {
    min-height: 50px;
  }

  .site-header nav a:nth-child(n + 3) {
    display: none;
  }

  .price-workspace {
    padding-top: 20px;
  }

  .workspace-heading {
    display: block;
  }

  .workspace-heading h2 {
    font-size: 22px;
  }

  .workspace-heading p {
    font-size: 14px;
    line-height: 1.4;
  }

  .source-mark {
    display: none;
  }

  .controls {
    grid-template-columns: 1.4fr .6fr;
    margin-top: 18px;
  }

  .check-control {
    min-height: 40px;
  }

  .lang-link {
    min-height: 0;
    grid-column: 1 / -1;
    justify-self: start;
  }

  .overview {
    grid-template-columns: 1fr;
    grid-template-areas:
      "current"
      "visual"
      "summary"
      "cheapest";
  }

  .current-reading {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 16px 18px;
  }

  .price-visual {
    border-left: 0;
  }

  .price-visual__header {
    min-height: 0;
    padding: 12px 0 9px;
  }

  .price-legend {
    padding-inline: 0;
  }

  .price-visual .view-controls {
    flex-direction: row;
    align-items: center;
  }

  .price-visual .price-chart {
    min-height: 210px;
  }

  .price-visual .price-chart .chart-plot {
    height: 208px;
    min-height: 208px;
  }

  .current-reading p,
  .current-reading__value,
  .day-verdict {
    grid-column: 1 / -1;
  }

  .current-reading__value strong {
    font-size: 40px;
  }

  .current-reading > span {
    text-align: right;
  }

  .day-summary > div {
    padding: 16px 12px;
  }

  .day-summary {
    border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  }

  .day-summary dd {
    font-size: 18px;
  }

  .cheapest-block {
    padding: 13px 0;
  }

  .data-notes {
    display: none;
  }

  .market-details dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

    .section-heading {
    align-items: flex-start;
  }

  .explainers {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .site-header__inner,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header nav {
    gap: 12px;
  }

  .workspace-heading h2 {
    font-size: 20px;
  }

  .controls {
    gap: 10px;
    margin: 14px 0 10px;
  }

  .market-details dl {
    grid-template-columns: 1fr;
  }

  .controls > label:not(.check-control) {
    font-size: 12px;
  }

  .controls input[type="number"] {
    min-height: 40px;
    padding: 7px 8px;
    font-size: 14px;
  }

  .current-reading {
    padding: 16px 16px;
  }

  .current-reading__value strong {
    font-size: 36px;
  }

  .price-visual__header {
    display: block;
    padding: 11px 0 8px;
  }

  .price-visual__header h2 {
    font-size: 16px;
  }

  .price-visual__header > div:first-child p {
    display: none;
  }

  .price-visual .view-controls {
    margin-top: 8px;
    justify-content: space-between;
    gap: 6px;
  }

  .price-visual .tabs {
    gap: 2px;
  }

  .price-visual .tabs button,
  .price-visual .interval-switch label span {
    padding: 0 8px;
    font-size: 12px;
  }

  .day-summary dt {
    font-size: 11px;
  }

  .day-summary dd {
    font-size: 18px;
  }

  .cheapest-block {
    display: block;
  }

  .cheapest-block fieldset {
    margin-top: 9px;
  }

  .data-section {
    padding: 24px 0;
  }

  .section-heading {
    display: block;
  }

  .price-visual .price-chart {
    min-height: 176px;
  }

  .price-visual .chart-plot {
    grid-template-columns: 31px minmax(0, 1fr) 18px;
  }

  .price-visual .price-chart .chart-plot {
    height: 174px;
    min-height: 174px;
  }

  .history-chart .chart-plot {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .chart-y-axis span {
    right: 6px;
  }

  .price-visual .chart-scale {
    margin-left: 31px;
    margin-right: 18px;
  }

  .history-axis {
    margin-inline: 44px;
  }

  .price-visual .price-legend {
    grid-template-columns: auto minmax(100px, 1fr) auto;
    margin-top: 6px;
    padding: 0 0 10px;
  }

  .price-visual .price-legend small {
    display: none;
  }

  .explainers {
    grid-template-columns: 1fr;
  }

  footer {
    display: block;
  }

  footer nav {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Finnish home page: 7-day forecast block (links to /ennuste/). */
.forecast-teaser {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.forecast-teaser .section-heading a {
  flex: 0 0 auto;
  font-size: 14px;
}

/* 7-day strip (2026-11-12 mockup "Seuraavat 7 päivää"): one column per day, all days across at any width.
   Column: weekday, date, level bar (height = day mean vs dearest shown day), day mean. Cheapest day: blue edge. */
.forecast-days {
  display: grid;
  margin: 14px 0 0;
  padding: 0;
  grid-template-columns: repeat(var(--forecast-days, 7), minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}

.forecast-days li {
  min-width: 0;
}

.forecast-days__card {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 44px;
  padding: 10px 4px 9px;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 14px;
  color: inherit;
  text-align: center;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.forecast-days__card:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: inherit;
}

.forecast-days li.is-cheapest .forecast-days__card {
  border: 1.5px solid var(--price-cool);
  background: var(--wash-cheap);
}

.forecast-days__wd {
  font-size: 14px;
  text-transform: capitalize;
}

.forecast-days__card time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.forecast-days__bar {
  display: flex;
  width: 60%;
  max-width: 56px;
  height: 30px;
  margin: 8px 0 6px;
  align-items: flex-end;
}

.forecast-days__bar i {
  display: block;
  width: 100%;
  height: var(--h, 50%);
  border-radius: 4px;
  background: var(--price-typical);
}

.lv-0 .forecast-days__bar i { background: var(--price-cheapest); }
.lv-1 .forecast-days__bar i { background: var(--price-low); }
.lv-2 .forecast-days__bar i { background: var(--price-typical); }
.lv-3 .forecast-days__bar i { background: var(--price-high); }
.lv-4 .forecast-days__bar i { background: var(--price-expensive); }

.forecast-days__card strong {
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.forecast-days__card small {
  color: var(--muted);
  font-size: 12px;
}

.forecast-days__hour span {
  color: var(--text);
  font-weight: 600;
}

.forecast-teaser__note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.forecast-teaser__contract {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 12px;
  margin: 12px 0 0;
  padding-top: 4px;
  border-top: 1px solid var(--line, var(--border, #d8dee6));
  font-size: 15px;
}

.forecast-teaser__contract a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}

/* Phones and tablets: the strip keeps only weekday, date, bar and mean; level word and cheapest hour
   are read out (visually hidden), so seven columns fit 390 px with no scroll. */
@media (max-width: 820px) {
  .forecast-days__card small {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    margin: -1px;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .forecast-days {
    gap: 4px;
  }

  .forecast-days__card {
    padding: 8px 0 7px;
    border-radius: 12px;
  }

  .forecast-days__wd {
    font-size: 13px;
  }

  .forecast-days__card time {
    font-size: 11px;
    letter-spacing: -0.02em;
  }

  .forecast-days__card strong {
    font-size: 14px;
    letter-spacing: -0.02em;
  }
}

@media (max-width: 380px) {
  .forecast-days {
    gap: 3px;
  }

  .forecast-days__card strong {
    font-size: 13px;
  }
}

/* ---- Card/app style, owner 2026-11-12 ("I LOVE THESE"; docs/design-reference/2026-11-12-mobile-app-*.png).
   Shared components for / and /ennuste/: soft-shadow cards, pill chips, tinted stat tiles, icon tiles,
   the savings line and the phone bottom bar. Shades derive from the base tokens, so dark mode follows;
   --tint-good is the only new hue. Type is the system sans (--font-ui), as in the mockups. ---- */
:root {
  --ink-cheap: color-mix(in srgb, var(--accent) 88%, var(--text));
  --ink-dear: color-mix(in srgb, var(--price-hot) 80%, var(--text));
  --wash-cheap: color-mix(in srgb, var(--price-cool) 9%, var(--surface));
  --wash-dear: color-mix(in srgb, var(--price-hot) 9%, var(--surface));
  /* Muted steel blue like the mockup hero (not the saturated link blue). Text sits on the dark
     left plateau (white >= 4.5:1); only the right edge, under the white pill and trees, lightens. */
  --hero-from: color-mix(in srgb, var(--accent) 70%, #5b7896);
  --hero-to: color-mix(in srgb, var(--price-cool) 60%, #9fbad8);
  --chip-on: color-mix(in srgb, var(--accent) 82%, #000);
  /* Winter tree line, inline SVG (no request): the mockup's photo, reduced to a quiet silhouette.
     Shared by the home hero and the /ennuste/viikko/ hero. */
  --hero-trees: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 70'%3E%3Cg fill='%23fff'%3E%3Cpath opacity='.2' d='M0 70Q70 50 140 58T220 54V70z'/%3E%3Cpath opacity='.34' d='M132.0 42.0L135.6 51.9H128.4zM132.0 49.3L137.8 59.2H126.2zM132.0 56.6L140.1 66.4H123.9zM130.8 65.9h2.4v2.1h-2.4zM152.0 28.0L157.4 43.2H146.6zM152.0 39.2L160.8 54.4H143.2zM152.0 50.4L164.1 65.6H139.9zM150.8 64.8h2.4v3.2h-2.4zM176.0 14.0L183.2 35.3H168.8zM176.0 29.7L187.7 51.0H164.3zM176.0 45.4L192.2 66.6H159.8zM174.8 65.5h2.4v4.5h-2.4zM198.0 32.0L202.9 45.7H193.1zM198.0 42.1L206.0 55.8H190.0zM198.0 52.2L209.1 65.8H186.9zM196.8 65.1h2.4v2.9h-2.4zM214.0 46.0L217.4 55.1H210.6zM214.0 52.7L219.5 61.8H208.5zM214.0 59.4L221.6 68.6H206.4zM212.8 68.1h2.4v1.9h-2.4z'/%3E%3C/g%3E%3C/svg%3E");
}

/* Dark accent is lighter; darken the hero so white text keeps AA (>= 4.5:1). */
[data-theme="dark"] {
  --hero-from: color-mix(in srgb, var(--accent) 72%, #000);
  --hero-to: color-mix(in srgb, var(--accent) 50%, #000);
}

/* Sans digits are proportional by default; line them up wherever prices stack or tick (was mono's job). */
table,
.day-summary dd,
.price-chart text,
.chart-callout,
.savings-card__eur,
.badge--cheap,
.badge--dear {
  font-variant-numeric: tabular-nums;
}

.icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  vertical-align: -0.25em;
}

.app-card {
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-ambient), var(--shadow-key);
}

[data-theme="dark"] .app-card {
  outline: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  outline-offset: -1px;
}

.app-card--accent {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.pill {
  display: inline-flex;
  min-height: 28px;
  padding: 3px 12px;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.pill--live {
  background: color-mix(in srgb, #fff 90%, transparent);
  color: #1d2733;
}

.pill--live i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1f7a4d;
  box-shadow: 0 0 0 0 color-mix(in srgb, #1f7a4d 45%, transparent);
  animation: live-pulse 2.4s ease-out infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, #1f7a4d 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px color-mix(in srgb, #1f7a4d 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .pill--live i { animation: none; }
}

/* Tinted rounded square behind an icon (pill cards, Suositus, chore tiles, savings). */
.icon-tile__icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--ink-cheap);
}

.icon-tile__icon .icon {
  width: 22px;
  height: 22px;
}

.icon-tile__icon--lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

.icon-tile__icon--lg .icon {
  width: 30px;
  height: 30px;
}

.icon-tile {
  display: flex;
  min-width: 0;
  padding: 14px 10px;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-ambient), var(--shadow-key);
  text-align: center;
  font-size: 13px;
  line-height: 1.3;
}

.icon-tile .icon-tile__icon {
  margin-bottom: 4px;
  background: transparent;
}

.icon-tile .icon-tile__icon .icon {
  width: 30px;
  height: 30px;
}

.icon-tile b {
  font-size: 14px;
  font-weight: 600;
}

.icon-tile span:last-child {
  color: var(--muted);
}

/* Stat tile: label with a glyph, big value, time chip. Cheap = blue, dear = red (the chart's colours). */
.stat-tile {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 16px;
  background: var(--surface);
}

.stat-tile--cheap {
  border-color: color-mix(in srgb, var(--price-cool) 18%, var(--surface));
  background: var(--wash-cheap);
}

.stat-tile--dear {
  border-color: color-mix(in srgb, var(--price-hot) 20%, var(--surface));
  background: var(--wash-dear);
}

/* Mockup: the label stays ink; the icon and the number carry the colour. */
.stat-tile--cheap dd,
.stat-tile--cheap dt .icon {
  color: var(--ink-cheap);
}

.stat-tile--dear dd,
.stat-tile--dear dt .icon {
  color: var(--ink-dear);
}

.stat-tile dt {
  color: var(--text);
}

.badge--cheap,
.badge--dear {
  display: inline-flex;
  padding: 1px 9px;
  align-items: center;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge--cheap {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--ink-cheap);
}

.badge--dear {
  background: color-mix(in srgb, var(--price-hot) 16%, var(--surface));
  color: var(--ink-dear);
}

/* Savings line: coins, the sentence, the euro amount in a green pill. */
.savings-card {
  display: flex;
  margin: 14px 0 0;
  padding: 12px 14px;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  font-size: 14px;
  line-height: 1.4;
}

.savings-card > span:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}

.savings-card__eur {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--tint-good-wash);
  color: var(--tint-good-ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Phone bottom bar (four places). Hidden on desktop; the header nav serves there. */
.bottom-nav {
  display: none;
}

@media (max-width: 820px) {
  .bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface);
    box-shadow: 0 -1px 0 color-mix(in srgb, var(--border) 80%, transparent), 0 -6px 18px color-mix(in srgb, #000 6%, transparent);
  }

  .bottom-nav a {
    display: flex;
    min-height: 56px;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
  }

  .bottom-nav .icon {
    width: 24px;
    height: 24px;
  }

  .bottom-nav a[aria-current="page"] {
    color: var(--ink-cheap);
    font-weight: 700;
  }

  .bottom-nav a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent);
    outline-offset: -3px;
  }
}

/* ---- Home (/): hero banner, two pill cards, chart card, stat tiles, Suositus, 7-day cards ---- */
.overview {
  grid-template-areas:
    "current visual"
    "verdict visual"
    "summary visual"
    "cheapest cheapest";
  /* A little wider left column than the old .72fr so "15,80 snt/kWh" and "klo 04–05" stay on one line. */
  grid-template-columns: minmax(360px, .8fr) minmax(0, 1.2fr);
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  border: 0;
}

.overview .hero-banner {
  display: block;
  padding: 20px 22px 18px;
  border: 0;
  border-radius: var(--radius-card);
  /* Winter tree line, inline SVG (no request): the mockup's photo, reduced to a quiet silhouette. */
  background:
    var(--hero-trees) right bottom / 210px auto no-repeat,
    linear-gradient(100deg, var(--hero-from) 0%, var(--hero-from) 50%, var(--hero-to) 100%);
  box-shadow: var(--shadow-ambient), var(--shadow-key);
  color: #fff;
}

/* Brand mark as the mockup's app icon: white bolt on a rounded blue square (inline SVG, no request).
   The ↯ glyph stays in the markup (aria-hidden) but is not drawn. */
.brand > span {
  display: inline-block;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 9px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M13.5 2 5 13.5h6L10 22l9-12h-6.2z'/%3E%3C/svg%3E") center / 20px no-repeat,
    linear-gradient(160deg, var(--price-cool), var(--chip-on));
  color: transparent;
  font-size: 0;
}

/* Round soft header button, as in the mockup; 44 px tap target. */
.theme-toggle {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-ambient), var(--shadow-key);
}

[data-theme="dark"] .theme-toggle {
  outline: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  outline-offset: -1px;
}

/* Inputs follow the card corners instead of the old square field. */
input[type="number"],
select {
  border-radius: 12px;
}

.brand strong {
  font-size: 19px;
  letter-spacing: -0.01em;
}

.hero-banner__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.overview .hero-banner p {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.overview .hero-banner > span,
.overview .hero-banner time,
.overview .hero-banner .price-unit {
  display: inline;
  color: color-mix(in srgb, #fff 86%, transparent);
  text-align: left;
}

.overview .hero-banner time::after {
  content: " · ";
}

.overview .hero-banner .current-reading__value {
  margin: 8px 0 6px;
}

.overview .hero-banner .current-reading__value strong {
  color: #fff;
  font-size: clamp(44px, 6vw, 60px);
}

.overview .hero-banner .price-unit {
  font-size: 16px;
}

.overview .day-verdict {
  display: grid;
  grid-area: verdict;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0;
  gap: 10px;
}

.pill-card {
  display: flex;
  min-width: 0;
  padding: 12px 14px;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  font-size: 15px;
  line-height: 1.3;
}

.pill-card > div {
  min-width: 0;
}

.pill-card [data-verdict],
.pill-card [data-verdict] strong {
  font-weight: 700;
}

.pill-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.pill-card small .price-unit {
  font-size: inherit;
}

.pill-card--good {
  background: var(--tint-good-wash);
}

.pill-card--good .icon-tile__icon {
  background: color-mix(in srgb, var(--tint-good) 16%, var(--surface));
  color: var(--tint-good-ink);
}

.pill-card--dear {
  background: var(--wash-dear);
}

.pill-card--dear .icon-tile__icon {
  background: color-mix(in srgb, var(--price-hot) 16%, var(--surface));
  color: var(--ink-dear);
}

/* Day-verdict cut-offs: fine print in .market-details, not under the pills. */
.day-verdict__rule {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.overview .price-visual {
  padding: 4px 6px 12px;
  border-left: 0;
}

/* Day tabs and switches as rounded segmented chips; the chosen one filled. */
.overview .tabs,
.overview .interval-switch,
.overview .cheapest-block fieldset {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 6%, var(--surface));
}

.overview .tabs button,
.overview .cheapest-block label span,
.overview .interval-switch label span {
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
}

.overview .cheapest-block label,
.overview .interval-switch label {
  margin: 0;
}

.overview .tabs button[aria-selected="true"],
.overview .cheapest-block input:checked + span,
.overview .interval-switch input:checked + span {
  border: 0;
  background: var(--chip-on);
  color: #fff;
  font-weight: 700;
}

/* Callout over the cheapest window, placed in the svg column of .chart-plot (52px | svg | 52px). */
.price-chart .chart-plot {
  --plot-left: 52px;
  --plot-right: 52px;
  position: relative;
}

.chart-callout {
  position: absolute;
  top: max(0px, calc(var(--y) * 100% - 8px));
  left: calc(var(--plot-left) + (100% - var(--plot-left) - var(--plot-right)) * var(--x));
  display: flex;
  padding: 4px 10px;
  flex-direction: column;
  align-items: center;
  transform: translate(var(--shift, -50%), -100%);
  border: 1.5px solid var(--price-cool);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.chart-callout b {
  font-size: 13px;
}

.chart-callout::after {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(var(--shift, -50%) * -1);
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: solid var(--price-cool);
  border-width: 0 1.5px 1.5px 0;
  background: var(--surface);
}

.overview .day-summary {
  grid-area: summary;
  gap: 10px;
  align-self: start;
}

.overview .day-summary > div,
.overview .day-summary > div:first-child,
.overview .day-summary > div + div {
  padding: 14px 12px 12px;
  border-left: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.overview .day-summary > .stat-tile--cheap {
  border-left-color: color-mix(in srgb, var(--price-cool) 18%, var(--surface));
}

.overview .day-summary > .stat-tile--dear {
  border-left-color: color-mix(in srgb, var(--price-hot) 20%, var(--surface));
}

.overview .day-summary dt {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
}

.overview .day-summary dt::before {
  content: "Σ";
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 8%, var(--surface));
  font-weight: 700;
}

.overview .day-summary .stat-tile--cheap dt::before {
  content: "↓";
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--ink-cheap);
}

.overview .day-summary .stat-tile--dear dt::before {
  content: "↑";
  background: color-mix(in srgb, var(--price-hot) 16%, var(--surface));
  color: var(--ink-dear);
}

.overview .day-summary dd {
  margin-top: 8px;
  font-size: clamp(19px, 2vw, 26px);
  white-space: nowrap;
}

.overview .day-summary dd .price-unit {
  margin-left: 1px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: -0.01em;
  font-weight: 400;
  white-space: nowrap;
}

.overview .day-summary time {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text);
  font-size: 13px;
}

.overview .day-summary .stat-tile--cheap time {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.overview .day-summary .stat-tile--dear time {
  background: color-mix(in srgb, var(--price-hot) 14%, var(--surface));
}

.overview .cheapest-block {
  display: flex;
  padding: 16px 18px;
  align-items: center;
  gap: 16px;
  border-top: 0;
}

.cheapest-block__text {
  min-width: 0;
  flex: 1 1 auto;
}

.overview .cheapest-block h2 {
  font-size: 18px;
}

.cheapest-block__lead {
  margin: 2px 0 0;
  font-size: 15px;
}

.overview .cheapest-block #cheapest-window {
  margin-top: 2px;
}

.overview .cheapest-block #cheapest-window strong {
  color: var(--ink-cheap);
  font-size: 18px;
}

/* Page title, intro and price settings: below the cards since 2026-11-12 (mockup: hero first). */
.page-intro {
  margin-top: 28px;
}

.forecast-teaser.app-card {
  margin: 22px 0;
  padding: 18px 18px 16px;
  border-top: 0;
}

.forecast-teaser .section-heading a {
  color: var(--ink-cheap);
  font-weight: 600;
}

/* Narrow desktop (821-1100 px): the left column sits at its minimum, so tiles use the phone sizing
   and a 390 px floor; "15,48 snt/kWh" and "klo 20.00–20.15" stay on one line. */
@media (min-width: 821px) and (max-width: 1100px) {
  .overview {
    grid-template-columns: minmax(390px, .8fr) minmax(0, 1.2fr);
  }

  /* The chart column is narrower here: day tabs and the 1 tunti / 15 min switch wrap under the title. */
  .price-visual__header,
  .price-visual .view-controls {
    flex-wrap: wrap;
    align-items: center;
  }

  .overview .day-summary {
    gap: 8px;
  }

  .overview .day-summary > div,
  .overview .day-summary > div:first-child,
  .overview .day-summary > div + div {
    padding: 12px 8px;
  }

  .overview .day-summary dd {
    font-size: 20px;
    letter-spacing: -0.02em;
  }

  .overview .day-summary dd .price-unit {
    margin-left: 0;
    font-size: 11px;
  }

  .overview .day-summary time {
    padding: 2px 7px;
    font-size: 12px;
  }
}

@media (max-width: 820px) {
  .overview {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "current"
      "verdict"
      "visual"
      "summary"
      "cheapest";
    grid-template-rows: none;
    gap: 12px;
  }

  .overview .day-summary {
    border-top: 0;
  }

  .overview .hero-banner {
    padding: 16px 18px;
  }

  .price-workspace {
    padding-top: 12px;
  }

  .page-intro {
    margin-top: 24px;
  }

  .overview .hero-banner .current-reading__value strong {
    font-size: 48px;
  }

  .overview .day-verdict {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview .day-verdict:not(:has(.pill-card + .pill-card)) {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview .price-visual {
    padding: 4px 10px 10px;
  }

  .overview .day-summary > div,
  .overview .day-summary > div:first-child,
  .overview .day-summary > div + div {
    padding: 12px 10px;
  }

  .overview .day-summary dd {
    font-size: 22px;
  }
}

@media (max-width: 520px) {
  .price-visual .chart-plot,
  .price-chart .chart-plot {
    --plot-left: 31px;
    --plot-right: 18px;
  }

  .overview .hero-banner .current-reading__value strong {
    font-size: 44px;
  }

  /* Half-width pills wrapped to 4-5 lines at 390 px; full width they read as two lines each:
     "Tänään: kallis päivä" / "Keskihinta 8,56 snt/kWh". */
  .overview .day-verdict,
  .overview .day-verdict:not(:has(.pill-card + .pill-card)) {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .pill-card {
    padding: 10px 12px;
    gap: 10px;
    font-size: 14px;
  }

  .pill-card .icon-tile__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .pill-card small {
    font-size: 13px;
  }

  .overview .day-summary {
    gap: 6px;
  }

  .overview .day-summary > div,
  .overview .day-summary > div:first-child,
  .overview .day-summary > div + div {
    padding: 10px 7px;
  }

  .overview .day-summary dt {
    gap: 5px;
    font-size: 12px;
  }

  .overview .day-summary dt::before {
    width: 20px;
    height: 20px;
    border-radius: 6px;
  }

  .overview .day-summary dd {
    font-size: 19px;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  .overview .day-summary dd .price-unit {
    font-size: 10px;
    margin-left: 0;
  }

  .overview .day-summary time {
    padding: 2px 7px;
    font-size: 12px;
    white-space: nowrap;
  }

  .overview .day-summary time {
    padding: 2px 7px;
    font-size: 12px;
  }

  .overview .cheapest-block {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 14px;
    gap: 10px 12px;
  }

  .overview .cheapest-block fieldset {
    grid-column: 1 / -1;
    margin: 0;
    justify-self: start;
  }

  .overview .tabs button,
  .overview .interval-switch label span {
    padding: 0 10px;
  }

  .forecast-teaser.app-card {
    padding: 14px 12px;
  }
}

/* Small phones (360 px): tiles are 106 px wide; keep "15,48 snt/kWh" and "klo 20.00–20.15" on one line. */
@media (max-width: 380px) {
  .overview .day-summary > div,
  .overview .day-summary > div:first-child,
  .overview .day-summary > div + div {
    padding: 10px 5px;
  }

  .overview .day-summary dd {
    font-size: 17px;
  }

  .overview .day-summary time {
    padding: 2px 4px;
    font-size: 11px;
  }
}
