/* Trovamercatino. Mobile-first, desktop da 1024 px. */

:root {
  /* Neutri caldi da carta e ferro verniciato, senza crema/lusso. */
  --bg:      #F0EEE7;
  --surface: #FFFDF8;
  --fg:      #27231F;
  --muted:   #5C554E;
  --border:  #D4CEC5;
  --firma:  #DE6A10;

  /* Derivati (stesse tinte, solo luminosità diversa) */
  --firma-testo: #9A4A0C;
  --firma-hover: #E47D3E;
  --on-firma: #1E1A16;
  --on-dark: #FFFDF8;
  --fg-hover: #493a32;
  --surface-hover: #eee7e0;
  --chip-bg: #ebe3dc;
  --chip-bg-hover: #ddd1c7;
  --border-card: #cfc1b6;
  --border-strong: #8c7a6e;
  --scrim: rgb(45 36 31 / 0.56);

  /* Stati */
  --warn-bg: oklch(95% 0.05 85);
  --warn-fg: oklch(38% 0.08 65);
  --warn-line: oklch(72% 0.12 75);
  --ok: oklch(55% 0.13 150);

  /* Categorie: solo tessere e segnaposto */
  --cat-usato-vintage: oklch(54% 0.14 35);
  --cat-antiquariato: oklch(49% 0.08 75);
  --cat-carboot: oklch(50% 0.13 255);
  --cat-rionale: oklch(51% 0.14 355);
  --cat-collezionismo: oklch(45% 0.1 305);

  --font-display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', sans-serif;
  --font-body: 'Lexend', 'Avenir Next', 'Segoe UI', sans-serif;

  --t-xs: 12px; --t-sm: 14px; --t-base: 16px; --t-md: 19px; --t-lg: 23px; --t-xl: 28px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 12px;
  --shadow-1: 0 1px 2px oklch(20% 0.02 240 / 0.08), 0 4px 12px oklch(20% 0.02 240 / 0.06);
  --shadow-2: 0 12px 32px oklch(20% 0.02 240 / 0.2), 0 2px 6px oklch(20% 0.02 240 / 0.1);
  --list-w: clamp(400px, 37vw, 540px);
  --nav-h: 72px;
  --page-max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--fg);
  font: 400 var(--t-base)/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body.lock { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.15; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--firma-testo); outline-offset: 2px; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: var(--s3); top: -60px; z-index: 100; padding: var(--s2) var(--s3); background: var(--fg); color: var(--on-dark); border-radius: var(--r); }
.skip:focus { top: var(--s3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s4);
  border: 2px solid transparent; border-radius: var(--r); background: none;
  font-weight: 600; font-size: var(--t-base); letter-spacing: 0.01em; line-height: 1.2;
  text-decoration: none; text-align: center;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--firma); color: var(--on-firma); }
