/* ============ токены ============ */
:root {
  --bg: #000;
  --surface: #161618;
  --surface-2: #222225;
  --surface-3: #2e2e32;
  --text: #fff;
  --text-2: rgba(255, 255, 255, .62);
  --text-3: rgba(255, 255, 255, .36);
  --accent: #7c5cff;
  --brand: linear-gradient(135deg, #8b6cff, #ff4fa3);
  --fill-1: rgba(255, 255, 255, .05);
  --fill-2: rgba(255, 255, 255, .08);
  --fill-3: rgba(255, 255, 255, .12);
  --fill-4: rgba(255, 255, 255, .16);
  --line: rgba(255, 255, 255, .06);
  --bar: #1a1a1c;
  --bar-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 10px 30px rgba(0, 0, 0, .6);
  --lens: color-mix(in srgb, var(--accent) 24%, #2a2a2f);
  --fade: rgba(0, 0, 0, .9);
  --hero-1: color-mix(in srgb, var(--accent) 18%, #151517);
  --hero-2: #111113;
  --sheet: #18181b;
  --sheet-ring: 0 0 0 1px rgba(255, 255, 255, .05);
  --backdrop: rgba(0, 0, 0, .66);
  --toast: #2a2a2e;
  --toast-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  --seg-lens: rgba(255, 255, 255, .13);
  --skeleton: rgba(255, 255, 255, .06);
  --skeleton-hi: rgba(255, 255, 255, .12);
  --warn: #ffb340;
  --good: #4ade80;
  --bad: #ff6b6b;
  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 18px;
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --spring: cubic-bezier(.3, 1.35, .5, 1);
  --ease: cubic-bezier(.2, .85, .25, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', Inter, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; }
h1, h2, h3, p { margin: 0; }
input, textarea, select { font: inherit; color: inherit; user-select: text; -webkit-user-select: text; }
[hidden] { display: none !important; }
::-webkit-scrollbar { display: none; }

/* ============ поверхности ============ */
/* Плоские тёмные карточки на чёрном фоне. Класс называется glass по историческим причинам. */
.glass {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface);
}
/* вложенные поверхности внутри карточек и шторок */
.well {
  position: relative;
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.pressable { transition: transform .2s ease, opacity .2s; }
.pressable:active { transform: scale(.975); opacity: .85; transition-duration: .06s; }

/* ============ каркас ============ */
#app { position: fixed; inset: 0; z-index: 1; }

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(12px + var(--safe-top)) 14px calc(118px + var(--safe-bottom));
}
.view > .stack { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack > * { flex-shrink: 0; }
/* ширину ограничиваем только у корневого контейнера: auto-отступы у вложенных flex-элементов сжимают их по содержимому */
.view > *, .page-body > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12px; }
.cap { font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); }
.section-title { font-size: 13px; color: var(--text-2); padding: 10px 6px 0; display: flex; justify-content: space-between; align-items: baseline; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre { white-space: pre-wrap; word-break: break-word; }
.selectable { user-select: text; -webkit-user-select: text; }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money .rub { color: var(--text-3); font-weight: 600; font-size: .74em; margin-left: .22em; }

.ico { display: inline-flex; flex-shrink: 0; }
.ico svg { width: 100%; height: 100%; }
.ico { width: 22px; height: 22px; }
.ico.s { width: 16px; height: 16px; }

/* ============ стикеры ============ */
.stk { position: relative; flex-shrink: 0; display: grid; place-items: center; }
.stk > svg, .stk > img, .stk > video { width: 100% !important; height: 100% !important; object-fit: contain; display: block; }
.stk[data-tgs] { opacity: 0; transition: opacity .25s; }
.stk[data-tgs].ready { opacity: 1; }
.stk-fallback { line-height: 1; }

/* ============ сплэш ============ */
#splash {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--bg); transition: opacity .35s ease, visibility .35s;
}
#splash.out { opacity: 0; visibility: hidden; }
.splash-logo { width: 84px; height: 84px; border-radius: 26px; animation: logo-in .7s var(--spring) both, logo-glow 1.8s ease-in-out .5s infinite; }
.splash-logo svg { display: block; width: 100%; height: 100%; }
.splash-name { font-size: 20px; font-weight: 760; letter-spacing: -.02em; animation: fade-up .5s .25s var(--ease) both; }
@keyframes logo-in { from { opacity: 0; transform: scale(.6) rotate(-8deg); } }
@keyframes logo-glow { 0%, 100% { box-shadow: 0 10px 40px rgba(139, 108, 255, .25); } 50% { box-shadow: 0 10px 60px rgba(255, 79, 163, .45); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--fill-3); border-top-color: var(--text); animation: spin .7s linear infinite; }
.loading { display: grid; place-items: center; padding: 60px 0; }

.fatal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px; text-align: center; }
.fatal h2 { font-size: 20px; }

/* ============ таббар ============ */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-bottom));
  z-index: 30;
  transform: translateX(-50%);
  display: flex;
  padding: 5px;
  border-radius: 999px;
  background: var(--bar);
  box-shadow: var(--bar-shadow);
}
.tab {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text-2);
  transition: color .2s;
}
.tabbar.five .tab { width: 62px; }
.tab .ico { width: 24px; height: 24px; display: block; }
.tab.active { color: var(--text); }
.tab .dot {
  position: absolute; top: 9px; right: calc(50% - 18px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.tab-lens {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 0;
  height: 52px;
  border-radius: 999px;
  background: var(--lens);
  transition: transform .28s var(--ease), width .28s var(--ease);
}
.tab-lens.instant { transition: none; }
.tab-fade {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(110px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--fade) 78%);
  pointer-events: none;
}

/* ============ карточки ============ */
.card { padding: 16px; }
.hero {
  border-radius: var(--r-xl);
  padding: 18px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(150deg, var(--hero-1) 0%, var(--hero-2) 72%);
}
.hero.compact { min-height: 0; gap: 26px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hero-title { font-size: 15px; font-weight: 650; }
.hero-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.hero-banner { position: absolute; inset: 0; z-index: -1; }
.hero-banner img, .hero-banner .stk { width: 100% !important; height: 100% !important; }
.hero-banner img { object-fit: cover !important; }
.hero-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .34) 0%, rgba(0, 0, 0, .08) 40%, rgba(0, 0, 0, .66) 100%);
}
.hero .stk.deco { margin: -6px -2px -6px 0; }
.amount { font-size: 38px; font-weight: 750; letter-spacing: -.025em; line-height: 1.05; margin-top: 6px; }
.amount.s { font-size: 24px; }
.big-title { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.12; }
.big-title span { display: block; color: var(--text-3); }

