
   :root {
    --portal-primary: var(--primary, #1F73E8);
    --portal-primary-light: var(--primary-light, #4EA6FF);
    --portal-accent: var(--accent, #7BC4FF);
    --portal-dark: var(--dark, #1b1b1b);
    --portal-gray: var(--gray, #7a7a7a);
    --portal-border: #dbe9ff;
    --portal-soft: #f8fbff;
    --portal-success: #2d8b42;
    --portal-warning: #9a6500;
    --portal-danger: #c62828;
    --portal-shadow: 0 20px 50px rgba(0, 0, 0, .09);
}

.hidden {
    display: none !important;
}

body.client-portal-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 8%, rgba(31, 115, 232, .12), transparent 27%),
        radial-gradient(circle at 88% 17%, rgba(78, 166, 255, .11), transparent 30%),
        linear-gradient(180deg, #fff 0%, #eef7ff 46%, #fff 100%);
}



#clientPortalApp {
    min-height: calc(100vh - 88px);
    padding: 45px clamp(12px, 3vw, 42px) 90px;
}

.portal-state-card {
    max-width: 780px;
    margin: 55px auto;
    padding: clamp(32px, 5vw, 55px);
    border: 1px solid var(--portal-border);
    border-radius: 26px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--portal-shadow);
    text-align: center;
}

.portal-state-card h1 {
    color: var(--portal-primary);
}

.portal-state-actions,
.portal-invitation-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 27px;
}

.portal-state-icon {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: #eef6ff;
    color: var(--portal-primary);
    font-size: 2rem;
    font-weight: 800;
}

.portal-loading-spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    border: 6px solid #dce8ff;
    border-top-color: var(--portal-primary);
    border-radius: 50%;
    animation: portalSpin 1s linear infinite;
}

@keyframes portalSpin {
    to {
        transform: rotate(360deg);
    }
}

.client-portal-shell {
    max-width: 1640px;
    margin: 0 auto;
}

.portal-welcome {
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    padding: clamp(28px, 4vw, 46px);
    border-radius: 26px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 20%, rgba(255, 255, 255, .2), transparent 25%),
        radial-gradient(circle at 10% 90%, rgba(123, 196, 255, .26), transparent 34%),
        linear-gradient(135deg, var(--portal-primary), var(--portal-primary-light));
    box-shadow: 0 28px 70px rgba(31, 115, 232, .25);
}

.portal-welcome h1,
.portal-welcome p,
.portal-welcome .portal-eyebrow {
    color: #fff;
}

.portal-welcome-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 25px;
}

.portal-welcome h1 {
    margin-bottom: 9px;
    font-size: clamp(2rem, 4vw, 3.45rem);
}

.portal-eyebrow {
    margin: 0 0 7px !important;
    color: var(--portal-primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.portal-welcome-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 11px;
}

.portal-welcome .btn.secondary {
    border-color: rgba(255, 255, 255, .6);
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.portal-welcome-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.portal-welcome-meta article {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 15px;
    background: rgba(255, 255, 255, .13);
    backdrop-filter: blur(8px);
}

.portal-welcome-meta span {
    display: block;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, .78);
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.portal-welcome-meta strong {
    color: #fff;
}

.client-portal-layout {
    display: grid;
    grid-template-columns: 275px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.client-portal-sidebar {
    position: sticky;
    top: 110px;
    display: grid;
    gap: 20px;
}

.client-portal-navigation,
.portal-help-card {
    padding: 18px;
    border: 1px solid var(--portal-border);
    border-radius: 21px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--portal-shadow);
}

.client-portal-navigation {
    display: grid;
    gap: 6px;
}

.portal-nav-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    width: 100%;
    padding: 12px 14px 12px 17px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #414a59;
    cursor: pointer;
    font-weight: 700;
    text-align: left;
    transition: .26s;
}

.portal-nav-button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 4px;
    height: 0;
    border-radius: 999px;
    background: var(--portal-primary);
    transform: translateY(-50%);
    transition: .26s;
}

