/* Generated by docs/ui-refresh/prototype/tools/build_buyer_theme.py */

/* ==========================================================================================
   tokens.css — the design tokens. Raw colour values live ONLY in this file.
   Two themes, one system:  Ink (dark, default)  ·  Paper (light)
   Identity: "Editorial luxury" (lab A) — serif display, refined sans, warm words on a cool page.
   Verified by tools/contrast.py (WCAG 2.2 AA).
   ========================================================================================== */

:root,
[data-bs-theme="dark"] {
  /* Ink: cool blue-black page, paper-warm words */
  --bg: #0b0c11;
  --bg-subtle: #07080d;
  --surface-1: #12131a;
  --surface-2: #1a1b22;
  --surface-3: #23252d;
  --surface-inverse: #f3f0ea;
  --input-bg: #0d0e14;
  --line: rgba(238, 234, 255, 0.09);
  --line-strong: #727380;
  --text-1: #f3f0ea;
  --text-2: #b6b7bf;
  --text-3: #9697a2;
  --text-inverse: #12131a;
  --text-on-accent: #ffffff;
  --text-on-success: #04150c;
  --text-link: #a7afff;

  --accent: #615ce8;
  --accent-hover: #6664ec;
  --accent-active: #544fd6;
  --accent-soft: rgba(110, 106, 240, 0.16);
  --accent-line: rgba(140, 138, 255, 0.34);
  --accent-text: #a7afff;
  --accent-rgb: 97, 92, 232;

  --success: #1fd887;
  --success-hover: #3be09a;
  --success-soft: rgba(31, 216, 135, 0.13);
  --success-line: rgba(31, 216, 135, 0.34);
  --success-text: #5be69d;
  --success-rgb: 31, 216, 135;
  --warning: #f8bd40;
  --warning-soft: rgba(248, 189, 64, 0.13);
  --warning-line: rgba(248, 189, 64, 0.32);
  --warning-text: #f5c761;
  --warning-rgb: 248, 189, 64;
  --danger: #ff6367;
  --danger-soft: rgba(255, 99, 103, 0.14);
  --danger-line: rgba(255, 99, 103, 0.36);
  --danger-text: #fc918e;
  --danger-rgb: 255, 99, 103;
  --info: #56c0fc;
  --info-soft: rgba(86, 192, 252, 0.13);
  --info-line: rgba(86, 192, 252, 0.34);
  --info-text: #77ccff;
  --info-rgb: 86, 192, 252;
  --neutral: #9697a2;
  --neutral-soft: rgba(238, 234, 255, 0.07);
  --neutral-line: rgba(238, 234, 255, 0.16);
  --neutral-text: #b6b7bf;

  /* data series (provisional until the chart pass validates them) */
  --viz-1: #8f8bff;
  --viz-2: #56c0fc;
  --viz-3: #1fd887;
  --viz-4: #f8bd40;
  --viz-5: #ff8a65;
  --viz-6: #f472b6;
  --viz-7: #a3e635;
  --viz-8: #9697a2;
  --viz-grid: rgba(238, 234, 255, 0.08);
  --viz-axis: #9697a2;

  /* elevation: lightness + a top highlight + ambient shadow */
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.5), 0 22px 48px -22px rgba(0, 0, 0, 0.8);
  --shadow-3: 0 0 0 1px rgba(238, 234, 255, 0.08), 0 12px 32px -8px rgba(0, 0, 0, 0.7), 0 32px 64px -24px rgba(0, 0, 0, 0.8);
  --shadow-4: 0 0 0 1px rgba(238, 234, 255, 0.1), 0 24px 80px -12px rgba(0, 0, 0, 0.85);
  --sheen: rgba(255, 255, 255, 0.035);

  --ring-color: #9d9aff;
  --ring: 0 0 0 3px rgba(140, 138, 255, 0.45);
  --overlay: rgba(4, 5, 9, 0.66);
  --glow-accent: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 1px 2px rgba(0, 0, 0, 0.45), 0 12px 28px -10px rgba(97, 92, 232, 0.75);
  --glow-success: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px -12px rgba(31, 216, 135, 0.6);
  --glow-working: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 56px -24px rgba(97, 92, 232, 0.6);
  --glow-ready: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 56px -26px rgba(31, 216, 135, 0.42);
  --grad-brand: linear-gradient(135deg, #8f8bff 0%, #615ce8 42%, #56c0fc 100%);
  --beam: linear-gradient(90deg, rgba(143, 139, 255, 0), #c9c7ff 50%, rgba(86, 192, 252, 0));
  --aurora:
    radial-gradient(62% 78% at 8% -6%, rgba(97, 92, 232, 0.42), rgba(97, 92, 232, 0) 62%),
    radial-gradient(44% 60% at 92% 4%, rgba(86, 160, 252, 0.18), rgba(86, 160, 252, 0) 60%),
    radial-gradient(48% 56% at 74% 108%, rgba(31, 216, 135, 0.15), rgba(31, 216, 135, 0) 62%),
    linear-gradient(180deg, #0e0f18 0%, #0b0c11 100%);
  --grain-opacity: 0.22;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 -0.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --skeleton-a: rgba(238, 234, 255, 0.06);
  --skeleton-b: rgba(238, 234, 255, 0.12);
  --seg-thumb: #23252d;
  --seg-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.5);
  --hover-wash: rgba(238, 234, 255, 0.05);
  --active-wash: rgba(238, 234, 255, 0.08);
}

[data-bs-theme="light"] {
  /* Paper: warm page, ink words */
  --bg: #f4f0e7;
  --bg-subtle: #ece7de;
  --surface-1: #fefcf9;
  --surface-2: #f8f5ef;
  --surface-3: #f0ece4;
  --surface-inverse: #181a24;
  --input-bg: #fffefc;
  --line: rgba(52, 42, 22, 0.11);
  --line-strong: #838078;
  --text-1: #181a24;
  --text-2: #444753;
  --text-3: #60636e;
  --text-inverse: #fefcf9;
  --text-on-accent: #ffffff;
  --text-on-success: #ffffff;
  --text-link: #4639bf;

  --accent: #574cdf;
  --accent-hover: #4d40cf;
  --accent-active: #4336bd;
  --accent-soft: rgba(87, 76, 223, 0.09);
  --accent-line: rgba(87, 76, 223, 0.26);
  --accent-text: #4639bf;
  --accent-rgb: 87, 76, 223;

  --success: #007844;
  --success-hover: #006b3c;
  --success-soft: rgba(0, 120, 68, 0.09);
  --success-line: rgba(0, 120, 68, 0.28);
  --success-text: #006439;
  --success-rgb: 0, 120, 68;
  --warning: #c27c00;
  --warning-soft: rgba(194, 124, 0, 0.14);
  --warning-line: rgba(160, 96, 0, 0.32);
  --warning-text: #844b00;
  --warning-rgb: 194, 124, 0;
  --danger: #d01c25;
  --danger-soft: rgba(208, 28, 37, 0.08);
  --danger-line: rgba(208, 28, 37, 0.28);
  --danger-text: #b00b1a;
  --danger-rgb: 208, 28, 37;
  --info: #0072b0;
  --info-soft: rgba(0, 114, 176, 0.09);
  --info-line: rgba(0, 114, 176, 0.28);
  --info-text: #005c96;
  --info-rgb: 0, 114, 176;
  --neutral: #60636e;
  --neutral-soft: rgba(52, 42, 22, 0.06);
  --neutral-line: rgba(52, 42, 22, 0.16);
  --neutral-text: #444753;

  --viz-1: #574cdf;
  --viz-2: #0072b0;
  --viz-3: #007844;
  --viz-4: #b86e00;
  --viz-5: #c2410c;
  --viz-6: #be185d;
  --viz-7: #4d7c0f;
  --viz-8: #60636e;
  --viz-grid: rgba(52, 42, 22, 0.1);
  --viz-axis: #60636e;

  --shadow-1: 0 1px 1px rgba(60, 46, 20, 0.04), 0 1px 2px rgba(60, 46, 20, 0.06);
  --shadow-2: 0 1px 1px rgba(60, 46, 20, 0.04), 0 3px 6px rgba(60, 46, 20, 0.04), 0 22px 44px -22px rgba(60, 46, 20, 0.26);
  --shadow-3: 0 0 0 1px rgba(52, 42, 22, 0.08), 0 10px 28px -8px rgba(60, 46, 20, 0.22), 0 28px 56px -24px rgba(60, 46, 20, 0.28);
  --shadow-4: 0 0 0 1px rgba(52, 42, 22, 0.1), 0 24px 72px -12px rgba(60, 46, 20, 0.38);
  --sheen: rgba(255, 255, 255, 0);

  --ring-color: #574cdf;
  --ring: 0 0 0 3px rgba(87, 76, 223, 0.32);
  --overlay: rgba(40, 32, 18, 0.42);
  --glow-accent: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(40, 30, 120, 0.32), 0 10px 22px -10px rgba(87, 76, 223, 0.6);
  --glow-success: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(0, 60, 34, 0.32), 0 12px 26px -12px rgba(0, 120, 68, 0.6);
  --glow-working: 0 1px 1px rgba(60, 46, 20, 0.04), 0 3px 6px rgba(60, 46, 20, 0.04), 0 24px 48px -24px rgba(87, 76, 223, 0.42);
  --glow-ready: 0 1px 1px rgba(60, 46, 20, 0.04), 0 3px 6px rgba(60, 46, 20, 0.04), 0 24px 48px -26px rgba(0, 120, 68, 0.36);
  --grad-brand: linear-gradient(135deg, #7c74f5 0%, #574cdf 42%, #0c8fd6 100%);
  --beam: linear-gradient(90deg, rgba(124, 116, 245, 0), #ffffff 50%, rgba(12, 143, 214, 0));
  --aurora:
    radial-gradient(62% 78% at 8% -6%, rgba(87, 76, 223, 0.2), rgba(87, 76, 223, 0) 62%),
    radial-gradient(44% 60% at 92% 4%, rgba(12, 143, 214, 0.12), rgba(12, 143, 214, 0) 60%),
    radial-gradient(48% 56% at 74% 108%, rgba(0, 150, 86, 0.12), rgba(0, 150, 86, 0) 62%),
    linear-gradient(180deg, #f8f4ec 0%, #f4f0e7 100%);
  --grain-opacity: 0.3;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 -0.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --skeleton-a: rgba(52, 42, 22, 0.06);
  --skeleton-b: rgba(52, 42, 22, 0.12);
  --seg-thumb: #fefcf9;
  --seg-shadow: 0 1px 2px rgba(60, 46, 20, 0.14), 0 0 0 1px rgba(52, 42, 22, 0.06);
  --hover-wash: rgba(52, 42, 22, 0.045);
  --active-wash: rgba(52, 42, 22, 0.08);
}

/* ---------- geometry, type, motion, layers: theme-independent ---------- */
:root {
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 999px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-9: 40px;
  --sp-10: 48px;
  --sp-11: 64px;
  --sp-12: 80px;

  /* comfortable density (buyer pages): 16px text, 46px controls, soft radii */
  --fs-body: 16px;
  --control-h-sm: 40px;
  --control-h-md: 46px;
  --control-h-lg: 54px;
  --row-h: 52px;
  --r-ctl: 12px;
  --r-card: 18px;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --font-features: "ss03", "cv05", "calt";
  --font-features-num: "tnum", "ss03", "cv05";
  --font-features-mono: "zero", "calt" 0;
  --display-weight: 460;
  --display-track: -0.024em;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;
  --fs-4xl: 40px;
  --fs-5xl: 62px;
  --lh-tight: 1.04;
  --lh-snug: 1.3;
  --lh-normal: 1.5;

  /* motion: fast, ease-out, never ease-in. Springs come from tools/spring.py and must be used with their own duration. */
  --dur-1: 90ms;
  --dur-2: 150ms;
  --dur-3: 220ms;
  --dur-4: 320ms;
  --dur-5: 480ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
  --ease-emphasized: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
  --ease-spring-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-spring: 410ms;
  --dur-spring-soft: 420ms;

  --z-sticky: 1020;
  --z-drawer: 1045;
  --z-modal: 1055;
  --z-popover: 1070;
  --z-toast: 1090;
  --z-palette: 1100;
}

/* real springs where linear() is supported (Chrome 113, Safari 17.2, Firefox 112); the cubic-beziers above are the fallback */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.0017 0.7%, 0.0068 1.4%, 0.0254 2.8%, 0.0559 4.3%, 0.1006 6%, 0.1433 7.4%, 0.1967 9%, 0.4301 15.5%, 0.5358 18.6%, 0.5866 20.2%, 0.6343 21.8%, 0.6789 23.4%, 0.7176 24.9%, 0.7533 26.4%, 0.7881 28%, 0.8464 31.1%, 0.8946 34.3%, 0.934 37.7%, 0.9647 41.3%, 0.9879 45.3%, 1.0034 49.7%, 1.0122 54.7%, 1.0149 58.9%, 1.0147 64%, 1.0049 84.2%, 1);
    --ease-spring-soft: linear(0, 0.005 1.1%, 0.0204 2.3%, 0.0461 3.6%, 0.0816 5%, 0.1168 6.2%, 0.1615 7.6%, 0.3667 13.6%, 0.4635 16.6%, 0.5144 18.3%, 0.5593 19.9%, 0.6011 21.5%, 0.6398 23.1%, 0.6755 24.7%, 0.7103 26.4%, 0.7704 29.8%, 0.8206 33.3%, 0.8638 37.1%, 0.9017 41.5%, 0.9322 46.4%, 0.9558 51.9%, 0.9729 58.1%, 0.9844 65%, 0.9922 73.4%, 1);
  }
}

/* compact density (admin): 13px text, 32px controls, 40px rows, crisper radii */
:root[data-density="compact"] {
  --fs-body: 13px;
  --control-h-sm: 28px;
  --control-h-md: 32px;
  --control-h-lg: 38px;
  --row-h: 40px;
  --r-ctl: 8px;
  --r-card: 12px;
}

/* ==========================================================================================
   base.css — tokens → Tabler 1.6.1 variables, element defaults, type and effect utilities.
   Loaded after tabler.min.css. Wins by load order and variables, not by !important.
   Our tokens already switch per theme, so one mapping block serves both.
   ========================================================================================== */

:root,
[data-bs-theme="dark"],
[data-bs-theme="light"] {
  /* type */
  --tblr-font-sans-serif: var(--font-sans);
  --tblr-font-monospace: var(--font-mono);
  --tblr-body-font-size: var(--fs-body);
  --tblr-body-line-height: 1.5;

  /* page, surfaces, text */
  --tblr-body-bg: var(--bg);
  --tblr-body-color: var(--text-1);
  --tblr-emphasis-color: var(--text-1);
  --tblr-heading-color: var(--text-1);
  --tblr-secondary: var(--text-2);
  --tblr-secondary-color: var(--text-2);
  --tblr-muted: var(--text-2);
  --tblr-tertiary-color: var(--text-3);
  --tblr-secondary-bg: var(--surface-2);
  --tblr-tertiary-bg: var(--bg-subtle);
  --tblr-bg-surface: var(--surface-1);
  --tblr-bg-surface-primary: var(--surface-1);
  --tblr-bg-surface-secondary: var(--bg-subtle);
  --tblr-bg-surface-tertiary: var(--surface-2);
  --tblr-bg-surface-inverted: var(--surface-inverse);
  --tblr-bg-forms: var(--input-bg);
  --tblr-bg-forms-disabled: var(--bg-subtle);
  --tblr-code-color: var(--text-2);

  /* lines */
  --tblr-border-color: var(--line);
  --tblr-border-color-translucent: var(--line);
  --tblr-border-dark-color: var(--line-strong);
  --tblr-border-active-color: var(--line-strong);

  /* accent */
  --tblr-primary: var(--accent);
  --tblr-primary-rgb: var(--accent-rgb);
  --tblr-primary-fg: var(--text-on-accent);
  --tblr-primary-darken: var(--accent-hover);
  --tblr-primary-lt: var(--accent-soft);
  --tblr-primary-text-emphasis: var(--accent-text);
  --tblr-primary-bg-subtle: var(--accent-soft);
  --tblr-primary-border-subtle: var(--accent-line);
  --tblr-link-color: var(--text-link);
  --tblr-link-hover-color: var(--text-link);
  --tblr-focus-ring-color: var(--ring-color);

  /* status. Blue is "info", never the accent. */
  --tblr-success: var(--success);
  --tblr-success-rgb: var(--success-rgb);
  --tblr-success-fg: var(--text-on-success);
  --tblr-success-darken: var(--success-hover);
  --tblr-success-lt: var(--success-soft);
  --tblr-success-text-emphasis: var(--success-text);
  --tblr-success-bg-subtle: var(--success-soft);
  --tblr-success-border-subtle: var(--success-line);
  --tblr-green: var(--success);
  --tblr-green-lt: var(--success-soft);
  --tblr-teal: var(--success);
  --tblr-teal-lt: var(--success-soft);
  --tblr-lime: var(--success);
  --tblr-lime-lt: var(--success-soft);

  --tblr-warning: var(--warning);
  --tblr-warning-rgb: var(--warning-rgb);
  --tblr-warning-lt: var(--warning-soft);
  --tblr-warning-text-emphasis: var(--warning-text);
  --tblr-warning-bg-subtle: var(--warning-soft);
  --tblr-warning-border-subtle: var(--warning-line);
  --tblr-yellow: var(--warning);
  --tblr-yellow-lt: var(--warning-soft);
  --tblr-orange: var(--warning);
  --tblr-orange-lt: var(--warning-soft);

  --tblr-danger: var(--danger);
  --tblr-danger-rgb: var(--danger-rgb);
  --tblr-danger-lt: var(--danger-soft);
  --tblr-danger-text-emphasis: var(--danger-text);
  --tblr-danger-bg-subtle: var(--danger-soft);
  --tblr-danger-border-subtle: var(--danger-line);
  --tblr-red: var(--danger);
  --tblr-red-lt: var(--danger-soft);
  --tblr-form-invalid-color: var(--danger-text);
  --tblr-form-invalid-border-color: var(--danger);
  --tblr-form-valid-color: var(--success-text);
  --tblr-form-valid-border-color: var(--success);

  --tblr-info: var(--info);
  --tblr-info-rgb: var(--info-rgb);
  --tblr-info-lt: var(--info-soft);
  --tblr-info-text-emphasis: var(--info-text);
  --tblr-info-bg-subtle: var(--info-soft);
  --tblr-info-border-subtle: var(--info-line);
  --tblr-blue: var(--info);
  --tblr-blue-lt: var(--info-soft);
  --tblr-azure: var(--info);
  --tblr-azure-lt: var(--info-soft);
  --tblr-cyan: var(--info);
  --tblr-cyan-lt: var(--info-soft);

  --tblr-indigo: var(--accent);
  --tblr-indigo-lt: var(--accent-soft);
  --tblr-purple: var(--accent);
  --tblr-purple-lt: var(--accent-soft);

  /* shape and depth */
  --tblr-border-radius: var(--r-ctl);
  --tblr-border-radius-sm: var(--r-sm);
  --tblr-border-radius-md: var(--r-ctl);
  --tblr-border-radius-lg: var(--r-card);
  --tblr-border-radius-xl: var(--r-xl);
  --tblr-border-radius-pill: var(--r-full);
  --tblr-box-shadow: var(--shadow-2);
  --tblr-box-shadow-sm: var(--shadow-1);
  --tblr-box-shadow-lg: var(--shadow-3);
  --tblr-shadow-card: var(--shadow-1);
  --tblr-shadow-input: none;
  --tblr-shadow-dropdown: var(--shadow-3);
  --tblr-box-shadow-dropdown: var(--shadow-3);
}

/* ---------- element defaults ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  letter-spacing: -0.006em;
  font-feature-settings: var(--font-features);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: var(--text-1);
  background-color: var(--bg);
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 { letter-spacing: -0.014em; text-wrap: balance; }
p { text-wrap: pretty; }
a { text-underline-offset: 0.18em; }
b, strong { font-weight: 600; }
code, kbd, pre, samp { font-family: var(--font-mono); font-feature-settings: var(--font-features-mono); }

::selection { background: var(--accent-soft); color: var(--text-1); }

:focus-visible { outline: 2px solid var(--ring-color); outline-offset: 2px; }
.form-control:focus, .form-select:focus { border-color: var(--ring-color); box-shadow: var(--ring); }

/* thin, quiet scrollbars on pointer devices */
@media (hover: hover) and (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
}

/* inputs need a border that passes 3:1, so they use the strong line, and never sit under 16px on phones (no iOS zoom) */
.form-control, .form-select { border-color: var(--line-strong); color: var(--text-1); }
.form-control::placeholder { color: var(--text-3); opacity: 1; }
:root:not([data-density="compact"]) .form-control,
:root:not([data-density="compact"]) .form-select { min-height: var(--control-h-md); font-size: 16px; padding-left: 14px; padding-right: 14px; }
.form-label { font-weight: 500; color: var(--text-1); margin-bottom: 7px; }
.form-hint { color: var(--text-2); }

/* ---------- type utilities ---------- */
.ui-display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  line-height: var(--lh-tight);
  font-feature-settings: normal;
  text-wrap: balance;
}
.ui-mono { font-family: var(--font-mono); font-feature-settings: var(--font-features-mono); letter-spacing: -0.01em; }
.ui-num { font-variant-numeric: tabular-nums; font-feature-settings: var(--font-features-num); }
.ui-eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); }
.ui-dim { color: var(--text-2); }
.ui-faint { color: var(--text-3); }
.ui-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- effect utilities (buyer hero moments only; the admin side uses none of these) ---------- */
/* static aurora + grain behind a hero. Put it on a positioned section; content sits above it. */
.ui-aurora { position: relative; isolation: isolate; overflow: hidden; }
.ui-aurora::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--aurora); }
.ui-aurora::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--noise); background-size: 180px 180px; opacity: var(--grain-opacity);
}
/* gradient border: the fill is painted in the padding box, the gradient shows through the transparent border */
.ui-gborder {
  border: 1px solid transparent;
  background: linear-gradient(var(--surface-1), var(--surface-1)) padding-box, var(--grad-brand) border-box;
}
.ui-glow-accent { box-shadow: var(--glow-accent); }
.ui-glow-success { box-shadow: var(--glow-success); }

