/* ═════════════════════════════════════════════════════════════
   SCUBACICE · stile (v2, "sale e lime")

   L'interfaccia è chiara e quasi neutra: il colore lo portano
   la mappa satellitare e le foto delle specie. Il lime è
   l'unico accento e segna solo ciò che conta: gli spot visitati,
   la sezione attiva, le immersioni fatte.

   Cambiando i colori qui sotto in :root cambia tutto il sito.
   ═════════════════════════════════════════════════════════════ */

:root {
  /* colori */
  --bg: #f3f4ef;           /* fondo: bianco sale */
  --surface: #e8eae3;      /* un gradino più scuro: campi, binari */
  --card: #ffffff;         /* schede e pannelli */
  --ink: #0e2a2f;          /* inchiostro blu profondo: testo e pulsanti */
  --ink-2: #2f474b;        /* testo dei paragrafi */
  --muted: #5b6b6c;        /* etichette, date, testo secondario */
  --line: rgba(14, 42, 47, .12);
  --line-2: rgba(14, 42, 47, .22);
  --lime: #c8f031;         /* il colore di Cice */
  --lime-soft: #eef9c9;    /* lime chiarissimo per gli sfondi */
  --lime-text: #4a6400;    /* lime scuro, leggibile come testo */
  --sea: #1d6f78;          /* spot profondi, grafico */
  --coral: #c43d2c;        /* errori ed elimina */
  --coral-soft: #fbe9e6;
  --gold: #8a5a00;         /* specie rare */
  --gold-soft: #fbf0d9;

  /* caratteri */
  --font-display: 'Funnel Display', 'Avenir Next', system-ui, sans-serif;
  --font-body: 'Funnel Sans', 'Avenir Next', system-ui, sans-serif;

  /* forme */
  --r-lg: 20px;            /* fogli e finestre */
  --r-md: 14px;            /* schede */
  --r-sm: 10px;            /* campi */
  --float: 0 1px 2px rgba(14, 42, 47, .08), 0 8px 24px -10px rgba(14, 42, 47, .35);
  --lift: 0 12px 28px -14px rgba(14, 42, 47, .35);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: calc(64px + var(--safe-b));

  /* movimento: un'unica curva, nessun rimbalzo */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-enter: cubic-bezier(.22, 1, .36, 1);
  --m-in: 150ms;
  --m-out: 120ms;
  --m-press: 90ms;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden; overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; margin: 0; }
