/* ============================================================
   Prohod — Личный кабинет (Obsidian Graphite & Ceramic Daylight)
   Dual-theme: Obsidian Graphite (Dark) & Ceramic Daylight (Light).
   Zero external font CDNs, Flat Instrument Surfaces, Concentric Radii,
   Strict 0Hz Idle, WCAG AA+/AAA, Native-First Cyrillic Typography.
   ============================================================ */

:root {
  color-scheme: dark;

  /* ── Elevation Surfaces L0–L4 (Obsidian Graphite — flat calibrated steps) ── */
  --bg-cavity: #0A0D13;
  --bg-base: #0E1117;
  --bg-rail: #10141C;
  --bg-card-top: #141821;
  --bg-card-bottom: #141821;
  --bg-surface: var(--bg-card-top);
  --bg-pass-top: #171C27;
  --bg-pass-bottom: #171C27;
  --bg-dock-top: #141821;
  --bg-dock-bottom: #141821;
  --bg-dock-well: #0B0F16;
  --bg-elevated: #1D2330;
  --bg-floating-top: #1B212E;
  --bg-floating-bottom: #1B212E;
  --surface-hover: #1D2330;
  --error-surface: #27171B;
  --qr-surface: #FFFFFF;

  /* ── Text Hierarchy (WCAG AAA/AA+ — 3 calibrated roles) ── */
  --ink-primary: #F2F4F8;
  --ink-muted: #A1AAB8;
  --ink-secondary: var(--ink-muted);
  --ink-tertiary: #7D8799;
  --ink-disabled: #7D8799;

  /* ── Semantic Fills vs WCAG AA+ Text Tokens ── */
  --status-success-fill: #20BC66;
  --status-success-text: #32DA7E;
  --status-success-soft: rgba(32, 188, 102, 0.13);
  --status-success-border: rgba(50, 218, 126, 0.28);
  --status-warning-fill: #E8A428;
  --status-warning-text: #F0B43C;
  --status-warning-soft: rgba(232, 164, 40, 0.13);
  --status-warning-border: rgba(232, 164, 40, 0.30);
  --status-error-fill: #E55353;
  --status-error-text: #F87171;
  --status-error-soft: rgba(229, 83, 83, 0.13);
  --status-error-border: rgba(229, 83, 83, 0.32);
  --accent-sky: #6DC9EB;
  --status-info-text: #6DC9EB;
  --accent-sky-soft: rgba(109, 201, 235, 0.13);
  --accent-sky-border: rgba(109, 201, 235, 0.28);
  --champagne-gold: #DEC088;
  --favorite-gold: #F2C14E;
  --focus-ring: rgba(109, 201, 235, 0.80);

  /* Compatibility aliases (strictly preserved for e2e.mjs var(--green|red|amber|cyan) contract!) */
  --green: var(--status-success-text);
  --amber: var(--status-warning-text);
  --red: var(--status-error-text);
  --cyan: var(--status-info-text);

  /* ── Vitality / Horizon Trace Tokens (OKLCH matte, 0Hz) ── */
  --vitality-healthy: #359E69;
  --vitality-head: #46B87E;
  --vitality-wash: rgba(53, 158, 105, 0.085);
  --vitality-planned: rgba(127, 143, 168, 0.62);
  --vitality-elevated: #C6933E;
  --vitality-degraded: #CC7246;
  --vitality-outage: #D16268;
  --vitality-checking: #669EBC;
  --vitality-baseline: rgba(154, 166, 186, 0.18);
  --vitality-node-cutout: var(--bg-card-top);

  /* ── Borders, Hairlines & Quiet Instrument Rim (Dark only) ── */
  --border: rgba(242, 244, 248, 0.09);
  --border-strong: rgba(242, 244, 248, 0.17);
  --hairline: rgba(242, 244, 248, 0.075);
  --rim-top: rgba(255, 255, 255, 0.08);
  --rim-bottom: transparent;
  --cavity-rim-top: rgba(0, 0, 0, 0.28);
  --cavity-rim-bottom: rgba(255, 255, 255, 0.04);
  --cavity-rim-shadow: inset 0 1px 2px var(--cavity-rim-top);
  --card-shadow: none;
  --float-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
  --seg-thumb-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --flag-shadow: 0 0 0 1px rgba(242, 244, 248, 0.12);
  --backdrop-scrim: rgba(7, 9, 14, 0.64);
  --toast-bg: rgba(27, 33, 46, 0.94);

  /* ── Flat Interactive Surfaces & Sidebar Navigation ── */
  --cta-primary-bg: #F2F4F8;
  --cta-primary-hover: #FFFFFF;
  --cta-primary-ink: #0B0E14;
  --cta-primary-rim: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --cta-secondary-bg: #1B212E;
  --cta-secondary-hover: #232B3B;
  --cta-secondary-ink: #F2F4F8;
  --cta-disabled-bg: #161B25;
  --seg-thumb-bg: #222938;
  --selected-card-bg: #182722;

  --nav-row-hover: rgba(242, 244, 248, 0.04);
  --nav-row-pressed: rgba(242, 244, 248, 0.07);
  --nav-active-bg: #1F2634;
  --nav-active-hover-bg: #252D3D;
  --nav-connected-bg: #172B22;
  --nav-connected-hover-bg: #1C342A;

  /* ── Switch & Checkbox Tokens ── */
  --switch-off-top: #212735;
  --switch-off-bottom: #212735;
  --switch-off-bg: var(--switch-off-top);
  --switch-off-border-top: rgba(242, 244, 248, 0.12);
  --switch-on-bg: #1BA859;
  --switch-thumb-bg: #F4F6FA;
  --switch-thumb-idle-bg: #B8C1D1;
  --switch-thumb-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);

  /* ── Chrome & Instrument Tokens ── */
  --topbar-bg: rgba(14, 17, 23, 0.90);
  --bottomnav-bg: rgba(14, 17, 23, 0.96);
  --avatar-bg: #222A3A;
  --avatar-ink: #F2F4F8;
  --chronometer-ink: #A8C0E8;
  --passkey-ink: #EEF3FA;
  --plinth-seam: rgba(242, 244, 248, 0.08);
  --bar-tick: rgba(242, 244, 248, 0.16);

  /* ── Typography (Native-First Zero-CDN Stack) ── */
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-sans: var(--f-body);
  --f-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  /* ── Concentric Radius Ladder (16 → 14 → 12 → 10 → 8 → 6) ── */
  --r-card: 16px;
  --r-dock: 12px;
  --r-cta: 10px;
  --r-row: 10px;
  --r-control: 8px;
  --r-badge: 6px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar: 244px;
  --topbar-h: 60px;

  /* ── Viewport & Safe-Area Tokens (Browser + Telegram Mini App) ── */
  --app-vh: 100vh;
  --app-vh: var(--tg-viewport-stable-height, 100dvh);
  --safe-top: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)) + var(--tg-content-safe-area-inset-bottom, 0px));
}

/* ── Ceramic Daylight (Light — Warm Mineral Porcelain, zero white glare, zero pure-black shadows) ── */
html[data-theme="light"] {
  color-scheme: light;

  --bg-cavity: #E4DFD6;
  --bg-base: #EFEDE8;
  --bg-rail: #E8E4DC;
  --bg-card-top: #FAF9F6;
  --bg-card-bottom: #FAF9F6;
  --bg-surface: var(--bg-card-top);
  --bg-pass-top: #FCFBF9;
  --bg-pass-bottom: #FCFBF9;
  --bg-dock-top: #FAF9F6;
  --bg-dock-bottom: #FAF9F6;
  --bg-dock-well: #ECE8E0;
  --bg-elevated: #E8E4DC;
  --bg-floating-top: #FCFBF9;
  --bg-floating-bottom: #FCFBF9;
  --surface-hover: #EFECE6;
  --error-surface: #FBE9EB;
  --qr-surface: #FFFFFF;

  --ink-primary: #141820;
  --ink-muted: #434D5E;
  --ink-secondary: var(--ink-muted);
  --ink-tertiary: #535E70;
  --ink-disabled: #596374;

  --status-success-fill: #158046;
  --status-success-text: #116E3B;
  --status-success-soft: rgba(21, 128, 70, 0.10);
  --status-success-border: rgba(21, 128, 70, 0.28);
  --status-warning-fill: #B4690E;
  --status-warning-text: #8F5300;
  --status-warning-soft: rgba(180, 105, 14, 0.11);
  --status-warning-border: rgba(180, 105, 14, 0.30);
  --status-error-fill: #C82834;
  --status-error-text: #B4232E;
  --status-error-soft: rgba(200, 40, 52, 0.10);
  --status-error-border: rgba(200, 40, 52, 0.30);
  --accent-sky: #0E7490;
  --status-info-text: #0B617A;
  --accent-sky-soft: rgba(14, 116, 144, 0.10);
  --accent-sky-border: rgba(14, 116, 144, 0.28);
  --champagne-gold: #9B7836;
  --favorite-gold: #996300;
  --focus-ring: rgba(14, 116, 144, 0.85);

  --vitality-healthy: #127A43;
  --vitality-head: #0E6637;
  --vitality-wash: rgba(18, 122, 67, 0.08);
  --vitality-planned: rgba(83, 94, 112, 0.58);
  --vitality-elevated: #A85D08;
  --vitality-degraded: #B0461B;
  --vitality-outage: #C42632;
  --vitality-checking: #0E7490;
  --vitality-baseline: rgba(59, 51, 40, 0.17);
  --vitality-node-cutout: var(--bg-card-top);

  /* Dual Polarity: --rim-top: transparent and warm mineral rgba(59, 51, 40, ...) shadows only */
  --border: rgba(58, 52, 43, 0.12);
  --border-strong: rgba(58, 52, 43, 0.22);
  --hairline: rgba(58, 52, 43, 0.095);
  --rim-top: transparent;
  --rim-bottom: transparent;
  --cavity-rim-top: rgba(59, 51, 40, 0.10);
  --cavity-rim-bottom: transparent;
  --cavity-rim-shadow: inset 0 1px 2px rgba(59, 51, 40, 0.08);
  --card-shadow: 0 1px 2px rgba(59, 51, 40, 0.04);
  --float-shadow: 0 10px 28px rgba(59, 51, 40, 0.14);
  --seg-thumb-shadow: 0 1px 2px rgba(59, 51, 40, 0.09);
  --flag-shadow: 0 0 0 1px rgba(58, 52, 43, 0.14);
  --backdrop-scrim: rgba(59, 51, 40, 0.34);
  --toast-bg: rgba(252, 251, 249, 0.96);

  --cta-primary-bg: #171C26;
  --cta-primary-hover: #232B3A;
  --cta-primary-ink: #F8FAFC;
  --cta-primary-rim: 0 1px 2px rgba(59, 51, 40, 0.14);
  --cta-secondary-bg: #FAF9F6;
  --cta-secondary-hover: #F2EFE9;
  --cta-secondary-ink: #141820;
  --cta-disabled-bg: #E7E2D9;
  --seg-thumb-bg: #FFFFFF;
  --selected-card-bg: #EBF5EF;

  --nav-row-hover: rgba(58, 52, 43, 0.045);
  --nav-row-pressed: rgba(58, 52, 43, 0.08);
  --nav-active-bg: #E1DCD3;
  --nav-active-hover-bg: #DAD4C9;
  --nav-connected-bg: #D9EDE2;
  --nav-connected-hover-bg: #CFE7DA;

  --switch-off-top: #8E887C;
  --switch-off-bottom: #807A6E;
  --switch-off-bg: var(--switch-off-top);
  --switch-off-border-top: rgba(58, 52, 43, 0.22);
  --switch-on-bg: #158046;
  --switch-thumb-bg: #FFFFFF;
  --switch-thumb-idle-bg: #FFFFFF;
  --switch-thumb-shadow: 0 1px 2px rgba(59, 51, 40, 0.18);

  --topbar-bg: rgba(239, 237, 232, 0.92);
  --bottomnav-bg: rgba(239, 237, 232, 0.96);
  --avatar-bg: #1B2230;
  --avatar-ink: #F8FAFC;
  --chronometer-ink: #6D6558;
  --passkey-ink: #1E2634;
  --plinth-seam: rgba(58, 52, 43, 0.12);
  --bar-tick: rgba(58, 52, 43, 0.16);
}

@media (prefers-contrast: more) {
  :root {
    --border: rgba(242, 244, 248, 0.30);
    --border-strong: rgba(242, 244, 248, 0.44);
    --hairline: rgba(242, 244, 248, 0.24);
  }
  html[data-theme="light"] {
    --border: rgba(58, 52, 43, 0.36);
    --border-strong: rgba(58, 52, 43, 0.48);
    --hairline: rgba(58, 52, 43, 0.30);
  }
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  background: var(--bg-base);
  color: var(--ink-primary);
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: var(--app-vh);
}
html, body { overflow-x: clip; max-width: 100%; overscroll-behavior-x: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font: inherit; }
b, strong { font-weight: 500; }
::selection { background: var(--status-success-soft); color: var(--ink-primary); }
[hidden] { display: none !important; }
.grad { color: var(--ink-primary); }
.mono { font-family: var(--f-mono); }
.muted { color: var(--ink-muted); }

