/* Arena · «Mediterráneo» visual system. Layers: fonts → tokens → base → components → views.
   Strict CSP: no inline styles anywhere; everything the views need is a class here. */

/* ── 1. Fonts (self-hosted WOFF2, latin subset, OFL: fonts/OFL.txt) ─────────────────────────────── */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/bricolage-grotesque-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("fonts/bricolage-grotesque-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-sans-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/instrument-sans-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/instrument-sans-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── 2. Tokens ─────────────────────────────────────────────────────────────────────────────────────
   Light by default (readable in the sun). Text pairs are >= 4.5:1, level indicators >= 3:1 on --bg.
   --ink-2 is #56737B instead of the palette's #5C7A82: the latter is 4.1:1 on --bg-3 (text must be >= 4.5).
   --sea / --terra are fills; text in those hues uses --sea-ink / --terra-ink. White on --terra is 3.1:1, so
   terracotta buttons use large text (19 px bold). */
:root {
  --ink: #0D3B47; --ink-2: #56737B;
  --sea: #2BB3A3; --sea-strong: #0E8C82; --sea-ink: #0A7A71;
  --sand: #F1E6CF; --terra: #E0734A; --terra-ink: #9A4220; --terra-bg: #FCE6DA; --on-terra: #FFFFFF; --on-sea-strong: #FFFFFF;
  --bg: #FFFFFF; --bg-2: #F3FAFA; --bg-3: #E6F6F6; --warm-bg: #FFF4EC;
  --raised: #FFFFFF; --line: #D9ECEE; --shadow: 0 1px 3px rgb(13 59 71 / .12);
  /* Occupancy levels (meaning unchanged: calm → full); darker tones for >= 3:1 on white. */
  --lv-baja: #1E9E57; --lv-media: #B57F00; --lv-alta: #D86A00; --lv-llena: #E0362A; --lv-none: #6F8389;
  /* Safety colours (anchoring banners, danger zones): unchanged meaning; black text on --ok/--warn (>= 9:1). */
  --meadow: #2f9e5b; --danger: #d70015; --ok: #34c759; --warn: #ff9500;
  /* Fallback behind a cove name when there is no photo (fixed in both themes; white text >= 4.5:1 where it sits). */
  --hero-fill: radial-gradient(circle at 88% 12%, rgb(43 179 163 / .75), transparent 55%), linear-gradient(160deg, #0A7A71, #0D3B47 78%);
  --radius-l: 24px; --radius-m: 18px; --radius-s: 12px; --tabs-h: 64px;
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Signals guide: illustration tiles stay light in both themes; lights on a night panel. */
  --sg-sky: #dcebf7; --sg-sea: #2f78b7; --night: #0b1220; --night-line: #1f2a3a; --night-muted: #aab3c0;
  font: 16px/1.4 var(--font-text);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #EAF6F6; --ink-2: #9DB8BE; --sea-strong: #3CC9B8; --sea-ink: #5ED6C6;
    --sand: #3A3326; --terra: #F08A62; --terra-ink: #F4A07F; --terra-bg: #3A2219; --on-terra: #0B1E24; --on-sea-strong: #0B1E24;
    --bg: #0B1E24; --bg-2: #10292F; --bg-3: #173840; --warm-bg: #2E2119;
    --raised: #2B5761; --line: #24474F; --shadow: 0 1px 3px rgb(0 0 0 / .4);
    --lv-baja: #3DBE74; --lv-media: #E5B000; --lv-alta: #F08A3C; --lv-llena: #FF5A4E; --lv-none: #8A9BA0;
    --sg-sky: #c4d7e7; --sg-sea: #2a679d;
  }
}
:root[data-theme="dark"] {
  --ink: #EAF6F6; --ink-2: #9DB8BE; --sea-strong: #3CC9B8; --sea-ink: #5ED6C6;
  --sand: #3A3326; --terra: #F08A62; --terra-ink: #F4A07F; --terra-bg: #3A2219; --on-terra: #0B1E24; --on-sea-strong: #0B1E24;
  --bg: #0B1E24; --bg-2: #10292F; --bg-3: #173840; --warm-bg: #2E2119;
  --raised: #2B5761; --line: #24474F; --shadow: 0 1px 3px rgb(0 0 0 / .4);
  --lv-baja: #3DBE74; --lv-media: #E5B000; --lv-alta: #F08A3C; --lv-llena: #FF5A4E; --lv-none: #8A9BA0;
  --sg-sky: #c4d7e7; --sg-sea: #2a679d;
}

/* ── 3. Base ───────────────────────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { padding: env(safe-area-inset-top) 0 0; overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sea-ink); }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); }
:focus-visible { outline: 2px solid var(--sea-strong); outline-offset: 2px; }
[hidden] { display: none !important; }
.icon { display: block; flex: none; }

#app { height: calc(100dvh - var(--tabs-h) - env(safe-area-inset-bottom) - env(safe-area-inset-top));
       display: flex; flex-direction: column; overflow: hidden; }
body.no-tabs #app { height: calc(100dvh - env(safe-area-inset-top)); }
.view { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 10px 16px; min-height: 0; overflow-y: auto; }
.view.no-scroll { overflow: hidden; }
.sub { color: var(--ink-2); font-size: 14px; }
.status-line { display: flex; gap: 6px; align-items: center; color: var(--ink-2); font-size: 13px; min-height: 18px; }
.footer-note { color: var(--ink-2); font-size: 12px; text-align: center; padding: 2px 8px; }
.big { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }

/* ── 4. Components ─────────────────────────────────────────────────────────────────────────────── */
.section-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 8px 0 0; color: var(--ink); }