.btn-primary:focus-visible, .giornata-btn:has(.nbadge:not([hidden])):focus-visible, .nav-item[aria-current="page"]:focus-visible { outline-color: var(--fg); }
.btn-outline { background: var(--surface); border-color: var(--fg); color: var(--fg); }
.btn-outline:hover:not([disabled]) { background: var(--surface-hover); }
.btn-outline[aria-pressed="true"], .btn-outline.is-on { background: var(--fg); color: var(--on-dark); }
.btn-outline[aria-pressed="true"]:hover, .btn-outline.is-on:hover { background: var(--fg-hover); border-color: var(--fg-hover); }
.btn-ghost { color: var(--fg); text-decoration: underline; text-decoration-thickness: 1.5px; padding: 0 var(--s3); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-hover); }
.btn-block { width: 100%; }
.btn .ico { width: 20px; height: 20px; }
.grow { flex: 1 1 auto; }
.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r); background: none; color: var(--fg);
}
.icon-btn:hover:not([disabled]) { background: var(--surface-hover); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.linklike { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
.linklike:hover { text-decoration: underline; text-underline-offset: 3px; }
.conditions-link { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Testata ---------- */
.topbar {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgb(185 79 45 / .08);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; text-decoration: none; }
.brand-mark { position: relative; width: 38px; height: 38px; flex: none; border-radius: var(--r); background: var(--fg); overflow: hidden; }
.brand-mark::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 15px; background: repeating-linear-gradient(90deg, var(--on-dark) 0 6px, transparent 6px 12px); }
.brand-mark::after { content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 4px; background: radial-gradient(circle at 3px 0, var(--on-dark) 3px, transparent 3.5px) 0 0 / 12px 4px repeat-x; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 700 var(--t-lg)/1 var(--font-display); letter-spacing: -0.015em; }
@media (max-width: 430px) { .brand-name { font-size: 17px; } .brand-mark { width: 32px; height: 32px; } .brand { gap: 8px; } }
.brand-sub { font-size: var(--t-sm); color: var(--muted); line-height: 1.3; margin-top: 2px; }
.giornata-btn {
  position: relative; min-height: 48px; padding: 0 var(--s3);
  border-color: var(--fg); background: var(--surface); color: var(--fg);
}
.giornata-btn:has(.nbadge:not([hidden])) { border-color: var(--firma); background: var(--firma); color: var(--on-firma); }
@media (hover: hover) {
  .btn-primary:hover:not([disabled]), .giornata-btn:has(.nbadge:not([hidden])):hover:not([disabled]) { background: var(--firma-hover); border-color: var(--firma-hover); }
  .giornata-btn:not(:has(.nbadge:not([hidden]))):hover:not([disabled]) { background: var(--surface-hover); }
}
.nbadge {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: var(--r); background: var(--firma); color: var(--on-firma); font-size: var(--t-sm); font-weight: 700;
}
.start-btn {
  display: inline-flex; align-items: baseline; gap: 6px; min-height: 44px; padding: 0 var(--s3);
  border: 0; border-radius: var(--r); background: none; font-size: var(--t-base);
}
.start-btn:hover { background: var(--surface-hover); }
.start-k { color: var(--muted); }
.start-change { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* ---------- Giorno (sempre visibile) ---------- */
.controls { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.daybar { display: flex; gap: 6px; padding: 10px var(--s4) 6px; overflow-x: auto; scrollbar-width: none; }
.daybar::-webkit-scrollbar { display: none; }
.day {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 58px; padding: 6px 7px;
  border: 1.5px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--fg);
  transition: background-color .15s;
}
.day:hover { background: var(--surface-hover); }
.day-k { font-weight: 700; font-size: var(--t-base); line-height: 1.2; display: inline-flex; align-items: center; }
.day-d { font-size: var(--t-sm); line-height: 1.2; color: var(--muted); white-space: nowrap; }
.day-k .ico { width: 20px; height: 20px; }
.day[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--on-dark); }
.day[aria-pressed="true"]:hover { background: var(--fg-hover); }
.day[aria-pressed="true"] .day-d { color: oklch(88% 0.01 240); }
.count-line { padding: 4px var(--s4) 10px; font: 600 var(--t-md)/1.25 var(--font-display); letter-spacing: -0.005em; text-wrap: balance; }
.count-line strong { font-weight: 700; }

/* ---------- Barra strumenti / filtri ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) var(--s4) 0; }
.start-inline { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-right: auto; padding: 0; border: 0; background: none; font-size: var(--t-base); text-align: left; }
.start-inline .ico { color: var(--muted); }
.filter-toggle { min-height: 44px; }
.filterbar { display: none; }
.pills { display: flex; gap: var(--s2); flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
.pills:empty { display: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 0 10px 0 14px;
  border: 0; border-radius: var(--r); background: var(--chip-bg); font-size: var(--t-base); font-weight: 600; white-space: nowrap;
}
.pill:hover { background: var(--chip-bg-hover); }
.pill .ico { width: 18px; height: 18px; }

.fgroup { margin: 0 0 var(--s5); padding: 0; border: 0; min-width: 0; }
.fgroup:last-child { margin-bottom: 0; }
.fgroup legend { padding: 0; margin-bottom: 10px; font-weight: 700; font-size: var(--t-base); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--border-strong); border-radius: var(--r); background: var(--surface);
  font-size: var(--t-base); font-weight: 500; line-height: 1.2; text-align: left;
}
.chip:hover { background: var(--surface-hover); }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--on-dark); }
.chip[aria-pressed="true"]:hover { background: var(--fg-hover); }
.chip .ico { width: 18px; height: 18px; }

.range { display: flex; flex-direction: column; gap: 4px; }
.range output { font-weight: 700; }
.range input { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; }
.range input::-webkit-slider-runnable-track { height: 6px; border-radius: var(--r); background: var(--border-strong); }
.range input::-moz-range-track { height: 6px; border-radius: var(--r); background: var(--border-strong); }
.range input::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -12px; border-radius: var(--r); background: var(--fg); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--fg); }
.range input::-moz-range-thumb { width: 24px; height: 24px; border-radius: var(--r); background: var(--fg); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--fg); }
.range-ends { display: flex; justify-content: space-between; font-size: var(--t-sm); color: var(--muted); }

/* ---------- Lista e schede ---------- */
.cards { display: grid; gap: var(--s3); padding: var(--s3) var(--s4); }
.card {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px 14px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
.card:not(:has(.tile-foto)) { grid-template-columns: minmax(0, 1fr); }
.card.is-hot { border-color: var(--fg); box-shadow: var(--shadow-1); }
.card.is-open { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.card-title { font-size: var(--t-md); line-height: 1.2; letter-spacing: -0.005em; }
.meta { display: flex; gap: var(--s2); align-items: flex-start; margin-top: 6px; font-size: var(--t-base); line-height: 1.4; }
.meta .ico { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.st { font-weight: 700; white-space: nowrap; }
.st-open::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: var(--r); background: var(--ok); vertical-align: 1px; }
.st-closed { color: var(--muted); font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.card > .badges, .card > .stale { grid-column: 1 / -1; margin-top: 0; }
.nw { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 10px; border-radius: var(--r); background: var(--chip-bg); font-size: var(--t-base); line-height: 1.3; }
.badge b { font-weight: 700; margin-left: .25em; }
.stale {
  display: flex; gap: var(--s2); align-items: flex-start; margin-top: 10px; padding: var(--s2) 10px;
  border: 1px solid var(--warn-line); border-radius: var(--r); background: var(--warn-bg); color: var(--warn-fg);
  font-size: var(--t-base); font-weight: 600; line-height: 1.35;
}
.stale .ico { width: 18px; height: 18px; margin-top: 1px; }
.card-actions { grid-column: 1 / -1; display: flex; gap: var(--s2); }
.card-actions .btn-outline { flex: 1 1 auto; }

/* Tessera di categoria: tendone a strisce + pittogramma */
.tile {
  --cat: var(--cat-usato-vintage);
  position: relative; display: grid; place-items: center; flex: none;
  width: 84px; height: 84px; border-radius: var(--r); overflow: hidden;
  background: var(--cat); color: var(--on-dark);
}
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 20px; background: repeating-linear-gradient(90deg, oklch(100% 0 0 / .92) 0 10px, transparent 10px 20px); }
.tile::after { content: ""; position: absolute; left: 0; right: 0; top: 20px; height: 5px; background: radial-gradient(circle at 5px 0, oklch(100% 0 0 / .92) 5px, transparent 5.5px) 0 0 / 20px 5px repeat-x; }
.tile .ico { width: 34px; height: 34px; margin-top: 20px; stroke-width: 1.7; }
.tile-sm { width: 60px; height: 60px; }
.tile-foto { padding: 0; overflow: hidden; }
.tile-foto::before, .tile-foto::after { display: none; }
.tile-foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.meteo .ico { color: var(--firma-testo); }
.gallery { display: flex; gap: var(--s2); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; margin: 0; padding: 0 0 4px; list-style: none; }
.gallery li { flex: 0 0 auto; scroll-snap-align: start; }
.gal-btn { display: block; width: 168px; height: 120px; padding: 0; border: 0; border-radius: var(--r); overflow: hidden; background: var(--chip-bg); cursor: zoom-in; }
.gal-btn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gal-btn:focus-visible { outline: 3px solid var(--firma-testo); outline-offset: 2px; }
.foto-big { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--r); background: var(--fg); }
.mine-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.mine-row .btn { flex: 1 1 0; min-width: max-content; min-height: 44px; } /* larghezze uguali quando c'è spazio; «Ci sei stato il 12 ott» non si spezza mai: se non entra, va a capo intero */
.profilo-btn { flex: 0 0 auto; }
.foto-nav { display: flex; justify-content: space-between; gap: var(--s2); margin-top: var(--s3); }
.tile-sm::before { height: 14px; }
.tile-sm::after { top: 14px; }
.tile-sm .ico { width: 26px; height: 26px; margin-top: 14px; }
.cat-usato-vintage { --cat: var(--cat-usato-vintage); }
.cat-antiquariato { --cat: var(--cat-antiquariato); }
.cat-carboot { --cat: var(--cat-carboot); }
.cat-rionale { --cat: var(--cat-rionale); }
.cat-collezionismo { --cat: var(--cat-collezionismo); }

/* ---------- Stato vuoto ---------- */
.empty { margin: var(--s3) var(--s4); padding: var(--s5) 20px; background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--r); }
.empty h2 { font-size: var(--t-lg); line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.empty p { margin-top: var(--s2); }
.empty-days { display: grid; gap: var(--s2); margin: var(--s3) 0 var(--s2); }
.day-alt { justify-content: space-between; width: 100%; }
.day-alt span { font-weight: 400; }

/* ---------- Piè di pagina ---------- */
.footer { margin-top: var(--s5); padding: var(--s4) var(--s4) calc(var(--nav-h) + var(--s5) + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--t-sm); }
.footer p { margin-top: var(--s2); max-width: 62ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s1); margin: 0 calc(-1 * var(--s3)) var(--s1); }
.footer-links .btn { font-size: var(--t-base); }

/* ---------- Mappa ---------- */
.map-col { display: none; position: relative; background: var(--chip-bg); }
.map, .map-fallback { position: absolute; inset: 0; }
body[data-vista="mappa"] { overflow: hidden; }
body[data-vista="mappa"] .list-col { display: none; }
body[data-vista="mappa"] .map-col { display: block; position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); top: var(--map-top, 180px); z-index: 10; }

.mk { cursor: pointer; }
.mk.is-hot, .mk.is-sel { z-index: 4; }
.pin {
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
  border: 2.5px solid var(--surface); border-radius: var(--r); background: var(--cat); color: var(--on-dark);
  box-shadow: 0 2px 6px oklch(20% 0.02 240 / .35); transition: transform .15s, box-shadow .15s;
}
.pin .ico { width: 22px; height: 22px; }
.mk.is-hot .pin, .mk.is-sel .pin { transform: scale(1.18); box-shadow: 0 0 0 3px var(--firma-testo), 0 6px 14px oklch(20% 0.02 240 / .35); }
.cluster {
  min-width: 46px; height: 46px; padding: 0 10px; border: 3px solid var(--surface); border-radius: var(--r);
  background: var(--fg); color: var(--on-dark); font: 700 18px/1 var(--font-body); box-shadow: 0 2px 8px oklch(20% 0.02 240 / .4);
}
.cluster:hover { background: var(--fg-hover); }
.halo { width: 58px; height: 58px; border: 3px solid var(--firma-testo); border-radius: var(--r); background: color-mix(in oklch, var(--firma-testo) 18%, transparent); pointer-events: none; }
.start-pin {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 2px solid var(--fg); border-radius: var(--r);
  background: var(--surface); font-size: var(--t-sm); font-weight: 700; box-shadow: var(--shadow-1); white-space: nowrap;
}
.start-pin .ico { width: 16px; height: 16px; }
.route-num { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--surface); border-radius: var(--r); background: var(--fg); color: var(--on-dark); font-weight: 700; font-size: var(--t-sm); pointer-events: none; }
.maplibregl-ctrl-group { border-radius: var(--r) !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 44px !important; height: 44px !important; }
.maplibregl-ctrl-attrib { font-size: 12px; }

