/* Pannello Camaleontico — foglio dal basso su mobile, colonna a destra su desktop */
#pannello { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; background: var(--bianco); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 40px rgba(30, 50, 80, .16), 0 0 0 1px var(--blu-06);
  display: flex; flex-direction: column; height: var(--h, 46vh); max-height: calc(100dvh - 60px - var(--sa-t)); transition: height .42s var(--dolce), opacity .6s ease, transform .7s var(--dolce); will-change: height; }
#pannello.trascina { transition: none; }
/* altezze di Mondo (ridotto), Anteprima (medio), Immersione (esteso): calcolate in js/componenti/foglio.js */
#pannello[data-stato="ingresso"] { height: auto; }
body.avvio #pannello { transform: translateY(24px); }
#maniglia { flex: none; height: 22px; display: grid; place-items: center; touch-action: none; cursor: grab; }
#linguetta { display: none; }
#maniglia span { width: 38px; height: 4px; border-radius: 2px; background: var(--blu-12); }
#pannello[data-stato="ingresso"] #maniglia { visibility: hidden; height: 12px; }
#pannello-testa { flex: none; padding: 0 16px 10px; touch-action: none; }
#pannello-corpo { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: manipulation; padding: 2px 16px calc(22px + var(--sa-b)); outline: none; }
#pannello[data-stato="ridotto"] #pannello-corpo { overflow: hidden; }
@media (max-width: 899px) { #pannello[data-stato="ridotto"]:not(.trascina) #pannello-corpo { visibility: hidden; } }
#pannello[data-stato="ingresso"] #pannello-corpo { padding-bottom: calc(18px + var(--sa-b)); flex: none; }

.frase { font-family: "Prata", serif; font-size: clamp(25px, 6.6vw, 32px); line-height: 1.16; text-align: center; padding: 4px 8px 16px; color: var(--blu); }
body.avvio .frase, body.avvio .cerca-riga { opacity: 0; transform: translateY(8px); }
.frase, .cerca-riga { transition: opacity .7s ease, transform .8s var(--dolce); }
body.passo-3 .frase, body.passo-4 .cerca-riga { opacity: 1; transform: none; }

.cerca-riga { display: flex; align-items: center; gap: 8px; }
.cerca { flex: 1; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 24px; background: var(--blu-06); box-shadow: inset 0 0 0 1px var(--blu-06); }
.cerca:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--oro); }
.cerca svg { width: 18px; height: 18px; flex: none; color: var(--blu-50); }
.cerca input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.cerca input::placeholder { color: var(--blu-50); }
.cerca .x { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--blu-50); }

.briciole { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; font-size: 12.5px; color: var(--blu-50); margin: 4px 0 6px; }
.briciole button { padding: 4px 2px; color: var(--blu-70); font-weight: 500; }
.briciole button:hover { color: var(--oro-scuro); }
.briciole .sep { opacity: .5; }
.briciole .indietro { width: 30px; height: 30px; margin-right: 4px; border-radius: 50%; background: var(--blu-06); display: grid; place-items: center; padding: 0; }
.briciole .indietro svg { width: 16px; height: 16px; }
.sopra { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--oro-scuro); margin-bottom: 2px; }
.titolo { font-family: "Prata", serif; font-size: 30px; line-height: 1.12; margin: 0 0 4px; }
.titolo.piccolo { font-size: 24px; }
.motto { font-size: 15px; color: var(--blu-70); margin-bottom: 10px; }
.intro { font-size: 15.5px; line-height: 1.55; margin: 8px 0 14px; }
.sezione { margin: 20px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--blu-50); display: flex; justify-content: space-between; align-items: center; }
.vuoto { font-size: 14.5px; color: var(--blu-70); padding: 12px 14px; border-radius: 14px; background: var(--blu-06); margin: 10px 0; }