/* Buttons: default ink; .primary terracotta (main action, large text); .secondary soft; .ghost text only. */
.btn { border: 0; border-radius: var(--radius-s); min-height: 52px; padding: 0 18px; width: 100%;
       background: var(--ink); color: var(--bg); font-weight: 700; font-size: 17px;
       display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--terra); color: var(--on-terra); font-size: 19px; }
.btn.secondary { background: var(--bg-3); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--sea-ink); }
.btn.compact { min-height: 44px; font-size: 15px; font-weight: 600; }
.btn.toggle[aria-pressed="true"] { background: var(--warn); color: #000; }
.close { border: 0; background: var(--bg-3); color: var(--ink); border-radius: 50%; width: 44px; height: 44px; font-size: 16px;
         flex: none; display: grid; place-items: center; }

/* Segmented control (departure, offsets, boat choices). */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; background: var(--bg-3);
             border-radius: var(--radius-s); padding: 3px; }
.segmented button { border: 0; background: transparent; color: var(--ink); border-radius: 9px; min-height: 44px;
                    font-size: 15px; font-weight: 600; padding: 0 4px; line-height: 1.15; }
.segmented button[aria-pressed="true"] { background: var(--raised); box-shadow: var(--shadow); font-weight: 700; }
.segmented.grid-2 { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented button:disabled { color: var(--ink-2); opacity: .45; cursor: default; }

/* Chips. A level class (.lv-*) on a chip adds a coloured dot; text stays ink for contrast. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 11px; border-radius: 999px;
               background: var(--bg-3); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.2; }
.chip .icon { width: 16px; height: 16px; }
.chip.ok { background: var(--sea); color: #0B1E24; }
.chip.warn { background: var(--warm-bg); color: var(--terra-ink); }
.chip.food { background: var(--terra-bg); color: var(--terra-ink); }
.chip.on-photo { background: rgb(255 255 255 / .22); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lv-baja { --lv: var(--lv-baja); } .lv-media { --lv: var(--lv-media); }
.lv-alta { --lv: var(--lv-alta); } .lv-llena { --lv: var(--lv-llena); } .lv-none { --lv: var(--lv-none); }
.chip:is(.lv-baja, .lv-media, .lv-alta, .lv-llena, .lv-none)::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lv, var(--lv-none)); flex: none; }

/* Photo card: photo bled to the edges (an <img> child, no inline background) and a bottom gradient for the text. */
.photo-card { position: relative; display: flex; align-items: flex-end; min-height: 200px; border-radius: var(--radius-l);
              overflow: hidden; background: var(--sand); color: #fff; text-align: left; border: 0; padding: 0; width: 100%; }
.photo-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-card .overlay { position: relative; width: 100%; padding: 36px 16px 14px;
                       background: linear-gradient(transparent, rgb(5 30 38 / .88)); }
.photo-card .overlay h2, .photo-card .overlay h3 { color: #fff; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.photo-card .overlay .chips { margin-top: 8px; }
.photo-card.no-photo { background: var(--hero-fill); }

/* List row: 48 px thumbnail + texts (other good options, places to eat). */
.list-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 4px 12px; align-items: center; width: 100%; min-height: 64px;
            padding: 8px 12px 8px 8px; border: 0; border-radius: var(--radius-m); background: var(--bg-2); color: var(--ink); text-align: left; }
.list-row .thumb { grid-row: span 2; width: 48px; height: 48px; border-radius: var(--radius-s); background: var(--bg-3); object-fit: cover;
                   display: grid; place-items: center; color: var(--sea-ink); }
.list-row .title { font-weight: 700; font-size: 16px; }
.list-row .meta { color: var(--ink-2); font-size: 14px; }
.list-row .thumb.no-photo { background: var(--hero-fill); }
.list-row .thumb.no-photo::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--lv, var(--lv-none));
                                   box-shadow: 0 0 0 2px #fff; }
.list-row .eta { grid-row: 1 / span 2; grid-column: 3; text-align: right; font-weight: 700; font-size: 15px;
                 font-variant-numeric: tabular-nums; }
.list-row .eta small { display: block; color: var(--ink-2); font-weight: 400; font-size: 13px; }

/* Surfaces. */
.sheet { background: var(--bg-2); border-radius: var(--radius-l); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.notice { background: var(--warm-bg); color: var(--terra-ink); border-radius: var(--radius-m); padding: 12px 14px; font-size: 14px; font-weight: 600; }
.notice.danger { background: var(--danger); color: #fff; }
.notice.compact { padding: 8px 12px; font-size: 13px; flex: none; }
details { background: var(--bg-2); border-radius: var(--radius-m); padding: 0 16px; }
details > summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "›"; margin-left: auto; color: var(--ink-2); font-size: 20px; transition: transform .2s; }
details[open] > summary::after { transform: rotate(90deg); }
details > div { padding: 0 0 12px; color: var(--ink-2); font-size: 15px; }

/* Sunlight legibility: black on green/amber/grey (>= 9:1), white only on the dark red (5.4:1). */
.banner { border-radius: var(--radius-m); padding: 16px; font-family: var(--font-display); font-size: 21px; font-weight: 800;
          color: #000; text-align: center; }
.banner.on { background: var(--danger); color: #fff; } .banner.near { background: var(--warn); }
.banner.clear { background: var(--ok); } .banner.low, .banner.wait { background: #aeaeb2; }

/* Tab bar: white, icon + label, active in turquoise with a soft pill behind the icon. */
.tabs { position: fixed; inset: auto 0 0 0; z-index: 1100; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr);
        background: var(--bg); border-top: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center;
               gap: 3px; min-height: 44px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tab-icon { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background-color .15s; }
.tabs button[aria-current="page"] { color: var(--sea-ink); font-weight: 700; }
.tabs button[aria-current="page"] .tab-icon { background: var(--bg-3); }

/* Screen header (ui.js viewHeader): [back] brand · language menu, then the title. */
.view-header { display: flex; flex-direction: column; gap: 6px; flex: none; }
.view-header-bar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.view-header h1 { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
.lang-menu { position: relative; margin-left: auto; flex: none; }
.lang-btn { border: 0; border-radius: 999px; min-height: 44px; min-width: 44px; padding: 0 12px; background: var(--bg-3);
            color: var(--ink); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.lang-btn[aria-expanded="true"] { background: var(--raised); box-shadow: var(--shadow); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1200; min-width: 168px; display: flex; flex-direction: column;
             gap: 2px; padding: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-m);
             box-shadow: 0 8px 24px rgb(13 59 71 / .18); }
.lang-list button { border: 0; background: transparent; color: var(--ink); text-align: left; min-height: 44px; padding: 0 12px;
                    border-radius: var(--radius-s); font-size: 16px; font-weight: 600; }
.lang-list button[aria-current="true"] { background: var(--bg-3); color: var(--sea-ink); font-weight: 700; }

/* Brand row (in every screen header). */
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand-icon { width: 28px; height: 28px; border-radius: 8px; display: block; }
.brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.brand.small .brand-icon { width: 24px; height: 24px; border-radius: 7px; }
.brand.small .brand-name { font-size: 17px; }

/* Maps (Leaflet) and markers built with el() inside empty divIcons. */
.mini-map, .map-full, .map-route, .nav-map { border-radius: var(--radius-m); overflow: hidden; background: var(--bg-3); }
.mini-map { flex: 1 0 140px; min-height: 140px; }
/* Home map with its full-screen button; .expanded covers the whole screen (tab bar included). */
.map-wrap { position: relative; display: flex; flex: 1 0 140px; min-height: 140px; }
.map-wrap > .mini-map { flex: 1; }
.map-wrap.expanded { position: fixed; inset: 0; z-index: 1300; background: var(--bg); }
.map-wrap.expanded > .mini-map { border-radius: 0; }
.map-expand { position: absolute; top: 8px; right: 8px; z-index: 1000; width: 44px; height: 44px; border: 0; border-radius: 50%;
              background: var(--raised); color: var(--ink); box-shadow: var(--shadow); display: grid; place-items: center; }
.map-wrap.expanded .map-expand { top: calc(10px + env(safe-area-inset-top)); right: 12px; }
body.map-open { overflow: hidden; }
/* «Buscar y filtrar» on Home: search box and one scrolling row of chips. */
.finder { display: flex; flex-direction: column; gap: 8px; flex: none; }
.filter-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip.filter { border: 0; flex: none; min-height: 36px; padding: 0 14px; font-size: 14px; }
.chip.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chip.filter:disabled { opacity: .45; }
.filter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filter-head .btn { width: auto; }
.map-full { flex: 1; min-height: 240px; }
.map-route { flex: none; height: 40vh; min-height: 240px; }
.leaflet-container { font: inherit; background: var(--bg-3); }
.me-boat { width: 30px; height: 30px; border-radius: 50%; background: #14213d; border: 3px solid #fff; box-sizing: border-box;
           box-shadow: 0 0 0 3px rgb(20 33 61 / .35), 0 1px 4px rgb(0 0 0 / .4); display: grid; place-items: center; }
/* Cove picker (Fondeo tab without a cove near the boat): search box and name/distance rows. */
.cala-search { min-height: 44px; font: inherit; font-size: 17px; color: var(--ink); background: var(--bg-3); border: 0;
               border-radius: var(--radius-s); padding: 0 12px; }
.cala-picks { display: flex; flex-direction: column; gap: 6px; }
.cala-pick { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px;
             border: 0; border-radius: var(--radius-m); background: var(--bg-2); color: var(--ink); text-align: left; }
.cala-pick .title { font-weight: 700; font-size: 16px; }
.cala-pick .meta { color: var(--ink-2); font-size: 14px; }
.pin { background: none; border: 0; }
.pin-label { position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%); white-space: nowrap;
             background: var(--raised); color: var(--ink); border-radius: 8px; padding: 2px 7px; font-size: 12px; font-weight: 600;
             box-shadow: 0 1px 3px rgb(0 0 0 / .25); pointer-events: none; }
.label-left .pin-label { left: auto; right: calc(100% + 4px); }
.dest-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--sea-strong); color: var(--on-sea-strong); border: 2px solid #fff;
            box-shadow: 0 1px 4px rgb(0 0 0 / .35); display: grid; place-items: center; font-size: 15px; line-height: 1; }

/* ── 5. Views ──────────────────────────────────────────────────────────────────────────────────── */
/* Home: featured cove (large photo card), other good options, map. Scrolls when it does not fit: only the map shrinks. */
.home .view-header h1 { font-size: 30px; }
.home-cards { display: flex; flex-direction: column; gap: 8px; flex: none; }
.home-cards .section-title { margin: 6px 0 0; }
.photo-card.hero { min-height: 190px; flex: none; }
.photo-card.hero:not(.no-photo) { min-height: 236px; }
.hero-name { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.home .status-line { display: block; flex: none; }

/* Cove card: the cove photo bled to the edges (else the palette colour) under a dark top and bottom fade for the
   header and the name, the summary as a lead paragraph, «Comer y beber», and a fixed action bar above the tab bar. */
.view.cala { padding-bottom: calc(52px + 24px); }
.cala-hero { position: relative; isolation: isolate; overflow: hidden; margin: -10px -16px 0; padding: 10px 16px 6px; min-height: 176px;
             display: flex; flex: none; background: var(--hero-fill); border-radius: 0 0 var(--radius-l) var(--radius-l); color: #fff; }
.cala-hero.has-photo { min-height: max(300px, 44dvh); background: var(--sand); }
.hero-photo { position: absolute; inset: 0; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cala-hero.has-photo::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgb(5 30 38 / .55), rgb(5 30 38 / 0) 28%, rgb(5 30 38 / 0) 48%, rgb(5 30 38 / .86)); }
.cala-hero .view-header { position: relative; z-index: 1; flex: 1; justify-content: flex-start; }
.cala-hero .view-header h1 { margin-top: auto; color: #fff; font-size: 32px; text-wrap: balance; }
.cala-hero.has-photo .view-header h1 { text-shadow: 0 1px 12px rgb(0 0 0 / .35); }
.cala-hero .brand-name { color: #fff; }
.cala-hero .close, .cala-hero .lang-btn { background: rgb(255 255 255 / .9); color: #0D3B47; }
.cala-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 10px; min-height: 12px; }
.cala-place { font-size: 15px; font-weight: 600; color: rgb(255 255 255 / .94); }
.cala-credit { margin-left: auto; margin-right: -4px; }
.cala-summary { margin: 6px 2px 2px; font-size: 17px; line-height: 1.55; color: var(--ink); text-wrap: pretty; flex: none; }

/* Photo credit: a quiet button over the photo; it opens a bottom sheet (<dialog>) with the source and the licence. */
.photo-credit { border: 0; background: transparent; color: rgb(255 255 255 / .9); font-size: 12px; font-weight: 600; min-height: 44px;
                padding: 0 4px; text-shadow: 0 1px 3px rgb(0 0 0 / .7); text-decoration: underline; text-underline-offset: 3px;
                text-decoration-color: rgb(255 255 255 / .45); }
.credit-sheet { width: 100%; max-width: min(560px, 100%); margin: auto auto 0; border: 0; padding: 20px 20px calc(16px + env(safe-area-inset-bottom));
                border-radius: var(--radius-l) var(--radius-l) 0 0; background: var(--bg); color: var(--ink); text-shadow: none; }
.credit-sheet[open] { display: flex; flex-direction: column; gap: 6px; }
.credit-sheet::backdrop { background: rgb(5 30 38 / .55); }
.credit-sheet h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; }
.credit-sheet p { margin: 0; font-size: 15px; }
.credit-sheet a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.credit-sheet .credit-author { color: var(--ink-2); }
.credit-sheet .btn { margin-top: 6px; }

/* «Comer y beber»: one soft card per venue; status first in colour, contact as pill links, review date small. */
.venues-box { flex: none; }
.venues { display: flex; flex-direction: column; gap: 10px; }
.venues .section-title { margin: 10px 0 2px; }
.venue { background: var(--bg-2); border-radius: var(--radius-m); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.venue p { margin: 0; }
.venue-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.venue-name { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
.venue-price { flex: none; color: var(--ink-2); font-weight: 700; letter-spacing: .06em; }
.venue .venue-kind { color: var(--ink-2); font-size: 14px; margin-top: -4px; }
.venue-status { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.venue-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--lv-none); flex: none; }
.venue-status.st-open { color: var(--sea-ink); } .venue-status.st-open::before { background: var(--sea-strong); }
.venue-status.st-closes_soon { color: var(--terra-ink); } .venue-status.st-closes_soon::before { background: var(--terra); }
.venue-status.st-unknown { font-weight: 600; } .venue-status.st-unknown::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--lv-none); }
.venue .chips { margin-top: 2px; }
.venue-notes { font-size: 15px; }
.venue-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.venue-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--raised);
              border: 1px solid var(--line); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; min-width: 0; }
.venue-link .icon { color: var(--sea-ink); }
.venue-link span { overflow-wrap: anywhere; }
.venue-reviewed { color: var(--ink-2); font-size: 13px; }
.venue-stale { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-s); background: var(--warm-bg);
               color: var(--terra-ink); font-size: 13px; font-weight: 600; }
.action-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); z-index: 1050;
              display: flex; gap: 8px; padding: 8px 16px; background: var(--bg); border-top: 1px solid var(--line); }
