/* Klientský portál — dashboard v detailu klienta */

/* Portál používá přirozený dokumentový scroll; obsah se nesmí uzamknout na výšku viewportu. */
body.authenticated.crm-client-portal-active.crm-on-section:not(.crm-on-kalkulacka) {
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 0;
}

body.authenticated.crm-client-portal-active .crm-shell {
    display: flex;
    flex-direction: column;
    max-width: none;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    box-sizing: border-box;
}

body.authenticated.crm-client-portal-active .crm-app-header {
    flex-shrink: 0;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
}

body.authenticated.auth-role-client.crm-client-portal-active .crm-app-header {
    display: none;
}

body.authenticated.auth-role-client.crm-client-portal-active .crm-shell {
    padding-top: clamp(0.75rem, 1.5vw, 1.35rem);
}

.cd-client-session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--cp-line, rgba(26, 35, 49, 0.1));
    border-radius: 18px;
    background: var(--cp-surface, #fff);
    box-shadow: var(--cp-shadow, 0 8px 28px rgba(31, 39, 53, 0.07));
}

.cd-client-session-brand,
.cd-client-session-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cd-client-session-mark {
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 12px;
    background: var(--cp-gold-soft, #f8f0dd);
    color: var(--cp-gold, #bd9650);
    font-weight: 800;
}

.cd-client-session-brand > div {
    display: grid;
    gap: 0.08rem;
}

.cd-client-session-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.cd-client-session-brand strong {
    color: var(--cp-ink, #171b24);
    font-size: 0.95rem;
}

.cd-client-session-brand > div > span:last-child {
    color: var(--cp-muted, #6c7482);
    font-size: 0.8rem;
}

.cd-client-test-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.35rem;
    padding: 0.18rem 0.48rem;
    border: 1px solid rgba(176, 113, 10, 0.3);
    border-radius: 999px;
    background: #fff2ce;
    color: #7a4a00;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cd-client-logout {
    min-height: 2.35rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--cp-line-strong, rgba(26, 35, 49, 0.14));
    border-radius: 999px;
    background: transparent;
    color: var(--cp-ink, #171b24);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.cd-client-logout:hover {
    border-color: var(--cp-gold, #bd9650);
}

html[data-theme='dark'] .cd-client-session-header {
    border-color: rgba(255, 255, 255, 0.09);
    background: #1b2028;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.24);
}

html[data-theme='dark'] .cd-client-session-brand strong,
html[data-theme='dark'] .cd-client-logout {
    color: #f4f6f8;
}

html[data-theme='dark'] .cd-client-session-brand > div > span:last-child {
    color: #a5adba;
}

html[data-theme='dark'] .cd-client-test-badge {
    border-color: rgba(234, 184, 91, 0.42);
    background: rgba(194, 134, 33, 0.18);
    color: #f5cf83;
}

@media (max-width: 520px) {
    .cd-client-session-header {
        margin-bottom: 0.75rem;
        border-radius: 15px;
    }

    .cd-client-session-brand > div > span:last-child {
        max-width: 10rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cd-client-test-badge {
        font-size: 0.58rem;
    }

    .cd-client-logout {
        padding-inline: 0.7rem;
    }
}

body.crm-client-portal-active.crm-on-section .crm-section.is-active,
body.crm-client-portal-active #crmSectionClientDetail.crm-section.is-active {
    min-height: 0 !important;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
    display: block !important;
    padding: 0;
    box-sizing: border-box;
}

body.crm-client-portal-active .crm-client-detail-root {
    min-height: 0 !important;
    overflow: visible;
    display: block;
}

body.crm-client-portal-active .cd-page--client-portal {
    min-height: 0;
    display: block;
    overflow: visible;
    padding: 0;
    margin: 0;
    max-width: none;
    box-sizing: border-box;
}

.cd-portal-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
    padding: 0 0.25rem;
}

.cd-portal-settings-btn {
    margin-left: auto;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--office-brand-border);
    background: rgba(212, 188, 130, 0.08);
    color: var(--office-brand);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.cd-portal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 188, 130, 0.2);
}

.cd-portal-header-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--office-brand);
    margin-bottom: 0.35rem;
}

.cd-portal-header-name {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: clamp(1.5rem, 3.5vw, 2.15rem);
    font-weight: 700;
    color: var(--office-text);
    margin-bottom: 0.35rem;
}

.cd-portal-header-lead {
    font-size: 0.9rem;
    color: var(--office-text-muted, rgba(255, 255, 255, 0.62));
    max-width: 42rem;
    line-height: 1.5;
}

.cd-page--client-portal {
    max-width: none;
    width: 100%;
}

.cd-tabs--portal {
    margin-bottom: 1.25rem;
}

.cd-tab--portal.is-active {
    color: var(--office-brand);
}

.cd-tab-panels--portal .cd-tab-panel--portal:not(.is-active) {
    display: none;
}

.cd-tab-panels--portal .cd-tab-panel--portal.is-active {
    display: block;
}

.cp-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.cp-section {
    padding: 1.5rem 1.75rem;
    border-radius: 18px;
    border: 1px solid var(--office-glass-border);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow: var(--office-shadow);
}

.cp-section--hero {
    border-color: rgba(212, 188, 130, 0.35);
    background:
        radial-gradient(ellipse 90% 80% at 100% 0%, rgba(212, 188, 130, 0.14) 0%, transparent 55%),
        linear-gradient(155deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.cp-section-head {
    margin-bottom: 1.25rem;
}

.cp-section-title {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--office-text);
    margin-bottom: 0.35rem;
}

.cp-section-lead {
    font-size: 0.9rem;
    color: var(--office-text-muted, rgba(255, 255, 255, 0.62));
    line-height: 1.5;
}

.cp-disclaimer {
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: var(--office-text-muted, rgba(255, 255, 255, 0.5));
}

.cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}

.cp-btn--primary {
    background: var(--office-brand, #d4bc82);
    color: #1a1510;
}

.cp-btn--secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--office-glass-border);
    color: var(--office-text);
}

.cp-btn--ghost {
    background: transparent;
    border-color: var(--office-brand-border);
    color: var(--office-brand);
}

/* DINO */
.cp-dino-next {
    padding: 1.1rem 1.25rem;
    border-radius: 14px;
    background: rgba(212, 188, 130, 0.1);
    border: 1px solid rgba(212, 188, 130, 0.25);
    margin-bottom: 1rem;
}

.cp-dino-next-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--office-brand);
    margin-bottom: 0.35rem;
}

.cp-dino-next-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.cp-dino-next-msg {
    font-size: 0.9rem;
    color: var(--office-text-muted);
    margin-bottom: 0.85rem;
}

.cp-dino-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cp-dino-chip {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--office-glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--office-text);
    font-size: 0.8rem;
    cursor: pointer;
}

.cp-dino-chip:hover {
    border-color: var(--office-brand);
}

.cp-dino-ask-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cp-dino-input {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--office-glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--office-text);
}

.cp-dino-drawer {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--office-glass-border);
}

.cp-dino-drawer.hidden {
    display: none;
}

/* Zabezpečení rodiny */
.cp-fp-summary {
    font-size: 0.85rem;
    color: var(--office-brand);
    margin-top: 0.5rem;
}

.cp-fp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.cp-fp-card {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--office-glass-border);
    background: rgba(0, 0, 0, 0.15);
    min-height: 88px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cp-fp-card--resolved {
    border-color: rgba(92, 184, 138, 0.45);
}

.cp-fp-card--partial {
    border-color: rgba(212, 188, 130, 0.5);
}

.cp-fp-card--missing {
    border-color: rgba(220, 100, 100, 0.45);
}

.cp-fp-status {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cp-fp-card--resolved .cp-fp-status {
    color: #5cb88a;
}

.cp-fp-card--partial .cp-fp-status {
    color: var(--office-brand);
}

.cp-fp-card--missing .cp-fp-status {
    color: #e08080;
}

.cp-fp-title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Cíle */
.cp-goals-empty {
    text-align: center;
    padding: 2rem 1rem;
}

.cp-goals-empty p {
    margin-bottom: 1rem;
    color: var(--office-text-muted);
}

.cp-goal-card {
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px solid var(--office-glass-border);
    margin-bottom: 1rem;
}

.cp-goal-card--primary {
    border-color: rgba(212, 188, 130, 0.4);
    background: rgba(212, 188, 130, 0.06);
}

.cp-goal-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--office-brand);
    margin-bottom: 0.35rem;
}

.cp-goal-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cp-goal-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-bottom: 1rem;
}

.cp-goal-bar span {
    display: block;
    height: 100%;
    background: var(--office-brand);
    border-radius: 999px;
}

.cp-goal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cp-goal-stats dt {
    font-size: 0.72rem;
    color: var(--office-text-muted);
}

.cp-goal-stats dd {
    font-weight: 600;
}

.cp-goals-secondary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.cp-goal-card--compact h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.cp-goal-compact-meta {
    font-size: 0.8rem;
    color: var(--office-text-muted);
    margin-top: 0.35rem;
}

/* Finance */
.cp-finance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.cp-finance-item dt {
    font-size: 0.78rem;
    color: var(--office-text-muted);
    margin-bottom: 0.25rem;
}

.cp-finance-item dd {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Graf */
.cp-chart-wrap {
    overflow-x: auto;
}

.cp-chart-svg {
    width: 100%;
    max-width: 640px;
    height: auto;
    display: block;
}

.cp-horizon-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    text-align: center;
}

.cp-horizon-row dt {
    font-size: 0.72rem;
    color: var(--office-text-muted);
}

.cp-horizon-row dd {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Výroční kontrola */
.cp-annual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.cp-annual-alert {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: rgba(212, 188, 130, 0.12);
    color: var(--office-brand);
    font-size: 0.88rem;
}

/* Doporučení */
.cp-rec-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cp-rec-card {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--office-glass-border);
}

.cp-rec-card h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.cp-rec-card p {
    font-size: 0.88rem;
    color: var(--office-text-muted);
    margin-bottom: 0.65rem;
}

/* Dokumenty */
.cp-doc-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.cp-doc-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-doc-link {
    background: none;
    border: none;
    color: var(--office-brand);
    cursor: pointer;
    font-weight: 600;
}

.cp-empty {
    color: var(--office-text-muted);
    margin-bottom: 1rem;
}

/* Přepínač pohledu poradce */
.cd-view-toggle {
    display: inline-flex;
    border-radius: 999px;
    border: 1px solid var(--office-glass-border);
    overflow: hidden;
    margin-bottom: 1rem;
}

.cd-view-toggle-btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--office-text-muted);
    cursor: pointer;
}

.cd-view-toggle-btn.is-active {
    background: rgba(212, 188, 130, 0.2);
    color: var(--office-brand);
}

.crm-client-goal-row {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--office-glass-border);
    border-radius: 12px;
}

.crm-client-goal-row .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.crm-portal-fp-overrides {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.crm-portal-fp-override-row label {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
    color: var(--office-text-muted, rgba(255, 255, 255, 0.62));
}

.crm-portal-fp-override-row select {
    width: 100%;
}

.crm-portal-kpi-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.crm-portal-expenses-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.crm-portal-expense-row {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

@media (max-width: 640px) {
    .cp-fp-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Režim náhledu klienta — kompaktní hero */
.cd-page--client-portal .cd-hero--portal {
    padding-bottom: 0.5rem;
}

.cd-page--client-portal .cd-hero--portal .cd-hero-contact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cd-page--client-portal .cd-tab-panels {
    margin-top: 0.5rem;
}

@media (max-width: 640px) {
    .cp-fp-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cp-horizon-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .crm-client-goal-row .form-row {
        grid-template-columns: 1fr;
    }
}

/* === Redesign dashboardu (2026-06) === */

.cp-btn--sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
}

.cp-goal-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.cp-goal-num span {
    display: block;
    font-size: 0.72rem;
    color: var(--office-text-muted);
    margin-bottom: 0.15rem;
}

.cp-goal-num strong {
    font-size: 1.05rem;
}

.cp-goal-num--accent strong {
    color: var(--office-brand);
}

.cp-goal-pct {
    font-size: 0.78rem;
    color: var(--office-text-muted);
    margin-top: 0.35rem;
}

.cp-goal-projection {
    margin-top: 0.85rem;
    font-size: 0.85rem;
    color: var(--office-text-muted);
}

.cp-goals-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.cp-goal-card--mini h4 {
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
}

.cp-goal-mini-meta {
    font-size: 0.78rem;
    color: var(--office-text-muted);
    margin-top: 0.35rem;
}

.cp-contract-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cp-contract-card {
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--office-glass-border);
    background: rgba(0, 0, 0, 0.12);
}

.cp-contract-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.cp-contract-card-head h3 {
    font-size: 1rem;
    font-weight: 600;
}

.cp-contract-inst {
    font-size: 0.78rem;
    color: var(--office-text-muted);
}

.cp-contract-purpose {
    font-size: 0.88rem;
    color: var(--office-text-muted);
    line-height: 1.45;
    margin-bottom: 0.65rem;
}

.cp-contract-payment {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--office-text);
    margin: 0 0 0.65rem;
}

.cp-contract-payment span {
    font-weight: 500;
    color: var(--office-text-muted);
}

.cp-contract-payment--muted {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--office-text-muted);
}

.cp-coverage-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cp-coverage-list li {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: rgba(92, 184, 138, 0.08);
    border: 1px solid rgba(92, 184, 138, 0.2);
}

.cp-coverage-list strong {
    display: block;
    margin-bottom: 0.2rem;
}

.cp-coverage-list span {
    font-size: 0.85rem;
    color: var(--office-text-muted);
}

.cp-gaps-note {
    margin-top: 0.85rem;
    font-size: 0.82rem;
    color: var(--office-text-muted);
}

.cp-anniv-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cp-anniv-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-anniv-premium {
    font-size: 0.82rem;
    color: var(--office-text-muted);
}