/* safe areas for phones with a home indicator */
.ui-safe-bottom { padding-bottom: max(var(--sp-4), env(safe-area-inset-bottom)); }

/* ==========================================================================================
   components.css — shared components. Reads tokens only; no raw colour values here.
   New classes are prefixed ui-. Stock Tabler classes are tuned through their own variables.
   Scope classes on <body>:  .ui-buyer (hero light allowed)   .ui-admin (no decoration, ever)
   ========================================================================================== */

/* ---------- brand ---------- */
.ui-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text-1); text-decoration: none; }
.ui-brand-mark { flex: none; width: 26px; height: 26px; color: var(--accent-text); }
.ui-brand-word { font-size: 18px; font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.ui-brand-desc { padding-left: 10px; border-left: 1px solid var(--line-strong); font-size: 12px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; line-height: 1.1; color: var(--text-3); }

/* ---------- buyer shell: top bar and footer ---------- */
.ui-top { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg); border-bottom: 1px solid var(--line); }
.ui-top-in { max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-5); height: 60px; display: flex; align-items: center; gap: var(--sp-4); }
.ui-top-links { margin-left: auto; display: flex; align-items: center; gap: var(--sp-1); }
.ui-top-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.ui-top-link i { font-size: 18px; }
.ui-foot { border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.ui-foot-in { max-width: 1120px; margin: 0 auto; padding: var(--sp-5); display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); align-items: center; }
.ui-foot a { color: var(--text-2); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.ui-foot-note { margin-left: auto; }

/* ---------- card ---------- */
.ui-card {
  background-color: var(--surface-1);
  background-image: linear-gradient(180deg, var(--sheen) 0%, transparent 38%);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
}
.ui-card-pad { padding: var(--sp-7); }
.card { --tblr-card-border-color: var(--line); }

/* icon tile */
.ui-tile { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-md); border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-text); font-size: 20px; }
.ui-tile.is-neutral { border-color: var(--neutral-line); background: var(--neutral-soft); color: var(--text-2); }

