/* Кабинет. Образ: спокойная тёмная или светлая витрина, один акцент бренда,
   крупная цифра срока. Typhoon: циан → синий → фиолетовый.
   Тема — атрибут data-theme на <html> (light | dark): его ставит /static/theme.js
   до отрисовки — по выбору человека (кнопка темы) или по системе. Поэтому все
   светлые правила — под [data-theme="light"], а не @media. */

:root {
  color-scheme: dark;
  --font: "Geologica", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Roboto", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --bg: #0A0C11;
  --surface: #13161D;
  --surface-2: #1A1E27;
  --surface-3: #232835;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .12);
  --text: #F2F4F8;
  --text-2: #A2A9B9;
  --text-3: #6A7182;

  --accent: #3B82F6;
  --accent-2: #8B5CF6;
  --accent-soft: rgba(59, 130, 246, .15);
  --accent-glow: rgba(59, 130, 246, .32);
  --on-accent: #FFFFFF;
  --ok: #3DD68C;
  --warn: #FFB547;
  --danger: #FF5C6C;
  --danger-soft: rgba(255, 92, 108, .13);

  --hero-a: #1D4ED8;
  --hero-b: #6D28D9;
  --hero-c: #07142E;

  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sheet-ease: cubic-bezier(.32, .72, 0, 1);
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --bar-bg: rgba(10, 12, 17, .86);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F2F3F7;
  --surface: #FFFFFF;
  --surface-2: #F2F3F7;
  --surface-3: #E7E9EF;
  --line: rgba(15, 20, 35, .07);
  --line-strong: rgba(47, 107, 255, .22);
  --text: #0D1017;
  --text-2: #5C6372;
  --text-3: #969CAB;
  --accent-soft: rgba(59, 130, 246, .11);
  --danger-soft: rgba(229, 56, 74, .10);
  --danger: #E5384A;
  --shadow: 0 10px 30px rgba(20, 30, 60, .10);
  --bar-bg: rgba(242, 243, 247, .88);
}