.cp-dino-fab {
    position: fixed;
    left: 1.25rem;
    bottom: 1.25rem;
    z-index: 1200;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    border: 1px solid rgba(212, 188, 130, 0.45);
    background: linear-gradient(145deg, #e8d5a8 0%, #c9a962 100%);
    color: #1a1510;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cp-dino-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 32px rgba(212, 188, 130, 0.25);
}

.cp-dino-panel {
    position: fixed;
    left: 1.25rem;
    bottom: 5rem;
    z-index: 1201;
    width: min(360px, calc(100vw - 2.5rem));
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid var(--office-glass-border);
    background: rgba(18, 18, 22, 0.96);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.cp-dino-panel.hidden {
    display: none;
}

.cp-dino-panel-head {
    position: relative;
    margin-bottom: 0.75rem;
    padding-right: 1.5rem;
}

.cp-dino-panel-head h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cp-dino-panel-head p {
    font-size: 0.78rem;
    color: var(--office-text-muted);
}

.cp-dino-panel-close {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: var(--office-text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.cp-dino-answer {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.88rem;
    line-height: 1.45;
}

.cp-dino-answer.hidden {
    display: none;
}

.cp-dashboard {
    padding-bottom: 5rem;
}

.cp-build-stamp {
    margin-top: 1.5rem;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
    text-align: center;
}

.cp-finance-breakdown {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.cp-finance-breakdown li {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.84rem;
}

.cp-finance-breakdown strong {
    display: block;
    margin-bottom: 0.2rem;
}

.cp-finance-breakdown span {
    color: var(--office-text-muted);
}

.cp-finance-excluded {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: #e8b86d;
}

@media (max-width: 640px) {
    .cp-goal-numbers {
        grid-template-columns: 1fr;
    }

    .cp-dino-fab {
        left: 1rem;
        bottom: 1rem;
    }

    .cp-dino-panel {
        left: 1rem;
        bottom: 4.5rem;
    }
}

/* === Shell layout (sidebar + main) === */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cp-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 280px;
    grid-template-rows: auto;
    align-items: start;
    gap: 1.125rem;
    min-height: 0;
    height: auto;
    border: 0;
    overflow: visible;
    background: transparent;
}

.cp-sidebar {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0.75rem 0.85rem 0.85rem;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--office-bg-mid);
    overflow: visible;
    box-sizing: border-box;
}

.cp-sidebar-logo {
    flex: 0 0 auto;
    padding: 0.65rem 0 0.85rem;
    margin: 0 0 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cp-sidebar-logo-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 4.35rem;
    object-fit: contain;
    object-position: left center;
    image-rendering: auto;
}

.cp-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 0 1 auto;
    min-height: 0;
    overflow: visible;
    overscroll-behavior: contain;
    padding-left: 0;
    padding-bottom: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 188, 130, 0.25) transparent;
}

.cp-sidebar-nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    width: 100%;
    padding: 0.46rem 0.65rem 0.46rem 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--office-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.cp-sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--office-text);
}

.cp-sidebar-nav-item.is-active {
    background: rgba(212, 188, 130, 0.16);
    color: var(--office-brand);
}

.cp-sidebar-nav-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.cp-sidebar-nav-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cp-sidebar-footer {
    position: static;
    margin: 1rem 0 0;
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: var(--office-bg-mid);
    z-index: 5;
}

.cp-sidebar-mascot {
    position: relative;
    flex-shrink: 0;
    padding: 0 0.1rem;
}

.cp-sidebar-mascot-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: clamp(6.5rem, 22vh, 9.5rem);
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.35));
}

.cp-sidebar-mascot-bubble {
    position: absolute;
    top: 7%;
    right: 0;
    left: auto;
    width: min(9.5rem, 46%);
    z-index: 2;
    padding: 0.5rem 0.6rem;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 14, 20, 0.94);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    text-align: left;
}

.cp-sidebar-mascot-bubble::after {
    content: '';
    position: absolute;
    inset: -0.55rem -0.45rem -0.55rem -0.85rem;
    z-index: -1;
    border-radius: 13px;
    background: var(--office-bg-mid);
}

.cp-sidebar-mascot-bubble::before {
    content: '';
    position: absolute;
    left: -0.45rem;
    top: 1.1rem;
    width: 0.55rem;
    height: 0.55rem;
    background: rgba(12, 14, 20, 0.94);
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    transform: rotate(45deg);
}

.cp-sidebar-mascot-bubble p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.74rem;
    line-height: 1.3;
    color: var(--office-text);
}

.cp-sidebar-mascot-bubble-line {
    display: block;
}

.cp-sidebar-mascot-bubble-brand {
    display: block;
}

.cp-sidebar-mascot-bubble strong {
    color: var(--office-brand);
    font-weight: 700;
}

.cp-sidebar-dino {
    padding: 0.75rem;
    border-radius: 14px;
    border: 1px solid rgba(212, 188, 130, 0.22);
    background: rgba(212, 188, 130, 0.06);
    text-align: left;
}

.cp-sidebar-dino-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cp-sidebar-dino-lead {
    font-size: 0.75rem;
    color: var(--office-text-muted);
    line-height: 1.4;
    margin-bottom: 0.65rem;
}

.cp-sidebar-dino-btn {
    width: 100%;
    font-size: 0.78rem;
}

.cp-main {
    padding: 1.5rem 1.75rem 2rem;
    min-height: 0;
    max-height: none;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212, 188, 130, 0.05) 0%, transparent 55%),
        linear-gradient(180deg, rgba(10, 12, 18, 0.55) 0%, rgba(8, 10, 14, 0.85) 100%);
}

.cp-main-header {
    margin-bottom: 1.25rem;
}

.cp-main-greeting {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.cp-main-lead {
    font-size: 0.9rem;
    color: var(--office-text-muted);
}

.cp-page-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cp-overview {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cp-overview--v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(300px, 28%);
    gap: 1.25rem;
    align-items: start;
}

.cp-overview-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.cp-overview-tiles,
.cp-expenses-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(200px, auto);
    gap: 0.6rem;
    align-items: stretch;
}

.cp-expenses-tiles--detail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cp-expenses-tiles--detail:not(:has(> :nth-child(3))) {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cp-overview-aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
}

.cp-card {
    padding: 1.25rem 1.35rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(212, 188, 130, 0.07) 0%, transparent 55%),
        linear-gradient(165deg, rgba(22, 27, 38, 0.96) 0%, rgba(14, 17, 24, 0.98) 100%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.cp-card-head {
    margin-bottom: 1rem;
}

.cp-card-head--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cp-card-title {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.cp-card-lead {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--office-text-muted);
    line-height: 1.45;
}

.cp-card-tag {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--office-brand);
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(212, 188, 130, 0.25);
    background: rgba(212, 188, 130, 0.08);
}

.cp-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.cp-kpi-tile {
    min-height: 7.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cp-kpi-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cp-kpi-icon {
    width: 1.35rem;
    height: 1.35rem;
    color: var(--office-brand);
    opacity: 0.9;
}

.cp-kpi-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cp-kpi-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--office-text-muted);
}

.cp-kpi-value {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
    font-weight: 700;
    color: var(--office-text);
    line-height: 1.15;
}

.cp-kpi-hint {
    font-size: 0.74rem;
    color: var(--office-text-muted);
    line-height: 1.35;
}

.cp-mini-bar {
    height: 0.38rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 0.15rem;
}

.cp-mini-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.cp-mini-bar--gold span {
    background: linear-gradient(90deg, rgba(212, 188, 130, 0.55), var(--office-brand, #d4bc82));
}

.cp-mini-bar--green span {
    background: linear-gradient(90deg, rgba(80, 180, 110, 0.55), #6fcf97);
}

.cp-mini-bar--violet span {
    background: linear-gradient(90deg, rgba(140, 120, 220, 0.55), #a894e8);
}

.cp-overview-mid,
.cp-overview-lower {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.cp-card--goal {
    min-height: 100%;
}

.cp-goal-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.cp-goal-hero-pct {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1;
    color: var(--office-brand);
}

.cp-goal-hero-pct span {
    font-size: 0.45em;
    font-weight: 700;
}

.cp-goal-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-goal-stat span {
    display: block;
    font-size: 0.72rem;
    color: var(--office-text-muted);
    margin-bottom: 0.2rem;
}

.cp-goal-stat strong {
    font-size: 0.92rem;
}

.cp-goal-stat--accent strong {
    color: var(--office-brand);
}

.cp-goal-sublist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-goal-sub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.84rem;
}

.cp-goal-sub-head strong {
    color: var(--office-brand);
}

.cp-finance-rows {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cp-finance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.72rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
}

.cp-finance-row:last-child {
    border-bottom: none;
}

.cp-finance-row strong {
    font-size: 0.95rem;
}

.cp-finance-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(212, 188, 130, 0.35);
    background: linear-gradient(135deg, rgba(212, 188, 130, 0.16) 0%, rgba(212, 188, 130, 0.06) 100%);
}

.cp-finance-total span {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--office-brand);
    font-weight: 700;
}

.cp-finance-total strong {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    color: var(--office-text);
}

.cp-card--chart .cp-chart-wrap {
    margin: 0.25rem 0 0.75rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    padding: 0.5rem;
}

.cp-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.cp-chart-legend-item {
    font-size: 0.72rem;
    color: var(--office-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.cp-chart-legend-item::before {
    content: '';
    width: 1.1rem;
    height: 0.18rem;
    border-radius: 999px;
    background: var(--office-brand, #d4bc82);
}

.cp-chart-legend-item--target::before {
    background: transparent;
    border-top: 2px dashed rgba(255, 255, 255, 0.45);
    height: 0;
    width: 1.25rem;
}

.cp-horizon-row--compact {
    margin-top: 0.25rem;
}

.cp-card--risk .cp-risk-list {
    grid-template-columns: 1fr;
}

.cp-aside-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.cp-aside-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.cp-aside-link:hover {
    border-color: rgba(212, 188, 130, 0.25);
    background: rgba(212, 188, 130, 0.06);
}

.cp-aside-link-title {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.cp-aside-link-body {
    display: block;
    font-size: 0.76rem;
    color: var(--office-text-muted);
    line-height: 1.4;
}

.cp-aside-list--page {
    gap: 0.75rem;
}

.cp-aside-list--page .cp-aside-link {
    padding: 1rem 1.05rem;
}

.cp-rec-next {
    margin-top: 0.5rem;
    padding: 1.15rem 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(212, 188, 130, 0.22);
    background: rgba(212, 188, 130, 0.06);
}

.cp-rec-next-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--office-brand);
    margin-bottom: 0.35rem;
}

.cp-rec-next h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.cp-rec-next p {
    font-size: 0.84rem;
    color: var(--office-text-muted);
    line-height: 1.45;
    margin-bottom: 0.85rem;
}

.cp-review-dl {
    display: grid;
    gap: 0.65rem;
    margin: 0 0 0.75rem;
}

.cp-review-dl div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.cp-review-dl dt {
    font-size: 0.78rem;
    color: var(--office-text-muted);
}

.cp-review-dl dd {
    font-size: 0.88rem;
    font-weight: 600;
}

.cp-review-summary,
.cp-review-alert {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--office-text-muted);
}

.cp-review-alert {
    margin-top: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(212, 188, 130, 0.22);
    background: rgba(212, 188, 130, 0.08);
    color: var(--office-brand);
}

.cp-doc-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
}

.cp-doc-card {
    min-width: 0;
}

.cp-doc-card-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    width: 100%;
    min-height: 118px;
    padding: 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.cp-doc-card-btn:hover {
    border-color: rgba(212, 188, 130, 0.28);
    transform: translateY(-1px);
}

.cp-doc-card-icon {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #e57373;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: rgba(229, 115, 115, 0.12);
}

.cp-doc-card-name {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.cp-doc-card-meta {
    font-size: 0.74rem;
    color: var(--office-text-muted);
}

@media (max-width: 1180px) {
    .cp-doc-strip:not(.cp-doc-strip--compact) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .cp-doc-strip:not(.cp-doc-strip--compact) {
        grid-template-columns: minmax(0, 1fr);
    }
}

.cp-expenses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.cp-expenses-table th,
.cp-expenses-table td {
    padding: 0.55rem 0.35rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-expenses-table th {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--office-text-muted);
}

.cp-expenses-table td:last-child,
.cp-expenses-table th:last-child {
    text-align: right;
}

.cp-expenses-table tfoot td {
    border-bottom: none;
    padding-top: 0.75rem;
    font-weight: 600;
}

.cp-risk-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 1rem;
}

.cp-risk-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cp-risk-name {
    font-size: 0.82rem;
}

.cp-risk-pill {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.cp-risk-pill--resolved {
    color: #8fd4a0;
    background: rgba(80, 180, 110, 0.12);
    border: 1px solid rgba(80, 180, 110, 0.25);
}

.cp-risk-pill--partial {
    color: #e8b86d;
    background: rgba(232, 184, 109, 0.1);
    border: 1px solid rgba(232, 184, 109, 0.22);
}

.cp-risk-pill--missing {
    color: #e8a0a0;
    background: rgba(200, 90, 90, 0.1);
    border: 1px solid rgba(200, 90, 90, 0.2);
}

.cp-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.cp-overview-span-2 {
    grid-column: 1 / -1;
}

.cp-dino-panel--sidebar {
    position: fixed;
    left: 280px;
    bottom: 1.25rem;
    z-index: 1300;
    width: min(380px, calc(100vw - 300px));
}

@media (max-width: 960px) {
    body.authenticated.crm-client-portal-active .crm-shell {
        height: calc(100dvh - 2 * var(--space-sm));
        max-height: calc(100dvh - 2 * var(--space-sm));
    }

    .cp-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .cp-sidebar {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        height: auto;
        max-height: none;
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding: 0.75rem;
    }

    .cp-sidebar-logo {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
        flex: 1 1 180px;
    }

    .cp-sidebar-logo-img {
        max-height: 3.5rem;
    }

    .cp-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1 1 100%;
        order: 3;
    }

    .cp-sidebar-nav {
        padding-bottom: 0;
    }

    .cp-sidebar-footer {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        flex: 1 1 100%;
        order: 4;
        flex-direction: row;
        align-items: flex-end;
        gap: 0.75rem;
        margin-top: 0.5rem;
    }

    .cp-sidebar-mascot {
        flex: 0 0 120px;
    }

    .cp-sidebar-mascot-img {
        max-height: 8.5rem;
    }

    .cp-sidebar-mascot-bubble {
        width: min(8.5rem, 52%);
        top: 5%;
    }

    .cp-sidebar-mascot-bubble p {
        font-size: 0.68rem;
    }

    .cp-sidebar-dino {
        flex: 1 1 auto;
        min-width: 200px;
    }

    .cp-dino-panel--sidebar {
        left: 1rem;
        bottom: 1rem;
        width: min(380px, calc(100vw - 2rem));
    }

    .cp-overview--v2 {
        grid-template-columns: 1fr;
    }

    .cp-overview-aside {
        position: static;
    }

    .cp-overview-mid,
    .cp-overview-lower {
        grid-template-columns: 1fr;
    }

    .cp-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cp-risk-list {
        grid-template-columns: 1fr;
    }

    .cp-overview-grid {
        grid-template-columns: 1fr;
    }
}

/* —— Výdaje (portál) —— */
.cp-expense-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-expense-total-label {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--office-text-muted);
}

.cp-expense-total-value {
    margin: 0.15rem 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--office-brand, #d4bc82);
}

.cp-expense-change {
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    color: var(--office-text-muted);
}

.cp-expense-change--up {
    color: #e8a87c;
}

.cp-expense-change--down {
    color: #8bc9a8;
}

.cp-expense-top-title {
    margin: 0 0 0.45rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--office-text-muted);
}

.cp-expense-top-list {
    list-style: none;
    margin: 0 0 0.85rem;
    padding: 0;
}

.cp-expense-top-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    font-size: 0.84rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cp-card--expense-top .cp-expense-top-list {
    margin: 0;
    padding: 0 0.25rem 0.35rem;
}

.cp-expense-top-item {
    align-items: center;
}