p { margin: 0; }
img.fade { opacity: 0; transition: opacity .4s ease; }
img.fade.is-in { opacity: 1; }
img.is-broken { visibility: hidden; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

.skip { position: fixed; z-index: 200; left: 12px; top: -60px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.noscript { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 32px; text-align: center; background: var(--bg); }
.only-desktop { display: none; }

.flag { display: inline-block; width: 16px; height: 11px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; box-shadow: 0 0 0 1px var(--line); flex: none; }
.flag-IT { background: linear-gradient(90deg, #169b62 33.3%, #fff 33.3% 66.6%, #e0312f 66.6%); }
.flag-HR { background: linear-gradient(180deg, #e0312f 33.3%, #fff 33.3% 66.6%, #1c4fa1 66.6%); }

.pips { display: inline-flex; gap: 3px; }
.pips i { width: 14px; height: 5px; border-radius: 3px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pips i.on { background: var(--ink); box-shadow: none; }

/* ───────── MAPPA ───────── */
#map { position: fixed; inset: 0; background: #b9d3d9; z-index: 0; }
.leaflet-container { font-family: var(--font-body); background: #b9d3d9; }
.leaflet-control-attribution {
  background: rgba(243, 244, 239, .85) !important; color: var(--muted) !important; font-size: 11px; padding: 1px 7px !important;
  margin: 0 0 calc(var(--tabbar-h) + 122px) 0 !important; border-radius: 0 6px 6px 0;
}
.leaflet-control-attribution a { color: var(--ink) !important; }
body.is-picking #map, body.is-picking .leaflet-grab { cursor: crosshair; }

/* segnaposti degli spot: un disco bianco, lime se ci sei stata */
.pin { --dot: var(--ink); width: 34px; height: 34px; position: relative; display: grid; place-items: center; cursor: pointer; transition: transform var(--m-out) var(--ease); }
.pin::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px rgba(14, 42, 47, .55), 0 2px 8px rgba(0, 0, 0, .4); }
.pin::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); position: relative; }
.pin:hover { transform: scale(1.12); transition-duration: var(--m-in); }
.pin.is-deep { --dot: var(--sea); }
.pin.is-visited::before { background: var(--lime); box-shadow: 0 0 0 1.5px var(--ink), 0 2px 8px rgba(0, 0, 0, .4); }
.pin.is-active { transform: scale(1.35); z-index: 1000 !important; }
.pin.is-active::before { background: var(--ink); box-shadow: 0 0 0 3px #fff, 0 0 0 7px rgba(200, 240, 49, .7), 0 4px 14px rgba(0, 0, 0, .45); }
.pin.is-active::after { background: var(--lime); }
.pin-label {
  position: absolute; left: 50%; top: calc(100% - 2px); transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 600 13px/1 var(--font-body); color: var(--ink); padding: 5px 9px; border-radius: 999px; background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3); opacity: 0; transition: opacity .2s;
}
.pin.has-label .pin-label, .pin:hover .pin-label { opacity: 1; }
.pin.is-active .pin-label { background: var(--ink); color: #fff; font-size: 10px; padding: 4px 7px; }
.pin-new::before { background: var(--lime); box-shadow: 0 0 0 2px var(--ink), 0 0 0 6px rgba(255, 255, 255, .6); }
.pin-new::after { background: var(--ink); }
.me-dot { width: 20px; height: 20px; border-radius: 50%; background: #2f7cf6; border: 3px solid #fff; box-shadow: 0 0 0 7px rgba(47, 124, 246, .22), 0 2px 6px rgba(0, 0, 0, .35); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── BARRA IN ALTO ───────── */
.topbar { position: fixed; z-index: 30; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; gap: 10px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; border-radius: 999px; }
.brand img { width: 46px; height: 46px; border-radius: 50%; box-shadow: var(--float); }
.wordmark { display: none; height: 46px; align-items: center; padding: 0 16px; border-radius: 999px; background: var(--card); box-shadow: var(--float); font: 700 18px/1 var(--font-display); letter-spacing: -.01em; }
.wordmark b, .splash-word b { font-weight: 700; background: var(--lime); padding: 2px 5px 3px; margin-left: 2px; border-radius: 6px; }

.search {
  position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 15px;
  border-radius: 999px; background: var(--card); box-shadow: var(--float); transition: box-shadow var(--m-in) var(--ease);
}
.search:focus-within { box-shadow: 0 0 0 2px var(--ink), var(--float); }
.search > svg { color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search-clear { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.search-clear:hover { background: var(--surface); color: var(--ink); }
.search-clear svg { width: 16px; height: 16px; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: min(60vh, 420px); overflow: auto;
  background: var(--card); border-radius: var(--r-md); box-shadow: var(--float), 0 0 0 1px var(--line); padding: 6px; animation: drop .2s var(--ease);
}
.search-results h4 { margin: 10px 10px 4px; font: 500 13px/1 var(--font-body); color: var(--muted); }
.result { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 48px; text-align: left; padding: 8px 10px; border-radius: var(--r-sm); }
.result:hover, .result.is-active { background: var(--bg); }
.result span { flex: 1; min-width: 0; font-weight: 500; }
.result small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result b { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.result .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.result .dot.is-visited { background: var(--lime); }
.result-empty { padding: 14px 10px; color: var(--muted); font-size: 14px; }

/* ───────── FILTRI ───────── */
.filters { position: fixed; z-index: 20; top: calc(66px + var(--safe-t)); left: 0; right: 0; display: flex; gap: 8px; padding: 0 34px 12px 12px; overflow-x: auto; scrollbar-width: none; }
.filters { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); }
.filters::-webkit-scrollbar, .group-tabs::-webkit-scrollbar, .collection::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--card); color: var(--ink); font-weight: 500; font-size: 14px; white-space: nowrap; box-shadow: var(--float);
  transition: background var(--m-out) var(--ease), color var(--m-out) var(--ease), transform var(--m-press) var(--ease);
}
.chip:hover { background: var(--bg); transition-duration: var(--m-in); }
.chip:active { transform: translateY(1px) scale(.985); }
.chip.is-on { background: var(--ink); color: #fff; }

.offline { position: fixed; z-index: 45; top: calc(112px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 500; font-size: 14px; box-shadow: var(--float); animation: drop .3s var(--ease); }
.offline svg { width: 16px; height: 16px; color: var(--lime); }

/* ───────── PULSANTI SULLA MAPPA ───────── */
.map-tools { position: fixed; z-index: 20; right: 12px; bottom: calc(var(--tabbar-h) + 132px); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; transition: opacity .25s, transform .3s var(--ease); }
body:not([data-sheet="mini"]) .map-tools { opacity: 0; pointer-events: none; transform: translateY(12px); }
.fab, .tool { background: var(--card); color: var(--ink); box-shadow: var(--float); transition: background var(--m-out) var(--ease), transform var(--m-press) var(--ease); }
.fab { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 15px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.tool { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.tool:hover, .fab:hover { background: var(--bg); transition-duration: var(--m-in); }
.fab:active, .tool:active { transform: translateY(1px) scale(.985); }
.fab-lime { background: var(--ink); color: #fff; }
.fab-lime svg { color: var(--lime); }
.fab-lime:hover { background: #24403f; }
.tool.is-on { color: #2f7cf6; }
.tool.is-busy svg { animation: spin 1.2s linear infinite; }
.tool-group { flex-direction: column; border-radius: 23px; overflow: hidden; box-shadow: var(--float); }
.tool-group .tool { border-radius: 0; box-shadow: none; }
.tool-group .tool + .tool { border-top: 1px solid var(--line); }

.pick-banner { position: fixed; z-index: 36; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 14px); display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 10px 10px 18px; border-radius: var(--r-md); background: var(--ink); color: #fff; font-weight: 500; line-height: 1.35; box-shadow: var(--float); animation: rise .3s var(--ease-enter); }
.pick-banner .btn { background: var(--lime); color: var(--ink); border-color: transparent; }

/* ───────── MENU ───────── */
.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: var(--tabbar-h); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 13px; font-weight: 500; position: relative; transition: color var(--m-out) var(--ease); }
.tab svg { width: 44px; height: 28px; padding: 3px 10px; border-radius: 999px; transition: background .2s var(--ease); }
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); font-weight: 600; }
.tab.is-on svg { background: var(--lime); }

/* ───────── FOGLIO ───────── */
.sheet {
  position: fixed; z-index: 35; left: 0; right: 0; top: calc(62px + var(--safe-t)); bottom: var(--tabbar-h);
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -1px 0 var(--line), 0 -12px 32px -12px rgba(14, 42, 47, .35); transform: translateY(100%); transition: transform .45s var(--ease);
  display: flex; flex-direction: column; will-change: transform;
}
.sheet.is-dragging { transition: none; }
.sheet-handle { height: 24px; flex: none; display: grid; place-items: center; width: 100%; cursor: grab; touch-action: none; }
.sheet-handle span { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); transition: background .2s; }
.sheet-handle:hover span { background: var(--muted); }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 16px 40px; overscroll-behavior: contain; outline: 0; }
.sheet:not([data-snap="full"]) .sheet-body { overflow: hidden; }
.sheet-head { cursor: pointer; }
.kicker { font: 500 13px/1.3 var(--font-body); color: var(--muted); display: flex; align-items: center; }

.list-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 18px; }
.list-head h2 { font-size: 30px; margin-top: 6px; }
.list-head h2 b { font-weight: 600; }
.list-mark { width: 40px; height: 40px; }
.spot-list { display: grid; background: var(--card); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.spot-row {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%; min-height: 64px;
  padding: 12px 16px 12px 14px; transition: background var(--m-out) var(--ease);
}
.spot-row + .spot-row { box-shadow: inset 0 1px 0 var(--line); }
.spot-row:hover { background: var(--bg); transition-duration: var(--m-in); }
.row-pin { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px var(--line-2); display: grid; place-items: center; justify-self: center; }
.row-pin::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.row-pin.is-deep::after { background: var(--sea); }
.row-pin.is-visited { background: var(--lime); box-shadow: 0 0 0 1.5px var(--ink); }
.row-main { min-width: 0; }
.row-main strong { display: block; font: 600 17px/1.2 var(--font-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-side { display: grid; justify-items: end; gap: 6px; }
.row-side b { font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap; }
.row-side b i { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 2px; font-size: 13px; }
.row-side small { font-size: 13px; font-weight: 500; color: var(--lime-text); }

.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--ink); transition: background var(--m-out) var(--ease), transform var(--m-press) var(--ease); flex: none; }
.icon-btn:hover { background: var(--surface); transition-duration: var(--m-in); }
.icon-btn:active { transform: translateY(1px) scale(.985); }
.icon-btn-lg { width: 48px; height: 48px; }

/* ───────── SCHEDA SPOT ───────── */
.spot-head { position: relative; padding: 2px 52px 0 2px; }
.spot-close { position: absolute; right: 0; top: -4px; }
.spot-head h2 { font-size: clamp(30px, 8vw, 40px); margin: 8px 0 12px; text-wrap: balance; }
.spot-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--surface); color: var(--ink); white-space: nowrap; }
.tag svg { width: 14px; height: 14px; stroke-width: 2.4; }
.tag-lime, .tag-iucn-10 { background: var(--lime); color: var(--ink); }
.tag-warn, .tag-iucn-30, .tag-iucn-40, .tag-iucn-50 { background: var(--coral-soft); color: var(--coral); }
.tag-gold, .tag-iucn-20 { background: var(--gold-soft); color: var(--gold); }

.gauges { display: grid; grid-template-columns: 1.35fr 1fr 1fr; margin: 18px 0 12px; background: var(--card); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); }
.gauge { padding: 13px 14px 14px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gauge + .gauge { box-shadow: inset 1px 0 0 var(--line); }
.gauge small { font-size: 13px; color: var(--muted); font-weight: 500; }
.gauge strong { font: 600 24px/1.05 var(--font-display); letter-spacing: -.02em; white-space: nowrap; }
.gauge strong i { font-style: normal; font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.gauge strong.txt { font: 600 16px/1.25 var(--font-body); letter-spacing: 0; white-space: normal; }
.gauge em { font-style: normal; font-size: 13px; color: var(--muted); }
.gauge .pips { margin-top: auto; padding-top: 2px; }
.depth-bar { height: 6px; border-radius: 3px; background: var(--surface); position: relative; overflow: hidden; margin-top: auto; }
.depth-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--ink); }
.depth-bar i::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 6px; border-radius: 3px; background: var(--lime); }
.depth-ticks { display: flex; justify-content: space-between; font-size: 11px; line-height: 1; color: var(--muted); }

.teaser { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px 10px 12px; border-radius: var(--r-md); text-align: left; background: var(--card); box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--m-out) var(--ease), transform var(--m-out) var(--ease); }
.teaser:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2), var(--lift); transition-duration: var(--m-in); }
.teaser:disabled { opacity: .7; cursor: default; }
.teaser > svg { color: var(--ink); width: 18px; height: 18px; }
.teaser-text { flex: 1; font-weight: 600; font-size: 15px; }
.avatars { display: flex; padding-left: 8px; min-height: 38px; }
.avatars img, .avatars i { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; margin-left: -8px; border: 2px solid var(--card); background: var(--surface); display: block; }
.teaser.is-loading .avatars i, .is-skeleton .sp-photo, .is-skeleton .sp-info i, .sp-summary .line { background: linear-gradient(90deg, var(--surface) 25%, #f4f5f0 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.spot-desc { color: var(--ink-2); margin: 18px 2px 0; font-size: 16px; line-height: 1.6; text-wrap: pretty; max-width: 62ch; }
.spot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 32px; align-items: center; }
.spot-actions .btn-lime { flex: 1; }
.admin-actions { display: flex; gap: 8px; width: 100%; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }

/* ───────── PULSANTI ─────────
   Un solo pulsante pieno per vista (inchiostro, icona lime);
   tutti gli altri sono bianchi con un filo. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 16px; border: 1px solid transparent; text-decoration: none; white-space: nowrap;
  transition: transform var(--m-out) var(--ease), background var(--m-out) var(--ease), border-color var(--m-out) var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }
.btn-lime { background: var(--ink); color: #fff; }
.btn-lime svg { color: var(--lime); stroke-width: 2.2; }
.btn-coral { background: var(--coral); color: #fff; }
.btn-ghost { background: var(--card); border-color: var(--line-2); color: var(--ink); }
.btn-danger { background: var(--card); color: var(--coral); border-color: rgba(196, 61, 44, .35); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); transition-duration: var(--m-in); }
  .btn:active { transform: translateY(1px) scale(.985); }
  .btn-lime:hover { background: #24403f; }
  .btn-coral:hover { background: #a93322; }
  .btn-ghost:hover { background: var(--bg); border-color: var(--muted); }
  .btn-danger:hover { background: var(--coral-soft); }
}
.btn-sm { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link-btn { color: var(--ink); font-size: 14px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; justify-self: center; padding: 10px; transition: text-decoration-color var(--m-out); }
.link-btn:hover { text-decoration-color: var(--ink); }

/* ───────── SPECIE ───────── */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.section-title h3 { font-size: 26px; }
.section-title span { font-size: 13px; font-weight: 600; color: var(--lime-text); white-space: nowrap; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0 0 14px; }
.hint-box { padding: 12px 14px; background: var(--surface); border-radius: var(--r-sm); margin: 14px 0 0; }
.species-sec { scroll-margin-top: 8px; }

.sp-search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; margin-bottom: 10px; border-radius: 999px; background: var(--card); box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--m-in); }
.sp-search:focus-within { box-shadow: 0 0 0 2px var(--ink); }
.sp-search svg { color: var(--muted); width: 18px; height: 18px; }
.sp-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 16px; }
.sp-search input::placeholder { color: var(--muted); }
.group-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 2px 16px; }
.group-tabs .chip { height: 36px; font-size: 14px; box-shadow: 0 0 0 1px var(--line); }
.group-tabs .chip.is-on { box-shadow: none; }
.group-tabs .chip b { font-weight: 500; opacity: .6; margin-left: 6px; }

