:root {
  --bg: #f3f6f8;
  --bg-2: #e8eef2;
  --card: #ffffff;
  --ink: #10222e;
  --ink-2: #4a5d6a;
  --ink-3: #7d8f9b;
  --line: #dbe3e9;
  --brand: #0b2a3c;
  --brand-2: #0f4c5c;
  --accent: #e9a23b;
  --sea: #1b7fa8;
  --sea-soft: rgba(27, 127, 168, .14);
  --wind: #6a5acd;
  --pos: #1f9d6b;
  --neg: #d0533f;
  --s-ottimo: #12a06a;
  --s-buono: #6db33f;
  --s-discreto: #e2a72b;
  --s-scarso: #e07a34;
  --s-no: #cf4646;
  --shadow: 0 1px 2px rgba(16, 34, 46, .06), 0 4px 16px rgba(16, 34, 46, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1820; --bg-2: #10222d; --card: #132733; --ink: #e6eef3; --ink-2: #a9bcc8; --ink-3: #7590a0;
    --line: #22394a; --brand: #08151d; --brand-2: #0f3a48; --sea: #4cb3dc; --sea-soft: rgba(76, 179, 220, .16);
    --wind: #a497f3; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1820; --bg-2: #10222d; --card: #132733; --ink: #e6eef3; --ink-2: #a9bcc8; --ink-3: #7590a0;
  --line: #22394a; --brand: #08151d; --brand-2: #0f3a48; --sea: #4cb3dc; --sea-soft: rgba(76, 179, 220, .16);
  --wind: #a497f3; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sea); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { font-size: 28px; }
.brand h1 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.sub { margin: 0; font-size: 12.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.updated { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .9; text-align: right; }
.icon-btn { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; width: 32px; height: 32px; font-size: 17px; cursor: pointer; flex: none; }
.icon-btn:hover { background: rgba(255,255,255,.22); }
.icon-btn.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; opacity: .78; white-space: nowrap; }
.tabs a:hover { opacity: 1; background: rgba(255,255,255,.12); }

main section { padding-top: 18px; }
.section-title { font-size: 19px; font-weight: 800; margin: 26px 0 12px; letter-spacing: -.01em; }
.section-title small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.sub-title { font-size: 16px; margin: 22px 0 10px; }
.lead { color: var(--ink-2); margin: -4px 0 14px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card h3 { font-size: 15px; }
.hint { color: var(--ink-3); font-size: 12.5px; margin: 8px 0 0; }

/* Days & spots */
.days { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.day {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); font: inherit; min-width: 84px;
}
.day:hover { border-color: var(--sea); }
.day[aria-selected="true"] { border-color: var(--sea); background: var(--sea-soft); box-shadow: inset 0 0 0 1px var(--sea); }
.day .dn { font-size: 12px; font-weight: 700; text-transform: capitalize; }
.day .dd { font-size: 11px; color: var(--ink-3); }
.day .wx { font-size: 20px; line-height: 1.2; }
.day .ds { font-size: 12px; font-weight: 800; color: #fff; border-radius: 999px; padding: 1px 8px; }
.day .dt { font-size: 10.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.spots { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: thin; }
.chip {
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px; padding: 6px 12px;
  font: 600 13px/1.2 inherit; font-family: inherit; white-space: nowrap; cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: var(--sea); }
.chip[aria-selected="true"] { background: var(--sea); border-color: var(--sea); color: #fff; }
.chip small { font-weight: 500; opacity: .75; }

.error { background: #fde8e4; color: #8a2b1d; border-radius: 10px; padding: 12px 14px; margin-top: 12px; }
.skeleton { padding: 40px; text-align: center; color: var(--ink-3); }

/* Score colors */
.s-ottimo { --sc: var(--s-ottimo); } .s-buono { --sc: var(--s-buono); } .s-discreto { --sc: var(--s-discreto); }
.s-scarso { --sc: var(--s-scarso); } .s-no { --sc: var(--s-no); }
.bg-sc { background: var(--sc); }

/* Hero */
.hero {
  margin-top: 14px; border-radius: 18px; padding: 20px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #1d6f8c 0%, #0f4c5c 45%, #0b2a3c 100%);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; inset: auto -10% -40px -10%; height: 90px; opacity: .18;
  background: repeating-radial-gradient(circle at 50% 120%, #fff 0 2px, transparent 2px 16px);
}
.hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; position: relative; z-index: 1; }
.hero .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; font-weight: 700; }
.hero h2 { font-size: 26px; font-weight: 800; margin: 2px 0 4px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; opacity: .95; }
.hero .why { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.hero .why li::before { content: "✓ "; color: #8de0b5; font-weight: 800; }
.hero .alerts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; position: relative; z-index: 1; }
.badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.badge.warn { background: rgba(233, 90, 63, .3); border-color: rgba(255, 140, 120, .5); }
.badge.good { background: rgba(31, 157, 107, .3); border-color: rgba(120, 230, 180, .45); }
.hero .others { position: relative; z-index: 1; margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.hero .others span { opacity: .8; }

/* Ring */
.ring { --p: 50; --size: 92px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--sc) calc(var(--p) * 1%), rgba(127,127,127,.22) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--ring-bg, var(--card)); }
.ring b { position: relative; font-size: calc(var(--size) * .32); font-weight: 800; line-height: 1; }
.ring i { position: relative; display: block; font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sc); text-align: center; }
.hero .ring { --size: 112px; --ring-bg: #0d3a4b; }
.hero .ring i { color: #fff; opacity: .85; }

/* Technique cards */
.techs { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.tech { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.tech.disabled { opacity: .55; }
.tech-head { display: flex; gap: 12px; align-items: center; }
.tech-head .ring { --size: 66px; }
.tech-title { min-width: 0; flex: 1; }
.tech-title h3 { font-size: 17px; display: flex; align-items: center; gap: 6px; }
.tech-title .lbl { font-size: 12px; font-weight: 700; color: #fff; background: var(--sc); padding: 1px 8px; border-radius: 999px; }
.tech-title p { margin: 3px 0 0; font-size: 13px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13.5px; }
.facts dt { color: var(--ink-3); font-weight: 600; }
.facts dd { margin: 0; font-weight: 600; }
.strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.strip span { height: 18px; border-radius: 3px; background: var(--sc); position: relative; }
.strip span.past { opacity: .25; }
.strip span.win { outline: 2px solid var(--ink); outline-offset: -1px; }
.strip-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.why-list li { display: grid; grid-template-columns: 18px 1fr; gap: 4px; align-items: start; }
.why-list .pos::before { content: "▲"; color: var(--pos); font-size: 11px; line-height: 20px; }
.why-list .neg::before { content: "▼"; color: var(--neg); font-size: 11px; line-height: 20px; }
.why-list .cap::before { content: "⚠"; color: var(--neg); font-size: 13px; line-height: 20px; }
.species { display: flex; flex-wrap: wrap; gap: 5px; }
.species span { background: var(--bg-2); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
details.more { border-top: 1px dashed var(--line); padding-top: 8px; font-size: 13.5px; }
details.more summary { cursor: pointer; color: var(--sea); font-weight: 600; }
details.more p { margin: 6px 0; color: var(--ink-2); }
.spot-rank { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.spot-rank li { display: flex; justify-content: space-between; gap: 8px; }
.spot-rank b { color: var(--sc); }

/* Conditions */
.hour-picker { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.hour-picker label { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.hour-picker input { flex: 1; accent-color: var(--sea); }
.hour-picker output { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.tile .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; display: flex; justify-content: space-between; }
.tile .v { font-size: 22px; font-weight: 800; margin: 2px 0; display: flex; align-items: center; gap: 6px; }
.tile .v small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tile .d { font-size: 12.5px; color: var(--ink-2); }
.arrow { display: inline-block; font-size: 18px; color: var(--sea); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.pill.good { background: rgba(31,157,107,.15); color: var(--pos); }
.pill.bad { background: rgba(208,83,63,.15); color: var(--neg); }

.chart-scroll { overflow-x: auto; }
.chart { min-width: 720px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--ink-3); font-size: 11px; font-family: inherit; }
.chart .ttl { fill: var(--ink-2); font-weight: 700; font-size: 11.5px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .day-sel { fill: var(--sea-soft); }
.chart .now { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }
.chart .hover { stroke: var(--ink-3); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--brand); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, 0); top: 2px; box-shadow: var(--shadow); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

/* Astro */
.astro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.moon { display: flex; gap: 12px; align-items: center; }
.moon .em { font-size: 46px; line-height: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; }
.timeline { position: relative; height: 34px; border-radius: 8px; overflow: hidden; background: #1b2b4a; margin-top: 8px; }
.timeline .daylight { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, #f6b26b, #ffe9a8 20%, #ffe9a8 80%, #f6b26b); opacity: .9; }
.timeline .per { position: absolute; top: 6px; bottom: 6px; border-radius: 5px; }
.timeline .per.maggiore { background: rgba(18, 160, 106, .85); }
.timeline .per.minore { background: rgba(109, 179, 63, .7); top: 10px; bottom: 10px; }
.tl-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
.tl-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.tl-legend i { display: inline-block; width: 12px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* Windy */
.overlay-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.windy-when { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.windy-frame { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10; min-height: 360px; background: var(--bg-2); }
.windy-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Guide */
.guide { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.guide .card { margin: 0; }
.guide h3 { font-size: 17px; margin-bottom: 6px; }
.guide dl { margin: 8px 0 0; display: grid; gap: 8px; }
.guide dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--sea); font-weight: 800; }
.guide dd { margin: 0; font-size: 14px; color: var(--ink-2); }
.table-scroll { overflow-x: auto; }
.calendar { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 12.5px; }
.calendar th, .calendar td { padding: 4px 3px; text-align: center; border-bottom: 1px solid var(--line); }
.calendar th:first-child, .calendar td:first-child { text-align: left; white-space: nowrap; padding-right: 10px; }
.calendar td.on span { display: block; height: 12px; border-radius: 3px; background: var(--sea); opacity: .8; }
.calendar th.cur, .calendar td.cur { background: var(--sea-soft); }
.calendar tr.grp td { font-weight: 800; color: var(--ink); padding-top: 10px; border-bottom: 0; }
.method p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }
.method .scale { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.method .scale span { color: #fff; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--sc); }

/* Rules */
.rules { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
.rules ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.rules li b { display: block; }
.rules li span { color: var(--ink-2); font-size: 14px; }
.sizes { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sizes td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.sizes td:last-child { text-align: right; font-weight: 700; }

.foot { color: var(--ink-3); font-size: 12.5px; padding-top: 18px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 30px; }

@media (max-width: 720px) {
  .fold > summary.section-title small { display: none; }
  .updated span { display: none; }
  .hero { padding: 16px; }
  .hero-grid { grid-template-columns: 1fr; gap: 10px; }
  .hero .ring { --size: 92px; }
  .hero h2 { font-size: 22px; }
  .techs, .guide { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile .v { font-size: 19px; }
  .windy-frame { aspect-ratio: 3 / 4; }
}

/* Sezioni comprimibili */
.fold { margin-top: 0; }
.fold > summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: ""; width: 9px; height: 9px; margin-left: auto; flex: none;
  border-right: 2.5px solid var(--ink-3); border-bottom: 2.5px solid var(--ink-3);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.fold:not([open]) > summary::after { transform: rotate(-45deg); }
.fold > summary:hover::after { border-color: var(--sea); }
.fold > summary.section-title { padding: 6px 0; border-bottom: 1px solid var(--line); }
.fold:not([open]) > summary.section-title { margin-bottom: 0; }
.fold[open] > summary.section-title { margin-bottom: 14px; }
.fold.sub > summary.card-head { margin: -16px; padding: 16px; }
.fold.sub[open] > summary.card-head { margin-bottom: 4px; }
.fold.sub > summary h3 { margin-right: auto; }
.fold.sub > summary::after { margin-left: 12px; }
.fold-note { color: var(--ink-3); font-size: 12.5px; }
section#previsioni .fold > summary.section-title { margin-top: 20px; }
#hero { margin-top: 0; }

/* Programma della giornata */
.dayline-scroll { overflow-x: auto; margin-top: 6px; }
.dayline { --lab: 104px; position: relative; min-width: 820px; display: grid; gap: 3px; }
.dl-row { display: grid; grid-template-columns: var(--lab) repeat(24, 1fr); gap: 2px; align-items: stretch; }
.dl-lab {
  position: sticky; left: 0; z-index: 2; background: var(--card); font-size: 12px; font-weight: 700; color: var(--ink-2);
  display: flex; align-items: center; gap: 4px; padding-right: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dl-cell {
  min-height: 24px; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1.15; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; text-align: center;
}
.dl-cell:hover { outline: 2px solid var(--sea); outline-offset: -1px; }
.dl-cell.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.dl-hours .dl-cell { min-height: 16px; font-weight: 700; color: var(--ink-3); cursor: default; }
.dl-hours .dl-cell:hover { outline: 0; }
.dl-light .dl-cell { min-height: 8px; border-radius: 2px; cursor: default; }
.dl-light .notte { background: #1b2b4a; } .dl-light .alba, .dl-light .tramonto { background: #f2a65a; } .dl-light .giorno { background: #ffe39a; }
.dl-wx .dl-cell { font-size: 15px; min-height: 40px; }
.dl-wx small { font-size: 10.5px; color: var(--ink-2); font-weight: 600; }
.dl-wind .arrow { font-size: 13px; line-height: 1; }
.dl-wave .dl-cell { color: var(--ink); font-weight: 600; }
.dl-best .dl-seg {
  min-height: 46px; border-radius: 8px; color: #fff; padding: 4px 6px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 1px; background: var(--tc);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.dl-best .dl-seg b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-best .dl-seg span { font-size: 11px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-best .dl-seg.rest { background: repeating-linear-gradient(135deg, var(--bg-2) 0 6px, transparent 6px 12px); color: var(--ink-3); box-shadow: none; border: 1px dashed var(--line); }
.dl-best .dl-seg.short { align-items: center; padding: 4px 0; }
.dl-tech .dl-cell { min-height: 18px; background: var(--sc); opacity: var(--op, 1); }
.dl-tech .dl-cell.top { opacity: 1; box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--ink); }
.dl-sep { height: 4px; }
.dl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 3; pointer-events: none; border-radius: 2px; }
.dl-hours .dl-cell.now { background: var(--accent); color: #fff; }
.dayline-legend { margin-top: 8px; }
.dayline-legend i { width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; }

/* Dove andare: mappa degli spot */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .osm-tiles { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
}
:root[data-theme="dark"] .osm-tiles { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
.spotmap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.spot-map { height: 480px; border-radius: 10px; overflow: hidden; background: var(--bg-2); z-index: 0; }
.spot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow-y: auto; }
.spot-list li {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--card);
}
.spot-list li:hover, .spot-list li.sel { border-color: var(--sea); background: var(--sea-soft); }
.spot-list li.na { opacity: .45; }
.spot-list .rk { font-weight: 800; color: var(--ink-3); text-align: center; }
.spot-list .nm { min-width: 0; }
.spot-list .nm b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-list .nm span { font-size: 12px; color: var(--ink-2); }
.spot-list .sc { font-weight: 800; color: #fff; background: var(--sc); border-radius: 999px; padding: 2px 9px; font-size: 13px; }
.spot-list .na .sc { background: var(--ink-3); }

.pin-wrap { background: none; border: 0; }
.pin {
  --tc: var(--sea); position: relative; width: 44px; height: 44px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--tc); box-shadow: 0 2px 8px rgba(0,0,0,.35), inset 0 0 0 3px var(--sc, #fff); display: grid; place-items: center;
  transition: transform .15s;
}
.pin > div { transform: rotate(45deg); text-align: center; line-height: 1; color: #fff; }
.pin b { display: block; font-size: 14px; font-weight: 800; }
.pin span { font-size: 12px; }
.pin.sel { box-shadow: 0 0 0 4px var(--accent), 0 2px 10px rgba(0,0,0,.4), inset 0 0 0 3px var(--sc, #fff); }
.pin-wrap:hover .pin { transform: rotate(-45deg) scale(1.1); }
.pin.na { width: 22px; height: 22px; background: #8a99a4; box-shadow: 0 1px 4px rgba(0,0,0,.3); opacity: .8; }
.pin.na > div { display: none; }
.pin.top::after { content: "★"; position: absolute; top: -6px; right: -6px; transform: rotate(45deg); color: var(--accent); font-size: 16px; text-shadow: 0 0 2px #000; }

.leaflet-popup-content-wrapper { border-radius: 12px; background: var(--card); color: var(--ink); }
.leaflet-popup-tip { background: var(--card); }
.leaflet-popup-content { margin: 12px 14px; font: 13px/1.45 Inter, system-ui, sans-serif; min-width: 250px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-3); }
.pop h4 { margin: 0; font-size: 15px; }
.pop .types { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 8px; }
.pop .types span { font-size: 11px; font-weight: 700; background: var(--bg-2); color: var(--ink-2); padding: 1px 7px; border-radius: 999px; text-transform: capitalize; }
.pop .best { background: var(--bg-2); border-left: 4px solid var(--tc); border-radius: 8px; padding: 6px 9px; margin-bottom: 8px; }
.pop .best b { font-size: 14px; }
.pop .cond { color: var(--ink-2); font-size: 12px; }
.pop table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.pop td { padding: 3px 2px; border-bottom: 1px solid var(--line); }
.pop td.s { text-align: right; font-weight: 800; color: var(--sc); }
.pop td.w { color: var(--ink-3); font-size: 12px; text-align: right; white-space: nowrap; }
.pop tr.f td { background: var(--sea-soft); }
.pop p { margin: 0 0 8px; color: var(--ink-2); font-size: 12.5px; }
.pop .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pop .acts button, .pop .acts a {
  font: 600 12.5px/1 Inter, system-ui, sans-serif; padding: 7px 10px; border-radius: 8px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--sea); background: var(--sea); color: #fff;
}
.pop .acts a { background: transparent; color: var(--sea); }
.chip .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--tc); margin-right: 5px; vertical-align: 0; }

@media (max-width: 720px) {
  .spotmap { grid-template-columns: 1fr; }
  .spot-map { height: 380px; }
  .spot-list { max-height: none; }
}
