/* ============================================================
   100ottani — app mappa ("strumento di bordo")
   Superfici verde benzina, ambra come lancetta, prezzi come chip.
   ============================================================ */

* { box-sizing: border-box; }

html, body { height: 100%; }

.app-body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-m);
  background: var(--color-bg);
  color: var(--color-text);
  overflow: hidden;
  overscroll-behavior: none;
}

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-s); }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 300; background: var(--color-surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius-s); }
.skip-link:focus { left: var(--space-3); top: var(--space-3); }

/* --- barra superiore ------------------------------------------------------ */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: calc(var(--space-2) + env(safe-area-inset-top)) var(--space-3) var(--space-2);
  background: color-mix(in srgb, var(--color-surface) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-line);
}

.brand { display: inline-flex; align-items: baseline; gap: 0.3ch; text-decoration: none; flex-shrink: 0; }
.brand-mark {
  background: linear-gradient(160deg, var(--green-600), var(--green-800));
  color: #fff;
  font-weight: 850;
  font-size: var(--text-m);
  border-radius: var(--radius-s);
  padding: 0.1em 0.38em;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), var(--shadow-1);
}
.brand-name { color: var(--color-text); font-weight: 680; letter-spacing: -0.01em; }

.searchbox { position: relative; flex: 1; min-width: 0; }
.searchbox-icon {
  position: absolute; left: 10px; top: 50%; translate: 0 -50%;
  width: 18px; height: 18px; fill: var(--color-muted); pointer-events: none;
}
#search {
  width: 100%;
  height: 44px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text);
  padding: 0 var(--space-4) 0 36px;
  font: inherit;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
#search:focus { border-color: var(--color-primary); background: var(--color-surface); }
#search::placeholder { color: var(--color-muted); }

.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  max-height: 50vh;
  overflow-y: auto;
}
.search-results [role="option"] {
  display: block; width: 100%; text-align: left;
  padding: var(--space-3);
  border: 0; border-bottom: 1px solid var(--color-line);
  background: none; color: var(--color-text); font: inherit; cursor: pointer;
}
.search-results [role="option"]:last-child { border-bottom: 0; }
.search-results [role="option"]:hover,
.search-results [role="option"][aria-selected="true"] { background: var(--color-surface-2); }
.search-results small { color: var(--color-muted); display: block; }

.iconbtn {
  position: relative;
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.iconbtn:active { transform: scale(0.94); }
.iconbtn svg { width: 20px; height: 20px; fill: currentColor; }
.iconbtn-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--color-accent); color: #3a2a05;
  font-size: 11px; font-weight: 750; line-height: 18px; text-align: center;
}

/* --- mappa ---------------------------------------------------------------- */

.map-wrap { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; background: var(--color-surface-2); }

.leaflet-container { font: inherit; }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--color-surface) 80%, transparent) !important;
  color: var(--color-muted) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--color-muted) !important; }
.leaflet-control-zoom { border: none !important; box-shadow: var(--shadow-2) !important; border-radius: var(--radius-m) !important; overflow: hidden; }
.leaflet-control-zoom a {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-line) !important;
  width: 40px !important; height: 40px !important; line-height: 40px !important;
}

.map-overlays {
  position: absolute;
  top: calc(64px + env(safe-area-inset-top) + var(--space-3));
  left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  pointer-events: none;
  z-index: 110;
}
.map-overlays > * { pointer-events: auto; }

.status-pill {
  background: color-mix(in srgb, var(--green-900) 88%, transparent);
  color: #eaf3ee;
  font-size: var(--text-s);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(6px);
  transition: opacity var(--transition-slow);
}
.status-pill[data-idle] { opacity: 0; pointer-events: none; }

.pill-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit; font-weight: 640; font-size: var(--text-s);
  cursor: pointer;
  box-shadow: var(--shadow-2);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.pill-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-muted); transition: background var(--transition-fast), box-shadow var(--transition-fast); }
.pill-toggle[aria-pressed="true"] { background: var(--green-800); border-color: var(--green-700); color: #f2f7f4; }
.pill-toggle[aria-pressed="true"] .pill-dot { background: var(--color-accent); box-shadow: 0 0 8px 1px color-mix(in srgb, var(--color-accent) 70%, transparent); }

/* --- marker: badge del distributore + etichetta prezzo -------------------- */

.price-pin { background: none; border: none; }
.pin {
  --pin-bg: var(--ink-500);
  --pin-ink: #ffffff;
  position: relative;
  display: block;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--pin-bg);
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-2);
  transform: translate(-50%, -100%);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.pin::after {  /* punta verso il punto esatto */
  content: "";
  position: absolute; left: 50%; bottom: -5px;
  width: 9px; height: 9px;
  background: var(--pin-bg);
  border-right: 2px solid var(--color-surface);
  border-bottom: 2px solid var(--color-surface);
  transform: translateX(-50%) rotate(45deg);
}
.pin:hover { transform: translate(-50%, -100%) scale(1.12); box-shadow: var(--shadow-3); z-index: 10; }
/* stazione senza conferma del 100 ottani: stesso badge, presenza attenuata */
.pin.is-unknown { opacity: 0.72; border-style: dashed; }

