:root {
  --bg:        #070709;
  --bg2:       #0e0e12;
  --surface:   #141419;
  --surface2:  #0e0e12;
  --surface3:  #1a1a21;

  --border:    rgba(255,255,255,0.06);
  --border2:   rgba(255,255,255,0.08);

  --text:  #E8E8EC;
  --text2: #9898A4;
  --text3: #5C5C6A;
  --text4: #3A3A46;

  --accent:       #4DC8D4;
  --accent-rgb:   77, 200, 212;
  --accent-light: rgba(77, 200, 212, 0.15);
  --accent-dim:   rgba(77, 200, 212, 0.08);

  --green:        #34D399;
  --green-light:  rgba(52, 211, 153, 0.12);
  --green-rgb:    52, 211, 153;

  --red:          #F87171;
  --red-light:    rgba(248, 113, 113, 0.12);
  --red-rgb:      248, 113, 113;

  --orange:       #FBBF24;

  --tab-h:     104px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-main:    'Instrument Sans', -apple-system, sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

/* ─── Light theme ────────────────────────────────────────── */
[data-theme="light"] {
  --bg:        #F8F8FA;
  --bg2:       #EFEFEF;
  --surface:   #FFFFFF;
  --surface2:  #F4F4F6;
  --surface3:  #ECECEE;
  --border:    rgba(0,0,0,0.06);
  --border2:   rgba(0,0,0,0.1);
  --text:  #0D0D0D;
  --text2: #555555;
  --text3: #777777;
  --text4: #AAAAAA;
  --accent:       #3AAFBA;
  --accent-rgb:   58, 175, 186;
  --accent-light: rgba(58, 175, 186, 0.12);
  --accent-dim:   rgba(58, 175, 186, 0.06);
  --green:        #059669;
  --green-light:  rgba(5, 150, 105, 0.1);
  --green-rgb:    5, 150, 105;
  --red:          #DC2626;
  --red-light:    rgba(220, 38, 38, 0.08);
  --red-rgb:      220, 38, 38;
}
[data-theme="light"] .tabbar { background: rgba(248, 248, 250, 0.92); box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04) inset; }
[data-theme="light"] .page-topbar { background: rgba(248, 248, 250, 0.88); }
[data-theme="light"] .payment-sheet { background: var(--surface); box-shadow: 0 -4px 24px rgba(0,0,0,0.08); }
[data-theme="light"] .success-overlay { background: rgba(248, 248, 250, 0.96); }
[data-theme="light"] .payment-overlay { background: rgba(0,0,0,0.2); }
[data-theme="light"] .vpn-link-area { background: rgba(0,0,0,0.03); }
[data-theme="light"] .vpn-link-area:active { background: rgba(0,0,0,0.06); }
[data-theme="light"] .ref-link-box { background: rgba(0,0,0,0.03); }
[data-theme="light"] .btn-spinner { border-color: rgba(0,0,0,0.1); border-top-color: var(--text); }
[data-theme="light"] .toast { background: #1A1A1A; color: #F5F5F5; }
[data-theme="light"] .btn-primary { color: #fff; }
[data-theme="light"] .vpn-copy-btn, [data-theme="light"] .vpn-qr-btn { color: #fff; }
[data-theme="light"] .landing-btn { color: #fff; }
[data-theme="light"] .voucher-btn { color: #fff; }
[data-theme="light"] .card::before { background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.1), transparent); }

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;

}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100vh;
  overflow: hidden;
}

/* Subtle noise grain for physical depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.028;
  pointer-events: none;
  z-index: 0;
}

/* ─── Pages ─────────────────────────────────────────────── */
.page {
  position: absolute;
  inset: 0;
  bottom: var(--tab-h);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 16px 20px;
  padding-top: max(24px, calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + 12px));
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  will-change: transform, opacity;
}
.page.active {
  opacity: 1;
  pointer-events: auto;
}
.page.slide-in-right { animation: pageSlideInRight 0.28s cubic-bezier(0.32,0.72,0,1) both; }
.page.slide-in-left  { animation: pageSlideInLeft  0.28s cubic-bezier(0.32,0.72,0,1) both; }