.action-bar .btn { white-space: nowrap; padding: 0 14px; }
.action-bar .btn.secondary { flex: 1 1 30%; }
.action-bar .btn.primary { flex: 2 1 60%; }

.sim-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--warm-bg); color: var(--terra-ink);
           border-radius: var(--radius-s); padding: 4px 4px 4px 14px; font-size: 14px; font-weight: 600; }
.sim-exit { border: 1.5px solid var(--terra-ink); border-radius: 9px; min-height: 44px; padding: 0 12px; background: var(--terra-bg); color: var(--terra-ink); font-weight: 700; }

/* "Mi barco": settings-style form and the checklist. */
.form { background: var(--bg-2); border-radius: var(--radius-m); }
.form label { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px;
              border-bottom: 1px solid var(--line); gap: 12px; }
/* Every value control has the same width so they line up; choices (type, CE, zone) are segmented buttons under their label. */
.form label > span { flex: 1 1 auto; min-width: 0; padding: 10px 0; font-weight: 600; }
.form .hint { display: block; color: var(--ink-2); font-size: 13px; font-weight: 400; margin-top: 2px; }
.form input:not([type="checkbox"]) { flex: 0 0 auto; width: 132px; min-height: 44px; font-size: 17px; color: var(--ink);
  background: var(--raised); border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 0 12px; text-align: right; }