.portal-nav-button:hover,
.portal-nav-button.active {
    padding-left: 22px;
    background: #eef6ff;
    color: var(--portal-primary);
}

.portal-nav-button:hover::before,
.portal-nav-button.active::before {
    height: 55%;
}

.portal-nav-count {
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e8f2ff;
    color: var(--portal-primary);
    font-size: .72rem;
    text-align: center;
}

.portal-help-card {
    padding: 24px;
    background: linear-gradient(145deg, #eef6ff, #fff);
}

.portal-help-card h2 {
    color: var(--portal-primary);
    font-size: 1.25rem;
}

.client-portal-content {
    min-width: 0;
}

.portal-view {
    display: grid;
    gap: 26px;
}

.portal-view-header,
.portal-card-header,
.portal-split-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
}

.portal-view-header h2,
.portal-card-header h2,
.portal-card-header h3 {
    margin-bottom: 7px;
    color: var(--portal-primary);
}

.portal-view-header p,
.portal-card-header p {
    margin: 0;
}

.portal-view-actions,
.portal-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-card {
    overflow: hidden;
    border: 1px solid var(--portal-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--portal-shadow);
}

.portal-card-header {
    padding: 25px 29px;
    border-bottom: 1px solid #e3edf9;
    background: linear-gradient(135deg, #fff, #f7faff);
}

.portal-card-body {
    padding: 28px;
}

.portal-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 17px;
}

.portal-metric {
    position: relative;
    min-height: 118px;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    background: linear-gradient(145deg, #fff, #f6faff);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .055);
}

.portal-metric::after {
    content: "";
    position: absolute;
    right: -27px;
    bottom: -37px;
    width: 105px;
    height: 105px;
    border-radius: 50%;
    background: rgba(31, 115, 232, .07);
}

.portal-metric span,
.portal-metric strong {
    position: relative;
    z-index: 1;
    display: block;
}

.portal-metric span {
    margin-bottom: 7px;
    color: var(--portal-gray);
    font-size: .79rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.portal-metric strong {
    color: var(--portal-primary);
    font-family: "Poppins", sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.portal-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 16px;
}

.portal-action-card {
    display: block;
    min-height: 100%;
    padding: 22px;
    border: 1px solid var(--portal-border);
    border-radius: 17px;
    background: #fff;
    transition: .28s;
}

.portal-action-card:hover {
    border-color: var(--portal-primary-light);
    transform: translateY(-5px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, .09);
}

.portal-action-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--portal-primary);
}

.portal-action-card p {
    margin: 0;
    font-size: .92rem;
}

.portal-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--portal-border);
    border-radius: 17px;
    background: #fff;
}

.portal-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
}

.portal-table th,
.portal-table td {
    padding: 15px 16px;
    border-bottom: 1px solid #e6eef9;
    text-align: left;
    vertical-align: top;
}

.portal-table th {
    color: #fff;
    background: linear-gradient(135deg, var(--portal-primary), var(--portal-primary-light));
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.portal-table tbody tr:hover {
    background: #f5f9ff;
}

.portal-table td small {
    display: block;
    margin-top: 4px;
    color: var(--portal-gray);
}

.portal-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #eef6ff;
    color: var(--portal-primary);
    font-size: .77rem;
    font-weight: 800;
}

.portal-status.success {
    background: #dff6e7;
    color: var(--portal-success);
}

.portal-status.warning {
    background: #fff6d8;
    color: var(--portal-warning);
}

.portal-status.danger {
    background: #ffe1e1;
    color: var(--portal-danger);
}

.portal-empty {
    padding: 34px;
    border: 1px dashed #bfd2ee;
    border-radius: 16px;
    background: #f8fbff;
    color: var(--portal-gray);
    text-align: center;
}

.portal-list {
    display: grid;
    gap: 13px;
}

.portal-list-item {
    padding: 17px;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    background: #f8fbff;
}

.portal-list-item strong {
    display: block;
    color: var(--portal-primary);
}

.portal-list-item p {
    margin: 5px 0 0;
}

