/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --ink: #0c111b;
  --ink-2: #454d5c;
  --muted: #5f6777;
  --line: #e2e6ee;
  --line-strong: #c3c9d4;
  --control-border: #7f899b; /* at least 3:1 against the card and the field fill */
  --accent: #1a56c4;
  --accent-hover: #154aa8;
  --on-accent: #ffffff;
  --accent-soft: #e6eefc;
  --danger: #b42318;
  --series: #2a78d6;
  --series-past: #5589cf;
  --good: #0a960a;
  --good-ink: #006300;
  --good-soft: rgba(12, 163, 12, 0.13);
  --shadow: 0 1px 2px rgba(12, 17, 27, 0.04), 0 12px 32px -18px rgba(12, 17, 27, 0.18);
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0a0d13;
    --surface: #131822;
    --surface-2: #1a2130;
    --ink: #f1f3f7;
    --ink-2: #c3c9d4;
    --muted: #98a0b0;
    --line: #252c3a;
    --line-strong: #3a4252;
    --control-border: #66708a;
    --accent: #7fb0ff;
    --accent-hover: #a3c6ff;
    --on-accent: #0a0d13;
    --accent-soft: #16233d;
    --danger: #ff9a8f;
    --series: #3987e5;
    --series-past: #2f70c8;
    --good: #0ca30c;
    --good-ink: #6fdc6f;
    --good-soft: rgba(12, 163, 12, 0.2);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 36px -20px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
}

h1, h2 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: 1.25rem; font-weight: 600; color: var(--ink-2); }
h2 { font-size: 1.375rem; font-weight: 650; }
p { margin: 0; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--on-accent); }

.muted { color: var(--muted); }

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

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.625rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 1.375rem; height: 1.375rem; fill: var(--accent); }

.zone-nav ul { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }

.zone-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  min-height: 44px;
  padding: 0.625rem 0.875rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.zone-nav a:hover { background: var(--surface-2); color: var(--ink); }
.zone-nav a[aria-current] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}
.zone-code { font-weight: 700; }
.zone-city { font-size: 0.875rem; color: var(--muted); }
.zone-nav a[aria-current] .zone-city { color: var(--ink-2); }

/* ---------- Page grid ---------- */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  padding-block: 1.5rem 3rem;
}
.page:focus { outline: none; }

