/* ============================================================
   AlterVPN — Mini App v2  ·  Monochrome design system
   Black / white / grayscale. Premium minimalist.
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700;12..96,800&family=Hanken+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---- Theme tokens ---- */
:root, [data-theme="dark"] {
  --ink:        #F4F4F2;   /* primary text on dark */
  --ink-soft:   #A6A6A2;   /* secondary text */
  --ink-faint:  #6B6B68;   /* tertiary / hints */
  --bg:         #080808;   /* page background */
  --bg-grad-a:  #0c0c0d;
  --bg-grad-b:  #050505;
  --surface:    #131314;   /* card (opaque base for sheets / tabbar) */
  --surface-2:  rgba(255,255,255,.05);   /* nested / inputs — translucent tint */
  --surface-3:  rgba(255,255,255,.09);   /* hover / raised */
  --line:       rgba(255,255,255,.09);   /* hairline border */
  --line-soft:  rgba(255,255,255,.05);
  --inverse:    #f4f4f2;   /* inverse surface (light chip on dark) */
  --inverse-ink:#0a0a0a;   /* text on inverse */
  --glow:       rgba(255,255,255,.06);
  --accent:     #ffffff;   /* monochrome accent = pure white */
  /* frosted surfaces — translucent so the smoke reads through as depth */
  --glass:      rgba(22,22,24,.62);
  --glass-2:    rgba(30,30,33,.55);
  --hair:       rgba(255,255,255,.07);  /* soft edge, not a hard cutout border */
  --hair-soft:  rgba(255,255,255,.04);
  --good:       #6ee7a8;
  --good-ink:   #0c2417;
  --warn:       #f0b35b;
  --bad:        #f08a8a;
  --radius:     22px;
  --radius-lg:  28px;
  --radius-sm:  14px;
  --radius-pill:999px;
  --shadow:     0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -28px rgba(0,0,0,.9);
  --shadow-soft:0 10px 30px -18px rgba(0,0,0,.8);
  --ease:       cubic-bezier(.22,.61,.36,1);
  --ease-out:   cubic-bezier(.16,1,.3,1);
  --safe-top:   env(safe-area-inset-top, 0px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
  --maxw:       460px;
  --grain:      .035;
  color-scheme: dark;
}

[data-theme="light"] {
  --ink:        #0a0a0a;
  --ink-soft:   #565654;
  --ink-faint:  #8d8d89;
  --bg:         #ecebe7;
  --bg-grad-a:  #f3f2ee;
  --bg-grad-b:  #e4e3df;
  --surface:    #ffffff;
  --surface-2:  rgba(20,20,22,.04);
  --surface-3:  rgba(20,20,22,.07);
  --line:       rgba(20,20,22,.10);
  --line-soft:  rgba(20,20,22,.06);
  --inverse:    #0a0a0a;
  --inverse-ink:#f7f7f5;
  --glow:       rgba(0,0,0,.04);
  --accent:     #0a0a0a;
  --glass:      rgba(255,255,255,.66);
  --glass-2:    rgba(248,247,244,.6);
  --hair:       rgba(20,20,22,.08);
  --hair-soft:  rgba(20,20,22,.05);
  --good:       #1f7a4d;
  --good-ink:   #eafff3;
  --warn:       #9a6213;
  --bad:        #b23b3b;
  --shadow:     0 1px 0 rgba(255,255,255,.7) inset, 0 22px 48px -30px rgba(20,20,20,.45);
  --shadow-soft:0 12px 30px -20px rgba(20,20,20,.35);
  --grain:      .02;
  color-scheme: light;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--bg-grad-a) 0%, var(--bg) 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Film grain overlay for atmosphere */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9000;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

::selection { background: var(--ink); color: var(--bg); }

/* ---- Ambient smoke canvas (behind everything) ---- */
#smoke {
  position: fixed; inset: 0;
  width: 100vw; height: 100dvh;
  z-index: 0; pointer-events: none;
  filter: blur(26px) saturate(1.05);
  opacity: .6;
  transition: opacity .8s var(--ease);
}
[data-theme="light"] #smoke { opacity: .42; filter: blur(30px); }
@media (prefers-reduced-motion: reduce) { #smoke { opacity: .35; } }
.app, .topbar, .tabbar { position: relative; z-index: 1; }


button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.mono { font-family: 'JetBrains Mono', monospace; letter-spacing: -0.02em; }

/* ---- App shell ---- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 12px) 18px calc(var(--safe-bottom) + 86px);
  position: relative;
  display: flex; flex-direction: column;
}

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 2px clamp(8px, 1.8vh, 14px);
}
.brand-link {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; cursor: pointer;
}
.brand-mark {
  width: 38px; height: 42px; flex: none;
  color: var(--ink);
  display: grid; place-items: center;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: 20px; letter-spacing: -0.03em;
}
.brand-name span { color: var(--ink-faint); }
.brand-sub {
  font-size: 10.5px; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .13em; margin-top: 3px;
  font-weight: 600; white-space: nowrap;
}
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); transition: transform .25s var(--ease), background .25s, border-color .25s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 18px; height: 18px; }
.lang-btn {
  width: auto; padding: 0 13px; font-weight: 700; font-size: 12px;
  letter-spacing: .04em; font-family: 'JetBrains Mono', monospace;
}

/* ============================================================
   SPLASH — animated AV logo that resolves into static header
   ============================================================ */
#splash {
  position: fixed; inset: 0; z-index: 9999;
  background:
    radial-gradient(130% 90% at 50% 40%, var(--bg-grad-a) 0%, var(--bg) 60%),
    var(--bg);
  display: grid; place-items: center;
  transition: opacity .6s var(--ease), visibility .6s;
}
#splash.done { opacity: 0; visibility: hidden; }
.splash-stage { position: relative; display: grid; place-items: center; }
.splash-logo {
  width: 132px; height: 146px; color: var(--ink);
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.55));
}
.splash-logo svg { width: 100%; height: 100%; overflow: visible; }
/* the AV path drawn as a stroke first, then filled */
.splash-logo .av-stroke {
  fill: transparent;
  stroke: var(--ink);
  stroke-width: 14;
  stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 5200;
  stroke-dashoffset: 5200;
  animation: av-draw 1.25s var(--ease-out) forwards;
}
.splash-logo .av-fill {
  fill: var(--ink);
  opacity: 0;
  animation: av-fill .6s var(--ease) .95s forwards;
}
@keyframes av-draw { to { stroke-dashoffset: 0; } }
@keyframes av-fill { from { opacity: 0; } to { opacity: 1; } }

