/* Withdrawals hub, Stage 1 (2026-11-19). Colours only from the master colour variables; sizes from the text tokens.
   One head (#wd-hub-head: title, sub-tab row, overview strip) drawn by js/app/withdrawals/withdrawalsHub.js and
   re-parented into whichever of the hub's two containers is on screen. Left-justified (PRD D-5). */

/* ---- the head ---------------------------------------------------------------------------------------------- */
/* Pinned from the sub-tab row down: `top` is set by the hub to minus the row's offset, so the title scrolls
   away and the row and the strip stay. The page background hides what scrolls under it. */
.wd-hub-head {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--ui-backgrounds-pageBg);
    letter-spacing: normal;
    padding-top: 20px;
    margin-bottom: 14px;
    box-sizing: border-box;
}
/* On "Your plan" the head sits in the tab itself, so it takes the planner page's own gutters and width cap
   (.wp-page: 34px sides inside --page-content-max-width). In the Optimize tab the scroller supplies both. */
.wd-hub-head--plan {
    margin-left: 34px;
    margin-right: 34px;
    max-width: calc(var(--page-content-max-width, 1700px) - 68px);
    margin-bottom: 0;
}
.wd-hub-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
}
.wd-hub-title h1 {
    margin: 0;
    color: var(--ui-text-primaryText);
}
.wd-hub-sub {
    margin: 0;
    color: var(--ui-text-secondaryText);
}

/* ---- the sub-tab row (the same #optimize-subtab-nav element the Optimize tab always had) ---------------- */
/* Tabs B (2026-11-20, a friendlier page, .automation/planning/rothpagefriendlier/): each tab is an icon, the page's
   name (16px bold) and a second line that is the plan's own ("Cash first, then Balanced", "$7,000 a year, 2 limits",
   the Optimizer's status chip). The open tab is a white tab joined to the strip under it. When the head is pinned
   (.wd-hub-head--compact, further down) the second line folds away and the tab is one line. The right end of the
   row is kept clear (--wd-pill-room) for the strip's dollars pill, which is drawn there when the head is wide or
   pinned (.wd-ov-dollars below). */
.wd-hub-head .wd-hub-nav {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin: 10px 0 0;
    border-bottom: 1px solid var(--ui-borders-borderDefault);
    position: static;
    padding-right: var(--wd-pill-room, 236px);
}
.wd-hub-head .wd-hub-nav .optimize-subtab {
    flex: 0 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: 22px minmax(0, auto);
    column-gap: 10px;
    row-gap: 1px;
    align-items: center;
    text-align: left;
    padding: 8px 18px 7px 14px;
    margin-bottom: -1px;
    background: transparent;
    border: 0;
    border-bottom: 4px solid transparent;
    border-radius: 10px 10px 0 0;
    color: var(--ui-text-secondaryText);
    font-size: var(--text-small, 14px);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.wd-hub-tab-ico { grid-row: 1 / span 2; width: 22px; height: 22px; align-self: center; flex: none; }
.wd-hub-tab-label {
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ui-text-primaryText);
    overflow: hidden;
    text-overflow: ellipsis;
}
.wd-hub-tab-sub {
    grid-column: 2;
    min-width: 0;
    max-width: 34ch;
    font-size: var(--text-small, 14px);
    font-weight: 400;
    line-height: 1.3;
    color: var(--ui-text-secondaryText);
    overflow: hidden;
    text-overflow: ellipsis;
}
.wd-hub-tab-sub--chip { display: flex; overflow: visible; }
.wd-hub-head .wd-hub-nav .optimize-subtab:hover .wd-hub-tab-label { color: var(--ui-text-linkText); }
.wd-hub-head .wd-hub-nav .optimize-subtab.active {
    color: var(--ui-text-linkText);
    border-bottom-color: var(--ui-text-linkText);
    background: var(--ui-backgrounds-cardBg);
    box-shadow: inset 0 0 0 1px var(--ui-borders-borderLight);
}
.wd-hub-head .wd-hub-nav .optimize-subtab.active .wd-hub-tab-label { color: var(--ui-text-linkText); }
.wd-hub-head .wd-hub-nav .optimize-subtab:focus-visible {
    outline: 2px solid var(--ui-borders-borderFocus);
    outline-offset: -2px;
}

