/* Geometry measured in the reference's 480 × 640 Telegram viewport.
   Catalog: 2 × 219 + 10 gap + 2 × 16 gutter = 480. */
:root {
  --tab-idle: #3a3a3c;
  --tab-active: #636366;
  --sheet: #f2f2f7;
  --ease-sheet: cubic-bezier(.32,.72,0,1);
  --safe-top: max(env(safe-area-inset-top,0px), calc(var(--tg-safe-top,0px) + var(--tg-content-top,0px)));
  --safe-bottom: max(env(safe-area-inset-bottom,0px), calc(var(--tg-safe-bottom,0px) + var(--tg-content-bottom,0px)));
}
:root[data-theme=dark] { --tab-idle:#d2d2d2; --tab-active:#898989; --sheet:#09090a; }
html { scrollbar-width:none; }
body::-webkit-scrollbar, .sheet::-webkit-scrollbar { display:none; }
button { font-family:inherit; }
button:disabled { opacity:.5; }
#app { padding-bottom:calc(var(--safe-bottom) + 92px); }
#app.deep { position:relative; padding-bottom:calc(var(--safe-bottom) + 100px); }
#app > .page { animation:none; }
#app > .page.overlay-enter > :not(.action-bar):not(.product-back) { animation:detailIn .42s var(--ease-sheet) both; }
.sticker { display:inline-block; width:var(--sticker-size); height:var(--sticker-size); flex-shrink:0; vertical-align:middle; pointer-events:none; }
.sticker svg { display:block; width:100%!important; height:100%!important; }
.sticker.unavailable { opacity:0; }
.demo-note { margin:18px 8px 0; color:var(--dim); font-size:11px; text-align:center; }

/* Storefront */
.hero { padding:20px 20px 16px; background-image:url('/assets/balance-background.webp'); background-position:center; }
.hero:before { background:linear-gradient(180deg,#0004,#0002 45%,#0006); }
.hero-title { font-size:14px; font-weight:600; letter-spacing:-.2px; }
.hero > .hero-top { align-items:flex-start; }
.hero .round.tiny { width:26px; height:26px; }
.hero .balance-label { font-weight:600; letter-spacing:.3px; line-height:18px; }
.balance-value { line-height:44px; letter-spacing:-1px; display:flex; align-items:baseline; }
.balance-value .currency { margin-left:3px; }
.avatar { position:relative; background:linear-gradient(150deg,#aaa7b1,#65636e); }
.avatar-button { border-radius:50%; padding:0; box-shadow:0 4px 14px #0005; }
.avatar-photo { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.avatar-initials { position:relative; }
.catalog-grid { margin-top:12px; }
.product-card { grid-template-rows:58px 36px 30px; gap:10px; align-content:start; }
.card-name { font-size:14.5px; font-weight:500; letter-spacing:-.12px; }
.card-bottom > .row { height:23px; gap:4px; align-items:baseline; }
.card-price { font-size:19px; line-height:23px; font-weight:600; }
.card-price small { font-size:13px; font-weight:400; }
.card-price .currency { font-size:13px; margin-left:2px; }
.stock-bar { margin-top:4px; height:3px; }
.badge { line-height:18px; padding:2px 10px; background:#eaeaea; font-weight:600; }
:root[data-theme=dark] .badge { background:var(--surface-2); }
.brand-icon { width:58px; height:58px; }
.card-top .brand-icon { margin:-2px 0 0 0; width:58px; height:58px; }
.brand-icon img { width:40px; height:40px; }
.product-card:last-child:nth-child(odd) { grid-template-rows:36px 30px; }
.product-card:last-child:nth-child(odd) .card-name { padding-right:45px; }
.card-peek { position:absolute; right:-27px; bottom:-13px; width:60%; max-width:132px; height:auto; transform:rotate(-38deg); pointer-events:none; }
.product-card.has-peek .card-bottom { padding-right:84px; }
.product-card.sold-out .card-name, .product-card.sold-out .card-price { color:var(--dim); }
.product-card.sold-out .stock { color:var(--faint); }

/* Three moving segments and a separate profile disc. */
.nav-pill { position:relative; padding:4px; border:0; height:64px; isolation:isolate; touch-action:none; }
.nav-pill:before, .nav-profile:before { content:""; position:absolute; inset:0; border:1px solid var(--border); border-radius:inherit; pointer-events:none; }
.nav-slider { position:absolute; top:4px; bottom:4px; left:4px; width:calc((100% - 8px) / 3); border-radius:999px; background:var(--nav-pill); transform:translateX(calc(var(--active-index,0) * 100%)); transition:transform .42s cubic-bezier(.22,1,.36,1),opacity .2s; z-index:-1; }
.nav-pill.no-selection .nav-slider { opacity:0; }
.nav-tab { position:relative; background:none!important; color:var(--tab-idle); touch-action:none; }
.nav-tab.active { color:var(--tab-active); }
.nav-profile { position:relative; color:var(--tab-idle); }
.nav-profile.active { background:var(--nav); color:var(--tab-active); }
.nav-profile.active:after { content:""; position:absolute; inset:4px; border-radius:50%; background:var(--nav-pill); z-index:-1; }
.nav-profile { isolation:isolate; }

/* Product: media starts immediately below Telegram's own header. */
.product-back { position:absolute; top:calc(var(--safe-top) + 24px); left:32px; z-index:5; width:36px; height:36px; border-radius:50%; display:grid; place-items:center; color:#fff; background:#ffffff24; backdrop-filter:blur(12px); }
:root[data-telegram=true] .product-back { display:none; }
:root[data-telegram=true] .page-head .back-button { visibility:hidden; }
.product-banner { position:relative; margin-bottom:20px; border-radius:24px; aspect-ratio:440/208; }
.product-banner strong { font-size:clamp(32px,8.6vw,46px); letter-spacing:-1.6px; font-weight:500; }
.product-banner .brand-icon.large { width:72px; height:72px; }
.product-banner .brand-icon.large img { width:64px; height:64px; }
.product-banner.gemini > .brand-icon { display:none; }
.product-banner.gemini strong { font-size:clamp(48px,13.5vw,64px); font-weight:400; }
.product-heading { margin-bottom:12px; font-size:21px; font-weight:600; gap:10px; }
.product-price-row { justify-content:flex-start; gap:10px; }
.stock-chip { display:inline-flex; align-items:center; gap:4px; padding:4px 8px; line-height:16px; }
.stock-chip .icon { width:13px; height:13px; }
.variant-select { display:flex; align-items:center; gap:6px; min-height:36px; padding:6px 0; margin-top:8px; color:var(--dim); font-size:12.5px; }
.variant-select .icon { width:14px; height:14px; transform:rotate(90deg); }
.variant-option { display:flex; width:100%; gap:12px; align-items:center; background:var(--tile); min-height:66px; border-radius:18px; padding:12px 14px; margin-top:8px; text-align:left; }
.variant-option small { display:block; color:var(--dim); font-size:12px; margin-top:3px; }
.variant-option > .icon { width:18px; }
.variant-option.selected { box-shadow:inset 0 0 0 1.5px var(--ink); }
.description { margin-top:20px; gap:8px; }
.description blockquote { position:relative; margin:0; overflow:hidden; border-radius:12px; background:var(--surface-2); padding:10px 14px 10px 16px; font-size:14px; line-height:23px; white-space:pre-wrap; overflow-wrap:anywhere; user-select:text; }
.description blockquote:before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--dim); opacity:.65; }
.description blockquote strong { font-weight:500; }
.description-symbol { margin-right:5px; }
.action-inner { align-items:center; }
.action-inner .stepper { width:108px; flex-shrink:0; justify-content:space-between; }
.stepper button { width:36px; font-size:23px; font-weight:400; }
.stepper span { min-width:20px; font-size:16px; }
.action-inner .primary { letter-spacing:-.2px; padding:0 12px; white-space:nowrap; }
.square-action .icon { width:25px; height:25px; }
.primary .sticker { --sticker-size:22px!important; }
.square-action, .stepper { box-shadow:0 2px 5px #00000009; }

/* Profile */
.profile-backdrop { position:absolute; top:0; left:0; right:0; height:340px; overflow:hidden; pointer-events:none; opacity:.48; z-index:-1; }
.profile-backdrop img { width:125%; max-width:none; height:105%; margin:-10% -12.5%; object-fit:cover; filter:blur(38px); }
.profile-backdrop:after { content:""; position:absolute; inset:0; background:linear-gradient(transparent 10%,var(--base)); }
#app[data-screen=profile] { isolation:isolate; position:relative; }
.profile-head { position:relative; padding:2px 0 20px; }
.profile-head h1 { margin:12px 0 2px; line-height:34px; font-size:28px; font-weight:700; }
.profile-head > p { font-size:14px; line-height:20px; }
.balance-pill { display:inline-flex; align-items:center; justify-content:center; gap:4px; font-size:14px; line-height:20px; padding:6px 15px; margin-top:14px; background:var(--nav-pill); }
.balance-pill .icon { width:14px; height:14px; color:var(--faint); }
.profile-actions { margin-bottom:10px; }
.profile-actions button { flex-direction:row; gap:10px; padding:12px; min-height:60px; font-size:15px; font-weight:500; }
.stat-box { min-height:103px; padding:16px; text-align:left; }
.stat-box small { margin:0 0 6px; font-size:12px; line-height:18px; }
.stat-box strong { display:block; font-size:18px; line-height:22px; font-weight:600; letter-spacing:-.3px; }
.stat-box .small-number { font-size:18px; letter-spacing:-.2px; }
.stat-box .stat-note { display:block; margin-top:6px; color:var(--faint); font-size:11.5px; line-height:16px; }
.stat-id { position:relative; }
.stat-id > .icon { position:absolute; right:14px; top:18px; width:15px; height:15px; color:var(--faint); }
.profile-links { margin-top:10px; }
.list-row { min-height:72px; padding:14px 16px; }
.list-row small { line-height:17px; }
.profile-links .list-row > .icon:first-child { width:27px; height:27px; }
.list-row .trailing-arrow { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:var(--nav-pill); }
.trailing-arrow .icon { width:17px; height:17px; color:var(--dim); }
.profile-utilities { display:flex; gap:8px; justify-content:center; margin:20px 0 0; }
.profile-utilities button { display:flex; align-items:center; gap:6px; color:var(--dim); font-size:12px; padding:6px 10px; min-height:36px; }
.profile-utilities .icon { width:16px; height:16px; }

/* Purchase history and delivery. */
.purchases-heading { display:flex; align-items:center; justify-content:space-between; margin:8px 0 22px; min-height:72px; }
.purchases-heading .section-title { margin:0 0 4px; font-size:34px; }
.purchases-heading p { font-size:13px; color:var(--dim); }
.purchases-empty-link { display:flex; justify-content:center; margin-top:28px; }
.purchases-empty-link .primary { flex:none; height:36px; padding:0 24px; border-radius:999px; font-size:14px; font-weight:500; }
.purchase-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.purchase-card { position:relative; display:flex; flex-direction:column; gap:12px; text-align:left; min-height:168px; background:var(--tile); border-radius:22px; padding:12px; }
.purchase-card:last-child:nth-child(odd) { grid-column:1/-1; min-height:100px; display:grid; grid-template-columns:58px minmax(0,1fr); gap:8px 12px; align-items:center; }
.purchase-card:last-child:nth-child(odd) > .purchase-card-top { grid-row:1/3; }
.purchase-card-top { min-height:44px; display:flex; align-items:center; justify-content:space-between; }
.purchase-card .brand-icon { width:44px; height:44px; }
.purchase-card .brand-icon img { width:34px; height:34px; }
.purchase-date { position:absolute; right:12px; top:12px; border-radius:14px; background:var(--surface-2); color:var(--dim); font-size:11px; padding:3px 8px; }
.purchase-name { display:block; font-size:14px; font-weight:500; line-height:18px; }
.purchase-meta { display:block; color:var(--dim); font-size:11px; margin-top:4px; }
.purchase-card:last-child:nth-child(odd) .purchase-name { padding-right:50px; }
.purchase-card-footer { display:flex; justify-content:space-between; align-items:baseline; gap:6px; margin-top:auto; }
.purchase-card-footer strong { font-size:19px; font-weight:600; }
.purchase-card-footer small { font-size:11px; color:var(--dim); }
.purchase-card-footer .pending-label { color:var(--warning); }
.recommend-title { font-size:15px; font-weight:500; margin:18px 0 12px; }
.order-spotlight { height:149px; display:flex; align-items:center; justify-content:center; }
.order-spotlight .brand-icon { width:96px; height:96px; }
.order-spotlight .brand-icon img { width:80px; height:80px; }
.order-summary.order-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.order-title h2 { font-size:18px; margin-bottom:4px; }
.metadata { grid-template-columns:1.25fr 1fr .65fr; gap:10px; padding:0 4px; }
.order-status { margin:16px 0; }
.content-box > .secondary { gap:7px; }

/* About and payment screens reuse the reference's animated art. */
.about-head { padding:2px 0 20px; }
.about-logo { overflow:hidden; background:#030407; }
.about-logo img { width:100%; height:100%; object-fit:cover; }
.about-head h1 { font-size:28px; line-height:34px; font-weight:700; margin:12px 0 3px; }
.about-head > p { font-size:14px; }
.about-shortcuts { display:flex; justify-content:space-around; gap:12px; margin-bottom:22px; }
.about-shortcut { display:flex; flex-direction:column; align-items:center; gap:8px; font-size:12px; color:var(--dim); font-weight:500; min-width:64px; }
.about-shortcut > span:first-child { width:60px; height:60px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--tile); }
.about-info { border-radius:22px; padding:16px; background:var(--tile); }
.about-info img { display:block; width:100%; aspect-ratio:16/10; object-fit:cover; border-radius:16px; margin-bottom:14px; }
.about-info p { font-size:14px; line-height:22px; }
.about-section-title { font-size:13px; color:var(--dim); font-weight:500; margin:22px 12px 8px; }
.topup-art { width:128px; height:128px; margin:12px auto 0; border-radius:0; background:none; }
.topup-summary { text-align:center; margin-top:6px; font-size:13px; color:var(--dim); line-height:20px; }
.topup-summary strong { color:var(--ink); font-weight:500; }
.amount-wrap { margin-top:0; align-items:center; }
.amount-wrap > span:not(.sr-only) { font-size:28px; padding-top:8px; }
.amount-input { text-align:center; width:1ch; min-width:1ch; max-width:calc(100% - 60px); font-weight:600; line-height:1.15; letter-spacing:-1.6px; }
.amount-input::placeholder { color:var(--faint); }
.presets { margin:24px 0; }
.presets button { display:flex; align-items:baseline; justify-content:center; gap:3px; min-height:44px; border-radius:16px; font-weight:600; }
.presets small { color:var(--dim); font-size:11px; }
.presets button.selected { background:var(--ink); color:var(--base); }
.payment-methods { margin-top:28px; }
.payment-methods > p { font-size:13px; color:var(--dim); margin:0 7px 10px; }
.payment-methods .method { margin-top:8px; }
.payment-note { margin:16px 10px 0; text-align:center; font-size:11.5px; line-height:18px; color:var(--dim); }
.method { min-height:66px; border-radius:20px; padding:10px 12px; gap:10px; }
.method .method-icon { background:none; border-radius:0; }
.method .method-icon .icon { width:26px; height:26px; }
:root[data-theme=light] [data-sticker=cryptobot] { filter:grayscale(1) brightness(.55); }
.method .method-amount { color:var(--dim); font-size:12px; white-space:nowrap; }
.sheet { width:calc(100% - 32px); max-width:448px; background:var(--sheet); padding:10px 16px calc(var(--safe-bottom) + 16px); outline:none; }
.sheet-close { opacity:0; pointer-events:none; }
.sheet-close:focus-visible { opacity:1; pointer-events:auto; }
.sheet h2, .sheet .subtitle { margin-left:4px; margin-right:4px; }
.sheet h2 { font-weight:600; line-height:24px; }
.sheet-handle { margin-bottom:16px; }
.sheet .subtitle { margin-bottom:18px; line-height:18px; }
.balance-summary { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:18px; }
.balance-summary > div { background:var(--tile); padding:12px 14px; border-radius:18px; min-height:76px; }
.balance-summary small { display:block; color:var(--dim); font-size:12px; margin-bottom:6px; }
.balance-summary strong { display:block; font-size:20px; font-weight:600; }
.balance-summary em { display:block; font-style:normal; font-size:11px; color:var(--dim); margin-top:4px; }
.sheet .back-text { width:100%; min-height:44px; color:var(--dim); font-size:14px; margin-top:6px; }
.sheet .primary { flex:none; }
.success-art { width:128px; height:128px; margin:24px auto 20px; background:none; border-radius:0; }
.payment-amount { font-size:34px; font-weight:600; }

@keyframes detailIn { from { transform:translateY(28px); opacity:0; } to { transform:none; opacity:1; } }
@media(max-width:390px) {
  .product-card.has-peek .card-bottom { padding-right:56px; }
  .product-card.has-peek .stock { font-size:10px; }
  .action-inner .stepper { width:96px; }
  .stepper button { width:30px; }
  .action-inner { gap:7px; }
  .action-inner .primary { font-size:14px; padding:0 8px; }
  .square-action { width:50px; }
}
@media(max-width:359px) {
  #app { padding-left:16px; padding-right:16px; }
  #app.deep { padding-left:20px; padding-right:20px; }
  .card-peek { display:none; }
  .product-card.has-peek .card-bottom { padding-right:0; }
  .card-name { font-size:13px; }
  .action-inner .stepper { width:84px; }
  .stepper button { width:27px; }
  .square-action { width:46px; }
  .action-inner .primary .sticker { display:none; }
  .stat-box { padding:13px; }
  .stat-box .small-number { font-size:16px; }
  .profile-actions button { font-size:14px; gap:6px; }
  .purchase-date { font-size:10px; padding:3px 6px; }
}
@media(prefers-reduced-motion:reduce) { #app > .page.overlay-enter > * { animation:none; } }
