/* =============================================================================
   CAPPELLANIE — Stili applicazione
   Dipende da design-tokens.css
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--fw-semibold); }
button { font-family: inherit; cursor: pointer; }
a { color: var(--marian-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

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

/* scrollbar discreta */
.d-list__scroll, .detail-panel__scroll, .sheet-scroll, .m-list {
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.d-list__scroll::-webkit-scrollbar, .detail-panel__scroll::-webkit-scrollbar,
.sheet-scroll::-webkit-scrollbar, .m-list::-webkit-scrollbar { width: 9px; }
.d-list__scroll::-webkit-scrollbar-thumb, .detail-panel__scroll::-webkit-scrollbar-thumb,
.sheet-scroll::-webkit-scrollbar-thumb, .m-list::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 99px; border: 3px solid var(--paper);
}

/* =============================================================================
   SHELL
   ============================================================================= */
.app { height: 100%; display: flex; flex-direction: column; background: var(--paper); }

/* ---- HEADER ---- */
.app-header {
  height: var(--app-header-h);
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--surface-marian);
  color: var(--ink-on-dark);
  border-bottom: 2px solid var(--gold-deep);
  position: relative; z-index: var(--z-sticky);
}
.app-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-deep));
}
.app-header__brand { display: flex; align-items: center; gap: var(--space-3); }
.app-header__mark { width: 38px; height: 38px; display: grid; place-items: center; }
.app-header__mark svg { width: 34px; height: 34px; }
.app-header__title {
  font-size: 1.5rem; line-height: 1; letter-spacing: var(--tracking-tight);
  font-variation-settings: 'opsz' 40, 'SOFT' 0, 'WONK' 1;
  color: var(--ink-on-dark);
}
.app-header__sub {
  margin: 3px 0 0; font-size: var(--fs-xs); letter-spacing: 0.06em;
  color: var(--ink-on-dark-soft); text-transform: none;
}
.app-header__nav { display: flex; gap: var(--space-1); }
.app-header__link {
  color: var(--ink-on-dark-soft); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  padding: 8px 14px; border-radius: var(--radius-pill); transition: all var(--dur-fast) var(--ease-out);
}
.app-header__link:hover { color: var(--ink-on-dark); background: oklch(1 0 0 / 0.08); text-decoration: none; }
.app-header__link.is-current { color: var(--marian-deep); background: var(--gold); }

/* =============================================================================
   FILTER BAR
   ============================================================================= */
.filterbar {
  flex: 0 0 auto; background: var(--paper-raised);
  border-bottom: 1px solid var(--border);
  padding: var(--space-3) var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-3);
  position: relative; z-index: var(--z-sticky);
}
.filterbar__row { display: flex; align-items: center; gap: var(--space-4); }
.filterbar__row--main { gap: var(--space-3); }
.filterbar__row--langs { gap: var(--space-3); }