/* ---- chips (status and change) ------------------------------------------------------------------------------ */
.wd-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: var(--text-xs, 12px);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid var(--ui-borders-borderLight);
    background: var(--ui-backgrounds-hoverBg);
    color: var(--ui-text-secondaryText);
}
/* Tones are mixed from the semantic colours and the theme's own text and card colours, so each pair holds its
   contrast in the light and the dark theme. */
.wd-chip--ok {
    border-color: color-mix(in srgb, var(--color-semantic-success) 35%, var(--ui-backgrounds-cardBg));
    background: color-mix(in srgb, var(--color-semantic-success) 12%, var(--ui-backgrounds-cardBg));
    color: color-mix(in srgb, var(--color-semantic-success) 55%, var(--ui-text-primaryText));
}
.wd-chip--warn {
    border-color: color-mix(in srgb, var(--color-semantic-warning) 40%, var(--ui-backgrounds-cardBg));
    background: color-mix(in srgb, var(--color-semantic-warning) 13%, var(--ui-backgrounds-cardBg));
    color: color-mix(in srgb, var(--color-semantic-warning) 50%, var(--ui-text-primaryText));
}

/* ---- the overview strip ---------------------------------------------------------------------------------- */
/* Strip B (2026-11-20, a friendlier page): outcomes first. Lifetime taxes and what is left are large (28px), each
   with its sub-line and its change in words; the three withdrawal rates sit on one small track under their name.
   The dollars pill is beside the sub-tabs when the head is wide, above the track when it is narrow. Links and the
   change line are a footer. Nothing was dropped: five figures, their sub-lines, the changes, the pill, the links. */
.wd-ov {
    background: var(--ui-backgrounds-cardBg);
    border: 1px solid var(--ui-borders-borderLight);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    padding: 11px 18px 10px;
    box-shadow: 0 4px 10px -8px rgba(var(--color-ui-shadow-rgb), 0.35);
}
.wd-ov:empty { display: none; }
/* The dollars pill: in the strip's own slot, drawn at the right end of the sub-tab row above the strip (the row
   keeps that room clear). A narrow head puts it back in the flow, above the rate track (the container rule below). */
.wd-ov { position: relative; }
/* 2026-11-21: the pill is the app's standard dollars pill (the slot carries .chart-controls-toolbar, so it takes a
   Dashboard chart's own rules: 35.6px high), centred on the 48px tab row and clear of the strip. */
.wd-ov-dollars { position: absolute; right: 0; bottom: 100%; margin-bottom: 6px; display: flex; align-items: center; }
.wd-ov-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(250px, 1.25fr);
    gap: 0 20px;
    align-items: stretch;
}
.wd-fig { display: flex; flex-direction: column; min-width: 0; }
.wd-fig-label { color: var(--ui-text-secondaryText); }
.wd-fig-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}
.wd-fig-value { color: var(--ui-text-primaryText); }
.wd-fig-sub { color: var(--ui-text-secondaryText); }
.wd-fig-chip { display: flex; min-width: 0; }
/* A change chip stays inside its figure's column: a long one ("lasted the whole plan before") wraps instead of
   running past the strip's edge on a narrow page (seen at 1100px, 2026-11-20). */
