/* ===== YourTrip — componenti condivisi =====
   Catalogo e markup in docs/ARCHITECTURE.md §Componenti. Le viste li usano così
   come sono; regole specifiche di una vista vanno in css/views/<vista>.css,
   con selettori prefissati .view-<vista>. */

/* ---------- Bottoni ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    height: 38px; padding: 0 var(--sp-4);
    border-radius: var(--r-sm);
    border: var(--bw) solid transparent;
    font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1;
    white-space: nowrap; text-decoration: none;
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
    user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn .fa-solid, .btn .fa-regular, .btn .fa-brands { font-size: 14px; }
.btn--primary { background: var(--ink); color: var(--on-ink); }
.btn--primary:hover { background: var(--ink-hover); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-hover); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(0.93); }
[data-theme="dark"] .btn--danger { color: #1A0C0B; }
.btn--danger-ghost { background: transparent; color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); }
.btn--link { background: none; height: auto; padding: 0; color: var(--accent-text); font-weight: var(--fw-medium); }
.btn--link:hover { text-decoration: underline; }
.btn--sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn--lg { height: 46px; padding: 0 var(--sp-6); font-size: var(--fs-base); }
.btn--icon { width: 38px; padding: 0; }
.btn--sm.btn--icon { width: 32px; }
.btn--block { width: 100%; }
.btn-group { display: inline-flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- Campi ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); }
.field__label:empty { display: none; }
.field__optional { color: var(--text-3); font-weight: var(--fw-regular); }
.field__hint { font-size: var(--fs-xs); color: var(--text-2); }
.field__error { font-size: var(--fs-xs); color: var(--danger); }
.input, .select, .textarea {
    width: 100%; min-width: 0;
    height: 40px; padding: 0 var(--sp-3);
    background: var(--surface);
    border: var(--bw) solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: var(--fs-base);
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.textarea { height: auto; min-height: 84px; padding: var(--sp-2) var(--sp-3); line-height: var(--lh-base); resize: vertical; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
    background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.input.is-invalid, .textarea.is-invalid, .select.is-invalid { border-color: var(--danger); }
.input:disabled, .select:disabled, .textarea:disabled, .input[readonly] { background: var(--surface-2); color: var(--text-2); }
.input--sm, .select--sm { height: 32px; font-size: var(--fs-sm); }
.input-group { display: flex; gap: var(--sp-2); align-items: stretch; }
.input-group > .input, .input-group > .select { flex: 1; }
input[type="date"].input, input[type="time"].input, input[type="datetime-local"].input { padding-right: var(--sp-2); }
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 767px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .input, .select, .textarea { font-size: 16px; } }

/* Checkbox */
.check { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; font-size: var(--fs-base); min-width: 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
    width: 20px; height: 20px; flex-shrink: 0;
    border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface);
    display: inline-flex; align-items: center; justify-content: center;
    color: transparent; font-size: 11px;
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.check:hover .check__box { border-color: var(--text-3); }
.check input:checked + .check__box { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.check input:focus-visible + .check__box { box-shadow: var(--focus-ring); }
.check__label { min-width: 0; }

/* ---------- Card ---------- */
.card {
    background: var(--surface);
    border: var(--bw) solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    min-width: 0;
}
.card--flush { padding: 0; overflow: hidden; }
.card--tight { padding: var(--sp-4); }
.card--interactive { transition: border-color var(--dur-fast) var(--ease); cursor: pointer; }
.card--interactive:hover { border-color: var(--border-strong); }
.card--muted { background: var(--surface-2); }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.card__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.card__subtitle { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.card__footer { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: var(--bw) solid var(--border); }
/* Card con barretta colore tappa a sinistra: style="--stop:var(--stop-N)" */
.card--stop { border-left: 4px solid var(--stop, var(--border)); }

/* Intestazione di sezione: micro-etichetta + azioni */
.section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); min-height: 32px; }
.section-title__text { font-size: var(--fs-micro); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-micro); color: var(--text-2); line-height: 1.2; }
.section-title__actions { display: flex; gap: var(--sp-2); }

