/* Design tokens live in penna-tokens.css (light + dark themes).
   Body background/color are owned there so theme flips paint immediately.
   ── Base ── */
html { font-size: 15px; }

/* ── AI kill switch ──
   Every AI control carries `data-ai-feature`. Hidden unless js/ai-gate.js
   (or a page's own server payload, e.g. welcome-view.html) marks the root
   `data-ai-enabled` from the backend's `ai_enabled` flag — off by default
   (settings.AI_FEATURES_ENABLED), so there is no flash of AI UI on load and
   no empty gap where it was. `grep -rn data-ai-feature frontend/` lists every
   surface to re-check when switching AI back on. */
html:not([data-ai-enabled]) [data-ai-feature] { display: none !important; }

body {
  font-family: var(--font);
}

/* ── Buttons (pill, ink fill) ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s, color .15s, border-color .15s;
  text-decoration: none;
  white-space: nowrap;
  min-height: 36px;
  padding: 10px 18px;
}
.btn:active:not(:where([data-app-theme="pennapay"] *)) { transform: translateY(1px); }

.btn-primary {
  background: var(--ink);
  color: var(--paper-hi);
  border-color: var(--ink);
}
.btn-primary:hover:not(:where([data-app-theme="pennapay"] *)) { transform: translateY(-1px); box-shadow: var(--shadow); }

/* Dark mode: use accent gold for primary buttons so they read as CTAs, not inverted ink.
   App-shell pages get the same gold through the "Button states" block below;
   the :not(:where()) keeps this rule's specificity for everything else. */
[data-theme="dark"] .btn-primary:not(:where([data-app-theme="pennapay"] *)) {
  background: var(--accent);
  color: var(--paper-lo);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover:not(:where([data-app-theme="pennapay"] *)) { background: var(--paper-hi); }

/* Destructive action: ONE style everywhere, a filled red pill (Rune, 2026-10-11).
   App-shell pages get it through the "Button states" block below; this is the
   same look for pages outside the app theme (marketing, builder). The old
   text-only .btn-danger and outline .btn-ghost-danger variants are gone. */
.btn-danger-solid {
  background: var(--danger);
  color: var(--paper-hi);
  border-color: var(--danger);
}
.btn-danger-solid:hover:not(:where([data-app-theme="pennapay"] *)) {
  background: color-mix(in srgb, var(--danger) 88%, var(--ink));
  border-color: color-mix(in srgb, var(--danger) 88%, var(--ink));
}
.btn-danger-solid:disabled:not(:where([data-app-theme="pennapay"] *)) {
  opacity: .5;
  cursor: not-allowed;
}

/* ── Form elements ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="password"],
input:not([type]),
textarea,
select {
  width: 100%;
  padding: 8px 12px;
  /* App shell: --field-line / --field-fill come from the token bridge in
     penna-tokens.css (a --pp-app-border-strong edge on a --paper fill, so a
     field reads as a well on its card). Marketing pages leave them unset and
     keep the --rule / --paper-hi fallbacks. */
  border: 1px solid var(--field-line, var(--rule));
  border-radius: var(--radius-sm);
  background: var(--field-fill, var(--paper-hi));
  color: var(--ink);
  font-family: var(--sans);
  font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea { resize: vertical; min-height: 64px; }

/* iOS Safari auto-zooms form controls below 16px on focus.
   Bump to 16px on touch viewports to suppress the unwanted zoom.
   !important because many per-page <style> blocks set inline class-level
   font-sizes (e.g. .msg-compose-body) that would otherwise win on
   specificity — there is no scenario where you want iOS to zoom-on-focus. */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="date"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ── Section card ── */
.card {
  background: var(--paper-hi);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--rule);
}

.card-title {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ── Grid helpers ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* ── Toggle switch ── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

input[type="checkbox"].toggle {
  width: 36px;
  height: 20px;
  appearance: none;
  background: var(--rule);
  border-radius: 20px;
  cursor: pointer;
  position: relative;
  transition: background .2s;
  border: none;
  padding: 0;
  flex-shrink: 0;
}
input[type="checkbox"].toggle::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--paper);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left .2s;
}
input[type="checkbox"].toggle:checked {
  background: var(--gold);
}
input[type="checkbox"].toggle:checked::after {
  left: 19px;
}