.wd-fig-chip .wd-chip { white-space: normal; border-radius: 10px; min-width: 0; }
/* The two large outcomes. */
.wd-out { gap: 3px; align-items: flex-start; }
.wd-out-label { display: flex; align-items: center; gap: 7px; }
.wd-out-ico { width: 18px; height: 18px; flex: none; }
.wd-out-value { font-size: 28px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.15; }
/* The withdrawal rates: one name, one track, three figures. */
.wd-ov-side { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wd-rate { min-width: 0; border-radius: 10px; padding: 9px 12px 10px; background: var(--ui-backgrounds-hoverBg); }
.wd-rate-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.wd-rate-title, .wd-rate-same { color: var(--ui-text-secondaryText); }
.wd-rate-track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-gray-400) 35%, transparent);
    margin: 12px 6px 9px;
}
.wd-rate-band { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--color-blue-6) 45%, transparent); }
.wd-rate-track .wd-dot {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    border: 2px solid var(--ui-backgrounds-hoverBg);
    box-sizing: border-box;
}
/* The small bars: one per retired year, bottom-aligned on a hairline; the typical year is a thin line across. */
.wd-rate-track.wd-rate-bars { display: flex; align-items: flex-end; gap: 1px; height: 24px; margin: 6px 0 7px; border-radius: 0; background: none; border-bottom: 1px solid color-mix(in srgb, var(--color-gray-400) 55%, transparent); }
.wd-rate-bar { flex: 1 1 0; min-width: 1px; min-height: 2px; border-radius: 1px 1px 0 0; background: color-mix(in srgb, var(--color-blue-6) 38%, transparent); }
.wd-rate-bar--first { background: var(--color-blue-6); }
.wd-rate-bar--highest { background: color-mix(in srgb, var(--color-slate-blue-1) 60%, var(--ui-text-primaryText)); }
.wd-rate-typical { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed var(--color-teal-3); pointer-events: none; }
.wd-dot--first { background: var(--color-blue-6); }
.wd-dot--typical { background: var(--color-teal-3); }
.wd-dot--highest { background: color-mix(in srgb, var(--color-slate-blue-1) 60%, var(--ui-text-primaryText)); }
.wd-rate-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wd-rate-fig .wd-fig-value { display: flex; align-items: center; font-size: var(--text-medium, 15px); font-weight: 700; }
.wd-rate-fig .wd-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.wd-rate-words { line-height: 1.35; color: var(--ui-text-secondaryText); }
.wd-rate-fig .wd-fig-sub { color: inherit; }
/* "First, age 62": the reader's "Age 62" follows a comma here. */
.wd-rate-fig[data-wd-fig="first"] .wd-fig-sub { text-transform: lowercase; }
/* Kept for a screen reader, not printed. */
.wd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wd-rate-fig .wd-fig-chip { margin-top: 3px; }
/* Under the figures: "Go back to my settings" on the left (only after an Optimizer result is used), the change line
   and "Undo my changes" on the right. The row is drawn only when it has something in it (2026-11-21: "Show the
   charts" is gone); the change line alone starts at the left edge, under the figures it is about. */
.wd-ov-under {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid var(--ui-borders-borderLight);
    color: var(--ui-text-secondaryText);
}
.wd-ov-links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
}
.wd-ov-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-left: auto;
}
.wd-ov-under > .wd-ov-foot:first-child { margin-left: 0; }
.wd-ov-ask { color: var(--ui-text-primaryText); }
.wd-ov-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ui-text-linkText);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.wd-ov-link:hover { text-decoration: underline; }
.wd-ov-btn {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--ui-borders-borderDefault);
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-primaryText);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.wd-ov-btn--go {
    border-color: var(--ui-text-linkText);
    background: var(--ui-text-linkText);
    color: var(--ui-backgrounds-cardBg);
}
.wd-ov-link:focus-visible,
.wd-ov-btn:focus-visible {
    outline: 2px solid var(--ui-borders-borderFocus);
    outline-offset: 2px;
}

/* ---- the pinned head, folded to one line (Stage 2; tabs B and strip B 2026-11-20) -------------------------- */
/* Set by the hub once the page has scrolled past what the fold frees. The bottom margin takes exactly the height
   the fold removed (--wd-hub-fold), so nothing under the head moves. The tabs lose their second line (the
   Optimizer's chip stays, beside its name); the strip is one line: "Lifetime taxes $3.35M | Left at 94 $15.74M |
   Withdrawal rate: first year 1.3% typical 0.6% highest 2.1%", with the dollars pill at the right end of the
   tab row. */