.avatar {
  flex-shrink: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #fff), color-mix(in srgb, var(--accent) 60%, #000));
  font-weight: 700; color: #fff;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap;
  background: var(--fill-2);
}
.chip.s { height: 20px; padding: 0 8px; font-size: 11px; }
.chip.warn { color: var(--warn); background: rgba(255, 179, 64, .14); }
.chip.good { color: var(--good); background: rgba(74, 222, 128, .13); }
.chip.bad { color: var(--bad); background: rgba(255, 107, 107, .14); }

.round-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
}
/* на карточке кнопка должна отличаться от её фона */
.hero .round-btn, .card .round-btn { background: var(--fill-3); }
.round-btn.s { width: 30px; height: 30px; }
.round-btn.s .ico { width: 16px; height: 16px; }

/* фильтр категорий */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px; padding: 2px 14px; }
.chips .cat {
  height: 36px; padding: 0 16px; border-radius: 999px; white-space: nowrap; font-weight: 600; font-size: 14px;
  color: var(--text-2); display: flex; align-items: center; flex-shrink: 0;
}
.chips .cat.active { color: var(--text); background: var(--surface-3); }

/* товар */
.product {
  padding: 14px 14px 13px;
  min-height: 172px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}
.product .stk { margin-bottom: 12px; }
.product h3 {
  font-size: 15px; font-weight: 650; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product .meta { margin-top: auto; width: 100%; padding-top: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.product .price { font-size: 20px; font-weight: 720; letter-spacing: -.01em; }
.product .price .from { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.product .left { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.bar { width: 100%; height: 3px; margin-top: 8px; border-radius: 3px; background: var(--fill-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--text) 50%, transparent); transition: width .6s var(--ease); }
/* игра: обложка во всю ширину карточки */
.product.game { padding: 0 0 13px; }
.product.game .cover { width: 100%; aspect-ratio: 460 / 215; object-fit: cover; display: block; background: var(--skeleton); }
.product.game .game-body { flex: 1; width: 100%; padding: 10px 14px 0; display: flex; flex-direction: column; }
.product.game h3 { font-size: 14px; }
.product.game .meta { padding-top: 8px; }
.product.game .price { font-size: 18px; }
.game-cover { width: 100%; aspect-ratio: 460 / 215; object-fit: cover; border-radius: 20px; }
.product.low .left { color: var(--warn); }
.product.low .bar i { background: var(--warn); }
.product.out { opacity: .5; }
.badge {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--accent);
}

/* строка списка */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 22px; width: 100%;
}
.row .title { font-weight: 650; }
.row .sub { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row .right { margin-left: auto; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.row .chev { color: var(--text-3); width: 18px; height: 18px; }
.icon-tile {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--fill-2);
}
.icon-tile svg { width: 26px; height: 26px; }

/* плитка-ссылка и статистика */
.tile { padding: 14px; min-height: 124px; display: flex; flex-direction: column; overflow: hidden; }
.tile .title { font-weight: 650; margin-top: auto; padding-top: 14px; }
.tile .sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.tile .corner { position: absolute; top: 12px; right: 12px; color: var(--text-3); width: 18px; height: 18px; }
.stat { padding: 14px; min-height: 0; }
.stat .label { font-size: 13px; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; }
.stat .value { font-size: 19px; font-weight: 720; margin-top: 10px; letter-spacing: -.01em; }
.stat .hint { font-size: 11px; color: var(--text-3); margin-top: 5px; }

.note { padding: 12px; }
.note .inner { padding: 10px 12px; border-radius: 12px; background: var(--fill-1); border-left: 3px solid var(--accent); font-weight: 600; line-height: 1.4; }

.action { height: 56px; border-radius: 22px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; font-size: 16px; }

.empty { padding: 44px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--text-2); }
.empty b { color: var(--text); font-size: 17px; }

/* ============ кнопки и формы ============ */
.btn {
  position: relative; width: 100%; height: 54px; border-radius: 18px; padding: 0 18px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 680; font-size: 16px; text-align: center;
  transition: transform .2s ease, opacity .2s;
}
.btn:active { transform: scale(.98); opacity: .85; transition-duration: .06s; }
.btn.primary { color: #fff; background: color-mix(in srgb, var(--accent) 86%, #000); }
.btn.ghost { background: var(--fill-2); }
.btn.danger { color: var(--bad); background: rgba(255, 107, 107, .12); }
.btn.s { height: 40px; border-radius: 14px; font-size: 14px; padding: 0 14px; }
.btn.auto { width: auto; }
.btn .money .rub { color: inherit; opacity: .7; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.busy { pointer-events: none; }
.btn.busy > * { opacity: 0; }
.btn.busy::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; animation: spin .7s linear infinite;
}
.btns { display: flex; gap: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; color: var(--text-2); padding: 0 4px; }
.field .hint { font-size: 12px; color: var(--text-3); padding: 0 4px; line-height: 1.35; }
.input {
  width: 100%; height: 50px; padding: 0 16px; border: 0; outline: 0; border-radius: 16px; font-size: 16px;
  background: var(--fill-2);
  transition: box-shadow .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--text-3); }
.input:focus { background: var(--fill-3); box-shadow: inset 0 0 0 1.5px var(--accent); }
textarea.input { height: auto; min-height: 104px; padding: 13px 16px; resize: none; line-height: 1.4; }
textarea.input.mono, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 21px) 22px, calc(100% - 16px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--surface); color: var(--text); }
.input-color { padding: 6px; width: 64px; }

