:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #1c1f23;
  --muted: #5d6670;
  --line: #e2ded5;
  --accent: #155e75;
  --accent-text: #ffffff;
  --warn-bg: #fff4e0;
  --warn-text: #7a4b00;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --surface: #1e2227;
    --text: #e9ecef;
    --muted: #9aa3ad;
    --line: #2e343b;
    --accent: #5fb4cc;
    --accent-text: #0d1a1f;
    --warn-bg: #3a2c12;
    --warn-text: #f3d39b;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
a { color: var(--accent); }

.bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  border-bottom: 1px solid var(--line);
}
.bar h1 { margin: 0 0 6px; font-size: 18px; letter-spacing: 0.01em; }
.controls { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 16px; }
.controls select {
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
}

/* Provvisorio, per le prove: cerca attorno a un punto toccato sulla mappa invece che alla posizione vera. */
.fly {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
}
.fly[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.flying .fly { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.flying #map { cursor: crosshair; }

.notice {
  margin: 0;
  padding: 8px var(--gutter);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 14px;
}
.notice button {
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* isolation: i controlli di Leaflet (z-index 1000) restano sotto l'intestazione fissa. */
#map { isolation: isolate; height: 48vh; min-height: 260px; max-height: 520px; background: var(--line); }

main { padding: 12px var(--gutter) 8px; }
.summary { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.item .dist { grid-row: 1; grid-column: 2; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .meta { grid-column: 1 / -1; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.item .live { color: #1a7f37; font-weight: 600; }
.item a { font-size: 14px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.empty { color: var(--muted); padding: 8px 0; }

.sec { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.next { margin: 4px 0 12px; font-size: 15px; overflow-wrap: anywhere; }
.linklike { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; text-align: left; }
.allday { margin-top: 14px; }
.allday summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 0; }
.allday .list { margin-top: 8px; }
.allday .item { opacity: 0.85; }
.alerts { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.alerts button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.toasts {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 1100;
  display: grid;
  gap: 8px;
}
.toast {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.toast strong { font-size: 15px; overflow-wrap: anywhere; }

.foot .gestori { margin: 0 0 8px; font-size: 15px; }

.foot { padding: 8px var(--gutter) calc(16px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12px; }

.leaflet-popup-content { margin: 10px 12px; font-size: 14px; line-height: 1.4; }
.leaflet-popup-content h3 { margin: 0 0 4px; font-size: 15px; }
.leaflet-popup-content p { margin: 2px 0; }

/* Offerte lampo dei locali e tessere: sezioni a parte sotto gli eventi, mai mescolate. */
.deals, .cards { margin-top: 18px; }
.deal { border-color: #d97706; border-style: dashed; }
.deal .badge, .card-item .badge {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
}
.deal .deal-what { grid-column: 1 / -1; margin: 0; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.deal .use, .card-item .use, .btn {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.deal .use, .card-item .use { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
.deal .use.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.card-item { cursor: default; }
.stamps-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.stamp-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); }
.stamp-dot.on { background: var(--accent); }
.small-note { color: var(--muted); font-size: 13px; }

/* Schermo da mostrare al cassiere (offerta lampo o premio), come una schermata di ritiro. */
.cashier-open { overflow: hidden; }
.cashier {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: calc(16px + env(safe-area-inset-top)) var(--gutter) calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #0f4c5c;
  color: #fff;
  text-align: center;
}
.cashier.is-done { background: #166534; }
.cashier-close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: var(--gutter);
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.cashier-kicker { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.cashier-place { margin: 0; font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
.cashier-title { margin: 8px 0 0; font-size: 40px; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.cashier-detail { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.cashier-time { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.cashier-clock { margin: 0; font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cashier-pulse { width: 14px; height: 14px; border-radius: 50%; background: #fde047; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { transform: scale(0.6); opacity: 0.5; } to { transform: scale(1.2); opacity: 1; } }
.cashier-day { margin: 0; font-size: 16px; opacity: 0.85; }
.cashier-status { min-height: 1.4em; margin: 12px 0 0; font-size: 22px; font-weight: 700; }
.cashier.is-done .cashier-status::before { content: "✓ "; }
.slide {
  position: relative;
  width: min(100%, 360px);
  height: 64px;
  margin-top: 16px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.slide-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.25); }
.slide-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-left: 48px; font-weight: 600; pointer-events: none; }
.slide-knob {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #0f4c5c;
  font-size: 26px;
  font-weight: 700;
  touch-action: none;
  cursor: grab;
}
.slide.is-back .slide-knob, .slide.is-back .slide-fill { transition: transform 0.25s, width 0.25s; }

/* Segnaposto delle offerte lampo: pillola gialla, colore che nessuna categoria di eventi usa. */
.deal-pin span {
  display: block;
  width: 84px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #facc15;
  color: #422006;
  font: 700 12px/24px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.badge-inline { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 12px; font-weight: 600; }
.leaflet-popup-content .use {
  min-height: 40px;
  margin-top: 6px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #155e75;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.leaflet-popup-content .use.secondary { background: transparent; color: #155e75; border: 1px solid #155e75; }

/* ===================================================================================
   Tema della serata: solo la pagina principale (body.app). Le pagine dei gestori restano chiare.
   Fondo scuro, un colore acceso (corallo) per le azioni, verde lime per cio' che e' in corso.
   =================================================================================== */
.app {
  --bg: #0e0f13;
  --surface: #181a21;
  --surface-2: #22252e;
  --text: #f5f2ec;
  --muted: #a3a7b4;
  --line: #2b2e38;
  --accent: #ff5a4e;
  --accent-text: #1a0503;
  --live: #b6f24a;
  --warn-bg: #2d2412;
  --warn-text: #f6d58f;
  --display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(255, 90, 78, 0.16), transparent 60%),
    radial-gradient(90% 50% at 0% 10%, rgba(139, 147, 255, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.app a { color: var(--accent); }
.app [hidden] { display: none !important; }
/* Su schermi larghi una colonna da telefono al centro. */
.app main, .app .bar > *, .app .notice, .app .foot { max-width: 640px; margin-left: auto; margin-right: auto; }
.app .notice { border-radius: 0 0 12px 12px; }

.app .bar {
  background: rgba(14, 15, 19, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 800 19px/1 var(--display); letter-spacing: -0.01em; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 78, 0.22); }
.app .controls { gap: 8px; }
.chip-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 38px;
  padding: 0 30px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a3a7b4' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}
.app .fly { min-height: 34px; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; }
.app .fly[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.app.flying .fly { background: var(--accent); color: var(--accent-text); }

.app main { padding-top: 18px; }
.hero { margin-bottom: 14px; }
.headline { margin: 0 0 6px; font: 800 clamp(28px, 8vw, 40px)/1.04 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.app .summary { font-size: 15px; margin-bottom: 12px; }

.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.pill.on { background: var(--c, var(--text)); border-color: var(--c, var(--text)); color: #111; }

/* La scheda grande: la cosa da fare adesso. */
.feat {
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.feat:focus-visible, .ev:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.feat.is-live { border-color: rgba(182, 242, 74, 0.55); box-shadow: 0 0 0 1px rgba(182, 242, 74, 0.25), 0 18px 40px rgba(0, 0, 0, 0.35); }
.feat-media { position: relative; height: 180px; }
.feat-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.feat-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(24, 26, 33, 0.95)); pointer-events: none; }
.feat-cat {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 15, 19, 0.75);
  backdrop-filter: blur(6px);
  font-size: 13px;
  font-weight: 600;
}
.feat-body { padding: 4px 16px 16px; }
.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  color: var(--accent);
  font: 800 22px/1.1 var(--display);
}
.feat.is-live .kicker { color: var(--live); }
.feat-title { margin: 0 0 8px; font: 800 24px/1.12 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.app .meta { margin: 2px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.app .meta strong { color: var(--text); font-weight: 600; }
.feat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.btn-go {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text) !important;
  font-weight: 700;
  text-decoration: none;
}
.src { font-size: 14px; color: var(--muted) !important; }

/* Riquadro al posto della foto: colore e icona della categoria. */
.tile {
  display: grid;
  place-items: center;
  background:
    radial-gradient(80% 90% at 30% 20%, color-mix(in srgb, var(--c) 55%, transparent), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--c) 35%, #14151b), #14151b);
}
.feat-media .tile { width: 100%; height: 100%; font-size: 64px; }
.tile span { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4)); }

/* Mappa piccola sotto la scheda grande; "Mappa grande" la allunga. */
.map-wrap { position: relative; margin: 0 0 6px; }
.app #map {
  height: 190px;
  min-height: 0;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #1b1d24;
  transition: height 0.25s ease;
}
.map-big #map { height: 62vh; }
.app .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.6); }
.map-toggle {
  position: absolute;
  z-index: 500;
  right: 10px;
  bottom: 22px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 15, 19, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.app .leaflet-control-attribution { background: rgba(14, 15, 19, 0.7); color: var(--muted); font-size: 10px; }
.app .leaflet-control-attribution a { color: var(--muted); }
.app .leaflet-popup-content-wrapper, .app .leaflet-popup-tip { background: var(--surface-2); color: var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.app .leaflet-popup-close-button { color: var(--muted) !important; }

.ev-pin span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #0e0f13;
  border-radius: 50%;
  background: var(--c);
  font-size: 17px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.ev-pin.is-faded span { opacity: 0.55; transform: scale(0.82); }
.ev-pin.is-live span { position: relative; border-color: #b6f24a; }
.ev-pin.is-live span::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid #b6f24a;
  border-radius: 50%;
  animation: ring 1.8s ease-out infinite;
}
@keyframes ring { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.9); opacity: 0; } }

/* Pallino verde che pulsa: "in corso". */
.live-dot {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b6f24a;
  box-shadow: 0 0 0 0 rgba(182, 242, 74, 0.7);
  animation: beat 1.6s ease-out infinite;
}
@keyframes beat { 70% { box-shadow: 0 0 0 8px rgba(182, 242, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(182, 242, 74, 0); } }
@media (prefers-reduced-motion: reduce) {
  .live-dot, .ev-pin.is-live span::after { animation: none; }
}

.app .sec {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 10px;
  color: var(--text);
  font: 800 18px/1.2 var(--display);
  letter-spacing: 0;
  text-transform: none;
}

/* Schede degli eventi: foto o riquadro a sinistra, conto alla rovescia in alto. */
.ev {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
}
.ev.is-live { border-color: rgba(182, 242, 74, 0.4); }
.ev .thumb { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; font-size: 34px; }
.ev-body { min-width: 0; }
.ev h3 { margin: 4px 0 2px; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.ev-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 90, 78, 0.16);
  color: #ff8a80;
  font-size: 13px;
  font-weight: 700;
}
.count.is-live { background: rgba(182, 242, 74, 0.14); color: var(--live); }
.cat { color: var(--c); font-size: 12px; font-weight: 600; }
.ev .src { display: inline-block; margin-top: 4px; font-size: 13px; }
.ev.is-allday { opacity: 0.9; }

.app .allday summary { color: var(--text); font: 800 16px/1.2 var(--display); padding: 10px 0; }
.app .allday .item, .app .allday .ev { opacity: 1; }
.app .item { background: var(--surface); }
.app .toast { color: var(--accent-text); }
.app .alerts button { border-radius: 999px; }
.app .foot { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.app .leaflet-popup-content .use { background: var(--accent); color: var(--accent-text); }
.app .leaflet-popup-content .use.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }

/* Provincia in alto e luoghi visitati (solo sul telefono). */
.where { margin: -2px 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.where .off { color: var(--warn-text); font-weight: 400; }
.places-map { height: 220px; margin: 8px 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #1b1d24; }
.place-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.place-list strong { color: var(--text); }
.prov-pin span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid #0e0f13;
  border-radius: 50%;
  background: var(--accent, #ff5a4e);
  color: #1a0503;
  font: 800 13px/1 system-ui, sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Distanza e tempo: un bottone in alto apre due cursori. */
.range-btn { padding-right: 30px; cursor: pointer; }
.range-panel { display: grid; gap: 14px; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.range { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.range output { color: var(--text); font-weight: 700; }
.range input[type="range"] { width: 100%; height: 28px; margin: 0; accent-color: var(--accent); }

/* Dettaglio dell'evento: un pannello che sale dal basso, dentro l'app. */
.sheet { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.sheet-panel {
  position: relative;
  width: min(100%, 640px);
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  padding-bottom: env(safe-area-inset-bottom);
  animation: rise 0.22s ease-out;
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel { animation: none; } }
.sheet-open { overflow: hidden; }
.sheet-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(14, 15, 19, 0.75);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.sheet-media { position: relative; height: 200px; }
.sheet-media .tile { width: 100%; height: 100%; font-size: 72px; }
.sheet-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(24, 26, 33, 0.95)); pointer-events: none; }
.sheet-text { padding: 4px 18px 22px; }
.sheet-text .ev-top { margin-bottom: 6px; }
.sheet-desc { margin: 12px 0 0; font-size: 15px; line-height: 1.5; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn-ghost {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sheet-out { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.sheet-out a { font-weight: 600; }

/* Testo in fondo: una riga, il resto si apre. */
.app .foot .info summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
.app .foot .info p { margin: 8px 0 0; line-height: 1.5; }

/* Via vicina sotto il titolo. */
.near { margin: 0 0 6px; color: var(--text); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

/* Condividi, salva, segui (2026-11-03): stessi bottoni del dettaglio, acceso quando e' attivo. */
.btn-ghost.is-on { border-color: var(--accent); color: var(--accent); }
.org-line { margin-top: 8px; }
.org-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.fav { margin-left: 6px; color: var(--accent); font-size: 12px; font-weight: 700; }
.org-sheet { padding-top: 22px; }
.org-sheet .feat-title { padding-right: 48px; }
.org-sheet .sec { margin-top: 22px; }
.ev.short { grid-template-columns: 1fr; }
.tg-login { margin: 16px 0 8px; min-height: 48px; }
.foot .account { margin: 0 0 8px; font-size: 14px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Distanza e tempo in alto a destra, al posto di "Vola altrove", che sta sotto la mappa (Marco, 2026-11-03). */
.brand-row .range-btn { min-height: 34px; font-size: 14px; }
.map-bar { margin: 0 0 10px; }
.map-bar[hidden], .map-bar:has(.fly[hidden]) { display: none; }