.form .stack { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.form > :last-child { border-bottom: 0; }
.form input[type="checkbox"], .check input { width: 22px; height: 22px; accent-color: var(--sea-strong); margin: 0; }
.checklist { background: var(--bg-2); border-radius: var(--radius-m); }
.checklist h3 { margin: 0; padding: 14px 14px 4px; font-family: var(--font-text); font-size: 13px; text-transform: uppercase;
                letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: start; }
.check .art { color: var(--ink-2); font-size: 13px; }
.check .rec { color: var(--terra-ink); font-size: 12px; font-weight: 700; }
.boat-anchoring { gap: 4px; }
.boat-anchoring h2 { margin: 0; font-size: 16px; font-weight: 600; }
.boat-anchoring p { margin: 0; color: var(--ink-2); font-size: 15px; }
.lang-choice button { font-size: 14px; }
/* «More optional details» (first use): the folded fields keep the form look inside the disclosure. */
.boat-fields { display: flex; flex-direction: column; gap: 10px; }
details.more { padding: 0; }
details.more > summary { padding: 0 14px; color: var(--sea-ink); }
details.more > .form { padding: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-m) var(--radius-m); color: var(--ink); font-size: 16px; }
/* Today's checklist: progress bar and "a/b ready" over the list. */
.checklist-block { display: flex; flex-direction: column; gap: 10px; }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress progress { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px;
                     background: var(--bg-3); overflow: hidden; display: block; }
