/* SailSMM design system — mobile-first, light and dark themes.
   All colours, type and spacing come from the tokens below; change the
   brand here, not in individual rules. */

/* Inter (SIL OFL 1.1). Two faces of the same family:
   1. Full font: declared FIRST, only downloaded when a page contains a
      character outside the Latin subset (e.g. Greek or Cyrillic names).
   2. Latin subset (~200 KB): declared LAST, so browsers check it first for
      the characters in its unicode-range. Same glyphs, axes and features. */
@font-face {
  font-family: "Inter";
  src: url("/static/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0100-024F, U+0259, U+02B0-02FF, U+0300-036F, U+1D00-1DBF, U+1E00-1EFF, U+2000-206F, U+2070-209F, U+20A0-20C0, U+2113, U+2116, U+2122, U+2126, U+212E, U+2190-2199, U+2212, U+2215, U+2219, U+2C60-2C7F, U+A720-A7FF, U+FEFF, U+FFFD;
}

/* =========================================================================
   Tokens. Light is the default; [data-theme="dark"] is set by /static/theme.js
   before first paint (saved choice, else the system preference).
   ========================================================================= */
:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-active: #1E40AF;
  --primary-text: #1D4ED8;          /* blue used for text/links (AA on surfaces) */
  --primary-soft: #EFF6FF;
  --primary-soft-2: #DBEAFE;
  --on-primary: #FFFFFF;

  --text: #111827;
  --text-2: #475569;                /* secondary text, 7:1 on white */
  --text-3: #5B6677;                /* tertiary text, AA on white and on --surface-2 */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #E2E8F0;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --placeholder: #6E7889;

  --success: #15803D; --success-soft: #F0FDF4; --success-line: #BBF7D0;
  --warning: #B45309; --warning-soft: #FFFBEB; --warning-line: #FDE68A;
  --danger: #B91C1C; --danger-hover: #991B1B; --danger-soft: #FEF2F2; --danger-line: #FECACA;
  --info: #1D4ED8; --info-soft: #EFF6FF; --info-line: #BFDBFE;

  /* Deep navy navigation (both themes) */
  --nav-bg: #0B1530;
  --nav-text: #CBD5E1;
  --nav-text-strong: #FFFFFF;
  --nav-muted: #7C8DB0;
  --nav-hover: rgba(255, 255, 255, 0.07);
  --nav-active-bg: rgba(59, 130, 246, 0.18);
  --nav-active-text: #FFFFFF;
  --nav-border: rgba(255, 255, 255, 0.08);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.75rem; --fs-sm: 0.875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.25rem; --fs-2xl: 1.5rem;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.18);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.35);

  --touch: 44px;
  --ctl: 44px; --ctl-sm: 36px; --ctl-lg: 48px;
  --topbar-h: 60px;
  --sidebar-w: 256px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --primary: #2563EB;              /* white text stays AA on buttons */
  --primary-hover: #1D4ED8;
  --primary-active: #1E40AF;
  --primary-text: #93C5FD;
  --primary-soft: rgba(59, 130, 246, 0.14);
  --primary-soft-2: rgba(59, 130, 246, 0.24);
  --on-primary: #FFFFFF;

  --text: #E5E9F2;
  --text-2: #A7B2C6;
  --text-3: #8A97AD;
  --bg: #0B1220;
  --surface: #111A2C;
  --surface-2: #17223A;
  --surface-3: #1F2B45;
  --border: #23314D;
  --border-strong: #33456A;
  --placeholder: #6B7A95;

  --success: #4ADE80; --success-soft: rgba(34, 197, 94, 0.12); --success-line: rgba(34, 197, 94, 0.3);
  --warning: #FBBF24; --warning-soft: rgba(245, 158, 11, 0.12); --warning-line: rgba(245, 158, 11, 0.3);
  --danger: #F87171; --danger-hover: #EF4444; --danger-soft: rgba(239, 68, 68, 0.12); --danger-line: rgba(239, 68, 68, 0.32);
  --info: #93C5FD; --info-soft: rgba(59, 130, 246, 0.12); --info-line: rgba(59, 130, 246, 0.3);

  --nav-bg: #070D1C;
  --nav-border: rgba(255, 255, 255, 0.07);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 3px rgba(96, 165, 250, 0.45);
  color-scheme: dark;
}

