/* The Investments retirement page (/admin/investments/retirement): page-specific styles on top of investments-area.css.
   Two panes on wide screens (the sticky "Your plan" inputs, 4 of 12 columns, and the results, 8), stacked below 1200px
   with the answer first; the inputs panel (collapsible sections, number fields, sliders, presets, account switches);
   the readiness ring, tiles and what-if chips; the chart legends; next steps; savings benchmarks; tax mix; data notes;
   the disclaimer. Every color is an --iv-* token (or a --rp-* alias of one), so light and dark follow the area. */

:root {
    --rp-bucket-taxdeferred: var(--iv-slice-2);
    --rp-bucket-roth: var(--iv-slice-1);
    --rp-bucket-taxable: var(--iv-slice-3);
    --rp-bucket-hsa: var(--iv-slice-5);
    --rp-bucket-education: var(--iv-slice-4);
    --rp-bucket-cash: var(--iv-slice-other);
    --rp-bucket-other: var(--iv-light);
    --rp-bucket-outside: var(--iv-accent);
    --rp-panel-bg: var(--rc-card, #FFFFFF);
    --rp-thumb: #FFFFFF;
}

[data-bs-theme="dark"] {
    --rp-panel-bg: var(--rc-card, #151B28);
    --rp-thumb: #E6E9EF;
}

/* The admin frame (.admin-main) is the page's scroll container, so the sticky inputs pane sticks to it as it scrolls. */

/* ------------------------------------------------------------------ Layout */

.rp-layout {
    display: grid;
    gap: 1rem;
    align-items: start;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "summary"
        "inputs"
        "details";
}

.rp-pane-inputs { grid-area: inputs; min-width: 0; }
.rp-pane-summary { grid-area: summary; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.rp-pane-details { grid-area: details; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.rp-duo { display: grid; gap: 1rem; align-items: stretch; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.rp-duo > * { min-width: 0; }
.rp-duo > .rc-card { height: 100%; }

@media (min-width: 768px) {
    .rp-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .rp-layout {
        grid-template-columns: minmax(300px, 4fr) minmax(0, 8fr);
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "inputs summary"
            "inputs details";
    }

    .rp-pane-inputs {
        position: sticky;
        top: 12px;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        border-radius: 20px;
    }

    .rp-panel-top { position: sticky; top: 0; }
}

.rp-load-error { margin-bottom: 1rem; }
.rp-start-callout { margin: 0; }

/* ------------------------------------------------------------------ The "Your plan" panel */

.rc-card.rp-panel { padding: 0; }

.rp-panel-top {
    z-index: 3;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--iv-tile-border);
    border-radius: 20px 20px 0 0;
    background: var(--rp-panel-bg);
}

.rp-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }

.rp-panel-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 3px 0 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--iv-tone, var(--iv-muted));
}

.rp-panel-status.iv-tone-neutral { color: var(--iv-muted); }
.rp-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rp-panel-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 12px; }
.rp-panel-actions .iv-btn { min-height: 34px; padding: 5px 12px; font-size: 12.5px; }
.rp-panel-error { margin: 10px 0 0; }
.rp-sections { display: flex; flex-direction: column; padding: 2px 16px 12px; }

/* A collapsible section. */
.rp-section + .rp-section { border-top: 1px solid var(--iv-tile-border); }
.rp-section-heading { margin: 0; font-size: inherit; line-height: inherit; }

.rp-section-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--iv-text);
    text-align: left;
    cursor: pointer;
}

.rp-section-toggle:hover .rp-section-title { color: var(--iv-green); }

.rp-section-chip {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--iv-icon-bg);
    color: var(--iv-icon);
    font-size: 12px;
}

