/* styles.css — the visual system of the app.
 *
 * Design intent (see docs/wording.md and the card structure in src/ui/app.js):
 *   · calm, high-contrast surfaces so the numbers carry the weight
 *   · one colour family per meaning — measured (blue/teal) vs modelled
 *     (orange) — and never the same colour for both
 *   · generous spacing, large type, and numbers that are easy to read at a
 *     glance on a phone
 *   · every chart sits next to words, so the page never depends on the
 *     reader being able to read a graph
 */

:root {
  /* surfaces */
  --canvas: #eceff3;
  --canvas-2: #e3e8ee;
  --paper: #ffffff;
  --paper-2: #f7f9fb;
  --ink: #10202b;
  --ink-2: #33485a;
  --muted: #63788a;
  --line: #dde5eb;
  --line-strong: #c3d0da;

  /* brand */
  --accent: #0b6bcb;
  --accent-dark: #07539f;
  --header-1: #0b2536;
  --header-2: #14455f;

  /* data colours — measured vs modelled */
  --past: #2f5872;
  --past-soft: #e2ebf1;
  --now: #0c8a97;
  --now-soft: #dff1f2;
  --future: #df5f2c;
  --future-deep: #ad3d16;
  --future-soft: #fbe6da;
  --good: #1d7a52;
  --bad: #b3341f;

  /* shape */
  --radius-lg: 20px;
  --radius: 13px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(16, 32, 43, 0.06), 0 6px 18px rgba(16, 32, 43, 0.07);
  --shadow-2: 0 2px 6px rgba(16, 32, 43, 0.08), 0 18px 44px rgba(16, 32, 43, 0.12);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 12% -10%, #dfe9f2 0%, rgba(223, 233, 242, 0) 60%),
    linear-gradient(180deg, var(--canvas) 0%, var(--canvas-2) 100%);
  background-attachment: fixed;
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  box-shadow: var(--shadow-1);
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- header -- */

.site-header {
  background: linear-gradient(135deg, var(--header-1) 0%, var(--header-2) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px rgba(9, 26, 38, 0.25);
  position: relative;
  overflow: hidden;
}
.site-header::after {
  /* a faint contour-line texture: climate data, not decoration for its own sake */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 26px);
  pointer-events: none;
}
.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem 1.6rem;
}
.site-header h1 {
  font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.tagline {
  color: rgba(255, 255, 255, 0.82);
  margin: 0.45rem 0 0;
  max-width: 46rem;
  font-size: clamp(0.92rem, 0.88rem + 0.2vw, 1.02rem);
  line-height: 1.5;
}
.lang-btn {
  flex: none;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.6); }

/* ---------------------------------------------------------------- layout -- */

main.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'search' 'map' 'results';
  gap: 1.25rem;
  padding-block: 1.5rem 3rem;
  align-items: start;
}
.search-section { grid-area: search; }
#map-section { grid-area: map; }
.results-col { grid-area: results; display: grid; gap: 1.25rem; }

@media (min-width: 62rem) {
  main.layout {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    grid-template-areas:
      'search search'
      'map    results';
    gap: 1.5rem;
  }
  #map-section { position: sticky; top: 1rem; }
}

/* ---------------------------------------------------------------- search -- */

#search-form {
  display: flex;
  gap: 0.6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.55rem;
  box-shadow: var(--shadow-1);
}
#search-input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--paper-2);
}
#search-input::placeholder { color: #8b9dab; }
#search-input:focus {
  outline: none;
  background: var(--paper);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(11, 107, 203, 0.14);
}
#search-button, .btn {
  padding: 0.75rem 1.4rem;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}
#search-button:hover, .btn:hover { background: var(--accent-dark); }
#search-button:active { transform: translateY(1px); }

#search-status {
  min-height: 1.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.5rem;
  padding-left: 0.2rem;
}

