/* 02.11.2026: фактический визуальный перенос утверждённого LEFT.
   Это интерфейс приложения, без рамки телефона, native-шапки Telegram и демо-сценариев. */
:root {
  color-scheme: dark;
  --bg: #08060b; --surface: #16121d; --surface-2: #211528; --surface-3: #1f1928;
  --text: #f6f1fa; --muted: #a79caf; --border: #33273f; --border-strong: #51305d;
  --pink: #f341b4; --violet: #9e42ef; --primary: #f05baa; --ok: #44dd9a; --danger: #ff91a7;
  --grad: linear-gradient(135deg, #ef40ac, #9c35e6);
  --nav-grad: linear-gradient(100deg, #c82580 0%, #8f2ab6 55%, #6632c6 100%);
  --r: 20px; --r-sm: 14px; --tabbar-h: 66px; --nav-gap: 12px;
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; color: var(--text); }
html { scroll-padding-bottom: calc(var(--tabbar-h) + var(--nav-gap) + 16px + var(--safe-b)); }
body { min-height: 100vh; background: radial-gradient(ellipse at 0 0, #240d1b, transparent 40%), #08060b; background-attachment: fixed; font-size: 16px; }
p, h1, h2, h3 { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: transparent; padding: 0; }
button:disabled { opacity: .6; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid #ffb9e5; outline-offset: 4px; }
button svg { pointer-events: none; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; display: block; }
.ic--accent { color: var(--primary); }
.ic--muted { color: var(--muted); width: 18px; height: 18px; }
.app { max-width: 410px; margin: 0 auto; padding: 0 16px calc(110px + var(--safe-b)); }
.top { display: flex; align-items: center; gap: 8px; padding: 18px 19px 14px; margin: 0 -16px; font-size: 16px; font-weight: 750; letter-spacing: .3px; }
.top__mark { width: 20px; height: 25px; object-fit: contain; }
.top__name { font-weight: 900; }
.top__light { font-weight: 350; color: #d8cadf; }
.panel { display: block; }
.hero { border: 1px solid #51305d; background: linear-gradient(130deg, #24172c, #100d17); border-radius: 23px; padding: 21px 19px; margin-bottom: 22px; }
.hero.is-active { border-color: #255840; background: linear-gradient(130deg, #11271e, #15101a); }
.hero__eyebrow { display: flex; align-items: center; gap: 8px; color: #c5b9cc; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.hero.is-active .hero__eyebrow::before { content: ""; width: 7px; height: 7px; flex: none; background: var(--ok); box-shadow: 0 0 12px #44dd9a88; border-radius: 50%; }
.hero__big { font-size: 30px; font-weight: 700; letter-spacing: -.9px; margin: 11px 0 7px; line-height: 1.13; overflow-wrap: anywhere; }
.hero__sub { color: var(--muted); font-size: 13px; line-height: 1.55; white-space: pre-line; }
.hero.is-active .hero__sub { color: #b8e7cf; font-size: 12px; }
.hero__big--grad { color: var(--pink); }
.hero__sub b { color: var(--text); }
.block { display: block; }
.block__title, .management-title { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin: 21px 1px 11px; }
.tariffs { display: flex; flex-direction: column; gap: 8px; }
.tariff { display: grid; width: 100%; grid-template-columns: 17px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #120e18; text-align: left; }
.tariff.is-selected { background: #211528; border-color: #d747b7; }
.tariff__radio { height: 17px; width: 17px; border: 2px solid #75517d; border-radius: 50%; position: relative; }
.tariff.is-selected .tariff__radio { border-color: var(--pink); }
.tariff.is-selected .tariff__radio::after { content: ""; position: absolute; inset: 3px; background: var(--pink); border-radius: 50%; }
.tariff__name { display: block; font-size: 14px; font-weight: 700; }
.tariff__per { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.tariff__price { margin-left: auto; font-size: 18px; font-weight: 750; white-space: nowrap; }
.badge { font-size: 10px; background: #71338c; color: #fff; padding: 3px 5px; border-radius: 6px; margin-left: 5px; font-weight: 700; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.seg__btn { font-size: 12px; padding: 12px 5px; min-height: 44px; border: 1px solid var(--border); border-radius: 12px; background: #15101b; }
.seg__btn.is-selected { border-color: #da42ac; background: #2b172b; color: #ffb7e4; }
.seg__btn .ic { display: none; }
.note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.error { font-size: 12px; line-height: 1.5; color: var(--danger); margin-top: 8px; }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; border: 0; border-radius: 14px; min-height: 48px; padding: 13px 16px; font-size: 14px; font-weight: 700; color: #fff; }
.btn--cta { background: linear-gradient(110deg, var(--pink), var(--violet)); box-shadow: 0 6px 22px #a0217620; }
.btn--ghost { background: #201625; border: 1px solid #6a3661; color: #f5b4de; box-shadow: none; }
.btn--quiet { background: transparent; color: #f6a6d9; box-shadow: none; }
.btn + .btn { margin-top: 9px; }
#pay-submit { margin-top: 18px; }
#methods-block > .note { margin: 12px 2px 0; }
.management { margin-top: 24px; padding-top: 1px; }
.management > .management-title { margin-top: 0; }
.links { display: block; }
.link { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: #15101b; text-align: left; margin-top: 8px; font-size: 13px; }
.link__text { min-width: 0; }
.link__sub { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.chev { font-size: 22px; color: #ab7d9e; }
.link:disabled { opacity: .5; }
.result { padding: 15px; border: 1px solid #554434; background: #231b13; border-radius: 15px; margin: 16px 0; }
.result--ok { border-color: #315d48; background: #13271e; }
.result__title { font-size: 15px; font-weight: 700; margin-bottom: 7px; }
.result__text { font-size: 12px; color: #c6b6c8; line-height: 1.55; }
.result .btn { margin-top: 12px; }
.payment-status > .note { margin-top: 12px; }
.screen-title { font-size: 25px; font-weight: 700; letter-spacing: -.6px; margin: 5px 0 10px; }
#panel-guide > .block .note { margin-bottom: 0; }
.seg--devices { grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6px; margin: 18px 0; }
.seg--devices .seg__btn { min-height: 40px; padding: 8px 3px; border-radius: 10px; background: #18111e; font-size: 11px; }
.seg--devices .seg__btn.is-selected { border-color: var(--pink); background: #35203b; color: var(--text); }
.guide-requirements { padding: 15px; border: 1px solid #554434; background: #231b13; border-radius: 15px; margin: 16px 0; }
.guide-requirements h2 { font-size: 17px; margin-bottom: 8px; }
.guide-requirements p { font-size: 12px; color: #c6b6c8; line-height: 1.55; }
.steps { padding: 0; list-style: none; margin: 20px 0; counter-reset: step; }
.step { display: flex; gap: 13px; margin: 23px 0; counter-increment: step; }
.step::before { content: counter(step); width: 30px; height: 30px; display: grid; place-items: center; background: #39203e; color: #f6b3de; border-radius: 9px; flex: none; font-size: 14px; }
.step__title { font-size: 15px; font-weight: 700; line-height: 1.45; margin-bottom: 7px; }
.step__text { font-size: 14px; line-height: 1.65; color: #c8bdcf; overflow-wrap: anywhere; }
.tips { display: block; }
.tip { padding: 15px; background: #17101e; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px; font-size: 14px; line-height: 1.65; color: #c8bdcf; }
.tip b { display: block; font-size: 15px; line-height: 1.45; margin-bottom: 7px; }
#guide-desktop-note { margin: 10px 0; }
#panel-guide > .btn { margin-top: 9px; }
#panel-ref .hero { margin-bottom: 22px; }
.wallet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding-top: 15px; margin-top: 17px; font-size: 12px; color: var(--muted); }
.wallet-row b { display: block; font-size: 15px; color: var(--text); margin-top: 5px; }
.wallet-action { border: 1px solid #86396c; border-radius: 11px; background: #351b32; color: #ffb2e1; padding: 10px 13px; min-height: 44px; font-size: 13px; font-weight: 700; flex: none; }
#panel-ref .block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 23px 0 12px; }
#panel-ref .block__title { margin: 0 2px; font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.counts { font-size: 13px; color: var(--muted); white-space: nowrap; }
.counts b { color: var(--text); }
.friends { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.friend { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; }
.friend + .friend { border-top: 1px solid var(--border); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); }
.avatar--off { background: var(--surface-3); color: var(--muted); }
.friend__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend__meta { font-size: 12px; color: var(--muted); }
.friend__meta .on { color: var(--ok); }
.friend__sum { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.friend__sumlabel { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.friend__sum--plus { color: var(--primary); }
.friend__sum--zero { color: var(--muted); font-weight: 600; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.textbtn { color: #f6a6d9; font-size: 13px; font-weight: 700; }
.promo { margin: 12px 0; }
.promo__open { font-size: 12px; }
.promo__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.promo__input { width: 100%; min-width: 0; padding: 14px; border: 1px solid #705378; border-radius: 12px; background: #110c17; color: #f3d2ea; font: inherit; text-transform: uppercase; letter-spacing: .08em; }
.promo__apply { padding: 10px 16px; }
.promo__on { font-size: 12px; color: var(--ok); padding: 12px; background: #13271e; border: 1px solid #315d48; border-radius: 12px; }
.sitelink__input { text-transform: none; letter-spacing: normal; }
#sitelink-form { display: flex; flex-direction: column; margin-top: 14px; }
.codeinput { width: 100%; min-height: 56px; padding: 10px 14px; border-radius: 12px; border: 1px solid #705378; background: #110c17; color: var(--text); font: inherit; font-size: 24px; letter-spacing: .35em; text-align: center; text-transform: uppercase; }
#panel-tv .note { margin: 12px 0; }
#tv-send { margin-top: 14px; }
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 100; background: #0009; display: flex; align-items: flex-end; justify-content: center; padding: 10px 10px calc(10px + var(--safe-b)); overscroll-behavior: contain; }
.sheet { position: relative; width: 100%; max-width: 390px; max-height: calc(100dvh - 40px - var(--safe-b)); overflow-y: auto; overscroll-behavior: contain; padding: 23px 18px 22px; border: 1px solid #624569; border-radius: 25px; background: linear-gradient(130deg,#2b1932,#16101c); box-shadow: 0 -10px 50px #0008; }
.sheet__head { margin-bottom: 10px; padding-right: 24px; }
.sheet__head h2 { font-size: 23px; margin: 0; }
.sheet__close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; font-size: 23px; color: #beafc6; border-radius: 10px; }
.sheet .note { font-size: 13px; line-height: 1.5; color: #beafc6; }
.sheet .note + .note { margin-top: 12px; }
.sheet .btn { margin-top: 9px; }
.sheet__summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; margin: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 15px; }
.share-preview { background: #130d19; border: 1px solid var(--border); border-radius: 13px; padding: 15px; margin: 16px 0; overflow-wrap: anywhere; }
.share-preview p { font-size: 13px; line-height: 1.6; }
.share-preview__url { color: #f5a9da; font-family: monospace; font-size: 12px !important; margin-top: 10px !important; }
.copy-fallback { margin-top: 12px; }
.copy-fallback label { display: block; font-size: 13px; margin-bottom: 8px; }
.copy-fallback input { width: 100%; text-transform: none; letter-spacing: normal; }
.toast { position: fixed; z-index: 110; left: 50%; bottom: calc(95px + var(--safe-b)); transform: translateX(-50%); width: calc(100% - 36px); max-width: 374px; padding: 13px; border: 1px solid #705378; background: #39253e; border-radius: 13px; font-size: 12px; line-height: 1.5; box-shadow: 0 8px 30px #0008; text-align: center; pointer-events: none; }
.sheet-open .toast { top: calc(16px + env(safe-area-inset-top, 0px)); bottom: auto; }
.skeleton { display: flex; flex-direction: column; gap: 10px; }
.sk { height: 64px; border-radius: 14px; background: #17121e; }
.sk--hero { height: 128px; border-radius: 23px; }
.fatal { text-align: center; padding: 40px 8px; }
.fatal__text { margin-bottom: 16px; color: var(--muted); }
@supports not (height: 100dvh) { .sheet { max-height: calc(100vh - 40px - var(--safe-b)); } }
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Действующая нижняя панель сохранена отдельно без геометрических изменений. */
/* Нижняя панель (27.10.2026, референс владельца): плавающая «стеклянная» плашка поверх
   контента. По краям разделы, в центре два действия: «Оплатить» — залитая градиентом
   «таблетка» вокруг иконки, «Пригласить» — такая же, но стеклянная. У действий нет точки активного раздела. */
.nav {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-gap) + var(--safe-b));
  width: calc(100% - 28px);
  max-width: 452px;
  height: var(--tabbar-h);
  margin: 0 auto;
  padding: 0 4px;
  display: grid;
  /* «Пригласить» — самая длинная подпись, ей колонка чуть шире: на 360 px влезает без обрезки. */
  grid-template-columns: 1fr 1fr 1fr 1.15fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
    rgba(30, 22, 40, 0.42);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
/* Без размытия (старые Android WebView) — плотнее, чтобы текст под панелью не мешал. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)), rgba(22, 17, 30, 0.97); }
}
/* Клавиатура открыта — панель уезжает вниз, не закрывая поле ввода. */
body.is-typing .nav { transform: translateY(calc(100% + 40px)); opacity: 0; pointer-events: none; }

.nav__item {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Все подписи стоят на одной линии: содержимое прижато к низу, сверху остаётся место. */
  justify-content: flex-end;
  gap: 4px;
  padding: 0 2px 13px;
  border-radius: 20px;
  color: rgba(246, 243, 250, 0.52);
  transition: color 0.18s ease;
}
.nav__ic { width: 24px; height: 24px; display: block; flex: none; stroke-width: 1.8; transition: transform 0.18s ease, color 0.18s ease; }
.nav__label {
  max-width: 100%;
  font-size: 11px;
  line-height: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.nav__item.is-active { color: #fff; }
.nav__item.is-active .nav__ic { color: #fff; filter: drop-shadow(0 0 6px rgba(240, 91, 170, 0.55)); }
/* Точка под подписью активного раздела. Место под неё есть всегда — подпись не прыгает. */
.nav__item[data-tab]::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  margin-left: -2px; /* точно по центру подписи, не полагаемся на static position */
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.nav__item.is-active::after { opacity: 1; transform: none; }
.nav__item:active .nav__ic { transform: scale(0.92); }

/* «Оплатить»: та же «таблетка», что у «Пригласить», но залитая градиентом и со свечением.
   Стоит на одной линии с соседями, не выступает (правка владельца 27.10.2026). */
.nav__item--pay { color: #fff; }
.nav__fab {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 30px;
  margin: -3px 0; /* в потоке занимает 24 px, как иконка соседей — подписи на одной линии */
  border-radius: 12px;
  background: var(--nav-grad);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow:
    0 4px 14px rgba(218, 49, 148, 0.45),
    0 2px 12px rgba(102, 50, 198, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.nav__fab .nav__ic { width: 20px; height: 20px; color: #fff; stroke-width: 2; }
.nav__item--pay .nav__label { color: #fff; font-weight: 700; }
.nav__item--pay:active .nav__fab { transform: translateY(1px) scale(0.97); }
.nav__item--pay:disabled { cursor: default; }
.nav__item--pay:disabled:not(.is-busy) .nav__fab { opacity: 0.5; box-shadow: none; }
.nav__spin { position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; opacity: 0; }
.nav__item--pay.is-busy .nav__ic { opacity: 0; }
.nav__item--pay.is-busy .nav__spin { opacity: 1; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* «Пригласить»: действие, а не раздел — иконка в стеклянном кружке с фирменным цветом. */
.nav__item--invite { color: rgba(246, 243, 250, 0.82); }
.nav__chip {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  margin: -3px 0;
  border-radius: 12px;
  background: rgba(240, 91, 170, 0.14);
  border: 1px solid rgba(240, 91, 170, 0.32);
}
.nav__chip .nav__ic { width: 20px; height: 20px; color: var(--primary); }

/* Узкие телефоны (320 px): панель шире, подписи мельче — «Оплатить» и «Пригласить» не слипаются. */
@media (max-width: 350px) {
  .nav { width: calc(100% - 20px); padding: 0 2px; }
  .nav__label { font-size: 9.5px; }
}

.nav__item:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
.nav__item--pay:focus-visible { outline: none; }
.nav__item--pay:focus-visible .nav__fab { outline: 2px solid #fff; outline-offset: 2px; }

#invite-copy-text { color: #beafc6; font-weight: 400; }

/* В эталоне процент друзей набран обычным начертанием. */
#ref-percent { font-weight: 400; }

.bonus-choice { margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.bonus-choice label { display:flex; align-items:center; gap:9px; font-size:13px; }
.bonus-choice input { accent-color:#e943b3; width:18px; height:18px; }

/* 04.11.2026: закрытая аналитика, читаемые показатели на узком телефоне. */
.ads-select { display:block; width:100%; margin:8px 0 18px; padding:12px; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--surface-2); color:var(--text); font:inherit; }
.ads-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:16px; margin-bottom:16px; }
.ads-card h2 { overflow-wrap:anywhere; }
.ads-card > .textbtn { display:block; overflow-wrap:anywhere; }
.ads-metric { display:flex; justify-content:space-between; gap:16px; margin:14px 0; }
.ads-metric span { color:var(--muted); }
.ads-metric b { text-align:right; flex-shrink:0; }

.ads-summary { border-color:var(--primary); background:var(--surface-2); }
#ads-results { scroll-margin-top:16px; }

#ads-entry { margin-top:20px; }

/* Personal Happ URL stays in a selectable field; never overflows mobile layout. */
.happ-device{margin-block:16px;min-width:0}.happ-device input{display:block;width:100%;max-width:100%;box-sizing:border-box;padding:12px;margin-block:10px;font:inherit}.happ-device .btn{margin-block:5px;white-space:normal;text-align:center}.happ-device p{overflow-wrap:anywhere}