.wd-hub-head--compact { margin-bottom: calc(14px + var(--wd-hub-fold, 0px)); }
.wd-hub-head--plan.wd-hub-head--compact { margin-bottom: var(--wd-hub-fold, 0px); }
.wd-hub-head--compact .wd-hub-nav .optimize-subtab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom-width: 3px;
    background: transparent;
    box-shadow: none;
}
.wd-hub-head--compact .wd-hub-tab-sub:not(.wd-hub-tab-sub--chip) { display: none; }
.wd-hub-head--compact .wd-hub-tab-label { font-size: var(--text-medium, 15px); }
.wd-hub-head--compact .wd-hub-tab-ico { width: 18px; height: 18px; }
.wd-hub-head--compact .wd-ov-dollars { margin-bottom: 3px; }
.wd-hub-head--compact .wd-ov { padding: 5px 16px 6px; }
.wd-hub-head--compact .wd-ov-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; }
.wd-hub-head--compact .wd-ov-under,
.wd-hub-head--compact .wd-out .wd-fig-sub,
.wd-hub-head--compact .wd-fig-chip,
.wd-hub-head--compact .wd-out-ico,
.wd-hub-head--compact .wd-rate-track,
.wd-hub-head--compact .wd-rate-same,
.wd-hub-head--compact .wd-rate-fig .wd-dot,
.wd-hub-head--compact .wd-rate-sep,
.wd-hub-head--compact .wd-rate-fig .wd-fig-sub { display: none; }
.wd-hub-head--compact .wd-out {
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
    padding: 0 12px;
    border-left: 1px solid var(--ui-borders-borderLight);
    white-space: nowrap;
}
.wd-hub-head--compact .wd-out:first-child { padding-left: 0; border-left: 0; }
.wd-hub-head--compact .wd-out-label { font-size: var(--text-xs, 12px); }
.wd-hub-head--compact .wd-out-value { font-size: var(--text-medium, 15px); font-weight: 700; letter-spacing: 0; line-height: 1.5; }
.wd-hub-head--compact .wd-ov-side { display: contents; }
.wd-hub-head--compact .wd-rate {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 5px;
    padding: 0 0 0 12px;
    border-left: 1px solid var(--ui-borders-borderLight);
    border-radius: 0;
    background: none;
}
.wd-hub-head--compact .wd-rate-head { display: inline-flex; }
.wd-hub-head--compact .wd-rate-title { font-size: var(--text-xs, 12px); font-weight: 400; letter-spacing: 0; text-transform: none; }
.wd-hub-head--compact .wd-rate-title::after { content: ':'; }
.wd-hub-head--compact .wd-rate-figs { display: flex; flex-wrap: wrap; gap: 0 12px; }
.wd-hub-head--compact .wd-rate-fig { flex-direction: row-reverse; align-items: baseline; gap: 5px; white-space: nowrap; }
.wd-hub-head--compact .wd-rate-fig .wd-fig-label { font-size: 0; }
.wd-hub-head--compact .wd-rate-fig .wd-fig-label::before { content: attr(data-pin); font-size: var(--text-xs, 12px); }
.wd-hub-head--compact .wd-rate-fig .wd-fig-value { line-height: 1.5; }

/* A narrow page (the inputs column open on a small window): the head is the container, so the inputs column
   decides, not the window. */
.wd-hub-head { container-type: inline-size; container-name: wdhub; }
@container wdhub (max-width: 760px) {
    .wd-hub-sub { display: none; }
    .wd-hub-head .wd-hub-nav { gap: 2px; padding-right: 0; }
    .wd-hub-head:not(.wd-hub-head--compact) .wd-ov-dollars { position: static; margin-bottom: 0; }
    .wd-hub-head--compact .wd-hub-nav { padding-right: 132px; }
    .wd-hub-head .wd-hub-nav .optimize-subtab { padding: 9px 10px 8px 8px; column-gap: 7px; }
    .wd-hub-tab-label { font-size: var(--text-medium, 15px); }
    /* The strip: the two outcomes side by side, the pill and the rates under them. */
    .wd-ov-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 12px; }
    .wd-ov-side { grid-column: 1 / -1; }
    .wd-rate { max-width: 420px; }
    .wd-out-value { font-size: 24px; }
    .wd-ov-foot { margin-left: 0; }
    /* Pinned and narrow: no icons, the app's short labels, "Future | Today's". */
    .wd-hub-head--compact .wd-hub-nav .optimize-subtab { padding-left: 8px; padding-right: 8px; }
    .wd-hub-head--compact .wd-hub-tab-ico { display: none; }
    .wd-hub-head--compact .wd-out { padding: 0 8px; }
    .wd-hub-head--compact .wd-out:first-child { padding-left: 0; }
    .wd-hub-head--compact .wd-rate { padding-left: 8px; }
    .wd-hub-head--compact .wd-rate-figs { gap: 0 8px; }
    .wd-hub-head--compact .wd-out-label[data-short] .wd-out-name { display: none; }
    .wd-hub-head--compact .wd-out-label[data-short]::after { content: attr(data-short); }
    .wd-hub-head--compact .wd-rate-title[data-short] { font-size: 0; }
    .wd-hub-head--compact .wd-rate-title[data-short]::after { content: attr(data-short) ':'; font-size: var(--text-xs, 12px); }
    .wd-hub-head--compact .wd-rate-fig .wd-fig-label[data-short]::before { content: attr(data-short); }
    .wd-hub-head--compact .wd-ov-dollars .dollarmode-segment button[data-short] { font-size: 0; }
    .wd-hub-head--compact .wd-ov-dollars .dollarmode-segment button[data-short]::after { content: attr(data-short); font-size: var(--chart-control-font-size, 13px); }
}
@container wdhub (max-width: 560px) {
    /* Three tabs on a phone-width head: no icons. Each tab is as wide as its NAME, which stays whole; the second
       line takes that width and ends in "..." (it adds nothing to the tab's width: width 0, min-width 100%). */
    .wd-hub-head .wd-hub-nav .optimize-subtab { flex: 0 0 auto; grid-template-columns: minmax(0, auto); padding: 8px 8px 7px; }
    .wd-hub-tab-ico { display: none; }
    .wd-hub-tab-sub { grid-column: 1; font-size: var(--text-xs, 12px); width: 0; min-width: 100%; }
    .wd-hub-tab-label { font-size: var(--text-small, 14px); overflow: visible; }
    .wd-hub-tab-sub--chip .wd-chip { white-space: normal; border-radius: 10px; }
    .wd-hub-head--compact .wd-hub-nav .optimize-subtab { padding-left: 6px; padding-right: 6px; gap: 5px; }
    .wd-hub-head--compact .wd-hub-tab-sub--chip { display: none; }
}
@container wdhub (max-width: 400px) {
    .wd-ov-main { grid-template-columns: minmax(0, 1fr); }
    .wd-rate-figs { gap: 6px; }
}