/* ---------- buttons: Tabler .btn tuned through its variables ---------- */
.btn {
  --tblr-btn-font-weight: 600;
  --tblr-btn-font-size: 15px;
  --tblr-btn-padding-y: calc((var(--control-h-md) - 1.25rem - 2px) / 2);
  --tblr-btn-padding-x: 18px;
  --tblr-btn-border-radius: var(--r-ctl);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: -0.005em; white-space: nowrap;
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.btn:active:not(:disabled):not(.disabled) { transform: scale(0.97); }
.btn .ti, .btn i { font-size: 18px; margin: 0; }
.btn-sm { --tblr-btn-padding-y: calc((var(--control-h-sm) - 1rem - 2px) / 2); --tblr-btn-padding-x: 12px; --tblr-btn-font-size: 13px; --tblr-btn-border-radius: var(--r-sm); gap: 6px; }
.btn-sm .ti, .btn-sm i { font-size: 16px; }
.btn-lg { --tblr-btn-padding-y: calc((var(--control-h-lg) - 1.5rem - 2px) / 2); --tblr-btn-padding-x: 22px; --tblr-btn-font-size: 16px; --tblr-btn-border-radius: var(--r-ctl); }
.btn-lg .ti, .btn-lg i { font-size: 20px; }
.btn-success { --tblr-btn-color: var(--text-on-success); --tblr-btn-hover-color: var(--text-on-success); --tblr-btn-active-color: var(--text-on-success); }
/* quiet button: surface fill, strong line. The default secondary action. */
.ui-btn-quiet { --tblr-btn-bg: var(--surface-1); --tblr-btn-border-color: var(--line-strong); --tblr-btn-color: var(--text-1); --tblr-btn-font-weight: 500; --tblr-btn-hover-bg: var(--surface-2); --tblr-btn-hover-border-color: var(--line-strong); --tblr-btn-active-bg: var(--surface-3); --tblr-btn-active-border-color: var(--line-strong); }
/* ghost: no chrome until hovered */
.ui-btn-ghost { --tblr-btn-bg: transparent; --tblr-btn-border-color: transparent; --tblr-btn-color: var(--text-2); --tblr-btn-font-weight: 500; --tblr-btn-hover-bg: var(--hover-wash); --tblr-btn-hover-color: var(--text-1); --tblr-btn-active-bg: var(--active-wash); --tblr-btn-box-shadow: none; }
/* hero light: only on buyer pages */
.ui-buyer .btn-primary:not(:disabled) { box-shadow: var(--glow-accent); }
.ui-buyer .btn-success:not(:disabled) { box-shadow: var(--glow-success); }
.btn:disabled, .btn.disabled { box-shadow: none; }

/* copy button: the icon swaps to a check while .is-copied is set (ui.js) */
.ui-copy { position: relative; }
.ui-copy .ui-copy-done { display: none; }
.ui-copy.is-copied .ui-copy-idle { display: none; }
.ui-copy.is-copied .ui-copy-done { display: inline-flex; color: var(--success-text); }

/* ---------- segmented control (role=tablist) with a sliding thumb ---------- */
.ui-seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; background: var(--bg-subtle); border: 1px solid var(--line); border-radius: var(--r-ctl); }
.ui-seg > button { position: relative; z-index: 1; min-height: calc(var(--control-h-md) - 2px); padding: 0 12px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; border-radius: calc(var(--r-ctl) - 3px); cursor: pointer; transition: color var(--dur-2) var(--ease-out); }
.ui-seg > button[aria-selected="true"] { color: var(--text-1); }
/* without JavaScript the selected button carries the thumb itself */
.ui-seg:not(.is-ready) > button[aria-selected="true"] { background: var(--seg-thumb); box-shadow: var(--seg-shadow); }
.ui-seg-thumb { position: absolute; z-index: 0; top: 3px; left: 0; height: calc(100% - 6px); width: var(--seg-w, 0); transform: translateX(var(--seg-x, 0)); background: var(--seg-thumb); box-shadow: var(--seg-shadow); border-radius: calc(var(--r-ctl) - 3px); pointer-events: none; }
.ui-seg.is-animated .ui-seg-thumb { transition: transform var(--dur-3) var(--ease-out), width var(--dur-3) var(--ease-out); }