/* Global secondary copy & semantic text helpers */
.sub { color: var(--ink-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.sub--danger { color: var(--status-error-text); }
.sub--warn { color: var(--status-warning-text); }
.sub--ok { color: var(--status-success-text); }

/* Accessible links inside copy / notes / FAQ */
.link-accent,
.note a,
.faq-link {
  color: var(--status-info-text);
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 2px;
}
.link-accent:hover,
.note a:hover,
.faq-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Unified keyboard focus rings (no border-radius mutation on focus) */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.btn--danger:focus-visible,
.btn--destructive:focus-visible { outline-color: var(--status-error-text); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Skip link for keyboard & screen-reader users */
.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 300;
  padding: 9px 14px;
  border-radius: var(--r-control);
  background: var(--cta-primary-bg);
  color: var(--cta-primary-ink);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--float-shadow);
  transition: top 140ms var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: calc(12px + var(--safe-top));
}

/* ── Brand Lockup (canonical 48×48 Obsidian-Titanium SVG) ── */
.mark {
  display: inline-block;
  width: 30px;
  height: 30px;
  flex: none;
  line-height: 0;
}
.mark svg { width: 100%; height: 100%; display: block; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}
.brand__word { color: var(--ink-primary); }
.brand--lg { font-size: 24px; }
.brand--lg .mark { width: 40px; height: 40px; }

/* ── 3-Way Segmented Theme Switch (Dark / Light / System, zero-FOUC) ── */
.theme-seg {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  box-shadow: var(--cavity-rim-shadow);
  gap: 2px;
  flex: none;
}
.theme-seg__btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border-radius: 7px;
  color: var(--ink-tertiary);
  font-weight: 500;
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}
.theme-seg__btn:hover { color: var(--ink-primary); }
.theme-seg__btn[aria-pressed="true"],
html[data-theme-pref="dark"] .theme-seg__btn[data-theme-set="dark"],
html[data-theme-pref="light"] .theme-seg__btn[data-theme-set="light"],
html[data-theme-pref="system"] .theme-seg__btn[data-theme-set="system"] {
  background: var(--seg-thumb-bg);
  color: var(--ink-primary);
  font-weight: 500;
  box-shadow: var(--seg-thumb-shadow);
}
.theme-seg__btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Unified Recessed L0 Text Inputs ── */
.input {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-row);
  background: var(--bg-cavity);
  border: 1px solid var(--border);
  box-shadow: var(--cavity-rim-shadow);
  color: var(--ink-primary);
  font-size: 14px;
  transition: border-color 140ms var(--ease);
}
.input::placeholder { color: var(--ink-tertiary); }
.input:focus { border-color: var(--accent-sky); }
.input--mono {
  font-family: var(--f-mono);
  letter-spacing: 0;
  text-transform: none;
}
.input--code {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.24em;
}

/* ── Buttons (Flat Instrument Controls + Honest Disabled Contrast) ── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
  padding: 11px 18px;
  border-radius: var(--r-cta);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 140ms var(--ease), background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn--sm { padding: 8px 14px; font-size: 13px; border-radius: var(--r-control); }
.btn--full {
  width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  min-height: 44px;
}

.btn--primary {
  color: var(--cta-primary-ink);
  background: var(--cta-primary-bg);
  box-shadow: var(--cta-primary-rim);
}
.btn--primary:hover:not(:disabled) { background: var(--cta-primary-hover); }

.btn--emerald {
  background: #1EA85B;
  border-color: rgba(50, 218, 126, 0.28);
  color: #07190F;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.20), var(--card-shadow);
}
.btn--emerald:hover:not(:disabled) { background: #23BA66; }
html[data-theme="light"] .btn--emerald {
  background: #158046;
  border-color: rgba(17, 110, 59, 0.28);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(59, 51, 40, 0.12);
}
html[data-theme="light"] .btn--emerald:hover:not(:disabled) { background: #126F3D; }

.btn--ghost {
  background: var(--cta-secondary-bg);
  border-color: var(--border);
  color: var(--cta-secondary-ink);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
}
.btn--ghost:hover:not(:disabled) { background: var(--cta-secondary-hover); border-color: var(--border-strong); }

.btn--accent {
  background: var(--status-success-soft);
  border-color: var(--status-success-border);
  color: var(--status-success-text);
}
.btn--accent:hover:not(:disabled) { border-color: var(--status-success-fill); }

.btn--danger {
  background: var(--status-error-soft);
  border-color: var(--status-error-border);
  color: var(--status-error-text);
}
.btn--danger:hover:not(:disabled) { border-color: var(--status-error-fill); }

/* Calm secondary at rest with crimson ink, warms to tonal error surface on hover */
.btn--destructive {
  background: var(--cta-secondary-bg);
  border-color: var(--border);
  color: var(--status-error-text);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
}
.btn--destructive:hover:not(:disabled) {
  background: var(--error-surface);
  border-color: var(--status-error-border);
}

/* Flat cerulean Telegram primary auth button */
.btn--telegram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: var(--r-cta);
  background: #1B86C1;
  border: 1px solid rgba(110, 198, 245, 0.28);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), var(--card-shadow);
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease);
}
.btn--telegram:hover:not(:disabled) {
  background: #2093D1;
  border-color: rgba(142, 219, 255, 0.42);
}
html[data-theme="light"] .btn--telegram {
  background: #177EB7;
  border-color: rgba(23, 126, 183, 0.30);
  box-shadow: 0 1px 2px rgba(59, 51, 40, 0.12);
}
html[data-theme="light"] .btn--telegram:hover:not(:disabled) {
  background: #146FA1;
  border-color: rgba(20, 111, 161, 0.42);
}
.btn--telegram:active:not(:disabled) { transform: scale(0.985); }
.btn--telegram .social-ic { flex: none; width: 22px; height: 22px; display: grid; place-items: center; }
.btn--telegram .social-ic svg { width: 22px; height: 22px; display: block; stroke: none; }

/* HonestControlAvailability: readable disabled slab, zero muddy opacity */
.btn[disabled], .btn:disabled,
.btn--telegram[disabled], .btn--telegram:disabled {
  background: var(--cta-disabled-bg);
  color: var(--ink-disabled);
  border-color: var(--hairline);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: auto;
}

/* Zero-shift loading spinner (transient active request only — 0Hz idle) */
.btn.is-loading { pointer-events: none; }
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: prohodSpin 680ms linear infinite;
}
@keyframes prohodSpin { to { transform: rotate(360deg); } }

/* Unified 1.5 linear button icon sizing */
.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.btn--sm svg,
.btn--sm > svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.5;
}

/* Inline card heading line-icons (unified 1.5 stroke) */
.bolt-ic,
.bolt-ic svg,
h3 svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 17px;
  height: 17px;
  color: var(--ink-tertiary);
  flex: none;
}
span.bolt-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -2px;
  margin-right: 6px;
}

.gapb { color: var(--status-warning-text); display: inline-flex; align-items: center; gap: 6px; }
.gapb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Topbar status pills — flat matte L2 (clickable links to Subscription & Regions) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-card-top);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease), color 140ms var(--ease);
}
a.pill:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.pill--quiet { color: var(--ink-muted); }
a.pill--quiet:hover { color: var(--ink-primary); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot--green { background: var(--status-success-fill); }
.dot--amber { background: var(--status-warning-fill); }
.dot--red { background: var(--status-error-fill); }
.dot--muted { background: var(--ink-tertiary); }
.dot--cyan { background: var(--accent-sky); }

/* Semantic & Interactive Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex: none;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
  padding: 4px 9px;
  border-radius: var(--r-badge);
  border: 1px solid var(--border);
  background: var(--bg-cavity);
}
.chip--ok {
  color: var(--status-success-text);
  background: var(--status-success-soft);
  border-color: var(--status-success-border);
}
.chip--warn {
  color: var(--status-warning-text);
  background: var(--status-warning-soft);
  border-color: var(--status-warning-border);
}
.chip--danger {
  color: var(--status-error-text);
  background: var(--status-error-soft);
  border-color: var(--status-error-border);
}
.chip--muted {
  color: var(--ink-muted);
  background: var(--bg-cavity);
  border-color: var(--border);
}
.chip--quiet {
  color: var(--ink-tertiary);
  background: transparent;
  border-color: var(--hairline);
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 7px;
}
a.chip { transition: border-color 140ms var(--ease), background-color 140ms var(--ease), color 140ms var(--ease); }
a.chip:hover { border-color: var(--border-strong); background: var(--surface-hover); color: var(--ink-primary); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-ink);
  border: 1px solid var(--border-strong);
  font-weight: 500;
  font-size: 13.5px;
  flex: none;
  transition: border-color 140ms var(--ease);
}
a.avatar:hover, button.avatar:hover { border-color: var(--ink-tertiary); }
.avatar--sm { width: 32px; height: 32px; font-size: 12.5px; }

/* ── Floating L4 Toast ── */
.toast-pop {
  position: fixed;
  top: calc(var(--topbar-h, 60px) + 10px + var(--safe-top));
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  max-width: min(460px, calc(100vw - 28px));
  padding: 6px 7px 6px 9px;
  border-radius: var(--r-pill);
  background: var(--toast-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--float-shadow);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.38;
  opacity: 0;
  transition: opacity 220ms var(--ease), transform 240ms var(--ease);
}
.toast-pop.is-in { opacity: 1; transform: translate(-50%, 0); }
body:has(#app[hidden]) .toast-pop,
body[data-view="auth"] .toast-pop {
  top: calc(12px + var(--safe-top));
}
.toast-pop--multi {
  border-radius: 14px;
  padding: 9px 10px 9px 12px;
  align-items: flex-start;
}
.toast-pop__ic {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  background: var(--status-success-soft);
  color: var(--status-success-text);
}
.toast-pop__ic svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toast-pop__body { flex: 1; min-width: 0; }
.toast-pop__sep { width: 1px; height: 14px; background: var(--hairline); flex: none; margin: 0 1px; }
.toast-pop__close {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--ink-muted);
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}
.toast-pop__close:hover { color: var(--ink-primary); background: var(--nav-row-hover); }
.toast-pop__close svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toast-pop--ok { border-color: var(--status-success-border); }
.toast-pop--ok .toast-pop__ic { background: var(--status-success-soft); color: var(--status-success-text); }
.toast-pop--err { border-color: var(--status-error-border); }
.toast-pop--err .toast-pop__ic { background: var(--status-error-soft); color: var(--status-error-text); }
.toast-pop--info { border-color: var(--accent-sky-border); }
.toast-pop--info .toast-pop__ic { background: var(--accent-sky-soft); color: var(--status-info-text); }

/* ── TMA ZERO-CLICK BOOT SHELL (0Hz Obsidian & Porcelain) ── */
.tma-boot { display: none; }
html[data-tma-boot="1"] #auth { display: none; }
html[data-tma-boot="1"] #tma-boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: var(--app-vh);
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
}
.tma-boot__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 32px;
  border-radius: var(--r-card);
  background: var(--bg-card-top);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
  text-align: center;
  max-width: 300px;
  width: 100%;
}
.tma-boot__mark {
  width: 56px;
  height: 56px;
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
}
.tma-boot__mark svg { width: 56px; height: 56px; display: block; }
.tma-boot__word {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}
.tma-boot__status {
  font-size: 13.5px;
  color: var(--ink-muted);
}

/* ── AUTH SCREEN (Split-Stage + Precision 0Hz Chronometer) ── */
.auth {
  min-height: 100vh;
  min-height: var(--app-vh);
  display: grid;
  justify-items: center;
  align-content: safe center;
  padding: clamp(20px, 4vh, 44px) 20px;
}
.auth__shell {
  width: 100%;
  max-width: 920px;
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  background: var(--bg-card-top);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: inset 0 1px 0 var(--rim-top), var(--float-shadow);
}

