:root {
    --demo-navy: #123b56;
    --demo-blue: #157ca3;
    --demo-blue-soft: #eaf6fb;
    --demo-green: #2f855a;
    --demo-orange: #c96f3b;
    --demo-border: #dfe7ee;
    --demo-bg: #f5f8fb;
    --demo-radius: 16px;
}

.demo-family-body {
    min-height: 100vh;
    background: var(--demo-bg);
    color: #243746;
}

.demo-ribbon {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem .75rem;
    padding: .55rem 1rem;
    background: #fff4d6;
    border-bottom: 1px solid #f2d28c;
    color: #654d12;
    font-size: .82rem;
    text-align: center;
}

.demo-header {
    background: #fff;
    border-bottom: 1px solid var(--demo-border);
}

.demo-header__inner {
    min-height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.demo-brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: var(--demo-navy);
    text-decoration: none;
}

.demo-brand__icon {
    font-size: 1.8rem;
}

.demo-brand strong,
.demo-brand small {
    display: block;
}

.demo-brand small {
    color: #6c7c88;
    font-size: .78rem;
}

.demo-nav {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--demo-border);
    backdrop-filter: blur(10px);
}

.demo-nav__scroll {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
}

.demo-nav__link {
    flex: 0 0 auto;
    padding: .85rem 1rem;
    border-bottom: 3px solid transparent;
    color: #5a6b78;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}

.demo-nav__link:hover,
.demo-nav__link.is-active {
    color: var(--demo-blue);
    border-bottom-color: var(--demo-blue);
}

.demo-main {
    min-height: 68vh;
}

.demo-family-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--demo-radius);
    background: linear-gradient(135deg, #1f6f91 0%, #22a2c7 100%);
    color: #fff;
    box-shadow: 0 .7rem 1.6rem rgba(21, 124, 163, .18);
}

.demo-family-hero h1 {
    margin: .25rem 0;
    font-size: clamp(1.65rem, 4vw, 2.25rem);
    font-weight: 800;
}

.demo-family-hero__hint {
    max-width: 360px;
    padding: .9rem 1rem;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 12px;
    background: rgba(255,255,255,.12);
}

.demo-family-hero__hint strong,
.demo-family-hero__hint span {
    display: block;
}

.demo-eyebrow {
    display: block;
    margin-bottom: .2rem;
    color: inherit;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .75;
}

.demo-stat-card {
    position: relative;
    min-height: 118px;
    padding: 1rem;
    overflow: hidden;
    border: 1px solid var(--demo-border);
    border-left: 4px solid var(--demo-blue);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 .2rem .7rem rgba(18, 38, 63, .06);
    color: #243746;
    transition: transform .18s ease, box-shadow .18s ease;
}

.demo-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .55rem 1.2rem rgba(18, 38, 63, .1);
}