/* =========================================================================
   Base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-md); line-height: 1.55;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--s2); letter-spacing: -0.015em; font-weight: 650; color: var(--text); }
h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
@media (min-width: 1024px) { h1 { font-size: 1.75rem; } }
p { margin: 0 0 var(--s3); }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s3) 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar :focus-visible, .cta-band :focus-visible, .stat-primary:focus-visible { outline-color: #93C5FD; }
::selection { background: var(--primary-soft-2); }
.icon { flex: none; display: block; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Utilities */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--mono); font-size: 0.9em; }
.block { display: block; }
.center { text-align: center; }
.break { overflow-wrap: anywhere; }
.pre-line { white-space: pre-line; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.warn-text { color: var(--warning); margin: 0; }
.mt { margin-top: var(--s8); }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.row-center { justify-content: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.row-start { display: flex; gap: var(--s3); align-items: center; min-width: 0; }
.stack { display: grid; gap: var(--s4); min-width: 0; align-content: start; }
.stack-sm { display: grid; gap: var(--s2); }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.plain li:last-child { border-bottom: 0; }
@media (max-width: 767px) { .hide-mobile { display: none !important; } }
.skip-link { position: absolute; left: var(--s4); top: -80px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: var(--s2) var(--s4); border-radius: var(--r-sm); }
.skip-link:focus { top: var(--s2); color: var(--on-primary); }

.demo-banner { display: flex; gap: var(--s2); align-items: center; justify-content: center; background: var(--warning-soft); color: var(--warning); font-size: var(--fs-sm); padding: var(--s2) var(--s4); border-bottom: 1px solid var(--warning-line); text-align: center; }
.demo-banner .icon { flex: none; }

/* =========================================================================
   Brand, buttons, icon buttons
   ========================================================================= */
.brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); font-weight: 700; font-size: var(--fs-md); letter-spacing: -0.02em; min-height: var(--touch); white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark { flex: none; display: block; }
.brand-on-dark, .brand-on-dark:hover { color: var(--nav-text-strong); }
.brand-tag { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0; background: var(--primary); color: #FFFFFF; padding: 1px var(--s2); border-radius: var(--r-full); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--ctl); padding: 0 var(--s4);
  background: var(--primary); color: var(--on-primary);
  border: 1px solid var(--primary); border-radius: var(--r-md);
  font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; text-align: center;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); text-decoration: none; }
.btn:active { background: var(--primary-active); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-secondary, .btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover, .btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:active, .btn-ghost:active { background: var(--surface-3); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
:root[data-theme="dark"] .btn-danger { background: #DC2626; border-color: #DC2626; }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #FFFFFF; }
.btn-sm { min-height: var(--ctl-sm); padding: 0 var(--s3); }
.btn-lg { min-height: var(--ctl-lg); padding: 0 var(--s6); font-size: var(--fs-md); }
.btn-block { width: 100%; }
@media (pointer: coarse) { .btn-sm { min-height: 40px; } }
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"] .icon { visibility: hidden; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--on-primary); border-right-color: transparent; animation: spin 0.7s linear infinite; }
.btn-secondary[aria-busy="true"]::after { border-color: var(--text); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--touch); height: var(--touch); border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.icon-btn-dark { background: transparent; border-color: var(--nav-border); color: var(--nav-text-strong); }
.icon-btn-dark:hover { background: var(--nav-hover); color: var(--nav-text-strong); }
.theme-toggle .ti { display: inline-flex; }
.theme-toggle .ti-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ti-sun { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .ti-moon { display: none; }

.link-more { display: inline-flex; align-items: center; gap: 4px; min-height: var(--touch); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }

/* =========================================================================
   Drawers (shared by the public menu and the app sidebar on small screens)
   Works without JS through :target; app.js adds focus handling, Escape,
   backdrop click, scroll lock and closes after navigation.
   ========================================================================= */
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(2, 6, 23, 0.55); opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; }
body.drawer-open .drawer-backdrop, .drawer:target ~ .drawer-backdrop { opacity: 1; visibility: visible; }
body.drawer-open { overflow: hidden; }
.drawer-close { display: inline-flex; }

/* Public drawer (right side) */
.drawer-right {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(320px, 86vw); display: flex; flex-direction: column; gap: var(--s4);
  padding: var(--s4); padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom));
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateX(105%); visibility: hidden; transition: transform 0.22s ease, visibility 0.22s;
  overflow-y: auto; overscroll-behavior: contain;
}
.drawer-right.is-open, .drawer-right:target { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.drawer-nav { display: grid; gap: 2px; }
.drawer-nav .side-link { justify-content: space-between; color: var(--text); }
.drawer-nav .side-link:hover { background: var(--surface-2); }
.drawer-nav .side-link[aria-current] { background: var(--primary-soft); color: var(--primary-text); }
.drawer-actions { display: grid; gap: var(--s2); margin-top: auto; }
@media (min-width: 1024px) { .drawer-right, .shell-public .drawer-backdrop { display: none; } }

/* =========================================================================
   Public shell
   ========================================================================= */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 768px) { .container { padding: 0 var(--s6); } }
.main { padding-top: var(--s6); padding-bottom: var(--s12); outline: none; min-width: 0; }
@media (min-width: 1024px) { .main { padding-top: var(--s10); padding-bottom: 72px; } }
.shell-public { display: flex; flex-direction: column; }
.shell-public .main { flex: 1; }

.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.site-header-inner { display: flex; align-items: center; gap: var(--s3); height: var(--topbar-h); }
.site-nav { display: none; }
.site-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
@media (min-width: 1024px) {
  .site-nav { display: flex; gap: var(--s1); margin-left: var(--s8); }
  .site-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s3); border-radius: var(--r-sm); color: var(--text-2); font-size: var(--fs-sm); font-weight: 550; }
  .site-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
  .site-nav a[aria-current] { color: var(--primary-text); background: var(--primary-soft); }
  .shell-public .burger { display: none; }
}

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: var(--s8) 0 var(--s6); }
.footer-grid { display: grid; gap: var(--s6); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { margin: var(--s2) 0 0; color: var(--text-2); font-size: var(--fs-sm); max-width: 36em; }
.footer-col { display: grid; align-content: start; gap: 2px; font-size: var(--fs-sm); min-width: 0; }
.footer-col h2 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: var(--s1); }
.footer-col a { color: var(--text-2); min-height: 36px; display: flex; align-items: center; overflow-wrap: anywhere; }
.footer-col a:hover { color: var(--primary-text); }
.footer-base { margin-top: var(--s6); }
.footer-base span { display: block; padding-top: var(--s4); border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-sm); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.3fr; } .footer-brand { grid-column: auto; } }