.auth__brand {
  position: relative;
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  background: var(--bg-pass-top);
  border-right: 1px solid var(--hairline);
  overflow: hidden;
}
.auth__chronometer {
  position: absolute;
  width: 420px;
  height: 420px;
  left: -96px;
  top: -96px;
  color: var(--chronometer-ink);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
html[data-theme="light"] .auth__chronometer { opacity: 0.24; }

.auth__brand-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auth__pitch { position: relative; z-index: 1; }
.auth__overline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-tertiary);
  margin-bottom: 10px;
}
.auth__headline {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
}
.auth__lede { color: var(--ink-muted); font-size: 14px; margin-top: 12px; max-width: 320px; line-height: 1.55; }
.auth__feats { list-style: none; display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.auth__feats li { display: flex; gap: 12px; align-items: flex-start; }
.feat-ic {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--ink-tertiary);
}
.feat-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.auth__feats b { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink-primary); }
.auth__feats i { font-style: normal; font-size: 12.5px; color: var(--ink-muted); }
.auth__meta-strip {
  position: relative;
  z-index: 1;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--ink-tertiary);
}

/* Auth right panel */
.auth__panel { padding: 34px 34px 30px; display: flex; flex-direction: column; justify-content: flex-start; }
.seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  box-shadow: var(--cavity-rim-shadow);
  border-radius: 11px;
  padding: 3px;
  margin-bottom: 20px;
}
.seg__btn {
  position: relative;
  z-index: 1;
  padding: 9px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 140ms var(--ease);
}
.seg__btn.is-active,
.seg__btn[aria-pressed="true"] { color: var(--ink-primary); }
.seg__ind {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 8px;
  background: var(--seg-thumb-bg);
  box-shadow: var(--seg-thumb-shadow);
  transition: transform 220ms var(--ease);
}
.seg[data-mode="register"] .seg__ind { transform: translateX(100%); }

.auth__title { font-family: var(--f-display); font-weight: 500; font-size: 24px; letter-spacing: -0.02em; color: var(--ink-primary); }
.auth__sub { color: var(--ink-muted); font-size: 13.5px; margin: 6px 0 18px; }

.social { display: flex; flex-direction: column; gap: 8px; }
#passkey-slot:empty,
.oauth-pill-row:empty { display: none; }
.oauth-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}
.oauth-pill-row .social-btn--pill {
  flex: 1 1 104px;
  width: auto;
  min-width: 0;
}
.oauth-pill-row:has(> :nth-child(4):last-child) .social-btn--pill {
  flex-basis: calc(50% - 4px);
}
.social-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--r-cta);
  background: var(--cta-secondary-bg);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
  color: var(--ink-primary);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease), transform 140ms var(--ease);
}
.social-btn:hover { background: var(--cta-secondary-hover); border-color: var(--border-strong); }
.social-btn:active { transform: scale(0.99); }
.social-btn .social-ic { flex: none; width: 24px; height: 24px; display: grid; place-items: center; color: var(--passkey-ink); }
.social-btn .social-ic svg { width: 24px; height: 24px; display: block; }
.social-btn--passkey { min-height: 44px; justify-content: flex-start; }
.social-btn--passkey .chip--quiet { margin-left: auto; }
.social-btn--pill {
  min-height: 40px;
  padding: 8px 10px;
  gap: 7px;
  justify-content: center;
  font-size: 13px;
  border-radius: var(--r-control);
}
.social-btn--pill .social-ic { width: 18px; height: 18px; }
.social-btn--pill .social-ic svg { width: 18px; height: 18px; }

.auth__or { display: flex; align-items: center; gap: 12px; color: var(--ink-tertiary); font-size: 12px; margin: 16px 0; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

.auth__form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth__form .field { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; min-width: 0; }
.field__label { font-size: 12px; color: var(--ink-muted); font-weight: 500; }
.auth__form input:not([type="checkbox"]) {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-row);
  background: var(--bg-cavity);
  border: 1px solid var(--border);
  box-shadow: var(--cavity-rim-shadow);
  color: var(--ink-primary);
  font-size: 14px;
  transition: border-color 140ms var(--ease);
}
.auth__form input:not([type="checkbox"])::placeholder { color: var(--ink-tertiary); }
.auth__form input:not([type="checkbox"]):focus { border-color: var(--accent-sky); }

/* Password eye reveal + live strength/match feedback */
.pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pass-wrap input { padding-right: 42px; }
.pass-eye {
  position: absolute;
  right: 4px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-control);
  color: var(--ink-tertiary);
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}
.pass-eye:hover { color: var(--ink-primary); background: var(--nav-row-hover); }
.pass-eye svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pass-meter,
.pass-match {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-muted);
}
.pass-meter__bar {
  flex: 1;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.pass-meter__fill {
  height: 100%;
  width: 0;
  border-radius: var(--r-pill);
  transition: width 180ms var(--ease), background-color 140ms var(--ease);
}
.pass-meter--weak { color: var(--status-error-text); }
.pass-meter--weak .pass-meter__fill { background: var(--status-error-fill); }
.pass-meter--mid { color: var(--status-warning-text); }
.pass-meter--mid .pass-meter__fill { background: var(--status-warning-fill); }
.pass-meter--ok { color: var(--status-success-text); }
.pass-meter--ok .pass-meter__fill { background: var(--status-success-fill); }
.pass-match--ok { color: var(--status-success-text); }
.pass-match--err { color: var(--status-error-text); }

/* Flat Precision Checkbox */
.check-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
  min-height: 28px;
}
.check-row:hover { color: var(--ink-primary); }
.check-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.check-box {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--switch-off-bg);
  border: 1px solid var(--switch-off-border-top);
  box-shadow: inset 0 1px 1px var(--cavity-rim-top);
  color: #FFFFFF;
  flex: none;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease);
}
.check-box svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 140ms var(--ease), transform 160ms var(--ease);
}
.check-row input[type="checkbox"]:checked + .check-box {
  background: var(--switch-on-bg);
  border-color: var(--status-success-border);
  box-shadow: inset 0 1px 0 var(--rim-top);
}
html[data-theme="light"] .check-row input[type="checkbox"]:checked + .check-box {
  box-shadow: none;
}
.check-row input[type="checkbox"]:checked + .check-box svg {
  opacity: 1;
  transform: scale(1);
}
.check-row input[type="checkbox"]:focus-visible + .check-box {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.auth__form .btn--primary { margin-top: 4px; }
.auth__err {
  color: var(--status-error-text);
  font-size: 13px;
  background: var(--status-error-soft);
  border: 1px solid var(--status-error-border);
  border-radius: var(--r-control);
  padding: 9px 11px;
}
.auth__demo { margin-top: 16px; font-size: 12.5px; color: var(--ink-muted); text-align: center; }
.auth__legal { margin-top: 8px; font-size: 11.5px; color: var(--ink-tertiary); text-align: center; line-height: 1.5; }
.auth__legal a { color: var(--status-info-text); text-decoration: underline; text-underline-offset: 2px; }

/* Tablet keeps framed auth card; only narrow phones go full-bleed */
@media (max-width: 820px) {
  .auth { padding: 24px 16px; }
  .auth__shell { grid-template-columns: 1fr; max-width: 500px; min-height: 0; align-content: start; }
  .auth__brand { padding: 24px 24px 20px; border-right: 0; border-bottom: 1px solid var(--hairline); gap: 14px; }
  .auth__headline { font-size: 24px; }
  .auth__lede { max-width: none; font-size: 13.5px; }
  .auth__feats, .auth__meta-strip { display: none; }
  .auth__panel { padding: 24px 24px 32px; }
}
@media (max-width: 540px) {
  .auth { padding: 0; }
  .auth__shell { max-width: none; border-radius: 0; min-height: 100vh; min-height: var(--app-vh); border: 0; box-shadow: none; }
  .auth__brand { padding: calc(22px + var(--safe-top)) 18px 18px; }
  .auth__panel { padding: 22px 18px calc(34px + var(--safe-bottom)); }
}

/* ── APP SHELL (L1 Rail + L1 Base + Flat Matte Sidebar Navigation) ── */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; min-height: var(--app-vh); min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: var(--app-vh);
  background: var(--bg-rail);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}
.sidebar .brand { padding: 2px 10px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
  position: relative;
}
.nav a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a:hover { color: var(--ink-primary); background: var(--nav-row-hover); }
.nav a:active { background: var(--nav-row-pressed); }
.nav a.active {
  color: var(--ink-primary);
  font-weight: 500;
  background: var(--nav-active-bg);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 var(--rim-top);
}
.nav a.active:hover { background: var(--nav-active-hover-bg); }
.nav .sep { height: 1px; background: var(--hairline); margin: 8px 10px; }

/* 0Hz static onboarding chip (≥ 11px floor, quiet neutral — shown only when active && 0 devices) */
.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-tertiary);
  background: transparent;
  border: 1px solid var(--hairline);
  padding: 2px 7px;
  border-radius: var(--r-badge);
}

/* Sidebar Account Footer (profile link + dedicated logout button) */
.account {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--r-dock);
  background: var(--bg-card-top);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
  width: 100%;
  transition: border-color 140ms var(--ease);
}
.account:hover { border-color: var(--border-strong); }
.account__link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 3px 4px;
  border-radius: var(--r-control);
  text-align: left;
  transition: background-color 140ms var(--ease);
}
.account__link:hover { background: var(--nav-row-hover); }
.account__meta { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.account__meta b { font-size: 13px; font-weight: 500; color: var(--ink-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__meta i { font-style: normal; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__logout {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-control);
  color: var(--ink-tertiary);
  flex: none;
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}
.account__logout:hover { color: var(--status-error-text); background: var(--error-surface); }
.account__logout svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: calc(var(--topbar-h) + var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: calc(12px + var(--safe-top)) clamp(16px, 3vw, 36px) 12px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.topbar__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__right { display: flex; align-items: center; gap: 10px; flex: none; }
#topbar-logout { display: none; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-control);
  background: var(--cta-secondary-bg);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
  color: var(--ink-muted);
  flex: none;
  transition: color 140ms var(--ease), border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.icon-btn:hover { color: var(--ink-primary); border-color: var(--border-strong); background: var(--cta-secondary-hover); }
.icon-btn svg { width: 16px; height: 16px; stroke-width: 1.5; }
.view { padding: clamp(20px, 3vw, 34px) clamp(20px, 3vw, 34px) calc(clamp(20px, 3vw, 34px) + var(--safe-bottom)); max-width: 1140px; width: 100%; }
.view:focus:not(:focus-visible) { outline: none; }
#app[data-guest="1"] { grid-template-columns: 1fr; }
#app[data-guest="1"] .sidebar,
#app[data-guest="1"] .bottomnav,
#app[data-guest="1"] #plan-pill,
#app[data-guest="1"] #top-avatar,
#app[data-guest="1"] #topbar-logout { display: none; }
#app[data-guest="1"] .view { padding-bottom: calc(clamp(20px, 3vw, 34px) + var(--safe-bottom)); }
.loading { color: var(--ink-muted); padding: 40px; text-align: center; font-size: 14px; }
.bottomnav { display: none; }

/* ── Mobile "Ещё" Bottom-Sheet Drawer (L4 Floating Surface) ── */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: var(--backdrop-scrim);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}
.sheet-backdrop.is-open { opacity: 1; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  max-height: min(82vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-floating-top);
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(20px + var(--safe-bottom));
  box-shadow: inset 0 1px 0 var(--rim-top), var(--float-shadow);
  transform: translateY(100%);
  transition: transform 240ms var(--ease);
}
.sheet.is-open { transform: translateY(0); }
.sheet__handle {
  width: 38px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  margin: 0 auto 12px;
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}
.sheet__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}
.sheet__close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-cavity);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}
.sheet__close:hover { color: var(--ink-primary); border-color: var(--border-strong); }
.sheet__close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sheet__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sheet__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sheet__item,
.sheet__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--r-row);
  color: var(--ink-primary);
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  width: 100%;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.sheet__grid .sheet__item {
  background: var(--bg-card-top);
  border-color: var(--border);
}
.sheet__item:hover,
.sheet__row:hover { background: var(--nav-row-hover); }
.sheet__item.active,
.sheet__row.active {
  background: var(--nav-active-bg);
  border-color: var(--border);
  font-weight: 500;
}
.sheet__item svg,
.sheet__row svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  color: var(--ink-tertiary);
}
.sheet__item.active svg,
.sheet__row.active svg { color: var(--ink-primary); }
.sheet__sep { height: 1px; background: var(--hairline); margin: 8px 0; }
.sheet__danger { color: var(--status-error-text); }
.sheet__danger svg { color: var(--status-error-text); }
.sheet__danger:hover { background: var(--error-surface); }

/* ── Grids, Flat Matte Cards, Subscription Pass & 2-Chamber Plinth ── */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: 1.5fr 1fr; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  position: relative;
  background: var(--bg-card-top);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 22px;
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
}
.sec-card { scroll-margin-top: calc(var(--topbar-h, 60px) + var(--safe-top) + 16px); }

