/* Tokens and resets now in woop-tokens.css */

body {
    font-family: var(--font-family);
    background: var(--background);
    min-height: 100vh;
    padding: 80px 20px 40px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 3px solid var(--wealth);
    padding-bottom: 20px;
    position: relative;
}


h1 {
    font-size: 2.2rem;
    color: var(--foreground);
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--muted-foreground);
    font-size: 1rem;
}

.family-section {
    background: white;
    border: 2px solid var(--wealth);
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 30px;
}

#familyMembersList {
    margin-bottom: 20px;
}

.empty-family-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted-foreground);
    font-size: 0.95rem;
}

.empty-family-message p {
    margin-bottom: 10px;
}

.empty-family-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.family-member-card {
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 15px;
    display: grid;
    gap: 15px;
    align-items: end;
}

.family-member-card.with-ss {
    grid-template-columns: 1.5fr 1fr 1.5fr 1.5fr 1.5fr 1fr auto;
}

.family-member-card.without-ss {
    grid-template-columns: 1.5fr 1fr 1.5fr auto;
}

.family-member-card.with-contributing-no-ss {
    grid-template-columns: 1.5fr 1fr 1.5fr 1.5fr auto;
}

.family-member-card .input-group {
    margin-bottom: 0;
}

.member-plan-row {
    grid-column: 1 / -1;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
}

.member-plan-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted-foreground);
    cursor: pointer;
    user-select: none;
}

.member-plan-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
}

.contributor-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contributor-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.contributor-toggle label {
    margin: 0;
    cursor: pointer;
}