/* =========================================================================
   App shell: navy sidebar (desktop) / drawer (mobile) + top bar
   ========================================================================= */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
  width: min(var(--sidebar-w), 84vw); display: flex; flex-direction: column;
  background: var(--nav-bg); color: var(--nav-text); border-right: 1px solid var(--nav-border);
  padding: var(--s4) var(--s3); padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-105%); visibility: hidden; transition: transform 0.22s ease, visibility 0.22s;
}
.sidebar.is-open, .sidebar:target { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 0 var(--s1) var(--s3); }
.sidebar-cta { margin: var(--s2) 0 var(--s3); }
.side-nav { display: grid; gap: 2px; }
.side-label { margin: var(--s4) var(--s3) var(--s1); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--nav-muted); font-weight: 600; }
.side-nav .side-label:first-child { margin-top: var(--s1); }
.side-link {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: var(--touch); padding: 0 var(--s3);
  border-radius: var(--r-sm); color: var(--nav-text); font: inherit; font-size: var(--fs-sm); font-weight: 550;
  background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none;
}
.sidebar .side-link .icon { color: var(--nav-muted); }
.sidebar .side-link:hover { background: var(--nav-hover); color: var(--nav-text-strong); text-decoration: none; }
.sidebar .side-link[aria-current] { background: var(--nav-active-bg); color: var(--nav-active-text); box-shadow: inset 3px 0 0 #3B82F6; }
.sidebar .side-link[aria-current] .icon { color: #93C5FD; }
.sidebar-foot { margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--nav-border); display: grid; gap: var(--s2); }
.user-chip { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s2); min-width: 0; }
.user-chip-text { display: grid; min-width: 0; line-height: 1.3; }
.user-chip-text strong { color: var(--nav-text-strong); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text span { color: var(--nav-muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-full); background: #1E3A8A; color: #DBEAFE; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em; }
.avatar-link { display: none; text-decoration: none; }
.avatar-link:hover { text-decoration: none; color: #FFFFFF; box-shadow: var(--ring); }

.app-main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; min-width: 0; }
.app-topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--s2);
  height: var(--topbar-h); padding: 0 var(--s4);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand .brand-name { display: none; }
@media (min-width: 400px) { .topbar-brand .brand-name { display: inline; } }
.topbar-spacer { flex: 1; }
.balance-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: var(--fs-sm); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance-pill .icon { color: var(--text-3); }
.balance-pill:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); }
@media (max-width: 359px) { .balance-pill .icon { display: none; } .balance-pill { padding: 0 var(--s2); } }
.app-content { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s10); outline: none; min-width: 0; }
.app-footer { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); justify-content: space-between; align-items: center; padding: var(--s4); border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-sm); }
.app-footer nav { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.app-footer a { color: var(--text-2); min-height: 32px; display: inline-flex; align-items: center; overflow-wrap: anywhere; }

@media (min-width: 768px) { .app-content { padding: var(--s6) var(--s6) var(--s12); } .app-footer { padding: var(--s4) var(--s6); } }
@media (min-width: 1024px) {
  .sidebar { width: var(--sidebar-w); transform: none; visibility: visible; box-shadow: none; z-index: 30; }
  .sidebar .drawer-close, .shell-app .burger, .shell-app .drawer-backdrop, .topbar-brand { display: none; }
  .app-main { margin-left: var(--sidebar-w); }
  .app-topbar { padding: 0 var(--s8); gap: var(--s3); }
  .app-content { padding: var(--s8) var(--s8) var(--s12); }
  .app-footer { padding: var(--s4) var(--s8); }
  .avatar-link { display: inline-grid; }
}

/* =========================================================================
   Page structure
   ========================================================================= */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head h1 { margin: 0 0 var(--s1); }
.page-head p { margin: 0; color: var(--text-2); }
.page-head > .btn { flex: none; }
@media (max-width: 639px) { .page-head > .btn { width: 100%; } }
.crumbs { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s3); overflow-wrap: anywhere; }
.section { margin-top: var(--s10); }
@media (min-width: 1024px) { .section { margin-top: 56px; } }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s4); }
.section-head h2 { margin: 0; font-size: var(--fs-xl); }
.section-head p { margin: 2px 0 0; font-size: var(--fs-sm); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-sm); min-width: 0; }
@media (min-width: 640px) { .card { padding: var(--s6); } }
.card-flush { padding: 0; overflow: hidden; }
.card-title { font-size: var(--fs-lg); margin: 0 0 var(--s4); display: flex; align-items: center; gap: var(--s2); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
.detail aside { display: grid; gap: var(--s4); min-width: 0; }
@media (min-width: 1024px) { .detail { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s6); } }
.grid { display: grid; gap: var(--s4); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.prose { max-width: 70ch; }
.prose h2 { margin-top: var(--s8); }
.prose ul { padding-left: 1.25em; }
.narrow { max-width: 760px; margin: 0 auto; }
.lead { font-size: var(--fs-md); color: var(--text-2); }
@media (min-width: 640px) { .lead { font-size: var(--fs-lg); } }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--fs-xs); color: var(--primary-text); font-weight: 650; margin-bottom: var(--s3); }