@media (min-width: 900px) {
  .page { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .page > .ad-slot,
  .page > .chart-card,
  .page > .note-card,
  .page > .overview-intro,
  .page > .zone-grid,
  .page > .about,
  .page > .answer,
  .page > .extras,
  .page > .subscribe,
  .page > .contract-teaser,
  .page > .smart,
  .page > .game-intro,
  .page > .game-me,
  .page > .game-board,
  .page > .game-rules,
  .page > .game-restore,
  .page > .partners,
  .page > .history,
  .page > .places,
  .page > .place-tools,
  .page > .contract-intro,
  .page > .contract-result { grid-column: 1 / -1; }
}

.card {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(120% 120% at 0% 0%, var(--accent-soft), transparent 62%),
    var(--surface);
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.75rem;
  margin-top: 0.25rem;
  line-height: 1;
}
.hero-value {
  font-size: clamp(3.75rem, 11vw, 6.5rem);
  font-weight: 750;
  letter-spacing: -0.045em;
}
.hero-unit { color: var(--ink-2); font-size: 1.25rem; font-weight: 600; }

.hero-sub { margin-top: 0.75rem; color: var(--ink-2); }
.compare {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.125rem 0.625rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  gap: 0.25rem;
  margin-top: 1.25rem;
  padding: 0.25rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.segmented a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.segmented a:hover { color: var(--ink); }
.segmented a[aria-current="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}
.stat { padding-top: 0.75rem; border-top: 1px solid var(--line-strong); }
.stat dt { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.stat dd { margin: 0.25rem 0 0; color: var(--ink-2); font-size: 0.875rem; }
.stat-value { color: var(--ink); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-note { display: block; color: var(--muted); }

.notice {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
}
.notice strong { color: var(--ink); }

/* ---------- Planner ---------- */
.lead { margin-top: 0.5rem; color: var(--ink-2); }

.planner-form { display: grid; gap: 1rem; margin-top: 1.25rem; }

.field { display: grid; gap: 0.375rem; }
.field label { font-size: 0.9375rem; font-weight: 600; }

select,
input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  background-color: var(--surface-2);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237a8394' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.875rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
}
select:hover,
input[type="number"]:hover { border-color: var(--muted); }
select:focus-visible,
input[type="number"]:focus-visible { outline-offset: 1px; border-color: var(--accent); background-color: var(--surface); }
input[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }

.custom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0.875rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.custom legend { padding: 0 0.375rem; font-size: 0.9375rem; font-weight: 600; }
.legend-note { color: var(--muted); font-weight: 400; }
@media (max-width: 420px) {
  .custom { grid-template-columns: minmax(0, 1fr); }
}

.field-error { color: var(--danger); font-size: 0.875rem; font-weight: 600; }
.field-error span {
  display: inline-grid;
  place-items: center;
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.25rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
  line-height: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.25rem;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-md);
  color: var(--on-accent);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:active { transform: translateY(1px); }

.result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--good-soft);
  border: 1px solid var(--good);
  border-radius: var(--radius-md);
}
.result-label { color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.result-time {
  margin-top: 0.25rem;
  font-size: clamp(1.625rem, 4.5vw, 2.25rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.result-meta { margin-top: 0.5rem; color: var(--ink-2); }
.result-saving { margin-top: 0.75rem; color: var(--ink); font-weight: 650; }
.check { color: var(--good-ink); font-weight: 800; }
.result-foot { margin-top: 0.5rem; color: var(--ink-2); font-size: 0.875rem; }

.fineprint { margin-top: 1rem; color: var(--muted); font-size: 0.8125rem; }

/* ---------- Ad placeholder ---------- */
.ad-slot {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Chart ---------- */
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1rem;
}
.card-head h2::first-letter { text-transform: uppercase; }
.unit { color: var(--muted); font-size: 0.875rem; }

.chart-scroll { overflow-x: auto; }
.chart-frame { position: relative; min-width: 720px; border-radius: var(--radius-sm); }
/* The scroll container clips anything outside the frame, so the focus ring is drawn inside it. */
.chart-frame:focus-visible { outline-offset: -3px; }
.chart-hint { margin-top: 0.5rem; color: var(--muted); font-size: 0.8125rem; }
.chart { display: block; width: 100%; height: auto; }

.chart text { fill: var(--muted); font-family: var(--font); font-size: 13px; font-variant-numeric: tabular-nums; }
.grid line { stroke: var(--line); stroke-width: 1; }
.grid line.baseline { stroke: var(--line-strong); }

.bar { fill: var(--series); }
.bar.past { fill: var(--series-past); }
.bar.is-active { fill: var(--ink); }

.window-band { fill: var(--good-soft); }
.window-rule { fill: var(--good); }
.chart .window-label { fill: var(--ink); font-size: 14px; font-weight: 650; }

.now line { stroke: var(--ink); stroke-width: 1.5; }
.chart .now text { fill: var(--ink); font-weight: 700; }

.hit { fill: transparent; cursor: crosshair; }

.tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  padding: 0.375rem 0.625rem;
  background: var(--ink);
  border-radius: 8px;
  color: var(--surface);
  font-size: 0.8125rem;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -100%);
}
.tooltip-value { font-size: 0.9375rem; }

.chart-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.8125rem;
}
.chart-key li { display: inline-flex; align-items: center; gap: 0.375rem; }
.key-swatch { width: 0.75rem; height: 0.75rem; border-radius: 3px; }
.key-future { background: var(--series); }
.key-past { background: var(--series-past); }
.key-window { background: var(--good-soft); border-top: 3px solid var(--good); border-radius: 0; }

/* ---------- Table view ---------- */
.table-view { margin-top: 1rem; }
.table-view summary {
  width: fit-content;
  padding-block: 0.625rem;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.table-scroll {
  position: relative; /* so that text hidden for screen readers cannot widen the page */
  max-height: 22rem;
  margin-top: 0.5rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 0.5rem 0.875rem; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
}
.num { text-align: right; }
tr.is-current th, tr.is-current td { background: var(--accent-soft); font-weight: 650; }

/* ---------- Price history ---------- */
.history .table-scroll { max-height: none; margin: 0.75rem 0; }
.history h2 { margin-top: 1.5rem; }
.history > h2:first-child { margin-top: 0; }
.history h2::first-letter { text-transform: uppercase; } /* a heading may begin with a month name */
.history-chart .chart-frame { min-width: 640px; }
.history-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.history-nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Towns ---------- */
.place-list {
  columns: 11rem;
  column-gap: 1.5rem;
  margin: 0.75rem 0;
  padding: 0;
  list-style: none;
}
.place-list li { break-inside: avoid; }
.place-list a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Overview page ---------- */
.page-title {
  color: var(--ink);
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}
.overview-intro .lead { max-width: 62ch; }

.zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}
.zone-card { transition: border-color 0.15s ease; }
.zone-card:has(a:hover) { border-color: var(--accent); }
.zone-card h2 a { display: grid; gap: 0.125rem; color: var(--ink); text-decoration: none; }
.zone-card-code { font-size: 1.5rem; font-weight: 750; }
.zone-card-name { color: var(--muted); font-size: 0.875rem; font-weight: 500; letter-spacing: 0; }
.zone-card-price { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.75rem; line-height: 1; }
.zone-card-value { font-size: 2.75rem; font-weight: 750; letter-spacing: -0.04em; }
.zone-card-unit { color: var(--ink-2); font-weight: 600; }
.zone-card-time { margin-top: 0.5rem; color: var(--ink-2); font-size: 0.875rem; }
.zone-card-stats { display: grid; gap: 0.375rem; margin: 1rem 0 0; }
.zone-card-stats div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.375rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
}
.zone-card-stats dt { color: var(--muted); }
.zone-card-stats dd { margin: 0; font-weight: 600; text-align: right; }
.zone-card-stats dd span { color: var(--muted); font-weight: 400; }
.zone-card-more { margin-top: 1rem; font-weight: 600; }
.zone-card-more a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Explanatory text ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem 2rem;
  margin-top: 1rem;
}
.about h3 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 650; }
.about p { color: var(--ink-2); }
.about .fineprint { color: var(--muted); }