.add-member-btn {
    padding: 12px 24px;
    background: var(--wealth);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.add-member-btn:hover {
    background: var(--wealth-hover);
}

.add-member-btn:focus,
.add-member-btn:focus-visible {
    outline: none;
    background: var(--wealth-hover);
    box-shadow: 0 0 0 3px var(--wealth-glow);
}

.remove-member-btn {
    padding: 8px 16px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.remove-member-btn:hover {
    background: var(--error-hover);
}

.retirement-number-section {
    background: white;
    border: 2px solid var(--wealth);
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 30px;
}

.projection-section {
    background: white;
    border: 2px solid var(--wealth);
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 30px;
}

.section-header h2 {
    color: var(--wealth);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.section-description {
    color: var(--muted-foreground);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.section-description strong {
    color: var(--wealth);
    font-weight: 600;
}

.helper-text {
    background: var(--info-bg);
    border-left: 4px solid var(--info);
    padding: 12px 16px;
    margin: 15px 0 20px 0;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--foreground);
}

.helper-text a {
    color: var(--info);
    text-decoration: none;
    font-weight: 600;
}

.helper-text a:hover {
    text-decoration: underline;
}

.retirement-calculator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.goals-left .goal-item {
    align-items: flex-start;
}

.calculation-display {
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px 24px;
    text-align: center;
}

.calc-label {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.calc-value {
    color: var(--wealth);
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.calc-note {
    color: var(--muted-foreground);
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.goals-divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0;
}

.goal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.goal-item-note {
    color: var(--muted-foreground);
    font-size: 0.78rem;
    margin-top: 4px;
}
.retire-age-input-wrap {
    margin: 4px 0 2px;
}
.retire-age-input-large {
    width: 72px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--wealth);
    padding: 4px 8px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.retire-age-input-large:focus {
    border-color: var(--wealth);
    outline: none;
    box-shadow: 0 0 0 3px var(--wealth-glow);
}

.projection-section-header {
    margin-bottom: 25px;
}

.projection-section-header h2 {
    color: var(--wealth);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.projection-section-header .section-description {
    color: var(--muted-foreground);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.input-section:empty {
    display: none;
}

.growth-rate-section {
    margin-bottom: 0;
}

.person-card {
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
}

.person-card h2 {
    color: var(--wealth);
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.growth-rate-card {
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
}

.growth-rate-card h2 {
    color: var(--wealth);
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.growth-rate-card .section-description {
    margin-bottom: 20px;
}

.growth-rate-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.growth-rate-card .input-group:last-child {
    margin-bottom: 0;
}

.input-group {
    margin-bottom: 20px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    color: var(--foreground);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--wealth);
    box-shadow: 0 0 0 2px var(--wealth-glow);
}

.member-name {
    text-transform: capitalize;
}

.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.person-grid-card {
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
}

.person-grid-card.checked {
    border-color: var(--wealth);
    background: #f0f7f4;
}

.person-grid-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    cursor: pointer;
}

.person-grid-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.person-grid-name {
    font-weight: 600;
    color: var(--foreground);
    font-size: 1.1rem;
}

.person-grid-age {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    margin-left: 8px;
}

.person-grid-details {
    display: none;
    padding-top: 15px;
    margin-top: 0;
}

.person-grid-details.visible {
    display: block;
}

/* Income step: name header row (no outer checkbox) */
.person-grid-name-row {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Each income source (SS / pension / other) within a person card */
.income-source-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.income-source-section:first-of-type {
    margin-top: 0;
    border-top: none;
}

.income-source-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--foreground);
    flex-wrap: wrap;
}

.income-source-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.income-source-hint {
    font-weight: 400;
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

/* Fields revealed when a source is enabled */
.income-source-fields {
    display: none;
    padding-top: 12px;
    padding-left: 28px;
}

.income-source-fields.visible {
    display: block;
}

/* COLA (inflation) checkbox within pension fields */
.income-cola-fieldset {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--muted-foreground);
    cursor: pointer;
}

.income-cola-fieldset input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
}

button {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.calculate-btn {
    background: var(--wealth);
    color: white;
}

.calculate-btn:hover {
    background: var(--wealth-hover);
}

.calculate-btn:focus,
.calculate-btn:focus-visible {
    outline: none;
    background: var(--wealth-hover);
    box-shadow: 0 0 0 3px var(--wealth-glow);
}

.calculate-btn:active {
    background: var(--wealth-hover);
}

.reset-link {
    background: none;
    border: none;
    color: var(--muted-foreground);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.reset-link:hover {
    color: var(--foreground);
}

.reset-link:focus-visible {
    outline: 2px solid var(--wealth-vivid);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Results controls bar — between hero and chart */
.results-controls-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.results-controls-bar .results-scenario-bar,
.results-controls-bar .results-retire-age-bar,
.results-controls-bar .results-expenses-bar,
.results-controls-bar .results-dividend-bar,
.results-controls-bar .results-contributions-bar {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Hero + Controls 2-column panel */
.results-hero-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}
.results-hero-panel .retirement-hero {
    text-align: left;
    margin-bottom: 0;
    padding: 24px 20px;
}
.results-hero-panel .retirement-hero-age {
    font-size: 3rem;
}
.results-hero-panel .retirement-hero-age.warning {
    font-size: 1.8rem;
}
.results-hero-panel .results-controls-bar {
    margin-bottom: 0;
}
@media (max-width: 768px) {
    .results-hero-panel {
        grid-template-columns: 1fr;
    }
    .results-hero-panel .retirement-hero {
        text-align: center;
    }
}

/* Outcome Summary Strip — 4-card row */
.outcome-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 16px;
}
.outcome-card {
    background: var(--surface-inset);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.outcome-card.active {
    border-color: var(--wealth);
    background: var(--wealth-bg);
}
.outcome-card-label {
    font-size: 0.78rem;
    color: var(--muted-foreground);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.outcome-card-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--wealth);
    line-height: 1.2;
    margin-bottom: 4px;
}
.outcome-card-value.warning { color: var(--error); }
.outcome-card-sub {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}
/* Mini inline survival bar */
.survival-mini-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}
.survival-mini-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #40916c 0%, var(--wealth-vivid) 100%);
    transition: width 0.4s ease;
}
.survival-mini-fill.warning {
    background: linear-gradient(90deg, #f59e0b 0%, var(--error) 100%);
}

/* Results footer */
.results-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.results-footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}
.results-footer-links a {
    color: var(--wealth);
    text-decoration: none;
    font-weight: 500;
}
.results-footer-links a:hover {
    text-decoration: underline;
}

.results-section {
    display: none;
}

.results-section.visible {
    display: block;
}

.chart-section {
    background: white;
    border: 2px solid var(--wealth);
    border-radius: 4px;
    padding: 20px;
}

.scenario-card:focus {
    outline: 2px solid var(--wealth);
    outline-offset: 2px;
}

.chart-wrapper {
    position: relative;
    height: 400px;
}

.table-container {
    background: white;
    border: 2px solid var(--wealth);
    border-radius: 4px;
    padding: 30px;
    overflow-x: auto;
}

.table-container h2 {
    color: var(--foreground);
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.table-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--surface-inset);
    border-radius: 4px;
    border-left: 4px solid var(--success-bg);
}

.legend-indicator {
    width: 24px;
    height: 24px;
    background: var(--success-bg);
    border: 1px solid #c3e6cb;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-text {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    line-height: 1.4;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    position: sticky;
    top: 0;
    background: var(--wealth);
    color: white;
}

th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
}

tbody tr {
    border-bottom: 1px solid var(--border);
}

tbody tr:nth-child(even) {
    background: var(--surface-inset);
}

tbody tr:hover {
    background: #f0f0f0;
}

tbody tr.milestone-row {
    background: var(--success-bg) !important;
    font-weight: 600;
}

tbody tr.milestone-row:hover {
    background: #c3e6cb !important;
}

td {
    padding: 10px;
    color: var(--foreground);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .family-section {
        padding: 20px;
    }

    .family-member-card,
    .family-member-card.with-ss,
    .family-member-card.without-ss,
    .family-member-card.with-contributing-no-ss {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .retirement-number-section {
        padding: 20px;
    }

    .projection-section {
        padding: 20px;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .projection-section-header h2 {
        font-size: 1.2rem;
    }

    .retirement-calculator {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .calc-value {
        font-size: 1.8rem;
    }

    .retire-age-input-large {
        font-size: 1.6rem;
    }

    .input-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .growth-rate-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .button-container {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .chart-section {
        padding: 14px;
    }

    .chart-wrapper {
        height: 300px;
    }

    .results-controls-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 12px;
    }

    .outcome-summary {
        grid-template-columns: 1fr 1fr;
    }

    .results-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    th, td {
        padding: 8px;
        font-size: 0.8rem;
    }
}

.error-message {
    background: var(--error-bg);
    color: var(--error);
    padding: 12px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.error-message.visible {
    display: block;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: var(--wealth);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

.reset-container {
    text-align: center;
    padding: 30px 0;
    margin-top: 20px;
}

.reset-confirm[hidden] {
    display: none;
}

.reset-confirm {
    display: inline-block;
    background: var(--error-bg);
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: left;
    max-width: 420px;
}

.reset-confirm-title {
    font-weight: bold;
    color: var(--error);
    font-size: 0.875rem;
    margin: 0 0 0.25rem;
}

.reset-confirm-body {
    color: var(--error);
    font-size: 0.875rem;
    margin: 0 0 0.75rem;
}

.reset-confirm-actions {
    display: flex;
    gap: 0.75rem;
}

.reset-confirm-yes {
    background: var(--error);
    color: white;
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 0.375rem;
    font-weight: bold;
    font-size: 0.875rem;
    cursor: pointer;
}

.reset-confirm-yes:hover {
    background: var(--error);
}

.reset-confirm-yes:focus-visible {
    outline: 2px solid var(--error);
    outline-offset: 2px;
}

.reset-confirm-cancel {
    background: white;
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 0.4rem 0.9rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.reset-confirm-cancel:hover {
    background: var(--surface-inset);
}

.reset-confirm-cancel:focus-visible {
    outline: 2px solid var(--wealth-vivid);
    outline-offset: 2px;
}

.expense-calculator-link {
    display: inline-block;
    color: var(--wealth);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
}

.expense-calculator-link:hover {
    text-decoration: underline;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 4px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: var(--wealth);
    color: white;
    padding: 20px 30px;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    opacity: 0.8;
    outline: 2px solid white;
    outline-offset: 2px;
}

.modal-body {
    padding: 30px;
}

.expense-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    margin-bottom: 15px;
    align-items: end;
}

.expense-item .input-group {
    margin-bottom: 0;
}

.remove-expense-btn {
    padding: 10px 16px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.remove-expense-btn:hover {
    background: var(--error-hover);
}

.add-expense-btn {
    padding: 10px 20px;
    background: var(--wealth);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 20px;
}

.add-expense-btn:hover {
    background: var(--wealth-hover);
}

.expense-total {
    border-top: 2px solid var(--wealth);
    padding-top: 20px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expense-total-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--foreground);
}

.expense-total-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--wealth);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-footer-primary {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal-btn-cancel {
    background: var(--error);
    color: white;
}

.modal-btn-cancel:hover {
    background: var(--error-hover);
}

.modal-btn-apply {
    background: var(--wealth);
    color: white;
}

.modal-btn-apply:hover {
    background: var(--wealth-hover);
}

.modal-btn-secondary {
    background: #6c757d;
    color: white;
    align-self: flex-end;
}

.modal-btn-secondary:hover {
    background: #5a6268;
}

.disclaimer-content {
    max-height: 60vh;
    overflow-y: auto;
}

.disclaimer-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.disclaimer-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.disclaimer-item h3 {
    color: var(--wealth);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.disclaimer-item p {
    color: var(--muted-foreground);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.blocked-content {
    display: none;
    text-align: center;
    padding: 80px 40px;
    background: var(--surface-inset);
    border: 2px solid var(--wealth);
    border-radius: 4px;
    margin: 40px 0;
}

.blocked-content.visible {
    display: block;
}

.blocked-content h2 {
    color: var(--wealth);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.blocked-content p {
    color: var(--muted-foreground);
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.blocked-content-btn {
    padding: 15px 30px;
    background: var(--wealth);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.blocked-content-btn:hover {
    background: var(--wealth-hover);
}

.calculator-content.hidden {
    display: none;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .expense-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Progress Indicator - Mobile Responsive */
    .progress-container {
        padding: 15px 10px;
        margin-bottom: 20px;
    }

    .progress-steps {
        max-width: 100%;
        padding: 0 5px;
    }

    .progress-circle {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .progress-label {
        font-size: 0.65rem;
        max-width: 45px;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .progress-line {
        display: none;
    }

    .progress-step {
        gap: 5px;
    }

    /* Disclaimer Modal - Mobile Buttons */
    .modal-footer {
        padding: 15px 20px;
    }

    .modal-footer-primary {
        width: 100%;
        gap: 10px;
    }

    .modal-footer-primary .modal-btn {
        flex: 1;
        padding: 14px 20px;
        font-size: 1rem;
    }

    .modal-btn-secondary {
        width: 100%;
        padding: 12px 20px;
        margin-top: 5px;
    }

    /* Person Grid - Stack on mobile */
    .person-grid {
        grid-template-columns: 1fr;
    }
}

/* Step Management Styles */
.step-container {
    /* Will be shown/hidden via JavaScript */
}

.step-navigation {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 0 0 20px 0;
}

.nav-btn {
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid var(--wealth);
    background: white;
    color: var(--wealth);
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--wealth);
    color: white;
}

.nav-btn:focus,
.nav-btn:focus-visible {
    outline: none;
    background: var(--wealth);
    color: white;
    box-shadow: 0 0 0 3px var(--wealth-glow);
}

.progress-container {
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid var(--border);
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.progress-step:hover {
    transform: scale(1.1);
}

.progress-step:hover .progress-circle {
    box-shadow: 0 0 8px var(--wealth-glow);
}

.progress-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--muted-foreground);
    font-weight: 600;
}

.progress-step.active .progress-circle {
    border-color: var(--wealth);
    background: var(--wealth);
    color: white;
    font-weight: bold;
}

.progress-step.completed .progress-circle {
    border-color: var(--wealth);
    background: white;
    color: var(--wealth);
}

.progress-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 10px;
}

.contributor-card {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 10px;
    background: var(--surface-inset);
}

.contributor-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.contributor-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.contributor-name {
    font-weight: 600;
    color: var(--foreground);
}

.contributor-age {
    color: var(--muted-foreground);
    font-size: 0.9rem;
}

.ss-checkbox-section {
    margin-bottom: 20px;
}

.ss-details-section {
    margin-top: 30px;
}

.ss-input-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 15px;
    background: var(--surface-inset);
}

.ss-input-card h3 {
    color: var(--wealth);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.ss-input-card h4 {
    color: var(--foreground);
    margin-bottom: 15px;
    font-size: 1rem;
}

.ss-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    cursor: pointer;
}

.ss-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.ss-details {
    display: none;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.ss-details .input-group {
    margin-bottom: 15px;
}

/* Scenario mode toggle */
.scenario-mode-toggle { display:flex; gap:0; margin-bottom:24px; border:1.5px solid var(--wealth); border-radius:4px; overflow:hidden; width:fit-content; }
.scenario-mode-btn { padding:8px 20px; background:transparent; border:none; font-family:var(--font-family); font-size:0.85rem; font-weight:600; color:var(--wealth); cursor:pointer; transition:background 0.15s,color 0.15s; }
.scenario-mode-btn.active { background:var(--wealth); color:#fff; }

/* Scenario cards */
.scenario-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:8px; }
@media(max-width:600px){ .scenario-cards { grid-template-columns:1fr; } }
.scenario-card { border:2px solid var(--border); border-radius:6px; padding:18px 16px; cursor:pointer; transition:border-color 0.15s,background 0.15s; background:#fff; }
.scenario-card:hover { border-color:var(--muted-foreground); }
.scenario-card.selected { border-color:var(--wealth); background:var(--wealth-bg); }
.scenario-card-label { font-family:var(--font-family-heading); font-size:1.15rem; margin:0 0 4px; }
.scenario-card-rates { font-size:0.78rem; color:var(--muted-foreground); margin:8px 0 6px; }
.scenario-card-rates span { display:inline-block; margin-right:10px; }
.scenario-card-desc { font-size:0.8rem; color:var(--muted-foreground); line-height:1.45; margin:0; }

/* Results scenario bar */
.results-scenario-bar { display:flex; align-items:center; gap:12px; margin-bottom:24px; padding-bottom:16px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.results-scenario-label { font-size:0.85rem; color:var(--muted-foreground); font-weight:600; white-space:nowrap; display:inline-block; min-width:120px; }
.results-retire-age-bar { display:flex; align-items:center; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.retire-age-value { font-weight:700; font-size:1.1rem; min-width:28px; text-align:center; }
.retire-age-slider { flex:1; min-width:120px; max-width:260px; accent-color:var(--wealth); cursor:pointer; }
.results-expenses-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.expenses-display-value { font-weight:700; font-size:1.1rem; min-width:64px; }
.results-expenses-slider { flex:1; min-width:120px; max-width:260px; accent-color:var(--wealth); cursor:pointer; }
.results-dividend-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.results-dividend-toggle { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:0.9rem; }
.results-dividend-toggle input[type="checkbox"] { width:16px; height:16px; accent-color:var(--dividend-vivid); cursor:pointer; flex-shrink:0; }
.results-dividend-toggle-text { font-weight:500; }
.results-dividend-amount-input { width:86px; padding:3px 8px; border:1px solid var(--dividend-vivid); border-radius:4px; font-size:0.95rem; font-weight:700; color:#047857; background:#fff; text-align:right; }
.results-dividend-amount-input:focus { outline:2px solid var(--dividend-vivid); outline-offset:1px; }
.results-dividend-per-mo { font-size:0.85rem; color:var(--muted-foreground); }

.results-contributions-bar { display:flex; flex-direction:column; gap:8px; }
.results-contribution-row { display:flex; align-items:center; gap:12px; flex-wrap:nowrap; }
.results-contribution-label { font-size:0.88rem; font-weight:600; color:var(--foreground); white-space:nowrap; min-width:0; }
.results-contribution-value { font-size:0.88rem; font-weight:700; color:var(--wealth); white-space:nowrap; min-width:60px; text-align:right; }
.results-contribution-slider { flex:1; min-width:80px; max-width:260px; accent-color:var(--wealth); cursor:pointer; }

.table-accordion { margin-top: 24px; }
.table-accordion-summary {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-weight: 600; font-size: 0.95rem;
    color: var(--foreground); padding: 10px 0; user-select: none;
    list-style: none;
}
.table-accordion-summary::-webkit-details-marker { display: none; }
.table-accordion-summary::before {
    content: '▶'; font-size: 0.7rem; color: var(--muted-foreground);
    transition: transform 0.2s;
}
details[open] .table-accordion-summary::before { transform: rotate(90deg); }
.table-accordion-hint { font-size: 0.8rem; color: var(--muted-foreground); font-weight: 400; }
.table-disclosure {
    font-size: 0.8rem; color: var(--muted-foreground); font-style: italic;
    margin: 4px 0 12px; padding: 8px 12px;
    border-left: 3px solid var(--border); line-height: 1.5;
}

/* Monte Carlo legend */
.mc-legend { display:flex; gap:18px; flex-wrap:wrap; margin-top:12px; font-size:0.8rem; color:var(--muted-foreground); }
.mc-legend-item { display:flex; align-items:center; gap:6px; }
.mc-legend-swatch { width:20px; height:4px; border-radius:2px; }

/* Health Dividend card on savings panel */
.health-dividend-card {
    background: linear-gradient(135deg, var(--dividend-bg), var(--success-bg));
    border: 2px solid var(--dividend-vivid);
    border-left: 4px solid #0d9488; /* teal — health app origin signal */
    border-radius: 4px;
    padding: 20px;
}

/* Consequence note within checkbox labels */
.dividend-toggle-note {
    font-size: 0.78rem;
    color: var(--muted-foreground);
    font-weight: 400;
}
.health-dividend-card h2 {
    color: var(--dividend-deep);
    margin-bottom: 4px;
    font-size: 1.1rem;
    font-weight: 700;
}
.health-dividend-card .dividend-source {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-bottom: 16px;
}
.health-dividend-card .dividend-amount {
    font-size: 1.6rem;
    font-weight: 700;
    color: #047857;
    margin-bottom: 4px;
}
.health-dividend-card .dividend-amount-label {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    margin-bottom: 16px;
}
.health-dividend-card .dividend-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.health-dividend-card .dividend-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--foreground);
    cursor: pointer;
}
.health-dividend-card .dividend-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--dividend-deep);
    cursor: pointer;
}
.health-dividend-card .dividend-toggle-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.health-dividend-card .dividend-toggle-disabled input[type="checkbox"] {
    cursor: not-allowed;
    width: 18px;
    height: 18px;
}
.health-dividend-card .dividend-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--dividend-deep);
    text-decoration: none;
    font-weight: 600;
}
.health-dividend-card .dividend-link:hover {
    text-decoration: underline;
}
.health-dividend-card .dividend-stale {
    font-size: 0.8rem;
    color: var(--dividend);
    margin-top: 8px;
    margin-bottom: 14px;
}
/* Editable monthly amount in Health Dividend card */
.dividend-edit {
    margin-bottom: 14px;
}
.dividend-edit-label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted-foreground);
    font-weight: 500;
    margin-bottom: 6px;
}
.dividend-monthly-input {
    display: block;
    width: 130px;
    padding: 6px 10px;
    border: 1px solid var(--dividend-vivid);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    color: #047857;
    background: #fff;
    margin-bottom: 4px;
}
.dividend-monthly-input:focus {
    outline: 2px solid var(--dividend-vivid);
    outline-offset: 1px;
}
.dividend-edit-hint {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}
/* Discovery teaser — shown when no Health Dividend bridge data exists */
.health-dividend-discovery {
    background: linear-gradient(135deg, var(--dividend-bg), var(--success-bg));
    border: 1px dashed var(--dividend-vivid);
    border-radius: 4px;
    padding: 16px 20px;
    margin-top: 16px;
    font-size: 0.875rem;
}
.dividend-discovery-heading {
    color: var(--dividend-deep);
    display: block;
    margin-bottom: 6px;
}
.health-dividend-discovery p {
    margin: 0 0 10px;
    color: var(--muted-foreground);
}
.dividend-discovery-link {
    font-size: 0.85rem;
    color: var(--dividend-deep);
    text-decoration: none;
    font-weight: 600;
}
.dividend-discovery-link:hover {
    text-decoration: underline;
}
@keyframes pulse-highlight-anim {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
    50% { box-shadow: 0 0 0 8px rgba(217, 119, 6, 0.25); }
}
.health-dividend-card.pulse-highlight {
    animation: pulse-highlight-anim 1s ease-in-out 3;
}
.retirement-hero-dividend {
    font-size: 0.85rem;
    color: var(--dividend-deep);
    margin-top: 8px;
    font-weight: 600;
}
.retirement-hero-dividend-included {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    background: var(--success-bg);
    border: 1px solid #6ee7b7;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #065f46;
}

/* Contribution summary — shown below dividend card in Step 3 when dividend is included */
.contribution-summary {
    margin-top: 12px;
    background: var(--success-bg);
    border: 1px solid #bbf7d0;
    border-left: 4px solid #0d9488;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 0.875rem;
}
.contribution-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    color: var(--muted-foreground);
}
.contribution-summary-row.dividend-row {
    color: #0d9488;
    font-weight: 600;
}
.contribution-summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid #bbf7d0;
    font-weight: 700;
    color: var(--foreground);
}

/* Retirement hero stat */
.retirement-hero {
    text-align: center;
    padding: 36px 24px 28px;
    margin-bottom: 28px;
    border: 2px solid var(--wealth);
    border-radius: 4px;
    background: linear-gradient(180deg, var(--wealth-bg) 0%, #fff 100%);
}
.retirement-hero-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted-foreground);
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}
.retirement-hero-age {
    font-family: var(--font-family-heading);
    font-size: 4rem;
    font-weight: 700;
    color: var(--wealth);
    line-height: 1.1;
    margin-bottom: 8px;
}
.retirement-hero-age.warning {
    color: var(--error);
    font-size: 2rem;
}
.retirement-hero-age.caution {
    color: var(--dividend-deep);
}
.retirement-hero-subtitle {
    font-size: 0.95rem;
    color: var(--muted-foreground);
    margin-bottom: 10px;
}
.retirement-hero-verdict {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--wealth);
    margin-bottom: 4px;
}
.retirement-hero-verdict.caution {
    color: var(--dividend-deep);
}
.retirement-hero-secondary {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    margin-top: 4px;
}
.retirement-hero-meta {
    font-size: 0.78rem;
    color: var(--muted-foreground);
    margin-top: 12px;
}
@media (max-width: 768px) {
    .retirement-hero { padding: 28px 16px 22px; }
    .retirement-hero-age { font-size: 3rem; }
}

/* Save as PDF button */
.save-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: var(--wealth);
    border: 2px solid var(--wealth);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.save-pdf-btn:hover {
    background: var(--wealth);
    color: white;
}

/* Print stylesheet */
@media print {
    /* Hide non-essential elements */
    nav, footer, .progress-container, .step-navigation,
    .reset-container, .blocked-content, .error-message,
    .results-controls-bar, .results-footer,
    .modal-overlay, .table-accordion,
    .mc-legend { display: none !important; }

    /* Hide all steps except results */
    .step-container { display: none !important; }
    #step6 { display: block !important; }
    .calculator-content.hidden { display: block !important; }

    /* Reset page layout */
    body {
        padding: 0 !important;
        background: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .container {
        box-shadow: none !important;
        padding: 20px !important;
        max-width: 100% !important;
    }

    /* Keep header but simplify */
    header {
        margin-bottom: 20px !important;
        padding-bottom: 12px !important;
    }

    h1 { font-size: 1.6rem !important; }
    .subtitle { font-size: 0.85rem !important; }

    /* Hero stat */
    .retirement-hero {
        page-break-inside: avoid;
        border-color: #2d6a4f !important;
        background: #f0f7f4 !important;
        margin-bottom: 16px !important;
        padding: 20px !important;
    }
    .retirement-hero-age { font-size: 2.8rem !important; }

    /* Chart section */
    .chart-section {
        page-break-inside: avoid;
        border-color: #2d6a4f !important;
        padding: 16px !important;
    }
    .chart-wrapper { height: 280px !important; }

    /* Outcome summary strip */
    .outcome-summary {
        page-break-inside: avoid;
        margin-top: 12px !important;
    }
    .outcome-card {
        border-color: #ddd !important;
        padding: 10px !important;
    }
    .survival-mini-fill {
        background: #2d6a4f !important;
    }
    .survival-mini-fill.warning {
        background: #dc3545 !important;
    }

    /* Print footer with branding */
    .calculator-content::after {
        content: 'Generated by ReckonWell.ai · Retirement Planner · ' attr(data-print-date);
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: #595249;
        margin-top: 24px;
        padding-top: 12px;
        border-top: 1px solid #ddd;
    }
}

/* Skip-link styles now in woop-chrome.css */

/* prefers-reduced-motion now in woop-tokens.css */

/* Initially hidden elements — toggled visible by JS */
.initially-hidden {
    display: none;
}

/* Planner nav styles now in woop-chrome.css */

/* Privacy tip in Step 1 */
.privacy-tip {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--muted-foreground);
    font-style: italic;
}

/* Goal item with extra bottom spacing */
.goal-item-spaced {
    margin-bottom: 20px;
}

/* Footer branding styles now in woop-chrome.css */

/* Health dividend per-year label */
.dividend-per-year {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--muted-foreground);
}

/* MC legend swatch variants */
.mc-legend-swatch.swatch-band {
    background: rgba(45, 106, 79, 0.35);
    height: 12px;
}

.mc-legend-swatch.swatch-median {
    background: var(--wealth-vivid);
    height: 3px;
}

.mc-legend-swatch.swatch-dividend {
    background: var(--dividend-vivid);
    height: 3px;
    border-style: dashed;
}

/* ============================================================
   Health CTA Banner — Step 6 Results screen
   Placed between #outcomeSummary and .table-accordion.

   Three modifier classes control visual state:
     .health-cta--urgent     State A: survival rate < 70%, no health data
     .health-cta--soft       State B: survival rate >= 70%, no health data
     .health-cta--connected  State C: healthDividend exists in localStorage

   Color rationale:
   Retirement/wealth actions use forest green (#2d6a4f). Reusing it
   here would merge the CTA into the results strip. Amber (#b45309)
   is already established for the health-wealth bridge on the Step 3
   dividend card — reusing it creates cross-step recognition.
   State C reverses to a sage confirmation tint, signalling that
   health data has joined the wealth plan.
   ============================================================ */

/* --- Base container ---------------------------------------- */
.health-cta {
    border-radius: 4px;
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 20px 22px;
    display: none;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.health-cta.health-cta--visible {
    opacity: 1;
    transform: translateY(0);
}

.health-cta-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.health-cta-body {
    flex: 1;
    min-width: 0;
}

.health-cta-headline {
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
}

.health-cta-text {
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0 0 14px;
    color: var(--foreground);
}

.health-cta-amount {
    font-weight: 700;
}

.health-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 4px;
    border: none;
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.health-cta-btn:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.health-cta-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 10px;
}

.health-cta-link:hover,
.health-cta-link:focus-visible {
    text-decoration: underline;
}

.health-cta-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.health-cta-dismiss {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    color: inherit;
    opacity: 0.55;
    transition: opacity 0.15s ease;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.health-cta-dismiss:hover {
    opacity: 1;
}

.health-cta-dismiss:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
}

/* ---- State A: urgent (survival rate < 70%, no health data) */
/*
   Contrast ratios (WCAG AAA 7:1 for normal text):
     Headline #92400e on #fff7ed  → 7.6:1  PASS AAA
     Body     #1a1a1a on #fff7ed  → 17.6:1 PASS AAA
     Amount   #b45309 on #fff7ed  → 5.9:1  PASS AA (bold/large)
     Button   #ffffff on #b45309  → 7.2:1  PASS AAA
*/
.health-cta--urgent {
    background: #fff7ed;
    border: 2px solid #b45309;
}

.health-cta--urgent .health-cta-headline {
    color: #92400e;
}

.health-cta--urgent .health-cta-text {
    color: #1a1a1a;
}

.health-cta--urgent .health-cta-amount {
    color: #b45309;
}

.health-cta--urgent .health-cta-btn {
    background: #b45309;
    color: #fff;
}

.health-cta--urgent .health-cta-btn:hover {
    background: #92400e;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.3);
}

/* ---- State B: soft (survival rate >= 70%, no health data) */
/*
   Contrast ratios:
     Headline #1a4731 on #f0faf4  → 9.5:1  PASS AAA
     Body     #333333 on #f0faf4  → 11.5:1 PASS AAA
     Button   #ffffff on #1a6040  → 7.1:1  PASS AAA
*/
.health-cta--soft {
    background: #f0faf4;
    border: 2px solid #a7d4b9;
    padding-right: 48px;
}

.health-cta--soft .health-cta-headline {
    color: #1a4731;
}

.health-cta--soft .health-cta-text {
    color: #333;
}

.health-cta--soft .health-cta-btn {
    background: #1a6040;
    color: #fff;
}

.health-cta--soft .health-cta-btn:hover {
    background: #134d33;
    box-shadow: 0 2px 8px rgba(26, 96, 64, 0.25);
}

/* ---- State C: connected (healthDividend in localStorage) */
/*
   Contrast ratios:
     Headline #1a4731 on #ecfdf5  → 8.9:1  PASS AAA
     Body     #1a1a1a on #ecfdf5  → 18.5:1 PASS AAA
     Link     #1a6040 on #ecfdf5  → 7.3:1  PASS AAA
*/
.health-cta--connected {
    background: #ecfdf5;
    border: 2px solid var(--wealth);
}

.health-cta--connected .health-cta-headline {
    color: #1a4731;
}

.health-cta--connected .health-cta-text {
    color: #1a1a1a;
}

.health-cta--connected .health-cta-link {
    color: #1a6040;
}

/* ---- Mobile ------------------------------------------------ */
@media (max-width: 767px) {
    .health-cta {
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }

    .health-cta--soft {
        padding-right: 48px;
    }

    .health-cta-icon {
        font-size: 1.4rem;
    }

    .health-cta-headline {
        font-size: 0.95rem;
    }

    .health-cta-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 18px;
        font-size: 0.9rem;
    }
}

/* ---- Print: suppress entirely ----------------------------- */
@media print {
    .health-cta { display: none !important; }
}