/* =========================================================================
   Homepage
   ========================================================================= */
.hero { display: grid; gap: var(--s6); align-items: center; }
.hero h1 { font-size: clamp(1.875rem, 7.5vw, 3rem); line-height: 1.1; letter-spacing: -0.03em; margin-bottom: var(--s3); }
.hero .lead { margin-bottom: var(--s5); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.hero-note { margin: var(--s3) 0 0; }
@media (max-width: 479px) { .hero-actions .btn { flex: 1 1 100%; } }
.hero-search { display: grid; gap: var(--s3); box-shadow: var(--shadow-md); }
.hero-search .card-title { margin-bottom: var(--s1); }
.hero-tags { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-full); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); font-weight: 550; }
.tag:hover { color: var(--primary-text); text-decoration: none; background: var(--primary-soft); }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s12); padding: var(--s6) 0 var(--s2); } }

.benefits { display: grid; gap: var(--s3); margin-top: var(--s8); }
.benefit { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.benefit > .icon { color: var(--primary-text); background: var(--primary-soft); border-radius: var(--r-md); padding: 8px; width: 36px; height: 36px; }
.benefit h2 { font-size: var(--fs-md); margin-bottom: 2px; }
.benefit p { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
@media (min-width: 768px) { .benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); } }

.platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 768px) { .platform-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .platform-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.platform-tile { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); min-height: 64px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); min-width: 0; transition: border-color 0.15s, box-shadow 0.15s; }
.platform-tile > .icon { margin-left: auto; color: var(--text-3); }
.platform-tile:hover { text-decoration: none; color: var(--text); border-color: var(--primary); box-shadow: var(--shadow-md); }
.platform-tile-text { display: grid; min-width: 0; line-height: 1.3; }
.platform-tile-text strong { font-size: var(--fs-sm); line-height: 1.25; }
@media (max-width: 767px) { .platform-tile { gap: var(--s2); padding: var(--s3) var(--s2) var(--s3) var(--s3); } .platform-tile > .icon { display: none; } .platform-tile .pf-lg { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; } }
.platform-tile-text span { font-size: var(--fs-xs); color: var(--text-3); }
@media (min-width: 1100px) { .platform-tile { flex-direction: column; align-items: flex-start; padding: var(--s4); } .platform-tile > .icon { display: none; } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.steps li { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.steps h3 { margin-bottom: 2px; }
.steps p { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); } }
.step-n, .step-dot { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-full); background: var(--primary); color: #FFFFFF; font-weight: 700; font-size: var(--fs-sm); }
.step-dot { width: 24px; height: 24px; font-size: var(--fs-xs); }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 900px) { .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); } }
.category-card { display: grid; gap: var(--s1); align-content: start; padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); min-width: 0; transition: border-color 0.15s, box-shadow 0.15s; }
.category-card:hover { text-decoration: none; color: var(--text); border-color: var(--primary); box-shadow: var(--shadow-md); }
.category-icons { display: flex; gap: 4px; margin-bottom: var(--s2); }

