/* ============================================================================
   Happy Family — portale web · base grafica (WI-10 Fase 1)
   ----------------------------------------------------------------------------
   Design token e stile base RIUSABILI, derivati dal prototipo approvato e da
   docs/ui-spec.md §2–§3. Regola d'oro branding: --teal = SOLO superfici/sfondi,
   MAI testo su bianco; testo/CTA = --ink (fill + testo bianco) o nero.
   Pro = teal-only (nessun gold). Light theme only (come il prototipo).
   Nessuna dipendenza di rete: font-stack di sistema (niente Google Fonts).
   ============================================================================ */

:root {
    /* --- Colore (ui-spec §2.1 / prototipo :root) ------------------------- */
    --teal: #80D0C0;        /* Superfici brand, stati selezionati (mai testo su bianco) */
    --teal-dark: #70C0C0;   /* Bordi/gradienti brand */
    --teal-light: #90D0D0;  /* Riempimenti soft, avatar membro */
    --ink: #1E6F66;         /* Azioni primarie, link, icone attive, testo accento */
    --ink-pressed: #14544C; /* Stato premuto */
    --bg: #F1F8F6;          /* Sfondo app */
    --surface: #FFFFFF;     /* Card, sheet, campi */
    --border: #E2ECEA;      /* Divisori, bordi input */
    --text: #0F1B19;        /* Testo primario */
    --text-2: #5B6B68;      /* Testo secondario / caption */
    --on-brand: #08312C;    /* Testo/icone su superficie --teal (contrasto AA) */
    --success: #2FA36B;     /* Stato positivo */
    --danger: #D8503C;      /* Errore / distruttivo */
    --danger-soft: #FCEBE7; /* Superficie soft d'errore (alert) */
    --on-danger-soft: #8E2A1A; /* Testo su superficie d'errore soft (contrasto AA) */
    --on-brand-pressed: #04211D; /* Stato premuto dei controlli su superficie --teal */
    --warning: #D98A2B;     /* Warning */
    --slate: #64748B;       /* Icona/label visibilità "Solo genitori" */

    /* --- Tipografia (ui-spec §2.2) --------------------------------------- */
    /* NB: font di sistema con i fallback del prototipo (Poppins/Inter sono un
       follow-up: si bundleranno in seguito, non ora). */
    --font-title: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;      /* titoli */
    --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;    /* UI/body */
    --fs-display: 28px;     /* Large title (700/34) */
    --fs-h2: 19px;          /* Titoli empty-state/sheet (600) */
    --fs-body: 16px;        /* Testo corrente (400–500) */
    --fs-body-sm: 14px;     /* Meta, caption (500) */
    --fs-micro: 11px;       /* Badge, PRO, label (600–800) */

    /* --- Spaziatura — griglia 4pt (ui-spec §2.3) ------------------------- */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;

    /* --- Raggi (ui-spec §2.4) ------------------------------------------- */
    --r-sm: 8px;
    --r-md: 12px;
    --r-card: 18px;
    --r-sheet: 24px;        /* solo angoli alti (sheet) */
    --r-pill: 999px;

    /* --- Ombre / elevazione (ui-spec §2.5) ------------------------------ */
    --sh-card: 0 2px 8px rgba(0, 0, 0, .06);    /* card */
    --sh-modal: 0 8px 24px rgba(0, 0, 0, .12);  /* sheet/modal */

    /* --- Layout ---------------------------------------------------------- */
    --container-max: 960px; /* larghezza massima del contenuto centrato */
}

/* ============================================================================
   Reset leggero
   ============================================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--fs-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg {
    max-width: 100%;
    display: block;
}

a {
    color: var(--ink);
    text-decoration: none;
}

a:hover {
    color: var(--ink-pressed);
}

/* ============================================================================
   Tipografia
   ============================================================================ */

h1,
h2,
h3 {
    font-family: var(--font-title);
    color: var(--text);
    line-height: 1.2;
    margin: 0 0 var(--sp-3);
}

h1 {
    font-size: var(--fs-display);
    font-weight: 700;
}

h2 {
    font-size: var(--fs-h2);
    font-weight: 600;
}

p {
    margin: 0 0 var(--sp-4);
}

/* Testo secondario / caption riutilizzabile. */
.text-muted {
    color: var(--text-2);
}

.lead {
    font-size: var(--fs-body);
    color: var(--text-2);
}

/* ============================================================================
   Layout — container centrato e header brandizzato
   ============================================================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--sp-5);
}

.site-header {
    padding-block: var(--sp-4);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

/* Wordmark: testo accento --ink (mai --teal su bianco). */
.brand {
    font-family: var(--font-title);
    font-size: var(--fs-h2);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.brand:hover {
    color: var(--ink-pressed);
}

main.container {
    padding-block: var(--sp-6);
}

/* ============================================================================
   Card — superficie bianca, angoli morbidi, ombra soft
   ============================================================================ */

.card {
    background: var(--surface);
    border-radius: var(--r-card);
    box-shadow: var(--sh-card);
    padding: var(--sp-6);
}

/* ============================================================================
   Bottoni — pill; primary (fill --ink, testo bianco) e secondary
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 48px;
    padding: var(--sp-3) var(--sp-6);
    border: 0;
    border-radius: var(--r-pill);
    font-family: var(--font-ui);
    font-size: var(--fs-body);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-align: center;
    transition: background-color .15s ease, color .15s ease;
}

/* Primary: fill --ink, testo bianco (contrasto AA). */
.btn-primary {
    background: var(--ink);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: var(--ink-pressed);
    color: #FFFFFF;
}

/* Secondary: superficie soft, testo --ink. */
.btn-secondary {
    background: var(--bg);
    color: var(--ink);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    color: var(--ink-pressed);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: .5;
    cursor: default;
    pointer-events: none;
}

/* ============================================================================
   Pagine di ritorno checkout (/pro/success, /pro/cancel)
   Card centrata, molta aria, estetica soft.
   ============================================================================ */

.pro-return {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding-block: var(--sp-8);
}

.pro-return .card {
    max-width: 440px;
    width: 100%;
    text-align: center;
    padding: var(--sp-8) var(--sp-6);
}

/* Badge circolare per l'icona in cima alla card. */
.pro-badge {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--sp-5);
    border-radius: var(--r-pill);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Variante brand (successo/Pro): superficie --teal, icona --on-brand (AA). */
.pro-badge--brand {
    background: var(--teal);
    color: var(--on-brand);
}

/* Variante neutra (annullo): superficie soft, icona secondaria. */
.pro-badge--neutral {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-2);
}

.pro-badge svg {
    width: 34px;
    height: 34px;
}

.pro-return h1 {
    margin-bottom: var(--sp-3);
}

.pro-return .lead {
    margin-bottom: var(--sp-6);
}

/* Riga di aiuto/hint sotto la card o il messaggio. */
.pro-return .hint {
    margin: 0;
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

/* ============================================================================
   Portale web — app-shell + auth (WI-10 Fase 2)
   ----------------------------------------------------------------------------
   Regola branding invariata: --teal = SOLO superfici; testo/CTA/tab attive =
   --ink o nero. Chip Pro = superficie --teal + testo --on-brand (nessun gold).
   Dropdown senza JS via <details>/<summary> nativi.
   ============================================================================ */

/* --- Barra applicativa (header dell'area App) ----------------------------- */
.appbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.appbar__bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: 60px;
    padding-block: var(--sp-2);
}

.appbar__spacer {
    flex: 1 1 auto;
}

/* --- Menu a discesa (family switcher + menu utente) ----------------------- */
.menu {
    position: relative;
}

.menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--text);
    font-size: var(--fs-body-sm);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
}

/* Nasconde il marker nativo del <summary> (Safari/Chrome). */
.menu__trigger::-webkit-details-marker {
    display: none;
}

.menu__trigger:hover {
    border-color: var(--teal-dark);
}

.switcher__name,
.usermenu__name {
    max-width: 30ch;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu__caret {
    width: 16px;
    height: 16px;
    color: var(--text-2);
    transition: transform .15s ease;
}

.menu[open] > .menu__trigger .menu__caret {
    transform: rotate(180deg);
}

.menu__panel {
    position: absolute;
    top: calc(100% + var(--sp-2));
    left: 0;
    min-width: 220px;
    max-width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-modal);
    padding: var(--sp-2);
    z-index: 30;
}

/* Menu utente ancorato a destra. */
.menu__panel--right {
    left: auto;
    right: 0;
}

.menu__label {
    margin: 0;
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-micro);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-2);
}

.menu__form {
    margin: 0;
}

.menu__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--fs-body-sm);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.menu__item:hover {
    background: var(--bg);
    color: var(--text);
}

/* Voce famiglia attiva: evidenziata con una superficie soft. */
.menu__item--active {
    background: var(--bg);
    font-weight: 700;
}

.menu__item--active::after {
    content: "✓";
    position: absolute;
    top: var(--sp-2);
    right: var(--sp-3);
    color: var(--ink);
    font-weight: 700;
}

.menu__item-name {
    font-weight: 600;
}

.menu__item-meta {
    font-size: var(--fs-micro);
    color: var(--text-2);
}

/* --- Chip Pro (teal-only, mai gold) --------------------------------------- */
.chip-pro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px var(--sp-2);
    border-radius: var(--r-pill);
    background: var(--teal);
    color: var(--on-brand);
    font-size: var(--fs-micro);
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.chip-pro__icon {
    width: 12px;
    height: 12px;
}

/* --- Nav delle 5 sezioni (tab bar) ---------------------------------------- */
.tabbar {
    border-top: 1px solid var(--border);
    overflow-x: auto;
}

.tabbar__inner {
    display: flex;
    gap: var(--sp-2);
    padding-block: 0;
}