.answer { color: var(--ink-2); }
.answer strong { color: var(--ink); }
.answer time { white-space: nowrap; }

/* ---------- Planner choices and plan table ---------- */
.choices { display: grid; gap: 0.25rem; margin: 0; padding: 0; border: 0; }
.choices legend { margin-bottom: 0.375rem; padding: 0; font-size: 0.9375rem; font-weight: 600; }
.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.375rem 0.625rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.choice:hover { background: var(--surface-2); }
.choice:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.choice input { width: 1.25rem; height: 1.25rem; flex: none; accent-color: var(--accent); }
.choice-note { display: block; color: var(--muted); font-size: 0.8125rem; }

.plan-table { margin-top: 0.5rem; }
.plan-table th, .plan-table td { padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 1px solid var(--line-strong); vertical-align: top; }
.plan-table thead th { position: static; background: none; }
.plan-table tbody th { font-weight: 650; }
.plan-table tfoot th, .plan-table tfoot td { border-bottom: 0; font-weight: 750; }

/* ---------- Personal fees ---------- */
.extras-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
  margin-top: 1rem;
}
.extras-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; grid-column: 1 / -1; }
.extras-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.hero-breakdown { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.875rem; }

/* ---------- Notes and footer ---------- */
.note-card h1, .note-card h2 { color: var(--ink); font-size: 1.375rem; }
.note-card p { margin-top: 0.5rem; color: var(--ink-2); }
.note-card .btn { margin-top: 0.75rem; }

.site-footer {
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.875rem;
}
.site-footer p + p { margin-top: 0.25rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Owner statistics ---------- */
.stats-page h2 { margin-top: 1.5rem; font-size: 1.125rem; }
.stats-page .table-scroll { max-height: none; }

/* ---------- Subscribe ---------- */
.subscribe-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.subscribe-links a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.subscribe code, .smart code { padding: 0.0625rem 0.25rem; background: var(--surface-2); border-radius: 4px; font-size: 0.8125rem; }

/* ---------- Today compared with recent days ---------- */
.day-context { margin-top: 1rem; color: var(--ink-2); font-size: 0.9375rem; }
.verdict { display: inline-block; margin-right: 0.375rem; padding: 0.125rem 0.625rem; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-size: 0.875rem; white-space: nowrap; }

/* ---------- Contract calculator ---------- */
.contract-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 0.75rem 1rem; align-items: end; margin-top: 1.25rem; }
.contract-form .btn { justify-self: start; }
.contract-table { max-height: none; margin-top: 1rem; }
.row-note { display: block; color: var(--muted); font-size: 0.8125rem; font-weight: 400; }
.contract-result > p { margin-top: 0.75rem; }
.contract-teaser .btn { margin-top: 0.75rem; }