.cta-band { display: grid; gap: var(--s4); padding: var(--s6); border-radius: var(--r-lg); background: var(--nav-bg); color: var(--nav-text); }
.cta-band h2 { color: #FFFFFF; font-size: var(--fs-xl); }
.cta-band p { margin: 0; color: var(--nav-text); max-width: 46em; }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.cta-band .btn-secondary { background: transparent; color: #FFFFFF; border-color: rgba(255, 255, 255, 0.3); }
.cta-band .btn-secondary:hover { background: rgba(255, 255, 255, 0.08); }
@media (max-width: 479px) { .cta-actions .btn { flex: 1 1 100%; } }
@media (min-width: 900px) { .cta-band { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: var(--s8); } }

/* =========================================================================
   Platform badges (monograms, original artwork)
   ========================================================================= */
.pf {
  --pf: #64748B;
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--pf); color: #FFFFFF; font-weight: 750; font-size: 13px; letter-spacing: -0.02em; line-height: 1;
}
.pf-sm { width: 18px; height: 18px; border-radius: 5px; font-size: 8px; }
.pf-lg { width: 40px; height: 40px; border-radius: 11px; font-size: 14px; }
.pf-instagram { --pf: #C13584; background: linear-gradient(135deg, #F58529, #DD2A7B 55%, #8134AF); }
.pf-youtube { --pf: #DC2626; }
.pf-tiktok { --pf: #111827; box-shadow: inset -2px -2px 0 rgba(37, 244, 238, 0.55), inset 2px 2px 0 rgba(254, 44, 85, 0.55); }
.pf-telegram { --pf: #0284C7; }
.pf-facebook { --pf: #1D4ED8; }
.pf-x { --pf: #0F172A; }
.pf-other { --pf: #475569; }
:root[data-theme="dark"] .pf-tiktok, :root[data-theme="dark"] .pf-x { --pf: #000000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); }
:root[data-theme="dark"] .pf-tiktok { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), inset -2px -2px 0 rgba(37, 244, 238, 0.55), inset 2px 2px 0 rgba(254, 44, 85, 0.55); }

/* Chips and filter bars */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px 2px 3px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chips { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip-link { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-full); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); font-weight: 550; white-space: nowrap; }
.chip-link .pf { margin-left: -6px; }
.chip-link:hover { color: var(--text); text-decoration: none; border-color: var(--text-3); }
.chip-link[aria-current] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip-count { font-size: var(--fs-xs); color: inherit; opacity: 0.7; font-variant-numeric: tabular-nums; }
.filter-card { display: grid; gap: var(--s3); margin-bottom: var(--s5); }
.filter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); }
.filter-row .select-field { grid-column: 1 / -1; grid-row: 2; }
.filter-row-2 .select-field { grid-row: auto; }
@media (min-width: 640px) { .filter-row { grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto; } .filter-row .select-field { grid-column: auto; grid-row: auto; } .filter-row-2 { grid-template-columns: minmax(0, 1fr) auto; } }
.result-count { margin: 0; }
.search-field { position: relative; display: block; min-width: 0; }
.search-field .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-field input { padding-left: 40px; }
.select-field { display: block; min-width: 0; }

/* =========================================================================
   Services catalogue
   ========================================================================= */
.svc-group { margin-bottom: var(--s5); }
.svc-group-title { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); margin: 0 0 var(--s2); }
.svc-cat { color: var(--text-2); font-weight: 600; }
.svc-table { list-style: none; margin: 0; padding: 0; }
.svc-table-head { display: none; }
.svc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s1) var(--s3); padding: var(--s3) var(--s4); align-items: center; }
.svc-row + .svc-row { border-top: 1px solid var(--border); }
.svc-id { grid-column: 1; color: var(--text-3); font-size: var(--fs-xs); }
.svc-name { grid-column: 1; display: grid; gap: 2px; min-width: 0; }
.svc-name a { color: var(--text); font-weight: 600; }
.svc-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-price { grid-column: 1; }
.svc-limits { grid-column: 1; }
.svc-action { grid-column: 2; grid-row: 1 / span 4; }
.mobile-label { display: inline; }
@media (min-width: 900px) {
  .svc-table-head, .svc-row { grid-template-columns: 64px minmax(0, 1fr) 160px 150px 96px; gap: var(--s4); padding: var(--s3) var(--s5); }
  .svc-table-head { display: grid; background: var(--surface-2); color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
  .svc-id, .svc-name, .svc-price, .svc-limits, .svc-action { grid-column: auto; grid-row: auto; }
  .svc-action { justify-self: end; }
  .mobile-label { display: none; }
}

/* =========================================================================
   Order flow
   ========================================================================= */
.stepper { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.stepper li { display: flex; align-items: center; gap: var(--s2); min-width: 0; padding-top: var(--s2); border-top: 3px solid var(--border); color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; }
.stepper li.is-done, .stepper li.is-current { border-top-color: var(--primary); color: var(--text); }
.stepper-n { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 11px; }
.stepper .is-done .stepper-n, .stepper .is-current .stepper-n { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }
.stepper-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .stepper li { font-size: var(--fs-sm); } }

.order-layout { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); grid-template-areas: "picker" "info" "details"; }
.order-area-picker { grid-area: picker; }
.order-area-info { grid-area: info; }
.order-area-details { grid-area: details; }
@media (min-width: 1024px) {
  .order-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "picker info" "details info"; gap: var(--s6); align-items: start; }
  .order-area-info { position: sticky; top: calc(var(--topbar-h) + var(--s5)); }
}
.picker { gap: var(--s4); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
.platform-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@media (min-width: 480px) { .platform-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.platform-option { position: relative; display: block; min-width: 0; }
.platform-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.platform-option-box { display: flex; align-items: center; gap: var(--s2); min-height: var(--touch); padding: 0 var(--s3); border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 550; cursor: pointer; overflow: hidden; }
.platform-option-box > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-option input:checked + .platform-option-box { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); color: var(--text); }
.platform-option input:focus-visible + .platform-option-box { box-shadow: var(--ring); }
.platform-option-box:hover { border-color: var(--text-3); }

.svc-info-empty { display: flex; gap: var(--s3); align-items: center; color: var(--text-3); }
.svc-info-empty p { margin: 0; color: var(--text); }
.svc-info-head { display: flex; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.svc-info-title { display: grid; min-width: 0; }
.svc-info-title strong { font-size: var(--fs-lg); line-height: 1.3; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin: 0 0 var(--s4); }
.kv div { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s2) var(--s3); min-width: 0; }
.kv dt { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kv dd { margin: 2px 0 0; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv-3 { margin: var(--s4) 0 0; }
.svc-desc { font-size: var(--fs-sm); color: var(--text-2); }
.svc-desc p:last-child { margin-bottom: 0; }
.terms-list { list-style: none; margin: var(--s4) 0 0; padding: var(--s4) 0 0; border-top: 1px solid var(--border); display: grid; gap: var(--s2); font-size: var(--fs-sm); color: var(--text-2); }
.terms-list li { display: flex; gap: var(--s2); align-items: flex-start; }
.terms-list .icon { color: var(--success); margin-top: 2px; }
.price-box { display: grid; gap: var(--s1); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--primary-soft); border: 1px solid var(--primary-soft-2); }
.price-box strong { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }

.svc-layout { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }
.svc-main { display: grid; gap: var(--s4); min-width: 0; }
.svc-side { min-width: 0; }
.svc-meta { margin-bottom: var(--s2); }
.svc-title { margin: 0; }
@media (min-width: 1024px) { .svc-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s6); align-items: start; } .svc-side { position: sticky; top: calc(var(--topbar-h) + var(--s5)); } }

.review-layout { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .review-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s6); } .review-pay { position: sticky; top: calc(var(--topbar-h) + var(--s5)); } }
.review-pay { display: grid; gap: var(--s3); }
.review-pay .card-title { margin-bottom: 0; }