/* Flagship Subscription Pass Surface (flat matte + semantic hairline borders) */
.card--pass {
  background: var(--bg-pass-top);
  border-color: var(--border-strong);
}
.card--pass-warn {
  background: var(--bg-pass-top);
  border-color: var(--status-warning-border);
}
.card--pass-danger {
  background: var(--bg-pass-top);
  border-color: var(--status-error-border);
}
.card--pass-neutral {
  background: var(--bg-pass-top);
  border-color: var(--border);
}
.card--pass-trial {
  background: var(--bg-pass-top);
  border-color: var(--status-success-border);
}

.pass-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.pass-rail__brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.pass-rail__brand .mark { width: 18px; height: 18px; }
.pass-rail__title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-tertiary);
}
.pass-id-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--r-badge);
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}
.pass-id-btn:hover { color: var(--ink-primary); border-color: var(--border-strong); }
.pass-id-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Fused L0 3-Cell Metrics Strip */
.pass-metrics {
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  border-radius: var(--r-row);
  box-shadow: var(--cavity-rim-shadow);
  display: grid;
  grid-template-columns: 1fr 0.9fr 1.1fr;
  overflow: hidden;
  margin-top: 14px;
}
.pass-metric {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  border-right: 1px solid var(--hairline);
}
.pass-metric:last-child { border-right: 0; }
.pass-metric__k {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pass-metric__v {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2-Chamber Plinth Card (flat deck + recessed well separated by 1px hairline) */
.card--plinth {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.plinth-deck {
  padding: 22px;
  background: var(--bg-dock-top);
  flex: 1;
}
.plinth-well {
  padding: 13px 22px;
  background: var(--bg-dock-well);
  border-top: 1px solid var(--plinth-seam);
}
.plinth-well .note { margin-top: 0; }

.card h3 { font-family: var(--f-display); font-weight: 500; font-size: 17px; letter-spacing: -0.01em; margin-bottom: 4px; color: var(--ink-primary); }
.card__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.section-title { font-family: var(--f-display); font-weight: 500; font-size: clamp(22px, 2.8vw, 28px); letter-spacing: -0.02em; margin-bottom: 6px; color: var(--ink-primary); }
.section-lead { color: var(--ink-muted); font-size: 14px; max-width: 580px; margin-bottom: 22px; }
.section-lead--tight { margin-top: -8px; }

/* ── Banners (flat semantic surfaces, multi-button safe on all viewports) ── */
.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r-card);
  background: var(--bg-card-top);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
}
.banner b { font-size: 15px; font-weight: 500; color: var(--ink-primary); }
.banner .meta { color: var(--ink-muted); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.banner .col,
.banner > div:not(.banner__actions) { flex: 1; min-width: 0; }
.banner .col { display: flex; flex-direction: column; gap: 2px; }
.banner__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; flex: none; }
.banner .btn { margin-left: auto; }
.banner__actions .btn { margin-left: 0; }
.banner > .btn + .btn { margin-left: 0; }
.banner__ic {
  width: 34px;
  height: 34px;
  border-radius: var(--r-control);
  display: grid;
  place-items: center;
  flex: none;
}
.banner__ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.banner--neutral { border-color: var(--border); background: var(--bg-card-top); }
.banner--neutral .banner__ic { background: var(--bg-cavity); color: var(--ink-tertiary); border: 1px solid var(--hairline); }
.banner--warn { border-color: var(--status-warning-border); background: var(--bg-card-top); }
.banner--warn .banner__ic { background: var(--status-warning-soft); color: var(--status-warning-text); border: 1px solid var(--status-warning-border); }
.banner--danger { border-color: var(--status-error-border); background: var(--bg-card-top); }
.banner--danger .banner__ic { background: var(--status-error-soft); color: var(--status-error-text); border: 1px solid var(--status-error-border); }
.banner--ok { border-color: var(--status-success-border); background: var(--bg-card-top); }
.banner--ok .banner__ic { background: var(--status-success-soft); color: var(--status-success-text); border: 1px solid var(--status-success-border); }
.banner--strip { padding: 13px 16px; }
.banner--strip b { font-size: 14px; }

@media (max-width: 560px) {
  .banner { flex-wrap: wrap; row-gap: 12px; }
  .banner > div:not(.banner__actions) { flex: 1 1 200px; min-width: 0; }
  .banner__actions { margin-left: 0; width: 100%; }
}

/* ── Security Checklist & Provider Rows ── */
.sec-summary { margin-bottom: 20px; }
.sec-summary .banner { flex-wrap: wrap; row-gap: 12px; }
.sec-summary .banner .col { flex: 1 1 220px; }
.sec-check { list-style: none; margin: 12px 0 0; padding: 0; display: grid; }
.sec-check li { border-bottom: 1px solid var(--hairline); }
.sec-check li:last-child { border-bottom: 0; }
.sec-crow { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 8px; border-radius: var(--r-control); font-size: 13.5px; color: var(--ink-primary); text-align: left; transition: background-color 140ms var(--ease), color 140ms var(--ease); }
button.sec-crow:hover { background: var(--nav-row-hover); color: var(--status-info-text); }
.sec-crow .ci { width: 24px; height: 24px; border-radius: var(--r-badge); display: grid; place-items: center; flex: none; }
.sec-crow .ci svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ci--ok { color: var(--status-success-text); background: var(--status-success-soft); }
.ci--warn { color: var(--status-warning-text); background: var(--status-warning-soft); }
.ci--off { color: var(--ink-muted); background: var(--bg-elevated); }
.sec-crow i { color: var(--ink-tertiary); font-style: normal; margin-left: auto; font-size: 12.5px; flex: none; padding-left: 10px; }
.acct-danger { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hairline); }

.prov-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 13.5px;
}
.prov-row:last-child { border-bottom: 0; }
.prov-row__lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prov-row__ic { width: 24px; height: 24px; flex: none; display: grid; place-items: center; color: var(--passkey-ink); }
.prov-row__ic svg { width: 24px; height: 24px; display: block; }
.prov-row__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }

/* ── Empty States ── */
.emptybox { text-align: center; padding: 14px 4px 6px; }
.emptybox .ic {
  width: 44px;
  height: 44px;
  border-radius: var(--r-dock);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  color: var(--ink-tertiary);
}
.emptybox--warn .ic {
  background: var(--status-warning-soft);
  border-color: var(--status-warning-border);
  color: var(--status-warning-text);
}
.emptybox--danger .ic {
  background: var(--status-error-soft);
  border-color: var(--status-error-border);
  color: var(--status-error-text);
}
.emptybox .ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.emptybox h3 { font-family: var(--f-display); font-weight: 500; font-size: 17px; }
.emptybox p { color: var(--ink-muted); font-size: 13.5px; line-height: 1.55; margin: 7px auto 0; max-width: 360px; }
.emptybox .btn { margin-top: 16px; }