@keyframes pageSlideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pageSlideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Tab Bar ────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  height: 64px;
  background: rgba(7, 7, 9, 0.88);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  display: flex;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 0 0.5px rgba(255,255,255,0.04) inset;
  padding: 0 6px;
}
.tab-slider {
  position: absolute;
  top: 6px; bottom: 6px;
  left: 6px;
  width: calc(25% - 3px);
  background: var(--accent-light);
  border-radius: 16px;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.tab-slider.stretch {
  animation: tabStretch 0.32s ease;
}
@keyframes tabStretch {
  0%   { scale: 1 1; }
  25%  { scale: 1.08 0.82; }
  55%  { scale: 1.02 0.95; }
  100% { scale: 1 1; }
}
.tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 1; position: relative;
  gap: 4px; cursor: pointer;
  color: var(--text4);
  border-radius: 16px;
  height: 52px;
  transition: color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}
.tab:active { transform: scale(0.88); }
.tab.active {
  color: var(--accent);
}
.tab-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.tab-icon svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.tab.active .tab-icon svg { stroke-width: 2.1; }
.tab-label { font-size: 10px; font-weight: 500; letter-spacing: 0.2px; }
.tab.active .tab-label { font-weight: 700; }

/* ─── Page Header ───────────────────────────────────────── */
#page-home, #page-wallet, #page-vpn, #page-settings {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
}
#page-home #home-content,
#page-wallet #wallet-content,
#page-vpn #vpn-content {
  padding: 0 16px 20px;
}
#page-settings #settings-content {
  padding: 8px 16px 20px;
}

.page-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 10px;
  padding-top: max(14px, calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + 10px));
  position: sticky; top: 0; z-index: 10;
  background: rgba(7, 7, 9, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.page-topbar-title {
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.3px;
}
.page-topbar-btn {
  width: 44px; height: 44px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.page-topbar-btn:active { opacity: 0.5; }

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.15), transparent);
  pointer-events: none;
}
.card-accent {
  background: var(--accent-dim);
  border-color: rgba(var(--accent-rgb), 0.14);
}
/* ─── Status ─────────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(var(--green-rgb), 0.2);
  padding: 5px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.3px;
}
.status-dot {
  width: 10px; height: 10px;
  background: var(--green); border-radius: 50%;
  animation: breathe 3s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(var(--green-rgb), 0.5), 0 0 2px rgba(var(--green-rgb), 0.8);
}
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.days-big {
  font-family: var(--font-heading);
  font-size: 56px; font-weight: 700;
  letter-spacing: -2.5px; line-height: 1;
  color: var(--text);

}
.days-label {
  font-size: 10px; color: var(--text3);
  margin-top: 8px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
}

/* ─── Traffic ────────────────────────────────────────────── */
.traffic-val {
  font-size: 14px; font-weight: 500;
  font-family: 'Source Code Pro', ui-monospace, monospace;
  margin-top: 2px; color: var(--text);
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  width: 100%; height: 52px;
  border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  letter-spacing: 0.1px;
  transition: opacity 0.15s, transform 0.12s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #3AAFBA);
  color: #070709;
  font-weight: 700;
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.2), 0 2px 8px rgba(0,0,0,0.3);
}
.btn-primary:active { opacity: 0.85; transform: scale(0.985); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.15); }