/* ---------- underline tabs with a sliding indicator ---------- */
.ui-tabs { position: relative; display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tab { position: relative; flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: color var(--dur-2) var(--ease-out); }
.ui-tab i { font-size: 17px; }
.ui-tab[aria-selected="true"] { color: var(--text-1); }
.ui-tabs:not(.is-ready) .ui-tab[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--accent); }
.ui-tabs-ink { position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--ink-w, 0); transform: translateX(var(--ink-x, 0)); background: var(--accent); border-radius: 2px 2px 0 0; pointer-events: none; }
.ui-tabs.is-animated .ui-tabs-ink { transition: transform var(--dur-3) var(--ease-out), width var(--dur-3) var(--ease-out); }
:root[data-density="compact"] .ui-tab { min-height: 36px; font-size: 13px; }

/* ---------- fields ---------- */
.ui-field { display: grid; gap: 7px; }
.ui-field > label, .ui-field-top > label { font-size: 14px; font-weight: 500; color: var(--text-1); margin: 0; }
.ui-field-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); }
.ui-field-top a { font-size: 13px; }
.ui-field-hint { font-size: 13px; color: var(--text-2); }
.ui-field-error { display: none; align-items: center; gap: 6px; font-size: 13px; color: var(--danger-text); }
.ui-field.is-invalid .ui-field-error { display: flex; }
.ui-field.is-invalid .form-control { border-color: var(--danger); }
.ui-field.is-valid .form-control { border-color: var(--success); }
/* password field with a show/hide button inside */
.ui-input-wrap { position: relative; }
.ui-input-wrap .form-control { padding-right: 48px; }
.ui-input-btn { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-3); border-radius: var(--r-ctl); cursor: pointer; font-size: 18px; }