.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search__ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-mute); pointer-events: none; }
.search__input {
  width: 100%; height: 42px; padding: 0 36px 0 38px;
  font-family: var(--font-body); font-size: var(--fs-body); color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search__input::placeholder { color: var(--ink-faint); }
.search__input:focus { border-color: var(--marian-bright); box-shadow: 0 0 0 3px var(--marian-tint); outline: none; }
.search__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: none; background: var(--paper-sunk); color: var(--ink-soft);
  border-radius: 50%; font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.search__clear:hover { background: var(--border-strong); }

.select-group { display: flex; gap: var(--space-3); }
.field-select { display: flex; flex-direction: column; gap: 3px; }
.field-select__lab { font-size: 10px; }
.field-select select {
  appearance: none; height: 42px; min-width: 116px; padding: 0 34px 0 14px;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%237a6f63' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field-select select:focus { border-color: var(--marian-bright); box-shadow: 0 0 0 3px var(--marian-tint); outline: none; }

.filterbar__lead { flex: 0 0 auto; }
.lang-chip-rail { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.filterbar__count { display: flex; align-items: baseline; gap: 6px; flex: 0 0 auto; white-space: nowrap; }
.filterbar__count-n { font-family: var(--font-display); font-size: 1.2rem; font-weight: var(--fw-semibold); color: var(--marian); }
.filterbar__count-t { font-size: var(--fs-sm); color: var(--ink-mute); }
.filterbar__reset {
  margin-left: 8px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--ink-soft); font-size: var(--fs-sm); padding: 5px 12px; border-radius: var(--radius-pill);
}
.filterbar__reset:hover { border-color: var(--marian-bright); color: var(--marian); }

/* =============================================================================
   LANG CHIP
   ============================================================================= */
.lang-chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--font-body); font-weight: var(--fw-semibold); line-height: 1;
  border-radius: var(--radius-pill); border: 1px solid transparent;
  transition: all var(--dur-fast) var(--ease-out);
}
.lang-dot { display: inline-block; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1.5px oklch(1 0 0 / 0.6); }
.lang-chip--sm { font-size: var(--fs-xs); padding: 4px 9px 4px 7px; background: var(--chip-tint); color: var(--chip-ink); }
.lang-chip--md { font-size: var(--fs-sm); padding: 7px 13px 7px 10px; }
.lang-chip--md.is-interactive { background: var(--surface); border-color: var(--border-strong); color: var(--ink-soft); }
.lang-chip--md.is-interactive:hover { border-color: var(--chip-color); color: var(--chip-ink); background: var(--paper-raised); }
.lang-chip--md.is-active { background: var(--chip-tint); border-color: var(--chip-color); color: var(--chip-ink); }
.lang-chip--md.is-active .lang-dot { box-shadow: 0 0 0 1.5px var(--chip-tint); }

/* =============================================================================
   DESKTOP MAIN GRID
   ============================================================================= */
.d-main {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: var(--list-w) minmax(0, 1fr) var(--detail-w);
  background: var(--paper);
}

/* ---- LISTA ---- */
.d-list { min-height: 0; display: flex; flex-direction: column; background: var(--paper-raised); border-right: 1px solid var(--border); }
.d-list__head { flex: 0 0 auto; display: flex; align-items: baseline; justify-content: space-between; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-soft); }
.d-list__sort { font-size: var(--fs-xs); color: var(--ink-faint); font-style: italic; }
.d-list__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--space-3) var(--space-4) var(--space-8); display: flex; flex-direction: column; gap: var(--space-3); }
.d-list__scroll > *, .m-list > *, .state--loading > * { flex: 0 0 auto; }

/* ---- MAPPA (Leaflet) ---- */
.d-map { position: relative; min-height: 0; overflow: hidden; background: var(--paper-sunk); }
.leaflet-campania { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--paper-sunk); }
/* riscalda le tile per coerenza con la palette crema/oro */
.leaflet-campania .leaflet-tile-pane {
  filter: sepia(0.42) saturate(0.78) brightness(0.99) contrast(1.02) hue-rotate(-8deg);
}
.leaflet-campania .leaflet-container,
.leaflet-campania.leaflet-container { font-family: var(--font-body); background: var(--paper-sunk); }
.leaflet-campania .leaflet-control-attribution {
  background: oklch(0.978 0.012 86 / 0.82); color: var(--ink-mute); font-size: 10px;
  font-family: var(--font-body); border-radius: var(--radius-xs) 0 0 0; padding: 2px 7px;
}
.leaflet-campania .leaflet-control-attribution a { color: var(--marian); }
.leaflet-campania .leaflet-bar { border: 1px solid var(--border); box-shadow: var(--shadow-md); border-radius: var(--radius-sm); overflow: hidden; }
.leaflet-campania .leaflet-bar a {
  background: var(--surface); color: var(--ink-soft); border-bottom-color: var(--border-soft);
  width: 32px; height: 32px; line-height: 32px; font-size: 18px;
}
.leaflet-campania .leaflet-bar a:hover { background: var(--paper-sunk); color: var(--ink); }

