/* ============================================================
   Returns and Allocations box (returnsboxdesign direction C, Steve 2026-11-22: "Build C";
   .automation/planning/returnsboxdesign/ holds the mock-ups and NOTES.md).

   1. The summary card at the top of the box (js/app/contentboxes/portfolioreturns/ui/returnsCard.js): what the accounts
      earn today and the mix the plan runs on, in the Allocations Planner's colours. The Health Care box's card look.
   2. The door cards: ONE look for every way out of the box (the Equity Returns Adjuster under Adjust over time, the
      Allocations Planner under Advanced), the look of the Retirement Spending box's "Check what your $8,500 covers".
      They replace two light-blue panels and three button styles.
   3. Inflation, Investment Returns and Portfolio Allocation fold to one line each under the card; the card replaces the "Combined Return",
      "Your investment accounts today" and "With cash" lines, which stay in the page for their painters.

   Colours only through the app's variables; text sizes only through the t- classes on the markup (no font-size here).
   ============================================================ */

/* ---------- 3. The box's own rows ---------- */
/* (Inflation % was a plain row with its section title hidden, .rtn-plain-section, until Steve folded it like the other
   two sections the same day.) */
.rtn-box.rtn-card-on #combined-return-container,
.rtn-box.rtn-card-on #household-return {
    display: none !important;
}

/* (Under the card the Inflation row sat 4px close while it was a plain row; as a fold it takes the folds' own air.) */

.rtn-ico {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- 2. Door cards ---------- */
.rtn-door {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 0 10px;
    padding: 10px 12px;
    border: 1px solid var(--ui-borders-borderDefault);
    border-radius: 10px;
    background: var(--color-white-1);
}

.rtn-door-pic {
    flex: 0 0 auto;
    display: inline-flex;
}

.rtn-door-pic:empty {
    display: none;
}

.rtn-door-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    letter-spacing: 0.2px;
}

.rtn-door-k,
.rtn-door-s {
    color: var(--ui-text-secondaryText);
}

.rtn-door-t {
    font-weight: 700;
    color: var(--ui-text-primaryText);
}

.rtn-door-go,
.rtn-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 2px;
    border: 0;
    background: none;
    font-weight: 600;
    color: var(--ui-text-linkText);
    white-space: nowrap;
    letter-spacing: 0.2px;
    cursor: pointer;
}

.rtn-door-go:hover,
.rtn-link:hover {
    text-decoration: underline;
}

.rtn-iconbtn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid var(--ui-borders-borderLight);
    border-radius: 8px;
    background: transparent;
    color: var(--ui-text-secondaryText);
    text-decoration: none;
    cursor: pointer;
}

.rtn-iconbtn:hover {
    color: var(--ui-text-primaryText);
    border-color: var(--ui-borders-borderDefault);
}

/* On a screen too small for the Dashboard tab the popup is the one way in, so its button carries the word. */
.rtn-iconbtn-word {
    display: none;
    font-weight: 600;
    color: var(--ui-text-linkText);
}

.rtn-iconbtn.is-only .rtn-iconbtn-word {
    display: inline;
}

.rtn-door-go:focus-visible,
.rtn-link:focus-visible,
.rtn-iconbtn:focus-visible {
    outline: 2px solid var(--ui-borders-borderFocus, var(--ui-text-linkText));
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------- 1. The summary card ---------- */
.rtn-card {
    margin: 2px 0 6px;
    padding: 14px 14px 12px;
    border: 1px solid rgba(var(--color-blue-7-rgb), 0.9);
    border-radius: 12px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--color-brand-light) 70%, var(--color-white-1)) 0%,
        var(--color-white-1) 72%);
    color: var(--ui-text-primaryText);
    letter-spacing: 0.2px;
}

.rtn-card:empty {
    display: none;
}

.rtn-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.rtn-fig {
    display: inline-flex;
    align-items: baseline;
}

.rtn-fig .t-figure {
    color: var(--ui-text-linkText);
}

.rtn-fig-u {
    margin-left: 1px;
    letter-spacing: 0;
}

.rtn-muted {
    color: var(--ui-text-secondaryText);
}

.rtn-chip {
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-gray-200) 60%, var(--color-white-1));
    color: var(--ui-text-secondaryText);
    font-weight: 600;
    white-space: nowrap;
}

.rtn-card-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    color: var(--ui-text-primaryText);
    font-weight: 600;
}

.rtn-card-ret {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: var(--ui-text-secondaryText);
}

.rtn-hr {
    height: 1px;
    margin: 11px 0 10px;
    background: var(--color-ui-card-divider);
}

.rtn-card-k {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--ui-text-primaryText);
}

.rtn-card-k b,
.rtn-tname b {
    font-weight: 600;
}

.rtn-card-cap {
    margin-top: 8px;
    color: var(--ui-text-secondaryText);
}

.rtn-card-cap b {
    color: var(--ui-text-primaryText);
    font-weight: 700;
}