/* ── Recessed L0 Sub-Link / Code Field ── */
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-row);
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  box-shadow: var(--cavity-rim-shadow);
  min-width: 0;
}
.field .mono { font-size: 12.5px; color: var(--ink-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.field .copy {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-control);
  background: var(--cta-secondary-bg);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  flex: none;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}
.field .copy:hover { color: var(--ink-primary); border-color: var(--border-strong); }
.field .copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions .btn { flex: 1 1 auto; min-width: max-content; }
.note { color: var(--ink-tertiary); font-size: 12.5px; margin-top: 12px; line-height: 1.5; }
.pillrow { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }

/* ── QR (clean white plate, responsive cap on mobile) ── */
.qr {
  background: var(--qr-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-dock);
  padding: 10px;
  width: 196px;
  height: 196px;
  flex: none;
}
.qr--sm { width: 156px; height: 156px; padding: 8px; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr--na {
  background: var(--bg-cavity);
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.qr--na .qr-na__ic { color: var(--status-warning-text); }
.qr--na .qr-na__ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.qr--na b { font-size: 13px; font-weight: 500; color: var(--ink-primary); }
.qr--na i { font-style: normal; font-size: 11.5px; line-height: 1.35; color: var(--ink-muted); max-width: 164px; }
.hy2-steps { margin: 0; padding-left: 18px; color: var(--ink-muted); font-size: 12.5px; line-height: 1.55; }
.hy2-steps li { margin-bottom: 5px; }
.hy2-steps b { color: var(--ink-primary); font-weight: 500; }
.qr-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }

/* ── Checkout, Plans, Promo, Receipt & Wallet ── */
.promo-card { max-width: 680px; }
.promo-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  align-items: stretch;
}
.promo-row .input,
.promo-row input { flex: 1 1 180px; min-width: 180px; }
.receipt-card { margin: 14px 0 18px; }

.plans .card { display: flex; flex-direction: column; }
.plan {
  background: var(--bg-pass-top);
  border-color: var(--border);
}
.plan--selected {
  border-color: var(--accent, var(--vitality-healthy, #20BC66));
  box-shadow: inset 0 1px 0 var(--rim-top), 0 0 0 1px var(--accent, var(--vitality-healthy, #20BC66));
}
.trial-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0;
  border-color: var(--border-strong);
  background: var(--bg-pass-top);
}
.trial-card__body { flex: 1 1 260px; min-width: 0; }
.trial-card__body h3 { margin: 0; font-size: 18px; }
.promo-details { padding: 0; }
.promo-details__sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  color: var(--ink-primary);
}
.promo-details__sum::-webkit-details-marker { display: none; }
.promo-details[open] .promo-details__sum .faq-chev { transform: rotate(180deg); }
.promo-details__body { padding: 0 20px 20px; }
.access-stack { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.access-status { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.access-status__main { flex: 1 1 280px; min-width: 0; }
.access-status__main h3 { margin: 10px 0 4px; font-size: 20px; line-height: 1.25; }
.access-status__cta { flex: none; align-self: center; }
.access-traffic { margin-top: 12px; max-width: 420px; }
.access-traffic__row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-muted); margin-bottom: 6px; }
.access-traffic__row b { color: var(--ink-primary); font-weight: 500; }
.access-connect--muted { opacity: 0.92; }
.access-connect__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.access-connect__head h3 { margin: 0; font-size: 18px; }
.access-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.access-step { display: flex; align-items: flex-start; gap: 12px; }
.access-step__n {
  width: 26px; height: 26px; flex: none; border-radius: 999px;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: var(--nav-active-bg); color: var(--ink-primary); border: 1px solid var(--border);
}
.access-step__body { flex: 1; min-width: 0; }
.access-extra-links { display: flex; flex-wrap: wrap; gap: 8px; }
.access-devices__list { margin-top: 10px; }
.access-regions__list { display: flex; flex-wrap: wrap; gap: 8px; }
.access-region-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--r-pill, 999px);
  background: var(--nav-active-bg); border: 1px solid var(--border);
  font-size: 13px; color: var(--ink-primary);
}
.adv-disclosure { padding: 0; }
.adv-disclosure__sum {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; cursor: pointer; list-style: none;
  font-weight: 500; color: var(--ink-primary);
}
.adv-disclosure__sum::-webkit-details-marker { display: none; }
.adv-disclosure[open] .adv-disclosure__sum .faq-chev { transform: rotate(180deg); }
.adv-disclosure__body {
  padding: 16px 20px 20px; border-top: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 18px;
}
.adv-sub h4 { margin: 0 0 10px; font-size: 15px; font-weight: 500; color: var(--ink-primary); }
.adv-sub--danger { padding-top: 14px; border-top: 1px solid var(--hairline); }
.access-manual-os { margin-top: 12px; }
.adv-raw-links { margin-top: 12px; }
.billing-included {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: var(--r-row);
  background: var(--nav-active-bg);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.billing-included b { color: var(--ink-primary); font-weight: 500; }

/* ── Unified Account Screen (#/account — WEB-S2-06) ── */
.account-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.account-profile,
.account-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.account-profile__lead {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 220px;
}
.account-profile__id {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.theme-seg--account {
  padding: 4px;
  gap: 4px;
}
.theme-seg--account .theme-seg__btn {
  width: auto;
  min-width: 78px;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}
html[data-tma="1"] .account-profile__logout { display: none; }
@media (max-width: 560px) {
  .theme-seg--account { width: 100%; }
  .theme-seg--account .theme-seg__btn { flex: 1 1 0; min-width: 0; height: 40px; }
}
.billing-status-pill {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.help-id-row { margin-top: 16px; }
.plan .metric { font-size: 30px; line-height: 1.05; color: var(--ink-primary); }
.plan .metric.grad { color: var(--ink-primary); }
.plan .kv { font-size: 13px; padding: 6px 0; }
.paymethods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.paymethod {
  border: 1px solid var(--border);
  border-radius: var(--r-dock);
  padding: 13px 15px;
  background: var(--bg-card-top);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
  cursor: pointer;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.paymethod:hover { border-color: var(--border-strong); }
.paymethod.is-sel {
  border-color: var(--border-strong);
  background: var(--nav-active-bg);
}
.paymethod.is-off {
  background: var(--cta-disabled-bg);
  color: var(--ink-disabled);
  border-color: var(--hairline);
  box-shadow: none;
  cursor: not-allowed;
}
.paymethod.is-off:hover { border-color: var(--hairline); }
.paymethod__t { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.paymethod__t b { font-size: 14.5px; font-weight: 500; letter-spacing: 0; color: var(--ink-primary); }
.paymethod.is-off .paymethod__t b { color: var(--ink-disabled); }
.paymethod__check { color: var(--ink-primary); display: inline-flex; transition: opacity 140ms var(--ease); }
.paymethod--pick:not(:has(input:checked)) .paymethod__check { opacity: 0; }
.paymethod__check svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.kv-yes { display: inline-flex; align-items: center; }
.kv-yes svg { width: 15px; height: 15px; fill: none; stroke: var(--ink-tertiary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.paymethod .sub { margin-top: 3px; font-size: 12.5px; }
@media (max-width: 560px) { .paymethods { grid-template-columns: 1fr; } }

.wallet-hero {
  background: var(--bg-pass-top);
  border-color: var(--border);
}
.amt-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.amt-btn { padding: 8px 13px; font-variant-numeric: tabular-nums; }
.amt-btn.is-sel {
  border-color: var(--border-strong);
  background: var(--nav-active-bg);
  color: var(--ink-primary);
}
.amt-input {
  flex: 1;
  min-width: 120px;
  padding: 10px 13px;
  border-radius: var(--r-row);
  background: var(--bg-cavity);
  border: 1px solid var(--border);
  box-shadow: var(--cavity-rim-shadow);
  color: var(--ink-primary);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.paymethod--pick { cursor: pointer; position: relative; }
.paymethod--pick input { position: absolute; opacity: 0; pointer-events: none; }
.paymethod--pick:has(input:checked) { border-color: var(--border-strong); background: var(--nav-active-bg); }
.paymethod--pick:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.kv.txn { align-items: flex-start; }
.txn-date { display: block; color: var(--ink-tertiary); font-size: 12px; font-style: normal; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ── Metrics & Key-Value Rows ── */
.metric {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}
.metric.grad { color: var(--ink-primary); }
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-muted); }
.kv b { font-weight: 500; color: var(--ink-primary); }

/* ── Device / Session / Activity / Region Rows (Inset Hairlines + Flat Linear Vessels) ── */
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 46px;
  right: 0;
  height: 1px;
  background: var(--hairline);
  pointer-events: none;
}

.row__ic {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: var(--r-control);
  display: grid;
  place-items: center;
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  flex: none;
  color: var(--ink-tertiary);
}
.row__ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.row__ic--active {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--ink-primary);
}
.row__ic--on {
  background: var(--status-success-soft);
  border-color: var(--status-success-border);
  color: var(--status-success-text);
}
.row__ic--warn {
  background: var(--status-warning-soft);
  border-color: var(--status-warning-border);
  color: var(--status-warning-text);
}
.row__ic--danger {
  background: var(--status-error-soft);
  border-color: var(--status-error-border);
  color: var(--status-error-text);
}
.row__ic--sky {
  background: var(--accent-sky-soft);
  border-color: var(--accent-sky-border);
  color: var(--status-info-text);
}
.row__ic .live {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-success-fill);
  border: 2px solid var(--bg-card-top);
}
.promo-ic {
  width: 34px;
  height: 34px;
  border-radius: var(--r-control);
  display: grid;
  place-items: center;
  flex: none;
  color: var(--ink-tertiary);
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
}
.promo-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.row__main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row__main b { font-size: 14px; font-weight: 500; color: var(--ink-primary); }
.row__main i { font-style: normal; display: block; color: var(--ink-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.row__status { font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.row__status--live { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-primary); font-weight: 500; }
.row__status--live .dot { width: 6px; height: 6px; }
.status-on { color: var(--status-success-text); }

/* ── FlagPlate & Regions Horizon Trace ── */
.flag-plate {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 21px;
  border-radius: 4px;
  overflow: hidden;
  flex: none;
  background: var(--bg-cavity);
  box-shadow: var(--flag-shadow);
}
.flag-plate svg { width: 100%; height: 100%; display: block; }
.flag-plate--sm {
  width: 20px;
  height: 14px;
  border-radius: 3px;
}

.region-row { gap: 14px; }
.region-code {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-tertiary);
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  margin-left: 6px;
  vertical-align: 1px;
}

/* ── Traffic & Quota Progress Track (Flat Semantic Fill + Calibrated Hairline Track) ── */
.bar-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  overflow: hidden;
  margin-top: 8px;
}
.bar-track--quartile {
  height: 6px;
  position: relative;
}
.bar-track--quartile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(25% - 0.5px), var(--bar-tick) calc(25% - 0.5px), var(--bar-tick) calc(25% + 0.5px), transparent calc(25% + 0.5px)),
    linear-gradient(90deg, transparent calc(50% - 0.5px), var(--bar-tick) calc(50% - 0.5px), var(--bar-tick) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(90deg, transparent calc(75% - 0.5px), var(--bar-tick) calc(75% - 0.5px), var(--bar-tick) calc(75% + 0.5px), transparent calc(75% + 0.5px));
}
.bar-notches {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-evenly;
}
.bar-notches span { width: 1px; height: 100%; background: var(--bar-tick); }
.bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--status-success-fill);
  transition: width 240ms var(--ease);
}
.bar-fill--ok { background: var(--status-success-fill); }
.bar-fill--warn { background: var(--status-warning-fill); }
.bar-fill--danger { background: var(--status-error-fill); }

/* Referral card */
.ref,
.ref-card {
  max-width: 680px;
}
.ref {
  background: var(--bg-pass-top);
  border-color: var(--border);
}

/* ── Connection Wizard (#/setup) ── */
.wiz-card { max-width: 640px; margin-left: auto; margin-right: auto; }
.stepper-slot { min-height: 48px; }
.stepper { display: flex; align-items: flex-start; gap: 4px; margin-bottom: 20px; }
.stepper__c { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 0 0 auto; }
.stepper__c b {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  background: var(--bg-cavity);
  color: var(--ink-muted);
}
.stepper__c b svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stepper__c i { font-size: 11px; color: var(--ink-tertiary); font-style: normal; white-space: nowrap; }
.stepper__c.is-active b { border-color: var(--accent-sky-border); color: var(--status-info-text); background: var(--accent-sky-soft); }
.stepper__c.is-done b { border-color: var(--status-success-border); color: var(--status-success-text); background: var(--status-success-soft); }
.stepper__c.is-active i { color: var(--ink-primary); font-weight: 500; }
.stepper__sep { flex: 1 1 auto; height: 1px; background: var(--hairline); margin: 14px 2px 0; }
.stepper__sep.is-done { background: var(--status-success-border); }
.wiz-lead { font-size: 14.5px; color: var(--ink-primary); line-height: 1.5; margin-bottom: 16px; }
.wiz-note { margin-top: 12px; }

.wiz-native {
  padding: 16px;
  border-radius: var(--r-dock);
  background: var(--bg-pass-top);
  border: 1px solid var(--border-strong);
  margin-bottom: 14px;
}
.wiz-native__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.wiz-native__head b { font-size: 15px; font-weight: 500; color: var(--ink-primary); }
.wiz-alt {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
details.wiz-alt {
  padding-top: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-cta);
  background: var(--bg-cavity);
  overflow: hidden;
}
details.wiz-alt > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 140ms var(--ease);
}
details.wiz-alt > summary::-webkit-details-marker { display: none; }
details.wiz-alt > summary:hover,
details.wiz-alt[open] > summary { color: var(--ink-primary); }
details.wiz-alt[open] > summary .faq-chev { transform: rotate(90deg); color: var(--ink-primary); }
details.wiz-alt > summary:focus-visible { outline-offset: -2px; border-radius: var(--r-cta); }
.wiz-alt__body { padding: 0 14px 14px; }
.wiz-alt__title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-tertiary);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.platform-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-dock);
  background: var(--bg-card-top);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease), color 140ms var(--ease);
}
.platform-tile:hover { border-color: var(--border-strong); color: var(--ink-primary); }
.platform-tile.is-sel {
  border-color: var(--border-strong);
  background: var(--nav-active-bg);
  color: var(--ink-primary);
  font-weight: 500;
}
.platform-tile__ic { width: 28px; height: 28px; }
.platform-tile__ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wiz-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.wiz-actions .btn { flex: 1 1 auto; }
.wiz-actions--center { margin-top: 18px; }
.wiz-steps { margin: 14px 0 0; padding-left: 20px; color: var(--ink-muted); font-size: 13.5px; line-height: 1.6; }
.wiz-steps li { margin: 4px 0; }
.wiz-qr { display: flex; flex-direction: column; align-items: center; margin: 16px 0; }
.wiz-qr .qr { width: 180px; height: 180px; }
.wiz-done { text-align: center; padding: 10px 0 4px; }
.wiz-done__ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--status-success-soft); color: var(--status-success-text); margin-bottom: 10px; }
.wiz-done__ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wiz-done h3 { font-size: 19px; font-weight: 500; margin: 0 0 6px; }

.wiz-tr {
  border: 1px solid var(--border);
  border-radius: var(--r-cta);
  background: var(--bg-cavity);
  margin-bottom: 10px;
  overflow: hidden;
}
.wiz-tr > summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 140ms var(--ease);
}
.wiz-tr > summary::-webkit-details-marker { display: none; }
.wiz-tr > summary:hover { color: var(--ink-primary); }
.wiz-tr > summary:focus-visible { outline-offset: -2px; border-radius: var(--r-cta); }
.wiz-tr[open] > summary .faq-chev { transform: rotate(90deg); color: var(--ink-primary); }
.wiz-tr__body { padding: 0 14px 14px; }
.wiz-tr .wiz-steps { margin: 0 0 12px; padding-left: 34px; padding-right: 14px; }
.wiz-tr__body .wiz-steps { padding-left: 20px; padding-right: 0; }
.wiz-tr .btn { margin: 10px 14px 14px; }
.wiz-tr__body .btn { margin: 10px 0 0; }

@keyframes wizIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wiz-anim { animation: wizIn 200ms var(--ease) both; }
.wiz-body .btn--full + .btn--full { margin-top: 8px; }

/* ── Error / Offline Cards & FAQ (#/help) ── */
.state-card { max-width: 560px; }
.state-card .banner { margin: 0; flex-wrap: wrap; row-gap: 12px; }
.state-card .banner .col { flex: 1 1 220px; }
.note--err { color: var(--status-warning-text); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.note--err .btn { flex: none; }

.faq-search { position: relative; display: flex; align-items: center; margin-bottom: 16px; max-width: 560px; }
.faq-search__ic { position: absolute; left: 13px; display: grid; place-items: center; color: var(--ink-tertiary); pointer-events: none; }
.faq-search__ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.faq-search input {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border-radius: var(--r-cta);
  background: var(--bg-cavity);
  border: 1px solid var(--border);
  box-shadow: var(--cavity-rim-shadow);
  color: var(--ink-primary);
  font-size: 14px;
}
.faq-search input::placeholder { color: var(--ink-tertiary); }
.faq-search input:focus { border-color: var(--accent-sky); }
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.faq-item {
  background: var(--bg-card-top);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
  border-radius: var(--r-dock);
  overflow: hidden;
}
.faq-item > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-primary);
  transition: color 140ms var(--ease);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:focus-visible { outline-offset: -2px; border-radius: var(--r-dock); }
.faq-item > summary > span:first-child { flex: 1; min-width: 0; }
.faq-item > summary:hover { color: var(--ink-primary); }
.faq-chev { display: grid; place-items: center; color: var(--ink-tertiary); flex: none; transition: transform 200ms var(--ease), color 140ms var(--ease); }
.faq-chev svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.faq-item[open] > summary .faq-chev { transform: rotate(90deg); color: var(--ink-primary); }
.faq-ans { padding: 0 18px 16px; color: var(--ink-muted); font-size: 13.8px; line-height: 1.6; }
.faq-ans p { margin: 0; }
.faq-link { display: inline-block; margin-top: 10px; font-weight: 500; font-size: 13.5px; }
.faq-empty { max-width: 760px; padding: 14px 2px; }

/* ── Responsive → Tablet & Mobile (≥ 11px floor, touch targets, iOS zoom guard) ── */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .view { padding-bottom: calc(92px + var(--safe-bottom)); }
  #topbar-logout { display: inline-grid; }
  .bottomnav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    background: var(--bottomnav-bg);
    border-top: 1px solid var(--hairline);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    padding: 8px max(6px, env(safe-area-inset-right)) calc(8px + var(--safe-bottom)) max(6px, env(safe-area-inset-left));
  }
  .bottomnav a,
  .bottomnav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
    min-height: 44px;
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 6px 4px;
    border-radius: var(--r-row);
    transition: background-color 140ms var(--ease), color 140ms var(--ease);
  }
  .bottomnav a span,
  .bottomnav button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .bottomnav a svg,
  .bottomnav button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
  }
  .bottomnav a.active,
  .bottomnav button.active,
  .bottomnav button[aria-expanded="true"] {
    color: var(--ink-primary);
    font-weight: 500;
    background: var(--nav-active-bg);
  }
  .topbar__right .pill { display: none; }
}
html[data-tma="1"] #topbar-logout { display: none; }