.portal-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 16px;
}

.portal-file-card {
    padding: 20px;
    border: 1px solid var(--portal-border);
    border-radius: 17px;
    background: #fff;
}

.portal-file-card strong {
    display: block;
    color: var(--portal-primary);
}

.portal-file-meta {
    margin: 6px 0 15px;
    color: var(--portal-gray);
    font-size: .87rem;
}

.portal-message-thread {
    display: grid;
    gap: 13px;
    max-height: 540px;
    overflow-y: auto;
    padding: 5px;
}

.portal-message {
    max-width: 82%;
    padding: 15px 17px;
    border-radius: 17px;
    background: #eef6ff;
}

.portal-message.customer {
    margin-left: auto;
    background: linear-gradient(135deg, var(--portal-primary), var(--portal-primary-light));
    color: #fff;
}

.portal-message.customer p,
.portal-message.customer small {
    color: #fff;
}

.portal-message small {
    display: block;
    margin-top: 6px;
    color: var(--portal-gray);
}

.portal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.portal-field.full {
    grid-column: 1 / -1;
}

.portal-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

.portal-field input,
.portal-field select,
.portal-field textarea {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #cfd9ea;
    border-radius: 12px;
    background: #fff;
    font: inherit;
}

.portal-field textarea {
    min-height: 130px;
    resize: vertical;
}

.portal-field input:focus,
.portal-field select:focus,
.portal-field textarea:focus {
    border-color: var(--portal-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(31, 115, 232, .13);
}

.portal-form-status {
    display: none;
    margin-top: 16px;
    padding: 15px;
    border-radius: 12px;
}

.portal-form-status.success {
    display: block;
    border-left: 5px solid #35b34a;
    background: #eaf9ef;
    color: #2d8b42;
}

.portal-form-status.error {
    display: block;
    border-left: 5px solid #d64040;
    background: #fff2f2;
    color: #d64040;
}

.portal-security-note {
    padding: 20px;
    border-left: 6px solid var(--portal-primary);
    border-radius: 15px;
    background: #eef7ff;
}

.portal-backdrop {
    position: fixed;
    inset: 88px 0 0;
    z-index: 1050;
    background: rgba(8, 20, 40, .58);
    backdrop-filter: blur(3px);
}

body.client-portal-page .modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(8, 20, 40, .78);
    backdrop-filter: blur(8px);
}

body.client-portal-page .modal-content {
    position: relative;
    width: min(980px, 100%);
    max-height: 92vh;
    overflow: auto;
    padding: 30px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 35px 100px rgba(0, 0, 0, .35);
}

body.client-portal-page .close-modal {
    position: sticky;
    top: 0;
    float: right;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--portal-primary);
    color: #fff;
    cursor: pointer;
    font-size: 1.65rem;
}

@media (max-width: 1080px) {
    .portal-menu-toggle {
        display: grid;
        place-items: center;
    }

    .portal-header-account {
        display: none;
    }

    .client-portal-layout {
        grid-template-columns: 1fr;
    }

    .client-portal-sidebar {
        position: fixed;
        top: 88px;
        bottom: 0;
        left: 0;
        z-index: 1060;
        width: min(290px, 88vw);
        padding: 20px;
        overflow-y: auto;
        background: #f6faff;
        transform: translateX(-110%);
        transition: transform .32s ease;
        box-shadow: 22px 0 60px rgba(0, 0, 0, .19);
    }

    .client-portal-sidebar.open {
        transform: translateX(0);
    }
}

@media (max-width: 700px) {
    #clientPortalApp {
        min-height: calc(100vh - 78px);
        padding: 28px 10px 70px;
    }

    .portal-welcome-top,
    .portal-view-header,
    .portal-card-header,
    .portal-split-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-welcome-actions,
    .portal-view-actions,
    .portal-card-actions {
        justify-content: flex-start;
    }

    .portal-card-header,
    .portal-card-body {
        padding: 22px 18px;
    }

    .portal-form-grid {
        grid-template-columns: 1fr;
    }

    .portal-message {
        max-width: 94%;
    }

    .portal-backdrop {
        inset: 78px 0 0;
    }

    .client-portal-sidebar {
        top: 78px;
    }
}