.d-map__caption {
  position: absolute; left: var(--space-5); bottom: var(--space-7); z-index: 500;
  display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-sm); color: var(--ink-soft);
  background: oklch(0.978 0.012 86 / 0.86); backdrop-filter: blur(3px);
  padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}

/* =============================================================================
   MARKER LEAFLET — pin colorato per lingua con croce
   ============================================================================= */
.lf-marker-wrap { background: none; border: none; }
.lf-marker { position: relative; width: 100%; height: 100%; display: grid; place-items: center; cursor: pointer; }
.lf-dot {
  position: relative; width: 26px; height: 26px; border-radius: 50%;
  background: var(--c); border: 2.5px solid var(--surface);
  display: grid; place-items: center; box-shadow: var(--shadow-marker);
  transition: transform var(--dur-fast) var(--ease-out);
}
.lf-marker:hover .lf-dot { transform: scale(1.14); }
.lf-marker.is-selected .lf-dot { width: 34px; height: 34px; border-width: 3px; }
.lf-cross { width: 13px; height: 13px; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.lf-marker.is-selected .lf-cross { width: 17px; height: 17px; stroke-width: 2.4; }
.lf-halo { position: absolute; inset: -7px; border-radius: 50%; border: 2.5px solid var(--gold); }
.lf-pulse {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--c); animation: lf-pulse 2.4s var(--ease-out) infinite;
}
@keyframes lf-pulse { 0% { transform: scale(0.6); opacity: 0.6; } 70% { transform: scale(2.1); opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lf-pulse { animation: none; opacity: 0; } }
.lf-marker-wrap:focus-visible { outline: none; }
.lf-marker-wrap:focus-visible .lf-dot { box-shadow: var(--shadow-marker), 0 0 0 3px var(--surface), 0 0 0 5.5px var(--focus-ring); }
.legend {
  position: absolute; right: var(--space-4); top: var(--space-4); z-index: 600;
  width: 210px; background: oklch(0.978 0.012 86 / 0.94); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  overflow: hidden;
}
.legend__toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: none; border: none; border-bottom: 1px solid transparent; }
.legend.is-open .legend__toggle { border-bottom-color: var(--border-soft); }
.legend__chev { width: 12px; height: 12px; color: var(--ink-mute); transition: transform var(--dur-base); }
.legend:not(.is-open) .legend__chev { transform: rotate(-90deg); }
.legend__list { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 1px; max-height: min(440px, 60vh); overflow-y: auto; }
.legend__item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px 8px; background: none; border: none; border-radius: var(--radius-sm); text-align: left; transition: background var(--dur-fast); }
.legend__item:hover { background: var(--paper-sunk); }
.legend__item.is-active { background: var(--marian-tint); }
.legend__item.is-dim { opacity: 0.42; }
.legend__dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1.5px oklch(1 0 0 / 0.7); }
.legend__name { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink); flex: 1 1 auto; }
.legend__lng { font-size: var(--fs-xs); color: var(--ink-mute); font-style: italic; }

/* =============================================================================
   PLACE CARD
   ============================================================================= */