.rp-section-titles { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.rp-section-title { font-family: var(--tx-font); font-size: 13.5px; font-weight: 600; transition: color .15s ease; }
.rp-section-summary { overflow: hidden; font-size: 11.5px; color: var(--iv-muted); text-overflow: ellipsis; white-space: nowrap; }
.rp-section-flag { color: var(--iv-negative); font-size: 13px; }
.rp-section-caret { color: var(--iv-light); font-size: 11px; transition: transform .2s ease; }
.rp-section.is-open .rp-section-caret { transform: rotate(90deg); }
.rp-section.has-error .rp-section-chip { background: var(--iv-negative-soft); color: var(--iv-negative); }
.rp-section-body { display: flex; flex-direction: column; gap: 12px; padding: 2px 0 16px; min-width: 0; }
.rp-section-body[hidden] { display: none; }

/* Fields. */
.rp-field-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-field-grid > .rp-field-wide { grid-column: 1 / -1; }
.rp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rp-label-row { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-width: 0; }
.rp-label { margin: 0; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--iv-muted); }
.rp-badge { font-size: 9.5px; }

.rp-input-wrap {
    display: flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid var(--iv-input-border);
    border-radius: 11px;
    background: var(--iv-input-bg);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.rp-input-wrap:focus-within { border-color: var(--iv-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--iv-focus) 22%, transparent); }
.rp-input-wrap.has-error { border-color: var(--iv-negative); }
.rp-input-wrap.has-error:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--iv-negative) 22%, transparent); }
.rp-input-wrap.is-disabled { opacity: .55; }

.rp-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 7px 10px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--iv-text);
    font-family: var(--tx-font);
    font-size: 14px;
    font-weight: 600;
    -moz-appearance: textfield;
    appearance: textfield;
}

.rp-input::-webkit-outer-spin-button,
.rp-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rp-input::placeholder { color: var(--iv-light); font-weight: 500; }
.rp-affix { padding-left: 10px; color: var(--iv-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.rp-affix + .rp-input { padding-left: 4px; }
.rp-affix-end { padding: 0 10px 0 0; font-size: 11.5px; }
.rp-hint { font-size: 11.5px; line-height: 1.4; color: var(--iv-muted); }
.rp-hint-block { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; margin: 0; }
.rp-hint-block .tx-glyph { color: var(--iv-green); font-size: 11px; }
.rp-hint a { color: var(--iv-green); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.rp-field-error { display: flex; align-items: baseline; gap: .35rem; font-size: 11.5px; line-height: 1.4; color: var(--iv-negative); }

.rp-note {
    display: flex;
    align-items: baseline;
    gap: .45rem;
    margin: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--iv-neutral-soft);
    color: var(--iv-text);
    font-size: 12px;
    line-height: 1.4;
}

.rp-note .tx-glyph { color: var(--iv-green); }
.rp-note-total { align-items: center; justify-content: space-between; }
.rp-note-total strong { font-family: var(--tx-font); font-size: 14px; }

.rp-link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--iv-green);
    font-size: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

/* Sliders: a green-filled track (set by --rp-fill) and a round thumb. */
.rp-slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.rp-slider-value { font-family: var(--tx-font); font-size: 13px; font-weight: 700; color: var(--iv-text); white-space: nowrap; }

.rp-range {
    width: 100%;
    height: 22px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.rp-range:focus { outline: none; }
.rp-range:disabled { opacity: .5; cursor: default; }

.rp-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--iv-green) 0, var(--iv-green) var(--rp-fill, 0%), var(--iv-track) var(--rp-fill, 0%), var(--iv-track) 100%);
}

.rp-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--iv-track); }
.rp-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--iv-green); }

.rp-range::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -6px;
    border: 2px solid var(--iv-green);
    border-radius: 50%;
    background: var(--rp-thumb);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .25);
    transition: transform .12s ease, box-shadow .15s ease;
    -webkit-appearance: none;
}

.rp-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid var(--iv-green);
    border-radius: 50%;
    background: var(--rp-thumb);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .25);
}

.rp-range:hover::-webkit-slider-thumb { transform: scale(1.12); }
.rp-range:active::-webkit-slider-thumb { transform: scale(1.12); }
.rp-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--iv-focus) 30%, transparent); }
.rp-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--iv-focus) 30%, transparent); }
.rp-range-scale { display: flex; justify-content: space-between; margin-top: -2px; font-size: 10.5px; color: var(--iv-light); }

/* Two-way switch (spending as a share of income or dollars). */
.rp-seg { display: grid; gap: 4px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3px; border-radius: 12px; background: var(--iv-range-bg); }