.pin-badge {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  border-radius: 7px;
  object-fit: contain;
  color: var(--pin-ink);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
img.pin-badge { background: #fff; padding: 2px; }

.pin-tag {
  position: absolute; right: -7px; bottom: -6px;
  z-index: 1;                      /* sopra la punta del pin */
  display: flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px;
  padding: 0 3px;
  border-radius: 5px;
  border: 1.5px solid var(--color-surface);
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  line-height: 1;
}
.pin-tag.is-cheap { background: var(--green-500); }
.pin-tag.is-mid   { background: var(--amber-500); color: #3b2a05; }
.pin-tag.is-dear  { background: var(--orange-500); }

.cluster-icon { background: none; border: none; }
.cluster-icon > span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--green-500), var(--green-800) 78%);
  color: #f2f7f2;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green-600) 28%, transparent), var(--shadow-2);
  transform: translate(-50%, -50%) translate(50%, 50%);
}

/* --- bottom sheet --------------------------------------------------------- */

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: min(92dvh, 860px);
  z-index: 150;
  background: var(--color-surface);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: 0 -8px 40px rgb(4 20 14 / 25%);
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.32, 0.72, 0.22, 1);
  touch-action: none;
  display: flex;
  flex-direction: column;
}
.sheet[data-dragging] { transition: none; }
.sheet[data-state="peek"] { transform: translateY(calc(100% - 158px - env(safe-area-inset-bottom))); }
.sheet[data-state="half"] { transform: translateY(46%); }
.sheet[data-state="full"] { transform: translateY(max(10px, env(safe-area-inset-top))); }
.sheet[data-state="hidden"] { transform: translateY(102%); }

.sheet-grip { padding: 10px 0 6px; cursor: grab; flex-shrink: 0; }
.sheet-grip span { display: block; width: 44px; height: 5px; margin: 0 auto; border-radius: 3px; background: var(--color-line); }

/* chiusura: sempre raggiungibile, sopra al contenuto che scorre */
.sheet-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-line);
  background: var(--color-surface-2);
  color: var(--color-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.sheet-close svg { width: 17px; height: 17px; }
.sheet-close:hover { background: var(--color-surface); color: var(--color-text); }
.sheet-close:active { transform: scale(0.92); }
.sheet-close:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.sheet-content {
  padding: 0 var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  flex: 1;
}

/* l'intestazione resta visibile mentre si scorre la scheda */
.st-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex; align-items: center; gap: var(--space-3);
  /* spazio per la X, che vive nel telaio del pannello: 34px + margine */
  padding: 2px 54px var(--space-3) 0;
  margin-bottom: 2px;
  background: var(--color-surface);
  box-shadow: 0 10px 12px -10px rgb(4 20 14 / 22%);
}
.st-head-text { min-width: 0; }
.st-brandtile {
  --bt-bg: var(--ink-500);
  --bt-ink: #fff;
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--bt-bg);
  color: var(--bt-ink);
  font-weight: 820; font-size: 15px; text-transform: uppercase; letter-spacing: -0.02em;
  box-shadow: var(--shadow-1);
}
.st-brandtile img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #fff; border-radius: inherit; }
/* Il nome è l'informazione che identifica l'impianto: due righe prima di
   troncare. L'indirizzo, spesso lungo e sporco, si accontenta di una. Così
   l'intestazione sticky non si mangia mezza scheda. */
