:root {
  color-scheme: light;
  --bg: #f4eefc;
  --bg-elevated: rgba(255,255,255,.82);
  --panel: rgba(255,255,255,.92);
  --panel-2: rgba(255,255,255,.72);
  --line: rgba(146, 106, 235, 0.14);
  --line-strong: rgba(146, 106, 235, 0.28);
  --text: #34244d;
  --muted: #8c7ea9;
  --muted-2: #ad9dc7;
  --accent: #8b3dff;
  --accent-2: #6527d3;
  --accent-soft: rgba(139,61,255,.10);
  --gold: #f3d9a2;
  --gold-2: #cba867;
  --success: #28b46f;
  --warning: #d39729;
  --danger: #d55f76;
  --shadow: 0 18px 48px rgba(78, 46, 128, 0.12);
  --admin-topbar-bg: rgba(255,255,255,.86);
  --admin-hero-bg: linear-gradient(180deg, rgba(255,255,255,.90), rgba(245,238,255,.94));
  --admin-hero-surface: rgba(255,255,255,.72);
  --admin-hero-surface-strong: rgba(255,255,255,.80);
  --admin-topbar-text: var(--text);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --screen-width: 430px;
  --header-h: 72px;
  --bottom-h: 86px;
}
body.theme-dark,
body[data-theme="dark"],
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0715;
  --bg-elevated: rgba(18, 13, 34, .92);
  --panel: rgba(19, 14, 36, .95);
  --panel-2: rgba(31, 24, 57, .85);
  --line: rgba(164, 138, 255, 0.12);
  --line-strong: rgba(164, 138, 255, 0.24);
  --text: #f5f0ff;
  --muted: #b8abd7;
  --muted-2: #8c7fb1;
  --accent: #983eff;
  --accent-2: #7129e8;
  --accent-soft: rgba(152,62,255,.16);
  --gold: #f0d7a7;
  --gold-2: #c6a25d;
  --success: #34d38c;
  --warning: #f0b84d;
  --danger: #ff8fa8;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  --admin-topbar-bg: rgba(18, 13, 34, .94);
  --admin-hero-bg: linear-gradient(180deg, rgba(25,18,48,.96), rgba(19,13,39,.98));
  --admin-hero-surface: rgba(255,255,255,.04);
  --admin-hero-surface-strong: rgba(255,255,255,.06);
  --admin-topbar-text: #f5f0ff;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(176, 139, 255, 0.20), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 219, 186, 0.28), transparent 24%),
    linear-gradient(180deg, #f8f4fd 0%, #f0e7fb 100%);
}
body.theme-dark,
body[data-theme="dark"],
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(117, 69, 255, 0.20), transparent 24%),
    radial-gradient(circle at bottom right, rgba(63, 23, 131, 0.24), transparent 24%),
    linear-gradient(180deg, #08050f 0%, #0e091d 100%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button[disabled] { opacity: .55; cursor: not-allowed; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }

.loader-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.loader-card,
.card,
.panel,
.modal-card,
.drawer-panel,
.ticket-thread,
.notification-panel,
.admin-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.loader-card { width: min(100%, 420px); padding: 28px 24px; text-align: center; }
.loader-spin { width: 50px; height: 50px; margin: 0 auto 18px; border-radius: 999px; border: 4px solid rgba(139,61,255,.12); border-top-color: var(--accent); animation: spin 1s linear infinite; }
.loader-title { font-size: 24px; font-weight: 800; }
.loader-text { margin-top: 8px; line-height: 1.55; color: var(--muted); }
.loader-error { margin-top: 14px; white-space: pre-wrap; color: var(--danger); }

/* ===== Brand splash overlay (initial cabinet load + tab transitions) ===== */
.brand-splash {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(176, 139, 255, 0.20), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 219, 186, 0.28), transparent 26%),
    linear-gradient(180deg, #f8f4fd 0%, #f0e7fb 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
body.theme-dark .brand-splash,
body[data-theme="dark"] .brand-splash {
  background:
    radial-gradient(circle at top left, rgba(117, 69, 255, 0.22), transparent 26%),
    radial-gradient(circle at bottom right, rgba(63, 23, 131, 0.24), transparent 26%),
    linear-gradient(180deg, #08050f 0%, #0e091d 100%);
}
.brand-splash.is-shown { opacity: 1; pointer-events: auto; }
.brand-splash.is-leaving { opacity: 0; }

.brand-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 360px;
  width: 100%;
}
.brand-splash-logo {
  width: 132px;
  height: 132px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow:
    0 0 0 10px rgba(139, 61, 255, .10),
    0 24px 60px rgba(101, 39, 211, .35),
    0 0 80px rgba(139, 61, 255, .25);
  opacity: 0;
  transform: scale(.84);
  animation: brand-splash-logo-in 480ms cubic-bezier(.2,.8,.2,1) forwards;
}
.brand-splash-logo img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.18));
}
.brand-splash-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--text);
  opacity: 0;
  margin: 0;
  text-align: center;
  animation: brand-splash-fade-up 380ms cubic-bezier(.2,.8,.2,1) 320ms forwards;
}
.brand-splash-title em {
  font-style: italic;
  font-weight: 800;
  color: var(--accent);
  margin-left: 10px;
}
.brand-splash-tagline {
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  text-align: center;
  animation: brand-splash-fade-up 320ms cubic-bezier(.2,.8,.2,1) 600ms forwards;
}
.brand-splash-status {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  opacity: 0;
  animation: brand-splash-fade-up 320ms ease 720ms forwards;
}
.brand-splash-error {
  margin-top: 4px;
  white-space: pre-wrap;
  color: var(--danger);
  text-align: center;
  font-size: 13px;
  max-width: 320px;
}
.brand-splash-actions { margin-top: 8px; }
@keyframes brand-splash-logo-in {
  0%   { opacity: 0; transform: scale(.84); }
  60%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes brand-splash-fade-up {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-splash-logo,
  .brand-splash-title,
  .brand-splash-tagline,
  .brand-splash-status {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}

.primary-btn,
.ghost-btn,
.icon-btn,
.tab-btn,
.list-btn,
.chip-btn,
.warn-btn,
.danger-btn,
.loader-btn,
.link-btn,
.nav-btn,
.menu-link {
  transition: transform .12s ease, opacity .12s ease, background .12s ease, border-color .12s ease;
}
.primary-btn:active,
.ghost-btn:active,
.icon-btn:active,
.tab-btn:active,
.list-btn:active,
.chip-btn:active,
.warn-btn:active,
.danger-btn:active,
.loader-btn:active,
.link-btn:active,
.nav-btn:active,
.menu-link:active {
  transform: translateY(1px) scale(.995);
}
.primary-btn,
.ghost-btn,
.warn-btn,
.danger-btn,
.loader-btn,
.chip-btn,
.icon-btn,
.tab-btn,
.list-btn,
.link-btn {
  min-height: 42px;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  background: var(--panel-2);
}
.primary-btn,
.loader-btn {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.warn-btn {
  color: var(--warning);
  background: rgba(211,151,41,.10);
  border-color: rgba(211,151,41,.24);
}
.danger-btn {
  color: var(--danger);
  background: rgba(213,95,118,.10);
  border-color: rgba(213,95,118,.24);
}
.icon-btn { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 14px; flex-shrink: 0; }
.link-btn { width: 100%; justify-content: space-between; text-align: left; }
.tab-btn.active,
.chip-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.hidden { display: none !important; }
.small { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.eyebrow,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.badge.success { color: var(--success); background: rgba(40,180,111,.12); }
.badge.accent { color: var(--accent); background: var(--accent-soft); }
.badge.warning { color: var(--warning); background: rgba(211,151,41,.12); }
.badge.danger { color: var(--danger); background: rgba(213,95,118,.12); }
.badge.gold { color: var(--gold-2); background: rgba(243,217,162,.18); }
.badge.neutral { color: var(--muted); background: rgba(140,126,169,.12); }

.app-shell {
  /* No z-index: keep .app-shell out of its own stacking context so that
     .card's backdrop-filter can sample the bg-particles canvas behind. */
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 14px calc(var(--bottom-h) + env(safe-area-inset-bottom));
}
#bg-particles {
  position: fixed;
  inset: 0;
  /* z-index: 0 keeps the canvas in the root stacking context, above body's bg.
     Cards lift themselves to z-index:1 below so they sit ABOVE the canvas, while
     still sharing the root SC — so their backdrop-filter can blur the particles. */
  z-index: 0;
  pointer-events: none;
  display: block;
}
.app-screen {
  width: min(100%, var(--screen-width));
  position: relative;
  padding-top: calc(var(--header-h) + 14px);
}
.desktop-sidebar,
.desktop-content {
  min-width: 0;
}
.desktop-sidebar {
  display: none;
}
.app-header {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: max(10px, env(safe-area-inset-top));
  width: min(calc(100vw - 20px), var(--screen-width));
  z-index: 25;
}
.header-card {
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.brand-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-meta { min-width: 0; overflow: hidden; }
.brand-badge {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: block;
  object-fit: contain;
}
.brand-logo {
  filter: drop-shadow(0 8px 18px rgba(101,39,211,.24));
}
body.theme-dark .brand-logo,
body[data-theme="dark"] .brand-logo {
  filter: drop-shadow(0 10px 22px rgba(139,61,255,.28));
}
.mw-badge { display: none; }
.brand-title { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-subtitle { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; flex-shrink: 0; }
.notify-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.card,
.panel { padding: 18px; }
.ticket-thread {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  max-height: 60vh;
  overflow-y: auto;
}
.ticket-thread .message-list { gap: 12px; }
.ticket-dialog { display: flex; flex-direction: column; gap: 14px; }
.ticket-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.ticket-dialog__reply { gap: 10px; }
.card-title { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.card-subtitle { color: var(--muted); font-size: 13px; line-height: 1.52; }
/* === Glass cards. Cards stay in root SC at z-index:1 (above canvas at z-index:0)
   so backdrop-filter samples the particles below them. !important on bg nukes
   the per-card opaque overrides (.cabinet-row-card, .cabinet-promo-card etc.) === */
.hero-card,
body.cabinet-body .card,
body.cabinet-body section.card,
body.cabinet-body .cabinet-row-card,
body.cabinet-body .cabinet-promo-card,
body.cabinet-body .cabinet-hub-card,
body.cabinet-body .cabinet-tariff-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, .06) !important;
  background-color: rgba(255, 255, 255, .06) !important;
  background-image: none !important;
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
}
body.theme-dark .hero-card,
body[data-theme="dark"] .hero-card,
body.cabinet-body.theme-dark .card,
body.cabinet-body[data-theme="dark"] .card,
body.cabinet-body.theme-dark section.card,
body.cabinet-body[data-theme="dark"] section.card,
body.cabinet-body.theme-dark .cabinet-row-card,
body.cabinet-body[data-theme="dark"] .cabinet-row-card,
body.cabinet-body.theme-dark .cabinet-promo-card,
body.cabinet-body[data-theme="dark"] .cabinet-promo-card,
body.cabinet-body.theme-dark .cabinet-hub-card,
body.cabinet-body[data-theme="dark"] .cabinet-hub-card,
body.cabinet-body.theme-dark .cabinet-tariff-card,
body.cabinet-body[data-theme="dark"] .cabinet-tariff-card {
  background: rgba(20, 14, 36, .10) !important;
  background-color: rgba(20, 14, 36, .10) !important;
  background-image: none !important;
}
.metrics-grid,
.detail-grid,
.two-col,
.three-col,
.four-col,
.quick-grid,
.admin-grid {
  display: grid;
  gap: 10px;
}
.metrics-grid,
.two-col,
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric,
.list-card,
.device-card,
.user-card,
.ticket-card,
.history-item,
.notification-item,
.message-item {
  min-height: 88px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.user-card.active,
.ticket-card.active,
.menu-link.active {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(139,61,255,.12);
}
.metric-label { font-size: 12px; color: var(--muted); }
.metric-value { margin-top: 7px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.metric-meta { margin-top: 6px; font-size: 12px; color: var(--muted-2); }
.progress {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(139,61,255,.08);
}
.progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d857ff);
}
.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.kv-key { font-size: 13px; color: var(--muted); }
.kv-value { font-weight: 700; text-align: right; word-break: break-word; }
.quick-promo-card {
  min-height: auto;
  padding: 12px 14px;
  grid-column: 1 / -1;
}
.quick-promo-head .small {
  margin-top: 4px;
}
.quick-promo-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.quick-promo-input {
  flex: 1 1 auto;
  width: auto;
  min-height: 40px;
  padding: 10px 12px;
  font-size: 13px;
}
.quick-promo-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
}
.key-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 6px;
}
.key-list-left,
.key-list-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.key-list-right {
  align-items: flex-end;
  text-align: right;
}
.key-list-meta {
  margin-top: 6px;
  line-height: 1.35;
}
.business-keys-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.business-keys-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.business-keys-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}
.business-keys-counter {
  opacity: .8;
}
.business-keys-list {
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.business-keys-list::-webkit-scrollbar {
  width: 6px;
}
.business-keys-list::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}
.business-keys-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.business-keys-pagination .ghost-btn[disabled] {
  opacity: .45;
  pointer-events: none;
}
.business-keys-page-info {
  text-align: center;
  flex: 1 1 auto;
  white-space: nowrap;
}
.quick-btn {
  min-height: 58px;
  padding: 10px 12px;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  font-size: 14px;
  line-height: 1.25;
}
.actions-row,
.wrap-row,
.info-tabs,
.input-row,
.toolbar-row,
.admin-toolbar,
.section-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.subscription-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.subscription-actions-grid .primary-btn,
.subscription-actions-grid .ghost-btn {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 10px;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  font-weight: 750;
}
.subscription-copy-btn,
.trial-claim-inline-btn {
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(139, 61, 255, .20);
}
@media (max-width: 360px) {
  .subscription-actions-grid {
    grid-template-columns: 1fr;
  }
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 12px 14px;
}
.textarea { min-height: 110px; resize: vertical; }
.notice-banner,
.inline-note {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
}
.client-links,
.menu-links,
.history-list,
.notification-list,
.ticket-list,
.message-list,
.side-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.client-links.import-client-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.client-links.import-client-links .client-link {
  min-height: 58px;
  padding: 0 14px;
}
.client-links.import-client-links .client-link > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 380px) {
  .client-links.import-client-links {
    grid-template-columns: 1fr;
  }
}
.list-btn,
.menu-link {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}
.client-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.client-link.recommended { border-color: rgba(139,61,255,.34); }
.modal,
.drawer,
.notification-sheet {
  position: fixed;
  inset: 0;
  background: rgba(18, 10, 32, 0.34);
  z-index: 40;
  padding: 14px;
}
.modal,
.notification-sheet { display: flex; align-items: flex-end; justify-content: center; }
.drawer {
  display: flex;
  justify-content: flex-start;
  /* Reserve room for the floating bottom-nav so the last menu items
     (incl. "Выйти") are reachable when the panel scrolls. */
  padding-bottom: calc(14px + var(--bottom-h) + env(safe-area-inset-bottom));
}
.modal-card,
.notification-panel {
  width: min(100%, var(--screen-width));
  max-height: min(82vh, 780px);
  overflow: auto;
  padding: 18px;
}
.drawer-panel {
  width: min(88vw, 340px);
  padding: 18px 16px;
  overflow: auto;
}
.menu-link {
  min-height: 50px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
}
.menu-link.active { background: var(--accent-soft); }
.bottom-nav-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
}
.bottom-nav {
  pointer-events: auto;
  width: min(calc(100vw - 20px), var(--screen-width));
  padding: 6px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
body.theme-dark .bottom-nav,
body[data-theme="dark"] .bottom-nav { background: rgba(17,12,32,.94); }
.desktop-sidebar-title {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}
.desktop-sidebar-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.desktop-sidebar-metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13px;
  color: var(--muted);
}
.desktop-sidebar-metric strong {
  color: var(--text);
  font-size: 14px;
}
.desktop-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (min-width: 1080px) {
  body.cabinet-body {
    --screen-width: 1320px;
    --header-h: 80px;
    --bottom-h: 0px;
  }
  .app-shell {
    padding: 18px 20px 36px;
  }
  .app-screen {
    width: min(100%, var(--screen-width));
    display: grid;
    grid-template-columns: minmax(250px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding-top: calc(var(--header-h) + 18px);
  }
  .app-header {
    width: min(calc(100vw - 40px), var(--screen-width));
  }
  .header-card {
    min-height: var(--header-h);
    height: auto;
    padding: 14px 16px;
  }
  .menu-open-btn,
  .bottom-nav-wrap,
  .drawer:not(.admin-drawer-shell) {
    display: none !important;
  }
  .admin-drawer-shell {
    display: flex;
  }
  .desktop-sidebar {
    display: flex;
    position: sticky;
    top: calc(var(--header-h) + 18px);
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }
  .desktop-content {
    width: 100%;
    grid-column: 2;
    grid-row: 1;
  }
  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .shop-group-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .shop-tariff-grid,
  .tariff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1360px) {
  .shop-tariff-grid,
  .tariff-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* Bottom-nav timing tokens — keep all properties in sync for buttery motion */
:root {
  --nav-ease: cubic-bezier(.22, 1, .36, 1); /* easeOutQuint */
  --nav-dur: .5s;
  --nav-dur-fast: .32s;
}
.nav-btn {
  position: relative;
  isolation: isolate;
  border: 0;
  background: transparent;
  color: var(--muted);
  height: 52px;
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 0;
  min-width: 52px;
  padding: 0 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(0,0,0,0);
  will-change: flex-grow, gap, padding, background-color, color, box-shadow;
  /* Deactivating: bg + color linger via small delay so the leaving pill leaves a soft "trace" */
  transition:
    flex-grow var(--nav-dur) var(--nav-ease),
    gap var(--nav-dur) var(--nav-ease),
    padding var(--nav-dur) var(--nav-ease),
    background-color var(--nav-dur) var(--nav-ease) .04s,
    color var(--nav-dur-fast) var(--nav-ease) .04s,
    box-shadow var(--nav-dur) var(--nav-ease) .04s;
}
.nav-btn .nav-label {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  transform: translateX(-4px);
  overflow: hidden;
  /* Deactivating label: same duration as activating so two labels visibly cross-fade */
  transition:
    max-width var(--nav-dur) var(--nav-ease),
    opacity var(--nav-dur) var(--nav-ease),
    transform var(--nav-dur) var(--nav-ease);
}
.nav-btn.active {
  flex-grow: 2.4;
  gap: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
  /* Activating: bg + color fill quickly so the moving pill feels solid right away */
  transition:
    flex-grow var(--nav-dur) var(--nav-ease),
    gap var(--nav-dur) var(--nav-ease),
    padding var(--nav-dur) var(--nav-ease),
    background-color var(--nav-dur-fast) var(--nav-ease) .06s,
    color var(--nav-dur-fast) var(--nav-ease) .06s,
    box-shadow var(--nav-dur-fast) var(--nav-ease) .06s;
}
.nav-btn.active .nav-label {
  max-width: 220px;
  opacity: 1;
  transform: translateX(0);
  transition:
    max-width var(--nav-dur) var(--nav-ease),
    opacity var(--nav-dur) var(--nav-ease) .12s,
    transform var(--nav-dur) var(--nav-ease) .08s;
}
body.theme-dark .nav-btn.active,
body[data-theme="dark"] .nav-btn.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .50);
}
.nav-btn:not(.active):hover { color: var(--text); }
.nav-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  transform: translate(-50%, -50%) scale(.7);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
body:not(.theme-dark):not([data-theme="dark"]) .nav-btn::after {
  background: rgba(60, 36, 110, .12);
}
/* Trail circle on previously-active button — disabled by user request. */
.nav-btn.was-active::after { animation: none; opacity: 0; }
.nav-btn.was-active.active::after { animation: none; opacity: 0; }
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.nav-icon .ui-icon,
.nav-icon .ui-icon svg { width: 22px; height: 22px; flex-basis: 22px; }
@media (prefers-reduced-motion: reduce) {
  .nav-btn,
  .nav-btn .nav-label { transition: none !important; }
}

