/* =========================================================================
   Social Security boxes: the box's own rules (box review 2026-11-18, first
   block), then the Children section and its Add / Edit popup
   (js/app/contentboxes/socialSecurity/ui/ssChildrenSection.js;
   .automation/planning/sschildbenefits PRD D9). Colours are tokens; text
   sizes come from the t- classes on the elements (css/styles2.css), so
   these rules keep layout, weight and colour only.
   ========================================================================= */

/* --- The box (`.automation/planning/boxesreview/everyday/`). Every extra is a
   CollapsibleSections fold row (the Spending box's look, quiet-boxes.css); the
   rules below are the rows the box draws itself. --- */

/* The amount rows: the label's words, its "?" and a grey sub-line under them
   (a fact about this plan: "Full retirement age 67, from your 1968 birth year").
   The value stays in its own column, centred on the two lines. */
/* Text flow, not a flex row: the "?" rides at the end of the words (wrapping with
   them) instead of dropping to a line of its own. */
.content-box-v3 .slider-container > .slider-label.ss-row-label {
    display: block;
}

.ss-row-label .ss-row-label-text {
    min-width: 0;
}

/* A Social Security amount is at most a few thousand dollars a month ("$8,000"), so its
   field is narrower than the money default (112px), leaving the label more room. */
.content-box-v3 .slider-tap.slider-container.slider-monetary:has(> .ss-row-label) .slider-input input {
    width: 76px;
}

/* The "?" never wraps onto a line of its own (Steve 2026-11-19: on a narrower column it
   dropped under "Monthly benefit at Full Retirement Age" and left a gap). It takes no
   width when the line is broken (a right margin of minus its own 22px and its 6px gap),
   so the label's words alone decide the line, and it hangs just past them, into the
   column gap and the empty left of the amount field (the figure is right-aligned).
   Painted above that field. */
.ss-row-label .ss-label-help {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 6px;
    margin-right: -28px;
    position: relative;
    z-index: 1;
}

.ss-row-label .ss-row-sub {
    display: block;
    margin-top: 2px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--ui-text-secondaryText);
    font-variant-numeric: tabular-nums;
}

.ss-row-label .ss-row-sub[hidden] {
    display: none;
}

.ss-label-help {
    flex-shrink: 0;
}

/* "I know my benefit at": a row label, not a heading. */
.ss-quiet-label {
    font-weight: 400;
    color: var(--ui-text-primaryText);
}

body.ui-quiet .ss-quiet-label {
    color: var(--qb-label, var(--ui-text-primaryText));
}

/* The "?" windows (the Spending box's label help body). */
.ss-help-body p {
    margin: 0 0 10px;
}

.ss-help-body a {
    color: var(--ui-text-linkText);
    font-weight: 600;
}

/* "Start collecting at  67 · January": the claim month sits in the age row,
   after the value (it had its own line, labelled "in"). The row's grid gains a
   `month` column; the open row's track still runs under the value. */
.content-box-v3 .slider-tap.slider-container.ss-claim-row {
    grid-template-columns: 28px minmax(0, 1fr) auto auto 28px;
    grid-template-areas:
        "label label value month chev"
        "minus track track track plus";
}