.tab {
    display: inline-flex;
    align-items: center;
    padding: var(--sp-3) var(--sp-3);
    border-bottom: 2px solid transparent;
    color: var(--text-2);
    font-size: var(--fs-body-sm);
    font-weight: 600;
    white-space: nowrap;
}

.tab:hover {
    color: var(--ink);
}

/* Tab attiva: testo + sottolineatura --ink (mai --teal su bianco). */
.tab--active {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

.tab--active:hover {
    color: var(--ink-pressed);
}

/* --- Contenuto dell'area App ---------------------------------------------- */
.app-main {
    padding-block: var(--sp-6);
}

/* --- Dashboard ------------------------------------------------------------ */
/* NB: la card di riepilogo `.dashboard__summary` / `.summary-item*` è stata sostituita
   dall'hero con le tre "pill" (sezione "App — polish" in fondo al file): le sue regole
   sono state rimosse perché non le usava più nessuna view. */
.dashboard__sections-heading {
    margin-bottom: var(--sp-4);
}

/* Griglia delle card-sezione. */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--sp-4);
}

.section-card {
    display: flex;
    align-items: center;
    min-height: 96px;
    color: var(--text);
    transition: box-shadow .15s ease, transform .15s ease;
}

.section-card:hover {
    color: var(--text);
    box-shadow: var(--sh-modal);
    transform: translateY(-2px);
}

.section-card__title {
    font-family: var(--font-title);
    font-size: var(--fs-h2);
    font-weight: 600;
}

/* --- Stub di sezione + empty-state ---------------------------------------- */
.section__title {
    margin-bottom: var(--sp-5);
}

.empty-state {
    text-align: center;
    padding-block: var(--sp-10);
}

.empty-state h1,
.empty-state h2 {
    margin-bottom: var(--sp-3);
}

/* --- Pagine di autenticazione (login/denied) ------------------------------ */
.auth {
    display: flex;
    justify-content: center;
    padding-block: var(--sp-8);
}

.auth__card {
    width: 100%;
    max-width: 420px;
}

.auth__title {
    margin-bottom: var(--sp-2);
}

.auth__hint {
    margin-top: var(--sp-5);
}

/* --- Form ----------------------------------------------------------------- */
.form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    margin-top: var(--sp-5);
}

.form__group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.form__label {
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--text);
}

.form__input {
    width: 100%;
    min-height: 48px;
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--fs-body);
}

.form__input:focus {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
    border-color: var(--ink);
}

.form__check {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-body-sm);
    color: var(--text);
    cursor: pointer;
}

.form__submit {
    margin-top: var(--sp-2);
}

/* --- Alert (errore login) ------------------------------------------------- */
.alert {
    margin-top: var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    font-size: var(--fs-body-sm);
}

.alert--error {
    background: var(--danger-soft);          /* superficie soft coerente con --danger */
    border: 1px solid var(--danger);
    color: var(--on-danger-soft);            /* testo scuro su superficie chiara (AA) */
}

/* ============================================================================
   Sezione LISTE — portale web (WI-10 Fase 3)
   ----------------------------------------------------------------------------
   PRIMA sezione di contenuto: stabilisce i pattern visivi riusabili dalle altre
   (progress bar, chip di visibilità, avatar autore, check-item, form di sezione).
   Regola branding invariata: --teal = SOLO superfici; --ink per testo/CTA/barre.
   ============================================================================ */

/* --- Intestazione di sezione (titolo + azione primaria) ------------------- */
.section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
    flex-wrap: wrap;
}

.section__head .section__title {
    margin-bottom: 0;
}

.btn__icon {
    width: 18px;
    height: 18px;
}

/* --- Banner "N nascoste dai permessi" ------------------------------------- */
.hidden-note {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    background: #EAF6F3;
    border: 1px solid var(--teal-light);
    border-radius: var(--r-md);
    padding: var(--sp-2) var(--sp-3);
    margin-bottom: var(--sp-4);
    color: var(--ink);
    font-size: var(--fs-body-sm);
    font-weight: 500;
}

.hidden-note svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

/* --- Elenco liste (card) -------------------------------------------------- */
.list-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.list-card {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow: var(--sh-card);
    padding: var(--sp-3);
}

.list-card__link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    color: var(--text);
}

.list-card__link:hover {
    color: var(--text);
}

.list-card__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--teal-light);
    color: var(--on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-card__icon svg {
    width: 24px;
    height: 24px;
}

.list-card__icon--lg {
    width: 52px;
    height: 52px;
    border-radius: var(--r-md);
}

.list-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.list-card__title {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-card__meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

/* --- Barra di avanzamento (n/tot) ----------------------------------------- */
.progress {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.progress__track {
    flex: 1 1 auto;
    height: 5px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
}

.progress__bar {
    display: block;
    height: 100%;
    background: var(--ink);
    border-radius: 3px;
}

/* Riempimento della barra a PASSI DEL 5% (classe, non style="width:…" inline): gli
   attributi style sarebbero l'unica cosa del nostro markup a richiedere una deroga
   nella Content-Security-Policy. Vedi Pages/App/_ProgressTrack.cshtml. */
.progress__bar--p0 { width: 0%; }
.progress__bar--p5 { width: 5%; }
.progress__bar--p10 { width: 10%; }
.progress__bar--p15 { width: 15%; }
.progress__bar--p20 { width: 20%; }
.progress__bar--p25 { width: 25%; }
.progress__bar--p30 { width: 30%; }
.progress__bar--p35 { width: 35%; }
.progress__bar--p40 { width: 40%; }
.progress__bar--p45 { width: 45%; }
.progress__bar--p50 { width: 50%; }
.progress__bar--p55 { width: 55%; }
.progress__bar--p60 { width: 60%; }
.progress__bar--p65 { width: 65%; }
.progress__bar--p70 { width: 70%; }
.progress__bar--p75 { width: 75%; }
.progress__bar--p80 { width: 80%; }
.progress__bar--p85 { width: 85%; }
.progress__bar--p90 { width: 90%; }
.progress__bar--p95 { width: 95%; }
.progress__bar--p100 { width: 100%; }

.progress__label {
    flex: 0 0 auto;
    font-size: var(--fs-micro);
    font-weight: 600;
    color: var(--text-2);
}

/* --- Chip di visibilità (shared: liste/bacheca/calendario) ---------------- */
.vis-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: var(--r-pill);
    font-size: var(--fs-micro);
    font-weight: 600;
}

.vis-chip svg {
    width: 12px;
    height: 12px;
}

.vis-chip--family {
    color: var(--ink);
    background: #EAF6F3;
}

.vis-chip--parents {
    color: var(--slate);
    background: #F1F5F9;
}

.vis-chip--custom {
    color: var(--text-2);
    background: var(--bg);
    border: 1px solid var(--border);
}

/* --- Chip autore (avatar iniziali + nome) --------------------------------- */
.author-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    min-width: 0;
    color: var(--text-2);
    font-size: var(--fs-micro);
    font-weight: 600;
}

.author-chip__avatar {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: var(--r-pill);
    background: var(--teal);
    color: var(--on-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 9px;
    font-weight: 700;
}

.author-chip__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14ch;
}

/* --- Menu azioni "…" su card/dettaglio ------------------------------------ */
.list-card__menu-trigger {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-2);
    justify-content: center;
}

.list-card__menu-trigger:hover {
    border-color: transparent;
    color: var(--ink);
}

.list-card__menu-trigger svg {
    width: 20px;
    height: 20px;
}

/* Voce di menu distruttiva (elimina). */
.menu__item--danger {
    color: var(--danger);
    font-weight: 600;
}

.menu__item--danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* --- Link "torna indietro" ------------------------------------------------ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    margin-bottom: var(--sp-4);
    color: var(--ink);
    font-size: var(--fs-body-sm);
    font-weight: 600;
}

.back-link svg {
    width: 18px;
    height: 18px;
}

/* --- Dettaglio lista ------------------------------------------------------ */
.list-detail__header {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.list-detail__head-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.list-detail__title {
    font-size: var(--fs-h2);
    margin: 0;
    word-break: break-word;
}

.list-detail__meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-body-sm);
}

.list-detail__progress-label {
    font-weight: 700;
    color: var(--ink);
}

.list-detail__chips {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

/* --- Elenco item (checklist) ---------------------------------------------- */
.check-list {
    list-style: none;
    margin: 0 0 var(--sp-4);
    padding: var(--sp-2) var(--sp-4);
    display: flex;
    flex-direction: column;
}

.check-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border);
}

.check-item:last-child {
    border-bottom: 0;
}

.check-item__toggle-form {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.check-item__toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-ui);
}

.check-item__box {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: var(--r-pill);
    border: 2px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.check-item__box svg {
    width: 16px;
    height: 16px;
}

.check-item--done .check-item__box {
    background: var(--ink);
    border-color: var(--ink);
}

.check-item__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.check-item__text {
    font-size: var(--fs-body);
    color: var(--text);
    word-break: break-word;
}

.check-item--done .check-item__text {
    color: var(--text-2);
    text-decoration: line-through;
}

.check-item__meta {
    font-size: var(--fs-micro);
    color: var(--text-2);
    margin-top: 1px;
}

.check-item__delete-form {
    margin: 0;
    flex: 0 0 auto;
}

.check-item__delete {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.check-item__delete:hover {
    color: var(--danger);
}

.check-item__delete svg {
    width: 17px;
    height: 17px;
}

/* --- Campo "Aggiungi elemento" (sticky in fondo) -------------------------- */
.add-item {
    position: sticky;
    bottom: var(--sp-4);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    box-shadow: var(--sh-card);
    padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-4);
    margin: 0;
}

.add-item__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--font-ui);
    font-size: var(--fs-body);
    color: var(--text);
    padding-block: var(--sp-2);
}

