/* Charitable Stretch calculator (Pages/CharitableStretch). It uses the Roth Conversion calculator's panel classes
   (rc-* in RothConversion.css); this file adds the heir cards, the two disclosures, the Monte Carlo averages and the
   family table. Option colors come from the same validated categorical order. */

/* ---------------------------------------------------------------- Heir cards (right panel) */

.cs-heirs-sub {
    font-size: 0.72rem;
    color: #5c6d82;
    line-height: 1.3;
}

.cs-heir-share {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: #3d4a5c;
}

.cs-heir-line {
    font-size: 0.72rem;
    color: #5c6d82;
    line-height: 1.35;
}

.cs-heir-best {
    font-weight: 600;
    color: #181c32;
}

/* ---------------------------------------------------------------- Comparison */

.cs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.4rem;
    margin: 0 0 0.7rem;
}

.cs-chips > span {
    font-size: 0.72rem;
    color: #3d4a5c;
    background: #f1f5f9;
    border: 1px solid #e4e8f0;
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
}

.cs-tiles {
    margin-bottom: 0.75rem;
}

.rc-table tr.cs-row-baseline > td {
    background: #f7f8fa;
}

.rc-table tr.cs-row-unavailable > td {
    color: #6b7a8f;
}

.rc-table td.cs-unavailable,
.rc-table td.cs-note-cell {
    white-space: normal;
}

.rc-table td.cs-unavailable {
    font-style: italic;
}

.rc-table td.cs-note-cell {
    min-width: 11rem;
    color: #3d4a5c;
}

/* ---------------------------------------------------------------- Monte Carlo */

.cs-measure-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.7rem;
}

/* The average: a hollow dot on the range, drawn over the median line. */
.cs-range-mean,
.cs-range-key-mean {
    width: 10px;
    height: 10px;
    border: 2px solid #181c32;
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
}

.cs-range-mean {
    position: absolute;
    top: 4px;
    margin-left: -5px;
}

.cs-range-key-mean {
    display: inline-block;
    margin-right: 0.35rem;
    vertical-align: -1px;
}

/* The 10-year rule is the yardstick: grey instead of the option blue. */
.cs-range-baseline .rc-range-box {
    border-color: #8a93a3;
    background: rgba(138, 147, 163, 0.14);
}

/* ---------------------------------------------------------------- Year by year */

.cs-option-picker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    margin: 0 0 0.6rem;
}

.cs-option-picker label {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #3d4a5c;
}

.cs-option-picker select {
    min-width: 18rem;
    max-width: 100%;
}

/* ---------------------------------------------------------------- Each child decides */

.cs-family-table td {
    vertical-align: middle;
}

.cs-family-table .cs-col-input {
    width: 7rem;
    min-width: 7rem;
}

.cs-family-table .cs-col-select {
    min-width: 12rem;
}

.cs-family-table .cs-col-select select {
    width: 100%;
    font-size: 0.75rem;
}

/* ---------------------------------------------------------------- Disclosures */

.cs-disclosure {
    margin: 0.25rem 0 0.8rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #181c32;
    white-space: normal;
    border: 1px solid;
    border-left-width: 5px;
    border-radius: 10px;
}

.cs-disclosure p {
    margin: 0.35rem 0 0.4rem;
}

.cs-disclosure ul {
    padding-left: 1.1rem;
    margin: 0.2rem 0 0.4rem;
}

.cs-disclosure li {
    margin-bottom: 0.25rem;
}

.cs-disclosure-title {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.35;
}

.cs-disclosure--legal {
    background: #fff8ec;
    border-color: #f7d9a8;
    border-left-color: #b45309;
}

.cs-disclosure--legal .cs-disclosure-title .bi {
    color: #b45309;
}

.cs-disclosure--risk {
    background: #fef3f2;
    border-color: #f4c7c3;
    border-left-color: #b42318;
}

.cs-disclosure--risk .cs-disclosure-title .bi {
    color: #b42318;
}

.cs-ack {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.35rem 0 0;
    font-weight: 600;
    cursor: pointer;
}

.cs-ack input {
    flex: 0 0 auto;
    margin-top: 0.2rem;
}

.cs-disclosure-foot {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #5c6d82;
}

/* ---------------------------------------------------------------- Assumptions */

.cs-rate-chip {
    display: inline-block;
    margin: 0 0.25rem 0.2rem 0;
    padding: 0 0.45rem;
    font-size: 0.72rem;
    color: #3d4a5c;
    background: #f1f5f9;
    border: 1px solid #e4e8f0;
    border-radius: 999px;
}

/* ---------------------------------------------------------------- Small adjustments to the shared rc-* pieces */

.cs-measure-toggle .ev-btn {
    font-size: 0.8125rem;
    padding: 0.2rem 0.75rem;
}

