/* ============================================================
   Abizvo design tokens
   Modular visual language derived from the logo's clipped facets.
   ============================================================ */

:root {
  /* Brand palette */
  --ab-graphite: #101827;
  --ab-navy: #17243A;
  /* #4568FF with white text measured 4.48:1, just under AA's 4.5; one step
     darker reads as the same blue and carries white at 4.54:1. */
  --ab-blue: #4467FF;
  --ab-turquoise: #16C7B7;
  --ab-lime: #B8F34B;
  --ab-surface: #F3F6FB;
  --ab-border: #D9E1EC;
  --ab-muted: #5E6B7D;
  --ab-white: #FFFFFF;

  /* Derived tints */
  --ab-blue-600: #3352d9;
  --ab-blue-100: #e6ebff;
  --ab-turquoise-100: #dcf7f4;
  --ab-lime-100: #f2fbdd;
  --ab-danger: #d64550;
  --ab-danger-100: #fbe7e9;
  --ab-warning: #c07f10;
  --ab-warning-100: #fdf3e0;
  --ab-success: #0f9d81;
  --ab-success-100: #ddf5ef;

  /* Semantic (light theme) */
  --bg: var(--ab-white);
  --bg-soft: var(--ab-surface);
  --bg-raised: var(--ab-white);
  --bg-inverse: var(--ab-graphite);
  --text: var(--ab-graphite);
  --text-muted: var(--ab-muted);
  --text-inverse: var(--ab-white);
  --border: var(--ab-border);
  --border-strong: #b9c5d6;
  --accent: var(--ab-blue);
  --accent-contrast: var(--ab-white);
  --accent-soft: var(--ab-blue-100);
  --link: var(--ab-blue-600);

  /* Badge text on its own tint. The portal set these; every other page fell
     back to the brand hues, which read 2.98:1 (green) to 3.67:1 (red) on
     their tints. Each of these is at least 4.5:1 on its -100 tint. */
  --status-success: #0f7b45;
  --status-warning: #8a5600;
  --status-danger: #b3261e;
  --status-lime: #3f6600;
  --status-teal: #0a6e64;

  /* Type scale (minor third-ish, rem-based) */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;
  --fs-4xl: 3.75rem;
  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.6;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Radius — continuous rounded surfaces; pills for controls */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgb(16 24 39 / 0.06);
  --shadow-md: 0 4px 14px rgb(16 24 39 / 0.08);
  --shadow-lg: 0 12px 40px rgb(16 24 39 / 0.14);

  /* Glass surfaces — translucent chrome over the aurora backdrop.
     Light theme leans on borders/shadow (light-on-light transparency
     hurts contrast); dark theme carries the full glass look. */
  --glass-bg: rgb(255 255 255 / 0.55);
  --glass-bg-strong: rgb(255 255 255 / 0.72);
  --glass-border: rgb(16 24 39 / 0.1);
  --glass-highlight: inset 0 1px 0 rgb(255 255 255 / 0.65);
  --glass-shadow: 0 8px 32px rgb(16 24 39 / 0.1);
  --glass-blur: 20px;
  --glass-blur-sm: 12px;
  --glass-fallback: color-mix(in srgb, var(--bg-raised) 96%, transparent);

  /* Aurora backdrop colors */
  --aurora-a: rgb(69 104 255 / 0.12);
  --aurora-b: rgb(22 199 183 / 0.09);
  --aurora-c: rgb(184 243 75 / 0.07);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.4, 1);
  --dur-fast: 120ms;
  --dur-med: 220ms;
  --dur-slow: 400ms;

  /* Page frame. The public header floats 12px from the top and is 62px tall,
     so anything sticky below it sits at --header-offset; --content-max is the
     column the header, every .section and the theme page's sticky bar share. */
  --header-offset: 82px;
  --content-max: 1200px;

  /* Layers */
  --z-sticky: 90; /* in-page sticky bars: above the content, below the header */
  --z-nav: 100;
  --z-drawer: 200;
  --z-dialog: 300;
  --z-toast: 400;

  /* Focus */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--ab-blue) 45%, transparent);

  color-scheme: light;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #111b2e;
  --bg-raised: #16223a;
  --bg-inverse: var(--ab-surface);
  --text: #e8edf6;
  --text-muted: #93a1b5;
  --text-inverse: var(--ab-graphite);
  --border: #24334d;
  --border-strong: #35486b;
  --accent: #6b89ff;
  --accent-contrast: #0b1220;
  --accent-soft: #1c2a4d;
  --link: #8ba3ff;
  --status-success: #4fc38f;
  --status-warning: #e0a94a;
  --status-danger: #f0857c;
  --status-lime: #b8d96a;
  --status-teal: #5fd2c4;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 14px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.55);
  --glass-bg: rgb(255 255 255 / 0.08);
  --glass-bg-strong: rgb(255 255 255 / 0.14);
  --glass-border: rgb(255 255 255 / 0.18);
  --glass-highlight: inset 0 1px 0 rgb(255 255 255 / 0.25);
  --glass-shadow: 0 8px 32px rgb(0 0 0 / 0.35);
  --aurora-a: rgb(69 104 255 / 0.35);
  --aurora-b: rgb(22 199 183 / 0.22);
  --aurora-c: rgb(184 243 75 / 0.1);
  color-scheme: dark;
}