.add-item__submit {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: #FFFFFF;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.add-item__submit:hover {
    background: var(--ink-pressed);
}

.add-item__submit svg {
    width: 20px;
    height: 20px;
}

/* --- Empty-state compatto (dettaglio senza item) -------------------------- */
.empty-state--sm {
    padding-block: var(--sp-6);
    margin-bottom: var(--sp-4);
}

.empty-state--sm .lead {
    margin: 0;
}

/* --- Nuova lista (form) --------------------------------------------------- */
.list-new__form {
    margin-top: var(--sp-4);
}

.form__textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.5;
}

.field-error {
    color: var(--on-danger-soft);
    font-size: var(--fs-body-sm);
}

/* Honeypot anti-bot (registrazione fondatore): fuori dal flusso e invisibile, ma NON
   display:none — alcuni bot ignorano i campi nascosti così. Resta non focalizzabile
   (tabindex -1 nel markup) e fuori dallo schermo per chi usa uno screen reader. */
.form__honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.list-new__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-3);
    margin-top: var(--sp-2);
}

/* Segmented control (tipo lista) */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    padding: var(--sp-1);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
}

.segmented__option {
    cursor: pointer;
}

.segmented__option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.segmented__option span {
    display: inline-flex;
    align-items: center;
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--r-pill);
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--text-2);
}

.segmented__option input:checked + span {
    background: var(--ink);
    color: #FFFFFF;
}

.segmented__option input:focus-visible + span {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
}

/* Opzioni di visibilità (radio card) */
.vis-options {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.vis-option {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
}

.vis-option input {
    flex: 0 0 auto;
    accent-color: var(--ink);
    width: 18px;
    height: 18px;
}

.vis-option:has(input:checked) {
    border-color: var(--ink);
    background: #EAF6F3;
}

.vis-option__body {
    display: flex;
    flex-direction: column;
}

.vis-option__title {
    font-weight: 600;
    color: var(--text);
}

.vis-option__sub {
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

/* Picker membri (audience Personalizzata) */
.member-pick {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--sp-3);
}

.member-pick__summary {
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.member-pick__hint {
    font-size: var(--fs-body-sm);
}

.member-pick__list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    margin-top: var(--sp-3);
}

.member-pick__item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-md);
    cursor: pointer;
}

.member-pick__item:hover {
    background: var(--bg);
}

.member-pick__item input {
    flex: 0 0 auto;
    accent-color: var(--ink);
    width: 18px;
    height: 18px;
}

.member-pick__avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: var(--r-pill);
    background: var(--teal-light);
    color: var(--on-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: var(--fs-body-sm);
    font-weight: 600;
}

.member-pick__body {
    display: flex;
    flex-direction: column;
}

.member-pick__name {
    font-weight: 600;
    color: var(--text);
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 560px) {
    .switcher__name,
    .usermenu__name {
        max-width: 14ch;
    }

    .section__head .btn {
        flex: 1 1 auto;
    }

    .author-chip__name {
        max-width: 10ch;
    }
}

/* ============================================================================
   Sezione BACHECA — portale web (WI-10 Fase 3)
   ----------------------------------------------------------------------------
   Feed di post (card), allegati (foto/video/file/link), composer e mini-paywall.
   Riusa i pattern condivisi (chip visibilità, avatar, menu "…"). Regola branding
   invariata: --teal = SOLO superfici; --ink per testo/CTA. Pro = teal-only.
   ============================================================================ */

/* --- Feed --------------------------------------------------------------- */
.post-feed {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow: var(--sh-card);
    padding: var(--sp-4);
    overflow: hidden;
}

.post-card__head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-2);
}

.post-card__avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: var(--r-pill);
    background: var(--teal-light);
    color: var(--on-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: var(--fs-body-sm);
    font-weight: 700;
}

.post-card__ident {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.post-card__author-line {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.post-card__author {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 22ch;
}

.post-card__time {
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

/* Chip ruolo autore (Genitore = superficie teal; Figlio = superficie soft). */
.role-chip {
    display: inline-flex;
    align-items: center;
    border-radius: var(--r-pill);
    font-size: var(--fs-micro);
    font-weight: 600;
    padding: 2px 8px;
}

.role-chip--parent {
    color: var(--on-brand);
    background: var(--teal);
}

.role-chip--child {
    color: var(--ink);
    background: #EAF6F3;
    border: 1px solid var(--teal-light);
}

.post-card__menu {
    flex: 0 0 auto;
}

.post-card__chips {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-bottom: var(--sp-2);
}

.post-card__text {
    margin: 0 0 var(--sp-3);
    font-size: var(--fs-body);
    line-height: 1.5;
    color: var(--text);
    /* Testo utente: mantiene gli a-capo e spezza le parole lunghe (no overflow orizzontale). */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.post-card__text:last-child {
    margin-bottom: 0;
}

/* --- Allegati (feed + dettaglio) ---------------------------------------- */
.post-media {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}

.post-media[data-count="1"] {
    grid-template-columns: 1fr;
}

.post-media__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--r-md);
    background: var(--bg);
}

.post-media[data-count="1"] .post-media__img {
    height: auto;
    max-height: 460px;
    object-fit: contain;
}

.post-video {
    width: 100%;
    max-height: 460px;
    border-radius: var(--r-md);
    background: #0F1B19;
    margin-bottom: var(--sp-3);
}

.post-file,
.post-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-3);
    color: var(--text);
    overflow: hidden;
}

.post-file {
    background: var(--bg);
    padding: var(--sp-3);
}

.post-file:hover,
.post-link:hover {
    color: var(--text);
    border-color: var(--teal-dark);
}

.post-file__icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    background: #FDECEA;
    color: var(--danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.post-file__icon svg {
    width: 20px;
    height: 20px;
}

.post-file__body,
.post-link__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-file__name,
.post-link__title {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-file__meta,
.post-link__meta {
    font-size: var(--fs-micro);
    color: var(--text-2);
}

.post-link__thumb {
    flex: 0 0 auto;
    width: 64px;
    align-self: stretch;
    background: linear-gradient(135deg, var(--teal-light), var(--teal));
    color: var(--on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-link__body {
    padding: var(--sp-3) var(--sp-3) var(--sp-3) 0;
}

/* --- Composer (nuovo post) ---------------------------------------------- */
.post-new__form {
    margin-top: var(--sp-4);
}

.post-new__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-3);
    margin-top: var(--sp-2);
}

.attach-field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    padding: var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-2);
}

.attach-field__label {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--text);
}

.attach-field__label svg {
    width: 18px;
    height: 18px;
    color: var(--ink);
}

.attach-field__pro {
    margin-left: auto;
}

.attach-field__input {
    font-family: var(--font-ui);
    font-size: var(--fs-body-sm);
    color: var(--text);
}

.attach-field__hint {
    font-size: var(--fs-micro);
}

.attach-field__link-title {
    margin-top: var(--sp-1);
}

/* --- Mini-paywall "Media estese" (riusabile) ---------------------------- */
.paywall {
    background: #0F1B19;
    border-radius: var(--r-card);
    padding: var(--sp-4);
    margin-top: var(--sp-4);
    color: #FFFFFF;
}

.paywall__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--teal);
    color: var(--on-brand);
    font-size: var(--fs-micro);
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-radius: var(--r-pill);
    padding: 3px 9px;
    margin-bottom: var(--sp-2);
}

.paywall__badge svg {
    width: 13px;
    height: 13px;
}

.paywall__title {
    margin: 0 0 var(--sp-1);
    font-family: var(--font-title);
    font-weight: 600;
    font-size: var(--fs-body);
    color: #FFFFFF;
}

.paywall__body {
    margin: 0 0 var(--sp-4);
    font-size: var(--fs-body-sm);
    color: rgba(255, 255, 255, .72);
}

.paywall__form {
    margin: 0;
}

/* CTA su superficie scura: eccezione alla regola "--teal solo superfici" — qui il fondo
   È scuro, quindi teal come fill con testo --on-brand rispetta il contrasto (come chip Pro). */
.paywall__cta {
    background: var(--teal);
    color: var(--on-brand);
}

.paywall__cta:hover {
    background: var(--teal-light);
    color: var(--on-brand);
}

.paywall__child {
    margin: 0;
    text-align: center;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .82);
    border-radius: var(--r-pill);
    padding: var(--sp-3);
    font-size: var(--fs-body-sm);
    font-weight: 500;
}

/* ============================================================================
   Sezione CALENDARIO — portale web (WI-10 Fase 3)
   ----------------------------------------------------------------------------
   Agenda per mese + composer evento + dettaglio. Riusa i token e i pattern di
   Liste/Bacheca (card, chip visibilità, avatar autore, form, mini-paywall).
   Branding invariato: --teal SOLO superfici; --ink per testo/CTA/accenti.
   ============================================================================ */

/* --- Navigazione periodo (mese precedente / successivo / oggi) ------------ */
.period-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
}

.period-nav__btn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--ink);
}

.period-nav__btn:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.period-nav__btn svg {
    width: 18px;
    height: 18px;
}

.period-nav__label {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: var(--fs-h2);
    color: var(--text);
    text-transform: capitalize;
}

.period-nav__today {
    margin-left: auto;
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--ink);
}

/* --- Agenda: gruppi per giorno -------------------------------------------- */
.agenda {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
}

.day-group__heading {
    margin: 0 0 var(--sp-2);
    font-size: var(--fs-body-sm);
    font-weight: 700;
    color: var(--text-2);
    text-transform: capitalize;
}

.event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

/* --- Card evento ---------------------------------------------------------- */
.event-card {
    display: flex;
    align-items: stretch;
    gap: var(--sp-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow: var(--sh-card);
    padding: var(--sp-3);
}

.event-card__link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: var(--sp-3);
    color: var(--text);
}