.place-card {
  position: relative; display: flex; gap: 0; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0; overflow: hidden; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.place-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.place-card.is-selected { border-color: var(--card-accent); box-shadow: var(--shadow-md); }
.place-card__rail { flex: 0 0 4px; background: var(--card-accent); }
.place-card.is-selected .place-card__rail { flex-basis: 5px; }
.place-card__body { display: flex; flex-direction: column; gap: 5px; padding: var(--space-4); flex: 1 1 auto; min-width: 0; }
.place-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 1px; }
.place-card__rev { color: var(--banner-review-ink); font-size: 9px; line-height: 1; }
.place-card__name {
  font-family: var(--font-display); font-size: var(--fs-h3); font-weight: var(--fw-semibold);
  line-height: var(--lh-snug); color: var(--ink); letter-spacing: var(--tracking-tight);
  font-variation-settings: 'opsz' 28, 'SOFT' 0, 'WONK' 0;
}
.place-card__loc { display: flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--ink-soft); }
.place-card__loc .pin-ico { width: 13px; height: 13px; flex: 0 0 auto; color: var(--ink-mute); }
.place-card__prov { color: var(--ink-mute); }
.place-card__rito { font-size: var(--fs-sm); color: var(--ink-mute); font-style: italic; }
.place-card__foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* =============================================================================
   BADGE / BANNER
   ============================================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1;
  padding: 5px 10px; border-radius: var(--radius-pill); border: 1px solid transparent;
}
.badge--compact { padding: 4px 9px; font-size: 11.5px; }
.badge-ico { width: 13px; height: 13px; flex: 0 0 auto; }
.badge--next { background: var(--status-next-tint); color: var(--status-next-ink); border-color: oklch(0.560 0.108 152 / 0.3); }
.badge--next .badge-lead { font-weight: var(--fw-bold); }
.badge--next .badge-detail { font-variant-numeric: tabular-nums; }
.badge--verify { background: var(--status-verify-tint); color: var(--status-verify-ink); border-color: oklch(0.720 0.130 64 / 0.32); }
.badge--todefine { background: var(--status-todefine-tint); color: var(--status-todefine-ink); border-color: var(--border-strong); font-style: italic; font-weight: var(--fw-medium); padding: 5px 11px; }

.review-banner {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--banner-review-tint); color: var(--banner-review-ink);
  border: 1px solid oklch(0.760 0.090 84 / 0.4); border-left: 3px solid var(--banner-review);
  border-radius: var(--radius-sm); padding: 10px 13px; font-size: var(--fs-sm); line-height: var(--lh-snug);
}
.review-banner .rb-ico { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.review-banner strong { font-weight: var(--fw-bold); }
.review-banner--inline { margin: 0 0 var(--space-2); }

/* =============================================================================
   DETAIL PANEL
   ============================================================================= */
.detail-panel { position: relative; min-height: 0; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.detail-panel--empty { background: var(--paper-raised); }
.detail-panel__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.detail-close {
  position: absolute; right: var(--space-4); top: var(--space-4); z-index: 2;
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--paper-raised); border: 1px solid var(--border); border-radius: 50%; color: var(--ink-soft);
}
.detail-close:hover { background: var(--paper-sunk); color: var(--ink); }
.detail-close svg { width: 16px; height: 16px; }

/* SCHEDA */
.scheda { padding: var(--space-7) var(--space-6) var(--space-9); }
.scheda__head-top { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-3); }
.scheda__rito-tag { font-size: var(--fs-xs); color: var(--gold-ink); font-style: italic; }
.scheda__name {
  font-size: var(--fs-h1); line-height: var(--lh-tight); color: var(--ink); letter-spacing: var(--tracking-display);
  font-variation-settings: 'opsz' 60, 'SOFT' 2, 'WONK' 0; margin-bottom: var(--space-2); text-wrap: balance;
}
.scheda__loc { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-body); color: var(--ink-soft); margin: 0 0 var(--space-4); }
.scheda__loc .pin-ico { width: 14px; height: 14px; margin-top: 3px; flex: 0 0 auto; color: var(--ink-mute); }
.scheda__badges { display: flex; flex-wrap: wrap; gap: 8px; }

.scheda__rule { display: flex; align-items: center; margin: var(--space-6) 0; }
.scheda__rule span { flex: 1; height: 1px; background: var(--gold-line); }
.scheda__rule::before, .scheda__rule::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.scheda__rule::before { margin-right: 8px; } .scheda__rule::after { margin-left: 8px; }