/* (Outranks the generic "anything appended takes its own line" rule.) */
.content-box-v3 .slider-tap.slider-container.ss-claim-row > div.ss-claim-month:not(.slider-label) {
    grid-area: month;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.ss-claim-month::before {
    content: '\00b7';
    color: var(--ui-text-secondaryText);
    font-weight: 700;
}

.ss-claim-month > label[hidden] {
    display: none;
}

.ss-claim-month .icon-dropdown-wrapper {
    width: auto;
    min-width: 0;
}

/* A switch row inside a fold (More settings, Spousal benefit coordination):
   the label and its "?" left, the switch right. */
.ss-switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.ss-switch-row .ss-switch-label {
    flex: 0 1 auto;
    min-width: 0;
    line-height: 1.35;
    color: var(--ui-text-primaryText);
    cursor: pointer;
}

body.ui-quiet .ss-switch-row .ss-switch-label {
    color: var(--qb-label, var(--ui-text-primaryText));
}

.ss-switch-row .ss-switch {
    flex-shrink: 0;
    margin-left: auto;
}

.ss-row-note {
    margin: 0 0 8px;
    color: var(--ui-text-secondaryText);
}

/* Inside the folds: the body starts close under its title row. */
.ss-fold .ss-more-content,
.ss-fold .ss-spouse-coordination-content {
    padding-top: 0;
}

/* The claim month in the quiet look: the same three steps as the box's other
   dropdowns (text at rest, a faint outline while the pointer is in the box,
   the full control on its row). quiet-boxes.css leaves dropdowns inside a
   slider row alone, so this row says it here. Pointer devices only. */
@media (hover: hover) and (pointer: fine) {
    body.ui-quiet .content-box-v3 .ss-claim-row .ss-claim-month .icon-dropdown-selected:not(.open) {
        border-color: transparent !important;
        background-color: transparent;
        transition: border-color var(--qb-fade, 0.2s ease);
    }

    body.ui-quiet .content-box-v3:is(:hover, :focus-within) .ss-claim-row .ss-claim-month .icon-dropdown-selected:not(.open) {
        border-color: var(--ui-borders-borderLight) !important;
    }

    body.ui-quiet .content-box-v3 .ss-claim-row:is(:hover, :focus-within) .ss-claim-month .icon-dropdown-selected:not(.open) {
        border-color: var(--ui-borders-borderDefault) !important;
    }
}

/* --- The Children section --- */

.ssc-content {
    margin-top: 2px;
}

.ssc-intro {
    margin: 0 0 12px 0;
}

.ssc-list {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ssc-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--ui-borders-borderLight);
    border-radius: 8px;
    background: var(--ui-backgrounds-cardBg);
}

.ssc-row-main {
    flex: 1;
    min-width: 0;
}

.ssc-row-name {
    font-weight: 700;
    color: var(--ui-text-primaryText);
    overflow-wrap: anywhere;
}

.ssc-row-meta {
    margin-top: 2px;
}

.ssc-row-result {
    margin-top: 7px;
    line-height: 1.45;
    color: var(--ui-text-primaryText);
    font-variant-numeric: tabular-nums;
}

.ssc-row-result.ssc-row-missed {
    color: var(--color-semantic-warning-deep);
}

.ssc-row-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.ssc-link {
    background: none;
    border: none;
    padding: 0;
    font-weight: 600;
    color: var(--ui-text-linkText);
    text-decoration: underline;
    cursor: pointer;
}

.ssc-add[hidden],
.ssc-list[hidden] {
    display: none;
}

.ssc-callout {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 7px;
    line-height: 1.45;
    background: var(--color-brand-light);
    color: var(--ui-text-primaryText);
}

.ssc-callout-warn {
    background: var(--color-semantic-warning-light);
    color: var(--color-semantic-warning-deep);
}

.ssc-dollars {
    margin-top: 8px;
}

.ssc-incare {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--ui-borders-borderLight);
}

.ssc-incare[hidden],
.ssc-callout[hidden],
.ssc-dollars[hidden],
.ssc-grad-field[hidden] {
    display: none;
}

.ssc-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ssc-toggle-row .toggle-switch {
    flex-shrink: 0;
    margin-top: 2px;
}

.ssc-toggle-text {
    flex: 1;
    min-width: 0;
}

.ssc-toggle-label {
    display: block;
    font-weight: 600;
    color: var(--ui-text-primaryText);
    cursor: pointer;
    margin-bottom: 2px;
}

.ssc-incare-result {
    margin-top: 10px;
    line-height: 1.45;
    color: var(--ui-text-primaryText);
    font-variant-numeric: tabular-nums;
}

/* ---- the Add / Edit popup (house popup shell, css/main_popup.css) ---- */
.ssc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ssc-field-label {
    display: block;
    font-weight: 700;
    color: var(--ui-text-primaryText);
    margin-bottom: 6px;
}

.ssc-field-help {
    margin-top: 6px;
}

.ssc-input,
.ssc-select {
    padding: 7px 9px;
    border: 1px solid var(--ui-borders-borderDefault);
    border-radius: 6px;
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-primaryText);
}

.ssc-input {
    width: 100%;
    box-sizing: border-box;
}

.ssc-born-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ssc-born-row .ssc-select {
    flex: 1;
    min-width: 0;
}

.ssc-born-row .ssc-year {
    width: 92px;
    flex: 0 0 auto;
}

.ssc-error {
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--color-semantic-warning-light);
    color: var(--color-semantic-warning-deep);
}

.ssc-error[hidden] {
    display: none;
}

.ssc-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