.event-card__link:hover {
    color: var(--text);
}

.event-card__time {
    flex: 0 0 auto;
    min-width: 72px;
    font-size: var(--fs-body-sm);
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.event-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.event-card__title-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
}

.event-card__title {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-card__icon {
    flex: 0 0 auto;
    display: inline-flex;
    color: var(--text-2);
}

.event-card__icon svg {
    width: 15px;
    height: 15px;
}

.event-card__loc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-micro);
    color: var(--text-2);
}

.event-card__loc svg {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
}

.event-card__meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.event-card__menu {
    flex: 0 0 auto;
}

/* --- Composer evento (form) ----------------------------------------------- */
.form__row {
    display: flex;
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.form__row > .form__group {
    flex: 1 1 200px;
    min-width: 0;
}

.event-new__custom-rule {
    margin-top: var(--sp-3);
}

.reminder-pick {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.reminder-channel {
    margin-top: var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.event-new__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-3);
    margin-top: var(--sp-2);
}

/* --- Dettaglio evento ----------------------------------------------------- */
.event-detail__card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.event-detail__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-3);
}

.event-detail__title {
    margin: 0;
}

.event-detail__chips {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.event-detail__facts {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--sp-2) var(--sp-4);
}

.event-detail__facts dt {
    font-size: var(--fs-body-sm);
    font-weight: 700;
    color: var(--text-2);
}

.event-detail__facts dd {
    margin: 0;
    color: var(--text);
}

.event-detail__desc {
    white-space: pre-wrap;
}

.event-detail__reminders {
    margin-top: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.event-detail__subtitle {
    margin: 0;
    font-size: var(--fs-h2);
    font-family: var(--font-title);
    font-weight: 700;
    color: var(--text);
}

/* --- Elenco promemoria ---------------------------------------------------- */
.reminder-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.reminder-list__item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.reminder-list__icon {
    flex: 0 0 auto;
    display: inline-flex;
    color: var(--text-2);
}

.reminder-list__icon svg {
    width: 17px;
    height: 17px;
}

.reminder-list__label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--fs-body-sm);
    color: var(--text);
}

.reminder-list__del {
    flex: 0 0 auto;
}

.reminder-add__row {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    align-items: center;
}

.reminder-add__row .form__input {
    flex: 1 1 auto;
    min-width: 120px;
    width: auto;
}

/* Bottone-icona (es. elimina promemoria) */
.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn--danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-soft);
}

/* ============================================================================
   Sezione INVITA — portale web (WI-10 Fase 3)
   ----------------------------------------------------------------------------
   Gestione inviti (solo Genitore): form email+ruolo, elenco con chip stato,
   card "locked" per il Figlio. Riusa token/classi esistenti (card, form,
   vis-option, role-chip, alert). Nuove classi solo per l'elenco e i chip stato.
   Chip stato (ui-spec §3): Pending=ambra (--warning) · Accepted=--success ·
   Expired/Revoked=neutro.
   ============================================================================ */

/* --- Alert di conferma (FlashOk) — variante success dell'alert esistente ---- */
.alert--success {
    background: #E9F6EF;                      /* superficie soft coerente con --success */
    border: 1px solid var(--success);
    color: #1C7A4C;                          /* testo scuro su superficie chiara (AA) */
}

.alert--warning {
    background: #FBF0DC;                      /* superficie soft coerente con --warning */
    border: 1px solid var(--warning);
    color: #8A5A12;                          /* testo ambra scuro su superficie chiara (AA) */
}

/* Fieldset usato solo come contenitore disattivabile: nessuna cornice di default. */
.form__fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.form__fieldset[disabled] {
    opacity: 0.55;
}

/* --- Banner "conferma la tua email" (app-shell) ---------------------------- */
.banner-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.banner-confirm__form {
    margin: 0;
}

/* --- Bottoni: variante piccola + ghost (riusabili) ------------------------- */
.btn--sm {
    min-height: 36px;
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--fs-body-sm);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}

/* --- Card "locked" (Figlio non può invitare) ------------------------------- */
.locked-card {
    text-align: center;
    padding: var(--sp-8) var(--sp-6);
}

.locked-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--sp-3);
    border-radius: 50%;
    background: var(--bg);
    color: var(--slate);
}

.locked-card__icon svg {
    width: 28px;
    height: 28px;
}

.locked-card__title {
    font-size: var(--fs-h2);
    font-weight: 600;
    margin-bottom: var(--sp-2);
}

/* --- Form invito ----------------------------------------------------------- */
.invite-form {
    margin-top: var(--sp-4);
}

.invite-form__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--sp-2);
}

/* --- Elenco inviti --------------------------------------------------------- */
.invite-list__heading {
    margin-top: var(--sp-6);
    margin-bottom: var(--sp-3);
    font-size: var(--fs-h2);
    font-weight: 600;
}

.invite-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

.invite-row__main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.invite-row__email {
    font-weight: 600;
    word-break: break-word;
}

.invite-row__chips {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.invite-row__meta {
    font-size: var(--fs-body-sm);
}

.invite-row__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex: 0 0 auto;
}

.invite-row__revoke {
    color: var(--danger);
}

.invite-row__revoke:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* --- Chip stato invito (ui-spec §3) ---------------------------------------- */
.invite-status {
    display: inline-flex;
    align-items: center;
    border-radius: var(--r-pill);
    font-size: var(--fs-micro);
    font-weight: 600;
    padding: 2px 8px;
}

.invite-status--pending {
    color: #8A5A12;                          /* testo ambra scuro su superficie chiara (AA) */
    background: #FBF0DC;                      /* superficie soft coerente con --warning */
}

.invite-status--accepted {
    color: #1C7A4C;
    background: #E9F6EF;
}

.invite-status--neutral {
    color: var(--text-2);
    background: var(--bg);
    border: 1px solid var(--border);
}

/* --- Link di accettazione in DEV (mai in Production: AcceptUrl è null in prod) --- */
.invite-devlink {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: var(--sp-2);
}

.invite-devlink__label {
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-2);
}

.invite-devlink__input {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: var(--fs-body-sm);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

/* ============================================================================
   Sezione DOVE SIAMO (WI-10 Fase 3) — posizioni effimere on-demand.
   ========================================================================== */

/* Banner privacy: on-demand · nessuno storico · 15 min. */
.privacy-banner {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--fs-body-sm);
    color: var(--on-brand);
    background: var(--teal-light);
    border-radius: var(--r-md);
}

.privacy-banner svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

/* Mappa Azure Maps + stati di fallback (loading / non disponibile). */
.map-canvas {
    position: relative;
    height: 340px;
    margin-bottom: var(--sp-4);
    overflow: hidden;
    background: var(--teal-light);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
}

.map-canvas__fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
    height: 100%;
    padding: var(--sp-6);
    text-align: center;
    color: var(--text-2);
}

.map-canvas__fallback strong {
    color: var(--text);
    font-size: var(--fs-h2);
}

/* Placeholder card mostrato quando Azure Maps non è configurato (account non ancora provisionato). */
.map-placeholder {
    margin-bottom: var(--sp-4);
    text-align: center;
}

.map-popup {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-body-sm);
    color: var(--text);
}

/* Paywall FULL: card Pro con sfondo mappa sfocato decorativo dietro. */
.loc-paywall {
    position: relative;
    padding: var(--sp-6) 0;
}

.loc-paywall__blur {
    position: absolute;
    inset: 0;
    border-radius: var(--r-card);
    background:
        radial-gradient(circle at 30% 40%, var(--teal) 0, transparent 42%),
        radial-gradient(circle at 72% 62%, var(--teal-dark) 0, transparent 46%),
        var(--teal-light);
    filter: blur(10px);
    opacity: .5;
    pointer-events: none;
}

.loc-paywall .paywall {
    position: relative;
}

/* Azioni sulla propria posizione (condividi / termina). */
.loc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-bottom: var(--sp-2);
}

.loc-actions form {
    margin: 0;
}

.loc-sharing-note {
    margin: 0 0 var(--sp-4);
    font-size: var(--fs-body-sm);
    color: var(--ink);
}

/* Card di sezione (richieste in arrivo, richiedi, lista membri). */
.loc-card {
    margin-bottom: var(--sp-4);
}

.loc-card__title {
    margin: 0 0 var(--sp-3);
    font-size: var(--fs-h2);
    color: var(--text);
}

/* Richieste in arrivo. */
.loc-request-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.loc-request {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.loc-request__text {
    color: var(--text);
}

.loc-request__cta {
    flex: 0 0 auto;
}

.loc-request-form .form__group {
    margin-top: var(--sp-3);
}

/* Lista membri con stato di condivisione. */
.loc-member-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.loc-member {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.loc-member__avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: var(--fs-body-sm);
    font-weight: 700;
    color: var(--on-brand);
    background: var(--teal-light);
    border-radius: var(--r-pill);
}

.loc-member__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.loc-member__name {
    color: var(--text);
    font-weight: 500;
}

.loc-member__you {
    color: var(--text-2);
    font-weight: 400;
}

.loc-member__meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-body-sm);
}

.loc-member__status {
    color: var(--text-2);
}

.loc-member__status--on {
    color: var(--ink);
    font-weight: 500;
}

/* Messaggio di errore geolocation (diniego permesso del browser). */
.loc-geo-msg {
    width: 100%;
    margin: var(--sp-2) 0 0;
    font-size: var(--fs-body-sm);
    color: var(--on-danger-soft);
}