@media (max-width: 520px) {
  .header-card {
    gap: 8px;
    padding: 10px 12px;
  }
  .brand-row {
    gap: 8px;
  }
  .brand-badge {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
  .brand-title {
    font-size: 12px;
  }
  .brand-subtitle {
    font-size: 10px;
  }
  .header-actions {
    gap: 6px;
  }
}

.toast-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 60;
}

.notif-popup-stack {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + var(--header-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), 400px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 65;
  pointer-events: none;
}
.notif-popup {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 17px;
  background: var(--panel);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  animation: notif-popup-in .22s cubic-bezier(.34,1.46,.64,1);
}
.notif-popup-body {
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}
.notif-popup-body:hover { opacity: .85; }
.notif-popup-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}
.notif-popup-text {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.notif-popup-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: opacity .12s;
}
.notif-popup-close:hover { opacity: .7; }
.notif-popup-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--accent);
  transform-origin: left;
}
@keyframes notif-popup-in {
  from { opacity: 0; transform: translateY(-10px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.toast {
  min-width: 220px;
  max-width: min(92vw, 420px);
  padding: 12px 20px;
  border-radius: 14px;
  color: #fff;
  background: rgba(52,36,77,.94);
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 500;
}
.toast.success { background: rgba(40,180,111,.94); }
.toast.error { background: rgba(213,95,118,.94); }

.money-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.money-inline span {
  font-size: .62em;
  color: var(--muted);
}
.stats-three-grid .metric {
  min-height: 106px;
}
.tariff-grid,
.instruction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tariff-card,
.instruction-card,
.payment-method-card {
  min-height: 88px;
  padding: 16px;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.payment-summary-card {
  padding: 20px;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.payment-summary-card .list-title-row {
  margin-bottom: 4px;
}
.tariff-card.current,
.payment-method-card.active {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(139,61,255,.14);
}
.tariff-price {
  margin-top: 14px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.tariff-description {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}
.tariff-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.tariff-feature-item,
.payment-summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(139,61,255,.06);
  border: 1px solid rgba(139,61,255,.10);
}
.tariff-feature-item span,
.payment-summary-line span {
  color: var(--muted);
  font-size: 13px;
}
.payment-summary-line.total {
  background: rgba(52,199,89,.12);
  border-color: rgba(52,199,89,.22);
}
.amount-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.payment-method-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.payment-method-card {
  width: 100%;
  text-align: left;
  color: var(--text);
}
.payment-method-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.payment-method-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.list-title-row:not(:last-child) {
  margin-bottom: 12px;
}
.list-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}
.payment-method-card .list-title {
  font-size: 15px;
}
.instruction-steps {
  margin: 14px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
}
.instruction-steps li {
  line-height: 1.55;
}
.acquisition-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.promo-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.promo-log-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
@media (max-width: 640px) {
  .tariff-grid,
  .instruction-grid,
  .tariff-feature-list {
    grid-template-columns: 1fr;
  }
}
.message-item.user {
  background: rgba(139,61,255,.08);
  margin-left: 18px;
}
.message-item.admin {
  background: rgba(243,217,162,.16);
  margin-right: 18px;
}
.message-item.system {
  background: transparent;
  border: 1px dashed rgba(139,61,255,.25);
  min-height: auto;
  padding: 8px 16px;
  border-radius: 10px;
  text-align: center;
  font-size: 0.82em;
  color: var(--text-2, #888);
  margin: 0 18px;
}
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.msg-row--right {
  flex-direction: row-reverse;
}
.msg-row--left {
  flex-direction: row;
}
.msg-row--system {
  justify-content: center;
}
.msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  word-break: break-word;
}
.msg-bubble--user {
  background: rgba(139,61,255,.22);
  border-bottom-right-radius: 4px;
}
.msg-bubble--admin {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.msg-sender {
  font-size: 0.75em;
  font-weight: 700;
  opacity: .6;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.msg-text {
  line-height: 1.55;
  white-space: pre-wrap;
}
.msg-time {
  font-size: 0.72em;
  opacity: .45;
  margin-top: 5px;
  text-align: right;
}
.msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.msg-system-label {
  font-size: 0.78em;
  color: var(--text-2, #888);
  background: rgba(139,61,255,.07);
  border: 1px dashed rgba(139,61,255,.22);
  padding: 4px 14px;
  border-radius: 20px;
}
.notification-item.unread { border-color: var(--line-strong); }
.code-box {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.04);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.desktop-shell {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  justify-content: center;
}
.admin-shell {
  width: min(1380px, 100%);
  padding: 20px;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-grid {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: start;
}
.user-list,
.side-panel {
  max-height: calc(100vh - 260px);
  overflow: auto;
}
.section-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
@media (max-width: 960px) {
  .admin-grid { grid-template-columns: 1fr; }
  .user-list,
  .side-panel { max-height: none; }
}
@media (max-width: 640px) {
  .metrics-grid,
  .two-col,
  .detail-grid,
  .three-col,
  .four-col,
  .quick-grid { grid-template-columns: 1fr; }
  .quick-promo-actions { flex-direction: column; align-items: stretch; }
  .quick-promo-btn { width: 100%; }
  .key-list-row { grid-template-columns: minmax(0, 1fr); }
  .key-list-right { align-items: flex-start; text-align: left; }
  .admin-header { flex-direction: column; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.admin-desktop-shell {
  padding-top: 24px;
  padding-bottom: calc(var(--bottom-h) + 34px);
}
.admin-topbar-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: max(10px, env(safe-area-inset-top));
  width: min(calc(100vw - 20px), 1680px);
  z-index: 34;
}
.admin-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--admin-topbar-bg);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.admin-topbar-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-topbar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: linear-gradient(180deg, rgba(46,242,207,.92), rgba(12,192,235,.92) 65%, rgba(33,134,255,.94));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32);
}
.admin-topbar-copy {
  min-width: 0;
}
.admin-topbar-title,
.admin-topbar-subtitle,
.admin-topbar-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .02em;
}
.admin-topbar-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text);
}
.admin-topbar-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}
.admin-drawer-panel {
  width: min(88vw, 360px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.admin-drawer-title {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}
.admin-drawer-menu {
  gap: 8px;
}
.admin-drawer-link {
  min-height: 56px;
  padding: 0 14px;
  background: var(--panel-2);
  border: 1px solid transparent;
}
.admin-drawer-selected {
  padding: 14px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.admin-drawer-selected-name {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.admin-drawer-actions {
  display: flex;
  gap: 8px;
}
.admin-drawer-actions .ghost-btn {
  width: 100%;
}
@media (max-width: 720px) {
  .admin-topbar-wrap {
    width: min(calc(100vw - 16px), 100%);
  }
  .admin-topbar {
    padding: 10px;
    gap: 8px;
  }
  .admin-topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .admin-topbar-title {
    font-size: 13px;
  }
}
.admin-body {
  overflow-x: hidden;
}
.admin-page-shell {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: calc(92px + env(safe-area-inset-top)) 20px calc(112px + env(safe-area-inset-bottom));
}
.admin-header-card,
.admin-stats-shell {
  margin-bottom: 14px;
}
.admin-header-card {
  padding: 18px;
}
.admin-header-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.admin-header-actions {
  justify-content: flex-end;
}
.admin-page-title {
  margin: 8px 0 6px;
  font-size: 30px;
  line-height: 1.05;
}
.admin-top-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.admin-stat-item {
  min-height: 88px;
  padding: 14px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.admin-stat-value {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.admin-stat-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.admin-main-shell {
  min-height: 0;
}
.admin-layout-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.admin-aside-column {
  min-width: 0;
}
.admin-main-column {
  min-width: 0;
}
.admin-context-card,
.admin-stats-shell,
.admin-main-shell,
.admin-selected-main,
.admin-selected-meta,
.admin-selected-pill,
.admin-summary-metric,
.admin-user-row,
.admin-user-row-head > div {
  min-width: 0;
}
.admin-search-card {
  position: sticky;
  top: calc(max(12px, env(safe-area-inset-top)) + 82px);
  z-index: 6;
}
.admin-users-card {
  padding: 12px;
  position: relative;
  z-index: 0;
}
.admin-user-list-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 240px);
  overflow: auto;
}
.admin-user-row {
  width: 100%;
  text-align: left;
  min-height: 0;
  flex-shrink: 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}
.admin-user-row.active {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(139,61,255,.14);
}
.admin-user-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.admin-user-row-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.28;
}
.admin-summary-card {
  background:
    var(--admin-hero-bg),
    linear-gradient(135deg, rgba(106,67,200,.18), rgba(38,24,71,.28));
}
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.admin-summary-metric {
  min-height: 94px;
  padding: 14px;
  border-radius: 18px;
  background: var(--admin-hero-surface);
  border: 1px solid var(--line);
}
.admin-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.desktop-only { display: block; }
.mobile-only { display: none; }
.admin-mobile-nav-wrap {
  z-index: 30;
}
.admin-mobile-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  grid-template-columns: none;
  scrollbar-width: none;
}
.admin-mobile-nav::-webkit-scrollbar {
  display: none;
}
.admin-section-nav-btn {
  min-width: 92px;
  flex: 0 0 auto;
  padding: 0 12px;
}
@media (min-width: 1181px) {
  .admin-page-shell {
    padding-inline: 24px;
  }
  .admin-header-card,
  .admin-context-card,
  .admin-main-shell > .card,
  .admin-main-column > .card,
  .admin-aside-column > .card {
    border-radius: 30px;
  }
  .admin-context-card {
    padding: 24px;
  }
  .admin-users-card {
    padding: 14px;
  }
  .admin-user-list-grid {
    max-height: calc(100vh - 268px);
  }
  .admin-summary-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
  }
  .admin-selected-bar {
    grid-template-columns: minmax(0, 1.25fr) minmax(420px, 1fr);
    gap: 16px;
  }
}
@media (max-width: 1180px) {
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .admin-page-shell {
    padding-inline: 12px;
  }
  .admin-layout-grid {
    grid-template-columns: 1fr;
  }
  .admin-search-card {
    position: static;
  }
  .admin-user-list-grid {
    max-height: none;
  }
}
@media (max-width: 720px) {
  .desktop-only { display: none; }
  .mobile-only { display: flex; }
  .admin-header-row {
    flex-direction: column;
  }
  .admin-page-title {
    font-size: 26px;
  }
  .admin-layout-grid,
  .metrics-grid,
  .two-col,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .admin-stat-grid,
  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-dual-grid {
    grid-template-columns: 1fr;
  }
  .admin-header-actions {
    width: 100%;
  }
  .admin-header-actions .ghost-btn {
    width: 100%;
  }
}

.admin-context-card {
  margin-bottom: 14px;
  padding: 18px;
}
.admin-context-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.admin-selected-bar {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--admin-hero-bg);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.admin-selected-bar.empty {
  opacity: .88;
}
.admin-selected-name {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.admin-selected-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.admin-selected-pill {
  min-height: 72px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--admin-hero-surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.admin-selected-pill strong {
  font-size: 15px;
  line-height: 1.2;
}
.admin-section-toolbar {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.admin-section-toolbar.disabled {
  opacity: .6;
}
.admin-section-select-wrap {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-section-select {
  min-width: 220px;
}
.admin-section-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-layout-grid-wide {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
}
@media (max-width: 960px) {
  .admin-layout-grid-wide {
    grid-template-columns: 1fr;
  }
}

.admin-pager-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-pager-actions {
  flex-wrap: nowrap;
}
.admin-page-badge {
  min-width: 68px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--admin-hero-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.admin-user-meta-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
/* Flat user-detail page (new layout, replaces .admin-user-sections + section
   active-toggling). All blocks always visible; sticky TOC scrolls to anchors. */
.admin-user-flat {
  scroll-behavior: smooth;
}
.admin-user-flat .card {
  scroll-margin-top: 92px;
}
.admin-user-hero {
  position: relative;
}
.admin-user-toc {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 12px;
  margin: 0 -4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: var(--surface-1, rgba(20, 16, 36, 0.78));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  backdrop-filter: blur(20px);
}
.admin-user-toc::-webkit-scrollbar { height: 4px; }
.admin-user-toc .chip-btn {
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .admin-user-toc {
    padding: 8px 10px;
  }
}

.admin-section-kicker {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent-2);
}
.admin-activity-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-activity-span-2 {
  grid-column: span 2;
}
@media (max-width: 1180px) {
  .admin-selected-bar {
    grid-template-columns: 1fr;
  }
  .admin-selected-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .admin-selected-meta {
    grid-template-columns: 1fr;
  }
  .admin-activity-grid,
  .admin-activity-span-2 {
    grid-template-columns: 1fr;
    grid-column: auto;
  }
}
@media (max-width: 720px) {
  .admin-context-head {
    flex-direction: column;
  }
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-section-toolbar {
    align-items: stretch;
  }
  .admin-section-select-wrap,
  .admin-section-select {
    min-width: 0;
    width: 100%;
  }
  .admin-pager-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-pager-actions {
    justify-content: space-between;
  }
}
@media (max-width: 520px) {
  .admin-selected-meta,
  .admin-dual-grid,
  .admin-activity-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-summary-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 380px) {
  .admin-stat-grid {
    grid-template-columns: 1fr;
  }
}

.legal-body {
  background:
    radial-gradient(circle at top left, rgba(176, 139, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 219, 186, 0.18), transparent 24%),
    linear-gradient(180deg, #f8f4fd 0%, #f0e7fb 100%);
  padding: 24px 14px 40px;
}
body.theme-dark.legal-body,
body[data-theme="dark"].legal-body {
  background:
    radial-gradient(circle at top left, rgba(117, 69, 255, 0.20), transparent 24%),
    radial-gradient(circle at bottom right, rgba(63, 23, 131, 0.24), transparent 24%),
    linear-gradient(180deg, #08050f 0%, #0e091d 100%);
}
.legal-shell {
  width: min(100%, 980px);
  margin: 0 auto;
}
.legal-card {
  padding: 22px;
}
.legal-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.legal-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 700;
}
.legal-nav-link.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.legal-hero {
  padding: 6px 2px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.legal-title {
  margin: 10px 0 8px;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.08;
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 13px;
}
.doc-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  line-height: 1.72;
  font-size: 15px;
}
.doc-section {
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.doc-section h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.25;
}
.doc-section p {
  margin: 0 0 12px;
}
.doc-section p:last-child {
  margin-bottom: 0;
}
.doc-section ul {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (max-width: 720px) {
  .legal-body { padding: 14px 10px 24px; }
  .legal-card { padding: 16px; }
  .legal-topbar { align-items: stretch; }
  .legal-nav { width: 100%; }
  .legal-nav-link, .legal-back { width: 100%; justify-content: center; }
  .doc-section { padding: 16px; }
  .doc-content { font-size: 14px; }
}


.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 10, 35, .42);
  backdrop-filter: blur(8px);
}
.busy-card {
  width: min(100%, 360px);
  padding: 24px 20px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.busy-title {
  font-size: 18px;
  font-weight: 800;
}
.busy-text {
  margin-top: 10px;
  line-height: 1.55;
  color: var(--muted);
}

.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.ui-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  overflow: visible;
}
.menu-link-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.menu-link-tail {
  flex: 0 0 16px;
  min-width: 16px;
  text-align: right;
  color: var(--muted);
}
.switch-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.switch-row {
  width: 100%;
  min-height: 74px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}
.switch-row.disabled {
  opacity: .62;
}
.switch-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.switch-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}
.switch-description,
.switch-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.switch-note {
  color: var(--muted-2);
}
.ios-switch {
  position: relative;
  flex: 0 0 52px;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(140,126,169,.22);
  background: rgba(140,126,169,.22);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
}
.ios-switch.on {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(139,61,255,.24);
}
.ios-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.ios-switch.on .ios-switch-knob {
  transform: translateX(20px);
}
.switch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 4px;
}
.route-status-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
}
.route-status-title {
  font-size: 13px;
  font-weight: 800;
}
.route-status-text {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
@media (max-width: 520px) {
  .switch-row {
    min-height: 0;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .stats-three-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stats-three-grid .metric {
    min-height: 92px;
    padding: 12px;
  }
  .stats-three-grid .metric-value {
    font-size: 18px;
  }
  .stats-three-grid .metric-meta {
    font-size: 11px;
  }
}

.shop-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.compact-metric {
  min-height: 0;
  padding: 12px 14px;
}
.compact-metric .metric-value {
  font-size: 22px;
  line-height: 1.15;
}
.compact-metric .metric-meta,
.compact-metric .metric-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.shop-group-card {
  width: 100%;
  min-height: 96px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.shop-group-card.active {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(139,61,255,.14);
  background: linear-gradient(180deg, rgba(139,61,255,.10), rgba(139,61,255,.05));
}
.shop-tariff-grid {
  margin-top: 14px;
}
.shop-custom-days-wrap {
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: rgba(255,255,255,.03);
}
.shop-custom-days-wrap.hidden {
  display: none;
}
.promo-editor-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.promo-flag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.promo-flag-card {
  min-height: 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.promo-flag-card input {
  margin: 3px 0 0;
}
.promo-flag-card span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.promo-flag-card strong {
  font-size: 14px;
  line-height: 1.25;
}
.promo-flag-card small {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.promo-add-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.promo-add-select {
  min-width: 220px;
}
.promo-property-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.promo-property-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.promo-remove-btn {
  flex: 0 0 auto;
}
.promo-editor-actions {
  flex-wrap: wrap;
}
.promo-effects-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.promo-help-stack .list-card {
  min-height: 0;
}
@media (max-width: 720px) {
  .shop-group-grid,
  .promo-flag-grid {
    grid-template-columns: 1fr;
  }
  .promo-add-row {
    width: 100%;
    justify-content: stretch;
    align-items: stretch;
    flex-direction: column;
  }
  .promo-add-select {
    min-width: 0;
    width: 100%;
  }
  .promo-effects-wrap {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .shop-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .compact-metric {
    padding: 10px;
    border-radius: 16px;
  }
  .compact-metric .metric-value {
    font-size: 18px;
  }
  .compact-metric .metric-label,
  .compact-metric .metric-meta {
    font-size: 11px;
  }
}
@media (max-width: 420px) {
  .compact-metric .metric-value {
    font-size: 16px;
  }
}

.site-body {
  padding: 18px 14px 36px;
}
.site-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.site-topbar {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.site-hero {
  padding: 26px;
}
.site-title,
.auth-title,
.account-title {
  margin: 12px 0 10px;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.08;
}
.site-lead {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
  max-width: 760px;
}
.site-cta-row {
  margin-top: 18px;
}
.site-hero-meta {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
}
.site-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.site-kpi-grid-accent .site-kpi-card {
  background: linear-gradient(180deg, rgba(139,61,255,.18), rgba(139,61,255,.08));
  border-color: rgba(139,61,255,.24);
}
.site-kpi-card {
  padding: 20px;
}
.site-kpi-value {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  font-weight: 900;
}
.site-kpi-label {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 800;
}
.site-kpi-meta {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}
.site-list-card {
  padding: 20px;
}
.site-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  /* Cap the height so a long country list (15+ rows) doesn't blow out the
     home grid; scroll within the card instead. ~6 rows visible by default. */
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.site-list::-webkit-scrollbar {
  width: 6px;
}
.site-list::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}
.site-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.site-list-title {
  font-weight: 800;
}
.site-list-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.site-list-value {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted-2);
}
.site-list-empty {
  color: var(--muted);
  font-size: 14px;
}
.site-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.site-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.site-card {
  padding: 20px;
}
.site-card h2 {
  margin: 10px 0 10px;
  font-size: 24px;
}
.site-card p {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}
.site-footer {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-shell {
  max-width: 620px;
}
.auth-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-card .auth-title {
  margin: 0;
}
.auth-card .eyebrow {
  margin-bottom: -6px;
}
.auth-card .site-lead {
  margin: -2px 0 2px;
  color: var(--muted);
}
.auth-card .auth-form {
  margin-top: 4px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.auth-field-hint {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
  opacity: .7;
}
.auth-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.auth-submit {
  width: 100%;
}
.success-banner {
  color: var(--success);
  background: rgba(40,180,111,.10);
  border-color: rgba(40,180,111,.24);
}
.danger-banner {
  color: var(--danger);
  background: rgba(213,95,118,.10);
  border-color: rgba(213,95,118,.24);
}
.account-shell {
  gap: 18px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 900px) {
  .site-grid,
  .site-grid-two,
  .site-kpi-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .site-body {
    padding: 12px 10px 24px;
  }
  .site-hero,
  .site-card,
  .auth-card,
  .site-footer,
  .site-topbar {
    padding: 16px;
  }
  .auth-split {
    grid-template-columns: 1fr;
  }
}

.subscription-import-body {
  padding: 18px 14px 36px;
}
.subscription-import-shell {
  width: min(100%, 1080px);
}
.subscription-import-card {
  max-width: 1080px;
}
.subscription-import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr);
  gap: 16px;
}
.subscription-import-main,
.subscription-import-qr-card,
.subscription-raw-box {
  min-height: 0;
}
.subscription-import-actions .primary-btn,
.subscription-import-actions .ghost-btn {
  min-width: 0;
}
.subscription-import-qr-card {
  display: flex;
  flex-direction: column;
}
.subscription-import-qr-stage {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
}
.subscription-import-qr-stage > * {
  grid-area: 1 / 1;
}
.subscription-import-countdown {
  --progress: 1;
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 18px;
  border-radius: 28px;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(
      circle at center,
      rgba(17, 10, 38, .54) 0 26%,
      rgba(17, 10, 38, .28) 26.5% 52%,
      rgba(17, 10, 38, .12) 52.5% 74%,
      rgba(17, 10, 38, .04) 74.5% 100%
    );
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(1.5px);
}
.subscription-import-countdown[hidden],
.subscription-import-countdown.is-hidden {
  display: none !important;
}
.subscription-import-countdown::before {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 999px;
  background:
    conic-gradient(
      from -90deg,
      var(--accent) 0turn,
      var(--accent-2) calc(var(--progress) * 1turn),
      rgba(181,171,215,.18) calc(var(--progress) * 1turn),
      rgba(181,171,215,.18) 1turn
    );
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 58.6% 72%, transparent 72.6% 100%);
  mask: radial-gradient(circle, transparent 0 58%, #000 58.6% 72%, transparent 72.6% 100%);
  box-shadow: 0 0 40px rgba(116, 63, 255, .22);
}
.subscription-import-countdown-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 220px);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: color-mix(in srgb, var(--panel) 58%, transparent);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  backdrop-filter: blur(4px);
}
.subscription-import-countdown-value {
  font-size: clamp(54px, 9vw, 84px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -.05em;
  color: var(--text);
}
.subscription-import-countdown-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.subscription-import-countdown-helper {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 180px;
}
.qr-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.qr-preview img {
  display: block;
  max-width: min(100%, 320px);
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  filter: contrast(1.03);
}
.qr-preview-empty {
  color: var(--muted);
}
@media (max-width: 900px) {
  .subscription-import-grid {
    grid-template-columns: 1fr;
  }
}

/* Skeleton loader for cabinet + import pages */
.cabinet-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 40px;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
}
.cabinet-skeleton-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 2px 6px;
}
.cabinet-skeleton-brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--accent);
}
.cabinet-skeleton-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--line-strong) 0%, var(--line) 50%, var(--line-strong) 100%);
  background-size: 200% 100%;
  animation: vpnbot-skel 1.4s ease-in-out infinite;
}
.cabinet-skeleton-hero-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
}
.cabinet-skeleton-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.cabinet-skeleton-line {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--line-strong) 0%, var(--line) 50%, var(--line-strong) 100%);
  background-size: 200% 100%;
  animation: vpnbot-skel 1.4s ease-in-out infinite;
}
.cabinet-skeleton-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.cabinet-skeleton-btn {
  height: 36px;
  flex: 1;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--line-strong) 0%, var(--line) 50%, var(--line-strong) 100%);
  background-size: 200% 100%;
  animation: vpnbot-skel 1.4s ease-in-out infinite;
}
.cabinet-skeleton-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.cabinet-skeleton-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .85s linear infinite;
}
.cabinet-skeleton-status {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
/* Legacy shimmer elements (used by import page) */
.cabinet-skeleton-hero,
.cabinet-skeleton-card {
  background: linear-gradient(90deg, rgba(120,120,120,0.12) 0%, rgba(120,120,120,0.22) 50%, rgba(120,120,120,0.12) 100%);
  background-size: 200% 100%;
  border-radius: 14px;
  animation: vpnbot-skel 1.3s ease-in-out infinite;
}
.cabinet-skeleton-hero { height: 110px; }
.cabinet-skeleton-card { height: 82px; }
@keyframes vpnbot-skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ======================================================================
 * Minimal cabinet redesign (home, devices, traffic, advanced, profile hub)
 * ====================================================================== */
.cabinet-status-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 20px;
  gap: 6px;
}
.cabinet-status-hero.tone-positive { box-shadow: inset 0 0 0 1px rgba(45, 200, 120, .18); }
.cabinet-status-hero.tone-negative { box-shadow: inset 0 0 0 1px rgba(255, 92, 92, .22); }
.cabinet-status-hero.tone-warning  { box-shadow: inset 0 0 0 1px rgba(255, 178, 36, .22); }
.cabinet-status-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.cabinet-status-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--accent);
}
.cabinet-status-hero.tone-negative .cabinet-status-value { color: var(--danger, #ff5c5c); }
.cabinet-status-hero.tone-warning .cabinet-status-value { color: #f5a524; }
.cabinet-status-divider {
  width: 60%;
  max-width: 200px;
  height: 1px;
  background: var(--line);
  margin: 6px 0 4px;
}
.cabinet-status-days {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}
.cabinet-status-days-suffix {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}
.cabinet-status-expire {
  font-size: 18px;
  font-weight: 700;
}

.cabinet-row-card {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 18px;
  font: inherit;
  color: inherit;
  position: relative;
}
.cabinet-row-card:hover { border-color: var(--line-strong); }
.cabinet-row-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--panel-3, rgba(139, 61, 255, .08));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.cabinet-row-icon .ui-icon {
  width: 22px;
  height: 22px;
}
.cabinet-row-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 4px;
}
.cabinet-row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cabinet-row-meta {
  font-size: 13px;
  color: var(--muted);
  white-space: normal;
  line-height: 1.4;
}
.cabinet-row-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.cabinet-row-value-suffix {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted-2);
  margin-left: 2px;
}
.cabinet-row-chevron {
  color: var(--muted-2);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}
