/* AdvTrack: stile comune (chiaro e scuro) */
:root {
  /* valori di riserva: i colori veri arrivano dalla palette scelta nell'amministrazione */
  --bg: #F4F1EA; --card: #ffffff; --field: #ffffff; --chip: #EAE8E3;
  --border: rgba(14, 26, 43, 0.11); --text: #0E1A2B; --muted: #818489;
  --accent: #E0218A; --on-accent: #fff; --accent-soft: rgba(224, 33, 138, 0.13); --accent-text: #C61D79; --second: #0E7490; --ink: #0E1A2B;
  --ok: #16a34a; --ok-soft: rgba(22, 163, 74, 0.12); --err: #dc2626; --err-soft: rgba(220, 38, 38, 0.1);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --card: #0f172a; --field: #111c33; --chip: #1e293b;
    --border: rgba(255, 255, 255, 0.09); --text: #f1f5f9; --muted: #94a3b8;
    --accent-soft: rgba(224, 33, 138, 0.18); --accent-text: #F0479F;
    --ok-soft: rgba(22, 163, 74, 0.18); --err-soft: rgba(220, 38, 38, 0.18);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.45; min-height: 100vh; }
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; }

/* Marchio */
.brand-word { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; color: var(--text); }
.brand-word b { color: var(--accent-text); font-weight: 700; }
.beta-tag { display: inline-block; vertical-align: 3px; margin-left: 7px; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.4; }
.auth-brand .beta-tag { vertical-align: 5px; }

/* Card e testi */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card, .card ~ .card, .card + .quick, .quick + .card { margin-top: 16px; }
.card h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.card h2 + .muted, .card h2 + p { margin-top: 4px; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.lead { color: var(--muted); font-size: 15px; margin-top: 8px; }
.lead b { color: var(--text); font-weight: 600; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.center { text-align: center; }
.count { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }

/* Pulsanti */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; transition: border-color .15s ease, filter .15s ease, transform .1s ease; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .nav-item:focus-visible, .quick-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }

/* Moduli */
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; }
.field > span i { font-style: normal; font-weight: 400; color: var(--muted); }
.field small { font-size: 12.5px; color: var(--muted); }
.field input, .prefix-input { width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); padding: 0 14px; font-size: 16px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.field input:focus, .prefix-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prefix-input { display: flex; align-items: center; padding: 0 0 0 12px; overflow: hidden; }
.prefix-input em { font-style: normal; color: var(--muted); font-size: 14px; white-space: nowrap; }
.prefix-input input { border: 0; height: 44px; padding: 0 12px 0 1px; box-shadow: none !important; background: transparent; min-width: 0; flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Avvisi */
.alert { border-radius: 12px; padding: 11px 14px; font-size: 14px; margin: 14px 0 0; }
.alert.error { background: var(--err-soft); color: var(--err); }
.alert.success { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--accent-soft); color: var(--accent-text); }
.content > .alert { margin: 0 0 16px; }

/* Pagine di accesso */
body.auth { display: flex; flex-direction: column; align-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px calc(16px + env(safe-area-inset-bottom)); }
body.auth .auth-wrap { margin: auto 0; }
.auth-wrap { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.auth-brand { text-decoration: none; }
.auth-brand .brand-word { font-size: 26px; }
.auth-card { width: 100%; padding: 28px 24px; }
.auth-card h1, .auth-card > .lead { text-align: left; }
.auth-card > .btn, .auth-card > form { margin-top: 20px; }
.auth-card > .muted { margin-top: 14px; }
.auth-foot { font-size: 12.5px; color: var(--muted); }
.big-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; margin-bottom: 14px; }
.big-ico svg { width: 26px; height: 26px; }

/* Controlli dell'installazione */
.checks { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checks li b { font-weight: 600; }
.checks li small { display: block; color: var(--err); font-size: 12.5px; }
.checks .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--ok); }
.checks .ko .dot { background: var(--err); }

