: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__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); }
}

@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;
    }
}