.cp-expense-top-main {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.cp-expense-top-name {
    font-size: 0.88rem;
}

.cp-expense-top-cat {
    font-size: 0.72rem;
    color: var(--office-text-muted);
}

.cp-expense-top-amount {
    font-size: 0.92rem;
    white-space: nowrap;
}

.cp-expense-hint {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(212, 188, 130, 0.18);
    background: rgba(212, 188, 130, 0.06);
}

.cp-expense-hint--info {
    display: grid;
    gap: 0.65rem;
}

.cp-expense-hint--info p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--office-text-muted);
}

.cp-expense-item-cell {
    min-width: 10rem;
}

.cp-expense-item-name {
    font-weight: 600;
    font-size: 0.86rem;
}

.cp-expense-item-meta {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    color: var(--office-text-muted);
}

.cp-expense-monthly {
    font-weight: 600;
    white-space: nowrap;
}

.cp-expense-table--client th:last-child,
.cp-expense-table--client td:last-child {
    text-align: right;
}

.cp-expense-form {
    display: grid;
    gap: 0.55rem;
}

.cp-expense-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.cp-expense-category-field .form-label {
    display: block;
    margin-bottom: 0.32rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
}

.cp-expense-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

.cp-expense-category-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    min-height: 4.25rem;
    padding: 0.5rem 0.35rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.cp-expense-category-chip:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

.cp-expense-category-chip.is-active {
    border-color: rgba(212, 188, 130, 0.45);
    background: rgba(212, 188, 130, 0.08);
    box-shadow: 0 0 0 1px rgba(212, 188, 130, 0.12);
}

.cp-expense-category-chip-icon {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-size: 1rem;
    line-height: 1;
}

.cp-expense-category-chip--blue .cp-expense-category-chip-icon {
    background: rgba(77, 142, 247, 0.16);
}

.cp-expense-category-chip--orange .cp-expense-category-chip-icon {
    background: rgba(232, 148, 90, 0.16);
}

.cp-expense-category-chip--cyan .cp-expense-category-chip-icon {
    background: rgba(69, 196, 232, 0.16);
}

.cp-expense-category-chip--pink .cp-expense-category-chip-icon {
    background: rgba(217, 123, 196, 0.16);
}

.cp-expense-category-chip--green .cp-expense-category-chip-icon {
    background: rgba(94, 207, 154, 0.16);
}

.cp-expense-category-chip--purple .cp-expense-category-chip-icon {
    background: rgba(169, 140, 240, 0.16);
}

.cp-expense-category-chip--gold .cp-expense-category-chip-icon {
    background: rgba(212, 188, 130, 0.16);
}

.cp-expense-category-chip-label {
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

@media (max-width: 520px) {
    .cp-expense-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cp-expense-impact-preview {
    display: grid;
    gap: 0.22rem;
    margin-top: 0;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(212, 188, 130, 0.14);
    background: rgba(212, 188, 130, 0.06);
}

.cp-expense-impact-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.62);
}

.cp-expense-impact-row strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.cp-expense-form-check {
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    padding: 0.72rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
}

.cp-expense-form-check input[type='checkbox'] {
    width: 1.18rem;
    height: 1.18rem;
    margin: 0;
    accent-color: #c9a962;
}

.cp-expense-form-check-copy {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.cp-expense-form-check-copy strong {
    font-size: 0.76rem;
    line-height: 1.3;
}

.cp-expense-form-check-copy small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.64rem;
    line-height: 1.35;
}

.cp-expense-form-check--advanced {
    margin: 0 0 0.15rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.72);
}

.cp-expense-advanced {
    margin-top: 0.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.cp-expense-advanced > summary {
    cursor: pointer;
    padding: 0.48rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    list-style: none;
}

.cp-expense-advanced > summary::-webkit-details-marker {
    display: none;
}

.cp-expense-advanced > summary::after {
    content: '+';
    float: right;
    font-weight: 400;
}

.cp-expense-advanced[open] > summary::after {
    content: '−';
}

.cp-expense-advanced-body {
    padding: 0 0.65rem 0.65rem;
    display: grid;
    gap: 0.55rem;
}

.cp-expense-reserve-hint {
    display: grid;
    gap: 0.15rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: rgba(212, 188, 130, 0.08);
    border: 1px solid rgba(212, 188, 130, 0.16);
}

.cp-expense-reserve-hint strong {
    font-size: 1.1rem;
    color: var(--office-brand, #d4bc82);
}

.cp-expense-reserve-hint small {
    font-size: 0.72rem;
    color: var(--office-text-muted);
}

.cp-expense-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.cp-expense-hero {
    display: grid;
    gap: 1rem;
}

.cp-expense-stat--hero {
    padding: 1.35rem 1.5rem;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(212, 188, 130, 0.16), transparent 55%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(212, 188, 130, 0.22);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.cp-expense-stat--hero span {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.cp-expense-hero-value {
    display: block;
    margin-top: 0.35rem;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--office-brand, #d4bc82);
}

.cp-expense-summary-grid--secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cp-expense-stat--compact {
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
}

.cp-expense-stat--compact strong {
    font-size: 0.98rem;
}

.cp-expense-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 0 0.15rem 0.35rem;
}

.cp-expense-feature-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.05rem;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cp-expense-feature-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.cp-expense-feature-name {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}

.cp-expense-feature-amount {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--office-text, #f5f5f5);
}

.cp-expense-feature-amount span {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--office-text-muted);
}

.cp-expense-feature-detail {
    justify-self: start;
    margin-top: 0.15rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(212, 188, 130, 0.28);
    background: rgba(212, 188, 130, 0.08);
    color: var(--office-brand, #d4bc82);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.cp-expense-feature-detail:hover {
    background: rgba(212, 188, 130, 0.14);
    border-color: rgba(212, 188, 130, 0.42);
}

.cp-expense-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.cp-expense-breakdown-row {
    display: grid;
    gap: 0.45rem;
}

.cp-expense-breakdown-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.cp-expense-breakdown-name {
    font-size: 0.88rem;
    font-weight: 600;
}

.cp-expense-breakdown-meta {
    font-size: 0.78rem;
    color: var(--office-text-muted);
    white-space: nowrap;
}

.cp-expense-breakdown-meta strong {
    color: var(--office-brand, #d4bc82);
    font-weight: 700;
}

.cp-expense-breakdown-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.cp-expense-breakdown-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(212, 188, 130, 0.95), rgba(139, 201, 168, 0.75));
}

.cp-expense-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.cp-expense-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.05rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.cp-expense-card--inactive,
.cp-expense-card--excluded {
    opacity: 0.68;
}

.cp-expense-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-expense-card-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
}

.cp-expense-card-label {
    margin: 0.2rem 0 0;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--office-text-muted);
}

.cp-expense-card-amount {
    margin: 0.1rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.cp-expense-card-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    min-width: 7.5rem;
}

.cp-expense-card-btn {
    padding: 0.42rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(212, 188, 130, 0.28);
    background: rgba(212, 188, 130, 0.1);
    color: var(--office-brand, #d4bc82);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cp-expense-card-btn--ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--office-text-muted);
}

.cp-dino-insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.cp-dino-insight {
    display: grid;
    gap: 0.55rem;
    padding: 1rem 1.05rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.cp-dino-insight--green {
    border-color: rgba(139, 201, 168, 0.22);
    background: linear-gradient(160deg, rgba(139, 201, 168, 0.08), rgba(255, 255, 255, 0.02));
}

.cp-dino-insight--amber {
    border-color: rgba(232, 168, 124, 0.22);
    background: linear-gradient(160deg, rgba(232, 168, 124, 0.08), rgba(255, 255, 255, 0.02));
}

.cp-dino-insight--blue {
    border-color: rgba(126, 184, 218, 0.22);
    background: linear-gradient(160deg, rgba(126, 184, 218, 0.08), rgba(255, 255, 255, 0.02));
}

.cp-dino-insight-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.cp-dino-insight-emoji {
    font-size: 0.95rem;
    line-height: 1;
}

.cp-dino-insight-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
}

.cp-dino-insight-body {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--office-text-muted);
}

.cp-dino-insight-link {
    justify-self: start;
    padding: 0;
    border: 0;
    background: none;
    color: var(--office-brand, #d4bc82);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}

.cp-card--dino-expenses .cp-card-title {
    font-size: 1rem;
}

/* —— Expenses page v2 (KPI strip, split tiles, overview) —— */
.cp-exp-picto {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
}

.cp-exp-picto--lg {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 1.15rem;
    border-radius: 10px;
}

.cp-exp-picto--sm {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
    border-radius: 9px;
}

.cp-exp-picto--xs {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.88rem;
    border-radius: 8px;
}

.cp-exp-picto--blue {
    background: rgba(77, 142, 247, 0.16);
    box-shadow: 0 0 14px rgba(77, 142, 247, 0.14);
}

.cp-exp-picto--green {
    background: rgba(94, 207, 154, 0.16);
    box-shadow: 0 0 14px rgba(94, 207, 154, 0.14);
}

.cp-exp-picto--purple {
    background: rgba(169, 140, 240, 0.16);
    box-shadow: 0 0 14px rgba(169, 140, 240, 0.14);
}

.cp-exp-picto--orange {
    background: rgba(232, 148, 90, 0.16);
    box-shadow: 0 0 14px rgba(232, 148, 90, 0.14);
}

.cp-exp-picto--cyan {
    background: rgba(69, 196, 232, 0.16);
    box-shadow: 0 0 14px rgba(69, 196, 232, 0.14);
}

.cp-exp-picto--pink {
    background: rgba(217, 123, 196, 0.16);
    box-shadow: 0 0 14px rgba(217, 123, 196, 0.14);
}

.cp-exp-picto--gold {
    background: rgba(212, 188, 130, 0.16);
    box-shadow: 0 0 14px rgba(212, 188, 130, 0.14);
}

.cp-exp-picto--amber {
    background: rgba(232, 148, 90, 0.16);
    box-shadow: 0 0 14px rgba(232, 148, 90, 0.14);
}

.cp-exp-picto--neutral {
    background: rgba(255, 255, 255, 0.06);
}

.cp-expense-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.cp-expense-kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(160deg, rgba(22, 27, 38, 0.96), rgba(14, 17, 24, 0.98));
    min-height: 5rem;
}

button.cp-expense-kpi-card,
button.cp-expense-strategy-card {
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
}

.cp-expense-card-action {
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.cp-expense-card-action:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.18);
}

.cp-expense-card-action:focus-visible {
    outline: 3px solid rgba(126, 184, 218, 0.46);
    outline-offset: 3px;
}

.cp-expense-kpi-icon {
    display: none;
}

.cp-expense-kpi-body {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.cp-expense-kpi-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
}

.cp-expense-kpi-sub {
    font-size: 0.65rem;
    color: var(--office-text-muted);
}

.cp-expense-kpi-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.15;
    margin-top: 0.15rem;
}

.cp-expense-kpi-meta {
    font-size: 0.68rem;
    color: var(--office-text-muted);
}

.cp-expense-kpi-meta--badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 0.15rem;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: rgba(126, 184, 218, 0.12);
    color: #7eb8da;
    font-weight: 600;
}

.cp-expense-kpi-card--orange .cp-expense-kpi-meta--badge {
    background: rgba(139, 201, 168, 0.12);
    color: #8bc9a8;
}

.cp-expense-kpi-meta--positive {
    color: #8bc9a8;
    font-weight: 600;
}

.cp-expense-kpi-meta--negative {
    color: #e8a87c;
    font-weight: 600;
}

.cp-expense-kpi-progress {
    height: 4px;
    margin-top: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.cp-expense-kpi-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #b8a0e8, rgba(184, 160, 232, 0.55));
}

.cp-expense-kpi-card--orange .cp-expense-kpi-progress i {
    background: linear-gradient(90deg, #e8a87c, rgba(232, 168, 124, 0.55));
}

.cp-expense-strategy-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.cp-expense-strategy-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-height: 100%;
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(165deg, rgba(22, 27, 38, 0.96), rgba(14, 17, 24, 0.98));
}

.cp-expense-strategy-card h3,
.cp-expense-strategy-title {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.3;
}

.cp-expense-strategy-value {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.15;
}

.cp-expense-strategy-value span {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--office-text-muted);
}

.cp-expense-strategy-pct {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

.cp-expense-strategy-desc {
    margin: 0.1rem 0 0;
    font-size: 0.62rem;
    line-height: 1.35;
    color: var(--office-text-muted);
}

.cp-expense-strategy-card--protection .cp-expense-strategy-pct {
    color: #5ecf9a;
}

.cp-expense-strategy-card--wealth .cp-expense-strategy-pct {
    color: #a98cf0;
}

.cp-expense-strategy-card--ratio {
    align-items: center;
    text-align: center;
}

.cp-expense-strategy-card--ratio h3 {
    width: 100%;
}

.cp-expense-strategy-gauge {
    display: grid;
    justify-items: center;
    width: 100%;
    margin: 0.15rem 0 0.25rem;
}

.cp-expense-strategy-gauge-wrap {
    position: relative;
    width: 118px;
    height: 68px;
}

.cp-expense-strategy-gauge-icon {
    position: absolute;
    left: 50%;
    top: 1.15rem;
    transform: translateX(-50%);
    font-size: 1.05rem;
    line-height: 1;
    pointer-events: none;
}

.cp-expense-strategy-gauge-svg {
    width: 118px;
    height: auto;
}

.cp-expense-strategy-status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    margin-top: auto;
    padding: 0.42rem 0.55rem;
    border-radius: 999px;
    background: rgba(94, 207, 154, 0.08);
    text-align: left;
}

.cp-expense-strategy-status-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    flex-shrink: 0;
    font-size: 0.72rem;
    line-height: 1;
}

.cp-expense-strategy-status-copy strong {
    display: block;
    font-size: 0.72rem;
}

.cp-expense-strategy-status-copy span {
    display: block;
    margin-top: 0.05rem;
    font-size: 0.6rem;
    line-height: 1.35;
    color: var(--office-text-muted);
}

.cp-expense-strategy-card--balanced .cp-expense-strategy-status {
    background: rgba(94, 207, 154, 0.08);
}

.cp-expense-strategy-card--balanced .cp-expense-strategy-status-icon {
    background: rgba(94, 207, 154, 0.18);
    color: #5ecf9a;
}

.cp-expense-strategy-card--balanced .cp-expense-strategy-status-copy strong {
    color: #5ecf9a;
}

.cp-expense-strategy-card--protection .cp-expense-strategy-status {
    background: rgba(94, 207, 154, 0.08);
}

.cp-expense-strategy-card--protection .cp-expense-strategy-status-icon {
    background: rgba(94, 207, 154, 0.18);
    color: #5ecf9a;
}

.cp-expense-strategy-card--protection .cp-expense-strategy-status-copy strong {
    color: #5ecf9a;
}

.cp-expense-strategy-card--builder .cp-expense-strategy-status {
    background: rgba(169, 140, 240, 0.08);
}

.cp-expense-strategy-card--builder .cp-expense-strategy-status-icon {
    background: rgba(169, 140, 240, 0.18);
    color: #a98cf0;
}

.cp-expense-strategy-card--builder .cp-expense-strategy-status-copy strong {
    color: #a98cf0;
}

