: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"] {
  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"] {
  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); }

.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; padding: 0; border-radius: 14px; }
.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 {
  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));
}
.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: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2ef2cf, #0cc0eb 65%, #2186ff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34);
}
.mw-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: linear-gradient(135deg, #11152b, #1d2d62 52%, #2ef2cf);
  color: #fff;
  font-weight: 900;
  letter-spacing: -.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(8, 8, 19, .32);
}
.mw-badge span:first-child { transform: translateX(1px); }
.mw-badge span:last-child { color: #b8fff1; }
.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; }
.card-title { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.card-subtitle { color: var(--muted); font-size: 13px; line-height: 1.52; }
.hero-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,.70)),
    linear-gradient(135deg, rgba(213,195,255,.34), rgba(255,237,216,.36));
}
body.theme-dark .hero-card,
body[data-theme="dark"] .hero-card {
  background:
    linear-gradient(180deg, rgba(25,18,48,.94), rgba(19,13,39,.96)),
    linear-gradient(135deg, rgba(106,67,200,.25), rgba(38,24,71,.40));
}
.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: 14px;
  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;
}
.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;
}
.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;
}
.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;
}
.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; }
.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: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  border-radius: 22px;
  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;
  }
  .desktop-content {
    width: 100%;
  }
  .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));
  }
}
.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 56px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-btn.active { color: var(--accent); background: var(--accent-soft); }
.nav-icon { font-size: 18px; }
.nav-label { font-size: 11px; font-weight: 700; }

@media (max-width: 520px) {
  .header-card {
    gap: 8px;
    padding: 10px 12px;
  }
  .brand-row {
    gap: 8px;
  }
  .brand-badge {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }
  .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;
  gap: 8px;
  z-index: 60;
}
.toast {
  min-width: 220px;
  max-width: min(92vw, 420px);
  padding: 12px 14px;
  border-radius: 14px;
  color: #fff;
  background: rgba(52,36,77,.94);
  box-shadow: var(--shadow);
}
.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,
.payment-summary-card {
  min-height: 88px;
  padding: 16px;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.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(243,217,162,.14);
  border-color: rgba(243,217,162,.22);
}
.amount-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.payment-method-card {
  width: 100%;
  text-align: left;
  color: var(--text);
}
.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,
  .payment-method-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;
}
.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: 4;
}
.admin-users-card {
  padding: 12px;
}
.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;
  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;
}
.admin-user-sections {
  scroll-behavior: smooth;
}
.admin-section-card {
  scroll-margin-top: 92px;
}
@media (max-width: 960px) {
  .admin-user-sections {
    margin-top: 14px;
  }
  .admin-user-sections .admin-section-card {
    display: none;
  }
  .admin-user-sections .admin-section-card.active {
    display: block;
  }
}

.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;
}
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.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;
}
.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: 18px 20px;
}
.auth-shell {
  max-width: 620px;
}
.auth-card {
  padding: 22px;
}
.auth-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.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;
}
.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 {
  width: min(100%, 260px);
  height: auto;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.qr-preview-empty {
  color: var(--muted);
}
@media (max-width: 900px) {
  .subscription-import-grid {
    grid-template-columns: 1fr;
  }
}
