* {
    box-sizing: border-box;
}

:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #f5f7fb;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(77, 95, 255, 0.08), transparent 32%),
        #f5f7fb;
}

.app-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 72px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.tagline {
    font-size: 13px;
    color: #778198;
}

.welcome-card,
.upload-panel,
.metric-card,
.section {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #e9edf5;
    box-shadow: 0 18px 48px rgba(23, 32, 51, 0.06);
}

.welcome-card {
    border-radius: 24px;
    padding: 36px;
    display: flex;
    justify-content: space-between;
    gap: 32px;
    align-items: center;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #7c879d;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.04;
    letter-spacing: -0.04em;
    max-width: 780px;
}

h2 {
    margin-bottom: 0;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.muted {
    color: #748099;
    font-size: 15px;
}

.score-badge {
    position: relative;
    min-width: 140px;
    min-height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #172033;
    color: white;
    flex-shrink: 0;
}

.score-badge > #score {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
}

.score-badge small {
    margin-top: 5px;
    opacity: 0.65;
}

.upload-panel {
    margin-top: 20px;
    border-radius: 20px;
    padding: 22px;
}

.open-upload-button {
    display: inline-flex;
    width: auto;
    min-height: 46px;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 8px;
    background: #027a48;
    color: white;
    font-size: 13px;
}

