/* Withdrawals hub, Stage 1 (2026-11-19). Colours only from the master colour variables; sizes from the text tokens.

   The Withdrawal Strategy box (js/app/contentboxes/withdrawalstrategy/withdrawalStrategyBox.js): three framed
   sections, each the app's own .content-section; this file gives them their frame, the frame title's quiet
   second half, the label / value / link rows, the header line and the stored boxes. */

/* ---- the three frames (PRD D-6) ----
   Quiet boxes draw a section as a part of the card with no frame of its own (css/quiet-boxes.css, "One card per
   box"). This box is the one exception Steve asked for: three framed sections, so a member sees that the pill
   governs only the first. The id outranks the quiet rule and the older floating-card look alike. */
#withdrawal-strategy-box .content-box-body > .wsb-frame {
    margin: 0 0 10px;
    padding: 10px 12px 10px;
    border: 1px solid var(--ui-borders-borderLight);
    border-radius: 12px;
    background: var(--ui-backgrounds-pageBg);
    box-shadow: none;
}
#withdrawal-strategy-box .content-box-body > .wsb-frame:first-child { margin-top: 4px; }
#withdrawal-strategy-box .content-box-body > .wsb-frame:last-child { margin-bottom: 0; }
#withdrawal-strategy-box .wsb-frame > .content-section-header { margin-bottom: 8px; }
/* Tax moves is a fold (2026-11-23): its bar and its body bring their own padding (css/quiet-boxes.css section 5),
   so the frame adds none and the bar fills the frame. */
#withdrawal-strategy-box .content-box-body > .wsb-frame.cs-fold { padding: 0; }

/* Frame titles: "Tax moves  the same with either choice above". */
.wsb-frame > .content-section-header > .content-section-title {
    white-space: normal;
}
.wsb-frame-sub {
    margin-left: 4px;
    font-size: var(--text-small, 14px);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ui-text-secondaryText);
}

/* ---- rows: a quiet label, the plan's own value under it in bold, and one link at the right ---- */
.wsb-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--ui-borders-borderLight);
}
.wsb-frame > .content-section-header + .wsb-row,
.wsb-frame > .wsb-row.wsb-row-first,
.wsb-frame > .content-section-body > .wsb-row:first-child,
.wsb-frame > .content-section-body > .wsb-row.wsb-row-first,
#withdrawal-own-order-row {
    border-top: 0;
    padding-top: 0;
}
.wsb-frame > .wsb-row:last-child,
.wsb-frame > .content-section-body > .wsb-row:last-child { padding-bottom: 0; }
.wsb-row-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.wsb-row-label {
    font-size: var(--text-medium, 15px);
    font-weight: 400;
    color: color-mix(in srgb, var(--ui-text-primaryText) 60%, var(--ui-text-secondaryText));
}
.wsb-row-value {
    font-size: var(--text-medium, 15px);
    font-weight: 600;
    line-height: 1.35;
    color: var(--ui-text-primaryText);
    overflow-wrap: anywhere;
}
.wsb-row-note { margin-top: 1px; }
.wsb-row-link {
    flex-shrink: 0;
    padding-top: 1px;
    font-size: var(--text-small, 14px);
    font-weight: 600;
    color: var(--ui-text-linkText);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.wsb-row-link:hover { text-decoration: underline; }
.wsb-row-link:focus-visible {
    outline: 2px solid var(--ui-text-linkText);
    outline-offset: 2px;
    border-radius: 4px;
}

/* The Optimizer's status carries its state in a small dot before the words. */
.wsb-row[data-wsb-search] { align-items: center; }
.wsb-row[data-wsb-search] .wsb-row-value::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: 1px;
    background: var(--color-gray-300);
}
.wsb-row[data-wsb-search="ok"] .wsb-row-value::before { background: var(--color-semantic-success); }
.wsb-row[data-wsb-search="stale"] .wsb-row-value::before { background: var(--color-semantic-warning); }

/* ---- frame 1: the controls moved in from the Retirement Spending box ---- */
#withdrawal-strategy-section .rmd-settings-container .wsb-row-text { gap: 2px; }
#withdrawal-strategy-section .wsb-label-help { margin-left: 6px; }

/* ---- the header line ("Balanced · Roth: Year by year · Optimizer up to date") ----
   White on the open box's dark bar; css/quiet-boxes.css turns .optbox-summary to the row's own text colour on a
   collapsed box (header option F), so the line reads on both. */
.optbox-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-ui-header-text);
    font-size: var(--text-small, 14px);
    font-weight: 600;
}
.wsb-summary {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ---- a pulse on the frame a link elsewhere opened (the Dashboard's Optimizer chip) ---- */
@keyframes wsb-flash {
    0% { box-shadow: 0 0 0 0 rgba(var(--color-blue-6-rgb), 0); }
    22% { box-shadow: 0 0 0 3px rgba(var(--color-blue-6-rgb), 0.35); }
    100% { box-shadow: 0 0 0 0 rgba(var(--color-blue-6-rgb), 0); }
}
.wsb-flash { animation: wsb-flash 1.1s ease-out 1; }

/* ---- stored boxes ----
   The Roth Conversions box stays in the page as the stored controls of the plan's Roth block (ids, listeners, the
   serializer and the plan-load path unchanged). Clipped, never display:none, and pinned to the top of whatever it
   is positioned against: the same rule as each pension's own box (css/pension-planner.css), for the same reasons. */
.content-box.box-stored {
    top: 0 !important; left: 0 !important;
    position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
    border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap; pointer-events: none !important;
}
/* Their two entries in the Add box are that storage too: the Withdrawal Strategy box stands in for them. */
.toggle-option-row.box-add-stored { display: none !important; }