/* ── Skip link (WCAG 2.4.1) ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--paper-hi);
  padding: 8px 16px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ── Focus indicators (WCAG 2.4.7) ── (app shell: see "Button states") */
.btn:focus-visible:not(:where([data-app-theme="pennapay"] *)),
.btn-ghost:focus-visible:not(:where([data-app-theme="pennapay"] *)),
.btn-danger-solid:focus-visible:not(:where([data-app-theme="pennapay"] *)) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

input[type="checkbox"].toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Button states (app shell) ──
   Five states on .btn-primary / .btn-ghost / .btn-danger-solid: default (soft
   depth), hover (brighter, raised shadow), pressed (shadow swapped for an
   inset one), keyboard focus (a ring drawn inside the pill) and disabled.

   Scoped to pages whose <html> carries data-app-theme="pennapay" (the app
   shell + auth pages). Marketing pages load this file too but keep the rules
   above unchanged (their hover/active/focus rules are fenced off with
   :not(:where(...)) so the two sets never stack).

   Every selector here is single-class weight (0,1,0) — the state rules
   included, via :where(.btn):hover. A page that restyles .btn-primary in
   its own <style> (loaded after this file) therefore keeps its own look in
   every state until it is moved onto these classes.

   No transforms: a translateY lift moves the label to a sub-pixel position
   and Chrome re-rasterises it on a compositing layer, which blurs the text.
   Depth comes from shadows only.

   Each variant sets --btn-* values; the state rules only read them. The
   .is-hover / .is-active / .is-focus hooks force a state for the static
   preview at /dev/button-states.html — nothing in the app sets them. */
:where([data-app-theme="pennapay"]) {
  --btn-sheen: var(--paper-hi);  /* top highlight on a filled button */
  --btn-elev:       0 1px 2px color-mix(in srgb, var(--ink) 20%, transparent),
                    0 2px 6px color-mix(in srgb, var(--ink) 8%, transparent);
  --btn-elev-hover: 0 2px 4px color-mix(in srgb, var(--ink) 22%, transparent),
                    0 6px 14px color-mix(in srgb, var(--ink) 12%, transparent);
  --btn-press:      inset 0 2px 4px color-mix(in srgb, var(--ink) 28%, transparent);
}
:where([data-app-theme="pennapay"][data-theme="dark"]) {
  --btn-sheen: var(--ink);
  --btn-elev:       0 1px 2px color-mix(in srgb, var(--paper-lo) 80%, transparent),
                    0 2px 6px color-mix(in srgb, var(--paper-lo) 50%, transparent);
  --btn-elev-hover: 0 2px 4px color-mix(in srgb, var(--paper-lo) 85%, transparent),
                    0 6px 16px color-mix(in srgb, var(--paper-lo) 60%, transparent);
  --btn-press:      inset 0 2px 5px color-mix(in srgb, var(--paper-lo) 70%, transparent);
}

:where([data-app-theme="pennapay"]) .btn {
  justify-content: center;
  text-align: center;
  background-color: var(--btn-fill, transparent);
  color: var(--btn-text, inherit);
  border-color: var(--btn-line, transparent);
  box-shadow: var(--btn-shadow, none);
  transition: background-color .15s, box-shadow .15s, color .15s, border-color .15s;
}

/* Light: the app's interactive green (--accent → --pp-app-accent-interactive),
   softened. Rune picked the green fill on 2026-10-03 ("Option B"), then found
   the solid version so vibrant that fields and borders looked faded next to
   it, and picked the "softer" tone the same day: the green mixed 15% toward
   the page ground, flat (no sheen), a small shadow, and the full green on
   hover. White --on-gold text is 5.10:1 on the default fill and 7.44:1 on
   hover (measured on /dev/button-states.html). */
:where([data-app-theme="pennapay"]) .btn-primary {
  --btn-fill:        color-mix(in srgb, var(--accent) 85%, var(--paper));
  --btn-fill-hover:  var(--accent);
  --btn-fill-active: var(--accent-dark);   /* darker green in light */
  --btn-text:        var(--on-gold);
  --btn-line:        transparent;
  --btn-ring:        var(--on-gold);
  --btn-shadow:      var(--shadow-sm);
  --btn-shadow-hover: var(--shadow);
}
/* Dark: gold, softened the same way — 15% toward the ground (--paper-lo
   text 5.99:1), full gold on hover (7.83:1). Unlike the rest
   of this block it keeps the old [data-theme="dark"] .btn-primary weight
   (0,2,0): that rule always beat a page's own `.btn-primary { color: white }`,
   and white on gold fails contrast, so the colours (and the state rules that
   must outrank them) stay one step heavier. */