/* Intestazione di pagina dentro una vista */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-8); flex-wrap: wrap; }
.page-head__title { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.page-head__sub { color: var(--text-2); margin-top: var(--sp-2); }

/* ---------- Badge e chip ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    height: 24px; padding: 0 var(--sp-2);
    border-radius: var(--r-full);
    font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1;
    white-space: nowrap;
    background: var(--muted-soft); color: var(--text-2);
}
.badge .fa-solid { font-size: 11px; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--accent { background: var(--accent-soft); color: var(--accent-text); }
.badge--muted { background: var(--muted-soft); color: var(--text-3); }
.badge--neutral { background: var(--surface-sunken); color: var(--text); }
.badge--outline { background: transparent; border: var(--bw) solid var(--border-strong); color: var(--text-2); }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 var(--sp-3);
    border-radius: var(--r-full);
    border: var(--bw) solid var(--border-strong);
    background: var(--surface);
    font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text);
    white-space: nowrap;
}
button.chip:hover, a.chip:hover { background: var(--surface-hover); text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* Colore tappa */
.stop-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--stop, var(--text-3)); flex-shrink: 0; }
.stop-num {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--stop, var(--text-3)); color: var(--on-stop);
    font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
}
.stop-num--lg { width: 34px; height: 34px; font-size: var(--fs-sm); }
.stop-chip {
    display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
    height: 28px; padding: 0 var(--sp-3) 0 var(--sp-2);
    border-radius: var(--r-full);
    background: color-mix(in srgb, var(--stop) var(--stop-tint), var(--surface));
    color: var(--text);
    font-size: var(--fs-sm); font-weight: var(--fw-medium);
    white-space: nowrap;
}
a.stop-chip:hover { text-decoration: none; background: color-mix(in srgb, var(--stop) calc(var(--stop-tint) + 8%), var(--surface)); }
.stop-chip__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--stop); flex-shrink: 0; }
.stop-chip__name { overflow: hidden; text-overflow: ellipsis; }
.stop-chip__meta { color: var(--text-2); font-weight: var(--fw-regular); }
.stop-strip { display: flex; gap: 2px; height: 6px; border-radius: var(--r-full); overflow: hidden; width: 100%; }
.stop-strip--tall { height: 10px; }
.stop-strip--empty { background: var(--surface-sunken); }
.stop-strip__seg { background: var(--stop); flex-basis: 0; min-width: 4px; }
.stop-tint { background: color-mix(in srgb, var(--stop) var(--stop-tint), var(--surface)); }

/* ---------- Segmented control e tab ---------- */
.segmented {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface-sunken);
    border-radius: var(--r-sm);
    width: fit-content; max-width: 100%; overflow-x: auto;
}
.segmented__item {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 var(--sp-3);
    border-radius: 6px;
    font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-2);
    white-space: nowrap;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.segmented__item:hover { color: var(--text); }
.segmented__item[aria-pressed="true"] { background: var(--surface-raised); color: var(--text); font-weight: var(--fw-semibold); box-shadow: inset 0 0 0 1px var(--border); }
.segmented--sm .segmented__item { height: 28px; font-size: var(--fs-xs); }
.segmented--block { display: flex; width: 100%; }
.segmented--block .segmented__item { flex: 1; justify-content: center; }

.tabs { display: flex; gap: var(--sp-6); border-bottom: var(--bw) solid var(--border); overflow-x: auto; margin-bottom: var(--sp-6); }
.tabs__item {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    height: 42px; margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium);
    white-space: nowrap;
}
.tabs__item:hover { color: var(--text); }
.tabs__item[aria-selected="true"] { color: var(--text); border-bottom-color: var(--ink); font-weight: var(--fw-semibold); }
.tabs__count { font-size: var(--fs-xs); color: var(--text-2); background: var(--surface-sunken); border-radius: var(--r-full); padding: 1px 7px; font-variant-numeric: tabular-nums; }

/* ---------- Statistiche ---------- */
.stat { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat__label { font-size: var(--fs-micro); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-micro); color: var(--text-2); }
.stat__value { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat__unit { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-2); margin-left: 6px; letter-spacing: 0; }
.stat__sub { font-size: var(--fs-sm); color: var(--text-2); }
.stat--ok .stat__value { color: var(--ok); }
.stat--warn .stat__value { color: var(--warn); }
.stat--danger .stat__value { color: var(--danger); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-6); }
@media (max-width: 767px) { .stat__value { font-size: var(--fs-2xl); } .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); } }

/* ---------- Progress ---------- */
.progress { width: 100%; height: 8px; background: var(--surface-sunken); border-radius: var(--r-full); overflow: hidden; }
.progress__bar { height: 100%; background: var(--ink); border-radius: var(--r-full); transition: width var(--dur) var(--ease); }
.progress--ok .progress__bar { background: var(--ok); }
.progress--warn .progress__bar { background: var(--warn); }
.progress--danger .progress__bar { background: var(--danger); }
.progress--accent .progress__bar { background: var(--accent); }
.progress--thin { height: 4px; }

