/* Batch 13: layout, organization and Don't Make Me Think across screens.
   Kept in its own file so the other batches' CSS (app, shell, phases) merges cleanly. */

/* ---------- Item 1: the caret header on every section ---------- */
.sec-head { flex-wrap: wrap; row-gap: 4px; }
.sec-head h2, .sec-head h3 { margin: 0; font-size: var(--fs-section); }
.sec-caret { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; font-weight: 700; color: var(--text); border-radius: 8px; padding-right: 6px; }
.sec-chev { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border: 1.5px solid var(--border-input); border-radius: 7px; background: var(--card); color: var(--text); }
.sec-chev svg { width: 16px; height: 16px; }
.sec-caret:hover .sec-chev { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.sec-caret:hover .sec-title-text { text-decoration: underline; text-underline-offset: 3px; }
.sec-caret:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.sec-sum { color: var(--text-2); font-size: .9375rem; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 160px; }
.sec:not(.sec-closed) > .sec-head .sec-sum, .sec:not(.sec-closed) > .sec-head-host > .sec-head .sec-sum { display: none; }
.sec.sec-closed > :not(.sec-head):not(.sec-head-host),
.sec.sec-closed > .sec-head-host > :not(.sec-head) { display: none !important; }
.sec.sec-closed { margin-bottom: var(--s3); }
.sec.sec-closed > .sec-head, .sec.sec-closed > .sec-head-host > .sec-head { margin-bottom: 0; }
/* A card whose header row is the caret (Home's cards): closed, it is one slim line. */
.card.sec.sec-closed { padding-top: var(--s2); padding-bottom: var(--s2); }
.card.sec > .sec-head:not(.section-title) { margin-bottom: var(--s2); }
.sec-head h2 .sec-caret, .sec-head h3 .sec-caret { font-size: inherit; }
@media (max-width: 760px) { .sec-sum { white-space: normal; flex-basis: 100%; } }
/* Open all · Close all: two small links at the top right of a screen with two or more sections. */
.sec-all { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: .8125rem; margin: -4px 0 6px; }
.page-head .sec-all { margin: 0; }
@media print { .sec.sec-closed > * { display: revert !important; } .sec-chev, .sec-all { display: none !important; } }
/* The chart: a caret section; closed, the pick and Side / Below hide and the list takes the full width. */
.vis-panel.sec-closed .bar-top { margin-bottom: 0; }
.vis-panel.sec-closed .bar-top > select, .vis-panel.sec-closed .bar-top > .seg { display: none; }
.vis-panel:not(.sec-closed) .bar-top > .sec-sum { display: none; }
.vis-panel .bar-top h3 { margin: 0; font-size: 1rem; }
.visuals.hidden { grid-template-columns: minmax(0, 1fr) !important; }

/* ---------- Item 2: slim strips (Cash flow, Net worth, the Budget's totals) ---------- */
.slim-strip { padding: 6px var(--s4); margin-bottom: var(--s3); }
.slim-line { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; row-gap: 4px; min-height: 36px; }
.slim-line .sec-caret { font-size: .9375rem; }
.slim-nums { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s5); }
.slim-item { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.slim-item .label { color: var(--text-2); font-size: .875rem; }
.slim-num { font-size: 1.125rem; font-weight: 700; }
.slim-strip:not(.sec-closed) .slim-nums { display: none; }
.slim-full > .card { box-shadow: none; padding: 0; margin: 6px 0 4px; background: transparent; }
.slim-full > .strip { margin: 6px 0 4px; }
@media (max-width: 760px) { .slim-line { gap: 4px var(--s3); } .slim-nums { gap: 2px var(--s4); } }

/* ---------- Item 5: short lists are taps ---------- */
.tap-pick .pick { min-height: 32px; }
@media (min-width: 761px) { .gate:has(> .tap-pick) { grid-column: span 2; } }
.gut-row h3 { margin: 0; font-size: 1rem; }
/* The row's status and its clock (Will get it) sit level on one line; the clock is icon-only (its name is in the tip). */
.status-cell { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.status-cell .will-get { min-height: 32px; width: 32px; padding: 0; justify-content: center; }
.status-cell .will-get .will-get-text { display: none; }
table.rows tr.row .status-cell .will-get { min-height: 36px; height: 36px; width: 36px; }

/* ---------- Item 3: side panels push the page; nothing sits under them ---------- */
body.side-open .tracker { right: min(440px, 100vw); }
body.side-open.parking-pinned .parking-dock { display: none; } /* one column at the right edge at a time below 1440 */
body.side-open.parking-pinned main.shell-page, body.side-open.parking-pinned .banner { padding-right: calc(min(440px, 100vw) + 16px); }
@media (min-width: 1440px) {
  body.side-open.parking-pinned .parking-dock { display: block; }
  body.side-open.parking-pinned .side-panel { right: 340px; }
  body.side-open.parking-pinned main.shell-page, body.side-open.parking-pinned .banner { padding-right: calc(440px + 356px); }
  body.side-open.parking-pinned .tracker { right: calc(440px + 340px); }
}
body.parking-pinned .tracker { right: 340px; }
@media (max-width: 1279px) { body.parking-pinned .tracker { right: 0; } }

/* ---------- Item 4: boxes level in a row ---------- */
.ft-grid { align-items: flex-start; } /* Fast Track: labels on one line, so the boxes start level */
.gut-row { align-items: flex-start; }
.gut-row > h3 { align-self: center; }
table.rows.mini.timer-table td { white-space: normal; overflow-wrap: anywhere; } /* the onboarding timer fits a phone instead of scrolling sideways */
.session-strip > .btn { flex: none; }
.owner-chip { gap: 4px; min-height: 32px; padding: 0 8px; white-space: nowrap; color: var(--text); }
.owner-chip svg { width: 14px; height: 14px; }
table.rows tr.row .owner-chip { min-height: 36px; }
@media (min-width: 761px) and (max-width: 1439px) { table.rows td, table.rows th { padding-left: 5px; padding-right: 5px; } } /* the wide lists (Income for a couple) fit 1280 */
.layer .stack > span.row-line { align-items: flex-start; } /* a box and its toggle in one Details row start level */
.timer-table { table-layout: fixed; width: 100%; }

/* ---------- Batch 19: columns that line up, rows that breathe, nothing stuck over a row ---------- */
/* The totals row ends the list where the list ends; stuck to the bottom of the screen it covered the last row seen. */
table.rows tfoot td { position: static; }
/* Same-size controls down a column (DESIGN.md rule 1b): every status pill and every Details button is one width. */
table.rows tr.row .status-cell > .status-btn { width: 124px; justify-content: space-between; }
table.rows tr.row td.col-actions .caret { min-width: 96px; justify-content: space-between; }
/* Budget by category: the box sits in one place on every row; what it reads from sits beside it, in its own column. */
table.rows.cat-rows td { height: 52px; }
table.rows.cat-rows td.col-note { width: 1%; white-space: nowrap; color: var(--text-2); }
table.rows.cat-rows td.col-amount { width: 1%; }
table.rows.cat-rows td.col-amount label.field.money, .from-box { width: 128px; }
.from-box { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; height: 36px; padding: 0 8px 0 10px; border: 1.5px solid var(--border-filled); border-radius: var(--r-input, 8px); background: var(--computed); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.from-box:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.from-box:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.from-box .i { width: 16px; height: 16px; flex: none; }
@media (max-width: 760px) {
  /* A phone: the box, then the status beside it; the note goes under the box, never pushing it. */
  table.rows.cat-rows tr.row td { height: auto; }
  table.rows.cat-rows tr.row td.col-amount { order: 1; width: auto; }
  table.rows.cat-rows tr.row td.col-status { order: 2; }
  table.rows.cat-rows tr.row td.col-note { order: 3; flex: 1 1 100%; width: auto; margin-top: -4px; }
  table.rows.cat-rows tr.row td.col-actions { order: 4; }
  table.rows.cat-rows tr.row td.check-cell, table.rows.cat-rows tr.row td.col-first { order: 0; }
}
table.rows.cat-rows .cat-note { background: none; padding: 0; font-weight: 500; color: var(--text-2); } /* words, not a chip: nothing here is clickable */
/* Will get it says so in words (DESIGN.md rule 8: a clock alone reads as nothing). */
.status-cell .will-get, table.rows tr.row .status-cell .will-get { width: auto; padding: 0 10px; gap: 4px; }
.status-cell .will-get .will-get-text { display: inline; }
.btn.small.clear-all { color: var(--text-2); border-color: var(--border-input); font-weight: 600; }
@media (max-width: 760px) { table.rows td.col-first .inst-cell { display: flex; width: 100%; } } /* every name box is the row's full width, so they line up */
/* Scorecard: every hole card is one grid, so Payoff, Effort, Best return and the buttons sit in the same place on each. */
.hole-body { display: grid; grid-template-columns: minmax(0, 1fr) 150px 104px 170px 180px 160px; gap: var(--s3) var(--s4); align-items: start; }
.hole-body > * { min-width: 0; }
.hole-body .hn-why { grid-column: 1; grid-row: 1 / span 2; }
.hole-body .hn-payoff { grid-column: 2; grid-row: 1; } .hole-body .hn-yours { grid-column: 2; grid-row: 2; }
.hole-body .hn-effort { grid-column: 3; grid-row: 1; } .hole-body .hn-score { grid-column: 4; grid-row: 1; }
.hole-body .hn-plan { grid-column: 5; grid-row: 1; padding-top: 22px; } .hole-body .hn-acts { grid-column: 6; grid-row: 1; }
.hole-body .hole-num { min-width: 0; }
.hn-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 2px; }
@media (max-width: 1100px) {
  .hole-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hole-body .hn-why { grid-column: 1 / -1; grid-row: 1; }
  .hole-body .hn-payoff { grid-column: 1; grid-row: 2; } .hole-body .hn-effort { grid-column: 2; grid-row: 2; }
  .hole-body .hn-yours { grid-column: 1; grid-row: 3; }
  .hole-body .hn-score { grid-column: 1; grid-row: 4; } .hole-body .hn-plan { grid-column: 2; grid-row: 4; padding-top: 0; align-self: center; }
  .hole-body .hn-acts { grid-column: 1 / -1; grid-row: 5; flex-direction: row; justify-content: space-between; align-items: center; }
}
@media (max-width: 760px) {
  /* A phone: Will get it (now in words) waits on the buttons line, after Details, so the status stays beside the box. */
  table.rows tr.row td.col-status, table.rows tr.row td.col-status > .status-cell { display: contents; }
  table.rows tr.row td.col-actions { order: 5; }
  table.rows tr.row .status-cell > .will-get { order: 6; }
  table.rows.cat-rows tr.row .status-cell > .status-btn { order: 2; }
}
@media (max-width: 760px) {
  /* A phone: every row is the same two-column card, so each box lands in the same place on every row (rule 1b). */
  table.rows:has(td.col-apr) tr.row td:not(.check-cell):not(.col-first):not(.col-status):not(.col-actions):not(:empty) { flex: 1 1 calc(50% - 4px); min-width: 0; } /* Debt and Credit cards: many boxes, so a fixed two-column card */
  table.rows tr.row .apr-guess .use-guess { order: 2; } /* the box first, Use after it */
  table.rows.cat-rows tr.row td.col-note:not(:empty) { flex: 1 1 100%; }
}
@media (max-width: 760px) {
  table.rows.cat-rows tr.row td.col-amount { flex: 0 0 auto !important; }
  table.rows.cat-rows tr.row td.col-note:not(:empty) { flex: 1 1 100% !important; }
  table.rows tr.row { align-items: flex-start; } /* cells of different heights start level */
  table.rows tr.row td.num .time-chip, table.rows tr.row td.num > .row-line > .chip-hrs { display: none; }
  table.rows tr.row td.col-pays-off:not(:empty) { flex: 1 1 100% !important; }
  table.rows tr.row .apr-guess label.field { flex: none; }
}
table.rows tr.row .status-cell > .status-btn { width: 114px; }
table.rows tr.row td.col-actions .caret { min-width: 92px; }
table.rows.tight tr.row td .time-chip { display: none; }
table.rows.tighter tr.row .status-cell .will-get { display: none; } /* still too wide: Will get it waits in the status menu and the list's Will get all of these */
@media (max-width: 760px) { table.rows tr.row td:not(.col-first):has(> .seg) { flex: 1 1 100% !important; } } /* a toggle gets its own line, never folded in half */
@media (max-width: 760px) { .set-row > .label:first-child { flex: 1 1 100%; width: auto !important; } } /* Coach tools settings: the label on its own line, every control starts at the same edge */
@media (max-width: 760px) { .foo-step-head > .num { margin-left: auto; text-align: right; } .foo-step-head > .foo-when { flex: 1 1 100%; text-align: right; } } /* FOO on a phone: each step's amount ends at the same right edge, its date under it */
.preset-row { row-gap: 4px; } .preset-row > .label:first-child { flex: 1 1 100%; min-width: 0; } /* Goals assumptions: the label over its control, so every toggle starts at the same edge (the wide Pace toggle wrapped under its label) */
@media (max-width: 760px) { .tool-list > .row-line > span:first-child { flex: 1 1 100% !important; } .tool-list > .row-line > .btn:last-child { margin-left: auto; } } /* Coach tools lists on a phone: the name on its own line, Fix now always at the right edge */
table.rows tr.row > td { padding-top: 4px; padding-bottom: 4px; } /* rule 1c: a row that grows (two boxes stacked, a long name) keeps air between it and the next */
table.rows.tight tr.row td.col-first label.field { max-width: 140px; }
table.rows.tight tr.row .status-cell > .status-btn { width: 108px; }
@media (min-width: 761px) and (max-width: 1439px) { table.rows.tight td, table.rows.tight th { padding-left: 4px; padding-right: 4px; } }
table.rows.tight .payoff-months { display: none; } /* squeezed: the payoff date alone (the months are in its tip and the bar) */
table.rows.tight .payoff { min-width: 0; }
table.rows.tight tr.row .seg button { padding: 0 6px; } /* squeezed: toggles drop their extra padding before Will get it drops its words */
table.rows.tight tr.row td.col-actions .actions { gap: 4px; }
table.rows.tight tr.row .status-cell .will-get > .i { display: none; } /* squeezed: the words without the clock */
table.rows tr.row label.field.name-field { height: auto; min-height: 36px; } /* a long name wraps inside its box instead of spilling out of it */
.foo-step-head > .foo-when { min-width: 96px; text-align: right; } /* each step's amount ends at the same edge, whatever its date */
table.rows td.col-balance .row-line > .time-chip { display: inline-flex; justify-content: center; min-width: 76px; } /* the hours chip after a balance is one width, so the box sits in one place */
@media (max-width: 760px) {
  td.col-first > .inst-cell:has(> .inst-link)::before { display: none; } /* rows start at the top on a phone: no spacer over the name */
}
@media (max-width: 760px) { table.rows tr.row td.num:not(:has(input, select, button, .seg)) { flex: 0 0 112px; align-self: center; } } /* a number that is only words (Month end's "$1,650 usual") holds one slot, so the box after it lines up */
