/* Canada River Levels — minimal but vivid: navy header, bright water blue, colour-coded status. */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #0b1b2e;
  --muted: #5a6b7e;
  --line: #e2e8f0;
  --accent: #0b6bf2;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0fe;
  --header: #0a2342;
  --header-ink: #ffffff;
  --header-muted: #a9bdd6;
  --hero-from: #0a2a5c;
  --hero-to: #0b6bf2;
  --very-low: #e2541b;
  --low: #f0a020;
  --normal: #18a873;
  --high: #1f7cf2;
  --very-high: #7b3fe4;
  --chart: #0b6bf2;
  --chart-area: rgba(11, 107, 242, 0.12);
  --band: rgba(24, 168, 115, 0.12);
  --shadow: 0 1px 2px rgba(11, 27, 46, 0.05), 0 6px 20px rgba(11, 27, 46, 0.06);
  --radius: 16px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #08111d;
  --surface: #0f1b2b;
  --surface-2: #0c1725;
  --ink: #e8eef6;
  --muted: #92a3b8;
  --line: #1c2b3e;
  --accent: #4d9bff;
  --accent-ink: #04162e;
  --accent-soft: #10284a;
  --header: #060d17;
  --header-ink: #ffffff;
  --header-muted: #8fa4c0;
  --hero-from: #0b2a57;
  --hero-to: #1557c8;
  --very-low: #ff7a45;
  --low: #ffbb3d;
  --normal: #34d399;
  --high: #4d9bff;
  --very-high: #a682ff;
  --chart: #4d9bff;
  --chart-area: rgba(77, 155, 255, 0.16);
  --band: rgba(52, 211, 153, 0.12);
  --shadow: none;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08111d;
    --surface: #0f1b2b;
    --surface-2: #0c1725;
    --ink: #e8eef6;
    --muted: #92a3b8;
    --line: #1c2b3e;
    --accent: #4d9bff;
    --accent-ink: #04162e;
    --accent-soft: #10284a;
    --header: #060d17;
    --header-ink: #ffffff;
    --header-muted: #8fa4c0;
    --hero-from: #0b2a57;
    --hero-to: #1557c8;
    --very-low: #ff7a45;
    --low: #ffbb3d;
    --normal: #34d399;
    --high: #4d9bff;
    --very-high: #a682ff;
    --chart: #4d9bff;
    --chart-area: rgba(77, 155, 255, 0.16);
    --band: rgba(52, 211, 153, 0.12);
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 750; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Header: solid navy bar ----------------------------------------------- */
.site-header { background: var(--header); color: var(--header-ink); }
.topbar { display: flex; align-items: center; gap: 1rem; max-width: 1120px; margin: 0 auto; padding: 12px 16px; }
.logo { display: flex; align-items: center; gap: .55rem; color: var(--header-ink); font-weight: 800; letter-spacing: -0.02em; font-size: 1.05rem; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; color: #5fb0ff; }
.topbar nav { display: flex; gap: 1.2rem; margin-left: auto; font-size: .93rem; }
.topbar nav a { color: var(--header-muted); font-weight: 500; }
.topbar nav a:hover { color: var(--header-ink); text-decoration: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--header-ink); cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 48px; }

/* --- Hero + search --------------------------------------------------------- */
.hero { padding: 28px 0 18px; max-width: 760px; }
.hero-band {
  max-width: none; margin: 18px 0 6px; padding: 40px 36px 36px; border-radius: 22px; color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(95, 176, 255, .45) 0%, transparent 55%),
    linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
}
.hero-band h1 { color: #fff; max-width: 680px; }
.hero-band .lead { color: rgba(255, 255, 255, .82); max-width: 640px; }
.hero-band .eyebrow { color: rgba(255, 255, 255, .8); }
.hero-band .search input { border-color: transparent; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; margin-bottom: .7rem; }
.lead { font-size: 1.08rem; color: var(--muted); }
.search { position: relative; margin-top: 1.1rem; max-width: 580px; }
.search input {
  width: 100%; padding: 15px 18px 15px 46px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.search input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.search svg { position: absolute; left: 17px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); stroke: var(--muted); fill: none; stroke-width: 2.2; }
.search-results {
  position: absolute; z-index: 1000; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); color: var(--ink);
}
.search-results a { display: flex; justify-content: space-between; gap: 1rem; padding: 9px 12px; border-radius: 9px; color: var(--ink); }
.search-results a:hover, .search-results a.active { background: var(--accent-soft); text-decoration: none; }

