/*! FynFox UI kit — the design system every app Fox writes may use (served at /fynfox-ui.css from the app's own address).
 * Tokens (--fx-*) + six styles (html[data-fx-style="clean|soft|bold|editorial|dark|glass"]) + polished parts (.fx-*).
 * Fox sets the business's own palette and fonts as tokens in :root; the owner's theme (FynFox builder) is applied on
 * top. Everything works without JavaScript; /fynfox-ui.js adds the same parts as React components. */
@import url("/fynfox-fonts.css");

/* Order of strength (lowest first): these defaults → the chosen style → the business's own :root tokens (Fox) → the
 * owner's theme (inline on <html>). Defaults and styles use :where() so an app's plain :root always wins. */
:where(:root) {
  --fx-bg: #f7f7f9;
  --fx-surface: #ffffff;
  --fx-surface-2: #f2f3f6;
  --fx-text: #14161c;
  --fx-muted: #636878;
  --fx-border: #e3e5ec;
  --fx-primary: #4b3fc4;
  --fx-on-primary: #ffffff;
  --fx-soft: color-mix(in srgb, var(--fx-primary) 11%, var(--fx-surface));
  --fx-success: #14804a;
  --fx-warning: #b25e09;
  --fx-danger: #c8323a;
  --fx-info: #1f6fd1;
  --fx-radius: 12px;
  --fx-radius-sm: calc(var(--fx-radius) * 0.66);
  --fx-radius-lg: calc(var(--fx-radius) * 1.5);
  --fx-shadow: 0 1px 2px rgb(16 18 27 / 0.05), 0 4px 14px rgb(16 18 27 / 0.06);
  --fx-shadow-lg: 0 2px 6px rgb(16 18 27 / 0.06), 0 18px 48px rgb(16 18 27 / 0.12);
  --fx-border-w: 1px;
  --fx-font-head: "FynFox Inter Tight", "FynFox Inter", system-ui, sans-serif;
  --fx-font-body: "FynFox Inter", system-ui, sans-serif;
  --fx-head-weight: 700;
  --fx-head-track: -0.02em;
  --fx-space: 1;
  --fx-gap: calc(16px * var(--fx-space));
  --fx-pad: calc(20px * var(--fx-space));
  --fx-focus: 0 0 0 3px color-mix(in srgb, var(--fx-primary) 35%, transparent);
  --fx-card-bg: var(--fx-surface);
  --fx-card-blur: none;
  --fx-sidebar: var(--fx-surface);
  color-scheme: light;
}