.species-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sp-card { position: relative; text-align: left; border-radius: var(--r-md); overflow: hidden; background: var(--card); box-shadow: 0 0 0 1px var(--line); display: flex; flex-direction: column; transition: transform var(--m-out) var(--ease), box-shadow var(--m-out) var(--ease); }
.sp-photo { display: block; aspect-ratio: 4 / 3; background: var(--surface); position: relative; overflow: hidden; }
.sp-photo img { width: 100%; height: 100%; object-fit: cover; transition: opacity .4s ease, transform .6s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .sp-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2), var(--lift); transition-duration: 180ms; }
  .sp-card:hover .sp-photo img { transform: scale(1.03); }
}
.sp-noimg { display: grid; place-items: center; color: var(--line-2); }
.sp-noimg svg { width: 44px; height: 44px; stroke-width: 1.3; }
.sp-info { display: block; padding: 10px 12px 13px; }
.sp-info strong { display: block; font-weight: 600; font-size: 15px; line-height: 1.25; }
.sp-info em { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-skeleton { pointer-events: none; }
.is-skeleton .sp-info i { display: block; height: 12px; border-radius: 6px; margin-bottom: 8px; }
.is-skeleton .sp-info i:last-child { width: 60%; margin: 0; }
.rarity { position: absolute; z-index: 1; left: 8px; top: 8px; height: 24px; padding: 0 9px; border-radius: 999px; font: 600 12px/24px var(--font-body); background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.rarity-rare { background: var(--gold-soft); color: var(--gold); }
.rarity-common { color: var(--muted); }
.seen-badge { position: absolute; z-index: 1; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .25); }
.seen-badge svg { width: 15px; height: 15px; stroke-width: 3; }
.sp-more { display: grid; place-items: center; padding: 22px 0 6px; }
.sp-nomatch { grid-column: 1 / -1; padding: 18px 0; text-align: center; }

.loader { display: grid; place-items: center; padding: 26px 0; color: var(--muted); }
.bubbles-loader { display: inline-flex; gap: 6px; height: 12px; align-items: center; }
.bubbles-loader i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: blink 1.2s ease-in-out infinite; }
.bubbles-loader i:nth-child(2) { animation-delay: .15s; }
.bubbles-loader i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