.st-title {
  margin: 0;
  font-size: var(--text-l); line-height: 1.2; letter-spacing: -0.015em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.st-sub {
  margin: 3px 0 0;
  color: var(--color-muted); font-size: var(--text-s); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.st-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-3) 0 0; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); font-weight: 660;
  padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--color-surface-2); color: var(--color-muted);
  border: 1px solid var(--color-line);
}
.badge.ron { background: var(--green-100); color: var(--green-800); border-color: var(--green-300); }
.badge.warn { background: var(--amber-100); color: #7a5605; border-color: var(--amber-300); }
.badge.off { background: var(--color-surface-2); color: var(--color-muted); border-style: dashed; }
@media (prefers-color-scheme: dark) {
  .badge.ron { background: #10281d; color: #7fd0a8; border-color: #1d4732; }
  .badge.warn { background: #33270e; color: var(--amber-300); border-color: #6b5316; }
}

/* avviso: dato comunicato che NON proviamo come erogato */
.notice {
  margin-top: var(--space-4);
  border-radius: var(--radius-m);
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--amber-500);
  background: var(--color-surface-2);
  padding: var(--space-3) var(--space-4);
}
.notice p { margin: 0; font-size: var(--text-s); line-height: 1.45; color: var(--color-muted); }

/* prezzo stile "display di pompa" */
.pump {
  margin-top: var(--space-4);
  border-radius: var(--radius-m);
  background:
    radial-gradient(120% 100% at 0% 0%, rgb(29 133 96 / 22%), transparent 60%),
    linear-gradient(165deg, var(--green-900), var(--green-950));
  color: #eef6f0;
  padding: var(--space-4);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%), var(--shadow-2);
}
.pump-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #8fb5a2;
}
.pump-cells { display: flex; gap: var(--space-4); align-items: flex-start; }
.pump-cell { flex: 1; min-width: 0; }
.pump-cell + .pump-cell {
  padding-left: var(--space-4);
  border-left: 1px solid rgb(255 255 255 / 10%);
}
.pump-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.09em; color: #9dbcab; margin: 0 0 4px; }
.pump-price {
  display: flex; align-items: baseline; gap: 3px;
  font-size: clamp(28px, 9vw, 38px); font-weight: 830;
  font-variant-numeric: tabular-nums; letter-spacing: -0.025em; line-height: 1;
  margin: 0;
}
.pump-price small { font-size: 13px; font-weight: 620; color: #b9d2c3; letter-spacing: 0; }
.pump-price.accent { color: var(--amber-300); text-shadow: 0 0 22px rgb(240 169 46 / 28%); }
.pump-meta { font-size: var(--text-xs); color: #8fb5a2; margin: 6px 0 0; }
.pump-delta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--space-3);
  padding: 4px 10px 4px 8px;
  border-radius: var(--radius-full);
  background: rgb(255 255 255 / 7%);
  font-size: var(--text-xs); font-weight: 660;
  color: #cfe2d8;
}
.pump-delta-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pump-delta.good { color: #8be0b3; }
.pump-delta.bad { color: #f2b0a4; }
.pump-delta.even { color: #b8cfc3; }

.spark-wrap { margin-top: var(--space-4); }
.spark-title { font-size: var(--text-s); color: var(--color-muted); margin: 0 0 6px; }
.spark { width: 100%; height: 64px; display: block; }
.spark path.line { fill: none; stroke: var(--color-primary); stroke-width: 2; }
.spark path.area { fill: color-mix(in srgb, var(--color-primary) 14%, transparent); stroke: none; }
.spark text { font-size: 10px; fill: var(--color-muted); font-variant-numeric: tabular-nums; }

/* navigazione */
.nav-row { margin-top: var(--space-4); }
.nav-primary { width: 100%; }
.nav-icon { display: inline-flex; }
.nav-alt { margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--color-muted); text-align: center; }
.nav-alt a { color: var(--color-link); font-weight: 640; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border-radius: var(--radius-m);
  border: 1px solid var(--color-line);
  font: inherit; font-weight: 680; font-size: var(--text-s);
  cursor: pointer; text-decoration: none;
  background: var(--color-surface-2); color: var(--color-text);
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--color-primary); border-color: var(--color-primary-strong); color: var(--color-on-primary); flex: 1; }
.btn.primary svg { fill: currentColor; width: 18px; height: 18px; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: var(--text-xs); }

/* sezioni scheda */
.st-section { margin-top: var(--space-5); }
.st-section > h3 { font-size: var(--text-s); text-transform: uppercase; letter-spacing: 0.07em; color: var(--color-muted); margin: 0 0 var(--space-2); font-weight: 700; }

.price-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.price-table th {
  padding: 0 0 6px; text-align: right;
  font-size: var(--text-xs); font-weight: 640; color: var(--color-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color-line);
}
.price-table th:first-child { text-align: left; }
.price-table td { padding: 9px 0; border-bottom: 1px solid var(--color-line); font-size: var(--text-s); text-align: right; font-weight: 700; }
.price-table td.product { text-align: left; font-weight: 560; padding-right: var(--space-3); }
.price-table th:not(:first-child), .price-table td:not(.product) { width: 76px; }
.price-table tr.ron td { color: var(--color-primary); }
.price-table tr.ron td.product { font-weight: 720; }
.table-note { margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--color-muted); }