/* six-slot one-time code: one real input stretched over six drawn slots, so paste and autofill just work */
.ui-otp { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ui-otp-slot { height: 56px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--input-bg); font-family: var(--font-mono); font-size: 22px; font-weight: 500; color: var(--text-1); transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.ui-otp-slot.is-active { border-color: var(--ring-color); box-shadow: var(--ring); }
.ui-otp-slot.is-filled { border-color: var(--line-strong); }
.ui-otp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; letter-spacing: 2em; cursor: text; border: 0; background: transparent; }
.ui-otp.is-invalid .ui-otp-slot { border-color: var(--danger); }

/* ---------- status pill ---------- */
.ui-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 24px; padding: 0 9px 0 8px; border: 1px solid var(--pill-line, var(--neutral-line)); border-radius: var(--r-full); background: var(--pill-soft, var(--neutral-soft)); color: var(--pill-text, var(--neutral-text)); font-size: 12.5px; font-weight: 500; line-height: 1; letter-spacing: 0; white-space: nowrap; }
.ui-pill-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--pill-dot, var(--neutral)); }
.ui-pill.is-success { --pill-line: var(--success-line); --pill-soft: var(--success-soft); --pill-text: var(--success-text); --pill-dot: var(--success); }
.ui-pill.is-info { --pill-line: var(--info-line); --pill-soft: var(--info-soft); --pill-text: var(--info-text); --pill-dot: var(--info); }
.ui-pill.is-warning { --pill-line: var(--warning-line); --pill-soft: var(--warning-soft); --pill-text: var(--warning-text); --pill-dot: var(--warning); }
.ui-pill.is-danger { --pill-line: var(--danger-line); --pill-soft: var(--danger-soft); --pill-text: var(--danger-text); --pill-dot: var(--danger); }
.ui-pill.is-accent { --pill-line: var(--accent-line); --pill-soft: var(--accent-soft); --pill-text: var(--accent-text); --pill-dot: var(--accent); }
.ui-pill.is-neutral { --pill-line: var(--neutral-line); --pill-soft: var(--neutral-soft); --pill-text: var(--neutral-text); --pill-dot: var(--neutral); }
/* Tabler badges and status dots the live scripts emit pick up the same look */
.badge { --tblr-badge-border-radius: var(--r-full); --tblr-badge-padding-x: 0.65em; --tblr-badge-padding-y: 0.4em; letter-spacing: 0; }