/* ---------- the six styles ---------- */
/* A style the OWNER chose (FynFox's Theme) wins over the app's own surface colours; the brand colour stays. */
html[data-fx-owner][data-fx-style="clean"] {
  --fx-bg: #f7f7f9; --fx-surface: #ffffff; --fx-surface-2: #f2f3f6; --fx-text: #14161c; --fx-muted: #636878; --fx-border: #e3e5ec;
  --fx-radius: 12px; --fx-border-w: 1px; --fx-card-bg: var(--fx-surface); --fx-card-blur: none;
  --fx-shadow: 0 1px 2px rgb(16 18 27 / 0.05), 0 4px 14px rgb(16 18 27 / 0.06);
  --fx-font-head: "FynFox Inter Tight", "FynFox Inter", system-ui, sans-serif; --fx-font-body: "FynFox Inter", system-ui, sans-serif;
  --fx-head-weight: 700; color-scheme: light;
}
:where(html[data-fx-style="soft"]),
html[data-fx-owner][data-fx-style="soft"] {
  --fx-bg: #f6f2ee;
  --fx-surface-2: #f3ede7;
  --fx-border: #ece4dc;
  --fx-radius: 20px;
  --fx-shadow: 0 2px 6px rgb(60 40 20 / 0.04), 0 12px 32px rgb(60 40 20 / 0.07);
  --fx-shadow-lg: 0 4px 10px rgb(60 40 20 / 0.05), 0 28px 64px rgb(60 40 20 / 0.12);
  --fx-border-w: 0px;
  --fx-font-head: "FynFox Figtree", system-ui, sans-serif;
  --fx-font-body: "FynFox Figtree", system-ui, sans-serif;
  --fx-head-weight: 700;
  --fx-head-track: -0.015em;
}
:where(html[data-fx-style="bold"]),
html[data-fx-owner][data-fx-style="bold"] {
  --fx-bg: #ffffff;
  --fx-surface-2: #f1f1f1;
  --fx-text: #0b0b0d;
  --fx-border: #0b0b0d;
  --fx-radius: 6px;
  --fx-border-w: 2px;
  --fx-shadow: 4px 4px 0 #0b0b0d;
  --fx-shadow-lg: 8px 8px 0 #0b0b0d;
  --fx-font-head: "FynFox Archivo", "FynFox Inter", system-ui, sans-serif;
  --fx-font-body: "FynFox Inter", system-ui, sans-serif;
  --fx-head-weight: 800;
  --fx-head-track: -0.03em;
}
:where(html[data-fx-style="editorial"]),
html[data-fx-owner][data-fx-style="editorial"] {
  --fx-bg: #fbfaf7;
  --fx-surface-2: #f4f1ea;
  --fx-text: #1a1814;
  --fx-muted: #6b665c;
  --fx-border: #e2ddd2;
  --fx-radius: 3px;
  --fx-shadow: none;
  --fx-shadow-lg: 0 20px 50px rgb(26 24 20 / 0.12);
  --fx-font-head: "FynFox Instrument Serif", "FynFox Newsreader", Georgia, serif;
  --fx-font-body: "FynFox Hanken Grotesk", system-ui, sans-serif;
  --fx-head-weight: 400;
  --fx-head-track: -0.01em;
  --fx-space: 1.15;
}
:where(html[data-fx-style="dark"]),
html[data-fx-owner][data-fx-style="dark"] {
  --fx-bg: #0d0f14;
  --fx-surface: #151821;
  --fx-surface-2: #1c202b;
  --fx-text: #eef0f6;
  --fx-muted: #9aa0b1;
  --fx-border: #272c39;
  --fx-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  --fx-shadow-lg: 0 24px 60px rgb(0 0 0 / 0.55);
  --fx-success: #3ccf8e;
  --fx-warning: #f3a64a;
  --fx-danger: #ff6b72;
  --fx-info: #5aa7ff;
  --fx-font-head: "FynFox Sora", system-ui, sans-serif;
  color-scheme: dark;
}
:where(html[data-fx-style="glass"]),
html[data-fx-owner][data-fx-style="glass"] {
  --fx-bg: #eef1fb;
  --fx-surface: rgb(255 255 255 / 0.72);
  --fx-surface-2: rgb(255 255 255 / 0.55);
  --fx-border: rgb(255 255 255 / 0.7);
  --fx-radius: 18px;
  --fx-card-bg: rgb(255 255 255 / 0.62);
  --fx-card-blur: blur(18px) saturate(1.4);
  --fx-shadow: 0 1px 1px rgb(30 40 90 / 0.04), 0 12px 40px rgb(30 40 90 / 0.1);
  --fx-font-head: "FynFox DM Sans", system-ui, sans-serif;
  --fx-font-body: "FynFox DM Sans", system-ui, sans-serif;
}
html[data-fx-style="glass"] body {
  background:
    radial-gradient(60rem 40rem at 10% -10%, color-mix(in srgb, var(--fx-primary) 22%, transparent), transparent 60%),
    radial-gradient(50rem 36rem at 110% 10%, color-mix(in srgb, var(--fx-info) 18%, transparent), transparent 60%),
    var(--fx-bg);
  background-attachment: fixed;
}

