/* Akaunta dashboard. Tokens: the UI guide's § 1 "Plain CSS equivalent", values unchanged.
   Rules: one accent element per screen (the primary action); weights 400/600 only; at most four
   text sizes per screen; 1px hairlines; no raw hex below the token block; spacing in steps of 4. */

:root {
  /* Surfaces */
  --page: #FAFAFA;
  --surface: #FFFFFF;
  --fill: #F4F4F5;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;

  /* Text: three values; --fg-subtle is never for text a user must read */
  --fg: #18181B;
  --fg-muted: #71717A;
  --fg-subtle: #A1A1AA;

  /* Accent: one colour, one job */
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-tint: #EEF2FF;
  --focus: #6366F1;

  /* Semantic: tint + ink pairs */
  --success-bg: #DCFCE7;  --success-fg: #15803D;
  --warning-bg: #FFF6D6;  --warning-fg: #854D0E;
  --danger-bg: #FEF2F2;   --danger-fg: #B91C1C;
  --info-bg: #E1EEFF;     --info-fg: #0D68C5;
  --danger: #DC2626;
  --danger-hover: #B91C1C;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-ms: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Type: size + line-height */
  --text-xs: 12px;    --text-xs-lh: 16px;
  --text-sm: 13px;    --text-sm-lh: 18px;
  --text-base: 14px;  --text-base-lh: 20px;
  --text-md: 16px;    --text-md-lh: 24px;
  --text-lg: 20px;    --text-lg-lh: 28px;
  --text-xl: 28px;    --text-xl-lh: 34px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-full: 9999px;

  /* Control and row heights */
  --h-control-sm: 28px;
  --h-control-md: 36px;
  --h-control-lg: 44px;
  --h-row-dense: 36px;
  --h-row-comfy: 44px;

  /* Elevation: popovers and modals only */
  --shadow-popover: 0 4px 12px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-modal: 0 16px 48px rgba(0,0,0,0.18);

  /* Motion */
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);

  /* App-level (derived, not colours) */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --h-topbar: 48px;
  --overlay: rgba(0,0,0,0.45);
}

/* ---- Base ------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--fg); font-family: var(--font);
  font-size: var(--text-base); line-height: var(--text-base-lh); font-weight: 400;
}
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
strong, b { font-weight: 600; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
        stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--fg-muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-value { color: var(--fg-subtle); }

/* ---- Top bar: brand · nav · user menu, one 48px band ----------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-md);
  height: var(--h-topbar); padding: 0 var(--space-md); background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar__brand { font-weight: 600; text-decoration: none; padding-right: var(--space-sm); }
.topnav { display: flex; align-items: center; gap: var(--space-xs); flex: 1; min-width: 0; }
.topnav__item {
  display: inline-flex; align-items: center; height: var(--h-control-md); padding: 0 var(--space-ms);
  border-radius: var(--radius-sm); color: var(--fg-muted); text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.topnav__item:hover { background: var(--fill); color: var(--fg); }
/* Navigation is never coloured: the active item is ink + weight on the neutral fill. */
.topnav__item.is-active { background: var(--fill); color: var(--fg); font-weight: 600; }
.topnav__item:focus-visible { outline-offset: -2px; }

/* ---- Menu (user menu; <details>) ------------------------------------------------------- */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary .icon { transform: rotate(180deg); }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + var(--space-xs)); z-index: 30; min-width: 220px;
  padding: var(--space-xs); background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover); display: flex; flex-direction: column;
}
.menu__caption { padding: var(--space-sm) var(--space-ms); color: var(--fg-muted); font-size: var(--text-sm);
                 line-height: var(--text-sm-lh); border-bottom: 1px solid var(--border); margin-bottom: var(--space-xs); }
.menu__panel form { margin: 0; }
.menu__item {
  display: flex; align-items: center; width: 100%; height: var(--h-control-md); padding: 0 var(--space-ms);
  border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; text-decoration: none;
  cursor: pointer; transition: background-color var(--dur-fast) var(--ease);
}
.menu__item:hover { background: var(--fill); }
.menu__item:focus-visible { outline-offset: -2px; }