.cabinet-row-chevron-floating {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.cabinet-traffic-card {
  display: block;
  position: relative;
}
.cabinet-traffic-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cabinet-traffic-head .cabinet-row-eyebrow { margin-bottom: 0; }
.cabinet-traffic-pct {
  margin-left: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}
.cabinet-traffic-amount {
  margin-top: 14px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.cabinet-traffic-amount strong { color: var(--accent); }
.cabinet-traffic-amount span { color: var(--muted); font-size: 18px; font-weight: 600; }
.cabinet-traffic-divider { color: var(--muted-2); }
.cabinet-traffic-progress { margin-top: 14px; height: 10px; }

.cabinet-install-btn {
  width: 100%;
  min-height: 56px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.cabinet-promo-card { padding: 14px 16px; overflow: hidden; }
.cabinet-promo-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 6px;
  min-width: 0;
}
.cabinet-promo-input {
  flex: 1 1 140px;
  width: auto;
  min-width: 0;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 13px;
}
.cabinet-promo-btn {
  flex: 0 1 auto;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 13px;
  max-width: 100%;
  white-space: nowrap;
}

.cabinet-notification-card { padding: 14px 16px; }
.cabinet-notification-title { font-weight: 800; margin-top: 4px; }
.cabinet-notification-body { margin-top: 8px; white-space: normal; line-height: 1.5; }
.cabinet-notification-meta { margin-top: 8px; color: var(--muted-2); }

/* Sub-screens */
.cabinet-subhead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 8px;
}
.cabinet-subhead-back {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
}
.cabinet-subhead-text { display: flex; flex-direction: column; }
.cabinet-subhead-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.cabinet-subhead-subtitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.cabinet-devices-summary { padding: 16px; }
.cabinet-devices-summary-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cabinet-devices-summary-total {
  margin-left: auto;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.cabinet-devices-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.cabinet-devices-stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
}
.cabinet-devices-stat.is-accent {
  border-color: rgba(45, 200, 120, .35);
  box-shadow: inset 0 0 0 1px rgba(45, 200, 120, .18);
}
.cabinet-devices-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.cabinet-devices-stat-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
}
.cabinet-device-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.cabinet-device-item-title { font-weight: 800; }
.cabinet-device-item-meta { color: var(--muted); }
.cabinet-device-actions { gap: 8px; }
.cabinet-device-slot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed var(--line-strong, var(--line));
  background: transparent;
  color: var(--muted);
}
.cabinet-device-slot-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  font-size: 22px;
  font-weight: 700;
  color: var(--muted-2);
}
.cabinet-device-slot-title { font-weight: 800; color: var(--muted); }
.cabinet-device-slot-meta { color: var(--muted-2); }