/* ---------- base ---------- */
.fx-ui, .fx-ui *, .fx-ui *::before, .fx-ui *::after { box-sizing: border-box; }
.fx-ui {
  margin: 0;
  background: var(--fx-bg);
  color: var(--fx-text);
  font-family: var(--fx-font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.fx-ui h1, .fx-ui h2, .fx-ui h3, .fx-ui h4, .fx-h1, .fx-h2, .fx-h3 {
  font-family: var(--fx-font-head);
  font-weight: var(--fx-head-weight);
  letter-spacing: var(--fx-head-track);
  line-height: 1.12;
  margin: 0 0 0.4em;
  color: var(--fx-text);
}
.fx-h1, .fx-ui h1 { font-size: clamp(28px, 4vw, 44px); }
.fx-h2, .fx-ui h2 { font-size: clamp(22px, 2.6vw, 30px); }
.fx-h3, .fx-ui h3 { font-size: 18px; }
.fx-ui p { margin: 0 0 0.8em; }
/* Plain links only (zero-strength), so a link styled as a button keeps the button's colours. */
:where(.fx-ui) a:where(:not(.fx-btn)) { color: var(--fx-primary); text-underline-offset: 3px; }
.fx-ui a.fx-btn { text-decoration: none; }
.fx-muted { color: var(--fx-muted); }
.fx-small { font-size: 13px; }
.fx-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fx-muted); }
.fx-num { font-variant-numeric: tabular-nums; }
.fx-ui :focus-visible { outline: none; box-shadow: var(--fx-focus); }
.fx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.fx-container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--fx-pad); }
.fx-stack { display: flex; flex-direction: column; gap: var(--fx-gap); }
.fx-row { display: flex; align-items: center; gap: calc(var(--fx-gap) * 0.75); flex-wrap: wrap; }
.fx-spread { display: flex; align-items: center; justify-content: space-between; gap: var(--fx-gap); flex-wrap: wrap; }
.fx-grid { display: grid; gap: var(--fx-gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--fx-min, 240px)), 1fr)); }
.fx-grid-2 { display: grid; gap: var(--fx-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fx-grid-3 { display: grid; gap: var(--fx-gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fx-grid-4 { display: grid; gap: var(--fx-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .fx-grid-3, .fx-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .fx-grid-2, .fx-grid-3 { grid-template-columns: minmax(0, 1fr); } .fx-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .fx-grid-4 .fx-stat { padding: 14px; } }

/* App shell: sidebar + main (staff tools, dashboards, portals). On phones the sidebar becomes a top bar + menu. */
.fx-app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.fx-sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  background: var(--fx-sidebar); border-right: var(--fx-border-w) solid var(--fx-border);
  backdrop-filter: var(--fx-card-blur);
  padding: calc(var(--fx-pad) * 0.9); display: flex; flex-direction: column; gap: 6px;
}
html[data-fx-style="bold"] .fx-sidebar, html[data-fx-style="soft"] .fx-sidebar { border-right: 1px solid var(--fx-border); }
.fx-brand { display: flex; align-items: center; gap: 10px; font-family: var(--fx-font-head); font-weight: var(--fx-head-weight); font-size: 17px; padding: 6px 8px 18px; color: var(--fx-text); text-decoration: none; }
.fx-brand-mark { width: 30px; height: 30px; border-radius: var(--fx-radius-sm); background: var(--fx-primary); color: var(--fx-on-primary); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.fx-nav { display: flex; flex-direction: column; gap: 2px; }
.fx-nav-label { padding: 14px 10px 6px; }
.fx-nav a, .fx-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--fx-radius-sm);
  color: var(--fx-muted); text-decoration: none; font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left;
}
.fx-nav a:hover, .fx-nav button:hover { background: var(--fx-surface-2); color: var(--fx-text); }
.fx-nav a[aria-current="page"], .fx-nav a.fx-active, .fx-nav button[aria-current="page"] { background: var(--fx-soft); color: var(--fx-primary); font-weight: 600; }
.fx-main { min-width: 0; display: flex; flex-direction: column; }
.fx-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--fx-gap); min-height: 64px;
  padding: 10px var(--fx-pad); background: color-mix(in srgb, var(--fx-bg) 82%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fx-border);
}
.fx-topbar .fx-grow { flex: 1; }
.fx-menu-btn, .fx-btn.fx-menu-btn { display: none; }
.fx-scrim { display: none; }
.fx-page { padding: calc(var(--fx-pad) * 1.3) var(--fx-pad) calc(var(--fx-pad) * 3); max-width: 1240px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: calc(var(--fx-gap) * 1.4); }
.fx-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--fx-gap); flex-wrap: wrap; }
.fx-page-head h1 { margin: 0; }
@media (max-width: 860px) {
  .fx-app { grid-template-columns: minmax(0, 1fr); }
  .fx-sidebar { position: fixed; inset: 0 auto 0 0; width: min(82vw, 300px); z-index: 50; transform: translateX(-105%); transition: transform 0.22s ease; box-shadow: var(--fx-shadow-lg); background: var(--fx-surface); }
  .fx-app.fx-open .fx-sidebar, .fx-sidebar[data-open="true"] { transform: none; }
  .fx-sidebar { background: linear-gradient(var(--fx-surface), var(--fx-surface)), var(--fx-bg); }
  .fx-app.fx-open .fx-scrim { display: block; position: fixed; inset: 0; z-index: 40; border: 0; padding: 0; background: rgb(10 12 20 / 0.38); cursor: pointer; }
  .fx-menu-btn, .fx-btn.fx-menu-btn { display: inline-flex; }
}

