:root {
  --disp: #d8efe9; --disp-ink: #155e57;
  --off: #ece7e1; --off-ink: #8a7f74;
}
@media (prefers-color-scheme: dark) {
  :root { --disp: #173f3b; --disp-ink: #8fe0d3; --off: #2a2f31; --off-ink: #8d9699; }
}

.user-box { display: flex; align-items: center; gap: 12px; }
.user-name { font-weight: 500; }
.btn-sm { padding: 7px 16px; font-size: .9rem; margin-right: 0 !important; }

.area { max-width: 1180px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 48px) 80px; }
.banner { background: var(--brand-soft); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: .92rem; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tab { font: 600 .95rem Inter; color: var(--muted); background: none; border: 0; padding: 12px 18px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--ink); border-color: var(--brand); }
.panel { display: none; }
.panel.active { display: block; animation: in .25s ease; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.panel-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 4px; }
.panel-head .hint { margin: 0; }

/* ---------- Tour ---------- */
.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.tour-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.tour-card.inattivo { opacity: .65; }
.tour-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tour-card h3 { font: 600 1.15rem/1.25 Fraunces, serif; margin: 0; }
.tour-citta { color: var(--muted); font-size: .88rem; }
.tour-desc { color: var(--muted); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tour-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: .78rem; background: var(--bg); border-radius: 999px; padding: 3px 10px; }
.pill.on { background: var(--disp); color: var(--disp-ink); font-weight: 600; }
.pill.off { background: var(--off); color: var(--off-ink); font-weight: 600; }
.tour-prezzo { font: 600 1.25rem Fraunces, serif; }
.tour-prezzo small { font: 400 .8rem Inter; color: var(--muted); }
.tour-azioni { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.link-btn { background: none; border: 0; color: var(--accent); font: 600 .9rem Inter; cursor: pointer; padding: 4px 0; }
.link-btn.danger { color: var(--danger); margin-left: auto; }

.empty { text-align: center; padding: 56px 16px; border: 2px dashed var(--line); border-radius: 18px; }
.empty-icon { font-size: 2.4rem; }
.empty h3 { font: 600 1.3rem Fraunces, serif; margin: 8px 0 4px; }
.empty p { color: var(--muted); margin: 0 auto 18px; max-width: 40ch; }

/* ---------- Modale ---------- */
dialog { border: 0; border-radius: 20px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 26, 28, .45); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dlg-head, .dlg-foot { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; gap: 12px; }
.dlg-head { border-bottom: 1px solid var(--line); }
.dlg-head h2 { font: 600 1.3rem Fraunces, serif; margin: 0; }
.dlg-body { padding: 20px 24px 4px; overflow-y: auto; }
.dlg-foot { border-top: 1px solid var(--line); justify-content: flex-end; }
.dlg-foot .btn.ghost { margin-right: 0; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--brand); }