.route-banner {
  position: absolute; top: var(--s3); left: var(--s3); right: var(--s3); z-index: 5;
  display: flex; align-items: center; gap: var(--s2); padding: 6px 6px 6px 14px;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-2);
}
.route-banner p { flex: 1; min-width: 0; font-weight: 600; line-height: 1.3; }
.route-banner small { display: block; font-weight: 400; color: var(--muted); font-size: var(--t-sm); }
.peek {
  position: absolute; left: var(--s3); right: var(--s3); bottom: var(--s3); z-index: 6;
  display: grid; grid-template-columns: 60px minmax(0, 1fr) 44px; gap: var(--s3); align-items: start;
  padding: var(--s3); background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-2);
}
.peek-title { font: 700 var(--t-md)/1.2 var(--font-display); }
.peek .meta { margin-top: 4px; }
.peek-actions { grid-column: 1 / -1; display: flex; gap: var(--s2); }
.peek-actions .btn { flex: 1; }
.peek.senza-foto { grid-template-columns: minmax(0, 1fr) 44px; }

.map-fallback { overflow: hidden; background: oklch(96% 0.006 240); }
.map-fallback svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fb-note { position: absolute; left: var(--s3); bottom: var(--s3); right: var(--s3); z-index: 2; padding: var(--s2) var(--s3); background: var(--surface); border-radius: var(--r); font-size: var(--t-sm); color: var(--muted); box-shadow: var(--shadow-1); }
.fb-pt { position: absolute; transform: translate(-50%, -50%); }

.view-toggle {
  position: fixed; left: 50%; bottom: calc(var(--s4) + env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 54px; padding: 0 26px;
  border: 0; border-radius: var(--r); background: var(--fg); color: var(--on-dark);
  font-size: 17px; font-weight: 700; letter-spacing: 0.01em; box-shadow: var(--shadow-2);
}
.view-toggle:hover { background: var(--fg-hover); }
.view-toggle:active { transform: translateX(-50%) translateY(1px); }

/* ---------- Pannello (dettaglio / giornata) ---------- */
.scrim { position: fixed; inset: 0; z-index: 55; background: var(--scrim); }
.panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; flex-direction: column; max-height: 92dvh;
  background: var(--surface); border-radius: var(--r) var(--r) 0 0; box-shadow: var(--shadow-2);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.panel.is-open { transform: none; }
.panel[data-tipo="giornata"] { height: 92dvh; }
.panel:focus { outline: none; }
.grab { width: 44px; height: 5px; margin: 8px auto 0; border-radius: var(--r); background: var(--border-strong); flex: none; }
.panel-head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s2) var(--s3) var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.panel-head .tile { margin-top: 2px; }
.panel-title { flex: 1; min-width: 0; padding-top: 4px; }
.panel-title h2 { font-size: var(--t-xl); line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
.panel-title p { margin-top: 4px; font-size: var(--t-base); }
.eyebrow { font-size: var(--t-sm); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.panel-body { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: var(--s4); } /* un URL o una parola lunga nei consigli non fa scorrere il corpo di lato */
.d-sec :is(p, li, dd), .alert p { overflow-wrap: anywhere; } /* solo i testi della scheda: bottoni e pianificatore tengono la loro larghezza minima */
.panel-foot { display: flex; gap: var(--s2); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.panel-foot .btn { flex: 1 1 auto; min-height: 54px; padding: 0 var(--s3); font-size: 17px; }

.d-sec { padding: var(--s4) 0; border-top: 1px solid var(--border); }
.d-sec:first-child { padding-top: 0; border-top: 0; }
.d-sec h3 { margin-bottom: var(--s2); font-size: var(--t-base); font-family: var(--font-body); font-weight: 700; }
.d-lead { font-size: 18px; line-height: 1.45; }
.dates li { display: flex; justify-content: space-between; gap: var(--s3); padding: 6px 0; font-size: var(--t-base); }
.dates li + li { border-top: 1px dashed var(--border); }
.dates .sel { font-weight: 700; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dl { display: grid; gap: var(--s3); margin: 0; }
.dl div { display: grid; gap: 2px; }
.dl dt { font-weight: 700; }
.dl dd { margin: 0; }
.tips { display: grid; gap: 6px; padding-left: 1.2em; list-style: disc; }
.links { display: flex; flex-wrap: wrap; gap: var(--s2); }
.links .btn { min-height: 44px; padding: 0 var(--s3); }
.links .ico { width: 16px; height: 16px; }
.source { color: var(--muted); font-size: var(--t-base); }
.alert {
  display: flex; gap: 10px; margin-bottom: var(--s4); padding: var(--s3);
  border: 1px solid var(--warn-line); border-radius: var(--r); background: var(--warn-bg); color: var(--warn-fg);
}
.alert strong { display: block; font-size: 17px; }
.alert p { margin-top: 2px; }

/* ---------- La tua giornata ---------- */
.pl-sec + .pl-sec { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--border); }
.pl-sec > h3 { font-size: var(--t-lg); letter-spacing: -0.01em; }
.pl-note { margin-top: 4px; color: var(--muted); }
.start-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.start-row .where { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; margin-right: auto; }
.start-row .where .ico { color: var(--muted); }
.start-opts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.sel-field { display: inline-flex; align-items: center; gap: var(--s2); min-height: 48px; }
select, input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="hidden"])), textarea {
  min-height: 48px; padding: 0 var(--s3); border: 1.5px solid var(--border-strong); border-radius: var(--r);
  background: var(--surface); font-size: var(--t-base);
}
textarea { padding: var(--s3); min-height: 110px; resize: vertical; width: 100%; }
select:hover, input:hover, textarea:hover { border-color: var(--fg); }
.field { display: grid; gap: 6px; margin-top: var(--s4); }
.field label, .field legend { font-weight: 700; }
.field-row { display: flex; gap: var(--s2); }
.field-row input { flex: 1; min-width: 0; }
.field-err { color: oklch(45% 0.15 25); font-weight: 600; }
.field-err:empty { display: none; }
.geo-msg { margin-top: var(--s2); font-weight: 600; }
.geo-msg:empty { display: none; }
.geo-msg.is-warn { padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--warn-bg); color: var(--warn-fg); }

.plan { margin-top: var(--s3); padding: 14px; border: 1px solid var(--border-card); border-radius: var(--r); background: var(--surface); }
.plan.is-onmap { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.plan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px var(--s3); }
.plan-head h4 { font-size: var(--t-md); }
.plan-total { font-size: var(--t-base); }
.plan-total strong { font-size: 18px; }
.steps { margin: var(--s3) 0; }
.step { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s3); align-items: start; padding: 4px 0; }
.step-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.step-name { font-weight: 600; }
.step-start .step-name, .step-end .step-name { font-weight: 400; color: var(--muted); }
.mezzi-sel { margin-top: var(--s3); }
.plan-why { margin-top: 6px; font-size: var(--t-base); font-weight: 600; color: var(--firma-testo); }
.leg a { color: var(--firma-testo); font-weight: 600; }
.step-warn { display: block; margin-top: 2px; color: var(--warn-fg); font-weight: 600; font-size: var(--t-base); }
.leg { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s3); color: var(--muted); font-size: var(--t-base); }
.leg span:first-child { justify-self: start; padding-left: 18px; position: relative; }
.leg span:first-child::before { content: ""; position: absolute; left: 6px; top: -4px; bottom: -4px; border-left: 2px dotted var(--border-strong); }
.step-ctrl { display: flex; gap: 2px; margin: 2px 0 0 -10px; }
.plan-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.plan-actions .btn { flex: 1 1 180px; min-height: 48px; }
.flush { margin-left: -12px; }
.back { margin-bottom: var(--s3); text-decoration: none; }
.gap { margin-top: var(--s3); }
.field.fs { border: 0; padding: 0; margin-inline: 0; }
.hint { margin-top: var(--s3); padding: var(--s3); border: 1px dashed var(--border-strong); border-radius: var(--r); color: var(--fg); }