/* Simple top navigation (customer portals, booking pages). */
.fx-header { display: flex; align-items: center; justify-content: space-between; gap: var(--fx-gap); padding: 14px var(--fx-pad); max-width: 1180px; margin: 0 auto; }
.fx-header nav { display: flex; flex-direction: row; gap: 4px; flex-wrap: wrap; } /* a row even when Fox also gives it the side menu's .fx-nav (real build 2026-11-17: the menu stood as a column) */
.fx-header nav a { padding: 8px 12px; border-radius: 999px; color: var(--fx-muted); text-decoration: none; font-weight: 500; }
.fx-header nav a:hover, .fx-header nav a[aria-current="page"] { color: var(--fx-text); background: var(--fx-surface-2); }
/* On phones the top menu folds behind the kit's ☰ button (.fx-menu-btn) and opens with .fx-open on the header.
 * Only headers that have that button (apps built before this keep their own menu). */
@media (max-width: 860px) {
  .fx-header:has(.fx-menu-btn) { flex-wrap: wrap; }
  .fx-header .fx-menu-btn, .fx-header .fx-btn.fx-menu-btn { display: inline-flex; }
  .fx-header:has(.fx-menu-btn) nav { display: none; order: 10; width: 100%; flex-direction: column; gap: 2px; padding-top: 8px; }
  .fx-header.fx-open:has(.fx-menu-btn) nav { display: flex; }
  .fx-header:has(.fx-menu-btn) nav a { padding: 12px 14px; border-radius: var(--fx-radius-sm); }
}