.demo-stat-card--info { border-left-color: #0dcaf0; }
.demo-stat-card--success { border-left-color: #198754; }
.demo-stat-card--warning { border-left-color: #ffc107; }
.demo-stat-card--primary { border-left-color: #0d6efd; }
.demo-stat-card--danger { border-left-color: #dc3545; }

.demo-stat-card__label {
    display: block;
    color: #6c757d;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.demo-stat-card__value {
    margin-top: .15rem;
    font-size: 1.9rem;
    font-weight: 800;
}

.demo-stat-card__icon {
    position: absolute;
    right: .8rem;
    bottom: .55rem;
    font-size: 2.35rem;
    opacity: .55;
}

.demo-panel {
    overflow: hidden;
    border: 1px solid var(--demo-border);
    border-radius: var(--demo-radius);
    background: #fff;
    box-shadow: 0 .2rem .8rem rgba(18, 38, 63, .06);
}

.demo-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--demo-border);
}

.demo-panel__body {
    padding: 1.15rem;
}

.demo-expense-preview {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: #f8fafc;
}

.demo-expense-preview strong,
.demo-expense-preview span {
    display: block;
}

.demo-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    color: #60717d;
    font-size: .82rem;
}

.demo-flow span {
    padding: .38rem .58rem;
    border-radius: 999px;
    background: var(--demo-blue-soft);
}

.demo-child-card {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .85rem;
    border: 1px solid var(--demo-border);
    border-left: 4px solid var(--child-accent);
    border-radius: 12px;
}

.demo-child-card__icon {
    font-size: 1.7rem;
}

.demo-child-card strong,
.demo-child-card span {
    display: block;
}

.demo-child-card span {
    color: #75848f;
    font-size: .84rem;
}

.demo-clean-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.demo-clean-list li {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .75rem 0;
    border-bottom: 1px solid #eef2f5;
}

.demo-clean-list li:last-child {
    border-bottom: 0;
}

.demo-clean-list strong,
.demo-clean-list span {
    display: block;
}

.demo-clean-list span:not(.demo-date-chip) {
    color: #7b8993;
    font-size: .78rem;
}

.demo-date-chip {
    min-width: 82px;
    padding: .35rem .45rem;
    border-radius: 8px;
    background: var(--demo-blue-soft);
    color: var(--demo-blue);
    font-size: .75rem;
    font-weight: 800;
    text-align: center;
}

.demo-info-alert {
    border: 1px solid #b9dfed;
    background: #eef9fd;
}

.demo-summary-card {
    height: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid var(--demo-border);
    border-radius: 14px;
    background: #fff;
}

.demo-summary-card span,
.demo-summary-card strong {
    display: block;
}

.demo-summary-card span {
    color: #76858f;
    font-size: .82rem;
}

.demo-summary-card strong {
    margin-top: .2rem;
    color: #198754;
    font-size: 1.55rem;
}

.demo-summary-card--action strong {
    color: var(--demo-orange);
}

.demo-expense-table thead th {
    padding: .85rem;
    background: #183f59;
    color: #fff;
    border: 0;
    font-size: .78rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.demo-expense-table tbody td {
    padding: .9rem;
    border-color: #e8edf1;
}

.demo-expense-table tr[data-demo-expense] {
    transition: box-shadow .2s ease, background .2s ease;
}

.demo-expense-table tr.is-saving {
    box-shadow: inset 4px 0 0 #ffc107;
    background: #fffdf4;
}

.demo-expense-table tr.is-saved {
    box-shadow: inset 4px 0 0 #198754;
    background: #f6fff9;
}

.demo-expense-table tr.is-rejected {
    box-shadow: inset 4px 0 0 #dc3545;
    background: #fff7f7;
}

.demo-status-badge {
    padding: .5em .75em;
    font-weight: 700;
}

.demo-status--pending { background: #ffc107; color: #2b2515; }
.demo-status--accepted { background: #0d6efd; color: #fff; }
.demo-status--partial { background: #0dcaf0; color: #18313e; }
.demo-status--paid { background: #198754; color: #fff; }
.demo-status--rejected { background: #dc3545; color: #fff; }

.demo-expense-actions,
.demo-payment-actions {
    min-width: 175px;
}

.demo-partial-payment {
    max-width: 290px;
    padding: .7rem;
    border: 1px solid #b8dfc8;
    border-radius: 10px;
    background: #f6fff9;
}

.demo-paid-state .badge {
    white-space: normal;
    line-height: 1.35;
}

.demo-save-state {
    min-height: 1.25rem;
    font-size: .78rem;
    font-weight: 700;
}

.demo-save-state.is-saving { color: #997404; }
.demo-save-state.is-saved { color: #198754; }
.demo-save-state.is-error { color: #dc3545; }

.demo-expense-mobile-list {
    display: grid;
    gap: .85rem;
    padding: .85rem;
}

.demo-expense-mobile-card {
    padding: 1rem;
    border: 1px solid var(--demo-border);
    border-left: 4px solid var(--demo-blue);
    border-radius: 14px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.demo-expense-mobile-card.is-saving { border-left-color: #ffc107; }
.demo-expense-mobile-card.is-saved { border-left-color: #198754; }
.demo-expense-mobile-card.is-rejected { border-left-color: #dc3545; }

.demo-conversion-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid #b8dfc8;
    border-radius: var(--demo-radius);
    background: #f2fbf5;
}

.demo-placeholder {
    max-width: 720px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid var(--demo-border);
    border-radius: var(--demo-radius);
    background: #fff;
    text-align: center;
    box-shadow: 0 .4rem 1.2rem rgba(18, 38, 63, .07);
}

.demo-placeholder__icon {
    margin-bottom: .5rem;
    font-size: 3.4rem;
}

.demo-footer {
    padding: 1.25rem 0;
    border-top: 1px solid var(--demo-border);
    background: #fff;
    color: #6d7a84;
    font-size: .82rem;
}

.demo-footer a {
    color: var(--demo-blue);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 767.98px) {
    .demo-family-hero,
    .demo-conversion-card {
        align-items: stretch;
        flex-direction: column;
    }

    .demo-family-hero__hint {
        max-width: none;
    }

    .demo-expense-preview {
        flex-direction: column;
    }

    .demo-expense-preview .text-end {
        text-align: left !important;
    }
}


/* =========================================================
   DEMO CALENDARIO
   ========================================================= */

.demo-calendar-hero {
    background: linear-gradient(135deg, #1d4f6e 0%, #157ca3 100%);
}

.demo-calendar-tip {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid var(--demo-border);
    border-left: 4px solid var(--demo-blue);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 .2rem .7rem rgba(18, 38, 63, .05);
}

.demo-calendar-tip--professional {
    border-left-color: #b91c1c;
}

.demo-calendar-tip__icon {
    flex: 0 0 auto;
    font-size: 1.7rem;
}

.demo-calendar-tip__label,
.demo-calendar-tip strong,
.demo-calendar-tip small {
    display: block;
}

.demo-calendar-tip__label {
    margin-bottom: .1rem;
    color: #6c7b86;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.demo-calendar-tip small {
    margin-top: .2rem;
    color: #788791;
}

.demo-calendar-panel {
    transition: border-color .2s ease, box-shadow .2s ease;
}

.demo-calendar-panel.is-saving {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, .15);
}

.demo-calendar-panel.is-saved {
    border-color: #198754;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, .12);
}

.demo-calendar-panel.is-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, .12);
}

.demo-calendar-panel__header {
    flex-wrap: wrap;
}

.demo-calendar-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
    margin-left: auto;
}

.demo-calendar-body {
    padding: .85rem;
}

.demo-calendar-panel .fc {
    --fc-border-color: #e0e7ed;
    --fc-button-bg-color: #157ca3;
    --fc-button-border-color: #157ca3;
    --fc-button-hover-bg-color: #116987;
    --fc-button-hover-border-color: #116987;
    --fc-button-active-bg-color: #123b56;
    --fc-button-active-border-color: #123b56;
    --fc-today-bg-color: rgba(21, 124, 163, .08);
}

.demo-calendar-panel .fc-toolbar-title {
    color: var(--demo-navy);
    font-weight: 800;
}

.demo-calendar-panel .fc-event {
    border-radius: 5px;
    cursor: pointer;
}

.demo-calendar-panel .fc-daygrid-event {
    padding: 1px 3px;
}

.demo-calendar-panel .fc-list-event:hover td {
    background: #f1f7fa;
}

.demo-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1rem;
}

.demo-calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #526470;
    font-size: .83rem;
    font-weight: 700;
}

.demo-calendar-legend i {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    background: var(--legend-color);
}

.demo-appointment-modal__header {
    color: #fff;
    background: linear-gradient(135deg, #7f1d1d, #b91c1c);
}

.demo-simulation-response {
    padding: 1rem;
    border: 1px dashed #c7d0d8;
    border-radius: 12px;
    background: #f8fafc;
}

#demoCalendarSaveState.is-saving {
    color: #997404;
}

#demoCalendarSaveState.is-saved {
    color: #198754;
}

#demoCalendarSaveState.is-error {
    color: #dc3545;
}

@media (max-width: 767.98px) {
    .demo-calendar-panel__header {
        align-items: flex-start;
    }

    .demo-calendar-toolbar-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    #demoCalendarSaveState {
        width: 100%;
        min-height: 1.2rem;
    }

    .demo-calendar-panel .fc-header-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .5rem;
        align-items: center;
        margin-bottom: .75rem;
    }

    .demo-calendar-panel .fc-toolbar-chunk:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
    }

    .demo-calendar-panel .fc-toolbar-chunk:first-child {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }

    .demo-calendar-panel .fc-toolbar-chunk:last-child {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
    }

    .demo-calendar-panel .fc-toolbar-title {
        font-size: 1.15rem;
    }

    .demo-calendar-panel .fc-button {
        padding: .36rem .45rem;
        font-size: .72rem;
    }

    .demo-calendar-panel .fc-daygrid-day-frame {
        min-height: 4rem;
    }

    .demo-calendar-panel .fc-daygrid-event {
        font-size: .66rem;
        line-height: 1.15;
    }
}

/* =========================================================
   DEMO DOCUMENTI
   ========================================================= */

.demo-summary-card--private strong {
    color: #6f42c1;
}

.demo-document-search {
    width: min(100%, 340px);
}

.demo-documents-panel {
    transition: border-color .2s ease, box-shadow .2s ease;
}

.demo-documents-panel.is-saving {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, .15);
}

.demo-documents-panel.is-saved {
    border-color: #198754;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, .12);
}

.demo-document-list {
    display: grid;
}

.demo-document-item {
    --document-accent: var(--demo-blue);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #e9eef2;
    border-left: 3px solid var(--document-accent);
    background: #fff;
}

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

.demo-document-item--private {
    --document-accent: #6f42c1;
}

.demo-document-item--shared {
    --document-accent: #0d6efd;
}

.demo-document-status--signed {
    --document-accent: #198754;
}

.demo-document-status--locked {
    --document-accent: #fd7e14;
}

.demo-document-item__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #f5f8fb;
    font-size: 1.55rem;
}

.demo-document-item__content {
    min-width: 0;
}

.demo-document-item__title {
    color: #243746;
    overflow-wrap: anywhere;
}

.demo-document-item__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
}

.demo-document-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: #6b7a85;
}

