:root {
  --ink: #12303a; --muted: #5b737a; --brand: #0b5c6b; --brand-2: #10808f; --bg: #f5f7f6; --card: #fff; --line: #e1e7e6;
  --green: #2e7d32; --amber: #f9a825; --red: #c62828; --na: #78909c;
  --nav-h: 62px; --disc-h: 34px; --rail-w: 92px; --panel-w: 400px; --sheet-w: 420px;
  --r: 14px; --shadow: 0 6px 24px rgba(4, 22, 32, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #06121f; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
.small { font-size: .82rem; } .muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- estructura: móvil = escenario + barra inferior; escritorio = raíl lateral + escenario */
#app { height: 100dvh; display: grid; grid-template-rows: 1fr var(--nav-h); grid-template-areas: "stage" "nav"; }
#stage { grid-area: stage; position: relative; overflow: hidden; contain: strict; }
.nav { grid-area: nav; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 40; }
.nav > button { flex: 1; min-width: 44px; min-height: 44px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .68rem; font-weight: 600; position: relative; transition: color .2s; }
.nav > button svg { width: 24px; height: 24px; }
.nav > button[aria-current="page"] { color: var(--brand); }
.nav > button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.nav > button.soon::after { content: attr(data-soon); position: absolute; top: 4px; left: calc(50% + 6px); white-space: nowrap; font-size: .55rem; background: #e0e6e5; color: var(--muted); border-radius: 6px; padding: 0 4px; }
.nav .brand, .nav .nav-foot { display: none; }

@media (min-width: 1024px) {
  #app { grid-template-rows: 1fr; grid-template-columns: var(--rail-w) 1fr; grid-template-areas: "nav stage"; }
  .nav { flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 10px 6px; gap: 4px; }
  .nav > button { flex: 0 0 auto; min-height: 64px; border-radius: 12px; font-size: .72rem; }
  .nav > button:hover { background: #eef4f4; color: var(--ink); }
  .nav > button[aria-current="page"] { background: #e3f1f2; }
  .nav > button[aria-current="page"]::before { display: none; }
  .nav .brand { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 12px; font-size: .9rem; }
  .nav .brand .logo { width: 48px; height: 48px; border-radius: 10px; background: #fff; }
  .nav .nav-foot { display: flex; flex-direction: column; gap: 6px; margin-top: auto; align-items: stretch; }
  .m-only { display: none !important; }
}
.badge-proto { font-size: .6rem; text-transform: uppercase; letter-spacing: .04em; background: #fff3c4; color: #6b4a00; border-radius: 6px; padding: 1px 5px; }

/* ---------- mapa + espacio (estrellas detrás del canvas transparente del globo) */
#map { position: absolute; inset: 0; }
#map.space {
  background-color: #050d18;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 72% 12%, #cfe3ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 33% 78%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 88% 64%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 42%, #dfe9ff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 8% 58%, #fff8e6 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 88%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 92% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 24% 40%, #e8f0ff 50%, transparent 51%), radial-gradient(1px 1px at 44% 8%, #fff 50%, transparent 51%),
    radial-gradient(ellipse at 50% 120%, #10335a 0%, transparent 60%);
  background-size: 230px 230px, 310px 310px, 270px 270px, 190px 190px, 350px 350px, 290px 290px, 250px 250px, 330px 330px, 170px 170px, 210px 210px, 100% 100%;
}
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-bottom-right { bottom: var(--disc-h); }
.maplibregl-ctrl-top-right { top: 64px; }
.maplibregl-ctrl-attrib { font-size: 10.5px; }
.tip { position: absolute; left: 0; top: 0; z-index: 25; pointer-events: none; background: rgba(10, 30, 38, .92); color: #fff; font-size: .8rem; padding: 6px 9px; border-radius: 8px; max-width: 260px; will-change: transform; }

/* ---------- barra superior del mapa: búsqueda */
.map-top { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 20; display: flex; gap: 8px; align-items: flex-start; transition: left .3s var(--ease); }
.search { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; background: #fff; border-radius: 26px; box-shadow: var(--shadow); min-height: 48px; padding: 0 12px 0 40px; }
.search .s-ico { position: absolute; left: 13px; width: 20px; height: 20px; color: var(--muted); }
.search input { flex: 1; border: 0; outline: none; background: none; min-height: 46px; font-size: 1rem; min-width: 0; }
.kbd { font: 600 .72rem ui-monospace, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
@media (hover: none) { .kbd { display: none; } }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: 14px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
.res { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; border: 0; background: none; min-height: 48px; padding: 6px 10px; border-radius: 10px; }
.res:hover, .res:focus-visible { background: #eef4f4; }
.res small { color: var(--muted); }
.res.world { color: var(--brand); font-weight: 600; }
.fab { width: 48px; height: 48px; flex: 0 0 48px; border: 0; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--brand); }
.fab svg { width: 22px; height: 22px; }
select.fab { text-align: center; font-weight: 700; appearance: none; padding: 0; }
@media (max-width: 1023px) { .fab { width: 44px; height: 44px; flex-basis: 44px; } .search { min-height: 44px; } .search input { min-height: 42px; } .map-top { gap: 6px; } }
@media (min-width: 1024px) {
  .map-top { left: 16px; right: auto; width: min(560px, calc(100% - 32px - var(--sheet-w))); top: 14px; }
  body:is([data-view="playas"], [data-view="alertas"], [data-view="perfil"]) .map-top { left: calc(var(--panel-w) + 16px); }
}

/* ---------- capas (Pronóstico) */
.float-panel { position: absolute; z-index: 15; left: 10px; top: calc(68px + env(safe-area-inset-top)); width: min(320px, calc(100% - 80px)); background: rgba(255, 255, 255, .96); border-radius: var(--r); box-shadow: var(--shadow); max-height: calc(100% - 140px); overflow: auto; }
body:not([data-view="pronostico"]) #layers-panel { display: none; }
.float-panel summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; font-weight: 700; cursor: pointer; list-style: none; }
.float-panel summary svg { width: 20px; height: 20px; color: var(--brand); }
.float-panel details[open] summary { border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 20px; background: #eef3f3; font-size: .86rem; cursor: pointer; user-select: none; }
.chip:has(input:checked) { background: #d7eef0; color: var(--brand); font-weight: 600; }
.chip input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.edito-ctl { padding: 0 12px 6px; }
.edito-ctl input[type=range] { width: 100%; min-height: 36px; accent-color: #8f5a12; }
.legend { padding: 0 12px 10px; font-size: .8rem; }
.legend-block { margin-top: 8px; }
.legend-title { font-weight: 600; margin-bottom: 3px; }
.legend-row { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; }
.legend img { max-width: 100%; height: 16px; }
.sw { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.cov-sir { background: #e5393533; border: 1.5px dashed #c62828; } .cov-afai { background: #7e57c222; border: 1.5px dashed #5e35b1; } .cov-edito { background: #c98d1e22; border: 1.5px dashed #8f5a12; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; background: var(--na); }
.sem-green { --c: var(--green); } .sem-amber { --c: var(--amber); } .sem-red { --c: var(--red); } .sem-na { --c: var(--na); }
.dot[class*="sem-"] { background: var(--c); }
@media (min-width: 1024px) { .float-panel { left: 16px; top: 76px; } }

/* ---------- páginas */
.page { position: absolute; inset: 0; z-index: 18; background: var(--bg); overflow: auto; overscroll-behavior: contain; animation: fadein .22s var(--ease); }
.page-inner { max-width: 720px; margin: 0 auto; padding: 18px 16px calc(var(--disc-h) + 24px); }
.page-inner.center { text-align: center; padding-top: 18vh; }
.page h2 { margin: .2em 0 .5em; }
.big-ico { width: 64px; height: 64px; color: var(--brand); }
.page-float { inset: auto 10px calc(var(--disc-h) + 10px) 10px; background: none; overflow: visible; }
.card { background: var(--card); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1px solid var(--line); margin-bottom: 12px; }
.hero h1 { font-size: 1.25rem; margin: 0 0 4px; }
.hero p { margin: 0 0 10px; }
.home-grid { display: grid; grid-template-columns: 1fr; gap: 6px 16px; }
.home-grid h3 { font-size: .9rem; margin: 10px 0 4px; }
@media (max-width: 1023px) { .page-float .home-grid > div:last-child { display: none; } }
@media (min-width: 1024px) {
  .page:not(.page-float) { right: auto; width: var(--panel-w); box-shadow: var(--shadow); border-right: 1px solid var(--line); }
  .page-inner { padding: 22px 20px 60px; }
  .page-float { inset: 80px auto auto 16px; width: 380px; }
  .home-grid { grid-template-columns: 1fr; }
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.rows { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.rows.compact { margin: 0; }
.grp { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 6px; }
.beach-row, .alert-item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.beach-row:hover { border-color: #b9d3d6; }
.br-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.br-main small, .br-lv small { color: var(--muted); }
.br-lv { text-align: right; font-weight: 600; font-size: .86rem; display: flex; flex-direction: column; }
.alert-item.fired { border-color: #f0b4b4; background: #fff7f7; }
.alert-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.alert-form select { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0 10px; background: #fff; flex: 1 1 160px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 600; }
.btn svg { width: 18px; height: 18px; }
.btn.sec { background: #e6f0f1; color: var(--brand); }
.btn.wide { width: 100%; }
.btn-ghost { border: 1px solid var(--line); background: #fff; border-radius: 10px; min-height: 40px; font-size: .8rem; }
.lang-select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 0 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.note { font-size: .82rem; background: #eef6f7; border-radius: 10px; padding: 10px 12px; }

/* ---------- hoja inferior (móvil) / panel lateral (escritorio) */
.sheet { position: absolute; left: 0; right: 0; top: 0; z-index: 30; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 28px rgba(4, 22, 32, .22); transform: translateY(110%); transition: transform .34s var(--ease); will-change: transform; display: flex; flex-direction: column; }
.sheet-handle { flex: 0 0 auto; height: 28px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-handle i { width: 44px; height: 5px; border-radius: 3px; background: #c9d3d3; }
.sheet-close { position: absolute; top: 6px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 1.1rem; color: var(--muted); border-radius: 50%; }
.sheet-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 0 16px calc(var(--disc-h) + 16px); }
@media (min-width: 768px) and (max-width: 1023px) { .sheet { left: 50%; right: auto; width: 560px; margin-left: -280px; } }
@media (min-width: 1024px) {
  .sheet { left: auto; right: 0; top: 0; bottom: var(--disc-h); width: var(--sheet-w); border-radius: 0; transform: translateX(105%); box-shadow: -6px 0 28px rgba(4, 22, 32, .16); }
  .sheet-handle { display: none; }
  .sheet-body { padding: 14px 18px 20px; }
  body.sheet-open :is(.maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-right) { right: var(--sheet-w); }
}

/* ---------- tarjeta de estado */
.status-card { --c: var(--na); border-radius: 14px; padding: 12px 14px; margin: 4px 0 12px; background: color-mix(in srgb, var(--c) 9%, #fff); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); }
.status-card.loading { color: var(--muted); }
.st-head { display: flex; gap: 12px; align-items: center; padding-right: 36px; }
.st-head h3 { margin: 0; font-size: 1.08rem; }
.st-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 800; font-size: 1.2rem; }
.status-card p { margin: 8px 0 0; }
.st-out, .st-clear { --c: var(--green); } .st-ocean { --c: #2f6f8f; } .st-err { --c: var(--na); }
.prov { color: #6b4a00; }

/* ---------- ficha */
.ficha h2 { margin: 2px 0; font-size: 1.25rem; }
.f-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding-right: 40px; margin-bottom: 6px; }
.sem-pill { --c: var(--na); background: var(--c); color: #fff; font-weight: 700; border-radius: 20px; padding: 4px 12px; white-space: nowrap; }
.sem-pill.sem-amber { color: #3b2a00; }
.section { border-top: 1px solid var(--line); padding: 10px 0; }
.section h3 { font-size: .98rem; margin: 2px 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag-real, .tag-proto { font-size: .62rem; font-weight: 700; letter-spacing: .04em; border-radius: 5px; padding: 1px 6px; }
.tag-real { background: #dff3e4; color: #1b5e20; } .tag-proto { background: #fff3c4; color: #6b4a00; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { --c: transparent; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 10px; background: #f3f6f6; border-left: 4px solid var(--c); min-width: 0; }
.kpi b { font-size: .95rem; } .k-lbl { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.degraded-banner { background: #fff1e0; color: #7a3d00; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-weight: 600; font-size: .86rem; }
.degraded-banner span { font-weight: 400; }
.chip-s { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 9px; margin: 2px 0; }
.chip-s.ok { background: #dff3e4; } .chip-s.part { background: #fff3c4; } .chip-s.miss { background: #fde0e0; }
.warns { padding-left: 18px; margin: 6px 0; } .warns li { margin: 3px 0; }
.proto-note { font-size: .8rem; background: #fff8e1; border-radius: 10px; padding: 8px 10px; }
.level { display: inline-block; border-radius: 8px; padding: 2px 10px; font-weight: 700; }
.lv-0 { background: #7fd3e6; } .lv-1 { background: #f2d600; } .lv-2 { background: #ff9800; } .lv-3 { background: #e53935; color: #fff; } .lv-na { background: #cfd8dc; }
.hist { display: flex; gap: 3px; flex-wrap: wrap; margin: 8px 0 4px; }
.hist div { display: flex; flex-direction: column; align-items: center; font-size: .62rem; color: var(--muted); width: 20px; }
.hist i { width: 18px; height: 18px; border-radius: 4px; }
.chart svg { width: 100%; height: 110px; display: block; }
.sample-banner { background: #fde0e0; color: #8b1a1a; font-weight: 700; border-radius: 8px; padding: 6px 10px; }

/* ---------- avisos, diálogo, toast */
.disclaimer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 35; min-height: var(--disc-h); padding: 4px 10px; font-size: .68rem; line-height: 1.3; background: rgba(255, 248, 225, .97); color: #4a3500; border-top: 1px solid #f0dc9a; display: flex; align-items: center; gap: 8px; }
.disclaimer > span { flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link { border: 0; background: none; color: var(--brand); font-weight: 700; text-decoration: underline; padding: 6px 2px; min-height: 32px; font-size: .72rem; white-space: nowrap; }
dialog { border: 0; border-radius: 16px; max-width: min(680px, 94vw); max-height: 88vh; padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(4, 18, 28, .5); }
.dlg { padding: 18px 20px; } .dlg .warn { background: #fff8e1; border-radius: 10px; padding: 4px 12px; font-size: .86rem; }
.sources { font-size: .86rem; padding-left: 18px; } .sources li { margin: 6px 0; }
.toast { position: absolute; left: 50%; bottom: calc(var(--disc-h) + 18px); transform: translateX(-50%); z-index: 50; background: #12303a; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: .9rem; }
.fatal { background: #c62828; color: #fff; padding: 8px; position: relative; z-index: 99; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* semáforo: especificidad doble para que gane sobre el --c por defecto de cada componente */
.sem-green.sem-green { --c: var(--green); } .sem-amber.sem-amber { --c: var(--amber); } .sem-red.sem-red { --c: var(--red); } .sem-na.sem-na { --c: var(--na); }
.dot.mon { background: #fff; border: 3px solid #5c7cfa; }
.sem-pill.mon { --c: #5c7cfa; }
.mon-box { background: #eef1ff; border-radius: 10px; padding: 10px 12px; }
.mon-box p { margin: 4px 0 0; }
.missing { background: #f6f7f8; border-radius: 10px; padding: 6px 12px; margin: 8px 0; }
.missing ul { margin: 4px 0; padding-left: 18px; } .missing p { margin: 4px 0; }
.region-filter { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 0 10px; margin: 4px 0 6px; }
.zone-atl { background: #ffd54f44; border: 1.5px solid #e0b000; } .zone-hor { background: #69f0ae44; border: 1.5px solid #1fa060; }
/* ---------- perfil */
.prof-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 16px; }
.prof-head h2 { margin: 0; word-break: break-word; }
.avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #e3f1f2; color: var(--brand); flex: 0 0 auto; }
.avatar.big { width: 96px; height: 96px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #bfe0e3; }
.avatar svg { width: 55%; height: 55%; } .avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-ico { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; }
.nav-ico svg { width: 24px; height: 24px; } .nav-ico img { width: 26px; height: 26px; object-fit: cover; border-radius: 50%; }
.nav > button[aria-current="page"] .nav-ico.has-photo { box-shadow: 0 0 0 2px var(--brand); }
.prof-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-btn { cursor: pointer; }
.text-in { flex: 1 1 180px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0 12px; font-size: 1rem; }
.err { color: var(--red); } .ok { color: var(--green); }
.lbl h3 { margin: 0 0 8px; font-size: 1rem; }
.card.flat h3 { margin: 0 0 8px; font-size: 1rem; }
.crop canvas { width: min(280px, 72vw); aspect-ratio: 1; display: block; margin: 8px auto; border-radius: 12px; touch-action: none; cursor: grab; background: #222; }
.crop input[type=range] { width: 100%; accent-color: var(--brand); }
@media (max-width: 1023px) { body:is([data-view="playas"], [data-view="alertas"], [data-view="perfil"], [data-view="clima"]) .map-top { display: none; } }
#splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #06121f; color: #fff; transition: opacity .5s; }
#splash img { width: 84px; height: 84px; border-radius: 20px; } #splash b { font-size: 1.5rem; letter-spacing: .02em; } #splash span { opacity: .7; font-size: .9rem; }
body.ready #splash { opacity: 0; pointer-events: none; }
.method h4 { margin: 10px 0 2px; font-size: .9rem; } .method p { margin: 0 0 6px; }
.nav .brand b { text-align: center; line-height: 1.1; font-size: .82rem; }
#splash img { width: 128px; height: 128px; } /* logo derivado con el blanco exterior quitado (icons/logo_transparente_256.png) */
.brand-fab { padding: 0; background: #fff; overflow: hidden; } .brand-fab img { width: 40px; height: 40px; border-radius: 50%; }
.ramp { display: block; width: 100%; height: 10px; border-radius: 4px; } .ramp-lbl { justify-content: space-between; font-size: .72rem; color: var(--muted); }
.hist .gap i, .hist-key i.gap { background: repeating-linear-gradient(45deg, #fff 0 3px, #b0bec5 3px 6px); border: 1px dashed #90a4ae; }
.hist-key i.gap { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin: 0 4px 0 6px; }
.hist .gap { color: #78909c; } .hist .nd { opacity: .55; }
.edito-line { margin: .4rem 0; } .units-warn { margin: .2rem 0 0; color: var(--muted); font-size: .78rem; }
/* dirección experimental */
.dir-ctl { margin: .5rem 0; padding: .55rem .6rem; border: 1px dashed #c48b00; border-radius: 10px; background: #fffaf0; }
.dir-ctl .seg { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: .35rem 0; }
.dir-ctl .seg button { min-width: 44px; min-height: 36px; border: 1px solid #cfd8dc; border-radius: 8px; background: #fff; font: inherit; cursor: pointer; }
.dir-ctl .seg button[aria-pressed="true"] { background: var(--brand, #0b5563); color: #fff; border-color: transparent; }
.dir-warn { font-size: .8rem; color: #6d4c00; background: #fff3cd; padding: .35rem .45rem; border-radius: 6px; margin: .3rem 0; }
.dir-msg { background: #eceff1; padding: .35rem .5rem; border-radius: 6px; }
.dir-key-arrow { display: inline-block; transform: rotate(-90deg); color: #fff; text-shadow: 0 0 2px #0a283c, 0 0 2px #0a283c; margin-right: 6px; }
.dir-key-track { display: inline-block; width: 22px; border-top: 3px dashed #ff7de9; margin-right: 6px; vertical-align: middle; }
.chip-exp .tag-proto { font-size: .65rem; }
@media (max-width: 767px) { .dir-ctl .seg button { min-height: 44px; } }
.hist-long { margin: .4rem 0 0; } .hist-long svg { width: 100%; height: 34px; display: block; }
.sw.hatch { background: repeating-linear-gradient(45deg, #5e6b74 0 2px, #cfd8dc 2px 5px); }
.chip-s.nocov { background: #eceff1; color: #37474f; border: 1px dashed #90a4ae; }
.missing li.no-cov { list-style: '🛰 '; }
.dir-banner { position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); bottom: 52px; max-width: min(92vw, 560px);
  background: rgba(255, 243, 205, .96); color: #5d4300; border: 1px solid #e0b84a; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .8rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
@media (min-width: 1024px) { .dir-banner { bottom: 60px; } }
@media (max-width: 767px) { .dir-banner { left: 12px; right: 56px; transform: none; max-width: none; border-radius: 14px; font-size: .74rem; text-align: left; } }
/* v0.4.5 riesgo en la zona + comparar */
.scope-msg { margin: .35rem 0; padding: .35rem .5rem; border-left: 3px solid #4f7f8a; background: #eef5f7; border-radius: 4px; color: #23414a; }
.scope-msg.muted { background: transparent; border-left-color: #b0bec5; color: var(--muted); }
.st-level { margin: .2rem 0; }
.compare-panel { margin: .6rem 0; padding: .6rem; border: 1px solid #d5e1e5; border-radius: 10px; background: #fff; }
.compare-panel h3 { margin: 0 0 .3rem; font-size: 1rem; }
.cmp-wrap { overflow-x: auto; } .cmp { width: 100%; border-collapse: collapse; font-size: .85rem; }
.cmp th, .cmp td { text-align: left; padding: .4rem .35rem; border-bottom: 1px solid #e6eef0; vertical-align: top; }
.cmp th small, .cmp td small { display: block; color: var(--muted); font-weight: 400; font-size: .72rem; }
li.has-cmp { display: flex; align-items: center; gap: 4px; } li.has-cmp .beach-row { flex: 1; }
.cmp-pick { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.cmp-pick input { width: 20px; height: 20px; }
#cmp-toggle { min-height: 40px; white-space: nowrap; }

/* ---------- Clima mundial (MET Norway; sin sargazo) */
#page-clima.wx-float { inset: 10px 10px auto 10px; background: none; overflow: visible; pointer-events: none; z-index: 19; }
.wx-card { pointer-events: auto; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 14px; }
.wx-card h2 { font-size: 1.05rem; margin: 0 0 2px; }
.wx-card p { margin: 3px 0; }
@media (max-width: 1023px) { .wx-card [data-i18n="weather.lead"] { display: none; } .wx-card { padding: 8px 12px; } .wx-card .wx-attr { font-size: .72rem; } }
@media (min-width: 1024px) { #page-clima.wx-float { inset: 16px auto auto 16px; width: 340px; } }
.wx-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--na); vertical-align: middle; }
.wx-dot.ok { background: var(--green); } .wx-dot.loading { background: var(--amber); animation: wxpulse 1s infinite alternate; }
.wx-dot.offline, .wx-dot.upstream_error, .wx-dot.not_configured { background: var(--red); }
@keyframes wxpulse { to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .wx-dot.loading { animation: none; } }
.wx-stub-note { background: #fff3cd; color: #6b4e00; border-radius: 8px; padding: 4px 8px; }
.wx-attr { color: var(--muted); } .wx-attr a { color: var(--brand); }
.wx-panel { position: absolute; z-index: 32; left: 0; right: 0; bottom: var(--disc-h); max-height: 56%; overflow: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 28px rgba(4,22,32,.22); padding: 14px 16px 18px; animation: wxup .28s var(--ease); }
@keyframes wxup { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 768px) and (max-width: 1023px) { .wx-panel { left: 50%; right: auto; width: 560px; margin-left: -280px; } }
@media (min-width: 1024px) { .wx-panel { left: auto; right: 0; top: 0; bottom: var(--disc-h); width: 400px; max-height: none; border-radius: 0; box-shadow: -6px 0 28px rgba(4,22,32,.16); animation-name: wxleft; } }
@keyframes wxleft { from { transform: translateX(40px); opacity: 0; } }
.wx-close { position: sticky; float: right; top: 0; border: 0; background: #eef2f1; width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; }
.wx-head h2 { margin: 0; font-size: 1.3rem; } .wx-head p { margin: 2px 0 8px; }
.wx-now { display: flex; gap: 14px; align-items: center; }
.wx-now p { margin: 3px 0; }
.wx-big { display: flex; align-items: center; gap: 4px; } .wx-big .i { font-size: 2.6rem; } .wx-big .t { font-size: 2.8rem; font-weight: 700; letter-spacing: -1px; }
.wx-sym { font-weight: 600; }
.wx-arrow { display: inline-block; font-weight: 700; color: var(--brand); }
.wx-units { display: flex; gap: 6px; margin: 10px 0 2px; }
.wx-units .chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.wx-units .chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.wx-panel h3 { font-size: .9rem; margin: 12px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wx-hours { display: flex; gap: 6px; overflow-x: auto; list-style: none; padding: 0 0 6px; margin: 0; scroll-snap-type: x proximity; }
.wx-hours li { flex: 0 0 auto; min-width: 58px; text-align: center; background: #f3f6f6; border-radius: 10px; padding: 6px 4px; display: flex; flex-direction: column; gap: 2px; scroll-snap-align: start; }
.wx-hours .h { font-size: .75rem; color: var(--muted); } .wx-hours .i { font-size: 1.3rem; }
.wx-days { list-style: none; padding: 0; margin: 0; }
.wx-days li { display: grid; grid-template-columns: 5.2em 1.8em 1fr auto; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.wx-days .i { font-size: 1.2rem; } .wx-days .mm { white-space: nowrap; }
.wx-error { background: #fdecea; border-radius: 12px; padding: 10px 12px; margin: 8px 0; }

@media (min-width: 1024px) { body.wx-on[data-view="clima"] .map-top { display: none; } }

/* ---------- v0.4.6 tarjeta de resumen de costa por país */
.country-card { margin-top: 10px; }
.country-card .cc-badges { margin: 4px 0; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; padding: 1px 6px; }
.badge.exp { background: #fff3cd; color: #6b4e00; } .badge.nv { background: #eceff1; color: #455a64; }
.cc-headline { font-size: 1.05rem; font-weight: 600; margin: 6px 0 2px; } .cc-headline.green { color: var(--green); }
.cc-pct { font-size: 1.7rem; font-weight: 800; letter-spacing: -.5px; margin-right: 2px; }
.cc-note { margin: 0 0 8px; color: var(--muted); }
.cbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: #eceff1; margin: 6px 0; }
.cbar.big { height: 16px; } .cbar span { display: block; min-width: 2px; transition: flex .4s var(--ease); }
.clegend { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; padding: 0; margin: 2px 0 8px; }
.clegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.cc-sub { margin: 10px 0 4px; font-size: .85rem; color: var(--muted); }
.cc-coasts { list-style: none; padding: 0; margin: 0; } .cc-coasts li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.cc-row { display: flex; justify-content: space-between; gap: 8px; }
.country-card .warn { color: #8a5a00; }
.wx-attr-short { display: none; }
@media (max-width: 1023px) { .wx-card .wx-attr-long { display: none; } .wx-card .wx-attr-short { display: block; } }

.near-tap { margin: 0 0 8px; padding: 6px 10px; background: #e8f4f6; color: var(--brand); border-radius: 10px; }
.brand .brand-by { display: block; max-width: 100%; text-align: center; font-size: .6rem; line-height: 1.2; opacity: .8; white-space: normal; overflow: visible; }
.brand .brand-by sup { font-size: .75em; vertical-align: super; line-height: 0; }
/* móvil/tablet: la marca 'by Oceanus International®' (la .brand del rail está oculta) en pastilla bajo el logo redondo */
.map-top .brand-by-m { position: absolute; left: 0; top: calc(100% + 5px); font-size: 10.5px; line-height: 16px; font-weight: 600; color: #0b3b46;
  background: rgba(255, 255, 255, .94); border-radius: 999px; padding: 0 8px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); white-space: nowrap; pointer-events: none; letter-spacing: .01em; }
@media (max-width: 1023px) { .float-panel { top: calc(84px + env(safe-area-inset-top)); } }
