:root {
  --bg: #050508;
  --bg-card: rgba(16, 16, 24, 0.72);
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --accent: #eef0ff;
  --accent-glow: #818cf8;
  --accent-2: #a5b4fc;
  --accent-days: #c4b5fd;
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #6366f1 100%);
  --gradient-days: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  --text: #f4f4f5;
  --muted: #71717a;
  --success: #34d399;
  --danger: #f87171;
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(129, 140, 248, 0.35);
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --glass: blur(16px) saturate(140%);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    calc(72px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
  position: relative;
  overflow-x: hidden;
}

/* ── Плавающий фон ── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}

.orb-a {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.55) 0%, transparent 70%);
  animation: drift-a 22s ease-in-out infinite;
}

.orb-b {
  width: 220px;
  height: 220px;
  bottom: 15%;
  left: -70px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.45) 0%, transparent 70%);
  animation: drift-b 26s ease-in-out infinite;
}

.orb-c {
  width: 180px;
  height: 180px;
  top: 42%;
  right: -40px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.3) 0%, transparent 70%);
  animation: drift-c 18s ease-in-out infinite;
}

.orb-d {
  width: 140px;
  height: 140px;
  top: 18%;
  left: 20%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.25) 0%, transparent 70%);
  animation: drift-d 20s ease-in-out infinite;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 40px) scale(1.08); }
  66% { transform: translate(20px, 20px) scale(0.95); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -35px) scale(1.1); }
}

@keyframes drift-c {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-25px, 30px); }
}

@keyframes drift-d {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(15px, -20px) scale(1.15); }
}

@keyframes float-card {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(129, 140, 248, 0.15); }
  50% { box-shadow: 0 0 32px rgba(129, 140, 248, 0.28); }
}

body.no-tabs {
  padding-bottom: env(safe-area-inset-bottom);
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}

body.app-ready .panel.active {
  animation: fade-up 0.45s ease-out both;
}

/* ── Карточки / стекло ── */
.hero,
.wallet-card,
.card,
.sub-hub,
.modal-sheet {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
}

.hero {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.hero.compact { padding: 16px; margin-bottom: 12px; }
.hero h1 { margin: 0 0 4px; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }

.wallet-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 16px 18px;
  margin-bottom: 22px;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.1), var(--shadow);
  animation: pulse-glow 4s ease-in-out infinite;
}

.wallet-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.45), rgba(56, 189, 248, 0.15), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.wallet-card .balance-row { margin: 0; }
.wallet-card .stat { background: var(--bg-elevated); }

.wallet-card--account {
  margin-bottom: 12px;
  animation: none;
  box-shadow: var(--shadow);
}

.wallet-card--account::before {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.28), rgba(56, 189, 248, 0.1), transparent 60%);
}

.stat .value--id {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.stat .value--email {
  font-size: 0.8rem;
  line-height: 1.35;
  word-break: break-all;
}

.pick-header { margin-bottom: 16px; }

.pick-header h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.brand-logo {
  margin: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
}

.brand-logo img {
  display: block;
  height: 50px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  margin-left: 6px;
  filter: drop-shadow(0 0 20px rgba(129, 140, 248, 0.25));
}

.pick-tagline {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 400;
}

.pick-header--shop { margin-bottom: 18px; }
.pick-header--shop h1 { font-size: 1.35rem; }

.sub-hub {
  position: relative;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(129, 140, 248, 0.22);
  background: linear-gradient(165deg, rgba(22, 22, 32, 0.92) 0%, rgba(12, 12, 18, 0.88) 100%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sub-hub::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.18), transparent 60%);
  pointer-events: none;
}

.sub-hub__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 10px;
}

.sub-hub__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sub-hub__help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.sub-hub__help svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.9;
}

.sub-hub__help:active {
  transform: scale(0.97);
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(167, 139, 250, 0.45);
}