.btn-ghost {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn-ghost:active { opacity: 0.7; }

.btn-outline {
  background: var(--accent-dim);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  color: var(--accent);
}
.btn-outline:active { opacity: 0.7; }

.copy-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 10px;
  min-width: 44px; min-height: 44px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.copy-btn svg { width: 17px; height: 17px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy-btn:active { background: var(--accent-light); }

/* ─── Section title ──────────────────────────────────────── */
.section-title {
  font-size: 10px; font-weight: 700;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px; padding-left: 2px;
}

/* ─── Renew Sheet ───────────────────────────────────────── */
.renew-sheet { min-height: 380px; }
.renew-empty { color: var(--text3); text-align: center; padding: 40px 0; }

.renew-price-hero {
  text-align: center; margin: 24px 0 4px;
}
.renew-price-amount {
  font-family: var(--font-heading);
  font-size: 52px; font-weight: 700;
  letter-spacing: -2px; color: var(--text);
  line-height: 1;
}
.renew-price-currency {
  font-size: 24px; font-weight: 600;
  color: var(--text3); margin-left: 2px;
  vertical-align: super; letter-spacing: 0;
}
.renew-price-sub {
  font-size: 13px; color: var(--text3);
  margin-top: 6px;
}
.renew-action { margin-top: 24px; }
.renew-action .btn { width: 100%; }

/* Shortage state (inside renew sheet) */
.renew-shortage { text-align: center; padding: 8px 0 4px; }

.renew-shortage-icon {
  width: 48px; height: 48px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--red-light);
  display: flex; align-items: center; justify-content: center;
}
.renew-shortage-icon svg { color: var(--red); }

.renew-shortage-title {
  font-family: var(--font-heading);
  font-size: 18px; font-weight: 700;
  margin-bottom: 6px;
}
.renew-shortage-amount {
  font-family: var(--font-heading);
  font-size: 28px; font-weight: 700;
  color: var(--red); letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.renew-shortage-hint {
  font-size: 13px; color: var(--text3);
  margin-bottom: 20px;
}

.renew-shortage-actions {
  display: flex; flex-direction: column; gap: 8px;
}
.renew-shortage-actions .btn { width: 100%; }

/* ─── Plan Segment (shared) ─────────────────────────────── */
.plan-seg {
  position: relative;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
}
.plan-seg-thumb {
  position: absolute;
  top: 3px; bottom: 3px; left: 0; width: 0;
  background: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 99px;
  pointer-events: none;
  transition: left 0.24s cubic-bezier(0.34, 1.2, 0.64, 1),
              width 0.24s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.plan-seg-btn {
  flex: 1;
  position: relative; z-index: 1;
  background: none; border: none;
  border-radius: 99px;
  padding: 9px 2px;
  min-height: 44px;
  font-size: 13px; font-weight: 600;
  color: var(--text3);
  font-family: var(--font-main);
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
  transition: color 0.18s;
}
.plan-seg-btn.active { color: var(--accent); }
.plan-seg-btn:active { opacity: 0.65; }
.plan-price-display { text-align: center; margin-top: 20px; }
.plan-price-big {
  font-family: var(--font-heading);
  font-size: 36px; font-weight: 700;
  letter-spacing: -0.5px; color: var(--text);
}
.plan-price-monthly { font-size: 13px; color: var(--text3); margin-top: 4px; }

/* ─── App cards ──────────────────────────────────────────── */
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-bottom: 8px;
}
.app-card:active { opacity: 0.6; }
.app-icon-wrap {
  width: 50px; height: 50px; border-radius: 12px;
  background: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 20px; font-weight: 700; color: var(--accent);
  flex-shrink: 0;

}
.app-info { flex: 1; }
.app-name { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.app-dl   { font-size: 12px; color: var(--text3); }
.app-arrow{ font-size: 20px; color: var(--text3); }

/* ─── FAQ ────────────────────────────────────────────────── */
.faq-item {
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: background 0.15s;
}
.faq-item:first-child { border-top: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.faq-item:last-child  { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.faq-item:only-child  { border-radius: var(--radius-lg); border: 1px solid var(--border); }
.faq-item + .faq-item { border-top: 1px solid var(--border); }
.faq-item.open        { background: var(--surface2); }

.faq-q {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 16px; cursor: pointer; gap: 14px;
}
.faq-q-text { font-size: 15px; font-weight: 500; line-height: 1.4; }
.faq-chevron {
  width: 22px; height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s ease, background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.faq-chevron svg { width: 11px; height: 11px; fill: none; stroke: var(--text3); stroke-width: 2.5; stroke-linecap: round; }
.faq-item.open .faq-chevron { transform: rotate(180deg); background: var(--accent-light); border-color: rgba(var(--accent-rgb), 0.25); }
.faq-item.open .faq-chevron svg { stroke: var(--accent); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height 0.32s ease, padding 0.2s;
  font-size: 14px; color: var(--text2); line-height: 1.8;
  padding: 0 16px;
}
.faq-item.open .faq-a { max-height: 400px; padding: 0 16px 16px; }

/* ─── Settings ───────────────────────────────────────────── */
.voucher-row { display: flex; gap: 8px; align-items: center; }
.voucher-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border2);
  border-radius: 10px; padding: 10px 14px;
  color: var(--text); font-size: 15px; font-family: inherit;
  outline: none;
}
.voucher-input::placeholder { color: var(--text3); }
.voucher-input:focus { border-color: rgba(var(--accent-rgb), 0.5); }
.voucher-btn {
  background: linear-gradient(135deg, var(--accent), #3AAFBA); color: #070709;
  border: none; border-radius: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  min-height: 44px;
  transition: opacity 0.15s;
}
.voucher-btn:active { opacity: 0.75; }


/* ─── Pull-to-refresh ───────────────────────────────────── */
.ptr-indicator {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%) translateY(-60px);
  z-index: 50; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.2s;
  opacity: 0;
}
.ptr-indicator.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(calc(var(--tg-safe-area-inset-top, 0px) + 12px));
}
.ptr-spinner { width: 18px; height: 18px; stroke: var(--accent); }
.ptr-indicator.spinning .ptr-spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Success Overlay ───────────────────────────────────── */
.success-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.success-overlay.open { opacity: 1; pointer-events: auto; }
.success-card {
  text-align: center; padding: 0 32px;
  transform: translateY(24px);
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.success-overlay.open .success-card { transform: translateY(0); }
.success-checkmark {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(var(--green-rgb), 0.15);
  border: 2px solid rgba(var(--green-rgb), 0.4);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}
.success-checkmark svg { width: 32px; height: 32px; stroke: var(--green); }
.success-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.success-plan  { font-size: 16px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.success-date  { font-size: 13px; color: var(--text3); margin-bottom: 32px; }
.success-btn   { width: 100%; }

/* ─── VPN Onboarding (empty state) ──────────────────────── */
.onboard-hero {
  text-align: center; padding: 32px 0 24px;
}
.onboard-icon {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--accent-dim); border: 1px solid rgba(var(--accent-rgb), 0.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.onboard-icon svg { width: 32px; height: 32px; stroke: var(--accent); }
.onboard-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.onboard-sub   { font-size: 14px; color: var(--text3); line-height: 1.6; }

.steps-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 16px; overflow: hidden; }
.step-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
}
.step-row + .step-row { border-top: 1px solid var(--border); }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); border: 1px solid rgba(var(--accent-rgb), 0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
.step-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.step-sub   { font-size: 12px; color: var(--text3); }

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--tab-h) + 4px); left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20, 20, 25, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 10px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; z-index: 200;
  white-space: nowrap;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-rgb), 0.02));
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: var(--radius-xl);
  padding: 40px 24px 32px;
  margin-bottom: 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(var(--accent-rgb), 0.04) inset;
}
/* Decorative corner mark */
.hero::before {
  content: '';
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.25);
  border-right: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 0 4px 0 0;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 16px; left: 16px;
  width: 32px; height: 32px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.25);
  border-left: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 0 0 0 4px;
  pointer-events: none;
}
.hero-monogram {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 16px;
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 700; color: var(--accent);
  letter-spacing: -1px;
  margin-bottom: 20px;

  position: relative; z-index: 1;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: 42px; font-weight: 700;
  letter-spacing: -2px; margin-bottom: 12px;
  color: var(--text);

  position: relative; z-index: 1;
}
.hero-sub {
  font-size: 15px; color: var(--text2); line-height: 1.7;
  position: relative; z-index: 1;
}