.switch { position: relative; width: 52px; height: 32px; border-radius: 99px; flex-shrink: 0; background: var(--fill-4); transition: background .25s; }
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  transition: transform .22s ease;
}
.switch.on { background: var(--good); }
.switch.on::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px; }
.switch-row .t { font-weight: 600; }
.switch-row .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.seg { position: relative; display: flex; padding: 4px; border-radius: 16px; background: var(--fill-1); }
.seg button { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; height: 38px; border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--text-2); transition: color .25s; white-space: nowrap; padding: 0 6px; }
.seg button.active { color: var(--text); }
.seg .seg-lens {
  position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 12px;
  background: var(--seg-lens);
  transition: transform .25s var(--ease);
}

.stepper { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 16px; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.stepper button:active { background: var(--fill-3); }
.stepper b { min-width: 34px; text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; }

.codebox { padding: 14px; font-size: 14px; line-height: 1.45; max-height: 220px; overflow-y: auto; }

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text-2); flex-shrink: 0; }
.kv span:last-child { text-align: right; font-weight: 600; word-break: break-word; }
.kvs { padding: 2px 14px; }

/* ============ страницы и шторки ============ */
#layers { position: relative; z-index: 40; }
.page {
  position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg);
  transform: translateX(24px); opacity: 0;
  transition: transform .26s var(--ease), opacity .2s;
}
.page.in { transform: none; opacity: 1; }

.page-head {
  position: relative; z-index: 2; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; min-height: 52px;
  padding: calc(8px + var(--safe-top)) 60px 6px;
}
.page-head h1 { font-size: 17px; font-weight: 680; }
.page-head .round-btn { position: absolute; left: 14px; bottom: 8px; }
.page-head .head-action { position: absolute; right: 14px; bottom: 8px; }
.page-body {
  position: relative; z-index: 1; flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 12px 14px calc(28px + var(--safe-bottom));
  /* контент мягко растворяется под шапкой, а не обрезается по линии */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px);
  mask-image: linear-gradient(180deg, transparent 0, #000 14px);
}