/* ---- "Your plan" is a document-style page ------------------------------------------------------------------ */
/* The head sits in a slot at the top of #withdrawals-tab. The slot makes no box, so the head's sticky range is
   the whole tab, not the slot. The window is this page's scroller; the tab and .main-area clip sideways only
   here (never a scroll container of their own), or nothing inside them could pin against the window. Scoped to
   the hub being on and this tab being the one on screen. Sentinel: __tests__/withdrawals-hub/hub-nav.test.js
   ("the head pins from the sub-tab row down, on both scrollers"). */
#wd-hub-plan-slot { display: contents; }
html.wd-hub-on #withdrawals-tab.active { overflow-x: clip; overflow-y: visible; }
html.wd-hub-on .main-area:has(#withdrawals-tab.active) { overflow-x: clip !important; overflow-y: visible !important; }

/* The strip's Future / Today's dollars choice is the app's standard dollars pill, at its standard size (Steve
   2026-11-21: it was a size smaller here). No size rule of the hub's own: the slot is a .chart-controls-toolbar
   (withdrawalsOverview.js), so the pill reads css/styles2.css "Chart display toggles", as on a Dashboard chart. */

/* ---- The "Safety net floor" window (safetyNetFloorPopup.js): one row per cash account ----------------------- */
.snf-popup { color: var(--ui-text-primaryText); }
.snf-popup .snf-lead { margin: 0 0 12px; color: var(--ui-text-secondaryText); font-size: var(--text-small, 14px); }
.snf-scope { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: var(--text-small, 14px); }
.snf-scope-label { color: var(--ui-text-secondaryText); }
.snf-head, .snf-row, .snf-total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 150px;
    gap: 12px;
    align-items: center;
}
.snf-head {
    padding-bottom: 6px;
    color: var(--ui-text-secondaryText);
    font-size: var(--text-xs, 12px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.snf-head > :nth-child(n+2), .snf-bal, .snf-total > :nth-child(n+2) { text-align: right; }
.snf-row { padding: 10px 0; border-top: 1px solid var(--ui-borders-borderLight); }
.snf-acct { display: flex; flex-direction: column; min-width: 0; }
.snf-name { font-size: var(--text-medium, 15px); font-weight: 600; overflow-wrap: anywhere; }
.snf-owner { font-weight: 400; color: var(--ui-text-secondaryText); }
.snf-note:empty { display: none; }
.snf-bal { color: var(--ui-text-secondaryText); font-size: var(--text-small, 14px); }
.snf-min { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.snf-sym { color: var(--ui-text-secondaryText); font-size: var(--text-small, 14px); }
.snf-input {
    width: 120px;
    padding: 6px 8px;
    border: 1px solid var(--ui-borders-borderDefault);
    border-radius: 6px;
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-primaryText);
    font-size: var(--text-medium, 15px);
    text-align: right;
}
.snf-input:focus-visible { outline: 2px solid var(--ui-text-linkText); outline-offset: 1px; }
.snf-total {
    padding: 12px 0 4px;
    border-top: 2px solid var(--ui-borders-borderDefault);
    font-size: var(--text-medium, 15px);
    font-weight: 700;
}
.snf-total > :nth-child(2) { font-weight: 400; color: var(--ui-text-secondaryText); font-size: var(--text-small, 14px); }
.snf-warn { margin-top: 8px; color: color-mix(in srgb, var(--color-semantic-warning) 70%, var(--ui-text-primaryText)); }
.snf-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--ui-borders-borderLight);
}
.snf-link { color: var(--ui-text-linkText); font-weight: 600; text-decoration: none; font-size: var(--text-small, 14px); }
.snf-link:hover { text-decoration: underline; }
.snf-actions { display: flex; gap: 10px; }
@media (max-width: 560px) {
    .snf-head, .snf-row, .snf-total { grid-template-columns: minmax(0, 1fr) 110px; }
    .snf-head > :nth-child(2), .snf-bal, .snf-total > :nth-child(2) { display: none; }
    .snf-input { width: 96px; }
}