/* ============================================================================
   Porta d'ingresso del portale — WI-10 Fase 4
   ----------------------------------------------------------------------------
   Branding (logo + wordmark), registrazione fondatore, landing invito, stub
   legale. La home pubblica "/" NON sta più qui: è la landing di presentazione
   in fondo al file (docs/landing-spec.md). Regola branding invariata: --teal =
   SOLO superfici, testo/CTA = --ink o nero. Nessun JS, nessuna risorsa di rete.
   ============================================================================ */

/* --- Brand: logo grafico + wordmark (header di _Layout e _AppLayout) ------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
}

.brand__logo {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
}

/* Link testuale (ghost/text del prototipo): solo testo --ink, sottolineato. */
.btn-link {
    background: transparent;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-link:hover {
    color: var(--ink-pressed);
}

/* --- Pagine di onboarding (registrazione / invito): logo sopra la card ------ */
.auth__logo {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--sp-4);
}

.auth__card--wide {
    max-width: 480px;
}

.auth__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    margin-top: var(--sp-5);
    font-size: var(--fs-body-sm);
}

/* Campo bloccato (email dell'invito: disabled, senza name → non viaggia nel body). */
.form__input:disabled {
    background: var(--bg);
    color: var(--text-2);
}

.form__hint {
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

/* --- Landing invito: riepilogo "invitato in <famiglia> come <ruolo>" -------- */
.invite-preview {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-4);
}

.invite-preview__avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-pill);
    background: var(--teal);
    color: var(--on-brand);
    font-family: var(--font-title);
    font-weight: 700;
    font-size: var(--fs-h2);
}

.invite-preview__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.invite-preview__family {
    font-family: var(--font-title);
    font-weight: 600;
    font-size: var(--fs-h2);
    color: var(--text);
    overflow-wrap: anywhere;
}

.invite-preview__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

/* Stato "invito non valido": icona neutra + testo. */
.invite-invalid {
    text-align: center;
    padding-block: var(--sp-4);
}

.invite-invalid .pro-badge {
    margin-inline: auto;
}

/* --- Stub pagine legali ---------------------------------------------------- */
.legal {
    max-width: 640px;
    margin-inline: auto;
}

/* ============================================================================
   Landing — home pubblica "/" (docs/landing-spec.md)
   ----------------------------------------------------------------------------
   Pagina di presentazione a tutta larghezza, servita dal layout dedicato
   _LandingLayout.cshtml. ZERO JS, nessuna risorsa esterna, icone SVG inline.
   Regola branding invariata: --teal SOLO come superficie (banda finale, chip),
   mai come colore di testo su bianco; sulla banda teal il testo è --on-brand e
   il bottone è invertito (fill --on-brand, testo bianco) per il contrasto AA.
   ============================================================================ */

:root {
    --lp-max: 1120px;          /* larghezza contenuto landing */
    --lp-gutter: 24px;         /* gutter laterale (40px da 900px) */
    --lp-section-y: 64px;      /* spazio verticale tra sezioni (96px da 900px) */
    --lp-hero-grad: linear-gradient(160deg, var(--bg) 0%, var(--surface) 55%);
    --lp-ease: cubic-bezier(.2, .7, .2, 1);      /* easing unico delle animazioni (brief §D) */
    --lp-sh-hover: 0 8px 24px rgba(0, 0, 0, .10);/* sollevamento hover (più profondo di --sh-card) */
}

/* --- Impalcatura ---------------------------------------------------------- */
.lp-container {
    width: 100%;
    max-width: var(--lp-max);
    margin-inline: auto;
    padding-inline: var(--lp-gutter);
}

body.lp {
    background: var(--surface);
    overflow-x: hidden;
}

/* Skip-link: fuori schermo finché non riceve il focus da tastiera. */
.lp-skip {
    position: absolute;
    left: var(--sp-4);
    top: var(--sp-2);
    z-index: 20;
    transform: translateY(-200%);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--r-pill);
    background: var(--ink);
    color: #FFFFFF;
    font-weight: 600;
}

.lp-skip:focus {
    transform: translateY(0);
    color: #FFFFFF;
}

/* Bersaglio dello skip-link: focus programmatico senza anello (il contesto è la
   pagina intera) e offset per non finire sotto la nav sticky. */
#lp-content {
    scroll-margin-top: 72px;
}

#lp-content:focus {
    outline: none;
}

.lp a:focus-visible,
.lp .btn:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}

/* --- Nav sticky ----------------------------------------------------------- */
.lp-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.lp-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    min-height: 64px;
}

.lp-nav__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.lp-nav__cta {
    min-height: 44px;
    padding: var(--sp-2) var(--sp-5);
    font-size: var(--fs-body-sm);
    white-space: nowrap;
}

/* Su mobile resta SOLO logo + CTA primaria (spec §3.1): il wordmark e "Accedi"
   farebbero andare a capo la barra a 360px; "Accedi" resta nel footer. */
.lp-nav__signin {
    display: none;
}

.lp-nav .brand__name {
    display: none;
}

/* --- Tipografia della landing --------------------------------------------- */
.lp-eyebrow {
    margin: 0 0 var(--sp-2);
    color: var(--ink);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lp-h2 {
    margin: 0;
    font-size: 26px;
    line-height: 32px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.lp-h3 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: 0 0 var(--sp-2);
    font-size: 17px;
    line-height: 24px;
    font-weight: 600;
}

.lp-body {
    margin: 0;
    font-size: var(--fs-body);
    line-height: 26px;
    color: var(--text-2);
}

/* --- Hero ----------------------------------------------------------------- */
.lp-hero {
    background: var(--lp-hero-grad);
    padding-block: var(--sp-10) var(--lp-section-y);
}

.lp-hero__grid {
    display: grid;
    gap: var(--sp-10);
    align-items: center;
}

.lp-hero__title {
    margin: 0 0 var(--sp-4);
    font-size: 34px;
    line-height: 40px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.lp-hero__lead {
    margin: 0 0 var(--sp-6);
    max-width: 46ch;
    font-size: 18px;
    line-height: 28px;
    color: var(--text-2);
}

/* Sotto i 600px le CTA sono a piena larghezza (una per riga): niente bottoni
   di larghezze diverse impilati. */
.lp-hero__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-3);
}

@media (min-width: 600px) {
    .lp-hero__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.lp-btn--lg {
    min-height: 52px;
    padding-inline: var(--sp-8);
}

.lp-hero__hint {
    margin: var(--sp-3) 0 0;
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

.lp-hero__visual {
    display: flex;
    justify-content: center;
}

/* --- Mock dell'app (composizione CSS dei componenti reali) ----------------- */
.lp-mock {
    width: 100%;
    max-width: 320px;
    display: grid;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sheet);
    box-shadow: var(--sh-card);
}

.lp-mock__item {
    display: grid;
    gap: var(--sp-2);
    padding: var(--sp-3);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

.lp-mock__item .vis-chip {
    justify-self: start;
}

.lp-mock__post-head {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.lp-mock__avatar {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: var(--r-pill);
    background: var(--teal-light);
    color: var(--on-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 13px;
    font-weight: 700;
}

.lp-mock__author {
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--text-2);
}

.lp-mock__text {
    margin: 0;
    font-size: 15px;
    line-height: 22px;
}

.lp-mock__title {
    margin: 0;
    font-family: var(--font-title);
    font-size: 15px;
    font-weight: 600;
}

.lp-mock__when {
    margin: 0;
    font-size: var(--fs-micro);
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text-2);
}

.lp-mock__row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-body-sm);
}

.lp-mock__box {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}

.lp-mock__box svg {
    width: 11px;
    height: 11px;
}

.lp-mock__row--done .lp-mock__box {
    background: var(--ink);
    border-color: var(--ink);
    color: #FFFFFF;
}

.lp-mock__row--done .lp-mock__row-text {
    color: var(--text-2);
    text-decoration: line-through;
}

.lp-mock__row-meta {
    margin-left: auto;
    font-size: var(--fs-micro);
    color: var(--text-2);
}

.lp-mock__event-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
}

.lp-mock__bell {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--ink);
}

/* --- Trust strip ---------------------------------------------------------- */
.lp-trust,
.lp-platforms {
    background: var(--bg);
    border-block: 1px solid var(--border);
}

.lp-trust {
    padding-block: var(--sp-5);
}

.lp-trust__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-3) var(--sp-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.lp-trust__item {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--text);
}

.lp-trust__item svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--ink);
}

/* --- Sezioni generiche ---------------------------------------------------- */
.lp-section {
    padding-block: var(--lp-section-y);
}

.lp-section--soft {
    background: var(--bg);
}

.lp-section__head {
    max-width: 60ch;
    margin-bottom: var(--sp-8);
}

/* --- Come funziona (3 step) ----------------------------------------------- */
.lp-steps,
.lp-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--sp-6);
    margin: 0;
    padding: 0;
    list-style: none;
}

.lp-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: var(--sp-4);
    border-radius: var(--r-pill);
    background: var(--ink);
    color: #FFFFFF;
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 700;
}

/* --- Le 5 sezioni (card feature) — griglia condivisa con .lp-steps --------- */
.lp-feature {
    padding: var(--sp-5);
}

.lp-feature__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--sp-4);
    border-radius: var(--r-pill);
    background: var(--bg);
    color: var(--ink);
}

.lp-feature__icon svg {
    width: 28px;
    height: 28px;
}

/* --- Permessi (testo + pannello visibilità + illustrazione opzionale) ------ */
/* Tre figli diretti: .lp-perm__text, .lp-perm__panel e (opzionale) .lp-perm__art.
   Su mobile impilati nell'ordine del DOM; da 900px due colonne (vedi §Responsive). */
.lp-perm {
    display: grid;
    gap: var(--sp-8);
    align-items: center;
}

.lp-perm__body {
    margin-top: var(--sp-4);
    max-width: 52ch;
}

.lp-perm__panel {
    display: grid;
    gap: var(--sp-3);
    padding: var(--sp-5);
    border: 1px solid var(--border);
}