.demo-document-empty strong,
.demo-document-empty span {
    display: block;
}

.demo-document-modal__header {
    color: #fff;
    background: linear-gradient(135deg, #123b56, #157ca3);
}

.demo-pdf-preview {
    overflow: hidden;
    border: 1px solid #d7e0e7;
    border-radius: 12px;
    background: #e9eef2;
}

.demo-pdf-preview__toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem .85rem;
    background: #213b4b;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
}

.demo-pdf-preview__page {
    min-height: 430px;
    width: min(92%, 560px);
    margin: 1.5rem auto;
    padding: 2.4rem;
    border: 1px solid #d8dde2;
    background: #fff;
    box-shadow: 0 .5rem 1.3rem rgba(18, 38, 63, .12);
}

.demo-pdf-preview__logo {
    margin-bottom: 2rem;
    color: var(--demo-blue);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.demo-pdf-preview__page h3 {
    margin-bottom: 1rem;
    color: #1e3545;
    font-size: 1.35rem;
}

.demo-pdf-preview__page p {
    min-height: 5rem;
    color: #52636f;
    line-height: 1.65;
}

.demo-pdf-line {
    height: 8px;
    margin: .8rem 0;
    border-radius: 999px;
    background: #e1e7eb;
}

.demo-pdf-line.w-90 { width: 90%; }
.demo-pdf-line.w-60 { width: 60%; }

.demo-pdf-signature {
    margin-top: 3.5rem;
    padding-top: .8rem;
    border-top: 1px solid #dbe2e7;
    color: #85919a;
    font-size: .75rem;
    font-style: italic;
    text-align: right;
}

.demo-document-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}

.demo-document-detail-grid > div {
    min-width: 0;
    padding: .8rem;
    border: 1px solid #e4e9ed;
    border-radius: 10px;
    background: #f9fbfc;
}

.demo-document-detail-grid span,
.demo-document-detail-grid strong {
    display: block;
}

.demo-document-detail-grid span {
    margin-bottom: .2rem;
    color: #7a8993;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.demo-document-version-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .85rem 0;
    border-bottom: 1px solid #e9eef2;
}

.demo-document-version-row:last-child {
    border-bottom: 0;
}