.rp-seg-btn {
    padding: 6px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--iv-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.rp-seg-btn[aria-checked="true"] { background: var(--iv-range-pill); color: var(--iv-text); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }

/* Return presets. */
.rp-presets { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.rp-preset {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--iv-tile-border);
    border-radius: 11px;
    background: transparent;
    color: var(--iv-text);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.rp-preset:hover { border-color: var(--iv-border); }
.rp-preset.is-selected { border-color: var(--iv-green); background: var(--iv-green-soft); }
.rp-preset-label { font-size: 12.5px; font-weight: 700; }
.rp-preset-detail { max-width: 100%; overflow: hidden; font-size: 10.5px; color: var(--iv-muted); text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 576px) and (max-width: 1199.98px) {
    .rp-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* The rough Social Security estimate. */
.rp-estimate { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border: 1px dashed var(--iv-border); border-radius: 12px; }
.rp-estimate-btn { min-height: 32px; padding: 4px 12px; font-size: 12.5px; }
.rp-estimate .rp-hint { flex: 1 1 160px; }
.rp-callout { margin: 0; }

/* Accounts by tax bucket. */
.rp-bucket { display: flex; flex-direction: column; gap: 4px; }
.rp-bucket + .rp-bucket { margin-top: 8px; }

.rp-bucket-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "dot label total"
        ". hint hint";
    align-items: center;
    column-gap: 8px;
}

.rp-bucket-dot { grid-area: dot; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--rp-mix, var(--iv-light)); }
.rp-bucket-label { grid-area: label; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--iv-text); }
.rp-bucket-hint { grid-area: hint; font-size: 11px; color: var(--iv-muted); }
.rp-bucket-total { grid-area: total; font-size: 12.5px; font-weight: 700; color: var(--iv-text); }
.rp-accounts { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }

.rp-account {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 11px;
    transition: background-color .15s ease;
}

.rp-account:hover { background: var(--iv-row-hover); }
.rp-account.is-excluded .rp-account-text,
.rp-account.is-excluded .rp-account-balance { opacity: .55; }
.rp-account.is-excluded .rp-account-balance { text-decoration: line-through; }
.rpl-switch-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rpl-switch { display: flex; align-items: flex-start; gap: 10px; min-width: 0; margin: 0; cursor: pointer; }

.rpl-switch-track {
    position: relative;
    flex: 0 0 auto;
    width: 32px;
    height: 18px;
    margin-top: 1px;
    border: 1px solid var(--iv-tile-border);
    border-radius: 9px;
    background: var(--iv-track);
    transition: background-color .15s ease, border-color .15s ease;
}

.rpl-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--rp-thumb);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .3);
    transition: transform .18s ease;
}

.rpl-switch-input:checked + .rpl-switch .rpl-switch-track { border-color: var(--iv-green); background: var(--iv-green); }
.rpl-switch-input:checked + .rpl-switch .rpl-switch-thumb { background: #FFFFFF; transform: translateX(14px); }
.rpl-switch-input:focus-visible + .rpl-switch .rpl-switch-track { outline: 2px solid var(--iv-focus); outline-offset: 2px; }
.rp-account-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-account-name { overflow: hidden; font-size: 13px; font-weight: 600; color: var(--iv-text); text-overflow: ellipsis; white-space: nowrap; }
.rp-account-mask { margin-left: .25rem; font-weight: 500; color: var(--iv-light); }
.rp-account-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: 11px; color: var(--iv-muted); }
.rp-account-balance { font-size: 13px; font-weight: 700; color: var(--iv-text); white-space: nowrap; }

/* Bucket colors (the account dots, the tax-mix bar and legend). */
.rp-mix-taxdeferred { --rp-mix: var(--rp-bucket-taxdeferred); }
.rp-mix-roth { --rp-mix: var(--rp-bucket-roth); }
.rp-mix-taxable { --rp-mix: var(--rp-bucket-taxable); }
.rp-mix-hsa { --rp-mix: var(--rp-bucket-hsa); }
.rp-mix-education { --rp-mix: var(--rp-bucket-education); }
.rp-mix-cash { --rp-mix: var(--rp-bucket-cash); }
.rp-mix-other { --rp-mix: var(--rp-bucket-other); }
.rp-mix-outside { --rp-mix: var(--rp-bucket-outside); }