@media print {
    .client-portal-sidebar,
    .portal-welcome-actions,
    .portal-view-actions,
    .portal-card-actions,
    .toast-container {
        display: none !important;
    }

    #clientPortalApp {
        padding: 0;
    }

    .client-portal-layout {
        display: block;
    }

    .portal-card,
    .portal-welcome {
        break-inside: avoid;
        box-shadow: none;
    }
}

/* =========================================================
   CLIENT PORTAL — SITE INTEGRATION & PRODUCTION POLISH
   ========================================================= */

:root {
    --portal-header-height: 92px;
    --portal-account-bar-height: 70px;
}

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

body.client-portal-page {
    min-width: 320px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 5000;
    padding: 11px 16px;
    border-radius: 10px;
    background: #fff;
    color: var(--portal-primary);
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.portal-noscript {
    display: block;
    padding: 16px;
    border-bottom: 1px solid #f0d59e;
    background: #fff7df;
    color: #714d00;
    font-weight: 700;
    text-align: center;
}

/* Account bar beneath the standard site navigation. */

.portal-account-bar {
    position: -webkit-sticky;
    position: sticky;
    top: var(--portal-header-height);
    z-index: 1090;
    min-height: var(--portal-account-bar-height);
    border-bottom: 1px solid var(--portal-border);
    background: rgba(248, 251, 255, .97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(15, 38, 75, .05);
}

.portal-account-bar-inner {
    display: flex;
    min-height: var(--portal-account-bar-height);
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.portal-account-summary,
.portal-account-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-account-summary {
    min-width: 0;
}

.portal-lock-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(
        135deg,
        var(--portal-primary),
        var(--portal-primary-light)
    );
    color: #fff;
    box-shadow: 0 9px 23px rgba(31, 115, 232, .22);
}

.portal-account-summary strong,
.portal-account-summary span {
    display: block;
}

.portal-account-summary strong {
    overflow: hidden;
    color: var(--portal-dark);
    font-family: "Poppins", sans-serif;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-account-summary span {
    margin-top: 2px;
    color: #687386;
    font-size: .84rem;
}

.portal-account-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    border: 1px solid #cfe0f8;
    border-radius: 999px;
    background: #fff;
    color: var(--portal-primary);
    font-weight: 750;
}

.portal-account-link:hover,
.portal-account-link:focus-visible {
    border-color: var(--portal-primary);
    background: #eef6ff;
    color: var(--portal-primary);
    outline: none;
}

.portal-menu-toggle {
    display: none;
    width: auto;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid var(--portal-primary);
    border-radius: 999px;
    background: var(--portal-primary);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(31, 115, 232, .2);
    -webkit-appearance: none;
    appearance: none;
}

#clientPortalApp {
    min-height: 70vh;
    padding-top: 38px;
}

.portal-state-card,
.portal-card,
.portal-welcome,
.client-portal-navigation,
.portal-help-card {
    isolation: isolate;
}

.portal-view-header h2,
.portal-card-header h2,
.portal-help-card h2,
.portal-state-card h1 {
    color: var(--portal-primary);
}

.portal-card,
.portal-state-card,
.client-portal-navigation,
.portal-help-card {
    border-color: rgba(199, 220, 248, .9);
}

.portal-metric,
.portal-action-card,
.portal-list-item,
.portal-file-card {
    min-width: 0;
}

.portal-action-card {
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
}

.portal-table-wrap {
    border: 1px solid #e0ebf9;
    border-radius: 15px;
}

.portal-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.portal-field input,
.portal-field select,
.portal-field textarea {
    -webkit-appearance: none;
    appearance: none;
    color: var(--portal-dark);
    font: inherit;
}

.portal-field select {
    -webkit-appearance: auto;
    appearance: auto;
}

.portal-field input[readonly] {
    background: #f5f8fc;
    color: #536071;
}

.portal-status {
    white-space: nowrap;
}

#clientPortalModal:not(.hidden) {
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

#clientPortalModal .modal-content {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.portal-security-note {
    border-left: 5px solid var(--portal-primary);
}