/* ---------- Liste e righe ---------- */
.list { display: flex; flex-direction: column; background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.list__item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); min-height: 52px; border-top: var(--bw) solid var(--border); min-width: 0; color: var(--text); }
.list__item:first-child { border-top: 0; }
a.list__item:hover, button.list__item:hover, .list__item--interactive:hover { background: var(--surface-hover); text-decoration: none; cursor: pointer; }
button.list__item { width: 100%; text-align: left; }
.list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list__title { font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__meta { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__aside { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; color: var(--text-2); font-size: var(--fs-sm); }

/* Coppie chiave/valore */
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: var(--sp-2) var(--sp-6); font-size: var(--fs-sm); }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Tabelle ---------- */
.table-wrap { overflow-x: auto; border: var(--bw) solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-size: var(--fs-micro); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-micro); color: var(--text-2); background: var(--surface-2); padding: var(--sp-3) var(--sp-4); border-bottom: var(--bw) solid var(--border); white-space: nowrap; }
.table td { padding: var(--sp-3) var(--sp-4); border-bottom: var(--bw) solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: var(--fw-semibold); background: var(--surface-2); border-top: var(--bw) solid var(--border); }

/* ---------- Stato vuoto ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-12) var(--sp-6); border: var(--bw) dashed var(--border-strong); border-radius: var(--r-lg); background: transparent; }
.empty__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-sunken); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: var(--sp-2); }
.empty__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.empty__text { color: var(--text-2); max-width: 46ch; }
.empty__actions { margin-top: var(--sp-4); display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; }
.empty--plain { border: 0; padding: var(--sp-8) var(--sp-4); }

/* Avviso in linea (callout) */
.callout { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r); background: var(--surface-2); border: var(--bw) solid var(--border); font-size: var(--fs-sm); }
.callout > .fa-solid { margin-top: 3px; color: var(--text-2); }
.callout--ok { background: var(--ok-soft); border-color: transparent; } .callout--ok > .fa-solid { color: var(--ok); }
.callout--warn { background: var(--warn-soft); border-color: transparent; } .callout--warn > .fa-solid { color: var(--warn); }
.callout--danger { background: var(--danger-soft); border-color: transparent; } .callout--danger > .fa-solid { color: var(--danger); }
.callout--accent { background: var(--accent-soft); border-color: transparent; } .callout--accent > .fa-solid { color: var(--accent-text); }