/* Area utente: menu laterale */
.shell { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: 260px; flex: none; display: flex; flex-direction: column; padding: 20px 14px; background: var(--card); border-right: 1px solid var(--border); }
.side-brand { padding: 4px 10px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; white-space: nowrap; padding: 10px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background .15s ease, color .15s ease; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: var(--chip); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-item.as-btn { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
.nav-soon { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 12px 8px; min-width: 0; color: var(--text); text-decoration: none; border-radius: 12px; }
.who:hover { background: var(--chip); }
.who-text { display: block; min-width: 0; }
.who-text b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sotto-sezioni di una pagina (schede): da usare per tutte le pagine lunghe */
.subnav { margin: -4px 0 18px; }
.subnav-track { display: flex; gap: 4px; padding: 4px; background: var(--chip); border-radius: 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.subnav-track::-webkit-scrollbar { display: none; }
.subnav-item { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.subnav-item svg { width: 18px; height: 18px; flex: none; }
.subnav-item:hover { color: var(--text); }
.subnav-item.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--border); }
.subnav-item.active svg { color: var(--accent-text); }
.subnav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.subnav-count { font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--card); color: var(--muted); }
.subnav-item.active .subnav-count { background: var(--chip); }
@media (max-width: 520px) { .subnav-item { padding: 0 10px; gap: 6px; font-size: 13.5px; } .subnav-item svg { display: none; } }
/* Azioni in fondo a una scheda (es. "Esci da tutti gli altri dispositivi") */
.card > form.actions { margin-top: 16px; }
/* Accessi: il tasto "Scollega" resta a destra anche sul telefono */
@media (max-width: 560px) { .sessions .row { flex-wrap: nowrap; } .sessions .row > form { width: auto; } }
@media (max-width: 520px) { .card > form.actions .btn { width: 100%; } }

/* Profilo: foto a sinistra, dati a destra */
.profile-grid { display: grid; grid-template-columns: 210px 1fr; gap: 24px; margin-top: 18px; align-items: start; }
.profile-photo { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding-top: 4px; }
.profile-photo small { font-size: 12px; line-height: 1.4; }
.profile-photo .avatar-btns { justify-content: center; }
.profile-fields { margin-top: 0; }
@media (max-width: 640px) { .profile-grid { grid-template-columns: 1fr; gap: 18px; } }

/* Profili social */
.social-input { display: flex; align-items: center; gap: 10px; }
.social-input > svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
.social-input .prefix-input { flex: 1; min-width: 0; }

/* Foto profilo */
.avatar { flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--chip); color: var(--muted); font-weight: 700; box-shadow: 0 0 0 1px var(--border); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.initial { background: var(--accent); color: var(--on-accent, #fff); box-shadow: none; }
.avatar.sm { width: 36px; height: 36px; font-size: 15px; }
.avatar.md { width: 48px; height: 48px; font-size: 19px; }
.avatar.xl { width: 104px; height: 104px; font-size: 40px; }
.avatar-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-btns form { margin: 0; }
.avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.js-on #avatarSubmit { display: none; }
.cropper { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.cropper[hidden] { display: none; }
.crop-stage { position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #0b0f14; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.crop-stage.dragging { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .55); outline: 2px solid rgba(255, 255, 255, .9); outline-offset: -2px; pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: min(300px, 100%); margin: 14px auto 6px; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.crop-zoom .icon-btn { width: 36px; height: 36px; font-size: 20px; line-height: 1; color: var(--text); flex: none; }
.cropper .alert { margin-top: 10px; }
@media (max-width: 520px) {
  .avatar-btns, .avatar-actions { justify-content: center; }
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main > .content { flex: 1; width: 100%; }
.content { max-width: 860px; margin: 0 auto; padding: 32px 28px 60px; }
.page-title { margin-bottom: 18px; }
.mtop { display: none; }
.icon-btn { appearance: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.scrim { display: none; }

@media (max-width: 899px) {
  .side { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: auto; transform: translateX(-102%); transition: transform .25s cubic-bezier(.22, .8, .24, 1); box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(2, 6, 23, .45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .mtop { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
  .mtop-title { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { padding: 20px 16px 48px; }
  .page-title { display: none; }
}

/* Elenchi (inviti, utenti, dispositivi) */
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; }
.row > svg { width: 20px; height: 20px; color: var(--muted); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-text b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.row-text span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 6px; }
.tag { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; vertical-align: 1px; }
.tag.off { background: var(--chip); color: var(--muted); }
.tag.wait { background: var(--ok-soft); color: var(--ok); }
.tag.good { background: var(--ok-soft); color: var(--ok); }
.tag.ko { background: var(--err-soft); color: var(--err); }
.row > svg.ko { color: var(--err); }
@media (max-width: 560px) { .row { flex-wrap: wrap; } .row > form, .row-actions { width: 100%; justify-content: flex-end; display: flex; } }

/* Coppie etichetta / valore */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 0; margin-top: 10px; border-top: 1px solid var(--border); font-size: 14px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; overflow-wrap: anywhere; text-align: right; }

/* Scorciatoie della panoramica */
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 620px) { .quick { grid-template-columns: 1fr; } }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: border-color .15s ease; }
.quick-item:hover { border-color: var(--accent); }
.quick-item svg { width: 22px; height: 22px; color: var(--accent-text); }
.quick-item span { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.quick-item b { color: var(--text); font-size: 14.5px; }

/* Sezioni vuote */
.empty { text-align: center; padding: 40px 24px; }
.empty .big-ico { margin: 0 auto 14px; }
.empty .muted { max-width: 440px; margin: 6px auto 0; }

/* Aspetto: scelta della palette */
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.pal { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.pal:hover { border-color: var(--accent); }
.pal input { position: absolute; opacity: 0; pointer-events: none; }
.pal:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pal:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pal-top b { font-size: 14px; }
.pal-sw { display: flex; height: 34px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.pal-sw span { flex: 1; }
.pal-demo { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; }
.pal-demo i { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 8px; }
.pal-demo em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pal-demo svg { width: 60px; height: 22px; margin-left: auto; }
.pal-links { display: flex; gap: 10px; font-size: 12.5px; }
.pal-links a, .pal-links button { appearance: none; border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; font-size: 12.5px; text-decoration: underline; }
.pal-links button.danger { color: var(--err); }
.colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 720px) { .colors { grid-template-columns: 1fr 1fr; } }
.color-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.color-field small { font-weight: 400; color: var(--muted); font-size: 12px; }
.color-in { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); }
.color-in input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; flex: none; }
.color-in input[type=text] { border: 0; outline: none; background: none; width: 100%; min-width: 0; font-size: 15px; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check-row input { flex: none; width: 18px; height: 18px; accent-color: var(--accent); }

/* Viaggi */
.page-actions { display: flex; justify-content: flex-end; gap: 8px; margin: -6px 0 16px; }
.trip-list { display: flex; flex-direction: column; gap: 12px; }
.trip-card { display: flex; align-items: center; gap: 16px; }
.trip-card + .trip-card { margin-top: 0; }
.trip-card-main { flex: 1; min-width: 0; }
.trip-card h2 a { color: var(--text); text-decoration: none; }
.trip-card h2 a:hover { color: var(--accent-text); }
.trip-card-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 620px) { .trip-card { flex-direction: column; align-items: stretch; } .trip-card-actions { justify-content: flex-start; } }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag.status-live { background: var(--ok-soft); color: var(--ok); }
.tag.status-draft { background: var(--chip); color: var(--muted); }
.tag.status-ended { background: var(--accent-soft); color: var(--accent-text); }
.field textarea, .field select { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--field); padding: 11px 14px; font-size: 16px; outline: none; resize: vertical; }
.field select { height: 46px; padding: 0 12px; }
.field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
fieldset.field { border: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 720px) { .choice-grid { grid-template-columns: 1fr; } }
.choice { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice b { font-size: 14px; }
.choice small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.trip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.trip-head .tags { margin-top: 6px; }
.trip-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.link-box { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 8px 8px 8px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--chip); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
@media (max-width: 620px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--chip); border-radius: 12px; padding: 10px 12px; }
.stat span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.stat b { display: block; font-size: 16px; margin-top: 2px; }
.danger-zone { border-color: var(--err-soft); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; border: 2px dashed var(--border); border-radius: 16px; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop b { font-size: 15px; }
.drop small { color: var(--muted); font-size: 13px; }
.drop .big-ico { margin: 0; }
#previewMap { height: 340px; border-radius: 14px; margin-top: 14px; border: 1px solid var(--border); background: var(--chip); }
.file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.file-list .ko { color: var(--err); }
.row-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); }
.row-form:first-of-type { border-top: 0; padding-top: 0; }
.card h2 + .row-form { margin-top: 10px; }

/* Scelta di partenza e arrivo sulla mappa */
.picker { margin-top: 10px; }
/* Partenza e arrivo affiancati sugli schermi larghi */
.ends-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; }
#pickers > .actions { margin-top: 18px; }
.ends-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ends-col h3 { font-size: 14.5px; font-weight: 700; }
.ends-col .picker { margin-top: 0; }
.ends-col .picker-map { height: 280px; }
@media (max-width: 760px) { .ends-grid { grid-template-columns: 1fr; gap: 28px; } }
.picker-map { height: 300px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--chip); z-index: 0; }
@media (max-width: 620px) { .picker-map { height: 260px; } }
.picker-row { display: flex; gap: 8px; margin-top: 10px; }
.picker-row input { flex: 1; min-width: 0; height: 46px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); padding: 0 14px; font-size: 16px; outline: none; }
.picker-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.picker-row .btn { flex: none; height: 46px; }
.picker-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.picker-hint:empty { display: none; }
.picker-hint.warn { color: var(--err); font-weight: 600; }
.pick-pin { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(15, 23, 42, .4); display: grid; place-items: center; cursor: grab; }
.pick-pin svg { width: 16px; height: 16px; }
.pick-home { width: 14px; height: 14px; border-radius: 50%; background: var(--err); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }

/* Note sotto un campo su due lati (es. spiegazione e contatore) */
.field-foot { display: flex; justify-content: space-between; gap: 12px; }
.home-map { margin-top: 10px; }
.home-clear { align-self: flex-start; margin-top: 4px; }

/* Pagina pubblica del profilo */
.pub-top { display: flex; align-items: center; justify-content: space-between; max-width: 980px; margin: 0 auto; padding: 18px 20px; }
.pub-brand { text-decoration: none; }
.pub-wrap { max-width: 980px; margin: 0 auto; padding: 0 20px 48px; }
.pub-wrap > .alert { margin-bottom: 16px; }
.pub-hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.pub-hero .avatar.xl { width: 112px; height: 112px; }
.pub-id h1 { font-size: 26px; letter-spacing: -0.02em; }
.pub-id h1 sup { font-size: .5em; vertical-align: super; line-height: 0; margin-left: 1px; }
.pub-bio { color: var(--muted); margin-top: 6px; font-size: 15px; line-height: 1.5; max-width: 560px; }
.pub-social { display: flex; gap: 8px; margin-top: 12px; }
.pub-social a { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--chip); color: var(--text); transition: background .15s ease, color .15s ease; }
.pub-social a:hover { background: var(--accent); color: var(--on-accent, #fff); }
.pub-social svg { width: 19px; height: 19px; }
.pub-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; }
.pub-kpi { background: var(--chip); border-radius: 14px; padding: 12px 14px; }
.pub-kpi span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.pub-kpi b { font-size: 20px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.pub-h2 { font-size: 17px; margin: 28px 0 12px; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pub-trip { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.pub-trip:hover { transform: translateY(-2px); border-color: var(--accent); }
.pub-thumb { position: relative; aspect-ratio: 2 / 1; background: linear-gradient(135deg, color-mix(in srgb, var(--chip) 70%, #e6efe6), color-mix(in srgb, var(--chip) 70%, #dfe8f1)); }
.pub-thumb > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pub-thumb > svg path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.pub-live { position: absolute; left: 10px; top: 10px; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--ink); color: #fff; border-radius: 999px; padding: 4px 10px; display: flex; align-items: center; gap: 6px; }
.pub-live i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .3); }
.pub-body { padding: 14px 16px 16px; }
.pub-body b { display: block; font-size: 16px; }
.pub-body > span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.pub-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pub-stats em { font-style: normal; font-size: 12px; font-weight: 600; background: var(--chip); border-radius: 999px; padding: 3px 9px; }
.pub-empty { text-align: center; margin-top: 24px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 36px; }
.pub-foot .brand-home { color: inherit; font-weight: 700; text-decoration: none; }
.pub-foot .brand-home span { color: var(--accent-text); }
@media (max-width: 620px) {
  .pub-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .pub-social { justify-content: center; }
  .pub-kpis { grid-template-columns: 1fr 1fr; }
  .pub-hero .avatar.xl { width: 96px; height: 96px; }
}

/* Punti di passaggio */
.via-map { height: 440px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--chip); z-index: 0; }
@media (max-width: 620px) { .via-map { height: 340px; } }
.via-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.via-actions { display: flex; gap: 8px; margin-left: auto; }
.via-pin { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent, #fff); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); cursor: grab; display: grid; place-items: center; font: 700 11.5px/1 Inter, system-ui, sans-serif; }
.via-pin.new { background: var(--ink); color: #fff; }
.via-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.via-list[hidden] { display: none; }
.via-list li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border: 1px solid var(--border); border-radius: 12px; }
.via-num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent, #fff); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }
.via-num.new { background: var(--ink); color: #fff; }
.via-ll { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.via-ll em { font-style: normal; font-weight: 600; color: var(--text); margin-left: 4px; }
.via-pop { text-align: center; }
.via-pop button { margin-top: 6px; }

/* Viaggio "Solo con il link" nella pagina pubblica: solo anteprima, non si apre */
.pub-trip.locked { cursor: default; }
.pub-trip.locked:hover { transform: none; border-color: var(--border); }
.pub-lock { position: absolute; right: 10px; top: 10px; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--card); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px 4px 8px; display: flex; align-items: center; gap: 5px; }
.pub-lock svg { width: 13px; height: 13px; flex: none; color: var(--muted); }

/* I miei viaggi: riepilogo e schede */
.sum-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sum-head + .pub-kpis { margin-top: 14px; }
.my-trips { margin-top: 16px; }
.my-trips .pub-trip { display: flex; flex-direction: column; }
.my-trips .pub-trip:hover { transform: none; border-color: var(--border); }
.my-trips .pub-body { flex: 1; display: flex; flex-direction: column; }
.my-trips .my-trip-foot { margin-top: auto; }
.my-trips .pub-stats + .my-trip-foot, .my-trips .pub-body > span + .my-trip-foot { margin-top: auto; }
.my-trips .pub-body > span { margin-bottom: 12px; }
.my-trips .pub-thumb { display: block; }
.my-trips .pub-body b a { color: var(--text); text-decoration: none; }
.my-trips .pub-body b a:hover { color: var(--accent-text); }
.thumb-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.thumb-empty svg { width: 28px; height: 28px; }
.thumb-empty small { font-size: 12.5px; font-weight: 600; }
.my-trip-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.my-trip-foot .tags { margin-top: 0; }
.my-trip-actions { display: flex; gap: 6px; flex: none; }
.my-trip-actions .btn svg { width: 16px; height: 16px; }
.new-trip { display: flex; align-items: center; justify-content: center; min-height: 220px; border-style: dashed; border-width: 2px; background: transparent; box-shadow: none; text-align: center; }
.new-trip span { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.new-trip svg { width: 30px; height: 30px; color: var(--accent-text); }
.new-trip b { color: var(--text); font-size: 15.5px; }
.new-trip small { font-size: 12.5px; }
.my-trips .new-trip:hover { border-color: var(--accent); }
.my-trips .pub-stats { margin-top: 0; margin-bottom: 12px; }

/* Grafica per i social */
.share-ui { display: grid; grid-template-columns: 280px 1fr; gap: 24px; margin-top: 18px; align-items: start; }
.share-controls { display: flex; flex-direction: column; gap: 14px; }
.share-controls select { width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); padding: 0 12px; font-size: 15px; color: var(--text); }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--chip); border-radius: 12px; }
.seg label { flex: 1; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg span i { font-style: normal; font-weight: 500; font-size: 12px; opacity: .8; }
.seg input:checked + span { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--border); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.share-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.share-preview { display: flex; justify-content: center; background: var(--chip); border-radius: 16px; padding: 16px; }
.share-preview canvas { display: block; max-width: 100%; max-height: 72vh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
@media (max-width: 760px) {
  .share-ui { grid-template-columns: 1fr; }
  .share-preview { order: -1; padding: 10px; }
  .share-preview canvas { max-height: 60vh; }
}

/* Visitatori: clacson e playlist */
.cheer-days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.cheer-days span { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; }
.cheer-days i { font-style: normal; color: var(--muted); }
.cheer-days b { font-weight: 700; font-variant-numeric: tabular-nums; }
.songs-admin .song-thumb { flex: none; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--chip, rgba(127,127,127,.15)); display: block; }
.songs-admin .song-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.songs-admin .song-note { color: var(--text, inherit); opacity: .85; }
.songs-admin .song-note b { font-size: inherit; font-weight: 600; }
.songs-admin .row.is-hidden .song-thumb, .songs-admin .row.is-hidden .row-text { opacity: .5; }
@media (max-width: 560px) { .songs-admin .row-text { flex-basis: calc(100% - 60px); } }

/* Esporta GPX */
.export-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.export-opt { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; color: inherit; text-decoration: none; transition: border-color .15s; }
.export-opt:hover { border-color: var(--accent); }
.export-opt b { font-size: 14px; font-weight: 700; }
.export-opt b::after { content: " ↓"; color: var(--accent-text, var(--accent)); }
.export-opt span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
@media (max-width: 560px) { .export-opts { grid-template-columns: 1fr; } }
/* schede che scorrono: sfumatura sul bordo per far capire che ce ne sono altre */
.subnav-track.more-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.subnav-track.more-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.subnav-track.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }

/* Visite: grafico a barre degli ultimi 14 giorni */
.views-chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 140px; margin: 16px 0 8px; align-items: end; }
.vc-col { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.vc-n { font-size: 11px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; min-height: 14px; }
.vc-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.vc-bar { width: 100%; max-width: 28px; border-radius: 4px 4px 2px 2px; background: var(--accent); }
.vc-bar.zero { background: var(--border); }
.vc-d { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .views-chart { gap: 2px; height: 120px; } .vc-n { font-size: 10px; } .vc-d { font-size: 10px; } }
.link-note { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.link-note p { flex: 1; margin: 0; }
@media (max-width: 560px) { .link-note { flex-direction: column; align-items: flex-start; } }
.stat-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .stat-grid.cols3 { gap: 8px; } .stat-grid.cols3 .stat { padding-left: 12px; padding-right: 12px; } }

/* Piè di pagina con le pagine legali (tutte le pagine) */
.site-foot { width: 100%; max-width: 860px; margin: 0 auto; padding: 18px 28px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-foot a { color: inherit; text-decoration: none; font-weight: 600; }
.site-foot a:hover { color: var(--text); text-decoration: underline; }
.site-foot p { margin: 0; }
.site-foot.auth { max-width: 420px; margin-top: 28px; padding: 14px 0 0; justify-content: center; text-align: center; }
.site-foot.pub { max-width: 980px; padding-left: 20px; padding-right: 20px; }
@media (max-width: 720px) { .site-foot { padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); flex-direction: column; align-items: flex-start; } .site-foot.auth { align-items: center; padding: 14px 0 0; } }

/* Pagine legali */
body.legal { min-height: 100vh; display: flex; flex-direction: column; }
.doc-top { width: 100%; max-width: 860px; margin: 0 auto; padding: 22px 28px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.doc-brand { text-decoration: none; color: inherit; }
.doc-brand .brand-word { font-size: 22px; }
.doc-wrap { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 22px 28px 48px; }
.doc { padding: 30px 32px 34px; }
.doc h1 { font-size: 26px; letter-spacing: -.01em; margin: 0; }
.doc-date { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.doc-lead { font-size: 16px; line-height: 1.6; margin: 18px 0 6px; }
.doc h2 { font-size: 17px; margin: 28px 0 8px; }
.doc h3 { font-size: 14.5px; margin: 18px 0 6px; }
.doc p, .doc li { font-size: 14.5px; line-height: 1.65; }
.doc p { margin: 0 0 10px; }
.doc ul { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc a { color: var(--accent-text); }
.doc code { font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--chip); }
.doc-table { overflow-x: auto; margin: 6px 0 12px; border: 1px solid var(--border); border-radius: 12px; }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th, .doc-table td { text-align: left; padding: 10px 12px; vertical-align: top; border-bottom: 1px solid var(--border); line-height: 1.5; }
.doc-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--chip); }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td:first-child { white-space: nowrap; }
@media (max-width: 720px) { .doc-top { padding: 16px 16px 0; } .doc-wrap { padding: 16px 16px 36px; } .doc { padding: 22px 18px 24px; } .doc h1 { font-size: 22px; } }

/* Selettore di lingua nel footer: IT | EN */
.site-foot .lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 8px; background: var(--chip); margin-left: 2px; }
.site-foot .lang-switch a { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; text-decoration: none; color: var(--muted); }
.site-foot .lang-switch a:hover { color: var(--text); text-decoration: none; }
.site-foot .lang-switch a.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.site-foot nav { align-items: center; }

/* Dispositivi */
.dev-status { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--chip); margin-top: 14px; }
.dev-status > i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; }
.dev-status.ok > i { background: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, .18); }
.dev-status.wait > i { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .18); }
.dev-status.ko > i { background: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .18); }
.dev-status-t { flex: 1; min-width: 0; }
.dev-status-t b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.dev-status-t span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.dev-status-a { flex: none; }
.dev-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 10px; font-size: 14px; line-height: 1.5; }
.steps li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 12px; display: grid; place-items: center; margin-top: 1px; }
.one-hero { display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: center; }
.one-box { width: 120px; height: 120px; border-radius: 28px; background: linear-gradient(145deg, var(--ink), #2a3550); display: grid; place-items: center; color: var(--accent); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.one-box svg { width: 56px; height: 56px; }
.one-ok { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--accent-text); }
.one-ok svg { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .dev-status { flex-wrap: wrap; }
  .dev-status-a { width: 100%; }
  .dev-status-a .btn { width: 100%; }
  .one-hero { grid-template-columns: 1fr; justify-items: start; }
  .one-box { width: 84px; height: 84px; border-radius: 22px; }
  .one-box svg { width: 40px; height: 40px; }
}

/* Pagina iniziale */
body.home { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.home-top { width: 100%; max-width: 1120px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-brand { text-decoration: none; }
.home-brand .brand-word { font-size: 22px; }
.home-top-r { display: flex; align-items: center; gap: 10px; }
.home-top-r .lang-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--chip); }
.home-top-r .lang-switch a { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; text-decoration: none; color: var(--muted); }
.home-top-r .lang-switch a.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.home { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px 40px; flex: 1; }

.home-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 48px 0 40px; }
.home-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; }
.home-eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: home-ping 2s ease-out infinite; }
.home-hero h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; margin-top: 18px; }
.home-lead { font-size: 18px; line-height: 1.55; color: var(--muted); margin-top: 18px; max-width: 520px; }
.home-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.home-cta .btn { height: 50px; padding: 0 24px; font-size: 15.5px; border-radius: 14px; white-space: nowrap; }
.site-foot.home-foot { max-width: 1120px; padding-left: 24px; padding-right: 24px; }
.home-note { font-size: 13px; color: var(--muted); margin-top: 14px; }