@font-face {
  font-family: "Geologica";
  src: url("/static/fonts/geologica.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ───────── База ───────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
/* страница не «пружинит» и не тянется пальцем вбок — как приложение, а не сайт */
html { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior: none;
}
html.is-locked, html.is-locked body { overflow: hidden; }
html.is-locked body { position: fixed; left: 0; right: 0; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
input { font: inherit; color: inherit; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

.app {
  max-width: 460px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px));
  min-height: 100dvh;
}

/* ───────── Шапка ───────── */
.top { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-bottom: 12px; }
.top__title { line-height: 1.2; }
.top__logo {
  width: 34px; height: 34px; border-radius: 10px; overflow: hidden; flex: none;
  background: var(--surface-2); box-shadow: 0 0 0 1px var(--line);
}
.top__logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top__name { font-weight: 650; font-size: 18px; letter-spacing: -.01em; flex: 1; }
.top__title { font-weight: 650; font-size: 18px; letter-spacing: -.01em; flex: 1; }
.top__back {
  width: 40px; height: 40px; margin-left: -8px; border-radius: 12px;
  display: grid; place-items: center; color: var(--text);
}
.top__back:active { background: var(--surface-2); }
.top__action {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--text-2);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s;
}
.top__action:active { background: var(--surface-2); }

/* ───────── Карточка срока ───────── */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); padding: 20px 20px 18px; color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--hero-b) 0%, transparent 55%),
    radial-gradient(120% 120% at 0% 100%, var(--hero-a) 0%, transparent 60%),
    var(--hero-c);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10); pointer-events: none;
}
.hero__swirl {
  position: absolute; z-index: -1; right: -58px; top: -58px;
  width: 240px; height: 240px; opacity: .13; color: #CFF4FF;
  animation: swirl 90s linear infinite;
}
@keyframes swirl { to { transform: rotate(-360deg); } }
.hero.is-off {
  background:
    radial-gradient(120% 90% at 100% 0%, #3A3F4E 0%, transparent 55%),
    radial-gradient(120% 120% at 0% 100%, #2A2F3B 0%, transparent 60%),
    #171A22;
}
.status {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px 0 9px; border-radius: 99px;
  background: rgba(255, 255, 255, .14); font-size: 13px; font-weight: 550;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 214, 140, .25); }
.status.is-trial .status__dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 181, 71, .25); }
.status.is-off .status__dot { background: #FF5C6C; box-shadow: 0 0 0 3px rgba(255, 92, 108, .25); }
.left { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 2px; }
.left__num { font-size: 76px; line-height: .95; font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.left__unit { font-size: 22px; font-weight: 550; opacity: .9; letter-spacing: -.01em; }
.hero__sub { font-size: 14.5px; color: rgba(255, 255, 255, .72); min-height: 20px; }
.hero__sub b { color: #fff; font-weight: 550; }
.hero__actions { display: grid; gap: 8px; margin-top: 18px; }

/* ───────── Кнопки ───────── */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 54px; border-radius: var(--r-md);
  font-size: 16.5px; font-weight: 600; letter-spacing: -.005em;
  transition: transform .15s var(--ease), background-color .2s, opacity .2s, filter .2s;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.98); }
.btn--light { background: #fff; color: #0B1020; }
.btn--light:active { background: #E9ECF5; }
.btn--glass { background: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn--accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 22px var(--accent-glow); }
.btn--accent:active { filter: brightness(.92); }
.btn--tonal { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn--tonal:active { background: var(--surface-3); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:active { filter: brightness(1.1); }
.btn--small { height: 46px; font-size: 15.5px; border-radius: 14px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.is-busy { color: transparent !important; }
.btn.is-busy svg { opacity: 0; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.4px solid #fff; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.btn--light.is-busy::after { border-color: #0B1020; border-right-color: transparent; }
.btn--danger.is-busy::after { border-color: var(--danger); border-right-color: transparent; }
.btn--tonal.is-busy::after { border-color: var(--text); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Секции ───────── */
.section { margin-top: 26px; }
.section__head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; }
.section__title { font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin: 0; }
.chip {
  height: 26px; padding: 0 10px; border-radius: 99px; display: inline-flex; align-items: center;
  background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 550;
  font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--line);
}
.chip--full { color: var(--warn); }
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
.hint { color: var(--text-3); font-size: 13.5px; margin: 10px 6px 0; line-height: 1.45; }
.hint--center { text-align: center; }

.list { padding: 4px 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 14px 12px 16px; min-height: 66px; }
.row + .row { border-top: 1px solid var(--line); }
.row--tap { transition: background-color .15s; }
.row--tap:active { background: var(--surface-2); }
.row__icon {
  width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.row__body { min-width: 0; flex: 1; display: block; }
.row__title { display: block; font-weight: 560; font-size: 16px; overflow-wrap: anywhere; }
.row__sub { display: block; color: var(--text-2); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.row__chev { color: var(--text-3); }
.empty { padding: 22px 18px; text-align: center; color: var(--text-2); font-size: 14.5px; }
.empty__icon { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.empty--big { padding: 28px 20px 20px; display: grid; gap: 12px; justify-items: center; }
.empty--big .empty__icon { margin: 0; }
.after-list { margin-top: 10px; }
[data-theme="light"] .after-list.btn--tonal { background: var(--surface); }

/* приглашение */
.ref { padding: 18px; position: relative; overflow: hidden; }
.ref__glow {
  position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%); pointer-events: none;
}
.ref__head { display: flex; gap: 14px; align-items: flex-start; position: relative; }
.ref__icon {
  width: 46px; height: 46px; border-radius: 15px; flex: none; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(59, 130, 246, .35);
}
.ref__title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.ref__desc { color: var(--text-2); font-size: 14.5px; margin-top: 3px; }
.ref__links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px; position: relative; }
.ref__link {
  display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; text-align: left;
  min-height: 58px; padding: 8px 5px 8px 12px; border-radius: 14px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s;
}
.ref__link:active { background: var(--surface-3); }
.ref__kind { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.ref__text2 { flex: 1; min-width: 0; display: block; }
.ref__label { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 550; }
.ref__url { display: block; font-size: 14.5px; color: var(--text); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); flex: none; }
.ref__share { margin-top: 10px; }
.ref__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--line); }
.stat__num { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--text-2); font-size: 13px; margin-top: 1px; }

.foot { display: flex; justify-content: center; gap: 8px; margin: 26px 0 4px; flex-wrap: wrap; }
.foot__link {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 99px;
  color: var(--text-2); font-size: 14px; font-weight: 550; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.foot__link:active { background: var(--surface-2); }

/* ───────── Подключение ───────── */
.key { padding: 14px 14px 12px; margin-bottom: 12px; }
.key__head { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; }
.key__icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.key__label { flex: 1; font-weight: 650; font-size: 15.5px; }
.key__qr { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); }
.key__qr:active { background: var(--surface-3); }
.key__value {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left;
  height: 48px; padding: 0 6px 0 14px; border-radius: 13px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s;
}
.key__value:active { background: var(--surface-3); }
.key__url { flex: 1; min-width: 0; font: 500 13.5px var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key__copy {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; flex: none;
}
.key__hint { color: var(--text-3); font-size: 13px; margin: 9px 2px 0; line-height: 1.45; }

.guide { padding: 18px 16px 6px; }
.guide__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.guide__title { margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -.015em; }
.select {
  position: relative; display: flex; align-items: center; gap: 8px;
  width: 152px; height: 44px; padding: 0 30px 0 12px; border-radius: 13px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text);
}
[data-theme="light"] .select { background: var(--surface); }
.select__icon { color: var(--text-2); display: grid; }
.select select {
  -webkit-appearance: none; appearance: none; border: 0; outline: 0; background: transparent;
  color: inherit; font: 500 15.5px var(--font); width: 100%; min-width: 0; height: 100%;
  position: absolute; inset: 0; padding: 0 30px 0 42px; cursor: pointer;
}
.select select option { color: #0D1017; }
.select__chev { position: absolute; right: 10px; color: var(--text-3); pointer-events: none; display: grid; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.tiles--one { grid-template-columns: 1fr; }
.tile {
  position: relative; overflow: hidden; height: 50px; border-radius: 14px; text-align: left;
  padding: 0 16px 0 18px; display: flex; align-items: center;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .25s var(--ease), background-color .25s var(--ease), transform .15s var(--ease);
}
.tile:active { transform: scale(.98); }
.tile.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent), 0 6px 18px rgba(59, 130, 246, .18); }
.tile__dot { position: absolute; left: 7px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tile__name { position: relative; z-index: 1; font-weight: 640; font-size: 16.5px; color: var(--text); transition: color .25s; }
.tile.is-on .tile__name { color: var(--accent); }
.tile__art {
  position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; color: var(--text); opacity: .12; display: grid; place-items: center;
  transition: opacity .25s, color .25s;
}
.tile__art svg { width: 100%; height: 100%; }
.tile.is-on .tile__art { color: var(--accent); opacity: .22; }

/* плавная смена шагов: высота перетекает, содержимое — затухание */
.swap { overflow: hidden; transition: height .26s var(--ease); }
.swap > * { transition: opacity .12s ease, transform .2s var(--ease); }
.swap.is-swapping > * { opacity: 0; transform: translateY(4px); }
.sheet__body { transition: height .26s var(--ease); }
.sheet__body > * { transition: opacity .12s ease; }
.sheet__body.is-swapping { overflow: hidden; }
.sheet__body.is-swapping > * { opacity: 0; }

.timeline { list-style: none; margin: 18px 0 0; padding: 0; }
.tl { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; padding-bottom: 26px; }
.tl:last-child { padding-bottom: 14px; }
.tl:not(:last-child)::before {
  content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; border-radius: 1px;
  background: var(--line-strong);
}
.tl__icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tl__icon.c-violet { background: rgba(151, 117, 250, .17); color: #A78BFA; }
.tl__icon.c-cyan { background: rgba(34, 211, 238, .15); color: #22D3EE; }
.tl__icon.c-teal { background: rgba(32, 201, 151, .16); color: #2DD4A7; }
[data-theme="light"] .tl__icon.c-violet { color: #7C3AED; }
[data-theme="light"] .tl__icon.c-cyan { color: #0E9FC2; }
[data-theme="light"] .tl__icon.c-teal { color: #12A37A; }
.tl__title { margin: 6px 0 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.tl__text { margin: 6px 0 0; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.tl__btns { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 18px 9px 14px;
  border-radius: 13px; background: var(--accent-soft); color: var(--accent);
  font-weight: 620; font-size: 15.5px; transition: filter .15s, transform .15s var(--ease);
}
.pill:active { transform: scale(.98); filter: brightness(1.1); }

/* ───────── Подписи экранов ───────── */
.lead { color: var(--text-2); font-size: 14.5px; margin: 0 4px 6px; line-height: 1.45; }
.lead b { color: var(--text); font-weight: 600; }
.label { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: 22px 4px 10px; }

/* ───────── Ещё / история ───────── */
.row__icon--soft { background: var(--surface-2); color: var(--text-2); }
.row__amount { font-weight: 650; font-size: 15.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.row { color: inherit; }

/* ───────── Карточки-пояснения ───────── */

.note-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text-2); font-size: 14.5px; line-height: 1.4; flex-wrap: wrap; }
.note-card svg { color: var(--text-3); }
.note-card .btn { width: auto; padding: 0 16px; margin-left: auto; }

/* ───────── После оплаты ───────── */
.paid { min-height: calc(100dvh - 140px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 0 8px; }
.paid .btn { max-width: 360px; }
.paid__icon { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; margin-bottom: 10px; }
.paid__icon--ok { background: rgba(61, 214, 140, .14); color: var(--ok); }
.paid__icon--fail { background: var(--danger-soft); color: var(--danger); }
.paid__icon--wait { background: var(--accent-soft); color: var(--accent); }
.paid__title { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.paid__text { color: var(--text-2); font-size: 15.5px; margin: 0 0 14px; max-width: 340px; line-height: 1.45; }
.paid__text b { color: var(--text); }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }

/* ───────── Не работает подключение ───────── */
.faq { display: grid; gap: 8px; margin-top: 14px; }
.faq__item { background: var(--surface); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.faq__q { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 16px; font-weight: 600; font-size: 15.5px; }
.faq__q > span:first-child { flex: 1; }
.faq__chev { color: var(--text-3); transition: transform .25s var(--ease); }
.faq__item.is-open .faq__chev { transform: rotate(90deg); color: var(--accent); }
.faq__a { height: 0; overflow: hidden; transition: height .26s var(--ease); }
.faq__item.is-open .faq__a { height: auto; }
.faq__steps { margin: 0; padding: 0 16px 16px 38px; color: var(--text-2); font-size: 14.5px; line-height: 1.5; display: grid; gap: 8px; }
.faq__steps li::marker { color: var(--accent); font-weight: 700; }
.help-actions { display: grid; gap: 8px; margin-top: 22px; }

/* ───────── Чат поддержки ───────── */
.chat-btn { position: relative; }
.chat-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.chat-badge[hidden] { display: none; }
.chat {
  position: fixed; inset: 0; z-index: 70; visibility: hidden; pointer-events: none;
  background: rgba(4, 6, 10, 0); transition: background-color .3s, visibility 0s .34s;
}
.chat.is-on { visibility: visible; pointer-events: auto; background: rgba(4, 6, 10, .58); transition: background-color .3s; }
.chat__frame {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; border: 0; display: block;
  background: var(--bg); transform: translateY(102%); transition: transform .34s var(--sheet-ease);
}
.chat.is-on .chat__frame { transform: none; }
@media (min-width: 640px) {
  .chat__frame {
    left: auto; right: 24px; bottom: 24px; width: 400px; height: min(680px, calc(100dvh - 48px));
    border-radius: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  }
}

/* ───────── Пояснения, ссылки-кнопки ───────── */
.note-card--col { flex-direction: column; align-items: flex-start; }
.note-card--col .btn { margin-left: 0; }
.note-card--warn { margin-bottom: 12px; color: var(--text); }
.note-card--warn svg { color: var(--warn); }
.linkbtn { display: block; margin: 12px auto 0; padding: 6px 10px; color: var(--accent); font-weight: 600; font-size: 15px; }
.linkbtn:active { opacity: .7; }

/* ───────── Вход и регистрация ───────── */
.auth { min-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
.auth__notice { margin-bottom: 12px; }
.auth__card { padding: 16px 16px 18px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); margin-bottom: 18px; }
.seg[hidden] { display: none; }
.seg__btn { height: 40px; border-radius: 11px; font-size: 15px; font-weight: 600; color: var(--text-2); transition: background-color .2s, color .2s, box-shadow .2s; }
.seg__btn.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .18), inset 0 0 0 1px var(--line); }
.auth__body { transition: height .26s var(--ease); }
.auth__body.is-swapping > * { opacity: 0; }
.auth__title { margin: 2px 2px 4px; font-size: 24px; font-weight: 680; letter-spacing: -.02em; }
.auth__sub { margin: 0 2px 18px; color: var(--text-2); font-size: 15px; }
.auth__form { display: grid; gap: 14px; }
.auth__fine { margin: 0 2px; color: var(--text-3); font-size: 12.5px; line-height: 1.45; text-align: center; }
.auth__fine a, .check__text a, .auth__help a, .cookie__text a, .pay-terms a, .auth__forgot a, .hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.auth__or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--text-3); font-size: 13px; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.auth__forgot-btn { justify-self: end; margin: -6px 2px 0; color: var(--accent); font-size: 14px; font-weight: 550; }
.auth__forgot { margin: -4px 2px 0; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.auth__forgot[hidden] { display: none; }
.auth__hint { margin: 10px 4px 0; color: var(--text-3); font-size: 13px; line-height: 1.45; text-align: center; }
.auth__help { margin: 18px 0 0; text-align: center; color: var(--text-2); font-size: 14.5px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.field__wrap { position: relative; display: block; }
.field__input {
  width: 100%; height: 52px; border: 0; outline: 0; border-radius: 14px; padding: 0 14px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 16.5px;
  transition: box-shadow .2s;
}
.field__wrap .field__input { padding-right: 52px; }
.field__input::placeholder { color: var(--text-3); }
.field__input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.field__eye { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; color: var(--text-3); }
.field__eye:active { background: var(--surface-3); }
.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 14.5px; line-height: 1.4; color: var(--text-2); padding: 2px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; margin-top: 0;
  box-shadow: inset 0 0 0 2px var(--line-strong); background: var(--surface-2); color: transparent; transition: background-color .15s, box-shadow .15s, color .15s;
}
.check input:checked + .check__box { background: var(--accent); box-shadow: none; color: #fff; }
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-err { margin: -2px 2px 0; color: var(--danger); font-size: 14px; line-height: 1.4; }
.form-err[hidden] { display: none; }
.tgcode { display: flex; justify-content: center; gap: 8px; margin: 4px 0 14px; }
.tgcode span {
  width: 54px; height: 64px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  font: 700 30px/1 var(--mono); letter-spacing: 0; color: var(--text);
}
.tgwait { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 16px; color: var(--text-2); font-size: 14.5px; }
.tgwait .spin { width: 16px; height: 16px; border-width: 2px; color: var(--accent); }
.tgwarn { margin-top: 14px; font-size: 13.5px; align-items: flex-start; flex-wrap: nowrap; }
.tgwarn span { flex: 1; min-width: 0; }
.tgwarn svg { color: var(--warn); margin-top: 1px; }
.auth .linkbtn { margin-top: 10px; text-align: center; }

/* ───────── Документы внизу ───────── */
.docs-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 28px 0 0; padding-top: 8px; font-size: 13px; }
.docs-foot a { color: var(--text-3); }
.auth .docs-foot { margin-top: auto; padding-top: 28px; }
.pay-terms { margin-top: 12px; }

/* ───────── Уведомление о cookie ───────── */
.cookie {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  max-width: 436px; margin: 0 auto; padding: 14px 14px 14px 16px; border-radius: 18px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow);
  transform: translateY(140%); transition: transform .34s var(--ease);
}
.cookie.is-on { transform: none; }
.cookie__text { margin: 0; flex: 1; color: var(--text-2); font-size: 13px; line-height: 1.4; }
.cookie__ok { width: auto; padding: 0 16px; flex: none; }

/* ───────── Аккаунт ───────── */
.acct .label:first-child { margin-top: 6px; }
.acct__form { padding: 16px; display: grid; gap: 14px; }
.acct__form .hint { margin: 0 2px; }
.acct__lead { margin: 0 2px; color: var(--text-2); font-size: 14.5px; line-height: 1.45; }
.acct__out { margin-top: 26px; }

/* ───────── Нижний лист ───────── */
.scrim {
  position: fixed; inset: 0; background: rgba(4, 6, 10, .58); z-index: 40;
  opacity: 0; transition: opacity .3s; touch-action: none;
}
.scrim.is-on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 460px; margin: 0 auto;
  background: var(--surface); border-radius: 26px 26px 0 0;
  padding: 22px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .35), inset 0 1px 0 var(--line);
  transform: translateY(105%); transition: transform .34s var(--sheet-ease);
  max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
}
.sheet.is-on { transform: none; }
.sheet__close {
  position: absolute; right: 14px; top: 14px; z-index: 1;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
}
.sheet__close:active { background: var(--surface-3); }
.sheet__title { font-size: 21px; font-weight: 680; letter-spacing: -.015em; margin: 4px 50px 16px 4px; }

.dev { text-align: center; padding: 6px 8px 0; }
.dev__icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.dev__icon--warn { background: var(--danger-soft); color: var(--danger); }
.dev__name { font-size: 21px; font-weight: 680; letter-spacing: -.015em; margin: 0; }
.dev__sub { color: var(--text-2); font-size: 14.5px; margin: 6px 6px 0; line-height: 1.45; }
.dev__seen { color: var(--text-3); font-size: 13px; margin: 6px 0 0; }
.dev__actions { display: grid; gap: 8px; margin-top: 22px; }

.qr { width: 212px; height: 212px; margin: 0 auto; padding: 12px; border-radius: 20px; background: #fff; }
.qr__svg { width: 100%; height: 100%; display: block; }
.qr__lead { text-align: center; font-weight: 620; font-size: 16px; margin: 16px 0 0; }
.qr__text { text-align: center; color: var(--text-2); font-size: 14px; margin: 6px 8px 16px; }

/* ───────── Тост ───────── */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
  background: rgba(28, 31, 40, .96); color: #fff; font-size: 14.5px; font-weight: 550;
  padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  display: flex; align-items: center; gap: 8px;
  transition: opacity .25s, transform .35s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast svg { color: var(--ok); }

/* ───────── Вход / ошибки ───────── */
.gate { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 12px; }
.gate__logo { width: 76px; height: 76px; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 22px; }
.gate__logo img { width: 100%; height: 100%; object-fit: cover; }
.gate__title { font-size: 24px; font-weight: 680; letter-spacing: -.02em; margin: 0; }
.gate__text { color: var(--text-2); font-size: 15.5px; margin: 8px 0 26px; max-width: 320px; }
.gate .btn { max-width: 340px; }

/* ───────── Загрузка ───────── */
.sk { background: var(--surface-2); border-radius: 10px; position: relative; overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent);
  animation: sk 1.3s infinite; transform: translateX(-100%);
}
@keyframes sk { to { transform: translateX(100%); } }
.sk--logo { width: 34px; height: 34px; border-radius: 10px; }
.sk--name { width: 120px; height: 18px; }
.sk--hero { height: 236px; border-radius: var(--r-xl); }
.sk--title { width: 130px; height: 22px; margin: 28px 4px 12px; }
.sk--list { height: 140px; border-radius: var(--r-lg); }
.sk--plans { height: 380px; border-radius: 16px; margin-top: 20px; }

/* ───────── Переходы экранов ─────────
   Только при смене экрана: вперёд — справа, назад — слева. Выбор внутри экрана
   анимацию не перезапускает (он меняет куски на месте). */
.view.from-right { animation: in-right .34s var(--ease) both; }
.view.from-left { animation: in-left .34s var(--ease) both; }
.view.fade { animation: in-fade .3s ease both; }
@keyframes in-right { from { opacity: 0; transform: translateX(24px); } }
@keyframes in-left { from { opacity: 0; transform: translateX(-24px); } }
@keyframes in-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .view, .hero__swirl { animation: none !important; }
  .swap, .sheet__body { transition: none; }
}

/* ───────── Шапка: язык и тема · код из письма ─────────
   Шапка главной: логотип, имя, справа [RU|EN][тема][чат]; шапка входа — [RU|EN][тема].
   Помещается в 360 px: длинное имя бренда обрезается многоточием, кнопки — нет. */
.top__name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__tools { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.langseg {
  display: flex; height: 42px; padding: 0 3px; border-radius: 13px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.langseg__btn {
  position: relative; isolation: isolate; width: 36px; height: 42px; display: grid; place-items: center;
  font-size: 13px; font-weight: 650; letter-spacing: .03em; color: var(--text-3); transition: color .2s;
}
.langseg__btn::before {
  content: ""; position: absolute; z-index: -1; inset: 5px 0; border-radius: 9px;
  background: transparent; transition: background-color .2s;
}
.langseg__btn.is-on { color: var(--text); }
.langseg__btn.is-on::before { background: var(--surface-3); }
.langseg__btn:not(.is-on):active::before { background: var(--surface-2); }
.top__tools .top__action { flex: none; }
.top__lang { font-size: 14px; font-weight: 650; letter-spacing: .03em; color: var(--text); }
.chat-badge--inline { position: static; display: inline-block; vertical-align: 2px; margin-left: 6px; box-shadow: none; }
.top__action:focus-visible, .langseg__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* код из письма: одно поле на 6 цифр, крупно и с разрядкой */
.code-input {
  height: 60px; text-align: center; font: 700 26px/1 var(--mono); letter-spacing: .42em;
  padding: 0 14px 0 calc(14px + .42em); font-variant-numeric: tabular-nums;
}
.code-input::placeholder { letter-spacing: .42em; color: var(--text-3); }
.code-links { display: grid; justify-items: center; gap: 2px; margin-top: 6px; }
.code-links .linkbtn, .auth .code-links .linkbtn { margin: 0; }
.linkbtn[disabled] { color: var(--text-3); cursor: default; font-variant-numeric: tabular-nums; }
.linkbtn.is-busy { opacity: .55; }
.code-spam { margin-top: 6px; }
.acct__code { padding: 16px; display: grid; gap: 12px; }
.acct__code-title { margin: 0 2px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.acct__code .acct__lead b, .auth__sub b { color: var(--text); font-weight: 600; word-break: break-word; }
.acct__code .code-spam { margin: 0; }
/* длинный тост («Почта подтверждена — …») — по ширине текста, а не в полэкрана */
.toast { width: max-content; }
/* история: подпись (дата · способ · промокод) и срок переносятся, а не обрезаются */
.hist .row__title, .hist .row__sub { white-space: normal; }
.paid__text b { white-space: nowrap; }