.lp-perm__row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

.lp-perm__row--on {
    border-color: var(--ink);
    background: var(--bg);
}

.lp-perm__dot {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: var(--r-pill);
}

.lp-perm__row--on .lp-perm__dot {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 9px var(--ink);
}

/* Descrizione del livello selezionato: cambia con la rotazione (brief §D.4). */
.lp-perm__desc {
    margin: var(--sp-2) 0 0;
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

.lp-perm__avatars {
    display: inline-flex;
    margin-left: auto;
}

.lp-perm__avatar {
    width: 24px;
    height: 24px;
    margin-left: -6px;
    border-radius: var(--r-pill);
    border: 2px solid var(--surface);
    background: var(--teal);
    color: var(--on-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 11px;
    font-weight: 700;
}

/* --- Gratis e Pro (nessun prezzo) ----------------------------------------- */
.lp-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp-6);
    align-items: stretch;   /* card simmetriche: stessa altezza anche con elenchi di lunghezza diversa */
}

.lp-plan {
    padding: var(--sp-6);
}

.lp-plan--pro {
    border: 2px solid var(--teal);
}

.lp-plan__list {
    display: grid;
    gap: var(--sp-2);
    margin: var(--sp-4) 0 0;
    padding: 0;
    list-style: none;
    font-size: var(--fs-body);
}

.lp-plan__list li {
    position: relative;
    padding-left: var(--sp-6);
}

.lp-plan__list li::before {
    content: "";
    position: absolute;
    left: var(--sp-2);
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: var(--r-pill);
    background: var(--ink);
}

.lp-plan__note {
    margin: var(--sp-5) 0 0;
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

/* --- Piattaforme ---------------------------------------------------------- */
.lp-platforms {
    padding-block: var(--sp-8);
}

.lp-platforms__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3) var(--sp-4);
    text-align: center;
}

.lp-platforms__icons {
    display: inline-flex;
    gap: var(--sp-3);
    color: var(--ink);
}

.lp-platforms__icons svg {
    width: 24px;
    height: 24px;
}

.lp-platforms__text {
    margin: 0;
    font-size: var(--fs-body);
    color: var(--text);
}

/* --- Banda CTA finale (unica superficie --teal piena) ---------------------- */
.lp-band {
    background: var(--teal);
    color: var(--on-brand);
    padding-block: var(--lp-section-y);
}

.lp-band__inner {
    max-width: 640px;
    text-align: center;
}

.lp-band__title {
    color: var(--on-brand);
}

.lp-band__body {
    margin: var(--sp-4) 0 var(--sp-6);
    font-size: 18px;
    line-height: 28px;
    color: var(--on-brand);
}

/* Bottone invertito: fill --on-brand + testo bianco (AA). MAI --ink su teal. */
.lp-band__cta {
    background: var(--on-brand);
    color: #FFFFFF;
}

.lp-band__cta:hover {
    background: var(--on-brand-pressed);
    color: #FFFFFF;
}

.lp-band a:focus-visible {
    outline-color: var(--on-brand);
}

/* --- Footer --------------------------------------------------------------- */
.lp-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-block: var(--sp-8);
}

.lp-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3) var(--sp-6);
}

.lp-footer__company {
    margin: 0;
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

.lp-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-5);
    font-size: var(--fs-body-sm);
    font-weight: 600;
}

/* --- Responsive (spec §5) -------------------------------------------------- */
@media (min-width: 900px) {
    :root {
        --lp-gutter: 40px;
        --lp-section-y: 96px;
    }

    .lp-nav__signin {
        display: inline-flex;
    }

    .lp-nav .brand__name {
        display: inline;
    }

    .lp-hero__grid {
        grid-template-columns: 7fr 5fr;
    }

    .lp-hero__title {
        font-size: 52px;
        line-height: 58px;
    }

    .lp-hero__lead {
        font-size: 20px;
        line-height: 30px;
    }

    .lp-h2 {
        font-size: 34px;
        line-height: 40px;
    }

    .lp-h3 {
        font-size: 18px;
        line-height: 26px;
    }

    .lp-mock {
        max-width: 360px;
    }

    /* Senza illustrazione: due colonne, testo | pannello (layout originale). */
    .lp-perm {
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-10);
    }

    /* Con illustrazione: testo e pannello impilati a sinistra, immagine a destra
       centrata verticalmente sull'intera colonna. */
    .lp-perm--art {
        grid-template-areas:
            "text art"
            "panel art";
        align-content: center;
        row-gap: var(--sp-6);
    }

    .lp-perm--art .lp-perm__text {
        grid-area: text;
        align-self: end;
    }

    .lp-perm--art .lp-perm__panel {
        grid-area: panel;
        align-self: start;
    }

    .lp-perm--art .lp-perm__art {
        grid-area: art;
        align-self: center;
    }
}

/* Le 5 sezioni stanno su una riga sola quando il contenuto è a piena larghezza
   (spec §5): a 1120px il minmax(240px) ne farebbe entrare 4 + 1 orfana. */
@media (min-width: 1120px) {
    .lp-features {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--sp-4);
    }

    .lp-feature {
        padding: var(--sp-4);
    }
}

/* ============================================================================
   Landing — illustrazioni opzionali + animazioni (docs/landing-visual-brief.md)
   ----------------------------------------------------------------------------
   Le immagini arrivano da LandingAssets: se il file non c'è la view non emette
   l'<img> e queste regole restano semplicemente inutilizzate (fallback = mock
   CSS / icona SVG / nessuna texture).
   Le animazioni valgono SOLO con JS attivo (classe `js` su <html>, messa da
   landing.js) e mai con prefers-reduced-motion: senza l'una o con l'altro la
   pagina è ESATTAMENTE quella statica, solo ferma. Si animano esclusivamente
   `transform` e `opacity` (composited).
   ============================================================================ */

/* --- Slot immagine: hero -------------------------------------------------- */
.lp-hero__art {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;   /* PNG con sfondo trasparente (vedi brief §C) */
    margin-inline: auto;
}

/* Con l'illustrazione il mock CSS non viene nemmeno emesso (vedi Index.cshtml):
   l'immagine prende tutta la colonna, centrata. */
.lp-hero__visual--art {
    display: block;
}

/* --- Slot immagine: step, sezioni, permessi, Pro, banda ------------------- */
.lp-step__art {
    display: block;
    width: 104px;
    height: auto;
    margin-bottom: var(--sp-3);
}

.lp-feature__icon--art {
    width: 112px;
    height: 112px;
    margin-bottom: var(--sp-3);
    background: none;   /* l'illustrazione ha già il suo tile teal */
}

.lp-feature__icon--art img {
    display: block;
    width: 112px;
    height: auto;
}

.lp-perm__art {
    display: block;
    width: 100%;
    max-width: 460px;
    height: auto;
    margin-inline: auto;
}

/* Slot immagine delle card piano: altezza fissa e immagine centrata dentro, così
   le due card restano allineate anche quando una delle due illustrazioni manca
   (in quel caso lo slot è semplicemente spazio vuoto, senza placeholder). */
.lp-plan__art {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    margin: 0 auto var(--sp-5);
}

.lp-plan__art img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* Texture della banda finale: quasi invisibile (30%) e leggermente più larga della
   banda, così la deriva di 20px non scopre mai un bordo. */
.lp-band {
    position: relative;
    overflow: hidden;
}

.lp-band__texture {
    position: absolute;
    top: 0;
    left: -20px;
    width: calc(100% + 40px);
    height: 100%;
    object-fit: cover;
    opacity: .3;
    pointer-events: none;
    animation: lp-drift 20s ease-in-out infinite alternate;
}

.lp-band__inner {
    position: relative;
}

/* --- 1. Rivelazione allo scroll ------------------------------------------- */
/* A riposo (senza JS) gli elementi sono VISIBILI: solo `html.js` li nasconde. */
.lp-reveal,
.lp-stagger > * {
    transition: opacity .5s var(--lp-ease), transform .5s var(--lp-ease);
}

html.js .lp-reveal:not(.is-visible),
html.js .lp-stagger:not(.is-visible) > * {
    opacity: 0;
    transform: translateY(16px);
    will-change: opacity, transform;
}

/* Stagger di 60 ms tra le card della stessa griglia. */
.lp-stagger.is-visible > *:nth-child(2) { transition-delay: .06s; }
.lp-stagger.is-visible > *:nth-child(3) { transition-delay: .12s; }
.lp-stagger.is-visible > *:nth-child(4) { transition-delay: .18s; }
.lp-stagger.is-visible > *:nth-child(5) { transition-delay: .24s; }

/* --- 2. Mock "vivo" dell'hero --------------------------------------------- */
/* Chip di visibilità: i due chip stanno nella STESSA cella di griglia, il cambio
   è un cross-fade di sola opacità (nessun salto di layout). */
.lp-mock__chips {
    display: inline-grid;
    justify-self: start;
}

.lp-mock__chip {
    grid-area: 1 / 1;
    transition: opacity .25s var(--lp-ease);
}

.lp-mock__chip--to {
    opacity: 0;
}

.lp-mock__item.is-parents .lp-mock__chip--from { opacity: 0; }
.lp-mock__item.is-parents .lp-mock__chip--to { opacity: 1; }

/* Riga di lista che si spunta da sola: la spunta scala 0.6→1, il testo si barra
   e compare "fatto da Marta". A riposo la riga è identica a una riga da fare. */
.lp-mock__row--live .lp-mock__box {
    transition: background-color .3s var(--lp-ease), border-color .3s var(--lp-ease);
}

.lp-mock__row--live .lp-mock__box svg {
    opacity: 0;
    transform: scale(.6);
    transition: opacity .3s var(--lp-ease), transform .3s var(--lp-ease);
}