.scheda__sec { margin-bottom: var(--space-6); }
.sec-title { display: flex; align-items: center; gap: 12px; margin-bottom: var(--space-3); }
.sec-title__label { color: var(--gold-ink); }
.scheda-todefine { color: var(--ink-mute); font-size: var(--fs-body); }
.scheda-todefine em { color: var(--status-todefine-ink); font-style: italic; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-5); margin: 0; }
.meta-grid > div { display: flex; flex-direction: column; gap: 1px; }
.meta-grid dt { font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); }
.meta-grid dd { margin: 0; font-size: var(--fs-body); color: var(--ink); }
.meta-native { color: var(--ink-soft); }

/* orari */
.orari { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.orari__row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); position: relative; }
.orari__row.is-next { background: var(--status-next-tint); }
.orari__day { font-size: var(--fs-body); color: var(--ink); font-weight: var(--fw-medium); }
.orari__dots { border-bottom: 1.5px dotted var(--border-strong); transform: translateY(-3px); }
.orari__time { font-family: var(--font-display); font-size: var(--fs-body-lg); font-weight: var(--fw-semibold); color: var(--ink); font-variant-numeric: tabular-nums; font-variation-settings: 'opsz' 24; }
.orari__verify { color: var(--status-verify-ink); font-size: 11px; margin-left: 3px; vertical-align: super; }
.orari__note { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--ink-mute); font-style: italic; margin-top: -2px; }
.orari__next-tag { grid-column: 1 / -1; justify-self: start; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--status-next-ink); font-weight: var(--fw-bold); }

/* story con capolettera */
.scheda-story {
  font-size: var(--fs-body-lg); line-height: var(--lh-relax); color: var(--ink); margin: 0; text-wrap: pretty;
}
.scheda-story::first-letter {
  float: left; font-family: var(--font-display); font-size: 3.4em; line-height: 0.74;
  font-weight: var(--fw-semibold); color: var(--marian); padding: 6px 10px 0 0;
  font-variation-settings: 'opsz' 144, 'SOFT' 4, 'WONK' 1;
}

/* contatti */
.contacts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.contact-row { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-body); }
.contact-row__ico { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; background: var(--marian-tint); border-radius: 50%; color: var(--marian); }
.contact-row__ico svg { width: 16px; height: 16px; }
.contact-row__val { padding-top: 3px; min-width: 0; }
.contact-role { color: var(--ink-soft); font-style: italic; }

/* azioni */
.scheda__actions { display: flex; gap: 10px; margin-top: var(--space-7); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: var(--radius-pill); font-size: var(--fs-body); font-weight: var(--fw-semibold); border: 1px solid transparent; transition: all var(--dur-fast) var(--ease-out); }
.btn-ico { width: 16px; height: 16px; }
.btn--primary { background: var(--marian); color: var(--ink-on-dark); flex: 1 1 auto; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--marian-deep); text-decoration: none; box-shadow: var(--shadow-md); }
.btn--ghost { background: var(--surface); color: var(--ink-soft); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--marian-bright); color: var(--marian); text-decoration: none; }

/* =============================================================================
   STATI
   ============================================================================= */
.state { padding: var(--space-7) var(--space-6); }
.state--loading { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) 0 0; }
.skeleton-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; gap: 9px; }
.sk-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--paper-sunk) 25%, var(--border-soft) 37%, var(--paper-sunk) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; }
.sk-chip { width: 84px; height: 18px; border-radius: 99px; } .sk-title { width: 78%; height: 20px; } .sk-meta { width: 52%; } .sk-foot { width: 40%; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk-line { animation: none; } }

.state--empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-9) var(--space-6); }
.state-orn { width: 64px; height: 64px; opacity: 0.9; }
.state-orn svg { width: 100%; height: 100%; }
.state-title { font-family: var(--font-display); font-size: var(--fs-h2); color: var(--ink); font-variation-settings: 'opsz' 36, 'WONK' 1; }
.state-text { max-width: 32ch; font-size: var(--fs-body); color: var(--ink-soft); margin: 0; line-height: var(--lh-snug); }