.cp-expense-strategy-card--neutral .cp-expense-strategy-status {
    background: rgba(255, 255, 255, 0.04);
}

.cp-expense-strategy-card--neutral .cp-expense-strategy-status-icon {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
}
.cp-expense-overview {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(212, 188, 130, 0.06) 0%, transparent 55%),
        linear-gradient(165deg, rgba(22, 27, 38, 0.96) 0%, rgba(14, 17, 24, 0.98) 100%);
    min-width: 0;
}

.cp-expense-overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.cp-expense-overview-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    scroll-margin-top: 5.5rem;
}

.cp-expense-overview.cp-target-highlight {
    animation: cp-target-highlight 1200ms ease-out;
}

@keyframes cp-target-highlight {
    0%, 30% { border-color: rgba(126, 184, 218, 0.68); }
    100% { border-color: rgba(255, 255, 255, 0.08); }
}

@media (prefers-reduced-motion: reduce) {
    .cp-expense-card-action,
    .cp-expense-overview.cp-target-highlight {
        transition: none;
        animation: none;
    }

    .cp-expense-card-action:hover {
        transform: none;
    }
}

.cp-expense-overview-body {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 0.45rem 0.85rem;
    align-items: start;
}

.cp-expense-overview .cp-expense-donut-wrap {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 0;
    flex-shrink: 0;
}

.cp-expense-overview .cp-expense-donut {
    display: block;
    width: 132px;
    height: 132px;
}

.cp-expense-overview .cp-expense-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20%;
    pointer-events: none;
}

.cp-expense-overview .cp-expense-donut-center strong {
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.cp-expense-overview .cp-expense-donut-center > span {
    margin-top: 0.08rem;
    font-size: 0.56rem;
    color: var(--office-text-muted);
}

.cp-expense-donut-wrap {
    position: relative;
    width: 184px;
    height: 184px;
    margin: 0 auto;
    flex-shrink: 0;
}

.cp-expense-donut {
    display: block;
    width: 184px;
    height: 184px;
}

.cp-expense-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 22%;
    pointer-events: none;
}

.cp-expense-donut-center strong {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.cp-expense-donut-center > span {
    margin-top: 0.1rem;
    font-size: 0.62rem;
    color: var(--office-text-muted);
}

.cp-expense-donut-center-disc {
    display: none;
}

.cp-expense-area-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.cp-expense-area-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(88px, 108px) auto;
    align-items: center;
    gap: 0.5rem 0.65rem;
    padding: 0.5rem 0.25rem 0.5rem 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.cp-expense-area-row--empty {
    opacity: 0.82;
}

.cp-expense-area-icon {
    display: none;
}

.cp-expense-area-row--blue .cp-expense-area-track i { background: #4d8ef7; }
.cp-expense-area-row--orange .cp-expense-area-track i { background: #e8945a; }
.cp-expense-area-row--cyan .cp-expense-area-track i { background: #45c4e8; }
.cp-expense-area-row--pink .cp-expense-area-track i { background: #d97bc4; }
.cp-expense-area-row--green .cp-expense-area-track i { background: #5ecf9a; }
.cp-expense-area-row--purple .cp-expense-area-track i { background: #a98cf0; }
.cp-expense-area-row--gold .cp-expense-area-track i { background: #d4bc82; }

.cp-expense-area-main {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.cp-expense-area-head strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
}

.cp-expense-area-head span {
    display: block;
    margin-top: 0.06rem;
    font-size: 0.66rem;
    color: var(--office-text-muted);
    line-height: 1.35;
}

.cp-expense-area-main strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
}

.cp-expense-area-main span {
    display: block;
    margin-top: 0.08rem;
    font-size: 0.68rem;
    color: var(--office-text-muted);
}

.cp-expense-area-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.cp-expense-area-track--empty {
    opacity: 0.35;
}

.cp-expense-area-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    min-width: 2px;
}

.cp-expense-area-stats {
    display: grid;
    justify-items: end;
    gap: 0.12rem;
    text-align: right;
    white-space: nowrap;
}

.cp-expense-area-amount {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.cp-expense-area-pct {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
}

.cp-expense-area-stats--empty {
    gap: 0.08rem;
}

.cp-expense-area-empty {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
}

.cp-expense-area-empty-hint {
    font-size: 0.62rem;
    font-weight: 500;
    color: rgba(232, 148, 90, 0.85);
}

.cp-expense-area-sep {
    display: none;
}

.cp-expense-area-chevron {
    color: rgba(255, 255, 255, 0.24);
    font-size: 1rem;
}

.cp-expense-overview-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.cp-expense-overview-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: #8bc9a8;
}

.cp-expense-overview-status span {
    width: 1.1rem;
    height: 1.1rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(139, 201, 168, 0.15);
    font-size: 0.68rem;
}

.cp-expenses-main {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.85fr);
    gap: 0.65rem;
    align-items: start;
}

.cp-dino-expense-panel {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(165deg, rgba(22, 27, 38, 0.96), rgba(14, 17, 24, 0.98));
    min-width: 0;
}

.cp-dino-expense-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

.cp-dino-head-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(212, 188, 130, 0.35);
    background: #0e1014;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.cp-dino-head-avatar img {
    display: block;
    width: 150%;
    height: 150%;
    object-fit: cover;
    object-position: center 8%;
    margin: -8% 0 0 -25%;
}

.cp-dino-expense-mascot {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    object-position: center 8%;
    flex-shrink: 0;
}

.cp-dino-expense-title {
    margin: 0;
    flex: 1;
    font-size: 0.92rem;
    font-weight: 700;
}

.cp-dino-expense-spark {
    color: var(--office-brand, #d4bc82);
    font-size: 0.85rem;
}

.cp-dino-expense-groups {
    display: grid;
    gap: 0.85rem;
}

.cp-dino-expense-group-title {
    margin: 0 0 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.82);
}

.cp-dino-expense-group-title span {
    margin-right: 0.15rem;
}

.cp-dino-expense-list {
    display: grid;
    gap: 0.45rem;
}

.cp-dino-expense-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: start;
    padding: 0.7rem 0.75rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
}

.cp-dino-expense-card--ok {
    border-color: rgba(94, 207, 154, 0.18);
    background: linear-gradient(160deg, rgba(94, 207, 154, 0.07), rgba(255, 255, 255, 0.02));
}

.cp-dino-expense-card--tip {
    border-color: rgba(232, 148, 90, 0.18);
    background: linear-gradient(160deg, rgba(232, 148, 90, 0.07), rgba(255, 255, 255, 0.02));
}

.cp-dino-expense-card--chance {
    border-color: rgba(77, 142, 247, 0.18);
    background: linear-gradient(160deg, rgba(77, 142, 247, 0.07), rgba(255, 255, 255, 0.02));
}

.cp-dino-expense-card .cp-exp-picto {
    align-self: start;
}

.cp-dino-expense-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
}

.cp-dino-expense-card-body h3 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
}

.cp-dino-expense-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.14rem 0.42rem;
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.cp-dino-expense-badge--ok {
    background: rgba(94, 207, 154, 0.14);
    color: #5ecf9a;
}

.cp-dino-expense-badge--tip {
    background: rgba(232, 148, 90, 0.14);
    color: #e8945a;
}

.cp-dino-expense-badge--chance {
    background: rgba(77, 142, 247, 0.14);
    color: #4d8ef7;
}

.cp-dino-expense-card-body p {
    margin: 0.35rem 0 0;
    font-size: 0.68rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.62);
}

.cp-dino-expense-card-action {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.45);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.cp-dino-expense-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}