/* ---------- surfaces ---------- */
.fx-card {
  background: var(--fx-card-bg); backdrop-filter: var(--fx-card-blur); -webkit-backdrop-filter: var(--fx-card-blur);
  border: var(--fx-border-w) solid var(--fx-border); border-radius: var(--fx-radius);
  box-shadow: var(--fx-shadow); padding: var(--fx-pad); min-width: 0;
}
.fx-card-flat { box-shadow: none; }
.fx-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: calc(var(--fx-gap) * 0.75); }
.fx-card-head h2, .fx-card-head h3 { margin: 0; font-size: 16px; }
.fx-card-link { display: block; color: inherit; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.fx-card-link:hover { transform: translateY(-2px); box-shadow: var(--fx-shadow-lg); }
.fx-divider { height: 1px; background: var(--fx-border); border: 0; margin: var(--fx-gap) 0; }

.fx-stat { display: flex; flex-direction: column; gap: 4px; }
.fx-stat-label { font-size: 13px; color: var(--fx-muted); font-weight: 500; }
.fx-stat-value { font-family: var(--fx-font-head); font-size: clamp(24px, 2.6vw, 32px); font-weight: var(--fx-head-weight); letter-spacing: var(--fx-head-track); font-variant-numeric: tabular-nums; line-height: 1.1; }
.fx-stat-change { font-size: 13px; font-weight: 600; }
.fx-up { color: var(--fx-success); }
.fx-down { color: var(--fx-danger); }

/* ---------- buttons ---------- */
.fx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: calc(var(--fx-radius-sm) + 2px); border: var(--fx-border-w) solid transparent;
  background: var(--fx-primary); color: var(--fx-on-primary); font: inherit; font-weight: 600; font-size: 14px; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
html[data-fx-style="bold"] .fx-btn { border-color: var(--fx-text); box-shadow: 3px 3px 0 var(--fx-text); }
html[data-fx-style="bold"] .fx-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--fx-text); }
html[data-fx-style="soft"] .fx-btn, html[data-fx-style="glass"] .fx-btn { border-radius: 999px; }
.fx-btn:hover { filter: brightness(1.07); }
.fx-btn:active { transform: translateY(1px); }
.fx-btn:disabled, .fx-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; filter: none; transform: none; }
.fx-btn-secondary { background: var(--fx-surface); color: var(--fx-text); border-color: var(--fx-border); }
.fx-btn-secondary:hover { background: var(--fx-surface-2); filter: none; }
.fx-btn-ghost { background: transparent; color: var(--fx-text); box-shadow: none !important; border-color: transparent !important; }
.fx-btn-ghost:hover { background: var(--fx-surface-2); filter: none; }
.fx-btn-soft { background: var(--fx-soft); color: var(--fx-primary); }
.fx-btn-danger { background: var(--fx-danger); color: #fff; }
.fx-btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.fx-btn-lg { min-height: 50px; padding: 0 24px; font-size: 16px; }
.fx-btn-block { width: 100%; }
.fx-btn-icon { width: 40px; padding: 0; }
.fx-btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: fx-spin 0.7s linear infinite; }
@keyframes fx-spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.fx-form { display: flex; flex-direction: column; gap: calc(var(--fx-gap) * 0.9); }
.fx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fx-label { font-size: 13px; font-weight: 600; color: var(--fx-text); }
.fx-help { font-size: 12.5px; color: var(--fx-muted); }
.fx-error-text { font-size: 12.5px; color: var(--fx-danger); font-weight: 500; }
.fx-input, .fx-select, .fx-textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; font: inherit; font-size: 15px; color: var(--fx-text);
  background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
html[data-fx-style="bold"] .fx-input, html[data-fx-style="bold"] .fx-select, html[data-fx-style="bold"] .fx-textarea { border-width: 2px; border-color: var(--fx-text); }
html[data-fx-style="dark"] .fx-input, html[data-fx-style="dark"] .fx-select, html[data-fx-style="dark"] .fx-textarea { background: var(--fx-surface-2); }
.fx-input:focus, .fx-select:focus, .fx-textarea:focus { outline: none; border-color: var(--fx-primary); box-shadow: var(--fx-focus); }
.fx-input[aria-invalid="true"], .fx-select[aria-invalid="true"], .fx-textarea[aria-invalid="true"] { border-color: var(--fx-danger); }
.fx-textarea { min-height: 96px; resize: vertical; }
.fx-select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--fx-muted) 50%), linear-gradient(135deg, var(--fx-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.fx-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.fx-check input { width: 18px; height: 18px; accent-color: var(--fx-primary); }
.fx-search { position: relative; }
.fx-search .fx-input { padding-left: 36px; }
.fx-search::before { content: ""; position: absolute; left: 13px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border: 2px solid var(--fx-muted); border-radius: 50%; }
.fx-search::after { content: ""; position: absolute; left: 24px; top: 50%; width: 6px; height: 2px; margin-top: 4px; background: var(--fx-muted); transform: rotate(45deg); }

/* ---------- tables (rows become cards on phones: each cell needs data-label) ---------- */
.fx-table-wrap { overflow-x: auto; border: var(--fx-border-w) solid var(--fx-border); border-radius: var(--fx-radius); background: var(--fx-card-bg); box-shadow: var(--fx-shadow); }
.fx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fx-table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fx-muted); padding: 12px 16px; background: var(--fx-surface-2); border-bottom: 1px solid var(--fx-border); white-space: nowrap; }
.fx-table td { padding: 13px 16px; border-bottom: 1px solid var(--fx-border); vertical-align: middle; }
.fx-table tbody tr:last-child td { border-bottom: 0; }
.fx-table tbody tr:hover td { background: color-mix(in srgb, var(--fx-surface-2) 60%, transparent); }
.fx-table th[aria-sort] { cursor: pointer; user-select: none; }
.fx-table th[aria-sort="ascending"]::after { content: " ↑"; }
.fx-table th[aria-sort="descending"]::after { content: " ↓"; }
.fx-table .fx-right { text-align: right; }
@media (max-width: 680px) {
  .fx-table-wrap { border: 0; box-shadow: none; background: none; overflow: visible; }
  .fx-table thead { display: none; }
  .fx-table, .fx-table tbody, .fx-table tr, .fx-table td { display: block; width: 100%; }
  .fx-table tr { background: var(--fx-card-bg); border: var(--fx-border-w) solid var(--fx-border); border-radius: var(--fx-radius); box-shadow: var(--fx-shadow); margin-bottom: 10px; padding: 6px 4px; }
  .fx-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 7px 12px; text-align: right; }
  .fx-table td::before { content: attr(data-label); font-weight: 600; color: var(--fx-muted); text-align: left; }
  .fx-table td:not([data-label])::before { content: none; }
}