/* ─── Skeleton ───────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
@keyframes skelPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}
.skeleton {
  background: linear-gradient(
    100deg,
    rgba(255,255,255,0.03) 30%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.03) 70%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear, skelPulse 2s ease-in-out infinite;
  border-radius: 8px;
}
.loading .skeleton:nth-child(1) { animation-delay: 0s; }
.loading .skeleton:nth-child(2) { animation-delay: 0.08s; }
.loading .skeleton:nth-child(3) { animation-delay: 0.16s; }
.loading .skeleton:nth-child(4) { animation-delay: 0.24s; }
.loading .skeleton:nth-child(5) { animation-delay: 0.32s; }
.skel-card { height: 130px; border-radius: var(--radius-lg); margin-bottom: 10px; }
.skel-btn  { height: 52px;  border-radius: var(--radius);    margin-bottom: 10px; }
.skel-row  { height: 64px;  border-radius: var(--radius);    margin-bottom: 8px;  }
.skel-row-lg { height: 52px; border-radius: var(--radius); margin-bottom: 8px; }
.skel-card-lg { height: 180px; border-radius: var(--radius-lg); margin-bottom: 10px; }
[data-theme="light"] .skeleton {
  background: linear-gradient(100deg, rgba(0,0,0,0.04) 30%, rgba(0,0,0,0.09) 50%, rgba(0,0,0,0.04) 70%);
  background-size: 800px 100%;
}
.loading   { padding: 16px 0; }

/* ─── Wallet ─────────────────────────────────────────────── */
.balance-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
}
.balance-amount {
  font-family: var(--font-heading);
  font-size: 36px; font-weight: 700;
  letter-spacing: -1.5px; line-height: 1;
  color: var(--text);

}
.balance-currency { font-size: 20px; font-weight: 400; color: var(--text2); }
.balance-label    {
  font-size: 10px; color: var(--text3);
  margin-top: 4px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.8px;
}