/* --- Live line ------------------------------------------------------------- */
.updated { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); margin: .6rem 0 1rem; }
.live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--normal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--normal) 25%, transparent); }
.updated.stale .live-dot { background: var(--low); box-shadow: 0 0 0 4px color-mix(in srgb, var(--low) 25%, transparent); }

/* --- Cards and grids --------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-top: .15rem; }
.stat-sub { font-size: .85rem; color: var(--muted); }
.stat { border-top: 3px solid var(--accent); }
.stat.tone-high { border-top-color: var(--high); }
.stat.tone-high .stat-value { color: var(--high); }
.stat.tone-low { border-top-color: var(--low); }
.stat.tone-low .stat-value { color: color-mix(in srgb, var(--low) 75%, var(--ink)); }
.stat.tone-rise { border-top-color: var(--very-high); }
.stat.tone-rise .stat-value { color: var(--very-high); }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 10px; }
.section-head p { margin: 0; }

/* --- Status pills (filled) ----------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: 3px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.pill.very-low, .pill.low, .pill.normal, .pill.high, .pill.very-high { border-color: transparent; color: #fff; }
.pill.very-low { background: var(--very-low); }
.pill.low { background: var(--low); color: #3a2500; }
.pill.normal { background: var(--normal); }
.pill.high { background: var(--high); }
.pill.very-high { background: var(--very-high); }
.trend { font-size: .82rem; white-space: nowrap; color: var(--muted); font-weight: 600; }
.trend.rising { color: var(--high); }
.trend.falling { color: var(--very-low); }

/* --- Map --------------------------------------------------------------------- */
.map-card { padding: 0; overflow: hidden; }
.map { height: 460px; background: var(--surface-2); }
.map.small { height: 300px; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 12px 16px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.very-low { background: var(--very-low); }
.dot.low { background: var(--low); }
.dot.normal { background: var(--normal); }
.dot.high { background: var(--high); }
.dot.very-high { background: var(--very-high); }
.leaflet-popup-content { font: 14px/1.4 ui-sans-serif, system-ui, sans-serif; }

/* --- Tables ----------------------------------------------------------------- */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; font-weight: 600; }
.table td a { font-weight: 700; }
.table .sub { display: block; font-size: .82rem; color: var(--muted); font-weight: 400; }

/* --- Province tiles -------------------------------------------------------------- */
.tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile { display: block; color: var(--ink); transition: transform .12s ease, border-color .12s ease; }
.tile:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.tile-name { font-weight: 750; }
.tile-meta { font-size: .85rem; color: var(--muted); }
.mixbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; margin-top: .7rem; background: var(--line); }
.mixbar i { display: block; }
.mixbar .low { background: var(--low); }
.mixbar .normal { background: var(--normal); }
.mixbar .high { background: var(--high); }