/* ------------------------------------------------------------------ Readiness (the answer) */

.rc-card.rp-hero {
    --rp-tone: var(--iv-green);
    --rp-tone-soft: var(--iv-green-soft);
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-color: var(--iv-border);
    background: var(--iv-hero-bg);
}

.rc-card.rp-hero.rp-tone-good { --rp-tone: var(--iv-positive); --rp-tone-soft: var(--iv-positive-soft); }
.rc-card.rp-hero.rp-tone-watch { --rp-tone: var(--iv-caution); --rp-tone-soft: var(--iv-caution-soft); }
.rc-card.rp-hero.rp-tone-act { --rp-tone: var(--iv-negative); --rp-tone-soft: var(--iv-negative-soft); }

.rp-hero-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 8px; }
.rp-eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--iv-green); }
.rp-hero-main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 22px; }
.rp-ring { position: relative; flex: 0 0 auto; width: 156px; height: 156px; }
.rp-ring svg { display: block; width: 100%; height: 100%; }
.rp-ring-track { fill: none; stroke: var(--iv-track); stroke-width: 10; }

.rp-ring-fill {
    fill: none;
    stroke: var(--rp-tone);
    stroke-width: 10;
    stroke-linecap: round;
    filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--rp-tone) 35%, transparent));
    transition: stroke-dashoffset .7s cubic-bezier(.2, .8, .2, 1), stroke .3s ease;
}

.rp-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.rp-ring-value { font-family: var(--tx-font); font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--iv-text); }
.rp-ring-caption { margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--iv-muted); }
.rp-hero-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.iv-pill.rp-hero-badge { --iv-tone: var(--rp-tone); --iv-tone-soft: var(--rp-tone-soft); align-self: flex-start; padding: 3px 9px; font-size: 11px; }
.rp-headline { margin: 0; font-family: var(--tx-font); font-size: clamp(18px, 1.1vw + 12px, 24px); font-weight: 600; line-height: 1.25; color: var(--iv-text); }
.rp-hero-detail { margin: 0; font-size: 13px; line-height: 1.45; color: var(--iv-muted); }
.rp-hero-timing { display: flex; align-items: baseline; gap: .4rem; margin: 0; font-size: 12px; line-height: 1.4; color: var(--iv-muted); }
.rp-hero-timing .tx-glyph { color: var(--iv-green); }
.rp-tiles { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.rp-tiles .iv-stat { background: var(--iv-tiles-bg); }
.rp-tiles .iv-stat-note { overflow-wrap: anywhere; }
.rp-hero .rp-tiles,
.rp-hero .rp-hero-copy { transition: opacity .15s ease; }
.rp-hero.is-updating .rp-tiles,
.rp-hero.is-updating .rp-hero-copy { opacity: .7; }

/* What-if chips. */
.rp-whatifs { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--iv-tile-border); }
.rp-whatifs-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: 10px; }
.rp-whatifs-title { display: inline-flex; align-items: center; gap: .4rem; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--iv-text); }
.rp-whatifs-title .tx-glyph { color: var(--iv-caution); }
.rp-whatifs-hint { font-size: 11.5px; color: var(--iv-muted); }
.rp-whatif-applied { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: 12px; font-weight: 600; color: var(--iv-green); }
.rp-whatif-chips { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

.rp-whatif {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--iv-tile-border);
    border-radius: 14px;
    background: var(--iv-tiles-bg);
    color: var(--iv-text);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.rp-whatif:hover { border-color: var(--iv-green); box-shadow: 0 6px 18px color-mix(in srgb, var(--iv-green) 14%, transparent); transform: translateY(-1px); }
.rp-whatif:active { transform: scale(.99); }

.rp-whatif-glyph {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--iv-icon-bg);
    color: var(--iv-icon);
    font-size: 13px;
}