.open-upload-button:hover { background: #056b40; }

.saved-analysis-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.statement-quality-badge {
    width: auto;
    padding: 7px 10px;
    border: 1px solid #cfe8d7;
    border-radius: 999px;
    background: #f1faf5;
    color: #17633f;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.statement-quality-badge.ocr_reconstructed,
.statement-quality-badge.validation_pending {
    border-color: #ead8af;
    background: #fffaf0;
    color: #795b17;
}

.statement-quality-badge.review_required {
    border-color: #f0c9c5;
    background: #fff5f4;
    color: #9d3028;
}

.statement-recovery {
    display: grid;
    grid-column: 2 / -1;
    align-self: stretch;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 14px;
    margin: 0;
    padding: 18px;
    border: 1px solid #f0c98c;
    border-radius: 16px;
    background: #fffaf1;
    color: #172033;
}
.statement-recovery.hidden { display: none; }
.recovery-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #172033;
    color: white;
    font-weight: 900;
}
.recovery-copy h3 { margin: 2px 0 6px; font-size: 18px; }
.recovery-copy p { margin: 4px 0; }
.recovery-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.recovery-actions button { min-height: 38px; padding: 8px 13px; }
.recovery-actions .text-action { background: transparent; color: #29466f; border: 1px solid #cbd5e4; }
#recovery-feedback { display: block; margin-top: 9px; color: #11613f; font-weight: 700; }
.pdf-password-form { margin-top: 12px; max-width: 360px; }
.pdf-password-form input { min-height: 40px; background: white; }
.pdf-password-form.hidden { display: none; }
.intake-result {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    border: 1px solid #b9d8ca;
    border-radius: 16px;
    background: #f2f8f5;
    color: #172033;
}
.intake-result.hidden { display: none; }
.intake-result-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #17633f;
    color: white;
    font-weight: 900;
}
.intake-result h3 { margin: 2px 0 6px; font-size: 18px; }
.intake-result p { margin: 4px 0; }
.intake-result small { color: #527064; overflow-wrap: anywhere; }

@media (max-width: 700px) {
    .intake-result {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 11px;
        padding: 15px;
    }
    .intake-result-mark {
        width: 30px;
        height: 30px;
    }
    .intake-result h3 {
        font-size: 16px;
        overflow-wrap: anywhere;
    }
    .intake-result p,
    .intake-result small {
        overflow-wrap: anywhere;
    }
}

.reset-statements-button {
    width: auto;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #d7dee9;
    border-radius: 10px;
    background: white;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.reset-statements-button:hover {
    border-color: #d6aaa5;
    background: #fff7f6;
    color: #9d3028;
}

.controls {
    display: grid;
    grid-template-columns: 1.7fr 0.8fr 0.8fr 0.7fr auto;
    gap: 14px;
    align-items: end;
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #667189;
}

input,
select,
button {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid #dfe5ef;
    background: white;
    padding: 0 13px;
    font: inherit;
}

button {
    border: none;
    background: #172033;
    color: white;
    font-weight: 750;
    cursor: pointer;
    padding: 0 20px;
}

button:hover {
    opacity: 0.92;
}

.error {
    margin: 14px 0 0;
    color: #b42318;
    font-size: 13px;
}

.hidden {
    display: none !important;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.metric-card {
    border-radius: 18px;
    padding: 22px;
}

.metric-card span {
    color: #7a859b;
    font-size: 12px;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.health-summary {
    display: grid;
    gap: 6px;
    max-width: 255px;
    padding: 14px 16px;
    border-left: 3px solid #71809a;
    border-radius: 0 12px 12px 0;
    background: #f6f8fc;
    color: #526078;
    font-size: 13px;
    line-height: 1.4;
}
.health-summary strong { color: #172033; font-size: 15px; }
.health-summary .health-scope { color: #71809a; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.health-summary.healthy { border-color: #027a48; }
.health-summary.healthy strong { color: #027a48; }
.health-summary.caution { border-color: #b54708; }
.health-summary.caution strong { color: #b54708; }
.health-summary.review-now,
.health-summary.alert { border-color: #b42318; }
.health-summary.review-now strong,
.health-summary.alert strong { color: #b42318; }

.score-info {
    position: absolute;
    right: -27px;
    top: 50%;
    width: 20px;
    min-height: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid #172033;
    border-radius: 50%;
    background: #172033;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    transform: translateY(-50%);
}

.score-tooltip {
    position: absolute;
    z-index: 5;
    right: -45px;
    bottom: 50%;
    width: 235px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #172033;
    box-shadow: 0 10px 24px rgba(23, 32, 51, 0.2);
    color: white;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(50% + 4px));
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.score-info:hover + .score-tooltip,
.score-info:focus + .score-tooltip {
    opacity: 1;
    transform: translateY(50%);
}

.upload-panel .controls {
    align-items: start;
}

.upload-panel .controls > label {
    min-height: 88px;
}

.upload-panel .controls > label small {
    min-height: 15px;
    color: #71809a;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
}

.upload-panel .controls > #analyze {
    align-self: start;
    margin-top: 26px;
}

.upload-choice-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.card-upload-zone { border-color: #c9d9d1; background: #f8fcfa; }
.card-upload-zone.dragging { border-color: #027a48; background: #f0faf5; }
.card-upload-button { border-color: #afd5c1; color: #17633f; }

.upload-card-illustration {
    position: relative;
    width: 70px;
    height: 45px;
    margin-bottom: 10px;
    border-radius: 9px;
    background: #172033;
    box-shadow: 0 8px 18px rgba(23, 32, 51, 0.14);
}
.upload-card-illustration span { position: absolute; left: 0; right: 0; top: 10px; height: 8px; background: #dce5f1; }
.upload-card-illustration i { position: absolute; left: 10px; bottom: 9px; width: 15px; height: 8px; border-radius: 2px; background: #6fc49a; }
.upload-card-illustration b { position: absolute; right: 10px; bottom: 11px; width: 18px; height: 3px; border-radius: 2px; background: #fff; opacity: .78; }

#greeting {
    margin-bottom: 10px;
    color: #172033;
    font-size: 22px;
    letter-spacing: -0.02em;
}

#headline {
    font-size: clamp(23px, 3.2vw, 34px);
    line-height: 1.12;
}

.profile-button { width: auto; min-height: 32px; padding: 0 12px; background: transparent; color: #526078; border: 1px solid #d9dfeb; font-size: 12px; }
.profile-panel { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 12px 0 20px; padding: 18px; border: 1px solid #e3e8f1; border-radius: 16px; background: #fff; }
.profile-panel h2 { margin: 3px 0 0; font-size: 18px; }
.profile-fields { display: flex; align-items: end; gap: 10px; }
.profile-fields label { min-width: 140px; font-size: 12px; }
.profile-fields input, .profile-fields select { margin-top: 4px; min-height: 36px; }
.profile-fields button { width: auto; min-height: 36px; padding: 0 14px; font-size: 12px; }

#monthly-card,
#other-purchases-card,
.metrics-grid > article:nth-child(2) {
    display: none;
}

.interactive-metric {
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.interactive-metric:hover,
.interactive-metric:focus-visible {
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.12);
    outline: none;
    transform: translateY(-2px);
}

.metric-hint {
    display: block;
    margin-top: 10px;
    color: #51607a !important;
    font-size: 11px !important;
    font-weight: 700;
}

.metric-explanation {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid #e3e8f1;
    color: #526078;
    font-size: 12px;
    line-height: 1.5;
}
.metric-explanation span { display: block; margin-top: 8px; }

.monthly-payments {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e3e8f1;
}

.monthly-payment {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #526078;
    font-size: 12px;
    line-height: 1.4;
}

.monthly-payment-name {
    font-weight: 700;
}

.monthly-payment-amount {
    text-align: right;
    white-space: nowrap;
}

.section {
    margin-top: 20px;
    border-radius: 20px;
    padding: 26px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.count-badge {
    display: inline-flex;
    min-width: 32px;
    height: 32px;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    background: #f1f3f8;
    color: #505a70;
    font-size: 12px;
    font-weight: 800;
}

.cards {
    display: grid;
    gap: 12px;
}

.period-panel { margin: 18px 0 14px; padding: 14px 16px 10px; border: 1px solid #cbdcf1; border-radius: 14px; background: linear-gradient(135deg, #edf5ff 0%, #f6f9fe 100%); box-shadow: 0 5px 16px rgba(43, 91, 145, 0.08); }
.period-panel-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; color: #173a67; }
.period-panel-heading > div { display: flex; flex-direction: column; gap: 2px; }
.period-panel-heading strong { font-size: 13px; font-weight: 850; }
.period-panel-heading small { color: #6780a0; font-size: 10px; }
.period-icon { display: inline-flex; width: 29px; height: 29px; align-items: center; justify-content: center; border-radius: 8px; background: #2f6faf; color: white; font-size: 16px; line-height: 1; }
.month-tabs { display: flex; align-items: flex-start; gap: 8px; overflow-x: auto; padding: 0 0 4px; scrollbar-width: thin; }
.period-special-tabs { display: grid; flex: 0 0 auto; gap: 5px; margin-left: auto; }
.year-tab { margin-left: 0; border: 1px solid #95b4d8; background: #dceafb; color: #173a67; }
.credits-tab { min-height: 30px !important; border: 1px solid #b9cbe2; background: #f7faff; color: #234c7d; font-size: 10px !important; letter-spacing: .04em; }
.credits-tab:hover { border-color: #5e88b8; background: #edf5ff; }
.credits-tab.active { border-color: #234c7d; background: #234c7d; color: #fff; }
.credit-workspace-intro { margin-bottom: 12px; padding: 17px 18px; border: 1px solid #d6e3f1; border-radius: 14px; background: linear-gradient(120deg, #eef5fd, #fff); }
.credit-workspace-intro span { color: #4774aa; font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.credit-workspace-intro h3 { margin: 5px 0 3px; color: #172f51; font-size: 20px; }
.credit-workspace-intro p { margin: 0; color: #5c6b80; font-size: 11px; }
.annual-coverage { margin: 4px 0 14px; color: #667189; font-size: 12px; font-weight: 700; }
.annual-financial-costs { margin: 14px 0 20px; padding: 16px; border: 1px solid #d9e4f2; border-radius: 14px; background: linear-gradient(145deg, #f7faff, #fff); }
.annual-financial-costs-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.annual-financial-costs-header h3 { margin: 0; color: #173a67; font-size: 14px; letter-spacing: 0.07em; }
.annual-financial-costs-header p { margin: 4px 0 0; color: #667189; font-size: 11px; }
.annual-financial-costs-total { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.annual-financial-costs-total span { color: #667189; font-size: 10px; }
.annual-financial-costs-total strong { color: #172033; font-size: 19px; }
.annual-financial-costs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.annual-financial-costs-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; border-radius: 10px; background: #fff; box-shadow: 0 3px 10px rgba(34, 58, 99, .05); }
.annual-financial-costs-grid span { color: #526078; font-size: 10px; font-weight: 750; }
.annual-financial-costs-grid strong { color: #173a67; font-size: 15px; }
.annual-financial-costs-grid small { color: #7b8799; font-size: 9px; }
.annual-financial-costs-note { margin: 12px 0 0; color: #526078; font-size: 10px; line-height: 1.45; }
.annual-row { display: flex; justify-content: space-between; gap: 18px; margin-top: 8px; padding: 12px 14px; border: 1px solid #ebeff6; border-radius: 10px; color: #526078; font-size: 13px; }
.annual-row strong { color: #172033; white-space: nowrap; }
.annual-category { margin-top: 8px; border: 1px solid #dfe7f2; border-radius: 11px; background: #fff; color: #223a63; }
.annual-category summary { display: flex; justify-content: space-between; gap: 18px; padding: 13px 14px; cursor: pointer; font-size: 13px; font-weight: 800; }
.annual-category-hint { margin: 0; padding: 0 14px 10px; color: #667189; font-size: 12px; line-height: 1.4; }
.annual-detail-row { display: flex; justify-content: space-between; gap: 18px; margin: 0 10px; padding: 10px 4px; border-top: 1px solid #edf1f6; color: #526078; font-size: 12px; }
.annual-detail-row strong { color: #172033; white-space: nowrap; }
.annual-credit-section { margin: 20px 0; padding: 16px; border: 1px solid #ccdaec; border-radius: 14px; background: linear-gradient(145deg, #f4f8fd, #fff); }
.annual-credit-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.annual-credit-heading h3 { margin: 0; color: #173a67; font-size: 15px; letter-spacing: 0.08em; }
.annual-credit-heading p { margin: 3px 0 0; color: #667189; font-size: 11px; }
.annual-credit-empty { margin: 0; padding: 14px; border-radius: 10px; background: #fff; color: #667189; font-size: 12px; }
.annual-credit-card { margin-top: 10px; padding: 14px; border: 1px solid #dbe4f0; border-radius: 12px; background: #fff; box-shadow: 0 3px 10px rgba(34, 58, 99, 0.05); }
.annual-credit-card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.annual-credit-card-header > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.annual-credit-card-header strong { overflow: hidden; color: #172033; font-size: 13px; text-overflow: ellipsis; }
.annual-credit-card-header span { color: #667189; font-size: 11px; }
.credit-configure-button { width: auto; min-height: 30px; padding: 0 11px; border: 1px solid #b9cbe2; background: #f4f8fd; color: #234c7d; font-size: 10px; white-space: nowrap; }
.annual-credit-paid-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; padding: 13px 16px; border-left: 5px solid #38b47a; border-radius: 10px; background: linear-gradient(110deg, #173a67, #24558c); color: #fff; box-shadow: 0 6px 14px rgba(23, 58, 103, 0.18); }
.annual-credit-paid-total > div { display: flex; flex-direction: column; gap: 3px; }
.annual-credit-paid-total span { font-size: 9px; font-weight: 750; letter-spacing: 0.07em; opacity: 0.78; }
.annual-credit-paid-total strong { font-size: 21px; letter-spacing: -0.02em; }
.annual-credit-paid-total small { font-size: 10px; font-weight: 700; opacity: 0.88; }
.credit-alerts { display: grid; gap: 7px; margin-top: 10px; }
.credit-alert { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 9px; padding: 9px 11px; border: 1px solid #e2e7ee; border-radius: 9px; background: #f8fafc; }
.credit-alert > span { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: #e5edf7; color: #234c7d; font-size: 11px; font-weight: 900; }
.credit-alert > div { display: flex; flex-direction: column; gap: 2px; }
.credit-alert strong { color: #172033; font-size: 10px; }
.credit-alert small { color: #667189; font-size: 9px; line-height: 1.4; }
.credit-alert-high { border-color: #efc6c2; background: #fff5f4; }
.credit-alert-high > span { background: #b42318; color: #fff; }
.credit-alert-medium { border-color: #ecd9ac; background: #fff9ec; }
.credit-alert-medium > span { background: #d3972f; color: #fff; }
.credit-alert-info { border-color: #c9e4d7; background: #f1faf5; }
.credit-alert-info > span { background: #21875c; color: #fff; }
.annual-credit-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.annual-credit-metrics > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px; border-radius: 9px; background: #f7f9fc; }
.annual-credit-metrics span { color: #667189; font-size: 9px; line-height: 1.3; }
.annual-credit-metrics strong { color: #172033; font-size: 12px; }
.credit-progress { height: 7px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #e8edf4; }
.credit-progress::before { display: block; width: var(--credit-progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3474bd, #1c9363); content: ""; }
.annual-credit-balance { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 14px; margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: #fff8e9; color: #6d5318; }
.annual-credit-balance.reported { background: #eef9f3; color: #11613f; }
.annual-credit-balance span { font-size: 10px; font-weight: 700; }
.annual-credit-balance strong { grid-row: span 2; font-size: 14px; }
.annual-credit-balance small { font-size: 9px; opacity: 0.8; }
.annual-credit-payments { margin-top: 10px; border-top: 1px solid #e8edf4; }
.annual-credit-payments summary { padding: 9px 0 2px; cursor: pointer; color: #335a8a; font-size: 10px; font-weight: 750; }
.annual-credit-payments > div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid #f0f2f6; color: #526078; font-size: 10px; }
.annual-credit-payments > div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.annual-credit-payments > div strong { color: #172033; white-space: nowrap; }
.credit-plan-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 10px; padding: 12px; border-radius: 10px; background: #f3f6fa; }
.credit-plan-form label { display: flex; flex-direction: column; gap: 4px; color: #526078; font-size: 9px; font-weight: 700; }
.credit-plan-form input, .credit-plan-form select { min-height: 34px; padding: 0 9px; border: 1px solid #d3ddea; border-radius: 8px; background: #fff; color: #172033; font-size: 11px; }
.credit-plan-form button { align-self: end; min-height: 34px; font-size: 10px; }
.credit-plan-form > small { align-self: center; color: #b42318; font-size: 9px; }
.annual-charts { margin: 14px 0 20px; }
.annual-chart { min-width: 0; padding: 15px; border: 1px solid #e4eaf3; border-radius: 14px; background: #fff; }
.annual-chart h4 { margin: 0; color: #172033; font-size: 14px; }
.annual-chart > p { margin: 4px 0 12px; color: #667189; font-size: 11px; }
.annual-month-bars { display: flex; align-items: end; gap: 5px; height: 178px; padding: 8px 0 0; border-bottom: 1px solid #dfe5ef; }
.annual-month-bar { display: flex; flex: 1 1 0; flex-direction: column; justify-content: end; align-items: center; gap: 5px; width: auto; min-height: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; color: #526078; font-size: 10px; font-weight: 700; }
.annual-month-bar:hover { background: transparent; color: #172033; opacity: 1; }
.annual-balance { min-height: 14px; color: #526078; font-size: 9px; font-weight: 850; white-space: nowrap; }
.annual-balance.positive { color: #027a48; }
.annual-balance.negative { color: #b42318; }
.annual-balance.missing { color: #7b8799; font-weight: 700; }
.annual-bar-pair { display: flex; align-items: end; justify-content: center; gap: 3px; width: 100%; height: calc(100% - 38px); }
.annual-bar-fill { display: block; width: min(20px, 38%); min-height: 3px; border-radius: 5px 5px 1px 1px; transition: filter .15s ease; }
.annual-bar-fill.income { height: var(--income-bar-height); background: #38a169; }
.annual-bar-fill.spending { height: var(--spending-bar-height); background: #d94b4b; }
.annual-month-bar:hover .annual-bar-fill { filter: brightness(.86); }
.annual-bar-label { min-height: 14px; text-transform: capitalize; }
.income-form { margin-bottom: 24px; padding: 18px; border-radius: 16px; background: #f6f8fc; }
.income-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.income-panel-heading h3 { margin: 3px 0 0; color: #172033; font-size: 17px; }
.income-eyebrow { color: #5b7195; font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.add-income-button { width: auto; min-height: 30px; padding: 4px 9px; border: 1px solid #b9ddc9; background: #edf9f2; color: #027a48; font-size: 11px; }
.add-income-button:hover { background: #dff4e8; }
.income-breakdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.income-breakdown-row { display: grid; gap: 3px; padding: 10px 11px; border: 1px solid #e0e7f0; border-radius: 10px; background: white; color: #5b6980; font-size: 11px; }
.income-breakdown-row { min-width:0; overflow-wrap:anywhere; }
.income-breakdown-row strong { color: #172033; font-size: 15px; }
.income-breakdown-row.unconfirmed { border-color: #ead8af; background: #fffaf0; }
.inline-income-form { display: grid; grid-template-columns: 130px minmax(150px, 1.5fr) minmax(110px, 1fr) 90px minmax(140px, 1fr) auto; gap: 8px; margin-top: 12px; padding: 11px; border: 1px solid #dce5ef; border-radius: 11px; background: white; }
.inline-income-form input, .inline-income-form select, .inline-income-form button { min-height: 34px; margin: 0; font-size: 11px; }
.inline-income-form small { grid-column: 1 / -1; color: #667189; }
.income-sources { margin-top: 12px; border-top: 1px solid #e1e7f0; padding-top: 10px; }
.income-sources summary { cursor: pointer; color: #29466f; font-size: 11px; font-weight: 800; }
.income-source-row { display: grid; grid-template-columns: minmax(180px, 1fr) 130px minmax(150px, .8fr) auto; align-items: center; gap: 8px; margin-top: 7px; padding: 7px 8px; border: 1px solid #e4e9f1; border-radius: 9px; background: white; color: #526078; font-size: 11px; }
.income-source-row strong { color: #172033; text-align: right; }
.income-source-row select, .income-source-row button { min-height: 30px; margin: 0; font-size: 10px; }
.manual-income-sources { margin-top: 10px; border-top: 1px solid #e1e7f0; padding-top: 9px; }
.manual-income-sources summary { cursor: pointer; color: #29466f; font-size: 11px; font-weight: 800; }
.manual-income-row { display: grid; grid-template-columns: minmax(180px, 1fr) 130px 150px auto; align-items: center; gap: 8px; margin-top: 7px; padding: 7px 8px; border: 1px solid #e4e9f1; border-radius: 9px; background: white; color: #526078; font-size: 11px; }
.manual-income-row strong { color: #172033; text-align: right; }
.manual-income-row small { color: #667189; }
.remove-income-button { width: auto; min-height: 28px; margin: 0; padding: 3px 8px; border: 1px solid #e7c7c7; background: #fff7f7; color: #a33a3a; font-size: 10px; }
.remove-income-button:hover { background: #fdeaea; }
.income-title { margin-bottom: 12px; color: #172033; font-size: 15px; font-weight: 800; }
.income-grid { display: grid; gap: 10px; }
.income-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(120px, 1fr) 100px; align-items: center; gap: 12px; color: #526078; font-size: 13px; font-weight: 700; }
.income-row input, .income-row select { margin: 0; min-height: 38px; }
.save-income-button { width: auto; min-height: 38px; margin-top: 14px; padding: 0 14px; background: #172033; font-size: 12px; }
.income-message { margin-left: 10px; color: #526078; font-size: 12px; }
.income-balance {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #dfe5ef;
    border-radius: 13px;
    background: white;
}

.income-summary-item { display: grid; gap: 5px; color: #526078; font-size: 12px; font-weight: 700; }
.income-summary-item strong { color: #172033; font-size: 19px; letter-spacing: -0.02em; }
.income-summary-item.available { padding-left: 14px; border-left: 1px solid #e1e7f0; }
.income-summary-item.available.negative strong { color: #b42318; }
.income-summary-item.available.positive strong { color: #027a48; }
.income-balance small { grid-column: 1 / -1; color: #667189; font-size: 11px; font-weight: 600; }
.savings-guide { margin: 14px 0 20px; padding: 17px; border: 1px solid #dbe7df; border-radius: 14px; background: #f6fbf8; }
.savings-guide h3 { margin: 0; color: #172033; font-size: 16px; }
.savings-guide > p { margin: 6px 0 12px; color: #526078; font-size: 12px; line-height: 1.45; }
.savings-guide-rule { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid #dcebe2; border-bottom: 1px solid #dcebe2; color: #526078; font-size: 11px; }
.savings-guide-rule span { display: grid; gap: 2px; }
.savings-guide-rule strong { color: #027a48; font-size: 16px; }
.savings-guide-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.savings-guide-figures div { display: grid; gap: 4px; }
.savings-guide-figures span { color: #526078; font-size: 11px; font-weight: 700; }
.savings-guide-figures strong { color: #172033; font-size: 16px; }
.savings-guide-outcome { margin-bottom: 0 !important; color: #17623c !important; font-weight: 800; }
.savings-guide-outcome.needs-reduction { color: #9a5d00 !important; }
.savings-guide > small { display: block; margin-top: 10px; color: #667189; font-size: 10px; line-height: 1.35; }
.income-balance.needs-income { display: grid; grid-template-columns: 1fr; color: #526078; font-size: 13px; }
.income-balance.needs-income strong { color: #172033; }
.income-balance.needs-income span { font-size: 12px; }
.add-movement-button { display: flex; width: auto; min-height: 44px; align-items: center; gap: 9px; padding: 6px 12px 6px 7px; background: #027a48; color: white; font-size: 12px; white-space: nowrap; }
.add-movement-button:hover { background: #056b40; }
.expected-payment-button { width: auto; min-height: 44px; padding: 6px 12px; background: white; color: #b7791f; border: 1px solid #ead8af; font-size: 12px; white-space: nowrap; }
.expected-payment-button:hover { background: #fffaf0; }
.add-icon { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: white; color: #027a48; font-size: 22px; font-weight: 500; line-height: 1; }
.manual-form { margin: 0 0 18px; padding: 18px; border: 1px solid #cce5d8; border-radius: 16px; background: #f7fcf9; }
.manual-form h3 { margin: 4px 0 14px; font-size: 17px; color: #172033; }
.classification-section { padding-top: 8px; }
.secondary-disclosure { width: auto; min-height: 38px; padding: 0 14px; background: transparent; color: #526078; border: 1px solid #d9dfeb; font-size: 12px; }
.secondary-disclosure:hover { background: #f6f8fc; color: #172033; }
.month-tab { width: auto; min-height: 38px; padding: 0 15px; border: 1px solid #d7e2ef; background: white; color: #3f5879; font-size: 12px; font-weight: 750; white-space: nowrap; box-shadow: 0 2px 5px rgba(30, 64, 105, 0.04); }
.month-tab:hover { border-color: #7fa5cf; background: #f8fbff; color: #173a67; }
.month-tab.active { border-color: #173a67; background: #173a67; color: white; box-shadow: 0 4px 10px rgba(23, 58, 103, 0.2); }
.month-summary { padding: 18px; border-radius: 14px; background: #f6f8fc; color: #344054; }
.month-summary h3 { margin: 0 0 14px; color: #172033; font-size: 18px; }
.month-summary-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 8px 0; color: #526078; font-size: 13px; }
.month-summary-row strong { color: #172033; text-align: right; }
.monthly-reconciliation { margin-top: 10px; overflow: hidden; border: 1px solid #dce4ef; border-left: 4px solid #7694ba; border-radius: 12px; background: #fbfcfe; }
.monthly-reconciliation > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 42px; padding: 0 14px; cursor: pointer; color: #526078; font-size: 11px; }
.monthly-reconciliation > summary strong { color: #315d96; font-size: 12px; }
.monthly-reconciliation > summary span { color: #7a859b; font-size: 9px; font-weight: 600; }
.reconciliation-matched { border-left-color: #20a464; background: #f3fbf7; }
.reconciliation-matched > summary strong { color: #087747; }
.reconciliation-needs_review { border-color: #efc6c2; border-left-color: #c83b32; background: #fff6f5; }
.reconciliation-needs_review > summary strong { color: #a52b23; }
.monthly-reconciliation-body { padding: 0 14px 12px; border-top: 1px solid rgba(213, 222, 235, .72); }
.monthly-reconciliation-body > p { margin: 10px 0; color: #667189; font-size: 10px; line-height: 1.5; }
.monthly-reconciliation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.monthly-reconciliation-grid > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid #edf0f5; color: #667189; font-size: 10px; }
.monthly-reconciliation-grid strong { color: #172033; white-space: nowrap; }
.monthly-reconciliation-grid .reconciliation-net-row { color: #173a67; font-weight: 800; }
.monthly-reconciliation-grid .reconciliation-matched-row strong { color: #087747; }
.monthly-reconciliation-grid .reconciliation-difference-row strong { color: #b42318; }
.month-change em { display: inline-block; min-width: 58px; margin-left: 8px; font-size: 12px; font-style: normal; text-align: left; }
.month-change.up { color: #b42318; }
.month-change.down { color: #027a48; }
.pending-summary { margin-top: 4px; border-top: 1px solid #dfe5ef; color: #9a6700; }
.pending-summary strong { color: #9a6700; }
.refund-summary { margin-top: 3px; border-top: 1px solid #dce9e1; color: #027a48; }
.refund-summary strong { color: #027a48; }
.net-spending-summary { padding-top: 5px; color: #172033; font-weight: 750; }
.net-spending-summary strong { color: #172033; font-size: 14px; }
.month-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 0 10px;
    color: #223a63;
    font-size: 16px;
    font-weight: 850;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.month-group-title::before {
    width: 5px;
    height: 22px;
    border-radius: 8px;
    background: #3c70b3;
    box-shadow: 0 2px 8px rgba(60, 112, 179, 0.22);
    content: "";
}
.merchant-detail { border: 1px solid #ebeff6; border-radius: 9px; padding: 6px 12px; margin-top: 4px; color: #526078; font-size: 12px; }
.merchant-detail summary { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto auto 18px 14px; gap: 7px; align-items: center; min-height: 20px; cursor: pointer; color: #172033; font-weight: 700; line-height: 1.15; }
.merchant-detail summary > .fixed-star { grid-column: 1; grid-row: 1; }
.merchant-name { grid-column: 2; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merchant-name-label { display: block; overflow: hidden; text-overflow: ellipsis; }
.merchant-product-origin { display: block; margin-top: 3px; overflow: hidden; color: #68758b; font-size: 10px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.product-category-surface .merchant-detail summary { align-items: start; }
.merchant-behavior { grid-column: 3; grid-row: 1; padding: 2px 6px; border-radius: 999px; background: #eef3fa; color: #526f94; font-size: 9px; font-weight: 700; white-space: nowrap; }
.merchant-amount { grid-column: 4; grid-row: 1; text-align: right; white-space: nowrap; }
.merchant-count { grid-column: 5; grid-row: 1; color: #748099; font-size: 11px; font-weight: 500; white-space: nowrap; }
.merchant-transaction-row { margin: 5px 0 0 22px; }
.merchant-transaction { color: #526078; font-size: 12px; line-height: 1.4; }
.merchant-detail.opportunity-target { border-color: #d39b2a; background: #fffaf0; box-shadow: 0 0 0 3px rgba(211, 155, 42, 0.16); animation: opportunity-target-pulse 1s ease-in-out 2; }
.merchant-transaction-row.opportunity-transaction-target { margin-right: 2px; padding: 5px 8px; border-left: 3px solid #d39b2a; border-radius: 6px; background: #fff3d6; }
.merchant-detail.opportunity-refund-target { border-color: #58a77d; background: #f3fbf6; box-shadow: 0 0 0 3px rgba(2, 122, 72, 0.12); }
.merchant-transaction-row.opportunity-refund-transaction-target { margin-right: 2px; padding: 5px 8px; border-left: 3px solid #027a48; border-radius: 6px; background: #e8f7ee; }
@keyframes opportunity-target-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(211, 155, 42, 0.12); }
    50% { box-shadow: 0 0 0 7px rgba(211, 155, 42, 0.24); }
}
.fixed-star { width: 16px; min-height: 16px; padding: 0; border: 0; background: transparent; color: #9aa5b5; font-size: 17px; line-height: 1; }
.fixed-star:hover, .fixed-star.active { background: transparent; color: #b7791f; }
.refund-marker, .refund-marker:disabled { width: 16px; min-height: 16px; padding: 0; border: 0; background: transparent; color: #027a48; font-size: 16px; line-height: 1; opacity: 1; }
.unrecognized-button { grid-column: 6; grid-row: 1; width: 18px; min-width: 18px; min-height: 18px; height: 18px; padding: 0; border: 1px solid #d8dfeb; border-radius: 50%; background: white; color: #68758b; font-size: 10px; font-weight: 900; line-height: 1; }
.unrecognized-button:hover, .unrecognized-button.active { border-color: #d92d20; background: #fff1f0; color: #b42318; }
.merchant-detail.unrecognized { border-color: #f0b8b3; background: #fffafa; }
.merchant-detail.dragging { opacity: 0.45; }
.expected-payment-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; margin-top: 8px; padding: 9px 12px; border: 1px dashed #cfd9e8; border-radius: 10px; background: #f8fafc; color: #52627a; font-size: 12px; }
.expected-payment-row strong { color: #172033; text-align: right; }

.insight-card {
    border: 1px solid #ebeff6;
    border-radius: 16px;
    padding: 18px;
}

.insight-card .card-title {
    font-weight: 800;
    margin-bottom: 6px;
}

.insight-card .card-reason,
.insight-card .card-action {
    color: #6d778d;
    font-size: 13px;
    line-height: 1.5;
}

.opportunity-heading { align-items: flex-start; }
.opportunity-heading .muted { margin: 5px 0 0; }
.opportunity-total { display: flex; flex-direction: column; align-items: flex-end; min-width: 190px; color: #526078; font-size: 12px; }
.opportunity-total strong { color: #027a48; font-size: 24px; line-height: 1.1; }
.opportunity-total small { margin-top: 4px; color: #8a5800; }
.opportunity-list { display: grid; gap: 10px; }
.opportunity-card { padding: 14px 16px; border: 1px solid #d9e5dc; border-radius: 14px; background: linear-gradient(135deg, #ffffff 0%, #f8fcf9 100%); }
.opportunity-card[data-status="RESOLVED"], .opportunity-card[data-status="DISMISSED"] { opacity: 0.62; background: #f7f8fa; }
.opportunity-card-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
.opportunity-card-header > div:first-child { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; align-items: center; }
.opportunity-card-header > div:first-child > strong { color: #172033; font-size: 14px; }
.opportunity-merchant { grid-column: 2; color: #526078; font-size: 12px; }
.opportunity-priority { padding: 3px 6px; border-radius: 999px; font-size: 9px; font-weight: 850; letter-spacing: 0.06em; }
.opportunity-priority.high { background: #fee4e2; color: #b42318; }
.opportunity-priority.medium { background: #fff0c2; color: #7a4b00; }
.opportunity-priority.low { background: #e8eff8; color: #295d9d; }
.opportunity-impact { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.opportunity-impact strong { color: #172033; font-size: 15px; }
.opportunity-impact span { color: #748099; font-size: 10px; }
.opportunity-card > p { margin: 8px 0 0; color: #526078; font-size: 12px; line-height: 1.45; }
.opportunity-card .opportunity-recommendation { color: #223a63; font-weight: 700; }
.opportunity-evidence { margin-top: 8px; color: #7a859b; font-size: 10px; }
.opportunity-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.opportunity-status { margin-right: auto; color: #526078; font-size: 11px; font-weight: 700; }
.opportunity-action { width: auto; min-height: 28px; padding: 0 9px; border: 1px solid #dce3ed; border-radius: 7px; background: white; color: #344054; font-size: 10px; }
.opportunity-action.primary { border-color: #172033; background: #172033; color: white; }
.watchdog-clear { padding: 28px; border: 1px solid #d9e5dc; border-radius: 8px; background: #f6faf7; }
.watchdog-clear h3 { margin: 0; color: #173c2b; font-size: 18px; }
.watchdog-clear p { margin: 7px 0 0; color: #526078; font-size: 12px; }
.watchdog-card[data-severity="ACTION"] { border-left: 3px solid #a15c20; }
.watchdog-card[data-severity="REVIEW"] { border-left: 3px solid #2b7254; }
.watchdog-card[data-severity="INFO"] { border-left: 3px solid #6f7c89; }
.opportunity-priority.watchdog-action { background: #f7efe1; color: #89541e; }
.opportunity-priority.watchdog-review { background: #e8f3ed; color: #236246; }
.opportunity-priority.watchdog-info { background: #eef2f4; color: #526078; }
.watchdog-evidence { margin-top: 12px; border-top: 1px solid #e3e9e5; padding-top: 10px; color: #526078; font-size: 11px; }
.watchdog-evidence summary { cursor: pointer; color: #075c3f; font-weight: 750; }
.watchdog-evidence p { line-height: 1.5; }
.watchdog-evidence dl { display: grid; grid-template-columns: minmax(130px, 1fr) 1fr; gap: 5px 14px; }
.watchdog-evidence dt { color: #748078; }
.watchdog-evidence dd { margin: 0; text-align: right; font-weight: 700; }
@media (max-width: 760px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    .sidebar, .app-shell, .topbar, .welcome-card, .section { min-width: 0; max-width: 100%; }
    .topbar { height: auto; min-height: 92px; flex-wrap: wrap; padding: 10px 0; }
    #current-view-label { width: 100%; }
    .topbar-actions { width: 100%; min-width: 0; justify-content: space-between; }
    .topbar-actions button { min-width: 0; padding-inline: 8px; }
    .watchdog-evidence dl { grid-template-columns: 1fr; gap: 2px; }
    .watchdog-evidence dd { margin: 0 0 8px; text-align: left; }
    .watchdog-card .opportunity-controls { display: grid; grid-template-columns: 1fr 1fr; }
    .watchdog-card .opportunity-controls .primary { grid-column: 1 / -1; }
    .watchdog-card .opportunity-action { min-height: 38px; }
}
.annual-change-list { display: grid; gap: 6px; }
.annual-change-row { display: grid; grid-template-columns: 130px 150px 150px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid #edf0f5; color: #344054; font-size: 12px; }
.annual-change-row > span:nth-child(2) { text-align: right; font-weight: 700; }
.annual-change-row small { color: #748099; }
.annual-change-value { font-weight: 800; }
.annual-change-value.up { color: #b42318; }
.annual-change-value.down { color: #027a48; }
.annual-change-value.same { color: #667085; }
.annual-savings-route { margin-top: 18px; padding: 15px 17px; border: 1px solid #cfe8d7; border-radius: 14px; background: #f5fbf7; }
.annual-savings-route strong { color: #14532d; font-size: 14px; }
.annual-savings-route p { margin: 6px 0 0; color: #41604b; font-size: 12px; line-height: 1.5; }
.set-limit-button { width: auto; min-height: 28px; margin-top: 10px; padding: 0 10px; border: 1px solid #b7d8c2; border-radius: 7px; background: #f4fbf6; color: #17623c; font-size: 10px; }
.inline-limit-form { display: grid; grid-template-columns: minmax(120px, 180px) auto minmax(0, 1fr); gap: 6px; align-items: center; margin-top: 7px; }
.inline-limit-form input { min-height: 30px; border: 1px solid #dce3ed; border-radius: 7px; padding: 0 9px; }
.inline-limit-form button { width: auto; min-height: 30px; padding: 0 10px; font-size: 10px; }
.inline-limit-form small { color: #52705d; }

.card-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
    color: #7a859b;
}

.empty-state {
    padding: 22px;
    border: 1px dashed #d9dfeb;
    border-radius: 16px;
    color: #748099;
    font-size: 14px;
}

@media (max-width: 900px) {
    .controls,
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .welcome-card {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .upload-choice-grid { grid-template-columns: 1fr; }

    .app-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 18px;
    }

    .period-panel {
        padding: 12px;
    }

    .period-panel-heading {
        align-items: flex-start;
    }

    .year-tab {
        margin-left: 0;
    }

    .topbar {
        align-items: flex-start;
        gap: 8px;
        flex-direction: column;
    }

    .welcome-card {
        flex-direction: column;
        padding: 24px;
    }

    .score-badge {
        min-width: 110px;
        min-height: 110px;
    }

    .controls,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .statement-recovery { grid-column: 1; }
}


.upload-zone {
    border: 1.5px dashed #cfd7e6;
    border-radius: 16px;
    min-height: 145px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
    background: #fbfcfe;
}

.upload-zone.dragging {
    border-color: #172033;
    background: #f3f5f9;
    transform: scale(1.01);
}

.upload-zone:hover .upload-illustration { transform: translateY(-2px) scale(1.03); }

.upload-illustration { width: 108px; height: 78px; margin: -2px 0 4px; transition: transform 0.2s ease; }
.upload-illustration svg { width: 100%; height: 100%; overflow: visible; }
.illustration-sheet { fill: #edf4ff; stroke: #295d9d; stroke-width: 2; }
.illustration-fold { fill: none; stroke: #295d9d; stroke-linejoin: round; stroke-width: 2; }
.illustration-lines { fill: none; stroke: #97b6dc; stroke-linecap: round; stroke-width: 3; }
.illustration-chart { fill: none; stroke: #027a48; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.illustration-badge { fill: #027a48; stroke: #fff; stroke-width: 3; }
.illustration-plus { fill: none; stroke: #fff; stroke-linecap: round; stroke-width: 2.5; }

.upload-title {
    font-size: 14px;
    font-weight: 800;
    color: #172033;
}

.upload-text {
    margin-top: 4px;
    color: #7a859b;
    font-size: 12px;
}

.secondary-button {
    width: auto;
    min-height: 38px;
    margin-top: 12px;
    padding: 0 16px;
    background: white;
    color: #172033;
    border: 1px solid #dfe5ef;
    font-size: 12px;
}

.selected-file {
    margin-top: 10px;
    color: #344054;
    font-size: 12px;
    font-weight: 700;
}

.source-list {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
}

.source-batch {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 170px 170px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #d9e3f1;
    border-radius: 12px;
    background: #f7f9fd;
    color: #172033;
    font-size: 13px;
}

.source-batch select { min-height: 36px; border: 1px solid #d5ddeb; border-radius: 9px; background: white; }
.source-details { border: 1px solid #e4e9f2; border-radius: 12px; background: white; }
.source-details summary { padding: 11px 14px; cursor: pointer; color: #526078; font-size: 12px; font-weight: 700; }
.source-details[open] summary { border-bottom: 1px solid #e4e9f2; }
.source-details .source-row { margin: 8px; }

.source-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 125px 170px 170px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f7f9fc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    color: #172033;
}

.source-type {
    display: inline-flex;
    width: fit-content;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #294f86;
    font-size: 10px;
    font-weight: 800;
}
.source-type.credit-card { background: #eaf8f0; color: #17633f; }

.source-row select {
    min-height: 36px;
    border: 1px solid #d5ddeb;
    border-radius: 9px;
    background: white;
    padding: 0 8px;
    color: #172033;
}

.country-breakdown {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #dfe5ef;
    color: #52617a;
    font-size: 13px;
}

.country-breakdown > span { font-weight: 700; color: #172033; }

.country-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-top: 8px;
}

.country-row strong { color: #172033; }

.identify-pse-button {
    margin: 5px 0 8px;
    padding: 5px 9px;
    border: 0;
    border-radius: 7px;
    background: #e7f5ec;
    color: #17623c;
    font-size: 12px;
    font-weight: 700;
}

.merchant-edit-button {
    display: inline-flex !important;
    grid-column: 7;
    grid-row: 1;
    width: 14px !important;
    min-width: 14px;
    max-width: 14px;
    min-height: 14px !important;
    height: 14px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #526f94;
    font-size: 11px;
    line-height: 1;
    align-items: center;
    justify-content: center;
}

.merchant-edit-button:hover { background: #edf4ff; color: #172f51; }

.transaction-editor {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 140px 140px 140px auto;
    gap: 5px;
    align-items: center;
    margin: 7px 0 8px;
    padding: 7px 9px;
    border-top: 1px solid #edf0f5;
}

.transaction-editor input,
.transaction-editor select {
    min-height: 28px;
    border: 1px solid #dce3ed;
    border-radius: 6px;
    padding: 0 7px;
    font-size: 12px;
}

.transaction-editor button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
}

.transaction-editor span { grid-column: 1 / -1; font-size: 12px; color: #52617a; }

.category-workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 26px 0 10px; }
.category-workspace-heading h3 { margin: 0; color: #223a63; font-size: 16px; font-weight: 850; letter-spacing: 0.08em; }
.category-workspace-heading p { margin: 5px 0 0; color: #748099; font-size: 11px; }
.add-category-button, .add-subcategory-button { width: auto; min-height: 28px; padding: 0 10px; border: 1px solid #cfd9e8; border-radius: 7px; background: white; color: #315d96; font-size: 10px; white-space: nowrap; }
.add-category-button:hover, .add-subcategory-button:hover { background: #edf4ff; }
.inline-name-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto minmax(0, 1fr); gap: 7px; align-items: center; margin: 7px 0 10px; padding: 8px; border: 1px solid #cfe0f2; border-radius: 9px; background: #f6f9fd; }
.inline-name-form input { min-height: 32px; padding: 0 9px; border: 1px solid #cfd9e8; border-radius: 7px; background: white; color: #172033; font-size: 12px; }
.inline-name-form button { width: auto; min-height: 32px; padding: 0 11px; border-radius: 7px; background: #173a67; color: white; font-size: 10px; }
.inline-name-form .inline-name-cancel { border: 1px solid #d5ddea; background: white; color: #667085; }
.inline-name-form small { color: #b42318; font-size: 10px; }
.spending-category-card { margin-top: 8px; border: 1px solid #dbe4f0; border-left-width: 4px; border-radius: 12px; background: #fff; transition: border-color 0.15s, background 0.15s; }
.category-tone-services { border-color: #cbdcf2; border-left-color: #4285c5; background: #f3f8ff; }
.category-tone-credits { border-color: #ead8ad; border-left-color: #d3972f; background: #fff9ef; }
.category-tone-health { border-color: #cae6d8; border-left-color: #2e9b68; background: #f2fbf7; }
.category-tone-delivery { border-color: #edd6c4; border-left-color: #dc7a3e; background: #fff7f1; }
.category-tone-insurance { border-color: #dcd2ef; border-left-color: #7a61b7; background: #f7f4ff; }
.category-tone-travel { border-color: #c8e6e8; border-left-color: #2498a0; background: #f1fbfc; }
.category-tone-taxes { border-color: #e5d7c5; border-left-color: #a36b2c; background: #fcf8f2; }
.category-tone-other { border-color: #dfe3e9; border-left-color: #7d8796; background: #f7f8fa; }
.category-tone-custom { border-color: #d7ddea; border-left-color: #607da5; background: #f6f8fb; }
.refund-category-card { border-color: #cce7d9; border-left-color: #20a464; background: #f0fbf5; }
.refund-category-card > summary, .refund-category-card > summary strong { color: #027a48; }
.spending-category-card.drag-over { border-color: #3474bd; background: #f0f6ff; box-shadow: 0 0 0 3px rgba(52, 116, 189, 0.12); }
.spending-category-card > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, auto) 20px;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    cursor: pointer;
    color: #173a67;
    font-size: 14px;
    font-weight: 850;
}
.spending-category-card > summary > span:first-child { min-width: 0; }
.spending-category-card > summary > button.delete-category-button {
    flex: 0 0 20px !important;
    width: 20px !important;
    max-width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0 0 0 -10px;
    padding: 0 !important;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: #8793a6;
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
}
.spending-category-card > summary > button.delete-category-button:hover { border-color: #e6b8b8; background: #fff1f1; color: #a42d2d; opacity: 1; }
.category-figures { display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; }
.category-figures strong { color: #172033; font-size: 14px; }
.category-figures small { color: #7a859b; font-size: 10px; font-weight: 500; }
.minor-opportunity-findings { margin-top: 10px; border: 1px solid #e1e6ee; border-radius: 10px; background: #fafbfd; }
.minor-opportunity-findings > summary { padding: 10px 12px; cursor: pointer; color: #526078; font-size: 11px; font-weight: 800; }
.minor-opportunity-findings > p { margin: 0; padding: 0 12px 9px; color: #7a859b; font-size: 9px; }
.minor-opportunity-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 12px; border-top: 1px solid #edf0f5; color: #526078; font-size: 10px; }
.minor-opportunity-row > span { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.minor-opportunity-row small { overflow: hidden; color: #7a859b; text-overflow: ellipsis; white-space: nowrap; }
.spending-category-body { padding: 0 10px 10px; border-top: 1px solid rgba(211, 221, 234, 0.72); border-radius: 0 0 10px 10px; background: rgba(255, 255, 255, 0.58); }
.spending-category-body > .add-subcategory-button { display: block; margin: 7px 0 4px auto; }
.spending-subcategory { margin-top: 7px; border-left: 3px solid #9cb9db; background: #f8fafc; border-radius: 7px; }
.spending-subcategory > summary { display: flex; justify-content: space-between; gap: 14px; padding: 7px 10px; cursor: pointer; color: #344f73; font-size: 11px; font-weight: 800; }
.subcategory-dropzone { min-height: 28px; padding: 1px 7px 7px; color: #8a96a9; font-size: 10px; }
.empty-category-hint { margin: 4px 0 0; padding: 8px; border: 1px dashed #d9e2ee; border-radius: 7px; color: #8a96a9; font-size: 10px; text-align: center; }
.missing-expected-payments { margin-top: 16px; border: 1px dashed #d5ddea; border-radius: 10px; background: #fafbfc; }
.missing-expected-payments > summary { padding: 9px 12px; cursor: pointer; color: #667085; font-size: 11px; font-weight: 750; }
.auxiliary-heading { margin-top: 20px; }
.unrecognized-alert-section { margin-top: 18px; padding: 14px; border: 1px solid #efb5af; border-radius: 13px; background: #fff6f5; }
.unrecognized-alert-section > h3 { margin: 0 0 8px; color: #a52a20; font-size: 12px; letter-spacing: 0.06em; }
.unrecognized-alert-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; background: white; cursor: pointer; }
.unrecognized-alert-row div { display: flex; flex-direction: column; gap: 2px; }
.unrecognized-alert-row span { color: #7a4a47; font-size: 10px; }
.unrecognized-alert-row > strong { color: #b42318; }

.duplicate-charge-section {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #f3c7c2;
    border-radius: 14px;
    background: #fff8f7;
}

.duplicate-charge-section > h3 {
    margin: 0 0 10px;
    color: #8f2d24;
    font-size: 13px;
    letter-spacing: 0.08em;
}

.repeated-charge-section {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #f2d38b;
    border-radius: 14px;
    background: #fffaf0;
}

.repeated-charge-section > h3 {
    margin: 0 0 10px;
    color: #7a4b00;
    font-size: 13px;
    letter-spacing: 0.06em;
}

.duplicate-charge-alert,
.repeated-charge-alert {
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    border-radius: 10px;
    background: #fff;
}

.duplicate-charge-alert + .duplicate-charge-alert,
.repeated-charge-alert + .repeated-charge-alert {
    margin-top: 8px;
}

.duplicate-charge-alert p,
.repeated-charge-alert p {
    margin: 0;
    color: #3e4b61;
    font-size: 13px;
}

.duplicate-charge-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: #172033;
    font-size: 13px;
}

.duplicate-charge-recovery { color: #a32920; }
.duplicate-charge-recovery.refunded { color: #027a48; }
.repeated-charge-impact { color: #8a5800; }
.duplicate-charge-action { color: #52617a; }

.duplicate-charge-alert {
    padding: 10px 0;
    border-top: 1px solid #f2d8d4;
}

.duplicate-charge-alert:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.duplicate-charge-alert p {
    margin: 5px 0;
    color: #3f4858;
    font-size: 13px;
}

.duplicate-charge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #172033;
    font-size: 13px;
}

.duplicate-charge-recovery { color: #b42318; }

.duplicate-charge-alert small {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 11px;
}

.duplicate-charge-alert .duplicate-charge-action {
    color: #8f2d24;
    font-weight: 700;
}

@media (max-width: 640px) {
    .transaction-editor { grid-template-columns: 1fr; }
    .annual-month-bars { height: 128px; }
    .annual-financial-costs-header { flex-direction: column; }
    .annual-financial-costs-total { align-items: flex-start; }
    .annual-financial-costs-grid { grid-template-columns: 1fr; }
    .annual-credit-card-header { align-items: flex-start; flex-direction: column; }
    .annual-credit-metrics, .credit-plan-form { grid-template-columns: 1fr 1fr; }
    .savings-guide-rule, .savings-guide-figures { grid-template-columns: 1fr; }
    .savings-guide-rule { gap: 7px; }
}

@media (max-width: 430px) {
    .annual-credit-metrics, .credit-plan-form { grid-template-columns: 1fr; }
    .annual-credit-paid-total { align-items: flex-start; flex-direction: column; }
    .income-breakdown { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .source-row, .source-batch { grid-template-columns: 1fr; }
    .opportunity-heading { flex-direction: column; }
    .opportunity-total { align-items: flex-start; }
    .opportunity-card-header { grid-template-columns: 1fr; }
    .opportunity-impact { align-items: flex-start; }
    .opportunity-controls { flex-wrap: wrap; justify-content: flex-start; }
    .opportunity-status { width: 100%; }
    .annual-change-row { grid-template-columns: 1fr auto; }
    .annual-change-row small { grid-column: 1 / -1; }
    .inline-limit-form { grid-template-columns: 1fr auto; }
    .inline-limit-form small { grid-column: 1 / -1; }
    .income-panel-heading { align-items: flex-start; }
    .income-breakdown { grid-template-columns: 1fr 1fr; }
    .inline-income-form, .income-source-row, .manual-income-row { grid-template-columns: 1fr; }
    .income-source-row strong, .manual-income-row strong { text-align: left; }
}
.credit-cards-workspace {
    margin: 24px 0;
}

.credit-cards-heading {
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 4px solid #1f6f5f;
}

.credit-cards-heading h3 {
    margin: 0;
    color: #123c36;
    letter-spacing: .08em;
}

.credit-cards-heading p {
    margin: 5px 0 0;
    color: #5c6f79;
}

.credit-card-panel {
    margin: 12px 0;
    overflow: hidden;
    border: 1px solid #b9ddd5;
    border-radius: 16px;
    background: #f6fbf9;
}

.credit-card-panel > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    background: #eaf7f2;
}

.credit-card-panel > summary span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.credit-card-panel > summary span:last-child {
    text-align: right;
}

.credit-card-panel > summary small {
    color: #61756f;
}

.credit-card-body {
    padding: 14px;
}

.credit-card-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.credit-card-metrics > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 12px;
    border-radius: 11px;
    background: #fff;
    border: 1px solid #dcebe7;
}

.credit-card-metrics span,
.credit-card-payment-note {
    color: #5c6f79;
    font-size: .82rem;
}

.credit-card-reconciliation {
    margin: 11px 0;
    border: 1px solid #d9e5e2;
    border-radius: 12px;
    background: #f8fbfa;
}

.credit-card-reconciliation.reconciled {
    border-color: #9ed7c7;
    background: #f0faf6;
}

.credit-card-reconciliation.mismatch {
    border-color: #efc4bd;
    background: #fff7f5;
}

.credit-card-reconciliation > summary {
    padding: 11px 13px;
    cursor: pointer;
    color: #24594f;
    font-weight: 800;
}

.credit-card-reconciliation.mismatch > summary { color: #a23e32; }

.credit-card-official-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 8px;
    padding: 0 13px 12px;
}

.credit-card-official-grid > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px;
    border-radius: 8px;
    background: #fff;
}

.credit-card-official-grid span,
.credit-card-reconciliation-checks small {
    color: #697774;
    font-size: .73rem;
}

.credit-card-reconciliation-checks {
    display: grid;
    gap: 6px;
    padding: 0 13px 13px;
}

.credit-card-reconciliation-checks > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.credit-card-payment-note {
    margin: 0 0 12px;
}

.credit-card-installment-group {
    margin: 12px 0;
    overflow: hidden;
    border: 1px solid #cfe3dd;
    border-radius: 12px;
    background: #fff;
}

.credit-card-installment-group > summary {
    padding: 11px 13px;
    cursor: pointer;
    color: #214f47;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .05em;
    background: #eef8f4;
}

.credit-card-installment-group.completed > summary {
    color: #64726f;
    background: #f5f7f7;
}

.credit-card-installment-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(125px, .75fr));
    gap: 12px;
    align-items: center;
    padding: 11px 13px;
    border-top: 1px solid #e5efec;
}

.credit-card-installment-row > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.credit-card-installment-row span,
.credit-card-installment-row small {
    color: #6a7774;
    font-size: .76rem;
}

.installment-merchant strong {
    color: #152d29;
}

.credit-card-category {
    margin-top: 9px;
    border-top: 1px solid #dcebe7;
}

.credit-card-category > summary {
    display: flex;
    justify-content: space-between;
    padding: 11px 4px;
    cursor: pointer;
    font-weight: 700;
}

.credit-card-purchases-heading {
    display: flex;
    justify-content: space-between;
    padding: 11px 4px 7px;
    color: #315e56;
    font-size: .86rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.remove-subcategory-button {
    margin: 0 0 6px 12px;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: #7c5656;
    cursor: pointer;
    font-size: .72rem;
}

.credit-card-purchases .merchant-detail {
    margin: 6px 0;
    background: #fff;
}

.credit-card-add-subcategory {
    margin: 2px 4px 8px;
}

.credit-card-subcategory {
    margin: 7px 0;
    padding: 0 9px;
    border-left: 3px solid #9bcfc2;
}

.credit-card-subcategory > summary {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    color: #315e56;
    font-size: .88rem;
    font-weight: 700;
}

@media (max-width: 720px) {
    .credit-card-metrics { grid-template-columns: 1fr; }
    .credit-card-panel > summary { grid-template-columns: 1fr; }
    .credit-card-panel > summary span:last-child { text-align: left; }
    .credit-card-installment-row { grid-template-columns: 1fr 1fr; }
    .installment-merchant { grid-column: 1 / -1; }
    .credit-card-official-grid { grid-template-columns: 1fr 1fr; }
    .credit-card-reconciliation-checks > div { flex-direction: column; gap: 2px; }
}

/* Fineraly financial cockpit: restrained surfaces, clear hierarchy, one brand color. */
:root { --brand:#126153; --brand-dark:#0e463c; --ink:#202b35; --muted:#65717a; --line:#e2e7e7; --canvas:#f5f7f7; font-family:Inter,"Segoe UI",system-ui,sans-serif; color:var(--ink); background:var(--canvas); font-synthesis:none; }
body { background:var(--canvas); font-size:16px; line-height:1.5; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible,input:focus-visible,[tabindex]:focus-visible { outline:3px solid #69a799; outline-offset:4px; }
button:disabled { cursor:default; opacity:.55; }
[hidden],.hidden { display:none !important; }
.skip-link { position:fixed; top:-100px; left:260px; z-index:100; background:white; color:var(--brand); padding:12px; }
.skip-link:focus { top:12px; }
.sidebar { position:fixed; inset:0 auto 0 0; z-index:20; width:236px; background:#fff; border-right:1px solid var(--line); padding:35px 22px 24px; display:flex; flex-direction:column; }
.brand-lockup { text-decoration:none; display:flex; gap:11px; align-items:center; color:var(--ink); }
.brand-symbol { display:grid; place-items:center; width:34px; height:39px; background:var(--brand); border-radius:5px; color:white; font-size:25px; font-weight:650; font-family:Georgia,serif; }
.brand-lockup strong { display:block; font-size:18px; letter-spacing:.14em; font-weight:720; }
.brand-lockup small { display:block; font-size:11px; letter-spacing:.025em; color:var(--muted); margin-top:2px; }
.nav-caption { font-size:10px; letter-spacing:.12em; font-weight:650; color:#77858b; margin:58px 12px 15px; }
.primary-nav { display:flex; flex-direction:column; gap:22px; min-height:0; margin-top:48px; overflow-y:auto; scrollbar-width:thin; }
.nav-group { display:grid; gap:4px; }
.nav-group-title { margin:0 14px 7px; color:#84908b; font-size:9px; font-weight:700; letter-spacing:.15em; line-height:1.3; }
.primary-nav a { position:relative; display:flex; align-items:center; gap:13px; text-decoration:none; color:#5c686e; padding:10px 14px; border-radius:6px; font-size:14px; font-weight:500; min-height:42px; }
.primary-nav a>span:first-child { font-size:21px; line-height:1; width:20px; text-align:center; font-weight:400; }
.primary-nav a:hover { background:#f4f7f6; color:var(--brand); }
.primary-nav a[aria-current=page] { background:#edf5f1; color:var(--brand); font-weight:650; }
.primary-nav a[aria-current=page]::before { position:absolute; inset:8px auto 8px 0; width:3px; border-radius:0 2px 2px 0; background:var(--brand); content:""; }
.nav-count { background:var(--brand); color:white; border-radius:4px; padding:0 6px; margin-left:auto; font-size:11px; }
.sidebar-footer { margin-top:auto; padding:24px 12px 0; font-size:12px; color:var(--muted); }
.sidebar-footer strong { font-weight:600; color:#43544e; }
.sidebar-footer p { margin-top:4px; }
.brand-rule { display:block; width:25px; height:2px; background:var(--brand); margin-bottom:17px; }
.app-shell { margin:0 0 0 236px; width:auto; max-width:1800px; padding:0 42px 40px; }
.topbar { height:83px; margin-bottom:0; border-bottom:1px solid var(--line); font-size:14px; color:#5c676d; }
.topbar-actions { display:flex; align-items:center; gap:14px; }
button,.primary-button { border-radius:6px; background:var(--brand); box-shadow:none; font-weight:550; }
.primary-button { border:1px solid var(--brand); padding:10px 17px; color:white; min-height:43px; font-size:14px; }
button:hover,.primary-button:hover { background:var(--brand-dark); }
.profile-button { background:transparent; border:0; color:#53615e; padding:8px; font-size:13px; }
.profile-button:hover { background:#eaf1ee; }
.welcome-card { background:transparent; border:0; box-shadow:none; border-radius:0; padding:32px 0 28px; align-items:center; gap:20px; }
.welcome-card h1 { font-size:30px; letter-spacing:-.035em; line-height:1.2; margin:0 0 7px; font-weight:620; }
.welcome-card .eyebrow { font-size:10px; letter-spacing:.13em; color:var(--muted); margin-bottom:10px; }
.welcome-card .muted { font-size:14px; margin:0; }
.context-controls { display:grid; grid-template-columns:auto 1fr; gap:5px 12px; align-items:center; flex-shrink:0; font-size:12px; color:var(--muted); }
.context-controls select { font-size:13px; padding:8px 32px 8px 12px; border:1px solid #d6dede; min-height:38px; color:#36443f; border-radius:6px; background:#fff; max-width:230px; }
#account-context { grid-column:2; font-size:11px; text-align:right; }
.surface,.section { border:1px solid var(--line); background:white; border-radius:9px; box-shadow:0 2px 3px #233c3002; padding:24px; margin:0 0 22px; }
.cp-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; background:white; border:1px solid var(--line); border-radius:9px; overflow:hidden; margin-bottom:24px; }
.cp-metric { padding:23px 24px; min-height:160px; display:flex; flex-direction:column; gap:7px; border:0; border-right:1px solid var(--line); background:transparent; color:var(--ink); text-align:left; border-radius:0; min-width:0; }
.cp-metric>span { font-size:13px; font-weight:500; color:#5c6b66; }
.cp-metric>strong { font-size:clamp(24px,2.2vw,33px); letter-spacing:-.045em; line-height:1.45; font-weight:610; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.cp-metric>small { font-size:11px; color:#6c7974; line-height:1.55; font-weight:400; }
.cp-savings { background:#eef6f2; border-right:0; }
.cp-savings>strong,.cp-savings>span,.cp-savings>small { color:var(--brand); }
.cp-savings:hover { background:#e0eee6; }
.cp-savings small>span { float:right; font-size:17px; }
.cp-section-heading { display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:9px; }
.cp-section-heading h2 { font-size:17px; letter-spacing:-.015em; font-weight:620; }
.text-button { padding:3px 0; background:transparent; border:0; color:var(--brand); font-size:12px; white-space:nowrap; min-height:28px; }
.text-button:hover { background:transparent; text-decoration:underline; }
.cp-section-note { color:var(--muted); font-size:12px; margin:0 0 16px; }
.cp-empty { padding:22px 0; color:var(--muted); }
.cp-empty strong { font-size:14px; font-weight:520; color:#485950; }
.cp-empty p { font-size:13px; line-height:1.7; margin:6px 0 0; max-width:640px; }
.cp-attention { border-left:3px solid var(--brand); }
.attention-row { display:grid; grid-template-columns:32px minmax(0,1fr) auto auto; gap:16px; align-items:center; padding:19px 0; border-top:1px solid var(--line); }
.attention-row h3 { margin:0 0 4px; font-size:14px; font-weight:600; }
.attention-row p { font-size:12px; color:var(--muted); margin:0; max-width:700px; line-height:1.6; }
.attention-marker { color:#728c7f; font-size:12px; font-variant-numeric:tabular-nums; }
.attention-amount { text-align:right; min-width:100px; }
.attention-amount strong { display:block; font-size:16px; font-weight:600; font-variant-numeric:tabular-nums; }
.attention-amount small { font-size:11px; color:var(--muted); }
.row-button { font-size:12px; background:white; border:1px solid #dce5df; color:var(--brand); padding:8px 12px; min-height:36px; }
.row-button:hover { color:white; }
.cp-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(0,1fr); gap:22px; align-items:stretch; }
.cp-grid>.surface { min-width:0; }
.flow-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px; margin:16px 0 10px; }
.chart-legend { display:flex; gap:18px; font-size:11px; color:var(--muted); }
.chart-legend span:before { content:''; display:inline-block; width:7px; height:7px; margin-right:7px; border-radius:2px; background:var(--brand); }
.chart-legend .legend-spending:before { background:#a9b9b3; }
.range-control { display:flex; padding:3px; border-radius:5px; background:#f3f5f4; }
.range-control button { padding:4px 8px; min-height:28px; font-size:11px; border:0; background:transparent; color:#64736b; border-radius:3px; }
.range-control button[aria-pressed=true] { background:#fff; box-shadow:0 1px 3px #18362a17; color:var(--brand); }
.cash-chart { display:flex; gap:13px; height:186px; margin-top:20px; }
.chart-scale { display:flex; flex-direction:column; justify-content:space-between; padding:0 0 27px; font-size:10px; color:#7f8e86; max-width:100px; overflow-wrap:anywhere; }
.chart-plot { display:flex; flex:1; gap:clamp(6px,2vw,30px); min-width:0; justify-content:space-around; background:repeating-linear-gradient(to top,transparent 0,transparent calc(50% - 1px),#e9eeeb calc(50% - 1px),#e9eeeb 50%); background-size:100% calc(100% - 27px); background-repeat:no-repeat; }
.chart-month { background:none; border:0; padding:0; color:var(--muted); display:flex; align-items:center; flex-direction:column; flex:1; max-width:100px; min-width:0; gap:8px; border-radius:0; }
.chart-month:hover { background:#f3f7f4; }
.chart-bars { display:flex; height:calc(100% - 27px); width:100%; max-width:62px; align-items:flex-end; justify-content:center; gap:5px; }
.chart-bars>span { width:35%; border-radius:3px 3px 0 0; }
.bar-income { background:var(--brand); }.bar-spending { background:#a9b9b3; }
.chart-month-label { font-size:11px; text-transform:capitalize; }
.chart-note { font-size:10px; color:var(--muted); margin:12px 0 4px; }
.chart-data { font-size:11px; color:var(--muted); }
.chart-data summary { cursor:pointer; }.chart-data>div { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:6px 0; }
.flow-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:18px; border-top:1px solid var(--line); padding-top:16px; font-size:12px; }
.flow-footer small { display:block; font-size:10px; color:var(--muted); margin-top:3px; }.flow-footer strong { font-size:19px; font-weight:600; white-space:nowrap; }
.category-summary { display:block; width:100%; background:transparent; color:var(--ink); text-align:left; border:0; padding:10px 0 12px; }
.category-summary:hover { background:#f5f8f6; }
.category-summary>span:first-child { display:flex; justify-content:space-between; gap:15px; font-size:12px; }
.category-summary strong { font-weight:550; }.category-summary small { display:block; color:var(--muted); font-size:10px; margin-top:4px; }
.category-track { display:block; height:5px; background:#edf1ef; border-radius:3px; margin-top:9px; overflow:hidden; }.category-track span { display:block; height:100%; background:#5b8e7a; border-radius:3px; }
.cp-bottom-grid { grid-template-columns:1fr 1fr; }
.payment-summary { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:15px 0; border-bottom:1px solid #ecf0ed; font-size:13px; }
.payment-summary:last-child { border-bottom:0; }.payment-summary strong { font-weight:550; overflow-wrap:anywhere; }.payment-summary small { display:block; font-size:11px; color:var(--muted); margin-top:4px; }.payment-summary>strong { white-space:nowrap; }
.help-row { display:flex; align-items:center; justify-content:space-between; gap:15px; width:100%; background:transparent; color:var(--ink); padding:14px 0; text-align:left; border:0; border-bottom:1px solid var(--line); border-radius:0; }
.help-row:hover { background:#f5f8f6; }.help-row strong { font-size:13px; font-weight:550; }.help-row small { display:block; font-size:12px; color:var(--muted); line-height:1.6; margin-top:4px; }
.cp-recent { padding-bottom:8px; }.transaction-table-header,.transaction-summary { display:grid; grid-template-columns:minmax(0,2.4fr) minmax(110px,1fr) minmax(110px,1fr) minmax(100px,.9fr); align-items:center; gap:20px; width:100%; }
.transaction-table-header { color:#859087; font-size:10px; padding:15px 0 10px; border-bottom:1px solid var(--line); }.transaction-table-header span:last-child { text-align:right; }
.transaction-summary { background:transparent; border:0; border-bottom:1px solid #edf0ed; border-radius:0; color:#66736b; padding:15px 0; text-align:left; font-size:11px; }.transaction-summary:hover { background:#f6f8f6; }.transaction-summary:last-child { border-bottom:0; }
.transaction-name { display:flex; align-items:center; gap:12px; min-width:0; }.transaction-name>span:last-child { min-width:0; }.transaction-name strong { font-size:12px; color:var(--ink); font-weight:550; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.transaction-name small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; color:var(--muted); max-width:340px; margin-top:2px; }
.merchant-monogram { display:grid; flex-shrink:0; place-items:center; width:33px; height:33px; background:#f0f3f1; color:#697e73; border:1px solid #e8ede9; border-radius:7px; font-size:13px; }.transaction-summary>strong { color:var(--ink); text-align:right; font-size:13px; font-weight:550; white-space:nowrap; }
.cp-data-note { font-size:11px; line-height:1.7; color:var(--muted); margin:14px 0; }
.account-facts { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; margin:30px 0; }.account-facts span { display:block; font-size:12px; color:var(--muted); }.account-facts strong { display:block; margin-top:6px; font-size:20px; font-weight:550; }
.empty-workspace { text-align:center; padding:50px 24px; }.empty-workspace p { margin-left:auto; margin-right:auto; }.load-status { color:var(--muted); font-size:13px; padding:15px; background:#edf3ef; border-radius:7px; margin-bottom:20px; }
dialog { border:1px solid var(--line); border-radius:12px; box-shadow:0 24px 80px #17332a33; padding:30px; width:min(720px,calc(100% - 28px)); max-height:85vh; color:var(--ink); }
dialog::backdrop { background:#17312966; }.dialog-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; border-bottom:1px solid var(--line); padding-bottom:20px; }.dialog-heading h2 { font-size:23px; line-height:1.3; }.dialog-heading .eyebrow { color:var(--brand); }
.icon-button { background:#f1f4f2; color:var(--ink); font-size:24px; line-height:1; width:36px; height:36px; padding:4px; border:0; flex-shrink:0; }.icon-button:hover { background:#e2eae5; }
#savings-detail>p { font-size:14px; color:var(--muted); line-height:1.7; margin:20px 0; }.savings-total { display:flex; justify-content:space-between; gap:20px; background:#eef5f1; color:var(--brand); padding:18px; margin:22px 0 12px; border-radius:6px; font-size:14px; }.savings-total strong { font-size:21px; font-weight:600; }.savings-total.secondary { background:#f2f4f3; color:var(--ink); }.saving-source { border-bottom:1px solid var(--line); padding:15px 0; }.saving-source>div { display:flex; justify-content:space-between; gap:20px; }.saving-source h3 { font-size:15px; margin:0; }.saving-source p { font-size:13px; color:var(--muted); margin:10px 0; }.saving-source small,.saving-basis { font-size:12px; color:var(--muted); }
/* Retain established editors and actions; use navigation to control their disclosure. */
body[data-view=transactions] [data-legacy-view]:not([data-legacy-view~=transactions]),body[data-view=reports] [data-legacy-view]:not([data-legacy-view~=reports]),body[data-view=watchdog] [data-legacy-view]:not([data-legacy-view~=watchdog]),body[data-view=recurring] [data-legacy-view]:not([data-legacy-view~=recurring]) { display:none !important; }
.welcome-card #score-badge,.welcome-card #health-summary { display:none !important; }
.metrics-grid #savings-card { display:none; }.metrics-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }.metric-card { border-radius:8px; box-shadow:none; border:1px solid var(--line); }
.upload-panel { box-shadow:none; background:white; border:1px solid var(--line); border-radius:9px; padding:22px; margin:0 0 22px; }.upload-panel:has(#upload-workspace.hidden):not(:has(.error:not(.hidden))) { display:none; }
body:not([data-view=accounts]) #upload-panel:not(.import-open):not(:has(#statement-recovery:not(.hidden))):not(:has(.error:not(.hidden))) { display:none; }
.upload-zone,.card-upload-zone { border:1px dashed #a8bfb4; border-radius:8px; box-shadow:none; background:#f8faf9; }.upload-illustration,.upload-card-illustration { display:none; }.upload-zone { min-height:160px; padding:25px; }.upload-title { font-size:18px; }.upload-text { font-size:13px; }
.secondary-button,.secondary-disclosure,.add-movement-button,.expected-payment-button { border:1px solid #d8e4dd; border-radius:6px; color:var(--brand); background:#f4f8f5; }.secondary-button:hover,.secondary-disclosure:hover,.add-movement-button:hover,.expected-payment-button:hover { background:#e8f0eb; }
.section-heading h2 { font-size:21px; }.eyebrow { font-size:11px; color:var(--muted); }.period-panel,.month-card,.month-summary,.income-form,.health-summary,.annual-summary,.annual-overview,.credit-workspace-intro { background:#f5f8f6; border-color:var(--line); border-radius:8px; box-shadow:none; }
.month-tab { background:#f0f4f1; color:#486251; border:1px solid #dfe8e1; border-radius:5px; }.month-tab.active { background:var(--brand); color:#fff; border-color:var(--brand); }.year-tab,.credits-tab { background:#f0f4f1; }
.opportunity-card,.insight-card,.spending-review-card,.merchant-detail { box-shadow:none; border-radius:7px; border-color:var(--line); }.opportunity-total strong { color:var(--brand); }.opportunity-priority { border-radius:4px; }.opportunity-priority.high { background:#f7efe1; color:#89541e; }.opportunity-priority.medium,.opportunity-priority.low { background:#eef2ee; color:#567360; }.opportunity-card[data-status=RESOLVED],.opportunity-card[data-status=DISMISSED] { opacity:.72; }
.opportunity-action.primary { background:var(--brand); border-color:var(--brand); }.statement-quality-badge { font-size:12px; }.profile-panel { margin:20px 0; box-shadow:none; border:1px solid var(--line); border-radius:8px; background:white; }
.annual-bar-fill.income { background:var(--brand); }.annual-bar-fill.spending { background:#a9b9b3; }
@media(min-width:1600px) { .app-shell { padding-left:60px; padding-right:60px; }.cp-metric { padding:28px; } }
@media(max-width:1200px) { .sidebar { width:205px; padding:30px 14px; }.app-shell { margin-left:205px; padding:0 26px 30px; }.brand-lockup strong { font-size:16px; }.cp-metric { padding:20px 17px; }.cp-metric>strong { font-size:25px; }.attention-row { gap:12px; grid-template-columns:minmax(0,1fr) auto; }.attention-marker { display:none; }.row-button { grid-column:2; }.cp-grid { gap:18px; }.surface { padding:21px; }.context-controls { max-width:235px; }.transaction-table-header,.transaction-summary { gap:12px; grid-template-columns:minmax(0,2fr) 100px 95px 100px; } }
@media(max-width:1000px) { .cp-grid { grid-template-columns:1fr; }.cp-categories #cp-categories { display:grid; grid-template-columns:1fr 1fr; gap:0 24px; }.cp-metrics { grid-template-columns:1fr 1fr; }.cp-metric:nth-child(2) { border-right:0; }.cp-metric:nth-child(-n+2) { border-bottom:1px solid var(--line); }.cp-metric { min-height:140px; }.welcome-card { align-items:flex-start; flex-direction:column; }.context-controls { display:flex; max-width:none; flex-wrap:wrap; }.context-controls #account-context { margin-left:6px; }.transaction-type { display:none; }.transaction-table-header,.transaction-summary { grid-template-columns:minmax(0,1.8fr) 100px 100px; }.transaction-table-header>span:nth-child(3) { display:none; } }
@media(max-width:760px) { .sidebar { position:static; width:100%; height:auto; padding:17px 18px 0; border-right:0; border-bottom:1px solid var(--line); }.brand-lockup { justify-content:flex-start; }.brand-symbol { width:27px; height:32px; font-size:22px; }.brand-lockup strong { font-size:15px; }.brand-lockup small { font-size:10px; }.nav-caption,.sidebar-footer { display:none; }.primary-nav { flex-direction:row; gap:4px; overflow:auto; margin:18px -8px 0; padding-bottom:8px; }.primary-nav a { flex-shrink:0; font-size:12px; min-height:40px; padding:8px 10px; gap:6px; }.primary-nav a>span:first-child { display:none; }.app-shell { margin:0; padding:0 18px 28px; }.topbar { height:65px; font-size:12px; }.topbar-actions { gap:8px; }.primary-button { min-height:38px; padding:8px 12px; font-size:12px; }.profile-button { font-size:12px; }.welcome-card { padding:26px 0 22px; gap:17px; }.welcome-card h1 { font-size:27px; }.welcome-card .muted { font-size:13px; }.context-controls select { font-size:12px; }.context-controls label { font-size:11px; }.surface { padding:19px; margin-bottom:18px; border-radius:8px; }.cp-metric { padding:18px 16px; min-height:144px; }.cp-metric>span { font-size:12px; }.cp-metric>strong { font-size:24px; }.cp-metric>small { font-size:11px; }.cp-section-heading h2 { font-size:16px; }.cp-section-heading { gap:10px; }.text-button { font-size:11px; }.cp-section-note { font-size:11px; }.attention-row { grid-template-columns:1fr auto; }.attention-row>div:first-of-type { grid-column:1 / -1; }.attention-amount { text-align:left; }.row-button { grid-column:2; }.cp-categories #cp-categories { display:block; }.transaction-table-header { display:none; }.transaction-summary { grid-template-columns:minmax(0,1fr) auto; gap:5px 12px; }.transaction-name { grid-column:1; grid-row:1 / 3; }.transaction-summary>span:nth-child(2) { grid-column:2; grid-row:2; font-size:10px; text-align:right; }.transaction-summary>strong { grid-column:2; grid-row:1; font-size:12px; }.transaction-name strong { font-size:12px; }.transaction-name small { max-width:150px; }.merchant-monogram { display:none; }.account-facts { grid-template-columns:1fr; gap:20px; }.flow-footer strong { font-size:17px; }.chart-scale { font-size:9px; max-width:77px; }.chart-plot { gap:6px; }.cash-chart { gap:9px; }.metrics-grid { grid-template-columns:1fr; }.section { padding:17px; }.section-heading { flex-wrap:wrap; gap:14px; }.period-panel { padding:14px; }.manual-controls,.profile-fields { grid-template-columns:1fr; }.controls { gap:14px; }.opportunity-card-header { flex-direction:column; }.opportunity-impact { text-align:left; }.opportunity-heading { align-items:flex-start; }.savings-total { flex-direction:column; gap:5px; }.dialog-heading h2 { font-size:20px; }dialog { padding:20px; }.saving-source>div { flex-direction:column; gap:6px; }.skip-link { left:18px; }.profile-panel { padding:17px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation:none !important; transition:none !important; } }

/* Explicit sizing prevents inherited full-width form controls from compressing headings. */
.topbar-actions button,.cp-section-heading button,.range-control button,.row-button,.icon-button { width:auto; flex-shrink:0; }
.cp-section-heading h2 { flex:1; min-width:0; }
.welcome-card #greeting { font-size:12px; font-weight:600; letter-spacing:.1em; color:var(--muted); }
.cp-metric>span,.primary-nav a,.attention-row h3,.payment-summary,.transaction-name strong { font-size:14px; }
.cp-metric>small,.cp-section-note,.chart-legend,.chart-note,.chart-data,.category-summary small,.payment-summary small,.transaction-name small,.cp-data-note,.flow-footer small { font-size:12px; }
.text-button,.range-control button,.category-summary>span:first-child,.attention-row p,.transaction-summary,.help-row small { font-size:13px; }
.chart-month-label,.chart-scale { font-size:12px; }
.transaction-summary>strong { font-size:14px; }
.cp-empty p { font-size:14px; }
.primary-nav { scrollbar-width:thin; }
@media(max-width:760px) { .primary-nav a { font-size:13px; }.cp-metric>span { font-size:13px; }.cp-section-heading { align-items:flex-start; }.cp-section-heading h2 { line-height:1.4; }.cp-section-heading .text-button { font-size:12px; }.flow-footer { align-items:flex-start; }.flow-footer strong { white-space:normal; text-align:right; }.chart-legend { font-size:12px; }.range-control button { font-size:12px; padding:4px 6px; }.transaction-summary>strong { font-size:13px; }.transaction-name small { font-size:11px; }.cash-chart { height:200px; }.chart-scale { max-width:90px; font-size:10px; } }
@media(max-width:760px) { .topbar { flex-direction:row; align-items:center; }.primary-nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); overflow:visible; gap:4px; margin-top:15px; }.primary-nav a { justify-content:center; padding:7px 4px; min-width:0; }.nav-count { margin-left:0; }.sidebar { padding-bottom:4px; }.topbar-actions button { font-size:11px; }.topbar-actions { gap:4px; } }
.signed-chart .chart-bars { position:relative; }.signed-chart .chart-bars>span { position:absolute; bottom:50%; }.signed-chart .bar-income { left:12%; }.signed-chart .bar-spending { right:12%; }.signed-chart .negative-bar { transform:translateY(100%); border-radius:0 0 3px 3px; }.signed-chart .chart-plot { background-image:linear-gradient(to bottom,transparent calc(50% - 1px),#9aaca1 calc(50% - 1px),#9aaca1 50%,transparent 50%); }
/* Product destinations */
.product-legacy-detail { margin-top:24px; }.product-legacy-detail>summary { cursor:pointer; font-size:14px; color:#315b43; padding:4px 0; }.product-legacy-detail .monthly-explorer { padding:0; border:0; box-shadow:none; margin-top:20px; }
#product-reports { margin-bottom:20px; } .product-source .text-button { flex-shrink:0; width:auto; }
.product-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:18px; }
.product-overview { margin:20px 0; }
.product-card { background:#fff; border:1px solid #dfe6e1; border-radius:10px; padding:24px; color:#203d30; text-align:left; min-width:0; }
.product-card h3 { margin:0; font-size:17px; }
.product-caption { display:block; color:#708076; font-size:12px; margin-bottom:10px; }
.product-balance { display:block; font-size:30px; letter-spacing:-1px; font-weight:550; }
.product-summary strong,.product-select strong { display:block; font-size:20px; margin:8px 0 14px; font-weight:550; }
.product-summary small,.product-select small,.product-select>span { display:block; line-height:1.7; }
.product-summary:hover,.product-select:hover { background:#f5f8f6; border-color:#87a995; }
.product-select[aria-pressed=true] { border-color:#276547; box-shadow:inset 0 0 0 1px #276547; background:#f4f8f5; }
.product-note { font-size:12px; color:#728078; line-height:1.7; margin:12px 0 20px; }
.product-mini-metrics { display:grid; grid-template-columns:1fr 1fr; gap:20px 12px; padding:20px 0; border-top:1px solid #e5ebe6; font-size:11px; color:#6a7c70; }
.product-mini-metrics strong { display:block; color:#284435; font-size:16px; margin-top:7px; }
.product-source { display:flex; align-items:center; gap:24px; justify-content:space-between; border-bottom:1px solid #e5ebe6; padding:20px 0; }
.product-source>span { min-width:0; overflow-wrap:anywhere; }.product-source strong { font-size:13px; }.product-source small { display:block; font-size:11px; color:#76847b; margin-top:5px; }.product-source select { width:240px; flex-shrink:0; }
.product-form label { display:grid; gap:8px; font-size:13px; margin:15px 0; }.product-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 18px; }
.product-feedback,.product-warning { color:#825f26; line-height:1.6; font-size:13px; }.product-warning { background:#fbf5e9; padding:15px; border-radius:6px; }
.product-filters { display:flex; flex-wrap:wrap; gap:7px; padding:15px 0; }.product-filters button { border:1px solid #dfe6e1; background:#fff; color:#586e5f; font-size:12px; padding:8px 12px; }.product-filters button[aria-pressed=true] { background:#eaf2ec; color:#205a3c; border-color:#8aa996; }
.product-filters button { width:auto; margin:0; min-height:38px; }
.product-table-head,.product-tx { display:grid; grid-template-columns:minmax(130px,2fr) minmax(95px,1fr) minmax(130px,1.4fr) minmax(100px,1fr) minmax(100px,1fr); gap:16px; align-items:center; }
.product-table-head { color:#809087; font-size:10px; padding:14px 0; }.product-table-head>span:nth-last-child(-n+2) { text-align:right; }
.product-tx { width:100%; border:0; border-bottom:1px solid #ebefec; border-radius:0; background:#fff; padding:16px 0; text-align:left; color:#6b7b70; font-size:11px; }
.product-tx:hover { background:#f5f8f6; }.product-tx>span:first-child { min-width:0; }.product-tx>span>strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; color:#263e30; }.product-tx small { display:block; font-size:10px; color:#829086; margin-top:5px; }.product-tx>strong { text-align:right; color:#264a36; font-size:12px; white-space:nowrap; }
.product-income-group { border-bottom:1px solid #ebefec; background:#fff; }
.product-income-group>summary { display:grid; grid-template-columns:minmax(130px,2fr) minmax(95px,1fr) minmax(130px,1.4fr) minmax(100px,1fr) minmax(100px,1fr); gap:16px; align-items:center; min-height:68px; padding:12px 0; color:#6b7b70; font-size:11px; cursor:pointer; list-style:none; }
.product-income-group>summary::-webkit-details-marker { display:none; }
.product-income-group>summary:hover { background:#f5f8f6; }
.product-income-group>summary>span:first-child { min-width:0; }
.product-income-group>summary>span:first-child>strong { display:block; overflow:hidden; color:#263e30; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.product-income-group>summary small { display:block; margin-top:5px; color:#829086; font-size:10px; }
.product-income-group>summary>strong { color:#264a36; font-size:12px; text-align:right; white-space:nowrap; }
.product-income-group[open]>summary { background:#f5f8f6; box-shadow:inset 3px 0 0 #2c7250; }
.product-income-group-items { padding:0 14px 12px 24px; background:#fafcfb; }
.product-income-group-items>p { margin:0; padding:10px 0 7px; color:#718178; font-size:10px; font-weight:650; letter-spacing:.04em; text-transform:uppercase; }
.product-income-group-item { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(110px,auto); gap:16px; align-items:center; width:100%; min-height:48px; margin:0; padding:9px 10px; border:0; border-top:1px solid #e8eeea; border-radius:0; background:transparent; color:#66776c; text-align:left; }
.product-income-group-item:hover { background:#fff; }
.product-income-group-item span small,.product-income-group-item>small { display:block; margin-top:3px; color:#829086; font-size:9px; }
.product-income-group-item>strong { color:#264a36; font-size:11px; text-align:right; }
.product-income-group-item>small { margin:0; text-align:right; }
.product-period-label { display:flex; align-items:center; gap:15px; margin-top:24px; font-size:13px; }.product-period-label select { width:160px; }
#product-cards,#product-loans,#product-transactions,#cockpit-accounts { display:grid; gap:20px; } .hidden { display:none !important; }
#product-card-detail .credit-card-panel { margin:0; background:#fff; } #product-dialog .product-table { min-width:0; }
body[data-view=transactions] .credit-cards-workspace { display:none; }
body[data-view=cards] .period-context-bar { display:none; }
@media(max-width:1000px) { .product-table-head,.product-tx,.product-income-group>summary { grid-template-columns:minmax(110px,2fr) 90px minmax(90px,1fr) 100px; }.product-table-head>span:nth-child(3),.product-tx>span:nth-child(3),.product-income-group>summary>span:nth-child(3) { display:none; } }
@media(max-width:640px) {
 .product-grid { grid-template-columns:1fr; }.product-card { padding:20px; }.product-overview { gap:10px; }.product-summary strong { font-size:18px; margin:4px 0; }
 .product-table-head { display:none; }.product-tx { grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; }.product-tx>span:nth-child(2) { grid-column:1; grid-row:2; }.product-tx>strong:nth-last-child(2) { grid-column:2; grid-row:1; }.product-tx>strong:last-child { grid-column:2; grid-row:2; font-size:10px; }.product-tx>strong:last-child:before { content:'Gasto: '; color:#748379; }
 .product-tx>span:nth-child(3) { display:block; grid-column:1 / -1; grid-row:3; font-size:10px; }
 .product-income-group>summary { grid-template-columns:minmax(0,1fr) auto; gap:5px 12px; min-height:76px; padding:12px 2px; }
 .product-income-group>summary>span:nth-child(2) { grid-column:1; grid-row:2; }
 .product-income-group>summary>span:nth-child(3) { display:block; grid-column:1 / -1; grid-row:3; font-size:10px; }
 .product-income-group>summary>strong:nth-last-child(2) { grid-column:2; grid-row:1; }
 .product-income-group>summary>strong:last-child { grid-column:2; grid-row:2; font-size:10px; }
 .product-income-group-items { padding:0 4px 10px 12px; }
 .product-income-group-item { grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; }
 .product-income-group-item>small { grid-column:1 / -1; text-align:left; }
 .product-form-grid { grid-template-columns:1fr; }.product-source { align-items:stretch; flex-direction:column; gap:10px; }.product-source select { width:100%; }.product-period-label { align-items:stretch; flex-direction:column; }
 #cockpit-accounts>.surface>.cp-section-heading { align-items:flex-start; flex-direction:column; } #product-dialog .transaction-editor { display:grid; grid-template-columns:1fr; } .source-row select[name=source-account] { width:100%; }
}

/* Categories stay in the primary Movimientos view, with the existing editors. */
.product-category-surface .category-workspace { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 16px; }
.product-category-surface .category-workspace-heading,.product-category-surface .category-workspace>.inline-name-form { grid-column:1 / -1; }
.product-category-surface .spending-category-card { margin:0; min-width:0; border-left-width:1px; border-color:var(--line); background:#fff; }
.product-category-surface .spending-category-card>summary { min-height:70px; }
.product-category-surface .spending-category-card[open] { grid-column:1 / -1; }
.product-category-surface .category-workspace-heading h3 { font-size:17px; letter-spacing:0; }
.product-category-surface .category-workspace-heading { margin:0 0 10px; }
.product-category-surface .add-category-button { width:auto; flex-shrink:0; }
.product-category-surface>.product-note { margin:18px 0 0; }
@media(max-width:760px) {
 .product-category-surface .category-workspace { grid-template-columns:minmax(0,1fr); }
 .product-category-surface .category-workspace-heading { align-items:flex-start; flex-direction:column; }
 .product-category-surface .spending-category-card>summary { min-height:64px; }
 .product-category-surface .merchant-detail summary { grid-template-columns:16px minmax(0,1fr) auto 18px 18px; row-gap:5px; }
 .product-category-surface .merchant-name { grid-column:2 / -1; grid-row:1; }
 .product-category-surface .merchant-product-origin { overflow:visible; text-overflow:clip; white-space:normal; }
 .product-category-surface .merchant-behavior { grid-column:2; grid-row:2; }
 .product-category-surface .merchant-amount { grid-column:3; grid-row:2; }
 .product-category-surface .merchant-count { grid-column:2 / 4; grid-row:3; }
 .product-category-surface .unrecognized-button { grid-column:4; grid-row:2; }
 .product-category-surface .merchant-edit-button { grid-column:5; grid-row:2; }
}

.auth-pending .sidebar,
.auth-pending .app-shell,
.auth-required .sidebar,
.auth-required .app-shell { visibility: hidden; }
.auth-ready .auth-screen { display: none; }
.auth-screen {
    position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center;
    padding: 24px; background: #f4f7f5;
}
.login-card {
    width: min(440px, 100%); padding: 40px; border: 1px solid #dfe8e3;
    border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(18, 45, 34, .08);
}
.login-brand { margin-bottom: 36px; text-decoration: none; color: inherit; }
.login-card h1 { font-size: clamp(28px, 5vw, 38px); }
.login-card label { display: grid; gap: 7px; margin-top: 18px; font-weight: 650; font-size: 13px; }
.login-card input { width: 100%; min-height: 46px; border: 1px solid #ccd9d2; border-radius: 9px; padding: 0 13px; font: inherit; }
.login-card .primary-button { width: 100%; margin-top: 22px; min-height: 46px; }
.login-feedback { min-height: 20px; margin: 12px 0 0; color: #a13b3b; font-size: 13px; }

@media(max-width:760px) {
 .primary-nav { display:flex; flex-direction:column; gap:12px; margin:16px -8px 0; padding-bottom:10px; overflow:visible; }
 .nav-group { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
 .nav-group-principal { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .nav-group-title { grid-column:1 / -1; margin:0 4px 3px; font-size:8px; }
 .primary-nav a { justify-content:center; min-width:0; min-height:38px; padding:7px 5px; font-size:12px; }
 .primary-nav a[aria-current=page]::before { inset:6px auto 6px 0; width:2px; }
}

/* Stage 2: premium visual foundations and the Movimientos category pilot. */
:root {
 --color-canvas:#f2f5f4;
 --color-surface:#fcfdfd;
 --color-surface-subtle:#f7f9f8;
 --color-brand:#115b4d;
 --color-brand-strong:#0b443a;
 --color-brand-soft:#eaf3ef;
 --color-text:#172c32;
 --color-text-secondary:#65746f;
 --color-border:#dce5e1;
 --color-border-strong:#c9d7d1;
 --color-positive:#18724f;
 --color-positive-soft:#eaf6ef;
 --color-attention:#9a6a1b;
 --color-attention-soft:#fbf5e8;
 --color-error:#9f342d;
 --color-error-soft:#fbefee;
 --radius-sm:8px;
 --radius-md:12px;
 --radius-lg:16px;
 --shadow-surface:0 1px 2px rgba(18,44,35,.035),0 8px 24px rgba(18,44,35,.035);
 --shadow-hover:0 2px 4px rgba(18,44,35,.045),0 12px 30px rgba(18,44,35,.06);
 --shadow-button:0 1px 2px rgba(8,52,43,.18),inset 0 1px rgba(255,255,255,.12);
 --space-1:4px;
 --space-2:8px;
 --space-3:12px;
 --space-4:16px;
 --space-5:20px;
 --space-6:24px;
 --space-8:32px;
 --text-label:10px;
 --text-secondary:12px;
 --text-body:14px;
 --text-internal:15px;
 --text-section:19px;
 --text-title:29px;
 --motion-fast:180ms;
 --motion-standard:220ms;
 --motion-ease:cubic-bezier(.2,.75,.25,1);
 --brand:var(--color-brand);
 --brand-dark:var(--color-brand-strong);
 --ink:var(--color-text);
 --muted:var(--color-text-secondary);
 --line:var(--color-border);
 --canvas:var(--color-canvas);
}

body { background:var(--color-canvas); color:var(--color-text); }
.sidebar { background:var(--color-surface); border-color:var(--color-border); }
.primary-nav a { transition:background-color var(--motion-fast) var(--motion-ease),color var(--motion-fast) var(--motion-ease),transform var(--motion-fast) var(--motion-ease); }
.primary-nav a:hover { transform:translateX(1px); }
.primary-nav a[aria-current=page] { background:var(--color-brand-soft); }
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible,input:focus-visible,[tabindex]:focus-visible { outline:2px solid #4f9582; outline-offset:3px; }
.primary-button,#cockpit-upload { border-color:var(--color-brand); border-radius:var(--radius-sm); background:linear-gradient(180deg,#176a59 0%,var(--color-brand) 100%); box-shadow:var(--shadow-button); transition:transform var(--motion-fast) var(--motion-ease),box-shadow var(--motion-fast) var(--motion-ease),background-color var(--motion-fast) var(--motion-ease); }
.primary-button:hover,#cockpit-upload:hover { background:linear-gradient(180deg,#145e50 0%,var(--color-brand-strong) 100%); box-shadow:0 3px 8px rgba(8,52,43,.16),inset 0 1px rgba(255,255,255,.1); transform:translateY(-1px); }
.secondary-button { border-color:var(--color-border-strong); border-radius:var(--radius-sm); background:var(--color-surface-subtle); box-shadow:none; color:var(--color-brand); transition:background-color var(--motion-fast) var(--motion-ease),border-color var(--motion-fast) var(--motion-ease),transform var(--motion-fast) var(--motion-ease); }
.secondary-button:hover { border-color:#aac1b8; background:#edf3f0; transform:translateY(-1px); }

.product-category-surface {
 border-color:var(--color-border);
 border-radius:var(--radius-lg);
 background:var(--color-surface);
 box-shadow:var(--shadow-surface);
 padding:clamp(20px,2.4vw,30px);
}
.product-category-surface .category-workspace { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:24px; row-gap:0; }
.product-category-surface .category-workspace-heading { align-items:flex-start; margin:0 0 var(--space-5); }
.product-category-surface .category-workspace-heading h3 { color:var(--color-text); font-size:var(--text-section); font-weight:620; letter-spacing:-.015em; }
.product-category-surface .category-workspace-heading p { max-width:620px; margin-top:var(--space-2); color:var(--color-text-secondary); font-size:var(--text-secondary); line-height:1.55; }
.product-category-surface .add-category-button,.product-category-surface .add-subcategory-button { min-height:32px; border-color:var(--color-border-strong); border-radius:var(--radius-sm); background:transparent; color:var(--color-brand); font-size:11px; font-weight:600; transition:background-color var(--motion-fast) var(--motion-ease),border-color var(--motion-fast) var(--motion-ease),transform var(--motion-fast) var(--motion-ease); }
.product-category-surface .add-category-button:hover,.product-category-surface .add-subcategory-button:hover { border-color:#aac1b8; background:var(--color-brand-soft); transform:translateY(-1px); }
.product-category-surface .inline-name-form { border-color:var(--color-border); border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.product-category-surface .spending-category-card {
 align-self:start;
 margin:0;
 border:0;
 border-top:1px solid var(--color-border);
 border-radius:0;
 background:transparent;
 box-shadow:none;
 transition:background-color var(--motion-fast) var(--motion-ease),border-color var(--motion-fast) var(--motion-ease),box-shadow var(--motion-standard) var(--motion-ease),transform var(--motion-standard) var(--motion-ease),margin var(--motion-standard) var(--motion-ease);
}
.product-category-surface .spending-category-card:last-of-type { border-bottom:1px solid var(--color-border); }
.product-category-surface .spending-category-card>summary { min-height:52px; padding:7px 12px; color:var(--color-text); font-size:var(--text-body); font-weight:600; transition:background-color var(--motion-fast) var(--motion-ease),color var(--motion-fast) var(--motion-ease); }
.product-category-surface .spending-category-card>summary::marker { color:#82918b; font-size:10px; }
.product-category-surface .spending-category-card:not([open])>summary:hover { background:var(--color-surface-subtle); color:var(--color-brand-strong); }
.product-category-surface .category-figures { flex-direction:column; align-items:flex-end; gap:0; line-height:1.25; }
.product-category-surface .category-figures strong { color:var(--color-text); font-size:17px; font-weight:630; letter-spacing:-.025em; font-variant-numeric:tabular-nums; }
.product-category-surface .category-figures small { margin-top:2px; color:var(--color-text-secondary); font-size:10px; font-weight:500; }
.product-category-surface .spending-category-card:has(.empty-category-hint)>summary { min-height:40px; padding-top:4px; padding-bottom:4px; color:#6d7b76; font-size:13px; }
.product-category-surface .spending-category-card:has(.empty-category-hint) .category-figures strong { color:#75837e; font-size:14px; font-weight:560; }
.product-category-surface .spending-category-card:has(.empty-category-hint) .category-figures small { display:none; }
.product-category-surface .spending-category-card[open] { margin:8px 0 10px; border:1px solid var(--color-border-strong); border-radius:var(--radius-md); background:var(--color-surface); box-shadow:var(--shadow-surface); transform:translateY(-1px); }
.product-category-surface .spending-category-card[open]>summary { min-height:58px; padding:9px 14px; }
.product-category-surface .spending-category-card[open] .category-figures strong { color:var(--color-brand-strong); font-size:18px; }
.product-category-surface .spending-category-body { padding:8px 12px 12px; border-color:var(--color-border); border-radius:0 0 var(--radius-md) var(--radius-md); background:var(--color-surface-subtle); }
.product-category-surface .merchant-detail { margin-top:6px; padding:8px 11px; border-color:var(--color-border); border-radius:10px; background:var(--color-surface); box-shadow:0 1px 2px rgba(18,44,35,.025); transition:border-color var(--motion-fast) var(--motion-ease),box-shadow var(--motion-fast) var(--motion-ease),transform var(--motion-fast) var(--motion-ease); }
.product-category-surface .merchant-detail:hover { border-color:var(--color-border-strong); box-shadow:0 5px 16px rgba(18,44,35,.055); transform:translateY(-1px); }
.product-category-surface .merchant-detail summary { color:var(--color-text); font-weight:600; }
.product-category-surface .merchant-product-origin,.product-category-surface .merchant-count { color:var(--color-text-secondary); font-weight:500; }
.product-category-surface .merchant-amount { color:var(--color-text); font-size:13px; font-weight:650; font-variant-numeric:tabular-nums; }
.product-category-surface .merchant-behavior { background:#eef3f1; color:#536a61; font-weight:600; }
.product-category-surface .empty-category-hint { margin:2px 0 0; border-color:var(--color-border); background:transparent; color:var(--color-text-secondary); }
.product-category-surface>.product-note { color:var(--color-text-secondary); font-size:11px; }
.product-income-categories { grid-column:1 / -1; margin:2px 0 24px; padding:20px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.product-income-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:22px; margin:0; cursor:pointer; list-style:none; }
.product-income-heading::-webkit-details-marker { display:none; }
.product-income-heading span { color:var(--color-brand); font-size:9px; font-weight:700; letter-spacing:.14em; }
.product-income-heading h4 { margin:4px 0 3px; color:var(--color-text); font-size:17px; font-weight:630; }
.product-income-heading p { max-width:720px; margin:0; color:var(--color-text-secondary); font-size:11px; line-height:1.5; }
.product-income-heading>strong { color:var(--color-brand-strong); font-size:22px; font-weight:640; white-space:nowrap; }
.product-expense-categories { margin-top:0; margin-bottom:10px; }
.product-expense-heading { cursor:default; }
.product-income-category-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); overflow:hidden; margin-top:15px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface); }
.product-income-category-card { position:relative; min-width:0; border-right:1px solid var(--color-border); border-bottom:1px solid var(--color-border); background:var(--color-surface); }
.product-income-category-card:nth-child(3n) { border-right:0; }
.product-income-category-card.is-selected { background:var(--color-brand-soft); box-shadow:inset 3px 0 0 var(--color-brand); }
.product-income-category-main { display:grid; width:100%; min-height:82px; align-content:center; gap:3px; margin:0; padding:12px 34px 12px 14px; border:0; border-radius:0; background:transparent; color:var(--color-text); text-align:left; }
.product-income-category-main span { color:var(--color-text-secondary); font-size:10px; font-weight:560; }
.product-income-category-main strong { font-size:15px; font-weight:630; }
.product-income-category-main small { color:var(--color-text-secondary); font-size:9px; }
.product-income-category-remove { position:absolute; top:7px; right:8px; width:22px; min-width:22px; height:22px; min-height:22px; margin:0; padding:0; border:0; border-radius:50%; background:transparent; color:#8a978f; font-size:15px; font-weight:500; line-height:20px; opacity:.72; }
.product-income-category-remove:hover,.product-income-category-remove:focus-visible { background:#eef2ef; color:#355c47; opacity:1; }
.product-income-restore { width:auto; min-height:30px; margin:10px 0 0 auto; padding:4px 8px; border:0; background:transparent; color:var(--color-text-secondary); font-size:9px; text-decoration:underline; text-underline-offset:2px; }
.cp-category-column+.cp-category-column { margin-top:18px; padding-top:16px; border-top:1px solid var(--color-border); }
.cp-category-column>h3 { margin:0 0 6px; color:var(--color-text-secondary); font-size:10px; font-weight:700; letter-spacing:.11em; text-transform:uppercase; }
.income-category-summary .category-track>span { background:var(--color-brand); }

@media(max-width:760px) {
 .primary-nav a:hover { transform:none; }
 .product-category-surface { padding:18px 14px; }
 .product-category-surface .category-workspace { grid-template-columns:minmax(0,1fr); }
 .product-category-surface .category-workspace-heading { gap:12px; margin-bottom:16px; }
 .product-category-surface .category-workspace-heading h3 { font-size:18px; }
 .product-category-surface .spending-category-card>summary { grid-template-columns:minmax(0,1fr) minmax(105px,auto) 20px; gap:8px; min-height:50px; padding:6px 8px; }
 .product-category-surface .spending-category-card:has(.empty-category-hint)>summary { min-height:38px; }
 .product-category-surface .category-figures strong { font-size:15px; }
 .product-category-surface .spending-category-card[open] .category-figures strong { font-size:16px; }
 .product-category-surface .spending-category-card[open] { margin:7px 0 9px; transform:none; }
}

.period-context-bar {
 display:grid;
 grid-template-columns:1fr auto 1fr;
 align-items:center;
 justify-content:space-between;
 gap:var(--space-4);
 min-height:52px;
 margin:0 0 var(--space-4);
 padding:7px 12px;
 border:1px solid var(--color-border);
 border-radius:var(--radius-md);
 background:#edf3f0;
 color:var(--color-text);
}
.period-navigation { grid-column:2; display:flex; align-items:center; gap:6px; min-width:0; justify-self:center; }
.period-step {
 display:grid;
 flex:0 0 30px;
 width:30px;
 min-width:30px;
 height:30px;
 min-height:30px;
 place-items:center;
 padding:0;
 border:1px solid transparent;
 border-radius:7px;
 background:transparent;
 box-shadow:none;
 color:var(--color-brand);
 font-size:22px;
 font-weight:450;
 line-height:1;
 transition:background-color var(--motion-fast) var(--motion-ease),border-color var(--motion-fast) var(--motion-ease),transform var(--motion-fast) var(--motion-ease);
}
.period-step:hover:not(:disabled) { border-color:var(--color-border-strong); background:rgba(252,253,253,.8); color:var(--color-brand-strong); transform:translateY(-1px); }
.period-step:disabled { background:transparent; color:#99a7a2; opacity:.48; }
.period-selector { position:relative; display:block; min-width:0; }
.period-selector>span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; }
.period-selector select {
 width:auto;
 min-width:168px;
 min-height:34px;
 padding:4px 30px 4px 8px;
 border:0;
 border-radius:7px;
 background-color:transparent;
 color:var(--color-text);
 font-size:15px;
 font-weight:640;
 letter-spacing:-.01em;
 cursor:pointer;
}
.period-selector select:hover { background:rgba(252,253,253,.58); }
#account-context { grid-column:3; justify-self:end; color:var(--color-text-secondary); font-size:11px; font-weight:520; text-align:right; white-space:nowrap; }
body[data-view=home] .welcome-card { padding-bottom:18px; }
body[data-view=home] .period-context-bar + #cockpit-status.hidden + #cockpit-home .cp-metrics { margin-top:0; }

@media(max-width:760px) {
 .period-context-bar { display:flex; flex-wrap:wrap; gap:2px 8px; min-height:64px; margin-bottom:14px; padding:7px 9px; }
 .period-navigation { width:100%; justify-content:space-between; }
 .period-selector { flex:1; text-align:center; }
 .period-selector select { width:auto; min-width:158px; max-width:100%; font-size:14px; text-align:center; }
 #account-context { width:100%; padding:0 36px 2px; text-align:center; white-space:normal; }
}

body[data-view=home] .cp-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; overflow:visible; border:0; border-radius:0; background:transparent; }
body[data-view=home] .cp-metric { min-height:154px; padding:23px 22px; border:1px solid var(--color-border); border-radius:var(--radius-lg); background:var(--color-surface); box-shadow:var(--shadow-surface); transition:border-color var(--motion-fast) var(--motion-ease),box-shadow var(--motion-fast) var(--motion-ease),transform var(--motion-fast) var(--motion-ease); }
body[data-view=home] .cp-metric:hover { border-color:var(--color-border-strong); box-shadow:var(--shadow-hover); transform:translateY(-1px); }
body[data-view=home] .cp-metric>span { color:var(--color-text-secondary); font-size:12px; font-weight:540; }
body[data-view=home] .cp-metric>strong { margin:5px 0 1px; color:var(--color-text); font-size:clamp(27px,2.15vw,34px); font-weight:620; line-height:1.25; }
body[data-view=home] .cp-metric>small { margin-top:auto; color:var(--color-text-secondary); font-size:11px; line-height:1.45; }
body[data-view=home] .cp-savings { border-color:#bfd8cc; background:var(--color-positive-soft); color:var(--color-brand); }
body[data-view=home] .cp-savings>span,body[data-view=home] .cp-savings>strong { color:var(--color-brand-strong); }
body[data-view=home] .cp-savings>small { display:grid; gap:4px; color:#587167; }
body[data-view=home] .cp-savings>small b { color:var(--color-brand); font-size:12px; font-weight:650; }
body[data-view=home] .cp-savings>small b span { float:none; font-size:14px; }
body[data-view=home] .cp-income { cursor:pointer; }
body[data-view=home] .cp-income>small { display:grid; gap:4px; }
body[data-view=home] .cp-income>small b { color:var(--color-brand); font-size:12px; font-weight:650; }
body[data-view=home] .cp-income:focus-visible { outline:3px solid #8fb7a2; outline-offset:2px; }

.home-product-overview { margin:4px 0 24px; }
.home-products-heading { display:flex; align-items:end; justify-content:space-between; gap:18px; margin-bottom:12px; }
.home-products-heading span { color:var(--color-text-secondary); font-size:9px; font-weight:700; letter-spacing:.14em; }
.home-products-heading h2 { margin:3px 0 0; color:var(--color-text); font-size:18px; font-weight:620; letter-spacing:-.015em; }
.home-products-heading>small { color:var(--color-text-secondary); font-size:11px; }
.home-product-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.home-product-card { display:flex; min-height:146px; flex-direction:column; align-items:flex-start; padding:20px; border:1px solid var(--color-border); border-radius:var(--radius-lg); background:var(--color-surface); box-shadow:var(--shadow-surface); color:var(--color-text); text-align:left; transition:border-color var(--motion-fast) var(--motion-ease),box-shadow var(--motion-fast) var(--motion-ease),transform var(--motion-fast) var(--motion-ease); }
.home-product-card:hover { border-color:var(--color-border-strong); background:var(--color-surface); box-shadow:var(--shadow-hover); color:var(--color-text); transform:translateY(-1px); }
.home-product-card>span { color:var(--color-text-secondary); font-size:11px; font-weight:560; }
.home-product-card>strong { margin:9px 0 3px; color:var(--color-text); font-size:17px; font-weight:620; line-height:1.3; }
.home-product-card>small { color:var(--color-text-secondary); font-size:11px; line-height:1.45; }
.home-product-card>b { margin-top:auto; padding-top:13px; color:var(--color-brand); font-size:12px; font-weight:650; }
.home-product-card>b i { font-size:14px; font-style:normal; }

body[data-view=home] .cp-attention { padding:25px 26px 12px; border:1px solid var(--color-border); border-left:3px solid var(--color-attention); border-radius:var(--radius-lg); box-shadow:var(--shadow-surface); }
body[data-view=home] .cp-attention .cp-section-heading { margin-bottom:2px; }
body[data-view=home] .cp-attention .cp-section-note { margin-bottom:4px; }
body[data-view=home] .attention-row { grid-template-columns:26px minmax(0,1fr) auto auto; gap:15px; padding:17px 0; }
body[data-view=home] .attention-marker { color:#8a7861; }
body[data-view=home] .attention-row h3 { color:var(--color-text); font-size:14px; font-weight:620; }
body[data-view=home] .attention-row p { max-width:760px; color:var(--color-text-secondary); }
body[data-view=home] .attention-amount strong { color:var(--color-text); font-size:15px; }
body[data-view=home] .attention-amount small { color:var(--color-attention); font-size:10px; }
body[data-view=home] .attention-row .row-button { border-color:var(--color-border-strong); background:var(--color-surface-subtle); color:var(--color-brand); }
body[data-view=home] .attention-row .row-button:hover { border-color:#aac1b8; background:var(--color-brand-soft); color:var(--color-brand-strong); transform:translateY(-1px); }

/* 4A · Accounts control center */
.account-command-center { padding:27px; }
.account-page-heading { align-items:flex-start; margin-bottom:22px; }
.account-page-heading .product-caption { margin:0 0 4px; font-size:9px; font-weight:700; letter-spacing:.14em; }
.account-page-heading h2 { margin:0; font-size:21px; font-weight:620; letter-spacing:-.02em; }
.account-page-heading .product-note { margin:5px 0 0; }
.account-control-layout { display:grid; grid-template-columns:minmax(245px,300px) minmax(0,1fr); gap:18px; align-items:start; }
.account-list-panel { display:grid; gap:9px; min-width:0; }
.account-list-heading { display:flex; align-items:center; justify-content:space-between; padding:0 3px 4px; color:var(--color-text-secondary); }
.account-list-heading span { font-size:9px; font-weight:700; letter-spacing:.14em; }
.account-list-heading small { font-size:10px; }
.account-select-card { display:flex; width:100%; min-height:126px; flex-direction:column; align-items:flex-start; padding:18px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface); color:var(--color-text); text-align:left; transition:border-color var(--motion-fast) var(--motion-ease),background var(--motion-fast) var(--motion-ease),box-shadow var(--motion-fast) var(--motion-ease),transform var(--motion-fast) var(--motion-ease); }
.account-select-card:hover { border-color:var(--color-border-strong); background:var(--color-surface-subtle); color:var(--color-text); transform:translateY(-1px); }
.account-select-card[aria-pressed=true] { border-color:#9dbbad; background:var(--color-brand-soft); box-shadow:inset 3px 0 0 var(--color-brand); }
.account-select-card>span { color:var(--color-text-secondary); font-size:10px; }
.account-select-card>strong { margin:5px 0 2px; color:var(--color-text); font-size:15px; font-weight:620; }
.account-select-card>small { color:var(--color-text-secondary); font-size:10px; }
.account-select-card>b { margin-top:auto; padding-top:12px; color:var(--color-brand-strong); font-size:13px; font-weight:620; }
.account-control-detail { min-width:0; overflow:hidden; border:1px solid var(--color-border); border-radius:var(--radius-lg); background:var(--color-surface); box-shadow:var(--shadow-surface); }
.account-detail-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:22px 24px 18px; border-bottom:1px solid var(--color-border); }
.account-detail-header .text-button { width:auto; flex-shrink:0; }
.account-detail-header h2 { margin:2px 0 4px; color:var(--color-text); font-size:22px; font-weight:620; letter-spacing:-.02em; }
.account-detail-header p { margin:0; color:var(--color-text-secondary); font-size:11px; }
.account-balance-panel { display:grid; padding:25px 24px 23px; background:#f3f7f5; }
.account-balance-panel>span { color:var(--color-text-secondary); font-size:11px; }
.account-balance-panel>strong { margin:5px 0 3px; color:var(--color-text); font-size:clamp(29px,3vw,39px); font-weight:610; letter-spacing:-.025em; }
.account-balance-panel>small { color:var(--color-text-secondary); font-size:11px; }
.account-flow-heading { display:flex; align-items:end; justify-content:space-between; gap:14px; padding:22px 24px 10px; }
.account-flow-heading span { color:var(--color-text-secondary); font-size:9px; font-weight:700; letter-spacing:.13em; }
.account-flow-heading h3 { margin:3px 0 0; color:var(--color-text); font-size:16px; font-weight:620; }
.account-flow-heading>small { color:var(--color-text-secondary); font-size:10px; }
.account-flow-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:0 24px; border:1px solid var(--color-border); border-radius:var(--radius-md); overflow:hidden; }
.account-flow-grid>div { display:flex; min-height:105px; flex-direction:column; padding:16px; border-right:1px solid var(--color-border); }
.account-flow-grid>div:last-child { border-right:0; }
.account-flow-grid span { color:var(--color-text-secondary); font-size:10px; }
.account-flow-grid strong { margin:6px 0 2px; color:var(--color-text); font-size:16px; font-weight:620; overflow-wrap:anywhere; }
.account-flow-grid small { margin-top:auto; color:var(--color-text-secondary); font-size:9px; line-height:1.4; }
.account-debt-note { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 18px; margin:14px 24px 0; padding:13px 15px; border:1px solid #e2e9e5; border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.account-debt-note span,.account-debt-note small { color:var(--color-text-secondary); font-size:10px; }
.account-debt-note strong { grid-row:1 / 3; grid-column:2; align-self:center; color:var(--color-text); font-size:15px; }
.account-recent { margin-top:22px; padding:21px 24px 7px; border-top:1px solid var(--color-border); }
.account-recent .cp-section-heading>span { color:var(--color-text-secondary); font-size:10px; }
.account-recent .product-note { margin:4px 0 0; }
.account-control-empty { min-height:360px; display:grid; place-items:center; }
.account-source-manager { padding:0 25px; }
.account-source-manager>summary { display:flex; min-height:76px; align-items:center; justify-content:space-between; gap:20px; cursor:pointer; list-style:none; }
.account-source-manager>summary::-webkit-details-marker { display:none; }
.account-source-manager>summary strong { display:block; color:var(--color-text); font-size:15px; font-weight:620; }
.account-source-manager>summary small { display:block; margin-top:4px; color:var(--color-text-secondary); font-size:10px; }
.account-source-manager>summary>span:last-child { color:var(--color-brand); transition:transform var(--motion-fast) var(--motion-ease); }
.account-source-manager[open]>summary>span:last-child { transform:rotate(180deg); }
.account-source-manager[open] { padding-bottom:18px; }

/* 4B · Credit card control center */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.card-command-center { padding:27px; }
.card-page-heading { align-items:flex-start; margin-bottom:22px; }
.card-page-heading .product-caption { margin:0 0 4px; font-size:9px; font-weight:700; letter-spacing:.14em; }
.card-page-heading h2 { margin:0; font-size:21px; font-weight:620; letter-spacing:-.02em; }
.card-page-heading .product-note { margin:5px 0 0; }
.card-control-layout { display:grid; grid-template-columns:minmax(245px,300px) minmax(0,1fr); gap:18px; align-items:start; }
.card-list-panel { display:grid; gap:9px; min-width:0; }
.card-list-heading { display:flex; align-items:center; justify-content:space-between; padding:0 3px 4px; color:var(--color-text-secondary); }
.card-list-heading span { font-size:9px; font-weight:700; letter-spacing:.14em; }
.card-list-heading small { font-size:10px; }
.card-select-card { display:flex; width:100%; min-height:142px; flex-direction:column; align-items:flex-start; padding:18px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface); color:var(--color-text); text-align:left; transition:border-color var(--motion-fast) var(--motion-ease),background var(--motion-fast) var(--motion-ease),box-shadow var(--motion-fast) var(--motion-ease),transform var(--motion-fast) var(--motion-ease); }
.card-select-card:hover { border-color:var(--color-border-strong); background:var(--color-surface-subtle); color:var(--color-text); transform:translateY(-1px); }
.card-select-card[aria-pressed=true] { border-color:#9dbbad; background:var(--color-brand-soft); box-shadow:inset 3px 0 0 var(--color-brand); }
.card-select-card>span { color:var(--color-text); font-size:14px; font-weight:620; }
.card-select-card>strong { margin:4px 0 3px; color:var(--color-text-secondary); font-size:12px; font-weight:560; letter-spacing:.04em; }
.card-select-card>small { color:var(--color-text-secondary); font-size:10px; }
.card-select-card>b { margin-top:auto; padding-top:13px; color:var(--color-brand-strong); font-size:14px; font-weight:620; }
.card-detail-column { min-width:0; }
.card-period-toolbar { display:flex; min-height:54px; align-items:center; justify-content:space-between; gap:16px; margin-bottom:10px; padding:9px 14px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.card-period-toolbar>span { color:var(--color-text-secondary); font-size:10px; font-weight:600; }
.card-period-toolbar select { width:auto; min-width:145px; margin:0; border:0; background:transparent; color:var(--color-text); font-size:12px; font-weight:620; }
#product-card-detail .credit-card-control-center { margin:0; overflow:hidden; border:1px solid var(--color-border); border-radius:var(--radius-lg); background:var(--color-surface); box-shadow:var(--shadow-surface); }
.credit-card-control-center>summary { min-height:96px; padding:21px 23px; border-bottom:1px solid var(--color-border); background:var(--color-surface); }
.credit-card-control-center>summary::-webkit-details-marker { display:none; }
.credit-card-control-center>summary span:first-child strong { color:var(--color-text); font-size:21px; font-weight:620; letter-spacing:-.02em; }
.credit-card-control-center>summary span:last-child strong { color:var(--color-text); font-size:19px; font-weight:620; }
.credit-card-control-center>summary small { color:var(--color-text-secondary); font-size:10px; font-weight:500; }
.credit-card-control-center .credit-card-body { padding:0 23px 22px; }
.credit-card-section-heading { display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:10px; }
.credit-card-section-heading>span { color:var(--color-text-secondary); font-size:9px; font-weight:700; letter-spacing:.13em; }
.credit-card-section-heading>small { color:var(--color-text-secondary); font-size:10px; }
.credit-card-primary-state { padding:22px 0 0; }
.credit-card-primary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); overflow:hidden; border:1px solid var(--color-border); border-radius:var(--radius-md); }
.credit-card-primary-grid>div { display:flex; min-height:128px; flex-direction:column; padding:18px; border-right:1px solid var(--color-border); background:var(--color-surface); }
.credit-card-primary-grid>div:last-child { border-right:0; }
.credit-card-primary-grid .primary-balance { background:#f0f6f3; }
.credit-card-primary-grid span { color:var(--color-text-secondary); font-size:10px; }
.credit-card-primary-grid strong { margin:7px 0 3px; color:var(--color-text); font-size:clamp(18px,1.75vw,25px); font-weight:620; line-height:1.22; overflow-wrap:anywhere; }
.credit-card-primary-grid small { margin-top:auto; color:var(--color-text-secondary); font-size:9px; line-height:1.4; }
.credit-card-primary-grid .primary-due-date strong { color:var(--color-brand-strong); font-size:20px; }
.credit-card-secondary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:10px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.credit-card-secondary-grid>div { display:flex; min-height:68px; flex-direction:column; justify-content:center; padding:12px 16px; border-right:1px solid var(--color-border); }
.credit-card-secondary-grid>div:last-child { border-right:0; }
.credit-card-secondary-grid span { color:var(--color-text-secondary); font-size:9px; }
.credit-card-secondary-grid strong { margin-top:3px; color:var(--color-text); font-size:13px; font-weight:620; overflow-wrap:anywhere; }
.credit-card-activity { padding:23px 0 0; }
.credit-card-control-center .credit-card-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin:0; overflow:hidden; border:1px solid var(--color-border); border-radius:var(--radius-md); }
.credit-card-control-center .credit-card-metrics>div { min-height:94px; padding:15px 16px; border:0; border-right:1px solid var(--color-border); border-radius:0; background:var(--color-surface); }
.credit-card-control-center .credit-card-metrics>div:last-child { border-right:0; }
.credit-card-control-center .credit-card-metrics span { color:var(--color-text-secondary); font-size:9px; }
.credit-card-control-center .credit-card-metrics strong { margin-top:6px; color:var(--color-text); font-size:16px; font-weight:620; overflow-wrap:anywhere; }
.credit-card-intelligence { padding-top:23px; }
.credit-card-intelligence>div:last-child { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.credit-card-intelligence>div:last-child>div { display:flex; min-height:98px; flex-direction:column; padding:15px 16px; border:1px solid #dce7e2; border-radius:var(--radius-md); background:#f5f8f6; }
.credit-card-intelligence span { color:var(--color-text-secondary); font-size:9px; }
.credit-card-intelligence strong { margin:5px 0 2px; color:var(--color-brand-strong); font-size:18px; font-weight:620; }
.credit-card-intelligence small { margin-top:auto; color:var(--color-text-secondary); font-size:9px; line-height:1.4; }
.credit-card-control-center .credit-card-reconciliation { margin:22px 0 0; border-color:var(--color-border); border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.credit-card-control-center .credit-card-reconciliation.reconciled { border-color:#b9d8ca; background:#f2f8f5; }
.credit-card-control-center .credit-card-reconciliation>summary { min-height:48px; padding:13px 15px; color:var(--color-brand-strong); font-size:12px; font-weight:650; }
.credit-card-control-center .credit-card-payment-note { margin:10px 0 0; padding:11px 13px; border-radius:var(--radius-md); background:var(--color-surface-subtle); color:var(--color-text-secondary); font-size:10px; }
.credit-card-control-center .credit-card-installment-group { margin:22px 0 0; border-color:var(--color-border); border-radius:var(--radius-md); }
.credit-card-control-center .credit-card-installment-group>summary { min-height:49px; padding:14px 15px; background:var(--color-surface-subtle); color:var(--color-text); font-size:12px; font-weight:650; letter-spacing:0; }
.credit-card-control-center .credit-card-installment-group.completed>summary { color:var(--color-text-secondary); }
.credit-card-control-center .credit-card-installment-row { grid-template-columns:minmax(180px,1.35fr) repeat(3,minmax(110px,.75fr)); padding:15px; border-top-color:var(--color-border); }
.credit-card-control-center .credit-card-installment-row span,.credit-card-control-center .credit-card-installment-row small { color:var(--color-text-secondary); font-size:9px; }
.credit-card-control-center .credit-card-installment-row strong { color:var(--color-text); font-size:12px; }
.credit-card-control-center .installment-merchant strong { font-size:13px; }
.credit-card-control-center .credit-card-category { margin-top:22px; border-top-color:var(--color-border); }

@media(max-width:1100px) {
 .card-control-layout { grid-template-columns:220px minmax(0,1fr); }
 .credit-card-primary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .credit-card-primary-grid>div:nth-child(2) { border-right:0; }
 .credit-card-primary-grid>div:nth-child(-n+2) { border-bottom:1px solid var(--color-border); }
 .credit-card-control-center .credit-card-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .credit-card-control-center .credit-card-metrics>div:nth-child(2) { border-right:0; }
 .credit-card-control-center .credit-card-metrics>div:nth-child(-n+2) { border-bottom:1px solid var(--color-border); }
 .credit-card-control-center .credit-card-installment-row { grid-template-columns:minmax(160px,1.2fr) repeat(3,minmax(95px,.8fr)); gap:9px; }
}
@media(max-width:760px) {
 .card-command-center { padding:19px; }
 .card-control-layout { grid-template-columns:minmax(0,1fr); }
 .card-list-panel { grid-template-columns:minmax(0,1fr); }
 .card-list-heading { grid-column:1 / -1; }
 .card-select-card { min-height:126px; }
 .card-period-toolbar { align-items:flex-start; flex-direction:column; gap:5px; }
 .card-period-toolbar label,.card-period-toolbar select { width:100%; }
 .credit-card-control-center>summary { grid-template-columns:minmax(0,1fr); padding:19px; }
 .credit-card-control-center>summary span:last-child { text-align:left; }
 .credit-card-control-center .credit-card-body { padding:0 19px 19px; }
 .credit-card-section-heading { align-items:flex-start; flex-direction:column; gap:3px; }
 .credit-card-primary-grid,.credit-card-secondary-grid,.credit-card-control-center .credit-card-metrics,.credit-card-intelligence>div:last-child { grid-template-columns:minmax(0,1fr); }
 .credit-card-primary-grid>div,.credit-card-secondary-grid>div,.credit-card-control-center .credit-card-metrics>div { min-height:88px; border-right:0; border-bottom:1px solid var(--color-border); }
 .credit-card-primary-grid>div:nth-child(3),.credit-card-secondary-grid>div:nth-child(2),.credit-card-control-center .credit-card-metrics>div:nth-child(3) { border-bottom:1px solid var(--color-border); }
 .credit-card-primary-grid>div:last-child,.credit-card-secondary-grid>div:last-child,.credit-card-control-center .credit-card-metrics>div:last-child { border-bottom:0; }
 .credit-card-intelligence>div:last-child { gap:8px; }
 .credit-card-control-center .credit-card-installment-row { grid-template-columns:minmax(0,1fr); gap:10px; }
 .credit-card-control-center .installment-merchant { grid-column:1; }
}

@media(max-width:1100px) {
 .account-control-layout { grid-template-columns:220px minmax(0,1fr); }
 .account-flow-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .account-flow-grid>div:nth-child(2) { border-right:0; }
 .account-flow-grid>div:nth-child(-n+2) { border-bottom:1px solid var(--color-border); }
}
@media(max-width:760px) {
 .account-command-center { padding:19px; }
 .account-page-heading { align-items:flex-start; }
 .account-control-layout { grid-template-columns:minmax(0,1fr); }
 .account-list-panel { grid-template-columns:minmax(0,1fr); }
 .account-list-heading { grid-column:1 / -1; }
 .account-select-card { min-height:116px; }
 .account-detail-header { padding:19px; }
 .account-detail-header { flex-direction:column; }
 .account-balance-panel { padding:21px 19px; }
 .account-flow-heading { align-items:flex-start; flex-direction:column; padding:20px 19px 10px; gap:3px; }
 .account-flow-grid { grid-template-columns:minmax(0,1fr); margin:0 19px; }
 .account-flow-grid>div { min-height:88px; border-right:0; border-bottom:1px solid var(--color-border); }
 .account-flow-grid>div:nth-child(3) { border-bottom:1px solid var(--color-border); }
 .account-flow-grid>div:last-child { border-bottom:0; }
 .account-debt-note { grid-template-columns:minmax(0,1fr); margin:13px 19px 0; }
 .account-debt-note strong { grid-column:1; grid-row:2; }
 .account-recent { padding:19px 19px 5px; }
 .account-source-manager { padding:0 19px; }
}

@media(max-width:1000px) {
 body[data-view=home] .cp-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body[data-view=home] .cp-metrics .cp-metric { border:1px solid var(--color-border); }
 .home-product-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .home-product-card { min-height:155px; padding:17px; }
}
@media(max-width:700px) {
 body[data-view=home] .cp-metrics { grid-template-columns:minmax(0,1fr); gap:10px; }
 body[data-view=home] .cp-metric { min-height:132px; padding:19px; }
 .home-products-heading { align-items:flex-start; flex-direction:column; gap:3px; }
 .home-product-grid { grid-template-columns:minmax(0,1fr); gap:10px; }
 .home-product-card { min-height:132px; }
 body[data-view=home] .cp-attention { padding:20px 18px 8px; }
 body[data-view=home] .attention-row { grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; }
 body[data-view=home] .attention-row>div:first-of-type { grid-column:1 / -1; }
 body[data-view=home] .attention-amount { text-align:left; }
 body[data-view=home] .attention-row .row-button { grid-column:2; }
}

/* Etapa 4C · centro de control de créditos */
.loan-command-center { padding:27px; }
.loan-page-heading { margin-bottom:20px; }
.loan-control-layout { display:grid; grid-template-columns:minmax(220px,260px) minmax(0,1fr); gap:18px; align-items:start; }
.loan-list-panel { display:grid; gap:9px; }
.loan-list-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 3px 5px; color:var(--color-text-muted); }
.loan-list-heading>span { font-size:10px; font-weight:800; letter-spacing:.13em; }
.loan-list-heading small { font-size:11px; }
.loan-select-card { display:grid; width:100%; min-height:126px; padding:16px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface); color:var(--color-text); text-align:left; box-shadow:none; transition:border-color .16s ease,background .16s ease,transform .16s ease; }
.loan-select-card:hover { transform:translateY(-1px); border-color:#afc9bd; background:#fbfdfc; }
.loan-select-card[aria-pressed=true] { border-color:#8eb6a5; border-left:3px solid var(--brand); background:var(--brand-soft); }
.loan-select-card span { font-size:13px; font-weight:750; line-height:1.35; }
.loan-select-card strong { margin-top:3px; color:var(--color-text-muted); font-size:11px; letter-spacing:.08em; }
.loan-select-card small { align-self:end; margin-top:16px; color:var(--color-text-muted); font-size:10px; }
.loan-select-card b { margin-top:6px; color:var(--brand-strong); font-size:14px; font-weight:760; }
.loan-detail-column { min-width:0; }
.loan-period-toolbar { display:flex; min-height:56px; align-items:center; justify-content:space-between; gap:16px; margin-bottom:10px; padding:8px 14px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.loan-period-toolbar>span { color:var(--color-text-muted); font-size:11px; }
.loan-period-toolbar label { margin:0; }
.loan-period-toolbar select { min-width:118px; min-height:38px; border-color:transparent; background:transparent; color:var(--color-text); font-weight:750; text-align:right; }
.loan-control-detail { margin:0; padding:0; border:0; border-radius:0; background:transparent; }
.loan-control-card { margin:0; padding:0; overflow:hidden; border:1px solid var(--color-border); border-radius:var(--radius-lg); background:var(--color-surface); box-shadow:var(--shadow-surface); }
.loan-control-header { display:flex; min-height:92px; align-items:center; justify-content:space-between; gap:20px; padding:20px 22px; border-bottom:1px solid var(--color-border); }
.loan-control-identity { display:grid; gap:4px; min-width:0; }
.loan-control-identity>span,.loan-section-heading>span { color:var(--color-text-muted); font-size:9px; font-weight:800; letter-spacing:.13em; }
.loan-control-identity>strong { overflow:hidden; color:var(--color-text); font-size:21px; letter-spacing:-.025em; text-overflow:ellipsis; }
.loan-control-identity>small { color:var(--color-text-muted); font-size:11px; }
.loan-control-card .credit-configure-button { min-height:36px; border-color:var(--color-border-strong); background:var(--color-surface-subtle); color:var(--brand-strong); }
.loan-primary-state,.loan-activity-section,.loan-progress-section { padding:21px 22px 0; }
.loan-section-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:10px; }
.loan-section-heading small { color:var(--color-text-muted); font-size:10px; }
.loan-primary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); overflow:hidden; border:1px solid var(--color-border); border-radius:var(--radius-md); }
.loan-primary-grid>div { display:flex; min-height:126px; flex-direction:column; padding:17px; border-right:1px solid var(--color-border); background:var(--color-surface); }
.loan-primary-grid>div:last-child { border-right:0; }
.loan-primary-grid .loan-balance-primary { background:var(--brand-soft); }
.loan-primary-grid span,.loan-secondary-grid span,.loan-activity-grid span { color:var(--color-text-muted); font-size:10px; }
.loan-primary-grid strong { margin-top:8px; color:var(--color-text); font-size:17px; line-height:1.18; letter-spacing:-.025em; }
.loan-primary-grid .loan-balance-primary strong { color:var(--brand-strong); font-size:22px; }
.loan-primary-grid small,.loan-secondary-grid small,.loan-activity-grid small { margin-top:auto; padding-top:10px; color:var(--color-text-muted); font-size:9px; line-height:1.45; }
.loan-secondary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:10px 22px 0; overflow:hidden; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.loan-secondary-grid>div { display:flex; min-height:78px; flex-direction:column; justify-content:center; padding:13px 16px; border-right:1px solid var(--color-border); }
.loan-secondary-grid>div:last-child { border-right:0; }
.loan-secondary-grid strong { margin-top:6px; color:var(--color-text); font-size:12px; line-height:1.3; }
.loan-activity-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); overflow:hidden; border:1px solid var(--color-border); border-radius:var(--radius-md); }
.loan-activity-grid>div { display:flex; min-height:98px; flex-direction:column; justify-content:center; padding:15px 16px; border-right:1px solid var(--color-border); }
.loan-activity-grid>div:last-child { border-right:0; }
.loan-activity-grid strong { margin-top:7px; color:var(--color-text); font-size:15px; }
.loan-progress-section { padding-bottom:20px; }
.loan-progress-section>.loan-section-heading { margin-bottom:12px; }
.loan-progress-copy { display:flex; align-items:baseline; justify-content:space-between; gap:16px; }
.loan-progress-copy strong { color:var(--color-text); font-size:17px; }
.loan-progress-copy span { color:var(--color-text-muted); font-size:11px; }
.loan-progress-section>.credit-progress { height:6px; margin-top:12px; background:#e6ece8; }
.loan-progress-section>.credit-progress::before { background:var(--brand); }
.loan-progress-section>p { margin:9px 0 0; color:var(--color-text-muted); font-size:10px; }
.loan-control-card>.credit-alerts { margin:0 22px 18px; }
.loan-cost-section { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:0 22px 18px; padding:17px 18px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.loan-cost-section>div { display:grid; gap:5px; }
.loan-cost-section span { color:var(--color-text-muted); font-size:9px; font-weight:800; letter-spacing:.12em; }
.loan-cost-section strong { color:var(--color-text); font-size:13px; }
.loan-cost-section small { max-width:680px; color:var(--color-text-muted); font-size:10px; line-height:1.5; }
.loan-simulator-button { width:auto; min-width:220px; opacity:.62; }
.loan-payment-history { margin:0 22px 18px; border-top:1px solid var(--color-border); border-bottom:1px solid var(--color-border); }
.loan-payment-history summary { padding:13px 0; color:var(--brand-strong); font-size:11px; }
.loan-payment-history>div { padding:10px 0; }
.loan-plan-form { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:0 22px 22px; padding:18px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface-subtle); }
.loan-plan-form-heading { display:grid; grid-column:1/-1; gap:4px; margin-bottom:3px; }
.loan-plan-form-heading strong { color:var(--color-text); font-size:13px; }
.loan-plan-form-heading small { color:var(--color-text-muted); font-size:10px; }
.loan-plan-form label { color:var(--color-text-muted); font-size:10px; }
.loan-plan-form input,.loan-plan-form select { min-height:40px; border-color:var(--color-border); border-radius:var(--radius-sm); }
.loan-plan-form button { min-height:40px; }

@media (max-width:1100px) {
 .loan-control-layout { grid-template-columns:1fr; }
 .loan-list-panel { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .loan-list-heading { grid-column:1/-1; }
 .loan-primary-grid,.loan-activity-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .loan-primary-grid>div:nth-child(2),.loan-activity-grid>div:nth-child(2) { border-right:0; }
 .loan-primary-grid>div:nth-child(-n+2),.loan-activity-grid>div:nth-child(-n+2) { border-bottom:1px solid var(--color-border); }
 .loan-secondary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .loan-secondary-grid>div:nth-child(2) { border-right:0; }
 .loan-secondary-grid>div:nth-child(-n+2) { border-bottom:1px solid var(--color-border); }
}
@media (max-width:760px) {
 .loan-command-center { padding:19px; }
 .loan-list-panel,.loan-primary-grid,.loan-secondary-grid,.loan-activity-grid,.loan-plan-form { grid-template-columns:1fr; }
 .loan-list-heading { grid-column:auto; }
 .loan-select-card { min-height:112px; }
 .loan-control-header,.loan-cost-section { align-items:flex-start; flex-direction:column; }
 .loan-control-header { padding:18px; }
 .loan-control-card .credit-configure-button,.loan-simulator-button { width:100%; }
 .loan-primary-state,.loan-activity-section,.loan-progress-section { padding-right:18px; padding-left:18px; }
 .loan-primary-grid>div,.loan-primary-grid>div:nth-child(2),.loan-secondary-grid>div,.loan-secondary-grid>div:nth-child(2),.loan-activity-grid>div,.loan-activity-grid>div:nth-child(2) { min-height:92px; border-right:0; border-bottom:1px solid var(--color-border); }
 .loan-primary-grid>div:last-child,.loan-secondary-grid>div:last-child,.loan-activity-grid>div:last-child { border-bottom:0; }
 .loan-secondary-grid,.loan-control-card>.credit-alerts,.loan-cost-section,.loan-payment-history,.loan-plan-form { margin-right:18px; margin-left:18px; }
 .loan-progress-copy { align-items:flex-start; flex-direction:column; gap:4px; }
 .loan-period-toolbar { align-items:flex-start; flex-direction:column; gap:2px; }
 .loan-period-toolbar label,.loan-period-toolbar select { width:100%; }
 .loan-period-toolbar select { text-align:left; }
}

@media(max-width:760px) {
 .product-income-categories { padding:15px 12px; }
 .product-income-heading { align-items:flex-start; flex-direction:column; gap:9px; }
 .product-income-category-grid { grid-template-columns:1fr 1fr; }
 .product-income-category-card:nth-child(3n) { border-right:1px solid var(--color-border); }
 .product-income-category-card:nth-child(2n) { border-right:0; }
 .product-income-table .product-tx>strong:last-child:before { content:'Categoría: '; }
}

@media(prefers-reduced-motion:reduce) {
 *,*::before,*::after { scroll-behavior:auto !important; animation:none !important; transition-duration:.01ms !important; transition-delay:0ms !important; }
}