.demo-document-version-badge {
    min-width: 42px;
    padding: .35rem .45rem;
    border-radius: 8px;
    background: var(--demo-blue-soft);
    color: var(--demo-blue);
    font-size: .78rem;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 767.98px) {
    .demo-document-search {
        width: 100%;
    }

    .demo-document-item {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: flex-start;
        padding: .9rem;
    }

    .demo-document-item__actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .demo-document-item__actions .btn {
        flex: 1 1 140px;
    }

    .demo-pdf-preview__page {
        min-height: 330px;
        margin: .8rem auto;
        padding: 1.4rem;
    }

    .demo-document-detail-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   STEP 4 - CENTRO NOTIFICHE DEMO
   ========================================================= */
.demo-nav__link [data-demo-notification-badge] {
    min-width: 1.45rem;
    font-size: .68rem;
}

.demo-notification-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.demo-notification-list {
    display: grid;
    gap: .8rem;
}

.demo-notification-item {
    --notification-accent: #157ca3;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .9rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--notification-accent);
    border-radius: .85rem;
    background: #fff;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.demo-notification-item.is-unread {
    background: #f8fbff;
    box-shadow: 0 .18rem .75rem rgba(21, 124, 163, .08);
}

.demo-notification-item:hover {
    transform: translateY(-1px);
}

.demo-notification-item--expense { --notification-accent: #198754; }
.demo-notification-item--calendar { --notification-accent: #0d6efd; }
.demo-notification-item--document { --notification-accent: #f59e0b; }
.demo-notification-item--system { --notification-accent: #6c757d; }

.demo-notification-icon {
    width: 2.65rem;
    height: 2.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .75rem;
    background: #f3f4f6;
    font-size: 1.25rem;
}

.demo-notification-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    margin-bottom: .3rem;
}

.demo-notification-title {
    font-weight: 700;
    color: #1f2937;
}

.demo-notification-message {
    color: #4b5563;
    line-height: 1.45;
}

.demo-notification-meta {
    margin-top: .45rem;
    color: #6b7280;
    font-size: .78rem;
}

.demo-notification-actions {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-width: 7.2rem;
}

.demo-notification-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: .85rem;
    background: #f8fafc;
}

@media (max-width: 767.98px) {
    .demo-notification-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .demo-notification-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        min-width: 0;
    }

    .demo-notification-actions .btn {
        flex: 1 1 0;
    }
}


/* =========================================================
   STEP 5 - CHAT FAMIGLIA DEMO
   ========================================================= */
.demo-nav__link [data-demo-chat-badge] {
    min-width: 1.45rem;
    font-size: .68rem;
}

.demo-chat-panel {
    overflow: hidden;
}

.demo-chat-header {
    border-bottom: 1px solid #e8edf1;
}

.demo-chat-person {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.demo-chat-person strong,
.demo-chat-person span {
    display: block;
}

.demo-chat-person span {
    color: #75838d;
    font-size: .78rem;
}

.demo-chat-avatar {
    width: 2.55rem;
    height: 2.55rem;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
}

.demo-chat-avatar--elena {
    background: #d7edf0;
    color: #176b73;
}

.demo-chat-avatar--marco {
    background: #dfe8f5;
    color: #264d7a;
}

.demo-chat-avatar--group {
    width: 2.9rem;
    height: 2.9rem;
    background: #edf6f8;
    color: var(--demo-blue);
    font-size: 1.25rem;
}

.demo-chat-stream {
    height: min(58vh, 560px);
    min-height: 410px;
    overflow-y: auto;
    padding: 1.2rem;
    background:
        radial-gradient(circle at 10% 10%, rgba(21, 124, 163, .045), transparent 25%),
        linear-gradient(#f8fafb, #f4f7f9);
}

.demo-chat-message {
    display: flex;
    align-items: flex-end;
    gap: .55rem;
    margin-bottom: .9rem;
}

.demo-chat-message.is-outgoing {
    justify-content: flex-end;
}

.demo-chat-message.is-highlighted .demo-chat-bubble {
    box-shadow: 0 0 0 3px rgba(255, 193, 7, .35), 0 .3rem 1rem rgba(18, 38, 63, .1);
}

.demo-chat-bubble {
    max-width: min(76%, 680px);
    padding: .75rem .85rem;
    border: 1px solid #e1e7eb;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 .15rem .5rem rgba(18, 38, 63, .06);
}

.demo-chat-message.is-outgoing .demo-chat-bubble {
    border-color: #cfe6dc;
    background: #eaf7f0;
}

.demo-chat-bubble__top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .3rem;
    color: #65737d;
    font-size: .72rem;
}

.demo-chat-bubble__top strong {
    color: #263943;
}

.demo-chat-text {
    white-space: pre-wrap;
    color: #243640;
    line-height: 1.45;
}

.demo-chat-inline-reply {
    display: grid;
    gap: .15rem;
    margin-bottom: .55rem;
    padding: .5rem .6rem;
    border-left: 3px solid var(--demo-blue);
    border-radius: .4rem;
    background: rgba(21, 124, 163, .07);
    color: #586973;
    font-size: .76rem;
}

.demo-chat-inline-reply strong {
    color: var(--demo-blue);
}

.demo-chat-file-card {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .6rem;
    padding: .6rem .7rem;
    border: 1px solid #dce4e9;
    border-radius: .65rem;
    background: rgba(255,255,255,.7);
}

.demo-chat-file-card > span {
    font-size: 1.2rem;
}

.demo-chat-file-card strong,
.demo-chat-file-card div > span {
    display: block;
}

.demo-chat-file-card div > span {
    margin-top: .1rem;
    color: #75838d;
    font-size: .7rem;
}

.demo-chat-context-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .6rem;
    padding: .28rem .5rem;
    border: 1px solid #cfe1ea;
    border-radius: 999px;
    background: #f5fbfd;
    color: #176f91;
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
}

.demo-chat-context-chip:hover {
    background: #eaf6fa;
    color: #125a75;
}

.demo-chat-message-actions {
    margin-top: .45rem;
    text-align: right;
    font-size: .75rem;
}

.demo-chat-message-actions .btn {
    font-size: .72rem;
    text-decoration: none;
}

.demo-chat-typing {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .65rem 1.2rem;
    border-top: 1px solid #edf1f4;
    background: #f8fafb;
    color: #667680;
    font-size: .8rem;
}

.demo-chat-typing .demo-chat-avatar {
    width: 1.9rem;
    height: 1.9rem;
    font-size: .72rem;
}

.demo-chat-dots {
    display: inline-block;
    min-width: 1.2rem;
    letter-spacing: .08em;
}

.demo-chat-composer {
    padding: 1rem;
    border-top: 1px solid #e6ecef;
    background: #fff;
}

.demo-chat-reply-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: .7rem;
    padding: .65rem .75rem;
    border-left: 3px solid var(--demo-blue);
    border-radius: .55rem;
    background: #f4fafc;
}

.demo-chat-reply-box strong,
.demo-chat-reply-box span {
    display: block;
}

.demo-chat-reply-box span {
    margin-top: .15rem;
    color: #687781;
    font-size: .76rem;
}

.demo-chat-context-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .7rem;
}