/* hex ring that breathes behind the logo */
.splash-ring {
  position: absolute; width: 220px; height: 220px;
  border: 1px solid var(--line); border-radius: 40px;
  transform: rotate(45deg) scale(.6); opacity: 0;
  animation: ring-in 1.4s var(--ease-out) .2s forwards;
}
.splash-ring.r2 { width: 290px; height: 290px; animation-delay: .35s; opacity: 0; }
@keyframes ring-in {
  0% { transform: rotate(45deg) scale(.5); opacity: 0; }
  60% { opacity: .9; }
  100% { transform: rotate(45deg) scale(1); opacity: .5; }
}
.splash-word {
  position: absolute; bottom: -54px; left: 50%; transform: translateX(-50%) translateY(8px);
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700;
  font-size: 22px; letter-spacing: -0.02em; opacity: 0; white-space: nowrap;
  animation: word-in .6s var(--ease) 1.15s forwards;
}
.splash-word span { color: var(--ink-faint); }
@keyframes word-in { to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* reveal of the app under the splash */
.app { opacity: 0; }
.app.revealed { animation: app-in .7s var(--ease-out) forwards; }
@keyframes app-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   CARDS / blocks
   ============================================================ */
.card {
  /* soft raised region of one continuous surface — no hard outline, no
     glass tile. A faint top-lit gradient gives depth without "cube" edges. */
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--ink) 4%, transparent) 0%,
      color-mix(in srgb, var(--ink) 2%, transparent) 100%);
  border: none;
  border-radius: var(--radius);
  box-shadow: none;
  position: relative;
}
[data-theme="light"] .card {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, #fff 70%, transparent) 0%,
      color-mix(in srgb, #fff 42%, transparent) 100%);
}
.card + .card { margin-top: clamp(7px, 1.6vh, 10px); }
.card-pad { padding: clamp(12px, 2.6vh, 16px); }

.reveal { opacity: 0; transform: translateY(14px); }
.revealed .reveal { animation: rise .65s var(--ease-out) forwards; }
.revealed .reveal:nth-child(1){animation-delay:.04s}
.revealed .reveal:nth-child(2){animation-delay:.10s}
.revealed .reveal:nth-child(3){animation-delay:.16s}
.revealed .reveal:nth-child(4){animation-delay:.22s}
.revealed .reveal:nth-child(5){animation-delay:.28s}
@keyframes rise { to { opacity: 1; transform: none; } }
/* Fallback for reveal nodes that live inside a screen which gets display:none
   on tab switch. Some in-app WebViews (Telegram) cancel a running forwards
   animation when the element is hidden and DON'T restart it when it becomes
   visible again — leaving the node stuck at the base opacity:0 (blank tab).
   For the active screen, make the resting state visible so a cancelled/never-
   replayed animation falls back to shown, not hidden. The rise still plays. */
.screen.active .reveal { opacity: 1; }

.eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-faint);
}
.section-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; letter-spacing: -0.02em;
}

/* ============================================================
   HERO — subscription status (the corrected home concept)
   ============================================================ */
.hero {
  background: transparent;
  border: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: none;
  padding-left: 4px; padding-right: 4px;
  overflow: visible;
}
[data-theme="light"] .hero { background: transparent; }
.hero-grid { display: none; }
.hero-grid--unused {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(80% 80% at 80% 0%, #000, transparent 75%);
          mask-image: radial-gradient(80% 80% at 80% 0%, #000, transparent 75%);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; }
.status-dot {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.status-dot i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint);
  position: relative;
}
.status-dot.on i { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); }
.status-dot.on i::after {
  content:""; position:absolute; inset:-4px; border-radius:50%;
  border:1px solid var(--good); opacity:.6; animation: ping 1.8s var(--ease-out) infinite;
}
@keyframes ping { 0%{transform:scale(.6);opacity:.7} 100%{transform:scale(2.4);opacity:0} }
.status-dot.off i { background: var(--ink-faint); }

.hero-hex {
  width: clamp(28px, 6.4vh, 36px); height: clamp(31px, 7vh, 39px); color: var(--ink);
  opacity: .9; flex: none;
}
.hero-hex svg { width: 100%; height: 100%; }

.plan-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: clamp(21px, 5.2vh, 28px); letter-spacing: -0.03em;
  margin-top: clamp(1px, 0.4vh, 4px); line-height: 1.05;
}
.plan-meta { margin-top: clamp(4px, 1.1vh, 7px); color: var(--ink-soft); font-size: 13.5px; font-weight: 500; }
.plan-meta b { color: var(--ink); font-weight: 700; }

/* big countdown chip */
.countdown {
  margin-top: clamp(7px, 1.7vh, 12px); display: inline-flex; align-items: baseline; gap: 8px;
  padding: clamp(7px, 1.5vh, 10px) 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.countdown .num {
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
  font-size: clamp(20px, 4.6vh, 26px); letter-spacing: -0.04em; line-height: 1;
}
.countdown .unit { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.countdown.forever .num { font-family: 'Bricolage Grotesque',sans-serif; font-size: 22px; }

/* day counter + compact upgrade badge share one row, aligned by their boxes */
.hero-cd-row { display:flex; align-items:stretch; gap:10px; flex-wrap:wrap; }
.hero-cd-row .countdown { margin-top:0; }
/* upgrade pill — soft ink-tinted accent chip beside the plan name. Inviting,
   but quieter than the primary CTA. */
.hero-upbadge {
  position:relative; overflow:hidden; flex:none;
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 13px; border-radius:var(--radius-pill); cursor:pointer;
  background:color-mix(in srgb, var(--ink) 9%, transparent);
  border:1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  color:var(--ink);
  font-family:'Bricolage Grotesque',sans-serif; font-weight:700; font-size:12.5px; letter-spacing:-.01em;
  white-space:nowrap;
  transition: transform .14s var(--ease), background .2s, border-color .2s;
}
.hero-upbadge:hover { background:color-mix(in srgb, var(--ink) 15%, transparent); border-color:color-mix(in srgb, var(--ink) 32%, transparent); }
/* slow light sweep — draws the eye every few seconds, then rests. A long
   idle gap (12s cycle, ~1s of travel) keeps it a glance, not a frantic loop. */
.hero-upbadge::before {
  content:""; position:absolute; top:0; bottom:0; left:-140%; width:60%;
  background:linear-gradient(100deg, transparent, color-mix(in srgb,var(--ink) 16%,transparent), transparent);
  transform:skewX(-18deg); pointer-events:none;
  animation: upbadge-sweep 12s var(--ease) 2.5s infinite;
}
@keyframes upbadge-sweep {
  0% { left:-140%; } 12% { left:140%; } 100% { left:140%; }
}
.hero-upbadge svg { width:15px; height:15px; color:var(--ink); flex:0 0 auto;
  animation: upbadge-nudge 12s var(--ease) 2.5s infinite; }
/* arrow lifts in time with the sweep — the chip "breathes" upward toward the offer */
@keyframes upbadge-nudge {
  0%,8%,16%,100% { transform:translateY(0); } 11% { transform:translateY(-2px); }
}
.hero-upbadge svg, .hero-upbadge span { position:relative; z-index:1; }
.hero-upbadge:active { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) {
  .hero-upbadge { transition:none; }
  .hero-upbadge::before, .hero-upbadge svg { animation:none; }
}

.expiring {
  margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  color: var(--warn); font-size: 13px; font-weight: 600;
  display: flex; gap: 9px; align-items: center;
}
.expiring svg { width: 17px; height: 17px; flex: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: clamp(11px, 2.3vh, 14px) 20px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  transition: transform .2s var(--ease), background .25s, opacity .25s, border-color .25s;
  position: relative; overflow: hidden;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .4; pointer-events: none; }

.btn-primary { background: var(--inverse); color: var(--inverse-ink); }
.btn-primary::after {
  content:""; position:absolute; top:0; left:-130%; width:60%; height:100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-18deg);
}
[data-theme="light"] .btn-primary::after { background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent); }
.btn-primary.shine::after { animation: shine 2.6s var(--ease) infinite; }
@keyframes shine { 0%{left:-130%} 55%{left:130%} 100%{left:130%} }