.empty { text-align: center; color: var(--muted); padding: 28px 18px; background: var(--card); box-shadow: 0 0 0 1px var(--line); border-radius: var(--r-md); display: grid; justify-items: center; gap: 14px; }
.empty p { max-width: 34ch; text-wrap: balance; }
.empty-lg { padding: 44px 20px; margin-top: 8px; }
.empty-art { width: 64px; height: 64px; }
.empty-art img { width: 64px; height: 64px; }
.empty-art i { display: none; }

/* ───────── VISTE (diario, profilo) ───────── */
.view { position: fixed; z-index: 38; inset: 0; bottom: var(--tabbar-h); overflow-y: auto; overscroll-behavior: contain; background: var(--bg); animation: view-in .3s var(--ease-enter); }
.view-inner { max-width: 720px; margin: 0 auto; padding: calc(28px + var(--safe-t)) 16px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.view-head h1 { font-size: clamp(40px, 11vw, 60px); letter-spacing: -.04em; }
.view-head h1 em { font-style: normal; }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.stat { background: var(--card); padding: 16px 16px 15px; position: relative; }
.stat strong { display: block; font: 600 40px/1 var(--font-display); letter-spacing: -.04em; }
.stat strong small { font: 400 15px var(--font-body); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat span { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; line-height: 1.25; color: var(--muted); font-weight: 500; }
.stat span svg { width: 16px; height: 16px; }
.stat-main { background: var(--lime); }
.stat-main strong, .stat-main span { color: var(--ink); }

.sub-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sub-title h3 { font-size: 22px; }
.sub-title span { font-size: 13px; color: var(--muted); }

.card { background: var(--card); box-shadow: 0 0 0 1px var(--line); border-radius: var(--r-md); padding: 20px; }
.card h3 { font-size: 20px; margin-bottom: 10px; }
.card p { color: var(--ink-2); margin-bottom: 14px; }
.card p:last-child { margin-bottom: 0; }
#me-body.view-inner { gap: 14px; }
#me-body .view-head { margin-bottom: 10px; }

/* grafico: le barre scendono dalla superficie, come una discesa */
.chart { display: grid; grid-template-columns: auto 1fr; gap: 10px; height: 160px; margin-top: 6px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; line-height: 1; color: var(--muted); padding-bottom: 18px; text-align: right; }
.chart-bars { display: flex; gap: 6px; align-items: flex-start; border-top: 2px solid var(--ink); background: repeating-linear-gradient(180deg, transparent 0 calc(50% - 10px), var(--line) calc(50% - 10px) calc(50% - 9px), transparent calc(50% - 9px) 100%); }
.bar { flex: 1; max-width: 40px; height: calc(100% - 18px); display: flex; flex-direction: column; align-items: center; }
.bar i { display: block; width: 100%; height: var(--h); border-radius: 0 0 6px 6px; background: var(--sea); box-shadow: inset 0 -4px 0 var(--lime); transform-origin: top; animation: dive-in .7s var(--ease-enter) both .1s; }
.bar b { font-size: 11px; font-weight: 600; line-height: 1; margin-top: 5px; color: var(--ink); }
@keyframes dive-in { from { transform: scaleY(0); } }

.collection { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px; }
.coll-item { flex: none; width: 88px; text-align: center; font-size: 13px; line-height: 1.25; color: var(--ink-2); }
.coll-item .ph { display: block; width: 76px; height: 76px; margin: 0 auto 8px; border-radius: 50%; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 2px var(--lime), 0 0 0 3px var(--ink); }
.coll-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
@media (hover: hover) and (pointer: fine) { .coll-item:hover img { transform: scale(1.03); } }

.dive-list { display: grid; background: var(--card); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.dive { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 16px; transition: background var(--m-out) var(--ease); }
.dive + .dive { box-shadow: inset 0 1px 0 var(--line); }
.dive:hover { background: var(--bg); transition-duration: var(--m-in); }
.dive-date { text-align: center; padding-right: 14px; box-shadow: inset -1px 0 0 var(--line); display: block; }
.dive-date strong { display: block; font: 600 28px/1 var(--font-display); letter-spacing: -.03em; }
.dive-date span { display: block; margin-top: 5px; font-size: 13px; line-height: 1; color: var(--muted); white-space: nowrap; }
.dive-main { min-width: 0; display: block; }
.dive-no { font-size: 13px; font-weight: 500; color: var(--muted); }
.dive-main strong { display: block; font: 600 18px/1.2 var(--font-display); letter-spacing: -.01em; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dive-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 6px; font-size: 13px; line-height: 1.3; color: var(--muted); }
.dive-meta b { color: var(--ink); font-weight: 600; }
.dive-notes { margin-top: 6px; font-size: 14px; line-height: 1.4; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dive-thumbs { display: flex; }
.dive-thumbs i { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--surface); border: 2px solid var(--card); margin-left: -10px; }
.dive-thumbs i:first-child { margin-left: 0; }
.dive-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.dive-thumbs .more { display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--lime); color: var(--ink); font-style: normal; }

/* ───────── PROFILO ───────── */
.card-demo { background: var(--lime-soft); box-shadow: 0 0 0 1px rgba(74, 100, 0, .25); }
.card-demo h3 { display: flex; align-items: center; gap: 10px; }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 2px var(--ink); }
.seg { display: flex; padding: 4px; background: var(--surface); border-radius: 999px; }
.seg button { flex: 1; height: 40px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--muted); transition: background .2s var(--ease), color .2s; }
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(14, 42, 47, .2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.g-logo { stroke: none; }
.user-line { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; font: 700 22px var(--font-display); flex: none; }
.user-id { min-width: 0; display: grid; gap: 3px; justify-items: start; }
.user-id small { color: var(--muted); font-size: 13px; }
.user-id b { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.card-install { display: flex; gap: 16px; align-items: flex-start; }
.card-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--lime); color: var(--ink); display: grid; place-items: center; flex: none; }
.about { display: flex; gap: 16px; align-items: center; }
.about img { width: 64px; height: 64px; flex: none; }
.wordmark-sm { font: 700 18px/1 var(--font-display); display: block; margin-bottom: 6px; }
.wordmark-sm i { font-style: normal; background: var(--lime); padding: 1px 4px 2px; border-radius: 5px; margin-left: 1px; }
.about p { font-size: 15px; }
.credits { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.7; margin-top: 8px; }