:where([data-app-theme="pennapay"])[data-theme="dark"] .btn-primary {
  --btn-fill:        color-mix(in srgb, var(--accent) 85%, var(--paper));
  --btn-fill-hover:  var(--accent);
  --btn-fill-active: color-mix(in srgb, var(--accent) 70%, var(--paper));
  --btn-text:        var(--paper-lo);
  --btn-line:        transparent;
  --btn-ring:        var(--paper-lo);
  background-color: var(--btn-fill);
  color: var(--btn-text);
  border-color: var(--btn-line);
}
:where([data-app-theme="pennapay"])[data-theme="dark"] :where(.btn-primary):is(:hover, .is-hover) {
  background-color: var(--btn-fill-hover);
}
:where([data-app-theme="pennapay"])[data-theme="dark"] :where(.btn-primary):is(:active, .is-active) {
  background-color: var(--btn-fill-active);
}
:where([data-app-theme="pennapay"])[data-theme="dark"] :where(.btn-primary):is(:disabled, [aria-disabled="true"]) {
  background-color: var(--paper-lo);
  color: var(--muted);
  border-color: var(--rule);
}

:where([data-app-theme="pennapay"]) .btn-ghost {
  --btn-fill:        transparent;
  --btn-fill-hover:  color-mix(in srgb, var(--ink) 6%, transparent);
  --btn-fill-active: color-mix(in srgb, var(--ink) 12%, transparent);
  --btn-text:        var(--ink);
  --btn-line:        var(--ink);
  --btn-ring:        var(--gold);
  --btn-shadow:      0 1px 2px color-mix(in srgb, var(--ink) 10%, transparent);
  --btn-shadow-hover: var(--btn-elev);
}
:where([data-app-theme="pennapay"][data-theme="dark"]) .btn-ghost {
  --btn-shadow:      var(--btn-elev);
  --btn-shadow-hover: var(--btn-elev-hover);
}

/* More variants (app shell) — same state machinery, different --btn-* values.
   .btn-quiet:        low-emphasis (remove ✕, close, secondary thread actions)
   .btn-danger-solid: every destructive action (Delete, Remove, Disable 2FA,
                      Disconnect, the confirm dialog's red button): filled red */
:where([data-app-theme="pennapay"]) .btn-quiet {
  --btn-fill:        transparent;
  --btn-fill-hover:  color-mix(in srgb, var(--ink) 6%, transparent);
  --btn-fill-active: color-mix(in srgb, var(--ink) 12%, transparent);
  --btn-text:        var(--muted);
  --btn-line:        transparent;
  --btn-ring:        var(--gold);
  --btn-shadow-hover: none;
}
:where([data-app-theme="pennapay"]) .btn-quiet:is(:hover, .is-hover):not(:disabled, [aria-disabled="true"]) { color: var(--ink); }
:where([data-app-theme="pennapay"]) .btn-danger-solid {
  --btn-fill:        var(--danger);
  --btn-fill-hover:  color-mix(in srgb, var(--danger) 88%, var(--btn-sheen));
  --btn-fill-active: color-mix(in srgb, var(--danger) 82%, var(--ink));
  --btn-text:        var(--paper);
  --btn-line:        transparent;
  --btn-ring:        var(--paper);
  --btn-shadow:      var(--btn-elev), inset 0 1px 0 color-mix(in srgb, var(--btn-sheen) 22%, transparent);
  --btn-shadow-hover: var(--btn-elev-hover), inset 0 1px 0 color-mix(in srgb, var(--btn-sheen) 26%, transparent);
  background-image: linear-gradient(to bottom, color-mix(in srgb, var(--btn-sheen) 14%, transparent), transparent 60%);
}
/* Dark: --btn-sheen is the light ink, so the shared pressed mix would wash the red
   out toward pink; pressed goes deeper (toward the dark ground) instead. */
:where([data-app-theme="pennapay"][data-theme="dark"]) .btn-danger-solid {
  --btn-fill-active: color-mix(in srgb, var(--danger) 80%, var(--paper-lo));
}