.sheet-wrap { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--backdrop); opacity: 0; transition: opacity .25s; }
.sheet {
  position: relative; width: calc(100% - 16px); max-width: 560px;
  max-height: calc(100% - 40px - var(--safe-top));
  margin-bottom: calc(8px + var(--safe-bottom));
  border-radius: 28px; overflow: hidden; display: flex; flex-direction: column;
  background: var(--sheet);
  box-shadow: var(--sheet-ring);
  transform: translateY(calc(100% + 40px));
  transition: transform .32s var(--ease);
}
.sheet-wrap.in .sheet-backdrop { opacity: 1; }
.sheet-wrap.in .sheet { transform: none; }
.sheet.dragging { transition: none; }
.sheet-grip { flex-shrink: 0; padding: 9px 0 6px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grip::after { content: ''; width: 38px; height: 5px; border-radius: 5px; background: var(--text-3); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 18px; }
.sheet-title { font-size: 20px; font-weight: 720; letter-spacing: -.01em; }

/* ============ тосты ============ */
#toasts { position: fixed; z-index: 90; left: 0; right: 0; top: calc(10px + var(--safe-top)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast {
  max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--toast); box-shadow: var(--toast-shadow);
  opacity: 0; transform: translateY(-10px); transition: opacity .2s, transform .25s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast.bad { color: var(--bad); }

/* ============ пополнение ============ */
.topup-hero { display: flex; flex-direction: column; align-items: center; padding: 6px 0 14px; }
.amount-input { display: flex; align-items: baseline; justify-content: center; margin-top: 4px; font-size: 52px; font-weight: 760; letter-spacing: -.03em; }
.amount-input input {
  border: 0; outline: 0; background: none; padding: 0; text-align: right; font-weight: inherit; letter-spacing: inherit;
  min-width: 1ch; caret-color: var(--accent);
}
.amount-input input::placeholder { color: var(--text-3); }
.amount-input .rub { color: var(--text-3); font-size: .62em; margin-left: .18em; font-weight: 650; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.presets button { height: 46px; border-radius: 16px; font-weight: 680; display: grid; place-items: center; }
.presets button.active { background: var(--surface-3); }
/* вариант срока: две строки — срок и цена */
.presets button.period { height: 64px; gap: 3px; align-content: center; }
.presets button.period b { font-size: 15px; }
.presets button.period span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.presets button.period.active { box-shadow: inset 0 0 0 1.5px var(--accent); }
.presets button.period.active span { color: var(--text); }
.presets .loading { padding: 14px 0; grid-column: 1 / -1; }

/* ============ админка ============ */
.chart { display: flex; align-items: flex-end; gap: 5px; height: 76px; margin-top: 14px; }
.chart i { flex: 1; min-height: 4px; border-radius: 5px; background: var(--accent); opacity: .45; }
.chart i:last-child { opacity: 1; }
.alert { box-shadow: inset 0 0 0 1px rgba(255, 179, 64, .4); }
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--bad); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.sticker-grid button { aspect-ratio: 1; border-radius: 16px; display: grid; place-items: center; }
.sticker-grid button.active { box-shadow: inset 0 0 0 2px var(--accent); background: var(--fill-3); }
.sticker-pick { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 18px; }
.sticker-pick { width: 100%; }
.sticker-pick .chev { width: 18px; height: 18px; }
.sticker-pick .slot { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--fill-1); overflow: hidden; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form .glass.card { display: flex; flex-direction: column; gap: 14px; }
.link-edit { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.stock-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13px; }
.sticky-bottom { position: sticky; bottom: 0; padding-top: 10px; }

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

/* внутри шторки карточки на тон светлее её фона */
.sheet .glass { background: var(--surface-2); }

/* ============ главная: поиск, акции, разделы ============ */
.search {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 16px;
  background: var(--surface); color: var(--text-3);
}
.search:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.search-input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16px;
  -webkit-appearance: none; appearance: none;
}
.search-input::placeholder { color: var(--text-3); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-reset { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--text-2); }

.promo { display: grid; gap: 8px; }
.promo-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 0;
  overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r-lg);
}
.promo-slide {
  position: relative; isolation: isolate; scroll-snap-align: start; height: 148px; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface); text-align: left;
}
.promo-slide.plain { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 35%, #000)); }
.promo-image { position: absolute; inset: 0; z-index: -1; }
.promo-image .stk, .promo-image img { width: 100% !important; height: 100% !important; }
.promo-image img { object-fit: cover !important; }
.promo-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .7)); }
.promo-text { position: absolute; left: 16px; right: 16px; bottom: 14px; display: grid; gap: 3px; color: #fff; }
.promo-text b { font-size: 18px; font-weight: 720; line-height: 1.2; }
.promo-text span { font-size: 13px; color: rgba(255, 255, 255, .78); }
.promo-dots { display: flex; justify-content: center; gap: 6px; }
.promo-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-3); transition: width .2s, background .2s; }
.promo-dots i.on { width: 18px; background: var(--accent); }