/* ---------- badges, tags, avatars ---------- */
.fx-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--fx-surface-2); color: var(--fx-muted); white-space: nowrap; }
.fx-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.fx-badge-plain::before { content: none; }
.fx-badge-primary { background: var(--fx-soft); color: var(--fx-primary); }
.fx-badge-success { background: color-mix(in srgb, var(--fx-success) 13%, var(--fx-surface)); color: var(--fx-success); }
.fx-badge-warning { background: color-mix(in srgb, var(--fx-warning) 14%, var(--fx-surface)); color: var(--fx-warning); }
.fx-badge-danger { background: color-mix(in srgb, var(--fx-danger) 12%, var(--fx-surface)); color: var(--fx-danger); }
.fx-badge-info { background: color-mix(in srgb, var(--fx-info) 12%, var(--fx-surface)); color: var(--fx-info); }
.fx-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--fx-soft); color: var(--fx-primary); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; overflow: hidden; }
.fx-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- tabs, steps, progress ---------- */
.fx-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--fx-surface-2); border-radius: calc(var(--fx-radius-sm) + 4px); flex-wrap: wrap; }
.fx-tab { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--fx-muted); padding: 7px 14px; border-radius: var(--fx-radius-sm); cursor: pointer; }
.fx-tab[aria-selected="true"] { background: var(--fx-surface); color: var(--fx-text); box-shadow: var(--fx-shadow); font-weight: 600; }
.fx-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.fx-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--fx-muted); }
.fx-steps li::before { content: attr(data-n); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--fx-surface-2); font-weight: 700; font-size: 12px; }
.fx-steps li[aria-current="step"] { color: var(--fx-text); }
.fx-steps li[aria-current="step"]::before, .fx-steps li.fx-done::before { background: var(--fx-primary); color: var(--fx-on-primary); }
.fx-progress { height: 8px; border-radius: 999px; background: var(--fx-surface-2); overflow: hidden; }
.fx-progress > span { display: block; height: 100%; background: var(--fx-primary); border-radius: inherit; transition: width 0.3s ease; }