/* Light is the default, full stop. The dark palette above applies only when
   something has set data-theme="dark" — a deliberate choice by the visitor,
   remembered in localStorage.

   This used to also flip on @media (prefers-color-scheme: dark), which meant
   most people never saw the light theme at all: the site followed the operating
   system and the toggle only appeared to work for anyone whose machine was
   already light. Following the OS is a defensible default in general; it is not
   what this product wants. */

/* ============ Portal direction — "Abizvo Portal" (Swiss Bento, cool neutral) ============
   The portal follows one composed direction from Abizvo Design
   (docs/design/portal-direction.md): Swiss Modernism on a bento grid, a
   grotesk, matte surfaces, cool-neutral colour, restrained motion, medium-low
   density. The values below are that direction's tokens written onto the
   names the existing stylesheets already read, so nothing else has to change
   — and they are scoped to a document that holds the portal, so the marketing
   site, the shop and Abizvo Design keep their own grounds. Every pair a reader
   meets (text on each ground, accent on each ground, the accent's own
   contrast, the control boundary) is AA-checked by PortalDirectionTests. */
/* .cx is the customer's side of the same direction — an invoice (/i/{token})
   and the customer portal (/c/{token}) — so it reads these tokens too. */
html:has(.cx),
html:has(.portal) {
  --bg: #f6f8fa;
  --bg-soft: #eceff3;
  --bg-raised: #ffffff;
  --text: #191d22;
  --text-muted: #4c545e;
  --border: #cdd4dc;
  /* The boundary of a control — 3:1 against the raised surface it sits on. */
  --border-strong: #8894a3;
  --accent: #2f63a0;
  --accent-contrast: #ffffff;
  --accent-soft: #e4ecf7;
  --link: #2a5a93;

  /* The rail: a matte surface beside the page, not a dark block against it. */
  --nav-bg: #eceff3;
  --nav-border: #dde3ea;
  --nav-text: #191d22;
  --nav-muted: #5b6470;
  --nav-hover: rgb(16 24 39 / 0.06);
  --nav-active-bg: #e4ecf7;
  --nav-active-text: #2f63a0;
  --nav-logo-filter: none;

  /* Status text that stays legible on the soft ground in both themes. */
  --status-success: #0f7b45;
  --status-warning: #8a5600;
  --status-danger: #b3261e;
  --status-lime: #3f6600;
  --status-teal: #0a6e64;

  /* Shape and elevation: matte — the edge is a hairline, the shadow barely there. */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow-md: 0 2px 8px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 12px 32px rgb(16 24 39 / 0.12);

  /* Motion: two durations for state, one for entrances, one easing. */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 140ms;
  --dur-med: 180ms;
  --dur-slow: 320ms;

  /* Type: page titles and section titles on the direction's scale. */
  --tracking-tight: -0.02em;
  --tracking-caption: 0.01em;
}

/* The customer's invoice is paper — light in both themes, like the PDF —
   and the business's colour carries white text (PdfAccent darkens it until
   white passes AA). These are the same in every theme on purpose. */
:root {
  --cx-on-brand: #fff;
  --cx-paper: #ffffff;
  --cx-ink: #111827;
  --cx-ink-muted: #4b5563;
  --cx-rule: #e5e7eb;
  --cx-wash: #f8fafc;
  --cx-field-border: #cbd5e1;
  --cx-pill-bg: #eef2f7;
  --cx-pill-text: #334155;
  --cx-paid-bg: #dcfce7;
  --cx-paid-text: #166534;
  --cx-overdue-bg: #fee2e2;
  --cx-overdue-text: #991b1b;
  --cx-part-bg: #fef3c7;
  --cx-part-text: #854d0e;
  --cx-closed-bg: #f1f5f9;
  --cx-closed-text: #475569;
}