.progress progress::-webkit-progress-bar { background: var(--bg-3); border-radius: 999px; }
.progress progress::-webkit-progress-value { background: var(--sea); border-radius: 999px; transition: width .2s; }
.progress progress::-moz-progress-bar { background: var(--sea); border-radius: 999px; }
.progress-text { margin: 0; font-size: 14px; font-weight: 700; color: var(--sea-ink); }
/* Home: the soft checklist reminder, one line. */
.reminder { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; color: var(--sea-ink); font-size: 14px;
            font-weight: 600; text-decoration: none; flex: none; }
.reminder .icon { color: var(--sea-strong); }
.reminder span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* First use (#/bienvenida): full-screen steps without the tab bar; the main action stays at the bottom. */
.view.welcome { gap: 12px; padding-bottom: 0; }
.welcome-hero { position: relative; margin: -10px -16px 0; min-height: max(340px, 60dvh); flex: none; display: flex; flex-direction: column;
                justify-content: space-between; overflow: hidden; color: #fff; background: var(--sand);
                border-radius: 0 0 var(--radius-l) var(--radius-l); }
.welcome-hero.no-photo { background: var(--hero-fill); }
/* Without a photo: a low afternoon sun over the water, so the gradient still reads as a day out. */
.welcome-hero.no-photo::before { content: ""; position: absolute; left: calc(68% - 48px); top: 22%; width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle, rgb(255 228 190 / .95) 0 40%, rgb(255 200 150 / .3) 58%, transparent 72%); }
.welcome-hero.no-photo::after { content: ""; position: absolute; left: calc(68% - 60px); top: calc(22% + 104px); width: 120px; height: 34%;
  background: repeating-linear-gradient(transparent 0 9px, rgb(255 228 190 / .28) 9px 12px);
  mask-image: radial-gradient(ellipse 50% 100% at 50% 0, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 50% 100% at 50% 0, #000 20%, transparent 75%); }
.welcome-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.welcome-top { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; padding: 14px 16px 40px;
               background: linear-gradient(rgb(5 30 38 / .45), transparent); }
.welcome-top .brand-name { color: #fff; }
.welcome-copy { position: relative; z-index: 1; padding: 56px 16px 24px; background: linear-gradient(transparent, rgb(5 30 38 / .82)); }
.welcome-title { margin: 0; color: #fff; font-size: clamp(36px, 11vw, 46px); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em;
                 text-wrap: balance; }
.welcome-lead { margin: 12px 0 0; font-size: 18px; line-height: 1.4; color: rgb(255 255 255 / .94); text-wrap: pretty; }
.welcome-hero > .credit { position: absolute; z-index: 2; right: 8px; bottom: 0; }
.welcome-hero:not(.no-photo) .welcome-copy { padding-bottom: 40px; }
.welcome-body { display: flex; flex-direction: column; gap: 8px; }
.onb-label { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.privacy { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; padding: 10px 12px; border-radius: var(--radius-s);
           background: var(--bg-2); color: var(--ink-2); font-size: 14px; }
.privacy .icon { color: var(--sea-ink); }
.steps { display: flex; gap: 5px; flex: 1; }
.steps i { flex: 1; height: 5px; border-radius: 999px; background: var(--line); }
.steps i.on { background: var(--sea); }
.welcome-top .steps i { background: rgb(255 255 255 / .35); }
.welcome-top .steps i.on { background: #fff; }
.onb-top { display: flex; align-items: center; gap: 12px; flex: none; }
.onb-title { margin: 4px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.onb-lead { margin: 0; color: var(--ink-2); font-size: 16px; }
.onb-actions { position: sticky; bottom: 0; margin-top: auto; flex: none; display: flex; flex-direction: column; gap: 2px;
               padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); background: var(--bg);
               box-shadow: 0 -12px 12px -4px var(--bg); }

/* Anchoring: safety banner, one line on what posidonia is, the spot card, then a tall map that the view scrolls past. */
.view.anchor .banner { flex: none; }
.anchor-explain { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: var(--ink-2); font-size: 14px; flex: none; }
.anchor-explain .icon { color: var(--sea-ink); margin-top: 1px; }
.anchor-card { gap: 8px; padding: 14px; flex: none; }
.anchor-card p { margin: 0; }
.anchor-card p:empty { display: none; }
.anchor-choice { font-weight: 600; }
.view.anchor .map-full { flex: none; height: 44vh; min-height: 260px; }
.map-keys { display: flex; flex-direction: column; gap: 6px; flex: none; }
.view.anchor .footer-note { margin: 0; }
.anchor-actions:not(:has(> :not([hidden]))) { display: none; }
.anchor-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.anchor-actions .btn { width: auto; flex: 1 1 auto; min-height: 44px; padding: 0 14px; font-size: 15px; }
/* Regulated zones (zones.json): notices at the spot and a compact legend under the anchoring map. */
.zone-notes { display: flex; flex-direction: column; gap: 6px; }
.zone-notes .notice { padding: 8px 12px; font-size: 13px; }
.zone-notes .notice.danger a { color: #fff; }
.zone-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-2); font-size: 12px; }
.legend-item::before { content: ""; display: inline-block; width: 14px; height: 9px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }
.legend-reserve::before { border: 2px dashed #8e44ad; }
.legend-no_anchor::before { border: 2px solid #d62828; background: rgb(255 107 107 / .3); }
.legend-buoys::before { border: 2px solid #f08c00; }
/* Map key: same colours as the anchoring map (posidonia fill, suggested/unfit spots, dashed swing circle). */
.legend-posidonia::before { background: rgb(47 158 91 / .45); }
.legend-spot::before, .legend-unfit::before, .legend-swing::before { width: 12px; height: 12px; border-radius: 50%; }
.legend-spot::before { background: #0a84ff; box-shadow: 0 0 0 2px #fff inset; border: 1px solid #0a84ff; }
.legend-unfit::before { background: #8e8e93; }
.legend-chosen::before { width: 14px; height: 14px; border-radius: 50%; background: #0e7c86; border: 2px solid #fff; box-shadow: 0 0 0 1px #0e7c86; }
.legend-swing::before { border: 1.5px dashed #0a84ff; }

/* Live navigation: compact high-contrast card over a full-height map. */
.nav-view { gap: 8px; }
.nav-card { gap: 10px; padding: 12px 14px 14px; flex: none; }
.nav-head { display: flex; align-items: center; gap: 10px; }
.nav-head h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -0.02em; line-height: 1.1; min-width: 0; }
.nav-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nav-stat { background: var(--raised); border-radius: var(--radius-s); padding: 8px; min-width: 0; box-shadow: var(--shadow); }
.nav-stat small, .nav-leg small { display: block; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.nav-stat b { display: block; font-family: var(--font-display); font-size: clamp(16px, 4.8vw, 21px); font-weight: 800; white-space: nowrap;
              font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.nav-leg b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nav-leg b::first-letter { text-transform: uppercase; }
.nav-leg .hint { font-weight: 400; margin-top: 2px; }
.nav-status { font-size: 14px; font-weight: 600; background: var(--warm-bg); color: var(--terra-ink); border-radius: var(--radius-s); padding: 8px 12px; }
.nav-card .banner { padding: 10px; font-size: 18px; }
.nav-map-wrap { position: relative; flex: 1; min-height: 200px; }
.nav-map { position: absolute; inset: 0; }
.nav-center { position: absolute; right: 10px; bottom: 24px; z-index: 1000; border: 0; border-radius: 22px; min-height: 44px;
              padding: 0 16px; background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: 0 2px 6px rgb(0 0 0 / .3); }

/* Signals guide (#/senales): illustrations on light tiles (readable in both themes), lights on a dark night panel. */
.sg { gap: 12px; }
.sg-seg { position: sticky; top: 0; z-index: 5; flex: none; box-shadow: 0 -10px 0 10px var(--bg); }
/* The sticky bar paints 20px of background above itself (its shadow): keep the title clear of it. */
.sg .view-header { padding-bottom: 10px; }
.sg-body { display: flex; flex-direction: column; gap: 12px; }
.sg-h2 { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin: 12px 0 0; letter-spacing: -0.01em; }
.sg-panel { background: var(--bg-2); border-radius: var(--radius-m); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sg-lead { margin: 0; font-size: 16px; font-weight: 600; }
.sg-aid { margin: 0; font-size: 15px; color: var(--ink-2); }
.sg-card { background: var(--bg-2); border-radius: var(--radius-m); padding: 12px; display: grid; grid-template-columns: 92px 1fr;
           gap: 14px; align-items: start; }
.sg-tile { width: 92px; height: 138px; border-radius: var(--radius-s); overflow: hidden; display: block; }
.sg-sky { fill: var(--sg-sky); }
.sg-sea { fill: var(--sg-sea); opacity: .94; }
.sg-o { stroke: #16181c; stroke-width: 1.6; stroke-linejoin: round; }
.sg-text { min-width: 0; }
.sg-name { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.sg-meaning { margin: 4px 0 0; font-size: 15px; }
.sg-action { margin: 8px 0 0; font-size: 15px; font-weight: 600; background: var(--bg-3); border-radius: 10px; padding: 6px 10px; }
.sg-action::before { content: "→ "; color: var(--sea-ink); font-weight: 700; }
.sg-light { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.sg-light small { display: block; color: var(--ink-2); font-size: 13px; }
.sg-code { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700; }
.sg-alt { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.sg-lamp { width: 40px; height: 40px; flex: none; display: block; }
.sg-lamp.big { width: 132px; height: 132px; }
.sg-lamp-bg { fill: var(--night); }
.sg-diagram { width: 100%; height: auto; display: block; border-radius: var(--radius-s); }
.sg-water { fill: #2c76b4; } .sg-land { fill: #d9cfb8; } .sg-sand { fill: #f1deae; }
.sg-rock { fill: #4a3b33; stroke: #16181c; stroke-width: 1.5; stroke-linejoin: round; }
.sg-dt { font: 600 13px var(--font-text); fill: #fff; }
.sg-dt.mid { text-anchor: middle; } .sg-dt.end { text-anchor: end; } .sg-dt.dark { fill: #4a3a1c; }
.sg-night { background: var(--night); color: #f2f2f7; border: 1px solid var(--night-line); border-radius: var(--radius-m); padding: 14px;
            display: flex; flex-direction: column; gap: 10px; }
.sg-stage { display: grid; place-items: center; padding: 4px 0; }
.sg-stage-code { text-align: center; font-family: var(--font-display); font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sg-stage-sub { text-align: center; color: var(--night-muted); font-size: 15px; margin: 0; }
.sg-bar-row { display: flex; gap: 10px; align-items: center; color: var(--night-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.sg-bar { flex: 1; min-width: 0; height: 24px; display: block; overflow: visible; }
.sg-bar-head { fill: #ffffff; }
.sg-bar-off { fill: #263142; }
.sg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-chip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 0; background: rgb(255 255 255 / .12); color: #f2f2f7;
           font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sg-chip[aria-pressed="true"] { background: #fff; color: #000; }
/* Two columns: long German names ("Manövrierbehindert") must fit at 360 px. */
.sg-chips-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sg-chips-grid .sg-chip { background: var(--bg-2); color: var(--ink); border-radius: var(--radius-s); padding: 4px 6px; line-height: 1.15; font-size: 14px;
                         overflow-wrap: anywhere; hyphens: auto; }
.sg-chips-grid .sg-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.sg-variants { background: rgb(255 255 255 / .14); }
.sg-variants button { color: #f2f2f7; }
.sg-variants button[aria-pressed="true"] { background: #fff; color: #000; }
.sg-views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sg-views figure { margin: 0; }
.sg-views figcaption { text-align: center; color: var(--night-muted); font-size: 13px; font-weight: 600; }
.sg-night-view { width: 100%; height: auto; display: block; }
.sg-parts { display: flex; gap: 8px; }
.sg-part { flex: 1; background: var(--bg-3); border-radius: var(--radius-s); padding: 10px 6px; text-align: center; }
.sg-part b { display: block; font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.sg-part small { display: block; color: var(--ink-2); font-size: 13px; line-height: 1.25; margin-top: 2px; }
.sg-colors { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.sg-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px;
          box-shadow: 0 0 0 1px rgb(0 0 0 / .4); }
.sg-dot-W { background: #fff4cc; } .sg-dot-R { background: #ff453a; } .sg-dot-G { background: #30d158; }
.sg-dot-Y { background: #ffd60a; } .sg-dot-Bu { background: #4a90ff; }
.sg-list { background: var(--bg-2); border-radius: var(--radius-m); }
.sg-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.sg-row:first-child { border-top: 0; }
.sg-row small { display: block; color: var(--ink-2); font-size: 13px; }
.sg-row p { margin: 2px 0 0; font-size: 15px; }
.sg-row-name { font-weight: 700; }
.sg-heading p { margin: 0; }
.sg-mini-night { background: var(--night); border-radius: 10px; width: 84px; }
.sg-rule { align-items: start; }
.sg-icon { width: 32px; height: 32px; display: block; color: var(--ink); }
.sg-icon-t { font: 700 14px var(--font-text); text-anchor: middle; fill: currentColor; }
.unit-hint { color: var(--ink-2); font-size: 13px; }