/* ---------- feedback ---------- */
.fx-empty { text-align: center; padding: calc(var(--fx-pad) * 2) var(--fx-pad); color: var(--fx-muted); border: 1.5px dashed var(--fx-border); border-radius: var(--fx-radius); background: color-mix(in srgb, var(--fx-surface) 60%, transparent); }
.fx-empty h3 { color: var(--fx-text); margin-bottom: 4px; }
.fx-alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--fx-radius-sm); background: var(--fx-surface-2); font-size: 14px; border-left: 3px solid var(--fx-muted); }
.fx-alert-success { background: color-mix(in srgb, var(--fx-success) 10%, var(--fx-surface)); border-color: var(--fx-success); }
.fx-alert-warning { background: color-mix(in srgb, var(--fx-warning) 11%, var(--fx-surface)); border-color: var(--fx-warning); }
.fx-alert-danger { background: color-mix(in srgb, var(--fx-danger) 10%, var(--fx-surface)); border-color: var(--fx-danger); }
.fx-alert-info { background: color-mix(in srgb, var(--fx-info) 10%, var(--fx-surface)); border-color: var(--fx-info); }
.fx-skeleton { border-radius: var(--fx-radius-sm); background: linear-gradient(90deg, var(--fx-surface-2), color-mix(in srgb, var(--fx-surface-2) 40%, var(--fx-surface)), var(--fx-surface-2)); background-size: 200% 100%; animation: fx-shimmer 1.3s ease infinite; min-height: 14px; }
@keyframes fx-shimmer { to { background-position: -200% 0; } }
.fx-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.fx-toast { background: var(--fx-text); color: var(--fx-bg); padding: 12px 16px; border-radius: var(--fx-radius-sm); box-shadow: var(--fx-shadow-lg); font-size: 14px; font-weight: 500; animation: fx-in 0.2s ease; }
.fx-toast-danger { background: var(--fx-danger); color: #fff; }
@keyframes fx-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- dialog (use <dialog class="fx-dialog">) ---------- */
.fx-dialog { border: 0; padding: 0; border-radius: var(--fx-radius-lg); background: var(--fx-surface); color: var(--fx-text); box-shadow: var(--fx-shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); }
.fx-dialog::backdrop { background: rgb(10 12 20 / 0.45); backdrop-filter: blur(3px); }
.fx-dialog-body { padding: calc(var(--fx-pad) * 1.2); overflow-y: auto; }
.fx-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px calc(var(--fx-pad) * 1.2); border-top: 1px solid var(--fx-border); background: var(--fx-surface-2); }

/* ---------- charts (drawn as SVG by /fynfox-ui.js or by hand; colours from the tokens) ---------- */
.fx-chart { width: 100%; margin: 0; color: var(--fx-muted); font-size: 12px; }
.fx-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.fx-chart .fx-axis { stroke: var(--fx-border); }
.fx-chart .fx-bar { fill: var(--fx-primary); }
.fx-chart .fx-line { fill: none; stroke: var(--fx-primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.fx-chart .fx-area { fill: color-mix(in srgb, var(--fx-primary) 16%, transparent); }
.fx-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--fx-muted); }
.fx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fx-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- landing / portal blocks ---------- */
.fx-hero { padding: calc(var(--fx-pad) * 4) var(--fx-pad) calc(var(--fx-pad) * 3); text-align: center; max-width: 880px; margin: 0 auto; }
.fx-hero h1 { font-size: clamp(36px, 6vw, 68px); }
.fx-hero p { font-size: clamp(16px, 1.6vw, 19px); color: var(--fx-muted); max-width: 620px; margin: 0 auto 28px; }
.fx-section { padding: calc(var(--fx-pad) * 3) 0; }
.fx-footer { padding: calc(var(--fx-pad) * 2) var(--fx-pad); color: var(--fx-muted); font-size: 13px; text-align: center; border-top: 1px solid var(--fx-border); }