/* ---------- Navigazione primaria ---------- */
.bottom-nav {
  position: fixed; left: 50%; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 520px); min-height: var(--nav-h);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  border: 1px solid var(--border-card); border-bottom: 0; border-radius: var(--r) var(--r) 0 0;
  background: var(--surface); box-shadow: 0 -6px 24px rgb(45 36 31 / .14);
  transform: translateX(-50%);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; min-height: 54px; padding: 4px 8px;
  border: 0; border-radius: var(--r); background: transparent; color: var(--muted);
  font-size: var(--t-sm); font-weight: 600; line-height: 1.15;
}
.nav-item .ico { width: 22px; height: 22px; }
.nav-item:hover { background: var(--surface-hover); color: var(--fg); }
.nav-item[aria-current="page"] { background: var(--firma); color: var(--on-firma); font-weight: 700; }

/* ---------- Viste dedicate ---------- */
.layout { width: 100%; min-height: 0; }
.profile-view { display: none; width: 100%; }
body[data-vista="lista"] .map-col,
body[data-vista="lista"] .profile-view,
body[data-vista="mappa"] .list-col,
body[data-vista="mappa"] .profile-view,
body[data-vista="profilo"] .list-col,
body[data-vista="profilo"] .map-col { display: none; }
body[data-vista="lista"] .list-col,
body[data-vista="profilo"] .profile-view { display: block; }
body[data-vista="profilo"] #controls,
body[data-vista="profilo"] #toolbar { display: none !important; }

/* ---------- Profilo locale ---------- */
.profile-view { padding: var(--s4) var(--s4) calc(var(--nav-h) + var(--s6) + env(safe-area-inset-bottom)); }
#profiloBody { display: grid; gap: var(--s4); width: min(100%, 760px); margin-inline: auto; }
.profile-head {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s3) var(--s4); align-items: center;
  padding: var(--s4); border: 1px solid var(--border-card);
  border-radius: var(--r); background: var(--surface);
}
.profile-avatar {
  display: grid; place-items: center; width: 64px; height: 64px;
  border: 2px solid var(--firma); border-radius: var(--r); background: var(--chip-bg);
  color: var(--firma-testo); font: 700 var(--t-xl)/1 var(--font-display);
}
.profile-head h1 { font-size: clamp(25px, 6vw, 34px); letter-spacing: -.02em; }
.profile-head .hint { margin: 4px 0 0; padding: 0; border: 0; color: var(--muted); }
.profile-form { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: end; }
.profile-form .field { flex: 1 1 220px; margin: 0; }
.profile-form .btn { flex: 0 0 auto; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.profile-stats > * {
  min-width: 0; padding: var(--s3) var(--s2); border: 1px solid var(--border-card); border-radius: var(--r);
  background: var(--surface); text-align: center; color: var(--muted); font-size: var(--t-sm);
}
.profile-stats strong { display: block; color: var(--fg); font: 700 var(--t-lg)/1.1 var(--font-display); }
.profile-quicklinks { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.profile-quicklinks a {
  flex: none; min-height: 44px; padding: 10px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--r); background: var(--surface); color: var(--fg); font-weight: 600; text-decoration: none;
}
.profile-quicklinks a:hover { background: var(--surface-hover); }
.profile-section {
  scroll-margin-top: var(--s4); padding: var(--s4); border: 1px solid var(--border-card);
  border-radius: var(--r); background: var(--surface);
}
.profile-section h2 { margin-bottom: var(--s3); font-size: var(--t-lg); }
.profile-items { display: grid; }
.profile-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2) var(--s3); align-items: center; padding: var(--s3) 0; }
.profile-row + .profile-row { border-top: 1px dashed var(--border-card); }
.profile-market { justify-self: start; padding: 0; border: 0; background: transparent; font-weight: 700; text-align: left; }
.profile-market:hover { color: var(--firma-testo); text-decoration: underline; text-underline-offset: 3px; }
.profile-meta { grid-column: 1; color: var(--muted); font-size: var(--t-sm); }
.profile-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s1); }
.profile-actions .btn, .profile-actions .icon-btn { min-height: 44px; }
.profile-empty { padding: var(--s4) 0; color: var(--muted); }
.profile-review-text { margin-top: var(--s2); color: var(--fg); line-height: 1.55; white-space: pre-wrap; }
.profile-draft {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content; min-height: 30px; padding: 3px 9px;
  border: 1px dashed var(--border-strong); border-radius: var(--r); background: var(--surface-hover);
  color: var(--muted); font-size: var(--t-sm); font-weight: 700;
}
.community-soon {
  padding: var(--s4); border: 1px dashed var(--border-strong); border-radius: var(--r);
  background: var(--chip-bg); color: var(--fg);
}
.local-label {
  display: inline-flex; align-items: center; min-height: 28px; padding: 3px 9px;
  border-radius: var(--r); background: var(--chip-bg); color: var(--muted); font-size: var(--t-sm); font-weight: 700;
}

/* ---------- Dialoghi ---------- */
dialog {
  width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0;
  border: 0; border-radius: var(--r); background: var(--surface); color: var(--fg); box-shadow: var(--shadow-2);
}
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: var(--scrim); }
.dlg { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dlg-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s3) var(--s3) 20px; border-bottom: 1px solid var(--border); }
.dlg-head h2 { flex: 1; font-size: var(--t-lg); letter-spacing: -0.01em; }
.dlg-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s4) 20px 20px; }
.dlg-foot { display: flex; gap: var(--s2); padding: var(--s3) 20px calc(var(--s4) + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.lead { margin-bottom: var(--s4); font-size: 17px; }
.prose p + p { margin-top: var(--s3); }
.nav-opts { display: grid; gap: var(--s2); }
.nav-opts .btn { justify-content: space-between; min-height: 56px; font-size: 17px; }
.radio-list { display: grid; gap: 6px; }
.radio-list label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; }
.radio-list input { width: 22px; height: 22px; margin: 0; accent-color: var(--fg); }
.done { text-align: left; }
.done h3 { font-size: var(--t-lg); margin-bottom: var(--s2); }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.cal-head strong { font: 700 var(--t-md)/1.2 var(--font-display); text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { padding: 4px 0; text-align: center; font-size: var(--t-sm); font-weight: 700; color: var(--muted); }
.cal-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 2px;
  border: 1.5px solid transparent; border-radius: var(--r); background: none; font-weight: 600;
}
.cal-day small { font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.1; }
.cal-day:hover:not([disabled]) { background: var(--surface-hover); }
.cal-day.has small { color: var(--fg); font-weight: 700; }
.cal-day.is-today { border-color: var(--border-strong); }
.cal-day[aria-pressed="true"] { background: var(--fg); color: var(--on-dark); }
.cal-day[aria-pressed="true"] small { color: var(--on-dark); }
.cal-day[disabled] { color: var(--border-strong); cursor: default; }
.cal-legend { margin-top: var(--s3); color: var(--muted); font-size: var(--t-sm); }

.popover { position: fixed; z-index: 70; width: min(440px, calc(100vw - 32px)); padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-2); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--s3) + env(safe-area-inset-bottom)); z-index: 90; transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--s3); width: max-content; max-width: calc(100% - 32px);
  padding: 10px 10px 10px var(--s4); border-radius: var(--r); background: var(--fg); color: var(--on-dark); box-shadow: var(--shadow-2);
}
.toast .btn { min-height: 40px; color: var(--on-dark); border-color: var(--on-dark); background: transparent; }
.toast .btn:hover { background: var(--fg-hover); }

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .only-mobile { display: none !important; }
  /* Solo l'app: con `body` nudo le pagine statiche (Privacy, schede, elenchi) non scorrevano con la rotella */
  body[data-vista] { height: 100dvh; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); overflow: hidden; }
  .topbar, .controls, .toolbar { width: min(100%, var(--page-max)); margin-inline: auto; }
  .topbar { padding: var(--s3) var(--s5); gap: var(--s4); border-inline: 1px solid var(--border); }
  .controls { position: static; display: flex; align-items: center; gap: var(--s5); padding: var(--s3) var(--s5); border-inline: 1px solid var(--border); border-bottom: 0; }
  .daybar { flex: none; padding: 0; overflow: visible; }
  .day { flex: 0 0 auto; min-width: 92px; padding: 6px 10px; }
  .count-line { padding: 0; font-size: var(--t-lg); }
  .toolbar { padding: 0 var(--s5) var(--s3); border: 1px solid var(--border); border-top: 0; }
  .filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
  .pills { flex-basis: auto; flex: 1 1 200px; }
  .fbtn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px 0 14px;
    border: 1.5px solid var(--border-strong); border-radius: var(--r); background: var(--surface); font-weight: 600;
  }
  .fbtn:hover { background: var(--surface-hover); }
  .fbtn.is-active { background: var(--fg); border-color: var(--fg); color: var(--on-dark); }
  .fbtn.is-active:hover { background: var(--fg-hover); }
  .fbtn .ico { width: 18px; height: 18px; transition: transform .15s; }
  .fbtn[aria-expanded="true"] .ico { transform: rotate(180deg); }
  .layout { display: block; width: min(100%, var(--page-max)); height: 100%; margin-inline: auto; min-height: 0; }
  .list-col { height: 100%; overflow-y: auto; border-inline: 1px solid var(--border); }
  .list-col:focus { outline: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--s4) var(--s5); }
  .empty { margin: var(--s4) var(--s5); }
  .footer { padding: var(--s4) var(--s5) calc(var(--nav-h) + var(--s5)); }
  body[data-vista="mappa"] .map-col {
    left: 50%; right: auto; width: min(100%, var(--page-max));
    bottom: var(--nav-h); transform: translateX(-50%); border-inline: 1px solid var(--border);
  }
  .profile-view { height: 100%; overflow-y: auto; padding: var(--s5) var(--s5) calc(var(--nav-h) + var(--s6)); border-inline: 1px solid var(--border); }
  #profiloBody { width: min(100%, 900px); }
  .profile-section { padding: var(--s5); }
  .bottom-nav { width: 460px; }
  .view-toggle { display: none; }
  .panel {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto; z-index: 60;
    width: min(520px, calc(100% - 48px)); max-height: 100dvh; height: 100dvh !important;
    border-radius: var(--r) 0 0 var(--r); transform: translateX(100%);
  }
  .panel.is-open { transform: none; }
  .grab { display: none; }
  .panel-head { padding: var(--s4) var(--s3) var(--s3) var(--s4); }
  .route-banner { right: auto; max-width: min(520px, calc(100% - 100px)); }
  .map-col.has-panel .route-banner { display: none; }
  .toast { bottom: calc(var(--nav-h) + var(--s4)); }
  dialog.sheet { margin: auto; }
}