/* ---------- stepper ---------- */
.ui-steps { list-style: none; margin: 0; padding: 0; }
.ui-steps > li { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; font-size: 15px; color: var(--text-3); }
.ui-steps > li + li::before { content: ""; position: absolute; left: 11px; top: -8px; width: 2px; height: 16px; border-radius: 2px; background: var(--line-strong); opacity: 0.55; }
.ui-steps > li + li::after { content: ""; position: absolute; left: 11px; top: -8px; width: 2px; height: 16px; border-radius: 2px; background: var(--success); transform: scaleY(0); transform-origin: top; }
.ui-steps > li.is-done + li::after { transform: scaleY(1); }
.ui-steps > li.is-done, .ui-steps > li.is-active { color: var(--text-1); }
.ui-steps > li.is-active { font-weight: 500; }
.ui-steps em { font-style: normal; font-size: 13px; font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ui-steps > li.is-active em { color: var(--info-text); }
.ui-steps > li.is-failed em { color: var(--danger-text); }
.ui-step-dot { position: relative; width: 24px; height: 24px; display: grid; place-items: center; border: 1.5px solid var(--line-strong); border-radius: 50%; font-size: 14px; color: transparent; }
.ui-steps > .is-done > .ui-step-dot { border-color: var(--success); background: var(--success); color: var(--text-on-success); }
.ui-steps > .is-active > .ui-step-dot { border-color: var(--info); box-shadow: 0 0 0 4px var(--info-soft); }
.ui-steps > .is-active > .ui-step-dot::after { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--info); }
.ui-steps > .is-failed > .ui-step-dot { border-color: var(--danger); background: var(--danger-soft); color: var(--danger-text); }