/* ─── Payment Sheet ──────────────────────────────────────── */
.payment-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.payment-overlay.open { opacity: 1; pointer-events: auto; }

.payment-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 301;
  background: var(--surface);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 1, 1);
  max-height: 75vh;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
}
.payment-sheet.open {
  transform: translateY(0);
  transition: transform 0.48s cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* Sheet content stagger */
.payment-sheet.open .payment-sheet-body > * {
  animation: sheetContentIn 0.3s ease both;
}
.payment-sheet.open .payment-sheet-body > *:nth-child(1) { animation-delay: 0.08s; }
.payment-sheet.open .payment-sheet-body > *:nth-child(2) { animation-delay: 0.14s; }
.payment-sheet.open .payment-sheet-body > *:nth-child(3) { animation-delay: 0.20s; }
@keyframes sheetContentIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}


.payment-sheet-handle {
  width: 36px; height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.payment-sheet-title {
  font-size: 17px; font-weight: 700;
  padding: 14px 20px 8px;
  flex-shrink: 0;
}
.payment-sheet-body {
  overflow-y: auto;
  padding: 4px 20px 20px;
  -webkit-overflow-scrolling: touch;
}
.payment-cat-label {
  font-size: 10px; font-weight: 700;
  color: var(--text3); text-transform: uppercase; letter-spacing: 2px;
  padding: 16px 20px 6px;
}
/* ── Payment provider cards ──────────────────────────────── */
.pay-cat-label {
  font-size: 12px; font-weight: 700;
  color: var(--text3); text-transform: uppercase; letter-spacing: 1.5px;
  margin: 20px 0 8px;
}
.pay-cat-label:first-child { margin-top: 0; }
.pay-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.pay-card:active { background: var(--surface2); }
.pay-card-active { outline: 2px solid var(--accent); }
.pay-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.pay-info { flex: 1; min-width: 0; }
.pay-name { font-size: 15px; font-weight: 500; color: var(--text); }
.pay-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.pay-check { flex-shrink: 0; }
.payment-method-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.payment-method-row:active { background: var(--surface2); }
.payment-method-empty {
  padding: 13px 20px;
  font-size: 14px; color: var(--text3);
  border-top: 1px solid var(--border);
}

/* ─── Topup islands ──────────────────────────────────────── */
.topup-method-card {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 8px;
}
.topup-method-card:active { background: var(--surface2); }
.topup-method-left { font-size: 15px; font-weight: 600; }
.topup-method-right {
  display: flex; align-items: center; gap: 6px;
  color: var(--text3);
}
.topup-method-name { font-size: 14px; color: var(--text2); }

.topup-amount-card { margin-bottom: 8px; }
.topup-amount-display {
  font-family: var(--font-heading);
  font-size: 46px; font-weight: 700;
  letter-spacing: -2px; line-height: 1;
  color: var(--text);
  margin-bottom: 18px;

}
.amount-seg {
  position: relative;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
}
.amount-seg-thumb {
  position: absolute;
  top: 3px; bottom: 3px; left: 0; width: 0;
  background: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 99px;
  pointer-events: none;
  transition: left 0.24s cubic-bezier(0.34, 1.2, 0.64, 1),
              width 0.24s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.amount-seg-btn {
  flex: 1;
  position: relative; z-index: 1;
  background: none; border: none;
  border-radius: 99px;
  padding: 9px 2px;
  min-height: 44px;
  font-size: 13px; font-weight: 600;
  color: var(--text3);
  font-family: var(--font-main);
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
  transition: color 0.18s;
}
.amount-seg-btn.active { color: var(--accent); }
.amount-seg-btn:active { opacity: 0.65; }

.topup-amount-input {
  /* Same visual as .topup-amount-display */
  background: none; border: none; outline: none;
  width: 100%; padding: 0;
  caret-color: var(--accent);
  -webkit-appearance: none; appearance: none;
}
.topup-amount-input::-webkit-inner-spin-button,
.topup-amount-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.topup-amount-input[type=number] { -moz-appearance: textfield; }
.topup-amount-input::placeholder { color: var(--text3); font-weight: 400; }

/* ─── Transaction history ────────────────────────────────── */
.tx-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
}
.tx-row + .tx-row { border-top: 1px solid var(--border); }
.tx-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tx-icon svg { flex-shrink: 0; }
.tx-icon-trial    { background: var(--accent-light);  color: var(--accent); }
.tx-icon-purchase { background: var(--green-light);   color: var(--green); }
.tx-icon-topup    { background: var(--green-light);   color: var(--green); }
.tx-icon-referral { background: var(--accent-light);  color: var(--accent); }
.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-size: 14px; font-weight: 500; }
.tx-date { font-size: 12px; color: var(--text3); margin-top: 2px; }
.tx-amount { font-size: 14px; font-weight: 600; flex-shrink: 0; }
.tx-debit  { color: var(--red); }
.tx-credit { color: var(--green); }
.tx-days   { color: var(--accent); }