/* Smart-home guide */
.smart h2 { margin-top: 2rem; }
.smart .table-scroll { max-height: none; margin: 0.75rem 0; }
.smart td, .smart th { vertical-align: top; }
.code-block {
  margin: 0.75rem 0;
  padding: 0.875rem 1rem;
  overflow-x: auto;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.code-block code { padding: 0; background: none; font-size: inherit; white-space: pre; }

/* Advertising links */
.ad-label {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.partner-list { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.75rem; }
.partner-list a { font-weight: 650; }
.partner-text { display: block; color: var(--muted); }

/* Guessing game */
.game-form { display: grid; gap: 1rem; max-width: 34rem; margin-top: 1.25rem; }
.game-form .btn { justify-self: start; }
.game-me h3 { margin: 1.75rem 0 0.5rem; font-size: 1.0625rem; }
.game-me form { margin-top: 0.75rem; }
.game-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1rem; }
.game-actions form { margin: 0; }
.game-table { max-height: none; margin-top: 1rem; }
.game-rules ul { margin: 0.75rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; }
.league-list { margin: 0.5rem 0; padding-left: 1.25rem; }
.league-list a { font-weight: 600; }
.btn-secondary { background: transparent; border: 2px solid var(--ink-2); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); }
.confirm { display: flex; gap: 0.625rem; align-items: flex-start; }
.confirm input { width: 1.5rem; height: 1.5rem; margin: 0.125rem 0 0; flex: none; accent-color: var(--accent); }
.confirm label { font-weight: 600; }
#besked:focus { outline: none; }
.recovery { margin-top: 0.75rem; }
.recovery summary { padding-block: 0.625rem; cursor: pointer; color: var(--accent); font-weight: 600; } /* a list item, so the open/closed arrow stays */
.recovery .code-block code { word-break: break-all; white-space: normal; }

/* ---------- Sideways scrolling ---------- */
/* A soft edge on the side where a wide table or chart continues; it disappears at the end. */
:root { --edge: rgba(12, 17, 27, 0.2); }
@media (prefers-color-scheme: dark) {
  :root { --edge: rgba(127, 176, 255, 0.22); }
}
.table-scroll,
.chart-scroll {
  background:
    linear-gradient(to right, var(--surface) 40%, transparent) left / 2rem 100% no-repeat local,
    linear-gradient(to left, var(--surface) 40%, transparent) right / 2rem 100% no-repeat local,
    linear-gradient(to right, var(--edge), transparent) left / 0.75rem 100% no-repeat scroll,
    linear-gradient(to left, var(--edge), transparent) right / 0.75rem 100% no-repeat scroll;
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  .wrap { width: min(1120px, 100% - 1.5rem); }

  /* The four zones share one row, each with its city underneath. */
  .header-row { gap: 0.125rem; padding-block: 0.25rem 0.5rem; }
  .zone-nav { flex: 1 0 100%; }
  .zone-nav ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.25rem, 1fr)); gap: 0.25rem; }
  .zone-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 48px;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    line-height: 1.25;
  }
  .zone-city { font-size: 0.75rem; overflow-wrap: anywhere; text-align: center; }

  .page { gap: 0.875rem; padding-block: 0.875rem 2rem; }
  .card { padding: 1.125rem 1rem; border-radius: 18px; }

  .stats { gap: 0.5rem; }
  .stat-value { font-size: 1.25rem; }
  .stat dd { font-size: 0.8125rem; }

  table { font-size: 0.9375rem; }
  th, td { padding: 0.5rem; }
  thead th { hyphens: auto; }
  .history tbody th a { white-space: nowrap; }
  .history table, .contract-table table { font-size: 0.875rem; }
  .history th, .history td, .contract-table th, .contract-table td { padding: 0.5rem 0.375rem; }
  .history tr > :first-child, .contract-table tr > :first-child { padding-left: 0.625rem; }
  .history tr > :last-child, .contract-table tr > :last-child { padding-right: 0.625rem; }
  .smart td, .smart th { overflow-wrap: anywhere; }

  /* The charts are drawn 960 units wide and shown at about three quarters of that on a phone,
     so their labels are set larger here to stay near 12 px on screen. */
  .chart text { font-size: 16px; }
  .history-chart .chart text { font-size: 17px; }
}