.switch { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; margin: 4px 0 12px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 40px; height: 22px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- Disponibilità ---------- */
.disp-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.disp-cal { position: sticky; top: 16px; }
.card { padding: clamp(18px, 2.5vw, 28px); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.seg { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 12px; cursor: pointer; font: inherit; transition: all .15s; }
.seg:hover { border-color: var(--brand); }
.seg b { display: block; font-size: .92rem; }
.seg small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.3; margin-top: 2px; }
.seg-ico { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 1rem; }
.seg.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.seg.active .seg-ico { background: var(--brand); color: #fff; }
.modo { display: none; }
.modo.active { display: block; animation: in .2s ease; }
.modo .actions { margin-top: 18px; }
.modo .actions .btn.ghost { margin-right: auto; }

.giorno-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.giorno-row:last-child { border-bottom: 0; }
.giorno-row .switch { margin: 6px 0 0; }
.giorno-row.spento .fasce-box { display: none; }
.giorno-row .chiuso { color: var(--muted); font-size: .88rem; padding-top: 7px; }
.giorno-row:not(.spento) .chiuso { display: none; }

.fasce-box { display: flex; flex-direction: column; gap: 8px; }
.fascia { display: flex; align-items: center; gap: 8px; }
.fascia input[type=time] { width: auto; flex: 1; min-width: 0; padding: 8px 10px; }
.fascia .sep { color: var(--muted); }
.fascia .rm { width: 30px; height: 30px; font-size: 1.1rem; flex: none; }
.add-fascia { align-self: flex-start; background: none; border: 0; color: var(--accent); font: 600 .85rem Inter; cursor: pointer; padding: 4px 0; }

.selezione { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; align-items: center; background: var(--bg); border-radius: 12px; padding: 8px 10px; margin-bottom: 14px; }
.selezione .tag { background: var(--surface); border: 1px solid var(--line); }
.muted { color: var(--muted); font-size: .9rem; }
.sub { font: 600 1.05rem Fraunces, serif; margin: 28px 0 10px; }
.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lista li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.lista li b { display: block; font-weight: 600; }
.lista li span { color: var(--muted); }
.lista .vuota { color: var(--muted); border-style: dashed; justify-content: center; }

/* ---------- Calendario ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h2 { font: 600 1.25rem Fraunces, serif; margin: 0; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-dow span { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; padding-bottom: 6px; }
.cal-day {
  aspect-ratio: 1 / 1.05; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  font: inherit; cursor: pointer; padding: 5px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  position: relative; transition: transform .1s, box-shadow .15s; min-width: 0; overflow: hidden;
}
.cal-day:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--brand-soft); }
.cal-day .n { font-weight: 600; font-size: .88rem; }
.cal-day .info { font-size: .62rem; line-height: 1.15; color: inherit; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-day.vuoto { visibility: hidden; }
.cal-day.passato { opacity: .4; cursor: default; }
.cal-day.oggi .n { color: var(--brand); }
.cal-day.oggi::after { content: ''; position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.cal-day.disp { background: var(--disp); color: var(--disp-ink); border-color: transparent; }
.cal-day.spec { box-shadow: inset 0 -3px 0 var(--brand); }
.cal-day.parz { background: linear-gradient(135deg, var(--disp) 50%, var(--off) 50%); color: var(--disp-ink); border-color: transparent; }
.cal-day.off { background: repeating-linear-gradient(-45deg, var(--off), var(--off) 5px, transparent 5px, transparent 9px), var(--surface); color: var(--off-ink); }
.cal-day.sel { outline: 2px solid var(--brand); outline-offset: 1px; }
.cal-day.range { outline: 2px solid var(--danger); outline-offset: 1px; }
.cal-day.attivo-det { box-shadow: 0 0 0 2px var(--accent); }

.legenda { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .78rem; color: var(--muted); }
.legenda li { display: flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }
.lg-disp { background: var(--disp); border-color: transparent; }
.lg-spec { background: var(--surface); box-shadow: inset 0 -3px 0 var(--brand); }
.lg-parz { background: linear-gradient(135deg, var(--disp) 50%, var(--off) 50%); border-color: transparent; }
.lg-off { background: repeating-linear-gradient(-45deg, var(--off), var(--off) 3px, transparent 3px, transparent 6px); }

.cal-dettaglio { margin-top: 16px; background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: .88rem; min-height: 48px; }
.cal-dettaglio b { text-transform: capitalize; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 12px 20px; border-radius: 999px; font-weight: 500; font-size: .92rem; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 10; animation: in .2s ease; max-width: calc(100vw - 32px); }

@media (max-width: 960px) {
  .disp-layout { grid-template-columns: 1fr; }
  .disp-cal { position: static; order: -1; }
}
@media (max-width: 560px) {
  .segmented { grid-template-columns: 1fr; }
  .giorno-row { grid-template-columns: 1fr; gap: 6px; }
  .cal-day .info { display: none; }
  .cal-day { aspect-ratio: 1; }
  .user-name { display: none; }
  .tab { padding: 12px 12px; }
}

/* ---------- Navigazione: icone nei tab ---------- */
.tab { display: inline-flex; align-items: center; gap: 8px; }
.tab-ico { width: 18px; height: 18px; flex: none; }

/* ---------- Telefono: aspetto da app ---------- */
@media (max-width: 720px) {
  body { --nav-h: 64px; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
  .topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-bottom: 12px; }
  .area { padding-top: 0; }

  /* Barra in basso come nelle app */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    background: var(--surface); border-top: 1px solid var(--line); border-bottom: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .06);
  }
  .tab {
    flex-direction: column; gap: 3px; justify-content: center; border: 0; margin: 0;
    padding: 6px 4px; font-size: .74rem; border-radius: 12px; min-height: 52px;
  }
  .tab-ico { width: 24px; height: 24px; }
  .tab.active { color: var(--brand); background: var(--brand-soft); }

  /* "Nuovo tour" come pulsante flottante */
  #btn-nuovo-tour {
    position: fixed; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 14;
    box-shadow: 0 10px 28px rgba(192, 40, 53, .4); padding: 14px 20px;
  }
  .tour-grid { grid-template-columns: 1fr; }
  .panel-title { font-size: 1.6rem; }

  /* Modale a tutto schermo */
  dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog form { height: 100dvh; max-height: 100dvh; }
  .dlg-head { padding-top: max(18px, env(safe-area-inset-top)); }
  .dlg-body { flex: 1; }
  .dlg-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .dlg-foot .btn { flex: 1; }

  .toast { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
  .banner { font-size: .85rem; }
  .modo .actions { flex-wrap: wrap; }
  .modo .actions .btn:not(.ghost) { flex: 1; }
}