/* ─── Fade-in ────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.28s ease forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── State cards (loading/error) ───────────────────────── */
.state-card { text-align: center; }
.state-card-loading { padding: 48px 20px; }
.state-card-error { padding: 40px 20px; }
.state-card-sm { padding: 32px 20px; }
.state-text { font-size: 14px; color: var(--text3); font-weight: 500; }
.state-error-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.state-error-msg { font-size: 13px; color: var(--text3); margin-bottom: 24px; line-height: 1.6; }
.state-error-msg-sm { font-size: 14px; color: var(--text3); margin-bottom: 16px; }

/* ─── Utility spacing ───────────────────────────────────── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }

/* ─── VPN button row ────────────────────────────────────── */
.vpn-btn-row { display: flex; gap: 8px; align-items: stretch; }

/* ─── About list card ───────────────────────────────────── */
.about-list-card { padding: 0; overflow: hidden; }

/* ─── QR sheet content ──────────────────────────────────── */
.qr-sheet-content { text-align: center; padding: 12px 0 8px; }
.qr-sheet-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.qr-sheet-canvas { display: inline-block; border-radius: 12px; overflow: hidden; }
.qr-sheet-hint { font-size: 12px; color: var(--text3); margin-top: 14px; }

/* ─── Timer unit (inside days-big) ──────────────────────── */
.timer-unit { font-size: 18px; font-weight: 600; color: var(--text2); }

/* ─── Trial button spinner ───────────────────────────────── */
.btn-spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(13, 13, 13, 0.25);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

/* ─── Loading state ──────────────────────────────────────── */
body.loading .btn-primary {
  opacity: 0.4; pointer-events: none;
}

/* ─── Landing ────────────────────────────────────────────── */
.landing {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px; overflow: auto;
}
.landing-inner {
  max-width: 360px; width: 100%; text-align: center;
}
.landing-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px;
  background: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 18px;
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 700; color: var(--accent);
  letter-spacing: -1px; margin-bottom: 20px;

}
.landing-title {
  font-family: var(--font-heading);
  font-size: 48px; font-weight: 700;
  letter-spacing: -2.5px; margin-bottom: 12px;
  color: var(--text);

}
.landing-sub {
  font-size: 17px; color: var(--text2);
  line-height: 1.65; margin-bottom: 28px;
}
.landing-feats {
  display: flex; flex-direction: column;
  gap: 0; margin-bottom: 28px; text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.landing-feat {
  font-size: 15px; font-weight: 400; color: var(--text2);
  padding: 14px 18px;
}
.landing-feat + .landing-feat { border-top: 1px solid var(--border); }
.landing-btn {
  display: flex; align-items: center; justify-content: center;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), #3AAFBA);
  color: #070709; border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 16px; font-weight: 700;
  text-decoration: none;
  margin-bottom: 14px;
  transition: opacity 0.15s;
  box-shadow: 0 0 32px rgba(var(--accent-rgb), 0.2), 0 4px 12px rgba(0,0,0,0.3);
}
.landing-btn:active { opacity: 0.85; }
.landing-note { font-size: 13px; color: var(--text3); }