/* ---------- showcase: product and landing pages (alternating rows, media with app UI over it, feature tabs) ---------- */
.fx-showcase { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: clamp(28px, 6vw, 96px); padding: clamp(40px, 7vw, 96px) 0; }
.fx-showcase.fx-flip > :first-child { order: 2; }
.fx-showcase h2 { font-size: clamp(28px, 3.4vw, 46px); line-height: 1.08; margin-bottom: 18px; }
.fx-showcase p { color: var(--fx-muted); font-size: clamp(16px, 1.3vw, 19px); max-width: 52ch; margin-bottom: 28px; }
@media (max-width: 820px) { .fx-showcase { grid-template-columns: minmax(0, 1fr); } .fx-showcase.fx-flip > :first-child { order: 0; } }
.fx-media { position: relative; overflow: hidden; border-radius: var(--fx-radius-lg); background: var(--fx-surface-2); box-shadow: var(--fx-shadow-lg); aspect-ratio: var(--fx-ratio, 16 / 10); }
.fx-media > img, .fx-media > video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* App UI floating over the picture: a search or prompt box, a panel, a button. Place it with .fx-at-top / -bottom / -center. */
.fx-overlay { position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: calc(var(--fx-radius) * 0.9); background: color-mix(in srgb, var(--fx-surface) 92%, transparent); color: var(--fx-text); box-shadow: 0 12px 40px rgb(0 0 0 / 0.28); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: clamp(14px, 1.4vw, 18px); max-width: calc(100% - 32px); }
.fx-overlay.fx-at-top { top: 16px; left: 16px; }
.fx-overlay.fx-at-bottom { bottom: 16px; left: 16px; right: 16px; }
.fx-overlay.fx-at-center { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 32px)); }
.fx-overlay.fx-at-right { top: 16px; right: 16px; }
.fx-overlay-dark { background: rgb(14 16 22 / 0.78); color: #fff; }
[data-fx-type]::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -0.15em; background: var(--fx-primary); animation: fx-caret 1s steps(1) infinite; }
@keyframes fx-caret { 50% { opacity: 0; } }
/* Feature tabs: a list with a bright bar on the active item (it fills while the tab is shown), the picture beside it. */
.fx-feature-tabs { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
@media (max-width: 820px) { .fx-feature-tabs { grid-template-columns: minmax(0, 1fr); } }
.fx-feature-list { display: flex; flex-direction: column; gap: 6px; }
.fx-feature-list [data-fx-tab] { position: relative; display: block; width: 100%; text-align: left; background: none; border: 0; padding: 18px 0 18px 26px; font: inherit; color: var(--fx-muted); cursor: pointer; }
.fx-feature-list [data-fx-tab] strong { display: block; font-family: var(--fx-font-head); font-size: clamp(20px, 2vw, 28px); font-weight: var(--fx-head-weight); color: var(--fx-muted); margin-bottom: 6px; }
.fx-feature-list [data-fx-tab]::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--fx-border); }
.fx-feature-list [data-fx-tab][aria-selected="true"] strong { color: var(--fx-text); }
.fx-feature-list [data-fx-tab][aria-selected="true"] { color: var(--fx-text); }
.fx-feature-list [data-fx-tab][aria-selected="true"]::after { content: ""; position: absolute; left: 0; top: 18px; width: 3px; height: calc(100% - 36px); border-radius: 3px; background: linear-gradient(var(--fx-primary), var(--fx-info)); transform-origin: top; animation: fx-tab-fill var(--fx-tab-ms, 5000ms) linear; }
[data-fx-held] .fx-feature-list [data-fx-tab][aria-selected="true"]::after { animation: none; }
@keyframes fx-tab-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* Buttons with energy, and a soft glow behind a picture. */
.fx-btn-gradient { background: linear-gradient(100deg, var(--fx-primary), var(--fx-info)); color: var(--fx-on-primary); border: 0; box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--fx-primary) 70%, transparent); }
.fx-btn-gradient:hover { filter: brightness(1.08) saturate(1.1); }
.fx-btn-outline { background: transparent; color: var(--fx-text); border: 1.5px solid currentColor; }
.fx-glow { position: relative; isolation: isolate; }
.fx-glow::before { content: ""; position: absolute; inset: 8% 6%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--fx-primary) 45%, transparent), transparent); filter: blur(40px); }
/* Device frames for screenshots of the app itself. */
.fx-device-laptop { position: relative; border-radius: 14px 14px 4px 4px; border: 10px solid #15171c; border-bottom-width: 14px; background: #15171c; box-shadow: var(--fx-shadow-lg); }
.fx-device-laptop::after { content: ""; position: absolute; left: -8%; right: -8%; bottom: -26px; height: 12px; border-radius: 0 0 14px 14px; background: linear-gradient(#d9dbe0, #a9adb6); }
.fx-device-phone { position: relative; border-radius: 34px; border: 9px solid #15171c; background: #15171c; box-shadow: var(--fx-shadow-lg); overflow: hidden; max-width: 280px; }
.fx-device-laptop > img, .fx-device-phone > img, .fx-device-laptop > video, .fx-device-phone > video { display: block; width: 100%; border-radius: 4px; }
.fx-device-phone > img, .fx-device-phone > video { border-radius: 25px; }

@media (prefers-reduced-motion: reduce) {
  .fx-ui *, .fx-ui *::before, .fx-ui *::after { animation: none !important; transition: none !important; }
}