.sub-hub__list {
  position: relative;
  z-index: 1;
  border-radius: calc(var(--radius) + 2px);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.sub-hub__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 14px 15px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.sub-hub__row:active {
  background: rgba(255, 255, 255, 0.05);
}

.sub-hub__row--gb {
  box-shadow: inset 3px 0 0 rgba(99, 102, 241, 0.55);
}

.sub-hub__row--days {
  box-shadow: inset 3px 0 0 rgba(56, 189, 248, 0.45);
}

.sub-hub__sep {
  height: 1px;
  margin: 0 16px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.sub-hub__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  flex-shrink: 0;
}

.sub-hub__icon svg {
  width: 22px;
  height: 22px;
}

.sub-hub__icon--gb {
  color: #c7d2fe;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.35), rgba(79, 70, 229, 0.15));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 20px rgba(99, 102, 241, 0.2);
}

.sub-hub__icon--days {
  color: #a5f3fc;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.28), rgba(124, 58, 237, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 20px rgba(56, 189, 248, 0.14);
}

.sub-hub__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sub-hub__title {
  font-size: 0.96875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sub-hub__desc {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-hub__desc--on {
  color: rgba(52, 211, 153, 0.95);
}

.sub-hub__desc--on::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.65);
  vertical-align: 1px;
}

.sub-hub__desc--expired {
  color: rgba(248, 113, 113, 0.9);
}

.sub-hub__chev {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: rgba(165, 180, 252, 0.55);
  background: rgba(255, 255, 255, 0.04);
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.sub-hub__chev svg {
  width: 16px;
  height: 16px;
}

.sub-hub__row:active .sub-hub__chev {
  color: var(--accent-2);
  background: rgba(129, 140, 248, 0.14);
  transform: translateX(2px);
}

@media (hover: hover) {
  .sub-hub__row:hover {
    background: rgba(255, 255, 255, 0.03);
  }

  .sub-hub__row:hover .sub-hub__chev {
    color: var(--accent-2);
    background: rgba(129, 140, 248, 0.12);
    transform: translateX(2px);
  }

  .sub-hub__help:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(167, 139, 250, 0.4);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  background: rgba(5, 5, 8, 0.78);
  backdrop-filter: blur(8px);
}

.modal-overlay[hidden] { display: none; }

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: min(78vh, 640px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 20px 18px 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.modal-sheet h2 {
  margin: 0 0 16px;
  font-size: 1.125rem;
  font-weight: 600;
}

.tariff-diff {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.tariff-diff:last-of-type {
  border-bottom: none;
  margin-bottom: 12px;
  padding-bottom: 0;
}

.tariff-diff h3 { margin: 0 0 8px; font-size: 0.9375rem; font-weight: 600; }
.tariff-diff p { margin: 0 0 8px; font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }
.tariff-diff p:last-child { margin-bottom: 0; }

.tariff-diff-note {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

.tariff-diff-note strong { color: var(--text); font-weight: 500; }
.modal-sheet .btn { margin-top: 0; }
.modal-sheet--qr { text-align: center; }
.modal-sheet--qr h2 { margin-bottom: 6px; }

.qr-modal-hint { margin: 0 0 16px; font-size: 0.8125rem; color: var(--muted); }

.qr-modal-frame {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  background: #fff;
}

.qr-modal-frame img {
  display: block;
  width: min(100%, 280px);
  height: auto;
  aspect-ratio: 1;
}

.hero h1,
.top-bar strong,
.card h2,
.sub-hub__title { color: var(--text); }

.hero .sub { color: var(--muted); font-size: 0.875rem; margin-bottom: 0; }
.hero.compact .sub { margin-bottom: 12px; }

.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.btn-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, border-color 0.15s;
}

.btn-back:active { transform: scale(0.94); border-color: var(--border-glow); }

.balance-row { display: flex; gap: 12px; }

.stat {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 0.2s;
}

.stat .label { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }

.stat .value {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mode-grid { display: grid; gap: 12px; margin-top: 8px; }

.trial-card {
  margin-bottom: 14px;
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.08), rgba(99, 102, 241, 0.06));
}

.trial-card--done {
  border-color: rgba(34, 197, 94, 0.3);
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.08), rgba(99, 102, 241, 0.04));
}

.trial-card .trial-hint { margin: 10px 0 12px; }

.trial-card .btn-row { margin-bottom: 0; }

.trial-card .btn-row .btn { flex: 1; text-decoration: none; text-align: center; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge.active {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge.inactive {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.progress-wrap { margin: 12px 0; }

.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #818cf8, #6366f1);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

.progress-fill.days {
  background: linear-gradient(90deg, #7c3aed, #a78bfa, #7c3aed);
  background-size: 200% 100%;
}

.meta { font-size: 0.875rem; color: var(--muted); line-height: 1.5; }
.meta strong { color: var(--text); font-weight: 500; }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient-primary);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary.days-theme {
  background: var(--gradient-days);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--border);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row .btn { margin-top: 0; }

.package-grid { display: grid; gap: 8px; }

.package-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.package-item:active {
  transform: scale(0.98);
  border-color: var(--border-glow);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}

.package-item .price {
  font-weight: 600;
  color: var(--accent-2);
}

.device-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.device-item:last-child { border-bottom: none; }
.device-item .dev-info { flex: 1; min-width: 0; }
.device-item .dev-info small { color: var(--muted); word-break: break-all; }

.btn-sm {
  padding: 8px 12px;
  font-size: 0.8rem;
  margin-top: 0;
  width: auto;
  flex-shrink: 0;
}

.tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(8, 8, 14, 0.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--border);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.tab {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: 0.7rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  border-radius: 10px;
}

.tab.active {
  color: var(--text);
  font-weight: 600;
  background: rgba(129, 140, 248, 0.1);
}

.tab.active.days-theme {
  color: var(--accent-days);
  background: rgba(167, 139, 250, 0.12);
}

.tab .icon {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 2px;
  transition: transform 0.2s;
}

.tab.active .icon {
  transform: translateY(-2px);
}

.panel { display: none; }
.panel.active { display: block; }

.connect-summary h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.connect-summary {
  margin-bottom: 4px;
}

.connect-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.connect-stat {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
}

.connect-stat .label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.connect-stat .value {
  font-size: 0.92rem;
  font-weight: 600;
  word-break: break-word;
  line-height: 1.3;
}

.section-title {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.connect-section {
  margin: 16px 0 12px;
}

.connect-section .section-title {
  margin-bottom: 10px;
}

.connect-platforms,
.connect-apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.connect-platform,
.connect-app {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
  text-align: center;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.connect-platform:active,
.connect-app:active {
  transform: scale(0.98);
}

.connect-platform.active,
.connect-app.active {
  border-color: rgba(129, 140, 248, 0.6);
  background: rgba(99, 102, 241, 0.16);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.14);
}

.connect-platform.active.days-theme,
.connect-app.active.days-theme {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(124, 58, 237, 0.16);
}

.connect-step {
  margin-bottom: 12px;
}

.connect-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.connect-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.25);
}

.connect-step-head h2 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.3;
}

.connect-step-desc {
  margin: 0 0 4px;
  line-height: 1.55;
}

.connect-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.connect-action-btn {
  width: 100%;
  margin: 0 !important;
  min-height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  line-height: 1.25;
  border-radius: 14px;
}

.connect-action-sub {
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.32);
}

.connect-action-btn.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(129, 140, 248, 0.22);
}

