/* =========================================================================
   Presepe Vivente di Lavis – foglio di stile principale (mobile first)
   ========================================================================= */
@font-face { font-family: "Cormorant"; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 700; font-display: swap; src: url(../fonts/cormorant-garamond-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans"; font-weight: 400; font-display: swap; src: url(../fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans"; font-weight: 600; font-display: swap; src: url(../fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans"; font-weight: 700; font-display: swap; src: url(../fonts/source-sans-3-latin-700-normal.woff2) format("woff2"); }

:root {
  --avorio: #f8f1e3;
  --carta: #fbf6ec;
  --beige: #eadcc2;
  --beige-2: #dcc8a6;
  --marrone: #4a2c1a;
  --marrone-2: #6b4429;
  --testo: #3a2416;
  --testo-2: #6d5543;
  --rosso: #8e1f1a;
  --rosso-2: #a8322a;
  --oro: #c49a3a;
  --oro-chiaro: #e9c877;
  --verde: #3f6a3a;
  --ombra: 0 1px 2px rgba(58,36,22,.08), 0 6px 18px rgba(58,36,22,.12);
  --ombra-forte: 0 10px 30px rgba(30,18,12,.28);
  --r: 16px;
  --font-titoli: "Cormorant", "Iowan Old Style", Georgia, serif;
  --font-testo: "Source Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --topbar: 56px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font: 400 17px/1.55 var(--font-testo);
  color: var(--testo);
  background: var(--avorio);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(196,154,58,.10), transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .12 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  padding-top: calc(var(--topbar) + var(--safe-t));
  padding-bottom: calc(var(--tabbar) + var(--safe-b));
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--rosso); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-titoli); font-weight: 700; line-height: 1.12; color: var(--marrone); margin: 0 0 .4em; letter-spacing: .005em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg:not(.ico) path, svg:not(.ico) circle, svg:not(.ico) rect { vector-effect: non-scaling-stroke; }
.skip { position: absolute; left: -999px; top: 0; z-index: 9999; background: #fff; padding: 8px 12px; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 2rem; text-align: center; }

/* ---------- Barra superiore ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  height: calc(var(--topbar) + var(--safe-t)); padding: var(--safe-t) 8px 0;
  display: flex; align-items: center; gap: 4px;
  background: linear-gradient(180deg, #3a2214, #4a2c1a);
  color: var(--avorio);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  border-bottom: 2px solid var(--oro);
}
.topbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { position: relative; width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; border-radius: 50%; color: inherit; cursor: pointer; }
.icon-btn:active { background: rgba(255,255,255,.12); }
.brand { flex: 1; display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; padding-left: 6px; }
.brand-star { color: var(--oro-chiaro); font-size: 20px; animation: twinkle 3.5s ease-in-out infinite; }
.brand-text { font-family: var(--font-titoli); font-weight: 700; font-size: 1.28rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .02em; }
.brand-text em { font-style: normal; color: var(--oro-chiaro); }
.badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rosso-2); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 1.5px solid var(--marrone); }
.demo-ribbon {
  position: fixed; z-index: 999; top: calc(var(--topbar) + var(--safe-t)); left: 0; right: 0;
  background: repeating-linear-gradient(135deg, #8e1f1a 0 12px, #7b1915 12px 24px);
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: 3px 8px;
}
body.has-demo main { padding-top: 22px; }

/* ---------- Barra inferiore ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 1000;
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--carta); border-top: 1px solid var(--beige-2);
  box-shadow: 0 -4px 16px rgba(58,36,22,.08);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--testo-2); font-size: 12.5px; font-weight: 600; position: relative; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--rosso); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--oro); }

/* ---------- Layout generale ---------- */
main { outline: none; }
.page { max-width: 760px; margin: 0 auto; padding: 18px 16px 28px; animation: pageIn .35s ease both; }
.page-head { margin: 6px 0 16px; }
.page-head .kicker { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--rosso); font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.page-head p { color: var(--testo-2); margin: 0; }
.ornament { display: flex; align-items: center; gap: 10px; color: var(--oro); margin: 22px 0 14px; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--oro), transparent); }
.ornament span { font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 22px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 1.02rem; letter-spacing: .02em; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn:active { transform: scale(.97); }
.btn .ico { width: 22px; height: 22px; }
.btn-primary { background: linear-gradient(180deg, #a8322a, #8e1f1a); color: #fff; box-shadow: 0 4px 14px rgba(142,31,26,.35), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-gold { background: linear-gradient(180deg, #e2bf68, #c49a3a); color: #3a2214; box-shadow: 0 4px 14px rgba(196,154,58,.35), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-ghost { background: var(--carta); color: var(--marrone); border: 1.5px solid var(--beige-2); }
.btn-light { background: rgba(248,241,227,.14); color: var(--avorio); border: 1.5px solid rgba(248,241,227,.5); backdrop-filter: blur(4px); }
.btn-block { width: 100%; }
.btn-sm { min-height: 42px; padding: 8px 16px; font-size: .95rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 140px; }

.card { background: var(--carta); border-radius: var(--r); box-shadow: var(--ombra); border: 1px solid rgba(220,200,166,.7); }
.card-pad { padding: 16px; }
.muted { color: var(--testo-2); }
.small { font-size: .9rem; }
.empty { text-align: center; padding: 34px 18px; color: var(--testo-2); }
.empty .ico { width: 44px; height: 44px; color: var(--oro); margin: 0 auto 10px; display: block; stroke-width: 1.4; }

/* ---------- HOME ---------- */
.hero { position: relative; min-height: 76vh; min-height: 76svh; display: flex; flex-direction: column; justify-content: flex-end; color: var(--avorio); overflow: hidden; margin-top: -2px; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,10,5,0) 25%, rgba(20,10,5,.55) 60%, rgba(30,16,8,.92) 100%); }
.hero-content { position: relative; z-index: 2; padding: 0 20px 26px; max-width: 640px; width: 100%; margin: 0 auto; animation: heroIn .9s ease both; }
.hero .kicker { font-size: 12.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--oro-chiaro); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.hero .kicker::after { content: ""; width: 40px; height: 1px; background: var(--oro-chiaro); }
.hero h1 { color: #fff7e4; font-size: clamp(2.5rem, 11vw, 3.6rem); margin: 6px 0 6px; text-shadow: 0 2px 18px rgba(0,0,0,.5); line-height: 1; }
.hero h1 small { display: block; font-size: .5em; color: var(--oro-chiaro); letter-spacing: .04em; margin-top: 6px; font-weight: 600; }
.hero .welcome { font-size: 1.08rem; color: #f3e6d0; margin: 10px 0 18px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.hero-actions { display: grid; gap: 10px; }
.hero-actions .btn-primary { min-height: 58px; font-size: 1.12rem; }
.hero-actions .sub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.snow { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.snow i { position: absolute; top: -10px; width: 4px; height: 4px; border-radius: 50%; background: #fff; opacity: .7; animation: fall linear infinite; }

.info-strip { display: grid; gap: 10px; margin: -14px 16px 0; position: relative; z-index: 3; }
.info-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.info-item .ico { color: var(--rosso); margin-top: 2px; width: 24px; height: 24px; }
.info-item strong { display: block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--testo-2); }
.avviso { background: #fff3d6; border: 1px solid var(--oro); border-left: 5px solid var(--oro); border-radius: 12px; padding: 12px 14px; margin: 14px 16px 0; font-weight: 600; }
.resume { margin: 14px 16px 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; }
.resume .ring { width: 46px; height: 46px; flex: none; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick a { display: flex; flex-direction: column; gap: 8px; padding: 16px; text-decoration: none; color: var(--testo); min-height: 108px; position: relative; overflow: hidden; transition: transform .15s; }
.quick a:active { transform: scale(.98); }
.quick a .ico { width: 30px; height: 30px; color: var(--rosso); stroke-width: 1.5; }
.quick a b { font-family: var(--font-titoli); font-size: 1.3rem; color: var(--marrone); line-height: 1.1; }
.quick a span { font-size: .88rem; color: var(--testo-2); line-height: 1.3; }
.quick a::after { content: ""; position: absolute; right: -18px; bottom: -18px; width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle, rgba(196,154,58,.22), transparent 70%); }
.intro { font-size: 1.05rem; }
.footer { text-align: center; color: var(--testo-2); font-size: .85rem; padding: 24px 16px 8px; }
.footer a { color: var(--testo-2); }

/* ---------- MAPPA ---------- */
.mapview { position: fixed; z-index: 10; top: calc(var(--topbar) + var(--safe-t)); bottom: calc(var(--tabbar) + var(--safe-b)); left: 0; right: 0; background: #e8dcc6; }
.map { position: absolute; inset: 0; }
.leaflet-container { font-family: var(--font-testo); background: #eadfca; }
.leaflet-tile-pane { filter: sepia(.32) saturate(.82) brightness(1.03) contrast(.96); }
.leaflet-control-attribution { font-size: 10px; background: rgba(251,246,236,.85) !important; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--ombra) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--marrone) !important; background: var(--carta) !important; font-size: 20px !important; }
body.has-demo .mapview .leaflet-top { top: 22px; }
.map-tools { position: absolute; right: 12px; bottom: 76px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.fab { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--carta); color: var(--marrone); box-shadow: var(--ombra-forte); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fab.on { background: #2e6fd6; color: #fff; }
.fab[aria-pressed="false"] { opacity: .6; }
.map-chips { position: absolute; top: 10px; left: 58px; right: 10px; z-index: 500; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; }
body.has-demo .map-chips { top: 30px; }
.map-chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--beige-2); background: var(--carta); color: var(--marrone); font-weight: 600; font-size: .92rem; box-shadow: 0 2px 8px rgba(58,36,22,.12); cursor: pointer; white-space: nowrap; }
.chip .ico { width: 18px; height: 18px; }
.chip.on { background: var(--marrone); color: var(--avorio); border-color: var(--marrone); }
.map-list-toggle { position: absolute; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 500; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: var(--marrone); color: var(--avorio); text-decoration: none; font-weight: 700; box-shadow: var(--ombra-forte); font-size: .95rem; }
.map-list-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Marcatori numerati */
.pin { width: 44px; height: 54px; position: relative; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); transition: transform .2s; }
.pin svg.shape { position: absolute; inset: 0; width: 44px; height: 54px; }
.pin .num { position: absolute; top: 8px; left: 0; width: 44px; text-align: center; color: #fff; font: 700 17px/26px var(--font-testo); }
.pin .cat { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--carta); display: grid; place-items: center; border: 1.5px solid currentColor; }
.pin .cat .ico { width: 15px; height: 15px; stroke-width: 2; }
.pin.active { transform: scale(1.18) translateY(-4px); z-index: 1000 !important; }
.pin.fav .num::after { content: "♥"; position: absolute; left: -4px; top: -12px; font-size: 13px; color: var(--rosso); text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.pin.current { animation: bob 1.6s ease-in-out infinite; }
.pin.done { opacity: .62; }
.spin { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.spin .ico { width: 20px; height: 20px; stroke-width: 2; }
.me-dot { width: 20px; height: 20px; border-radius: 50%; background: #2e6fd6; border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(46,111,214,.5); animation: pulse 2s infinite; }
.route-label { background: transparent; border: 0; }

/* Scheda a scomparsa sopra la mappa */
.sheet { position: absolute; z-index: 700; left: 8px; right: 8px; bottom: 8px; max-width: 520px; margin: 0 auto; background: var(--carta); border-radius: 20px; box-shadow: var(--ombra-forte); overflow: hidden; animation: sheetIn .28s cubic-bezier(.2,.8,.2,1) both; border: 1px solid var(--beige-2); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--beige-2); margin: 8px auto 0; }
.sheet-body { display: flex; gap: 12px; padding: 10px 14px 4px; }
.sheet-photo { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; flex: none; background: var(--beige); }
.sheet h3 { margin: 0 0 4px; font-size: 1.35rem; }
.sheet .meta { font-size: .88rem; color: var(--testo-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.sheet .desc { font-size: .95rem; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sheet .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 14px 14px; }
.sheet .close { position: absolute; top: 6px; right: 6px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(58,36,22,.08); display: grid; place-items: center; cursor: pointer; }

.numbadge { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; background: var(--rosso); color: #fff; font-weight: 700; font-size: .95rem; flex: none; }
.cat-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cat-tag .ico { width: 16px; height: 16px; }

/* ---------- ELENCO TAPPE ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--carta); border: 1.5px solid var(--beige-2); border-radius: 999px; padding: 0 14px; min-height: 48px; }
.search input { border: 0; background: transparent; font: inherit; flex: 1; min-width: 0; outline: none; color: var(--testo); }
.search .ico { color: var(--testo-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { box-shadow: none; }
.list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.trow { display: flex; align-items: stretch; overflow: hidden; text-decoration: none; color: inherit; animation: rowIn .35s ease both; }
.trow .thumb { width: 104px; flex: none; position: relative; background: var(--beige); }
.trow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.trow .thumb .numbadge { position: absolute; left: 8px; top: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.trow .tbody { flex: 1; padding: 12px 12px 12px 14px; min-width: 0; }
.trow h3 { font-size: 1.25rem; margin: 2px 0 2px; }
.trow p { margin: 0; font-size: .92rem; color: var(--testo-2); line-height: 1.35; }
.trow .tmeta { display: flex; gap: 10px; font-size: .82rem; color: var(--testo-2); margin-top: 6px; flex-wrap: wrap; }
.trow .tmeta span { display: inline-flex; align-items: center; gap: 4px; }
.trow .tmeta .ico { width: 15px; height: 15px; }
.favbtn { width: 48px; flex: none; border: 0; background: transparent; display: grid; place-items: center; color: var(--beige-2); cursor: pointer; }
.favbtn .ico { width: 26px; height: 26px; }
.favbtn.on { color: var(--rosso); }
.favbtn.on .ico { fill: currentColor; }
.favbtn.pop .ico { animation: pop .35s ease; }

/* ---------- SCHEDA TAPPA ---------- */
.detail-hero { position: relative; margin: -18px -16px 0; }
.detail-hero img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--beige); }
.detail-hero .caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px; background: linear-gradient(transparent, rgba(20,10,5,.82)); color: #fff; }
.detail-hero .caption h1 { color: #fff7e4; margin: 6px 0 0; font-size: 2.15rem; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.detail-hero .caption .cat-tag { color: var(--oro-chiaro); }
.detail-hero .fotocred { position: absolute; right: 8px; top: 8px; font-size: 11px; color: #fff; background: rgba(0,0,0,.4); padding: 2px 8px; border-radius: 10px; }
.bignum { display: inline-flex; align-items: center; gap: 8px; }
.bignum .numbadge { width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; border: 2px solid var(--oro-chiaro); }
.lead { font-size: 1.12rem; font-family: var(--font-titoli); font-weight: 600; color: var(--marrone-2); font-style: italic; margin: 16px 0 6px; line-height: 1.35; }
.section { margin-top: 18px; }
.section h2 { font-size: 1.4rem; display: flex; align-items: center; gap: 8px; }
.section h2 .ico { color: var(--rosso); width: 22px; height: 22px; }
.bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.bullets li { padding-left: 24px; position: relative; }
.bullets li::before { content: "✦"; position: absolute; left: 2px; top: 0; color: var(--oro); font-size: .9em; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.people span { background: var(--beige); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .95rem; color: var(--marrone); }
.curio { background: linear-gradient(135deg, #fff6df, #f7ecd2); border: 1px dashed var(--oro); border-radius: var(--r); padding: 14px 16px; position: relative; }
.curio::before { content: "Lo sapevi?"; display: block; font-family: var(--font-titoli); font-weight: 700; font-size: 1.15rem; color: var(--rosso); margin-bottom: 4px; }
.timebox { display: flex; gap: 10px; align-items: center; background: var(--carta); border: 1px solid var(--beige-2); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.timebox .ico { color: var(--rosso); }
.acc { display: flex; gap: 10px; border-radius: 12px; padding: 12px 14px; align-items: flex-start; }
.acc .ico { margin-top: 2px; }
.acc-ok { background: #e7f0df; color: #2c4c27; }
.acc-mid { background: #fbefd6; color: #6b4a12; }
.acc-no { background: #f6dfdb; color: #7a1d17; }
.acc p { margin: 2px 0 0; font-size: .92rem; }
.minimap { height: 200px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--beige-2); position: relative; z-index: 1; }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar) + var(--safe-b) + 8px); z-index: 20; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 20px; padding: 8px; background: rgba(248,241,227,.92); backdrop-filter: blur(8px); border-radius: 999px; box-shadow: var(--ombra-forte); border: 1px solid var(--beige-2); }
.round { width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--beige-2); background: var(--carta); display: grid; place-items: center; color: var(--marrone); cursor: pointer; }
.round.on { color: var(--rosso); }
.round.on .ico { fill: currentColor; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.prevnext a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; text-decoration: none; color: var(--testo); font-size: .9rem; }
.prevnext a b { font-family: var(--font-titoli); font-size: 1.1rem; color: var(--marrone); line-height: 1.15; }
.prevnext a.next { text-align: right; }
.prevnext small { color: var(--testo-2); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700; }

/* ---------- GUIDA / SEGUI IL PRESEPE ---------- */
.guide-top { position: sticky; top: calc(var(--topbar) + var(--safe-t)); z-index: 30; margin: -18px -16px 14px; padding: 12px 16px 10px; background: var(--marrone); color: var(--avorio); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
body.has-demo .guide-top { top: calc(var(--topbar) + var(--safe-t) + 22px); }
.guide-top .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.guide-top .step { font-family: var(--font-titoli); font-size: 1.35rem; font-weight: 700; }
.guide-top .pct { font-weight: 700; color: var(--oro-chiaro); }
.progress { height: 8px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--oro), var(--oro-chiaro)); border-radius: 4px; transition: width .5s ease; }
.dots { display: flex; gap: 4px; margin-top: 8px; }
.dots a { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); }
.dots a.done { background: var(--oro); }
.dots a.cur { background: #fff; }
.guide-card { overflow: hidden; }
.guide-card img { width: 100%; aspect-ratio: 2/1; object-fit: cover; }
.guide-card .body { padding: 14px 16px 16px; }
.guide-card h2 { font-size: 1.9rem; margin: 6px 0 4px; }
.guide-nav { position: sticky; bottom: calc(var(--tabbar) + var(--safe-b) + 8px); z-index: 20; display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 16px; }
.guide-nav .btn-ghost { width: 56px; padding: 0; }
.nextbox { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 14px; }
.nextbox .ico { color: var(--oro); }
.nextbox small { display: block; color: var(--testo-2); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700; }
.nextbox b { font-family: var(--font-titoli); font-size: 1.2rem; color: var(--marrone); }
.distance { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; font-weight: 700; color: #2e6fd6; }
.distance .ico { width: 16px; height: 16px; }
.finish { text-align: center; padding: 30px 10px; }
.finish .star { font-size: 64px; color: var(--oro); animation: twinkle 2.5s ease-in-out infinite; line-height: 1; }
.collapse summary { cursor: pointer; font-weight: 700; color: var(--rosso); list-style: none; display: flex; align-items: center; gap: 6px; padding: 8px 0; }
.collapse summary::-webkit-details-marker { display: none; }
.collapse summary::after { content: "▾"; transition: transform .2s; }
.collapse[open] summary::after { transform: rotate(180deg); }

/* ---------- PROGRAMMA ---------- */
.day { margin-bottom: 22px; }
.day-title { position: sticky; top: calc(var(--topbar) + var(--safe-t)); z-index: 5; background: var(--avorio); padding: 8px 0; font-family: var(--font-titoli); font-size: 1.45rem; font-weight: 700; color: var(--marrone); border-bottom: 1px solid var(--beige-2); margin-bottom: 10px; text-transform: capitalize; }
body.has-demo .day-title { top: calc(var(--topbar) + var(--safe-t) + 22px); }
.event { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--beige-2); }
.event .time { font-weight: 700; color: var(--rosso); font-size: 1.05rem; line-height: 1.2; }
.event .time small { display: block; color: var(--testo-2); font-weight: 600; font-size: .8rem; }
.event h3 { font-size: 1.22rem; margin: 0 0 2px; }
.event p { margin: 0; font-size: .94rem; color: var(--testo-2); }
.event .where { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-weight: 600; font-size: .9rem; text-decoration: none; }
.event .where .ico { width: 16px; height: 16px; }
.event.special h3::before { content: "✦ "; color: var(--oro); }
.live { display: inline-block; background: var(--rosso); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; animation: blink 1.6s ease-in-out infinite; }
.past { opacity: .5; }

/* ---------- SERVIZI ---------- */
.sgroup { margin-bottom: 18px; }
.sgroup h2 { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }
.sgroup h2 .sicon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.sgroup h2 .sicon .ico { width: 22px; height: 22px; }
.sitem { padding: 12px 14px; margin-bottom: 8px; }
.sitem b { display: block; font-size: 1.05rem; }
.sitem p { margin: 2px 0 8px; font-size: .94rem; color: var(--testo-2); }
.sitem .btn-row .btn { flex: 0 1 auto; }

/* ---------- MODALE ---------- */
.modal { position: fixed; inset: 0; z-index: 3000; background: rgba(20,10,5,.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease both; }
.modal-box { width: 100%; max-width: 520px; background: var(--carta); border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); animation: sheetIn .28s cubic-bezier(.2,.8,.2,1) both; }
.modal-box h2 { font-size: 1.5rem; }
.share-grid { display: grid; gap: 10px; }
.share-grid .btn { justify-content: flex-start; }
.wa { background: #25d366; color: #fff; }

/* ---------- TOAST ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 16px); transform: translate(-50%, 20px); background: var(--marrone); color: var(--avorio); padding: 12px 18px; border-radius: 12px; box-shadow: var(--ombra-forte); z-index: 4000; opacity: 0; pointer-events: none; transition: all .25s ease; max-width: calc(100% - 32px); font-weight: 600; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animazioni ---------- */
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes twinkle { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.88); } }
@keyframes fall { to { transform: translate3d(var(--dx, 20px), 110vh, 0); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,111,214,.5); } 70% { box-shadow: 0 0 0 16px rgba(46,111,214,0); } 100% { box-shadow: 0 0 0 0 rgba(46,111,214,0); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes blink { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .snow { display: none; }
}

/* ---------- Schermi più grandi ---------- */
@media (min-width: 760px) {
  .hero { min-height: 70vh; }
  .info-strip { grid-template-columns: repeat(3, 1fr); max-width: 760px; margin: -20px auto 0; }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .detail-hero { margin: 0 0 0; border-radius: var(--r); overflow: hidden; }
  .guide-top { margin: -18px 0 14px; border-radius: 0 0 var(--r) var(--r); }
  .avviso, .resume { max-width: 728px; margin-left: auto; margin-right: auto; }
}

@media print {
  .topbar, .tabbar, .sticky-actions, .guide-nav, .demo-ribbon { display: none !important; }
  body { padding: 0; background: #fff; }
}

/* Percorso animato sulla mappa */
.route-anim { stroke-dasharray: 10 9; animation: dash 1.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -19; } }
.pl-pin, .pl-spin, .pl-me { background: none; border: 0; }
@media (prefers-reduced-motion: reduce) { .route-anim { animation: none; } }
.pin svg.shape { z-index: 0; }
.pin .num { z-index: 1; }
.pin .cat { z-index: 2; }
.hero-actions .sub .btn { font-size: .9rem; padding: 10px 10px; gap: 6px; letter-spacing: 0; min-height: 50px; }
.hero-actions .sub .btn .ico { width: 20px; height: 20px; }