/* ---- Main, toolbar, banner ------------------------------------------------------------- */
.main { padding: var(--space-md); }
.main--auth { padding-top: var(--space-3xl); }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); min-height: var(--h-control-md);
           margin-bottom: var(--space-ms); }
.toolbar__title { font-size: var(--text-lg); line-height: var(--text-lg-lh); font-weight: 600; margin-right: var(--space-sm); }
.toolbar__spacer { flex: 1; }
.banner {
  display: flex; align-items: center; gap: var(--space-ms); padding: var(--space-sm) var(--space-ms);
  margin-bottom: var(--space-ms); border-radius: var(--radius-sm); font-weight: 600;
}
.banner--warning { background: var(--warning-bg); color: var(--warning-fg); }
.banner--danger { background: var(--danger-bg); color: var(--danger-fg); }
.banner--info { background: var(--info-bg); color: var(--info-fg); }
.banner--success { background: var(--success-bg); color: var(--success-fg); }

/* ---- Buttons: primary · secondary · ghost · destructive; sm 28 · md 36 · lg 44 -------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  height: var(--h-control-md); padding: 0 var(--space-ms); border: 0; border-radius: var(--radius-sm);
  font-weight: 600; font-size: var(--text-base); line-height: var(--text-base-lh); text-decoration: none;
  white-space: nowrap; cursor: pointer; transition: background-color var(--dur-fast) var(--ease);
}
.btn--sm { height: var(--h-control-sm); padding: 0 var(--space-sm); }
.btn--md { height: var(--h-control-md); padding: 0 var(--space-ms); }
.btn--lg { height: var(--h-control-lg); padding: 0 var(--space-md); font-size: var(--text-md); line-height: var(--text-md-lh); }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: var(--surface); }
.btn--primary:hover, .btn--primary:active { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1px var(--border-strong); }
.btn--secondary:hover, .btn--secondary:active { background: var(--fill); }
.btn--ghost { background: transparent; color: var(--fg-muted); }
.btn--ghost:hover, .btn--ghost:active { background: var(--fill); color: var(--fg); }
.btn--destructive { background: var(--danger); color: var(--surface); }
.btn--destructive:hover, .btn--destructive:active { background: var(--danger-hover); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--fill); color: var(--fg-subtle); box-shadow: none;
                                             cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }

/* ---- Forms ---------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: var(--space-md); }
.inline-form { display: inline-flex; margin: 0; }
.form__actions { display: flex; justify-content: flex-end; gap: var(--space-sm); }
.field { display: flex; flex-direction: column; }
.field__label { font-size: var(--text-sm); line-height: var(--text-sm-lh); font-weight: 600; margin-bottom: var(--space-sm); }
.helper { font-size: var(--text-sm); line-height: var(--text-sm-lh); color: var(--fg-muted); margin-top: var(--space-sm); }
.form-error { font-size: var(--text-sm); line-height: var(--text-sm-lh); color: var(--danger-fg); background: var(--danger-bg);
              padding: var(--space-sm) var(--space-ms); border-radius: var(--radius-sm); }
.field__error { font-size: var(--text-sm); line-height: var(--text-sm-lh); color: var(--danger-fg); margin-top: var(--space-sm); }

.input {
  width: 100%; height: var(--h-control-lg); padding: 0 var(--space-ms); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: var(--text-md);
  line-height: var(--text-md-lh); transition: border-color var(--dur-fast) var(--ease);
}
.input--sm { height: var(--h-control-sm); font-size: var(--text-base); line-height: var(--text-base-lh); }
.input--md { height: var(--h-control-md); font-size: var(--text-base); line-height: var(--text-base-lh); }
textarea.input { height: auto; min-height: 88px; padding: var(--space-sm) var(--space-ms); resize: vertical; }
.input::placeholder { color: var(--fg-subtle); }
.input:hover { border-color: var(--fg-subtle); }
.input:focus-visible { border-color: var(--accent); outline: 2px solid var(--focus); outline-offset: -1px; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled { background: var(--fill); color: var(--fg-subtle); }
.input[readonly] { background: var(--fill); }

/* ---- Custom select / combobox (never native) ------------------------------------------- */
.select { position: relative; display: inline-flex; flex-direction: column; min-width: 160px; }
.select__box { position: relative; }
.select__control {
  appearance: none; -webkit-appearance: none; display: flex; align-items: center; width: 100%;
  height: var(--h-control-md); padding: 0 32px 0 var(--space-ms); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: var(--text-base);
  line-height: var(--text-base-lh); text-align: left; cursor: pointer; transition: border-color var(--dur-fast) var(--ease);
}
.select--lg .select__control { height: var(--h-control-lg); font-size: var(--text-md); line-height: var(--text-md-lh); }
.select--sm .select__control { height: var(--h-control-sm); }
input.select__control { cursor: text; }
.select__control:hover { border-color: var(--fg-subtle); }
.select__control:focus-visible { border-color: var(--accent); outline: 2px solid var(--focus); outline-offset: -1px; }
.select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select__value.is-empty { color: var(--fg-subtle); }
.select__chevron { position: absolute; right: var(--space-ms); top: 50%; margin-top: -8px; color: var(--fg-muted);
                   pointer-events: none; transition: transform var(--dur-fast) var(--ease); }