/* Hover — brighter fill, raised shadow */
:where([data-app-theme="pennapay"]) :where(.btn):is(:hover, .is-hover) {
  background-color: var(--btn-fill-hover, var(--btn-fill, transparent));
  box-shadow: var(--btn-shadow-hover, var(--btn-shadow, none));
  transform: none;
}

/* Pressed — pushed in: the outer shadow and top sheen give way to an inset one */
:where([data-app-theme="pennapay"]) :where(.btn):is(:active, .is-active) {
  background-color: var(--btn-fill-active, var(--btn-fill, transparent));
  background-image: none;
  box-shadow: var(--btn-press);
  transform: none;
}

/* Keyboard focus — a second outline inside the pill, offset 3px from the edge.
   --btn-ring is chosen per variant for ≥3:1 against that variant's fill
   (WCAG 2.4.7 / 1.4.11). */
:where([data-app-theme="pennapay"]) :where(.btn):is(:focus-visible, .is-focus) {
  outline: 2px solid var(--btn-ring, var(--gold));
  outline-offset: -5px;
}

/* Disabled — flat grey, no depth, clearly not clickable. Comes last so it
   beats hover/pressed at equal specificity. */
:where([data-app-theme="pennapay"]) :where(.btn):is(:disabled, [aria-disabled="true"]) {
  background-color: var(--paper-lo);
  background-image: none;
  color: var(--muted);
  border-color: var(--rule);
  box-shadow: none;
  cursor: not-allowed;
}

/* Sizes. Default .btn is .9rem / 10px 18px / 36px tall. */
.btn-lg { font-size: .95rem; padding: 12px 20px; min-height: 44px; }
.btn-sm { font-size: .8rem; padding: 6px 12px; min-height: 30px; }
.btn-xs { font-size: .74rem; padding: 4px 9px; min-height: 26px; gap: 4px; }

/* The hidden attribute must win over .btn's display:inline-flex. */
.btn[hidden], .btn.u-hidden { display: none; }

/* Full-width button (auth cards, stacked mobile actions) */
.btn-block { width: 100%; }

/* List-row button: label at the left, detail (size, date) at the right. */
.btn.btn-split { justify-content: space-between; text-align: left; gap: 10px; }

/* A row of buttons: wraps instead of colliding, with a fixed gap. */
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Wrapper that lets a wide table scroll sideways on a phone instead of pushing
   the page (and the card edges) past the screen. */
.table-scroll { position: relative; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Overflow menu ("⋯", phones) — js/overflow-menu.js ──
   At <=600px a container marked data-overflow="sm" moves its secondary
   actions into one menu. The moved nodes keep their own handlers; the rules
   below only restyle them while they sit in the menu (two classes, so they beat
   .btn variants, dark .btn-primary and page rules like `.row-actions a`).
   The menu opens in the top layer (popover="manual"); the z-index only
   matters for browsers without the Popover API: above the Feedback launcher
   (1200), below the toast (1250) and the feedback modal (1300). Placement
   keeps it clear of the sticky top bar, the launcher and the mobile nav. */
.ofm { display: inline-flex; flex-shrink: 0; }
.ofm .ofm-trigger {
  min-width: 40px;
  min-height: 36px;
  padding: 2px 10px;
  font-size: 1.2rem;
  line-height: 1;
}
.ofm-menu {
  position: fixed;
  inset: auto;                   /* [popover] UA style centres it (inset:0; margin:auto) */
  top: 0;
  left: 0;
  z-index: 1210;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  max-width: calc(100vw - 16px);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper-hi);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: left;
  white-space: normal;
}
.ofm-menu[hidden] { display: none; }
.ofm-menu[popover]:not(:popover-open) { display: none; }
.ofm-menu .ofm-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 0 !important;          /* rows carry inline margin-left spacing */
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: .92rem !important;  /* rows carry inline font-size */
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none !important;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  cursor: pointer;
  opacity: 1;
  transform: none;
}
.ofm-menu .ofm-item:is([hidden], .u-hidden) { display: none; }
.ofm-menu .ofm-item:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  box-shadow: none;
}
.ofm-menu .ofm-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.ofm-menu .ofm-item.ofm-danger { color: var(--danger); }
.ofm-menu .ofm-item.ofm-danger:is(:hover, :focus-visible) { background: var(--danger-bg); color: var(--danger); }
.ofm-menu .ofm-item:is(:disabled, [aria-disabled="true"]) { background: transparent; color: var(--muted); cursor: not-allowed; }
/* A symbol-only action (✕) shows its data-overflow-label text in the menu. */
.ofm-menu .ofm-item[data-overflow-label] { font-size: 0 !important; }
.ofm-menu .ofm-item[data-overflow-label]::after { content: attr(data-overflow-label); font-size: .92rem; }
.ofm-menu .ofm-sep { height: 1px; margin: 4px 6px; background: var(--rule); flex-shrink: 0; }
/* Grouped menu (data-overflow-groups): labelled sections, a hairline between the
   visible ones. The header is decoration (aria-hidden); the group is named by
   aria-label. A group with no visible action carries [hidden]. */