/* ---------- result block (the money moment) ---------- */
.ui-result { display: grid; justify-items: start; }
.ui-result-check { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--success-line); border-radius: 50%; background: var(--success-soft); color: var(--success-text); font-size: 20px; }
.ui-result-title { margin: 14px 0 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--fs-3xl); line-height: 1.1; letter-spacing: var(--display-track); color: var(--text-1); }
.ui-result-text { margin: 8px 0 0; max-width: 42ch; font-size: 15px; color: var(--text-2); }

/* ---------- usage meter ---------- */
.ui-meter { display: grid; gap: 8px; }
.ui-meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); font-size: 14px; color: var(--text-2); }
.ui-meter-top b { color: var(--text-1); font-variant-numeric: tabular-nums; }
.ui-meter-track { height: 8px; border-radius: var(--r-full); background: var(--neutral-soft); overflow: hidden; }
.ui-meter-fill { height: 100%; width: 100%; border-radius: var(--r-full); background: var(--success); transform: scaleX(var(--v, 0)); transform-origin: left; }
.ui-meter.is-warning .ui-meter-fill { background: var(--warning); }
.ui-meter.is-danger .ui-meter-fill { background: var(--danger); }
.ui-meter-note { font-size: 13px; color: var(--text-3); }

/* ---------- alerts: soft tint, strong text ---------- */
.ui-note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--note-line, var(--neutral-line)); border-radius: var(--r-md); background: var(--note-soft, var(--neutral-soft)); color: var(--text-1); font-size: 14px; }
.ui-note > i { flex: none; font-size: 18px; line-height: 1.3; color: var(--note-text, var(--text-2)); }
.ui-note.is-danger { --note-line: var(--danger-line); --note-soft: var(--danger-soft); --note-text: var(--danger-text); }
.ui-note.is-warning { --note-line: var(--warning-line); --note-soft: var(--warning-soft); --note-text: var(--warning-text); }
.ui-note.is-info { --note-line: var(--info-line); --note-soft: var(--info-soft); --note-text: var(--info-text); }
.ui-note.is-success { --note-line: var(--success-line); --note-soft: var(--success-soft); --note-text: var(--success-text); }
.ui-note b { font-weight: 600; }

