/* =====================================================================
   StarSnow — Telegram-style UI
   Modelled on Telegram iOS: grouped inset lists on a grey canvas (day)
   or black canvas (night), Telegram blue accents, gold Stars, Premium
   gradient. All colours are tokens, so a Telegram Mini App theme
   (themeParams) can override them at runtime — see js/app.js.
   ===================================================================== */

:root {
  color-scheme: light;
  /* canvas & surfaces */
  --bg: #efeff4;
  --cell: #ffffff;
  --cell-press: #e5e5ea;
  --nav: rgba(247, 247, 247, 0.82);
  /* text */
  --text: #000000;
  --hint: #6b6b70;
  --section-header: #6d6d72;
  --separator: rgba(60, 60, 67, 0.22);
  /* accents */
  --brand: #2aabee;
  --brand-2: #229ed9;
  --accent: #2481cc; /* links & buttons: Telegram iOS day button colour, AA on white */
  --button: #2481cc;
  --button-text: #ffffff;
  --accent-soft: rgba(36, 129, 204, 0.12);
  --destructive: #ff3b30;
  --green: #34c759;
  --gold-1: #ffd54a;
  --gold-2: #f5a300;
  --premium: linear-gradient(90deg, #6b93ff 0%, #976fff 50%, #e46ace 100%);
  --seg-bg: rgba(118, 118, 128, 0.12);
  --seg-on: #ffffff;
  --toast: rgba(30, 30, 30, 0.9);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);

  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Night (Telegram iOS night) — system preference, unless the user picked light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #000000;
    --cell: #1c1c1d;
    --cell-press: #2c2c2e;
    --nav: rgba(22, 22, 23, 0.82);
    --text: #ffffff;
    --hint: #98989e;
    --section-header: #8d8e93;
    --separator: rgba(84, 84, 88, 0.6);
    --accent: #3e88f7;
    --button: #3e88f7;
    --accent-soft: rgba(62, 136, 247, 0.16);
    --destructive: #eb5545;
    --seg-bg: rgba(118, 118, 128, 0.24);
    --seg-on: #636366;
    --toast: rgba(58, 58, 60, 0.95);
    --shadow: none;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #000000;
  --cell: #1c1c1d;
  --cell-press: #2c2c2e;
  --nav: rgba(22, 22, 23, 0.82);
  --text: #ffffff;
  --hint: #98989e;
  --section-header: #8d8e93;
  --separator: rgba(84, 84, 88, 0.6);
  --accent: #3e88f7;
  --button: #3e88f7;
  --accent-soft: rgba(62, 136, 247, 0.16);
  --destructive: #eb5545;
  --seg-bg: rgba(118, 118, 128, 0.24);
  --seg-on: #636366;
  --toast: rgba(58, 58, 60, 0.95);
  --shadow: none;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
button, input { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.container { width: min(100% - 32px, 560px); margin-inline: auto; }
/* Phones with a notch / Telegram's fullscreen Mini App: keep the same gap on both sides */
@supports (padding: max(0px)) {
  .container { width: min(100% - max(32px, env(safe-area-inset-left) + env(safe-area-inset-right) + 24px), 560px); }
}
.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; padding: 8px 14px; background: var(--cell); border-radius: 0 0 12px 0; }
.skip-link:focus { left: 0; }

.snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.55; }
.navbar, main, .footer { position: relative; z-index: 1; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: var(--nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}
.navbar__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; }
.navbar__actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 1 1 auto; min-width: 0; }
.navbar__actions > .seg, .navbar__actions > .icon-btn { flex: none; }
/* The account name takes whatever room is left and is cut with «…»: RU/EN and the theme button stay put, however long the name is */
.navbar__actions > #loginBtn { order: -1; flex: 1 1 0; min-width: 0; text-align: right; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); flex: none; }
.brand__logo { width: 32px; height: 32px; object-fit: contain; }
.brand__name { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: #3e88f7; }
/* Night: white wordmark with a soft ice glow. Day: Telegram blue. */
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .brand__name { color: #fff; text-shadow: 0 0 12px rgba(79, 195, 247, 0.9); } }
:root[data-theme='dark'] .brand__name { color: #fff; text-shadow: 0 0 12px rgba(79, 195, 247, 0.9); }
.brand--small .brand__logo { width: 22px; height: 22px; }
.brand--small .brand__name { font-size: 15px; }
.text-btn { font-size: 17px; font-weight: 600; color: var(--accent); padding: 6px 2px; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Small phones: tighter header; at the very narrowest only the logo stays next to the controls */
@media (max-width: 400px) {
  .brand { gap: 6px; }
  .brand__logo { width: 28px; height: 28px; }
  .brand__name { font-size: 16px; }
  .text-btn { font-size: 15px; }
  .icon-btn { width: 32px; height: 32px; }
}
@media (max-width: 340px) {
  .brand__name { display: none; }
}
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--seg-bg); color: var(--accent); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root[data-theme='dark'] .icon-moon { display: none; }
:root[data-theme='dark'] .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon-moon { display: none; }
  :root:not([data-theme='light']) .icon-sun { display: block; }
}

/* ---------- Segmented control (iOS) ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: 9px; background: var(--seg-bg); }
.seg__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.seg__btn:is([aria-selected='true'], [aria-pressed='true']) { background: var(--seg-on); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); }
.seg--sm .seg__btn { min-height: 26px; padding: 0 8px; font-size: 12px; }
.tabs { margin-bottom: 4px; }
.tabs .seg__btn { min-height: 36px; font-size: 15px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-block: 8px 32px; }
.sheet, .aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-content: start; min-width: 0; }
.aside { gap: 4px; }

/* ---------- Hero ---------- */
.hero { display: grid; justify-items: center; text-align: center; gap: 8px; padding-top: 12px; }
.hero__art { position: relative; width: 168px; height: 168px; }
.hero__art img { position: relative; width: 100%; height: 100%; object-fit: contain; animation: float 5s ease-in-out infinite; filter: drop-shadow(0 12px 18px rgba(34, 158, 217, 0.35)); }
.hero__glow { position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, rgba(42, 171, 238, 0.55), transparent 70%); filter: blur(18px); }
.hero__spark { position: absolute; width: 14px; height: 14px; background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 2.8s ease-in-out infinite; }
.hero__spark.s1 { left: 2%; top: 22%; }
.hero__spark.s2 { right: 4%; top: 8%; width: 10px; height: 10px; animation-delay: 0.7s; }
.hero__spark.s3 { right: -2%; bottom: 26%; width: 12px; height: 12px; animation-delay: 1.4s; }
.hero__spark.s4 { left: 12%; bottom: 6%; width: 9px; height: 9px; animation-delay: 2.1s; }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes twinkle { 0%, 100% { transform: scale(0.4) rotate(0); opacity: 0.2; } 50% { transform: scale(1.1) rotate(45deg); opacity: 1; } }
.hero__title { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; text-wrap: balance; }
.hero__sub { font-size: 15px; color: var(--hint); }
/* Two lines everywhere: what you do, then the reassurance */
.hero__line { display: block; }
@media (max-width: 520px) { .hero__sub { font-size: clamp(13px, 3.7vw, 15px); } }
@media (min-width: 360px) { .hero__line:first-child { white-space: nowrap; } }
/* The product names in their own colours: gold Stars, the Premium gradient */
.hl-stars, .hl-premium { -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-box-decoration-break: clone; }
.hl-stars { background-image: linear-gradient(180deg, #ffd23f, #f59f00); }
.hl-premium { background-image: linear-gradient(90deg, #6b93ff, #976fff 50%, #e46ace); }

/* ---------- Grouped lists ---------- */
.group { background: var(--cell); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.group--tight { margin-top: 12px; }
.group-header { padding: 22px 16px 7px; font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: 0; color: var(--section-header); }
.group-footer { padding: 7px 16px 0; font-size: 13px; line-height: 1.35; color: var(--hint); }

.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 16px; color: var(--text); background: var(--cell);
  -webkit-tap-highlight-color: transparent;
}
.row + .row::before, .row-details + .row-details::before, .option + .option::before {
  content: ''; position: absolute; top: 0; left: 16px; right: 0; z-index: 2; height: 0.5px; background: var(--separator);
}
.group .row-details, .option { position: relative; }
.row--icon + .row--icon::before, .option + .option::before { left: 60px; }
.row__title { flex: 1; min-width: 0; font-size: 17px; }
.row__sub { display: block; font-size: 14px; color: var(--hint); margin-top: 1px; }
.row__value { font-size: 17px; color: var(--hint); white-space: nowrap; }
.row__at { color: var(--hint); }
.row__input, .row__value-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0; font-size: 17px; }
.row__value-input { flex: 0 1 110px; text-align: right; font-weight: 600; }
.row__input::placeholder, .row__value-input::placeholder { color: var(--hint); opacity: 0.7; font-weight: 400; }
.row--input { cursor: text; }
.row:has(input:focus-visible) { box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--radius); }
input[aria-invalid='true'] { color: var(--destructive); }
.error { padding: 7px 16px 0; font-size: 13px; color: var(--destructive); }

/* Icon tiles (Telegram settings style) */
.tile { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 7px; }
.tile--blue { background: linear-gradient(180deg, #4fc3f7, #229ed9); }
.tile--gold { background: linear-gradient(180deg, #ffcf3a, #f59f00); }
.tile--green { background: linear-gradient(180deg, #5fd776, #2fb84f); }
.tile--violet { background: linear-gradient(180deg, #b48cff, #8c5cf5); }
.tile--premium { background: var(--premium); }
.ai--tile { width: 20px !important; height: 20px !important; filter: none !important; }
/* Monochrome icon inside a coloured tile: shapes white, details take the tile colour */
.tile .ai [fill^='url'] { fill: #fff; }
.tile .ai [stroke^='url'] { stroke: #fff; }
.tile .ai [fill='#fff'] { fill: currentColor; }
.tile .ai [stroke='#fff'] { stroke: currentColor; }
.tile .ai [opacity] { opacity: 0; }
.tile--blue { color: #229ed9; }
.tile--gold { color: #f59f00; }
.tile--green { color: #2fb84f; }
.tile--violet { color: #8c5cf5; }
.tile--premium { color: #976fff; }

/* Selectable rows (Stars packs, Premium plans) */
.option { display: block; cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .row { transition: background 0.15s; }
.option:active .row { background: var(--cell-press); }
.check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--separator); display: grid; place-items: center; transition: background 0.15s, border-color 0.15s; }
.check::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.option input:checked ~ .row .check { background: var(--accent); border-color: var(--accent); }
.option input:checked ~ .row .check::after { opacity: 1; }
.option input:focus-visible ~ .row { box-shadow: inset 0 0 0 2px var(--accent); }

/* Stacked gold stars (like Telegram's Stars purchase list) */
.stack { position: relative; flex: none; display: inline-flex; align-items: center; width: 60px; height: 28px; }
/* each star sits in front of the next one and casts a thin amber edge on it, so the stack reads as separate stars */
.stack .ai { position: absolute; width: 23px; height: 23px; top: 2px;
  filter: drop-shadow(1.2px 0 0 rgba(150, 70, 0, 0.75)) drop-shadow(0 0 0.4px rgba(170, 90, 0, 0.6)); }
.stack .p-spark { display: none; } /* the little sparkles of one star would sit on top of its neighbour as stray dots */
.stack .ai:nth-child(1) { left: 0; z-index: 6; }
.stack .ai:nth-child(2) { left: 9px; z-index: 5; }
.stack .ai:nth-child(3) { left: 18px; z-index: 4; }
.stack .ai:nth-child(4) { left: 27px; z-index: 3; }
.stack .ai:nth-child(5) { left: 36px; z-index: 2; }
.price { font-size: 17px; color: var(--hint); white-space: nowrap; }
.option input:checked ~ .row .price { color: var(--text); font-weight: 600; }

/* Premium */
.premium-head { display: grid; justify-items: center; gap: 4px; padding: 14px 16px 6px; text-align: center; }
.premium-head__title { font-size: 22px; font-weight: 700; background: var(--premium); -webkit-background-clip: text; background-clip: text; color: transparent; }
.premium-head__sub { font-size: 15px; color: var(--hint); }
.ai.ai--hero-sm { width: 72px; height: 72px; filter: drop-shadow(0 8px 14px rgba(151, 111, 255, 0.4)); }
.save { flex: none; padding: 2px 6px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; background: var(--premium); }


/* Main button (Telegram Mini App MainButton) */
.main-btn {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; margin-top: 20px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--button); color: var(--button-text); font-size: 17px; font-weight: 600; cursor: pointer;
  transition: transform 0.12s, filter 0.15s;
}
.main-btn:hover { filter: brightness(1.06); }
.main-btn:active { transform: scale(0.98); filter: brightness(0.95); }
.main-btn--premium { background: var(--premium); }
.main-btn::after { content: ''; position: absolute; inset: 0 auto 0 -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: skewX(-20deg); animation: shimmer 3.6s ease-in-out infinite; }
@keyframes shimmer { 0%, 60% { left: -60%; } 100% { left: 130%; } }

.trust { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.trust__item { display: inline-flex; align-items: center; gap: 5px; }

/* Referral cell */
.ref { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-top: 2px; }
.ref__img { flex: none; width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(34, 158, 217, 0.3)); }
.ref__text { display: grid; gap: 4px; justify-items: start; }
.ref__title { font-size: 17px; font-weight: 600; }
.ref__sub { font-size: 14px; color: var(--hint); }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.pill-btn:active { filter: brightness(0.92); }

.badge { flex: none; padding: 3px 9px; border-radius: 999px; font-size: 14px; font-weight: 700; color: #fff; background: var(--accent); }

/* FAQ rows */
.row-details summary { list-style: none; cursor: pointer; }
.row-details summary::-webkit-details-marker { display: none; }
.row-details summary:active { background: var(--cell-press); }
.row-details p { padding: 0 16px 14px 58px; font-size: 15px; line-height: 1.4; color: var(--hint); }
.row-details + .row-details::before { left: 58px; }
.chev { flex: none; width: 8px; height: 8px; border: solid #c4c4c7; border-width: 2px 2px 0 0; transform: rotate(45deg); transition: transform 0.2s; margin-right: 2px; }
.row-details[open] .chev { transform: rotate(135deg); }

/* ---------- Footer ---------- */
.footer { padding: 8px 0 36px; text-align: center; }
.footer .brand { margin-bottom: 8px; }
.footer__nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.footer__note { max-width: 46ch; margin: 12px auto 0; font-size: 12px; color: var(--hint); }

/* ---------- Toast (Telegram undo-toast) ---------- */

/* ---------- Legal pages ---------- */
.legal-wrap { padding-block: 20px 32px; }
.legal { padding: 20px 16px; }
.legal h1 { font-size: 22px; margin-bottom: 12px; }
.legal h2 { font-size: 17px; margin: 20px 0 6px; }
.legal p { font-size: 15px; line-height: 1.5; color: var(--text); margin-bottom: 8px; }

/* ---------- Desktop: hero + info on the left, purchase sheet on the right ---------- */
@media (min-width: 960px) {
  .container { width: min(100% - 64px, 1040px); }
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); grid-template-areas: 'hero sheet' 'aside sheet'; column-gap: 48px; row-gap: 12px; padding-top: 28px; }
  .hero { grid-area: hero; justify-items: start; text-align: left; padding-top: 24px; }
  .hero__art { width: 220px; height: 220px; }
  .hero__title { font-size: 40px; }
  .hero__sub { font-size: 17px; }
  .sheet { grid-area: sheet; position: sticky; top: 72px; align-self: start; padding: 16px; border-radius: 20px; background: color-mix(in srgb, var(--bg) 60%, var(--cell)); box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.18); }
  .aside { grid-area: aside; }
  .legal-wrap { width: min(100% - 64px, 720px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- payment methods, recipient preview, consent, info pages ---------- */
.recipient { display: flex; align-items: center; gap: 10px; margin: 8px 16px 0; padding: 8px 12px; border-radius: 12px; background: var(--cell); font-size: 14px; }
.recipient img, .recipient__ph { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.recipient__ph { display: grid; place-items: center; background: var(--separator); color: var(--hint); font-weight: 600; }
.recipient small { display: block; color: var(--hint); }
.recipient--warn { color: var(--destructive); }
.consent { position: fixed; z-index: 50; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 440px; margin-inline: auto; display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--cell); border: 0.5px solid var(--separator); box-shadow: 0 10px 34px rgba(0, 0, 0, .28); font-size: 14px; animation: consent-in .28s cubic-bezier(.2, .9, .3, 1); }
.consent.is-leaving { opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; }
@keyframes consent-in { from { opacity: 0; transform: translateY(16px); } }
.consent__head { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.consent__text { margin: 0; color: var(--hint); line-height: 1.4; }
.consent__text a { color: var(--accent); }
.consent__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.consent__btn { min-height: 44px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.consent__btn--yes { background: var(--button); color: var(--button-text, #fff); }
.consent__btn:active { opacity: .7; }
.footer__nav--seo { margin-top: 6px; font-size: 13px; opacity: .85; }
.legal .lead { color: var(--hint); font-size: 16px; margin-bottom: 14px; }
.legal .crumbs { font-size: 13px; color: var(--hint); margin-bottom: 8px; }
.legal .crumbs a { color: inherit; }
.legal ul, .legal ol { margin: 0 0 10px 1.2em; line-height: 1.5; font-size: 15px; }
.legal li { margin-bottom: 6px; }
.legal .steps { counter-reset: s; list-style: none; margin-left: 0; }
.legal .steps li { counter-increment: s; position: relative; padding-left: 34px; }
.legal .steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--button, #229ed9); color: var(--button-text, #fff); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.legal .qa { border-top: 1px solid var(--separator); padding: 10px 0; }
.legal .qa summary { cursor: pointer; font-weight: 600; }
.legal .qa p { margin: 8px 0 0; }
.legal .updated { margin-top: 18px; font-size: 12px; color: var(--hint); }
.legal .pill-btn { display: inline-flex; margin-top: 6px; text-decoration: none; }
.legal code { background: var(--separator); padding: 1px 5px; border-radius: 5px; }
.ptable { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 15px; }
.ptable th, .ptable td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--separator); }
.more { margin-top: 12px; padding: 14px 16px; display: grid; gap: 8px; }
.more h2 { font-size: 15px; color: var(--hint); }
.more a { font-size: 15px; }
.recipient[hidden] { display: none; }
.test-banner { position: sticky; top: 0; z-index: 30; margin: 0; padding: 8px 16px; text-align: center; font-size: 13px; font-weight: 600; color: #3a2a00; background: repeating-linear-gradient(135deg, #ffd34d 0 14px, #ffc21a 14px 28px); }
.test-banner[hidden] { display: none; }

/* ================= UI kit (js/ui.js): one toast, sheet, dialog, button, input and dropdown everywhere ================= */
body.is-locked { overflow: hidden; }

.ui-toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: min(100% - 32px, 420px); padding: 12px 16px; border-radius: 12px;
  background: var(--toast); color: #fff; font-size: 15px; line-height: 1.35; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.ui-toast.is-in { animation: toast-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.ui-toast[hidden] { display: none; }
.ui-toast::before { flex: none; font-size: 16px; }
.ui-toast[data-kind='ok']::before { content: '✓'; color: #4cd964; font-weight: 700; }
.ui-toast[data-kind='error']::before { content: '!'; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--destructive); color: #fff; font-size: 13px; font-weight: 700; }
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } }

.ui-sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.ui-sheet[hidden] { display: none; }
.ui-sheet__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); animation: fade-in 0.2s; }
.ui-sheet__panel {
  position: relative; width: min(100%, 480px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; outline: none;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: var(--bg); color: var(--text);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2); animation: sheet-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.ui-sheet__panel::before { content: ''; display: block; width: 36px; height: 5px; margin: 0 auto 6px; border-radius: 3px; background: var(--separator); }
.ui-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 12px; }
.ui-sheet__head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--text); }
.ui-sheet__x { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--seg-bg); color: var(--hint); font-size: 22px; line-height: 1; cursor: pointer; }
.ui-sheet__text { margin: 0 0 4px; font-size: 15px; line-height: 1.45; color: var(--text); white-space: pre-line; }
.ui-sheet .group-header { padding-top: 18px; }
.ui-sheet .main-btn { margin-top: 16px; }
.ui-sheet .main-btn:disabled, .ui-btn:disabled { filter: grayscale(1) opacity(0.5); cursor: not-allowed; transform: none; }
.ui-sheet .tile > svg { color: #fff; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (min-width: 600px) {
  .ui-sheet { align-items: center; }
  .ui-sheet__panel { border-radius: 16px; padding-bottom: 20px; }
  .ui-sheet__panel::before { display: none; }
}
.ui-sheet--dialog .ui-sheet__panel { width: min(100%, 400px); }
:root[data-theme='dark'] .ui-sheet__panel { background: #111113; border-top: 0.5px solid var(--separator); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .ui-sheet__panel { background: #111113; border-top: 0.5px solid var(--separator); } }
@media (prefers-reduced-motion: reduce) { .ui-sheet__panel, .ui-sheet__backdrop, .ui-toast.is-in { animation: none; } }

.ui-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.ui-btn { min-height: 46px; padding: 0 16px; border: 0; border-radius: 12px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; transition: filter 0.15s, transform 0.12s; }
.ui-btn:active { transform: scale(0.98); }
.ui-btn--primary { background: var(--button); color: var(--button-text); }
.ui-btn--danger { background: var(--destructive); color: #fff; }
.ui-btn--ghost { background: var(--seg-bg); color: var(--text); }
.ui-input { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--separator); border-radius: 12px; background: var(--cell); color: var(--text); font: inherit; font-size: 16px; resize: vertical; }
.ui-input:focus, .ui-select:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Dropdowns: every <select> looks the same, site and admin. */
select, .ui-select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 15px; color: var(--text); background-color: var(--cell);
  border: 1px solid var(--separator); border-radius: 10px; padding: 9px 34px 9px 12px; min-height: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* Checkout sheet specifics */
.paysheet__summary .row { min-height: 44px; }
.paysheet__summary .row__label { flex: 1; color: var(--hint); }
.paysheet__summary .row__value { color: var(--text); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.paysheet__summary .row--total .row__value { font-size: 20px; font-weight: 700; }
.paysheet__legal { text-align: center; }
.paysheet__legal a { color: var(--accent); }
.row.is-disabled { opacity: 0.55; }
.badge-soon { flex: none; padding: 3px 8px; border-radius: 8px; background: var(--seg-bg); color: var(--hint); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.login-status { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; color: var(--hint); font-size: 15px; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--separator); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
a.main-btn { text-decoration: none; }

/* Layout never jumps when the scrollbar appears or a sheet locks the page. */
html { scrollbar-gutter: stable; }

/* Custom dropdown + date range (js/ui.js) */
.ui-dd { position: relative; display: inline-block; min-width: 0; }
.ui-dd__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--separator); border-radius: 10px; background: var(--cell); color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ui-dd__btn:hover { border-color: var(--hint); }
.ui-dd__btn:focus-visible, .ui-dd__btn[aria-expanded='true'] { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ui-dd__btn.is-set { border-color: var(--accent); color: var(--accent); }
.ui-dd__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-dd__chev { flex: none; width: 10px; height: 10px; border-right: 2px solid var(--hint); border-bottom: 2px solid var(--hint); transform: translateY(-2px) rotate(45deg); transition: transform 0.15s; }
.ui-dd__btn[aria-expanded='true'] .ui-dd__chev { transform: translateY(2px) rotate(-135deg); }
.ui-dd__menu {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 100%; max-height: 360px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  border: 1px solid var(--separator); border-radius: 12px; background: var(--cell); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22); animation: dd-in 0.12s ease-out;
}
.ui-dd__menu[hidden] { display: none; }
.ui-dd.is-up .ui-dd__menu { top: auto; bottom: calc(100% + 6px); }
.ui-dd.is-right .ui-dd__menu { left: auto; right: 0; }
.ui-dd__opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 15px; white-space: nowrap; cursor: pointer; }
.ui-dd__opt.is-active { background: var(--seg-bg); }
.ui-dd__opt[aria-selected='true'] { color: var(--accent); font-weight: 600; }
.ui-dd__opt[aria-selected='true']::after { content: '✓'; flex: none; font-weight: 700; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.ui-dd.is-up .ui-dd__menu { animation-name: dd-in-up; }
@keyframes dd-in-up { from { opacity: 0; transform: translateY(4px); } }

.ui-dr__pop { width: 292px; max-height: none; padding: 12px; overflow: visible; }
.ui-dr__presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ui-dr__preset { padding: 5px 10px; border: 0; border-radius: 999px; background: var(--seg-bg); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ui-dr__preset:hover { background: var(--accent-soft); color: var(--accent); }
.ui-dr__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ui-dr__nav { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 20px; cursor: pointer; }
.ui-dr__nav:hover:not(:disabled) { background: var(--seg-bg); }
.ui-dr__nav:disabled { opacity: 0.3; cursor: default; }
.ui-dr__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.ui-dr__dow { padding: 4px 0; color: var(--hint); font-size: 12px; text-align: center; }
.ui-dr__day { height: 34px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.ui-dr__day:hover:not(:disabled) { background: var(--seg-bg); }
.ui-dr__day:disabled { color: var(--hint); opacity: 0.4; cursor: default; }
.ui-dr__day.is-today { box-shadow: inset 0 0 0 1px var(--accent); }
.ui-dr__day.is-in { background: var(--accent-soft); border-radius: 0; }
.ui-dr__day.is-edge { background: var(--accent); color: var(--button-text); border-radius: 8px; }
.ui-dr__hint { margin: 10px 2px 0; color: var(--hint); font-size: 12px; line-height: 1.35; }
@media (prefers-reduced-motion: reduce) { .ui-dd__menu { animation: none; } }

/* Number fields: no tiny up/down arrows anywhere (type the number; it also keeps the layout calm) */
input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ui-btn--link { display: grid; place-items: center; text-decoration: none; }
.footer__note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- info / legal pages (Telegram grouped style, RU + EN side by side) ---------- */
html:not([lang='en']) .only-en, html[lang='en'] .only-ru { display: none !important; }
.info { display: grid; gap: 0; padding-block: 12px 32px; max-width: 720px; }
.info .crumbs { font-size: 13px; color: var(--hint); padding: 4px 16px 0; }
.info .crumbs a { color: inherit; }
.info__head { padding: 10px 16px 6px; }
.info__head h1 { font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 6px; }
.info__lead { color: var(--hint); font-size: 16px; line-height: 1.4; margin: 0; }
.info .blk { margin-top: 18px; }
.info-card { padding: 14px 16px; }
.info-card p, .info-card li { font-size: 15px; line-height: 1.5; }
.info-card p { margin: 0 0 10px; }
.info-card p:last-child, .info-card ul:last-child, .info-card ol:last-child { margin-bottom: 0; }
.info-card ul, .info-card ol { margin: 0 0 10px 1.2em; padding: 0; }
.info-card li { margin-bottom: 6px; }
.info-card a { color: var(--accent); }
.info-card .steps { counter-reset: s; list-style: none; margin-left: 0; }
.info-card .steps li { counter-increment: s; position: relative; padding-left: 36px; min-height: 26px; }
.info-card .steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--button); color: var(--button-text, #fff); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.info-card code { background: var(--seg-bg); padding: 1px 6px; border-radius: 6px; font-size: 14px; }
.info-card .pill-btn { text-decoration: none; }
.info-card .ptable { margin: 4px 0 0; }
.info-card .ptable th { color: var(--hint); font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
.info-card .ptable td:last-child, .info-card .ptable th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.info-card .ptable tr:last-child td { border-bottom: 0; }
.price-live__head { font-size: 17px; }
.info__updated { padding: 8px 16px 0; }
.info .row--btn { color: var(--text); text-decoration: none; }

/* «Buy again» chips above the recipient field */
.recent { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 8px; scrollbar-width: none; }
.recent::-webkit-scrollbar { display: none; }
.recent__chip { flex: none; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.recent__chip:active { opacity: .7; }

/* Reserve the room the JS-rendered lists will take, so nothing below jumps when they appear (layout shift). */
#starPacks:empty { min-height: 288px; }
.price-live[data-price-table] { min-height: 321px; }
.price-live[data-premium-table] { min-height: 142px; }

/* Thin, rounded scrollbars in the app's colours (no arrows, no white track) — windows, tables, the page. */
* { scrollbar-width: thin; scrollbar-color: rgba(128, 128, 140, .45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128, 128, 140, .4); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(128, 128, 140, .65); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
.ui-sheet__panel { scrollbar-gutter: stable; }