.lane-section { display: grid; gap: 10px; }
.lane-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.lane-head h2 { font-size: 19px; font-weight: 720; letter-spacing: -.01em; }
.lane-all { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.lane {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 10px) / 1.85); gap: 10px;
  overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -14px; padding: 0 14px; scroll-padding: 0 14px;
}
.lane > * { scroll-snap-align: start; }

.card-rating { margin-top: 5px; font-size: 12px; font-weight: 650; color: #ffcc4d; }
.card-rating span { color: var(--text-3); font-weight: 500; }

/* ============ скидка и промокод ============ */
.discount-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 40%, transparent); }
.discount-row b { font-size: 14px; }
.discount-icon { font-size: 24px; line-height: 1; }
.old-price { opacity: .6; font-weight: 600; margin-right: 2px; }

/* ============ отзывы ============ */
.stars { color: #ffcc4d; letter-spacing: 1px; }
.stars.big { font-size: 22px; margin-top: 4px; }
.rating-inline { font-size: 13px; color: var(--text-2); }
.review { padding: 12px 14px; display: grid; gap: 6px; }
.review-head { display: flex; align-items: center; gap: 8px; }
.review-head b { font-size: 14px; }
.review-head .stars { font-size: 13px; }
.review-text { font-size: 14px; line-height: 1.4; color: var(--text-2); }
.rate { display: flex; justify-content: center; gap: 6px; }
.rate button { font-size: 34px; line-height: 1; color: var(--surface-3); transition: transform .15s, color .15s; }
.rate button.on { color: #ffcc4d; }
.rate button:active { transform: scale(1.2); }

/* ---------- СБП: комментарий к переводу ---------- */
.sbp-comment { padding: 14px; display: grid; gap: 10px; justify-items: center; text-align: center; box-shadow: inset 0 0 0 1px rgba(255, 179, 64, .45); }
.sbp-comment-head { font-weight: 650; color: var(--warn); }
.sbp-code { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 14px; background: rgba(255, 179, 64, .14); color: var(--text); font: 800 30px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 1px; }
.sbp-code .ico { width: 20px; height: 20px; color: var(--warn); }
.kv .kv-copy { width: 15px; height: 15px; margin-left: 6px; vertical-align: -2px; color: var(--text-3, rgba(255, 255, 255, .45)); }

/* ============ светлая тема (как в Telegram) ============ */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f2f2f6;
  --surface-3: #e4e4eb;
  --text: #0c0c10;
  --text-2: rgba(12, 12, 16, .6);
  --text-3: rgba(12, 12, 16, .38);
  --fill-1: rgba(0, 0, 0, .04);
  --fill-2: rgba(0, 0, 0, .055);
  --fill-3: rgba(0, 0, 0, .085);
  --fill-4: rgba(0, 0, 0, .14);
  --line: rgba(0, 0, 0, .07);
  --bar: rgba(255, 255, 255, .97);
  --bar-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 10px 30px rgba(0, 0, 0, .12);
  --lens: color-mix(in srgb, var(--accent) 16%, #fff);
  --fade: rgba(242, 242, 247, .94);
  --hero-1: color-mix(in srgb, var(--accent) 14%, #fff);
  --hero-2: #ffffff;
  --sheet: #ffffff;
  --sheet-ring: 0 0 0 1px rgba(0, 0, 0, .04), 0 -8px 40px rgba(0, 0, 0, .1);
  --backdrop: rgba(0, 0, 0, .34);
  --toast: #ffffff;
  --toast-shadow: 0 6px 24px rgba(0, 0, 0, .14);
  --seg-lens: #ffffff;
  --skeleton: rgba(0, 0, 0, .055);
  --skeleton-hi: rgba(0, 0, 0, .1);
  --warn: #d97f00;
  --good: #16a34a;
  --bad: #e5484d;
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] .tab.active { color: var(--accent); }
:root[data-theme="light"] .glass:not(.hero) { box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
:root[data-theme="light"] .sheet .glass { box-shadow: none; }
:root[data-theme="light"] .seg .seg-lens { box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="light"] .card-rating, :root[data-theme="light"] .stars, :root[data-theme="light"] .rate button.on { color: #f0a400; }
/* на картинке-баннере текст всегда светлый */
.hero:has(.hero-banner) { color: #fff; --text-2: rgba(255, 255, 255, .72); --text-3: rgba(255, 255, 255, .5); --fill-3: rgba(255, 255, 255, .16); }

/* ============ бренд ============ */
.logo-mark { display: inline-flex; flex-shrink: 0; border-radius: 30%; overflow: hidden; box-shadow: 0 4px 14px rgba(139, 108, 255, .35); }
.logo-mark svg { display: block; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 760; letter-spacing: -.02em; }

/* ============ скелетоны ============ */
.sk { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--skeleton); }
.sk::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skeleton-hi), transparent);
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-hero { height: 190px; border-radius: var(--r-xl); }
.sk-hero.s { height: 150px; }
.sk-bar { height: 46px; border-radius: 16px; }
.sk-card { height: 172px; }
.sk-row { height: 68px; border-radius: 22px; }
.sk-action { height: 56px; border-radius: 22px; }
.sk-stat { height: 92px; }
.sk-wrap { animation: none !important; }

/* ============ появление карточек ============ */
.enter .lane > *, .enter .grid > .product, .enter .again > * { animation: card-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.cover, .game-cover, .again-cover, .hero-img, .hero-opt-img { opacity: 0; transition: opacity .35s ease; }
.cover.loaded, .game-cover.loaded, .again-cover.loaded, .hero-img.loaded, .hero-opt-img.loaded { opacity: 1; }
.game-cover { background: var(--skeleton); }

/* ============ навигация по разделам ============ */
.nav-chips {
  /* у .view сверху отступ 12px + safe-area: прилипаем ровно под safe-area */
  position: sticky; top: -12px; z-index: 8;
  display: flex; gap: 8px; overflow-x: auto; margin: -4px -14px 0; padding: 8px 14px;
  background: linear-gradient(180deg, var(--bg) 78%, transparent);
}
.nav-chips button {
  height: 34px; padding: 0 15px; border-radius: 999px; flex-shrink: 0; white-space: nowrap;
  font-size: 14px; font-weight: 650; color: var(--text-2); background: var(--surface);
  transition: background .2s, color .2s;
}
.nav-chips button.on { color: #fff; background: var(--accent); }
.lane-section { scroll-margin-top: calc(56px + var(--safe-top)); }

/* ============ «Купить снова» ============ */
.lane.again { grid-auto-columns: 74%; }
.again-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 20px; min-height: 68px; text-align: left; }
.again-card .stk { margin: 0; }
.again-cover { width: 64px; height: 30px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--skeleton); }
.again-title { font-size: 14px; font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.again-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.again-go { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.again-go .ico { width: 17px; height: 17px; }

/* ============ лента «Только что купили» ============ */
.feed { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 14px; border-radius: 16px; background: var(--surface); overflow: hidden; font-size: 13px; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex-shrink: 0; box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.feed-cap { color: var(--text-3); font-weight: 600; flex-shrink: 0; }
.feed-text { position: relative; flex: 1; min-width: 0; height: 100%; }
.feed-line { position: absolute; inset: 0; display: flex; align-items: center; white-space: nowrap; overflow: hidden; animation: feed-in .45s var(--ease) both; }
.feed-line b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.feed-line span { color: var(--text-3); flex-shrink: 0; margin-left: 4px; }
.feed-line.out { animation: feed-out .4s var(--ease) both; }
@keyframes feed-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes feed-out { to { opacity: 0; transform: translateY(-14px); } }

/* ============ акции ============ */
.sale-badge {
  position: absolute; top: 12px; left: 12px; z-index: 4;
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff4f6d, #ff2d87); box-shadow: 0 4px 12px rgba(255, 45, 135, .35);
}
.product:not(.game) .sale-badge { left: auto; right: 12px; }
.product:not(.game) .sale-badge ~ .badge { top: 40px; }
.price .was { font-size: 12px; font-weight: 600; color: var(--text-3); margin-right: 5px; letter-spacing: 0; }
.card-timer { margin-top: 5px; font-size: 11px; font-weight: 700; color: var(--warn); font-variant-numeric: tabular-nums; }
.chip.sale { color: #fff; background: linear-gradient(135deg, #ff4f6d, #ff2d87); }
.countdown { font-variant-numeric: tabular-nums; }

/* ============ подсказки под полем ============ */
.suggest { display: flex; gap: 6px; overflow-x: auto; margin: 0 -2px; padding: 0 2px; }
.suggest button { height: 30px; padding: 0 12px; border-radius: 999px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--fill-2); white-space: nowrap; }
.suggest button.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* ============ подарок ============ */
.gift-box { padding: 12px 14px; display: grid; gap: 10px; }
.gift-extra { display: grid; gap: 6px; }
.gift-extra .input { min-height: 64px; }
.gift-extra .hint { font-size: 12px; color: var(--text-3); line-height: 1.35; padding: 0 4px; }
.gift-card {
  position: relative; padding: 16px; border-radius: 22px; display: grid; gap: 10px; text-align: center;
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--brand) border-box; border: 1.5px solid transparent;
}
.gift-card .gift-link { font-size: 13px; color: var(--text-2); word-break: break-all; }
.gift-card .note { font-size: 14px; font-style: italic; color: var(--text-2); }

/* ============ статус заказа ============ */
.timeline { padding: 14px 16px; display: grid; }
.tl-step { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step i { position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; flex-shrink: 0; background: var(--surface-3); }
.tl-step:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 18px; bottom: 0; width: 2px; background: var(--surface-3); }
.tl-step.done i { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 18%, transparent); }
.tl-step.done:not(:last-child)::before { background: color-mix(in srgb, var(--good) 55%, transparent); }
.tl-step.current i { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 22%, transparent); animation: blink 1.4s ease-in-out infinite; }
.tl-step.bad i { background: var(--bad); }
.tl-step b { display: block; font-size: 14px; font-weight: 650; }
.tl-step span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tl-step.wait b { color: var(--text-3); }
@keyframes blink { 50% { opacity: .45; } }

.btn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* ============ конфетти ============ */
.confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; width: 100%; height: 100%; }

/* ============ обложка шапки ============ */
.hero-deco { position: absolute; right: 4px; bottom: 2px; z-index: -1; opacity: .95; pointer-events: none; }
.hero-edit { background: var(--fill-3) !important; }
.hero:has(.hero-banner) .hero-edit { background: rgba(0, 0, 0, .28) !important; color: #fff; backdrop-filter: blur(6px); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-opt { display: grid; gap: 6px; text-align: center; }
.hero-opt-pic {
  position: relative; aspect-ratio: 2 / 1; border-radius: 16px; overflow: hidden; display: grid; place-items: center;
  background: var(--skeleton); box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .2s;
}
.hero-opt-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-opt-empty { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(150deg, var(--hero-1), var(--hero-2)); }
.hero-opt-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hero-opt-check {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: var(--accent); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s var(--spring);
}
.hero-opt-check .ico { width: 14px; height: 14px; }
.hero-opt.on .hero-opt-pic { box-shadow: inset 0 0 0 3px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.hero-opt.on .hero-opt-check { opacity: 1; transform: none; }
.hero-opt.on .hero-opt-title { color: var(--text); }

/* ============ колесо удачи и бонусы ============ */
.perk { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 20px; text-align: left; min-height: 64px; }
.perk-ico { font-size: 28px; line-height: 1; flex-shrink: 0; }
.perk b { display: block; font-size: 15px; font-weight: 700; }
.perk span:not(.perk-ico):not(.countdown) { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.perk .countdown { color: var(--text-3); font-size: 12px; }
.perk.ready { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.perk.ready .perk-ico { animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-14deg); } 90% { transform: rotate(12deg); } }

.wheel { position: relative; width: min(300px, 82vw); aspect-ratio: 1; margin: 6px auto 0; }
.wheel-disc {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  box-shadow: 0 10px 40px rgba(124, 92, 255, .35), 0 0 0 6px var(--surface-3);
  transition: transform 4.2s cubic-bezier(.12, .7, .08, 1);
}
.wheel-disc svg { display: block; }
.wheel-pointer {
  position: absolute; z-index: 3; top: -10px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--text);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35));
}
.wheel-hub { position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 30%; box-shadow: 0 0 0 5px var(--sheet); }
.wheel-result { display: grid; gap: 2px; text-align: center; min-height: 44px; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--ease); }
.wheel-result.in { opacity: 1; transform: none; }
.wheel-result b { font-size: 20px; }
.wheel-result span { font-size: 13px; color: var(--text-2); }