/* =============================================================================
   MOBILE
   ============================================================================= */
.app-header--mobile { padding: 0 var(--space-4); }
.app-header--mobile .app-header__title { font-size: 1.3rem; }
.filterbar--mobile { padding: var(--space-3) var(--space-4); }
.filterbar--mobile .filterbar__row--main { flex-wrap: wrap; }
.filterbar--mobile .search { flex: 1 1 100%; max-width: none; }
.filterbar--mobile .select-group { flex: 1 1 100%; }
.filterbar--mobile .field-select { flex: 1 1 0; }
.filterbar--mobile .field-select select { width: 100%; min-width: 0; height: var(--tap-min); }
.filterbar--mobile .search__input { height: var(--tap-min); }
.filterbar--mobile .filterbar__row--langs { flex-wrap: nowrap; }
.filterbar--mobile .lang-chip-rail { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filterbar--mobile .lang-chip-rail::-webkit-scrollbar { display: none; }
.filterbar--mobile .lang-chip--md { min-height: 38px; }
.filterbar--mobile .filterbar__lead { display: none; }
.filterbar--mobile .filterbar__count { width: 100%; justify-content: flex-start; padding-top: 2px; }

.m-toggle { flex: 0 0 auto; display: flex; gap: 4px; padding: var(--space-2) var(--space-4); background: var(--paper-raised); border-bottom: 1px solid var(--border); }
.m-toggle button { flex: 1 1 0; height: var(--tap-min); display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--ink-soft); }
.m-toggle button svg { width: 16px; height: 16px; }
.m-toggle button.is-on { background: var(--marian); color: var(--ink-on-dark); border-color: var(--marian); }
.m-toggle__n { background: oklch(1 0 0 / 0.22); border-radius: 99px; padding: 1px 7px; font-size: 11px; }
.m-toggle button:not(.is-on) .m-toggle__n { background: var(--paper-sunk); color: var(--ink-soft); }

.m-content { flex: 1 1 auto; min-height: 0; position: relative; }
.m-map { position: absolute; inset: 0; background: var(--paper-sunk); }
.m-map .leaflet-campania { position: absolute; inset: 0; }
.m-map .legend { width: 180px; z-index: 600; }
.m-list { position: absolute; inset: 0; overflow-y: auto; padding: var(--space-3) var(--space-4) var(--space-9); display: flex; flex-direction: column; gap: var(--space-3); }
.m-list > * { flex: 0 0 auto; }

/* BOTTOM SHEET */
.sheet-layer { position: fixed; inset: 0; z-index: var(--z-sheet); }
.sheet-scrim { position: absolute; inset: 0; background: oklch(0.25 0.02 60 / 0.34); animation: fade-in var(--dur-base) var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.bottom-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: 92vh;
  background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-sheet); display: flex; flex-direction: column;
  transition: transform var(--dur-slow) var(--ease-out); will-change: transform;
  border-top: 2px solid var(--gold-deep);
}
.bottom-sheet.is-dragging { transition: none; }
.sheet-grab-zone { flex: 0 0 auto; padding: 10px 0 6px; cursor: grab; touch-action: none; position: relative; }
.sheet-grab-zone:active { cursor: grabbing; }
.sheet-grab { width: 42px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 0 auto; }
.sheet-close { position: absolute; right: 14px; top: 10px; width: 34px; height: 34px; display: grid; place-items: center; background: var(--paper-raised); border: 1px solid var(--border); border-radius: 50%; color: var(--ink-soft); }
.sheet-close svg { width: 16px; height: 16px; }
.sheet-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-scroll .scheda { padding: var(--space-3) var(--space-5) var(--space-9); }
.sheet-scroll .scheda__name { font-size: var(--fs-display-lg); }

@media (max-width: 380px) {
  .scheda__name { font-size: var(--fs-h2); }
  .meta-grid { grid-template-columns: 1fr; }
}