/* ---------- Skeleton e spinner ---------- */
.skeleton-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.skeleton { height: 12px; border-radius: 6px; background: var(--surface-sunken); }
.spinner { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- Overlay: backdrop, modale, drawer ---------- */
html.has-overlay body { overflow: hidden; }
.yt-overlay { position: fixed; inset: 0; z-index: var(--z-overlay); display: flex; }
.yt-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: yt-fade var(--dur) var(--ease); }
.yt-overlay.is-leaving { opacity: 0; transition: opacity 120ms var(--ease); }
.yt-overlay--modal { align-items: center; justify-content: center; padding: var(--sp-4); }
.modal, .drawer {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: var(--bw) solid var(--border);
    box-shadow: var(--shadow-overlay);
    max-height: 100%;
    min-width: 0;
    outline: none;
}
.modal { width: 100%; border-radius: var(--r-lg); max-height: min(86vh, 860px); animation: yt-rise var(--dur) var(--ease); }
.modal--sm { max-width: 420px; }
.modal--md { max-width: 560px; }
.modal--lg { max-width: 820px; }
.yt-overlay--drawer { justify-content: flex-end; }
.drawer { width: min(var(--drawer-w, 480px), 100vw); height: 100%; border-width: 0 0 0 var(--bw); border-radius: 0; animation: yt-slide var(--dur) var(--ease); }
.overlay__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-6); border-bottom: var(--bw) solid var(--border); }
.overlay__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlay__body { padding: var(--sp-6); overflow-y: auto; flex: 1; min-height: 0; }
.overlay__footer { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-6); border-top: var(--bw) solid var(--border); flex-wrap: wrap; }
.overlay__footer .overlay__start { margin-right: auto; }
.overlay__message { color: var(--text); line-height: var(--lh-base); white-space: pre-line; }
.modal--sm .overlay__header { border-bottom: 0; padding-bottom: 0; }
.modal--sm .overlay__footer { border-top: 0; padding-top: 0; }
.modal--sm .overlay__body { padding-top: var(--sp-4); }
.is-busy { cursor: progress; }
@media (max-width: 767px) {
    .yt-overlay--modal { align-items: flex-end; padding: 0; }
    .modal { max-width: none !important; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; padding-bottom: var(--safe-bottom); }
    .drawer { width: 100vw; border-left: 0; padding-bottom: var(--safe-bottom); }
    .overlay__body { padding: var(--sp-5) var(--sp-4); }
    .overlay__header { padding-left: var(--sp-4); }
    .overlay__footer { padding: var(--sp-3) var(--sp-4); }
    .overlay__footer .btn { flex: 1; }
}
@keyframes yt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes yt-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes yt-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: var(--sp-6); transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--sp-2); width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast {
    pointer-events: auto;
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: 46px; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
    background: var(--ink); color: var(--on-ink);
    border-radius: var(--r);
    box-shadow: var(--shadow-popover);
    font-size: var(--fs-sm); font-weight: var(--fw-medium);
    animation: yt-rise var(--dur) var(--ease);
}
.toast.is-leaving { opacity: 0; transition: opacity 150ms var(--ease); }
.toast__icon { font-size: 15px; }
.toast--ok .toast__icon { color: #7DD3A0; }
.toast--warn .toast__icon { color: #F2C46D; }
.toast--error .toast__icon { color: #F59A92; }
/* Nel tema scuro il toast è chiaro (inchiostro invertito): icone nei toni scuri */
[data-theme="dark"] .toast--ok .toast__icon { color: #2E7D4F; }
[data-theme="dark"] .toast--warn .toast__icon { color: #A86512; }
[data-theme="dark"] .toast--error .toast__icon { color: #C0392B; }
.toast__msg { flex: 1; min-width: 0; }
.toast__action { color: var(--on-ink); font-weight: var(--fw-bold); padding: 0 var(--sp-3); height: 32px; border-radius: 6px; text-decoration: underline; text-underline-offset: 3px; }
.toast__action:hover { background: rgba(127, 127, 127, 0.2); }
.toast__close { width: 32px; height: 32px; border-radius: 6px; color: var(--on-ink); opacity: 0.7; }
.toast__close:hover { opacity: 1; background: rgba(127, 127, 127, 0.2); }
@media (max-width: 767px) { .toasts { bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + var(--sp-3)); width: calc(100vw - 24px); } }

/* ---------- Menu a tendina ---------- */
.menu {
    position: fixed; z-index: var(--z-menu);
    min-width: 200px; max-width: 300px;
    padding: var(--sp-1);
    background: var(--surface);
    border: var(--bw) solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-popover);
    animation: yt-fade var(--dur-fast) var(--ease);
}
.menu__item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; height: 38px; padding: 0 var(--sp-3); border-radius: 6px; font-size: var(--fs-sm); color: var(--text); text-align: left; }
.menu__item:hover, .menu__item:focus-visible { background: var(--surface-hover); outline: none; }
.menu__item:disabled { opacity: 0.45; }
.menu__item--danger { color: var(--danger); }
.menu__icon { width: 16px; text-align: center; color: var(--text-2); flex-shrink: 0; }
.menu__item--danger .menu__icon { color: var(--danger); }
.menu__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__check { color: var(--accent); }
.menu__divider { height: 1px; background: var(--border); margin: var(--sp-1) 0; }
.menu__heading { font-size: var(--fs-micro); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-micro); color: var(--text-2); padding: var(--sp-2) var(--sp-3) var(--sp-1); }

/* ---------- Ricerca luogo ---------- */
.place-picker { position: relative; }
.place-picker .input { padding-left: 36px; }
.place-picker__icon { position: absolute; left: 12px; top: 0; height: 40px; display: flex; align-items: center; color: var(--text-3); pointer-events: none; font-size: 13px; }
.place-picker__results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: var(--z-menu); background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-popover); max-height: 320px; overflow-y: auto; padding: var(--sp-1); }
.place-picker__item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: var(--sp-2) var(--sp-3); border-radius: 6px; text-align: left; gap: 1px; }
.place-picker__item:hover, .place-picker__item.is-active { background: var(--surface-hover); }
.place-picker__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.place-picker__detail { font-size: var(--fs-xs); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.place-picker__state { padding: var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }

/* ---------- Placeholder "In costruzione" (stub delle viste) ---------- */
.wip { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-8); border: var(--bw) dashed var(--border-strong); border-radius: var(--r-lg); }
.wip__label { font-size: var(--fs-micro); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-micro); color: var(--text-2); }
.wip__title { font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); }
.wip__text { color: var(--text-2); max-width: 60ch; }

/* ---------- Leaflet in tema ---------- */
.leaflet-container { font-family: var(--font-sans); background: var(--surface-sunken); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: var(--shadow-popover); }
.leaflet-popup-content-wrapper { border-radius: var(--r); }
.leaflet-popup-content { margin: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); line-height: var(--lh-snug); }
.leaflet-bar a { background: var(--surface); color: var(--text); border-bottom-color: var(--border); }
.leaflet-bar a:hover { background: var(--surface-hover); }
.leaflet-control-attribution { font-size: 11px; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--text-2); }
.leaflet-control-attribution a { color: var(--text-2); }