/* ---- Tabs, one line each (Steve 2026-11-21) --------------------------------------------------------------- */
/* A tab is its icon and its name, all three the same height; the Optimizer's status chip sits beside its name.
   The second line of plan text is gone from the tabs (it was cut off and made the first tab much wider); what the
   plan is set to is the strip's "Your settings" line. These rules follow the tabs-B block above and win over it. */
.wd-hub-head .wd-hub-nav { align-items: stretch; gap: 4px; }
.wd-hub-head .wd-hub-nav .optimize-subtab {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 20px 10px 16px;
    flex: 0 0 auto;
}
.wd-hub-head .wd-hub-tab-label { overflow: visible; }
.wd-hub-head .wd-hub-tab-sub--chip { display: inline-flex; align-items: center; max-width: none; }
.wd-hub-head--compact .wd-hub-nav .optimize-subtab { padding: 8px 14px; gap: 8px; }
.wd-ov-sent { margin: 0 0 12px; color: var(--ui-text-secondaryText); line-height: 1.5; }
.wd-ov-sent b { font-weight: 600; color: var(--ui-text-primaryText); }
.wd-ov-sent-lead { font-weight: 600; }
.wd-hub-head--compact .wd-ov-sent { display: none; }
/* 2026-11-22 (Steve: "The Withdrawal Rate bars are too short. Perhaps this text 'Your settings: ...' could be in a box
   to the left of the Withdrawal Rate graph (so the text will wrap sooner) and this would allow the graph to be
   taller."): the sentence is the first item of the figures' grid, a soft box (the rates' own) over the two outcomes;
   the rates' box spans both rows, and its bars take the height that frees (at least 56px; 24px before). The pinned
   one-line head is unchanged (the sentence folds away, the grid is its flex row). */
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent {
    grid-template-areas: "sent sent side" "taxes left side";
    row-gap: 12px;
}
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent > .wd-ov-sent {
    grid-area: sent;
    align-self: start;   /* its text's height: a taller rates box adds room under it, not an empty band inside it */
    margin: 0;
    padding: 9px 12px 10px;
    border-radius: 10px;
    background: var(--ui-backgrounds-hoverBg);
}
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent > [data-wd-fig="taxes"] { grid-area: taxes; }
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent > [data-wd-fig="left"] { grid-area: left; }
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent > .wd-ov-side { grid-area: side; }
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent .wd-ov-side > .wd-rate { flex: 1 1 0; display: flex; flex-direction: column; }
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent .wd-rate-track.wd-rate-bars { flex: 1 1 0; height: auto; min-height: 56px; }
/* The sentence is the grid's first child now: the pinned row's first figure is the one after it. */
.wd-hub-head--compact .wd-ov-sent + .wd-out { padding-left: 0; border-left: 0; }
@container wdhub (max-width: 760px) {
    .wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent { grid-template-areas: "sent sent" "taxes left" "side side"; }
}
@container wdhub (max-width: 400px) {
    .wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent { grid-template-areas: "sent" "taxes" "left" "side"; }
}
@container wdhub (max-width: 760px) {
    .wd-hub-head .wd-hub-nav .optimize-subtab { padding: 10px 12px 8px 10px; gap: 7px; }
}
@container wdhub (max-width: 560px) {
    .wd-hub-head .wd-hub-nav .optimize-subtab { padding: 9px 9px 7px; gap: 5px; }
    .wd-hub-head .wd-hub-tab-sub--chip .wd-chip { white-space: nowrap; }
    .wd-hub-head .wd-hub-nav { flex-wrap: wrap; }
}