/* provenienza */
.prov-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--color-line);
  font-size: var(--text-s);
}
.prov-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.prov-dot.fresh { background: var(--green-500); box-shadow: 0 0 6px color-mix(in srgb, var(--green-500) 60%, transparent); }
.prov-dot.stale { background: var(--amber-500); }
.prov-name { font-weight: 680; min-width: 64px; text-transform: capitalize; }
.prov-when { color: var(--color-muted); margin-left: auto; text-align: right; }
.conf-bar { height: 6px; border-radius: 3px; background: var(--color-surface-2); overflow: hidden; margin-top: 6px; }
.conf-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--amber-500), var(--green-500)); }
.conf-note { font-size: var(--text-xs); color: var(--color-muted); margin-top: 6px; }

.services-row { display: flex; flex-wrap: wrap; gap: 6px; }

.report-link { display: inline-block; margin-top: var(--space-5); color: var(--color-muted); font-size: var(--text-s); background: none; border: none; cursor: pointer; text-decoration: underline; font-family: inherit; padding: 0; }

/* form segnalazione */
.report-form { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.report-form select, .report-form textarea, .report-form input[type="email"] {
  width: 100%; font: inherit; color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-line); border-radius: var(--radius-s);
  padding: 10px 12px;
}
.report-form textarea { min-height: 80px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- drawer filtri -------------------------------------------------------- */

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgb(5 14 10 / 45%);
  backdrop-filter: blur(3px);
  display: flex; justify-content: flex-end;
}
/* `display:flex` vincerebbe sull'attributo hidden dello user agent */
.drawer-backdrop[hidden] { display: none; }
.drawer {
  width: min(400px, 100%);
  height: 100%;
  background: var(--color-surface);
  display: flex; flex-direction: column;
  padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
  overflow-y: auto;
  box-shadow: var(--shadow-3);
  animation: drawer-in 240ms cubic-bezier(0.32, 0.72, 0.22, 1);
}
@keyframes drawer-in { from { transform: translateX(30%); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }

.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.drawer-head h2 { margin: 0; font-size: var(--text-xl); letter-spacing: -0.01em; }

.filter-group { border: 0; padding: 0; margin: 0 0 var(--space-5); }
.filter-group legend { font-size: var(--text-s); font-weight: 720; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: var(--space-2); padding: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-line);
  background: var(--color-surface-2);
  font-size: var(--text-s); font-weight: 640;
  transition: all var(--transition-fast);
}
.chip span::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--chip-accent, var(--color-muted));
}
.chip input:checked + span {
  background: color-mix(in srgb, var(--chip-accent, var(--color-primary)) 16%, var(--color-surface));
  border-color: var(--chip-accent, var(--color-primary));
}
.chip input:focus-visible + span { box-shadow: var(--focus-ring); }

.range-row { display: flex; align-items: center; gap: var(--space-3); }
.range-row input[type="range"] { flex: 1; accent-color: var(--color-primary); height: 44px; }
.range-row output { min-width: 72px; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }

.switch { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; font-size: var(--text-s); }
.switch input { width: 44px; height: 26px; appearance: none; border-radius: 13px; background: var(--color-line); position: relative; transition: background var(--transition-fast); cursor: pointer; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-surface); box-shadow: var(--shadow-1); transition: translate var(--transition-fast); }
.switch input:checked { background: var(--color-primary); }
.switch input:checked::after { translate: 18px 0; }
.switch input:focus-visible { box-shadow: var(--focus-ring); }

.drawer-foot { margin-top: auto; display: flex; gap: var(--space-2); padding-top: var(--space-4); }
.drawer-foot .primary { flex: 1; }

/* --- skeleton / util ------------------------------------------------------ */

.skel { border-radius: var(--radius-s); background: linear-gradient(100deg, var(--color-surface-2) 40%, var(--color-line) 50%, var(--color-surface-2) 60%); background-size: 300% 100%; animation: skel 1.1s infinite linear; }
@keyframes skel { to { background-position: -300% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.noscript-box { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: var(--space-5); background: var(--color-bg); z-index: 90; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 900px) {
  .sheet { left: auto; right: var(--space-4); width: 420px; border-radius: var(--radius-l); bottom: var(--space-4); height: auto; max-height: calc(100dvh - 120px); }
  .sheet[data-state="peek"], .sheet[data-state="half"], .sheet[data-state="full"] { transform: none; }
  .sheet[data-state="hidden"] { transform: translateY(calc(100% + 40px)); }
  .sheet-grip { display: none; }
  /* lo spazio in alto va sull'intestazione, non sul contenitore che scorre:
     altrimenti le righe passerebbero visibilmente sopra il bordo sticky */
  .st-head { padding-top: var(--space-4); }
  .map-overlays { align-items: flex-start; left: var(--space-4); right: auto; }
}