.summary { margin: 0; display: grid; }
.summary > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.summary > div:last-child { border-bottom: 0; }
.summary dt { color: var(--text-2); font-size: var(--fs-sm); }
.summary dd { margin: 0; font-weight: 500; text-align: right; min-width: 0; }
.summary-total dt { color: var(--text); font-weight: 650; }
.summary-total dd { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-compact > div { padding: var(--s2) 0; }

/* =========================================================================
   Forms
   ========================================================================= */
.form { display: grid; gap: var(--s4); }
.form h1, .form h2 { margin-bottom: 0; }
.form-wide { max-width: 940px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--s4); }
.field { display: grid; gap: 6px; min-width: 0; }
.field[hidden] { display: none; }
.field-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.field-label .muted { font-weight: 500; }
.field-hint { font-size: var(--fs-xs); color: var(--text-3); }
.field-error { font-size: var(--fs-sm); color: var(--danger); font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: var(--fs-md); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 0 var(--s3); min-height: var(--ctl); width: 100%; min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { padding: var(--s3); line-height: 1.5; resize: vertical; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; text-overflow: ellipsis; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
input[aria-invalid="true"], textarea[aria-invalid="true"], input.was-validated:invalid, textarea.was-validated:invalid { border-color: var(--danger); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--primary); flex: none; }
input[type="radio"] { min-height: 0; }
.check { display: flex; gap: var(--s3); align-items: flex-start; font-size: var(--fs-sm); min-height: var(--touch); padding-top: var(--s2); }
.check input { margin-top: 1px; }
.checks { align-content: end; gap: var(--s2); }
.inline-form { margin: 0 0 var(--s3); display: grid; gap: var(--s2); }
.auth { max-width: 440px; margin: 0 auto; }
.auth .card { padding: var(--s6); box-shadow: var(--shadow-md); }
@media (min-width: 640px) { .auth { margin-top: var(--s4); } .auth .card { padding: var(--s8); } }
.auth-head { display: grid; gap: var(--s2); justify-items: start; }
.auth-head h1 { margin: var(--s2) 0 0; }
.auth-head p { margin: 0; }
.auth-switch { margin: 0; padding-top: var(--s4); border-top: 1px solid var(--border); text-align: center; font-size: var(--fs-sm); color: var(--text-2); }

/* =========================================================================
   Feedback
   ========================================================================= */
.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); margin-bottom: var(--s4); border: 1px solid transparent; font-size: var(--fs-sm); }
.alert > .icon { margin-top: 1px; }
.alert > div { min-width: 0; }
.form .alert, .stack .alert, .review-pay .alert { margin-bottom: 0; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success-line); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.alert-warn { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-line); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.alert a { color: inherit; text-decoration: underline; }
.badge { display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 600; padding: 2px 10px; min-height: 24px; border-radius: var(--r-full); white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-pending, .badge-pay-created { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge-processing { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary-soft-2); }
.badge-needs_review, .badge-partial { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-line); }
.badge-completed, .badge-pay-paid { background: var(--success-soft); color: var(--success); border-color: var(--success-line); }
.badge-failed, .badge-pay-failed { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge-cancelled { background: var(--surface-2); color: var(--text-2); }
.status-card { border-left: 4px solid var(--primary); }
.status-card p { margin: 0; }
.status-card .card-title { margin-bottom: var(--s2); }
.status-completed { border-left-color: var(--success); }
.status-partial, .status-needs_review { border-left-color: var(--warning); }
.status-failed { border-left-color: var(--danger); }
.status-cancelled { border-left-color: var(--border-strong); }

/* =========================================================================
   Dashboard
   ========================================================================= */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.stat-card { display: grid; gap: 2px; align-content: start; padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); color: var(--text); min-width: 0; }