.lp-mock__row--live .lp-mock__row-text {
    transition: color .3s var(--lp-ease);
}

.lp-mock__row-meta--live {
    opacity: 0;
    transition: opacity .3s var(--lp-ease);
}

.lp-mock__row--live.is-checked .lp-mock__box {
    background: var(--ink);
    border-color: var(--ink);
    color: #FFFFFF;
}

.lp-mock__row--live.is-checked .lp-mock__box svg {
    opacity: 1;
    transform: scale(1);
}

.lp-mock__row--live.is-checked .lp-mock__row-text {
    color: var(--text-2);
    text-decoration: line-through;
}

.lp-mock__row--live.is-checked .lp-mock__row-meta--live {
    opacity: 1;
}

/* Campanella del promemoria: wiggle di 400 ms. */
.lp-mock__bell.is-ring {
    transform-origin: 50% 15%;
    animation: lp-ring .4s var(--lp-ease);
}

/* --- 3. Illustrazione hero: fluttuazione lenta ---------------------------- */
.lp-float {
    animation: lp-float 6s ease-in-out infinite;
}

/* --- 4. Pannello permessi: rotazione del livello selezionato -------------- */
.lp-perm__row {
    transition: border-color .3s var(--lp-ease), background-color .3s var(--lp-ease);
}

.lp-perm__desc.is-in {
    animation: lp-fade .25s var(--lp-ease);
}

/* --- 5. Micro-interazioni (nav, CTA, card) -------------------------------- */
.lp-nav {
    transition: box-shadow .2s var(--lp-ease);
}

.lp-nav.is-scrolled {
    box-shadow: var(--sh-card);
}

.lp-hero__actions .btn,
.lp-nav__cta,
.lp-band__cta {
    transition: background-color .15s ease, color .15s ease,
                transform .2s var(--lp-ease), box-shadow .2s var(--lp-ease);
}

.lp-hero__actions .btn:hover,
.lp-nav__cta:hover,
.lp-band__cta:hover {
    transform: translateY(-1px);
    box-shadow: var(--lp-sh-hover);
}

.lp-feature {
    transition: transform .2s var(--lp-ease), box-shadow .2s var(--lp-ease);
}

.lp-feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--lp-sh-hover);
}

/* --- Keyframe ------------------------------------------------------------- */
@keyframes lp-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes lp-ring {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-14deg); }
    45% { transform: rotate(12deg); }
    70% { transform: rotate(-6deg); }
}

@keyframes lp-drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-20px, 0, 0); }
}

@keyframes lp-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Chi ha chiesto meno movimento vede la pagina ferma: landing.js non parte
   nemmeno (nessuna classe, nessun timer) e qui si spengono le animazioni CSS. */
@media (prefers-reduced-motion: reduce) {
    .lp *,
    .lp *::before,
    .lp *::after {
        animation: none !important;
        transition: none !important;
    }
}


/* ============================================================================
   Area ADMIN — portale interno (WI-11)
   ----------------------------------------------------------------------------
   Strumento INTERNO, non superficie di prodotto: densità alta, nessuna
   illustrazione, nessuna animazione. Riusa gli stessi token del portale
   (colore, spaziatura, raggi) e le classi esistenti dove servono (.btn,
   .alert, .form__input): qui vive solo ciò che è specifico dell'Admin.
   Regola branding invariata: --teal SOLO come superficie, mai testo su bianco.
   ============================================================================ */

.admin-body {
    background: var(--surface);
}

.admin-container {
    width: 100%;
    max-width: 1200px;   /* più largo del portale: qui si leggono tabelle */
    margin-inline: auto;
    padding-inline: var(--sp-4);
}

/* --- Header ---------------------------------------------------------------- */
.admin-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-header__bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: 52px;
    padding-block: var(--sp-2);
}

.admin-header__spacer {
    flex: 1 1 auto;
}

.admin-header__back {
    font-size: var(--fs-body-sm);
    font-weight: 600;
    white-space: nowrap;
}

.admin-header__form {
    margin: 0;
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--text);
}

.admin-brand__logo {
    border-radius: var(--r-sm);
}

.admin-brand__name {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: var(--fs-body);
}

/* Badge "Admin": superficie teal con testo scuro (contrasto AA), mai teal su bianco. */
.admin-brand__badge {
    display: inline-block;
    padding: 2px var(--sp-2);
    border-radius: var(--r-pill);
    background: var(--teal);
    color: var(--on-brand);
    font-size: var(--fs-micro);
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* --- Navigazione ----------------------------------------------------------- */
.admin-nav {
    border-top: 1px solid var(--border);
    overflow-x: auto;
}

.admin-nav__inner {
    display: flex;
    gap: var(--sp-1);
}

.admin-nav__link {
    padding: var(--sp-3) var(--sp-3);
    border-bottom: 2px solid transparent;
    color: var(--text-2);
    font-size: var(--fs-body-sm);
    font-weight: 600;
    white-space: nowrap;
}

.admin-nav__link:hover {
    color: var(--text);
}

.admin-nav__link--active {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

/* --- Impaginato ------------------------------------------------------------ */
.admin-main {
    padding-block: var(--sp-6) var(--sp-10);
}

.admin-page__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}

.admin-page__title {
    font-size: var(--fs-display);
    margin: 0;
}

.admin-page__breadcrumb {
    margin: 0 0 var(--sp-1);
    font-size: var(--fs-body-sm);
}

.admin-page__meta {
    margin: var(--sp-1) 0 0;
    color: var(--text-2);
    font-size: var(--fs-body-sm);
}

.admin-page__chips {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.admin-section__title {
    font-size: var(--fs-h2);
    margin: var(--sp-8) 0 var(--sp-3);
}

.admin-note {
    margin: var(--sp-2) 0 0;
    color: var(--text-2);
    font-size: var(--fs-body-sm);
    max-width: 80ch;
}

/* Nota di privacy: superficie teal chiara, testo scuro (è informativa, non un warning). */
.admin-privacy-note {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: var(--sp-5);
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--teal-dark);
    border-radius: var(--r-md);
    background: var(--bg);
    color: var(--text);
    font-size: var(--fs-body-sm);
}

/* --- KPI ------------------------------------------------------------------- */
.admin-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--sp-3);
}

.admin-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
}

.admin-kpi__value {
    font-family: var(--font-title);
    font-size: var(--fs-display);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.admin-kpi__label {
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--text-2);
}

.admin-kpi__hint {
    font-size: var(--fs-micro);
    color: var(--text-2);
}

/* --- Filtri ---------------------------------------------------------------- */
.admin-filters {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.admin-filters__field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    min-width: 200px;
}

.admin-filters__label {
    font-size: var(--fs-micro);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-2);
}

/* --- Tabelle --------------------------------------------------------------- */
/* Contenitore con scroll orizzontale: su schermi stretti la tabella scorre,
   la pagina no. */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-body-sm);
}

.admin-table th,
.admin-table td {
    padding: var(--sp-3);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.admin-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg);
    font-size: var(--fs-micro);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-2);
    white-space: nowrap;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover {
    background: var(--bg);
}

.admin-table__muted {
    color: var(--text-2);
}

/* Le date non vanno a capo: "2026-09-16" spezzato su due righe è illeggibile. */
.admin-table__date {
    white-space: nowrap;
}

.admin-table__hint {
    display: block;
    font-size: var(--fs-micro);
    color: var(--text-2);
}

.admin-table__empty {
    padding-block: var(--sp-6);
    text-align: center;
    color: var(--text-2);
}

.admin-table code {
    font-size: var(--fs-micro);
    word-break: break-all;
}

/* --- Liste di fatti (dettaglio) -------------------------------------------- */
.admin-facts {
    display: grid;
    grid-template-columns: minmax(160px, auto) 1fr;
    gap: var(--sp-2) var(--sp-4);
    margin: 0;
    padding: var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    font-size: var(--fs-body-sm);
}

.admin-facts dt {
    font-weight: 600;
    color: var(--text-2);
}

.admin-facts dd {
    margin: 0;
    word-break: break-word;
}

.admin-extlink {
    display: inline-block;
    margin-left: var(--sp-2);
    font-weight: 600;
}

/* --- Chip di stato --------------------------------------------------------- */
.admin-chip {
    display: inline-block;
    padding: 1px var(--sp-2);
    border-radius: var(--r-pill);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: var(--fs-micro);
    font-weight: 700;
    white-space: nowrap;
}

.admin-chip--ok {
    background: #E9F6EF;
    border-color: var(--success);
    color: #1C7A4C;
}

.admin-chip--warn {
    background: #FBF0DC;
    border-color: var(--warning);
    color: #8A5A12;
}

.admin-chip--danger {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--on-danger-soft);
}

/* Pro: superficie teal + testo scuro, come il chip Pro del portale (niente gold). */
.admin-chip--pro {
    background: var(--teal);
    border-color: var(--teal-dark);
    color: var(--on-brand);
}

/* --- Azioni in riga -------------------------------------------------------- */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    white-space: nowrap;
}

.admin-actions__form {
    margin: 0;
}

.admin-actions__danger {
    color: var(--danger);
}

.admin-actions__danger:hover {
    background: var(--danger-soft);
    color: var(--on-danger-soft);
}

/* --- Paginatore ------------------------------------------------------------ */
.admin-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
}

.admin-pager__count {
    margin: 0;
    color: var(--text-2);
    font-size: var(--fs-body-sm);
}

.admin-pager__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.admin-pager__page {
    color: var(--text-2);
    font-size: var(--fs-body-sm);
}