.btn-ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-line { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-sm { padding: 12px 16px; font-size: 13.5px; width: auto; border-radius: 12px; }
.btn-row { display: flex; gap: 9px; }
.btn-row .btn { width: auto; flex: 1; white-space: nowrap; }

.btn-stack { display: flex; flex-direction: column; gap: clamp(7px, 1.6vh, 9px); margin-top: clamp(8px, 1.9vh, 12px); }

/* tiny spinner */
.spin {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor; animation: rot .7s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ============================================================
   PILLS / STAT chips
   ============================================================ */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 15px 16px;
}
.stat-val {
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
  font-size: 24px; letter-spacing: -0.04em; line-height: 1;
}
.stat-lbl { font-size: 11px; color: var(--ink-faint); font-weight: 600; margin-top: 7px;
  text-transform: uppercase; letter-spacing: .08em; }

/* ============================================================
   TRAFFIC bars
   ============================================================ */
.traffic-bar-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:9px; }
.traffic-buy {
  display:inline-flex; align-items:center; gap:5px; cursor:pointer;
  padding:5px 11px; border-radius:99px;
  background:var(--surface-3); border:1px solid var(--line); color:var(--ink-soft);
  font-size:11.5px; font-weight:700; white-space:nowrap;
  transition: border-color .2s, color .2s, transform .12s var(--ease);
}
.traffic-buy svg { width:13px; height:13px; }
.traffic-buy:hover { border-color:var(--ink); color:var(--ink); }
.traffic-buy:active { transform:scale(.95); }
.traffic-node { margin-top: 7px; }
.traffic-node:first-child { margin-top: 0; }
.traffic-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.traffic-head .nm { font-weight: 600; color: var(--ink); }
.traffic-head .vl { font-family:'JetBrains Mono',monospace; color: var(--ink-soft); font-size: 11.5px; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--ink);
  width: 0; transition: width 1s var(--ease-out); }