/* Traffic detail */
.cabinet-traffic-detail { padding: 18px; }
.cabinet-traffic-detail-head { display: flex; align-items: center; gap: 12px; }
.cabinet-traffic-detail-amount {
  margin-top: 16px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.cabinet-traffic-detail-amount strong { color: var(--accent); }
.cabinet-traffic-detail-amount span { color: var(--muted); font-size: 20px; font-weight: 600; }
.cabinet-traffic-detail-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.cabinet-traffic-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

/* Profile hub */
.cabinet-hub-card { padding: 16px; }
.cabinet-hub-list { display: flex; flex-direction: column; gap: 8px; }
.cabinet-hub-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 14px;
  color: inherit;
  font: inherit;
}
.cabinet-hub-row:hover { border-color: var(--line-strong); }
.cabinet-hub-row.cabinet-hub-row-static {
  cursor: default;
}
.cabinet-hub-row-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cabinet-hub-row-title { font-weight: 700; }
.cabinet-hub-row-meta { color: var(--muted); white-space: normal; line-height: 1.4; }
.cabinet-hub-row .cabinet-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

/* Tariffs (simple) */
.cabinet-tariffs-summary { padding: 18px; }
.cabinet-tariffs-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cabinet-tariffs-summary-cell {
  text-align: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 12px;
}
.cabinet-tariffs-summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(139, 61, 255, .08);
  color: var(--accent);
  margin-bottom: 8px;
}
.cabinet-tariffs-summary-value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--accent);
}
.cabinet-tariffs-summary-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 4px;
}