html:has(.cx)[data-theme="dark"],
html:has(.portal)[data-theme="dark"] {
  --bg: #0f1319;
  --bg-soft: #161b23;
  --bg-raised: #1b2129;
  --text: #e6eaf0;
  --text-muted: #9aa5b4;
  --border: #2a323d;
  --border-strong: #66738a;
  --accent: #7fa6e6;
  --accent-contrast: #0f1319;
  --accent-soft: #1e2b40;
  --link: #93b4ec;

  --nav-bg: #0b0e13;
  --nav-border: #1d232c;
  --nav-text: #e6eaf0;
  --nav-muted: #8c97a6;
  --nav-hover: rgb(255 255 255 / 0.06);
  --nav-active-bg: #1e2b40;
  --nav-active-text: #a9c4f0;
  --nav-logo-filter: brightness(0) invert(1);

  --status-success: #4fc38f;
  --status-warning: #e0a94a;
  --status-danger: #f0857c;
  --status-lime: #b8d96a;
  --status-teal: #5fd2c4;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 2px 8px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.55);
}

/* ============ Base reset ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* One surface paints the page. Glass panes refract whatever is behind
     them, so a second opaque fill on body would be the thing they sample
     — and the aurora would never show through. */
  background: var(--bg);
  /* In-page jumps (anchors, scrollIntoView, skip links) glide rather than
     teleport. The prefers-reduced-motion block below forces this back to
     `auto`, which is not optional: smooth scrolling is a motion effect, and
     for a reader with vestibular sensitivity an unasked-for animated scroll
     is the symptom, not the polish. */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: transparent;
}

img,
svg {
  max-width: 100%;
  display: block;
}

/* The `hidden` attribute only hides things because the UA stylesheet says
   `[hidden] { display: none }` — and any author `display` rule outranks it.
   Two already exist above and below (`svg` here, `.btn` further down), so a
   hidden icon or a hidden button stayed on screen while its `.hidden` property
   read true. Restated here with the weight to actually win. */
[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  line-height: var(--lh-tight);
  margin: 0 0 var(--sp-4);
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 var(--sp-4);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* The router moves focus to the page's heading after every navigation
   (FocusOnNavigate, for a screen reader's sake), and a focus nobody made with
   a pointer counts as focus-visible — so every page opened with a ring drawn
   round its own title. A heading is not a control: it takes the focus and
   shows nothing. */
h1[tabindex="-1"]:focus,
h1[tabindex="-1"]:focus-visible {
  outline: none;
  box-shadow: none;
}

@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;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-toast);
  background: var(--accent);
  color: var(--accent-contrast);
  padding: var(--sp-2) var(--sp-4);
}

.skip-link:focus {
  left: var(--sp-2);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 0.625rem 1.375rem;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out), transform var(--dur-slow) var(--ease-spring),
    box-shadow var(--dur-slow) var(--ease-spring);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}

.btn-primary:hover {
  background: var(--ab-blue-600);
  color: var(--ab-white);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.btn-danger {
  background: var(--ab-danger);
  color: #fff;
}

.btn-lime {
  background: var(--ab-lime);
  color: var(--ab-graphite);
  box-shadow: 0 4px 16px rgb(184 243 75 / 0.25);
}

.btn-lime:hover {
  background: #a8e438;
  color: var(--ab-graphite);
  box-shadow: 0 8px 28px rgb(184 243 75 / 0.35);
}

.btn-glass {
  color: var(--text);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur-sm)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur-sm)) saturate(160%);
  border-color: var(--glass-border);
  box-shadow: var(--glass-highlight);
}

.btn-glass:hover {
  background: color-mix(in srgb, var(--glass-bg-strong) 80%, var(--text) 6%);
}

.btn-sm {
  min-height: 34px;
  padding: 0.25rem 0.75rem;
  font-size: var(--fs-xs);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ============ Forms ============ */
.field {
  margin-bottom: var(--sp-4);
}

.field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.field .hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

.input,
input.form-control,
select.form-control,
textarea.form-control {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  min-height: 44px;
  transition: border-color var(--dur-fast) var(--ease-out);
}

textarea.form-control {
  min-height: 96px;
  resize: vertical;
}

/* A file picker is the browser's own control unless something styles it, and
   its "Choose File" button then sits beside our pill buttons looking like a
   different product. The button inside is drawn as .btn-secondary.btn-sm; the
   "No file chosen" text keeps the muted body type. Every area is sent this
   sheet, so one rule covers the portal, the shop and the public forms. */
input[type="file"] {
  max-width: 100%;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

input[type="file"].form-control {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
}

input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-xs);
  min-height: 34px;
  padding: 0.25rem 0.875rem;
  margin-inline-end: var(--sp-3);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

input[type="file"]:hover::file-selector-button {
  border-color: var(--accent);
  color: var(--accent);
}

input[type="file"]:disabled::file-selector-button {
  opacity: 0.55;
  cursor: not-allowed;
}

.input:focus,
.form-control:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: var(--focus-ring);
}