/* ---- The strip, tidier (Steve 2026-11-24: "I don't like how this looks. I want the design to be clean and tidy") ----
   The settings are a short list (a name, then what it is set to) with no grey box and no bold run-in text; the
   withdrawal rates lose their grey box too and sit behind one hairline. Same words, same places. */
.wd-ov-sent--list {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 16px;
    align-items: baseline;
    line-height: 1.4;
}
.wd-ov-sent--list .wd-ov-sent-lead { grid-column: 1 / -1; margin-bottom: 2px; color: var(--ui-text-secondaryText); }
.wd-ov-sent--list .wd-set { display: contents; }
.wd-ov-sent--list .wd-set-k { color: var(--ui-text-secondaryText); }
.wd-ov-sent--list .wd-set-k:empty::before { content: "Withdrawal order"; }
.wd-ov-sent--list .wd-set-v { display: block; min-width: 0; font-weight: 500; color: var(--ui-text-primaryText); }
.wd-ov-sent--list .wd-set-v::first-letter { text-transform: uppercase; }
.wd-set-hush { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent > .wd-ov-sent.wd-ov-sent--list {
    padding: 0 0 12px;
    border-radius: 0;
    background: none;
    border-bottom: 1px solid var(--ui-borders-borderLight);
    align-self: stretch;
}
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent .wd-rate {
    background: none;
    border-radius: 0;
    padding: 0 0 0 20px;
    border-left: 1px solid var(--ui-borders-borderLight);
}
.wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent .wd-rate-track .wd-dot { border-color: var(--ui-backgrounds-cardBg); }
@container wdhub (max-width: 760px) {
    /* A narrow head stacks the parts, so each is kept short: the head must not grow past what a short page can
       scroll under it (the fold, withdrawalsHub.js syncFold). */
    .wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent .wd-rate { padding: 0; border-left: 0; }
    .wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent { row-gap: 8px; }
    .wd-hub-head:not(.wd-hub-head--compact) .wd-ov-main--sent > .wd-ov-sent.wd-ov-sent--list { padding-bottom: 8px; gap: 2px 14px; }
    .wd-ov-sent--list .wd-ov-sent-lead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}

/* "How the Optimizer works" on the title line (2026-11-24), while the Optimizer page is open. */
.wd-hub-learn { color: var(--ui-text-linkText); font-weight: 600; white-space: nowrap; text-decoration: none; }
.wd-hub-learn:hover { text-decoration: underline; }
.wd-hub-learn[hidden] { display: none; }

/* ---- The strip on Withdrawal order only (Steve 2026-11-25: "In order to simplify the pages, I think we should show this
   top section only on the Withdrawals tab") ----
   On Roth & tax moves and the Optimizer the head is bare (.wd-hub-head--bare, withdrawalsHub.js syncBare): the strip
   keeps the dollars pill, at the right end of the tab row as before, and its line "Go back to my settings / Changes
   are since you opened Withdrawals. Undo my changes" when that line has something in it (an Optimizer result lands on
   Roth & tax moves, and that is the way back). The settings, the two outcomes and the withdrawal rates are not drawn
   there, and the bare head never folds (it has no figures to fold). */
#wd-hub-head.wd-hub-head--bare .wd-ov { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
#wd-hub-head.wd-hub-head--bare .wd-ov-main { display: block; }
#wd-hub-head.wd-hub-head--bare .wd-ov-main > :not(.wd-ov-side),
#wd-hub-head.wd-hub-head--bare .wd-ov-side > :not(.wd-ov-dollars) { display: none; }
#wd-hub-head.wd-hub-head--bare .wd-ov-under { margin-top: 0; padding: 10px 0 0; border-top: 0; }
@container wdhub (max-width: 760px) {
    /* Narrow: the pill sits under the tab row (no room beside it), at the right. */
    #wd-hub-head.wd-hub-head--bare .wd-ov-side { align-items: flex-end; padding-top: 8px; }
}