.cabinet-tariff-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}
.cabinet-tariff-card.is-current {
  box-shadow: inset 0 0 0 1px rgba(255, 178, 36, .35);
}
.cabinet-tariff-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}
.cabinet-tariff-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.cabinet-tariff-tagline { color: var(--muted); margin-top: 4px; line-height: 1.45; }
.cabinet-tariff-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cabinet-tariff-feature {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.cabinet-tariff-feature-value { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.cabinet-tariff-feature-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 4px;
}
.cabinet-tariff-options { display: flex; flex-direction: column; gap: 8px; }
.cabinet-tariff-option {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.cabinet-tariff-option:hover { border-color: var(--line-strong); }
.cabinet-tariff-option.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.cabinet-tariff-option-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong, var(--line));
  position: relative;
  flex: 0 0 auto;
}
.cabinet-tariff-option.is-active .cabinet-tariff-option-radio {
  border-color: var(--accent);
}
.cabinet-tariff-option.is-active .cabinet-tariff-option-radio::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.cabinet-tariff-option-label { font-weight: 700; }
.cabinet-tariff-option-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cabinet-tariff-option-price strong { font-size: 16px; font-weight: 800; }
.cabinet-tariff-option-price .small { color: var(--muted-2); }
.cabinet-tariff-buy {
  width: 100%;
  min-height: 52px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

@media (max-width: 480px) {
  .cabinet-status-days { font-size: 48px; }
  .cabinet-status-value { font-size: 26px; }
  .cabinet-traffic-amount { font-size: 22px; }
  .cabinet-traffic-amount span { font-size: 16px; }
}

/* Subscription pool (phase 4c) — preview list inside the "Профили подписки" card. */
.pool-preview-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pool-preview-list li {
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-weight: 600;
}

/* ============================================================
   Micro-animations (cabinet)
   GPU-only (transform/opacity), short (<400ms), reduced-motion safe.
   ============================================================ */
@keyframes cab-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cab-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cab-scale-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes cab-slide-from-left {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cab-slide-from-bottom {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cab-toast-in {
  from { opacity: 0; transform: translateY(-14px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cab-spin-once {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}
@keyframes cab-status-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(40, 180, 111, 0); }
  50%      { box-shadow: 0 0 24px 2px rgba(40, 180, 111, .26); }
}

/* --- Tab content entry: every direct child of main fades up with stagger --- */
.app-screen main.desktop-content > * {
  animation: cab-fade-up .34s cubic-bezier(.22, 1, .36, 1) both;
}
.app-screen main.desktop-content > :nth-child(1) { animation-delay: 0ms; }
.app-screen main.desktop-content > :nth-child(2) { animation-delay: 40ms; }
.app-screen main.desktop-content > :nth-child(3) { animation-delay: 80ms; }
.app-screen main.desktop-content > :nth-child(4) { animation-delay: 120ms; }
.app-screen main.desktop-content > :nth-child(5) { animation-delay: 155ms; }
.app-screen main.desktop-content > :nth-child(6) { animation-delay: 185ms; }
.app-screen main.desktop-content > :nth-child(7) { animation-delay: 210ms; }
.app-screen main.desktop-content > :nth-child(n+8) { animation-delay: 230ms; }

/* --- Hub-rows mini-stagger inside their cabinet-hub-card --- */
.cabinet-hub-card .cabinet-hub-row {
  animation: cab-fade-up .28s cubic-bezier(.22, 1, .36, 1) both;
}
.cabinet-hub-card .cabinet-hub-row:nth-of-type(1) { animation-delay: 80ms; }
.cabinet-hub-card .cabinet-hub-row:nth-of-type(2) { animation-delay: 110ms; }
.cabinet-hub-card .cabinet-hub-row:nth-of-type(3) { animation-delay: 140ms; }
.cabinet-hub-card .cabinet-hub-row:nth-of-type(4) { animation-delay: 170ms; }
.cabinet-hub-card .cabinet-hub-row:nth-of-type(n+5) { animation-delay: 200ms; }

/* --- Tariff cards stagger --- */
.cabinet-tariff-card { animation: cab-fade-up .35s cubic-bezier(.22, 1, .36, 1) both; }
.cabinet-tariff-card:nth-of-type(1) { animation-delay: 60ms; }
.cabinet-tariff-card:nth-of-type(2) { animation-delay: 110ms; }
.cabinet-tariff-card:nth-of-type(3) { animation-delay: 160ms; }
.cabinet-tariff-card:nth-of-type(4) { animation-delay: 210ms; }
.cabinet-tariff-card:nth-of-type(n+5) { animation-delay: 250ms; }

/* --- Drawer (left side menu) --- */
.drawer:not(.hidden) { animation: cab-fade-in .26s cubic-bezier(.22, 1, .36, 1) both; }
.drawer:not(.hidden) .drawer-panel {
  animation: cab-slide-from-left .38s cubic-bezier(.22, 1, .36, 1) both;
}
/* Smooth close: when JS adds .is-closing right before tearing the drawer DOM, play
   the reverse animation. The 260ms timeout in the toggle-menu handler matches this. */
.drawer.is-closing { animation: cab-fade-out .24s cubic-bezier(.4, 0, .8, .25) forwards !important; }
.drawer.is-closing .drawer-panel {
  animation: cab-slide-to-left .26s cubic-bezier(.4, 0, .8, .25) forwards !important;
}
.drawer.is-closing .menu-link { animation: none !important; }
@keyframes cab-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes cab-slide-to-left {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-28px); }
}
.drawer:not(.hidden) .menu-link {
  animation: cab-slide-from-left .32s cubic-bezier(.22, 1, .36, 1) both;
}
.drawer:not(.hidden) .menu-link:nth-of-type(1) { animation-delay: 120ms; }
.drawer:not(.hidden) .menu-link:nth-of-type(2) { animation-delay: 150ms; }
.drawer:not(.hidden) .menu-link:nth-of-type(3) { animation-delay: 180ms; }
.drawer:not(.hidden) .menu-link:nth-of-type(4) { animation-delay: 210ms; }
.drawer:not(.hidden) .menu-link:nth-of-type(5) { animation-delay: 235ms; }
.drawer:not(.hidden) .menu-link:nth-of-type(6) { animation-delay: 255ms; }
.drawer:not(.hidden) .menu-link:nth-of-type(7) { animation-delay: 270ms; }
.drawer:not(.hidden) .menu-link:nth-of-type(n+8) { animation-delay: 285ms; }

/* --- Modals (country, QR, etc.) --- */
.modal:not(.hidden) { animation: cab-fade-in .22s ease both; }
.modal:not(.hidden) .modal-card {
  animation: cab-slide-from-bottom .38s cubic-bezier(.22, 1, .36, 1) both;
}

/* --- Notifications sheet --- */
.notification-sheet:not(.hidden) { animation: cab-fade-in .22s ease both; }
.notification-sheet:not(.hidden) .notification-panel {
  animation: cab-slide-from-bottom .42s cubic-bezier(.22, 1, .36, 1) both;
}
.notification-panel .notification-item {
  animation: cab-fade-up .26s cubic-bezier(.22, 1, .36, 1) both;
}
.notification-panel .notification-item:nth-of-type(1) { animation-delay: 80ms; }
.notification-panel .notification-item:nth-of-type(2) { animation-delay: 110ms; }
.notification-panel .notification-item:nth-of-type(3) { animation-delay: 140ms; }
.notification-panel .notification-item:nth-of-type(4) { animation-delay: 170ms; }
.notification-panel .notification-item:nth-of-type(5) { animation-delay: 200ms; }
.notification-panel .notification-item:nth-of-type(n+6) { animation-delay: 220ms; }

/* --- Busy overlay --- */
.busy-overlay:not(.hidden) { animation: cab-fade-in .22s ease both; }
.busy-overlay:not(.hidden) .busy-card {
  animation: cab-scale-in .3s cubic-bezier(.22, 1, .36, 1) both;
}

/* --- Toasts --- */
.toast { animation: cab-toast-in .26s cubic-bezier(.22, 1, .36, 1) both; }

/* --- Country list buttons (inside CountryModal) --- */
.modal-card .client-link {
  animation: cab-fade-up .24s cubic-bezier(.22, 1, .36, 1) both;
}
.modal-card .client-link:nth-of-type(1) { animation-delay: 80ms; }
.modal-card .client-link:nth-of-type(2) { animation-delay: 100ms; }
.modal-card .client-link:nth-of-type(3) { animation-delay: 120ms; }
.modal-card .client-link:nth-of-type(4) { animation-delay: 140ms; }
.modal-card .client-link:nth-of-type(5) { animation-delay: 160ms; }
.modal-card .client-link:nth-of-type(6) { animation-delay: 175ms; }
.modal-card .client-link:nth-of-type(n+7) { animation-delay: 190ms; }

/* --- Subscription "Активна" gentle glow (only when active/positive)
   Uses a pseudo-element so the entry stagger from main > * stays intact. --- */
.cabinet-status-hero.tone-positive { position: relative; }
.cabinet-status-hero.tone-positive::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: cab-status-glow 3.2s ease-in-out 1.6s infinite;
}

/* --- Refresh icon spin (toggled via .is-spinning class from JS) --- */
.icon-btn.is-spinning .ui-icon { animation: cab-spin-once .65s cubic-bezier(.22, 1, .36, 1); }

/* --- Hover lift on desktop (≥1080px) for top-level cards/buttons --- */
@media (hover: hover) and (min-width: 1080px) {
  .cabinet-row-card,
  .cabinet-hub-row {
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
  }
  .cabinet-row-card:hover,
  .cabinet-hub-row:hover {
    transform: translateY(-2px);
  }
}

/* --- Same-tab re-render (drawer/modal toggle, theme switch, refresh):
   skip card-entry stagger so the user doesn't see main content "re-arrive".
   Drawer/modal/toast/notification animations still play normally. --- */
body.no-entry-anim .app-screen main.desktop-content > *,
body.no-entry-anim .cabinet-hub-card .cabinet-hub-row,
body.no-entry-anim .cabinet-tariff-card {
  animation: none !important;
}

/* --- Reduced motion: disable everything above --- */
@media (prefers-reduced-motion: reduce) {
  .app-screen main.desktop-content > *,
  .cabinet-hub-card .cabinet-hub-row,
  .cabinet-tariff-card,
  .drawer:not(.hidden),
  .drawer:not(.hidden) .drawer-panel,
  .drawer:not(.hidden) .menu-link,
  .modal:not(.hidden),
  .modal:not(.hidden) .modal-card,
  .modal-card .client-link,
  .notification-sheet:not(.hidden),
  .notification-sheet:not(.hidden) .notification-panel,
  .notification-panel .notification-item,
  .busy-overlay:not(.hidden),
  .busy-overlay:not(.hidden) .busy-card,
  .toast,
  .cabinet-status-hero.tone-positive::before,
  .icon-btn.is-spinning .ui-icon {
    animation: none !important;
  }
}

/* === Frosted glass surfaces over animated particles === */
:root {
  --glass-card-bg: rgba(255, 255, 255, .34);
  --glass-card-bg-2: rgba(255, 255, 255, .18);
  --glass-card-inner: rgba(255, 255, 255, .18);
  --glass-card-inner-2: rgba(255, 255, 255, .085);
  --glass-card-border: rgba(255, 255, 255, .46);
  --glass-card-border-accent: rgba(146, 106, 235, .30);
  /* Shadow blur trimmed from 74px → 36px. The bigger value made cards look
     floaty but ate paint time on low-tier GPUs (large blurs on a constantly
     re-rastered card are surprisingly expensive when the layer is composited
     above an animated canvas). 36px still looks frosted. */
  --glass-card-shadow: 0 18px 36px rgba(78, 46, 128, .18), inset 0 1px 0 rgba(255, 255, 255, .36);
  /* 10px is the perf sweet spot — visually indistinguishable from 14px through
     the moving particle layer, but ~30% cheaper on weak GPUs since the blur
     kernel scales superlinearly with radius. */
  --glass-card-blur: 10px;
  --glass-card-saturate: 1.65;
}
body.theme-dark,
body[data-theme="dark"],
:root[data-theme="dark"] {
  --glass-card-bg: rgba(20, 13, 40, .24);
  --glass-card-bg-2: rgba(9, 6, 20, .13);
  --glass-card-inner: rgba(255, 255, 255, .048);
  --glass-card-inner-2: rgba(255, 255, 255, .020);
  --glass-card-border: rgba(255, 255, 255, .14);
  --glass-card-border-accent: rgba(174, 132, 255, .34);
  --glass-card-shadow: 0 18px 38px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .09);
}

#bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
}

#loader-root,
#cabinet-root,
#admin-root,
.app-shell,
.site-shell,
.legal-shell {
  position: relative;
  z-index: 1;
}

.loader-card,
.card,
section.card,
article.card,
.panel,
.modal-card,
.drawer-panel,
.ticket-thread,
.notification-panel,
.admin-shell,
.legal-card,
.payment-card,
.busy-card,
.bottom-nav,
body.cabinet-body .card,
body.cabinet-body section.card,
body.cabinet-body .cabinet-row-card,
body.cabinet-body .cabinet-promo-card,
body.cabinet-body .cabinet-hub-card,
body.cabinet-body .cabinet-tariff-card,
body.cabinet-body.theme-dark .card,
body.cabinet-body[data-theme="dark"] .card,
body.cabinet-body.theme-dark section.card,
body.cabinet-body[data-theme="dark"] section.card,
body.cabinet-body.theme-dark .cabinet-row-card,
body.cabinet-body[data-theme="dark"] .cabinet-row-card,
body.cabinet-body.theme-dark .cabinet-promo-card,
body.cabinet-body[data-theme="dark"] .cabinet-promo-card,
body.cabinet-body.theme-dark .cabinet-hub-card,
body.cabinet-body[data-theme="dark"] .cabinet-hub-card,
body.cabinet-body.theme-dark .cabinet-tariff-card,
body.cabinet-body[data-theme="dark"] .cabinet-tariff-card {
  z-index: 1;
  background: linear-gradient(180deg, var(--glass-card-bg), var(--glass-card-bg-2)) !important;
  background-color: var(--glass-card-bg) !important;
  border-color: var(--glass-card-border-accent) !important;
  box-shadow: var(--glass-card-shadow) !important;
  backdrop-filter: blur(var(--glass-card-blur)) saturate(var(--glass-card-saturate));
  -webkit-backdrop-filter: blur(var(--glass-card-blur)) saturate(var(--glass-card-saturate));
}

.list-card,
.ticket-card,
.metric-card,
.client-link,
.cabinet-hub-row,
.cabinet-status-hero,
.cabinet-account-card,
.cabinet-skeleton-section,
.cabinet-skeleton-hero-panel,
.admin-context-card,
.admin-section-card,
.subscription-raw-box,
.subscription-import-main,
.subscription-import-qr-card,
.payment-summary-card,
.auth-field .input,
.input,
.select,
.textarea {
  background: linear-gradient(180deg, var(--glass-card-inner), var(--glass-card-inner-2)) !important;
  border-color: var(--glass-card-border-accent) !important;
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

.site-kpi-grid-accent .site-kpi-card,
body.cabinet-body .hero-card,
body.cabinet-body.theme-dark .hero-card,
body.cabinet-body[data-theme="dark"] .hero-card {
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, .22), transparent 32%),
    linear-gradient(180deg, rgba(139, 61, 255, .22), rgba(139, 61, 255, .075)) !important;
  border-color: rgba(139, 61, 255, .30) !important;
}
body.theme-dark .site-kpi-grid-accent .site-kpi-card,
body[data-theme="dark"] .site-kpi-grid-accent .site-kpi-card,
body.cabinet-body.theme-dark .hero-card,
body.cabinet-body[data-theme="dark"] .hero-card {
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, .10), transparent 34%),
    linear-gradient(180deg, rgba(152, 62, 255, .18), rgba(18, 13, 34, .20)) !important;
}


/* Keep sticky sidebars/search panels sticky: the generic .card glass rule must not
   downgrade them to position:relative. */
@media (min-width: 1080px) {
  .desktop-sidebar.card {
    position: sticky !important;
    top: calc(var(--header-h) + 18px);
    max-height: calc(100vh - var(--header-h) - 54px);
    overflow: auto;
  }
}
@media (min-width: 961px) {
  .admin-search-card.card {
    position: sticky !important;
    top: calc(max(12px, env(safe-area-inset-top)) + 82px);
  }
}

/* Hero/stat cards were still too opaque; keep the accent mood, but let the
   particle field visibly pass through them. */
.site-kpi-grid-accent .site-kpi-card,
body.cabinet-body .hero-card,
body.cabinet-body.theme-dark .hero-card,
body.cabinet-body[data-theme="dark"] .hero-card {
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, .10), transparent 34%),
    linear-gradient(180deg, rgba(139, 61, 255, .16), rgba(18, 13, 34, .10)) !important;
  backdrop-filter: blur(8px) saturate(1.7);
  -webkit-backdrop-filter: blur(8px) saturate(1.7);
}
body.theme-dark .site-kpi-grid-accent .site-kpi-card,
body[data-theme="dark"] .site-kpi-grid-accent .site-kpi-card,
body.cabinet-body.theme-dark .hero-card,
body.cabinet-body[data-theme="dark"] .hero-card {
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, .075), transparent 34%),
    linear-gradient(180deg, rgba(152, 62, 255, .13), rgba(8, 5, 18, .075)) !important;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .loader-card,
  .card,
  .panel,
  .modal-card,
  .drawer-panel,
  .ticket-thread,
  .notification-panel,
  .admin-shell,
  .legal-card,
  .payment-card,
  .busy-card,
  .bottom-nav {
    background: var(--panel) !important;
  }
}

/* === Perf-tier escape hatches ===
   bg_particles.js sets body.bg-perf-low / body.bg-perf-mid based on device
   tier and live FPS. backdrop-filter is the single most expensive thing on
   the page when stacked over an animated canvas, so we strip it completely
   on potato-tier devices. Cards stay readable via opaque-leaning gradients. */
body.bg-perf-mid .card,
body.bg-perf-mid section.card,
body.bg-perf-mid .panel,
body.bg-perf-mid .hero-card,
body.bg-perf-mid .modal-card,
body.bg-perf-mid .drawer-panel,
body.bg-perf-mid .notification-panel,
body.bg-perf-mid .bottom-nav {
  /* Halve the blur radius further: ~0.6× the GPU cost for each step down. */
  backdrop-filter: blur(6px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(6px) saturate(1.3) !important;
}

body.bg-perf-low .card,
body.bg-perf-low section.card,
body.bg-perf-low .panel,
body.bg-perf-low .hero-card,
body.bg-perf-low .modal-card,
body.bg-perf-low .drawer-panel,
body.bg-perf-low .notification-panel,
body.bg-perf-low .ticket-thread,
body.bg-perf-low .legal-card,
body.bg-perf-low .payment-card,
body.bg-perf-low .busy-card,
body.bg-perf-low .bottom-nav,
body.bg-perf-low .list-card,
body.bg-perf-low .ticket-card,
body.bg-perf-low .metric-card,
body.bg-perf-low .client-link,
body.bg-perf-low .input,
body.bg-perf-low .select,
body.bg-perf-low .textarea,
body.bg-perf-low .cabinet-row-card,
body.bg-perf-low .cabinet-promo-card,
body.bg-perf-low .cabinet-hub-card,
body.bg-perf-low .cabinet-tariff-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* On low-tier we also bump card backgrounds to opaque-ish so removing the
   blur doesn't expose the moving particles through near-transparent cards. */
body.bg-perf-low {
  --glass-card-bg: rgba(255, 255, 255, .82);
  --glass-card-bg-2: rgba(255, 255, 255, .62);
  --glass-card-inner: rgba(255, 255, 255, .60);
  --glass-card-inner-2: rgba(255, 255, 255, .42);
}
body.bg-perf-low.theme-dark,
body.bg-perf-low[data-theme="dark"] {
  --glass-card-bg: rgba(20, 13, 40, .82);
  --glass-card-bg-2: rgba(9, 6, 20, .68);
  --glass-card-inner: rgba(28, 20, 52, .58);
  --glass-card-inner-2: rgba(14, 10, 28, .42);
}
/* Trim the heaviest shadow too — large blur radii on shadows are nearly as
   expensive as backdrop-filter on the same content. */
body.bg-perf-low {
  --glass-card-shadow: 0 10px 18px rgba(78, 46, 128, .14), inset 0 1px 0 rgba(255, 255, 255, .28);
}
body.bg-perf-low.theme-dark,
body.bg-perf-low[data-theme="dark"] {
  --glass-card-shadow: 0 10px 18px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .07);
}

/* === Stable ambient glow layer ===
   The old page background used percentage radial-gradients on body. On cabinet
   tab switches the document height / scrollbar state can change, so those
   gradients were recalculated and the big glow looked like it jumped. Keep the
   ambient glow fixed to the viewport; animated particles stay on the canvas. */