@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom on focused form controls */
  input,
  .input,
  .auth__form input:not([type="checkbox"]),
  .amt-input,
  .faq-search input {
    font-size: 16px;
  }
}

@media (pointer: coarse), (max-width: 768px) {
  .theme-seg__btn { width: 40px; height: 40px; }
  .field .copy { width: 40px; height: 40px; }
  .icon-btn { width: 40px; height: 40px; }
  .avatar--sm { width: 40px; height: 40px; }
  .btn--sm { min-height: 40px; padding: 9px 14px; }
  .pass-eye { width: 40px; height: 40px; }
  .toast-pop { top: calc(var(--topbar-h, 60px) + 20px + var(--safe-top)); }
  .toast-pop__close { width: 40px; height: 40px; }
  .sheet__close { width: 40px; height: 40px; }
  .pass-id-btn { min-height: 40px; padding: 6px 10px; }
  #remember-row, .check-row { min-height: 44px; padding: 6px 0; }
  .seg__btn { min-height: 44px; padding: 10px 9px; }
  .amt-btn { min-height: 44px; padding: 10px 14px; }
  a.chip { min-height: 40px; padding: 8px 12px; }
  .faq-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; }
  .auth__legal a { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 2px; line-height: 1.4; }
}

@media (max-width: 560px) {
  .row { flex-wrap: wrap; row-gap: 8px; }
  .region-row { align-items: flex-start; }
  .region-row .flag-plate { margin-top: 2px; }
  .row__main { flex: 1 1 160px; }
  .prov-row { flex-wrap: wrap; row-gap: 8px; }
}

@media (max-width: 520px) {
  .qr-wrap { flex-direction: column; align-items: stretch; }
  .qr:not(.qr--sm) {
    width: min(220px, 100%);
    height: auto;
    aspect-ratio: 1;
    margin-inline: auto;
  }
  .actions .btn { padding: 11px 14px; flex: 1 1 auto; min-width: max-content; }
  .actions .btn--primary { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .platform-grid { grid-template-columns: 1fr 1fr; }
  .stepper {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    align-items: start;
    margin-inline: -8px;
  }
  .stepper__sep { display: none; }
  .stepper__c {
    position: relative;
    min-width: 0;
    padding: 0 1px;
  }
  .stepper__c b { position: relative; z-index: 1; }
  .stepper__c:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 14px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 1px;
    background: var(--hairline);
    pointer-events: none;
  }
  .stepper__c.is-done:not(:last-child)::after { background: var(--status-success-border); }
  .stepper__c i {
    font-size: 11px;
    letter-spacing: 0;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
  }
  .pass-metrics { grid-template-columns: 1fr; }
  .pass-metric {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .pass-metric:last-child { border-bottom: 0; }
}

@media (max-width: 420px) {
  .actions .btn {
    white-space: normal;
    text-align: center;
    min-width: 0;
  }
  .wiz-actions .btn {
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .topbar { gap: 8px; padding-inline: 12px; }
  .topbar__title { font-size: 17px; }
  .topbar__right { gap: 8px; }
  .row + .row::before { left: 0; }
  .sheet__grid { grid-template-columns: 1fr; }
}

/* ── Apple ID Auth Hint & RU-Resilient Auth Fallback ── */
.auth__apple {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-row);
  background: var(--bg-cavity);
  padding: 0 12px;
}
.auth__apple summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 140ms var(--ease);
}
.auth__apple summary::-webkit-details-marker { display: none; }
.auth__apple summary:hover,
.auth__apple[open] summary { color: var(--ink-primary); }
.auth__apple-ic { width: 20px; height: 20px; flex: none; display: inline-grid; place-items: center; }
.auth__apple-ic svg { width: 20px; height: 20px; display: block; }
.auth__apple p {
  font-size: 12.5px;
  line-height: 1.52;
  color: var(--ink-muted);
  padding: 0 0 11px;
  margin: 0;
}

.auth-fallback {
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: var(--r-row);
  background: var(--accent-sky-soft);
  border: 1px solid var(--accent-sky-border);
  color: var(--ink-primary);
  font-size: 12.5px;
  line-height: 1.5;
}
.auth-fallback__title {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--ink-primary);
}
.auth-fallback__text {
  margin: 0;
  color: var(--ink-muted);
}
.auth-fallback__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.auth-fallback__actions .btn { min-height: 36px; padding: 7px 12px; font-size: 12.5px; }

/* ── Account Deletion Danger Zone & Confirmation Modal (Guideline 5.1.1(v)) ── */
.acct-delete__head { margin-bottom: 12px; }
.acct-delete__head h4 {
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--status-error-text);
  margin: 0;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--backdrop-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(14px + var(--safe-top)) 14px calc(14px + var(--safe-bottom));
  opacity: 0;
  transition: opacity 180ms var(--ease);
}
.modal-backdrop[hidden] { display: none; }
.modal-backdrop.is-open { opacity: 1; }
.modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(var(--app-vh) - var(--safe-top) - var(--safe-bottom) - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-floating-top);
  border: 1px solid var(--status-error-border);
  border-radius: var(--r-card);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--float-shadow);
  padding: 22px;
  transform: translateY(10px) scale(0.985);
  transition: transform 200ms var(--ease);
}
.modal-backdrop.is-open .modal { transform: translateY(0) scale(1); }
.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.modal__ic {
  background: var(--status-error-soft);
  color: var(--status-error-text);
  border: 1px solid var(--status-error-border);
}
.modal__title-wrap { flex: 1; min-width: 0; }
.modal__title-wrap h3 {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  margin: 0 0 4px;
}
.modal__title-wrap .sub { color: var(--ink-muted); font-size: 13px; line-height: 1.5; margin: 0; }
.modal__close {
  width: 40px;
  height: 40px;
  border-radius: var(--r-row);
  flex: none;
}
.modal__form { display: flex; flex-direction: column; gap: 12px; }
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal__actions { display: flex; gap: 10px; margin-top: 6px; }
.modal__actions .btn { flex: 1; min-height: 44px; }
@media (max-width: 480px) {
  .modal-backdrop {
    padding: calc(14px + var(--safe-top)) 14px calc(14px + var(--safe-bottom));
    align-items: flex-end;
  }
  .modal { padding: 20px 18px; }
  .modal__actions { flex-direction: column-reverse; }
}

.wiz-dl-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.wiz-dl-stack .btn { margin-top: 0; }

/* ── TMA SHELL, 3-TAB BAR, ONBOARDING & SCREENS (Obsidian Graphite & Ceramic Daylight) ── */
html[data-tma="1"] {
  --tma-cavity: #0A0D13;
  --tma-card-top: #141821;
  --tma-card-bottom: #141821;
  --tma-pass-top: #171C27;
  --tma-pass-bottom: #171C27;
  --tma-well-bg: #0B0F16;
  --tma-selected-bg: #1E2534;
  --tma-selected-border: rgba(242, 244, 248, 0.26);

  --tma-card-shadow: inset 0 1px 0 var(--rim-top);
  --tma-pass-shadow: inset 0 1px 0 var(--rim-top);

  --tma-wm-ink: #C6DAF8;
  --tma-wm-accent: #32DA7E;
  --tma-wm-opacity: 0.10;

  /* Спокойная платиновая главная кнопка TMA на графите */
  --tma-cta-bg: #F2F4F8;
  --tma-cta-hover: #FFFFFF;
  --tma-cta-ink: #0B0E14;
  --tma-cta-border: rgba(255, 255, 255, 0.18);
  --tma-cta-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);

  --tma-nav-bg: rgba(14, 17, 23, 0.94);
  --tma-nav-active-bg: #1E2534;
  --tma-nav-active-border: rgba(242, 244, 248, 0.09);
}
html[data-tma="1"][data-theme="light"] {
  --tma-cavity: #E4DFD6;
  --tma-card-top: #FAF9F6;
  --tma-card-bottom: #FAF9F6;
  --tma-pass-top: #FCFBF9;
  --tma-pass-bottom: #FCFBF9;
  --tma-well-bg: #ECE8E0;
  --tma-selected-bg: #FFFFFF;
  --tma-selected-border: rgba(58, 52, 43, 0.30);

  --tma-card-shadow: 0 1px 2px rgba(59, 51, 40, 0.04);
  --tma-pass-shadow: 0 1px 3px rgba(59, 51, 40, 0.06);

  --tma-wm-ink: #5A5246;
  --tma-wm-accent: #158046;
  --tma-wm-opacity: 0.09;

  /* Глубокий графит на светлой керамике (контраст > 14:1, тёплая минеральная тень) */
  --tma-cta-bg: #171C26;
  --tma-cta-hover: #232B3A;
  --tma-cta-ink: #F8FAFC;
  --tma-cta-border: rgba(58, 52, 43, 0.18);
  --tma-cta-shadow: 0 1px 3px rgba(59, 51, 40, 0.14);

  --tma-nav-bg: rgba(239, 237, 232, 0.95);
  --tma-nav-active-bg: #FFFFFF;
  --tma-nav-active-border: rgba(58, 52, 43, 0.12);
}
html[data-tma="1"] #auth { display: none; }
.tma-auth-err:not([hidden]) {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: var(--app-vh);
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
}
.tma-auth-err__card { max-width: 340px; gap: 14px; }
html[data-tma="1"] .app { grid-template-columns: 1fr; }
html[data-tma="1"] .sidebar { display: none; }
html[data-tma="1"] .topbar { display: none; }
html[data-tma="1"] .view {
  padding: calc(max(12px, var(--safe-top)) + 2px) 16px calc(94px + var(--safe-bottom));
  max-width: 560px;
  width: 100%;
  margin-inline: auto;
}
html[data-tma="1"][data-tma-onboarding="1"] .bottomnav { display: none; }
html[data-tma="1"][data-tma-onboarding="1"] .view {
  padding: calc(max(16px, var(--safe-top)) + 2px) 16px calc(28px + var(--safe-bottom));
}
html[data-tma="1"] .toast-pop {
  top: auto;
  bottom: calc(82px + var(--safe-bottom));
}
html[data-tma="1"][data-tma-onboarding="1"] .toast-pop {
  bottom: calc(20px + var(--safe-bottom));
}
html[data-tma="1"] .bottomnav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  align-items: stretch;
  justify-content: space-around;
  gap: 4px;
  background: var(--tma-nav-bg);
  border-top: 1px solid var(--hairline);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.24);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  padding: 6px max(8px, env(safe-area-inset-right)) calc(8px + var(--safe-bottom)) max(8px, env(safe-area-inset-left));
}
html[data-tma="1"][data-theme="light"] .bottomnav {
  box-shadow: 0 -4px 16px rgba(59, 51, 40, 0.06);
}
@media (min-width: 560px) {
  html[data-tma="1"] .bottomnav {
    padding-inline: max(14px, calc((100% - 560px) / 2));
  }
}
html[data-tma="1"] .bottomnav--tma a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  min-height: 50px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 7px 6px 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  overflow: hidden;
  transition: color 140ms var(--ease), transform 140ms var(--ease), background-color 140ms var(--ease), border-color 140ms var(--ease);
}
html[data-tma="1"] .bottomnav--tma a:active { transform: scale(0.97); }
html[data-tma="1"] .bottomnav--tma a svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  transition: color 140ms var(--ease);
}
html[data-tma="1"] .bottomnav--tma a.active {
  color: var(--ink-primary);
  font-weight: 500;
  background: var(--tma-nav-active-bg);
  border-color: var(--tma-nav-active-border);
  box-shadow: none;
}
html[data-tma="1"] .bottomnav--tma a.active svg {
  color: var(--ink-primary);
  stroke-width: 1.75;
}

@keyframes tmaEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.tma-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: tmaEnter 170ms var(--ease) both;
}
.tma-pending-pay { margin: 0; }
.tma-card {
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--tma-card-top);
  box-shadow: var(--tma-card-shadow);
}
.tma-card__title {
  font-family: var(--f-display);
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}