a.stat-card:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-text); margin-bottom: var(--s2); }
.stat-label { font-size: var(--fs-sm); color: var(--text-2); }
.stat-value { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.stat-foot { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-3); }
.stat-primary { grid-column: 1 / -1; background: var(--nav-bg); border-color: var(--nav-bg); color: #FFFFFF; }
a.stat-primary:hover { color: #FFFFFF; border-color: var(--primary); }
.stat-primary .stat-icon { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; }
.stat-primary .stat-label, .stat-primary .stat-foot { color: #C7D2FE; }
.stat-primary .stat-value { font-size: 1.75rem; }
@media (max-width: 767px) {
  .stat-card { padding: var(--s3) var(--s4); }
  .stat-card:not(.stat-primary) .stat-icon { width: 28px; height: 28px; margin-bottom: var(--s1); }
  .stat-card:not(.stat-primary) .stat-icon .icon { width: 16px; height: 16px; }
}
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); } .stat-primary { grid-column: span 1; } .stat-grid .stat-card:last-child { grid-column: span 1; } }
@media (min-width: 1280px) { .stat-grid { grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); } }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s6); }
@media (min-width: 768px) { .quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quick { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text); font-size: var(--fs-sm); font-weight: 600; min-width: 0; }
.quick .icon { color: var(--primary-text); }
.quick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick:hover { text-decoration: none; color: var(--text); border-color: var(--primary); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.checklist li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); align-items: start; padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); }
.checklist li > .icon { color: var(--primary-text); margin-top: 2px; }
.checklist li.is-done > .icon { color: var(--success); }
.checklist li > .btn { grid-column: 2; justify-self: start; }
.checklist p { margin: 0; }
@media (min-width: 640px) { .checklist li { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; } .checklist li > .btn { grid-column: 3; } }
.help-strip { display: flex; gap: var(--s2); align-items: center; margin: var(--s6) 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.actions-card { display: grid; gap: var(--s2); }
.actions-card .card-title { margin-bottom: var(--s1); }

/* Order rows */
.order-list, .tx-list { list-style: none; margin: 0; padding: 0; }
.order-list li + li, .tx-list li + li { border-top: 1px solid var(--border); }
.order-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s1) var(--s3); padding: var(--s3) var(--s4); color: var(--text); align-items: start; }
.order-row:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.order-row-main { display: grid; gap: 3px; min-width: 0; }
.order-row-title { font-weight: 600; line-height: 1.35; }
.order-row-meta { display: flex; flex-wrap: wrap; gap: 2px var(--s2); color: var(--text-3); font-size: var(--fs-xs); }
.order-row-link { display: flex; gap: 4px; align-items: center; color: var(--text-3); font-size: var(--fs-xs); min-width: 0; }
.order-row-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row-side { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.order-row-side .price { font-size: var(--fs-sm); }
@media (min-width: 768px) {
  .order-row { grid-template-columns: auto minmax(0, 1fr) auto; padding: var(--s4) var(--s5); align-items: center; }
  .order-row-side { grid-column: auto; display: grid; justify-items: end; gap: 4px; text-align: right; }
}
.price { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }

/* Wallet */
.balance-card { display: grid; gap: 2px; }
.balance { font-size: 2rem; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin: var(--s4) 0 0; }
.mini-stats div { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s2) var(--s3); min-width: 0; }
.mini-stats dt { font-size: var(--fs-xs); color: var(--text-3); }
.mini-stats dd { margin: 0; font-weight: 650; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tx-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: var(--s3) var(--s4); }
@media (min-width: 640px) { .tx-row { padding: var(--s4) var(--s5); } }
.tx-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text-3); }
.tx-topup, .tx-order_refund { background: var(--success-soft); color: var(--success); }
.tx-main { display: grid; gap: 2px; min-width: 0; }
.tx-title { font-weight: 600; }
.tx-side { display: grid; justify-items: end; gap: 2px; }
.tx-side .num { font-weight: 650; }

/* Support */
.support-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
@media (min-width: 1024px) { .support-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s6); } .contact-card { position: sticky; top: calc(var(--topbar-h) + var(--s5)); } }
.contact-card { display: grid; gap: var(--s3); }
.contact-card p, .contact-card .card-title { margin: 0; }
.tile-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-text); }
.faq { display: grid; gap: var(--s3); }
.disclosure > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); cursor: pointer; min-height: var(--touch); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary h2 { margin: 0; font-size: var(--fs-md); }
.disclosure > summary .icon { color: var(--text-3); transition: transform 0.15s; }
.disclosure[open] > summary .icon { transform: rotate(90deg); }
.disclosure[open] > summary { margin-bottom: var(--s3); }
.disclosure p { color: var(--text-2); }
.disclosure p:last-child { margin-bottom: 0; }
.status-help { margin: 0; display: grid; gap: var(--s3); }
.status-help div { display: grid; gap: var(--s1); }
.status-help dt { margin: 0; }
.status-help dd { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
@media (min-width: 640px) { .status-help div { grid-template-columns: 170px minmax(0, 1fr); align-items: start; } }

/* =========================================================================
   Admin tables and legacy components
   ========================================================================= */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); max-width: 100%; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table th.num { text-align: right; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.tabs { display: flex; gap: var(--s2); flex-wrap: nowrap; overflow-x: auto; margin-bottom: var(--s5); padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface); font-size: var(--fs-sm); font-weight: 550; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab[aria-current] { background: var(--text); color: var(--bg); border-color: var(--text); }
.search { display: flex; gap: var(--s2); flex: 1 1 260px; max-width: 460px; }
.search input { flex: 1; }
.stats { margin-bottom: var(--s5); }
.stat { display: flex; flex-direction: column; gap: var(--s1); }
.stat strong { font-size: var(--fs-2xl); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; font-weight: 700; overflow-wrap: anywhere; }
.facts { display: grid; gap: var(--s4); margin: 0; }
.facts-2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) { .facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.facts div { min-width: 0; }
.facts .span-2 { grid-column: 1 / -1; }
.facts dt { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: var(--s3); }
.timeline p { margin: 2px 0 0; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--border-strong); box-shadow: 0 0 0 3px var(--surface-2); }
.dot-completed { background: var(--success); }
.dot-failed { background: var(--danger); }
.dot-processing, .dot-pending { background: var(--primary); }
.dot-needs_review, .dot-partial { background: var(--warning); }