#manual-form {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}
#manual-form summary { cursor: pointer; }
.manual-row { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.manual-row input {
  flex: 1;
  min-width: 7rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
#manual-status { color: var(--bad); margin: 0.4rem 0 0; }

/* ------------------------------------------------------------------- map -- */

#map-section { position: relative; }
#map {
  height: clamp(300px, 42vh, 460px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  background: var(--paper-2);
}
.maplibregl-ctrl-group {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-1) !important;
  overflow: hidden;
}
.maplibregl-ctrl-attrib { font-size: 0.7rem; }

.legend {
  position: absolute;
  left: 0.75rem;
  bottom: 2.4rem; /* clear the attribution strip along the bottom edge */
  right: 0.75rem;
  max-width: 22rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem 0.5rem;
  font-size: 0.76rem;
  box-shadow: var(--shadow-1);
  pointer-events: none;
}
.legend .legend-title {
  margin: 0 0 0.45rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.legend-bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(90deg, #2c7bb6 0%, #abd9e9 20%, #ffffbf 40%, #fdae61 70%, #d7191c 100%);
}
.legend-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.legend-ticks span:first-child { margin-left: -0.1rem; }
.legend-ticks span:last-child { margin-right: -0.1rem; }

/* hover bubble on the map */
.maplibregl-popup-content {
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 0.55rem 0.75rem;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--ink);
}
.map-popup-name { font-weight: 700; display: block; }
.map-popup-value { color: var(--muted); }

/* ------------------------------------------------------------------ card -- */

#card { display: block; }
.card-inner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 1.35rem 1.35rem 1.5rem;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.card-head h2 {
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem);
  margin: 0;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.card-meta { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.8rem; }
.card-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.share-btn {
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--paper-2); }
.cache-badge {
  flex: none;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
}