html,
body {
  background-color: #f0e7fb;
}
html[data-theme="dark"],
html.theme-dark,
body.theme-dark,
body[data-theme="dark"] {
  background-color: #08050f;
}
body {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8f4fd 0%, #f0e7fb 100%) !important;
  background-attachment: fixed !important;
}
body.theme-dark,
body[data-theme="dark"],
html[data-theme="dark"] body {
  background: linear-gradient(180deg, #08050f 0%, #0e091d 100%) !important;
  background-attachment: fixed !important;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(820px 560px at 8vw -8vh, rgba(176, 139, 255, .22), rgba(176, 139, 255, .085) 34%, transparent 68%),
    radial-gradient(760px 520px at 88vw -4vh, rgba(255, 219, 186, .20), rgba(255, 219, 186, .070) 36%, transparent 70%),
    radial-gradient(680px 520px at 74vw 108vh, rgba(139, 61, 255, .12), transparent 72%);
  transform: translateZ(0);
}
body.theme-dark::before,
body[data-theme="dark"]::before,
html[data-theme="dark"] body::before {
  background:
    radial-gradient(900px 620px at 7vw -9vh, rgba(117, 69, 255, .25), rgba(117, 69, 255, .095) 35%, transparent 70%),
    radial-gradient(760px 600px at 91vw -7vh, rgba(152, 62, 255, .145), rgba(152, 62, 255, .045) 36%, transparent 72%),
    radial-gradient(720px 580px at 72vw 108vh, rgba(63, 23, 131, .16), transparent 72%);
}

/* Kill the pre-glass status pulse. With transparent cards it looked like an old
   local glow sliding under the layout during tab switches. */
.cabinet-status-hero.tone-positive::before {
  display: none !important;
  animation: none !important;
  box-shadow: none !important;
}

/* Compact import clients inside subscription/import cards */
.client-links.import-client-links {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}
.client-links.import-client-links .client-link {
  min-height: 46px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -.01em;
}
.client-links.import-client-links .client-link > span:first-child {
  white-space: nowrap;
}
.client-links.import-client-links .client-link-chevron {
  opacity: .82;
  font-size: 18px;
  line-height: 1;
}
.client-links.import-client-links .client-link.recommended {
  border-color: rgba(182, 132, 255, .90);
  background: linear-gradient(180deg, rgba(139, 61, 255, .16), rgba(255,255,255,.035));
  box-shadow:
    0 0 0 1px rgba(182, 132, 255, .18),
    0 0 20px rgba(139, 61, 255, .36),
    inset 0 0 18px rgba(139, 61, 255, .10);
}
.client-links.import-client-links .client-link.recommended:hover {
  box-shadow:
    0 0 0 1px rgba(205, 170, 255, .24),
    0 0 26px rgba(139, 61, 255, .46),
    inset 0 0 20px rgba(139, 61, 255, .14);
}
@media (max-width: 380px) {
  .client-links.import-client-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Compact VLESS profile settings */
.vless-compact-card {
  padding: 12px;
}
.vless-compact-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.vless-compact-title {
  font-weight: 900;
  font-size: 14px;
  line-height: 1.2;
}
.vless-compact-desc {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
}
.vless-compact-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(106px, 1fr));
  gap: 8px;
  align-items: end;
}
.vless-compact-grid-simple {
  grid-template-columns: minmax(130px, 220px) minmax(0, 1fr);
}
.vless-compact-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.vless-compact-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
}
.vless-compact-field .select {
  min-height: 40px;
  height: 40px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
}
.vless-profile-pick .amount-chip-row {
  gap: 6px;
  flex-wrap: wrap;
}
.vless-profile-pick .chip-btn {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 13px;
}
.vless-compact-summary,
.vless-selected-card {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(139,61,255,.18);
  background: rgba(255,255,255,.035);
  font-size: 12px;
  line-height: 1.35;
}
.vless-selected-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
}
.vless-selected-card > div {
  color: var(--text);
  font-weight: 850;
}
.vless-compact-actions {
  margin-top: 10px;
  gap: 8px;
}
.vless-compact-actions .primary-btn,
.vless-compact-actions .ghost-btn {
  min-height: 42px;
  padding: 0 12px;
}
@media (max-width: 840px) {
  .vless-compact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .vless-compact-grid-simple {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 430px) {
  .vless-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vless-compact-actions .primary-btn,
  .vless-compact-actions .ghost-btn {
    flex: 1 1 132px;
  }
}

/* Dark native dropdowns: keep compact VLESS selects readable when opened. */
select.select {
  color-scheme: dark;
  background: linear-gradient(180deg, rgba(35, 25, 58, .98), rgba(24, 17, 42, .98)) !important;
  color: var(--text) !important;
  caret-color: var(--text);
}
select.select:focus,
select.select:focus-visible {
  outline: none;
  border-color: rgba(174, 92, 255, .72) !important;
  box-shadow: 0 0 0 3px rgba(139, 61, 255, .18), 0 0 24px rgba(139, 61, 255, .16);
}
select.select option,
select.select optgroup {
  background-color: #1b1230;
  color: #f4eeff;
}
select.select option:checked {
  background-color: #8b3dff;
  color: #ffffff;
}
select.select option:disabled {
  color: rgba(244, 238, 255, .45);
}

/* Styled page scrollbar */
html,
body {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 61, 255, .58) rgba(139, 61, 255, .10);
}
html[data-theme="dark"],
body.theme-dark,
body[data-theme="dark"] {
  scrollbar-color: rgba(152, 62, 255, .78) rgba(255, 255, 255, .055);
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, rgba(139, 61, 255, .055), rgba(139, 61, 255, .12));
  border-radius: 999px;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  min-height: 54px;
  border-radius: 999px;
  border: 3px solid rgba(12, 7, 25, .88);
  background:
    linear-gradient(180deg, rgba(190, 136, 255, .98), rgba(139, 61, 255, .92) 48%, rgba(99, 42, 214, .94));
  box-shadow:
    0 0 0 1px rgba(213, 184, 255, .22),
    0 0 18px rgba(139, 61, 255, .40);
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(213, 184, 255, 1), rgba(157, 74, 255, .98) 48%, rgba(113, 41, 232, .98));
  box-shadow:
    0 0 0 1px rgba(235, 221, 255, .30),
    0 0 24px rgba(152, 62, 255, .54);
}
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner {
  background: transparent;
}