/* ───────── MODULI ───────── */
.form { display: grid; gap: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > span { font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-head { display: flex; justify-content: space-between; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line-2); outline: 0; font-size: 16px; transition: border-color var(--m-in), box-shadow var(--m-in); -webkit-appearance: none; appearance: none; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b6c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 34px; text-overflow: ellipsis; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field input::placeholder, .field textarea::placeholder { color: #8a9798; }
.form .hint { margin: -8px 0 0; }

.switch { display: flex; gap: 14px; align-items: center; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 50px; height: 30px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .2s var(--ease); }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--lime); }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch b { display: block; font-weight: 600; }
.switch small { color: var(--muted); font-size: 14px; }

.pick-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); padding: 4px; overscroll-behavior: contain; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px 6px 6px; border-radius: 8px; cursor: pointer; position: relative; transition: background var(--m-out); }
.pick:hover { background: var(--bg); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick img, .pick .ph { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface); flex: none; }
.pick span { flex: 1; min-width: 0; font-size: 15px; line-height: 1.25; font-weight: 500; }
.pick span em { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.pick .check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; transition: background var(--m-in), border-color var(--m-in); }
.pick .check svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.pick input:checked ~ .check { background: var(--lime); border-color: var(--ink); color: var(--ink); }
.pick input:checked ~ .check svg { opacity: 1; }
.pick input:focus-visible ~ .check { outline: 2px solid var(--ink); outline-offset: 2px; }
.pick-count { font-size: 13px; font-weight: 600; color: var(--lime-text); }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.form-actions .btn-lime { flex: 1; }
.form-error { color: var(--coral); font-size: 14px; font-weight: 500; padding: 10px 14px; border-radius: var(--r-sm); background: var(--coral-soft); }