.guardi { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 14px; background: var(--oro-14); font-size: 14px; margin: 4px 0 12px; animation: su .35s var(--dolce) both; }
.guardi b { font-weight: 600; }
.guardi button { flex: none; font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 14px; background: #fff; }

.temi { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 6px; padding: 4px 16px 8px; scrollbar-width: none; }
.temi::-webkit-scrollbar { display: none; }
.tema { flex: none; height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14px; font-weight: 500; background: #fff; box-shadow: inset 0 0 0 1px var(--blu-12); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tema small { font-size: 11.5px; color: var(--blu-50); font-weight: 500; }
.tema[aria-pressed="true"] { background: var(--blu); color: #fff; box-shadow: none; }
.tema[aria-pressed="true"] small { color: rgba(255, 255, 255, .7); }

.lista { display: flex; flex-direction: column; }
.voce-lista { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--blu-06); width: 100%; }
.voce-lista:last-child { border-bottom: 0; }
.voce-lista .ico { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--blu-06); display: grid; place-items: center; color: var(--blu); }
.voce-lista .ico svg { width: 19px; height: 19px; }
.voce-lista .ico.oro { background: var(--oro-14); color: var(--oro-scuro); }
.voce-lista .tx { flex: 1; min-width: 0; }
.voce-lista .n, .voce-lista .s { display: block; }
.voce-lista .tx { text-align: left; }
.voce-lista .etichetta { flex: none; margin-left: 0; }
.voce-lista .n { font-weight: 500; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voce-lista .s { font-size: 13px; color: var(--blu-50); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voce-lista .fr { flex: none; color: var(--blu-50); }
.voce-lista .fr svg { width: 16px; height: 16px; }
.griglia { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tessera { padding: 12px 12px 11px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--blu-12); min-height: 62px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.tessera .n { font-family: "Prata", serif; font-size: 16px; line-height: 1.2; }
.tessera .s { font-size: 12px; color: var(--blu-50); }
.tessera.spenta { box-shadow: inset 0 0 0 1px var(--blu-06); }
.tessera.spenta .n { font-family: "DM Sans", sans-serif; font-size: 14px; color: var(--blu-70); }

.etichetta { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 6px; font-size: 10px; font-weight: 600; letter-spacing: .1em; vertical-align: middle; margin-left: 6px; }
.etichetta.demo { background: var(--oro-14); color: var(--oro-scuro); }
.etichetta.vds { background: var(--blu); color: #fff; }
.etichetta.bozza { background: var(--blu-06); color: var(--blu-70); }
.etichetta.sim { background: #fff; color: var(--blu-70); box-shadow: inset 0 0 0 1px var(--blu-12); }

.citazione { font-family: "Prata", serif; font-size: 19px; line-height: 1.45; padding: 4px 0 4px 16px; border-left: 2px solid var(--oro); margin: 12px 0 10px; }
.scheda-dati { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; margin: 4px 0; }
.scheda-dati dt { color: var(--blu-50); }
.scheda-dati dd { margin: 0; }
.nota { font-size: 12.5px; color: var(--blu-50); margin: 8px 0; line-height: 1.45; }

.azioni { display: flex; gap: 8px; margin: 16px 0 6px; flex-wrap: wrap; }
.btn { height: 46px; padding: 0 18px; border-radius: 23px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn svg { width: 18px; height: 18px; }
.btn.primo { background: var(--blu); color: #fff; flex: 1; }
.btn.primo[aria-pressed="true"] { background: var(--oro); }
.btn.secondo { box-shadow: inset 0 0 0 1.5px var(--blu-12); }
.btn.testo { height: 40px; padding: 0 4px; color: var(--oro-scuro); font-size: 14.5px; }
.btn.piccolo { height: 36px; font-size: 13.5px; padding: 0 14px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.inviti { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--blu-06); display: flex; flex-direction: column; align-items: flex-start; }

.schede { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--blu-06); margin: 8px 0 14px; }
.schede button { flex: 1; height: 38px; border-radius: 12px; font-size: 13.5px; font-weight: 500; text-align: center; color: var(--blu-70); }
.schede button[aria-selected="true"] { background: #fff; color: var(--blu); box-shadow: 0 1px 6px rgba(30, 50, 80, .12); font-weight: 600; }
.campo { display: block; margin: 12px 0; }
.campo span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--blu-50); margin-bottom: 6px; }
.campo input, .campo textarea, .campo select { width: 100%; border: 0; border-radius: 12px; background: var(--blu-06); padding: 12px 14px; font-size: 16px; outline: 0; resize: vertical; }
.campo input:focus, .campo textarea:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--oro); }
.modi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.modi button { padding: 10px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--blu-12); font-size: 14px; font-weight: 500; display: flex; gap: 8px; align-items: center; }
.modi button svg { width: 18px; height: 18px; flex: none; }
.modi button[aria-pressed="true"] { background: var(--blu); color: #fff; box-shadow: none; }
.ancore { font-size: 14px; padding: 10px 12px; border-radius: 12px; background: var(--oro-14); margin: 10px 0; }
.riga-fine { display: flex; gap: 8px; align-items: center; }
#pannello-corpo.in-volo .dopo { opacity: 0; }
#pannello-corpo.arrivo .dopo > * { animation: su .5s var(--dolce) both; }
#pannello-corpo.arrivo .dopo > *:nth-child(2) { animation-delay: .06s; } #pannello-corpo.arrivo .dopo > *:nth-child(3) { animation-delay: .12s; }
#pannello-corpo.arrivo .dopo > *:nth-child(4) { animation-delay: .18s; } #pannello-corpo.arrivo .dopo > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes su { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 900px) {
  #pannello { left: auto; top: 0; bottom: 0; width: var(--pannello-w); height: auto !important; max-height: none; border-radius: 0; box-shadow: -8px 0 40px rgba(30, 50, 80, .10), 0 0 0 1px var(--blu-06); }
  #pannello[data-stato="ingresso"] { height: auto; justify-content: center; }
  #pannello[data-stato="ingresso"] #pannello-corpo { flex: none; }
  #pannello[data-stato="ridotto"] #pannello-corpo { overflow-y: auto; }
  #pannello[data-stato="ridotto"] { transform: translateX(100%); box-shadow: none; }
  #linguetta { display: grid; place-items: center; position: absolute; left: -34px; top: 50%; width: 34px; height: 64px; margin-top: -32px; border-radius: 14px 0 0 14px;
    background: var(--bianco); color: var(--blu); box-shadow: -6px 0 18px rgba(30, 50, 80, .10), 0 0 0 1px var(--blu-06); font-size: 22px; line-height: 1; }
  #linguetta::before { content: "\203A"; }
  #pannello[data-stato="ridotto"] #linguetta::before { content: "\2039"; }
  body.avvio #linguetta { visibility: hidden; }
  #maniglia { display: none; }
  #pannello-testa { padding: 20px 26px 12px; }
  #pannello-corpo { padding: 2px 26px 30px; }
  .temi { margin: 4px -26px 6px; padding: 4px 26px 8px; flex-wrap: wrap; overflow: visible; }
  .frase { font-size: 34px; text-align: left; padding: 0 0 20px; }
  body.avvio #pannello { transform: translateX(24px); }
}

/* ---------- Esploratore: ruota delle categorie, stato, pillole, mini schede ---------- */
.esploratore { margin: 4px -16px 0; --passo: 64px; }
.esploratore .ruota { position: relative; }
.esploratore .ruota-vista { height: 84px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x; perspective: 460px; outline: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20%, #000 80%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 20%, #000 80%, transparent 100%); }
.esploratore .ruota-vista::-webkit-scrollbar { display: none; }
.esploratore .ruota-pista { display: flex; height: 100%; padding-inline: calc(50% - var(--passo) / 2); width: max-content; }
.esploratore .ruota-voce { flex: none; width: var(--passo); height: 100%; display: grid; place-items: center; scroll-snap-align: center; }
.esploratore .ruota-icona { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--blu-06); will-change: transform, opacity; color: var(--c, var(--blu)); }
.esploratore .ruota-icona svg { width: 22px; height: 22px; }
.esploratore .ruota-voce[aria-selected="true"] .ruota-icona { background: #fff; box-shadow: 0 5px 14px rgba(30, 50, 80, .16); }
.esploratore .ruota-cornice { position: absolute; left: 50%; top: 42px; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 19px; pointer-events: none; box-shadow: inset 0 0 0 1.5px var(--oro), 0 0 0 5px var(--oro-14); }
.esploratore .stato-r { text-align: center; padding: 2px 16px 0; }
.esploratore .stato-r b { font-family: "Prata", serif; font-weight: 400; font-size: 18px; }
.esploratore .stato-r span { font-size: 13px; color: var(--blu-50); margin-left: 6px; }
.esploratore .pillole-r { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 16px 2px; touch-action: pan-x; }
.esploratore .pillole-r::-webkit-scrollbar { display: none; }
.esploratore .pillole-r[hidden] { display: none; }
.pillola-r { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13.5px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--blu-12); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.pillola-r small { color: var(--blu-50); font-size: 11.5px; }
.pillola-r[aria-pressed="true"] { background: var(--blu); color: #fff; box-shadow: none; }
.pillola-r[aria-pressed="true"] small { color: rgba(255,255,255,.7); }
.esploratore .schede-r { display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x mandatory; padding: 10px calc(50% - 74px) 8px; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.esploratore .schede-r::-webkit-scrollbar { display: none; }
.scheda-r { flex: none; width: 148px; height: 118px; border-radius: 16px; overflow: hidden; scroll-snap-align: center; display: flex; flex-direction: column; text-align: left; background: #fff; box-shadow: 0 0 0 1px var(--blu-12); transition: transform .25s var(--dolce), box-shadow .25s; }
.scheda-r .fascia { position: relative; height: 50px; flex: none; display: flex; align-items: flex-end; padding: 0 9px 6px; color: #fff; overflow: hidden; }
.scheda-r .fascia img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scheda-r .fascia svg { position: relative; width: 19px; height: 19px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.scheda-r .t { padding: 7px 10px 0; font-weight: 600; font-size: 13.5px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scheda-r .s { padding: 2px 10px; font-size: 11.5px; color: var(--blu-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scheda-r.attiva { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--oro), 0 8px 20px rgba(30, 50, 80, .16); }
#pannello[data-stato="esteso"] .esploratore .schede-r { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; padding: 10px 16px 8px; touch-action: auto; }
#pannello[data-stato="esteso"] .scheda-r { width: calc(50% - 5px); }
@media (min-width: 900px) {
  .esploratore .schede-r { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; padding: 10px 16px 8px; }
  .scheda-r { width: calc(50% - 5px); }
}
.galleria { display: flex; gap: 8px; overflow-x: auto; margin: 6px -16px 10px; padding: 0 16px; scrollbar-width: none; touch-action: pan-x; }
.galleria::-webkit-scrollbar { display: none; }
.galleria img { flex: none; height: 150px; width: auto; max-width: 82%; border-radius: 14px; object-fit: cover; background: var(--blu-06); }
.video-voce { width: 100%; max-height: 52vh; border-radius: 14px; background: #000; margin: 6px 0 10px; }
.posiz { font-size: 13px; line-height: 1.45; padding: 9px 12px; border-radius: 12px; background: var(--blu-06); color: var(--blu-70); margin: 8px 0; }
.scheda-dati a { color: var(--oro-scuro); text-decoration: underline; }