/* ---------- empty state ---------- */
.ui-empty { display: grid; justify-items: center; gap: 10px; padding: var(--sp-10) var(--sp-5); text-align: center; }
.ui-empty-art { width: 56px; height: 56px; display: grid; place-items: center; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); color: var(--text-3); font-size: 26px; }
.ui-empty-title { margin: 6px 0 0; font-size: 16px; font-weight: 600; color: var(--text-1); }
.ui-empty-text { margin: 0; max-width: 40ch; font-size: 14px; color: var(--text-2); }

/* ---------- skeleton ---------- */
.ui-skel { display: block; border-radius: var(--r-xs); background-color: var(--skeleton-a); background-image: linear-gradient(90deg, transparent 0%, var(--skeleton-b) 50%, transparent 100%); background-size: 200% 100%; background-repeat: no-repeat; background-position: 200% 0; }
.ui-skel-line { height: 12px; }
.ui-skel-pill { height: 24px; width: 84px; border-radius: var(--r-full); }

/* ---------- keyboard hint ---------- */
.ui-kbd { min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--bg-subtle); color: var(--text-3); font-family: var(--font-mono); font-size: 12px; line-height: 1; box-shadow: none; }

.dropdown-menu { --tblr-dropdown-border-radius: var(--r-md); --tblr-dropdown-padding-y: 6px; --tblr-dropdown-padding-x: 6px; --tblr-dropdown-bg: var(--surface-3); --tblr-dropdown-link-hover-bg: var(--hover-wash); --tblr-dropdown-link-active-bg: var(--active-wash); --tblr-dropdown-link-active-color: var(--text-1); --tblr-dropdown-font-size: 13px; }
.dropdown-item { border-radius: var(--r-xs); gap: 10px; }
.modal { --tblr-modal-bg: var(--surface-1); --tblr-modal-border-radius: var(--r-xl); --tblr-modal-box-shadow: var(--shadow-4); --tblr-modal-footer-bg: transparent; }
.modal-backdrop { --tblr-backdrop-bg: var(--overlay); --tblr-backdrop-opacity: 1; background: var(--overlay); }

/* Shared interactions for the live buyer header, account forms and dashboard. */
.ui-buyer [hidden] { display: none !important; }
.ui-btn-reset {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .ui-top-link:hover { background: var(--hover-wash); color: var(--text-1); }
}
@media (max-width: 575.98px) {
  .ui-top-in { height: 56px; padding-inline: var(--sp-4); }
  .ui-top-link span, .ui-brand-desc { display: none; }
  .ui-card-pad { padding: var(--sp-5); }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active:not(:disabled):not(.disabled) { transform: none; }
}