.rp-whatif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-whatif-label { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.rp-whatif-figures { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem; }
.rp-whatif-value { font-family: var(--tx-font); font-size: 16px; font-weight: 700; }
.rp-whatif.iv-tone-positive .rp-whatif-value { color: var(--iv-positive); }
.rp-whatif-delta { padding: 1px 6px; border-radius: 6px; background: var(--iv-neutral-soft); color: var(--iv-muted); font-size: 11px; font-weight: 700; }
.rp-delta-positive { background: var(--iv-positive-soft); color: var(--iv-positive); }
.rp-delta-negative { background: var(--iv-negative-soft); color: var(--iv-negative); }

@media (max-width: 1399.98px) {
    .rp-whatif-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .rp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .rc-card.rp-hero { padding: 14px; }
    .rp-hero-main { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; text-align: center; }
    .iv-pill.rp-hero-badge { align-self: center; }
    .rp-hero-timing { justify-content: center; }
    .rp-ring { width: 136px; height: 136px; }
    .rp-ring-value { font-size: 30px; }
    .rp-tiles .iv-stat-chip { display: none; }
    .rp-tiles .iv-stat { padding: 9px 10px; }
    .rp-whatif-chips { grid-template-columns: minmax(0, 1fr); }
    .rp-field-grid { gap: 10px; }
}

@media (max-width: 379.98px) {
    .rp-field-grid { grid-template-columns: minmax(0, 1fr); }
    .rp-tiles .iv-stat-value { font-size: 15px; }
}

/* ------------------------------------------------------------------ Charts */

.rp-chart { position: relative; min-width: 0; min-height: 200px; transition: opacity .15s ease; }
.rp-chart.is-updating { opacity: .7; }

.rp-chart-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 200px;
    padding: 1rem;
    border-radius: 12px;
    background: var(--iv-neutral-soft);
    color: var(--iv-muted);
    font-size: 12.5px;
    text-align: center;
}

.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -2px 0 8px; padding: 0; list-style: none; font-size: 11.5px; color: var(--iv-muted); }
.rp-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.rp-swatch { display: inline-block; width: 16px; height: 10px; border-radius: 3px; }
.rp-swatch-line { height: 3px; border-radius: 2px; background: var(--iv-green); }
.rp-swatch-median { height: 3px; border-radius: 2px; background: var(--iv-accent); }
.rp-swatch-band { background: color-mix(in srgb, var(--iv-green) 24%, transparent); }
.rp-swatch-target { height: 0; border-top: 2px dashed var(--iv-caution); border-radius: 0; }
.rp-swatch-retired { border: 1px dashed color-mix(in srgb, var(--iv-green) 60%, transparent); background: color-mix(in srgb, var(--iv-green) 10%, transparent); }
.rp-swatch-contrib { background: color-mix(in srgb, var(--iv-slice-2) 60%, transparent); }
.rp-swatch-growth { background: color-mix(in srgb, var(--iv-green) 55%, transparent); }
.rp-empty-note { margin: 0; padding: 1.5rem 1rem; color: var(--iv-muted); font-size: 12.5px; text-align: center; }

/* ------------------------------------------------------------------ Next steps */

.rp-steps { margin: 0; padding: 0; list-style: none; }
.rc-task-btn.rp-step-try { border-color: color-mix(in srgb, var(--iv-green) 45%, transparent); color: var(--iv-green); }
.rc-task-btn.rp-step-try:hover:not(:disabled),
.rc-task-btn.rp-step-try:focus-visible { border-color: var(--iv-green); background: var(--iv-green-soft); color: var(--iv-green); }
.rp-steps-card .rc-task-btn-view:hover { border-color: var(--iv-green); color: var(--iv-green); }

/* ------------------------------------------------------------------ Savings benchmarks */