.home-demo { position: relative; }
.demo-card { background: var(--card); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow), 0 30px 60px -30px rgba(0, 0, 0, .25); overflow: hidden; transform: rotate(1.2deg); }
.demo-map { position: relative; background: radial-gradient(120% 90% at 75% 20%, color-mix(in srgb, var(--accent) 22%, var(--ink)) 0%, var(--ink) 60%); color: rgba(255, 255, 255, .09); aspect-ratio: 16 / 10; }
.demo-map svg { display: block; width: 100%; height: 100%; }
.demo-glow, .demo-route { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.demo-glow { stroke-width: 12; opacity: .22; }
.demo-route { stroke-width: 4.5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: home-draw 2.4s .3s cubic-bezier(.6, .1, .3, 1) forwards; }
.demo-start { fill: var(--ink); stroke: #fff; stroke-width: 3; }
.demo-now { fill: var(--accent); stroke: #fff; stroke-width: 3; }
.demo-pulse { fill: var(--accent); transform-origin: 262px 148px; transform-box: view-box; animation: home-pulse 2s ease-out infinite; }
.demo-live { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; backdrop-filter: blur(6px); }
.demo-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.demo-toast { border: 1px solid var(--border); position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 10px; padding: 9px 13px 9px 10px; border-radius: 14px; background: var(--card); color: var(--text); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(8px); animation: home-in .5s 2.6s ease-out forwards; }
.demo-toast svg { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.demo-toast span { display: flex; flex-direction: column; }
.demo-toast b { font-size: 13px; font-weight: 600; }
.demo-toast em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.demo-body { padding: 16px 18px 18px; }
.demo-body > b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.demo-body > span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.demo-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.demo-stats span { display: flex; flex-direction: column; padding: 9px 10px; border-radius: 12px; background: var(--chip); font-size: 11.5px; color: var(--muted); min-width: 0; }
.demo-stats b { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }

/* Pagina iniziale: il viaggio, una tappa dopo l'altra lungo la stessa strada */
.home-trip { --road: var(--ink); padding: 72px 0 8px; }
@media (prefers-color-scheme: dark) { .home-trip { --road: #E2E8F0; } .trip-stop::before { opacity: .35; } .vh-casing { opacity: .35; } }
.home-trip h2 { font-size: clamp(30px, 4.2vw, 44px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; }
.trip-road { list-style: none; margin-top: 40px; position: relative; }
.trip-stop { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; padding: 0 0 56px 48px; }
/* la strada: bordo scuro e linea del colore principale, come sulla mappa */
.trip-stop::before { content: ""; position: absolute; left: 9px; top: 10px; bottom: -10px; width: 8px; border-radius: 4px; background: var(--road); opacity: .9; }
.trip-stop::after { content: ""; position: absolute; left: 11px; top: 10px; bottom: -10px; width: 4px; border-radius: 2px; background: var(--accent); }
.trip-stop:nth-child(2)::after { background: linear-gradient(var(--accent), var(--accent)) top / 100% 58% no-repeat, repeating-linear-gradient(to bottom, var(--accent) 0 8px, transparent 8px 15px) bottom / 100% 42% no-repeat; } /* la traversata in nave */
.trip-stop .trip-txt::before { content: ""; position: absolute; left: 3px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 4px solid var(--road); z-index: 1; box-sizing: border-box; }
.trip-dest::before, .trip-dest::after { display: none; }
.trip-dest .trip-txt::before { width: 24px; height: 24px; left: 1px; top: 4px; background: var(--accent); border-color: var(--road); }
.trip-dest { padding-bottom: 8px; display: block; }
.trip-dest h3 { max-width: none; }
.vis-cheer { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 6px; }
.vc-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .3); }
.vc-row + .vc-row { margin-left: 28px; }
.vis-cheer .vc-row svg { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.vc-song i { width: 34px; height: 34px; border-radius: 8px; flex: none; background: linear-gradient(135deg, var(--ink), color-mix(in srgb, var(--accent) 55%, var(--ink))); }
.vc-row > span { display: flex; flex-direction: column; }
.vc-row b { font-size: 14px; font-weight: 600; }
.vc-row em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.trip-when { display: block; font-size: 14px; color: var(--muted); }
.trip-txt h3 { font-size: clamp(21px, 2.3vw, 26px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; margin-top: 2px; }
.trip-txt p { font-size: 16px; line-height: 1.6; color: var(--muted); margin-top: 10px; max-width: 34em; }
.trip-dest h3 { font-size: clamp(26px, 3.2vw, 34px); }
.trip-dest .home-cta { margin-top: 22px; }

.trip-vis { margin: 0; color: var(--text); }
.trip-vis svg { display: block; width: 100%; height: auto; overflow: visible; }
.trip-vis figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.vis-profile figcaption { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.vis-profile figcaption span { white-space: nowrap; }
.vis-profile .vp-top { color: var(--text); font-weight: 600; text-align: center; }
.vp-area { fill: var(--accent); opacity: .22; }
.vp-line { fill: none; stroke: var(--road); stroke-width: 2.5; stroke-linejoin: round; }
.vp-base { stroke: var(--border); stroke-width: 1.5; }
.vp-peak { fill: var(--accent); stroke: var(--road); stroke-width: 2.5; }
.vh-hatch { stroke: var(--road); stroke-width: 1.2; opacity: .28; }
.vh-ring { fill: none; stroke: var(--road); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: .55; }
.vh-house { fill: var(--bg); stroke: var(--road); stroke-width: 2; stroke-linejoin: round; }
.vh-casing, .vh-route { fill: none; stroke-linecap: round; }
.vh-casing { stroke: var(--road); stroke-width: 9; opacity: .9; }
.vh-route { stroke: var(--accent); stroke-width: 4.5; }
.vh-end { fill: var(--bg); stroke: var(--road); stroke-width: 3; }
.vis-post { display: flex; align-items: flex-end; gap: 18px; }
.vpost { width: 46%; max-width: 190px; aspect-ratio: 4 / 5; border-radius: 10px; background: var(--ink); color: #fff; padding: 14px; border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: space-between; transform: rotate(-3deg); box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .5); }
.vpost-t { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }
.vpost svg path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.vpost-n { display: flex; gap: 10px; font-size: 11px; color: rgba(255, 255, 255, .7); white-space: nowrap; }
.vpost-n b { color: #fff; font-size: 14px; }
.vfile { display: flex; flex-direction: column; gap: 2px; padding: 10px 0 10px 14px; border-left: 3px solid var(--road); font-size: 13px; }
.vfile b { font-weight: 600; }
.vfile span { color: var(--muted); }

@keyframes home-draw { to { stroke-dashoffset: 0; } }
@keyframes home-pulse { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes home-ping { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes home-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .demo-route { animation: none; stroke-dashoffset: 0; } .demo-toast { animation: none; opacity: 1; transform: none; } .demo-pulse, .home-eyebrow i { animation: none; } }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; gap: 36px; padding: 28px 0 28px; }
  .demo-card { transform: none; }
  .trip-stop { grid-template-columns: 1fr; gap: 22px; padding-bottom: 48px; }
  .trip-vis { max-width: 420px; }
}
@media (max-width: 600px) {
  .home-top { padding: 14px 16px; }
  .home { padding: 0 16px 28px; }
  .home-lead { font-size: 16.5px; }
  .home-cta .btn { flex: 1; padding: 0 14px; }
  .demo-map { aspect-ratio: 4 / 3; }
  .demo-toast { padding: 7px 11px 7px 8px; gap: 8px; }
  .demo-toast svg { width: 26px; height: 26px; padding: 5px; }
  .demo-toast b { font-size: 12px; }
  .site-foot.home-foot { padding-left: 16px; padding-right: 16px; }
  .home-trip { padding-top: 52px; }
  .trip-stop { padding-left: 40px; }
  .trip-txt p { font-size: 15.5px; }
  .trip-dest .home-cta .btn { flex: none; padding: 0 28px; }
  .demo-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Dispositivi: azioni per il viaggio e avviso della zona privata */
.dev-go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dev-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 13px; line-height: 1.45; }
.dev-note svg { width: 16px; height: 16px; margin-top: 1px; color: var(--accent-text); }

/* Panoramica: parto adesso / viaggio in corso */
.go-card { display: flex; align-items: center; gap: 14px; }
.go-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.go-card b { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.go-card span { font-size: 13.5px; color: var(--muted); }
.go-card .btn { flex: none; }
.go-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); }
.go-trip svg { color: var(--accent-text); }
@media (max-width: 560px) { .go-card { flex-wrap: wrap; } .go-card:not(.live) .btn { width: 100%; } }

/* Nuovo viaggio: il pulsante principale e' primo nel codice (Invio) ma a destra */
.new-actions .btn { white-space: nowrap; }
.new-actions .act-back { order: 1; }
.new-actions .act-alt { order: 2; }
.new-actions .act-main { order: 3; }
@media (max-width: 560px) {
  .new-actions { flex-wrap: wrap; }
  .new-actions .act-main { order: 0; flex: 1 1 100%; }
  .new-actions .act-back, .new-actions .act-alt { flex: 1; }
}