.select__control[aria-expanded="true"] ~ .select__chevron { transform: rotate(180deg); }
.popover, .select__list {
  position: absolute; z-index: 40; top: calc(100% + var(--space-xs)); left: 0; background: var(--surface);
  border-radius: var(--radius-md); box-shadow: var(--shadow-popover);
}
.select__list { min-width: 100%; max-height: 288px; overflow-y: auto; margin: 0; padding: var(--space-xs); list-style: none; }
.select__option {
  display: flex; align-items: center; min-height: var(--h-control-sm); padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
}
.select__option:hover, .select__option.is-active { background: var(--fill); }
.select__option[aria-selected="true"] { font-weight: 600; background: var(--accent-tint); }
.select__none { padding: var(--space-xs) var(--space-sm); color: var(--fg-muted); }

/* ---- Date-range picker ---------------------------------------------------------------- */
.daterange { position: relative; display: inline-flex; flex-direction: column; }
.daterange .select__control { min-width: 200px; }
.daterange__pop { padding: var(--space-ms); display: flex; gap: var(--space-ms); }
.daterange__presets { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 140px;
                      border-right: 1px solid var(--border); padding-right: var(--space-ms); }
.daterange__presets .btn { justify-content: flex-start; }
.calendar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); }
.calendar__month { font-weight: 600; }
.calendar__grid { border-collapse: collapse; }
.calendar__grid th { width: 36px; height: var(--h-control-sm); font-size: var(--text-sm); font-weight: 600; color: var(--fg-muted); }
.calendar__grid td { padding: 0; }
.calendar__day {
  width: 36px; height: var(--h-control-sm); border: 0; border-radius: var(--radius-sm); background: transparent;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.calendar__day:hover { background: var(--fill); }
.calendar__day:focus-visible { outline-offset: -2px; }
.calendar__day.is-outside { color: var(--fg-subtle); }
.calendar__day.is-today { box-shadow: inset 0 0 0 1px var(--border-strong); }
.calendar__day.is-in-range { background: var(--accent-tint); border-radius: 0; }
.calendar__day.is-start, .calendar__day.is-end { background: var(--accent-tint); font-weight: 600;
                                                 box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--radius-sm); }
.daterange__footer { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-sm); }