/* ───────── FINESTRA ───────── */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(14, 42, 47, .45); animation: fade .25s; }
.modal-card { position: relative; width: 100%; max-height: 93dvh; overflow-y: auto; overscroll-behavior: contain; outline: 0; background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 26px 20px calc(26px + var(--safe-b)); box-shadow: 0 -12px 40px -12px rgba(14, 42, 47, .4); animation: rise .4s var(--ease-enter); }
.modal-close { position: absolute; right: 14px; top: 14px; z-index: 3; }
.modal h2 { font-size: 32px; margin-bottom: 20px; padding-right: 48px; }

.sp-hero { margin: -26px -20px 0; position: relative; aspect-ratio: 4 / 3; max-height: 44dvh; width: calc(100% + 40px); background: var(--surface); overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.sp-hero img { width: 100%; height: 100%; object-fit: cover; }
.sp-hero .credit { position: absolute; z-index: 1; right: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .9); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-title { margin-top: 20px; }
.sp-title h2 { margin-bottom: 4px; padding: 0; font-size: 34px; text-wrap: balance; }
.sp-title em { color: var(--muted); font-size: 16px; }
.sp-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.sp-seen { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); background: var(--lime); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.sp-seen svg { width: 16px; height: 16px; stroke-width: 3; }
.sp-summary { color: var(--ink-2); margin-bottom: 22px; line-height: 1.65; text-wrap: pretty; }
.sp-summary .line { display: block; height: 12px; border-radius: 6px; margin-bottom: 10px; }
.sp-summary .line.short { width: 55%; }

.welcome { text-align: center; display: grid; justify-items: center; gap: 12px; padding-top: 8px; }
.welcome img { width: 96px; height: 96px; }
.welcome h2 { padding: 0; margin: 8px 0 0; font-size: 36px; }
.welcome > p { color: var(--ink-2); max-width: 32ch; }
.welcome ul { list-style: none; padding: 0; margin: 10px 0 12px; display: grid; width: 100%; text-align: left; background: var(--card); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.welcome li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.welcome li + li { box-shadow: inset 0 1px 0 var(--line); }
.welcome li > svg { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--lime); color: var(--ink); }
.welcome li b { display: block; font-weight: 600; }
.welcome li span { font-size: 14px; color: var(--muted); line-height: 1.4; display: block; }

.confirm { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(14, 42, 47, .45); animation: fade .2s; }
.confirm-card { width: min(380px, 100%); background: var(--bg); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--lift); animation: pop .25s var(--ease-enter); }
.confirm-card h3 { font-size: 24px; margin-bottom: 8px; }
.confirm-card p { color: var(--ink-2); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.confirm-actions .btn { padding: 0 12px; }

/* ───────── AVVISI ───────── */
.toast { position: fixed; z-index: 95; left: 50%; bottom: calc(var(--tabbar-h) + 18px); transform: translate(-50%, 16px); display: flex; align-items: center; gap: 10px; max-width: calc(100% - 28px); padding: 12px 20px 12px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 500; font-size: 15px; line-height: 1.3; box-shadow: var(--float); opacity: 0; pointer-events: none; transition: opacity .2s, transform .3s var(--ease-enter); }
.toast svg { width: 18px; height: 18px; stroke-width: 2.4; color: var(--lime); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--coral); border-radius: var(--r-md); }
.toast.is-error svg { color: #fff; }

/* ───────── SCHERMATA DI AVVIO ───────── */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); transition: opacity .5s var(--ease), visibility .5s; }
.splash img { width: 88px; height: 88px; animation: enter .7s var(--ease-enter) both; }
.splash-word { font: 700 28px/1 var(--font-display); letter-spacing: -.02em; animation: enter .7s var(--ease-enter) both .12s; }
.splash.is-gone { opacity: 0; visibility: hidden; }