.rtn-card-own {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 8px;
    color: var(--ui-text-secondaryText);
}

.rtn-card-own .rtn-link {
    padding: 0;
}

.rtn-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-top: 10px;
}

/* Equities bar: equities in the colour, bonds a tint of it (the Allocations Planner's type colours). */
.rtn-bar {
    position: relative;
    display: block;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--c, var(--color-blue-6)) 22%, var(--color-white-1));
}

.rtn-bar > i {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--c, var(--color-blue-6));
}

.rtn-bar.is-empty {
    background: var(--color-ui-card-divider);
}

/* One row per account type: name and money | equities bar | equities %. */
.rtn-types {
    display: grid;
    grid-template-columns: minmax(96px, 30%) minmax(0, 1fr) 42px;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
}

.rtn-tname {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--ui-text-primaryText);
}

.rtn-tname > span {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.rtn-tsub {
    color: var(--ui-text-secondaryText);
}

.rtn-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c, var(--color-blue-6));
}

.rtn-tpct {
    text-align: right;
    font-weight: 700;
    color: var(--ui-text-primaryText);
}

/* Small charts (the Allocations Planner's mini chart look). */
.rtn-spark {
    display: block;
    flex: 0 0 auto;
    overflow: visible;
}

.rtn-spark line,
.rtn-spark path {
    vector-effect: non-scaling-stroke;
}

.rtn-spark-base {
    stroke: var(--color-ui-card-divider);
    stroke-width: 1;
}

.rtn-spark-ret {
    stroke: var(--color-slate-7);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.rtn-spark-area {
    fill: rgba(var(--color-blue-6-rgb), 0.14);
    stroke: none;
}

.rtn-spark-line {
    fill: none;
    stroke: var(--color-blue-6);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* The glide path across the card's width, its two ends labelled and the ages under it. */
.rtn-glide {
    position: relative;
    padding-bottom: 16px;
}

.rtn-glide .rtn-spark {
    width: 100%;
    height: 62px;
}

.rtn-glide-v {
    position: absolute;
    font-weight: 700;
    color: var(--ui-text-linkText);
}

.rtn-glide-ax {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 14px;
    color: var(--ui-text-secondaryText);
}

.rtn-glide-ax > span {
    position: absolute;
    top: 0;
}

.rtn-glide-ax > span:first-child {
    left: 0;
}

.rtn-glide-ax > span:not(:first-child):not(:last-child) {
    transform: translateX(-50%);
}

.rtn-glide-ax > span:last-child {
    right: 0;
}

/* ---------- 4. The box's choices (Steve 2026-11-22: every toggle in the box the light grey and white style) ----------
   Fixed Returns | Adjust Over Time, One rate | By age (Bonds, Inflation; inflationbondsadjusters) and Fixed Mix | Advanced
   are the light SegmentedControl, one compact size, at the end of their row under the rate or mix they set. The slate
   pills' radios stay in the page as hidden storage. Sized on the control itself: the box's manual-controls reset sets
   every div's display back to '' (portfolioReturnsUIFactory.js updateVisibility). */
.seg-control.rtn-seg {
    flex: none;
    width: 270px;
    max-width: 100%;
    margin-left: auto;
}

.allocation-mode-choice {
    margin-bottom: 4px;
}

/* ---------- 5. One soft band per rate (Steve 2026-11-22: option 4 of the toggle mock-ups, "Option 4, the band";
   returnsboxdesign/toggles/) ----------
   A choice between two rows did not say whose it was. Each rate (Inflation, stocks, bonds) now sits in one light band
   with its choice: the slider row (One rate / Fixed Returns) or its By age card, then the choice at the band's bottom
   right. Rows without a choice (fees, the mix sliders) and Fixed Mix | Advanced stay plain. Markup: rateCurveRows.js
   (#inflation-band, #bonds-band) and the factory (#equities-band). */
.rtn-band {
    margin: 4px -6px 12px;
    padding: 2px 10px 10px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-gray-100) 75%, var(--color-white-1));
}

/* The row inside sits tight on its choice. */
.rtn-box .rtn-band .slider-tap {
    min-height: 42px;
    padding-bottom: 0;
}

/* The By age card is the band's content: no outline or fill of its own inside it. */
.rtn-band .rtn-door.rtn-band-door {
    margin: 0;
    padding: 10px 0 6px;
    border: 0;
    border-radius: 0;
    background: none;
}

.rtn-band .rate-byage-row,
.rtn-band #equities-return-method-row {
    margin: 2px 0 0;
}

/* The choice's track darker than the band, so it reads as a control (Steve 2026-11-22: the mock's gray-200 70% with
   white was 1.08:1 against the band, "a bit too close"): a touch of gray-300, 1.23:1 light / 1.31:1 dark. */
.rtn-band .seg-control.rtn-seg {
    background: color-mix(in srgb, var(--color-gray-300) 40%, var(--color-gray-200));
}