#backToTop {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1400;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--portal-primary);
    color: #fff;
    box-shadow: 0 13px 30px rgba(0,0,0,.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition:
        opacity .2s ease,
        visibility .2s ease,
        transform .2s ease,
        background .2s ease;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover,
#backToTop:focus-visible {
    background: #1764cc;
    outline: none;
}

/* Standard black site footer, matching the public pages. */

#site-footer,
#site-footer .container,
#site-footer .footer-grid,
#site-footer .footer-grid.footer-grid-five,
#site-footer .footer-bottom {
    background: #000 !important;
}

#site-footer {
    margin-top: 0;
    padding: 70px 0 25px;
    color: #fff;
}

#site-footer h3,
#site-footer p,
#site-footer a {
    color: #fff !important;
}

#site-footer p,
#site-footer a {
    opacity: .92;
}

#site-footer a:hover,
#site-footer a:focus-visible {
    color: #7BC4FF !important;
    opacity: 1;
}

#site-footer .footer-grid.footer-grid-five {
    display: grid;
    grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
}

#site-footer .footer-column {
    min-width: 0;
}

#site-footer .footer-logo {
    width: 150px;
    max-height: 90px;
    margin-bottom: 18px;
    object-fit: contain;
}

#site-footer .footer-column ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#site-footer .footer-column li + li {
    margin-top: 8px;
}

#site-footer .social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 15px;
}

#site-footer hr {
    margin: 42px 0 24px;
    border: 0;
    border-top: 1px solid rgba(255,255,255,.18);
}

#site-footer .footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0;
    border: 0 !important;
    box-shadow: none !important;
}

#site-footer .footer-bottom p {
    margin: 0;
}

#site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 18px;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .portal-account-bar,
    #clientPortalModal:not(.hidden) {
        background-color: rgba(248, 251, 255, .99);
    }
}

@media (max-width: 1180px) {
    #site-footer .footer-grid.footer-grid-five {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .portal-menu-toggle {
        display: inline-flex;
    }

    .client-portal-sidebar {
        top: calc(var(--portal-header-height) + var(--portal-account-bar-height));
        bottom: 0;
    }

    .portal-backdrop {
        top: calc(var(--portal-header-height) + var(--portal-account-bar-height));
    }
}

@media (max-width: 900px) {
    :root {
        --portal-header-height: 78px;
    }
}

@media (max-width: 760px) {
    :root {
        --portal-account-bar-height: 66px;
    }

    .portal-account-bar-inner {
        width: 94%;
    }

    .portal-lock-icon,
    .portal-account-link {
        display: none;
    }

    .portal-account-summary {
        max-width: calc(100% - 135px);
    }

    .portal-account-summary span {
        font-size: .75rem;
    }

    .portal-menu-toggle {
        min-width: 124px;
        padding-right: 12px;
        padding-left: 12px;
    }

    #clientPortalApp {
        padding-top: 24px;
    }

    #site-footer {
        padding: 54px 0 22px;
    }

    #site-footer .footer-grid.footer-grid-five {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    #site-footer .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    #site-footer .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .portal-menu-toggle span:last-child {
        display: none;
    }

    .portal-menu-toggle {
        min-width: 46px;
        width: 46px;
        padding: 0;
        border-radius: 12px;
    }

    .portal-account-summary {
        max-width: calc(100% - 58px);
    }

    .portal-welcome {
        border-radius: 20px;
    }

    .portal-metrics {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-loading-spinner {
        animation-duration: 1.8s;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    .site-header,
    .portal-account-bar,
    #site-footer,
    #backToTop,
    .portal-backdrop,
    #clientPortalModal {
        display: none !important;
    }

    #clientPortalApp {
        padding: 0;
    }
}