/* ─── Referral ───────────────────────────────────────────── */
.ref-row  {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.ref-title  {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 700; margin-bottom: 4px;

}
.ref-stats  { font-size: 13px; color: var(--text3); }
.ref-btn    { margin-bottom: 10px; }
.ref-link-row {
  display: flex; align-items: center; gap: 8px;
}
.ref-link-box {
  flex: 1;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  min-height: 44px;
  font-size: 11px;
  font-family: 'Source Code Pro', ui-monospace, monospace;
  color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}

/* ─── Status Hero (redesigned home active) ────────────────── */
.status-hero {
  text-align: center;
  padding: 28px 20px 24px;
}
.status-hero .status-badge {
  margin-bottom: 16px;
}
.status-hero .days-big {
  margin-bottom: 0;
}
.status-expiry {
  font-size: 12px;
  color: var(--text3);
  margin-top: 12px;
  font-weight: 500;
}

/* ─── Expiry Block (redesigned, more prominent) ──────────── */
.expiry-block {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(var(--red-rgb), 0.14);
  border: 1px solid rgba(var(--red-rgb), 0.3);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.expiry-block:active { background: rgba(var(--red-rgb), 0.22); }
.expiry-block-icon { flex-shrink: 0; color: var(--red); }
.expiry-block-body { flex: 1; }
.expiry-block-title { font-size: 14px; font-weight: 700; color: var(--red); }
.expiry-block-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.expiry-block > svg:last-child { flex-shrink: 0; stroke: var(--text3); }

/* ─── Expired Card ───────────────────────────────────────── */
.expired-card {
  text-align: center;
  padding: 32px 20px;
  border: 1px solid rgba(var(--red-rgb), 0.2);
}
.expired-label {
  font-family: var(--font-heading);
  font-size: 28px; font-weight: 700;
  color: var(--red);
  margin-bottom: 6px;
}
.expired-date {
  font-size: 13px; color: var(--text3); font-weight: 500;
}
.expired-sub {
  font-size: 12px; color: var(--text3); margin-top: 8px;
}

/* ─── Compact features (home new user) ───────────────────── */
.features-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0 12px;
}
.feature-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}
.feature-row svg {
  flex-shrink: 0;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Hero CTA ───────────────────────────────────────────── */
.hero-cta {
  margin-top: 24px;
  font-size: 15px;
  padding: 14px 28px;
}

/* ─── VPN Hero Card (redesigned key page) ────────────────── */
.vpn-hero-card {
  padding: 20px;
}
.vpn-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.vpn-hero-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
}
.vpn-link-area {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.15s;
}
.vpn-link-area:active { background: rgba(0,0,0,0.45); }
.vpn-link-text {
  font-family: 'Source Code Pro', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}
/* ─── VPN Action Buttons ────────────────────────────────── */
.vpn-copy-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #3AAFBA);
  color: #070709;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.15);
}
.vpn-copy-btn:active { opacity: 0.85; }
.vpn-qr-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #3AAFBA);
  color: #070709;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.15);
}
.vpn-qr-btn:active { opacity: 0.85; }

/* ─── VPN Traffic (inside hero card) ──────────────────────── */
.vpn-traffic {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vpn-traffic-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text2);
}
.vpn-traffic-row .traffic-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}


/* ─── Sync Section ───────────────────────────────────────── */
.sync-section {
  margin-top: 20px;
  text-align: center;
}
.sync-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
}

/* ─── Settings Cards ─────────────────────────────────────── */
.settings-card {
  margin-bottom: 12px;
}
.settings-card-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  margin-bottom: 12px;
}


/* ─── About Footer ───────────────────────────────────────── */
.about-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text4);
  padding: 20px 0 8px;
}

/* ─── Wallet Divider ─────────────────────────────────────── */
.wallet-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0 4px;
}

/* ─── TX List Card ───────────────────────────────────────── */
.tx-list-card {
  padding: 0;
}
.tx-list-card .tx-row {
  padding: 12px 16px;
}
.tx-list-card .tx-row + .tx-row {
  border-top: 1px solid var(--border);
}
.tx-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  font-size: 13px;
  color: var(--text3);
}
.tx-empty svg { flex-shrink: 0; opacity: 0.5; }