/* ============ частые вопросы ============ */
.faq { border-radius: 20px; }
.faq summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 650; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary > span:first-child { flex: 1; }
.faq-chev { width: 18px; height: 18px; color: var(--text-3); transition: transform .2s; }
.faq[open] .faq-chev { transform: rotate(90deg); }
.faq-a { padding: 0 16px 14px; font-size: 14px; line-height: 1.45; color: var(--text-2); }

/* ============ админка: призы ============ */
.prize-edit { display: grid; gap: 6px; padding: 10px; }
.prize-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; align-items: center; }
.prize-row .input { height: 42px; }

.fatal .logo-mark { margin-bottom: 8px; }

/* ============ документы и согласие ============ */
.doc { padding: 18px 16px; }
.doc-h { font-size: 16px; font-weight: 720; margin: 18px 0 8px; }
.doc-h:first-child { margin-top: 0; }
.doc-p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.consent {
  position: fixed; inset: 0; z-index: 35; display: flex; align-items: flex-end; justify-content: center;
  padding: 0 8px calc(8px + var(--safe-bottom)); background: var(--backdrop); opacity: 0; transition: opacity .3s;
}
.consent.in { opacity: 1; }
.consent.out { opacity: 0; pointer-events: none; }
.consent-card {
  width: 100%; max-width: 560px; display: grid; gap: 14px; justify-items: center; text-align: center;
  padding: 22px 16px 16px; border-radius: 28px; background: var(--sheet); box-shadow: var(--sheet-ring);
  transform: translateY(30px); transition: transform .35s var(--ease);
}
.consent.in .consent-card { transform: none; }
.consent-card > .btn { width: 100%; }
.consent-docs { width: 100%; display: grid; gap: 6px; }
.consent-doc { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-weight: 600; font-size: 14px; text-align: left; }
.consent-doc .ico { color: var(--text-3); }

