/* La Cruz — estación meteorológica. One stylesheet for Ahora, Tormentas and Historial.
   Mobile first (most visitors are on phones). Quiet surfaces, one typeface (IBM Plex Sans), colour
   reserved for state: green low, yellow moderate, orange high, red very high, violet ongoing. */
:root {
  --bg: #0b0e14;
  --surface: #121722;
  --surface-2: #171d2a;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #eef1f6;
  --text-2: #9aa3b2;
  --text-3: #6b7383;
  --accent: #8cc8ff;
  --forecast: #d47ef0;
  --l0: #59c98a; --l1: #f2c94c; --l2: #ff9a4a; --l3: #f25f5c; --l4: #b48cff;
  --temp: #ffb36b;
  --hum: #6fc3ff;
  --press: #c3a6ff;
  --radius: 14px;
  --pad: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 50% -10%, rgba(80, 120, 190, 0.14), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }  /* components with display:flex must still hide */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--pad) 10px;
  background: rgba(11, 14, 20, 0.82);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 2px; }
.nav a { text-decoration: none; color: var(--text-2); font-size: 14px; padding: 7px 11px; border-radius: 999px; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.page { max-width: 1080px; margin: 0 auto; padding: 22px var(--pad) 10px; }
.footer { max-width: 1080px; margin: 34px auto 0; padding: 22px var(--pad) calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; display: grid; gap: 8px; }
.footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a { text-decoration: none; color: var(--text-2); }
.footer a:hover { color: var(--text); }

/* Shared pieces */
.eyebrow { color: var(--text-2); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--l0); flex: none; }
.live.stale { background: var(--l1); }
.live.off { background: var(--l3); }
.section-title { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 10px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.muted { color: var(--text-2); }
.state { --c: var(--l0); }
.state.l0, .tone-ok, .tone-passed { --c: var(--l0); }
.state.l1, .tone-watch { --c: var(--l1); }
.state.l2, .tone-likely { --c: var(--l2); }
.state.l3, .tone-imminent { --c: var(--l3); }
.tone-ongoing { --c: var(--l4); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.tag { font-size: 12.5px; font-weight: 500; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font: 500 13px 'IBM Plex Sans', sans-serif; color: var(--text-2); background: none; border: 0;
  padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { color: var(--text); background: rgba(255, 255, 255, 0.1); }

/* ---------- Ahora ---------- */
.now { display: grid; gap: 26px; }
.now-main .facts { margin-top: 26px; }  /* same gap as between sections */
.hero .temp { font-size: clamp(92px, 28vw, 150px); font-weight: 300; line-height: 0.95; letter-spacing: -0.045em; margin-top: 6px; }
.hero .temp sup { font-size: 0.38em; font-weight: 300; vertical-align: 0.95em; margin-left: 0.04em; letter-spacing: 0; color: var(--text-2); }
.hero .feel { font-size: 18px; margin-top: 8px; }
.hero .feel .muted { color: var(--text-2); }
.hero .trend { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.storm-line { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 12px 14px; margin-top: 18px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.storm-line:hover { border-color: var(--line-2); }
.storm-line .txt { flex: 1; min-width: 0; font-size: 14.5px; }
.storm-line b { font-weight: 500; color: var(--c); }
.storm-line .go { color: var(--text-3); font-size: 18px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.fact { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.fact:nth-child(odd) { padding-right: 14px; border-right: 1px solid var(--line); }
.fact:nth-child(even) { padding-left: 16px; }
.fact .k { font-size: 13px; color: var(--text-2); }
.fact .v { font-size: 26px; font-weight: 400; letter-spacing: -0.01em; margin-top: 2px; }
.fact .v small { font-size: 14px; color: var(--text-2); margin-left: 2px; }
.fact .s { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.day .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.day .head .section-title { white-space: nowrap; }
.day .head .section-title { margin: 0; }
.chart { position: relative; height: 190px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.chart .readout { position: absolute; top: 0; left: 0; pointer-events: none; font-size: 12.5px; background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 8px; white-space: nowrap; transform: translate(-50%, -100%); opacity: 0; }
.chart .readout.on { opacity: 1; }
.chart .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 14px; }
.notice { font-size: 14px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--l1) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--l1) 30%, transparent); }

@media (min-width: 900px) {
  .now { grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: start; padding-top: 18px; }
  .now .day { grid-column: 1 / -1; }
  /* Temperature and facts on the left, the radar on the right; without a radar (outside the storm region)
     the facts take the right column so neither side is left empty. */
  .now { row-gap: 32px; }
  .now-main { display: contents; }
  .now .hero { grid-column: 1; grid-row: 1; }
  .now-main .facts { grid-column: 1; grid-row: 2; margin-top: 0; }
  .now-side { grid-column: 2; grid-row: 1 / span 2; }
  .now-side .scope-panel { margin-top: 0; }
  .now:has(#scope-panel[hidden]) .now-main .facts { grid-column: 2; grid-row: 1; margin-top: 14px; }
  .now:has(#scope-panel[hidden]) .now-side { display: none; }
  .chart { height: 240px; }
}

/* ---------- Tormentas ---------- */
.btn { font: 500 14px 'IBM Plex Sans', sans-serif; color: var(--text); height: 38px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); padding: 0 12px; }
.btn { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: rgba(255, 255, 255, 0.22); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn[disabled] { opacity: .5; cursor: progress; }
.zones { display: grid; gap: 12px; }
.zone { padding: 16px; display: grid; gap: 12px; }
.zone.skeleton { min-height: 230px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.z-top { display: flex; align-items: center; gap: 8px; }
.z-name { font-weight: 500; }
.z-time { color: var(--text-3); font-size: 13px; }
.z-top .spacer { flex: 1; }
.remove { border: 0; background: none; color: var(--text-3); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.remove:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.z-headline { font-size: 19px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.z-when { color: var(--c); margin-top: 2px; }
.tone-ok .z-when, .tone-passed .z-when { color: var(--text-2); }
.motion { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.datum { padding: 9px 8px 9px 0; min-width: 0; }
.datum + .datum { padding-left: 10px; border-left: 1px solid var(--line); }
.datum .k { font-size: 12px; color: var(--text-2); }
.datum .v { font-size: 18px; margin-top: 1px; white-space: nowrap; }
.datum .s { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.hazards { list-style: none; display: grid; gap: 8px; }
.hazards > li { display: grid; grid-template-columns: minmax(0, 1fr) 80px 80px; gap: 4px 12px; align-items: center; }
.hz-head { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; line-height: 1.25; }
.hz-head span + span { text-align: center; white-space: nowrap; }
.hazard .bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.hazard .bars i { height: 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); }
.hazard .txt { flex: 1; min-width: 0; }
.hazard .t { font-size: 14.5px; }
.hazard .w { font-size: 12.5px; color: var(--text-2); display: block; }
.meter { display: flex; gap: 2px; width: 40px; flex: none; }
.meter i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.meter i.on { background: var(--c); }
.hazard .tag { min-width: 72px; text-align: center; }
.z-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); }
.next { display: flex; gap: 3px; align-items: center; }
.next i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.09); }
.zone .error { color: #ffb0ad; font-size: 14px; }
.map-panel { padding: 0; overflow: hidden; }
#map { height: 62vh; min-height: 360px; max-height: 640px; background: #0d1119; }
.sym.ring { width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--c); display: inline-block; }
.sym.path { width: 20px; height: 0; border-top: 2px dashed var(--forecast); display: inline-block; }
.leaflet-container { font: 12px 'IBM Plex Sans', sans-serif; background: #0d1119; }
.leaflet-control-attribution { background: rgba(11, 14, 20, .78) !important; color: var(--text-3) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-bar a { background: rgba(18, 23, 34, .94); color: var(--text); border-color: var(--line-2); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #161c28; color: var(--text); border: 1px solid var(--line-2); }
.leaflet-popup-content { margin: 11px 13px; font-size: 13px; line-height: 1.45; }
.cell-icon { width: 30px; height: 30px; position: relative; }
.cell-icon .ring { position: absolute; inset: 8px; border-radius: 50%; border: 2.5px solid var(--c); background: rgba(8, 11, 18, .88); }
.cell-icon .ring::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--c); }
.cell-icon .arrow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.cell-icon .arrow::before { content: ''; position: absolute; left: -4px; top: -15px; border-left: 4px solid transparent;
  border-right: 4px solid transparent; border-bottom: 7px solid var(--c); }
.t-severe { --c: var(--l4); } .t-strong { --c: var(--l3); } .t-thunderstorm { --c: var(--l2); } .t-shower { --c: var(--l1); } .t-developing { --c: #7a8597; }
.bolt { color: #ffe866; text-shadow: 0 0 3px #000, 0 0 2px #000; line-height: 1; }
.bolt.old { color: #ffb15c; opacity: .55; }
.zone-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 3px 9px 3px 7px; border-radius: 999px;
  background: rgba(8, 11, 18, .88); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font: 500 11.5px 'IBM Plex Sans', sans-serif; }
.mark-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--forecast); }

/* ---------- Historial ---------- */
.hist-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.hist-head h1 { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.hist { display: grid; gap: 14px; }
.hist .panel { padding: 16px 16px 12px; }
.hist .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.hist h2 { font-size: 15px; font-weight: 500; }
.hist .range { font-size: 13px; color: var(--text-2); }
.hist .chart { height: 200px; }
.keys { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-top: 4px; flex-wrap: wrap; }
.keys i { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 6px; background: var(--k); }
@media (min-width: 900px) {
  .hist { grid-template-columns: 1fr 1fr; }
  .hist .wide { grid-column: 1 / -1; }
  .hist .wide .chart { height: 260px; }
}

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

/* ---------- Tormentas: home, places, details, region ---------- */
.home-ico { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.z-name-input { font: 500 15px 'IBM Plex Sans', sans-serif; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 3px 8px; width: 60%; }
.details { display: grid; gap: 8px; font-size: 13.5px; }
.details .row { display: flex; gap: 8px; align-items: baseline; }
.details .k { color: var(--text-2); min-width: 92px; flex: none; font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 12px; padding: 2px 8px 2px 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--text); display: inline-flex; align-items: center; gap: 5px; }
.chip:not(.hail):not(.wind) { padding-left: 8px; }
.chip .badge { width: 16px; height: 16px; } .chip .badge svg { width: 10px; height: 10px; }
.chip.hail { background: color-mix(in srgb, var(--l4) 22%, transparent); }
.chip.wind { background: color-mix(in srgb, var(--l3) 22%, transparent); }
.near { list-style: none; display: grid; gap: 6px; }
.near li { display: grid; grid-template-columns: 12px 1fr; gap: 8px; align-items: start; }
.near .sym.ring { margin-top: 4px; }
.near .muted { font-size: 12.5px; }
.tl { display: grid; grid-template-columns: 78px repeat(3, 1fr); gap: 3px 4px; align-items: center; font-size: 12px; color: var(--text-2); }
.tl i { height: 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); }
.tl .ticks { grid-column: 2 / -1; display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.advice { font-size: 13.5px; padding: 9px 11px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.z-actions { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.linkish { background: none; border: 0; color: var(--text-2); font: inherit; cursor: pointer; padding: 2px 0; }
.linkish:hover { color: var(--text); text-decoration: underline; }
.map-panel { position: relative; }
.pick-bar { position: absolute; z-index: 1001; left: 10px; right: 10px; top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 12px; background: rgba(18, 23, 34, 0.95); border: 1px solid var(--line-2); font-size: 14px; }
.pick-bar #pick-text { flex: 1 1 200px; }
.pick-bar form { display: flex; gap: 6px; flex: 1 1 240px; }
.pick-bar input { flex: 1; min-width: 0; font: 14px 'IBM Plex Sans', sans-serif; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; height: 34px; }
.picking #map { cursor: crosshair; }
.badge { width: 14px; height: 14px; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid #0b0e14; flex: none; }
.badge.hail { background: var(--l4); }
.badge.wind { background: var(--l3); }
.badge::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.cell-icon .badge { position: absolute; width: 12px; height: 12px; }
.cell-icon .badge.hail { right: -2px; bottom: -2px; }
.cell-icon .badge.wind { left: -2px; bottom: -2px; }
.home-pin { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(8, 11, 18, .9);
  border: 2px solid var(--c); }
.home-pin svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; }
.top button.go { color: var(--text-2); background: none; border: 0; cursor: pointer; font-size: 13px; }
.top button.go:hover { color: var(--text); }


/* ---------- Icon set and map legend (same shapes as the app) ---------- */
.ring-ico { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--c); background: #0b0e14; position: relative; flex: none; }
.ring-ico::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--c); }
.badge { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  border: 1.5px solid #0b0e14; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.badge::after { content: none; }
.badge svg { width: 13px; height: 13px; display: block; }
.badge.hail { background: var(--l4); }
.badge.wind { background: var(--l3); }
.bolt-ico { width: 16px; height: 16px; fill: #ffe866; flex: none; }
.bolt-ico.old { fill: #ff9f43; opacity: .6; }
.path-ico { display: inline-flex; align-items: center; gap: 5px; width: 34px; height: 10px; flex: none;
  background: repeating-linear-gradient(90deg, var(--forecast) 0 4px, transparent 4px 7px) center / 100% 2px no-repeat; justify-content: space-between; }
.path-ico i { width: 6px; height: 6px; border-radius: 50%; background: var(--forecast); }
.house-ico { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: #0b0e14; border: 2px solid var(--accent); flex: none; }
.house-ico svg { width: 12px; height: 12px; }
.place-ico { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #0b0e14, 0 0 0 3px rgba(255,255,255,.3); flex: none; }
/* on the map */
.cell-icon .badge { position: absolute; width: 16px; height: 16px; border-width: 1.5px; }
.cell-icon .badge svg { width: 10px; height: 10px; }
.cell-icon .badge.hail { right: -5px; bottom: -5px; }
.cell-icon .badge.wind { left: -5px; bottom: -5px; }
.bolt-mk { display: block; fill: #ffe866; filter: drop-shadow(0 0 1px #000); }
.bolt-mk.old { fill: #ff9f43; opacity: .55; }
.home-pin { width: 28px; height: 28px; background: #0b0e14; border: 2.5px solid var(--c, var(--accent)); box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.home-pin svg { width: 14px; height: 14px; fill: none; stroke: none; }


/* ==========================================================================
   Editorial pass: serif for numbers and headlines, warm neutrals, hairlines
   instead of boxes, square markers instead of pills, small radii.
   ========================================================================== */
:root {
  --bg: #11110f;
  --surface: #181816;
  --surface-2: #1f1f1c;
  --line: rgba(255, 250, 240, 0.08);
  --line-2: rgba(255, 250, 240, 0.14);
  --text: #f0ede6;
  --text-2: #a6a198;
  --text-3: #75716a;
  --accent: #9cc9f0;
  --serif: 'IBM Plex Serif', Georgia, serif;
  --radius: 6px;
}
body { background: var(--bg); background-image: none; }
.topbar { background: rgba(17, 17, 15, 0.86); }
.brand { font-family: var(--serif); font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }
.nav a { border-radius: 6px; }
.nav a[aria-current="page"] { background: none; color: var(--text); box-shadow: inset 0 -2px 0 var(--text); border-radius: 0; }

/* Serif where it carries meaning: big numbers, page titles, headlines */
.hero .temp { font-family: var(--serif); font-weight: 300; letter-spacing: -0.03em; }
.hero .temp sup { font-family: var(--serif); }
.hero .feel { font-family: var(--serif); font-size: 20px; }
.storms-head h1, .hist-head h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -0.015em; }
.z-headline { font-family: var(--serif); font-weight: 400; font-size: 21px; }
.fact .v, .datum .v { font-family: var(--serif); font-weight: 400; }

/* Fewer boxes: zones and lists separated by rules, not cards */
.panel { border-radius: var(--radius); }
.zones { gap: 0; }
.zone.panel { background: none; border: 0; border-top: 1px solid var(--line-2); border-radius: 0; padding: 18px 0 20px; }
.zone.panel:first-child { border-top: 0; padding-top: 4px; }
.hist .panel { background: none; border: 0; border-top: 1px solid var(--line-2); border-radius: 0; padding: 16px 0 8px; }
.storm-line { border-radius: var(--radius); }
.advice { border-radius: var(--radius); background: none; border: 0; border-left: 2px solid var(--line-2); padding: 2px 0 2px 12px; color: var(--text-2); }

/* Levels: a square of colour and the word, no capsule */
.tag { background: none; padding: 0; border-radius: 0; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.tag::before { content: ''; width: 8px; height: 8px; background: var(--c); flex: none; }
.hazard .tag { min-width: 0; }
.chip { border-radius: 4px; }
.dot { border-radius: 2px; }
.live { border-radius: 50%; }

/* Controls: quieter, squarer */
.btn, .seg { border-radius: 6px; }
.seg button { border-radius: 4px; }
.seg button[aria-pressed="true"] { background: rgba(255, 250, 240, 0.1); }
.map-panel { border-radius: var(--radius); }
.chart .readout { border-radius: 4px; }
.notice { border-radius: var(--radius); }

/* ==========================================================================
   Vivid pass: contrast and colour that come from the data.
   ========================================================================== */
:root {
  --bg: #0d1016;
  --surface: #151a23;
  --surface-2: #1b212c;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.15);
  --text: #ffffff;
  --text-2: #b9c0cb;
  --text-3: #808a99;
  --accent: #6cc4ff;
  --heat: #9aa3b2;
  --l0: #4ed98a; --l1: #ffd23f; --l2: #ff9238; --l3: #ff4d4d; --l4: #b47cff;
}
body { background: var(--bg); }
.topbar { background: rgba(13, 16, 22, 0.86); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

/* Hero: the temperature tints the page */
.hero { position: relative; isolation: isolate; }
.hero::before { content: ''; position: absolute; z-index: -1; left: -60px; top: -20px; width: 380px; height: 300px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--heat) 30%, transparent), transparent); transition: background 1s ease; }
.hero .temp { font-weight: 400; color: #fff; }
.hero .temp sup { color: var(--heat); font-weight: 400; }
.hero .feel { color: #fff; }
.range { display: flex; align-items: center; gap: 10px; margin-top: 14px; max-width: 360px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.range .bar { flex: 1; height: 6px; border-radius: 3px; position: relative; }
.range .bar i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--bg), 0 0 12px rgba(255, 255, 255, .5); }

/* Storm line takes the colour of its level */
.storm-line { background: color-mix(in srgb, var(--c, var(--l0)) 14%, var(--surface)); border: 0; border-left: 4px solid var(--c, var(--l0)); border-radius: 6px; }
.storm-line b { font-weight: 600; }
.storm-line .dot { display: none; }
.storm-line .txt { color: #fff; }

/* Facts: brighter values, small visuals */
.fact .v { color: #fff; font-size: 28px; display: flex; align-items: baseline; gap: 6px; }
.mini { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); margin: 6px 0 4px; max-width: 140px; overflow: hidden; }
.mini i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7fd3ff, #4a9dff); border-radius: 2px; transition: width .6s ease; }
.fact .arrow { font-family: 'IBM Plex Sans', sans-serif; font-size: 20px; font-weight: 600; }
.fact .arrow.down { color: var(--l2); } .fact .arrow.up { color: var(--l0); } .fact .arrow.flat { color: var(--text-3); }
.comfort { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.notice { background: color-mix(in srgb, var(--l1) 14%, var(--surface)); border: 0; border-left: 4px solid var(--l1); }

/* Tormentas: every zone carries its level colour */
.zone.panel { padding-left: 16px; position: relative; }
.zone.panel::before { content: ''; position: absolute; left: 0; top: 20px; bottom: 22px; width: 3px; border-radius: 2px; background: var(--c, var(--l0)); }
.zone.panel:first-child::before { top: 6px; }
.zone.skeleton::before { display: none; }
.z-when { font-weight: 500; }
.tag::before { width: 9px; height: 9px; border-radius: 2px; }
.z-headline, .storms-head h1, .hist-head h1 { color: #fff; }
.chip.hail { background: color-mix(in srgb, var(--l4) 30%, transparent); }
.chip.wind { background: color-mix(in srgb, var(--l3) 30%, transparent); }
.advice { border-left-color: var(--c, var(--line-2)); color: var(--text); }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* Ahora: which place the page is about (station, GPS or a searched town) */
.place { position: relative; margin-bottom: 6px; }
.place-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: 500 20px var(--serif, 'IBM Plex Sans'), serif; color: #fff; letter-spacing: -0.01em; max-width: 100%; }
.place-btn #place-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-btn .pin { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.place-btn .change { font: 500 12.5px 'IBM Plex Sans', sans-serif; letter-spacing: 0; color: var(--accent); margin-left: 4px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); white-space: nowrap; }
.place-btn:hover .change { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.place-btn .chev { display: inline-block; font-size: 11px; transition: transform .2s ease; }
.place-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.place-panel { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: min(420px, calc(100vw - 32px)); padding: 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  display: grid; gap: 10px; }
.place-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { font: 500 13.5px 'IBM Plex Sans', sans-serif; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); }
#place-q { width: 100%; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg);
  color: var(--text); font: 15px 'IBM Plex Sans', sans-serif; }
#place-q:focus { outline: none; border-color: var(--accent); }
.place-results { list-style: none; display: grid; max-height: 260px; overflow-y: auto; }
.place-results:empty { display: none; }
.place-results button { width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 8px; cursor: pointer;
  color: var(--text); font: 15px 'IBM Plex Sans', sans-serif; display: flex; flex-direction: column; }
.place-results button:hover, .place-results button:focus-visible { background: var(--surface-2); }
.place-results small { color: var(--text-3); font-size: 12.5px; }
.place-msg { font-size: 13.5px; color: var(--text-2); }
.place-invite { font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.place-invite .linkish { color: var(--accent); }
.hero .sky { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.hero .sky::first-letter { text-transform: uppercase; }
.source { font-size: 12.5px; color: var(--text-3); margin-top: 18px; }
.source a { color: var(--text-2); }

/* Brand: sevienelatormenta, with "la" dimmed so the words read */
.brand { display: inline-flex; align-items: center; font: 600 18px 'IBM Plex Sans', sans-serif; letter-spacing: -0.035em;
  color: #fff; white-space: nowrap; }
.brand b { font-weight: 400; color: var(--text-3); }
.brand em { font-style: normal; }

/* Brand plus three links on one row down to 360 px phones */
@media (max-width: 420px) {
  .topbar { padding-left: 16px; padding-right: 16px; gap: 8px; }
  .brand { font-size: 15px; }
  .nav { gap: 0; } .nav a { padding: 7px 6px; font-size: 13px; }
}
@media (max-width: 370px) {
  .brand { font-size: 14px; }
  .nav a { padding: 7px 4px; font-size: 12.5px; }
}

/* Ahora: the app's radar around the place */
.scope-panel { margin-top: 22px; }
.scope { max-width: 440px; margin: 0 auto; }
.scope svg { display: block; width: 100%; height: auto; overflow: visible; }
.scope text { font-family: 'IBM Plex Sans', sans-serif; }
.sc-ring { fill: var(--text-3); font-size: 11px; }
.sc-card { fill: #fff; font-size: 14px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.sc-brg { fill: var(--text-3); font-size: 10.5px; text-anchor: middle; dominant-baseline: central; }
.sc-tick { stroke: var(--text-3); stroke-width: 1; }
.sc-min { fill: #fff; font-size: 11px; font-weight: 600; }
.sc-bolt { fill: #ffe866; }
.sc-bolt.old { fill: #ffb15c; opacity: .55; }
.scope-note { font-size: 13px; color: var(--text-2); text-align: center; margin-top: 6px; }
.sc-wrap { position: relative; }
.sc-hit { cursor: pointer; outline: none; }
.sc-area { fill: transparent; }
.sc-hit.on .sc-area, .sc-hit:focus-visible .sc-area { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .55); stroke-width: 1; }
.sc-hit.on .sc-bolt { filter: drop-shadow(0 0 4px #ffe866); }
.sc-tip { position: absolute; z-index: 5; pointer-events: none; max-width: 240px; padding: 8px 11px; border-radius: 8px;
  background: rgba(13, 16, 22, .96); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  font-size: 13px; line-height: 1.4; color: var(--text-2); display: grid; }
.sc-tip b { color: #fff; font-weight: 600; font-size: 13.5px; }
.scope-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.scope-legend span { display: inline-flex; align-items: center; gap: 6px; }
.scope-legend .sw { width: 10px; height: 10px; border-radius: 50%; }
.scope-legend .lg-bolt { width: 12px; height: 12px; fill: #ffe866; }
.scope-legend .lg-track { width: 18px; border-top: 2px dashed #d47ef0; }
.scope-legend .lg-cpa { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; }
.scope-legend .lg-center { width: 8px; height: 8px; border-radius: 50%; background: #6cc4ff; }

/* ---------- Tormentas: status, map, places, region, method ---------- */
.st-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 28px; flex-wrap: wrap; margin-bottom: 16px; }
.st-head h1 { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; color: #fff; }
.st-head .eyebrow { margin-top: 4px; font-size: 13px; display: block; }
.st-head .eyebrow .live { display: inline-block; margin-right: 7px; vertical-align: 1px; }
.sec-head .btn { white-space: nowrap; }
.kpis { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kpis div { padding: 8px 16px; min-width: 96px; }
.kpis div + div { border-left: 1px solid var(--line); }
.kpis dt { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.kpis dd { font: 400 24px var(--serif, 'IBM Plex Sans'), serif; color: #fff; font-variant-numeric: tabular-nums; }
.kpis dd.sub { font: 12px/1.3 var(--sans, inherit); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis dd.sub.near { color: var(--l2); }
.region-sum { margin: -6px 0 12px; font-size: 13px; }
.st-map .map-panel { padding: 0; overflow: hidden; border-radius: 10px; }
.st-map #map { height: min(68vh, 680px); min-height: 380px; max-height: none; }
.legend { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 2px 0; font-size: 12.5px; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend .ring-ico { width: 13px; height: 13px; border-width: 2.5px; }
.legend .ring-ico::after { inset: 2px; }
.legend .badge { width: 16px; height: 16px; } .legend .badge svg { width: 10px; height: 10px; }
.legend .bolt-ico { width: 13px; height: 13px; }
.legend .house-ico { width: 18px; height: 18px; } .legend .house-ico svg { width: 10px; height: 10px; }
.st-places, .st-top, .st-about { margin-top: 36px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sec-head h2 { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.sec-head .tools { display: flex; gap: 8px; flex: 1 1 320px; justify-content: flex-end; }
.add { position: relative; flex: 1 1 220px; max-width: 320px; }
.add input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); font: 14px 'IBM Plex Sans', sans-serif; }
.add input:focus { outline: none; border-color: var(--accent); }
.add-results { list-style: none; position: absolute; z-index: 1100; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); padding: 4px; max-height: 280px; overflow-y: auto; }
.add-results:empty { display: none; }
.add-results li.muted { padding: 8px 10px; font-size: 13px; color: var(--text-2); }
.add-results button { width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 7px 10px; cursor: pointer;
  color: var(--text); font: 14px 'IBM Plex Sans', sans-serif; display: flex; flex-direction: column; }
.add-results button:hover, .add-results button:focus-visible { background: var(--surface-2); }
.add-results small { color: var(--text-3); font-size: 12px; }
.home-setup { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--text-2); margin-bottom: 14px; }
.home-setup .linkish { color: var(--accent); }
.zones { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.z-radar { border-top: 1px solid var(--line); padding-top: 10px; }
.z-radar summary { cursor: pointer; font-size: 13px; color: var(--text-2); list-style: none; display: flex; align-items: center; gap: 6px; }
.z-radar summary::-webkit-details-marker { display: none; }
.z-radar summary::before { content: '▸'; font-size: 11px; transition: transform .2s ease; }
.z-radar[open] summary::before { transform: rotate(90deg); }
.z-radar summary:hover { color: var(--text); }
.z-radar .scope { max-width: 360px; margin: 8px auto 0; }
.table-wrap { overflow-x: auto; }
table.top { width: 100%; border-collapse: collapse; font-size: 14px; }
table.top th, table.top td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.top thead th { font-size: 11.5px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding-top: 0; }
table.top tbody th { font-weight: 500; color: #fff; white-space: nowrap; }
table.top tbody th .sym { margin-right: 8px; vertical-align: -1px; }
table.top td { color: var(--text-2); }
table.top td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.top .go-cell { text-align: right; padding-right: 0; }
table.top button.go { color: var(--accent); background: none; border: 0; cursor: pointer; font-size: 13px; white-space: nowrap; }
.st-about { font-size: 13px; color: var(--text-2); display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.st-about details summary { cursor: pointer; color: var(--text); }
.st-about ul { margin: 8px 0 0 18px; display: grid; gap: 4px; }
@media (max-width: 640px) {
  .kpis { width: 100%; } .kpis div { flex: 1; min-width: 0; padding: 8px 12px; }
  .st-map #map { height: 58vh; min-height: 320px; }
  .sec-head .tools { flex-basis: 100%; } .add { max-width: none; }
  .legend li.sep { margin-left: 0; }
  table.top thead { display: none; }
  table.top tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.top th, table.top td { border: 0; padding: 0; }
  table.top td:nth-child(2), table.top td:nth-child(3), table.top td:nth-child(4) { grid-column: 1; font-size: 13px; }
  table.top .go-cell { grid-column: 2; grid-row: 1; }
}
/* A place card uses the width it gets: two columns (reading | timeline and radar) when wide */
.zone { container-type: inline-size; }
.z-main, .z-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
@container (min-width: 760px) {
  .z-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; }
  .z-side { padding-left: 24px; border-left: 1px solid var(--line); }
  .z-side .z-radar { border-top: 0; padding-top: 0; }
}
.z-body { display: grid; gap: 12px; }
.zone > .details { border-top: 1px solid var(--line); padding-top: 12px; }
@container (min-width: 760px) {
  /* Below the card: Cerca, Rayos and Lluvia side by side, label above value */
  .zone > .details { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 28px; }
  .zone > .details .row { flex-direction: column; gap: 4px; }
}
.page:has(.st-head) { max-width: 1200px; }
@media (min-width: 641px) { .legend li.sep { margin-left: 6px; } }