/* --- Station reading ------------------------------------------------------------- */
.reading { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.big { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin-top: .2rem; }
.status-card { border-top: 4px solid var(--muted); }
.status-big { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin: .3rem 0 .2rem; }
.status-card.very-low { border-top-color: var(--very-low); background: color-mix(in srgb, var(--very-low) 9%, var(--surface)); }
.status-card.very-low .status-big { color: var(--very-low); }
.status-card.low { border-top-color: var(--low); background: color-mix(in srgb, var(--low) 11%, var(--surface)); }
.status-card.low .status-big { color: color-mix(in srgb, var(--low) 70%, var(--ink)); }
.status-card.normal { border-top-color: var(--normal); background: color-mix(in srgb, var(--normal) 9%, var(--surface)); }
.status-card.normal .status-big { color: var(--normal); }
.status-card.high { border-top-color: var(--high); background: color-mix(in srgb, var(--high) 9%, var(--surface)); }
.status-card.high .status-big { color: var(--high); }
.status-card.very-high { border-top-color: var(--very-high); background: color-mix(in srgb, var(--very-high) 10%, var(--surface)); }
.status-card.very-high .status-big { color: var(--very-high); }

/* --- Gauge: five coloured segments + marker --------------------------------------- */
.gauge-wrap { position: relative; padding-top: 40px; margin-top: 4px; }
.gauge-track { position: relative; height: 44px; }
.gauge-seg { position: absolute; top: 0; bottom: 0; border-right: 2px solid var(--surface); }
.gauge-seg:not(.on)::before { content: ""; position: absolute; inset: 0; background: var(--surface); opacity: .68; }
.gauge-seg:first-child, .gauge-seg:first-child::before { border-radius: 10px 0 0 10px; }
.gauge-seg:nth-child(5), .gauge-seg:nth-child(5)::before { border-radius: 0 10px 10px 0; border-right: 0; }
/* Nombres de los tramos debajo de la barra: el actual en su color y en negrita */
.gauge-track { margin-bottom: 30px; }
.gauge-seg span { position: absolute; top: calc(100% + 8px); left: 0; right: 0; text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge-seg.on { opacity: 1; }
.gauge-seg.on span { font-weight: 800; }
.gauge-seg.very-low { background: var(--very-low); }
.gauge-seg.low { background: var(--low); }
.gauge-seg.normal { background: var(--normal); }
.gauge-seg.high { background: var(--high); }
.gauge-seg.very-high { background: var(--very-high); }
.gauge-seg.very-low.on span { color: var(--very-low); }
.gauge-seg.low.on span { color: color-mix(in srgb, var(--low) 70%, var(--ink)); }
.gauge-seg.normal.on span { color: var(--normal); }
.gauge-seg.high.on span { color: var(--high); }
.gauge-seg.very-high.on span { color: var(--very-high); }
.gauge-marker { position: absolute; top: -8px; bottom: -8px; width: 4px; margin-left: -2px; border-radius: 3px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.gauge-bubble {
  position: absolute; top: 0; transform: translateX(-50%); padding: 3px 10px; border-radius: 8px;
  font-size: .85rem; font-weight: 800; white-space: nowrap; background: var(--ink); color: var(--surface);
}
.gauge-bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.gauge-note { font-size: .9rem; color: var(--muted); margin: 1rem 0 0; }
.gauge-note strong { color: var(--ink); }

/* --- Charts: stretched SVG + HTML labels on top ------------------------------------ */
.chart-box { position: relative; height: 280px; margin-top: 6px; touch-action: pan-y; cursor: crosshair; }
.chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2.75; stroke-linejoin: round; stroke-linecap: round; }
.chart .band { fill: var(--band); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .day { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; opacity: .8; }
.y-label { position: absolute; left: 0; transform: translateY(-120%); font-size: .75rem; color: var(--muted); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 0 4px; border-radius: 4px; pointer-events: none; }
.band-label { position: absolute; right: 6px; transform: translateY(4px); font-size: .72rem; font-weight: 700; color: var(--normal); text-transform: uppercase; letter-spacing: .06em; pointer-events: none; }
.now-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--chart); box-shadow: 0 0 0 3px var(--surface), 0 0 0 7px color-mix(in srgb, var(--chart) 25%, transparent); pointer-events: none; }
.hover-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: .5; pointer-events: none; }
.hover-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--surface); border: 3px solid var(--chart); pointer-events: none; }
.chart-tip { position: absolute; top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: .82rem; line-height: 1.3; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }
.chart-tip strong { display: block; font-size: .95rem; }
.x-labels { position: relative; height: 22px; margin-top: 8px; font-size: .75rem; color: var(--muted); }
.x-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.x-labels span:first-child { transform: none; }
.chart-empty { padding: 24px; text-align: center; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 10px; }
.tab { padding: 5px 14px; border-radius: 999px; font-size: .85rem; color: var(--muted); cursor: pointer; border: 0; background: none; font: inherit; font-weight: 600; }
.tab.active { background: var(--accent); color: var(--accent-ink); }

/* --- Misc --------------------------------------------------------------------------- */
.crumbs { font-size: .85rem; color: var(--muted); margin: 18px 0 4px; }
.crumbs a { color: var(--muted); }
.page-title { margin-top: .3rem; }
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0; }
.faq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.faq-item { border-left: 4px solid var(--accent); }
.faq-item h3 { font-size: 1rem; font-weight: 750; margin-bottom: .45rem; }
.faq-item p { margin: 0; color: var(--muted); }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .88rem; color: var(--ink); font-weight: 600; }
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.empty { text-align: center; color: var(--muted); }
.notice { border-left: 4px solid var(--low); }

