/* Brezza · Minusio — "Cartolina": sand paper, lake-blue ink, terracotta for the best window.
   Mobile first; light + dark (html[data-theme], set before the first paint from the system or the moon / sun button). */

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-d: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --paper: #F5EEE2; --paper-2: #EFE5D4; --card: #FFFBF4; --card-2: #F7EEDF; --line: #E5D7C0; --line-2: #D9C8AC;
  --ink: #12324F; --ink-2: #3B5269; --muted: #5C6672; --faint: #8C8478;
  --terra: #A8411F; --terra-mark: #E07A55; --terra-bg: #FBE3D6; --terra-band: rgba(224, 122, 85, .13);
  --warn-ink: #7A4800; --warn-bg: #FCE8BE; --warn-mark: #C98A12;
  --good-ink: #1D6B64; --good-bg: #DCF1EC;
  --nightcol: #ECE3D3;
  --shadow: 0 1px 0 rgba(120, 90, 50, .06), 0 10px 30px -18px rgba(90, 60, 25, .35);
  --focus: #2370B5;
  --cta-ink: #FFFFFF;
  --backdrop: rgba(18, 50, 79, .45);
  /* rating levels: mark (bars, rings), text, background — always together with their icon */
  --no-m: #BEB2A1; --no-t: #655949; --no-b: #EDE5D8;
  --ok-m: #3BA196; --ok-t: #1B6A62; --ok-b: #D9F0EB;
  --top-m: #2370B5; --top-t: #164C7E; --top-b: #DCE9F6;
  --strong-m: #E0A526; --strong-t: #7F5300; --strong-b: #F8E7BE;
  --danger-m: #D23C2C; --danger-t: #A0231A; --danger-b: #F9DAD4;
  --night-m: #D8CEBE; --night-t: #6B6256; --night-b: #EAE2D5;
  /* models (compare lines, "Dettagli e modelli"): hues that never appear in the rating scale */
  --m-ch1: #008300; --m-ch2: #D55181; --m-d2: #4A3AA7; --m-ecmwf: #1BAF7A;
  --src-ch1: #12324F; --src-ch1-ink: #FFFFFF;
  --src-ch2: #5C6672; --src-ch2-ink: #FFFFFF;
  --src-ecmwf: #BEB2A1; --src-ecmwf-ink: #12324F;
  --zone-mix: 18%;

  --radius: 22px;
  --radius-sm: 14px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0C1726; --paper-2: #101D30; --card: #14223A; --card-2: #1A2B46; --line: #26385A; --line-2: #33486D;
  --ink: #F4EBDC; --ink-2: #CDD5E0; --muted: #A5B1C0; --faint: #7D8A9C;
  --terra: #F7957A; --terra-mark: #F08A68; --terra-bg: #3E2621; --terra-band: rgba(240, 138, 104, .09);
  --warn-ink: #F8D27E; --warn-bg: #3A2D12; --warn-mark: #E7A93A;
  --good-ink: #8BE3D6; --good-bg: #123A3A;
  --nightcol: #18263C;
  --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 14px 34px -18px rgba(0, 0, 0, .7);
  --focus: #5AA8F0;
  --cta-ink: #2A140C;
  --backdrop: rgba(0, 0, 0, .6);
  --no-m: #6F6C6B; --no-t: #D3CCC2; --no-b: #2A3346;
  --ok-m: #45C0B1; --ok-t: #86E2D5; --ok-b: #133A3D;
  --top-m: #5AA8F0; --top-t: #A6D0FB; --top-b: #173556;
  --strong-m: #F0B53A; --strong-t: #F8D27E; --strong-b: #3D3015;
  --danger-m: #FF6656; --danger-t: #FFA196; --danger-b: #45201F;
  --night-m: #34445E; --night-t: #A5B1C0; --night-b: #1D2A40;
  --m-ch1: #3DBB3D; --m-ch2: #E87BA4; --m-d2: #9085E9; --m-ecmwf: #1BAF7A;
  --src-ch1: #F4EBDC; --src-ch1-ink: #0C1726;
  --src-ch2: #A5B1C0; --src-ch2-ink: #0C1726;
  --src-ecmwf: #33486D; --src-ecmwf-ink: #F4EBDC;
  --zone-mix: 24%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.4; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image: radial-gradient(1200px 500px at 85% -120px, rgba(255, 200, 140, .30), transparent 70%), radial-gradient(900px 600px at -10% 0, rgba(140, 190, 220, .18), transparent 60%);
  background-repeat: no-repeat;
}
:root[data-theme="dark"] body {
  background-image: radial-gradient(1000px 500px at 85% -120px, rgba(90, 140, 220, .16), transparent 70%), radial-gradient(800px 500px at -10% 0, rgba(240, 138, 104, .07), transparent 60%);
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
svg { overflow: visible; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sc { font-variant: all-small-caps; letter-spacing: .07em; font-weight: 700; }
svg.i { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }

.wrap { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 12px; }
@media (min-width: 600px) { .wrap { padding: 0 24px; } }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 10px;
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- header ---------- */
.site-header { padding: 8px 0 0; }
.header-inner { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; gap: 10px; align-items: center; flex: 1 1 auto; min-width: 0; }
.logo { width: 40px; height: 40px; flex: none; }
.logo-bg { fill: var(--ink); }
.logo-ring { stroke: var(--paper); opacity: .7; }
.logo-wave { stroke: var(--terra-mark); }
.logo-letter { fill: var(--paper); }
.brand-text { min-width: 0; }
.brand h1 { font-family: var(--font-d); font-size: 1.1875rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.brand h1 .dot { color: var(--terra); }
.updated { font-size: .8125rem; color: var(--muted); margin-top: 1px; }
.header-actions { display: flex; gap: 6px; flex: none; }
.icon-btn {
  border: 0; background: transparent; width: 44px; height: 44px; border-radius: 999px; cursor: pointer;
  display: inline-grid; place-items: center; color: var(--ink); flex: none;
}
.icon-btn.round { border: 1px solid var(--line); background: var(--card); }
.icon-btn:hover { background: var(--card-2); }
.icon-btn svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
#theme-toggle .i-sun, :root[data-theme="dark"] #theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] #theme-toggle .i-sun { display: block; }
.notif-link.on { color: var(--terra); border-color: var(--terra-mark); }
.notif-link.on svg { fill: currentColor; fill-opacity: .2; }
.runs { font-size: .8125rem; color: var(--ink-2); margin-bottom: 10px; }

/* compact: on a phone it sits above the first screen (hero + today's chart) */
.banner {
  margin: 8px 0 0; padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--warn-bg); color: var(--warn-ink); border: 1px solid color-mix(in srgb, var(--warn-mark) 45%, transparent);
  font-size: .8125rem; line-height: 1.35; font-weight: 600; display: flex; gap: 8px; align-items: flex-start;
}
.banner .ico { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.banner.offline { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.banner.updating { background: var(--card-2); color: var(--ink-2); border-color: var(--line); font-weight: 500; }

/* ---------- thresholds band (between "Cosa fare" and the detail sections) ---------- */
.controls { margin-top: 28px; }
.controls-inner {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px;
  border-top: 1.5px dashed var(--line-2); border-bottom: 1.5px dashed var(--line-2);
}
.controls-text { font-size: .875rem; color: var(--ink-2); min-width: 0; font-weight: 600; }
@media (max-width: 389px) { .controls-inner .btn { padding: 8px 12px; } }
@media (max-width: 339px) { .controls-inner .btn-sub { display: none; } }

.segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.segmented button {
  border: 0; background: transparent; padding: 0 16px; border-radius: 999px; font-weight: 650; font-size: .9375rem;
  cursor: pointer; color: var(--ink-2); min-height: 42px; white-space: nowrap; transition: background-color .15s, color .15s;
}
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .3); }
.segmented button:not([aria-pressed="true"]):hover { background: var(--card-2); color: var(--ink); }
.segmented-sm button { padding: 0 13px; font-size: .875rem; min-height: 40px; }
.segmented button[aria-busy="true"] { cursor: progress; opacity: .75; } /* switched, data still loading */

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink);
  padding: 0 16px; border-radius: 999px; font-weight: 650; font-size: .9375rem; cursor: pointer; min-height: 42px; white-space: nowrap;
}
.btn:hover { background: var(--card-2); }
.btn-quiet { background: transparent; }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink); opacity: .9; }
.btn-cta { background: var(--terra); color: var(--cta-ink); border-color: var(--terra); min-height: 46px; padding: 0 20px; font-weight: 750; }
.btn-cta:hover { background: var(--terra); opacity: .92; }
.btn-ghost { background: transparent; min-height: 40px; }
.btn-sub { font-weight: 500; color: var(--ink-2); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.btn-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-sm-solid { min-height: 40px; padding: 0 14px; font-size: .875rem; }
.btn:disabled { opacity: .6; cursor: progress; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- sections ---------- */
main { padding-bottom: 24px; transition: opacity .2s; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.section-head h2 { font-family: var(--font-d); font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; }
.section-sub { color: var(--muted); font-size: .875rem; margin-bottom: 12px; max-width: 70ch; }
.section-meta { color: var(--muted); font-size: .8125rem; }
[data-refresh].is-refreshing { opacity: .55; transition: opacity .2s; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card:focus { outline: none; }

.error-box {
  margin-top: 20px; padding: 18px; border-radius: var(--radius);
  background: var(--danger-b); color: var(--danger-t); border: 1px solid color-mix(in srgb, var(--danger-m) 40%, transparent);
  display: grid; gap: 8px; justify-items: start;
}
.error-title { font-weight: 750; }
.error-detail { font-size: .875rem; }
.inline-error {
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid color-mix(in srgb, var(--warn-mark) 45%, transparent); font-size: .875rem; font-weight: 600; margin-bottom: 12px;
}

/* ---------- "Cosa fare" ---------- */
.section-first { margin-top: 6px; }
.cosa-head { flex-wrap: wrap; row-gap: 8px; margin-bottom: 8px; }
.cosa-head h2 { white-space: nowrap; font-size: 1.5rem; }
/* phone: hero, the week, the big chart one under the other; desktop: hero + week on the left, the big chart right */
.cosa-top { display: grid; gap: 10px; }
.cosa-side { display: grid; gap: 10px; align-content: start; }
.cosa-top > *, .cosa-side > *, .grid-next > *, .grid-trend > * { min-width: 0; }
@media (min-width: 980px) {
  .cosa-top { grid-template-columns: minmax(360px, 430px) minmax(0, 1fr); align-items: start; gap: 20px; }
  .cosa-side { gap: 14px; }
}
/* ?day=… from a notification, or a day picked in the week: the day is scrolled into view and briefly ringed */
.flash-ring { animation: ring 3s ease-out; }
@keyframes ring { 0%, 55% { box-shadow: 0 0 0 3px var(--focus); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* level colours: mark / text / background, used by bars, rings, pills */
.lv-no { --lvm: var(--no-m); --lvt: var(--no-t); --lvb: var(--no-b); }
.lv-ok { --lvm: var(--ok-m); --lvt: var(--ok-t); --lvb: var(--ok-b); }
.lv-top { --lvm: var(--top-m); --lvt: var(--top-t); --lvb: var(--top-b); }
.lv-strong { --lvm: var(--strong-m); --lvt: var(--strong-t); --lvb: var(--strong-b); }
.lv-danger { --lvm: var(--danger-m); --lvt: var(--danger-t); --lvb: var(--danger-b); }
.lv-night, .lv-na { --lvm: var(--night-m); --lvt: var(--night-t); --lvb: var(--night-b); }
[class*="lv-"] { --fill: var(--lvm); }

/* round level icon (– ✓ ✓✓ ! ⚠) */
.lvic {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--lvb); color: var(--lvt); border: 1.5px solid var(--lvm);
}
.lvic svg { width: 15px; height: 15px; }
.lvic.md { width: 28px; height: 28px; }
.lvic.md svg { width: 17px; height: 17px; }
.lvic.sm { width: 22px; height: 22px; }
.lvic.sm svg { width: 13px; height: 13px; }
/* level pill ("✓✓ Perfetto") */
.lvpill {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 8px 1px 5px; font-size: .78125rem;
  font-weight: 700; background: var(--lvb); color: var(--lvt); white-space: nowrap; vertical-align: 1px; line-height: 1.5;
}
.lvpill svg { width: 15px; height: 15px; }
.lvpill.big { font-size: .875rem; padding: 3px 12px 3px 7px; gap: 5px; border: 1.5px solid var(--lvm); }
.lvpill.big svg { width: 17px; height: 17px; }
/* a short spell (isolated good hours, no window): the hour's level, dashed and paler — informational, not a verdict */
.lvpill.soft { border: 1.5px dashed var(--lvm); background: color-mix(in srgb, var(--lvb) 55%, transparent); }
.lvic.soft, .wd .ic.soft, .vs .lvd.soft { border-style: dashed; background: color-mix(in srgb, var(--lvb) 55%, var(--card)); }

/* ---------- hero: the postcard ---------- */
.hero {
  overflow: hidden; position: relative;
  --stampedge: #FFFBF4; --s1: #FBD7BF; --s2: #F8E6D2; --s3: #E4EEF0; --hink: #12324F; --hmuted: #3B5269;
  --sc-far: rgba(18, 50, 79, .13); --sc-near: rgba(18, 50, 79, .24); --sc-lake: rgba(35, 112, 181, .20); --sc-wave: rgba(255, 255, 255, .85);
  --sc-figure: #12324F; --sc-hull: #3B5269; --sc-sail: #FFFBF4; --sc-cloud: rgba(70, 85, 105, .28);
  /* sun (core + glow) by phase; the moon and the stars only at night */
  --sun-core: #FFF6D0; --sun-glow: #FFE38A; --glow-op: .75; --moon: #F4EBDC;
}
.hero.ph-alba { --s1: #F9CDB3; --s2: #F8E3CF; --s3: #E2EDF0; --sun-core: #FFE2B0; --sun-glow: #FFC98A; }
.hero.ph-giorno { --s1: #A9D8F0; --s2: #D3ECF5; --s3: #F5F1E5; }
.hero.ph-tramonto { --s1: #F4A98E; --s2: #F8CDA9; --s3: #F8E7D2; --hmuted: #12324F; --sun-core: #FFD3A6; --sun-glow: #FF9E73; }
.hero.ph-giorno.c-calm { --s1: #C9E2EE; --s2: #E3EEF0; --s3: #F4EFE4; }
.hero.ph-alba.c-calm { --s1: #F4D6C4; --s2: #F3E6D7; --s3: #E7EDEC; }
.hero.c-storm { --s1: #9EAAB9; --s2: #C3C9CF; --s3: #E2DCD1; --hmuted: #12324F; }
/* night (both themes) and the whole dark theme: light ink on a dark sky */
.hero.ph-notte, :root[data-theme="dark"] .hero {
  --stampedge: #F4EBDC; --hink: #F4EBDC; --hmuted: #D5DCE6;
  --sc-far: rgba(170, 190, 225, .16); --sc-near: rgba(8, 16, 32, .55); --sc-lake: rgba(90, 140, 200, .22); --sc-wave: rgba(244, 235, 220, .45);
  --sc-figure: #F4EBDC; --sc-hull: #CBD3E0; --sc-sail: rgba(244, 235, 220, .8); --sc-cloud: rgba(120, 135, 160, .5);
}
.hero.ph-notte { --s1: #16264A; --s2: #24375E; --s3: #3A4B72; }
/* dark theme: the sky still follows the time of day (dawn, day, sunset, night, storm), just muted; text >= 4.5:1 */
:root[data-theme="dark"] .hero { --s1: #2C5A82; --s2: #31608A; --s3: #284B6D; --sun-core: #FFE7A3; --sun-glow: #FFD36B; --glow-op: .55; }
:root[data-theme="dark"] .hero.ph-giorno.c-calm { --s1: #2E5370; --s2: #365C78; --s3: #2A4560; }
:root[data-theme="dark"] .hero.ph-alba { --s1: #5A3F5C; --s2: #6A4A5C; --s3: #2F4566; --sun-core: #FFD9A8; --sun-glow: #FFB27A; }
:root[data-theme="dark"] .hero.ph-tramonto { --s1: #6B3445; --s2: #7A4540; --s3: #33304F; --sun-core: #FFC796; --sun-glow: #FF8E66; }
:root[data-theme="dark"] .hero.ph-notte { --s1: #0B1631; --s2: #13234A; --s3: #1B2D55; }
:root[data-theme="dark"] .hero.c-storm { --s1: #2B3342; --s2: #353D4C; --s3: #1D2638; }

.sky { position: relative; padding: 12px 14px 38px; background: linear-gradient(170deg, var(--s1) 0%, var(--s2) 55%, var(--s3) 100%); color: var(--hink); }
.scene { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62px; pointer-events: none; }
.sc-far { fill: var(--sc-far); }
.sc-near { fill: var(--sc-near); }
.sc-lake { fill: var(--sc-lake); }
.sc-wave { stroke: var(--sc-wave); stroke-width: 1.3; fill: none; }
.sc-sun { fill: var(--sun-core); }
.sc-glow-stop { stop-color: var(--sun-glow); }
.sc-glow-stop.s0 { stop-opacity: var(--glow-op); }
.sc-glow-stop.s1 { stop-opacity: 0; }
.sc-moon { fill: var(--moon); }
.sc-moon-cut { fill: var(--s2); }
.sc-star { fill: var(--moon); opacity: .7; }
.sc-cloud { fill: var(--sc-cloud); }
.sc-rider { stroke: var(--sc-figure); fill: none; }
.sc-rider .sc-head { fill: var(--sc-figure); stroke: none; }
.sc-wing { fill: var(--terra-mark); stroke: none; }
.sc-boat { opacity: .85; }
.sc-hull { fill: var(--sc-hull); }
.sc-sail { fill: var(--sc-sail); stroke: var(--sc-hull); }

.hblock { position: relative; z-index: 2; }
.hblock.with-stamp { padding-right: 118px; min-height: 112px; }
.eyebrow { font-size: .8125rem; color: var(--hmuted); margin-bottom: 6px; }
.eyebrow strong { color: var(--hink); font-weight: 750; }
.headline {
  font-family: var(--font-d); font-weight: 850; font-size: clamp(32px, 10.2vw, 42px); line-height: 1.02; letter-spacing: -.035em;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.headline.long { font-size: clamp(27px, 8.2vw, 33px); line-height: 1.05; }
.lvline { margin-top: 7px; }
.hero .lvpill.big { background: color-mix(in srgb, var(--lvb) 88%, transparent); }
.hero .lvpill.big.soft { background: color-mix(in srgb, var(--lvb) 62%, transparent); }
.windline {
  position: relative; z-index: 2; margin: 8px 0 0; font-size: .90625rem; color: var(--hink); padding-right: 30px; /* clear of the sun / moon */
  display: flex; gap: 2px 5px; align-items: center; flex-wrap: wrap;
}
.windline svg { width: 19px; height: 19px; }
.windline .b { font-weight: 800; }
.windline .dot { color: var(--hmuted); }
.gstamp {
  position: absolute; top: 10px; right: 10px; width: 114px; padding: 5px; transform: rotate(3deg); z-index: 3;
  background: radial-gradient(circle at 50% 50%, transparent 2.6px, var(--stampedge) 3px) -4.5px -4.5px / 9px 9px;
  filter: drop-shadow(0 4px 7px rgba(40, 30, 10, .22));
}
.gstamp-in { background: var(--card); border: 1.5px solid var(--line-2); padding: 4px 2px 2px; }
.gstamp svg { display: block; width: 100%; height: auto; overflow: visible; }
.gz-track { stroke-opacity: .26; }
.gz-lab { fill: var(--muted); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; font-family: var(--font); }
.gz-gust { stroke: var(--terra-mark); }
.gz-needle { stroke: var(--ink); }
.gz-hub { fill: var(--ink); }
.gz-dot { fill: var(--terra-mark); }
.gz-num { fill: var(--ink); font-family: var(--font-d); font-size: 29px; font-weight: 850; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.gz-unit { fill: var(--ink-2); font-family: var(--font); font-size: 10.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.gz-when { fill: var(--terra); font-family: var(--font); font-size: 9.6px; font-weight: 800; letter-spacing: 1.1px; }

.hero-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.row { display: flex; align-items: flex-start; gap: 8px; font-size: .875rem; color: var(--ink-2); line-height: 1.4; }
.row > svg.i { width: 19px; height: 19px; margin-top: 0; color: var(--terra); }
.row strong { color: var(--ink); }
.row .small { color: var(--muted); }
.row .old, .station-age .old {
  font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); border-radius: 999px; padding: 1px 8px; font-size: .75rem; margin-left: 6px; white-space: nowrap;
}
.livedot { width: 19px; height: 19px; flex: none; display: grid; place-items: center; }
.livedot i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok-m); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok-m) 25%, transparent); }
.livedot.off i { background: var(--no-m); box-shadow: 0 0 0 4px color-mix(in srgb, var(--no-m) 25%, transparent); }
.hero .dp-live { font-size: .8125rem; } /* one line on a 390 px phone */
.dp-live .arrow { width: 13px; height: 13px; color: var(--ink); vertical-align: -2px; margin: 0 0 0 3px; }
.facts-now { display: grid; gap: 6px; padding-top: 8px; border-top: 1.5px dashed var(--line-2); }
.hero-water > svg.i { color: var(--top-m); }
.next-line { display: flex; gap: 8px; align-items: flex-start; font-size: .9375rem; color: var(--ink); }
.next-line .d2 { display: block; font-size: .8125rem; color: var(--ink-2); }
.next-line .off-mini { margin-left: 6px; }

/* chips: offshore, rating notes, danger hours */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px 4px 7px;
  font-size: .78125rem; font-weight: 600; line-height: 1.25; max-width: 100%;
}
.chip svg.i { width: 15px; height: 15px; }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.warn.soft { font-weight: 500; }
.chip.good { background: var(--good-bg); color: var(--good-ink); }
.chip.info { background: var(--top-b); color: var(--top-t); }
.chip.danger { background: var(--danger-b); color: var(--danger-t); font-weight: 700; }
.chip .why { font-weight: 500; }
.chips.sm .chip { font-size: .71875rem; padding: 2px 8px 2px 5px; }
.off-mini {
  display: inline-flex; align-items: center; gap: 3px; padding: 0 7px 0 5px; border-radius: 999px; white-space: nowrap; margin-left: 4px;
  background: var(--warn-bg); color: var(--warn-ink); font-size: .71875rem; font-weight: 700; vertical-align: 1px;
}
.off-mini svg.i { width: 12px; height: 12px; }
/* the hero on a narrow phone: "Pericolo 10–11 · offshore" on one line, "con raffiche da 20 kn" for screen readers */
@media (max-width: 379px) {
  .hero .chip .dn-long { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}

/* lake water + wetsuit: "🌡 Acqua 21° [misurata] · aria 19° → [4/3]" (a button: tap for the details); the hero's is the
   dashed "ticket" */
.dp-wet { display: grid; gap: 4px; width: 100%; }
.wet {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; width: 100%; min-height: 44px; margin: 0; padding: 5px 7px 5px 8px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--card-2);
  font-size: .8125rem; color: var(--ink-2); text-align: left; cursor: pointer;
}
.wet:hover, .wet[aria-expanded="true"] { border-color: var(--ink-2); }
.wet-ico { width: 22px; display: grid; place-items: center; flex: none; color: var(--terra); }
.wet-ico svg { width: 21px; height: 21px; }
.wet-tx { flex: 1 1 150px; min-width: 0; letter-spacing: -.005em; }
.wet-tx strong { color: var(--ink); font-weight: 750; }
.wet-when { color: var(--ink); font-weight: 700; }
.wet-air { white-space: nowrap; }
.wet-to { margin-left: 2px; }
.wet.big { font-size: .875rem; min-height: 48px; padding: 6px 7px 6px 8px; }
.wkind {
  display: inline-block; font-size: .65625rem; font-weight: 700; border-radius: 999px; padding: 0 6px; line-height: 1.45;
  border: 1.3px solid currentColor; color: var(--muted); vertical-align: 1px; white-space: nowrap;
}
.wkind.k-misurata { color: var(--good-ink); }
.wkind.k-tipica, .wkind.k-modellata, .wkind.k-stimata { border-style: dashed; }
.suit {
  display: inline-flex; align-items: center; gap: 5px; background: var(--ink); color: var(--paper); border-radius: 11px;
  padding: 5px 10px 5px 7px; font-weight: 800; font-size: .9375rem; flex: none; margin-left: auto; line-height: 1.2;
}
.wet.big .suit { font-size: 1rem; }
.suit.long { flex: 0 1 auto; font-size: .8125rem !important; }
.suit-i { width: 15px; height: 19px; flex: none; }
.suit-zip { stroke: var(--terra-mark); }
.suit.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1.5px solid var(--warn-mark); }
.suit svg.i { width: 16px; height: 16px; }
.dp-wet.warn .wet { background: var(--warn-bg); border-color: var(--warn-mark); color: var(--warn-ink); }
.dp-wet.warn .wet-ico { color: var(--warn-ink); }
.wet-note { font-size: .8125rem; color: var(--ink-2); padding: 0 4px; }
.dp-wet.warn .wet-note { color: var(--ink); font-weight: 600; }
.wet-river {
  display: flex; gap: 6px; align-items: flex-start; font-size: .8125rem; font-weight: 600; color: var(--warn-ink);
  background: var(--warn-bg); border-radius: 10px; padding: 5px 9px;
}
.wet-river svg.i, .water-river svg.i { width: 16px; height: 16px; margin-top: 1px; }

/* ---------- "La settimana" ---------- */
.week { padding: 12px 8px 8px; --maxb: 54px; }
.wk-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px; }
.wk-top .sc { color: var(--terra); font-size: .9375rem; }
.wk-top .hint { font-size: .75rem; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.wk-top .hint i { display: inline-block; width: 16px; border-top: 2px dashed var(--line-2); }
.wk-sum { margin: 4px 4px 0; font-size: .875rem; color: var(--ink-2); line-height: 1.35; }
.wk-sum b { font-family: var(--font-d); font-size: 1.0625rem; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.wk-sum .best { white-space: nowrap; }
.wk-sum .best strong { color: var(--ink); }
.wk-chips { margin: 6px 4px 0; }
.wkrow { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 3px; margin-top: 8px; }
.wd {
  border: 1.5px solid transparent; background: transparent; border-radius: 14px; padding: 6px 0 4px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; cursor: pointer; min-width: 0; position: relative; color: var(--ink);
}
.wd .d { font-size: .8125rem; font-weight: 750; color: var(--ink); }
.wd .lol { position: relative; width: 100%; height: calc(var(--maxb) + 28px); border-bottom: 1.5px solid var(--line-2); margin-top: 1px; }
.wd .gx { position: absolute; left: 50%; width: 16px; margin-left: -8px; bottom: 0; height: calc(var(--gh) * var(--maxb)); background: var(--lvm); opacity: .3; border-radius: 3px 3px 0 0; }
.wd .bar {
  position: absolute; left: 50%; width: 16px; margin-left: -8px; bottom: 0; height: max(2px, calc(var(--bh) * var(--maxb)));
  border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, var(--lvm), color-mix(in srgb, var(--lvm) 55%, transparent));
}
.wd .cap { position: absolute; left: 50%; width: 20px; margin-left: -10px; height: 2px; border-radius: 2px; background: var(--lvt); bottom: calc(var(--gh) * var(--maxb) - 1px); }
.wd .ic {
  position: absolute; left: 50%; margin-left: -12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lvb); color: var(--lvt); border: 1.5px solid var(--lvm); bottom: calc(var(--gh) * var(--maxb) + 4px);
}
.wd .ic svg { width: 14px; height: 14px; }
.wd .v { font-size: .78125rem; font-weight: 750; color: var(--ink); white-space: nowrap; margin-top: 2px; }
.wd .v.no { font-weight: 500; color: var(--ink-2); }
.wd .v.w { font-size: .6875rem; letter-spacing: -.02em; }
.wd.trend .lol { border-bottom-style: dashed; }
.wd.trend .bar { background: repeating-linear-gradient(180deg, var(--lvm) 0 3px, color-mix(in srgb, var(--lvm) 45%, transparent) 3px 5px); opacity: .8; }
.wd.trend .gx { opacity: .18; }
.wd.trend .ic { border-style: dashed; }
.wd.sep::before { content: ""; position: absolute; left: -3px; top: 8px; bottom: 8px; border-left: 1.5px dashed var(--line-2); }
.wd.past { opacity: .7; }
.wd:hover { background: var(--card-2); }
.wd[aria-pressed="true"] { background: var(--card-2); border-color: var(--ink); }
@media (min-width: 980px) { .week { padding: 14px 12px 10px; --maxb: 70px; } }

/* ---------- day cards: the big one (chart of the chosen day), medium (next days), small (trend) ---------- */
.day-card { padding: 12px 12px 12px; }
.dc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; padding: 0 4px; }
.dc-head > * { min-width: 0; }
.dc-head h3 { font-family: var(--font-d); font-size: 1.0625rem; font-weight: 800; letter-spacing: -.015em; }
.dc-head h4 { font-family: var(--font-d); font-size: 1.0625rem; font-weight: 800; letter-spacing: -.01em; }
.dc-date { color: var(--muted); font-weight: 500; font-size: .8125rem; font-family: var(--font); letter-spacing: 0; }
.dc-head .where { display: flex; align-items: center; gap: 3px; font-size: .8125rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.dc-head .where svg.i { width: 14px; height: 14px; color: var(--terra); }
.focus .dchart { margin-top: 4px; }
.focus > .chips { margin: 8px 4px 0; }
.rel {
  display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px; white-space: nowrap; background: var(--card);
}
.rel svg.i { width: 14px; height: 14px; }
.dverdict { display: flex; gap: 8px; align-items: flex-start; margin: 8px 4px 2px; font-size: .9375rem; line-height: 1.3; color: var(--ink); }
.dverdict strong { font-weight: 750; }
.dverdict .d2 { display: block; margin-top: 1px; font-weight: 400; color: var(--muted); font-size: .8125rem; }
.day-card > .chips { margin: 6px 4px 0; }
.dchart { position: relative; margin-top: 8px; touch-action: manipulation; }
.dchart svg { display: block; width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; }
.dfoot { margin: 8px 4px 0; display: grid; gap: 6px; justify-items: stretch; font-size: .8125rem; color: var(--ink-2); }
.dfoot .row { font-size: .8125rem; }
.dfoot .row > svg.i { width: 16px; height: 16px; }
.day-card.size-S { padding: 11px 9px 10px; }
.size-S .dc-head { padding: 0 2px; }
.size-S .dc-head h4 { font-size: .90625rem; }
.size-S .dverdict { font-size: .8125rem; margin: 6px 2px 2px; gap: 6px; }
.size-S .dverdict .d2 { font-size: .75rem; }
.size-S > .chips { margin: 5px 2px 0; }
.size-S .dfoot { margin: 6px 2px 0; gap: 4px; }
.size-S .dfoot .row { font-size: .75rem; gap: 5px; }
.size-S .dfoot .row > svg.i { width: 14px; height: 14px; }
.tr-wet.warn { color: var(--warn-ink); font-weight: 700; }
.tr-wet.warn > svg.i { color: var(--warn-mark); }
.sub-head { margin: 30px 2px 10px; }
.sub-head h3 { font-family: var(--font-d); font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; }
.sub-head h3 span { font-weight: 500; color: var(--muted); font-size: .9375rem; letter-spacing: 0; }
.sub-head p { color: var(--muted); font-size: .84375rem; margin-top: 2px; }
.grid-next { display: grid; gap: 12px; }
.grid-trend { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid-next { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .grid-trend { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 339px) { .grid-trend { grid-template-columns: minmax(0, 1fr); } }

/* under the big chart: the day's reliability, then the key */
.chart-swrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 4px 0; font-size: .8125rem; color: var(--ink-2); }
.clegend { margin: 12px 4px 0; display: grid; gap: 12px; font-size: .78125rem; color: var(--ink-2); }
.crow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.crow li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg-sw { display: inline-block; flex: none; }
.lg-sw.mean { width: 10px; height: 14px; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, var(--top-m), color-mix(in srgb, var(--top-m) 55%, transparent)); }
.lg-sw.gust { width: 10px; height: 14px; background: color-mix(in srgb, var(--top-m) 28%, transparent); border-top: 2px solid var(--top-t); }
.lg-sw.gustcap { width: 10px; height: 14px; background: color-mix(in srgb, var(--ok-m) 28%, transparent); border-top: 3px solid var(--strong-m); }
.lg-sw.hatch { width: 14px; height: 14px; border-radius: 3px; background: repeating-linear-gradient(45deg, var(--warn-mark) 0 1.4px, var(--warn-bg) 1.4px 5px); }
.lg-sw.night { width: 14px; height: 14px; border-radius: 3px; background: var(--nightcol); border: 1px solid var(--line-2); }
.lg-sw.win { width: 18px; height: 8px; border: 2px solid var(--terra-mark); border-bottom: 0; }
.scale { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1.1fr 1.2fr 1.4fr 1fr 1.1fr; gap: 4px; }
.scale li { text-align: center; font-size: .6875rem; color: var(--ink-2); line-height: 1.25; min-width: 0; }
.scale li i { display: block; height: 7px; border-radius: 5px; background: var(--lvm); margin-bottom: 5px; }
.scale li b { display: flex; align-items: center; justify-content: center; gap: 2px; color: var(--lvt); font-size: .71875rem; line-height: 1.15; }
.scale li b svg.i { width: 13px; height: 13px; }
.ccap { font-size: .75rem; color: var(--muted); line-height: 1.45; }
.ccap svg.bolt { vertical-align: -1px; color: var(--ink-2); }
@media (max-width: 559px) { .scale li b { font-size: .65625rem; letter-spacing: -.02em; } .scale li b svg.i { display: none; } }

/* ---------- the day charts (SVG) ---------- */
.dsvg text { font-family: var(--font); }
.g-night { fill: var(--nightcol); }
.g-hatch-bg { fill: var(--warn-bg); opacity: .75; }
.g-hatch { stroke: var(--warn-mark); stroke-width: 1.6; opacity: .55; }
.g-stripe { stroke: var(--card); stroke-width: 1.3; stroke-opacity: .55; }
.g-win { fill: var(--terra-band); }
.g-axis { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.g-thr { stroke-width: 1; stroke-dasharray: 5 4; opacity: .9; shape-rendering: crispEdges; }
.g-thr.t-marginal { stroke: var(--ok-m); stroke-dasharray: 2 3; opacity: .7; }
.g-thr.t-min { stroke: var(--ok-m); }
.g-thr.t-perfect { stroke: var(--top-m); stroke-width: 1.4; }
.g-thr.t-strong { stroke: var(--strong-m); }
.g-thr.t-max { stroke: var(--danger-m); }
.g-tick { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.g-x { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.g-thrlab { fill: var(--ink-2); font-size: 11px; paint-order: stroke; stroke: var(--card); stroke-width: 3.5px; stroke-linejoin: round; }
.g-thrlab.sm { font-size: 10px; }
.g-bar .b-gust { fill: var(--lvm); opacity: .28; }
.g-bar.lv-night .b-gust { opacity: .45; }
.g-bar .b-cap { stroke: var(--lvt); stroke-width: 2; stroke-linecap: round; }
.g-bar.lv-night .b-cap { stroke: var(--night-m); }
.g-bar.gusty .b-cap { stroke: var(--strong-m); stroke-width: 3; } /* irregular gusts: at most "Sufficiente" */
.g-bar.past { opacity: .38; }
.g-storm { fill: var(--ink); }
.g-now { stroke: var(--ink); stroke-width: 1.6; }
.g-nowpill { fill: var(--ink); }
.g-nowlab { fill: var(--card); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-bracket { fill: none; stroke: var(--terra-mark); stroke-width: 2; stroke-linejoin: round; }
.g-blabel { fill: var(--terra); font-size: 12px; font-weight: 800; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.g-blabel.md { font-size: 11px; }
.g-blabel.sm { font-size: 10px; font-weight: 750; }
.g-peak { fill: var(--ink); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--card); stroke-width: 3px; }
.g-arrow { fill: var(--ink-2); }
.g-arrow.off { fill: var(--warn-mark); }
.g-arrow.m { fill: var(--faint); opacity: .7; }
.g-mean { fill: var(--ink); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.g-mean.ride { font-weight: 800; }
.g-gust { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.g-mean.m, .g-gust.m { fill: var(--muted); font-weight: 400; }
.g-rowlab { fill: var(--muted); font-size: 9.5px; }
.dsvg .hit { fill: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dsvg .hit:hover, .dsvg .hit.on { fill: var(--ink); fill-opacity: .06; }
.dsvg .hit:focus { outline: none; }
.dsvg .hit:focus-visible { stroke: var(--focus); stroke-width: 2; }

/* ---------- "Dettagli e modelli" (collapsed) ---------- */
.details-section > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px;
  min-height: 58px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.details-section > summary::-webkit-details-marker { display: none; }
.details-section > summary::after {
  content: ""; grid-column: 2; grid-row: 1 / span 2; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .15s;
}
.details-section[open] > summary::after { transform: rotate(-135deg); }
.details-section > summary:hover { border-color: var(--line-2); }
.ds-title { font-weight: 750; font-size: 1rem; }
.ds-sub { grid-column: 1; font-size: .8125rem; color: var(--muted); }
.details-body { margin-top: 12px; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.spot-note { font-size: .875rem; color: var(--ink-2); margin-bottom: 10px; max-width: 75ch; }
.chart-card { margin: 0; padding: 12px 8px 10px; }
@media (min-width: 600px) { .chart-card { padding: 16px 16px 12px; } }
.chart-title { font-weight: 750; font-size: .9375rem; padding: 0 6px; }
.chart-title .sub { font-weight: 500; color: var(--muted); }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 4px; padding: 0 6px; font-size: .75rem; color: var(--ink-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .lkey { width: 16px; height: 2px; border-radius: 1px; background: var(--ink); }
.chart-legend .akey { width: 14px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--top-m) 22%, transparent); }
.chart-legend .zkey { width: 14px; height: 10px; border-radius: 3px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--fill) var(--zone-mix), transparent); }
.chart-legend .nkey { width: 14px; height: 10px; border-radius: 3px; background: var(--nightcol); box-shadow: inset 0 0 0 1px var(--line-2); }
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart:focus { outline: none; }
.chart:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.chart svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.chart-foot { font-size: .75rem; color: var(--muted); padding: 4px 6px 0; }

/* svg parts of the 3 / 7-day chart and of the sparklines */
.ax-text { fill: var(--muted); font-size: 10px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.ax-text-2 { fill: var(--ink-2); font-size: 11px; font-weight: 650; font-family: var(--font); }
.ax-text-2.sel { fill: var(--ink); font-weight: 800; }
.gridline { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.baseline { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.daysep { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.night { fill: color-mix(in srgb, var(--nightcol) 80%, transparent); }
.past-shade { fill: var(--paper); opacity: .45; }
.zone { fill: color-mix(in srgb, var(--fill) var(--zone-mix), transparent); }
.thr-line { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 3; opacity: .6; shape-rendering: crispEdges; }
.ax-thr { fill: var(--ink); font-size: 10px; font-weight: 700; font-family: var(--font); font-variant-numeric: tabular-nums; }
.zone-label { fill: var(--ink-2); font-size: 10px; font-weight: 650; font-family: var(--font); paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.gust-band { fill: color-mix(in srgb, var(--top-m) 16%, transparent); }
.gust-line { fill: none; stroke: color-mix(in srgb, var(--top-m) 60%, transparent); stroke-width: 1; stroke-linejoin: round; }
.wind-line { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.model-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-ch1 { stroke: var(--m-ch1); --mc: var(--m-ch1); }
.m-ch2 { stroke: var(--m-ch2); --mc: var(--m-ch2); }
.m-d2 { stroke: var(--m-d2); --mc: var(--m-d2); }
.m-ecmwf { stroke: var(--m-ecmwf); --mc: var(--m-ecmwf); }
.src-seg { stroke: none; }
.src-seg.s-ch1 { fill: var(--src-ch1); } .src-seg.s-ch2 { fill: var(--src-ch2); } .src-seg.s-ecmwf { fill: var(--src-ecmwf); }
.src-seg.s-none { fill: var(--line); }
.src-label.s-ch1 { fill: var(--src-ch1-ink); } .src-label.s-ch2 { fill: var(--src-ch2-ink); } .src-label.s-ecmwf { fill: var(--src-ecmwf-ink); }
.src-label { font-size: 10px; font-weight: 700; font-family: var(--font); pointer-events: none; }
.end-label { fill: var(--ink-2); font-size: 10px; font-weight: 700; font-family: var(--font); paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.dir-arrow { fill: var(--ink-2); }
.dir-arrow.dim { opacity: .35; }
.now-line { stroke: var(--ink); stroke-width: 1.5; }
.now-label { fill: var(--ink); font-size: 10px; font-weight: 700; font-family: var(--font); }
.sel-bar { fill: var(--ink); }
.cross { stroke: var(--ink-2); stroke-width: 1; pointer-events: none; }
.marker { stroke: var(--card); stroke-width: 2; pointer-events: none; }
.marker.wind { fill: var(--ink); }
.marker.gust { fill: var(--top-m); }
.marker.model { fill: var(--mc); }
.marker.last { fill: var(--terra-mark); stroke-width: 1.5; }
.hit { fill: transparent; cursor: crosshair; }

/* table view */
.table-view { margin-top: 12px; }
.table-view summary { cursor: pointer; font-weight: 650; font-size: .875rem; padding: 10px 0; color: var(--ink-2); min-height: 40px; }
.table-scroll { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.data-table { border-collapse: collapse; width: 100%; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table thead th { position: sticky; top: 0; background: var(--card); color: var(--ink-2); font-weight: 650; z-index: 1; }
.data-table td.num, .data-table th.num { text-align: right; }
.data-table tr.day-row th { background: var(--card-2); font-weight: 750; color: var(--ink); position: static; }
.data-table tr.past td { color: var(--muted); }

/* ---------- live stations + lake water ---------- */
.stations { display: grid; gap: 12px; }
@media (min-width: 760px) { .stations { grid-template-columns: repeat(2, 1fr); } }
/* wide screens: the three stations in a row, the lake water below across the whole row (curve on the right) */
@media (min-width: 1100px) {
  .stations { grid-template-columns: repeat(3, 1fr); }
  .station.water-card { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px 32px; align-content: start; }
  .station.water-card > * { grid-column: 1; }
  .station.water-card > .spark { grid-column: 2; grid-row: 1 / span 6; align-self: center; }
  .station.water-card > .waves { grid-column: auto; }
}
.stations-msg { grid-column: 1 / -1; }
.station { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.station-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.station-name { font-weight: 750; font-size: 1rem; }
.station-elev { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.station-now { display: flex; align-items: center; gap: 12px; }
.station-arrow { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--card-2); border: 1.5px solid var(--line-2); color: var(--ink); }
.station-arrow .arrow { width: 24px; height: 24px; }
.station-arrow.water-ico { color: var(--terra); border-color: transparent; }
.station-arrow.water-ico svg { width: 26px; height: 26px; }
.station-big { font-family: var(--font-d); font-size: 2.5rem; font-weight: 850; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.station-big .u { font-size: .9375rem; font-weight: 600; color: var(--ink-2); margin-left: 3px; letter-spacing: 0; }
.station-facts { display: grid; gap: 1px; font-size: .8125rem; color: var(--ink-2); line-height: 1.35; }
.station-facts strong { color: var(--ink); }
.station-age { font-size: .75rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.station-hint { font-size: .78125rem; color: var(--muted); }
.station-error {
  font-size: .8125rem; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink); font-weight: 600;
}
.water-card { overflow: hidden; }
.water-card .station-name { font-variant: all-small-caps; letter-spacing: .07em; color: var(--terra); font-size: 1.0625rem; }
.water-card .station-big { font-size: 3rem; letter-spacing: -.04em; }
.water-card .waves { position: absolute; right: -10px; top: -6px; width: 170px; pointer-events: none; stroke: var(--top-m); opacity: .16; }
.water-card > :not(.waves) { position: relative; }
.water-note { font-size: .8125rem; color: var(--ink-2); }
.water-river {
  display: flex; gap: 6px; align-items: flex-start; font-size: .8125rem; font-weight: 600; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--warn-bg); color: var(--warn-ink);
}
.spark { position: relative; touch-action: pan-y; }
.spark:focus { outline: none; }
.spark:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.spark svg { display: block; width: 100%; height: auto; }
.spark .wind-line { stroke-width: 1.6; }
.water-card .spark .wind-line { stroke: var(--top-m); stroke-width: 2; }

/* ---------- tooltip ---------- */
.tooltip {
  position: absolute; z-index: 40; pointer-events: none; min-width: 168px; max-width: 270px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 12px 32px -8px rgba(40, 30, 10, .35); padding: 10px 12px; font-size: .8125rem; line-height: 1.35;
}
.tooltip[hidden] { display: none; }
.tt-time { color: var(--muted); font-size: .75rem; }
.tt-spot { color: var(--ink-2); font-weight: 650; margin-bottom: 4px; }
.tt-main { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 2px; }
.tt-main .big { font-family: var(--font-d); font-size: 1.25rem; font-weight: 850; }
.tt-main .sm { color: var(--ink-2); }
.tt-row { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tt-row strong { color: var(--ink); }
.tt-row .arrow { width: 14px; height: 14px; fill: currentColor; flex: none; }
.tt-rating { margin: 6px 0 2px; }
.tt-notes { margin: 4px 0 0; padding: 0 0 0 16px; color: var(--ink); }
.tt-notes li { margin: 1px 0; }
.tt-notes li.positive { color: var(--good-ink); font-weight: 650; list-style-type: "+ "; }
.tt-notes li.info { list-style-type: "i  "; }
.tt-models { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 8px; align-items: center; margin-top: 4px; }
.tt-models .lk { width: 14px; height: 2px; border-radius: 1px; background: var(--mc); }
.tt-models .val { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.tt-models .nm { color: var(--ink-2); }
.tt-suit .big { font-size: 1.0625rem; line-height: 1.25; }
.tooltip .tt-row + .tt-row { margin-top: 2px; }
.tt-hint { margin-top: 6px; font-size: .75rem; color: var(--muted); }

/* shared bits */
.dir { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.arrow { width: 14px; height: 14px; fill: currentColor; flex: none; }
.small { font-size: .8125rem; color: var(--muted); }

/* ---------- dialog ---------- */
dialog {
  border: 1px solid var(--line-2); border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); background: var(--card); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: var(--backdrop); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 26px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 4px 20px; }
.dialog-head h2 { font-family: var(--font-d); font-size: 1.25rem; font-weight: 800; }
.dialog-intro { padding: 0 20px 8px; color: var(--ink-2); font-size: .875rem; }
dialog fieldset { border: 0; margin: 0; padding: 8px 20px 4px; overflow: visible; }
dialog legend { font-variant: all-small-caps; letter-spacing: .07em; color: var(--terra); font-weight: 750; font-size: 1rem; padding: 0; margin-bottom: 6px; }
.field { display: grid; grid-template-columns: 1fr 86px auto; align-items: center; gap: 2px 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.field label { font-weight: 650; font-size: .9375rem; }
.field input {
  width: 86px; font: inherit; font-size: 1rem; padding: 8px 10px; border-radius: 12px; text-align: right; min-height: 42px;
  border: 1.5px solid var(--line-2); background: var(--paper); color: var(--ink); font-variant-numeric: tabular-nums;
}
.field input:focus-visible { border-color: var(--focus); }
.field input[aria-invalid="true"] { border-color: var(--danger-m); box-shadow: 0 0 0 1px var(--danger-m); }
.field .unit { color: var(--ink-2); font-size: .875rem; min-width: 1.75rem; }
.field .help { grid-column: 1 / -1; font-size: .8125rem; color: var(--muted); }
.hours-field { grid-template-columns: auto 72px auto 72px; justify-content: start; column-gap: 10px; }
.hours-field input { width: 72px; }
.ws-intro, .fs-intro { font-size: .8125rem; color: var(--muted); margin: 0 0 6px; }
.ws-field { grid-template-columns: 1fr auto 72px auto; }
.ws-field input { width: 72px; }
.ws-label { font-weight: 650; font-size: .9375rem; }
.ws-label svg.i { color: var(--warn-mark); }
.ws-from { font-size: .8125rem; }
.ws-last { grid-template-columns: 1fr; }
.form-error {
  margin: 4px 20px 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--danger-b); color: var(--danger-t); font-weight: 600; font-size: .875rem;
}
.dialog-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px 16px; border-top: 1.5px dashed var(--line-2); margin-top: 8px; position: sticky; bottom: 0; background: var(--card); }
.dialog-foot .spacer { flex: 1; }
.dialog-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }

/* ---------- notifications ---------- */
.notif-card { padding: 12px 16px 16px; display: grid; gap: 10px; max-width: 680px; }
.notif-state { font-weight: 650; }
.notif-state[data-kind="ok"] { color: var(--good-ink); }
.notif-state[data-kind="warn"] { font-weight: 600; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink); }
.notif-prefs { border: 0; margin: 0; padding: 0; min-width: 0; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; cursor: pointer; min-height: 56px; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.ni { width: 38px; height: 38px; border-radius: 12px; background: var(--card-2); display: grid; place-items: center; color: var(--terra); flex: none; }
.ni svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.switch-text { flex: 1; font-size: .875rem; min-width: 0; color: var(--ink-2); }
.switch-text strong { color: var(--ink); font-size: .9375rem; }
.sw-when { color: var(--ink-2); }
.switch-sub { display: block; color: var(--muted); font-size: .8125rem; }
input[role="switch"] {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer;
  width: 52px; height: 32px; border-radius: 999px; background: var(--line-2); transition: background-color .15s;
}
input[role="switch"]::before {
  content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s;
}
input[role="switch"]:checked { background: var(--ok-t); }
:root[data-theme="dark"] input[role="switch"]:checked { background: var(--ok-m); }
input[role="switch"]:checked::before { transform: translateX(20px); }
input[role="switch"]:disabled { opacity: .45; cursor: not-allowed; }
input[role="switch"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.notif-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notif-actions:not(:has(> :not([hidden]))) { display: none; }
.notif-feedback { font-size: .875rem; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--card-2); }
.notif-feedback[data-kind="ok"] { color: var(--good-ink); background: var(--good-bg); font-weight: 650; }
.notif-feedback[data-kind="err"] { background: var(--danger-b); color: var(--danger-t); font-weight: 600; }
.notif-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); }

/* ---------- toast (new version, messages) ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 24px);
  padding: 6px 6px 6px 16px; border-radius: 16px; background: var(--ink); color: var(--paper);
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, .35); font-size: .9375rem; font-weight: 650;
}
.toast .btn { background: var(--terra-mark); color: #2A140C; border-color: var(--terra-mark); }
.toast .icon-btn { width: 40px; height: 40px; color: var(--paper); flex: none; }
.toast .icon-btn:hover { background: rgba(127, 127, 127, .25); }

/* ---------- footer ---------- */
.site-footer { margin-top: 28px; border-top: 1px solid var(--line); padding: 22px 0 40px; font-size: .8125rem; color: var(--muted); line-height: 1.55; }
.site-footer p + p { margin-top: 8px; }
.site-footer strong { color: var(--ink-2); }
.site-footer a { color: var(--ink-2); }
.disclaimer { color: var(--ink); font-weight: 650; }
.footer-small { color: var(--muted); }

/* ---------- small phones ---------- */
@media (max-width: 370px) {
  .hblock.with-stamp { padding-right: 108px; }
  .gstamp { width: 104px; }
  .headline { font-size: 34px; }
  .headline.long { font-size: 28px; }
  .wd .d { font-size: .75rem; }
  .wd .v { font-size: .71875rem; }
  .wd .v.w { font-size: .625rem; }
  .wk-top .hint { display: none; }
  .segmented button { padding: 0 12px; }
  .brand h1 { font-size: 1.0625rem; }
  .wet.big { font-size: .8125rem; gap: 4px 6px; }
  .wet.big .suit { font-size: .9375rem; padding: 4px 8px 4px 6px; }
  .wet-ico { width: 18px; }
  .hero .dp-live { font-size: .78125rem; letter-spacing: -.01em; }
  .wk-sum { font-size: .8125rem; }
  .wk-sum b { font-size: 1rem; }
  .wk-chips .chip { font-size: .71875rem; padding: 3px 8px 3px 6px; }
  .hblock.with-stamp { min-height: 104px; }
}
/* desktop */
@media (min-width: 980px) {
  .sky { padding-bottom: 64px; }
  .scene { height: 96px; }
  .gstamp { width: 136px; top: 14px; right: 14px; }
  .hblock.with-stamp { padding-right: 150px; min-height: 136px; }
  .headline { font-size: 46px; }
  .headline.long { font-size: 36px; }
  .cosa-head { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .lvic, .lvpill, .chip, .wd .ic, .dsvg, .lg-sw, .suit { forced-color-adjust: none; }
  .chip, .lvpill, .wd { border: 1px solid CanvasText; }
}

/* ======================================================================== sports (multi-sport profiles) */
/* pictograms (viewBox 48): figure = currentColor, wing / sail / kite = terracotta */
.pg { display: block; flex: none; overflow: visible; width: 30px; height: 30px; }
.pg.sm { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; align-items: flex-start; }
.sport-ctl:empty { display: none; }
/* header: one sport = chip, several = a switch of pictograms */
.spchip {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; min-height: 40px; padding: 0 9px 0 5px; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: var(--card); cursor: pointer; font-weight: 750; font-size: .90625rem; color: var(--ink);
  box-shadow: 0 2px 8px -6px rgba(60, 40, 10, .4); --sailfill: var(--card);
}
.spchip .cv { width: 16px; height: 16px; color: var(--terra); }
.spseg { display: inline-flex; align-items: center; gap: 2px; margin-top: 4px; padding: 2px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--card); }
.spseg button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; position: relative; color: var(--ink); padding: 0; --sailfill: var(--card); }
.spseg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); --sailfill: var(--ink); }
.spseg .more { width: 40px; color: var(--terra); }
.spseg .more svg.i { width: 18px; height: 18px; }
.spseg .star { position: absolute; top: 0; right: 0; width: 13px; height: 13px; color: var(--terra-mark); }
.spseg .plus { font-size: .8125rem; font-weight: 800; color: var(--terra); }
.cosa-head .upd { font-size: .78125rem; color: var(--muted); text-align: right; line-height: 1.25; margin-left: auto; }

/* one-time hint: the new sports */
.sports-hint { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 8px 6px 8px 10px; border-radius: 16px; background: var(--card); border: 1.5px dashed var(--line-2); }
.sports-hint .ni { width: 38px; height: 38px; border-radius: 12px; background: var(--terra-bg); display: grid; place-items: center; color: var(--ink); flex: none; --sailfill: var(--card); }
.sports-hint p { flex: 1; font-size: .84375rem; color: var(--ink-2); min-width: 0; }
.sports-hint p b { color: var(--ink); }
.sports-hint .btn { min-height: 40px; padding: 0 12px; }

/* hero: per-sport verdicts (several sports) */
.focusbox { position: relative; }
.focusbox .gstamp { top: 0; right: -4px; }
.vstrip { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; position: relative; z-index: 4; }
.vs {
  position: relative; display: flex; align-items: center; gap: 5px; min-height: 46px; padding: 4px 8px 4px 4px; border-radius: 14px;
  border: 1.5px solid rgba(18, 50, 79, .18); background: rgba(255, 251, 244, .62); cursor: pointer; text-align: left; color: var(--hink); min-width: 0; font: inherit;
  --sailfill: var(--card);
}
.hero.ph-notte .vs, :root[data-theme="dark"] .vs { background: rgba(12, 23, 38, .38); border-color: rgba(244, 235, 220, .24); }
.vs[aria-pressed="true"] { background: var(--card); border-color: var(--ink); color: var(--ink); }
.vs .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.12; }
.vs .t b { font-size: .84375rem; font-weight: 800; white-space: nowrap; }
.vs .t span { display: flex; align-items: center; gap: 3px; font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.vs .lvd { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--lvb); color: var(--lvt); border: 1.5px solid var(--lvm); flex: none; }
.vs .lvd svg.i { width: 11px; height: 11px; }
.vs .best { position: absolute; top: -9px; right: 8px; background: var(--terra); color: var(--cta-ink); font-size: .625rem; font-weight: 800; letter-spacing: .06em; border-radius: 5px; padding: 1px 5px; transform: rotate(2deg); }
.vs.isbest { border-color: var(--terra-mark); }
.vs.isbest[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--terra-mark); }
.sc-pg { color: var(--sc-figure); --sailfill: var(--sc-sail); --top-m: transparent; }

/* the advice "ticket" (hero): gear badge, what to wear / the indicative size, water and air */
.wet.ticket { gap: 10px; padding: 7px 10px 7px 7px; min-height: 52px; flex-wrap: nowrap; }
.wet.ticket .gear { width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex: none; }
.wet.ticket .gear.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1.5px solid var(--warn-mark); }
.wet.ticket .gear svg { width: 24px; height: 24px; }
.wet.ticket .gear .suit-i { width: 18px; height: 22px; }
.wet.ticket .wet-tx { line-height: 1.28; }
.wet.ticket .adv { display: block; font-size: .9375rem; font-weight: 750; color: var(--ink); letter-spacing: -.01em; }
.wet.ticket .adv i { font-style: normal; font-weight: 500; color: var(--ink-2); }
.wet.ticket .wt { display: block; font-size: .8125rem; color: var(--ink-2); margin-top: 1px; }
.dp-wet.warn .wet.ticket .adv { color: var(--warn-ink); }
.size-note { color: var(--ink); font-weight: 600; }
.linkbtn {
  border: 0; background: transparent; padding: 0; min-height: 32px; font: inherit; font-size: .8125rem; font-weight: 700; color: var(--terra);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
/* tips: at most two lines */
.tips { list-style: none; margin: 0; padding: 0 4px; display: grid; gap: 3px; }
.tips li { display: flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--ink-2); min-width: 0; }
.tips li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tips li svg.i { width: 15px; height: 15px; color: var(--terra); flex: none; }
.tips li.warn { color: var(--warn-ink); font-weight: 700; }
.tips li.warn svg.i { color: var(--warn-mark); }

/* the week with several sports: the best sport's pictogram on each day */
.wk-sum .lst { display: block; font-size: .84375rem; margin-top: 2px; }
.wk-sum .lst span { white-space: nowrap; }
.wk-sum .lst em { font-style: normal; font-weight: 750; color: var(--ink); }
.wd .ic.sp { width: 28px; height: 28px; margin-left: -14px; color: var(--ink); background: var(--card); --sailfill: var(--card); }
.wd .ic.sp .pg { width: 22px; height: 22px; }
.wd .ic.sp.back { margin-left: -4px; transform: scale(.86) translateY(-3px); }
.wd .ic.sp.front { margin-left: -19px; z-index: 1; }
.wd .a { font-size: .65625rem; color: var(--muted); white-space: nowrap; min-height: 14px; letter-spacing: -.02em; }
.dc-head .where .pg { width: 22px; height: 22px; --sailfill: var(--card); }

/* chart thresholds of the other sports */
.g-thr.t-flat { stroke: var(--top-m); stroke-width: 1.4; }
.g-thr.t-ok { stroke: var(--strong-m); }
.scale.n4 { grid-template-columns: 1.3fr 1.2fr 1.1fr 1.2fr; }

/* "Soglie": the sport switch */
.th-switch-wrap { padding: 0 20px 4px; }
.th-switch { flex-wrap: wrap; }
.th-switch button { display: inline-flex; align-items: center; gap: 4px; --sailfill: var(--paper-2); }
.th-switch button[aria-pressed="true"] { --sailfill: var(--ink); }
#th-title-sport { color: var(--terra); }

/* "I tuoi sport": a bottom sheet (<dialog>) */
body.locked { overflow: hidden; }
dialog.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 100%; max-height: 94dvh; border: 0; border-radius: 26px 26px 0 0;
  background: var(--paper); color: var(--ink); padding: 0 0 calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -16px 40px -16px rgba(0, 0, 0, .4);
  overflow-y: auto; transform: translateY(105%); transition: transform .25s ease;
}
dialog.sheet.on { transform: none; }
dialog.sheet::backdrop { background: var(--backdrop); }
.sheet .in { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.grab { display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 9px auto 6px; }
.shd { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 2px dashed var(--line-2); }
.shd h3 { margin: 2px 0 0; font-family: var(--font-d); font-size: 1.375rem; font-weight: 850; letter-spacing: -.02em; }
.shd p { margin: 2px 0 8px; font-size: .8125rem; color: var(--ink-2); }
.shd p svg.i { width: 13px; height: 13px; color: var(--terra); vertical-align: -1px; }
.tiles { display: flex; flex-direction: column; gap: 7px; padding: 10px; }
.sheet .tiles { padding: 10px 0 4px; }
.tile { position: relative; }
.tile-main {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; text-align: left; border: 1.5px solid var(--line);
  background: var(--card); border-radius: 18px; padding: 7px 12px 7px 8px; cursor: pointer; min-height: 64px; color: var(--ink); font: inherit;
}
.tile-main[aria-pressed="true"] { border: 2px solid var(--ink); padding: 6.5px 11.5px 6.5px 7.5px; }
.tile-main:hover { background: var(--card-2); }
.tst {
  width: 52px; height: 52px; padding: 3px; transform: rotate(-3deg); flex: none;
  background: radial-gradient(circle at 50% 50%, transparent 2px, var(--stampedge, #FFFBF4) 2.4px) -3.5px -3.5px / 7px 7px; filter: drop-shadow(0 2px 3px rgba(40, 30, 10, .25));
}
:root[data-theme="dark"] .tst { --stampedge: #F4EBDC; }
.tile:nth-child(even) .tst { transform: rotate(2.5deg); }
.tst-in { width: 100%; height: 100%; background: linear-gradient(180deg, #D3ECF5, #F5F1E5); border: 1.2px solid var(--line-2); display: grid; place-items: center; color: #12324F; --sailfill: #FFFBF4; }
:root[data-theme="dark"] .tst-in { background: linear-gradient(180deg, #1F4D78, #16304F); color: #F4EBDC; --sailfill: #14223A; }
.tst-in .pg { width: 40px; height: 40px; }
.tt { min-width: 0; padding-right: 40px; }
.tt b { display: block; font-family: var(--font-d); font-size: 1.0625rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.tt b small { font-family: var(--font); font-size: .8125rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.tt > span { display: block; font-size: .8125rem; color: var(--ink-2); line-height: 1.3; margin-top: 2px; }
.tt .prin { font-style: normal; display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: .71875rem; font-weight: 800; color: var(--terra); background: var(--terra-bg); border-radius: 999px; padding: 1px 8px 1px 5px; letter-spacing: .02em; }
.tt .prin svg.i { width: 12px; height: 12px; }
.ck { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; flex: none; }
.ck svg.i { width: 16px; height: 16px; }
[aria-pressed="true"] > .ck { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.starbtn { position: absolute; right: 50px; top: 50%; margin-top: -20px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--terra); z-index: 2; }
.starbtn svg.i { width: 22px; height: 22px; }
.starbtn[aria-pressed="false"] { color: var(--muted); }
.sheet .note { display: flex; gap: 10px; align-items: center; margin: 8px 0 0; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.sheet .note .ni { width: 36px; height: 36px; border-radius: 11px; background: var(--terra-bg); display: grid; place-items: center; color: var(--terra); flex: none; }
.sheet .note .ni svg.i { width: 20px; height: 20px; }
.sheet .note .nt { flex: 1; font-size: .84375rem; color: var(--ink-2); line-height: 1.3; min-width: 0; }
.sheet .note .nt b { display: block; color: var(--ink); font-size: .875rem; }
.sheet .note .btn { flex: none; }
.sheet .weight { margin: 12px 0 0; display: grid; gap: 4px; }
.sheet .weight label { font-weight: 750; font-size: .875rem; }
.sheet .weight .wrow { display: flex; align-items: center; gap: 8px; }
.sheet .weight input {
  width: 96px; font: inherit; font-size: 1rem; padding: 8px 10px; border-radius: 12px; text-align: right; min-height: 42px;
  border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); font-variant-numeric: tabular-nums;
}
.sheet .weight .help { font-size: .78125rem; color: var(--muted); }
.notif { margin: 12px 0 0; }
.notif h4 { margin: 0 0 6px; font-size: .875rem; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.notif h4 svg.i { width: 17px; height: 17px; color: var(--terra); }
.nchips { display: flex; flex-wrap: wrap; gap: 6px; }
.nchip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 13px 0 8px; border-radius: 999px; border: 1.5px solid var(--line-2);
  background: var(--card); cursor: pointer; font: inherit; font-weight: 700; font-size: .875rem; color: var(--ink); --sailfill: var(--card);
}
.nchip .bx { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; }
.nchip .bx svg.i { width: 13px; height: 13px; }
.nchip[aria-checked="true"] .bx { background: var(--ok-t); border-color: var(--ok-t); color: #fff; }
:root[data-theme="dark"] .nchip[aria-checked="true"] .bx { background: var(--ok-m); border-color: var(--ok-m); color: #0C1726; }
.nchip .pg { width: 24px; height: 24px; }
.nchip.off { cursor: default; border-style: dashed; color: var(--ink-2); font-weight: 600; }
.nchip.off small { font-weight: 500; color: var(--muted); }
.notif p { margin: 6px 0 0; font-size: .78125rem; color: var(--muted); }
.cta {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; background: var(--terra); color: var(--cta-ink); border: 0; border-radius: 999px;
  padding: 0 20px; min-height: 50px; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: 0 8px 20px -10px rgba(168, 65, 31, .7);
}
.cta[disabled] { opacity: .45; cursor: default; }
.cta svg.i { width: 20px; height: 20px; }
.sheet .cta { margin-top: 14px; min-height: 48px; }

/* first run: "Che sport fai a Minusio?" */
body.first-run .site-header, body.first-run main, body.first-run .site-footer, body.first-run .skip-link, body.first-run #stale-banner { display: none !important; }
.first { max-width: 560px; margin: 0 auto; padding: 4px 16px 130px; }
.ftop { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.ftop .logo { width: 36px; height: 36px; }
.ftop b { font-family: var(--font-d); font-size: 1.0625rem; font-weight: 800; }
.ftop b span { color: var(--terra); }
.ftop .icon-btn { margin-left: auto; }
.pc .sky { padding: 12px 16px 40px; }
.pc h2 { margin: 0; font-family: var(--font-d); font-size: clamp(28px, 8.6vw, 34px); font-weight: 850; letter-spacing: -.03em; line-height: 1.04; padding-right: 76px; position: relative; z-index: 2; }
.pc .lead { margin: 6px 0 0; font-size: .875rem; color: var(--hmuted); padding-right: 70px; position: relative; z-index: 2; }
.pc .lead b { color: var(--hink); }
.pc .eyebrow { position: relative; z-index: 2; }
.pstamp {
  position: absolute; top: 12px; right: 14px; width: 66px; padding: 4px; transform: rotate(5deg); z-index: 3;
  background: radial-gradient(circle at 50% 50%, transparent 2.3px, var(--stampedge) 2.7px) -4px -4px / 8px 8px; filter: drop-shadow(0 3px 5px rgba(40, 30, 10, .22));
}
.pstamp-in { background: var(--card); border: 1.5px solid var(--line-2); text-align: center; padding: 4px 2px 3px; }
.pstamp-in .logo { width: 100%; height: auto; display: block; }
.pstamp-in small { display: block; font-size: .53125rem; font-weight: 800; letter-spacing: .08em; color: var(--terra); margin-top: 1px; }
.fcta { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, var(--paper) 30%); z-index: 5; }
.fcta .in { max-width: 528px; margin: 0 auto; }
.fcta p { margin: 7px 0 0; text-align: center; font-size: .78125rem; color: var(--muted); }
.notif-sports { margin-top: -6px; }

@media (max-width: 370px) {
  .vs .t b { font-size: .78125rem; }
  .vs .t span { font-size: .75rem; }
  .vs .pg { width: 26px; height: 26px; }
  .tt span { font-size: .78125rem; }
  .tt { padding-right: 36px; }
  .wd .a { font-size: .59375rem; }
}
@media (min-width: 980px) {
  .focusbox .gstamp { top: 4px; right: 0; }
}

/* the one-time install card */
.install-card {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 55; max-width: 520px; margin: 0 auto;
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 20px; background: var(--card); color: var(--ink);
  border: 1.5px dashed var(--line-2); box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .35); transform: translateY(140%); transition: transform .25s ease;
}
.install-card.on { transform: none; }
.install-card .ic-stamp {
  width: 54px; height: 54px; padding: 4px; flex: none; transform: rotate(-4deg);
  background: radial-gradient(circle at 50% 50%, transparent 2px, var(--paper) 2.4px) -3.5px -3.5px / 7px 7px; filter: drop-shadow(0 2px 3px rgba(40, 30, 10, .25));
}
.install-card .ic-stamp .logo { width: 100%; height: 100%; }
.install-card .ic-tx { flex: 1; min-width: 0; }
.install-card h2 { font-family: var(--font-d); font-size: 1.0625rem; font-weight: 850; letter-spacing: -.01em; }
.install-card p { font-size: .84375rem; color: var(--ink-2); margin-top: 2px; }
.install-card .ic-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.vs .t span { overflow: hidden; text-overflow: ellipsis; }