/* Empty, error, pagination */
.empty { text-align: center; padding: var(--s10) var(--s5); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
.card .empty { border: 0; padding: var(--s6) var(--s2); }
.empty-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-text); margin-bottom: var(--s3); }
.empty h3 { margin-bottom: var(--s1); }
.empty p { color: var(--text-2); font-size: var(--fs-sm); max-width: 40em; margin-left: auto; margin-right: auto; }
.empty .btn { margin-top: var(--s2); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s4); gap: var(--s3); }
.state-page { text-align: center; padding: var(--s12) 0; max-width: 520px; margin: 0 auto; }
.state-code { display: inline-block; font-size: var(--fs-sm); font-weight: 700; color: var(--primary-text); background: var(--primary-soft); padding: 4px 12px; border-radius: var(--r-full); margin-bottom: var(--s4); }
.state-page .row { margin-top: var(--s6); }

/* Confirmation dialog */
.dialog { border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s6); max-width: 420px; width: calc(100% - 32px); box-shadow: var(--shadow-lg); color: var(--text); background: var(--surface); }
.dialog::backdrop { background: rgba(2, 6, 23, 0.55); }
.dialog h2 { font-size: var(--fs-lg); }
.dialog p { color: var(--text-2); font-size: var(--fs-sm); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s5); flex-wrap: wrap; }
@media (max-width: 479px) { .dialog-actions .btn { flex: 1 1 100%; } }

/* Admin accent */
.is-admin .app-topbar { box-shadow: inset 0 -2px 0 var(--primary); }

/* Two-factor sign-in */
.secret-key { font-size: 18px; letter-spacing: 0.06em; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: var(--s3); word-break: break-all; user-select: all; margin: 0; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); padding: 0; margin: var(--s3) 0; list-style: none; }
.recovery-codes li { background: var(--surface-2); border-radius: var(--r-sm); padding: var(--s2) var(--s3); text-align: center; }

/* Admin setup checks */
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.check-list li { display: flex; gap: var(--s3); align-items: flex-start; min-width: 0; }
.check-list li > div { min-width: 0; }
.check-list p { margin: 2px 0 0; overflow-wrap: anywhere; }
.setup-checks { margin-bottom: var(--s4); }


/* Admin bulk actions */
.bulk-bar { display: grid; gap: var(--s3); margin-bottom: var(--s3); align-items: end; }
.bulk-bar .field { margin: 0; }
@media (min-width: 768px) { .bulk-bar { grid-template-columns: minmax(180px, 1fr) minmax(200px, 2fr) auto; } }
.table .sel { width: 40px; text-align: center; }
.table .sel input { width: 18px; height: 18px; }

/* Cancellation request */
.cancel-form summary { cursor: pointer; font-weight: 600; color: var(--primary-text); padding: var(--s2) 0; min-height: 44px; display: flex; align-items: center; }
.cancel-form[open] summary { margin-bottom: var(--s2); }
.cancel-request { border-color: var(--warning-line); margin-bottom: var(--s4); }
.cancel-request .inline-form { display: block; margin-top: var(--s3); }

/* Admin tables as cards on phones (labels are added by app.js) */
@media (max-width: 767px) {
  .table-wrap:has(.table-cards[data-labeled]) { overflow: visible; border: 0; background: none; box-shadow: none; }
  .table-cards[data-labeled], .table-cards[data-labeled] tbody { display: block; width: 100%; }
  .table-cards[data-labeled] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-cards[data-labeled] tr { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s2) var(--s3); margin-bottom: var(--s3); }
  .table-cards[data-labeled] td { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); padding: var(--s2) 0; border: 0; border-bottom: 1px solid var(--border); text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .table-cards[data-labeled] td:last-child { border-bottom: 0; }
  .table-cards[data-labeled] td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
  .table-cards[data-labeled] td[data-label=""] { justify-content: flex-start; text-align: left; }
  .table-cards[data-labeled] td[data-label=""]::before { display: none; }
  .table-cards[data-labeled] td.sel { justify-content: flex-start; width: auto; }
  .table-cards[data-labeled] td .stack-sm, .table-cards[data-labeled] td .row-start { justify-content: flex-end; flex-wrap: wrap; }
}

/* Support tickets */
.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-list li + li { border-top: 1px solid var(--border); }
.ticket-row { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; color: inherit; text-decoration: none; min-width: 0; }
.ticket-row:hover strong { color: var(--primary-text); }
.ticket-main { display: grid; gap: 2px; min-width: 0; }
.ticket-main strong { overflow-wrap: anywhere; }
.ticket-side { display: grid; justify-items: end; gap: 4px; flex: 0 0 auto; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.msg { border-radius: var(--r-lg); padding: var(--s3); background: var(--surface-2); max-width: 100%; }
.msg-staff { background: var(--primary-soft); border: 1px solid var(--primary-soft-2); }
.msg-head { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s1); }
.msg p { margin: 0; }