/* l'interfaccia entra una volta sola, dopo la schermata di avvio */
.topbar, .filters, .map-tools, .tabbar { opacity: 0; }
body.is-ready .topbar { animation: enter .6s var(--ease-enter) both; }
body.is-ready .filters { animation: enter .6s var(--ease-enter) both .08s; }
body.is-ready .tabbar { animation: fade .5s ease both .1s; }
body.is-ready .map-tools { opacity: 1; }

/* ───────── ANIMAZIONI ───────── */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ───────── SCHERMI PIÙ GRANDI ───────── */
@media (min-width: 560px) {
  .wordmark { display: flex; }
  .search { max-width: 440px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .modal { align-items: center; padding: 24px; }
  .modal-card { max-width: 560px; max-height: calc(100dvh - 48px); border-radius: var(--r-lg); padding: 30px 30px 32px; animation: pop .3s var(--ease-enter); }
  .sp-hero { margin: -30px -30px 0; width: calc(100% + 60px); }
}

@media (min-width: 960px) {
  :root { --panel-w: 440px; --tabbar-h: 0px; }
  .only-desktop { display: flex; }
  .topbar { left: 20px; right: auto; width: var(--panel-w); top: 18px; }
  .wordmark { display: none; }
  .search { max-width: none; }
  .filters { left: 20px; right: auto; width: auto; max-width: calc(100vw - 420px); top: 76px; padding: 0 0 4px; -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .sheet { left: 20px; right: auto; top: 128px; bottom: 20px; width: var(--panel-w); border-radius: var(--r-lg); transform: none !important; box-shadow: 0 0 0 1px var(--line), var(--float); }
  .sheet .sheet-body, .sheet:not([data-snap="full"]) .sheet-body { overflow-y: auto; padding: 22px 20px 28px; }
  .sheet-handle { display: none; }
  .sheet-head { cursor: default; }
  .group-tabs { margin: 0 -20px 14px; padding: 2px 20px; }
  .tabbar { left: auto; right: 20px; top: 18px; bottom: auto; width: auto; height: 50px; padding: 4px; gap: 2px; border-radius: 999px; border: 0; box-shadow: var(--float); }
  .tab { flex-direction: row; gap: 8px; font-size: 15px; padding: 0 18px 0 14px; border-radius: 999px; transition: background .2s var(--ease), color .2s; }
  .tab svg { width: 20px; height: 20px; padding: 0; background: none !important; }
  .tab:hover { background: var(--bg); }
  .tab.is-on { background: var(--lime); }
  .map-tools { bottom: 34px; right: 20px; }
  body:not([data-sheet="mini"]) .map-tools { opacity: 1; pointer-events: auto; transform: none; }
  .leaflet-bottom.leaflet-left { left: auto; right: 0; }
  .leaflet-control-attribution { margin: 0 !important; border-radius: 6px 0 0 0; }
  .view { bottom: 0; left: 0; right: auto; width: min(660px, 100%); box-shadow: 1px 0 0 var(--line), 24px 0 60px -20px rgba(14, 42, 47, .35); }
  .view-inner { padding: 44px 36px 60px; }
  .pick-banner { left: 50%; right: auto; transform: translateX(-50%); bottom: 34px; width: 520px; }
  .toast { bottom: 34px; }
  .offline { top: 80px; }
}