@media (max-width: 1023px) {
  .only-desk { display: none !important; }
  dialog.sheet {
    position: fixed; inset: auto 0 0; margin: 0; width: 100vw; max-width: 100vw; max-height: 90dvh;
    border-radius: var(--r) var(--r) 0 0;
  }
}

@media (max-width: 520px) {
  .profile-row { grid-template-columns: minmax(0, 1fr); }
  .profile-meta, .profile-actions { grid-column: 1; grid-row: auto; }
  .profile-actions { justify-content: flex-start; }
}

@media (max-width: 359px) {
  .brand-sub { display: none; }
  .daybar { gap: 4px; padding-inline: var(--s3); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}


/* --- aggiunte dell'app vera (non del prototipo) --- */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Telefono e tablet: guscio da app. Il documento non scorre, scorrono le viste: la barra del browser
   resta ferma, la barra in basso non balla, con la tastiera (interactive-widget=resizes-content) il
   guscio si accorcia e i piedi dei pannelli restano sopra la tastiera. */
@media (max-width: 1023px) {
  /* Solo l'app (body[data-vista]): le pagine statiche, Installa e Privacy restano documenti che scorrono */
  body[data-vista] { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body[data-vista] .topbar, body[data-vista] .controls, body[data-vista] .toolbar { flex: none; }
  body[data-vista] .layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body[data-vista] .home-view, body[data-vista] .list-col, body[data-vista] .profile-view { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
  /* Pannello aperto (body.lock): ferma anche la vista che scorre (lo scrim copre, inert blocca i tocchi: questo chiude il caso dello scorrimento inerziale) */
  body.lock .home-view, body.lock .list-col, body.lock .profile-view { overflow-y: hidden; }
}
/* Poca altezza (tastiera aperta, telefono in orizzontale): testata, giorni e toolbar da soli riempirebbero lo schermo.
   Si torna al documento che scorre, così il browser porta in vista il campo in cui si scrive. */
@media (max-width: 1023px) and (max-height: 520px) {
  body[data-vista] { height: auto; min-height: 100dvh; display: block; overflow: visible; }
  body[data-vista] .layout { display: block; }
  body[data-vista] .home-view, body[data-vista] .list-col, body[data-vista] .profile-view { overflow-y: visible; }
  body[data-vista].lock { overflow: hidden; } /* pannello aperto: il documento sotto lo scrim resta fermo anche qui */
}

.card-skel { min-height: 236px; background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--r); }
@media (prefers-reduced-motion: no-preference) { .card-skel { animation: skel 1.2s ease-in-out infinite alternate; } @keyframes skel { from { opacity: .55 } to { opacity: 1 } } }

#map.map, #mapFallback.map-fallback { position: absolute; inset: 0; }
/* Le viste ricevono il focus al cambio di scheda (lettori di schermo): il bordo di focus su un'intera sezione è solo una riga arancione che spunta sotto la barra */
.home-view:focus, .list-col:focus, .profile-view:focus, .map-col:focus { outline: none; }

/* Telefoni stretti (≤ 380 px): i bottoni affiancati della scheda e delle card non vanno su due righe */
@media (max-width: 380px) {
  .panel-foot .btn { font-size: 15px; padding: 0 var(--s2); white-space: nowrap; }
  .mine-row .btn { font-size: 15px; padding: 0 var(--s2); gap: 6px; }
  .card-actions .btn { font-size: 15px; padding: 0 var(--s2); gap: 6px; }
  .card-actions .btn-outline { white-space: nowrap; }
}

/* Tasto itinerari in testata, telefono: resta un quadrato da 44 px e il contatore sta sull'angolo, così la testata non si allarga
   e il nome dell'app non va a capo (a 360 px «Trovamercatino» si spezzava) */
@media (max-width: 767px) {
  .giornata-btn .nbadge { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 5px; font-size: 12px; background: var(--fg); color: var(--bg); border: 2px solid var(--surface); }
  .brand-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Testata della scheda sul telefono: resta fissa sopra il corpo che scorre, quindi deve stare bassa. Con i nomi lunghi
   (174 mercatini sopra i 48 caratteri) a 28 px faceva 6 righe più la categoria su 2: 300 px su 740, al corpo restavano 200-290 px */
@media (max-width: 767px) {
  .panel-head { gap: var(--s2); padding: var(--s2) var(--s3) var(--s2) var(--s3); }
  .panel-title { padding-top: 2px; }
  .panel-title .eyebrow { font-size: var(--t-xs); letter-spacing: 0.06em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } /* «Antiquariato e modernariato» intero: al massimo due righe */
  .panel-title h2 { font-size: var(--t-lg); line-height: 1.2; text-wrap: pretty; }
  .panel-title h2.is-long { font-size: var(--t-md); }
  .panel-title p:last-child { margin-top: 2px; font-size: var(--t-sm); }
  .panel-head .tile-sm { width: 48px; height: 48px; }
  .panel-head .tile-sm::before { height: 11px; }
  .panel-head .tile-sm::after { top: 11px; }
  .panel-head .tile-sm .ico { width: 22px; height: 22px; margin-top: 11px; }
}

.maplibregl-marker:has(.route-num) { z-index: 5; }

/* Comunità senza account */
.footer-add { margin-bottom: var(--s3); }
.community-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.community-actions .btn { flex: 1 1 150px; }
.community-result { margin-bottom: var(--s2); padding: 10px 12px; border-radius: var(--r); background: var(--chip-bg); color: var(--firma-testo); font-weight: 700; }
.community-result.is-no { background: var(--warn-bg); color: var(--warn-fg); }
.proposta-due { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.proposta-giorni { display: flex; flex-wrap: wrap; gap: 6px; }
.proposta-giorni .chip { cursor: pointer; }
.proposta-giorni .chip:has(input:checked) { background: var(--fg); border-color: var(--fg); color: var(--on-dark); }
.proposta-giorni input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.field-note { color: var(--muted); font-size: var(--t-sm); }
.hp { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
input[type="time"], input[type="number"], input[type="file"] { min-height: 48px; max-width: 100%; padding: 8px var(--s3); border: 1.5px solid var(--border-strong); border-radius: var(--r); background: var(--surface); font: inherit; }
@media (max-width: 420px) { .proposta-due { grid-template-columns: 1fr; gap: 0; } }
.video-list { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.video-list a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border-card); border-radius: var(--r); color: inherit; text-decoration: none; }
.video-list a:hover { background: var(--surface-hover); }
.video-t { font-weight: 600; }

/* Beta Giro: stesso simbolo nel marchio, voto e icona. */
.brand-mark { background:var(--firma); -webkit-mask:url('icone/Simbolo-Giro.png') center/contain no-repeat; mask:url('icone/Simbolo-Giro.png') center/contain no-repeat; border:0; border-radius:0; filter:drop-shadow(1px 0 0 var(--firma-testo)) drop-shadow(-1px 0 0 var(--firma-testo)) drop-shadow(0 1px 0 var(--firma-testo)) drop-shadow(0 -1px 0 var(--firma-testo)); }
.brand-mark::before,.brand-mark::after { display:none; }
.brand-filters { position:absolute; overflow:hidden; pointer-events:none; color:var(--firma); }
.giro-symbol { display:block; width:40px; height:40px; color:var(--firma); flex:none; }
.giro-symbol.is-empty { color:var(--border-strong); }
.header-account { margin-left:auto; padding-inline:8px; min-width:44px; min-height:44px; }
.header-account.is-profile { width:44px; padding:0; border:1.5px solid var(--border-strong); border-radius:50%; background:var(--chip-bg); color:var(--firma-testo); font-weight:700; text-decoration:none; overflow:hidden; }
.header-account.is-profile img { width:100%; height:100%; object-fit:cover; }
.home-view { padding:24px 20px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
#homeBody { width:min(100%,960px); min-width:0; margin-inline:auto; }
.home-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.home-heading h1 { font-size:clamp(28px,5vw,40px); line-height:1.15; margin:8px 0; }
.home-heading p,.home-section>p { color:var(--muted); line-height:1.55; }
.home-today { font-size:14px; }
.home-search,.list-search { display:flex; align-items:center; gap:8px; margin:20px 0 12px; padding:4px 8px 4px 12px; border:1.5px solid var(--border-strong); background:var(--surface); border-radius:var(--r); }
.home-search:focus-within,.list-search:focus-within { outline:3px solid var(--firma-testo); outline-offset:2px; }
.home-search input,.list-search input { flex:1; min-width:0; border:0; background:transparent; font:inherit; min-height:44px; padding:4px; color:var(--fg); outline:none; }
.home-search input::placeholder,.list-search input::placeholder { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-search + .home-section { margin-top:16px; }
.data-warning { margin:12px 20px; padding:10px 12px; border:1px solid var(--warn-line); border-radius:var(--r); background:var(--warn-bg); color:var(--warn-fg); font-size:var(--t-sm); font-weight:600; line-height:1.45; }
#homeBody>.data-warning { margin-inline:0; }
.home-explore,.home-explore>div { min-width:0; max-width:100%; }
.home-explore { display:grid; gap:16px; }
.home-explore h3 { margin-bottom:8px; font-size:15px; }
.home-explore-chips { display:flex; gap:8px; width:100%; max-width:100%; overflow-x:auto; padding-bottom:4px; scrollbar-width:thin; }
.home-explore-chips .chip { flex:none; }
.home-trip-short { width:100%; display:flex; justify-content:space-between; align-items:center; gap:16px; border:1.5px solid var(--border-strong); border-radius:var(--r); background:var(--chip-bg); color:var(--fg); padding:16px; text-align:left; }
.home-trip-short strong { display:block; color:var(--firma-testo); font-size:19px; margin-bottom:6px; }
.home-trip-short span span { font-size:14px; }
.home-section { min-width:0; max-width:100%; margin-top:32px; }
.home-section-head { display:flex; gap:12px; align-items:center; justify-content:space-between; margin-bottom:12px; }
.home-section-head h2 { font-size:23px; }
.home-link { display:flex; align-items:center; justify-content:center; gap:4px; min-height:44px; padding:4px; background:none; border:0; color:var(--firma-testo); font:inherit; font-size:14px; text-decoration:underline; flex:none; }
.home-place { display:flex; align-items:center; gap:8px; margin-bottom:8px; color:var(--fg)!important; }
.home-place-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.home-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:12px; margin:16px 0; }
.home-card { display:flex; flex-direction:column; border:1px solid var(--border-card); background:var(--surface); border-radius:var(--r); overflow:hidden; min-width:0; }
.home-card-body { padding:12px; display:flex; flex-direction:column; flex:1; gap:6px; }
.home-market { border:0; background:none; padding:0; text-align:left; color:var(--fg); min-height:44px; }
.home-market h3 { font-size:18px; line-height:1.25; overflow-wrap:anywhere; }
.home-market:hover h3 { text-decoration:underline; }
.home-meta,.home-date-note { color:var(--muted); font-size:13px; line-height:1.4; }
.home-when { font-size:14px; line-height:1.45; }
.home-date-note { color:var(--warn-fg); font-size:var(--t-sm); font-weight:600; }
.home-reason { font-size:14px; color:var(--firma-testo); line-height:1.45; }
.home-card-foot { margin-top:0; padding-top:var(--s2); display:flex; align-items:center; justify-content:space-between; gap:4px; }
.home-photo { margin:0; }
.home-photo img { display:block; width:100%; aspect-ratio:4/3; object-fit:cover; }
.home-photo figcaption { padding:4px 8px; color:var(--muted); font-size:var(--t-xs); line-height:1.3; background:var(--surface); }
.home-card.is-compact .home-market h3 { font-size:17px; }
.home-weekdays { display:flex; gap:8px; flex-wrap:wrap; }
.home-weekdays .btn { padding:8px 12px; font-size:14px; }
.home-empty { padding:16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r); line-height:1.6; }
.home-news li { border-bottom:1px solid var(--border); padding:16px 0; }
.home-news a { display:flex; align-items:center; justify-content:space-between; gap:12px; text-decoration:none; min-height:44px; }
.home-news a:hover h3 { text-decoration:underline; }
.home-news h3 { font-size:17px; }
.home-news p { margin-top:4px; font-size:13px; color:var(--muted); line-height:1.5; }
.home-news .home-news-summary { font-size:14px; color:var(--fg); }
.home-footer { margin-top:32px; padding-top:16px; border-top:1px solid var(--border); font-size:13px; color:var(--muted); line-height:1.6; }
.list-search { margin:16px 20px 4px; }
.list-search .btn { font-size:14px; padding-inline:8px; }
.list-query-note { margin:8px 20px; color:var(--muted); font-size:14px; }
.rating-field { border:0; padding:0; margin:12px 0; }
.rating-field legend { font-weight:600; margin-bottom:8px; }
.rating-input { display:flex; gap:4px; }
.rating-choice { position:relative; display:grid; place-items:center; width:48px; min-height:48px; cursor:pointer; border-radius:var(--r); }
.rating-choice input { position:absolute; width:1px; height:1px; clip-path:inset(50%); }
.rating-choice:has(input:focus-visible) { outline:3px solid var(--firma-testo); outline-offset:2px; }
.rating-choice .rating-full { display:none; }
.rating-choice.is-filled .rating-full { display:block; }
.rating-choice.is-filled .rating-empty { display:none; }
.rating-number { margin-top:8px; font-weight:600; }
.preference-chips { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.preference-chips label,.account-check { display:flex; align-items:center; gap:8px; min-height:44px; line-height:1.5; }
.preference-chips label { padding:6px 12px; border:1px solid var(--border-strong); border-radius:var(--r); background:var(--surface); font-size:14px; }
input[type=checkbox],input[type=radio] { accent-color:var(--firma-testo); }
.account-welcome { display:grid; gap:12px; }
.account-welcome p,.account-form p,.account-box p { line-height:1.6; }
.welcome-brand { display:flex; align-items:center; gap:var(--s3); margin-bottom:var(--s4); }
.account-welcome .welcome-brand .brand-mark { width:64px; height:64px; }
.account-welcome .welcome-brand .brand-name { font-size:var(--t-lg); }
.welcome-title { max-width:12ch; font-size:clamp(28px,8vw,34px); text-align:left; text-wrap:balance; }
.welcome-title:focus { outline:0; }
.account-form { display:grid; gap:12px; }
.account-box { margin-bottom:24px; padding:20px; border:1px solid var(--border-strong); border-radius:var(--r); background:var(--surface); }
.account-box h2 { margin-bottom:8px; }
.account-box .profile-actions { justify-content:flex-start; margin-top:12px; }
.account-email { color:var(--muted); font-size:var(--t-sm); }
.account-edit { margin-top:var(--s3); border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.account-edit>summary { min-height:48px; display:flex; align-items:center; font-weight:600; cursor:pointer; }
.account-edit .profile-form { padding-bottom:var(--s3); }
.account-avatar { width:64px; height:64px; border-radius:var(--r); object-fit:cover; }
.profile-switch { display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; min-height:48px; margin:16px 0; padding:10px 12px; border:1.5px solid var(--border-strong); border-radius:var(--r); background:var(--surface); text-align:left; }
.profile-switch[aria-checked=true] span:last-child { color:var(--firma-testo); font-weight:700; }
.public-review { padding:12px 0; border-bottom:1px solid var(--border); }
.public-review p { white-space:pre-wrap; margin-top:8px; }
:root[data-tema=scuro] { color-scheme:dark; --bg:#1E1D1B; --surface:#292723; --fg:#F4F0E7; --muted:#C0B8AD; --border:#4A443B; --border-card:#575044; --border-strong:#A99F90; --firma:#DE6A10; --firma-testo:#F28A3A; --firma-hover:#E47D3E; --on-firma:#1E1A16; --on-dark:#211D17; --fg-hover:#E2DACD; --surface-hover:#35312B; --chip-bg:#312A22; --chip-bg-hover:#44362A; --scrim:rgb(0 0 0/.7); --warn-bg:#3D2D19; --warn-fg:#FFD18B; --warn-line:#A6834A; --ok:#94CBB6; }
@media(max-width:767px) { .brand-name { font-size:18px; } .topbar { gap:8px; } .brand-mark { width:32px; height:32px; } .header-account { margin-left:auto; } .giornata-btn { width:44px; min-width:44px; padding:0; } .giornata-btn>span:not(.nbadge) { display:none; } .home-near,.home-recommend { grid-template-columns:1fr; } }
@media(min-width:768px) { .home-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } .home-near { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(min-width:1024px) { body[data-vista=home],body[data-vista=profilo] { grid-template-rows:auto minmax(0,1fr); } .home-view { height:100%; overflow-y:auto; border-inline:1px solid var(--border); } .home-view:focus { outline:none; } .header-account { order:3; } }
@media(prefers-reduced-motion:reduce) { * { scroll-behavior:auto!important; transition:none!important; } }
@media(max-width:359px) { .brand-name { font-size:16px; } .header-account { padding-inline:8px; } .topbar { column-gap:10px; } }
.giro-symbol.is-empty { opacity:1; }
#giro-outline feFlood { flood-color:var(--muted); }
#giro-filled .giro-fill { flood-color:var(--firma); }
#giro-filled .giro-border { flood-color:var(--firma-testo); }
.review-status { display:block; margin-top:4px; color:var(--firma-testo); font-weight:700; }
.public-review-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.public-review .btn { min-height:44px; }
:root[data-tema=scuro] .field-err { color:#FFB09A; }
.account-callback{max-width:480px;margin:8vh auto;padding:28px 24px;text-align:center;background:var(--surface);border:1px solid var(--border);border-radius:12px}
.account-callback .brand-mark{display:block;width:80px;height:80px;margin:0 auto 20px}
.account-callback h1{font-family:'Bricolage Grotesque',sans-serif;font-size:26px}
.account-callback h2{font-size:20px;margin:28px 0 12px}
.account-callback p{line-height:1.6}
.account-callback .btn{margin-top:16px}
.privacy-page{width:min(100% - 32px,760px);margin:24px auto 64px;padding:clamp(20px,5vw,40px);border:1px solid var(--border-card);border-radius:var(--r);background:var(--surface)}
.privacy-page h1{font-size:clamp(30px,7vw,44px);margin:24px 0 12px}.privacy-page h2{font-size:22px;margin:32px 0 10px}.privacy-page p,.privacy-page li{line-height:1.7}.privacy-page p+p{margin-top:12px}.privacy-page ul{padding-left:24px;list-style:disc}.privacy-page .brand{display:inline-flex}.privacy-meta{color:var(--muted)}
#accessoDlg.is-welcome { width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; padding:0; border:0; background:var(--bg); }
#accessoDlg.is-welcome::backdrop { background:var(--bg); }
#accessoDlg.is-welcome>.dlg { width:min(100%,480px); min-height:100dvh; margin:0 auto; display:grid; align-content:end; background:transparent; box-shadow:none; }
#accessoDlg.is-welcome .dlg-head { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
#accessoDlg.is-welcome .dlg-body { padding:32px 24px calc(32px + env(safe-area-inset-bottom)); }
/* Video di sfondo del benvenuto: foto subito, video in dissolvenza quando parte; sfumatura verso il fondo dove stanno titolo e bottoni */
#accessoDlg.is-welcome { overflow:hidden; }
#accessoDlg.is-welcome>.dlg { position:relative; z-index:1; }
.welcome-media { position:absolute; inset:0; z-index:0; overflow:hidden; background:var(--bg); }
.welcome-media img,.welcome-media video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.welcome-media video { opacity:0; transition:opacity .7s ease; }
.welcome-media.is-playing video { opacity:1; }
/* La sfumatura copre la fascia di marchio, titolo e testo (metà bassa) quasi per intero: il testo deve leggersi anche sui fotogrammi peggiori, non solo sul poster */
.welcome-media::after { content:""; position:absolute; inset:0; background:linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 94%, transparent) 42%, color-mix(in srgb, var(--bg) 72%, transparent) 64%, color-mix(in srgb, var(--bg) 35%, transparent) 84%, color-mix(in srgb, var(--bg) 14%, transparent) 100%); }
#accessoDlg.is-welcome .welcome-title,#accessoDlg.is-welcome .welcome-brand { text-shadow:0 1px 10px color-mix(in srgb, var(--bg) 70%, transparent); }
#accessoDlg.is-welcome .btn-outline { background:color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter:blur(8px); }
@media (prefers-reduced-motion: reduce) { .welcome-media video { display:none; } }

/* Occhio sulla password (accesso, registrazione, nuova password) */
.pw-row { position:relative; }
.pw-row input { width:100%; padding-right:52px; }
.pw-eye { position:absolute; right:3px; top:50%; width:44px; height:44px; transform:translateY(-50%); }
.pw-eye .ico { width:22px; height:22px; }
.pw-eye .off,.pw-eye[aria-pressed="true"] .on { display:none; }
.pw-eye[aria-pressed="true"] .off { display:block; }

/* Tutorial dopo l'accesso: schermo intero come il benvenuto, figura animata in CSS (niente librerie, niente video) */
#tutorialDlg { width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; padding:0; border:0; background:var(--bg); }
#tutorialDlg::backdrop { background:var(--bg); }
#tutorialDlg>.dlg { width:min(100%,480px); min-height:100dvh; margin:0 auto; display:grid; align-content:end; background:transparent; box-shadow:none; }
#tutorialDlg .dlg-body { display:grid; gap:12px; padding:32px 24px calc(32px + env(safe-area-inset-bottom)); }
#tutorialDlg h2 { font-size:clamp(26px,7vw,32px); line-height:1.15; letter-spacing:-0.015em; text-wrap:balance; }
#tutorialDlg h2:focus { outline:0; }
.tut-testo { line-height:1.6; }
.tut-figura { display:grid; place-items:center; height:min(42vh,260px); margin-bottom:8px; border-radius:var(--r); background:var(--chip-bg); overflow:hidden; }
.tut-figura svg { width:min(100%,340px); height:auto; fill:none; stroke:var(--fg); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.tut-figura text { fill:var(--fg); stroke:none; font:600 15px var(--font-body); }
.tut-figura .tut-anello,.tut-figura .tut-spunta,.tut-figura .tut-rotta,.tut-figura .tut-ok { stroke:var(--firma-testo); stroke-width:3; }
.tut-figura .tut-stella { fill:var(--firma); stroke:var(--firma); }
.tut-figura .tut-brillo { fill:var(--firma-testo); stroke:none; }
.tut-figura .tut-pin { stroke:var(--firma-testo); stroke-width:2.5; }
.tut-figura .tut-mappa,.tut-figura .tut-campo { stroke:var(--border-strong); }
.tut-figura .tut-strade { stroke:var(--border-strong); stroke-dasharray:4 6; }
.tut-figura .tut-chip rect { fill:var(--surface); }
.tut-dots { display:flex; gap:8px; margin:4px 0 0; padding:0; list-style:none; }
.tut-dots li { width:8px; height:8px; border-radius:4px; background:var(--border-strong); transition:width .25s; }
.tut-dots li.is-on { width:26px; background:var(--firma); }
.tut-azioni { display:grid; gap:8px; margin-top:8px; }
/* Movimento: tracciati che si disegnano, elementi che compaiono con un piccolo rimbalzo; con «riduci movimento» tutto resta fermo al fotogramma finale */
.tut-figura .tut-anello { stroke-dasharray:280; stroke-dashoffset:280; animation:tut-traccia .8s ease-out forwards; }
.tut-figura .tut-spunta { stroke-dasharray:70; stroke-dashoffset:70; animation:tut-traccia .45s ease-out .7s forwards; }
.tut-figura .tut-brillo { transform-box:fill-box; transform-origin:center; transform:scale(0); animation:tut-pop .5s ease-out forwards; }
.tut-figura .b1 { animation-delay:1s; } .tut-figura .b2 { animation-delay:1.15s; } .tut-figura .b3 { animation-delay:1.3s; } .tut-figura .b4 { animation-delay:1.45s; }
.tut-figura .tut-digita { clip-path:inset(0 100% 0 0); animation:tut-svela 1s steps(16) .4s forwards; }
.tut-figura .tut-pin { transform-box:fill-box; transform-origin:center bottom; opacity:0; animation:tut-cade .6s cubic-bezier(.2,.8,.3,1.2) 1.5s forwards; }
.tut-figura .tut-stella { transform-box:fill-box; transform-origin:center; transform:scale(0); animation:tut-pop .55s ease-out .3s forwards; }
.tut-figura .tut-chip { transform-box:fill-box; transform-origin:left center; opacity:0; animation:tut-entra .5s ease-out .9s forwards; }
.tut-figura .tut-rotta { stroke-dasharray:330; stroke-dashoffset:330; animation:tut-traccia 1s ease-in-out 1.4s forwards; }
.tut-figura .c1 { animation-delay:.2s; } .tut-figura .c2 { animation-delay:.9s; }
.tut-figura .tut-ok { stroke-dasharray:30; stroke-dashoffset:30; animation:tut-traccia .4s ease-out forwards; }
.tut-figura .c1 .tut-ok { animation-delay:.8s; } .tut-figura .c2 .tut-ok { animation-delay:1.5s; }
.tut-comunita .b2 { animation-delay:1.2s; } .tut-comunita .b3 { animation-delay:1.9s; }
@keyframes tut-traccia { to { stroke-dashoffset:0; } }
@keyframes tut-pop { 0% { transform:scale(0); opacity:0; } 70% { transform:scale(1.18); opacity:1; } 100% { transform:scale(1); opacity:1; } }
@keyframes tut-cade { 0% { transform:translateY(-46px); opacity:0; } 65% { transform:translateY(5px); opacity:1; } 100% { transform:none; opacity:1; } }
@keyframes tut-entra { from { transform:translateX(36px); opacity:0; } to { transform:none; opacity:1; } }
@keyframes tut-svela { to { clip-path:inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .tut-figura * { animation-delay:0s !important; } } /* con le durate a zero anche i ritardi a zero: tutto subito al fotogramma finale */
#accountGateDlg .dlg-foot { flex-wrap:wrap; }
#accountGateDlg .dlg-foot .btn-ghost { flex:1 0 100%; }
@media(max-width:420px){.list-search{display:grid;grid-template-columns:minmax(0,1fr) auto auto}.list-search input,.list-search .btn{min-width:0}.topbar{padding-inline:12px}.brand-name{overflow-wrap:anywhere}}

/* ---------- Pagine statiche (scheda mercatino, elenco, weekend, Installa) ---------- */
.pagina-corpo { display: block; }
.pagina-topbar { position: static; }
.pagina { width: min(100% - 32px, 760px); margin: 24px auto 48px; padding: clamp(20px, 5vw, 40px); border: 1px solid var(--border-card); border-radius: var(--r); background: var(--surface); }
.pagina h1 { font-size: clamp(30px, 7vw, 44px); margin: 12px 0 8px; letter-spacing: -0.02em; }
.pagina h2 { font-size: var(--t-lg); margin: 0 0 var(--s3); }
.pagina h3 { font-size: var(--t-base); margin: var(--s4) 0 var(--s2); font-family: var(--font-body); font-weight: 700; color: var(--muted); }
.pagina .d-sec { padding: var(--s5) 0; }
.pagina .d-sec:first-of-type { border-top: 0; }
.pagina p + p { margin-top: var(--s3); }
.pagina-sotto { color: var(--muted); font-size: var(--t-md); line-height: 1.4; }
.pagina-titolo-sezione { margin-top: var(--s6); padding-top: var(--s5); border-top: 2px solid var(--fg); }
.briciole { font-size: var(--t-sm); color: var(--muted); }
.briciole a { color: inherit; }
.briciole span { color: var(--fg); }
.pagina-conta { display: inline-block; margin-left: var(--s2); padding: 2px 10px; border-radius: 999px; background: var(--chip-bg); color: var(--firma-testo); font: 700 var(--t-sm)/1.5 var(--font-body); vertical-align: middle; }
.pagina-lista { display: grid; gap: var(--s2); padding-left: 0; }
.pagina-lista li { padding-left: var(--s4); position: relative; line-height: 1.5; }
.pagina-lista li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 7px; height: 7px; border-radius: 50%; background: var(--firma); }
.pagina-passi { padding-left: 1.4em; display: grid; gap: var(--s2); list-style: decimal; }
.pagina-passi li { line-height: 1.55; }
.date-elenco { display: grid; gap: var(--s1); margin: var(--s3) 0; }
.date-elenco li { padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); }
.date-elenco time { font-weight: 700; }
.stato-ok { color: var(--ok); font-weight: 700; }
.stato-dubbio { color: var(--warn-fg); font-weight: 700; }
.stato-sospeso { color: var(--warn-fg); }
.pagina-azioni { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.pagina-cta { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--border); }
.pagina-foto { margin: var(--s4) 0 0; }
.pagina-foto img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); background: var(--chip-bg); }
.pagina-foto figcaption { margin-top: var(--s1); font-size: var(--t-xs); color: var(--muted); }
.pagina .alert { display: flex; gap: var(--s2); margin: var(--s4) 0 0; padding: var(--s3) var(--s4); border: 1px solid var(--warn-line); border-radius: var(--r); background: var(--warn-bg); color: var(--warn-fg); }
.pagina .alert p { margin-top: 2px; }
.pagina-piede { width: min(100% - 32px, 760px); margin: 0 auto 48px; color: var(--muted); font-size: var(--t-sm); }
.pagina-piede p + p { margin-top: var(--s2); }
@media (min-width: 1024px) { .pagina { margin-top: 40px; } }
.footer-pagine a { display: inline-block; padding: 8px 0; min-height: 24px; }