.cp-expense-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    border-radius: 12px;
    border: 0;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.cp-expense-btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.cp-expense-btn--primary {
    color: #141820;
    background: linear-gradient(135deg, #e8d4a8, #d4bc82);
    box-shadow: 0 8px 20px rgba(212, 188, 130, 0.18);
}

.cp-expense-btn--ghost {
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cp-expense-btn--ghost.is-open {
    border-color: rgba(212, 188, 130, 0.28);
    color: var(--office-brand, #d4bc82);
}

.cp-expense-detail-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.cp-expense-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.cp-expense-detail-head h3 {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.cp-expense-detail-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cp-expense-filter {
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
}

.cp-expense-filter.is-active {
    border-color: rgba(212, 188, 130, 0.45);
    color: var(--office-brand, #d4bc82);
    background: rgba(212, 188, 130, 0.08);
}

.cp-expense-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.cp-expense-detail-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.cp-expense-detail-row:last-child {
    border-bottom: 0;
}

.cp-expense-detail-row--inactive,
.cp-expense-detail-row--excluded {
    opacity: 0.65;
}

.cp-expense-detail-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.cp-expense-detail-icon svg {
    width: 1rem;
    height: 1rem;
}

.cp-expense-detail-icon--blue { color: #5b8def; }
.cp-expense-detail-icon--orange { color: #e8a87c; }
.cp-expense-detail-icon--cyan { color: #56c8e8; }
.cp-expense-detail-icon--pink { color: #d48bc4; }
.cp-expense-detail-icon--green { color: #8bc9a8; }
.cp-expense-detail-icon--purple { color: #b8a0e8; }
.cp-expense-detail-icon--gold { color: #d4bc82; }

.cp-expense-detail-main {
    min-width: 0;
}

.cp-expense-detail-main strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
}

.cp-expense-detail-main span {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.72rem;
    color: var(--office-text-muted);
}

.cp-expense-detail-amount {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.cp-expense-detail-amount span {
    font-weight: 500;
    color: var(--office-text-muted);
}

.cp-expense-detail-tag {
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.cp-expense-detail-tag--contract {
    color: #8bc9a8;
}

.cp-expense-detail-tag--manual {
    color: rgba(255, 255, 255, 0.45);
}

.cp-expense-detail-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cp-expense-detail-btn {
    padding: 0.38rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cp-expense-detail-btn--ghost {
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--office-text-muted);
}

.cp-expenses-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.cp-expenses-page {
    display: grid;
    gap: 0.85rem;
}

.cp-expenses-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cp-expenses-toolbar-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.cp-expenses-kpi {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.cp-kpi-tile {
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    min-height: 3.5rem;
}

.cp-kpi-tile span {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--office-text-muted);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-kpi-tile strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-kpi-tile--lead {
    background: linear-gradient(145deg, rgba(212, 188, 130, 0.12), rgba(255, 255, 255, 0.03));
    border-color: rgba(212, 188, 130, 0.22);
}

.cp-kpi-tile--lead strong {
    font-size: 0.95rem;
    color: var(--office-brand, #d4bc82);
}

.cp-tile {
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: none;
    padding: 1.05rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    overflow: visible;
}

.cp-tile-head {
    flex-shrink: 0;
    margin-bottom: 0.45rem;
}

.cp-tile-head--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.cp-tile-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.cp-tile-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.cp-tile-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-tile-action {
    padding: 0;
    border: 0;
    background: none;
    color: #7eb8da;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.cp-tile-body {
    flex: 1;
    min-height: 0;
    overflow: visible;
    scrollbar-width: thin;
}

.cp-expenses-duo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.cp-expenses-bottom {
    display: grid;
    gap: 1.25rem;
}

.cp-banner {
    padding: 1.1rem 1.2rem 1.2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.cp-banner-head {
    margin-bottom: 0.85rem;
}

.cp-banner-head--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cp-banner-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.cp-banner-icon {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(124, 140, 248, 0.14);
}

.cp-banner-icon--shield {
    background: rgba(59, 130, 246, 0.14);
}

.cp-banner-icon--wealth {
    background: rgba(59, 130, 246, 0.14);
}

.cp-banner-icon--goals {
    background: rgba(192, 132, 252, 0.14);
}

.cp-banner-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.cp-banner-link {
    padding: 0;
    border: 0;
    background: none;
    color: #7eb8da;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cp-expense-widget-tabs {
    display: inline-flex;
    gap: 0.15rem;
    padding: 0.15rem;
    margin-bottom: 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.cp-expense-widget-tab {
    padding: 0.25rem 0.6rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--office-text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
}

.cp-expense-widget-tab.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--office-text, #f5f5f5);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.cp-expense-widget-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) auto;
    gap: 1rem;
    align-items: center;
}

.cp-expense-widget-label {
    margin: 0;
    font-size: 0.72rem;
    color: var(--office-text-muted);
}

.cp-expense-widget-summary--compact {
    gap: 0.5rem;
}

.cp-expense-widget-total {
    margin: 0.1rem 0 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cp-expense-widget-change {
    margin: 0.2rem 0 0;
    font-size: 0.68rem;
    font-weight: 700;
}

.cp-expense-widget-chart .cp-expense-donut {
    width: 72px;
    height: 72px;
}

.cp-expense-widget-change span {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--office-text-muted);
}

.cp-expense-widget-change--down {
    color: #6fcf97;
}

.cp-expense-widget-change--up {
    color: #e8a87c;
}

.cp-expense-widget-top-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.cp-expense-widget-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
}

.cp-expense-widget-top strong {
    font-size: 0.82rem;
}

.cp-expense-widget-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.cp-expense-widget-cat {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.8rem;
}

.cp-expense-widget-cat-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
}

.cp-expense-widget-cat-name {
    min-width: 0;
}

.cp-expense-widget-cat-val {
    font-weight: 600;
    white-space: nowrap;
}

.cp-expense-widget-cat-pct {
    color: var(--office-text-muted);
    min-width: 2.5rem;
    text-align: right;
}

.cp-expense-widget-chart .cp-expense-donut {
    width: 118px;
    height: 118px;
}

.cp-expense-widget-add {
    display: block;
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.72rem 1rem;
    border: 0;
    border-radius: 14px;
    background: rgba(124, 140, 248, 0.16);
    color: #c4b5fd;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.cp-protection-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.cp-protection-list--compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem 0.45rem;
}

.cp-protection-list--compact .cp-protection-row {
    padding: 0.28rem 0;
    border-bottom: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.35rem;
}

.cp-protection-list--compact .cp-protection-name {
    font-size: 0.68rem;
    line-height: 1.2;
}

.cp-protection-list--compact .cp-protection-pill {
    font-size: 0.58rem;
    padding: 0.12rem 0.35rem;
}

.cp-protection-list--compact .cp-protection-icon {
    width: 1.1rem;
    font-size: 0.75rem;
}

.cp-wealth-list--compact .cp-wealth-row {
    padding: 0.35rem 0;
    font-size: 0.74rem;
}

.cp-wealth-total--compact {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
}

.cp-wealth-total--compact strong {
    font-size: 0.92rem;
}

.cp-goal-highlight--compact {
    padding: 0.55rem 0.65rem;
    box-shadow: none;
}

.cp-goal-highlight--compact .cp-goal-highlight-name {
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
}

.cp-goal-highlight--compact .cp-goal-highlight-hint {
    margin-top: 0.35rem;
    font-size: 0.68rem;
}

.cp-doc-strip--compact {
    display: grid;
    gap: 0.35rem;
}

.cp-doc-card--compact .cp-doc-card-btn {
    padding: 0.45rem 0.55rem;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
}

.cp-doc-card--compact .cp-doc-card-name {
    font-size: 0.72rem;
}

.cp-aside-list--compact {
    gap: 0.35rem;
}

.cp-aside-link--compact {
    padding: 0.45rem 0.55rem;
}

.cp-aside-link--compact .cp-aside-link-title {
    font-size: 0.72rem;
    margin-bottom: 0.1rem;
}

.cp-aside-link--compact .cp-aside-link-body {
    font-size: 0.66rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cp-tile.cp-card--docs-strip,
.cp-tile.cp-card--aside {
    padding: 1.05rem 1.1rem;
    min-height: 200px;
    max-height: none;
}

.cp-expense-payments-panel {
    border-radius: 10px;
}

.cp-expense-payments-panel > summary {
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
}

.cp-protection-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cp-protection-row:last-child {
    border-bottom: 0;
}

.cp-protection-icon {
    width: 1.75rem;
    text-align: center;
    font-size: 0.95rem;
}

.cp-protection-name {
    font-size: 0.84rem;
    font-weight: 500;
}

.cp-protection-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.cp-protection-pill--resolved {
    color: #6fcf97;
    background: rgba(111, 207, 151, 0.12);
}

.cp-protection-pill--partial {
    color: #e8a87c;
    background: rgba(232, 168, 124, 0.12);
}

.cp-protection-pill--missing {
    color: #e57373;
    background: rgba(229, 115, 115, 0.12);
}

.cp-wealth-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cp-wealth-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.84rem;
}

.cp-wealth-row:last-child {
    border-bottom: 0;
}

.cp-wealth-icon {
    width: 1.75rem;
    text-align: center;
}

.cp-wealth-value {
    font-size: 0.9rem;
}

.cp-wealth-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-wealth-total span {
    font-size: 0.82rem;
    color: #7eb8da;
    font-weight: 600;
}

.cp-wealth-total strong {
    font-size: 1.15rem;
    color: #7eb8da;
}

.cp-goal-highlight {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(192, 132, 252, 0.1), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(192, 132, 252, 0.22);
    box-shadow: 0 0 24px rgba(192, 132, 252, 0.08);
}

.cp-goal-highlight-badge {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #c084fc;
}

.cp-goal-highlight-name {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    font-weight: 700;
}

.cp-goal-highlight-bar {
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.cp-goal-highlight-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(192, 132, 252, 0.55), #c084fc);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.45);
}

.cp-goal-highlight-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: var(--office-text-muted);
}

.cp-goal-highlight-meta strong {
    color: #c084fc;
}

.cp-goal-highlight-hint {
    margin: 0.55rem 0 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--office-text-muted);
}

.cp-expense-payments-panel {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.cp-expense-payments-panel > summary {
    cursor: pointer;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--office-text-muted);
    list-style: none;
}

.cp-expense-payments-panel > summary::-webkit-details-marker {
    display: none;
}

.cp-expense-payments-panel .cp-expense-card-list {
    padding: 0 0.85rem 0.85rem;
}

.cp-expense-stat {
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.cp-expense-stat span {
    display: block;
    font-size: 0.72rem;
    color: var(--office-text-muted);
    margin-bottom: 0.35rem;
}

.cp-expense-stat strong {
    font-size: 1.05rem;
}

.cp-expense-stat--wide {
    grid-column: 1 / -1;
}

.cp-expense-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 1rem;
}

.cp-expense-chart-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cp-expense-donut {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.cp-expense-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 160px;
}

.cp-expense-legend li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.28rem 0;
}

.cp-expense-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cp-expense-cat-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
}

.cp-expense-cat-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.cp-expense-cat-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(212, 188, 130, 0.85), rgba(212, 188, 130, 0.45));
}

.cp-expense-table-wrap {
    overflow-x: auto;
}

.cp-expense-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.cp-expense-table th,
.cp-expense-table td {
    padding: 0.55rem 0.45rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.cp-expense-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--office-text-muted);
}

.cp-expense-table-actions {
    white-space: nowrap;
}

.cp-empty--sm {
    font-size: 0.82rem;
}

.cp-expense-modal {
    width: min(calc(100% - 2rem), 620px);
    max-width: 620px;
    max-height: min(92vh, 860px);
    padding: 1.15rem 1.2rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(212, 188, 130, 0.07) 0%, transparent 55%),
        linear-gradient(165deg, rgba(22, 27, 38, 0.98) 0%, rgba(14, 17, 24, 0.99) 100%);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(212, 188, 130, 0.08);
    overflow-x: hidden;
    overflow-y: auto;
}

.cp-expense-modal:has(.cp-expense-advanced[open]) {
    max-height: min(90vh, 920px);
    overflow-y: auto;
}

.cp-expense-modal .modal-header {
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cp-expense-modal .modal-header h3 {
    font-size: 1.38rem;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    letter-spacing: -0.015em;
}

.cp-expense-modal .modal-header .icon-btn {
    color: rgba(255, 255, 255, 0.45);
}

.cp-expense-modal .modal-header .icon-btn:hover {
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.06);
}

.cp-expense-modal .modal-body {
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    padding: 0;
}

.cp-expense-modal .form-group {
    gap: 0.38rem;
}

.cp-expense-modal .form-group label {
    margin-bottom: 0;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.cp-expense-modal .form-input,
.cp-expense-modal .form-textarea {
    min-height: 2.7rem;
    padding: 0.62rem 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.86rem;
}

.cp-expense-modal .modal-footer {
    justify-content: flex-end;
    gap: 0.45rem;
    padding-top: 0.85rem;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.cp-expense-modal .modal-footer .btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.52);
    font-weight: 500;
    font-size: 0.82rem;
    padding: 0.55rem 0.9rem;
    box-shadow: none;
}

.cp-expense-modal .modal-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.72);
}

.cp-expense-modal .modal-footer .btn-primary {
    min-width: 7.5rem;
    background: linear-gradient(135deg, #dcc392 0%, #c9a962 100%);
    color: #12141a;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.62rem 1.2rem;
    border: none;
    box-shadow: 0 4px 18px rgba(212, 188, 130, 0.32);
}

.cp-expense-modal .modal-footer .btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 22px rgba(212, 188, 130, 0.4);
}

.cp-expense-modal .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.55rem;
}

@media (max-width: 640px) {
    .cp-expense-modal {
        width: min(calc(100% - 1rem), 620px);
        max-height: calc(100dvh - 1rem);
        padding: 0.9rem;
        border-radius: 18px;
    }

    .cp-expense-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cp-expense-modal .form-row {
        grid-template-columns: 1fr;
    }
}

.cp-expense-source {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
}

.cp-expense-source--contract {
    color: #8bc9a8;
    background: rgba(139, 201, 168, 0.12);
}

.cp-expense-source--manual {
    color: var(--office-brand, #d4bc82);
    background: rgba(212, 188, 130, 0.12);
}

.cp-expense-row--inactive {
    opacity: 0.72;
}

.cp-expense-inactive-tag {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.68rem;
    color: var(--office-text-muted);
}

.cp-expense-row--excluded {
    opacity: 0.65;
}

.cp-expense-excluded-tag,
.cp-expense-excluded-hint {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.68rem;
    color: #e8a87c;
}

.cp-expense-excluded-hint {
    margin-left: 0;
    max-width: 12rem;
    line-height: 1.3;
}

@media (max-width: 1100px) {
    .cp-expense-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cp-expenses-main {
        grid-template-columns: 1fr;
    }

    .cp-portfolio-main,
    .cp-portfolio-allocation-body {
        grid-template-columns: 1fr;
    }

    .cp-expenses-kpi {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cp-overview-tiles,
    .cp-expenses-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .cp-expense-summary-grid,
    .cp-expense-summary-grid--secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cp-expense-kpi-strip,
    .cp-expenses-main,
    .cp-portfolio-kpi-strip {
        grid-template-columns: 1fr;
    }

    .cp-portfolio-main {
        grid-template-columns: 1fr;
    }

    .cp-expense-strategy-grid {
        grid-template-columns: 1fr;
    }

    .cp-expense-strategy-card--ratio {
        order: -1;
    }

    .cp-expense-overview-body {
        grid-template-columns: 1fr;
    }

    .cp-expense-area-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .cp-expense-area-chevron {
        display: none;
    }

    .cp-expense-detail-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .cp-expense-detail-amount,
    .cp-expense-detail-tag,
    .cp-expense-detail-actions {
        grid-column: 1 / -1;
    }

    .cp-expense-detail-actions {
        flex-wrap: wrap;
    }

    .cp-expenses-kpi {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cp-overview-tiles,
    .cp-expenses-tiles {
        grid-template-columns: 1fr;
    }

    .cp-expense-feature-grid {
        grid-template-columns: 1fr;
    }

    .cp-expense-widget-summary {
        grid-template-columns: 1fr;
    }

    .cp-expenses-duo {
        grid-template-columns: 1fr;
    }

    .cp-expense-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .cp-expense-card-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
    }

    .cp-protection-list--compact {
        grid-template-columns: 1fr;
    }

    .cp-expense-detail-grid {
        grid-template-columns: 1fr;
    }

    .cp-portfolio-main {
        grid-template-columns: 1fr;
    }

    .cp-portfolio-comments {
        grid-template-columns: 1fr;
    }
}

/* Portfolio — klientský portál */
.cp-portfolio-page {
    display: grid;
    gap: 1rem;
}

.cp-portfolio-head {
    display: grid;
    gap: 0.35rem;
}

.cp-portfolio-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.cp-portfolio-lead {
    margin: 0;
    max-width: 42rem;
    color: var(--office-text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.cp-portfolio-main {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1rem;
    align-items: start;
}

.cp-portfolio-allocation-body {
    display: grid;
    grid-template-columns: minmax(9rem, 11rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.cp-portfolio-donut-wrap {
    margin: 0 auto;
}

.cp-portfolio-allocation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.cp-portfolio-allocation-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.55rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.cp-portfolio-allocation-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.cp-portfolio-allocation-label {
    font-size: 0.82rem;
}

.cp-portfolio-allocation-pct {
    font-size: 0.78rem;
    color: var(--office-text-muted);
    font-weight: 600;
}

.cp-portfolio-allocation-value {
    font-size: 0.82rem;
    font-weight: 700;
}

.cp-portfolio-comments {
    display: grid;
    gap: 1rem;
}

.cp-portfolio-comment-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.88rem;
    line-height: 1.55;
}

.cp-portfolio-comment--dino .cp-card-head {
    border-bottom-color: rgba(126, 184, 218, 0.18);
}

.cp-portfolio-comment--advisor .cp-card-head {
    border-bottom-color: rgba(139, 201, 168, 0.18);
}

html[data-theme='light'] .cp-portfolio-allocation-row {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .cp-portfolio-comment-text {
    color: var(--office-text);
}

.cp-portfolio-mock-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(232, 200, 124, 0.45);
    background: rgba(232, 200, 124, 0.12);
    color: var(--office-text);
    font-size: 0.88rem;
    line-height: 1.45;
}

.cp-portfolio-mock-banner strong {
    color: #e8c87c;
    font-weight: 700;
}

html[data-theme='light'] .cp-portfolio-mock-banner {
    background: rgba(180, 130, 20, 0.1);
    border-color: rgba(180, 130, 20, 0.35);
}

html[data-theme='light'] .cp-portfolio-mock-banner strong {
    color: #9a6b00;
}

.cp-portfolio-empty-message {
    margin: 0 0 0.5rem;
    color: var(--office-text);
    line-height: 1.55;
}

.cp-portfolio-empty-hint {
    margin: 0;
    color: var(--office-text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.cp-portfolio-investment-list,
.cp-portfolio-next-steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.cp-portfolio-investment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 1rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-portfolio-investment-label {
    grid-column: 1 / -1;
    font-weight: 600;
}

.cp-portfolio-investment-meta {
    color: var(--office-text-muted);
    font-size: 0.84rem;
}

.cp-portfolio-investment-value {
    justify-self: end;
}

.cp-portfolio-next-step {
    position: relative;
    padding-left: 1.1rem;
    color: var(--office-text);
    line-height: 1.45;
}

.cp-portfolio-next-step::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--office-accent, #7eb8da);
}

html[data-theme='light'] .cp-portfolio-investment-row {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

/* Portfolio view toggle + report mode */
.cp-portfolio-view-toolbar {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-portfolio-view-btn {
    border: 0;
    background: transparent;
    color: var(--office-text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.cp-portfolio-view-btn.is-active {
    background: rgba(126, 184, 218, 0.18);
    color: #e8f4fc;
}

.cp-portfolio-view-btn:hover:not(.is-active) {
    color: var(--office-text);
}

html[data-theme='light'] .cp-portfolio-view-toolbar {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .cp-portfolio-view-btn.is-active {
    background: rgba(37, 99, 235, 0.12);
    color: #1e40af;
}

.cp-portfolio-page--report {
    gap: 1.25rem;
}

.cp-pr-draft-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: baseline;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    background: rgba(232, 200, 124, 0.12);
    border: 1px solid rgba(232, 200, 124, 0.35);
    font-size: 0.88rem;
}

.cp-pr-draft-banner strong {
    color: #e8c87c;
    font-weight: 700;
}

html[data-theme='light'] .cp-pr-draft-banner {
    background: rgba(180, 130, 20, 0.1);
    border-color: rgba(180, 130, 20, 0.35);
}

html[data-theme='light'] .cp-pr-draft-banner strong {
    color: #9a6b00;
}

.cp-pr-report {
    display: grid;
    gap: 1.5rem;
}

.cp-pr-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    padding: 2rem 1.75rem;
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(126, 184, 218, 0.22), transparent 55%),
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(139, 201, 168, 0.14), transparent 50%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-pr-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.65rem;
    max-width: 44rem;
}

.cp-pr-eyebrow {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(126, 184, 218, 0.95);
    font-weight: 600;
}

.cp-pr-hero-title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.cp-pr-hero-sub {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
    max-width: 38rem;
}

.cp-pr-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    margin-top: 0.35rem;
}

.cp-pr-badge {
    display: inline-flex;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(126, 184, 218, 0.18);
    border: 1px solid rgba(126, 184, 218, 0.35);
    font-size: 0.78rem;
    font-weight: 600;
}

.cp-pr-meta-item {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.62);
}

html[data-theme='light'] .cp-pr-hero {
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(37, 99, 235, 0.1), transparent 55%),
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(16, 185, 129, 0.08), transparent 50%),
        linear-gradient(135deg, #f8fafc, #eef2ff);
    border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .cp-pr-hero-sub,
html[data-theme='light'] .cp-pr-meta-item {
    color: var(--office-text-muted);
}

.cp-pr-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.cp-pr-debug-banner {
    padding: 0.45rem 0.75rem;
    border-radius: 0.4rem;
    background: rgba(126, 184, 218, 0.12);
    border: 1px dashed rgba(126, 184, 218, 0.45);
    font-size: 0.78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: rgba(255, 255, 255, 0.75);
}

html[data-theme='light'] .cp-pr-debug-banner {
    color: var(--office-text-muted);
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.35);
}

.cp-pr-kpi-value {
    font-size: 1.35rem !important;
}

.cp-pr-kpi-value--pending {
    font-size: 1rem !important;
    color: var(--office-text-muted);
    font-weight: 600;
}

.cp-pr-pending {
    color: var(--office-text-muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.cp-pr-allocation-pending .cp-portfolio-empty-message {
    margin: 0 0 0.5rem;
}

.cp-pr-chapter {
    display: grid;
    gap: 0.85rem;
}

.cp-pr-chapter-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cp-pr-summary-headline {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
}

.cp-pr-summary-body {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
    max-width: 48rem;
}

.cp-pr-highlights {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.45rem;
}

.cp-pr-highlights li {
    position: relative;
    padding-left: 1.1rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
}

.cp-pr-highlights li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #8bc9a8;
    font-weight: 700;
}

html[data-theme='light'] .cp-pr-summary-body,
html[data-theme='light'] .cp-pr-highlights li {
    color: var(--office-text);
}

.cp-pr-allocation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.cp-pr-allocation-card .cp-card-title {
    font-size: 1rem;
}

.cp-pr-table-wrap {
    overflow-x: auto;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-pr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.cp-pr-table th,
.cp-pr-table td {
    padding: 0.75rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-pr-table th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--office-text-muted);
    background: rgba(255, 255, 255, 0.03);
}

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

.cp-pr-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.cp-pr-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.cp-pr-inv-provider {
    display: block;
    font-size: 0.78rem;
    color: var(--office-text-muted);
    font-weight: 400;
    margin-top: 0.15rem;
}

.cp-pr-return--pos {
    color: #8bc9a8;
    font-weight: 600;
}

.cp-pr-return--neg {
    color: #e8a87c;
    font-weight: 600;
}

.cp-pr-dino {
    padding: 1.25rem 1.35rem;
    border-radius: 0.85rem;
    background: rgba(126, 184, 218, 0.08);
    border: 1px solid rgba(126, 184, 218, 0.18);
}

.cp-pr-dino-lead {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.cp-pr-dino-body p {
    margin: 0.65rem 0 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
}

.cp-pr-advisor-note {
    margin: 1rem 0 0;
    padding: 0.85rem 1rem;
    border-left: 3px solid rgba(139, 201, 168, 0.65);
    background: rgba(139, 201, 168, 0.08);
    border-radius: 0 0.5rem 0.5rem 0;
}

.cp-pr-advisor-note span {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--office-text-muted);
    margin-bottom: 0.35rem;
}

.cp-pr-advisor-note p {
    margin: 0;
    line-height: 1.55;
}

html[data-theme='light'] .cp-pr-dino {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.15);
}

html[data-theme='light'] .cp-pr-dino-body p {
    color: var(--office-text);
}

html[data-theme='light'] .cp-pr-table-wrap {
    border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .cp-pr-table th {
    background: rgba(15, 23, 42, 0.03);
}

.cp-pr-swot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.cp-pr-swot-col {
    padding: 1.1rem 1.15rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-pr-swot-col--strengths {
    background: rgba(139, 201, 168, 0.08);
    border-color: rgba(139, 201, 168, 0.2);
}

.cp-pr-swot-col--weaknesses {
    background: rgba(232, 168, 124, 0.08);
    border-color: rgba(232, 168, 124, 0.2);
}

.cp-pr-swot-title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.cp-pr-swot-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.cp-pr-swot-list li {
    display: grid;
    gap: 0.2rem;
    font-size: 0.88rem;
}

.cp-pr-swot-list li strong {
    font-size: 0.9rem;
}

.cp-pr-swot-list li span {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.45;
}

html[data-theme='light'] .cp-pr-swot-list li span {
    color: var(--office-text-muted);
}

.cp-pr-rec-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.cp-pr-rec {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem 1rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-pr-rec--high {
    border-color: rgba(232, 168, 124, 0.35);
}

.cp-pr-rec-priority {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--office-text-muted);
}

.cp-pr-rec p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
}

html[data-theme='light'] .cp-pr-rec {
    background: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .cp-pr-rec p {
    color: var(--office-text-muted);
}

.cp-pr-strategy-body {
    margin: 0;
    line-height: 1.6;
    max-width: 44rem;
}

.cp-pr-pillars {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cp-pr-pillars li {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(196, 168, 232, 0.15);
    border: 1px solid rgba(196, 168, 232, 0.3);
    font-size: 0.82rem;
    font-weight: 600;
}

.cp-pr-action-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.cp-pr-action {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-pr-action-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(126, 184, 218, 0.2);
    font-weight: 700;
    font-size: 0.9rem;
}

.cp-pr-action-body {
    display: grid;
    gap: 0.25rem;
}

.cp-pr-action-meta {
    font-size: 0.8rem;
    color: var(--office-text-muted);
}

html[data-theme='light'] .cp-pr-action {
    background: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.08);
}

@media (max-width: 960px) {
    .cp-pr-kpi-grid,
    .cp-pr-allocation-grid,
    .cp-pr-swot {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .cp-pr-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cp-pr-hero {
        padding: 1.35rem 1.15rem;
    }
}

/* =========================================================
   Klientský portál — světlý private banking redesign (2026-07)
   Zachovává původní shell, navigaci i všechny interakce.
   ========================================================= */

body.crm-client-portal-active .cp-shell {
    --cp-canvas: #f4f6f8;
    --cp-sidebar: #ffffff;
    --cp-surface: #ffffff;
    --cp-surface-soft: #f8f9fb;
    --cp-line: rgba(26, 35, 49, 0.085);
    --cp-line-strong: rgba(26, 35, 49, 0.14);
    --cp-ink: #171b24;
    --cp-muted: #6c7482;
    --cp-gold: #bd9650;
    --cp-gold-soft: #f8f0dd;
    --cp-shadow: 0 8px 28px rgba(31, 39, 53, 0.07);
    --cp-shadow-hover: 0 14px 38px rgba(31, 39, 53, 0.105);
}

html[data-theme='light'] body.crm-client-portal-active {
    background: #f4f2ed;
    background-image: none;
    color: #171b24;
}

html[data-theme='dark'] body.crm-client-portal-active {
    background: #10141a;
    background-image: none;
    color: #f4f6f8;
}

body.crm-client-portal-active .office-ambient-layer {
    display: none !important;
}

html[data-theme='dark'] body.crm-client-portal-active .cp-shell {
    --cp-canvas: #11151b;
    --cp-sidebar: #181c23;
    --cp-surface: #1b2028;
    --cp-surface-soft: #212731;
    --cp-line: rgba(255, 255, 255, 0.07);
    --cp-line-strong: rgba(255, 255, 255, 0.12);
    --cp-ink: #f4f6f8;
    --cp-muted: #a5adba;
    --cp-gold: #d4bc82;
    --cp-gold-soft: rgba(212, 188, 130, 0.12);
    --cp-shadow: 0 10px 34px rgba(0, 0, 0, 0.24);
    --cp-shadow-hover: 0 16px 44px rgba(0, 0, 0, 0.32);
}

body.crm-client-portal-active .cp-shell {
    grid-template-columns: clamp(250px, 15.5vw, 270px) minmax(0, 1fr) clamp(260px, 16.5vw, 290px);
    gap: clamp(0.9rem, 1.15vw, 1.25rem);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.crm-client-portal-active .cp-sidebar {
    position: sticky;
    top: 1rem;
    padding: 1.25rem 1rem 1rem;
    border: 1px solid var(--cp-line);
    border-radius: 20px;
    background: var(--cp-sidebar);
    box-shadow: var(--cp-shadow);
}

body.crm-client-portal-active .cp-sidebar-logo {
    position: relative;
    min-height: 92px;
    display: flex;
    align-items: center;
    padding: 1rem 0.9rem;
    margin-bottom: 0.9rem;
    border: 1px solid var(--cp-line);
    border-radius: 16px;
    background: linear-gradient(145deg, #ece9e1, #fbfaf7 68%);
    box-shadow: 0 9px 24px rgba(31, 39, 53, 0.08);
    overflow: hidden;
}

body.crm-client-portal-active .cp-sidebar-logo::before {
    content: none;
}

body.crm-client-portal-active .cp-sidebar-logo-img {
    width: 100%;
    height: auto;
    max-height: 3.85rem;
    object-fit: contain;
    object-position: left center;
    filter: none;
    opacity: 1;
    transform: translateZ(0);
}

html[data-theme='dark'] body.crm-client-portal-active .cp-sidebar-logo {
    border-color: rgba(212, 188, 130, 0.2);
    background:
        radial-gradient(circle at 12% 20%, rgba(212, 188, 130, 0.13), transparent 38%),
        #111318;
    box-shadow: 0 12px 26px rgba(8, 10, 14, 0.18);
}

html[data-theme='dark'] body.crm-client-portal-active .cp-sidebar-logo::before {
    display: none;
}

html[data-theme='dark'] body.crm-client-portal-active .cp-sidebar-logo-img {
    filter: none;
    opacity: 0.96;
}

body.crm-client-portal-active .cp-sidebar-nav {
    gap: 0.25rem;
    padding: 0;
}

body.crm-client-portal-active .cp-sidebar-nav-item {
    min-height: 42px;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: 11px;
    color: var(--cp-muted);
    font-size: 0.82rem;
    font-weight: 550;
}

body.crm-client-portal-active .cp-sidebar-nav-item:hover {
    background: var(--cp-surface-soft);
    color: var(--cp-ink);
}

body.crm-client-portal-active .cp-sidebar-nav-item.is-active {
    background: var(--cp-gold-soft);
    color: #8d6827;
}

html[data-theme='dark'] body.crm-client-portal-active .cp-sidebar-nav-item.is-active {
    color: var(--cp-gold);
}

body.crm-client-portal-active .cp-sidebar-nav-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.72;
}

body.crm-client-portal-active .cp-sidebar-footer {
    position: static;
    gap: 0.75rem;
    margin: 1rem 0 0;
    padding: 0.75rem 0 0;
    background: transparent;
}

body.crm-client-portal-active .cp-sidebar-mascot {
    aspect-ratio: 838 / 962;
    min-height: 0;
    border-radius: 16px;
    border: 1px solid var(--cp-line);
    background: #fbfaf7;
    box-shadow: 0 9px 24px rgba(31, 39, 53, 0.08);
    overflow: hidden;
}

body.crm-client-portal-active .cp-sidebar-mascot-img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center;
    filter: none;
}

body.crm-client-portal-active .cp-sidebar-mascot-img--dark {
    display: none;
}

html[data-theme='dark'] body.crm-client-portal-active .cp-sidebar-mascot-img--light {
    display: none;
}

html[data-theme='dark'] body.crm-client-portal-active .cp-sidebar-mascot-img--dark {
    display: block;
}

html[data-theme='dark'] body.crm-client-portal-active .cp-sidebar-mascot {
    border-color: rgba(212, 188, 130, 0.18);
    background: #0d0f13;
    box-shadow: 0 12px 26px rgba(8, 10, 14, 0.2);
}

body.crm-client-portal-active .cp-sidebar-mascot-bubble {
    display: none;
}

body.crm-client-portal-active .cp-sidebar-mascot-bubble::after {
    display: none;
}

body.crm-client-portal-active .cp-sidebar-mascot-bubble::before {
    background: #fff;
    border-color: var(--cp-line);
}

body.crm-client-portal-active .cp-sidebar-mascot-bubble p {
    color: var(--cp-ink);
}

html[data-theme='dark'] body.crm-client-portal-active .cp-sidebar-mascot-bubble {
    background: rgba(28, 33, 42, 0.96);
}

html[data-theme='dark'] body.crm-client-portal-active .cp-sidebar-mascot-bubble::before {
    background: #1c212a;
}

body.crm-client-portal-active .cp-sidebar-dino {
    padding: 0.8rem;
    border: 1px solid var(--cp-line);
    border-radius: 14px;
    background: var(--cp-surface);
    box-shadow: 0 5px 20px rgba(31, 39, 53, 0.045);
}

body.crm-client-portal-active .cp-sidebar-dino-title {
    color: var(--cp-ink);
}

body.crm-client-portal-active .cp-sidebar-dino-lead {
    color: var(--cp-muted);
}

body.crm-client-portal-active .cp-coming-soon {
    display: grid;
    place-items: center;
    min-height: 280px;
    padding: 2.5rem;
    text-align: center;
}

body.crm-client-portal-active .cp-coming-soon-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0.8rem;
    border-radius: 999px;
    background: var(--cp-gold-soft);
    color: var(--cp-gold);
}

body.crm-client-portal-active .cp-coming-soon-eyebrow {
    margin: 0 0 0.3rem;
    color: var(--cp-muted);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.crm-client-portal-active .cp-coming-soon-title {
    margin: 0;
    color: var(--cp-ink);
    font-size: 1.35rem;
}

body.crm-client-portal-active .cp-coming-soon-copy {
    margin: 0.5rem 0 0;
    color: var(--cp-muted);
    line-height: 1.5;
}

body.crm-client-portal-active .cp-main {
    min-width: 0;
    padding: 1.35rem 0 3rem;
    background: transparent;
}

body.crm-client-portal-active .cp-main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

body.crm-client-portal-active .cp-main-greeting {
    color: var(--cp-ink);
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
    font-weight: 650;
    letter-spacing: -0.03em;
}

body.crm-client-portal-active .cp-client-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    gap: 0.7rem 1.25rem;
    max-width: min(100%, 42rem);
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--cp-line);
    border-radius: 16px;
    background: var(--cp-surface);
    box-shadow: 0 8px 24px rgba(31, 39, 53, 0.05);
}

body.crm-client-portal-active .cp-client-summary div {
    min-width: 0;
}

body.crm-client-portal-active .cp-client-summary dt {
    margin-bottom: 0.2rem;
    color: var(--cp-muted);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.crm-client-portal-active .cp-client-summary dd {
    margin: 0;
    color: var(--cp-ink);
    font-size: 0.82rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

body.crm-client-portal-active .cp-cashflow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

body.crm-client-portal-active .cp-cashflow-grid article {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--cp-line);
    border-radius: 14px;
    background: var(--cp-surface-soft);
}

body.crm-client-portal-active .cp-cashflow-grid span {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--cp-muted);
    font-size: 0.8rem;
}

body.crm-client-portal-active .cp-cashflow-grid strong {
    color: var(--cp-ink);
    font-size: clamp(1rem, 1.8vw, 1.35rem);
}

body.crm-client-portal-active .cp-cashflow-note {
    margin-top: 1rem;
}

body.crm-client-portal-active .cp-dino-page .cp-dino-chips {
    margin-bottom: 1rem;
}

body.crm-client-portal-active .cp-main-lead,
body.crm-client-portal-active .cp-card-lead,
body.crm-client-portal-active .cp-kpi-hint,
body.crm-client-portal-active .cp-aside-link-body {
    color: var(--cp-muted);
}

body.crm-client-portal-active .cp-overview,
body.crm-client-portal-active .cp-page-stack {
    gap: 1.5rem;
}

body.crm-client-portal-active .cp-overview--v2 {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

body.crm-client-portal-active .cp-overview-body,
body.crm-client-portal-active .cp-overview-aside {
    gap: 1.15rem;
}

body.crm-client-portal-active .cp-right-rail {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    padding-top: 1.35rem;
}

body.crm-client-portal-active .cp-right-rail .cp-card {
    width: 100%;
    min-width: 0;
}

body.crm-client-portal-active .cp-overview-tiles,
body.crm-client-portal-active .cp-expenses-tiles {
    gap: 1rem;
}

body.crm-client-portal-active .cp-overview-tiles {
    grid-template-columns: minmax(360px, 1.15fr) minmax(270px, 0.85fr) minmax(300px, 1fr);
}

body.crm-client-portal-active .cp-card,
body.crm-client-portal-active .cp-tile,
body.crm-client-portal-active .cp-section {
    min-width: 0;
    border: 1px solid var(--cp-line);
    border-radius: 18px;
    background: var(--cp-surface);
    box-shadow: var(--cp-shadow);
}

body.crm-client-portal-active .cp-card {
    padding: 1.35rem 1.45rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.crm-client-portal-active .cp-card:hover {
    border-color: rgba(189, 150, 80, 0.18);
    box-shadow: var(--cp-shadow-hover);
}

body.crm-client-portal-active .cp-card-title,
body.crm-client-portal-active .cp-kpi-value,
body.crm-client-portal-active .cp-finance-total strong,
body.crm-client-portal-active .cp-aside-link-title,
body.crm-client-portal-active .cp-protection-name,
body.crm-client-portal-active .cp-wealth-row,
body.crm-client-portal-active .cp-goal-highlight-name,
body.crm-client-portal-active .cp-expense-total-value {
    color: var(--cp-ink);
}

body.crm-client-portal-active .cp-card-title {
    font-weight: 650;
    letter-spacing: -0.015em;
}

body.crm-client-portal-active .cp-kpi-row {
    gap: 1rem;
}

body.crm-client-portal-active .cp-kpi-tile {
    min-height: 8.3rem;
    min-width: 0;
}

body.crm-client-portal-active .cp-kpi-top,
body.crm-client-portal-active .cp-kpi-label,
body.crm-client-portal-active .cp-kpi-hint {
    min-width: 0;
}

body.crm-client-portal-active .cp-kpi-hint {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

body.crm-client-portal-active .cp-kpi-icon {
    width: 2rem;
    height: 2rem;
    padding: 0.45rem;
    border-radius: 10px;
    color: #9d752f;
    background: var(--cp-gold-soft);
}

body.crm-client-portal-active .cp-kpi-label {
    color: var(--cp-muted);
}

body.crm-client-portal-active .cp-mini-bar,
body.crm-client-portal-active .cp-goal-bar {
    background: rgba(31, 39, 53, 0.08);
}

html[data-theme='dark'] body.crm-client-portal-active .cp-mini-bar,
html[data-theme='dark'] body.crm-client-portal-active .cp-goal-bar {
    background: rgba(255, 255, 255, 0.08);
}

body.crm-client-portal-active .cp-overview-mid,
body.crm-client-portal-active .cp-overview-lower {
    gap: 1rem;
}

body.crm-client-portal-active .cp-finance-row,
body.crm-client-portal-active .cp-goal-stats,
body.crm-client-portal-active .cp-goal-sublist,
body.crm-client-portal-active .cp-doc-list li,
body.crm-client-portal-active .cp-anniv-item {
    border-color: var(--cp-line);
}

body.crm-client-portal-active .cp-finance-total,
body.crm-client-portal-active .cp-card--goal,
body.crm-client-portal-active .cp-dino-next {
    border-color: rgba(189, 150, 80, 0.18);
    background: linear-gradient(145deg, var(--cp-gold-soft), var(--cp-surface));
}

body.crm-client-portal-active .cp-card--chart .cp-chart-wrap,
body.crm-client-portal-active .cp-contract-card,
body.crm-client-portal-active .cp-fp-card,
body.crm-client-portal-active .cp-rec-card,
body.crm-client-portal-active .cp-aside-link,
body.crm-client-portal-active .cp-dino-chip,
body.crm-client-portal-active .cp-dino-input {
    border-color: var(--cp-line);
    background: var(--cp-surface-soft);
    color: var(--cp-ink);
}

body.crm-client-portal-active .cp-aside-link:hover,
body.crm-client-portal-active .cp-dino-chip:hover {
    border-color: rgba(189, 150, 80, 0.32);
    background: var(--cp-gold-soft);
}

body.crm-client-portal-active .cp-btn--primary {
    border-radius: 10px;
    background: linear-gradient(135deg, #c7a65e, #e1c477);
    color: #251d0f;
    box-shadow: 0 6px 16px rgba(189, 150, 80, 0.18);
}

body.crm-client-portal-active .cp-btn--secondary,
body.crm-client-portal-active .cp-btn--ghost,
body.crm-client-portal-active .cd-portal-settings-btn {
    border-color: var(--cp-line-strong);
    background: var(--cp-surface);
    color: var(--cp-ink);
    box-shadow: none;
}

body.crm-client-portal-active .cp-dino-panel--sidebar {
    border: 1px solid var(--cp-line-strong);
    border-radius: 18px;
    background: var(--cp-surface);
    color: var(--cp-ink);
    box-shadow: 0 24px 70px rgba(31, 39, 53, 0.18);
}

body.crm-client-portal-active .cp-protection-list--compact {
    gap: 0.3rem 0.75rem;
}

body.crm-client-portal-active .cp-protection-list--compact .cp-protection-row {
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

body.crm-client-portal-active .cp-protection-list--compact .cp-protection-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

body.crm-client-portal-active .cp-protection-list--compact .cp-protection-pill {
    position: static;
    align-self: center;
}

html[data-theme='light'] body.crm-client-portal-active .cp-protection-pill--resolved {
    color: #187847;
    background: #e8f7ef;
}

html[data-theme='light'] body.crm-client-portal-active .cp-protection-pill--partial {
    color: #9a551d;
    background: #fff1e4;
}

html[data-theme='light'] body.crm-client-portal-active .cp-protection-pill--missing {
    color: #b33d42;
    background: #fdebed;
}

/* Shared light surfaces for detail pages (Expenses, Portfolio and reused widgets). */
html[data-theme='light'] body.crm-client-portal-active .cp-expense-kpi-card,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-card,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-overview,
html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-panel,
html[data-theme='light'] body.crm-client-portal-active .cp-kpi-tile,
html[data-theme='light'] body.crm-client-portal-active .cp-banner,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-payments-panel {
    border-color: var(--cp-line);
    background: var(--cp-surface);
    color: var(--cp-ink);
    box-shadow: var(--cp-shadow);
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-kpi-label,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-kpi-sub,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-kpi-meta,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-value span,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-pct,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-desc,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-status-copy span,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-head span,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-main span,
html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-card-body p,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-main span,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-amount span {
    color: var(--cp-muted);
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-kpi-value,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-card h3,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-title,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-value,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-overview-title,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-donut-center strong,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-head strong,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-main strong,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-amount,
html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-title,
html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-group-title,
html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-card-body h3,
html[data-theme='light'] body.crm-client-portal-active .cp-expenses-toolbar-title,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-main strong,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-amount {
    color: var(--cp-ink);
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-kpi-progress,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-track,
html[data-theme='light'] body.crm-client-portal-active .cp-goal-highlight-bar {
    background: rgba(31, 39, 53, 0.08);
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-row,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-row,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-icon,
html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-card,
html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-more,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-btn--ghost,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-btn,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-widget-tabs {
    border-color: var(--cp-line);
    background: var(--cp-surface-soft);
    color: var(--cp-ink);
}

html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-card--ok {
    border-color: rgba(24, 120, 71, 0.16);
    background: #f1faf5;
}

html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-card--tip {
    border-color: rgba(154, 85, 29, 0.16);
    background: #fff8f1;
}

html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-card--chance {
    border-color: rgba(42, 105, 190, 0.16);
    background: #f3f7fd;
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-pct,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-empty,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-area-chevron,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-tag--manual {
    color: var(--cp-muted);
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-overview-foot,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-panel,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-list,
html[data-theme='light'] body.crm-client-portal-active .cp-expense-detail-row,
html[data-theme='light'] body.crm-client-portal-active .cp-wealth-row,
html[data-theme='light'] body.crm-client-portal-active .cp-wealth-total,
html[data-theme='light'] body.crm-client-portal-active .cp-protection-row {
    border-color: var(--cp-line);
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-card--neutral .cp-expense-strategy-status {
    background: #f3f5f7;
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-strategy-card--neutral .cp-expense-strategy-status-icon,
html[data-theme='light'] body.crm-client-portal-active .cp-exp-picto--neutral {
    background: rgba(31, 39, 53, 0.07);
    color: var(--cp-muted);
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-widget-tab.is-active {
    background: var(--cp-surface);
    color: var(--cp-ink);
    box-shadow: 0 2px 7px rgba(31, 39, 53, 0.09);
}

html[data-theme='light'] body.crm-client-portal-active .cp-dino-head-avatar {
    border-color: rgba(189, 150, 80, 0.28);
    background: #fbfaf7;
    box-shadow: 0 4px 14px rgba(31, 39, 53, 0.1);
}

html[data-theme='light'] body.crm-client-portal-active .cp-dino-head-avatar img,
html[data-theme='light'] body.crm-client-portal-active .cp-dino-expense-mascot {
    content: url('public/client-portal/dino-ai-mascot-light.png?v=20260722f');
}

html[data-theme='light'] body.crm-client-portal-active .cp-chart-svg text {
    fill: var(--cp-muted);
}

html[data-theme='light'] body.crm-client-portal-active .cp-chart-svg line {
    stroke: rgba(31, 39, 53, 0.12);
}

body.crm-client-portal-active .cp-tile-title,
body.crm-client-portal-active .cp-tile-action {
    overflow: visible;
    text-overflow: clip;
}

body.crm-client-portal-active .cp-goal-highlight--compact .cp-goal-highlight-hint {
    color: var(--cp-muted);
    line-height: 1.45;
}

body.crm-client-portal-active .cp-right-rail .cp-aside-link-body {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

body.crm-client-portal-active .cp-goal-highlight--compact {
    min-height: 128px;
    padding: 0.9rem;
}

body.crm-client-portal-active .cp-aside-link {
    padding: 0.9rem;
}

/*
 * Formatted metrics are atomic; surrounding labels and descriptions remain
 * naturally wrappable. The numeric glyphs use stable widths across updates.
 */
body.crm-client-portal-active .cp-value-atomic {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    font-variant-numeric: tabular-nums;
}

body.crm-client-portal-active .cp-finance-row > span,
body.crm-client-portal-active .cp-goal-stat,
body.crm-client-portal-active .cp-portfolio-investment-label,
body.crm-client-portal-active .cp-portfolio-investment-meta,
body.crm-client-portal-active .cp-portfolio-allocation-label {
    min-width: 0;
}

body.crm-client-portal-active .cp-finance-row > strong,
body.crm-client-portal-active .cp-finance-total > strong,
body.crm-client-portal-active .cp-goal-stat > strong,
body.crm-client-portal-active .cp-portfolio-investment-value,
body.crm-client-portal-active .cp-portfolio-allocation-pct,
body.crm-client-portal-active .cp-portfolio-allocation-value {
    flex: 0 0 auto;
}

@media (max-width: 1280px) {
    body.crm-client-portal-active .cp-shell {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    body.crm-client-portal-active .cp-kpi-row,
    body.crm-client-portal-active .cp-overview-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.crm-client-portal-active .cp-tile--goals {
        grid-column: 1 / -1;
    }

    body.crm-client-portal-active .cp-right-rail {
        position: static;
        grid-column: 2;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-top: 0;
    }

    body.crm-client-portal-active .cp-main-header {
        flex-direction: column;
    }

    body.crm-client-portal-active .cp-client-summary {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 1520px) and (min-width: 1281px) {
    body.crm-client-portal-active .cp-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.crm-client-portal-active .cp-overview-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.crm-client-portal-active .cp-tile--goals {
        grid-column: 1 / -1;
    }
}

@media (max-width: 960px) {
    body.crm-client-portal-active .cp-shell {
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        border-radius: 18px;
    }

    body.crm-client-portal-active .cp-sidebar,
    body.crm-client-portal-active .cp-main,
    body.crm-client-portal-active .cp-right-rail {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.crm-client-portal-active .cp-sidebar {
        position: static;
        padding: 0.75rem;
        border-right: 0;
        border-bottom: 1px solid var(--cp-line);
    }

    body.crm-client-portal-active .cp-sidebar-logo {
        min-height: 58px;
        padding: 0.65rem 0.75rem;
        margin-bottom: 0;
        border: 1px solid rgba(212, 188, 130, 0.2);
    }

    body.crm-client-portal-active .cp-sidebar-logo-img {
        width: auto;
        max-width: min(100%, 16rem);
        max-height: 2.65rem;
    }

    body.crm-client-portal-active .cp-sidebar-nav {
        flex-wrap: nowrap;
        order: 3;
        width: 100%;
        padding: 0.65rem 0 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    body.crm-client-portal-active .cp-sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    body.crm-client-portal-active .cp-sidebar-nav-item {
        flex: 0 0 auto;
        width: auto;
        min-height: 38px;
        padding: 0.55rem 0.7rem;
        white-space: nowrap;
    }

    body.crm-client-portal-active .cp-sidebar-footer {
        position: static;
        display: block;
        order: 4;
        padding: 0;
        margin: 0;
        background: transparent;
    }

    body.crm-client-portal-active .cp-sidebar-mascot {
        display: block;
        width: 100%;
        height: 132px;
        aspect-ratio: auto;
        margin-top: 0.65rem;
    }

    body.crm-client-portal-active .cp-sidebar-mascot-img {
        object-fit: contain;
        object-position: center 32%;
    }

    body.crm-client-portal-active .cp-sidebar-dino {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-top: 0.65rem;
        padding: 0.65rem;
    }

    body.crm-client-portal-active .cp-sidebar-dino-lead {
        display: none;
    }

    body.crm-client-portal-active .cp-sidebar-dino-title {
        display: block;
        flex: 1 1 auto;
        margin: 0;
        font-size: 0.8rem;
    }

    body.crm-client-portal-active .cp-sidebar-dino-btn {
        width: auto;
        margin-left: auto;
    }

    body.crm-client-portal-active .cp-main {
        padding: 1.25rem 1rem 2.5rem;
    }

    body.crm-client-portal-active .cp-right-rail {
        grid-column: 1;
        padding: 0 1rem 2rem;
    }

    body.crm-client-portal-active .cp-main-body,
    body.crm-client-portal-active .cp-page-stack,
    body.crm-client-portal-active .cp-overview,
    body.crm-client-portal-active .cp-kpi-row,
    body.crm-client-portal-active .cp-overview-tiles,
    body.crm-client-portal-active .cp-overview-lower {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    body.crm-client-portal-active .cp-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.crm-client-portal-active .cp-finance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    body.crm-client-portal-active .crm-app-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    body.crm-client-portal-active .crm-app-header-actions {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    body.crm-client-portal-active .crm-app-header-user {
        max-width: 100%;
        white-space: normal;
    }

    body.crm-client-portal-active .cp-main {
        padding: 1rem 0.75rem 2rem;
    }

    body.crm-client-portal-active .cp-overview-aside,
    body.crm-client-portal-active .cp-overview-mid,
    body.crm-client-portal-active .cp-overview-lower,
    body.crm-client-portal-active .cp-kpi-row,
    body.crm-client-portal-active .cp-overview-tiles,
    body.crm-client-portal-active .cp-expenses-tiles,
    body.crm-client-portal-active .cp-expenses-tiles--detail {
        grid-template-columns: 1fr;
    }

    body.crm-client-portal-active .cp-right-rail {
        grid-template-columns: 1fr;
    }

    body.crm-client-portal-active .cp-card,
    body.crm-client-portal-active .cp-section {
        padding: 1.15rem;
        border-radius: 16px;
    }

    body.crm-client-portal-active .cp-main-greeting {
        font-size: 1.45rem;
    }

    body.crm-client-portal-active .cp-client-summary,
    body.crm-client-portal-active .cp-cashflow-grid {
        grid-template-columns: 1fr;
    }

    body.crm-client-portal-active .cp-kpi-tile {
        min-height: 0;
    }

    body.crm-client-portal-active .cp-goal-stats,
    body.crm-client-portal-active .cp-finance-grid {
        grid-template-columns: 1fr;
    }

    body.crm-client-portal-active .cp-finance-row,
    body.crm-client-portal-active .cp-finance-total {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
    }

    body.crm-client-portal-active .cp-portfolio-investment-row {
        grid-template-columns: minmax(0, 1fr);
    }

    body.crm-client-portal-active .cp-portfolio-investment-label,
    body.crm-client-portal-active .cp-portfolio-investment-meta,
    body.crm-client-portal-active .cp-portfolio-investment-value {
        grid-column: 1;
        justify-self: start;
    }

    body.crm-client-portal-active .cp-portfolio-allocation-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            'dot label pct'
            '. value value';
    }

    body.crm-client-portal-active .cp-portfolio-allocation-dot {
        grid-area: dot;
    }

    body.crm-client-portal-active .cp-portfolio-allocation-label {
        grid-area: label;
    }

    body.crm-client-portal-active .cp-portfolio-allocation-pct {
        grid-area: pct;
    }

    body.crm-client-portal-active .cp-portfolio-allocation-value {
        grid-area: value;
        justify-self: end;
    }

    body.crm-client-portal-active .cp-expense-detail-amount {
        justify-self: start;
    }

    body.crm-client-portal-active .cp-dino-panel--sidebar {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        width: auto;
        max-height: calc(100dvh - 1.5rem);
        overflow-y: auto;
    }
}

/* Block 2: expense category accordion and responsive detail. */
.cp-expense-area-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.cp-expense-area-row {
    display: block;
    padding: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.cp-expense-area-row--empty {
    opacity: 0.9;
}

.cp-expense-area-row.is-open {
    opacity: 1;
    border-color: rgba(212, 188, 130, 0.28);
    background: rgba(255, 255, 255, 0.045);
}

.cp-expense-area-toggle {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(88px, 108px) auto;
    align-items: center;
    gap: 0.5rem 0.65rem;
    padding: 0.55rem 0.6rem 0.55rem 0.35rem;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cp-expense-area-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.cp-expense-area-toggle:focus-visible,
.cp-expense-recommendation:focus-visible,
.cp-expense-add-custom:focus-visible {
    outline: 2px solid var(--office-brand);
    outline-offset: -2px;
}

.cp-expense-area-icon {
    display: none;
}

.cp-expense-area-row--blue .cp-expense-area-track i { background: #4d8ef7; }
.cp-expense-area-row--orange .cp-expense-area-track i { background: #e8945a; }
.cp-expense-area-row--cyan .cp-expense-area-track i { background: #45c4e8; }
.cp-expense-area-row--pink .cp-expense-area-track i { background: #d97bc4; }
.cp-expense-area-row--green .cp-expense-area-track i { background: #5ecf9a; }
.cp-expense-area-row--purple .cp-expense-area-track i { background: #a98cf0; }
.cp-expense-area-row--gold .cp-expense-area-track i { background: #d4bc82; }

.cp-expense-area-main {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.cp-expense-area-head strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
}

.cp-expense-area-head span {
    display: block;
    margin-top: 0.06rem;
    font-size: 0.66rem;
    color: var(--office-text-muted);
    line-height: 1.35;
}

.cp-expense-area-main strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
}

.cp-expense-area-main span {
    display: block;
    margin-top: 0.08rem;
    font-size: 0.68rem;
    color: var(--office-text-muted);
}

.cp-expense-area-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.cp-expense-area-track--empty {
    opacity: 0.35;
}

.cp-expense-area-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    min-width: 2px;
}

.cp-expense-area-stats {
    display: grid;
    justify-items: end;
    gap: 0.12rem;
    text-align: right;
    white-space: nowrap;
}

.cp-expense-area-amount {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.cp-expense-area-pct {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
}

.cp-expense-area-stats--empty {
    gap: 0.08rem;
}

.cp-expense-area-empty {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
}

.cp-expense-area-empty-hint {
    font-size: 0.62rem;
    font-weight: 500;
    color: rgba(232, 148, 90, 0.85);
}

.cp-expense-area-sep {
    display: none;
}

.cp-expense-area-chevron {
    color: rgba(255, 255, 255, 0.24);
    font-size: 1rem;
    transition: transform 0.18s ease, color 0.18s ease;
}

.cp-expense-area-row.is-open .cp-expense-area-chevron {
    color: var(--office-brand);
    transform: rotate(90deg);
}

.cp-expense-area-panel {
    padding: 0.2rem 0.75rem 0.85rem 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #fff;
}

.cp-expense-area-panel[hidden] {
    display: none;
}

.cp-expense-area-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0 0.65rem;
}

.cp-expense-area-panel-head strong,
.cp-expense-area-panel-head span {
    display: block;
}

.cp-expense-area-panel-head strong {
    font-size: 0.86rem;
}

.cp-expense-area-panel-head div > span,
.cp-expense-area-panel-empty {
    margin-top: 0.12rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    line-height: 1.45;
}

.cp-expense-area-panel-total {
    flex: 0 0 auto;
    color: var(--office-brand);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.cp-expense-area-items {
    list-style: none;
    margin: 0;
    padding: 0;
    border-block: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-expense-area-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.58rem 0;
}

.cp-expense-area-item + .cp-expense-area-item {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cp-expense-area-item-copy {
    min-width: 0;
}

.cp-expense-area-item-copy strong,
.cp-expense-area-item-copy span {
    display: block;
}

.cp-expense-area-item-copy strong {
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.cp-expense-area-item-copy span {
    margin-top: 0.08rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.68rem;
}

.cp-expense-area-item-copy .cp-expense-area-item-source {
    color: var(--office-brand);
}

.cp-expense-area-item-monthly {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    white-space: nowrap;
}

.cp-expense-area-suggestions {
    padding-top: 0.75rem;
}

.cp-expense-area-suggestions h3 {
    margin: 0 0 0.45rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.7rem;
    font-weight: 650;
}

.cp-expense-recommendations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.cp-expense-recommendation,
.cp-expense-add-custom {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(255, 255, 255, 0.68);
    font: inherit;
    font-size: 0.69rem;
    cursor: pointer;
}

.cp-expense-recommendation {
    padding: 0.38rem 0.62rem;
}

.cp-expense-recommendation span,
.cp-expense-add-custom span {
    color: var(--office-brand);
    font-weight: 800;
}

.cp-expense-recommendation:hover {
    border-color: rgba(212, 188, 130, 0.3);
    color: var(--office-text);
}

.cp-expense-add-custom {
    margin-top: 0.65rem;
    padding: 0.42rem 0.7rem;
    border-color: rgba(212, 188, 130, 0.24);
    color: var(--office-brand);
    font-weight: 650;
}

.cp-expense-category-context {
    margin: 0.45rem 0 0;
    color: rgba(255, 255, 255, 0.68);
}

html[data-theme='light'] .cp-expense-area-row.is-open {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(212, 188, 130, 0.28);
}

html[data-theme='light'] .cp-expense-area-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

html[data-theme='light'] .cp-expense-area-panel,
html[data-theme='light'] .cp-expense-area-items,
html[data-theme='light'] .cp-expense-area-item + .cp-expense-area-item {
    border-color: rgba(31, 39, 53, 0.1);
}

html[data-theme='light'] .cp-expense-recommendation,
html[data-theme='light'] .cp-expense-add-custom {
    border-color: rgba(31, 39, 53, 0.14);
}

html[data-theme='light'] .cp-expense-area-panel-head strong,
html[data-theme='light'] .cp-expense-area-item-copy strong {
    color: #202633;
}

html[data-theme='light'] .cp-expense-area-panel-head div > span,
html[data-theme='light'] .cp-expense-area-panel-empty,
html[data-theme='light'] .cp-expense-area-item-copy span,
html[data-theme='light'] .cp-expense-area-item-monthly,
html[data-theme='light'] .cp-expense-area-suggestions h3 {
    color: #667085;
}

html[data-theme='light'] .cp-expense-recommendation {
    background: rgba(255, 255, 255, 0.72);
    color: #344054;
}

html[data-theme='light'] .cp-expense-recommendation:hover {
    border-color: rgba(139, 104, 42, 0.4);
    background: rgba(189, 150, 80, 0.1);
    color: #202633;
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-card-action:hover {
    border-color: rgba(31, 39, 53, 0.24);
}

html[data-theme='light'] body.crm-client-portal-active .cp-expense-card-action:focus-visible {
    outline-color: rgba(47, 111, 191, 0.52);
}

html[data-theme='light'] .cp-expense-modal {
    border-color: rgba(31, 39, 53, 0.14);
    background:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(189, 150, 80, 0.09) 0%, transparent 55%),
        #ffffff;
    color: #202633;
    box-shadow: 0 24px 64px rgba(31, 39, 53, 0.22);
}

html[data-theme='light'] .cp-expense-modal .modal-header,
html[data-theme='light'] .cp-expense-modal .modal-footer {
    border-color: rgba(31, 39, 53, 0.11);
}

html[data-theme='light'] .cp-expense-modal .modal-header h3,
html[data-theme='light'] .cp-expense-modal .form-group label,
html[data-theme='light'] .cp-expense-category-field .form-label,
html[data-theme='light'] .cp-expense-form-check,
html[data-theme='light'] .cp-expense-form-check--advanced {
    color: #202633;
}

html[data-theme='light'] .cp-expense-form-check {
    border-color: rgba(31, 39, 53, 0.13);
    background: #f8f9fb;
}

html[data-theme='light'] .cp-expense-form-check:hover {
    border-color: rgba(31, 39, 53, 0.22);
    background: #f4f6f8;
}

html[data-theme='light'] .cp-expense-form-check-copy small {
    color: #667085;
}

html[data-theme='light'] .cp-expense-modal .modal-header .icon-btn {
    color: #667085;
}

html[data-theme='light'] .cp-expense-modal .modal-header .icon-btn:hover {
    color: #202633;
    background: rgba(31, 39, 53, 0.06);
}

html[data-theme='light'] .cp-expense-modal .form-input,
html[data-theme='light'] .cp-expense-modal .form-textarea {
    border-color: rgba(31, 39, 53, 0.16);
    background: #ffffff;
    color: #202633;
    -webkit-text-fill-color: #202633;
}

html[data-theme='light'] .cp-expense-modal .form-input::placeholder,
html[data-theme='light'] .cp-expense-modal .form-textarea::placeholder {
    color: #8a94a6;
    -webkit-text-fill-color: #8a94a6;
    opacity: 1;
}

html[data-theme='light'] .cp-expense-modal .form-input:focus,
html[data-theme='light'] .cp-expense-modal .form-textarea:focus {
    border-color: rgba(47, 111, 191, 0.62);
    box-shadow: 0 0 0 3px rgba(47, 111, 191, 0.13);
}

html[data-theme='light'] .cp-expense-category-chip {
    border-color: rgba(31, 39, 53, 0.13);
    background: #f8f9fb;
    color: #344054;
}

html[data-theme='light'] .cp-expense-category-chip:hover {
    border-color: rgba(31, 39, 53, 0.24);
    background: #f1f3f6;
}

html[data-theme='light'] .cp-expense-category-chip.is-active {
    border-color: rgba(139, 104, 42, 0.56);
    background: #fbf6ea;
    color: #202633;
    box-shadow: 0 0 0 2px rgba(189, 150, 80, 0.13);
}

html[data-theme='light'] .cp-expense-impact-preview {
    border-color: rgba(139, 104, 42, 0.2);
    background: #fbf8f1;
}

html[data-theme='light'] .cp-expense-impact-row {
    color: #667085;
}

html[data-theme='light'] .cp-expense-impact-row strong {
    color: #202633;
}

html[data-theme='light'] .cp-expense-advanced {
    border-color: rgba(31, 39, 53, 0.13);
    background: #f8f9fb;
}

html[data-theme='light'] .cp-expense-advanced > summary,
html[data-theme='light'] .cp-expense-category-context {
    color: #667085;
}

html[data-theme='light'] .cp-expense-modal .modal-footer .btn-secondary {
    border-color: rgba(31, 39, 53, 0.18);
    background: #ffffff;
    color: #475467;
}

html[data-theme='light'] .cp-expense-modal .modal-footer .btn-secondary:hover {
    border-color: rgba(31, 39, 53, 0.3);
    background: #f6f7f9;
    color: #202633;
}

@media (max-width: 960px) {
    .cp-pr-kpi-grid,
    .cp-pr-allocation-grid,
    .cp-pr-swot {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    html:has(body.crm-client-portal-active .cp-expenses-page) {
        overflow-x: hidden;
    }

    body.authenticated.crm-client-portal-active:has(.cp-expenses-page) {
        height: auto;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.authenticated.crm-client-portal-active:has(.cp-expenses-page) .crm-shell,
    body.crm-client-portal-active:has(.cp-expenses-page) .crm-section.is-active,
    body.crm-client-portal-active:has(.cp-expenses-page) .crm-client-detail-root,
    body.crm-client-portal-active:has(.cp-expenses-page) .cd-page--client-portal,
    .cp-shell:has(.cp-expenses-page),
    .cp-main:has(.cp-expenses-page) {
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .cp-shell:has(.cp-expenses-page) {
        grid-template-rows: auto auto;
    }

    .cp-main:has(.cp-expenses-page) {
        padding-inline: 0.75rem;
    }

    .cp-pr-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cp-pr-hero {
        padding: 1.35rem 1.15rem;
    }

    .cp-expense-area-toggle {
        min-height: 58px;
        padding: 0.65rem 0.55rem;
    }

    .cp-expense-area-panel {
        padding: 0.15rem 0.65rem 0.8rem;
    }

    .cp-expense-area-panel-head,
    .cp-expense-area-item {
        align-items: flex-start;
    }

    .cp-expense-area-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .cp-expense-area-item .cp-expense-detail-btn {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .cp-expense-recommendation,
    .cp-expense-add-custom {
        min-height: 44px;
    }
}