/* ---- Tabs (section switcher, e.g. Nustatymai) ------------------------------------------ */
.tabs { display: flex; gap: var(--space-xs); border-bottom: 1px solid var(--border); margin-bottom: var(--space-md); }
.tabs__item {
  display: inline-flex; align-items: center; height: var(--h-control-md); padding: 0 var(--space-ms);
  color: var(--fg-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.tabs__item:hover { color: var(--fg); background: var(--fill); }
.tabs__item.is-active, .tabs__item[aria-current="page"] { color: var(--fg); font-weight: 600; border-bottom-color: var(--fg); }
.tabs__item:focus-visible { outline-offset: -2px; }

/* ---- Table: dense 36px rows, hairlines, no zebra --------------------------------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { height: var(--h-row-dense); padding: 0 var(--space-ms); border-bottom: 1px solid var(--border);
                       text-align: left; white-space: nowrap; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface); font-size: var(--text-sm);
            line-height: var(--text-sm-lh); font-weight: 600; color: var(--fg-muted); }
.table tbody tr { transition: background-color var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: var(--fill); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:focus-within { outline: 2px solid var(--focus); outline-offset: -2px; }
.table tbody tr.is-selected { background: var(--accent-tint); box-shadow: inset 2px 0 0 var(--accent); }
.table .num { text-align: right; }
.table .truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }
.row-actions { opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.table tbody tr:hover .row-actions, .table tbody tr:focus-within .row-actions { opacity: 1; }

/* ---- Badge: tint + ink, always a word --------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-xs); height: 20px; padding: 0 var(--space-sm);
  border-radius: var(--radius-sm); font-size: var(--text-xs); line-height: var(--text-xs-lh); font-weight: 600;
  white-space: nowrap; background: var(--fill); color: var(--fg-muted);
}
.badge--warning { background: var(--warning-bg); color: var(--warning-fg); }
.badge--danger { background: var(--danger-bg); color: var(--danger-fg); }
.badge--info { background: var(--info-bg); color: var(--info-fg); }
.badge--success { background: var(--success-bg); color: var(--success-fg); }
.badge--warning::before, .badge--danger::before, .badge--info::before, .badge--success::before {
  content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor;
}

/* ---- Card, empty state ----------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); }
.card--auth { max-width: 400px; margin: 0 auto; padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md); }
.card__title { font-size: var(--text-lg); line-height: var(--text-lg-lh); font-weight: 600; }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); padding: var(--space-3xl) var(--space-md);
         text-align: center; }
.empty__title { font-size: var(--text-lg); line-height: var(--text-lg-lh); font-weight: 600; }
.empty__body { max-width: 420px; color: var(--fg-muted); font-size: var(--text-md); line-height: var(--text-md-lh); }

/* ---- Dialog (confirm) ------------------------------------------------------------------ */
.dialog {
  width: calc(100% - var(--space-xl)); max-width: 480px; padding: var(--space-lg); border: 0;
  border-radius: var(--radius-md); background: var(--surface); color: var(--fg); box-shadow: var(--shadow-modal);
}
.dialog::backdrop { background: var(--overlay); }
.dialog__title { font-size: var(--text-lg); line-height: var(--text-lg-lh); font-weight: 600; margin-bottom: var(--space-sm); }
.dialog__text { color: var(--fg-muted); }
.dialog__footer { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-lg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; }
}

/* ---- Sąskaitos: search field, tabs row, pager, detail ------------------------------------ */
.toolbar__search { width: 288px; }
.tabs--page { margin-bottom: var(--space-ms); }
.table td .muted, .table td.muted { color: var(--fg-muted); }
.table td a.cell-link { display: inline-block; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-ms);
         color: var(--fg-muted); font-size: var(--text-sm); line-height: var(--text-sm-lh); }
.empty__icon { width: 40px; height: 40px; color: var(--fg-subtle); }
.empty__icon.icon { stroke-width: 1.5; }

.detail { display: flex; flex-direction: column; gap: var(--space-md); }
.detail__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); }
.detail__section { display: flex; flex-direction: column; gap: var(--space-sm); }
/* Section headings share the page title's size: a fifth text size would be one too many (UI guide § 1). */
.detail__title { font-size: var(--text-lg); line-height: var(--text-lg-lh); font-weight: 600; }
.detail__actions > * { max-width: 720px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-xs) var(--space-lg); margin: 0; }
.facts dt { color: var(--fg-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: inherit; }
.flag-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-xs); }
.actions-slot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); min-height: var(--h-control-md); }