.footer { margin-top: 24px; background: var(--header); color: var(--header-muted); }
.footer > * { max-width: 1120px; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
.footer { padding: 28px 0 40px; font-size: .85rem; }
.footer p { margin-top: 0; margin-bottom: .45rem; }
.footer a { color: var(--header-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(255, 255, 255, .35); }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .topbar nav { gap: .9rem; }
  .map { height: 360px; }
}
@media (max-width: 560px) {
  .topbar nav a.hide-sm { display: none; }
  .hero-band { padding: 28px 20px 24px; border-radius: 18px; }
  .big { font-size: 1.75rem; }
  .status-big { font-size: 1.4rem; }
  .stat-value { font-size: 1.6rem; }
  .reading { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .reading .card { padding: 14px; }
  .reading .card:last-child { grid-column: 1 / -1; }
  .table th, .table td { padding: 10px; }
  .table .hide-sm { display: none; }
  .gauge-seg span { font-size: .66rem; }
  .gauge-seg:not(.on) span { visibility: hidden; }
  .chart-box { height: 220px; }
  .faq-grid { grid-template-columns: 1fr; }
}
.big .unit { font-size: .45em; font-weight: 700; color: var(--muted); margin-left: .25em; letter-spacing: 0; }

/* --- Unidades: el HTML trae las dos y se enseña una ------------------------------- */
html:not([data-units="imperial"]) .imp { display: none !important; }
html[data-units="imperial"] .met { display: none !important; }
.units-btn { font: inherit; font-size: .78rem; font-weight: 700; color: var(--header-ink); background: transparent; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 5px 11px; cursor: pointer; white-space: nowrap; }
.units-btn:hover { border-color: var(--header-ink); }

/* --- Fuente y enlaces oficiales ----------------------------------------------------- */
/* Caja amarilla, bien legible en claro y en oscuro: que nadie la tome por una fuente oficial */
.source-note {
  margin: 28px 0 0; padding: 16px 18px; border: 1px solid #e9c46a; border-left: 6px solid #e0a800;
  border-radius: 12px; background: #fff7d6; color: #3b2f00; font-size: .95rem; line-height: 1.6;
}
.source-note strong { color: #2a2100; }
.source-note a { color: #6b4e00; font-weight: 700; text-decoration: underline; }
:root[data-theme="dark"] .source-note { background: #2e2608; border-color: #7a6214; border-left-color: #e0a800; color: #f6e7b4; }
:root[data-theme="dark"] .source-note strong { color: #fff3c4; }
:root[data-theme="dark"] .source-note a { color: #ffd24d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .source-note { background: #2e2608; border-color: #7a6214; border-left-color: #e0a800; color: #f6e7b4; }
  :root:not([data-theme="light"]) .source-note strong { color: #fff3c4; }
  :root:not([data-theme="light"]) .source-note a { color: #ffd24d; }
}
.official h2 { font-size: 1.05rem; margin: 0 0 .3rem; }
.official ul { margin: .6rem 0 0; padding-left: 1.1rem; }
.official li { margin: .25rem 0; }
.more-links { margin: 12px 0 0; font-size: .9rem; font-weight: 600; }
.section-head .more { font-size: .88rem; font-weight: 600; }

/* --- Récord y "hace un año" ------------------------------------------------------------ */
.record .big { margin: .35rem 0 .25rem; }
.record .ly { font-size: 1.15rem; font-weight: 700; margin: .5rem 0 .3rem; line-height: 1.4; }

/* --- Gráfico del año ------------------------------------------------------------------ */
.year-box { height: 300px; }
.chart .band-outer { fill: var(--band); opacity: .55; }
.chart .median { fill: none; stroke: var(--normal); stroke-width: 1.5; stroke-dasharray: 5 5; }
.chart .year-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.chart .year-line.past-1 { stroke: var(--muted); }
.chart .year-line.past-2 { stroke: var(--muted); opacity: .45; stroke-dasharray: 4 3; }
.legend i.lg { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.legend i.lg.band { background: var(--band); outline: 1px solid var(--normal); }
.legend i.lg.median { height: 0; border-top: 2px dashed var(--normal); border-radius: 0; }
.legend i.lg.past-1 { height: 0; border-top: 2px solid var(--muted); border-radius: 0; }
.legend i.lg.past-2 { height: 0; border-top: 2px dashed var(--muted); border-radius: 0; opacity: .6; }
.legend i.lg.now { height: 0; border-top: 3px solid var(--chart); border-radius: 0; }
.year-box + .x-labels + .legend { border-top: 0; padding-left: 0; }

/* --- Tiempo y avisos -------------------------------------------------------------------- */
.weather .periods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: .4rem 0 .8rem; }
.weather .periods p { margin: .25rem 0 0; font-size: .88rem; color: var(--muted); line-height: 1.45; }
.rain-note { margin: 0 0 .8rem; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: .92rem; }
.alerts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 .8rem; }
.alerts.top { margin: 14px 0 0; }
.alert-pill { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: .84rem; font-weight: 700; text-decoration: none; background: var(--low); color: #3a2500; }
.alert-pill.warning { background: var(--very-low); color: #fff; }
@media (max-width: 760px) { .weather .periods { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .weather .periods { grid-template-columns: 1fr; } .units-btn { padding: 4px 8px; } }