.connect-action-icon {
  flex-shrink: 0;
  width: 22px;
  font-size: 1rem;
  line-height: 1;
  text-align: center;
}

.connect-action-text {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 600;
}

.connect-footer-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.connect-open-browser {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(161, 161, 170, 0.45);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.connect-open-browser:active {
  color: var(--text);
  text-decoration-color: rgba(129, 140, 248, 0.55);
}

.connect-hint {
  text-align: center;
  margin: 6px 0 0;
  font-size: 0.7rem;
  line-height: 1.45;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.connect-steps .connect-step:last-child {
  margin-bottom: 4px;
}

.input-row { display: flex; gap: 8px; margin-top: 8px; }

input[type="text"],
input[type="number"] {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12);
}

.history-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.history-item:last-child { border-bottom: none; }

.auth-screen {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 0 48px;
}

.auth-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 0.95rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: var(--glass);
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}

.auth-tab.active {
  color: var(--text);
  border-color: var(--border-glow);
  background: rgba(129, 140, 248, 0.12);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

.auth-input:focus {
  outline: none;
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12);
}

.auth-submit {
  margin-top: 4px;
}

.auth-forgot-link {
  align-self: flex-end;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-forgot-link:hover {
  color: var(--text);
}

.auth-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
}

.auth-info {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.auth-card-verify {
  text-align: center;
}

.auth-verify-text {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-verify-text strong {
  display: inline-block;
  margin-top: 4px;
  color: var(--text);
  word-break: break-all;
  font-weight: 600;
}

.auth-spam-hint {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  opacity: 0.9;
}

.auth-label-code {
  align-items: center;
  text-align: center;
}

.auth-code-input {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  padding: 16px 12px;
  letter-spacing: 0.55em;
  font-size: 1.65rem;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border-radius: 14px;
  caret-color: var(--accent, #818cf8);
}

.auth-code-input::placeholder {
  letter-spacing: 0.45em;
  opacity: 0.35;
}

.auth-code-input:focus {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.16);
}

.auth-verify-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.auth-resend {
  width: 100%;
  margin-top: 0;
}

.auth-back-link {
  display: block;
  width: 100%;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: center;
}

.auth-back-link:hover {
  color: var(--text);
}

.btn-logout {
  margin-top: 12px;
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.25);
}

.btn-logout:hover {
  background: rgba(248, 113, 113, 0.08);
}

.link-email-confirm-value {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid var(--border-glow);
  font-size: 1rem;
  word-break: break-all;
}

.auth-hint {
  margin: 18px 0 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.loading,
.error {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

.error { color: var(--danger); }
.error a { color: var(--text); text-decoration: underline; }

.loader {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-glow);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.maintenance {
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
}

.maintenance-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: float-card 3s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(129, 140, 248, 0.4));
}

.maintenance h1 { margin: 0 0 12px; font-size: 1.5rem; }
.maintenance-body { max-width: 320px; margin-bottom: 24px; }

.maintenance-text {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-line;
}

.maintenance-btn { text-decoration: none; display: inline-block; }

.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.pay-method {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.pay-method.active {
  border-color: var(--border-glow);
  background: rgba(129, 140, 248, 0.1);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.notice {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .wallet-card,
  .progress-fill,
  .maintenance-icon,
  .loader,
  .sub-hub {
    animation: none !important;
  }

  body.app-ready .panel.active {
    animation: none !important;
  }
}

body.dialog-open {
  overflow: hidden;
}

#app-dialog-root,
#app-snackbar-root {
  position: relative;
  z-index: 500;
}

.app-dialog-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: rgba(5, 5, 8, 0.72);
  backdrop-filter: blur(10px);
  animation: dialog-fade-in 0.18s ease;
}

.app-dialog {
  position: relative;
  width: min(100%, 340px);
  padding: 22px 20px 18px;
  border-radius: 18px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: linear-gradient(165deg, rgba(26, 26, 36, 0.98), rgba(15, 15, 22, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: dialog-slide-in 0.22s ease;
}

.app-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.app-dialog-message {
  margin: 0 28px 20px 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.app-dialog-actions--single {
  justify-content: flex-end;
}

.app-dialog-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.app-dialog-btn:active {
  transform: scale(0.97);
}

.app-dialog-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--border);
}

.app-dialog-btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.app-dialog-btn--danger {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

#app-snackbar-root {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.app-snackbar {
  max-width: min(100%, 420px);
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.25);
  background: rgba(20, 20, 28, 0.94);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-snackbar.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes dialog-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialog-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
