/* =========================================================
   Galleria Borromea - PAGINA TOTEM
   Stile identico a scene-semplice.html (inclusivo, grande, leggibile)
   Palette: #941750 bordeaux + #f9e8ef rosa soft + azzurro calma + rosso SOS
========================================================= */

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d7deea;
  --primary: #941750;
  --primary-dark: #7a1342;
  --primary-soft: #f9e8ef;
  --primary-soft-border: #f1c8da;
  --ok: #059669;
  --warn: #d97706;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.45;
}

a.skip-link {
  position: absolute;
  left: -9999px;
}
a.skip-link:focus {
  left: 12px; top: 8px; position: fixed; z-index: 10000;
  background: #fff; color: #000; padding: 10px 14px;
  border-radius: 12px; outline: 3px solid #000; font-weight: 700;
}

/* ================= HEADER (stesso identico di scene-semplice) ================= */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--primary-soft-border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.loghi {
  display: flex;
  align-items: center;
  gap: 14px;
}
.loghi img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
}
.loghi-divider {
  width: 2px;
  height: 30px;
  background: var(--border);
  border-radius: 2px;
}
.header-link {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  background: var(--primary-soft);
  border: 2px solid var(--primary-soft-border);
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.header-link:hover { background: var(--primary-soft-border); }

/* ================= SOS / CALMA fissi (stesso identico) ================= */
.sos-fixed-btn, .calm-fixed-btn {
  position: fixed;
  z-index: 200;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  padding: 10px 16px;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.sos-fixed-btn  { right: 20px;  bottom: 20px; background: #dc2626; }
.sos-fixed-btn:hover { background: #b91c1c; }
.calm-fixed-btn { right: 100px; bottom: 20px; background: #0ea5e9; }
.calm-fixed-btn:hover { background: #0284c7; }

/* ================= CONTENITORE PRINCIPALE ================= */
.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 22px 22px 110px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ================= TU SEI QUI (stesso stile di scene-semplice) ================= */
.dove-sono-card {
  background: var(--card);
  border: 3px solid var(--primary-soft-border);
  border-radius: 20px;
  padding: 18px 22px;
  box-shadow: 0 8px 22px rgba(15,23,42,0.06);
  text-align: center;
}
.dove-sono-titolo {
  font-size: 14px; font-weight: 800; color: var(--muted);
  letter-spacing: 0.10em; margin: 0 0 6px; text-transform: uppercase;
}
#title {
  font-size: 28px; font-weight: 900; color: var(--primary);
  margin: 0; line-height: 1.15;
}
#subtitle {
  margin-top: 6px; font-size: 16px; font-weight: 700; color: var(--text);
}

/* ================= NAV PREC / SUCC (stesso stile dei bottoni grandi) ================= */
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 18px;
  background: var(--primary);
  color: #fff !important;
  text-decoration: none;
  font-weight: 900;
  font-size: 16px;
  border: 3px solid var(--primary);
  border-radius: 18px;
  box-shadow: 0 6px 16px rgba(148,23,80,0.18);
  cursor: pointer;
  transition: transform .08s ease, background .12s;
}
.nav-cta:hover:not([aria-disabled="true"]) { background: var(--primary-dark); border-color: var(--primary-dark); }
.nav-cta:active:not([aria-disabled="true"]) { transform: scale(0.97); }
.nav-cta[aria-disabled="true"] { background: #cbd5e1; border-color: #cbd5e1; color: #475569 !important; box-shadow: none; }
.nav-site-link {
  font-size: 13px;
  color: var(--muted);
  align-self: center;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  padding: 8px;
}
.nav-site-link:hover { color: var(--primary-dark); }

/* ================= TAB NAV ================= */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(15,23,42,0.05);
}
.tabs [data-tab] {
  appearance: none;
  flex: 1 1 auto;
  min-width: 86px;
  background: var(--primary-soft);
  border: 2px solid var(--primary-soft-border);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .08s, background .12s, color .12s;
}
.tabs [data-tab]:hover { background: var(--primary-soft-border); }
.tabs [data-tab]:active { transform: scale(0.97); }
.tabs [data-tab][aria-selected="true"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(148,23,80,0.22);
}
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.stage-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--primary-dark);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.btn-help-mini {
  appearance: none;
  border: 2px solid var(--primary-soft-border);
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 8px 12px;
  font-weight: 800;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.btn-help-mini[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ================= STAGE / PANEL contenuto ================= */
.stage {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(15,23,42,0.06);
}
.stage-slot[data-panel] { display: none; }
.stage-slot[data-panel].is-active { display: block; }

/* BOTTONI STANDARD (stesso stile dei pulsanti del viewer) */
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  font-weight: 900;
  font-size: 15px;
  border-radius: 16px;
  cursor: pointer;
  border: 3px solid;
  text-decoration: none;
  transition: transform .08s, background .12s, color .12s;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: #cbd5e1 !important; border-color: #cbd5e1 !important; color: #475569 !important;
  cursor: not-allowed; box-shadow: none !important; transform: none !important;
}
.btn-primary   { background: var(--primary);  border-color: var(--primary);  color: #fff; }
.btn-primary:hover   { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: #fff;            border-color: var(--border);  color: var(--text); }
.btn-secondary:hover { background: #f1f5f9; }

/* HERO VIDEO nel tab Video */
.hero-video {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.hero-video-copy .bar { margin: 0 0 6px; }
.hero-video-frame {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}
.hero-video-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.note {
  background: var(--primary-soft);
  border: 2px solid var(--primary-soft-border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}
.block {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
}
.block h2 { margin-top: 0; color: var(--primary-dark); font-size: 20px; }
.field { margin-top: 14px; }
.field label {
  display: block;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
  font-size: 14px;
}
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
.field input:focus, .field textarea:focus {
  outline: 3px solid var(--primary-soft-border);
  border-color: var(--primary);
}
.field textarea { min-height: 100px; resize: vertical; }

/* REVIEW STARS / CHOICES */
.review-choice {
  appearance: none;
  border: 3px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  transition: all .12s;
}
.review-choice:hover { background: var(--primary-soft); }
.review-choice.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(148,23,80,0.22);
}
.review-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.review-box { display: flex; flex-direction: column; gap: 14px; }

/* HELP BOX */
.help-box { display: flex; flex-direction: column; gap: 14px; }
.help-note {
  background: var(--primary-soft);
  border: 2px solid var(--primary-soft-border);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--primary-dark);
}
.help-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.10em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.help-list {
  padding-left: 22px;
  margin: 0;
  line-height: 1.6;
  font-weight: 600;
}
.help-list li { margin: 6px 0; }
.help-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* CALM / SOS MODAL */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9000;
}
.overlay-card {
  background: #fff;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.30);
}
.overlay-header {
  padding: 14px 18px;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.overlay-title { font-weight: 900; font-size: 18px; color: var(--primary-dark); }
.overlay-body {
  flex: 1;
  overflow: auto;
  padding: 0;
  background: #000;
  min-height: 480px;
}
.overlay-body iframe { width: 100%; height: 100%; min-height: 480px; border: 0; display: block; }
.overlay-footer {
  padding: 12px 18px;
  border-top: 2px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.overlay-footer a { color: var(--primary); font-weight: 800; }

.sos-modal, .calm-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.60);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sos-modal-card, .calm-modal-card {
  background: #fff;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  border-radius: 20px;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.32);
  border: 3px solid var(--primary-soft-border);
}
.sos-modal-head, .calm-modal-head {
  padding: 18px 20px 10px;
  border-bottom: 2px solid var(--primary-soft-border);
  background: var(--primary-soft);
}
.sos-modal-head h3, .calm-modal-head h3 {
  margin: 0 0 4px;
  font-size: 22px;
  color: var(--primary-dark);
  font-weight: 900;
}
.sos-modal-head p, .calm-modal-head p { margin: 0; font-weight: 600; color: var(--text); font-size: 14px; }
.sos-modal-body, .calm-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.sos-note {
  background: var(--primary-soft);
  border: 2px solid var(--primary-soft-border);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 14px;
}
.sos-preview {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  font-family: inherit;
}
.sos-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Calma */
.calm-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.calm-chip {
  background: var(--primary-soft);
  border: 2px solid var(--primary-soft-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-dark);
}
.calm-card-list { display: flex; flex-direction: column; gap: 10px; }
.calm-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
}
.calm-card-title { font-weight: 900; color: var(--primary-dark); margin-bottom: 4px; }
.calm-card-text  { font-weight: 600; color: var(--text); font-size: 14px; line-height: 1.55; }
.calm-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.calm-focus {
  min-height: 180px;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--primary-soft);
  border: 3px solid var(--primary-soft-border);
  border-radius: 20px;
  font-size: 36px;
  font-weight: 900;
  color: var(--primary-dark);
  letter-spacing: 0.04em;
  padding: 24px;
  white-space: pre-line;
  line-height: 1.2;
}
.calm-status {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
}
.calm-escalation { margin-top: 4px; padding: 12px; background: #fff7ed; border: 2px solid #fed7aa; border-radius: 16px; }

/* PORTE - nuovo stile neuro-inclusivo */
.porta-sticky-container {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 899;
}
.porta-sticky-btn {
  background: #fff8e1;
  border: 2px solid #f5c74c;
  color: #6b3f00;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.14);
  cursor: pointer;
  max-width: 42vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.porta-sticky-ico { font-size: 17px; }
.porta-sticky-txt { font-size: 11px; opacity: .8; }
.porta-sticky-val { color: #702b06; }

.porte-summary {
  background: #f3f4f6;
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  padding: 20px 22px;
  text-align: center;
  margin-bottom: 16px;
}
.porte-summary--selected {
  background: linear-gradient(180deg, #fff8e1 0%, #fff1c1 100%);
  border: 3px solid #f5c74c;
  box-shadow: 0 10px 32px rgba(245,199,76,0.25);
}
.porte-summary-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #941750;
  margin-bottom: 10px;
}
.porte-summary-title {
  font-size: 26px;
  font-weight: 900;
  color: #111827;
  line-height: 1.2;
}
.porte-summary--selected .porte-summary-title {
  color: #702b06;
}
.porte-summary-sub {
  font-size: 14px;
  margin-top: 8px;
  color: #374151;
  font-weight: 600;
}

.porte-panel {
  background: #fff;
  border: 2px solid #fbe3ec;
  border-radius: 20px;
  padding: 20px 22px 22px;
  box-shadow: 0 8px 26px rgba(148,23,80,0.08);
}
.porte-panel-kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #941750;
  margin-bottom: 14px;
}

.porte-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 720px) {
  .porte-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.porte-btn {
  border: 2px solid #e5c7d4;
  background: #fdf6f9;
  color: #3b0f24;
  border-radius: 16px;
  padding: 14px 12px;
  font-weight: 800;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  transition: transform .06s ease, border-color .15s ease, background .15s ease;
}
.porte-btn:hover { border-color: #941750; background: #faeaf2; }
.porte-btn:active { transform: scale(.98); }
.porte-btn-main {
  font-size: 17px;
  color: #941750;
  letter-spacing: .3px;
}
.porte-btn-sub {
  font-size: 11.5px;
  color: #6b7280;
  font-weight: 600;
  line-height: 1.25;
}
.porte-btn--selected {
  border: 3px solid #941750;
  background: linear-gradient(180deg, #fff8e1 0%, #fff1c1 100%);
  box-shadow: 0 10px 28px rgba(148,23,80,0.18);
}
.porte-btn--selected .porte-btn-main {
  color: #702b06;
  font-size: 18px;
}
.porte-btn--selected .porte-btn-sub { color: #5c3a00; }

.porte-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-danger {
  background: #fee2e2;
  border: 2px solid #fecaca;
  color: #991b1b;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}
.btn-danger:hover { background: #fecaca; }

@media (max-width: 560px) {
  .porte-summary { padding: 14px 16px; border-radius: 16px; }
  .porte-summary-kicker { font-size: 11px; letter-spacing: 1.2px; margin-bottom: 6px; }
  .porte-summary-title { font-size: 20px; }
  .porte-summary-sub { font-size: 12.5px; margin-top: 6px; }
  .porte-panel { padding: 14px 14px 16px; border-radius: 16px; }
  .porte-panel-kicker { font-size: 12px; letter-spacing: 1.3px; margin-bottom: 10px; }
  .porte-grid { gap: 10px; }
  .porte-btn { border-radius: 14px; padding: 10px 8px; min-height: 64px; }
  .porte-btn-main { font-size: 14.5px; }
  .porte-btn-sub { font-size: 10.5px; }
  .porta-sticky-btn {
    font-size: 12px;
    padding: 7px 11px;
    max-width: 48vw;
  }
  .porta-sticky-ico { font-size: 15px; }
  .porta-sticky-txt { display: none; }
}

@media (max-width: 380px) {
  .porte-summary-title { font-size: 18px; }
  .porte-btn-main { font-size: 13px; }
  .porte-btn-sub { display: none; }
  .porte-btn { min-height: 52px; padding: 8px 6px; }
  .porte-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (orientation: landscape) and (max-height: 520px) {
  .porte-summary { padding: 10px 14px; }
  .porte-summary-title { font-size: 16px; }
  .porte-panel { padding: 10px 14px 12px; }
  .porte-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .porte-btn { min-height: 48px; padding: 6px; }
  .porte-btn-sub { display: none; }
  .porta-sticky-btn { font-size: 11px; padding: 5px 10px; }
}

/* ================= RESPONSIVE MOBILE (stesso compatto di scene-semplice) ================= */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .app { padding: 14px 14px 100px; gap: 14px; }
  .site-header { padding: 8px 12px; gap: 8px; }
  .loghi { gap: 8px; }
  .loghi img { height: 26px; }
  .loghi-divider { height: 22px; }
  .header-link { font-size: 12px; padding: 6px 10px; }
  .dove-sono-card { padding: 12px 14px; border-radius: 16px; }
  .dove-sono-titolo { font-size: 12px; }
  #title { font-size: 22px; }
  #subtitle { font-size: 13px; margin-top: 4px; }
  .nav-cta { font-size: 13px; padding: 12px 12px; border-radius: 14px; }
  .tabs [data-tab] { min-width: 72px; font-size: 12px; padding: 8px 10px; border-radius: 12px; }
  .stage { padding: 12px; border-radius: 16px; }
  .stage-head h2 { font-size: 15px; }
  .btn { padding: 12px 14px; font-size: 14px; border-radius: 14px; }
  .hero-video-frame { border-radius: 14px; aspect-ratio: 16/9; }
  #btn-sos-fisso, #btn-calm-fisso { font-size: 13px; padding: 9px 14px; }
  #btn-calm-fisso { right: 92px; }
  .sos-fixed-btn { right: 14px !important; bottom: 14px !important; }
  .calm-fixed-btn { right: 88px !important; bottom: 14px !important; }
  .calm-focus { min-height: 140px; font-size: 28px; }
  .overlay-card { max-height: 94vh; border-radius: 16px; }
  .overlay-body { min-height: 320px; }
  .overlay-body iframe { min-height: 320px; }
}

@media (max-width: 380px) {
  .tabs [data-tab] { min-width: 64px; font-size: 11px; padding: 7px 8px; }
  .btn { font-size: 13px; padding: 10px 12px; }
  #title { font-size: 20px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .app { padding: 10px 12px 90px; gap: 10px; }
  .dove-sono-card { padding: 8px 12px; }
  .dove-sono-titolo { font-size: 11px; }
  #title { font-size: 18px; }
  .nav-cta { font-size: 12px; padding: 9px 12px; }
  .tabs [data-tab] { padding: 6px 10px; font-size: 12px; }
  .btn { padding: 10px 12px; font-size: 13px; }
  .sos-fixed-btn, .calm-fixed-btn { font-size: 12px; padding: 7px 12px; bottom: 8px; }
}

/* =========================================================
   MAPPA VERA · toggle 1°/2° Piano + PIN cliccabili
========================================================= */
.map-toggle {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.map-toggle button {
  flex: 1 1 auto;
  min-height: 56px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 16px;
  border: 3px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  padding: 10px 14px;
  transition: all 0.15s ease;
}
.map-toggle button[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(148, 23, 80, 0.22);
}
.map-container {
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid var(--primary-soft-border);
  background: #e9edf6;
  aspect-ratio: 16 / 9;
  max-height: 68vh;
  user-select: none;
}
.map-container.is-edit {
  cursor: crosshair;
  outline: 4px dashed #059669;
  outline-offset: 4px;
  border-color: #059669;
}
.map-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.map-edit-hint {
  position: absolute;
  top: 8px; left: 8px; right: 8px;
  background: rgba(5, 150, 105, 0.95);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}
.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  background: var(--primary);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  z-index: 5;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}
.map-pin:hover { transform: translate(-50%, -106%) scale(1.05); box-shadow: 0 8px 20px rgba(148,23,80,0.4); }
.map-pin:focus-visible { outline: 4px solid #000; outline-offset: 3px; }
.map-pin--active {
  background: #059669;
  width: 58px;
  height: 58px;
  font-size: 20px;
  z-index: 10;
  border-color: #fff;
  animation: pinPulse 1.4s ease-in-out infinite;
}
@keyframes pinPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105, 0.55), 0 6px 16px rgba(0,0,0,0.25); }
  50%      { box-shadow: 0 0 0 14px rgba(5,150,105,0.0), 0 6px 16px rgba(0,0,0,0.25); }
}
.map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  text-align: center;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(4px);
  gap: 8px;
  pointer-events: none;
}
.map-container.is-edit .map-empty {
  display: none !important;
}
.map-empty strong { font-size: 18px; color: var(--primary); }
.map-empty small { font-size: 14px; color: var(--muted); }
.map-iframe-fallback {
  margin-top: 14px;
  border-top: 2px dashed var(--primary-soft-border);
  padding-top: 14px;
}

.map-pin--poi {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, #fde68a, #f59e0b);
  color: #111;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
  user-select: none;
  z-index: 5;
  line-height: 1;
}
.map-pin--poi:hover {
  transform: translate(-50%, -56%) scale(1.08);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}
.map-pin--poi:focus {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.map-poi-popup {
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translate(-50%, -100%);
  min-width: 260px;
  max-width: 340px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 16px;
  padding: 14px 16px 14px 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.22);
  z-index: 20;
  display: none;
  gap: 10px;
  flex-direction: column;
  font-family: inherit;
}
.map-poi-popup[data-open="true"] {
  display: flex;
}
.map-poi-popup::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--primary);
}
.map-poi-popup__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.map-poi-popup__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  color: var(--primary);
  line-height: 1.2;
}
.map-poi-popup__icon {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: linear-gradient(145deg, #fde68a, #f59e0b);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.map-poi-popup__close {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: none;
  background: #f3f4f6;
  color: #111;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .16s ease;
}
.map-poi-popup__close:hover { background: #e5e7eb; }
.map-poi-popup__body {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}
.map-poi-popup__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.map-poi-popup__btn {
  flex: 1 1 auto;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .12s ease, filter .12s ease;
  text-decoration: none;
}
.map-poi-popup__btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.map-poi-popup__btn--ghost {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

/* =========================================================
   🎨 BARRA FILTRI SERVIZI (POI) + stato attivo categoria
   ========================================================= */
.poi-filter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border: 1px solid #f3e8ff;
  border-radius: 20px;
  padding: 14px 16px;
  margin: 0 0 14px 0;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.06);
}
.poi-filter__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary, #7c1d52);
  letter-spacing: 0.02em;
}
.poi-filter__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.poi-filter__btn {
  --btn-pad-v: 10px;
  --btn-pad-h: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--btn-pad-v) var(--btn-pad-h);
  border-radius: 999px;
  border: 2px solid #ede9fe;
  background: #ffffff;
  color: #4c1d95;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.poi-filter__btn:hover {
  transform: translateY(-1px);
  border-color: #ddd6fe;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}
.poi-filter__btn:active {
  transform: translateY(0);
}
.poi-filter__btn[aria-pressed="true"] {
  background: var(--primary, #7c1d52);
  border-color: var(--primary, #7c1d52);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 29, 82, 0.2);
}
/* Totem filter: stesso identico stile POI! */
.totem-filter {
  margin-bottom: 10px;
}

/* =========================================================
   🛡️ NASCONDI FORZATAMENTE I TOTEM BORDEAUX quando il filtro
      è attivo su "solo il mio totem"! PRIMA del JS! 
      (Serve per non dipendere dai listener JS!)
   ========================================================= */
#mapPlansWrap[data-totem-filter-current="only-current"] .map-pin:not(.map-pin--active) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
/* Quando si passa a "mostra tutti" li ri-rendi visibili! */
#mapPlansWrap[data-totem-filter-current="all"] .map-pin:not(.map-pin--active) {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

@media (max-width: 520px) {
  .poi-filter {
    padding: 12px;
  }
  .poi-filter__btn {
    --btn-pad-v: 9px;
    --btn-pad-h: 12px;
    font-size: 12.5px;
  }
}