/* Cabinet instructions / referrals polish */
.instructions-hero-card,
.referral-hero-card {
  overflow: hidden;
  position: relative;
}
.instructions-hero-card::after,
.referral-hero-card::after,
.instruction-client-card::after,
.referral-share-card::after {
  content: "";
  position: absolute;
  inset: auto -28% -48% auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(52,211,140,.18), transparent 68%);
  pointer-events: none;
}
.instruction-hero-top,
.referral-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.instruction-hero-icon,
.referral-hero-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  color: var(--success);
  background: rgba(52,211,140,.12);
  border: 1px solid rgba(52,211,140,.20);
  box-shadow: 0 0 28px rgba(52,211,140,.16);
}
.instruction-platform-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 4px;
  scrollbar-width: none;
}
.instruction-platform-scroll::-webkit-scrollbar { display: none; }
.instruction-platform-tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 800;
  letter-spacing: -.01em;
  transition: transform .15s ease, border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
}
.instruction-platform-tab.active {
  color: #fff;
  border-color: rgba(52,211,140,.45);
  background: linear-gradient(135deg, rgba(52,211,140,.96), rgba(31,181,120,.92));
  box-shadow: 0 10px 28px rgba(52,211,140,.20);
}
.instruction-platform-tab:active { transform: scale(.97); }
.instruction-client-card,
.instruction-subscribe-card,
.instruction-steps-card,
.referral-share-card,
.referral-how-card,
.referral-activation-card,
.referral-invited-card {
  position: relative;
  overflow: hidden;
}
.instruction-client-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.instruction-app-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  color: #fff;
  background: linear-gradient(135deg, rgba(52,211,140,.98), rgba(15,179,122,.88));
  box-shadow: 0 16px 44px rgba(52,211,140,.22), inset 0 1px 0 rgba(255,255,255,.28);
  font-size: 21px;
  font-weight: 950;
  letter-spacing: -.04em;
}
.instruction-client-name {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -.04em;
}
.instruction-platform-name {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.instruction-client-badge { white-space: nowrap; }
.instruction-client-subtitle {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.55;
}
.instruction-download-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}
.instruction-download-main,
.instruction-download-secondary {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}
.instruction-download-main {
  gap: 10px;
  font-weight: 900;
}
.instruction-btn-mark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.18);
  font-weight: 950;
}
.instruction-install-card {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(52,211,140,.20);
  background: linear-gradient(135deg, rgba(52,211,140,.13), rgba(139,61,255,.08));
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.instruction-install-card strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
}
.instruction-install-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.instruction-install-plus {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, rgba(52,211,140,.96), rgba(25,177,119,.92));
  box-shadow: 0 12px 32px rgba(52,211,140,.20);
  font-size: 26px;
  font-weight: 700;
}
.instruction-sub-actions,
.referral-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.referral-action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.instruction-section-kicker {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .10em;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 14px;
}
.instruction-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.instruction-step-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.instruction-step-num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--success);
  background: rgba(52,211,140,.12);
  border: 1px solid rgba(52,211,140,.20);
  font-weight: 950;
}
.instruction-step-title {
  font-weight: 900;
  line-height: 1.25;
}
.instruction-step-text {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.referral-summary-grid {
  margin-top: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.copy-box {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(52,211,140,.18);
  background: linear-gradient(135deg, rgba(52,211,140,.08), rgba(139,61,255,.05));
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform .12s ease, border-color .12s ease, box-shadow .15s ease, background .15s ease;
}
.copy-box:hover {
  border-color: rgba(52,211,140,.42);
  box-shadow: 0 10px 26px rgba(52,211,140,.10);
}
.copy-box:active {
  transform: scale(.985);
}
.copy-box-content {
  flex: 1;
  min-width: 0;
}
.copy-box-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.copy-box-value {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.copy-box-value-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: .04em;
}
.copy-box-icon {
  flex-shrink: 0;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(52,211,140,.12);
  color: var(--accent, #34d38c);
}
.copy-box-icon .ui-icon { width: 18px; height: 18px; }
.copy-box-icon-default,
.copy-box-icon-done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .18s ease, transform .18s ease;
}
.copy-box-icon-done {
  opacity: 0;
  transform: scale(.6);
}
.copy-box.is-copied .copy-box-icon {
  background: rgba(52,211,140,.28);
}
.copy-box.is-copied .copy-box-icon-default {
  opacity: 0;
  transform: scale(.6);
}
.copy-box.is-copied .copy-box-icon-done {
  opacity: 1;
  transform: scale(1);
}
.copy-box.is-copied {
  border-color: rgba(52,211,140,.55);
  background: linear-gradient(135deg, rgba(52,211,140,.18), rgba(52,211,140,.08));
}
.referral-hero-icon .ui-icon,
.instruction-hero-icon .ui-icon { width: 26px; height: 26px; }
.referral-link-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(52,211,140,.16);
  background: linear-gradient(135deg, rgba(52,211,140,.09), rgba(139,61,255,.06));
}
.referral-link-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.referral-link-value {
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.referral-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.referral-mini-card {
  padding: 14px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.referral-mini-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.referral-mini-card strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.referral-how-grid { margin-top: 12px; }
.referral-how-item {
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.referral-how-item:hover {
  transform: translateY(-1px);
  border-color: rgba(52,211,140,.22);
  box-shadow: 0 12px 34px rgba(52,211,140,.08);
}
.referral-code-input { min-height: 48px; }
.referral-history-item {
  border-color: rgba(52,211,140,.12);
}
@media (max-width: 640px) {
  .instruction-client-head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .instruction-client-badge {
    grid-column: 1 / -1;
    width: max-content;
  }
  .instruction-sub-actions,
  .referral-action-grid,
  .referral-code-grid {
    grid-template-columns: 1fr;
  }
  .referral-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .copy-box {
    padding: 12px 14px;
    gap: 10px;
  }
  .copy-box-icon { width: 32px; height: 32px; border-radius: 10px; }
  .copy-box-value { font-size: 12px; }
}


/* Cabinet instructions / info v3: purple accents + subsection transitions */
.instruction-screen {
  display: contents;
}
.instruction-platform-panel {
  display: grid;
  gap: 14px;
  animation: instruction-panel-swap .36s cubic-bezier(.2,.78,.28,1) both;
  transform-origin: 50% 10%;
}
.instruction-platform-panel > .card {
  animation: instruction-card-pop .42s cubic-bezier(.2,.78,.28,1) both;
}
.instruction-platform-panel > .card:nth-child(1) { animation-delay: .02s; }
.instruction-platform-panel > .card:nth-child(2) { animation-delay: .06s; }
.instruction-platform-panel > .card:nth-child(3) { animation-delay: .10s; }
@keyframes instruction-panel-swap {
  0% { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(10px); }
  62% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes instruction-card-pop {
  0% { opacity: 0; transform: translateY(12px) scale(.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.instruction-platform-tab.active {
  color: #fff;
  border-color: rgba(139,61,255,.58);
  background: linear-gradient(135deg, rgba(152,62,255,.98), rgba(101,39,211,.94));
  box-shadow: 0 12px 34px rgba(139,61,255,.28), 0 0 24px rgba(139,61,255,.18);
}
.instruction-platform-tab.active::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 14px rgba(255,255,255,.85);
}
.instruction-hero-icon,
.referral-hero-icon,
.info-hero-icon {
  color: var(--accent);
  background: rgba(139,61,255,.14);
  border-color: rgba(139,61,255,.28);
  box-shadow: 0 0 34px rgba(139,61,255,.24), inset 0 1px 0 rgba(255,255,255,.10);
}
.instruction-app-icon,
.instruction-install-plus {
  background: linear-gradient(135deg, rgba(152,62,255,.98), rgba(101,39,211,.92));
  box-shadow: 0 16px 44px rgba(139,61,255,.30), 0 0 30px rgba(139,61,255,.18), inset 0 1px 0 rgba(255,255,255,.26);
}
.instruction-install-card {
  border-color: rgba(139,61,255,.22);
  background: linear-gradient(135deg, rgba(139,61,255,.14), rgba(139,61,255,.06));
}
.instruction-step-num,
.info-list-num {
  color: var(--accent);
  background: rgba(139,61,255,.13);
  border-color: rgba(139,61,255,.26);
  box-shadow: 0 0 20px rgba(139,61,255,.14);
}
.referral-link-box {
  border-color: rgba(139,61,255,.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(139,61,255,.18), transparent 54%),
    linear-gradient(135deg, rgba(139,61,255,.11), rgba(139,61,255,.05));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 0 34px rgba(139,61,255,.10);
}
.referral-how-item:hover {
  border-color: rgba(139,61,255,.26);
  box-shadow: 0 12px 34px rgba(139,61,255,.10);
}
.referral-history-item {
  border-color: rgba(139,61,255,.14);
}

/* Information section polish */
.info-hero-card,
.info-main-card,
.info-actions-card {
  position: relative;
  overflow: hidden;
}
.info-hero-card::after,
.info-main-card::after {
  content: "";
  position: absolute;
  inset: auto -24% -48% auto;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(139,61,255,.18), transparent 68%);
  pointer-events: none;
}
.info-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.info-hero-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
}
.info-hero-icon .ui-icon { width: 26px; height: 26px; }
.info-summary-grid {
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.info-route-value {
  font-size: 18px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.info-tabs-polished {
  margin-top: 14px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.info-tabs-polished::-webkit-scrollbar { display: none; }
.info-tabs-polished .tab-btn {
  flex: 1 0 auto;
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-weight: 900;
}
.info-tabs-polished .tab-btn.active {
  color: #fff;
  border-color: rgba(139,61,255,.50);
  background: linear-gradient(135deg, rgba(152,62,255,.98), rgba(101,39,211,.92));
  box-shadow: 0 10px 28px rgba(139,61,255,.22);
}
.info-tab-panel-frame {
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.info-content-panel {
  display: grid;
  gap: 10px;
  animation: info-panel-swap .34s cubic-bezier(.2,.78,.28,1) both;
}
@keyframes info-panel-swap {
  0% { opacity: 0; transform: translateY(12px); filter: blur(8px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.info-faq-card,
.info-list-card,
.info-status-card,
.info-action-card {
  border: 1px solid var(--line);
  background: var(--panel-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.info-faq-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 20px;
}
.info-faq-card strong,
.info-list-card strong {
  display: block;
  font-weight: 950;
  line-height: 1.25;
}
.info-faq-card span,
.info-list-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.info-faq-card b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(139,61,255,.12);
  box-shadow: 0 0 18px rgba(139,61,255,.12);
}
.info-list-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
}
.info-list-num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 950;
}
.info-list-num .ui-icon {
  width: 18px;
  height: 18px;
}
.info-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.info-status-card {
  padding: 14px;
  border-radius: 20px;
  min-width: 0;
}
.info-status-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.info-status-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 950;
  overflow-wrap: anywhere;
}
.info-status-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.info-list-card-wide {
  margin-top: 2px;
}
.info-actions-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.info-action-card {
  width: 100%;
  padding: 13px;
  border-radius: 20px;
  color: var(--text);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.info-action-card:active {
  transform: scale(.99);
}
.info-action-card:hover {
  border-color: rgba(139,61,255,.24);
  box-shadow: 0 12px 34px rgba(139,61,255,.09);
}
.info-action-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--accent);
  background: rgba(139,61,255,.12);
  box-shadow: 0 0 20px rgba(139,61,255,.12);
}
.info-action-icon .ui-icon {
  width: 21px;
  height: 21px;
}
.info-action-body strong {
  display: block;
  font-weight: 950;
}
.info-action-body small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}
.info-action-tail {
  color: var(--muted);
  font-weight: 950;
}
@media (max-width: 640px) {
  .info-summary-grid,
  .info-status-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .instruction-platform-panel,
  .instruction-platform-panel > .card,
  .info-content-panel {
    animation: none !important;
  }
}

/* Perf-low: kill the blur-based entry swap on instructions/info subtabs.
   instruction-panel-swap (filter: blur 10px) and info-panel-swap (blur 8px)
   force a GPU pass per animated frame, and over the bg-particles canvas that
   compounds with the canvas repaint — same reason backdrop-filter is stripped
   on bg-perf-low. instruction-card-pop is opacity/translate only, so it stays. */
body.bg-perf-low .instruction-platform-panel,
body.bg-perf-low .info-content-panel {
  animation: none !important;
}

.instruction-platform-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.instruction-platform-tab.active::after {
  display: inline-block;
  flex: 0 0 auto;
}

/* --- Locked Fastest+Fixed group: blurred preview + offer overlay ---
   Switches stay rendered underneath so users can see the shape of what
   they're buying. Hover (desktop) or tap on the overlay (mobile, via
   .is-revealed) clears the blur and exposes the disabled rows. The buy
   button always sits inside the overlay so the offer is one tap away. */
.switch-locked-group {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
}
.switch-locked-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  filter: blur(6px);
  transition: filter .22s ease;
  pointer-events: none;
  user-select: none;
}
.switch-locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 13, 40, .58), rgba(20, 13, 40, .72));
  border: 1px solid rgba(255, 178, 36, .35);
  cursor: pointer;
  transition: opacity .22s ease, backdrop-filter .22s ease;
  backdrop-filter: blur(2px) saturate(1.2);
  -webkit-backdrop-filter: blur(2px) saturate(1.2);
  z-index: 1;
}
body[data-theme="light"] .switch-locked-overlay,
body.theme-light .switch-locked-overlay {
  background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .82));
  color: var(--text);
}
.switch-locked-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.switch-locked-desc {
  font-size: 13px;
  opacity: .82;
  max-width: 340px;
  line-height: 1.4;
}
.switch-locked-cta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.switch-locked-peek { font-size: 12px; padding: 6px 12px; }
/* Reveal happens only when the group has .is-revealed (added by clicking
   "Посмотреть" or the empty area of the overlay). A JS mouseleave handler
   strips the class when the cursor leaves the group, so peek is intentional.
   On reveal the whole overlay (incl. the buy button) fades out — to buy,
   click the button while it's still visible in the default blurred state. */
.switch-locked-group.is-revealed .switch-locked-stack { filter: blur(0); }
.switch-locked-group.is-revealed .switch-locked-overlay {
  opacity: 0;
  transition: opacity .18s ease;
}
/* Overlay stays clickable when revealed so a second tap (mobile) re-blurs.
   The invisible buy button MUST be inert — otherwise users tap-toggling
   would accidentally trigger the purchase confirm. */
.switch-locked-group.is-revealed .switch-locked-overlay [data-action="shop-purchase"],
.switch-locked-group.is-revealed .switch-locked-peek {
  pointer-events: none;
}

/* Imperative confirm/info dialog (window.confirm replacement). Reuses
   .modal positioning so it sits on top of any other open modal. The card
   is intentionally narrow — confirms hold a few rows of text plus two
   action buttons. */
.confirm-modal { z-index: 60; }
.confirm-modal-card {
  width: min(100%, 420px);
  max-height: min(82vh, 600px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.confirm-modal-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.confirm-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
}
.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.confirm-modal-actions .ghost-btn,
.confirm-modal-actions .primary-btn { min-height: 40px; }
.primary-btn.is-danger {
  background: linear-gradient(180deg, #ff5d5d, #c93c3c) !important;
  border-color: rgba(201, 60, 60, .55) !important;
}
.confirm-purchase-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.confirm-purchase-row strong { font-weight: 800; }
.confirm-purchase-hint { opacity: .8; }
.confirm-purchase-shortfall {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(127, 127, 127, .3);
}
.confirm-purchase-shortfall strong { color: #c93c3c; }
body[data-theme="dark"] .confirm-purchase-shortfall strong,
body.theme-dark .confirm-purchase-shortfall strong { color: #ff8b8b; }

/* --- Pool country list (subscription bundle whitelist) ---
   Replaces the old inline-styled scroll box. Includes locked premium rows
   that masquerade as checkbox rows but actually open the geo_premium offer. */
.pool-country-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 12px;
  background: var(--panel-2);
  color: var(--text);
}
.pool-country-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 0;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  font: inherit;
}
.pool-country-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #7c5cff;
}
.pool-country-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pool-country-row.is-locked {
  opacity: .82;
  transition: opacity .15s ease, background-color .15s ease;
}
.pool-country-row.is-locked:hover {
  opacity: 1;
  background: rgba(255, 178, 36, .08);
}
.pool-country-lock {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.pool-country-cta {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 178, 36, .18);
  color: #c98a00;
  flex-shrink: 0;
}
body[data-theme="dark"] .pool-country-cta,
body.theme-dark .pool-country-cta {
  background: rgba(255, 178, 36, .14);
  color: #ffce6a;
}

/* --- Modal / notification / drawer panels: keep them opaque on
   the cabinet's busy background, and switch from "outer scroll" to
   "head fixed + inner list scrolls". The default cabinet-body rule
   at the top of the file pulls glass-card-bg (.24/.34) into these
   panels, which made text float over the wallpaper — override here
   so the surfaces sit on solid var(--panel). --- */
body.cabinet-body .modal-card,
body.cabinet-body .notification-panel,
body.cabinet-body .drawer-panel {
  background: var(--panel) !important;
  background-image: none !important;
  background-color: var(--panel) !important;
}

/* Country modal & notifications panel: head + (optional inline-note /
   actions row) + a single scrolling list. Drawer follows the same
   contract for menu links. */
.country-modal-card,
.notification-panel,
.drawer-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.country-modal-head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-shrink: 0;
}
/* The single scrollable region inside each panel. Anything else inside
   the panel (head, actions row, inline-note) stays at natural height. */
.country-modal-list,
.notification-panel .notification-list,
.drawer-panel .menu-links {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
}
.notification-panel .toolbar-row,
.notification-panel .actions-row,
.drawer-panel .toolbar-row {
  flex-shrink: 0;
}