.card-notes { display: grid; gap: 0.5rem; margin: 0.9rem 0 0.2rem; }
.note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
}
.note-scenario { background: #f3f6f8; color: var(--ink-2); border-left-color: var(--line-strong); }
.note-warm { background: #fdf1e9; color: #7c3b12; border-left-color: var(--future); font-weight: 600; }

/* section rhythm */
.sec-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.sec-title {
  margin: 0 0 0.85rem;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}
.hero-title {
  margin: 0;
  font-size: clamp(1.12rem, 1rem + 0.6vw, 1.35rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.hero-sub { margin: 0.3rem 0 0.9rem; color: var(--muted); font-size: 0.86rem; }

/* ------------------------------------------------------------------ hero -- */

.hero { padding-top: 1.15rem; }
.hero-compare {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.hero-col {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.7rem 0.65rem 0.75rem;
  min-width: 0;
}
.hero-col.is-past { border-top-color: var(--past); background: var(--past-soft); }
.hero-col.is-now { border-top-color: var(--now); background: var(--now-soft); }
.hero-col.is-future { border-top-color: var(--future); background: var(--future-soft); }

.hero-when {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.hero-tag {
  margin: 0.1rem 0 0.4rem;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-num {
  margin: 0;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.hero-unit { margin: 0.15rem 0 0.5rem; font-size: 0.72rem; color: var(--muted); }
.hero-tiles { min-height: 12px; }
.hero-tiles .day-tiles { width: 100%; height: auto; max-width: 100%; }
.hero-col.is-past .hero-tiles { color: var(--past); }
.hero-col.is-now .hero-tiles { color: var(--now); }
.hero-col.is-future .hero-tiles { color: var(--future-deep); }
.hero-freq {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  color: var(--ink-2);
  line-height: 1.35;
}
.hero-tiles-hint { margin: 0.5rem 0 0; font-size: 0.74rem; color: var(--muted); }

.hero-delta { margin: 0.7rem 0 0; }
.delta-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}
.metric-delta { margin: 0.35rem 0 0; }

.hero-freqs { margin: 0.8rem 0 0; display: grid; gap: 0.25rem; }
.hero-freqs p { margin: 0; font-size: 0.88rem; color: var(--ink-2); }

.hero-fan { margin: 1rem 0 0; }
.hero-fan .fan { width: 100%; height: auto; }
.hero-fan figcaption { margin-top: 0.35rem; }
.hero-fan figcaption p { margin: 0 0 0.2rem; font-size: 0.78rem; color: var(--muted); }
.hero-fan .hero-spread { color: var(--ink-2); font-weight: 600; }
.hero-sentence {
  margin: 0.9rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
}

/* --------------------------------------------------------------- timeline -- */

.timeline-sec { padding-top: 1.4rem; }
.timeline-sec .timeline { width: 100%; height: auto; }
.timeline-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.76rem;
  color: var(--ink-2);
}
.timeline-legend li { display: flex; align-items: center; gap: 0.4rem; }
.key { width: 0.85rem; height: 0.85rem; border-radius: 3px; border: 1px solid var(--line-strong); }
.key-past { background: linear-gradient(90deg, var(--past) 0 50%, var(--now) 50% 100%); }
.key-future { background: repeating-linear-gradient(45deg, var(--future-soft) 0 3px, var(--future) 3px 5px); }
.timeline-note { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--muted); }

/* ---------------------------------------------------------------- charts -- */

.day-tiles .tile-solid { fill: currentColor; }
.day-tiles .tile-ghost {
  fill: currentColor;
  fill-opacity: 0.18;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-dasharray: 2.5 2;
  opacity: 0.9;
}
.day-tiles .tile-overflow { font-size: 10px; font-weight: 700; fill: currentColor; }

.fan-band { fill: var(--future-soft); }
.fan-axis { stroke: var(--line-strong); stroke-width: 1; }
.fan-dot { fill: var(--paper); stroke: var(--future-deep); stroke-width: 1.6; }
.fan-avg-line { stroke: var(--future-deep); stroke-width: 1.4; stroke-dasharray: 3 2.5; }
.fan-avg { fill: var(--future-deep); stroke: var(--paper); stroke-width: 2; }
.fan-label { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.fan-label-strong { font-size: 11px; font-weight: 700; fill: var(--ink); }

.timeline .axis-band-past { fill: var(--past); }
.timeline .axis-band-now { fill: var(--now); }
.timeline .axis-band-future { fill: url(#crm-hatch); }
.timeline .axis-hatch-line { stroke: var(--future); stroke-width: 2.4; }
.timeline .axis-today { stroke: var(--ink); stroke-width: 1.6; }
.timeline .axis-tick { stroke: var(--line-strong); stroke-width: 1; }
.timeline .axis-label { font-size: 9px; fill: var(--muted); font-variant-numeric: tabular-nums; }

/* per-metric comparison chart */
.spark { display: block; width: 100%; height: auto; margin: 0.4rem 0 0.2rem; color: var(--ink); }
.spark .spark-ground { stroke: var(--line-strong); stroke-width: 1; }
.spark .spark-bar-base { fill: var(--past); }
.spark .spark-bar-recent { fill: var(--now); }
.spark .spark-bar-proj { fill: var(--future); }
.spark .spark-whisker { stroke: var(--future-deep); stroke-width: 1.6; }
.spark .spark-dot { fill: var(--paper); stroke: var(--future-deep); stroke-width: 1.4; }
.spark .spark-connector { stroke: var(--muted); stroke-width: 1.3; stroke-dasharray: 3 2.5; fill: none; }
.spark .spark-connector-guide { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 2; }
.spark .spark-change-up { fill: var(--ink); }
.spark .spark-change-down { fill: var(--ink); }
.spark .spark-change-flat { fill: var(--muted); }
.spark .spark-label { font-size: 9px; fill: var(--muted); }
.spark .spark-value { font-size: 11px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.spark .spark-sea-full { fill: var(--future-soft); }

/* ---------------------------------------------------------------- metrics -- */

.metrics-sec { padding-top: 1.4rem; }
.metric {
  border-top: 1px solid var(--line);
  padding: 1rem 0 0.9rem;
}
.metric:first-of-type { border-top: none; padding-top: 0.2rem; }
.metric-name { margin: 0 0 0.3rem; font-size: 0.95rem; line-height: 1.35; }
.metric-values {
  margin: 0 0 0.3rem;
  display: grid;
  gap: 0.1rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.metric-viz { margin: 0.2rem 0 0.4rem; }
.metric-empty {
  margin: 0.4rem 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
}
.metric-sentence { margin: 0.3rem 0 0; font-size: 0.9rem; line-height: 1.5; color: var(--ink); }

.metric-info { margin-top: 0.55rem; }
.metric-info summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-dark);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem 0.15rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
}
.metric-info summary::-webkit-details-marker { display: none; }
.metric-info summary::before {
  content: '?';
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}
.metric-info p { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--ink-2); }
.metric-note { color: var(--muted) !important; font-style: italic; }

/* ------------------------------------------------------------------- sea -- */

.sea-sec { padding-top: 1.4rem; }
.sea-figure { margin: 0.8rem 0 0; }
.sea-figure .sea-ruler { width: 100%; height: auto; max-width: 24rem; }
.sea-figure figcaption { margin-top: 0.4rem; }
.sea-figure figcaption p { margin: 0 0 0.2rem; font-size: 0.8rem; color: var(--muted); }
.sea-ruler-title { color: var(--ink) !important; font-weight: 600; }
.sea-ruler-note { font-style: italic; }
.sea-ref { margin: 0.6rem 0 0; font-size: 0.75rem; color: var(--muted); }

.ruler-track { fill: var(--paper-2); stroke: var(--line-strong); stroke-width: 1; }
.ruler-possible { fill: #d7e6f2; }
.ruler-likely { fill: #6aa9d4; }
.ruler-median { stroke: #12466e; stroke-width: 2; }
.ruler-tick { stroke: var(--line-strong); stroke-width: 1; }
.ruler-label { font-size: 9px; fill: var(--muted); }
.ruler-person { fill: var(--line-strong); }
.ruler-adult { stroke: var(--muted); stroke-width: 1; }
.ruler-caption { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.ruler-lead { stroke: var(--line-strong); stroke-width: 1; }
.ruler-value { font-size: 12px; font-weight: 700; fill: #12466e; }
.ruler-range { font-size: 11px; font-weight: 600; fill: var(--ink-2); }

/* --------------------------------------------------------------- summary -- */

.summary-sec { padding-top: 1.4rem; }
.summary { margin: 0; display: grid; gap: 0.55rem; }
.summary-item {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
}
.summary-item dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.summary-item dd { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.summary-action { background: #eef6f1; border-color: #cfe4d7; }
.summary-action dt { color: var(--good); }

/* ----------------------------------------------------------------- howto -- */

.howto {
  margin-top: 1.3rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.85rem;
  background: var(--paper-2);
}
.howto summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--ink-2);
}
.howto-intro { margin: 0.6rem 0 0.3rem; font-size: 0.83rem; color: var(--muted); }
.howto ul { margin: 0.2rem 0 0.5rem; padding-left: 1.1rem; }
.howto li { font-size: 0.83rem; color: var(--ink-2); margin-bottom: 0.3rem; line-height: 1.45; }

.card-foot {
  margin: 1.2rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
}
.dot-sep { color: var(--line-strong); }

/* --------------------------------------------------------------- skeleton -- */

.sk {
  border-radius: 6px;
  background: linear-gradient(90deg, #eef2f5 25%, #f7fafb 50%, #eef2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
.sk-title { height: 1.6rem; width: 45%; margin-bottom: 0.6rem; }
.sk-line { height: 0.85rem; width: 85%; margin-bottom: 0.5rem; }
.sk-hero { height: 6.5rem; width: 100%; margin: 0.9rem 0; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ----------------------------------------------------------------- error -- */

.error-box {
  border: 1px solid #e6c1bd;
  border-left: 4px solid var(--bad);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: #fdf5f4;
  box-shadow: var(--shadow-1);
}
.error-box strong { display: block; margin-bottom: 0.3rem; }
.error-box p { margin: 0 0 0.7rem; font-size: 0.9rem; }
.error-box .btn { margin-right: 0.6rem; }

/* ---------------------------------------------------------------- footer -- */

footer {
  margin-top: 1rem;
  border-top: 1px solid var(--line-strong);
  padding: 1.2rem 0 2.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}
footer p { margin: 0; max-width: 60rem; }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 40rem) {
  .hero-compare { grid-template-columns: 1fr; }
  .hero-col { display: grid; grid-template-columns: auto 1fr; column-gap: 0.8rem; align-items: baseline; }
  .hero-when, .hero-tag { grid-column: 1; }
  .hero-num { grid-column: 2; grid-row: 1; justify-self: end; }
  .hero-unit { grid-column: 2; grid-row: 2; justify-self: end; }
  .hero-tiles, .hero-freq { grid-column: 1 / -1; }
  .legend { right: 0.75rem; }
}

@media (min-width: 62rem) {
  .card-inner { padding: 1.6rem 1.7rem 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

@media print {
  body { background: #fff; }
  .site-header, #map-section, #search-form, .howto, .skip-link { display: none; }
  .card-inner { box-shadow: none; border: none; }
}