/* The ranges are not clickable here (the Roth calculator's are). */
.cs-ranges .rc-range-row,
.cs-ranges .rc-range-row:hover {
    cursor: default;
    background: transparent;
}

.cs-compare-table thead th[rowspan] {
    vertical-align: bottom;
}

.cs-compare-table thead th.cs-group {
    border-bottom: 1px solid #c9ced8;
}

.cs-family-table .ev-btn.cs-heir-link {
    width: auto;
    font-size: inherit;
    font-weight: 600;
}

/* Long option names wrap so every column stays on screen at laptop widths. */
.rc-table.cs-compare-table td:first-child,
.rc-table.cs-mc-table td:first-child {
    white-space: normal;
    min-width: 10rem;
}

.rc-table.cs-compare-table td.cs-wrap {
    white-space: normal;
}

/* The shared wrap-head minimum (4.5rem a column) is too wide for these nine- and seven-column tables. */
.rc-table.rc-table--wrap-head.cs-compare-table th,
.rc-table.rc-table--wrap-head.cs-family-table th {
    min-width: 4rem;
}

/* ---------------------------------------------------------------- Monte Carlo portfolio */

/* The mix under Portfolio: the Roth Conversion calculator's stocks and bonds bar, one row across the panel. */
.cs-mix {
    margin: 0.1rem 0 0.2rem;
}

.cs-mix .cs-mix-bar {
    height: 9px;
    margin: 0.2rem 0 0.15rem;
}

.cs-mix .rc-alloc-legend {
    font-size: 0.68rem;
}

/* Word choices (Simple / Advanced) on one line in the switch. */
.rc-assumptions .cs-switch-words span {
    padding-left: 4px;
    padding-right: 4px;
    white-space: nowrap;
}

.rc-assumptions .cs-mc-note > div + div {
    margin-top: 0.2rem;
}

.rc-assumptions input.cs-total-off {
    color: #b42318;
    font-weight: 600;
}

/* ---------------------------------------------------------------- Who gets what (IRS, family, charity) */

/* Stacked bars on one scale: family, charity, then the IRS at the end; 2px gaps between segments, a rounded end,
   amounts inside only where they fit (the table carries every figure). Colors passed the palette validator
   (colorblind separation) and keep the Roth Conversion calculator's tax / family / charity hues. */
.cs-who-sub {
    margin-top: -0.2rem;
}

.cs-who-picker {
    margin: 0.2rem 0 0.5rem;
}

.cs-who-chart {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0.35rem 0 0.4rem;
}

.cs-who-row {
    display: grid;
    grid-template-columns: 10.5rem minmax(0, 1fr) 4.25rem;
    align-items: center;
    gap: 0.6rem;
}

.cs-who-label b {
    display: block;
    font-size: 0.8125rem;
    color: #181c32;
    line-height: 1.25;
}

.cs-who-label span {
    display: block;
    font-size: 0.72rem;
    color: #5c6d82;
    line-height: 1.25;
}

.cs-who-track {
    display: flex;
    gap: 2px;
    height: 24px;
}

.cs-who-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-width: 3px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.cs-who-seg:last-child {
    border-radius: 0 4px 4px 0;
}

.cs-who-seg--family { background: #157f5a; }
.cs-who-seg--charity { background: #4a3aa7; }
.cs-who-seg--tax { background: #c2410c; }

.cs-who-total {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #181c32;
    font-variant-numeric: tabular-nums;
}

.cs-who-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    margin: 0 0 0.55rem 11.1rem;
    font-size: 0.72rem;
    color: #3d4a5c;
}

.cs-who-key {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 0.35rem;
    border-radius: 2px;
    vertical-align: -1px;
}

.cs-who-table td {
    font-variant-numeric: tabular-nums;
}

/* "Before planning" over "10-year rule": two short lines, so the table fits beside both side panels. */
.cs-who-th-kicker {
    display: block;
    font-weight: 400;
    color: #5c6d82;
}

.rc-table.cs-who-table td:first-child {
    white-space: normal;
    min-width: 9rem;
}

.cs-who-callout {
    margin-top: 0.6rem;
}

@media (max-width: 700px) {
    .cs-who-row {
        grid-template-columns: minmax(0, 1fr) 3.75rem;
    }

    .cs-who-label {
        grid-column: 1 / -1;
    }

    .cs-who-legend {
        margin-left: 0;
    }
}

/* ---------------------------------------------------------------- Lower rates and time value tables */

.rc-table.cs-rates-table td:first-child,
.rc-table.cs-periods-table td:first-child {
    white-space: normal;
    min-width: 8.5rem;
}

.rc-table.rc-table--wrap-head.cs-rates-table th {
    min-width: 4rem;
}