.banner-rifiutata, .banner-sospesa { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--ink); }

/* ---------- Menu comune (link) e contatori ---------- */
a.tab { text-decoration: none; position: relative; }
.tab-contatore {
  font: 600 .7rem/1 Inter; font-style: normal; background: var(--brand); color: #fff;
  border-radius: 99px; padding: 3px 6px; min-width: 18px; text-align: center;
}
@media (max-width: 720px) {
  .tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .tab-contatore { position: absolute; top: 4px; left: calc(50% + 6px); }
}

/* ---------- Prenotazioni della guida ---------- */
.tessere-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
.pren-annullati { margin-top: 22px; }
.pren-annullati summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
#panel-prenotazioni .pren-lista { max-width: 860px; }
.pren-data .pill { white-space: nowrap; }
@media (max-width: 720px) {
  .tessere.tessere-2 { grid-template-columns: 1fr 1fr; }
  .tessere.tessere-2 .tessera.totale { grid-column: auto; }
}

/* ---------- Tempo di viaggio dei tour ---------- */
.pill-avviso { background: #fbefd5; color: #8a5a00; border: 1px solid #e2b85c; font: 600 .78rem Inter; cursor: pointer; }
.viaggio-box { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.viaggio-box small.hint { margin-top: 8px; }
@media (prefers-color-scheme: dark) { .pill-avviso { background: #3d3216; color: #f5c96b; } }

/* ---------- Profilo e residenza ---------- */
.profilo-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.profilo-layout .sub:first-child { margin-top: 0; }
.profilo-fisso .dati { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: .9rem; }
.profilo-fisso dt { color: var(--muted); }
.profilo-fisso dd { margin: 0; overflow-wrap: anywhere; }
.posizione { border-radius: 10px; padding: 10px 12px; font-size: .86rem; margin: -4px 0 16px; }
.posizione-ok { background: var(--disp); color: var(--disp-ink); }
.posizione-parziale { background: #fbefd5; color: #6b4600; }
.posizione-ko { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.banner-profilo { background: #fbefd5; }
.banner-profilo a { font-weight: 600; margin-left: 4px; }
.viaggio-calcola { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.viaggio-calcola .btn.ghost { background: var(--surface); margin-right: 0; }
.viaggio-stima { font-size: .84rem; color: var(--ink); }
@media (prefers-color-scheme: dark) { .posizione-parziale, .banner-profilo { background: #3d3216; color: #f5c96b; } }
@media (max-width: 900px) { .profilo-layout { grid-template-columns: 1fr; } }
#p-lingue { margin-bottom: 4px; }
#form-profilo .lingua-altra { margin-bottom: 4px; }
.err-testo { color: var(--danger); }
.etichetta-viaggio { margin-top: 12px; }

/* ---------- Ricevute ---------- */
.ric-numerazione { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 8px; padding: 16px 20px; }
.ric-numerazione .tessera-l { display: block; font-size: .78rem; color: var(--muted); }
.ric-num { font: 700 1.6rem Fraunces, serif; margin-right: 12px; }
.ric-num-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ric-num-form label { font-size: .85rem; margin: 0; }
.ric-num-form input { width: 110px; padding: 8px 10px; }
.ric-num-form .btn.ghost { margin-right: 0; }
.ric-numerazione .form-error { width: 100%; margin: 0; }
#ric-da-emettere .pren-importo .btn { margin-top: 6px; }
#ric-tabella tr.annullata td { color: var(--muted); text-decoration: line-through; }
#ric-tabella tr.annullata td:last-child, #ric-tabella tr.annullata td:nth-last-child(2) { text-decoration: none; }
#ric-tabella tbody tr { cursor: default; }
.azioni-riga { white-space: nowrap; }
.azioni-riga .link-btn { margin-right: 10px; padding: 0; }
.ric-origine { background: var(--bg); border-radius: 12px; padding: 10px 14px; font-size: .88rem; margin-bottom: 16px; }
.ric-calcolo { background: var(--bg); border-radius: 12px; padding: 12px 14px; margin: -4px 0 16px; font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.ric-calcolo div { display: flex; justify-content: space-between; gap: 12px; }
.ric-calcolo .ric-netto { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; font-size: 1rem; }
.ric-bollo { margin: 6px 0 0; color: #8a5a00; font-size: .84rem; }
#dlg-ricevuta .check { margin: 4px 0 8px; }
@media (max-width: 720px) {
  #ric-tabella td[data-col] { display: block; }
  #btn-ricevuta-manuale { width: 100%; }
}
@media (max-width: 720px) {
  #ric-tabella tr { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; }
  #ric-tabella td { grid-row: auto; grid-column: auto; }
  #ric-tabella .rc-n { grid-column: 1; grid-row: 1; }
  #ric-tabella .rc-n::before { content: 'N. '; }
  #ric-tabella .rc-cliente { grid-column: 2; grid-row: 1; font-weight: 600; }
  #ric-tabella .rc-stato { grid-column: 3; grid-row: 1; }
  #ric-tabella .rc-oggetto { grid-column: 1 / -1; grid-row: 2; color: var(--muted); font-size: .85rem; }
  #ric-tabella .rc-data { grid-column: 1 / 3; grid-row: 3; color: var(--muted); font-size: .82rem; }
  #ric-tabella .rc-netto { grid-column: 3; grid-row: 3; text-align: right; font-weight: 600; }
  #ric-tabella .rc-netto::before { content: 'Netto '; font-weight: 400; color: var(--muted); font-size: .8rem; }
  #ric-tabella .rc-lordo { display: none; }
  #ric-tabella .rc-azioni { grid-column: 1 / -1; grid-row: 4; }
}

/* Ricevute della guida: colore per origine (tramite app / fuori app) */
#ric-riepilogo { margin-bottom: 12px; }
#ric-tabella tr.annullata td.rc-origine { text-decoration: none; }
#ric-tabella .rc-origine .pill { white-space: nowrap; }
@media (max-width: 720px) {
  #ric-tabella .rc-origine { grid-column: 1 / 3; grid-row: 4; }
  #ric-tabella .rc-azioni { grid-column: 3; grid-row: 4; justify-self: end; }
}
#ric-tabella td.num { white-space: nowrap; }
@media (max-width: 720px) {
  #ric-tabella tbody tr.origine-app td:first-child, #ric-tabella tbody tr.origine-manuale td:first-child { box-shadow: none; padding-left: 0; }
}
/* Menu con più di 5 voci (amministratore): etichette corte e testo più piccolo sul telefono */
.tab-breve { display: none; }
@media (max-width: 720px) {
  .tabs-molte .tab:has(.tab-breve) .tab-testo { display: none; }
  .tabs-molte .tab-breve { display: inline; }
  .tabs-molte { padding-left: 4px; padding-right: 4px; }
  .tabs-molte .tab { font-size: .68rem; padding: 6px 2px; min-width: 0; }
}

/* ---------- Google Calendar (profilo guida) ---------- */
.gcal { margin-top: 18px; }
.gcal-testa { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.gcal-testa .sub { margin: 0 0 2px; }
.gcal-ico { width: 34px; height: 34px; flex: none; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 10px; padding: 6px; }
.gcal-stato { padding: 10px 12px; border-radius: 10px; font-size: .9rem; margin: 0 0 8px; }
.gcal-stato.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); }
.gcal-stato.errore { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.gcal-stato.spento { background: var(--bg); color: var(--muted); }
.gcal-avviso { margin-top: 8px; }
.gcal-impegni { margin: 10px 0; font-size: .88rem; }
.gcal-impegni ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.gcal-impegni li { display: flex; justify-content: space-between; gap: 8px; background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.gcal-impegni li span:first-child { text-transform: capitalize; }
.gcal-impegni li span:last-child { color: var(--muted); white-space: nowrap; }
.gcal-azioni { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.gcal-pren { display: inline-block; margin-top: 4px; font-size: .8rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.gcal-pren:hover { text-decoration: underline; }
.gcal-pren.gia { color: var(--ok); }

/* ---------- Fotografie dei tour ---------- */
.tour-card { overflow: hidden; }
.tour-cover { position: relative; margin: -20px -20px 4px; aspect-ratio: 16 / 9; background: var(--bg); }
.tour-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tour-cover-n { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.tour-cover.vuota { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-bottom: 2px dashed color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface)); color: var(--danger); cursor: pointer; font: inherit; width: calc(100% + 40px); }
.tour-cover.vuota span { font-size: 1.8rem; }
.tour-cover.vuota small { color: var(--muted); }
.foto-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-top: 6px; }
.foto-tile { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.foto-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-tile.carica img { opacity: .45; }
.foto-copertina { position: absolute; left: 6px; top: 6px; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.foto-carica { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; font-weight: 600; }
.foto-comandi { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.foto-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .92); color: #1f2a2e; font-size: .85rem; cursor: pointer; display: grid; place-items: center; }
.foto-btn:disabled { opacity: .35; cursor: default; }
.foto-togli { margin-left: auto; color: var(--danger); font-size: 1.15rem; font-weight: 700; }
.foto-comandi .foto-btn + .foto-btn { margin-left: 4px; }
.foto-aggiungi { aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: 10px; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--accent); font: inherit; padding: 6px; text-align: center; }
.foto-aggiungi:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.foto-aggiungi span { font-size: 1.6rem; line-height: 1; }
.foto-aggiungi b { font-size: .82rem; }
.foto-aggiungi small { color: var(--muted); font-size: .72rem; }

/* ---------- Replica di un tour ---------- */
.tour-bottoni { display: flex; gap: 10px; flex-wrap: wrap; }
.tour-bottoni.centrati { justify-content: center; }
dialog.dlg-largo { width: min(860px, calc(100vw - 24px)); }
#dlg-catalogo .dlg-head .hint { margin: 2px 0 0; }
.cat-toolbar { grid-template-columns: minmax(0, 1fr) 220px; margin-bottom: 6px; }
.cat-lista { display: flex; flex-direction: column; gap: 10px; }
.cat-voce { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--surface); }
.cat-voce img { width: 132px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.cat-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cat-info b { font-size: 1rem; }
.cat-dett { color: var(--muted); font-size: .8rem; }
.cat-desc { font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-gia { align-self: flex-start; margin-top: 2px; }
.replica-info { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 12px; padding: 10px 14px; font-size: .88rem; margin-bottom: 14px; line-height: 1.45; }
.replica-nota { display: block; margin-top: 4px; color: var(--muted); font-size: .82rem; }
@media (max-width: 720px) {
  .cat-toolbar { grid-template-columns: 1fr; }
  .cat-voce { grid-template-columns: 96px minmax(0, 1fr); }
  .cat-voce img { width: 96px; }
  .cat-voce .btn { grid-column: 1 / -1; width: 100%; }
  .panel-head .tour-bottoni { width: 100%; }
}
.tour-cover.riferimento { display: block; width: calc(100% + 40px); padding: 0; border: 0; cursor: pointer; font: inherit; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.tour-cover.riferimento img { filter: saturate(.85); }
.tour-cover-rif { position: absolute; left: 10px; bottom: 10px; right: 10px; width: max-content; max-width: calc(100% - 20px); background: rgba(0, 0, 0, .65); color: #fff; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; }

/* Prossime partenze (tour di gruppo) e modulo del tour */
.partenze-guida { display: grid; gap: 10px; margin-bottom: 22px; }
.pg { padding: 14px 16px !important; }
.pg-annullata { opacity: .7; }
.pg-testa { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.pg-testa .hint { margin: 2px 0 0; }
.pg-barra { position: relative; height: 10px; border-radius: 99px; background: var(--line); }
.pg-pieno { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: #e0a106; }
.pg-pieno.ok { background: var(--disp-ink); }
.pg-minimo { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--ink); border-radius: 2px; transform: translateX(-1px); }
.pg-numeri { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: .88rem; color: var(--muted); }
.pg-numeri b { color: var(--ink); }
.pg-iscritti { margin-top: 8px; font-size: .88rem; }
.pg-iscritti summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.pg-iscritti ul { margin: 6px 0 0; padding-left: 18px; }
.gruppo-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 4px; margin: 0 0 16px; }
.gruppo-box legend { padding: 0 6px; }
.gruppo-grid { grid-template-columns: 1.3fr 1fr 1fr 1.2fr; }
.gruppo-anteprima { margin: 0 0 12px; font-size: .9rem; color: var(--muted); }
.gruppo-anteprima b { color: var(--ink); }
.tour-totale { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
@media (max-width: 720px) { .gruppo-grid { grid-template-columns: 1fr 1fr; } }

/* Ricevute: prenotazioni di un tour a raccolta (una ricevuta ciascuna) */
.ric-raccolta { list-style: none; display: grid; gap: 2px; padding: 12px 4px 6px; border-top: 1px solid var(--line); margin-top: 6px; }
.ric-raccolta b { font-size: .92rem; }
.ric-raccolta span { font-size: .82rem; color: var(--muted); }
.pren.in-raccolta { margin-left: 14px; border-left: 3px solid color-mix(in srgb, var(--accent, #1f6f6b) 40%, transparent); padding-left: 10px; }
.ric-tipo { margin-top: 4px; width: fit-content; font-size: .75rem; }
.ric-tipo.intero { background: color-mix(in srgb, #1e8a4c 14%, transparent); color: #1e6b3d; }
input[readonly] { background: color-mix(in srgb, var(--line) 35%, transparent); }