.demo-chat-context-row .form-select {
    width: min(100%, 430px);
}

.demo-chat-attachment {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    margin-bottom: .7rem;
    padding: .55rem .7rem;
    border: 1px solid #dfe6ea;
    border-radius: .55rem;
    background: #f8fafb;
    font-size: .78rem;
}

.demo-chat-attachment small {
    color: #7b8993;
}

.demo-chat-compose-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .55rem;
    align-items: stretch;
}

.demo-chat-compose-row textarea {
    resize: none;
}

.demo-notification-item--chat { --notification-accent: #6f42c1; }

@media (max-width: 767.98px) {
    .demo-chat-stream {
        height: 52vh;
        min-height: 360px;
        padding: .85rem .65rem;
    }

    .demo-chat-message {
        gap: .35rem;
    }

    .demo-chat-message > .demo-chat-avatar {
        width: 2rem;
        height: 2rem;
        font-size: .72rem;
    }

    .demo-chat-bubble {
        max-width: 84%;
        padding: .65rem .7rem;
    }

    .demo-chat-context-row {
        align-items: stretch;
        flex-direction: column;
        gap: .3rem;
    }

    .demo-chat-context-row .form-select {
        width: 100%;
    }

    .demo-chat-compose-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .demo-chat-compose-row [data-demo-chat-send] {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   DEMO MANTENIMENTO
   ========================================================= */
.demo-support-perspective {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid #dfe7ec;
    border-left: 4px solid var(--demo-blue);
    border-radius: .85rem;
    background: #fff;
    box-shadow: 0 .2rem .8rem rgba(18, 38, 63, .05);
}

.demo-support-flow-note {
    display: flex;
    gap: .8rem;
    padding: .9rem 1rem;
    border: 1px solid #d8e8ef;
    border-radius: .75rem;
    background: #f5fbfd;
    color: #314a57;
}
.demo-support-flow-note > span { font-size: 1.35rem; }
.demo-support-flow-note p { margin-top: .2rem; font-size: .85rem; color: #647680; }

.demo-support-installments { display: grid; }
.demo-support-installment {
    display: grid;
    grid-template-columns: minmax(170px, 1.4fr) repeat(4, minmax(100px, .7fr)) minmax(150px, auto);
    gap: .8rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #edf1f4;
}
.demo-support-installment:last-child { border-bottom: 0; }
.demo-support-installment.is-interactive {
    background: linear-gradient(90deg, rgba(183,121,31,.06), transparent 45%);
    box-shadow: inset 3px 0 0 #b7791f;
}
.demo-support-installment__period strong,
.demo-support-installment__period small { display: block; }
.demo-support-installment__period small { margin-top: .18rem; color: #71808a; }
.demo-support-installment__action { text-align: right; }
.demo-mobile-label { display: block; margin-bottom: .15rem; color: #7a8790; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }

.demo-support-payment-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}
.demo-support-payment-summary > div {
    padding: .8rem;
    border: 1px solid #e0e7eb;
    border-radius: .7rem;
    background: #f8fafb;
}
.demo-support-payment-summary span,
.demo-support-payment-summary strong { display: block; }
.demo-support-payment-summary span { color: #73818a; font-size: .72rem; }
.demo-support-payment-summary strong { margin-top: .15rem; font-size: 1.05rem; }

.demo-support-payment-list { display: grid; gap: .75rem; }
.demo-support-payment-item {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) minmax(240px,.8fr);
    gap: .85rem;
    align-items: center;
    padding: .9rem;
    border: 1px solid #dfe7eb;
    border-left: 3px solid #198754;
    border-radius: .75rem;
    background: #fff;
}
.demo-support-payment-item__number {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #eaf7f0;
    color: #157347;
    font-weight: 800;
}
.demo-support-proof-card {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .7rem;
    border: 1px solid #e0e6ea;
    border-radius: .6rem;
    background: #f8fafb;
}
.demo-support-proof-card > span { font-size: 1.25rem; }
.demo-support-proof-card strong,
.demo-support-proof-card small { display: block; overflow-wrap: anywhere; }
.demo-support-proof-card small { margin-top: .1rem; color: #74818a; }
.demo-support-empty { padding: 2rem 1rem; text-align: center; color: #61727c; }
.demo-notification-item--support { --notification-accent: #b7791f; }

@media (max-width: 991.98px) {
    .demo-support-installment {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
    .demo-support-installment__period,
    .demo-support-installment__action { grid-column: 1 / -1; }
    .demo-support-installment__action { text-align: left; }
}

@media (max-width: 767.98px) {
    .demo-support-perspective { align-items: stretch; flex-direction: column; }
    .demo-support-perspective .btn-group { width: 100%; }
    .demo-support-perspective .btn { flex: 1; }
    .demo-support-payment-summary { grid-template-columns: 1fr; }
    .demo-support-payment-item { grid-template-columns: auto minmax(0,1fr); }
    .demo-support-proof-card { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   Tour guidato + menu ☰ Simula Demo Famiglia
   -------------------------------------------------------------------------- */
.demo-simulate-nav-button {
    appearance: none;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    background: #eef8f3;
    color: #146c43;
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}

.demo-simulate-nav-button:hover,
.demo-simulate-nav-button:focus {
    color: #146c43;
    border-bottom-color: #198754;
    background: #e2f4ea;
    outline: 0;
}

.demo-simulation-menu {
    width: min(430px, 94vw);
}

.demo-simulate-section__title {
    margin-bottom: .45rem;
    color: #6c757d;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.demo-simulate-link {
    display: grid;
    grid-template-columns: 1.7rem minmax(0, 1fr) 1.5rem;
    width: 100%;
    align-items: start;
    gap: .75rem;
    padding: .75rem .7rem;
    border: 0;
    border-radius: .7rem;
    background: transparent;
    color: var(--demo-navy);
    text-align: left;
    transition: background-color .15s ease, transform .15s ease;
}

.demo-simulate-link:hover,
.demo-simulate-link:focus {
    background: var(--demo-blue-soft);
    transform: translateX(2px);
    outline: 0;
}

.demo-simulate-link > span:first-child {
    font-size: 1.15rem;
    line-height: 1.4;
    text-align: center;
}

.demo-simulate-link > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.demo-simulate-link strong {
    font-size: .94rem;
}

.demo-simulate-link small {
    margin-top: .08rem;
    color: #6c757d;
    line-height: 1.35;
}

.demo-simulate-status {
    display: inline-flex;
    width: 1.35rem;
    height: 1.35rem;
    align-items: center;
    justify-content: center;
    align-self: center;
    border-radius: 50%;
    color: #198754;
    font-size: .8rem;
    font-weight: 800;
}

.demo-simulate-status.is-complete {
    border: 1px solid #badbcc;
    background: #d1e7dd;
}

.demo-tour-mask {
    position: fixed;
    z-index: 12000;
    background: rgba(12, 35, 30, .66);
    pointer-events: none;
}

.demo-tour-surface {
    z-index: 12001 !important;
}

.demo-tour-target {
    position: relative !important;
    z-index: 12002 !important;
    border-radius: .5rem;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, .98),
        0 0 0 8px rgba(25, 135, 84, .58) !important;
    animation: demoFamilyTourPulse 1.7s ease-in-out infinite;
    pointer-events: auto !important;
}

.demo-tour-popover {
    position: fixed;
    z-index: 12003;
    width: min(390px, calc(100vw - 24px));
    padding: 1rem;
    border: 1px solid rgba(25, 135, 84, .25);
    border-radius: .9rem;
    background: #fff;
    color: #16202a;
    box-shadow: 0 18px 56px rgba(0, 0, 0, .28);
    pointer-events: auto;
}

.demo-tour-popover__top,
.demo-tour-popover__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.demo-tour-popover__eyebrow {
    color: #198754;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.demo-tour-popover__exit {
    padding: 0;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: .78rem;
    text-decoration: underline;
}

.demo-tour-popover__title {
    margin-top: .7rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.demo-tour-popover__text {
    margin-top: .45rem;
    color: #4a5661;
    line-height: 1.48;
}

.demo-tour-popover__transition {
    display: grid;
    gap: .45rem;
    margin-top: .85rem;
    padding: .7rem .8rem;
    border: 1px solid rgba(25, 135, 84, .22);
    border-radius: .6rem;
    background: rgba(25, 135, 84, .07);
    color: #146c43;
    font-size: .82rem;
    font-weight: 700;
}

.demo-tour-popover__transition-track {
    display: block;
    height: .32rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(25, 135, 84, .15);
}

.demo-tour-popover__transition-progress {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #198754, #157ca3);
}

.demo-tour-popover__transition-progress.is-running {
    animation: demoFamilyTourTransitionProgress linear forwards;
}

.demo-tour-popover.is-processing .demo-tour-popover__hint {
    opacity: .55;
}

.demo-tour-popover__footer {
    margin-top: 1rem;
    padding-top: .8rem;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: .78rem;
}

.demo-tour-popover__hint {
    color: #198754;
    font-weight: 600;
}

.demo-simula-intro {
    position: fixed;
    z-index: 11950;
    display: flex;
    width: min(370px, calc(100vw - 24px));
    flex-direction: column;
    gap: .35rem;
    padding: 1rem 2.2rem 1rem 1rem;
    border: 1px solid rgba(25, 135, 84, .3);
    border-radius: .85rem;
    background: #fff;
    color: var(--demo-navy);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .2);
}

.demo-simula-intro strong {
    color: #198754;
    font-size: 1rem;
}

.demo-simula-intro span {
    color: #4f5b66;
    font-size: .88rem;
    line-height: 1.45;
}

.demo-simula-intro__close {
    position: absolute;
    top: .45rem;
    right: .55rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 1.25rem;
    line-height: 1;
}

@keyframes demoFamilyTourPulse {
    0%, 100% { transform: translateZ(0) scale(1); }
    50% { transform: translateZ(0) scale(1.015); }
}

@keyframes demoFamilyTourTransitionProgress {
    from { width: 0; }
    to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .demo-tour-popover__transition-progress.is-running {
        animation-duration: .2s !important;
    }
}

@media (max-width: 575.98px) {
    .demo-tour-popover {
        width: calc(100vw - 20px);
        padding: .9rem;
    }

    .demo-tour-popover__footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .demo-simula-intro {
        right: 10px !important;
        left: auto !important;
    }

    .demo-simulation-menu {
        width: 94vw;
    }
}

/* --------------------------------------------------------------------------
   Sidebar compatta demo famiglia - allineata alla nuova navigazione dell'app
   -------------------------------------------------------------------------- */
.demo-family-sidebar {
    position: fixed;
    z-index: 1035;
    top: 108px;
    bottom: 0;
    left: 0;
    width: 250px;
    overflow-y: auto;
    padding: 1rem .8rem 1.5rem;
    background: var(--demo-navy);
    color: #fff;
    box-shadow: 4px 0 18px rgba(18, 59, 86, .08);
}

.demo-family-sidebar__mobile-head {
    display: none;
}

.demo-family-sidebar__eyebrow {
    color: #9fc2d1;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.demo-family-menu {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.demo-family-menu__link,
.demo-family-menu__button,
.demo-family-menu__sublink {
    width: 100%;
    border: 0;
    border-radius: .58rem;
    background: transparent;
    color: #e7f0f4;
    text-decoration: none;
    text-align: left;
    transition: background .16s ease, color .16s ease;
}

.demo-family-menu__link,
.demo-family-menu__button {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .75rem;
    font-size: .9rem;
    font-weight: 700;
}

.demo-family-menu__button {
    justify-content: space-between;
}

.demo-family-menu__link:hover,
.demo-family-menu__button:hover,
.demo-family-menu__sublink:hover,
.demo-family-menu__link.is-active,
.demo-family-menu__sublink.is-active {
    background: #fff;
    color: var(--demo-navy);
}

.demo-family-menu__button[aria-expanded="true"] {
    background: rgba(255,255,255,.10);
    color: #fff;
}

.demo-family-menu__chevron {
    transition: transform .18s ease;
}

.demo-family-menu__button[aria-expanded="true"] .demo-family-menu__chevron {
    transform: rotate(180deg);
}

.demo-family-submenu {
    display: none;
    gap: .16rem;
    padding: .1rem 0 .35rem .55rem;
}

.demo-family-submenu.is-open {
    display: grid;
}

.demo-family-menu__sublink {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .52rem .7rem .52rem 1rem;
    color: #c8dce5;
    font-size: .84rem;
}

.demo-family-menu__divider {
    height: 1px;
    margin: .6rem .45rem;
    background: rgba(255,255,255,.15);
}

.demo-family-menu__action {
    cursor: pointer;
}

.demo-family-sidebar-toggle {
    display: none;
}

.demo-family-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1030;
    border: 0;
    background: rgba(12, 30, 43, .48);
}

.demo-main,
.demo-footer {
    margin-left: 250px;
}

/* --------------------------------------------------------------------------
   Lettere / allegati demo famiglia
   -------------------------------------------------------------------------- */
.demo-letter-update-badge {
    background: #e8f7ee;
    color: #176b43;
    border: 1px solid #bfe7cf;
}

.demo-letter-update-alert {
    background: linear-gradient(135deg, #f7fff9 0%, #eef8ff 100%);
    color: #29424f;
}

.demo-letter-update-icon {
    display: inline-flex;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: .7rem;
    background: #dff4e7;
    font-size: 1.2rem;
}

.letter-type-card {
    border: 1px solid var(--demo-border);
    border-radius: .8rem;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.letter-type-card:hover,
.letter-type-card.selected {
    border-color: var(--demo-blue);
    box-shadow: 0 0 0 .16rem rgba(21,124,163,.12);
    transform: translateY(-1px);
}

.letter-type-icon {
    margin-bottom: .45rem;
    font-size: 1.65rem;
}

.demo-letter-attachment-shell {
    padding: 1rem;
    border: 1px solid #d9e4eb;
    border-radius: .85rem;
    background: #fbfdff;
}

.demo-letter-attachment-dropzone {
    padding: .9rem;
    border: 1px dashed #9eb8c8;
    border-radius: .75rem;
    background: #fff;
}

.demo-letter-attachment-item {
    display: grid;
    grid-template-columns: 2.6rem minmax(0,1fr);
    gap: .8rem;
    padding: .85rem;
    border: 1px solid var(--demo-border);
    border-radius: .75rem;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.demo-letter-attachment-item.is-preparing {
    border-color: #ffc107;
    box-shadow: 0 0 0 .13rem rgba(255,193,7,.12);
}

.demo-letter-attachment-item.is-ready {
    border-color: #77bc95;
    box-shadow: 0 0 0 .13rem rgba(25,135,84,.08);
}

.demo-letter-attachment-icon {
    display: flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: .65rem;
    background: #edf6fa;
    font-size: 1.25rem;
}

.demo-letter-attachment-body {
    min-width: 0;
}

.demo-letter-preview-attachments {
    margin-top: 1.5rem;
}

.demo-letter-detail-attachment {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    padding: .7rem;
    border: 1px solid #e2e9ee;
    border-radius: .65rem;
    background: #fbfdff;
}

.demo-letter-detail-attachment strong,
.demo-letter-detail-attachment small {
    display: block;
    overflow-wrap: anywhere;
}

.demo-letter-detail-attachment small {
    margin-top: .12rem;
    color: #6c757d;
}

.demo-letter-detail-file-icon {
    font-size: 1.25rem;
}

.demo-letter-page-footer {
    font-size: .72rem;
}

@media (max-width: 991.98px) {
    .demo-family-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        gap: .25rem;
    }

    .demo-family-sidebar {
        top: 0;
        z-index: 1055;
        width: min(310px, 88vw);
        height: 100vh;
        padding: .9rem;
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    .demo-family-sidebar.is-open {
        transform: translateX(0);
    }

    .demo-family-sidebar__mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin: -.1rem -.1rem .8rem;
        padding: .75rem .6rem .9rem;
        border-bottom: 1px solid rgba(255,255,255,.15);
    }

    .demo-family-sidebar-backdrop.is-visible {
        display: block;
    }

    .demo-main,
    .demo-footer {
        margin-left: 0;
    }
}

@media (min-width: 992px) {
    .demo-family-sidebar-toggle {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   Sentenza, chiusura pratica e nuova richiesta di assistenza
   -------------------------------------------------------------------------- */
.demo-family-closure-banner {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.15rem;
    border: 1px solid #75b798;
    border-radius: 1rem;
    background: linear-gradient(135deg, #198754, #157ca3);
    color: #fff;
    box-shadow: 0 .6rem 1.5rem rgba(21,124,163,.16);
}

.demo-family-closure-banner:hover {
    color: #fff;
    transform: translateY(-1px);
}

.demo-family-closure-banner__icon {
    display: grid;
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border-radius: .85rem;
    background: rgba(255,255,255,.18);
    font-size: 1.45rem;
}

.demo-family-closure-banner > span:nth-child(2) {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
}

.demo-family-closure-banner small {
    color: rgba(255,255,255,.84);
}

.demo-family-closure-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid #75b798;
    border-radius: 1.1rem;
    background: linear-gradient(135deg, #effaf4, #f4faff);
}

.demo-family-closure-summary dt {
    color: #667085;
    font-size: .86rem;
}

.demo-family-professional-status {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.demo-family-professional-status small {
    display: block;
    color: #6c757d;
}

.demo-family-assistance-card {
    border-top: 4px solid #f59f00;
}

.demo-family-request-field {
    height: 100%;
    padding: .9rem;
    border: 2px solid #f0ad4e;
    border-radius: .85rem;
    background: #fffaf0;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.demo-family-request-field small {
    color: #8a5a16;
}

.demo-family-request-field.is-complete {
    border-color: #198754;
    background: #effaf4;
    box-shadow: 0 0 0 .14rem rgba(25,135,84,.08);
}

.demo-family-request-field.is-complete small {
    color: #146c43;
}

@media (max-width: 575.98px) {
    .demo-family-closure-banner,
    .demo-family-closure-hero,
    .demo-family-professional-status {
        align-items: flex-start;
        flex-direction: column;
    }

    .demo-family-closure-banner .btn {
        width: 100%;
    }
}


/* --------------------------------------------------------------------------
   Autopilot e pianificazioni ricorrenti · 29/08/2026
   -------------------------------------------------------------------------- */
.demo-autopilot-family{border:1px solid #dce5ee;border-left:4px solid #0d6efd;border-radius:1rem;background:linear-gradient(135deg,#f8fbff,#fff 55%,#fffaf5);padding:1.15rem}
.demo-autopilot-family__header{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}
.demo-autopilot-child{border:1px solid #e2e8ee;border-left:4px solid #0dcaf0;border-radius:.8rem;background:#fff;padding:.85rem}
.demo-autopilot-chip{display:inline-flex;gap:.3rem;align-items:center;border:1px solid #e3e8ed;border-radius:999px;background:#fafcfd;padding:.28rem .52rem;font-size:.78rem;color:#53606a}
.demo-autopilot-planning{border:1px solid #d8e1e8;border-left:4px solid #6f8fa8;border-radius:.8rem;background:#f8fbfd;padding:.85rem}
.demo-planning-row{display:flex;gap:.8rem;align-items:center;padding:.75rem 0;border-top:1px solid #e6ebef}
.demo-planning-row:first-of-type{border-top:0}
.demo-planning-row__icon{display:grid;place-items:center;width:2.5rem;height:2.5rem;border-radius:.75rem;background:#fff;border:1px solid #e4e9ed;font-size:1.2rem}
.demo-planning-row__missing{color:#9a651d!important}
.demo-autopilot-count{display:flex;justify-content:space-between;align-items:center;border:1px solid #e0e6eb;border-radius:.7rem;background:#fff;padding:.65rem .75rem}
.demo-autopilot-count.is-overdue{border-left:4px solid #dc3545;background:#fff8f8}.demo-autopilot-count.is-today{border-left:4px solid #d8a12f;background:#fffaf2}.demo-autopilot-count.is-week{border-left:4px solid #0d6efd;background:#f7fbff}
.demo-planning-rule-card{border-left:4px solid #6f8fa8}
.demo-planning-known,.demo-planning-unknown{display:flex;flex-direction:column;gap:.15rem;border:1px solid #e3e8ed;border-radius:.7rem;background:#fff;padding:.75rem}.demo-planning-known span,.demo-planning-unknown span{font-size:.76rem;color:#6c757d}.demo-planning-unknown{border-left:4px solid #d8a12f;background:#fffaf4}
.demo-plan-success-icon{display:grid;place-items:center;flex:0 0 2.7rem;width:2.7rem;height:2.7rem;border-radius:50%;background:#198754;color:#fff;font-weight:900}
@media(max-width:767.98px){.demo-autopilot-family__header,.demo-planning-row{align-items:stretch;flex-direction:column}.demo-planning-row .btn{width:100%}}