.ofm-menu .ofm-group { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.ofm-menu .ofm-group[hidden] { display: none; }
.ofm-menu .ofm-group:not([hidden]) ~ .ofm-group:not([hidden]) {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--rule);
}
.ofm-menu .ofm-group-label {
  padding: 6px 14px 2px;
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
/* The actions cell of a table row stays on screen: pinned to the right edge of
   the scroller, with a soft edge over the columns that scroll beneath it. */
.ofm-cell {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--paper-hi);
  box-shadow: -10px 0 10px -10px color-mix(in srgb, var(--ink) 40%, transparent);
}
th.ofm-cell { z-index: 2; }
.ofm-cell.ofm-open { z-index: 6; }
/* Two classes: beats page rules that make the actions <td> a flex box (which
   would drop it out of the table grid and leave a part-height sticky box). */
:is(td, th).ofm-cell.ofm-cell { display: table-cell; vertical-align: middle; padding-left: 10px; padding-right: 12px; }

/* Spacing utilities — replace one-off inline margins on buttons. */
.u-mt-1 { margin-top: 4px; }
.u-mt-2 { margin-top: 8px; }
.u-mt-3 { margin-top: 12px; }
.u-mt-4 { margin-top: 16px; }
.u-mb-4 { margin-bottom: 16px; }
.u-mb-8 { margin-bottom: 32px; }
.u-mb-2 { margin-bottom: 8px; }
.u-ml-2 { margin-left: 8px; }
.u-ml-4 { margin-left: 16px; }
.u-ml-auto { margin-left: auto; }
.u-flex-1 { flex: 1; }
.u-shrink-0 { flex-shrink: 0; }

/* ── Toast (shared) ──
   One transient status message, bottom-right. Markup: an element with class
   "toast" (plus "success" or "error"), revealed by adding "show". Pages may
   keep a static <div class="toast" role="status" aria-live="polite"> and
   toggle .show, or create one per message — js/utils.js showToast() does the
   latter.

   Stacking: above the Feedback launcher (.pf-launcher, z-index 1200) and
   below the feedback modal (.pf-overlay, 1300). App modals sit at 200–1000,
   so a toast also shows over an open modal — on purpose, it reports what the
   modal just did.
   Position: --pf-launcher-clearance (feedback-widget.css) lifts it clear of
   the launcher, including the launcher's mobile and composer/action-bar
   offsets; pages without the launcher fall back to 24px.
   Colours: inverse ink by default; success/error on the status tokens with
   --paper text (≥4.5:1 in both app themes). */
.toast {
  position: fixed;
  right: 20px;
  bottom: var(--pf-launcher-clearance, 24px);
  z-index: 1250;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  background: var(--toast-bg, var(--ink));
  color: var(--paper);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  translate: 0 8px;
  transition: opacity .2s, translate .2s;
}
.toast.show { opacity: 1; translate: 0 0; }
.toast.success { --toast-bg: var(--success); }
.toast.error { --toast-bg: var(--danger); }
@media (max-width: 768px) {
  .toast { left: 12px; right: 12px; max-width: none; }
}

/* ── Accessibility utilities ── */
.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;
}
fieldset { border: 0; margin: 0; padding: 0; }
fieldset > legend { padding: 0; margin-bottom: 8px; font-weight: 600; }

/* One-time-code (2FA) inputs: the "000000" placeholder is a format hint, not
   a value. Hide it as soon as the field is focused so it does not read as typed
   zeros under the cursor. Add class="code-input" to any code field. */
.code-input:focus::placeholder { color: transparent; }