/* ─── Connect Sheet: raised higher ───────────────────────── */
#connect-sheet { max-height: 90vh; min-height: 50vh; }

/* ─── App Detail Sheet: over connect sheet ───────────────── */
#app-detail-overlay { z-index: 309; }
.app-detail-sheet { z-index: 310; max-height: 80vh; }

/* ─── Connect Sheet: desktop back button ──────────────────── */
.cs-back-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 8px;
  transition: opacity 0.12s;
}
.cs-back-btn:active { opacity: 0.6; }

/* ─── Connect Sheet: platform pills ──────────────────────── */
.cs-platforms {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cs-platforms::-webkit-scrollbar { display: none; }
.cs-plat {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.cs-plat.active {
  background: var(--accent-light);
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
}
.cs-plat:active { opacity: 0.7; }

/* ─── Connect Sheet: app rows (clickable) ────────────────── */
.cs-app-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  transition: opacity 0.12s;
}
.cs-app-row:active { opacity: 0.6; }
.cs-app-row + .cs-app-row {
  border-top: 1px solid var(--border);
}
.cs-app-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}
.cs-app-info {
  flex: 1;
  min-width: 0;
}
.cs-app-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.cs-app-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.cs-badge-top {
  background: var(--accent-light);
  color: var(--accent);
}
.cs-badge-alt {
  background: var(--surface2);
  color: var(--text3);
}
.cs-app-arrow {
  font-size: 20px;
  color: var(--text3);
  flex-shrink: 0;
  font-weight: 300;
}

/* ─── App Detail Sheet: content ──────────────────────────── */
.ad-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 12px;
}
.ad-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}
.ad-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.ad-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.ad-plat {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}
.ad-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 280px;
}
.ad-content .btn {
  width: 100%;
  max-width: 280px;
}

/* ─── Theme toggle ───────────────────────────────────────── */
.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  min-height: 44px;
  padding: 2px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.theme-toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--border);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.theme-toggle-track.active {
  background: var(--accent);
}
.theme-toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.theme-toggle-track.active .theme-toggle-thumb {
  transform: translateX(20px);
  background: var(--bg);
}

/* ─── Settings Bottom Buttons ───────────────────────────── */
.settings-btns-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.settings-btns-row .btn {
  flex: 1;
  height: 48px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ─── About Screen ──────────────────────────────────────── */
.about-screen {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.about-screen.open {
  transform: translateX(0);
}
.about-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  padding-top: max(14px, calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + 10px));
  background: var(--bg);
  flex-shrink: 0;
}
.about-topbar-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.about-back-btn {
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
}
.about-back-btn:active { opacity: 0.5; }
.about-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 40px;
  -webkit-overflow-scrolling: touch;
}
.about-desc-card {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text2);
}
.about-list {
  margin-top: 16px;
}
.about-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.12s;
}
.about-list-row:active {
  background: var(--surface2);
}
.about-list-row + .about-list-row {
  border-top: 1px solid var(--border);
}
.about-list-arrow {
  color: var(--text3);
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
}

/* Sheets opened from about-screen (z-400): must be above it */
#faq-overlay, #terms-overlay, #privacy-overlay { z-index: 410; }
#faq-sheet, #terms-sheet, #privacy-sheet       { z-index: 411; max-height: 85vh; }

/* Light theme: about screen */
[data-theme="light"] .about-screen { background: var(--bg); }
[data-theme="light"] .about-topbar { background: var(--bg); }

/* ── Legal pages (Terms / Privacy) ──────────────────────── */
.legal-card { padding: 20px; font-size: 13px; line-height: 1.7; color: var(--text2); }
.legal-card h4 { color: var(--text); font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
.legal-card ul { padding-left: 18px; margin: 6px 0; }
.legal-card li { margin-bottom: 4px; }
.legal-card p { margin: 8px 0; }
.legal-date { font-size: 12px; color: var(--text3); }
.legal-contact { margin-top: 16px; font-size: 12px; color: var(--text3); }

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  /* Функциональные переходы — всегда анимировать */
  .payment-sheet, .payment-overlay,
  .about-screen, .faq-sheet,
  .plan-seg-thumb, .amount-seg-thumb {
    transition-duration: 0.25s !important;
  }
}