.bar.over > i { background: var(--bad); }
.bar.low > i { background: var(--warn, #d99a2b); }
.traffic-foot { display:flex; justify-content:flex-end; margin-top:5px;
  font-size:11px; font-weight:600; color:var(--ink-faint);
  font-family:'JetBrains Mono',monospace; }

/* combined traffic card: main + limited nodes in one card, split by a hairline */
.traffic-divider { height:1px; background:var(--line); margin:12px 0; }
.traffic-section .traffic-bar-head { margin-bottom:9px; }

/* ============================================================
   BOTTOM TAB BAR
   ============================================================ */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw); z-index: 200;
  padding: 0 14px calc(var(--safe-bottom) + 12px);
  pointer-events: none;
}
.tabbar-inner {
  pointer-events: auto;
  display: flex; align-items: stretch; justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
          backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--hair); border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.6);
  padding: 7px;
  position: relative;
}
/* selection indicator: a small dot under the active tab (no big pill) */
.tab-thumb {
  position: absolute; left: 0; bottom: 8px; height: 4px; width: 4px;
  border-radius: 99px; background: var(--ink);
  transition: left .4s var(--ease-out), opacity .3s;
  z-index: 1; pointer-events: none;
}
.tab {
  flex: 1; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 0 9px; color: var(--ink-faint);
  transition: color .3s var(--ease);
  position: relative; min-width: 0;
}
.tab svg { width: 21px; height: 21px; transition: transform .3s var(--ease), opacity .3s; opacity: .85; }
.tab span { font-size: 9.5px; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.active { color: var(--ink); }
.tab.active svg { transform: translateY(-1px); opacity: 1; }
.tab:active svg { transform: scale(.86); }

/* ============================================================
   SCREENS (tab pages)
   ============================================================ */
.screen { display: none; }
.screen.active { display: block; animation: screen-in .52s var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .screen.active { animation: screen-in-rm .2s ease; }
}
/* desktop-only sidebar nav — hidden until the ≥920px is-web rule reveals it */
.side-nav { display: none; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(6px); }
  60%  { filter: blur(0); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes screen-in-rm { from { opacity: 0; } to { opacity: 1; } }
.screen-head { margin: 4px 2px 16px; }
.screen-head h1 {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 27px; letter-spacing: -0.035em; line-height: 1;
}
.screen-head p { color: var(--ink-soft); font-size: 13.5px; margin-top: 8px; }

/* ============================================================
   PLANS — interactive wheel picker (drag/scroll, centre = selected)
   ============================================================ */
.picker { display:flex; flex-direction:column; gap:16px; }
/* plan switch scrolls horizontally so any count of plans fits */
.plan-seg { margin-bottom:0; overflow-x:auto; flex-wrap:nowrap; scrollbar-width:none; -ms-overflow-style:none; }
.plan-seg::-webkit-scrollbar { display:none; }
.plan-seg button { flex:0 0 auto; white-space:nowrap; }

/* the wheel: horizontal scroll-snap rail; centre chip is the selection */
.dur-wheel-wrap { position:relative; }
.dur-arrow {
  position:absolute; top:50%; transform:translateY(-50%); z-index:3;
  width:36px; height:36px; display:grid; place-items:center;
  border-radius:50%; cursor:pointer;
  background:var(--surface-3); border:1.5px solid var(--line); color:var(--ink);
  box-shadow:0 2px 10px rgba(0,0,0,.16);
  transition: opacity .2s var(--ease), transform .12s var(--ease), background .2s;
}
.dur-arrow.prev { left:6px; }
.dur-arrow.next { right:6px; }
.dur-arrow svg { width:18px; height:18px; }
.dur-arrow:active { transform:translateY(-50%) scale(.9); }
.dur-arrow.off { opacity:0; pointer-events:none; }
@media (prefers-reduced-motion: reduce) { .dur-arrow { transition:none; } }
.dur-wheel {
  display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory;
  scrollbar-width:none; -ms-overflow-style:none;
  /* side padding = half the viewport so the first/last chip can reach centre */
  padding: 14px 50%;
  -webkit-overflow-scrolling:touch; cursor:grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
}
.dur-wheel::-webkit-scrollbar { display:none; }
.dur-wheel.drag { cursor:grabbing; }
.dur {
  position:relative; flex:0 0 132px; scroll-snap-align:center;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  padding:20px 10px 17px; border-radius:20px; cursor:pointer;
  background:var(--surface-2); border:1.5px solid transparent;
  transform-origin:center center;
  transition: border-color .22s var(--ease), background .22s;
  will-change: transform, opacity;
}
.dur.sel { border-color: var(--ink); background: var(--surface-3); }
.dur-top { font-family:'Bricolage Grotesque',sans-serif; font-weight:700; font-size:17px; letter-spacing:-.02em; white-space:nowrap; }
.dur-mo { font-size:11px; color:var(--ink-faint); font-weight:600; white-space:nowrap; }
.dur-save {
  position:absolute; top:-9px; left:50%; transform:translateX(-50%);
  font-size:9px; font-weight:800; letter-spacing:.04em; white-space:nowrap;
  background:var(--good); color:var(--good-ink); padding:2px 8px; border-radius:99px;
}
.dur.sel .dur-top { color:var(--ink); }

.price-panel { text-align:center; padding:2px 0 2px; }
.pp-total { display:flex; align-items:baseline; justify-content:center; gap:10px; }
.pp-num { display:inline-block; font-family:'Bricolage Grotesque',sans-serif; font-weight:800; font-size:42px;
  letter-spacing:-.04em; line-height:1; }
.pp-stars { font-size:13px; color:var(--ink-faint); font-weight:600; }
.pp-sub { font-size:12.5px; color:var(--ink-soft); margin-top:8px; }
.pp-forecast {
  display:inline-flex; align-items:center; gap:7px; margin-top:10px;
  padding:7px 13px; border-radius:99px;
  background:var(--surface-3); border:1.5px solid var(--line);
  font-size:12.5px; color:var(--ink-soft); font-weight:600;
}
.pp-forecast svg { width:15px; height:15px; color:var(--ink-faint); flex:0 0 auto; }
.pp-forecast b { color:var(--ink); font-weight:800; }
.pp-forecast-bonus { color:var(--good); font-weight:800; }
.pp-desc { font-size:12.5px; color:var(--ink-faint); margin-top:10px; line-height:1.5;
  max-width:340px; margin-left:auto; margin-right:auto; }
.pp-num.bump { animation: pp-bump .34s var(--ease-out); }
@keyframes pp-bump { 0%{transform:translateY(3px) scale(.92);opacity:.3} 100%{transform:none;opacity:1} }

/* ── deferred activation: plan relation badge, defer note, chooser ── */
.plan-rel {
  display:inline-flex; align-items:center; gap:7px; align-self:center;
  font-size:11px; font-weight:800; letter-spacing:.05em; text-transform:uppercase;
  padding:6px 13px; border-radius:99px; margin-bottom:2px;
  border:1px solid var(--hair); background:var(--glass-2);
}
.plan-rel-dot { width:7px; height:7px; border-radius:50%; background:var(--ink-soft); }
.plan-rel.is-up { color:var(--ink); border-color:color-mix(in srgb,var(--ink) 26%,transparent); }
.plan-rel.is-up .plan-rel-dot { background:var(--ink); box-shadow:0 0 0 4px color-mix(in srgb,var(--ink) 14%,transparent); }
.plan-rel.is-down { color:var(--warn); border-color:color-mix(in srgb,var(--warn) 32%,transparent); }
.plan-rel.is-down .plan-rel-dot { background:var(--warn); }
.plan-rel.is-current { color:var(--ink-soft); }

.defer-note {
  font-size:12px; color:var(--warn); text-align:center; line-height:1.5;
  margin-top:-2px; padding:0 6px;
}
.btn-primary.is-up::after { animation: shine 1.8s var(--ease) infinite; }

.defer-opts { display:flex; flex-direction:column; gap:12px; margin-top:8px; }
.defer-opt {
  text-align:left; padding:16px; border-radius:var(--radius-sm); cursor:pointer;
  border:1px solid var(--hair); background:var(--glass-2);
  transition: border-color .2s, transform .15s var(--ease), background .2s;
}
.defer-opt:active { transform:scale(.99); }
.defer-opt:hover { border-color:color-mix(in srgb,var(--ink) 24%,transparent); }
.defer-opt-t { font-weight:800; font-size:15px; }
.defer-opt-d { font-size:12.5px; color:var(--ink-soft); margin-top:5px; line-height:1.45; }

.pending-banner { border:1px solid color-mix(in srgb,var(--warn) 24%,transparent); }
.pending-row { display:flex; align-items:center; gap:14px; }
.pending-ic {
  width:40px; height:40px; flex:none; border-radius:12px; display:grid; place-items:center;
  color:var(--warn); background:color-mix(in srgb,var(--warn) 14%,transparent);
}
.pending-ic svg { width:21px; height:21px; }
.pending-title { font-weight:800; font-size:14px; }
.pending-sub { font-size:12.5px; color:var(--ink-soft); margin-top:3px; line-height:1.45; }

/* ── contextual upsell card (live cross-sell on Home) — REMOVED, replaced by
   the compact .hero-upbadge inside the hero. ── */

.plan-folder { border:1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 12px; background: var(--surface-2); }
.plan-folder-head { display:flex; align-items:center; gap:12px; padding:15px 16px; cursor:pointer; }
.plan-folder-head .pf-name { font-weight:700; font-size:15px; }
.plan-folder-head .pf-desc { font-size:12px; color:var(--ink-faint); margin-top:2px; }
.plan-folder-head .chev { margin-left:auto; transition: transform .3s var(--ease); color:var(--ink-faint); }
.plan-folder.open .chev { transform: rotate(180deg); }
.plan-folder-body { display:none; padding: 0 12px 12px; }
.plan-folder.open .plan-folder-body { display:block; }

.period {
  display:flex; align-items:center; gap:14px;
  padding:15px 16px; border-radius: 13px; cursor:pointer;
  border:1px solid var(--line); background: var(--surface);
  transition: border-color .2s, background .2s, transform .15s var(--ease);
  margin-top: 10px; position: relative;
}
.period:active { transform: scale(.99); }
.period.sel { border-color: var(--ink); background: var(--surface-3); }
.period-radio {
  width:20px; height:20px; border-radius:50%; border:2px solid var(--line);
  flex:none; display:grid; place-items:center; transition: border-color .2s;
}
.period.sel .period-radio { border-color: var(--ink); }
.period.sel .period-radio::after { content:""; width:10px; height:10px; border-radius:50%; background:var(--ink); }
.period-main { flex:1; min-width:0; }
.period-label { font-weight:700; font-size:14.5px; }
.period-sub { font-size:11.5px; color:var(--ink-faint); margin-top:3px; }
.period-price { text-align:right; }
.period-price .now { font-family:'JetBrains Mono',monospace; font-weight:600; font-size:17px; letter-spacing:-.03em; }
.period-price .was { font-size:11.5px; color:var(--ink-faint); text-decoration:line-through; }

/* ---- traffic top-up picker (choose main vs whitelists) ---- */
.tt-pick-list { display:flex; flex-direction:column; gap:10px; margin-top:4px; }
.tt-pick {
  display:flex; align-items:center; gap:14px; width:100%; text-align:left;
  padding:15px 16px; border-radius:14px; cursor:pointer;
  border:1px solid var(--line); background:var(--surface);
  transition: border-color .2s, background .2s, transform .15s var(--ease);
  opacity:0; transform:translateY(10px);
  animation: tt-pick-in .5s var(--ease-out) forwards;
}
.tt-pick:nth-child(1){ animation-delay:.05s; }
.tt-pick:nth-child(2){ animation-delay:.12s; }
@keyframes tt-pick-in { to { opacity:1; transform:none; } }
.tt-pick:hover { border-color:var(--ink); background:var(--surface-3); }
.tt-pick:active { transform:scale(.985); }
.tt-pick-ic {
  width:42px; height:42px; flex:none; border-radius:12px;
  display:grid; place-items:center; background:var(--surface-2); color:var(--ink);
}
.tt-pick-ic svg { width:21px; height:21px; }
.tt-pick-tx { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.tt-pick-t { font-family:'Bricolage Grotesque',sans-serif; font-weight:700; font-size:15px; letter-spacing:-.01em; }
.tt-pick-s { font-size:12px; color:var(--ink-faint); }
.tt-pick-go { flex:none; color:var(--ink-faint); display:grid; place-items:center;
  transition: transform .2s var(--ease), color .2s; }
.tt-pick-go svg { width:18px; height:18px; }
.tt-pick:hover .tt-pick-go { transform:translateX(3px); color:var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .tt-pick { animation:none; opacity:1; transform:none; }
}
.badge {
  display:inline-block; font-size:9.5px; font-weight:800; letter-spacing:.06em;
  text-transform:uppercase; padding:3px 8px; border-radius:99px;
  background: var(--inverse); color: var(--inverse-ink); margin-left:6px;
}
.badge.disc { background: color-mix(in srgb, var(--good) 90%, #000); color:#06190f; }

/* ============================================================
   PAYMENT methods
   ============================================================ */
.pay-method {
  display:flex; align-items:center; gap:14px; width:100%;
  padding:16px; border-radius:13px; margin-top:10px;
  border:1px solid var(--line); background:var(--surface-2);
  transition: border-color .2s, background .2s, transform .15s var(--ease);
}
.pay-method:active { transform: scale(.99); }
.pay-method:hover { border-color: var(--ink-faint); }
.pay-ic { width:42px; height:42px; border-radius:11px; flex:none;
  display:grid; place-items:center; background:var(--surface); border:1px solid var(--line); }
.pay-ic svg { width:21px; height:21px; }
/* brand marks keep their native aspect ratio (card/sbp are wide/tall) */
.pay-ic .pi-card { width:30px; height:auto; }
.pay-ic .pi-sbp { width:auto; height:24px; }
.pay-ic .pi-crypto, .pay-ic .pi-stars { width:22px; height:22px; }
.pay-tx { flex:1; text-align:left; }
.pay-tx .t { font-weight:700; font-size:14.5px; }
.pay-tx .s { font-size:11.5px; color:var(--ink-faint); margin-top:2px; }
.pay-go { color:var(--ink-faint); }

.promo-wrap { display:flex; gap:9px; margin-top:14px; }
.input {
  width:100%; padding:14px 15px; border-radius:12px;
  background:var(--surface-2); border:1px solid var(--line); color:var(--ink);
  font-size:14.5px; transition:border-color .2s;
}
.input:focus { outline:none; border-color: var(--ink-faint); }
.input::placeholder { color: var(--ink-faint); }
.field-lbl { font-size:12px; font-weight:600; color:var(--ink-soft); margin:14px 0 7px; }
.field-err { color: var(--bad); font-size:12px; margin-top:7px; min-height: 1em; }
.field-ok { color: var(--good); font-size:12px; margin-top:7px; }

/* ============================================================
   SHEETS / MODALS
   ============================================================ */
.scrim {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
}
.scrim.show { opacity: 1; visibility: visible; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: var(--maxw); z-index: 510;
  background: var(--surface);
  /* own stacking context so the scrim's blur never bleeds onto sheet content */
  isolation: isolate;
  border: 1px solid var(--hair); border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px 18px calc(var(--safe-bottom) + 22px);
  max-height: 92dvh; overflow-y: auto;
  transition: transform .45s var(--ease-out);
  box-shadow: 0 -30px 60px -30px rgba(0,0,0,.7);
}
.sheet.show { transform: translateX(-50%) translateY(0); }
.sheet-grip { width:40px; height:4px; border-radius:99px; background:var(--line);
  margin: 4px auto 14px; }
.sheet-head { display:flex; align-items:center; gap:12px; margin-bottom:6px; }
.sheet-title { font-family:'Bricolage Grotesque',sans-serif; font-weight:700; font-size:20px;
  letter-spacing:-.02em; }
.sheet-x { margin-left:auto; width:34px; height:34px; border-radius:50%;
  background:var(--surface-2); border:1px solid var(--line); display:grid; place-items:center;
  color:var(--ink-soft); }
.sheet-x:active { transform: scale(.9); }
.sheet-sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 8px; }
.sheet-foot { position: sticky; bottom: 0; padding-top: 14px; margin-top: 6px;
  background: linear-gradient(to top, var(--surface) 70%, transparent); }

/* centered dialog (small confirms) on wide screens & for confirms */
.dialog { max-width: 400px; border-radius: var(--radius-lg); border-bottom: 1px solid var(--line);
  bottom: auto; top: 50%; transform: translate(-50%,-46%) scale(.96); opacity:0; }
.dialog.show { transform: translate(-50%,-50%) scale(1); opacity:1; }

/* loading lines */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.center-load { display:grid; place-items:center; padding: 40px 0; color: var(--ink-faint); gap: 14px; }

/* ============================================================
   CONNECT WIZARD  (Install → Import → Ready) — premium, ref-matched
   ============================================================ */
.wiz {
  display: flex; flex-direction: column;
  min-height: min(64dvh, 540px);
}
.wiz-top { display:flex; align-items:center; justify-content:center; margin: 2px 0 4px; position: relative; }
.wiz-stepper { display:flex; align-items:center; gap:8px; }
.wiz-stepper .dot {
  width:7px; height:7px; border-radius:50%; background:var(--line);
  transition: background .4s var(--ease), width .4s var(--ease), transform .4s var(--ease);
}
.wiz-stepper .dot.on { background: var(--ink); }
.wiz-stepper .dot.cur { width:22px; border-radius:99px; background: var(--ink); }
.wiz-stepcount {
  position:absolute; right:0; top:50%; transform:translateY(-50%);
  font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--ink-faint);
  letter-spacing:.02em;
}

/* stage holds the centered hero; grows to push CTA to bottom */
.wiz-body { flex:1; display:flex; flex-direction:column; justify-content:center;
  text-align:center; padding: 8px 0 6px; }

/* the signature hexagon medallion */
.wiz-hex {
  width: 104px; height: 114px; margin: 0 auto;
  position: relative; color: var(--ink);
  animation: hex-pop .7s var(--ease-out) both;
}
@keyframes hex-pop { 0%{opacity:0; transform:translateY(14px) scale(.9)} 100%{opacity:1; transform:none} }
.wiz-hex .hex-ring {
  position:absolute; inset:50% auto auto 50%; width:128px; height:128px;
  transform: translate(-50%,-50%) rotate(45deg); border:1px solid var(--line);
  border-radius:28px; opacity:.75;
  animation: hex-breathe 4s var(--ease) infinite;
}
.wiz-hex .hex-ring.r2 { width:158px; height:158px; opacity:.45; animation-delay:.4s; }
@keyframes hex-breathe { 0%,100%{transform:translate(-50%,-50%) rotate(45deg) scale(1); opacity:.75} 50%{transform:translate(-50%,-50%) rotate(45deg) scale(1.08); opacity:.25} }
.wiz-hex .hex-core { position:absolute; inset:0; }
.wiz-hex svg.hex-shape { width:100%; height:100%; display:block; }
.wiz-hex .hex-glyph {
  position:absolute; inset:0; display:grid; place-items:center;
}
.wiz-hex .step-num {
  font-family:'Bricolage Grotesque',sans-serif; font-weight:800; font-size:38px;
  line-height:1; color: var(--ink);
}
/* pulse lives on the hex outline, not the number */
.wiz-hex .hex-shape path {
  animation: hex-stroke-pulse 2.2s cubic-bezier(0.4,0,0.6,1) infinite;
}
@keyframes hex-stroke-pulse {
  0%,100% { stroke-opacity:.45; stroke-width:1.5; }
  50%      { stroke-opacity:1;  stroke-width:2.2; }
}
@media (prefers-reduced-motion: reduce) {
  .wiz-hex .hex-shape path { animation: none; stroke-opacity: .6; }
}
.wiz-hex .brand-av { width:42px; height:46px; color:var(--ink); }
/* check for the final step */
.wiz-hex .done-check { width:44px; height:44px; }
.wiz-hex .done-check circle { stroke:var(--good); }
.wiz-hex .done-check path { stroke:var(--good);
  stroke-dasharray:40; stroke-dashoffset:40; animation: draw-check .5s var(--ease-out) .2s forwards; }
@keyframes draw-check { to { stroke-dashoffset:0; } }

.wiz-title { font-family:'Bricolage Grotesque',sans-serif; font-weight:800; font-size:23px;
  letter-spacing:-.035em; margin-top:16px; animation: rise .55s var(--ease-out) .08s both; }
.wiz-desc { color:var(--ink-soft); font-size:13.5px; margin-top:8px; line-height:1.5;
  max-width: 320px; margin-left:auto; margin-right:auto;
  animation: rise .55s var(--ease-out) .14s both; }

/* footer pinned CTA region */
.wiz-foot { padding-top: 12px; animation: rise .55s var(--ease-out) .2s both; }

/* device toggle accordion */
.device-toggle { transition: opacity .15s; }
.device-toggle .device-chev { transition: transform .22s var(--ease); }
#wiz-device-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .32s cubic-bezier(0.23,1,0.32,1), opacity .25s var(--ease);
}
#wiz-device-panel.open {
  max-height: 300px;
  opacity: 1;
}

/* platform selector — refined, real brand logos */
.platform-scroll { animation: rise .55s var(--ease-out) .16s both; }
.platform-grid { display:grid; grid-template-columns: repeat(4,1fr); gap:7px; margin-top:8px; }
.platform-chip {
  display:flex; flex-direction:column; align-items:center; gap:6px;
  padding:10px 4px 8px; border-radius:13px; border:1px solid var(--line);
  background:var(--surface-2); transition: border-color .2s, background .2s, transform .15s var(--ease);
  position: relative;
}
.platform-chip:active { transform: scale(.94); }
.platform-chip.sel { border-color: var(--ink); background: var(--surface-3); box-shadow: 0 0 0 1px var(--ink) inset; }
.platform-chip .plat-logo { width:23px; height:23px; display:grid; place-items:center; }
.platform-chip .plat-logo svg { width:100%; height:100%; }
.platform-chip span { font-size:10.5px; font-weight:600; letter-spacing:-.01em; }
.platform-chip.sel::after {
  content:""; position:absolute; top:7px; right:7px; width:6px; height:6px;
  border-radius:50%; background:var(--ink);
}
.platform-chip .det {
  position:absolute; top:-7px; left:50%; transform:translateX(-50%);
  font-size:8px; font-weight:800; text-transform:uppercase; letter-spacing:.1em;
  background:var(--inverse); color:var(--inverse-ink); padding:2px 7px; border-radius:99px;
  white-space:nowrap;
}

.key-box {
  display:flex; align-items:center; gap:10px; margin-top:14px;
  padding:14px 15px; border-radius:14px; background:var(--surface-2); border:1px solid var(--line);
}
.key-box code { font-family:'JetBrains Mono',monospace; font-size:12px; color:var(--ink-soft);
  flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.key-box button { color:var(--ink); flex:none; width:34px; height:34px; display:grid; place-items:center;
  border-radius:9px; background:var(--surface); border:1px solid var(--line); transition: transform .15s var(--ease); }
.key-box button:active { transform: scale(.88); }

.note {
  display:flex; gap:10px; align-items:flex-start; margin-top:14px; padding:13px 15px;
  border-radius:13px; background:var(--surface-2); border:1px solid var(--line);
  font-size:12.5px; color:var(--ink-soft); text-align:left; line-height:1.5;
}
.note svg { width:16px; height:16px; flex:none; margin-top:1px; color:var(--ink-faint); }
.note.warn { border-color: color-mix(in srgb,var(--warn) 35%,transparent);
  background: color-mix(in srgb,var(--warn) 10%,transparent); color: var(--warn); }
.note.warn svg { color: var(--warn); }


/* ============================================================
   REFERRAL
   ============================================================ */
.balance-big {
  font-family:'JetBrains Mono',monospace; font-weight:600; font-size:40px;
  letter-spacing:-.04em; line-height:1; margin-top: 6px;
}
.balance-sub { color:var(--ink-soft); font-size:12.5px; margin-top:8px; }
.acc-tg-head { display:flex; align-items:center; gap:13px; }
.acc-tg-mark { width:40px; height:40px; border-radius:11px; flex:none; display:grid; place-items:center;
  background: color-mix(in srgb, #229ED9 22%, transparent); color:#229ED9; }
[data-theme="light"] .acc-tg-mark { background: color-mix(in srgb, #229ED9 16%, transparent); }
.ref-link {
  display:flex; align-items:center; gap:10px; margin-top:6px;
  padding:13px 14px; border-radius:12px; background:var(--surface-2); border:1px solid var(--line);
}
.ref-link code { font-family:'JetBrains Mono',monospace; font-size:12px; color:var(--ink-soft);
  flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.list-row { display:flex; align-items:center; gap:12px; padding:13px 2px; border-bottom:1px solid var(--line-soft); }
.list-row:last-child { border-bottom:none; }
.list-row .lr-main { flex:1; }
.list-row .lr-t { font-weight:600; font-size:14px; }
.list-row .lr-s { font-size:11.5px; color:var(--ink-faint); margin-top:2px; }
.tag { font-size:10.5px; font-weight:700; padding:4px 9px; border-radius:99px;
  background:var(--surface-3); color:var(--ink-soft); }
.tag.ok { color:var(--good); background: color-mix(in srgb,var(--good) 16%,transparent); }
.tag.pend { color:var(--warn); background: color-mix(in srgb,var(--warn) 16%,transparent); }
.tag.err { color:var(--bad); background: color-mix(in srgb,var(--bad) 16%,transparent); }

/* segmented control */
.seg { display:flex; gap:4px; padding:4px; border-radius:12px; background:var(--surface-2);
  border:1px solid var(--line); }
.seg button { flex:1; padding:10px; border-radius:9px; font-weight:600; font-size:13px;
  color:var(--ink-soft); transition: background .2s, color .2s; }
.seg button.on { background: var(--inverse); color: var(--inverse-ink); }

/* ============================================================
   HELP / FAQ
   ============================================================ */
.faq { border:1px solid var(--line); border-radius:14px; overflow:hidden; background:var(--surface-2); }
.faq-q { display:flex; align-items:center; gap:12px; padding:16px; cursor:pointer; font-weight:600; font-size:14px; }
.faq-q .chev { margin-left:auto; color:var(--ink-faint); transition: transform .3s var(--ease); }
.faq.open .chev { transform: rotate(180deg); }
.faq-a { display:none; padding:0 16px 16px; color:var(--ink-soft); font-size:13.5px; line-height:1.6; }
.faq.open .faq-a { display:block; animation: rise .3s var(--ease-out); }
.link-row { display:flex; align-items:center; gap:14px; padding:16px; border-radius:14px;
  border:1px solid var(--line); background:var(--surface-2); margin-top:10px; }
.link-row svg.lead { width:20px; height:20px; color:var(--ink); flex:none; }
.link-row .lr-main{flex:1}
.link-row .go { color:var(--ink-faint); }

/* ============================================================
   TOAST
   ============================================================ */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 92px);
  transform: translateX(-50%) translateY(20px);
  z-index: 9500; max-width: calc(var(--maxw) - 40px);
  background: var(--inverse); color: var(--inverse-ink);
  padding: 13px 20px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: opacity .3s, transform .3s var(--ease-out), visibility .3s;
  text-align: center;
}
#toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ============================================================
   RESPONSIVE — desktop / browser
   ============================================================ */
@media (min-width: 720px) {
  :root { --maxw: 520px; }
  .app { padding-top: calc(var(--safe-top) + 34px); }
  .screen-head h1 { font-size: 30px; }
  .plan-name { font-size: 34px; }
}

/* Browser (non-Telegram): real website layout — sidebar + wide content.
   body.is-web toggled on by JS only outside Telegram. */
@media (min-width: 920px) {
  body.is-web {
    background:
      radial-gradient(50% 55% at 15% 8%, color-mix(in srgb, var(--surface-3) 50%, transparent) 0%, transparent 60%),
      radial-gradient(45% 50% at 92% 95%, color-mix(in srgb, var(--surface-2) 60%, transparent) 0%, transparent 55%),
      radial-gradient(120% 80% at 50% -10%, var(--bg-grad-a) 0%, var(--bg) 55%),
      var(--bg);
  }
  /* shell becomes a two-column grid: fixed sidebar + fluid content */
  body.is-web .app {
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 256px minmax(0, 1fr);
    grid-template-areas: "side main";
    gap: 40px;
    padding: 34px 40px 40px;
    min-height: 100dvh;
  }
  /* top bar moves into the sidebar column, becomes the brand block */
  body.is-web .topbar {
    grid-area: side;
    align-self: start;
    position: sticky; top: 34px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0;
    height: max-content;
  }
  body.is-web .topbar .brand-mark { width: 44px; height: 48px; }
  body.is-web .topbar .brand-text { margin-top: 14px; }
  body.is-web .brand-name { font-size: 23px; }
  body.is-web .topbar-actions { margin: 26px 0 0; gap: 8px; }

  /* sidebar nav block injected by JS after brand */
  body.is-web .side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 30px; }
  body.is-web .side-nav .snav {
    display: flex; align-items: center; gap: 13px;
    padding: 12px 14px; border-radius: 14px; color: var(--ink-soft);
    font-weight: 600; font-size: 14.5px; transition: background .2s, color .2s;
    border: 1px solid transparent;
  }
  body.is-web .side-nav .snav svg { width: 20px; height: 20px; }
  body.is-web .side-nav .snav:hover { background: var(--surface-2); color: var(--ink); }
  body.is-web .side-nav .snav.active { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-soft); }

  /* content column */
  body.is-web #screen-home,
  body.is-web .screen { grid-area: main; }
  body.is-web .app > .screen { grid-area: main; }
  body.is-web .screen.active { display: block; }

  /* hide mobile tab bar on desktop */
  body.is-web .tabbar { display: none; }
  body.is-web .app { padding-bottom: 40px; }

  /* roomier type + 2-up grids in content */
  body.is-web .screen-head h1 { font-size: 34px; }
  body.is-web .hero .plan-name { font-size: 40px; }
  body.is-web #toast { left: auto; right: 40px; bottom: 40px; transform: translateY(20px); }
  body.is-web #toast.show { transform: translateY(0); }

  /* home: hero + side cards in two columns */
  body.is-web #home-body { display: grid; grid-template-columns: 1.4fr 1fr; column-gap: 16px; row-gap: 8px; align-items: start; }
  body.is-web #home-body > .hero { grid-column: 1 / -1; }
  body.is-web #home-body > .earn-card { margin-top: -40px; }
  body.is-web #home-body > .hero { grid-column: 1 / -1; }

  /* plans: periods in a row of cards */
  body.is-web #plans-body .card { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

  /* sheets become centered dialogs on desktop, not bottom sheets */
  body.is-web .sheet:not(.dialog) {
    bottom: auto; top: 50%; left: 50%;
    transform: translate(-50%, -46%) scale(.98);
    max-width: 460px; border: 1px solid var(--line);
    border-radius: var(--radius-lg); max-height: 88dvh;
    opacity: 0;
  }
  body.is-web .sheet:not(.dialog).show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  body.is-web .sheet-grip { display: none; }
}

/* full-width single column fallback between mobile & desktop */
@media (min-width: 600px) and (max-width: 919px) {
  :root { --maxw: 560px; }
}

/* very wide: vertical brand wordmark in corner */
@media (min-width: 1320px) {
  body.is-web::before {
    content: "ALTERVPN";
    position: fixed; left: 22px; bottom: 34px; z-index: 0;
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
    font-size: 12px; letter-spacing: .4em; color: var(--ink-faint); opacity: .4;
    writing-mode: vertical-rl; transform: rotate(180deg); pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .splash-logo .av-stroke { stroke-dashoffset: 0; }
  .splash-logo .av-fill { opacity: 1; }
}

/* ============================================================
   HOME REDESIGN — hero plan row, slim traffic bars, earn card
   ============================================================ */

/* Plan name + upgrade badge share top row; day counter sits below */
.hero-plan-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: clamp(1px, 0.4vh, 4px); flex-wrap: nowrap;
}
.hero-plan-row .plan-name { margin-top: 0; flex: 1; min-width: 0; }

/* day counter chip — own line under plan name, above the date */
.hero-days-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  margin-top: clamp(6px, 1.4vh, 10px);
  padding: 7px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.hero-days-chip .num {
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
  font-size: clamp(18px, 4vh, 22px); letter-spacing: -0.04em; line-height: 1;
  color: var(--ink);
}
.hero-days-chip .unit {
  font-size: 12px; color: var(--ink-soft); font-weight: 600;
}
.hero-days-chip.forever .num {
  font-family: 'Bricolage Grotesque', sans-serif;
}

/* Slim traffic bars — no card wrapper, right under topbar */
.btn-mid { padding: 13px 18px; font-size: 14px; border-radius: 14px; }

/* animated clock — minute hand sweeps fast, hour hand slow, both pivot at clock center (12,12) */
.clock-ico .clk-hand { transform-box: view-box; transform-origin: 12px 12px; }
.clock-ico .clk-min { animation: clk-spin 3s linear infinite; }
.clock-ico .clk-hour { animation: clk-spin 36s linear infinite; }
@keyframes clk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .clock-ico .clk-hand { animation: none; }
}

/* banknote fan — bills splay open then close; rest frame = closed (stacked).
   Opaque paper fill lets a fanned bill hide the strokes of the one behind. */
.fan-ico { display: inline-grid; place-items: center; }
.fan-ico svg { display: block; overflow: visible; }
.fan-paper { fill: #1a6b35; }
.fan-bill { transform-box: view-box; transform-origin: 12px 19.5px; }
.fan-l { animation: fan-left 3.6s var(--ease) infinite; }
.fan-r { animation: fan-right 3.6s var(--ease) infinite; }
.fan-c { animation: fan-center 3.6s var(--ease) infinite; }
@keyframes fan-left {
  0%, 14% { transform: rotate(0deg); }
  42%, 62% { transform: rotate(-40deg); }
  90%, 100% { transform: rotate(0deg); }
}
@keyframes fan-right {
  0%, 14% { transform: rotate(0deg); }
  42%, 62% { transform: rotate(40deg); }
  90%, 100% { transform: rotate(0deg); }
}
@keyframes fan-center {
  0%, 14% { transform: translateY(0); }
  42%, 62% { transform: translateY(-2px); }
  90%, 100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .fan-bill { animation: none; }
}
.slim-traffic {
  padding: 0 4px;
  display: flex; flex-direction: column;
  margin-top: clamp(6px, 1.4vh, 10px);
}
/* label sits RIGHT ON its bar (touching); breathing room only BETWEEN nodes */
.slim-bar-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 2px;
}
.slim-bar-row + .slim-bar { margin-bottom: 0; }
.slim-bar { height: 5px; border-radius: 99px; margin-bottom: 16px; background: var(--surface-3); }
.slim-bar:last-child { margin-bottom: 0; }
.slim-bar-label {
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slim-bar-val {
  flex: none; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink-faint); font-weight: 600;
}

/* Earn card — green accent */
.earn-card {
  margin-top: clamp(7px, 1.6vh, 10px);
  background: color-mix(in srgb, #1a6b35 70%, var(--surface)) !important;
  border: 1px solid color-mix(in srgb, #2d9e55 50%, transparent) !important;
  color: #e8fced !important;
}
[data-theme="light"] .earn-card {
  background: color-mix(in srgb, #1e8040 80%, #f5f5f5) !important;
  border-color: color-mix(in srgb, #2ba050 60%, transparent) !important;
  color: #e6fced !important;
}
.earn-inner {
  display: flex; align-items: center; gap: 12px;
}
.earn-ic-wrap {
  flex: none; width: 38px; height: 38px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.12);
  border-radius: 10px;
}
.earn-ic-wrap svg {
  width: 22px; height: 22px;
  stroke: #6dea9a; fill: none;
}
.earn-text {
  flex: 1; min-width: 0;
}
.earn-title {
  font-weight: 700; font-size: 14.5px; line-height: 1.2;
}
.earn-sub {
  font-size: 11.5px; line-height: 1.3; margin-top: 2px;
  color: color-mix(in srgb, #e8fced 75%, transparent);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.earn-pct {
  flex: none;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 20px;
  color: #6dea9a; letter-spacing: -0.04em;
}