/* Зона 1 — Карта пропуска Access Pass (плоская поверхность + семантическая граница) */
html[data-tma="1"] .tma-pass {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 14px;
  border: 1px solid var(--status-success-border);
  background: var(--tma-pass-top);
  box-shadow: var(--tma-pass-shadow);
}
html[data-tma="1"] .tma-pass.card--pass-trial {
  background: var(--tma-pass-top);
  border-color: var(--status-success-border);
}
html[data-tma="1"] .tma-pass.card--pass-warn {
  background: var(--tma-pass-top);
  border-color: var(--status-warning-border);
}
html[data-tma="1"] .tma-pass.card--pass-danger {
  background: var(--tma-pass-top);
  border-color: var(--status-error-border);
}
html[data-tma="1"] .tma-pass.card--pass-neutral {
  background: var(--tma-pass-top);
  border-color: var(--border);
}
.tma-pass__wm {
  position: absolute;
  top: -12px;
  right: -18px;
  width: 210px;
  height: 172px;
  opacity: var(--tma-wm-opacity);
  pointer-events: none;
  z-index: 0;
}
.tma-pass__content {
  position: relative;
  z-index: 1;
}
.tma-pass__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.tma-pass__mark { width: 22px; height: 22px; }
.tma-pass__hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.tma-pass__hero-main { min-width: 0; flex: 1; }
.tma-pass__plan {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--ink-primary);
  margin-bottom: 4px;
}
.tma-pass__renew-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 4px 10px;
  min-height: 26px;
  border-radius: 999px;
  background: var(--status-success-soft);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.tma-pass__renew-pill:hover { border-color: var(--status-success-fill); }
.tma-pass__days {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  line-height: 1;
}
.tma-pass__days b {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 0.96;
  color: var(--ink-primary);
}
.tma-pass__days span {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-tertiary);
}
.tma-pass__stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: var(--r-row);
  background: var(--tma-cavity);
  border: 1px solid var(--hairline);
  box-shadow: var(--cavity-rim-shadow);
  overflow: hidden;
}
.tma-pass__stats--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tma-stat {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  border-right: 1px solid var(--hairline);
  text-decoration: none;
  transition: background-color 140ms var(--ease);
}
.tma-stat:last-child { border-right: 0; }
.tma-stat--link:hover,
.tma-stat--link:active { background: var(--nav-row-hover); }
.tma-stat__k {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-tertiary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tma-stat__ic {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--ink-tertiary);
}
.tma-stat__ic svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tma-stat__v {
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
  line-height: 1.28;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tma-stat__v--nav {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.tma-stat__v--nav svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--ink-tertiary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.tma-stat--link:hover .tma-stat__v--nav svg { stroke: var(--ink-primary); }
.tma-pass__traffic { margin-top: 10px; }

/* Зона 2 — 2-камерный плинт быстрого подключения */
html[data-tma="1"] .tma-hero-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--tma-card-top);
  box-shadow: var(--tma-card-shadow);
}
.tma-hero-deck {
  padding: 16px;
  background: var(--tma-card-top);
}
.tma-hero-well {
  padding: 12px 16px 14px;
  background: var(--tma-well-bg);
  border-top: 1px solid var(--plinth-seam);
}
.tma-hero-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.tma-hero-head__ic {
  width: 36px;
  height: 36px;
  border-radius: var(--r-control);
  flex: none;
  color: var(--ink-primary);
}
.tma-hero-head__ic svg {
  width: 18px;
  height: 18px;
}
.tma-hero-head__text { min-width: 0; flex: 1; }
.tma-hero-sub {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.38;
  color: var(--ink-muted);
}

/* Флагманская кнопка TMA (плоский светлый акцент на графите / графит на керамике) */
.btn--tma-primary {
  background: var(--tma-cta-bg);
  color: var(--tma-cta-ink);
  border: 1px solid var(--tma-cta-border);
  box-shadow: var(--tma-cta-shadow);
}
.btn--tma-primary:hover:not(:disabled) { background: var(--tma-cta-hover); }
.tma-connect-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 10px 40px;
  border-radius: var(--r-dock);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  transition: transform 140ms var(--ease), background-color 140ms var(--ease);
}
.tma-connect-cta:active { transform: scale(0.985); }
.tma-cta-label { text-align: center; }
.tma-cta-arrow {
  position: absolute;
  right: 14px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  opacity: 0.72;
  transition: transform 140ms var(--ease), opacity 140ms var(--ease);
}
.tma-cta-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tma-connect-cta:hover .tma-cta-arrow { transform: translateX(2px); opacity: 1; }

.tma-sub-link { margin-top: 0; }
.tma-sub-link__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.tma-sub-link__label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: 0;
}
.tma-sub-link__ic {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--ink-tertiary);
}
.tma-sub-link__ic svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tma-sub-link__hint {
  font-size: 11px;
  color: var(--ink-tertiary);
}
.tma-sub-field {
  margin-top: 0;
  min-height: 44px;
  padding: 4px 6px 4px 12px;
  gap: 8px;
  background: var(--tma-cavity);
}
.tma-sub-field__val {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink-primary);
}
.tma-sub-field__copy { flex: none; }
.copy.is-copied,
.pass-id-btn.is-copied {
  color: var(--status-success-text);
  border-color: var(--status-success-border);
  background: var(--status-success-soft);
}

.tma-step__btns { display: flex; flex-direction: column; gap: 10px; }
.tma-quiet-link {
  background: none;
  border: 0;
  padding: 6px 4px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 140ms var(--ease);
}
.tma-quiet-link:hover { color: var(--ink-primary); }
.tma-micro-hint { margin: 10px 0 0; font-size: 12.5px; line-height: 1.48; }
.tma-action-row {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 8px;
  margin-top: 10px;
}
.tma-action-row .btn {
  min-width: 0;
  min-height: 44px;
  padding-inline: 6px;
  gap: 5px;
  font-size: 12.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tma-action-row .btn svg { width: 14px; height: 14px; flex: none; }
.tma-action-row .btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Зона 3 — Полоса локаций с векторными флагами */
.tma-regions-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--tma-card-top);
  box-shadow: var(--tma-card-shadow);
}
.tma-regions__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.tma-regions__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-display);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-primary);
}
.tma-regions__ic {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--ink-tertiary);
}
.tma-regions__ic svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tma-region-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tma-region-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: var(--r-row);
  background: var(--tma-cavity);
  border: 1px solid var(--hairline);
  min-width: 0;
}
.tma-region-tile .flag-plate {
  flex: none;
}
.tma-region-tile__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.tma-region-tile__country {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tma-region-tile__city {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tma-region-tile__lat {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.tma-region-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 10px 5px 7px;
  border-radius: var(--r-row);
  background: var(--tma-cavity);
  border: 1px solid var(--hairline);
  color: var(--ink-primary);
}
.tma-region-pill__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
  white-space: nowrap;
}
.tma-regions__foot {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.38;
  color: var(--ink-tertiary);
}
html[data-tma="1"] .flag-plate {
  box-shadow: 0 0 0 1px rgba(242, 244, 248, 0.14);
}
html[data-tma="1"][data-theme="light"] .flag-plate {
  box-shadow: 0 0 0 1px rgba(58, 52, 43, 0.16);
}

/* Плинт предложения для истёкшей/неактивной подписки */
.tma-offer-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.tma-offer-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
.tma-offer-cta { margin-top: 14px; }
.tma-offer-price {
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
}
.tma-well-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-primary);
  text-decoration: none;
}
.tma-well-link__ic {
  display: grid;
  place-items: center;
  color: var(--status-success-text);
  flex: none;
}
.tma-well-link__ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tma-well-link > span:nth-child(2) { flex: 1; min-width: 0; }
.tma-well-link > svg { width: 15px; height: 15px; fill: none; stroke: var(--ink-tertiary); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── TMA: 3-шаговый онбординг нового пользователя ── */
.tma-ob {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  animation: tmaEnter 170ms var(--ease) both;
}
.tma-ob-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}
.tma-ob-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.tma-ob-dot {
  height: 3px;
  flex: 1;
  border-radius: 999px;
  background: var(--hairline);
  transition: background-color 180ms var(--ease);
}
.tma-ob-dot.is-cur { background: var(--ink-primary); }
.tma-ob-dot.is-done { background: var(--status-success-fill); }
.tma-ob-counter {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
html[data-tma="1"] .tma-ob-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--tma-card-top);
  box-shadow: var(--tma-pass-shadow);
}
.tma-ob-stage {
  position: relative;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--tma-cavity);
  border-bottom: 1px solid var(--plinth-seam);
}
.tma-ob-medallion {
  width: min(252px, 100%);
  height: auto;
  display: block;
}
.tma-ob-flags {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--tma-card-top);
  border: 1px solid var(--hairline);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-muted);
}
.tma-ob-flags__stack {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tma-ob-body { padding: 18px 18px 16px; }
.tma-ob-well {
  padding: 10px 18px;
  background: var(--tma-well-bg);
  border-top: 1px solid var(--plinth-seam);
}
.tma-ob-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--status-success-text);
  margin-bottom: 6px;
}
.tma-ob-pill-ok {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--status-success-soft);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}
.tma-ob-brand {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--tma-cavity);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.tma-ob-brand .mark { width: 28px; height: 28px; display: block; }
.tma-ob-brand .mark svg { width: 28px; height: 28px; display: block; }
.tma-ob-title {
  margin: 0;
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--ink-primary);
}
.tma-ob-lead {
  margin: 8px 0 16px;
  font-size: 14px;
  line-height: 1.48;
  color: var(--ink-muted);
}
.tma-ob-perks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.tma-ob-perk {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-row);
  background: var(--tma-cavity);
  border: 1px solid var(--hairline);
}
.tma-ob-perk__well {
  width: 34px;
  height: 34px;
  border-radius: var(--r-control);
  flex: none;
  color: var(--ink-primary);
}
.tma-ob-perk b { display: block; font-size: 14px; font-weight: 500; color: var(--ink-primary); line-height: 1.28; }
.tma-ob-perk i { display: block; font-style: normal; font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; line-height: 1.32; }
.tma-ob-cta { min-height: 52px; }
.tma-ob-next { margin-top: 12px; min-height: 46px; }
.tma-ob-skip { width: 100%; margin-top: 0; }
.tma-ob-well-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.tma-ob-well-row .tma-quiet-link {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 6px 4px;
}
.tma-ob-well-row .tma-quiet-link:first-child {
  border-right: 1px solid var(--hairline);
  border-radius: 0;
}
.tma-ob-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ── TMA: шторка выбора ОС «Установить Happ» и store-кнопки ── */
.tma-os-detected {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-muted);
  margin: 0 0 10px;
}
.tma-os-detected b {
  font-weight: 500;
  color: var(--ink-primary);
}
.tma-os-detected__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--status-success-fill);
  flex: none;
}
.tma-os-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.tma-os-pills::-webkit-scrollbar { display: none; }
.tma-os-pill {
  flex: none;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-cavity);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.tma-os-pill.is-sel {
  background: var(--tma-cta-bg);
  border-color: var(--tma-cta-border);
  color: var(--tma-cta-ink);
}

