/* tgvip — shared by the mini app (/) and /admin. Served from the same binary
   as both pages, uncached, so the two can never drift apart. */

/* ══════════════════════════════════════════════════════
   @font-face — Xsolla CDN
   ══════════════════════════════════════════════════════ */

/* Pilat Wide (B2C headings) */
@font-face { font-family: 'Pilat Wide'; src: url('https://cdn.xsolla.net/strapi-v2-bucket-prod/Pilat_Test_Medium_/Pilat_Test_Medium.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pilat Wide'; src: url('https://cdn.xsolla.net/strapi-v2-bucket-prod/Pilat_Test_Demi_Bold_bee67c470a/Pilat_Test_Demi_Bold_bee67c470a.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pilat Wide'; src: url('https://cdn.xsolla.net/strapi-v2-bucket-prod/Pilat_Test_Bold_b12b40d234/Pilat_Test_Bold_b12b40d234.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pilat Wide'; src: url('https://cdn.xsolla.net/strapi-v2-bucket-prod/Pilat_Test_Heavy_2885678ca4/Pilat_Test_Heavy_2885678ca4.otf') format('opentype'); font-weight: 800; font-style: normal; font-display: swap; }

/* Pilat (B2B headings) */
@font-face { font-family: 'Pilat'; src: url('https://cdn.xsolla.net/merchant-bucket-prod/files/uploaded/722279/55a03110b2400b778d485de2c8d064c0.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pilat'; src: url('https://cdn.xsolla.net/merchant-bucket-prod/files/uploaded/722279/e968c9cc76e48ff6111c90534549bbf9.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pilat'; src: url('https://cdn.xsolla.net/merchant-bucket-prod/files/uploaded/722279/ed4fe74e88aaacc6978f06a862e75b08.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pilat'; src: url('https://cdn.xsolla.net/merchant-bucket-prod/files/uploaded/722279/7450f429979af7eaa8fa4d4d91cee927.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pilat'; src: url('https://cdn.xsolla.net/merchant-bucket-prod/files/uploaded/722279/218d647ff7690c1e312f6943e29af375.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

/* Aktiv Grotesk (body, all contexts) */
@font-face { font-family: 'Aktiv Grotesk'; src: url('https://cdn.xsolla.net/strapi-v2-bucket-prod/Pilat_Test_Light_c4650750bb/Pilat_Test_Light_c4650750bb.otf') format('opentype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aktiv Grotesk'; src: url('https://cdn.xsolla.net/strapi-v2-bucket-prod/Pilat_Test_Book_5cb49cd592/Pilat_Test_Book_5cb49cd592.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aktiv Grotesk'; src: url('https://cdn.xsolla.net/strapi-v2-bucket-prod/Pilat_Test_Demi_e9bed59107/Pilat_Test_Demi_e9bed59107.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aktiv Grotesk'; src: url('https://cdn.xsolla.net/strapi-v2-bucket-prod/Pilat_Test_Bold_195d1b44fa/Pilat_Test_Bold_195d1b44fa.otf') format('opentype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aktiv Grotesk'; src: url('https://cdn.xsolla.net/strapi-v2-bucket-prod/Pilat_Test_Bold_195d1b44fa/Pilat_Test_Bold_195d1b44fa.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }

/* ══════════════════════════════════════════════════════
   CSS Custom Properties — Xsolla Design Tokens
   Theme: pentagram-dark (packages/core/src/tokens/pentagram-dark.json)
   ══════════════════════════════════════════════════════ */
:root {
  /* ── Font Stacks ── */
  --xui-font-heading-b2b: 'Pilat', 'Aktiv Grotesk', 'Noto Sans', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --xui-font-heading-b2c: 'Pilat Wide', 'Aktiv Grotesk', 'Noto Sans', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --xui-font-body: 'Aktiv Grotesk', 'Noto Sans', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  /* Promo / marketing pages — Pilat Wide Bold for semantic h1 & h2 (see SKILL.md); aliases B2C heading stack + registered 700 face */
  --xui-font-promo-heading: var(--xui-font-heading-b2c);
  --xui-font-weight-promo-heading: 700;

  /* ── Spacing ── */
  --xui-space-xs: 4px;
  --xui-space-s: 8px;
  --xui-space-m: 16px;
  --xui-space-l: 24px;
  --xui-space-xl: 32px;

  /* ── Border Radius ── */
  --xui-radius-button: 4px;
  --xui-radius-card: 12px;
  --xui-radius-input: 4px;
  --xui-radius-tag-sm: 2px;
  --xui-radius-tag-lg: 4px;
  --xui-radius-avatar-sm: 4px;
  --xui-radius-avatar-lg: 8px;
  --xui-radius-avatar-circle: 999px;

  /* ── Shadows ── */
  --xui-shadow-active: 0px 1px 2px rgba(7,7,8,0.2), 0px 1px 3px 1px rgba(7,7,8,0.1);
  --xui-shadow-surface: 0px 1px 2px rgba(7,7,8,0.2), 0px 2px 6px 2px rgba(7,7,8,0.1);
  --xui-shadow-surface-hover: 0px 4px 8px 3px rgba(7,7,8,0.1), 0px 1px 3px rgba(7,7,8,0.2);
  --xui-shadow-popover: 0px 6px 10px 4px rgba(7,7,8,0.1), 0px 2px 3px rgba(7,7,8,0.2);
  --xui-shadow-modal: 0px 8px 12px 6px rgba(7,7,8,0.1), 0px 4px 4px rgba(7,7,8,0.2);

  /* ── Background ── */
  --xui-bg-primary: #1b2628;
  --xui-bg-secondary: #141d1f;
  --xui-bg-inverse: #ffffff;
  --xui-bg-brand-primary: #80eaff;
  --xui-bg-brand-secondary: #0b3841;
  --xui-bg-brand-extra-primary: #cef655;
  --xui-bg-brand-extra-secondary: #566c13;
  --xui-bg-success-primary: #95ff80;
  --xui-bg-success-secondary: #14410b;
  --xui-bg-warning-primary: #ffc380;
  --xui-bg-warning-secondary: #6c4313;
  --xui-bg-alert-primary: #e84f30;
  --xui-bg-alert-secondary: #6c2213;
  --xui-bg-neutral-primary: #99aeb2;
  --xui-bg-neutral-secondary: #34474b;

  /* ── Content ── */
  --xui-content-primary: #e8eced;
  --xui-content-secondary: rgba(232,236,237,0.72);
  --xui-content-tertiary: rgba(232,236,237,0.58);
  --xui-content-inverse: #000000;
  --xui-content-brand-primary: #80eaff;
  --xui-content-brand-secondary: #55dcf6;
  --xui-content-brand-extra-primary: #cef655;
  --xui-content-brand-extra-secondary: #9bc323;
  --xui-content-success-primary: #70f655;
  --xui-content-success-secondary: #3dc322;
  --xui-content-warning-primary: #f6ab55;
  --xui-content-warning-secondary: #c37822;
  --xui-content-alert-primary: #f67055;
  --xui-content-alert-secondary: #e84f30;
  --xui-content-neutral-primary: #99aeb2;
  --xui-content-neutral-secondary: #4b6368;
  --xui-content-on-brand: #000000;
  --xui-content-on-brand-extra: #000000;
  --xui-content-on-success: #000000;
  --xui-content-on-warning: #000000;
  --xui-content-on-alert: #ffffff;
  --xui-content-on-neutral: #ffffff;
  --xui-content-static-light: #ffffff;
  --xui-content-static-dark: #000000;

  /* ── Border ── */
  --xui-border-primary: #ffffff;
  --xui-border-secondary: rgba(178,242,255,0.1);
  --xui-border-inverse: rgba(0,0,0,0.15);
  --xui-border-brand: #55dcf6;
  --xui-border-brand-extra: #cef655;
  --xui-border-success: #70f655;
  --xui-border-warning: #f6ab55;
  --xui-border-alert: #f67055;
  --xui-border-neutral: #9580ff;

  /* ── Overlay ── */
  --xui-overlay-mono: rgba(178,242,255,0.06);
  --xui-overlay-brand: rgba(128,234,255,0.2);
  --xui-overlay-brand-extra: rgba(206,246,85,0.3);
  --xui-overlay-success: rgba(149,255,128,0.2);
  --xui-overlay-warning: rgba(255,195,128,0.24);
  --xui-overlay-alert: rgba(232,79,48,0.32);
  --xui-overlay-neutral: rgba(123,152,157,0.28);

  /* ── Layer ── */
  --xui-layer-scrim: rgba(0,0,0,0.5);
  --xui-layer-float: #000000;

  /* ── Control: Brand ── */
  --xui-ctrl-brand-primary-bg: #80eaff;
  --xui-ctrl-brand-primary-bg-hover: #b2f2ff;
  --xui-ctrl-brand-primary-bg-press: #55dcf6;
  --xui-ctrl-brand-primary-bg-disable: rgba(52,71,75,0.85);
  --xui-ctrl-brand-primary-border: #31cae8;
  --xui-ctrl-brand-primary-border-hover: #55dcf6;
  --xui-ctrl-brand-secondary-bg: #135d6c;
  --xui-ctrl-brand-secondary-bg-hover: #1b8398;
  --xui-ctrl-brand-secondary-bg-press: #0b3841;
  --xui-ctrl-brand-secondary-border: #22a8c3;
  --xui-ctrl-brand-secondary-border-hover: #22a8c3;
  --xui-ctrl-brand-tertiary-bg: transparent;
  --xui-ctrl-brand-tertiary-bg-hover: #0b3841;
  --xui-ctrl-brand-tertiary-bg-press: #135d6c;
  --xui-ctrl-brand-ghost-bg: transparent;
  --xui-ctrl-brand-ghost-bg-hover: rgba(128,234,255,0.04);
  --xui-ctrl-brand-ghost-bg-press: rgba(128,234,255,0.08);
  --xui-ctrl-brand-ghost-border: rgba(128,234,255,0.16);
  --xui-ctrl-brand-ghost-border-hover: rgba(128,234,255,0.24);
  --xui-ctrl-brand-text-primary: #000000;
  --xui-ctrl-brand-text-secondary: #80eaff;
  --xui-ctrl-brand-text-tertiary: #80eaff;
  --xui-ctrl-brand-text-ghost: #80eaff;
  --xui-ctrl-brand-text-disable: rgba(232,236,237,0.2);

  /* ── Control: Mono ── */
  --xui-ctrl-mono-primary-bg: #ffffff;
  --xui-ctrl-mono-primary-bg-hover: #e8eced;
  --xui-ctrl-mono-primary-bg-press: #f4f5f6;
  --xui-ctrl-mono-secondary-bg: #34474b;
  --xui-ctrl-mono-secondary-bg-hover: #4b6368;
  --xui-ctrl-mono-secondary-bg-press: #233134;
  --xui-ctrl-mono-secondary-border: #4b6368;
  --xui-ctrl-mono-secondary-border-hover: #607f85;
  --xui-ctrl-mono-tertiary-bg: transparent;
  --xui-ctrl-mono-tertiary-bg-hover: #233134;
  --xui-ctrl-mono-tertiary-bg-press: #34474b;
  --xui-ctrl-mono-ghost-bg: transparent;
  --xui-ctrl-mono-ghost-bg-hover: rgba(255,255,255,0.04);
  --xui-ctrl-mono-ghost-bg-press: rgba(255,255,255,0.08);
  --xui-ctrl-mono-ghost-border: rgba(255,255,255,0.16);
  --xui-ctrl-mono-ghost-border-hover: rgba(255,255,255,0.24);
  --xui-ctrl-mono-text-primary: #000000;
  --xui-ctrl-mono-text-secondary: #ffffff;
  --xui-ctrl-mono-text-tertiary: #ffffff;
  --xui-ctrl-mono-text-ghost: #ffffff;
  --xui-ctrl-mono-text-disable: rgba(232,236,237,0.2);

  /* ── Control: Alert ── */
  --xui-ctrl-alert-primary-bg: #f67055;
  --xui-ctrl-alert-primary-bg-hover: #ff9580;
  --xui-ctrl-alert-primary-bg-press: #e84f30;
  --xui-ctrl-alert-secondary-bg: rgba(232,79,48,0.4);
  --xui-ctrl-alert-secondary-bg-hover: rgba(246,112,85,0.4);
  --xui-ctrl-alert-secondary-bg-press: rgba(195,61,34,0.4);
  --xui-ctrl-alert-tertiary-bg: transparent;
  --xui-ctrl-alert-tertiary-bg-hover: rgba(255,170,153,0.07);
  --xui-ctrl-alert-tertiary-bg-press: rgba(255,85,51,0.12);
  --xui-ctrl-alert-ghost-bg: transparent;
  --xui-ctrl-alert-ghost-bg-hover: rgba(246,112,85,0.04);
  --xui-ctrl-alert-ghost-bg-press: rgba(246,112,85,0.08);
  --xui-ctrl-alert-ghost-border: rgba(246,112,85,0.16);
  --xui-ctrl-alert-ghost-border-hover: rgba(246,112,85,0.24);
  --xui-ctrl-alert-text-primary: #ffffff;
  --xui-ctrl-alert-text-secondary: #ffffff;
  --xui-ctrl-alert-text-tertiary: #f67055;
  --xui-ctrl-alert-text-ghost: #f67055;
  --xui-ctrl-alert-text-disable: rgba(232,236,237,0.2);

  /* ── Control: BrandExtra ── */
  --xui-ctrl-brand-extra-primary-bg: #cef655;
  --xui-ctrl-brand-extra-primary-bg-hover: #bae831;
  --xui-ctrl-brand-extra-primary-bg-press: #dfff80;
  --xui-ctrl-brand-extra-secondary-bg: rgba(186,232,49,0.4);
  --xui-ctrl-brand-extra-secondary-bg-hover: rgba(206,246,85,0.4);
  --xui-ctrl-brand-extra-secondary-bg-press: rgba(186,232,49,0.4);
  --xui-ctrl-brand-extra-tertiary-bg: transparent;
  --xui-ctrl-brand-extra-tertiary-bg-hover: rgba(206,246,85,0.07);
  --xui-ctrl-brand-extra-tertiary-bg-press: rgba(186,232,49,0.12);
  --xui-ctrl-brand-extra-ghost-bg: transparent;
  --xui-ctrl-brand-extra-ghost-bg-hover: rgba(206,246,85,0.04);
  --xui-ctrl-brand-extra-ghost-bg-press: rgba(206,246,85,0.08);
  --xui-ctrl-brand-extra-ghost-border: rgba(206,246,85,0.16);
  --xui-ctrl-brand-extra-ghost-border-hover: rgba(206,246,85,0.24);
  --xui-ctrl-brand-extra-text-primary: #000000;
  --xui-ctrl-brand-extra-text-secondary: #ffffff;
  --xui-ctrl-brand-extra-text-tertiary: #cef655;
  --xui-ctrl-brand-extra-text-ghost: #cef655;
  --xui-ctrl-brand-extra-text-disable: rgba(232,236,237,0.2);

  /* ── Control: Input ── */
  --xui-ctrl-input-bg: rgba(178,242,255,0.12);
  --xui-ctrl-input-bg-hover: rgba(178,242,255,0.15);
  --xui-ctrl-input-bg-disable: rgba(178,242,255,0.25);
  --xui-ctrl-input-border: rgba(178,242,255,0.1);
  --xui-ctrl-input-border-hover: rgba(178,242,255,0.15);
  --xui-ctrl-input-border-disable: transparent;
  --xui-ctrl-input-text: #ffffff;
  --xui-ctrl-input-placeholder: rgba(255,255,255,0.56);
  --xui-ctrl-input-text-disable: rgba(255,255,255,0.36);

  /* ── Control: Focus ── */
  --xui-ctrl-focus-bg: #000000;
  --xui-ctrl-focus-border: #55dcf6;

  /* ── Control: AppButton ── */
  --xui-ctrl-app-btn-bg: #34474b;
  --xui-ctrl-app-btn-bg-hover: #4b6368;
  --xui-ctrl-app-btn-bg-press: #607f85;
  --xui-ctrl-app-btn-border: #4b6368;
  --xui-ctrl-app-btn-border-hover: #607f85;
  --xui-ctrl-app-btn-text: #b7c5c8;

  /* ── Control: Link ── */
  --xui-ctrl-text-disable: rgba(255,255,255,0.4);
  --xui-ctrl-link-primary: #55dcf6;
  --xui-ctrl-link-primary-hover: #80eaff;
  --xui-ctrl-link-secondary: #cef655;
  --xui-ctrl-link-secondary-hover: #dfff80;

  /* ── Control: Check (Checkbox/Radio) ── */
  --xui-ctrl-check-bg: #135d6c;
  --xui-ctrl-check-bg-hover: #1b8398;
  --xui-ctrl-check-bg-disable: rgba(178,242,255,0.25);
  --xui-ctrl-check-border: #22a8c3;
  --xui-ctrl-check-border-hover: #22a8c3;
  --xui-ctrl-check-icon: #80eaff;

  /* ── Control: Switch ── */
  --xui-ctrl-switch-bg: #135d6c;
  --xui-ctrl-switch-bg-hover: #1b8398;
  --xui-ctrl-switch-border: #22a8c3;

  /* ── Control: Knob ── */
  --xui-ctrl-knob-bg: #80eaff;
  --xui-ctrl-knob-bg-hover: #b2f2ff;
  --xui-ctrl-knob-bg-inactive: #ffffff;

  /* ── Control: Faint (unchecked Checkbox / Radio background) ── */
  --xui-ctrl-faint-bg: rgba(178,242,255,0.15);
  --xui-ctrl-faint-bg-hover: rgba(178,242,255,0.2);
  --xui-ctrl-faint-border: rgba(178,242,255,0.1);
  --xui-ctrl-faint-border-hover: rgba(178,242,255,0.15);

  /* ── Control: Segmented ── */
  --xui-ctrl-segmented-bg: rgba(178,242,255,0.1);
  --xui-ctrl-segmented-bg-hover: rgba(178,242,255,0.1);
  --xui-ctrl-segmented-bg-active: rgba(178,242,255,0.15);
  --xui-ctrl-segmented-text: #ffffff;
  --xui-ctrl-segmented-text-disable: rgba(255,255,255,0.4);

  /* ── Control: ToggleButton ── */
  --xui-ctrl-toggle-bg: rgba(178,242,255,0.12);
  --xui-ctrl-toggle-bg-hover: rgba(178,242,255,0.15);
  --xui-ctrl-toggle-bg-active: #135d6c;
  --xui-ctrl-toggle-border: rgba(178,242,255,0.1);
  --xui-ctrl-toggle-border-active: #22a8c3;
  --xui-ctrl-toggle-text: #ffffff;
  --xui-ctrl-toggle-text-active: #80eaff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--xui-font-body);
  color: var(--xui-content-primary);
  background-color: var(--xui-bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════════════
   tgvip — Xsolla Pentagram Dark
   Components below follow the XUI specs (button, input, field-group,
   dropdown, tag, notification); class names that predate the restyle are
   kept because the script builds those nodes.
   ══════════════════════════════════════════════════════ */
:root { color-scheme: dark; }
html { background: var(--xui-bg-secondary); }

body {
  font-size: 16px;
  line-height: 20px;
  padding: 0 var(--xui-space-m) calc(96px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
.hide { display: none !important; }

/* ── Navbar ── */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center;
  height: 56px; margin: 0 calc(var(--xui-space-m) * -1); padding: 0 var(--xui-space-m);
  background: var(--xui-bg-secondary);
  border-bottom: 1px solid var(--xui-border-secondary);
}
.nav a { display: block; border-radius: var(--xui-radius-button); }
.nav a:focus-visible { outline: 2px solid var(--xui-border-brand); outline-offset: 4px; }
.nav .logo { display: block; height: 20px; width: auto; color: var(--xui-content-primary); }
/* The switch between the manager app and /admin, at the far end of the bar. */
.nav .nav-switch {
  margin-left: auto; padding: 4px 10px; white-space: nowrap;
  font-size: 12px; line-height: 16px; font-weight: 500; text-decoration: none;
  color: var(--xui-bg-secondary); background: var(--xui-bg-inverse);
  border-radius: var(--xui-radius-button);
  transition: opacity 0.15s ease;
}
.nav .nav-switch:hover { opacity: 0.85; }

/* ── Type ── */
h1 {
  font-family: var(--xui-font-heading-b2b);
  font-size: 24px; line-height: 28px; font-weight: 400;
  margin: var(--xui-space-l) 0 var(--xui-space-xs);
}
/* Title row for every page below the actions page: a back arrow, then the
   title. Put <a class="back" data-back> in front of an <h1> inside
   .page-head and the script wires it to the actions page. */
.page-head { display: flex; align-items: center; gap: var(--xui-space-s); margin: var(--xui-space-l) 0 var(--xui-space-xs); }
.page-head h1 { margin: 0; min-width: 0; }
.back {
  flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px;
  margin-left: calc(var(--xui-space-s) * -1);
  border-radius: 8px; color: var(--xui-content-primary);
  transition: background-color 0.15s ease;
}
.back svg { transform: scaleX(-1); }
.back:hover { background: var(--xui-ctrl-mono-tertiary-bg-hover); }
.back:active { background: var(--xui-ctrl-mono-tertiary-bg-press); }
.back:focus-visible { outline: 2px solid var(--xui-border-brand); outline-offset: 2px; }
.sub { color: var(--xui-content-tertiary); font-size: 14px; line-height: 16px; margin: 0 0 var(--xui-space-l); }
.note { color: var(--xui-content-tertiary); font-size: 14px; line-height: 16px; margin-top: var(--xui-space-s); }
.center { text-align: center; color: var(--xui-content-tertiary); padding: calc(var(--xui-space-xl) + var(--xui-space-s)) 0; }

/* from components/field-group.md */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--xui-space-m); }
label { display: block; font-size: 14px; line-height: 16px; color: var(--xui-content-tertiary); margin: 0; }
label .hint { color: var(--xui-content-tertiary); }
.row2 { display: grid; grid-template-columns: 1fr 108px; gap: 12px; }
.row2 > div { display: flex; flex-direction: column; gap: 4px; }

/* from components/input.md (md) — the control itself is the container */
input, select, textarea {
  width: 100%; min-height: 48px; padding: 11px 12px;
  background: var(--xui-ctrl-input-bg);
  border: 1px solid var(--xui-ctrl-input-border);
  border-radius: 8px;
  color: var(--xui-ctrl-input-text);
  font-family: var(--xui-font-body); font-size: 16px; line-height: 20px;
  outline: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--xui-ctrl-input-placeholder); }
input:hover, select:hover, textarea:hover {
  background: var(--xui-ctrl-input-bg-hover); border-color: var(--xui-ctrl-input-border-hover);
}
input:focus, select:focus, textarea:focus {
  background: var(--xui-ctrl-focus-bg); border-color: transparent;
  outline: 1px solid var(--xui-border-brand); outline-offset: -1px;
}
textarea { resize: vertical; min-height: 72px; }

/* ── Buttons — from components/button.md ── */
.xui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: fit-content; max-width: 100%; box-sizing: border-box;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  font-family: var(--xui-font-body); font-weight: 500;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  position: relative; white-space: nowrap; outline: none;
}
.xui-btn:focus-visible { outline: 2px solid var(--xui-border-brand); outline-offset: 2px; }
.xui-btn:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }
.xui-btn--full-width { width: 100%; }
.xui-btn--spread { justify-content: space-between; }
.xui-btn--md { height: 48px; padding: 0 20px; font-size: 16px; border-radius: 8px; }
.xui-btn--xs { height: 32px; padding: 0 20px; font-size: 12px; border-radius: 4px; }
.xui-btn--md .xui-btn__icon { width: 28px; height: 28px; }
.xui-btn--primary.xui-btn--brand {
  background: var(--xui-ctrl-brand-primary-bg);
  border-color: var(--xui-ctrl-brand-primary-border);
  color: var(--xui-ctrl-brand-text-primary);
}
.xui-btn--primary.xui-btn--brand:hover {
  background: var(--xui-ctrl-brand-primary-bg-hover);
  border-color: var(--xui-ctrl-brand-primary-border-hover);
}
.xui-btn--primary.xui-btn--brand:active { background: var(--xui-ctrl-brand-primary-bg-press); }
.xui-btn--secondary.xui-btn--brand {
  background: var(--xui-ctrl-brand-secondary-bg);
  border-color: var(--xui-ctrl-brand-secondary-border);
  color: var(--xui-ctrl-brand-text-secondary);
}
.xui-btn--secondary.xui-btn--brand:hover {
  background: var(--xui-ctrl-brand-secondary-bg-hover);
  border-color: var(--xui-ctrl-brand-secondary-border-hover);
}
.xui-btn--secondary.xui-btn--brand:active { background: var(--xui-ctrl-brand-secondary-bg-press); }
.xui-btn__spinner {
  position: absolute; width: 20px; height: 20px;
  border: 2px solid currentColor; border-bottom-color: transparent; border-radius: 50%;
  animation: xui-spin 0.8s linear infinite;
}
.xui-btn--loading .xui-btn__label { opacity: 0; }
@keyframes xui-spin { to { transform: rotate(360deg); } }

/* ── Sandbox tag — from components/tag.md (warning tone) ── */
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
  border-radius: var(--xui-radius-tag-lg);
  font-size: 12px; font-weight: 500; letter-spacing: .02em;
}
.badge.sandbox { background: var(--xui-bg-warning-secondary); color: var(--xui-content-warning-primary); }

/* ── Notification banner ── */
.banner { padding: 12px var(--xui-space-m); border-radius: 8px; margin: 0 0 var(--xui-space-m); font-size: 14px; line-height: 18px; border: 1px solid transparent; }
.banner.err { background: var(--xui-bg-alert-secondary); border-color: var(--xui-border-alert); color: var(--xui-content-primary); }
.banner.ok  { background: var(--xui-bg-success-secondary); border-color: var(--xui-border-success); color: var(--xui-content-primary); }

/* ── The new client form's check of the player id with the game ── */
.player-check {
  display: flex; align-items: center; gap: var(--xui-space-s); margin-top: var(--xui-space-s);
  font-size: 14px; line-height: 16px; color: var(--xui-content-tertiary); overflow-wrap: anywhere;
}
.player-check.ok  { color: var(--xui-content-success-primary); }
.player-check.err { color: var(--xui-content-alert-primary); }
.player-check.warn { color: var(--xui-content-warning-primary); }
.player-check .thumb { width: 32px; height: 32px; flex-basis: 32px; }
.player-check a { color: inherit; text-decoration: underline; }

/* ── Combobox / picker menus — from components/dropdown.md ── */
.combo { position: relative; scroll-margin-top: 72px; }
.combo input { padding-right: 40px; }
.combo .chev {
  position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--xui-content-secondary); border-bottom: 2px solid var(--xui-content-secondary);
  transform: rotate(45deg); pointer-events: none; transition: transform .15s;
}
.combo.open .chev { transform: rotate(225deg); margin-top: -2px; }
.combo.open input, .combo.open .picker-btn {
  background: var(--xui-ctrl-focus-bg); border-color: transparent;
  outline: 1px solid var(--xui-border-brand); outline-offset: -1px;
}
.picker-btn {
  display: block; width: 100%; min-height: 48px; padding: 11px 40px 11px 12px; text-align: left; cursor: pointer;
  background: var(--xui-ctrl-input-bg); border: 1px solid var(--xui-ctrl-input-border); border-radius: 8px;
  font-family: var(--xui-font-body); font-size: 16px; line-height: 20px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.picker-btn:hover { background: var(--xui-ctrl-input-bg-hover); border-color: var(--xui-ctrl-input-border-hover); }
.picker-btn:focus-visible { outline: 2px solid var(--xui-border-brand); outline-offset: 2px; }
.picker-btn .picker-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn .picker-label.placeholder { color: var(--xui-ctrl-input-placeholder); }
/* from components/select.md — sm size and disabled state */
.picker-btn--sm { min-height: 40px; padding: 9px 36px 9px 10px; font-size: 14px; border-radius: var(--xui-radius-input); }
.picker-btn--sm + .chev { right: 14px; }
.picker-btn:disabled {
  background: var(--xui-ctrl-input-bg-disable); border-color: var(--xui-ctrl-input-border-disable);
  color: var(--xui-ctrl-input-text-disable); cursor: not-allowed;
}
.combo.disabled .chev { border-color: var(--xui-ctrl-input-text-disable); }

.dropdown {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 20;
  max-height: min(320px, 45vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 0; list-style: none;
  background: var(--xui-bg-primary);
  border: 1px solid var(--xui-border-secondary); border-radius: var(--xui-radius-button);
  box-shadow: var(--xui-shadow-popover);
}
.opt {
  display: flex; gap: 12px; align-items: center; padding: 8px 16px; cursor: pointer;
  transition: background-color 0.15s ease;
}
.opt:hover, .opt.active { background: var(--xui-ctrl-input-bg-hover); }
.opt[hidden], .dropdown .none[hidden] { display: none; }
.opt.off { opacity: 0.5; cursor: not-allowed; }
.opt.off:hover { background: transparent; }
.opt .meta { flex: 1 1 auto; min-width: 0; }
.opt .name { font-size: 14px; line-height: 18px; color: var(--xui-content-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .line2 { color: var(--xui-content-tertiary); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .tag { flex: 0 0 auto; font-size: 12px; font-weight: 500; color: var(--xui-content-brand-primary); }
.opt .card-art { width: 32px; height: 32px; flex-basis: 32px; border-radius: var(--xui-radius-avatar-sm); }
.opt.selected { background: var(--xui-ctrl-brand-primary-bg); }
.opt.selected .name, .opt.selected .tag { color: var(--xui-content-on-brand); }
.opt.selected:hover, .opt.selected.active { background: var(--xui-ctrl-brand-primary-bg-hover); }
.dropdown .none { color: var(--xui-content-tertiary); padding: 16px; text-align: center; font-size: 14px; }

/* ── Selected items ── */
.items { list-style: none; margin: 0 0 var(--xui-space-m); padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--xui-space-s); }
.item {
  display: flex; gap: 12px; align-items: center; padding: 12px;
  background: var(--xui-bg-primary); border: 1px solid var(--xui-border-secondary);
  border-radius: var(--xui-radius-card); box-shadow: var(--xui-shadow-surface);
}
.item.off { opacity: 0.5; }
.item .meta { flex: 1 1 auto; min-width: 0; }
.item .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .line2 { color: var(--xui-content-tertiary); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: var(--xui-radius-avatar-lg);
  background: var(--xui-overlay-mono); object-fit: cover;
}
.opt .thumb { width: 36px; height: 36px; flex-basis: 36px; }

.stepper { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.stepper button {
  min-width: 32px; height: 32px; padding: 0 10px; cursor: pointer; font-size: 18px; line-height: 1;
  background: var(--xui-ctrl-mono-secondary-bg); border: 1px solid var(--xui-ctrl-mono-secondary-border);
  border-radius: var(--xui-radius-button); color: var(--xui-ctrl-mono-text-secondary);
  transition: background-color 0.15s ease;
}
.stepper button:hover { background: var(--xui-ctrl-mono-secondary-bg-hover); border-color: var(--xui-ctrl-mono-secondary-border-hover); }
.stepper button:active { background: var(--xui-ctrl-mono-secondary-bg-press); }
.stepper button:focus-visible { outline: 2px solid var(--xui-border-brand); outline-offset: 2px; }
.stepper button:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }
.qty { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 500; }
/* The count field between − and +: an xs input, kept at 16px so iOS does not zoom in on it. */
.stepper input.qty {
  width: 52px; min-height: 32px; height: 32px; padding: 0 4px;
  border-radius: var(--xui-radius-input);
}

/* ── Hero card lines: cards picked per row, the count follows them ── */
.item.hero { flex-wrap: wrap; }
.qty.locked { padding: 0 4px; color: var(--xui-content-secondary); }
.cards { flex: 1 0 100%; display: grid; gap: var(--xui-space-s); padding-top: var(--xui-space-s); border-top: 1px solid var(--xui-border-secondary); justify-items: start; }
/* One row per card: picture, card, count, remove. On a phone the count goes
   under the card, which keeps the card's name readable. */
.card-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; }
@media (max-width: 519px) {
  .card-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .card-row .stepper { grid-row: 2; grid-column: 2; }
}
.card-remove {
  flex: 0 0 auto; min-width: 32px; height: 32px; padding: 0 10px; cursor: pointer; font-size: 18px; line-height: 1;
  background: var(--xui-ctrl-mono-secondary-bg); border: 1px solid var(--xui-ctrl-mono-secondary-border);
  border-radius: var(--xui-radius-button); color: var(--xui-ctrl-mono-text-secondary);
}
.card-remove:hover { background: var(--xui-ctrl-mono-secondary-bg-hover); }
.card-remove:focus-visible { outline: 2px solid var(--xui-border-brand); outline-offset: 2px; }
.card-art { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 8px; background: var(--xui-overlay-mono); object-fit: cover; }
/* A hero line's cards in an offer: each one's picture and count, on a row of their own under the line. */
.card dd.card-strip { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; text-align: left; margin-top: -2px; }
.card-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px;
  border-radius: 10px; background: var(--xui-overlay-mono); font-size: 13px; line-height: 16px;
}
.card-chip .card-art { width: 32px; height: 32px; flex-basis: 32px; border-radius: 6px; }

/* ── Bottom bar ── */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: var(--xui-space-m); align-items: center;
  padding: 12px var(--xui-space-m) calc(12px + env(safe-area-inset-bottom));
  background: var(--xui-bg-primary); border-top: 1px solid var(--xui-border-secondary);
}
.bar .sum { flex: 1 1 auto; min-width: 0; }
.bar .sum b { display: block; font-weight: 600; font-size: 18px; line-height: 22px; font-variant-numeric: tabular-nums; }
.bar .sum span { color: var(--xui-content-tertiary); font-size: 12px; line-height: 16px; }

/* ── Actions page ── */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tile {
  display: flex; align-items: center; gap: var(--xui-space-m); width: 100%; padding: var(--xui-space-m);
  text-align: left; cursor: pointer;
  background: var(--xui-bg-primary); border: 1px solid var(--xui-border-secondary);
  border-radius: var(--xui-radius-card); box-shadow: var(--xui-shadow-surface);
  transition: box-shadow 150ms ease, transform 150ms ease, border-color 150ms ease;
}
.tile:hover { box-shadow: var(--xui-shadow-surface-hover); transform: translateY(-2px); border-color: var(--xui-border-brand); }
.tile:active { transform: translateY(0); }
.tile:focus-visible { outline: 2px solid var(--xui-border-brand); outline-offset: 2px; }
.tile .tile-icon {
  flex: 0 0 48px; height: 48px; border-radius: var(--xui-radius-avatar-lg); display: grid; place-items: center;
  background: var(--xui-bg-brand-secondary); color: var(--xui-content-brand-primary);
}
.tile .tile-body { flex: 1 1 auto; min-width: 0; }
.tile .tile-title { display: block; font-weight: 500; font-size: 18px; line-height: 24px; }
.tile .tile-desc { display: block; color: var(--xui-content-tertiary); font-size: 14px; line-height: 18px; margin-top: 2px; }
.tile .go {
  flex: 0 0 auto; width: 8px; height: 8px; margin-right: 4px;
  border-right: 2px solid var(--xui-content-secondary); border-top: 2px solid var(--xui-content-secondary);
  transform: rotate(45deg); transition: border-color 150ms ease;
}
.tile:hover .go { border-color: var(--xui-content-brand-primary); }

/* ── Offer ready ── */
.card { background: var(--xui-bg-primary); border: 1px solid var(--xui-border-secondary); border-radius: var(--xui-radius-card); box-shadow: var(--xui-shadow-surface); padding: var(--xui-space-m); margin: var(--xui-space-m) 0; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 8px var(--xui-space-m); margin: 0; }
.card dt { color: var(--xui-content-tertiary); font-size: 14px; line-height: 18px; }
.card dd { margin: 0; font-size: 14px; line-height: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.link {
  display: block; word-break: break-all; font-size: 12px; line-height: 16px; font-family: ui-monospace, Menlo, monospace;
  background: var(--xui-bg-primary); border: 1px solid var(--xui-border-secondary); border-radius: 8px;
  padding: 12px; margin: var(--xui-space-m) 0; color: var(--xui-ctrl-link-primary);
}
.link:hover { color: var(--xui-ctrl-link-primary-hover); }
.actions { display: flex; gap: 12px; }
.actions > * { flex: 1; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 16px; color: var(--xui-content-brand-primary); }

/* ── Offers list ── */
.offers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--xui-space-s); }
.offer-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px var(--xui-space-m);
  text-align: left; cursor: pointer; color: inherit; font: inherit;
  background: var(--xui-bg-primary); border: 1px solid var(--xui-border-secondary); border-radius: var(--xui-radius-card);
  transition: border-color 150ms ease;
}
.offer-row:hover { border-color: var(--xui-border-brand); }
.offer-row:focus-visible { outline: 2px solid var(--xui-border-brand); outline-offset: 2px; }
.offer-row .meta { flex: 1 1 auto; min-width: 0; }
.offer-row .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-row .line2 { color: var(--xui-content-tertiary); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-row .side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.offer-row .amount { font-size: 14px; line-height: 18px; font-variant-numeric: tabular-nums; }
.more { margin-top: var(--xui-space-m); }

/* ── Offer state tags — components/tag.md tones ── */
.state { background: var(--xui-bg-neutral-secondary); color: var(--xui-content-secondary); }
.state.awaiting { background: var(--xui-bg-warning-secondary); color: var(--xui-content-warning-primary); }
.state.paid { background: var(--xui-bg-success-secondary); color: var(--xui-content-success-primary); }
.state.refunded { background: var(--xui-bg-alert-secondary); color: var(--xui-content-alert-primary); }

/* ── Alert button — components/button.md, alert tone (Disable) ── */
.xui-btn--secondary.xui-btn--alert {
  background: var(--xui-ctrl-alert-secondary-bg);
  color: var(--xui-ctrl-alert-text-secondary);
}
.xui-btn--secondary.xui-btn--alert:hover { background: var(--xui-ctrl-alert-secondary-bg-hover); }
.xui-btn--secondary.xui-btn--alert:active { background: var(--xui-ctrl-alert-secondary-bg-press); }

/* ── Clients, and the /admin roster ── */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 var(--xui-space-m); }
.toolbar > .xui-btn { flex: 1 1 auto; }
h2 {
  font-family: var(--xui-font-heading-b2b);
  font-size: 18px; line-height: 24px; font-weight: 400;
  margin: var(--xui-space-l) 0 var(--xui-space-s);
}
.badge + .badge { margin-left: 4px; }
.badge.role { background: var(--xui-bg-brand-secondary); color: var(--xui-content-brand-primary); }
.badge.pending { background: var(--xui-bg-warning-secondary); color: var(--xui-content-warning-primary); }
.badge.disabled { background: var(--xui-bg-alert-secondary); color: var(--xui-content-alert-primary); }
.offer-row .count { color: var(--xui-content-tertiary); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }

/* checkbox list, for picking a manager's projects */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--xui-space-s); }
.check {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; cursor: pointer;
  background: var(--xui-ctrl-input-bg); border: 1px solid var(--xui-ctrl-input-border); border-radius: 8px;
  color: var(--xui-content-primary); font-size: 14px; line-height: 18px;
}
.check:hover { background: var(--xui-ctrl-input-bg-hover); border-color: var(--xui-ctrl-input-border-hover); }
.check input {
  flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0;
  accent-color: var(--xui-ctrl-brand-primary-bg);
}
.check .line2 { display: block; color: var(--xui-content-tertiary); font-size: 12px; line-height: 16px; }

/* a link inside a card's value column, e.g. a client's @handle */
.card dd a { color: var(--xui-ctrl-link-primary); text-decoration: none; }
.card dd a:hover { color: var(--xui-ctrl-link-primary-hover); }

/* ── Switch: turns one feature on or off ──
   <button type="button" class="switch" role="switch" aria-checked="true">
     <span class="switch-label">ON</span><span class="switch-knob"></span>
   </button>
   aria-checked is the state: on is filled with the knob at the end, off is an
   outline with the knob at the start. .switch--sm is the compact size. */
.switch {
  --switch-on: #16dc94;
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  height: 32px; min-width: 76px; padding: 0 3px 0 12px;
  border: 2px solid var(--switch-on); border-radius: 999px; background: var(--switch-on);
  color: #062a1d; font: inherit; font-size: 14px; line-height: 1; font-weight: 700; letter-spacing: 0.02em;
  cursor: pointer; user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.switch .switch-knob {
  width: 22px; height: 22px; margin-left: auto; border-radius: 50%;
  background: var(--xui-bg-inverse); transition: background-color 0.15s ease;
}
.switch[aria-checked="false"] {
  flex-direction: row-reverse; padding: 0 12px 0 3px;
  background: transparent; border-color: var(--xui-border-primary); color: var(--xui-content-primary);
}
.switch[aria-checked="false"] .switch-knob { margin-left: 0; margin-right: auto; }
.switch:focus-visible { outline: 2px solid var(--xui-border-brand); outline-offset: 2px; }
.switch:disabled { cursor: not-allowed; opacity: 0.45; }
.switch--sm { height: 24px; min-width: 58px; gap: 6px; padding: 0 2px 0 9px; font-size: 11px; }
.switch--sm .switch-knob { width: 16px; height: 16px; }
.switch--sm[aria-checked="false"] { padding: 0 9px 0 2px; }

/* A feature's name and note beside its switch. */
.switch-row { display: flex; align-items: center; gap: var(--xui-space-m); margin-bottom: var(--xui-space-m); }
.switch-row .switch-text { flex: 1 1 auto; min-width: 0; }
.switch-row .switch-title { font-weight: 500; }
.switch-row .note { margin-top: 2px; }