/* ============ админка: источники ============ */
.source-card { display: grid; gap: 10px; }
.source-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.source-stats div { display: grid; gap: 2px; padding: 8px; border-radius: 12px; background: var(--fill-1); }
.source-stats b { font-size: 15px; }
.source-stats span { font-size: 11px; color: var(--text-3); }


/* ============ сайт в браузере (html.web) ============ */
.site-head { display: none; }
.guest-title { font-size: 22px; font-weight: 760; letter-spacing: -.02em; line-height: 1.2; max-width: 440px; }
.guest-hero .btn { width: auto; height: 46px; border-radius: 16px; font-size: 15px; }
.login-box { align-items: center; text-align: center; gap: 12px; padding: 6px 0 4px; }
.login-box .muted { max-width: 360px; line-height: 1.4; }
.login-box a { color: var(--accent); text-decoration: none; font-weight: 650; }
.tg-login { min-height: 48px; display: grid; place-items: center; }
.tg-login iframe { display: block; }
.login-card { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 30px 20px 22px; }
.login-card .muted { max-width: 380px; line-height: 1.4; }
.login-card .btn { max-width: 320px; margin-top: 6px; }

@media (min-width: 900px) {
  html.web { --site-w: 1040px; --site-head: 64px; --site-pad: 88px; }
  html.web .tabbar, html.web .tab-fade { display: none; }
  html.web .site-head {
    display: flex; align-items: center; gap: 28px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 64px;
    padding: 0 max(24px, calc((100vw - var(--site-w)) / 2));
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .site-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 760; letter-spacing: -.02em; flex-shrink: 0; }
  .site-nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
  .site-link { height: 38px; padding: 0 14px; border-radius: 999px; font-weight: 650; color: var(--text-2); white-space: nowrap; transition: background .2s, color .2s; }
  .site-link:hover { color: var(--text); background: var(--fill-1); }
  .site-link.active { color: var(--text); background: var(--surface-2); }
  .site-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .site-balance { height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); font-weight: 700; }
  .site-balance:hover, .site-avatar:hover { opacity: .85; }
  .site-login { width: auto; height: 40px; border-radius: 999px; font-size: 14px; }

  /* контент шире, чем в мини-аппе: витрина и админка — во всю ширину сайта, остальное — колонкой */
  html.web .view { padding: var(--site-pad) 24px 56px; }
  html.web .view > * { max-width: 760px; }
  html.web .view[data-tab="home"] > *, html.web .view[data-tab="admin"] > * { max-width: var(--site-w); }
  html.web .view[data-tab="home"] .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  /* горизонтальные ленты мышью листать неудобно — раскладываем сеткой */
  html.web .lane { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); overflow: visible; margin: 0; padding: 0; }
  html.web .lane.again { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  /* sticky отсчитывается от края верхнего отступа ленты, а не от края экрана: прилипаем ровно под шапку */
  html.web .nav-chips { top: calc(var(--site-head) - var(--site-pad)); margin: -4px 0 0; padding: 10px 0; }
  html.web .lane-section { scroll-margin-top: 130px; }
  html.web .chips { margin: 0; padding: 2px 0; }
  html.web .hero { min-height: 220px; padding: 24px; }
  /* логотип уже в шапке сайта */
  html.web .guest-hero .hero-top { display: none; }
  html.web .guest-hero { justify-content: center; }

  /* страницы — колонкой по центру, шторки — окном по центру */
  html.web .page-head { padding-top: 16px; }
  html.web .page-body > * { max-width: 760px; }
  html.web .sheet-wrap { align-items: center; }
  html.web .sheet {
    max-width: 520px; margin-bottom: 0; max-height: calc(100% - 80px);
    opacity: 0; transform: translateY(24px) scale(.98);
    transition: transform .28s var(--ease), opacity .2s;
  }
  html.web .sheet-wrap.in .sheet { opacity: 1; transform: none; }
  html.web .sheet-grip { visibility: hidden; padding: 6px 0 4px; }
  html.web .consent { align-items: center; }
  html.web #toasts { top: 76px; }

  html.web .view, html.web .page-body, html.web .sheet-body { scrollbar-width: thin; scrollbar-color: var(--fill-3) transparent; }
  html.web .pressable:hover { filter: brightness(1.12); }
}