/* ============================================================================
   App — polish (docs/app-web-polish-spec.md)
   ----------------------------------------------------------------------------
   Illustrazioni della home riusate DENTRO l'area /app come SEGNALETICA: stessa
   posizione, stessa scala, nessuna decorazione gratuita. Regole:
   · niente animazioni di ingresso (l'app si usa dieci volte al giorno): restano
     solo gli hover/transizioni già esistenti, 150–200 ms;
   · ogni immagine è opzionale — quando LandingAssets non trova il file la view
     non emette l'<img> e queste regole non hanno nulla da stilare;
   · branding invariato: --teal SOLO come superficie, testo/CTA --ink o --text.
   ============================================================================ */

/* --- Hero di benvenuto della dashboard (spec §2.1) ------------------------- */
.app-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-5);
    background: var(--bg);
    margin-bottom: var(--sp-8);
}

.app-hero__text {
    min-width: 0;
}

.app-hero__greeting {
    margin-bottom: var(--sp-4);
}

/* L'illustrazione è decorativa: si rimpicciolisce prima del testo e non lo comprime.
   Il tetto di 220px è sull'ALTEZZA (l'illustrazione è verticale): a parità di presenza
   la card resta bassa invece di aprire una fascia di vuoto accanto al saluto. */
.app-hero__art {
    flex: 0 1 auto;
    width: auto;
    height: 220px;
    max-width: 34%;
    object-fit: contain;
}

/* Le tre "pill" (famiglia attiva · ruolo · piano) sostituiscono i summary-item. */
.app-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-pill {
    display: inline-flex;
    align-items: baseline;
    gap: var(--sp-2);
    padding: 6px var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    background: var(--surface);
}

.app-pill__label {
    font-size: var(--fs-micro);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-2);
}

.app-pill__value {
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--text);
}

/* Piano Pro: superficie teal + testo scuro (AA), mai teal come testo. */
.app-pill--pro {
    background: var(--teal);
    border-color: transparent;
}

.app-pill--pro .app-pill__label,
.app-pill--pro .app-pill__value {
    color: var(--on-brand);
}

/* --- Griglia delle 5 sezioni: tile + titolo + riga di stato (spec §2.1) ---- */
/* Colonne ESPLICITE per breakpoint invece di `auto-fit, minmax(180px, 1fr)`: con una
   traccia minima fissa la griglia SFONDA il contenitore sotto i ~400px (2×180 + gap >
   350 utili) e il telefono prende lo scroll orizzontale. Con `minmax(0, 1fr)` le colonne
   si stringono sempre, e il numero lo decide il breakpoint.
   Sopra gli 880px le 5 sezioni stanno su UNA riga, come le 5 tab dell'app-shell: il tile
   è segnaletica, e la segnaletica si legge in fila. */
.section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
}

@media (min-width: 560px) {
    .section-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 880px) {
    .section-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.section-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
    min-height: 0;
    padding: var(--sp-4);
}

.section-card__tile {
    display: block;
}

.section-card__tile img {
    display: block;
    width: 72px;
    height: 72px;
}

.section-card__title {
    display: block;
}

.section-card__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2);
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

/* Chip Pro in versione ridotta: nelle card di sezione convive con la riga di stato. */
.chip-pro--sm {
    padding: 1px 6px;
    font-size: 10px;
}

.chip-pro--sm .chip-pro__icon {
    width: 10px;
    height: 10px;
}

/* --- Founder empty: famiglia appena creata (spec §2.1) -------------------- */
.app-founder {
    text-align: center;
    padding-block: var(--sp-10);
}

.app-founder__art {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
    margin: 0 auto var(--sp-5);
}

.app-founder__title {
    margin-bottom: var(--sp-3);
}

.app-founder__body {
    max-width: 480px;
    margin: 0 auto var(--sp-6);
}

/* --- Intestazione di sezione: tile 40px + H1 (spec §2.2) ------------------ */
.app-sectionhead {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 0;
}

.app-sectionhead__tile {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
}

/* Il titolo dentro l'intestazione non porta più il margine di default. */
.app-sectionhead .section__title {
    margin-bottom: 0;
}

/* --- Empty-state illustrati (spec §2.4) ----------------------------------- */
.app-empty {
    max-width: 480px;
    margin-inline: auto;
}

.app-empty__art {
    display: block;
    width: 160px;
    max-width: 100%;
    height: auto;
    margin: 0 auto var(--sp-4);
}

/* --- Mini-paywall con illustrazione Pro (spec §2.5) ----------------------- */
.app-paywall {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
}

.app-paywall__art {
    flex: 0 0 auto;
    width: 120px;
    height: auto;
}

.app-paywall__text {
    min-width: 0;
}

/* --- Banner privacy di Dove siamo (spec §2.5) ----------------------------- */
.app-privacy {
    align-items: center;
    gap: var(--sp-4);
}

.app-privacy__art {
    flex: 0 0 auto;
    width: 96px;
    height: auto;
}

.app-privacy__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-privacy__title {
    font-family: var(--font-title);
    font-size: var(--fs-body);
    font-weight: 600;
}

.app-privacy__meta {
    font-size: var(--fs-micro);
    font-weight: 600;
    letter-spacing: .02em;
    opacity: .85;
}

/* --- Pagine di ritorno / conferma (spec §2.6) ----------------------------- */
.app-proreturn__art {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    margin: 0 auto var(--sp-5);
}

.app-confirm__art {
    display: block;
    width: 140px;
    max-width: 100%;
    height: auto;
    margin: 0 auto var(--sp-4);
}

/* --- Schermi stretti ------------------------------------------------------ */
@media (max-width: 600px) {
    /* L'hero non ha spazio per l'illustrazione: resta il saluto + le pill. */
    .app-hero__art {
        display: none;
    }

    /* App-shell: a ~390px logo + wordmark + switcher + menu utente NON ci stanno in
       riga e spingono l'intera pagina oltre il viewport (scroll orizzontale su TUTTE
       le pagine di /app, non solo qui). Come sulla home, sul telefono resta il solo
       logo: il wordmark sparisce dalla vista ma resta nel DOM per gli screen reader. */
    .appbar .brand__name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .appbar__bar {
        gap: var(--sp-2);
    }

    /* Paywall: immagine sopra il testo, entrambi centrati. */
    .app-paywall {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-3);
    }

    /* Banner privacy: l'illustrazione si riduce per non mangiare la riga di testo. */
    .app-privacy__art {
        width: 64px;
    }
}

/* --- Pro omaggio (dettaglio famiglia) -------------------------------------- */
/* Blocco di scrittura dentro una pagina altrimenti di sola lettura: riquadro
   dedicato, così l'azione non si confonde con i dati che la circondano. */
.admin-comp {
    padding: var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
}

.admin-comp__state {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: 0 0 var(--sp-3);
    font-size: var(--fs-body-sm);
}

.admin-comp__note {
    color: var(--text-2);
}

/* Le due azioni (concedi/aggiorna e revoca) sono form separati ma sulla stessa riga. */
.admin-comp__forms {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-bottom: var(--sp-2);
}

.admin-comp__form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin: 0;
}

.admin-comp__forms > .admin-comp__form:first-child {
    flex: 1 1 420px;
}

.admin-comp__field--wide {
    flex: 1 1 260px;
}

/* --- Grafici (dashboard) --------------------------------------------------- */
/* Tre colonne su desktop, una sola sotto i 900px: i grafici restano leggibili
   invece di comprimersi. SVG generati lato server, nessuna libreria JS. */
.admin-charts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-3);
}

@media (max-width: 900px) {
    .admin-charts {
        grid-template-columns: 1fr;
    }
}

.admin-chart {
    margin: 0;
    padding: var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
}

.admin-chart__title {
    margin-bottom: var(--sp-2);
    font-size: var(--fs-body-sm);
    font-weight: 700;
    color: var(--text);
}

/* Il viewBox fa il lavoro: l'SVG occupa la colonna e mantiene le proporzioni. */
.admin-chart__svg {
    display: block;
    width: 100%;
    height: auto;
}

.admin-chart__empty {
    margin: 0;
    padding-block: var(--sp-8);
    text-align: center;
    color: var(--text-2);
    font-size: var(--fs-body-sm);
}

.admin-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-3);
    margin: var(--sp-2) 0 0;
    padding: 0;
    list-style: none;
    font-size: var(--fs-micro);
    color: var(--text-2);
}

.admin-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-chart__swatch {
    flex: none;
}

.admin-chart__legend-value {
    font-weight: 700;
    color: var(--text);
}

.admin-chart__data {
    margin-top: var(--sp-2);
    font-size: var(--fs-micro);
    color: var(--text-2);
}

.admin-chart__data summary {
    cursor: pointer;
    font-weight: 700;
}

.admin-chart__table {
    width: 100%;
    margin-top: var(--sp-2);
    border-collapse: collapse;
}

.admin-chart__table th,
.admin-chart__table td {
    padding: 2px var(--sp-1);
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-chart__table th[scope="row"],
.admin-chart__table th[scope="col"]:first-child {
    text-align: left;
    font-weight: 600;
}

/* In stampa i grafici restano affiancati e non si spezzano a metà. */
@media print {
    .admin-charts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-chart {
        break-inside: avoid;
    }

    .admin-chart__data[open] summary {
        display: none;
    }
}

/* Avviso privacy accanto al campo nota del Pro omaggio (testo libero). */
.admin-comp__privacy {
    font-size: var(--fs-micro);
    color: var(--text-2);
}

/* --- Pro OFFERTO dall'Admin nell'hero della dashboard ------------------------
   Sotto le pill: "Pro offerto fino al …" e, per l'owner, la CTA d'acquisto (alla
   scadenza la famiglia tornerebbe Free). Il motivo della concessione NON arriva qui. */
.app-hero__offer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
    font-size: var(--fs-body-sm);
    color: var(--text-2);
}

.app-hero__offer-cta {
    margin: 0;
}