.tma-store-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  border-radius: var(--r-dock);
  text-decoration: none;
  text-align: left;
  color: var(--ink-primary);
  cursor: pointer;
  transition: transform 140ms var(--ease), background-color 140ms var(--ease), border-color 140ms var(--ease);
}
.tma-store-btn:active { transform: scale(0.99); }
.tma-store-btn--primary {
  background: var(--tma-selected-bg);
  border: 1px solid var(--tma-selected-border);
  box-shadow: var(--tma-card-shadow);
}
.tma-store-btn--secondary {
  background: var(--bg-card-top);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--rim-top), var(--card-shadow);
}
.tma-store-btn:hover { border-color: var(--border-strong); }
.tma-store-btn--primary:hover { border-color: var(--ink-tertiary); }
.tma-store-btn__ic {
  width: 38px;
  height: 38px;
  flex: none;
  display: block;
}
.tma-store-btn__ic svg {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 10px;
}
.tma-store-btn__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tma-store-btn__title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink-primary);
}
.tma-store-btn__tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  background: var(--bg-cavity);
  border: 1px solid var(--border);
  color: var(--ink-muted);
}
.tma-store-btn--primary .tma-store-btn__tag {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}
.tma-store-btn__sub {
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--ink-muted);
}
.tma-store-btn__trail {
  flex: none;
  color: var(--ink-tertiary);
  display: grid;
  place-items: center;
}
.tma-store-btn__trail svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tma-pass-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}
.tma-pass-bar__mark { width: 24px; height: 24px; flex: none; }
.tma-pass-bar__main { min-width: 0; flex: 1; }
.tma-pass-bar__main b {
  display: block;
  font-family: var(--f-display);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink-primary);
}
.tma-pending-pay .banner__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tma-pending-pay__close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
}
.tma-pending-pay__close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.5; }
.tma-plans-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.tma-plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 11px;
  min-width: 0;
  min-height: 118px;
  border-radius: var(--r-card);
  background: var(--tma-card-top);
  border: 1px solid var(--border);
  box-shadow: var(--tma-card-shadow);
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease), transform 140ms var(--ease);
}
.tma-plan:active { transform: scale(0.985); }
.tma-plan--wide {
  grid-column: 1 / -1;
  min-height: 92px;
}
.tma-plan.is-sel {
  background: var(--tma-selected-bg);
  border-color: var(--tma-selected-border);
  box-shadow: 0 0 0 1px var(--tma-selected-border), var(--tma-card-shadow);
}
.tma-plan.is-unavail { opacity: 0.62; }
.tma-plan__top {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}
.tma-plan__title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.tma-plan__name {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-muted);
}
.tma-plan.is-sel .tma-plan__name { color: var(--ink-primary); }
.tma-plan__tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
}
.tma-plan__tag--popular {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--ink-primary);
}
.tma-plan__tag--best {
  background: var(--status-success-soft);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
}
.tma-plan__radio {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--tma-cavity);
  flex: none;
  display: grid;
  place-items: center;
  color: var(--tma-cta-ink);
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease);
}
.tma-plan__radio svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tma-plan.is-sel .tma-plan__radio {
  background: var(--tma-cta-bg);
  border-color: var(--tma-cta-bg);
}
.tma-plan__price-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 2px;
}
.tma-plan__old {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-tertiary);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.tma-plan__price {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--ink-primary);
}
.tma-plan__price.is-disc { color: var(--status-success-text); }
.tma-plan__foot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: auto;
}
.tma-plan__sub {
  font-size: 11px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tma-plan__sav {
  flex: none;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
}

.tma-methods-wrap { margin-top: 14px; }
.tma-section-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-tertiary);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 8px 2px;
}
.tma-methods-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tma-method-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--r-dock);
  background: var(--tma-card-top);
  border: 1px solid var(--border);
  box-shadow: var(--tma-card-shadow);
  color: var(--ink-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms var(--ease), border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.tma-method-pill:active { transform: scale(0.99); }
.tma-method-pill__left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tma-radio {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--tma-cavity);
  flex: none;
  position: relative;
}
.tma-method-pill.is-sel .tma-radio {
  border-color: var(--ink-primary);
  box-shadow: inset 0 0 0 4px var(--ink-primary);
}
.tma-method-pill b { font-weight: 500; }
.tma-method-pill.is-sel {
  background: var(--tma-selected-bg);
  border-color: var(--tma-selected-border);
}
.tma-pay-perks {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 12px;
}
.tma-pay-perk {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 8px;
  border-radius: var(--r-row);
  background: var(--tma-cavity);
  border: 1px solid var(--hairline);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-muted);
  min-width: 0;
  white-space: nowrap;
}
.tma-pay-perk__ic {
  display: grid;
  place-items: center;
  color: var(--ink-tertiary);
  flex: none;
}
.tma-pay-perk__ic svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tma-pay-discount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--r-row);
  background: var(--status-success-soft);
  border: 1px solid var(--status-success-border);
  font-size: 13px;
  color: var(--ink-primary);
}
.tma-pay-discount-row__val {
  color: var(--status-success-text);
  font-variant-numeric: tabular-nums;
}
.tma-pay-cta {
  margin-top: 12px;
  min-height: 50px;
  border-radius: var(--r-dock);
  font-size: 15px;
  font-weight: 500;
  gap: 8px;
}
.tma-pay-cta svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.tma-cta-old {
  opacity: 0.56;
  font-size: 13px;
  font-weight: 400;
  margin-left: 6px;
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}
.tma-pay-reassure {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  margin: 9px auto 0;
  max-width: 344px;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.38;
  color: var(--ink-muted);
  text-align: left;
}
.tma-pay-reassure__ic {
  display: grid;
  place-items: center;
  margin-top: 2px;
  color: var(--ink-tertiary);
  flex: none;
}
.tma-pay-reassure__ic svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tma-wallet-row {
  margin-top: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tma-promo-card {
  padding: 0;
  overflow: hidden;
}
.tma-promo-card--open {
  padding: 14px;
}
.tma-promo-card--applied {
  padding: 13px 14px;
  border-color: var(--status-success-border);
  background: var(--tma-card-top);
}
.tma-promo-card--warn {
  padding: 13px 14px;
  border-color: var(--status-warning-border);
}
.tma-promo-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 140ms var(--ease);
}
.tma-promo-trigger:hover { background: var(--nav-row-hover); }
.tma-promo-trigger:active { background: var(--tma-cavity); }
.tma-promo-trigger__ic {
  width: 34px;
  height: 34px;
  border-radius: var(--r-control);
  flex: none;
  color: var(--ink-tertiary);
}
.tma-promo-trigger__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tma-promo-trigger__main b {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.22;
  color: var(--ink-primary);
}
.tma-promo-trigger__main i {
  font-style: normal;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-muted);
}
.tma-promo-trigger__chev {
  display: grid;
  place-items: center;
  color: var(--ink-tertiary);
  flex: none;
}
.tma-promo-trigger__chev svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tma-promo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.tma-promo-head__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-primary);
}
.tma-promo-details__ic {
  display: grid;
  place-items: center;
  color: var(--ink-tertiary);
}
.tma-promo-details__ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tma-promo-collapse {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink-tertiary);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.tma-promo-collapse svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.5; }
.tma-promo-field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 5px 5px 12px;
  border-radius: var(--r-dock);
  background: var(--tma-cavity);
  border: 1px solid var(--border-strong);
  transition: border-color 140ms var(--ease);
}
.tma-promo-field:focus-within { border-color: var(--accent-sky); }
.tma-promo-field.is-err { border-color: var(--status-error-border); }
.tma-promo-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink-primary);
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  outline: none;
}
.tma-promo-input::placeholder {
  font-family: var(--f-body);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-tertiary);
}
.tma-promo-clear-x {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 0;
  background: var(--bg-elevated);
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  flex: none;
  cursor: pointer;
}
.tma-promo-clear-x svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.6; }
.tma-promo-apply {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-control);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease);
}
.tma-promo-apply:active { transform: scale(0.98); }
.tma-promo-apply:disabled { opacity: 0.55; cursor: default; }
.tma-promo-msg {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.38;
  color: var(--ink-muted);
}
.tma-promo-msg--err { color: var(--status-error-text); font-weight: 500; }
.tma-promo-ready {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tma-promo-ready__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.tma-promo-ready__main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tma-promo-ready__main b {
  font-family: var(--f-mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-primary);
}
.tma-promo-ready__main span {
  font-size: 12px;
  color: var(--status-success-text);
  font-weight: 500;
}
.tma-promo-ready__btn { flex: none; min-height: 34px; padding: 6px 12px; }
.tma-promo-applied {
  display: flex;
  align-items: center;
  gap: 11px;
}
.tma-promo-applied__ic {
  width: 34px;
  height: 34px;
  border-radius: var(--r-control);
  flex: none;
  display: grid;
  place-items: center;
  background: var(--status-success-soft);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
}
.tma-promo-card--warn .tma-promo-applied__ic {
  background: var(--status-warning-soft);
  border-color: var(--status-warning-border);
  color: var(--status-warning-text);
}
.tma-promo-applied__ic svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tma-promo-applied__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tma-promo-applied__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.tma-promo-applied__title b {
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-primary);
}
.tma-promo-applied__sub {
  font-size: 12px;
  line-height: 1.32;
  color: var(--ink-muted);
}
.tma-promo-remove {
  flex: none;
  padding: 6px 10px;
  border-radius: var(--r-control);
  border: 1px solid var(--border);
  background: var(--tma-cavity);
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.plan-old-price {
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-tertiary);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}
.promo-applied,
.promo-ready {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-dock);
  background: var(--status-success-soft);
  border: 1px solid var(--status-success-border);
  margin-bottom: 12px;
}
.promo-applied { margin-bottom: 0; }
.promo-applied__ic {
  width: 34px;
  height: 34px;
  border-radius: var(--r-control);
  display: grid;
  place-items: center;
  background: var(--bg-surface);
  color: var(--status-success-text);
  flex: none;
}
.promo-applied__ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.promo-applied__main,
.promo-ready__main { flex: 1; min-width: 0; }
.promo-feedback {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.promo-feedback--err { color: var(--status-error-text); }
.promo-feedback--ok { color: var(--status-success-text); }
.input.is-err { border-color: var(--status-error-border); }

.tma-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.tma-profile-head .avatar { width: 42px; height: 42px; font-size: 16px; }
.tma-profile-head__meta { flex: 1; min-width: 0; }
.tma-profile-head__meta b {
  display: block;
  font-family: var(--f-display);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tma-profile-head__sub { margin-top: 2px; font-size: 12.5px; }
.tma-profile-head__id { margin-top: 1px; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-tertiary); }
.tma-profile-sec { display: flex; flex-direction: column; }
.tma-group {
  padding: 4px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--tma-card-top);
  box-shadow: var(--tma-card-shadow);
}
.tma-list__row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 11px 16px;
  background: transparent;
  border: 0;
  color: var(--ink-primary);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: background-color 140ms var(--ease);
}
.tma-list__row:hover { background: var(--nav-row-hover); }
.tma-list__row:active { background: var(--nav-row-pressed, var(--nav-row-hover)); }
.tma-list__row + .tma-list__row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 62px;
  right: 16px;
  height: 1px;
  background: var(--hairline);
}
.tma-list__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tma-list__main b { font-size: 14.5px; font-weight: 500; color: var(--ink-primary); }
.tma-list__main i { font-style: normal; font-size: 12.5px; color: var(--ink-muted); line-height: 1.35; }
.tma-list__trail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-tertiary);
  font-size: 13px;
  flex: none;
}
.tma-list__trail svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tma-regen-card {
  margin-top: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.tma-regen-card__text { min-width: 0; }
.tma-regen-card__text b { display: block; font-size: 14.5px; font-weight: 500; color: var(--ink-primary); margin-bottom: 4px; }
.tma-regen-card__text .note { margin-top: 3px; font-size: 12.5px; }

.tma-sheet-body {
  padding: 4px 18px calc(22px + var(--safe-bottom));
  overflow-y: auto;
  max-height: calc(var(--app-vh) - 120px);
}
.tma-other-qr { display: flex; justify-content: center; margin-top: 4px; }
.tma-other-qr .qr { width: 196px; height: 196px; }
.tma-other-sec {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.tma-other-sec__label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.tma-link-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.tma-link-grid .btn {
  min-width: 0;
  padding-inline: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-auth-card {
  max-width: 520px;
  margin: 0 auto;
}
.browser-auth-code {
  margin: 18px 0;
  padding: 18px 16px;
  border-radius: var(--r-dock);
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 2px var(--cavity-rim-top);
  font-family: var(--f-mono);
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}
.browser-auth-meta {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 14px 16px;
  border-radius: var(--r-row);
  background: var(--bg-cavity);
  border: 1px solid var(--hairline);
}
.browser-auth-meta__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.browser-auth-meta__k {
  color: var(--ink-muted);
}
.browser-auth-meta__v {
  color: var(--ink-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}
.browser-auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

/* ── PKCE S256 Telegram Bot Deep-Link Handoff Panel (#tg-handoff-panel — WEB-S3-01) ── */
.tg-handoff {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--r-dock);
  background: var(--bg-cavity);
  border: 1px solid var(--border);
  box-shadow: var(--cavity-rim-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tg-handoff[hidden] { display: none; }
.tg-handoff__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tg-handoff__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-primary);
}
.tg-handoff__code {
  padding: 12px 14px;
  border-radius: var(--r-row);
  background: var(--bg-card-top);
  border: 1px solid var(--border-strong);
  font-family: var(--f-mono);
  font-size: clamp(22px, 4.5vw, 28px);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}
.tg-handoff__hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
}
.tg-handoff__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.tg-handoff__qr .qr {
  width: 156px;
  height: 156px;
}
.tg-handoff__status {
  font-size: 12.5px;
  color: var(--ink-muted);
  text-align: center;
}
.tg-handoff__status--err {
  color: var(--status-danger-text);
}
.tg-handoff__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* ── Feature-Flagged Email OTP & Password Reset (WEB-S4-01) ── */
.auth-otp-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-size: 13px;
}
.auth-otp-links[hidden] { display: none; }
.link-btn {
  background: none;
  border: 0;
  padding: 4px 0;
  min-height: 36px;
  color: var(--accent-sky);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.otp-panel {
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--r-dock);
  background: var(--bg-cavity);
  border: 1px solid var(--border);
  box-shadow: var(--cavity-rim-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.otp-panel[hidden] { display: none; }
.otp-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.otp-panel__title { font-size: 15px; font-weight: 500; color: var(--ink-primary); margin: 0; }
.otp-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.otp-verify-slot { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
