/* Overboeken: the panel's row and the transfer's sheet (SPEC §10b). */

/* the panel's `Overboeken` is a button among links: drawn as its rows are */
.acctpanel button.srow {
  width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: none;
  font: inherit; color: var(--fg); text-align: left; cursor: pointer;
}

/* All the screen below the coloured bar, whatever the screen (Nicolas, 2026-11-18), so the top
   stays put while Naar's list grows and shrinks; the content fills it, and the buttons sit at
   its bottom however little is above them. `--trf-top` is the bar's bottom edge, measured by
   `transfer.js` (the bar is taller under an iPhone's status bar). A phone: from the bar to the
   screen's bottom edge. Wider: the centred dialog, from just under the bar to 16 px above the
   bottom. */
.sheet.transfer {
  width: min(480px, calc(100vw - 32px)); max-height: none; display: flex; flex-direction: column;
  top: calc(var(--trf-top, 56px) + 16px); bottom: 16px; height: auto; transform: translateX(-50%);
}
body.phone .sheet.transfer { top: var(--trf-top, 56px); bottom: 0; height: auto; max-height: none; transform: none; }
.sheet.transfer > .trf { flex: 1 0 auto; display: flex; flex-direction: column; }
/* the grab line keeps its 5 px when the content overflows, or everything under it moves up as it shrinks */
.sheet.transfer > .grab { flex: none; }
.trf-body { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; flex: 1 0 auto; }
.trf-body > .trf-actions { margin-top: auto; }

/* The form holds still (`trf-still`): only Naar's list scrolls, in whatever height is left
   between the fields above and the buttons. `transfer.js` sets it while the form is shown and
   the list gets at least `LIST_MIN_PX` there; otherwise the sheet scrolls as a whole (the
   buttons still at its bottom), so nothing is ever squeezed out of sight. */
.sheet.transfer.trf-still { overflow: hidden; }
.sheet.transfer.trf-still > .trf, .trf-still .trf-body { flex: 1 1 auto; min-height: 0; }
.trf-still .trf-body > * { flex: none; }
.trf-still .trf-body > .trf-to { flex: 1 1 auto; min-height: 0; }
.trf-still .trf-to > * { flex: none; }
.trf-still .trf-to > .trf-list { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* Below 900 px of height the labels stand left of their fields, about 85 px more for the list:
   at 812 px that is what lets a chosen payee and `Naam ontvanger` fit without the sheet
   scrolling. By the screen's height, never by what is typed, so the fields never move. */
@media (max-height: 900px) {
  .trf-body .trf-field { flex-direction: row; align-items: center; gap: 10px; }
  .trf-body .trf-field > .trf-k { flex: none; width: 92px; flex-direction: column; gap: 0; hyphens: manual; }
  .trf-body .trf-field > :not(.trf-k) { flex: 1 1 auto; min-width: 0; }
  .trf-body .trf-from { flex-direction: row; gap: 10px; padding: 8px 12px; }
  .trf-body .trf-from > .trf-k { flex: none; width: 80px; }
  .trf-body { gap: 10px; }
}
.trf-k { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.trf-v { display: flex; flex-direction: column; min-width: 0; }
.trf .n { font-size: 16px; font-weight: 600; }
.trf .s { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.trf .muted { color: var(--muted); }

.trf-from { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); }
/* `Van` as a button, when Banking can send from another account too (BFE-TRF-23) */
.trf-from-switch { position: relative; width: 100%; font: inherit; color: var(--fg); text-align: left; cursor: pointer; }
.trf-body .trf-from.trf-from-switch { padding-right: 36px; } /* room for the chevron, beside the short-screen padding */
.trf-from-switch .trf-chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--muted); transition: transform 0.15s; }
.trf-from-switch[aria-expanded="true"] .trf-chev { transform: translateY(-50%) rotate(90deg); }
.trf-sources { margin-top: -4px; }

.trf-to { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; }
.trf-opt {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px;
  border: 1px solid var(--rule); border-top-width: 0; cursor: pointer;
}
.trf-opt:first-of-type { border-top-width: 1px; border-radius: 12px 12px 0 0; }
.trf-opt:last-of-type { border-radius: 0 0 12px 12px; }
.trf-opt:only-of-type { border-radius: 12px; }
.trf-opt:has(input:checked) { background: var(--sel); }
.trf-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.trf-opt .l { display: flex; flex-direction: column; min-width: 0; }