.validation-message,
.field-error {
  color: var(--ab-danger);
  font-size: var(--fs-xs);
  margin-top: var(--sp-1);
}

.alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
}

.alert-error {
  background: var(--ab-danger-100);
  border-color: var(--ab-danger);
  color: #7c1f27;
}

.alert-success {
  background: var(--ab-success-100);
  border-color: var(--ab-success);
  color: #0b5e4d;
}

/* Warning tone. The --ab-warning tokens already existed; this is the alert
   variant that was missing, used where something needs attention before it is
   relied on (unmapped GIFI codes, preparation-aid disclaimers). */
.alert-warning {
  background: var(--ab-warning-100);
  border-color: var(--ab-warning);
  color: #7a4f00;
}

.alert-info {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

/* ============ Badges & cards ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge-blue { background: var(--accent-soft); color: var(--link); }
.badge-green { background: var(--ab-success-100); color: var(--status-success, var(--ab-success)); }
.badge-lime { background: var(--ab-lime-100); color: var(--status-lime, #4a7000); }
.badge-amber { background: var(--ab-warning-100); color: var(--status-warning, var(--ab-warning)); }
.badge-red { background: var(--ab-danger-100); color: var(--status-danger, var(--ab-danger)); }
.badge-teal { background: var(--ab-turquoise-100); color: var(--status-teal, #0a7d72); }

[data-theme="dark"] .badge-green,
[data-theme="dark"] .badge-lime,
[data-theme="dark"] .badge-amber,
[data-theme="dark"] .badge-red,
[data-theme="dark"] .badge-teal {
  background: var(--bg-soft);
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}

/* Highlighted card (formerly clipped-corner; motif retired for rounded) */
.card-clip {
  border-radius: var(--radius-lg);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

/* ============ Tables ============ */
.table-wrap {
  overflow-x: auto;
  /* A `.visually-hidden` label is absolutely positioned, and an absolutely
     positioned child escapes a scroller unless the scroller is itself
     positioned — it then sits at its unclipped spot past the viewport and a
     phone widens the page to it (Inventory read 422px at 375). */
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

table.data th {
  text-align: left;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  white-space: nowrap;
}

table.data td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

table.data .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.data a.row-link {
  color: var(--text);
  font-weight: 600;
}

/* ============ Glass surfaces ============ */
.glass,
.glass-strong {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  border-radius: var(--radius-lg);
}

/* Higher-opacity tier — required under body text and data */
.glass-strong {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur-sm)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur-sm)) saturate(160%);
}

.glass-lift {
  transition: transform var(--dur-slow) var(--ease-spring), box-shadow var(--dur-slow) var(--ease-spring);
}

.glass-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-highlight), 0 18px 44px color-mix(in srgb, var(--glass-shadow) 100%, transparent);
}

/* No backdrop-filter → opaque raised surface */
@supports not (backdrop-filter: blur(1px)) {
  .glass,
  .glass-strong,
  .btn-glass {
    background: var(--glass-fallback);
  }
}

/* User prefers opacity → same opaque fallback, no blur cost */
@media (prefers-reduced-transparency: reduce) {
  .glass,
  .glass-strong,
  .btn-glass {
    background: var(--glass-fallback);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ============ Aurora backdrop ============ */
/* Apply to a layout root; paints a fixed gradient field behind content.
   Cheap: static radial gradients + one slowly drifting pseudo-element. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 15% 10%, var(--aurora-a), transparent 65%),
    radial-gradient(50% 45% at 85% 20%, var(--aurora-b), transparent 65%),
    radial-gradient(45% 40% at 70% 90%, var(--aurora-c), transparent 60%);
}

.aurora::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(35% 30% at 30% 60%, var(--aurora-a), transparent 70%),
    radial-gradient(30% 30% at 75% 40%, var(--aurora-b), transparent 70%);
  opacity: 0.6;
  animation: aurora-drift 26s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  from {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }

  to {
    transform: translate3d(3%, 3%, 0) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aurora::after {
    animation: none;
  }
}

/* ============ Utility ============ */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--ab-danger); }
.text-success { color: var(--ab-success); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.flex { display: flex; align-items: center; gap: var(--sp-3); }
/* A row of buttons that does not fit a phone must wrap, not widen the page:
   a flex row never clips, the browser widens its layout viewport to the row
   (tax returns read 382px at 375). Wide screens keep the single line. */
@media (max-width: 880px) { .flex { flex-wrap: wrap; } }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