.rp-bench-list { display: flex; flex-direction: column; gap: 14px; }
.rp-bench { --rp-who: var(--iv-you); }
.rp-bench-partner { --rp-who: var(--iv-partner); }
.rp-bench-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: 6px; }
.rp-bench-who { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; font-size: 13px; font-weight: 700; color: var(--iv-text); }
.rp-bench-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rp-who); }
.rp-bench-age { font-size: 11px; font-weight: 600; color: var(--iv-muted); }
.rp-bench-value { font-family: var(--tx-font); font-size: 15px; font-weight: 700; color: var(--iv-tone, var(--iv-text)); white-space: nowrap; }
.rp-bench.iv-tone-neutral .rp-bench-value { color: var(--iv-muted); }
.rp-bench-track { position: relative; height: 10px; border-radius: 5px; background: var(--iv-track); }

.rp-bench-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--rp-who) 55%, transparent), var(--rp-who));
    transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.rp-bench-marker { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--iv-text); opacity: .75; }
.rp-bench-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 6px; font-size: 11.5px; color: var(--iv-muted); }
.rp-bench-status { font-weight: 700; color: var(--iv-tone, var(--iv-muted)); }
.rp-bench.iv-tone-neutral .rp-bench-status { color: var(--iv-muted); }
.rp-ladder { display: grid; gap: 4px; grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: 16px; }

.rp-ladder-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 2px;
    border-radius: 9px;
    background: var(--iv-neutral-soft);
    color: var(--iv-muted);
    font-size: 10.5px;
}

.rp-ladder-x { font-size: 12px; font-weight: 700; color: var(--iv-text); }
.rp-ladder-step.is-you { box-shadow: inset 0 0 0 2px var(--iv-you); }
.rp-ladder-step.is-partner { box-shadow: inset 0 -3px 0 var(--iv-partner); }
.rp-ladder-step.is-you.is-partner { box-shadow: inset 0 0 0 2px var(--iv-you), inset 0 -5px 0 var(--iv-partner); }

@media (max-width: 419.98px) {
    .rp-ladder { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ Tax mix */

.rp-mix-bar { display: flex; gap: 2px; height: 16px; overflow: hidden; border-radius: 8px; background: var(--iv-track); }
.rp-mix-seg { display: block; min-width: 3px; height: 100%; background: var(--rp-mix, var(--iv-light)); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.rp-mix-legend { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; padding: 0; list-style: none; }
.rp-mix-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.rp-mix-text { display: flex; flex-direction: column; min-width: 0; }
.rp-mix-label { font-size: 13px; font-weight: 600; color: var(--iv-text); }
.rp-mix-hint { font-size: 11px; color: var(--iv-muted); }
.rp-mix-figures { display: flex; flex-direction: column; align-items: flex-end; }
.rp-mix-amount { font-size: 13px; font-weight: 700; color: var(--iv-text); white-space: nowrap; }
.rp-mix-share { font-size: 11px; color: var(--iv-muted); }

/* ------------------------------------------------------------------ Where the numbers come from, disclaimer */

.rtp-sources { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rtp-source { display: flex; align-items: flex-start; gap: 10px; min-width: 0; text-align: left; color: var(--iv-text); font-size: 12.5px; line-height: 1.45; }

.rtp-source > span:last-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.rtp-source-glyph {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--iv-icon-bg);
    color: var(--iv-icon);
    font-size: 11px;
}

.rtp-source.iv-tone-caution { padding: 8px 10px; border-radius: 10px; background: var(--iv-caution-soft); }
.rtp-source.iv-tone-caution .rtp-source-glyph { background: transparent; color: var(--iv-caution); }

.rp-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 0;
    padding: 12px 14px;
    border: 1px dashed var(--iv-tile-border);
    border-radius: 14px;
    color: var(--iv-muted);
    font-size: 12px;
    line-height: 1.45;
}

.rp-disclaimer .tx-glyph { margin-top: 2px; color: var(--iv-green); }

/* ------------------------------------------------------------------ Reduced motion */

@media (prefers-reduced-motion: reduce) {
    .rp-ring-fill,
    .rp-bench-fill,
    .rp-mix-seg,
    .rp-whatif,
    .rp-section-caret,
    .rpl-switch-thumb,
    .rpl-switch-track,
    .rp-chart,
    .rp-hero .rp-tiles,
    .rp-hero .rp-hero-copy { transition: none; }
    .rp-whatif:hover { transform: none; }
    .rp-range::-webkit-slider-thumb { transition: none; }
}