/* Naar: `Naar eigen` and `Naar elders` side by side, the pressed one filled */
.trf-modes { display: flex; gap: 10px; margin-bottom: 10px; }
.trf-mode {
  flex: 1 1 0; min-height: 44px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--surface); color: var(--fg);
}
.trf-mode[aria-pressed="true"] { background: var(--sel); border-color: var(--accent); }
.trf-mode:disabled { opacity: 0.45; }
.trf-search-slot:empty { display: none; }
/* under `Naar elders` the field stands where the buttons were, titled `Naar`, with its own cross */
.trf-search-field { margin-bottom: 10px; }
.trf-search-wrap { position: relative; display: block; }
.trf-search-wrap .trf-search { margin: 0; padding-right: 44px; }
.trf-clear {
  position: absolute; right: 0; top: 0; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0;
}
.trf-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Bedrag: a field for five digits and the cents; beside it amounts from the history */
.trf-amount-row .trf-k { cursor: default; }
.trf-euro .trf-amount { flex: none; width: 5.5em; }
.trf-aside { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.trf-chip {
  min-height: 44px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: 22px;
  background: var(--panel); color: var(--fg); font: inherit; font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; flex: none;
}
.trf-chip[aria-pressed="true"] { background: var(--sel); border-color: var(--accent); }
.trf-chip:disabled { opacity: 0.45; }

/* Naar's search (BFE-TRF-14 … -16): the field, its groups of choices, the receiving name */
.trf-search { margin-bottom: 8px; -webkit-appearance: none; appearance: none; }
.trf-list { display: flex; flex-direction: column; gap: 8px; }
.trf-list:empty { display: none; }
.trf-group { display: flex; flex-direction: column; }
.trf-heading { margin: 4px 0 -4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.trf-bad, .trf-bad-ref { margin: 0; font-size: 14px; color: var(--amber-fg); }
.trf-none, .trf-search-err { font-size: 14px; }
.trf-name-slot { margin-top: 10px; }
.trf-name-slot:empty { display: none; }
.trf-to .trf-err { margin-top: 6px; }

.trf-field { display: flex; flex-direction: column; gap: 6px; }
.trf-euro { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 600; }
.trf-amount, .trf-desc, .trf-search, .trf-recipient {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: 10px;
  background: var(--surface); color: var(--fg); font-size: 16px; box-sizing: border-box; width: 100%;
}
.trf-amount { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trf [aria-invalid="true"] { border-color: var(--amber-fg); }
.trf-counter { font-variant-numeric: tabular-nums; }
.trf-err, .trf-msg { margin: 0; font-size: 14px; color: var(--fg); }
.trf-err, .trf-msg.warn { color: var(--amber-fg); }
.trf-line { margin: 0; }

.trf-review { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px solid var(--rule); border-radius: 12px; }
.trf-row { display: flex; flex-direction: column; gap: 2px; }
.trf-big { font-size: 32px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.trf-desc-shown { overflow-wrap: anywhere; }
/* to an IBAN outside the household: the name large, the warning when never seen (BFE-TRF-17) */
.trf .trf-to-name { font-size: 18px; overflow-wrap: anywhere; }
.trf-never { margin-top: 4px; font-size: 14px; color: var(--amber-fg); }
.trf-count { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trf-done { margin: 0; font-size: 20px; font-weight: 700; color: var(--pos); }

/* the buttons stay at the sheet's bottom edge while what is above them scrolls (the sheet is the scroller) */
.trf-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  /* sticky is measured inside the sheet's padding: `bottom` and the margins take it back, so the bar meets the edge */
  position: sticky; bottom: -20px; z-index: 1; margin: 0 -20px -20px; padding: 12px 20px 20px;
  background: var(--surface); border-top: 1px solid var(--rule);
}
body.phone .trf-actions {
  bottom: calc(-1 * max(20px, env(safe-area-inset-bottom)));
  margin-bottom: calc(-1 * max(20px, env(safe-area-inset-bottom))); padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.trf-actions .btn { min-height: 44px; font-size: 15px; }
.trf-actions .btn.primary { flex: 1 1 220px; font-weight: 600; }
.trf-actions .btn:disabled { opacity: 0.45; cursor: default; }
/* the dark accent is light: dark text on it, as `.btn.primary` has under data-theme="dark" */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .trf-actions .btn.primary { color: #0d1626; } }