.toolbar__form { display: contents; }
.summary { color: var(--fg-muted); font-size: var(--text-sm); line-height: var(--text-sm-lh); margin-bottom: var(--space-ms); }
.alert-list { display: flex; flex-direction: column; gap: var(--space-ms); margin-bottom: var(--space-lg); }
.alert-list__title { font-size: var(--text-lg); line-height: var(--text-lg-lh); font-weight: 600; margin-bottom: var(--space-sm); }

/* ---- Nustatymai ------------------------------------------------------------------------- */
.settings { max-width: 720px; display: flex; flex-direction: column; gap: var(--space-md); }
.settings__section { display: flex; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-md); }
.check { display: flex; align-items: center; gap: var(--space-sm); min-height: var(--h-control-lg); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--fg); margin: 0; }
/* File picker: the native input stays (keyboard, screen readers) but is hidden; a secondary button and the
   chosen name stand in for the browser's own, English, control. */
.file { display: flex; align-items: center; gap: var(--space-ms); min-width: 0; }
.file__name { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file input:focus-visible + .btn { outline: 2px solid var(--focus); outline-offset: 2px; }
.one-time { border-color: var(--warning-fg); background: var(--warning-bg); max-width: 720px; margin-bottom: var(--space-lg); }
.one-time__password { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--text-lg); line-height: var(--text-lg-lh);
                      letter-spacing: .05em; user-select: all; }
.diff { margin: 0; padding: 0; list-style: none; overflow-wrap: anywhere; }
/* Taisyklės: a playbook's text and the change against the live version */
.pb-text, .pb-diff { margin: 0; padding: var(--space-ms); max-height: 70vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
                     background: var(--fill); border-radius: var(--radius-md); font: var(--text-sm)/var(--text-sm-lh) ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.pb-diff span { display: block; }
.pb-diff__add { background: var(--success-bg); color: var(--success-fg); }
.pb-diff__del { background: var(--danger-bg); color: var(--danger-fg); }
.pb-diff__hunk { color: var(--fg-muted); }
.pb-more > summary { cursor: pointer; font-weight: 600; }
.pb-more[open] > summary { margin-bottom: var(--space-sm); }
.table--top td { vertical-align: top; }
.table tfoot th, .table tfoot td { border-top: 1px solid var(--border-strong); padding: 0 var(--space-ms); height: var(--h-row-dense); text-align: left; }
.table tfoot td.num { text-align: right; }
.table td .actions-slot { flex-wrap: nowrap; white-space: nowrap; min-height: 0; }
.table-wrap + .settings { margin-top: var(--space-lg); }

/* „?“ explanations (help macro in _ui.html, [data-help] in app.js). The tip is position: fixed, placed by
   app.js, so a table's scroll box does not clip it. */
.field__head, .section__head { display: flex; align-items: center; gap: var(--space-xs); }
.field__head .field__label { margin-bottom: 0; }
/* the same gap under the label as .field__label's own margin, for every field with a „?“ (also the select
   macro's label row, which is not inside a .field); a checkbox row has none */
.field__head { margin-bottom: var(--space-sm); }
.field__head:has(> .check) { margin-bottom: 0; }
.field__head .check { min-height: var(--h-control-md); }
.section__head .detail__title { margin: 0; }
.section__head { margin-bottom: var(--space-ms); }
.cell-help { display: inline-flex; align-items: center; gap: var(--space-xs); }
.help { display: inline-flex; position: relative; }
.help__btn {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: var(--radius-full); background: var(--fill); color: var(--fg-muted);
  box-shadow: inset 0 0 0 1px var(--border-strong); font: 600 var(--text-xs)/1 inherit; cursor: help;
}
.help__btn:hover, .help__btn[aria-expanded="true"] { background: var(--accent-tint); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.help__btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.help__tip {
  position: fixed; z-index: 40; max-width: min(340px, calc(100vw - 16px)); padding: var(--space-sm) var(--space-ms);
  background: var(--fg); color: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-popover);
  font-size: var(--text-sm); line-height: var(--text-sm-lh); font-weight: 400; text-align: left; white-space: normal;
}
