/* OmExpert — тёмный сайт без светлой темы: спокойный графитовый фон, мягкий светлый текст,
   глубину держат тонкие рамки и лёгкая подсветка сверху. Цвет — только у статусов и ошибок. */

/* Фон не угольно-чёрный и текст не чисто белый: так контраст остаётся высоким, но не режет глаз. */
:root {
  --bg: #0d0e10;
  --surface: #131417;
  --surface-2: #1a1b1f;
  --overlay: rgba(13, 14, 16, .78);      /* шапка при прокрутке */
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --text: #ededef;
  --muted: #9d9ea6;
  --dim: #7c7d85;      /* мелкие подписи: контраст с фоном ≈ 4,7 : 1 */
  --plate: #e6e6e9;                      /* главная кнопка: светлая, но не белая */
  --plate-text: #0d0e10;
  --glow: 0 0 0 transparent;             /* свечения нет */
  --glow-soft: rgba(255, 255, 255, .06);
  --brand: #f4f4f5;
  --shadow-card: none;                   /* на тёмном тени не видно — карточки держит рамка */
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .5);
  --backdrop: rgba(0, 0, 0, .7);
  --hub-glow: none;
  --red: #ff4d5a;
  --ok: #34d17a;                         /* статус сервисов в подвале — единственный зелёный */
  --warn: #f5b83d;
  color-scheme: dark;
}

:root {
  /* Manrope — один шрифт для латиницы и кириллицы: буквы в строке одного рисунка */
  --font-display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(20px, 4.7vw, 68px);
  --max: 1440px;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* атрибут hidden скрывает всегда — даже кнопки со своим display (inline-flex и т.п.) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  min-height: 100vh;
  /* едва заметное холодное свечение над первым экраном — вместо фонового графа */
  background: radial-gradient(1100px 560px at 50% -180px, rgba(130, 140, 180, .13), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--text); color: var(--bg); }

/* полоса прокрутки: тонкая, в цвет темы, со скруглённым ползунком */
/* Firefox; в Chrome стандартные свойства отключили бы скруглённый ползунок ниже */
@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) var(--bg);
  }
}
::-webkit-scrollbar { width: 10px; height: 10px; }     /* Chrome, Edge, Яндекс, Safari */
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  border: 3px solid var(--bg);                         /* отступ от краёв — ползунок кажется тоньше */
  border-radius: 999px;
  background: var(--line-strong);
}
@media (hover: hover) { ::-webkit-scrollbar-thumb:hover { background: var(--muted); } }
::-webkit-scrollbar-corner { background: var(--bg); }
/* рамка фокуса повторяет скругление элемента; у ссылок без своего скругления — 6px */
:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; }
.logo, .nav a, .footer a, .link { border-radius: 6px; }

/* на телефоне браузер при тапе рисует прямоугольную подсветку — убираем,
   вместо неё мягкое затемнение самого элемента со скруглёнными углами */
html { -webkit-tap-highlight-color: transparent; }
/* нажатие пальцем: кнопка чуть «проседает» и плавно возвращается (без вспышки фона) */
.hero-btn, .product-more, .login-btn, .burger, .menu-item, .btn, .mobile-nav a {
  -webkit-touch-callout: none;
}
.hero-btn:active, .product-more:active, .login-btn:active, .burger:active, .btn:active {
  transform: scale(.98);
  transition-duration: .08s;
}
.menu-item:active, .mobile-nav a:active { opacity: .6; transition: opacity .08s; }

/* ---------- шапка ---------- */

/* Шапка — плавающая капсула: тонкая рамка, размытый фон, меню по центру.
   При прокрутке капсула плотнее и отбрасывает мягкую тень. */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1180px, calc(100% - 2 * var(--gutter)));
  height: 56px;
  margin: 12px auto 0;
  padding: 0 8px 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(19, 20, 23, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: background .25s, border-color .25s, box-shadow .25s;
}
.topbar.scrolled {
  border-color: var(--line-strong);
  background: rgba(19, 20, 23, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 14px 40px -14px rgba(0, 0, 0, .7);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand);
  font: 700 1.05rem/1 var(--font-display);
  letter-spacing: -.02em;
  text-decoration: none;
}
.logo-mark {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

/* пункты меню — по центру капсулы; при наведении и у текущего раздела — мягкая плашка */
.nav {
  display: flex;
  gap: 2px;
  margin: 0 auto;
}
.nav a {
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
@media (hover: hover) { .nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); } }
.nav a:focus-visible { color: var(--text); }
/* раздел, который сейчас на экране (класс ставит main.js) */
.nav a.active { color: var(--text); background: rgba(255, 255, 255, .07); }
.mobile-nav a.active { color: var(--text); }
.mobile-nav a:not(.active) { color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, background .2s;
}
@media (hover: hover) { .icon-btn:hover { color: var(--text); background: var(--glow-soft); } }
.icon-btn svg {
  position: absolute;
  inset: 0;
  width: 17px;
  height: 17px;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* «Войти» — светлая пилюля, как главная кнопка */
.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--plate);
  color: var(--plate-text);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow .2s;
}
@media (hover: hover) { .login-btn:hover, .login-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); } }
/* после входа кнопка — просто круглая аватарка */
.login-btn.is-user {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  justify-content: center;
}
.avatar, .profile-avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-letter {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: #0a0a0a;                  /* фон — пастельный цвет аккаунта */
  font-weight: 700;
  font-size: .85rem;
}

/* карточка профиля */
.menu.profile { min-width: 280px; padding: 8px; }
.profile-head { display: flex; align-items: center; gap: 14px; padding: 12px 10px 14px; }
.profile-avatar { flex-shrink: 0; width: 52px; height: 52px; border: 1px solid var(--line-strong); }
.profile-avatar.avatar-letter { font-size: 1.3rem; }
.profile-names { min-width: 0; }
.profile-name { font-weight: 600; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.profile-email {
  margin-top: 2px;
  color: var(--muted);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-facts { margin: 0 10px 6px; border-top: 1px solid var(--line); }
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
}
.profile-row:last-child { border-bottom: 0; }
.profile-row dt { color: var(--dim); }
.profile-row dd { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; color: var(--muted); text-align: right; }
.profile-id {
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: 500 .8rem/1.2 var(--font-mono);
  letter-spacing: .06em;
  cursor: copy;
  transition: border-color .2s, box-shadow .2s;
}
@media (hover: hover) { .profile-id:hover { border-color: var(--text); box-shadow: var(--glow); } }
.profile-id.copied { color: var(--muted); letter-spacing: 0; }
.profile-provider { display: inline-flex; align-items: center; gap: 6px; }

/* план: пробный — контур, Plus — светлая заливка, Pro и Эксперт — свои (в конце файла, «уровни тарифов») */
.plan-badge {
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font: 600 .72rem/1.5 var(--font-body);
  letter-spacing: .02em;
}
.plan-plus { border-color: transparent; background: var(--plate); color: var(--plate-text); }
.plan-pro { border-color: transparent; background: var(--text); color: var(--bg); }
.plan-term { color: var(--muted); }
.plan-term.expired { color: var(--red); }
.profile-provider svg { width: 14px; height: 14px; }

/* меню аккаунта: выбор провайдера или «Выйти» */
.account { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  /* закрыто: прозрачное, чуть выше и меньше; visibility выключается после анимации */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.96);
  transform-origin: top right;
  transition:
    opacity .18s ease,
    transform .22s cubic-bezier(.4, 0, 1, 1),
    visibility 0s linear .22s;
}
/* «хвостик» бабла — уголок, указывающий на кнопку «Войти» */
.menu::before {
  content: "";
  position: absolute;
  top: -7px;
  /* --tail-right задаёт main.js: центр кнопки «Войти» (ширина кнопки меняется) */
  right: var(--tail-right, 24px);
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  border-top-left-radius: 3px;
  transform: rotate(45deg);
}
.menu.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity .22s ease,
    transform .35s cubic-bezier(.22, .61, .36, 1),
    visibility 0s;
}
/* пункты появляются друг за другом */
.menu > * {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease;
}
.menu.open > * {
  opacity: 1;
  transform: none;
  transition: opacity .3s ease, transform .35s cubic-bezier(.22, .61, .36, 1);
}
.menu.open > :nth-child(2) { transition-delay: .04s; }
.menu.open > :nth-child(3) { transition-delay: .08s; }
.menu.open > :nth-child(4) { transition-delay: .12s; }
.menu.open > :nth-child(n+5) { transition-delay: .16s; }
.menu-label {
  padding: 10px 12px 6px;
  color: var(--dim);
  font: 500 .8rem/1.3 var(--font-body);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: .9rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
@media (hover: hover) { .menu-item:hover { background: var(--glow-soft); } }
.menu-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.menu-item.unavailable { opacity: .4; cursor: help; }
@media (hover: hover) { .menu-item.unavailable:hover { background: none; } }
.menu-sep { height: 1px; margin: 6px; background: var(--line); }

/* ---------- первый экран (макет: 1440×850) ---------- */

main { position: relative; }

.hero {
  display: flex;
  flex-direction: column;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 72px) var(--gutter) clamp(48px, 5vw, 80px);
}
.hero-headline {
  max-width: 16em;
  color: var(--brand);
  font: 600 clamp(2.1rem, 4.2vw, 3.5rem)/1.1 var(--font-display);
  letter-spacing: -.03em;
  text-wrap: balance;
}

/* первый экран по центру, под кнопками — окно приложения (главная и страница DDx Host) */
.hero-center {
  position: relative;
  isolation: isolate;
  align-items: center;
  padding-top: clamp(56px, 8vw, 112px);
  padding-bottom: clamp(56px, 7vw, 96px);
  text-align: center;
}

/* Фон первого экрана: во всю ширину окна и под шапкой — сетка точек, тающая к краям.
   Раз в несколько секунд по ней наискосок проходит светлая полоса: точки под ней светлеют.
   Полоса едет через transform, а слой ярких точек внутри неё — навстречу с той же скоростью,
   поэтому точки стоят на месте, а прокрутка не тормозит. Цвета нет — только белый. */
.hero-bg {
  --dots: 0 0 / 28px 28px;
  position: absolute;
  top: -80px;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  overflow: hidden;
  transform: translateX(-50%);
  pointer-events: none;
  --edge: radial-gradient(ellipse 60% 62% at 50% 34%, #000 25%, transparent 78%);
}
/* сетка и волна тают к краям; подсветка под курсором — нет: она проявляет сетку и там */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.6px) var(--dots);
  -webkit-mask-image: var(--edge);
  mask-image: var(--edge);
}
.hero-wave {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 28vw;
  -webkit-mask-image: linear-gradient(100deg, transparent 10%, #000 50%, transparent 90%);
  mask-image: linear-gradient(100deg, transparent 10%, #000 50%, transparent 90%);
  will-change: transform;
  animation: hero-wave 11s cubic-bezier(.45, 0, .55, 1) -1.4s infinite;
}
.hero-wave span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100vw;
  background: radial-gradient(rgba(255, 255, 255, .3) 1.1px, transparent 1.8px) var(--dots);
  /* слой стоит на месте относительно фона (едет навстречу полосе) — маска краёв совпадает */
  -webkit-mask-image: var(--edge);
  mask-image: var(--edge);
  will-change: transform;
  animation: hero-wave-back 11s cubic-bezier(.45, 0, .55, 1) -1.4s infinite;
}
/* под курсором точки светлеют слабее, чем у волны; где волна проходит под курсором,
   слои складываются — там ярче всего. Положение (--mx, --my) ставит main.js */
.hero-spot {
  position: absolute;
  inset: 0;
  background: radial-gradient(rgba(255, 255, 255, .26) 1.1px, transparent 1.8px) var(--dots);
  /* круг у курсора; к низу первого экрана подсветка тоже тает — без резкого края */
  -webkit-mask-image: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 72%),
    linear-gradient(to bottom, #000 75%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 72%),
    linear-gradient(to bottom, #000 75%, transparent);
  mask-composite: intersect;
  opacity: 0;
  transition: opacity .5s ease;
}
.hero-bg.lit .hero-spot { opacity: 1; }
/* проход занимает 7 из 11 секунд, остальное — пауза за краем; задержка −1,4 с — при открытии
   страницы полоса уже входит в кадр, первая волна проходит сразу */
@keyframes hero-wave {
  0% { transform: translateX(-28vw); }
  65%, 100% { transform: translateX(100vw); }
}
@keyframes hero-wave-back {
  0% { transform: translateX(28vw); }
  65%, 100% { transform: translateX(-100vw); }
}
.hero-center .hero-headline { margin-inline: auto; }
.hero-center .hero-lead { max-width: 40rem; margin-inline: auto; text-wrap: balance; }
.hero-center .hero-actions { justify-content: center; }
.hero-center .notice { margin-inline: auto; }

/* скриншот в рамке: подсветка за ним, низ плавно растворяется в фоне */
.hero-shot {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 980px;                /* около 2/3 экрана: окно не заслоняет страницу целиком */
  margin: clamp(48px, 6vw, 80px) auto 0;
}
.hero-shot::before {
  content: "";
  position: absolute;
  inset: -14% 6% auto;
  z-index: -1;
  height: 70%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(150, 160, 200, .16), transparent 72%);
  filter: blur(24px);
  pointer-events: none;
}
/* Живое окно приложения (demo.js): рамка и маска — на .demo-screen, внутри «камера» с кадрами,
   курсором и волной клика. Камера двигается целиком, поэтому курсор всегда над своей точкой. */
.app-demo .demo-screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1400 / 640;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #050607;
  box-shadow: 0 40px 120px -24px rgba(0, 0, 0, .85);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
}
/* в разделе «Демонстрация» окно сразу под заголовком */
.demo-section .app-demo { margin-top: 0; }
.app-demo .demo-cam {
  position: absolute;
  inset: 0 0 auto;
  transform-origin: 0 0;
  transition: transform 1.3s cubic-bezier(.65, 0, .35, 1);
  will-change: transform;
}
.app-demo picture { display: block; }
.app-demo .demo-frame {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: auto;
  -webkit-mask-image: none;
  mask-image: none;
}
/* первый кадр — основа, виден всегда; следующие лежат поверх и проявляются */
.app-demo .demo-cam > .demo-frame {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity .45s ease;
}
.app-demo .demo-cam > .demo-frame.is-on { opacity: 1; }
/* кнопки «Развернуть» и «Закрыть»: первая — при наведении на окно, вторая — в развёрнутом виде */
.demo-btn {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(19, 20, 23, .78);
  color: var(--text);
  font: 600 .82rem/1 var(--font-body);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: opacity .25s, border-color .2s;
}
.demo-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .demo-btn:hover { border-color: rgba(255, 255, 255, .3); } }
.demo-open { top: 14px; right: 14px; opacity: 0; }
.app-demo:hover .demo-open, .demo-open:focus-visible { opacity: 1; }
.app-demo .demo-screen { cursor: zoom-in; }
.demo-close { display: none; top: 18px; right: 18px; width: 40px; padding: 0; justify-content: center; }
/* развёрнуто: окно целиком по центру экрана, без обрезки и затемнения, фон затемнён */
.app-demo.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  max-width: none;
  margin: 0;
  padding: 24px;
  background: rgba(5, 6, 7, .9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: demo-expand .35s cubic-bezier(.22, .61, .36, 1);
}
.app-demo.is-expanded::before { display: none; }
.app-demo.is-expanded .demo-screen {
  width: min(100%, calc((100vh - 48px) * 1400 / 860));
  aspect-ratio: 1400 / 860;
  cursor: default;
  -webkit-mask-image: none;
  mask-image: none;
}
.app-demo.is-expanded .demo-open { display: none; }
.app-demo.is-expanded .demo-close { display: inline-flex; }
@keyframes demo-expand { from { opacity: 0; } }

/* --- раскадровка живого окна (demo.js) --- */
/* появление окна при загрузке: поднимается и проявляется */
/* окно поднимается и проявляется, когда раздел впервые на экране (класс ставит demo.js) */
.app-demo .demo-screen { transition: opacity .9s ease, translate 1.1s cubic-bezier(.22, .61, .36, 1); }
.app-demo:not(.is-seen) .demo-screen { opacity: 0; translate: 0 40px; }
/* смена кадра — наплыв с лёгкой расфокусировкой */
.app-demo .demo-cam > .demo-frame { filter: blur(6px); transition: opacity .5s ease, filter .6s ease; }
.app-demo .demo-cam > .demo-frame.is-on { filter: none; }
/* без анимации: развернули окно, сменился размер, начался новый круг */
.app-demo.is-snapping .demo-cam, .app-demo.is-snapping .demo-cursor, .app-demo.is-snapping .demo-spot,
.app-demo.is-snapping .demo-ring { transition: none !important; }
/* притемнение вокруг места действия — тень от рамки на всю сцену; рамка перетекает между местами */
.demo-spot, .demo-ring, .demo-sweep {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.demo-spot {
  z-index: 1;
  border-radius: 14px;
  box-shadow: 0 0 0 300vmax rgba(5, 6, 7, .58);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(.65, 0, .35, 1), width 1.2s cubic-bezier(.65, 0, .35, 1),
    height 1.2s cubic-bezier(.65, 0, .35, 1), opacity .6s ease;
}
.demo-spot.is-on { opacity: 1; }
/* рамка-«защёлка»: подлетает чуть крупнее и садится точно по месту */
.demo-ring { z-index: 2; opacity: 0; transition: opacity .3s ease; }
.demo-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(255, 255, 255, .85);
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .07), 0 0 28px rgba(255, 255, 255, .12);
}
/* подлетает чуть крупнее и садится точно по месту; увеличение — у ::before, положение не сдвигается */
.demo-ring.is-on { opacity: 1; }
.demo-ring.is-on::before { animation: demo-lock .55s cubic-bezier(.2, .9, .3, 1.15) both; }
@keyframes demo-lock {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: none; }
}
/* блик, один раз проходящий по ответу ИИ */
.demo-sweep { z-index: 2; overflow: hidden; border-radius: 12px; }
.demo-sweep::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .16) 50%, transparent 70%);
  transform: translateX(-100%);
}
.demo-sweep.is-on::after { animation: demo-sweep 1.1s cubic-bezier(.4, 0, .2, 1); }
@keyframes demo-sweep { to { transform: translateX(100%); } }
/* подпись шага — вне «камеры», не увеличивается; сменяется сдвигом вверх */
.demo-caption {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: grid;
  min-width: 250px;
  padding: 10px 14px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(13, 14, 16, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .7);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .4s ease, transform .5s cubic-bezier(.22, .61, .36, 1);
  pointer-events: none;
}
.app-demo.has-caption .demo-caption { opacity: 1; transform: none; }
.demo-step {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font: 600 .88rem/1.3 var(--font-body);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .45s cubic-bezier(.22, .61, .36, 1);
}
.demo-step.is-on { opacity: 1; transform: none; transition-delay: .12s; }
.demo-step b {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: .72rem;
}
.demo-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 9px; }
.demo-progress i { position: relative; height: 2px; overflow: hidden; border-radius: 1px; background: var(--line-strong); }
.demo-progress i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s ease;   /* в начале нового круга деления плавно гаснут */
}
.demo-progress i.is-done::after { transform: scaleX(1); }
.demo-progress i.is-on::after { transform: scaleX(1); transition: transform 3.6s linear; }

.demo-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -5px;              /* кончик стрелки — в точке клика */
  opacity: 0;
  pointer-events: none;
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(.65, 0, .35, 1), ease;
}
.demo-cursor.is-on { opacity: 1; }
.demo-cursor svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: #fff;
  stroke: #0d0e10;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55));
  transform-origin: 20% 15%;
  transition: transform .14s ease;
}
.demo-cursor.is-down svg { transform: scale(.82); }
.demo-ripple {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 0;
  height: 0;
  pointer-events: none;
}
.demo-ripple::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 1.5px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  opacity: 0;
}
.demo-ripple.is-on::after { animation: demo-ripple .6s cubic-bezier(.2, .7, .3, 1); }
@keyframes demo-ripple {
  from { opacity: .9; transform: scale(.3); }
  to { opacity: 0; transform: scale(1.3); }
}

.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 40px 120px -24px rgba(0, 0, 0, .85);
  /* видна только верхняя часть окна — так оно ниже; остальное растворяется в фоне */
  aspect-ratio: 1400 / 640;
  object-fit: cover;
  object-position: top;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
}

/* первый раздел сразу после hero — без двойного отступа */
.hero + .section { padding-top: clamp(24px, 3vw, 48px); }

.hero-title {
  color: var(--brand);
  font: 700 clamp(2.6rem, 6vw, 4.6rem)/1 var(--font-display);
  letter-spacing: -.035em;
}

/* подпись над заголовком, описание и условия — первый экран */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(16px, 2vw, 24px);
  color: var(--muted);
  font: 500 .9rem/1.3 var(--font-body);
}
.pulse { display: none; }
.hero-lead {
  max-width: 36rem;
  margin-top: clamp(24px, 2.6vw, 36px);
  color: var(--muted);
  font-size: clamp(.98rem, 1.05vw, 1.06rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 1.6vw, 22px);
  margin-top: clamp(28px, 3vw, 44px);
}

/* кнопки первого экрана: основная — молочная заливка, вторая — прозрачная с тонкой рамкой */
.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .25s, transform .25s, border-color .25s, background-color .25s;
}
.hero-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s;
}
@media (hover: hover) { .hero-btn:hover { transform: translateY(-1px); } }
.hero-btn-primary { background: var(--plate); color: var(--plate-text); }
@media (hover: hover) { .hero-btn-primary:hover { box-shadow: 0 0 0 4px var(--glow-soft), var(--glow); } }
@media (hover: hover) { .hero-btn-primary:hover svg { transform: translateX(3px); } }   /* стрелка чуть «ведёт» вперёд */
.hero-btn-outline { border-color: var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--text); }
@media (hover: hover) { .hero-btn-outline:hover { border-color: rgba(255, 255, 255, .26); background: var(--glow-soft); } }

.notice {
  max-width: 34rem;
  margin-top: 24px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: .875rem;
}
.notice-error { border-color: color-mix(in srgb, var(--red) 50%, transparent); color: var(--red); }

/* ---------- кнопки (окно входа) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.btn-primary { background: var(--text); color: var(--bg); }
@media (hover: hover) { .btn-primary:hover { box-shadow: var(--glow); } }
.btn-ghost { border-color: var(--line-strong); background: transparent; }
@media (hover: hover) { .btn-ghost:hover { border-color: var(--text); } }
.btn-sm { height: 40px; padding: 0 18px; font-size: .875rem; }
.btn:disabled { opacity: .5; cursor: default; }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

/* ---------- секции ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(44px, 6vh, 76px) var(--gutter);
}

/* заголовок раздела: крупно и с воздухом, без линий и номеров */
.section-head { max-width: 46rem; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head h2 {
  font: 700 clamp(1.7rem, 2.8vw, 2.4rem)/1.15 var(--font-display);
  letter-spacing: -.025em;
}
.section-head p { margin-top: 14px; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }

/* ---------- продукты ---------- */

.products {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.product {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  padding: clamp(22px, 2.4vw, 34px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  overflow: hidden;
}
.product-kicker {
  color: var(--dim);
  font: 500 .8rem/1.3 var(--font-body);
}
.product-name {
  margin-top: 14px;
  font: 700 clamp(1.5rem, 2.2vw, 1.9rem)/1.1 var(--font-display);
  letter-spacing: -.03em;
}
.product-desc {
  max-width: 38rem;
  margin-top: 18px;
  color: var(--muted);
  font-size: .96rem;
  line-height: 1.65;
}

/* список смотрит на ширину своей колонки в карточке, а не всего экрана */
.product-main { min-width: 0; container-type: inline-size; }

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 26px;
  list-style: none;
}
.product-features li { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: .95rem; }
.product-features li::before {
  content: "";
  width: 8px;
  height: 4px;
  margin-bottom: 3px;
  border-left: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
}

/* «Подробнее» — ведёт на страницу продукта */
.product-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin-top: 32px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--plate);          /* яркая: молочная заливка, как «Начать бесплатно» */
  color: var(--plate-text);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: box-shadow .25s, transform .25s;
}
.product-more svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s;
}
@media (hover: hover) { .product-more:hover { box-shadow: 0 0 0 4px var(--glow-soft), var(--glow); transform: translateY(-1px); } }
@media (hover: hover) { .product-more:hover svg { transform: translateX(3px); } }

/* ---------- решение (главная) ---------- */

/* задачи: 4 крупные карточки 2×2, разделены тонкими линиями */
.cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  border-top: 1px solid var(--line);
}
.case {
  position: relative;
  padding: clamp(32px, 4vw, 56px) clamp(24px, 3vw, 48px) clamp(36px, 4vw, 56px) 0;
  border-bottom: 1px solid var(--line);
  transition: background-color .3s;
}
.case:nth-child(even) { padding-left: clamp(24px, 3vw, 48px); padding-right: 0; border-left: 1px solid var(--line); }
.case-num { color: var(--dim); font: 400 .78rem/1 var(--font-mono); letter-spacing: .1em; }
.case-problem {
  margin-top: 20px;
  font: 700 clamp(1.2rem, 1.7vw, 1.45rem)/1.2 var(--font-display);
  letter-spacing: -.03em;
}
.case-answer {
  max-width: 30rem;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}
/* узел графа в углу карточки — загорается при наведении */
.case::after {
  content: "";
  position: absolute;
  top: clamp(32px, 4vw, 56px);
  right: 0;
  width: 7px;
  height: 7px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  transition: background-color .3s, box-shadow .3s, border-color .3s;
}
.case:nth-child(odd)::after { right: clamp(24px, 3vw, 48px); }
@media (hover: hover) {
  .case:hover::after { border-color: var(--text); background: var(--text); box-shadow: var(--glow); }
}

/* путь к выводу — узлы на одной линии, последний светится */
.flow { margin-top: clamp(64px, 8vw, 110px); }
.flow-title {
  margin-bottom: 36px;
  color: var(--dim);
  font: 500 .8rem/1.3 var(--font-body);
}
.flow-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
}
.flow-steps::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), var(--text));
}
.flow-steps li { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 36px 16px 0 0; }
.flow-node {
  position: absolute;
  top: 0;
  left: 0;
  width: 15px;
  height: 15px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: var(--bg);
}
.flow-steps b { font: 600 clamp(1rem, 1.3vw, 1.15rem)/1.2 var(--font-display); letter-spacing: -.02em; }
.flow-steps small { color: var(--muted); font-size: .88rem; }
.flow-final .flow-node { border-color: var(--text); background: var(--text); box-shadow: var(--glow); }

/* для кого — два столбца */
.audience {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: clamp(64px, 8vw, 110px);
}
.audience-col {
  padding: clamp(28px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.audience-col h3 {
  margin-top: 14px;
  font: 700 clamp(1.15rem, 1.6vw, 1.35rem)/1.2 var(--font-display);
  letter-spacing: -.03em;
}
.audience-col ul { margin-top: 24px; list-style: none; border-top: 1px solid var(--line); }
.audience-col li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.audience-col li:last-child { border-bottom: 0; padding-bottom: 0; }
.audience-col li::before { content: ""; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: var(--text); }

.solution-more { margin-top: 40px; }

@media (max-width: 720px) {
  .cases { grid-template-columns: 1fr; }
  .case, .case:nth-child(even) { padding: 30px 0; border-left: 0; }
  .case::after, .case:nth-child(odd)::after { right: 0; top: 34px; }
}

@media (max-width: 760px) {
  .audience { grid-template-columns: 1fr; }
  /* путь к выводу — вертикальная цепочка */
  .flow-steps { grid-template-columns: 1fr; row-gap: 26px; }
  .flow-steps::before { top: 7px; bottom: 30px; right: auto; width: 1px; height: auto;
    background: linear-gradient(180deg, var(--line-strong), var(--text)); }
  .flow-steps li { padding: 0 0 0 36px; }
}

/* ---------- страница продукта (/ddx-host) ---------- */

.about-text {
  max-width: 46rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.65;
}

/* четыре акцента — в одну линию через тонкие разделители */
/* четыре акцента — карточки с лёгкой подсветкой сверху */
.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
  list-style: none;
}
.principles-first { margin-top: 0; }   /* сразу под заголовком раздела, без вводного текста */
.principles li {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 60%), var(--surface);
}
.principles h3 { margin-top: 0; }

/* линейные иконки в плитке с тонкой рамкой — карточки «Что мы делаем», «Суть», возможности */
.ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .01));
  color: var(--text);
}
.ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature .ico { width: 36px; height: 36px; border-radius: 10px; }
.feature .ico svg { width: 20px; height: 20px; }
.step-num { color: var(--dim); font: 500 .8rem/1 var(--font-body); }
.principles h3, .step h3, .feature h3 {
  margin-top: 14px;
  font: 600 1.1rem/1.3 var(--font-display);
  letter-spacing: -.01em;
}
.principles p, .step p, .feature p { margin-top: 8px; color: var(--muted); font-size: .92rem; line-height: 1.55; }

/* шаги — узлы графа на одной линии */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
  list-style: none;
}
.steps::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), var(--text) 85%, transparent);
}
.step { position: relative; padding-top: 32px; }
.step-node {
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: var(--bg);
}
.step:last-child .step-node { border-color: var(--text); background: var(--text); box-shadow: var(--glow); }

/* три главные возможности — карточки с экраном телефона, выглядывающим снизу */
.showcase {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
}
.show-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: radial-gradient(100% 50% at 50% 100%, rgba(150, 160, 200, .1), transparent 70%), var(--surface);
}
.show-text { padding: clamp(22px, 2.4vw, 30px) clamp(22px, 2.4vw, 30px) 0; }
.show-text h3 { font: 600 1.15rem/1.3 var(--font-display); letter-spacing: -.01em; }
.show-text p { margin-top: 8px; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.show-media {
  display: flex;
  justify-content: center;
  flex: none;
  height: clamp(300px, 28vw, 380px);
  margin-top: auto;                /* к нижнему краю: телефоны в ряду на одной высоте */
  padding-top: 28px;
  box-sizing: content-box;
  overflow: hidden;
}
/* плоский макет телефона: тот же корпус, что у объёмного в карточке на главной, но без
   поворота и толщины; низ уходит за край карточки */
.phone-frame {
  position: relative;
  align-self: flex-start;
  width: min(78%, 250px);
  padding: 7px;
  border-radius: 36px;
  background: linear-gradient(150deg, #34353b, #15161a 55%, #23242a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 24px 60px -24px rgba(0, 0, 0, .9);
}
.phone-frame img { display: block; width: 100%; height: auto; border-top: 22px solid #000; border-radius: 29px; background: #000; }
/* блик по стеклу */
.phone-frame::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 29px;
  background: linear-gradient(118deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 36%);
  pointer-events: none;
}
/* кнопки громкости на левой грани */
.phone-frame::before {
  content: "";
  position: absolute;
  top: 18%;
  left: -3px;
  width: 3px;
  height: 7%;
  border-radius: 2px 0 0 2px;
  background: #2b2c31;
  box-shadow: 0 calc(100% + 12px) 0 #2b2c31;
}

/* остальные возможности — одной карточкой-таблицей: ячейки разделены тонкими линиями
   (фон контейнера просвечивает в зазор 1px), в ячейке иконка слева, текст справа */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(40px, 4vw, 56px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--line);
  list-style: none;
}
.feature {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  column-gap: 14px;
  padding: 22px 24px;
  background: var(--surface);
}
.feature .ico { grid-row: span 2; margin: 0; }
.feature h3 { margin-top: 0; font-size: .98rem; line-height: 1.3; }
.feature p { margin-top: 5px; font-size: .88rem; line-height: 1.5; }


@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; }
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* девятая — на всю ширину, без пустой ячейки */
  .steps::before { display: none; }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .steps { grid-template-columns: 1fr; row-gap: 28px; }
  /* на телефоне шаги — вертикальная цепочка узлов */
  .steps::before { display: block; top: 6px; bottom: 6px; left: 5px; right: auto; width: 1px; height: auto;
    background: linear-gradient(180deg, var(--line-strong), var(--text) 85%, transparent); }
  .step { padding: 0 0 0 32px; }
  .principles { grid-template-columns: 1fr; gap: 10px; }
  .principles li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
    padding: 16px 18px;
  }
  .principles .ico { grid-row: span 2; margin: 0; }
  .principles p { margin-top: 4px; }
  .features-grid { grid-template-columns: 1fr; }
  .feature { padding: 16px 18px; }
}
/* Ленты на узком экране: список [data-carousel] листается пальцем по одной карточке, точки
   .carousel-dots под ним (main.js). Карточка встаёт по центру; соседние чуть меньше и приглушены
   и по мере пролистывания плавно проявляются (--d — насколько карточка ушла от центра). */
.carousel-dots { display: none; justify-content: center; gap: 8px; margin-top: 18px; }
.carousel-dots i {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
  cursor: pointer;
  transition: width .25s, background-color .25s;
}
.carousel-dots i.on { width: 18px; background: var(--text); }
@media (max-width: 900px) {
  /* возможности на странице DDx Host */
  .showcase {
    position: relative;
    display: flex;
    gap: 12px;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .showcase::-webkit-scrollbar { display: none; }
  .show-card {
    flex: 0 0 min(84%, 420px);
    scroll-snap-align: center;
    scroll-snap-stop: always;      /* сильный свайп — тоже ровно на одну карточку, без пролёта */
    opacity: calc(1 - var(--d, 0) * .5);
    transform: scale(calc(1 - var(--d, 0) * .07));
  }
  .show-media { height: 320px; }
  .showcase + .carousel-dots { display: flex; }
}

/* страница-заглушка (pages/*.html) */
.stub {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: calc(100svh - 72px);
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px var(--gutter);
}
.stub h1 {
  margin-top: 20px;
  font: 700 clamp(1.9rem, 3.6vw, 2.8rem)/1.1 var(--font-display);
  letter-spacing: -.03em;
}
.stub p:not(.hero-eyebrow) { max-width: 34rem; margin: 16px 0 28px; color: var(--muted); font-size: 1rem; }


/* Объёмный телефон: корпус с рамкой, вырезом камеры и кнопками, повёрнут в перспективе;
   виден верх телефона — низ уходит за нижний край карточки, карточка остаётся по высоте текста.
   Толщина — стопка теней со сдвигом вбок, блик — полупрозрачный градиент поверх экрана.
   Телефон неподвижен. */
.product-shot {
  position: relative;
  align-self: end;
  width: clamp(190px, 17vw, 230px);
  height: clamp(250px, 23vw, 300px);
  margin: 0 clamp(8px, 2vw, 32px) calc(-1 * clamp(22px, 2.4vw, 34px)) 0;
  perspective: 1400px;
}
/* мягкий свет за телефоном — глубина */
.product-shot::before {
  content: "";
  position: absolute;
  inset: -20% -40%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .07), transparent);
  pointer-events: none;
}
.phone3d {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform-origin: 50% 25%;
  transform: rotateY(-22deg) rotateX(9deg) rotateZ(2deg);
  transform-style: preserve-3d;
}
.phone3d-body {
  position: relative;
  padding: 8px;
  border-radius: 38px;
  background: linear-gradient(150deg, #34353b, #15161a 55%, #23242a);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .14),
    1px 1px 0 #1d1e22, 2px 2px 0 #1b1c20, 3px 3px 0 #19191d, 4px 4px 0 #17181b,
    5px 5px 0 #151619, 6px 6px 0 #131417,
    30px 40px 70px -18px rgba(0, 0, 0, .85);
}
/* сверху экрана — чёрная полоса статус-бара: в ней вырез камеры, и он не закрывает заголовок приложения */
.phone3d-body img { display: block; width: 100%; height: auto; border-top: 24px solid #000; border-radius: 30px; background: #000; }
/* блик по стеклу */
.phone3d-body::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 30px;
  background: linear-gradient(118deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
}
/* кнопки громкости на левой грани */
.phone3d-body::before {
  content: "";
  position: absolute;
  top: 22%;
  left: -3px;
  width: 3px;
  height: 9%;
  border-radius: 2px 0 0 2px;
  background: #2b2c31;
  box-shadow: 0 calc(100% + 14px) 0 #2b2c31;
}
/* вырез камеры — общий для объёмного и плоского телефона */
.phone-island {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 26%;
  height: 14px;
  border-radius: 10px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  transform: translateX(-50%);
}

/* будущий продукт — пунктирная рамка */
.product-soon {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding-block: 20px;
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}
.product-soon .product-name { margin-top: 0; font-size: 1.25rem; }
.product-soon .product-desc { margin-top: 0; }
.product-soon .product-name { color: var(--muted); }

@media (max-width: 1100px) {
  .products { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .product { grid-template-columns: 1fr; }
  .product-shot { justify-self: center; }
}
@media (max-width: 640px) {
  /* на телефоне скриншоты выбиваются из вёрстки; живое окно на главной — свой вариант (.phone-demo) */
  .hero-shot:not(.app-demo), .product-shot { display: none; }
  .hero-center { padding-bottom: clamp(40px, 10vw, 56px); }
}





/* ---------- состояние ---------- */

.status { border-top: 1px solid var(--line); }
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.status-row dt { display: flex; align-items: center; gap: 14px; }
.status-row dd { color: var(--muted); font: 400 .85rem/1.3 var(--font-mono); text-align: right; }

.dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--dim); }
.dot.ok { background: var(--text); box-shadow: var(--glow); }
.dot.err { background: var(--red); }

/* ---------- подвал ---------- */

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px var(--gutter) 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
}
.footer-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px 48px; }
.footer-brand p { max-width: 22rem; margin-top: 12px; line-height: 1.55; }
.footer .footer-mail { display: inline-block; margin-top: 16px; color: var(--text); }
.footer-social { display: flex; gap: 8px; margin-top: 14px; }
.footer .footer-social a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  transition: color .2s, border-color .2s, background-color .2s;
}
@media (hover: hover) { .footer .footer-social a:hover { color: var(--text); border-color: var(--line-strong); background: var(--glow-soft); } }
.footer-social svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-cols div { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-title {
  margin-bottom: 4px;
  color: var(--dim);
  font: 500 .8rem/1.3 var(--font-body);
}
.footer a { color: var(--muted); text-decoration: none; transition: color .2s; }
.footer .logo { color: var(--brand); }
@media (hover: hover) { .footer a:hover { color: var(--text); } }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 16px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font: 400 .82rem/1.2 var(--font-body);
}
@media (max-width: 760px) {
  .footer-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* страница оплаты помещается в экран целиком — от подвала там остаётся только нижняя строка */
body:has(.pay-page:not([hidden])) .footer { display: none; }   /* оплата — один экран, без подвала */

/* статус сервисов: точка светится цветом состояния, пока проверка не прошла — серая */
.status-link { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.status-dot {
  --c: var(--dim);
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  transition: background .3s, box-shadow .3s;
}
.status-dot::after {             /* расходящееся кольцо — «живой» индикатор */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c);
  opacity: 0;
}
.status-link[data-state] .status-dot { box-shadow: 0 0 6px 1px color-mix(in srgb, var(--c) 70%, transparent); }
.status-link[data-state] .status-dot::after { animation: status-ring 2.4s ease-out infinite; }
.status-link[data-state="ok"] .status-dot { --c: var(--ok); }
.status-link[data-state="partial"] .status-dot { --c: var(--warn); }
.status-link[data-state="down"] .status-dot { --c: var(--red); }
@keyframes status-ring { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(3); } }
@media (prefers-reduced-motion: reduce) { .status-link[data-state] .status-dot::after { animation: none; } }

/* ---------- окно входа по коду ---------- */

.modal {
  margin: auto;
  width: min(440px, calc(100% - 32px));
  padding: 36px 32px 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
.modal-kicker {
  color: var(--dim);
  font: 500 .8rem/1.3 var(--font-body);
}
.modal h3 { margin-top: 10px; font: 700 1.4rem/1.15 var(--font-display); letter-spacing: -.03em; }
.modal-text { margin: 14px 0 24px; color: var(--muted); font-size: .9rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.modal .notice { margin-top: 16px; }

.otp {
  width: 100%;
  padding: 16px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: 500 1.2rem/1 var(--font-mono);
  letter-spacing: .06em;
  text-align: center;
  caret-color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.otp::placeholder { color: var(--dim); }
.otp:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--glow-soft); }
.otp.filled { border-color: var(--muted); }
.otp.error { border-color: var(--red); animation: shake .35s; }
.otp.busy { opacity: .55; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.code-progress { display: flex; gap: 4px; margin-top: 10px; }
.code-progress i { flex: 1; height: 1px; background: var(--line-strong); transition: background .2s, box-shadow .2s; }
.code-progress i.on { background: var(--text); box-shadow: var(--glow); }

.code-timer { margin-top: 12px; color: var(--dim); font: 400 .75rem/1 var(--font-mono); text-align: center; }
.code-timer.expired { color: var(--red); }

/* ---------- узкие экраны ---------- */

/* на сенсорных экранах размытие под шапкой пересчитывается каждый кадр прокрутки и даёт
   дёрганье — заменяем его почти непрозрачным фоном */
@media (pointer: coarse) {
  /* html — для приоритета над правилами ниже по файлу */
  html .topbar,
  html .topbar.scrolled,
  html .topbar.menu-open {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(19, 20, 23, .94);
  }
}

/* ---------- мобильное меню ---------- */

.burger {
  display: none;
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
/* три тонкие линии → крестик */
.burger span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1px;
  background: var(--text);
  transition: transform .35s cubic-bezier(.22, .61, .36, 1), opacity .2s;
}
.burger span:nth-child(1) { top: 12px; }
.burger span:nth-child(2) { top: 17px; }
.burger span:nth-child(3) { top: 22px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* разделы на телефоне — отдельная капсула под шапкой */
.mobile-nav {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: -1px;
  right: -1px;
  padding: 4px 18px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  /* сплошной фон: размытие внутри размытой шапки не срабатывает, и текст страницы просвечивал */
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  /* закрыто: свёрнуто вверх и прозрачно */
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  transition: clip-path .4s cubic-bezier(.22, .61, .36, 1), opacity .25s ease;
}
.mobile-nav.open { clip-path: inset(0 0 0 0); opacity: 1; }
.mobile-nav a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font: 600 1.25rem/1.1 var(--font-display);
  letter-spacing: -.02em;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav.open a {
  opacity: 1;
  transform: none;
  transition: opacity .35s ease, transform .4s cubic-bezier(.22, .61, .36, 1);
}
.mobile-nav.open a:nth-child(2) { transition-delay: .05s; }
.mobile-nav.open a:nth-child(3) { transition-delay: .1s; }
.mobile-nav.open a:nth-child(4) { transition-delay: .15s; }
.mobile-nav.open a:nth-child(5) { transition-delay: .2s; }

/* шапка с открытым меню — всегда с фоном */
.topbar.menu-open { border-color: var(--line-strong); background: rgba(19, 20, 23, .96); }

@media (max-width: 960px) {
  .nav { display: none; }
  .topbar { gap: 10px; padding: 0 8px; }
  .topbar-actions { margin-left: auto; gap: 6px; }
  .burger { display: block; flex-shrink: 0; }
  .mobile-nav { display: block; }
}
@media (max-width: 560px) {
  .hero-actions { flex-direction: column; }
  .hero-btn { width: 100%; }
}

/* ---------- тарифы (главная) ---------- */

/* над тарифами: слева пробный период с кнопкой, справа выбор валюты — одной строкой */
.plans-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 24px;
}
.plans-trial { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .95rem; }
.plans-trial-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 600 .95rem/1.3 var(--font-body);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  cursor: pointer;
  transition: text-decoration-color .2s;
}
@media (hover: hover) { .plans-trial-btn:hover { text-decoration-color: var(--text); } }
.plans-trial-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }
/* выбор валюты (pricing.js): системный select скрыт, вместо него — пилюля и своё меню */
.cur-native { display: none; }
.cur { position: relative; }
.cur-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 .85rem/1 var(--font-body);
  cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}
.cur-btn .cur-code { color: var(--text); font-weight: 600; letter-spacing: .02em; }
.cur-btn svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; opacity: .7;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
@media (hover: hover) { .cur-btn:hover { border-color: var(--line-strong); color: var(--text); background: var(--glow-soft); } }
.cur.open .cur-btn { border-color: var(--line-strong); color: var(--text); }
.cur.open .cur-btn svg { transform: rotate(180deg); }

/* ПК: меню под кнопкой, две колонки, текущая — с галочкой */
.cur-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(540px, calc(100vw - 2 * var(--gutter)));
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transform-origin: top right;
  transition: opacity .18s ease, transform .22s cubic-bezier(.4, 0, 1, 1), visibility 0s linear .22s;
}
.cur.open .cur-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .22s ease, transform .3s cubic-bezier(.22, .61, .36, 1), visibility 0s;
}
.cur-title { display: none; }
.cur-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  max-height: min(340px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.cur-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: 400 .86rem/1.25 var(--font-body);
  text-align: left;
  cursor: pointer;
}
.cur-item .cur-code { flex: none; width: 34px; color: var(--text); font-weight: 600; font-size: .8rem; letter-spacing: .02em; }
.cur-item .cur-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .cur-item:hover { background: var(--glow-soft); color: var(--text); } }
.cur-item:focus-visible { outline: 1px solid var(--line-strong); outline-offset: -1px; }
.cur-item.is-current { background: rgba(255, 255, 255, .07); color: var(--text); }
.cur-item.is-current::after {
  content: "";
  flex: none;
  width: 9px;
  height: 4.5px;
  margin: 0 2px 3px auto;
  border-left: 1.5px solid var(--text);
  border-bottom: 1.5px solid var(--text);
  transform: rotate(-45deg);
}
.cur-backdrop { display: none; }

/* телефон: панель снизу с заголовком, строки крупнее — под палец */
@media (max-width: 640px) {
  .cur-btn .cur-name { display: none; }
  .cur-menu {
    position: fixed;
    inset: auto 0 0;
    z-index: 61;
    width: auto;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
    opacity: 1;
    transform: translateY(105%);
    transition: transform .3s cubic-bezier(.4, 0, 1, 1), visibility 0s linear .3s;
  }
  .cur.open .cur-menu { transform: none; transition: transform .38s cubic-bezier(.22, .61, .36, 1), visibility 0s; }
  /* ручка сверху */
  .cur-menu::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 2px;
    background: var(--line-strong);
  }
  .cur-title { display: block; margin: 0 6px 8px; color: var(--text); font: 700 1.05rem/1.3 var(--font-display); }
  .cur-list { grid-template-columns: 1fr; max-height: 60vh; }
  .cur-item { padding: 13px 10px; font-size: .95rem; }
  .cur-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
  }
  .cur.open .cur-backdrop { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.plan-card {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.2vw, 30px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 50%), var(--surface);
}
/* рекомендуемый: светлее рамка и подсветка сверху */
.plan-card-accent {
  border-color: rgba(255, 255, 255, .24);
  background: radial-gradient(120% 60% at 50% 0%, rgba(160, 170, 210, .12), transparent 70%), var(--surface);
}
.plan-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font: 700 1.15rem/1.2 var(--font-display);
  letter-spacing: -.01em;
}
.plan-flag {
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glow-soft);
  color: var(--text);
  font: 500 .75rem/1.3 var(--font-body);
}
/* цена в местной валюте бывает длинной («29 000 ₸») — «/мес» тогда целиком уходит на новую строку */
.plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin-top: 18px; }
.plan-amount { font: 700 clamp(1.6rem, 2vw, 2rem)/1 var(--font-display); letter-spacing: -.03em; white-space: nowrap; }
.plan-per { color: var(--muted); font-size: 1rem; white-space: nowrap; }
.plan-usd { margin-top: 6px; color: var(--dim); font: 400 .85rem/1.4 var(--font-body); }
.plan-usd:empty { display: none; }   /* цена в долларах — подписи нет, место не держим */
.plan-list { margin: 14px 0 24px; list-style: none; }
.plan-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: .9rem;
}
/* галочка */
.plan-list li::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 4px;
  margin: 0 1px 3px;
  border-left: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
}
.plan-btn { margin-top: auto; width: 100%; }
.plans-note { margin-top: 20px; color: var(--dim); font-size: .82rem; }

/* на телефоне тарифы — лента по одной карточке (общие правила лент — у «Возможностей»;
   этот блок стоит после основных правил .plans, иначе они его перебивают) */
@media (max-width: 640px) {
  /* тарифы — на главной и в окне тарифов; лента открывается на рекомендуемом */
  .plans {
    position: relative;
    display: flex;
    gap: 12px;
    margin-inline: calc(-1 * var(--gutter));
    padding: 4px var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .plans::-webkit-scrollbar { display: none; }
  .plans > .plan-card {
    flex: 0 0 min(82%, 360px);
    scroll-snap-align: center;
    scroll-snap-stop: always;      /* сильный свайп — тоже ровно на одну карточку, без пролёта */
    opacity: calc(1 - var(--d, 0) * .5);
    transform: scale(calc(1 - var(--d, 0) * .06));
  }
  .plans + .carousel-dots { display: flex; }
}



/* ---------- язык ---------- */

/* пока не загрузился перевод (не русский язык) — страница скрыта, чтобы не мигал русский текст */
html.i18n-pending body { visibility: hidden; }

.lang { position: relative; }
/* язык — пилюля «RU ⌄» с тонкой рамкой; стрелка переворачивается, пока меню открыто */
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 .78rem/1 var(--font-body);
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .2s, background-color .2s, border-color .2s;
}
@media (hover: hover) { .lang-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--glow-soft); } }
.lang-btn[aria-expanded="true"] { color: var(--text); border-color: var(--line-strong); }
.lang-current { display: block; }
.lang-caret {
  display: block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .7;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.lang-btn[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
/* цена плана в профиле */
.plan-cost { color: var(--text); font-weight: 600; font-size: .82rem; }
.lang-menu { min-width: 200px; --tail-right: 22px; }
.lang-code {
  width: 26px;
  color: var(--dim);
  font: 500 .72rem/1 var(--font-mono);
  letter-spacing: .08em;
}
.menu-item.current { color: var(--text); }
.menu-item.current .lang-code { color: var(--text); text-shadow: var(--glow); }
.menu-item.current::after {
  content: "";
  width: 9px;
  height: 4.5px;
  margin: 0 4px 3px auto;
  border-left: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
}


/* ---------- страница профиля ---------- */

.profile-page { padding-top: clamp(40px, 5vw, 72px); }
.pf-avatar { flex-shrink: 0; width: clamp(64px, 7vw, 84px); height: clamp(64px, 7vw, 84px); }
.pf-avatar .profile-avatar { width: 100%; height: 100%; }
.pf-avatar .avatar-letter { font-size: clamp(2rem, 4vw, 3rem); }
.pf-names { min-width: 0; }
.pf-name {
  font: 700 clamp(1.6rem, 3vw, 2.3rem)/1.1 var(--font-display);
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.pf-email { margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }

.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.pf-card {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.pf-card .product-kicker { margin-bottom: 18px; }
.pf-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 1rem; }
.pf-plan .plan-badge { font-size: .85rem; padding: 4px 12px; }
.pf-plan .plan-cost { font-size: 1.1rem; }
.pf-action { align-self: flex-start; margin-top: auto; }
.pf-card .pf-action { margin-top: 28px; }
.pf-facts { border-top: 1px solid var(--line); }
.pf-facts .profile-row { padding: 14px 0; font-size: .92rem; }

.pf-list { list-style: none; border-top: 1px solid var(--line); }
.pf-list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pf-list li:last-child { border-bottom: 0; }
.pf-icon svg { width: 20px; height: 20px; display: block; }
.pf-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pf-item b { font-weight: 600; font-size: .95rem; }
.pf-item small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }

@media (max-width: 820px) {
  .pf-grid { grid-template-columns: 1fr; }
}


/* ---------- админка: консоль (/admin) ----------
   Устроена как консоли Google: разделы — кнопки с иконками в шапке, заголовок раздела коротко,
   подробности — под «Как это работает». Оформление — как у всего сайта: монохром, выбранное —
   светлой плашкой, иконки в тонких рамках; цвет только у состояний (работает, внимание, ошибка). */

/* иконки: контур, цвет — от текста */
.ic {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* шапка админки: шире, у логотипа подпись «Админка», вместо разделов сайта — разделы консоли */
body:has(.adm-main) .topbar { width: min(1440px, calc(100% - 32px)); gap: 16px; }
body:has(.adm-main) .logo::after {
  content: "Админка";
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  font: 600 .72rem/1.2 var(--font-body);
  letter-spacing: .02em;
}
body:has(.adm-main) .footer { display: none; }
/* не админ (или ещё не проверили): меню пустое — бургер не нужен */
body:has(#admin-view[hidden]) .burger { display: none !important; }

.nav .adm-link { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.mobile-nav .adm-link { align-items: center; gap: 14px; font-size: 1.1rem; }
.mobile-nav .adm-link .ic { width: 22px; height: 22px; }
.adm-dot {
  --state: var(--muted);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--state);
}
@media (max-width: 1360px) {
  body:has(.adm-main) .nav a { padding: 7px 9px; font-size: .86rem; }
}
/* разделов больше, чем у сайта: в бургер — раньше */
@media (max-width: 1200px) {
  body:has(.adm-main) .nav { display: none; }
  body:has(.adm-main) .topbar-actions { margin-left: auto; }
  body:has(.adm-main) .burger { display: block; flex-shrink: 0; }
  body:has(.adm-main) .mobile-nav { display: block; }
}

/* ---------- каркас и общие части ---------- */

.adm-shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 72px; }
.adm-shell .notice { max-width: none; margin: 0 0 16px; }
.adm-panel { animation: adm-in .25s ease; }
@keyframes adm-in { from { opacity: 0; transform: translateY(6px); } }

.adm-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.adm-head > div { min-width: 0; }
/* иконка в рамке — как у списков в профиле */
.adm-head-icon, .adm-tile-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
}
.adm-head-icon { width: 52px; height: 52px; border-radius: 15px; }
.adm-head-icon .ic { width: 26px; height: 26px; }
.adm-tile-icon { width: 36px; height: 36px; border-radius: 10px; }
.adm-tile-icon .ic { width: 19px; height: 19px; }
.adm-title { font: 700 clamp(1.4rem, 2.2vw, 1.8rem)/1.15 var(--font-display); letter-spacing: -.02em; }
.adm-sub { margin-top: 4px; color: var(--muted); font-size: .92rem; }
.adm-subtitle { display: flex; align-items: center; gap: 8px; margin: 32px 0 14px; font: 600 1.05rem var(--font-display); }
.adm-subtitle .ic { color: var(--muted); }

.adm-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.adm-card-flush { padding: 0; overflow: hidden; }
.adm-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 12px; }
.adm-card-head h2 { display: flex; align-items: center; gap: 9px; font: 600 1.05rem var(--font-display); }
.adm-card-head h2 .ic { color: var(--muted); }
.adm-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.adm-saved { color: var(--muted); font-size: .85rem; }

/* «Как это работает»: длинные пояснения свёрнуты */
.adm-help { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.adm-help summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.adm-help summary .ic { color: var(--muted); }
.adm-help summary::-webkit-details-marker { display: none; }
.adm-help summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s;
}
.adm-help[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.adm-help p { padding: 0 16px 14px 44px; color: var(--muted); font-size: .9rem; line-height: 1.6; max-width: 62rem; }

/* кнопки */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: none;
  font: 600 .9rem var(--font-body);
  cursor: pointer;
  transition: box-shadow .25s, background-color .25s, border-color .25s;
  white-space: nowrap;
}
.adm-btn:active { transform: scale(.98); }
.adm-btn:disabled { opacity: .5; cursor: default; }
.adm-btn-primary { background: var(--plate); color: var(--plate-text); }
@media (hover: hover) { .adm-btn-primary:hover { box-shadow: 0 0 0 4px var(--glow-soft); } }
.adm-btn-danger { border-color: color-mix(in srgb, var(--red) 50%, transparent); color: var(--red); }
@media (hover: hover) { .adm-btn-danger:hover { background: color-mix(in srgb, var(--red) 10%, transparent); } }

/* поля */
.adm-select { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.adm-select .ic { width: 16px; height: 16px; }
.adm-select select, .adm-search, .adm-text-field input, .adm-text-field textarea, .adm-price-input input, .adm-kaspi-input {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.adm-select select { height: 40px; padding: 0 12px; }
.adm-select select:focus, .adm-search:focus, .adm-text-field input:focus, .adm-text-field textarea:focus,
.adm-price-input input:focus, .adm-kaspi-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--glow-soft);
}
.adm-text-field { display: grid; gap: 8px; margin-bottom: 18px; }
.adm-text-field b { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.adm-text-field b .ic { width: 16px; height: 16px; color: var(--muted); }
.adm-text-field small { margin-top: -4px; color: var(--muted); font-size: .82rem; }
.adm-text-field input, .adm-text-field textarea { width: 100%; padding: 10px 14px; resize: vertical; }
.adm-text-field input { height: 44px; }

.adm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip, var(--muted)) 14%, transparent);
  color: var(--chip, var(--muted));
  font: 500 .76rem/1.6 var(--font-body);
  white-space: nowrap;
}
.adm-chip .ic { width: 13px; height: 13px; }
.adm-chip.is-ok { --chip: var(--ok); }
.adm-chip.is-off { --chip: var(--red); }
.adm-chip.is-info { --chip: var(--text); }

.adm-empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 36px 20px; color: var(--muted); }

/* ---------- обзор ---------- */

.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.adm-stat, .adm-action {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .2s, transform .2s, background-color .2s;
}
.adm-stat { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; min-width: 0; }
@media (hover: hover) {
  .adm-stat:hover, .adm-action:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-2px); }
  .adm-stat:hover .adm-go, .adm-action:hover .adm-go { opacity: 1; transform: translateX(2px); }
}
.adm-stat-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: .9rem; }
.adm-go { margin-left: auto; color: var(--muted); opacity: .5; transition: opacity .2s, transform .2s; }
.adm-stat-value { font: 700 clamp(1.5rem, 2.2vw, 1.95rem)/1.1 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.adm-stat-value.is-ok { color: var(--ok); }
.adm-stat-value.is-warn { color: var(--warn); }
.adm-stat-value.is-error { color: var(--red); }
.adm-stat-value.is-off { color: var(--muted); }
.adm-stat small { color: var(--dim); font-size: .8rem; }

.adm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }

/* обзор: последние платежи и новые аккаунты */
.adm-overview-lists { margin-top: 20px; }
.adm-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.adm-more { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; color: var(--muted); font-size: .85rem; font-weight: 500; text-decoration: none; }
.adm-more .ic { width: 15px; height: 15px; }
@media (hover: hover) { .adm-more:hover { color: var(--text); background: rgba(255, 255, 255, .05); } }
.adm-mini { list-style: none; }
.adm-mini li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.adm-mini li:last-child { border-bottom: 0; }
.adm-mini li.adm-empty { display: flex; padding: 24px 0; }
.adm-mini .adm-avatar { width: 36px; height: 36px; font-size: .9rem; }
.adm-mini-text { display: flex; flex-direction: column; min-width: 0; }
.adm-mini-text b { overflow: hidden; font-weight: 600; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.adm-mini-text small { overflow: hidden; color: var(--dim); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.adm-mini-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .88rem; font-variant-numeric: tabular-nums; }
.adm-mini-side small { color: var(--dim); font-size: .76rem; }
.adm-mini-side .adm-off { color: var(--red); }
.adm-action { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.adm-action > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-action b { font-weight: 600; font-size: .95rem; }
.adm-action small { color: var(--muted); font-size: .8rem; }

/* ---------- аккаунты ---------- */

.adm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.adm-searchbox { position: relative; flex: 1 1 280px; min-width: 0; color: var(--muted); }
.adm-searchbox .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.adm-search { width: 100%; height: 44px; padding: 0 14px 0 42px; }

.adm-list-head, .adm-user {
  display: grid;
  grid-template-columns: 40px minmax(0, 1.4fr) minmax(0, .8fr) auto;
  align-items: center;
  gap: 12px 16px;
  padding: 0 20px;
}
.adm-list-head { padding-block: 10px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: .76rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.adm-list-head span:first-child { grid-column: 2; }
.adm-shell #adm-error { margin: 12px 20px 0; }
.adm-list { list-style: none; }
.adm-user { padding-block: 14px; border-bottom: 1px solid var(--line); transition: background-color .2s; }
@media (hover: hover) { .adm-user:hover { background: rgba(255, 255, 255, .02); } }
.adm-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font: 600 1rem var(--font-display);
}
img.adm-avatar { object-fit: cover; }
.adm-avatar.avatar-letter[style] { border-color: transparent; color: #0a0a0a; }   /* буква на пастельном цвете аккаунта */
.adm-user.is-me .adm-avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--text); }   /* это вы — кольцо */
.adm-who, .adm-state { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.adm-who b { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.adm-mail, .adm-facts span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.adm-mail { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.adm-mail .ic, .adm-facts .ic { width: 14px; height: 14px; }
.adm-facts { display: flex; flex-wrap: wrap; gap: 3px 14px; color: var(--dim); font-size: .8rem; }
.adm-facts .adm-id { font-family: var(--font-mono); letter-spacing: .03em; }
.adm-facts .is-warn { color: var(--warn); }
.adm-state { gap: 6px; }

/* смена тарифа — сегменты одной плашкой */
.adm-plans { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.adm-plan {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: 500 .85rem var(--font-body);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
@media (hover: hover) { .adm-plan:hover { color: var(--text); background: rgba(255, 255, 255, .06); } }
.adm-plan.is-current { background: var(--plate); color: var(--plate-text); }
.adm-plan:disabled { opacity: .5; cursor: default; }
.adm-expire { color: color-mix(in srgb, var(--red) 80%, var(--muted)); }
.adm-expire.is-current { background: color-mix(in srgb, var(--red) 20%, transparent); color: var(--red); }
.adm-foot { padding: 12px 20px; color: var(--dim); font-size: .82rem; }
.adm-foot:empty { display: none; }

@media (max-width: 900px) {
  .adm-list-head { display: none; }
  .adm-user { grid-template-columns: 40px minmax(0, 1fr); align-items: start; }
  .adm-state { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .adm-plans { grid-column: 1 / -1; display: flex; }
  .adm-plan { flex: 1 1 auto; height: 40px; }   /* под палец */
}

/* ---------- цены ---------- */

.adm-price-rows { border-top: 1px solid var(--line); }
.adm-price {
  display: grid;
  grid-template-columns: 110px auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.adm-price:last-child { border-bottom: 0; }
.adm-prices { max-width: 920px; }
.adm-price .plan-badge { justify-self: start; font-size: .8rem; padding: 3px 11px; }
.adm-price small { color: var(--muted); font-size: .85rem; }
.adm-price-input { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; }
.adm-price-input input { width: 140px; height: 42px; padding: 0 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .adm-price { grid-template-columns: 1fr auto; }
  .adm-price small { grid-column: 1 / -1; }
}

/* ---------- описания: форма и карточка, как её увидят клиенты ---------- */

.adm-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.adm-preview { position: sticky; top: 92px; }
.adm-preview-label { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: .85rem; }
.adm-preview-card {
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent), var(--bg);
}
.adm-preview-name { display: block; font: 700 1.4rem/1.2 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.adm-preview-desc { margin-top: 6px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.adm-preview-desc:empty { display: none; }
.adm-preview-list { margin-top: 14px; list-style: none; }
.adm-preview-list li { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; font-size: .9rem; overflow-wrap: anywhere; }
.adm-preview-list .ic { width: 16px; height: 16px; margin-top: 3px; color: var(--ok); }
@media (max-width: 960px) {
  .adm-split { grid-template-columns: minmax(0, 1fr); }
  .adm-preview { position: static; }
}

/* ---------- Kaspi ---------- */

.adm-kaspi { max-width: 760px; }
.adm-status {
  --state: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--state) 30%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--state) 8%, transparent);
}
[data-state="ok"] { --state: var(--ok); }
[data-state="warn"] { --state: var(--warn); }
[data-state="error"] { --state: var(--red); }
.adm-status-icon { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--state) 18%, transparent); color: var(--state); }
.adm-status-icon .ic { width: 22px; height: 22px; }
.adm-status b { font: 600 1.05rem var(--font-display); color: var(--state); }
.adm-status[data-state="off"] b { color: var(--text); }
.adm-status p { margin-top: 2px; color: var(--muted); font-size: .9rem; }
.adm-step { display: flex; gap: 14px; margin-top: 22px; }
.adm-step .adm-text-field { flex: 1; min-width: 0; margin-bottom: 0; }
.adm-step-num { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--text); }
.adm-inline { display: flex; flex-wrap: wrap; gap: 10px; }
.adm-kaspi-input { flex: 0 1 260px; min-width: 0; height: 42px; padding: 0 14px; }
.adm-shell #adm-kaspi-error { margin-top: 16px; }

@media (max-width: 640px) {
  .adm-shell { width: calc(100% - 24px); padding-top: 18px; }
  .adm-head { gap: 12px; }
  .adm-head-icon { width: 44px; height: 44px; border-radius: 13px; }
  .adm-head-icon .ic { width: 22px; height: 22px; }
  .adm-card { padding: 16px; }
  .adm-card-flush { padding: 0; }
  .adm-toolbar, .adm-user, .adm-foot { padding-inline: 14px; }
  .adm-help p { padding-left: 16px; }
  .adm-card-foot .adm-btn { flex: 1 1 auto; }
  .adm-step-num { display: none; }
  .adm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .adm-stat { padding: 14px; }
  .adm-stat-top { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
  .adm-stat-top .adm-go { display: none; }
  .adm-stat-value { font-size: 1.35rem; }
}
@media (max-width: 400px) {
  body:has(.adm-main) .logo::after { display: none; }   /* шапка узкая: подпись «Админка» — только в заголовке вкладки */
}


/* ---------- ссылки для соцсетей ---------- */

.an-tiles.lk-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lk-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lk-name b { font-weight: 600; white-space: nowrap; }
.lk-name small { color: var(--dim); font-size: .78rem; }
.lk-name code { color: var(--muted); font-family: var(--font-mono); font-size: .76rem; }
.lk-table tr.is-archived td { opacity: .5; }
/* переходы: число и полоса относительно самой результативной ссылки */
.lk-bar { position: relative; display: flex; justify-content: flex-end; min-width: 110px; }
.lk-bar i { position: absolute; left: 0; top: 50%; height: 6px; border-radius: 3px; background: var(--line-strong); transform: translateY(-50%); max-width: calc(100% - 44px); }
.lk-bar span { position: relative; }
.lk-actions { width: 1%; white-space: nowrap; text-align: right !important; }
.adm-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.adm-icon-btn .ic { width: 16px; height: 16px; }
@media (hover: hover) { .adm-icon-btn:hover { border-color: var(--text); color: var(--text); } }
.adm-icon-btn.is-done { border-color: var(--ok); color: var(--ok); }
.lk-form { margin-top: 20px; }
.lk-form .adm-card-head h2 .ic { color: var(--muted); }
.lk-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 16px; }
.lk-slug { display: flex; align-items: center; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); overflow: hidden; }
.lk-slug:focus-within { border-color: var(--text); box-shadow: 0 0 0 3px var(--glow-soft); }
.lk-slug span { padding: 0 2px 0 12px; color: var(--dim); font-size: .85rem; white-space: nowrap; }
.adm-text-field .lk-slug input { height: 100%; padding: 0 12px 0 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.lk-fields .adm-select, .lk-fields .adm-select select { width: 100%; }
.lk-fields .adm-select select { height: 44px; }
@media (max-width: 960px) {
  .an-tiles.lk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lk-fields { grid-template-columns: minmax(0, 1fr); }
}


/* ---------- аналитика и доходы: фильтры, плитки, карточки, графики, таблицы ---------- */

.adm-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 20px; padding: 12px 16px; }
.adm-filter-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .85rem; }
.adm-filter-label .ic { width: 16px; height: 16px; }
.adm-filter-label:not(:first-child) { margin-left: 8px; }
.an-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%; padding: 3px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.an-seg-btn {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: 500 .88rem var(--font-body);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
@media (hover: hover) { .an-seg-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); } }
.an-seg-btn.is-current { background: var(--plate); color: var(--plate-text); }
.an-seg-small { margin-bottom: 14px; }
.an-seg-small .an-seg-btn { height: 30px; font-size: .82rem; }

.an-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; transition: opacity .2s; }
.an-body > * { min-width: 0; }
.an-body.is-loading { opacity: .45; }   /* при перезагрузке прежние цифры остаются, без скачков */

.an-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.an-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.an-tile-label { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; color: var(--muted); font-size: .88rem; }
.an-tile-value { font: 700 clamp(1.4rem, 2vw, 1.8rem)/1.1 var(--font-display); letter-spacing: -.01em; }
.an-tile small { color: var(--dim); font-size: .8rem; overflow-wrap: anywhere; }

.an-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.an-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.an-card > header { margin-bottom: 14px; }
.an-card h2 { display: flex; align-items: center; gap: 9px; font: 600 1.05rem var(--font-display); }
.an-card h2 .ic { color: var(--muted); }
.an-card > header p { margin-top: 4px; color: var(--muted); font-size: .82rem; }

/* серии: первая — цвет текста, вторая — приглушённая */
.an-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; color: var(--muted); font-size: .82rem; }
.an-legend span { display: inline-flex; align-items: center; gap: 6px; }
.an-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: var(--text); }
.an-key.s2 { background: var(--muted); }

.an-chart { position: relative; width: 100%; }
.an-chart svg { display: block; overflow: visible; }
.an-grid { stroke: var(--line); stroke-width: 1; }
.an-axis { fill: var(--muted); font: 11px var(--font-body); font-variant-numeric: tabular-nums; }
.an-value { fill: var(--text); font: 600 11px var(--font-body); }
.an-line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.an-line.s2 { stroke: var(--muted); }
.an-area { fill: var(--text); opacity: .08; stroke: none; }
.an-dot { fill: var(--text); stroke: var(--surface); stroke-width: 2; }
.an-dot.s2 { fill: var(--muted); }
.an-bar { fill: var(--text); }
.an-cross { stroke: var(--line-strong); stroke-width: 1; }
.an-chart [tabindex]:focus-visible { outline: 1px solid var(--line-strong); }
@media (hover: hover) { .an-hit:hover { fill: var(--glow-soft); } }
.an-tip {
  position: absolute;
  top: 0;
  z-index: 2;
  min-width: 130px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  pointer-events: none;
  font-size: .8rem;
}
.an-tip small { display: block; margin-bottom: 4px; color: var(--muted); }
.an-tip-row { display: flex; align-items: center; gap: 8px; }
.an-tip-row b { font-weight: 600; }
.an-tip-row span { color: var(--muted); }

.an-details { margin-top: 12px; }
.an-details summary { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; cursor: pointer; list-style: none; }
.an-details summary::-webkit-details-marker { display: none; }
.an-details summary .ic { width: 15px; height: 15px; }
.an-details[open] summary { margin-bottom: 10px; }

.an-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }   /* таблица скроллится внутри карточки */
.an-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.an-table th, .an-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.an-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.an-table th { color: var(--dim); font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.an-table th button { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.an-table th[aria-sort="ascending"] button::after { content: " ↑"; }
.an-table th[aria-sort="descending"] button::after { content: " ↓"; }
.an-table th[aria-sort="ascending"], .an-table th[aria-sort="descending"] { color: var(--text); }
@media (hover: hover) { .an-table tbody tr:hover td { background: rgba(255, 255, 255, .02); } }
.an-table tbody tr:last-child td { border-bottom: 0; }
.an-table tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 600; }
.an-empty { color: var(--muted); text-align: center !important; }

@media (max-width: 1100px) {
  .an-grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .an-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .an-tile { padding: 14px; }
  .an-tile-label { flex-direction: column; align-items: flex-start; gap: 8px; }
  .an-card { padding: 16px 14px; }
  .adm-filterbar { padding: 12px; }
  .adm-filter-label:not(:first-child) { margin-left: 0; }
  .an-seg-btn { height: 38px; padding: 0 11px; }   /* под палец */
}
@media (max-width: 340px) {
  .an-tiles { grid-template-columns: 1fr; }
}


/* ---------- тарифы на весь экран ---------- */

html.modal-open { overflow: hidden; }   /* страница под окном не прокручивается */

.plans-modal {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.plans-modal::backdrop { background: var(--bg); }
.plans-modal[open] { animation: plans-in .45s cubic-bezier(.22, .61, .36, 1); }
@keyframes plans-in { from { opacity: 0; transform: translateY(24px); } }
/* тонкая сетка на фоне окна — как мотив сайта */
.plans-modal::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000, transparent 75%);
  pointer-events: none;
}
.plans-modal-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) var(--gutter) clamp(40px, 6vw, 80px);
}
.plans-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.plans-modal-head h2 {
  font: 700 clamp(1.7rem, 3vw, 2.5rem)/1.1 var(--font-display);
  letter-spacing: -.035em;
}
.plans-modal-head .hero-eyebrow { margin-bottom: 18px; }
.plans-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
}
.plans-close svg { width: 18px; height: 18px; }
.plans-status {
  margin-top: 24px;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  font-size: .92rem;
}

/* ---------- страница оплаты (/pay): чекаут ----------
   Слева заказ (что покупаете, цена, что входит, срок, итог), справа — аккаунт, способ с логотипом
   и ценой в своей валюте, кнопка с суммой; сверху шаги. На компьютере всё в одном экране без
   прокрутки: отступы и размеры сжимаются по высоте окна (vh), подвала на этой странице нет. */
.pay-page { max-width: 1180px; padding-top: clamp(12px, 2.6vh, 40px); padding-bottom: clamp(12px, 2.6vh, 40px); }
.pay-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-bottom: clamp(10px, 2.2vh, 24px); }
.pay-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 9px;
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.pay-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .pay-back:hover { color: var(--text); background: rgba(255, 255, 255, .05); } }

/* шаги: пройденный — галочка, текущий — светлая плашка */
.pay-steps { display: flex; align-items: center; gap: 10px; list-style: none; }
.pay-steps li { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: .85rem; white-space: nowrap; }
.pay-steps li + li::before { content: ""; width: 28px; height: 1px; margin-right: 2px; background: var(--line-strong); }
.pay-steps i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font: 600 .75rem/1 var(--font-body);
  font-style: normal;
}
.pay-steps .is-current { color: var(--text); }
.pay-steps .is-current i { border-color: var(--plate); background: var(--plate); color: var(--plate-text); }
.pay-steps .is-done { color: var(--muted); }
.pay-steps .is-done i { border-color: var(--text); font-size: 0; }
.pay-steps .is-done i::after { content: "✓"; font-size: .75rem; }

.pay-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(12px, 2vh, 20px); align-items: start; }
.pay-summary, .pay-panel { padding: clamp(16px, 2.8vh, 32px) clamp(20px, 2.4vw, 32px); border-radius: calc(var(--radius) + 4px); }

/* заказ */
.pay-summary { border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.pay-product { display: flex; align-items: center; gap: 14px; margin: clamp(8px, 1.6vh, 14px) 0 clamp(10px, 2vh, 22px); }
.pay-product-mark { flex-shrink: 0; width: 48px; height: 48px; padding: 9px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--bg); }
.pay-product b { display: block; color: var(--muted); font-weight: 500; font-size: .88rem; }
.pay-title { font: 700 clamp(1.3rem, 3.4vh, 1.8rem)/1.15 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.pay-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pay-price b { font: 700 clamp(1.9rem, 5.4vh, 3rem)/1 var(--font-display); letter-spacing: -.03em; white-space: nowrap; }
.pay-price span { color: var(--muted); }
.pay-usd { min-height: 1.3em; margin-top: 6px; color: var(--dim); font-size: .85rem; }
.pay-features { display: grid; gap: clamp(4px, 1vh, 10px); margin-top: clamp(10px, 2vh, 18px); padding-top: clamp(10px, 2vh, 18px); border-top: 1px solid var(--line); list-style: none; }
.pay-features li { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; line-height: 1.4; overflow-wrap: anywhere; }
.pay-features svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pay-lines { margin-top: clamp(10px, 2vh, 20px); border-top: 1px solid var(--line); }
.pay-lines div { display: flex; justify-content: space-between; gap: 16px; padding: clamp(8px, 1.4vh, 12px) 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.pay-lines dt { color: var(--muted); }
.pay-lines dd { text-align: right; }
.pay-total { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: clamp(10px, 1.8vh, 16px); }
.pay-total span { font-weight: 600; }
.pay-total b { font: 700 1.5rem/1 var(--font-display); letter-spacing: -.02em; white-space: nowrap; }

/* оплата */
.pay-panel { border: 1px solid var(--line-strong); background: var(--surface); }
.pay-account { display: flex; align-items: center; gap: 12px; margin-bottom: clamp(10px, 2.2vh, 22px); padding: clamp(8px, 1.4vh, 12px) 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.pay-account-avatar { display: grid; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; }
.pay-account div { min-width: 0; }
.pay-account small { display: block; color: var(--dim); font-size: .76rem; }
.pay-account b { display: block; overflow: hidden; font-weight: 600; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.pay-methods { display: grid; gap: clamp(6px, 1.1vh, 10px); margin-top: 10px; }
.pay-method {
  display: grid;
  grid-template-columns: auto 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: clamp(8px, 1.5vh, 14px) 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
@media (hover: hover) { .pay-method:hover { border-color: rgba(255, 255, 255, .26); } }
.pay-method:has(input:checked) { border-color: var(--text); background: rgba(255, 255, 255, .03); box-shadow: 0 0 0 3px var(--glow-soft); }
.pay-method input { width: 18px; height: 18px; margin: 0; accent-color: var(--text); }
/* логотип способа: свой цвет бренда, карта — значок в рамке */
.pay-method-logo { display: block; width: 40px; height: 40px; border-radius: 11px; object-fit: contain; }
.pay-method-card { display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--bg); }
.pay-method-card svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pay-method-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pay-method-text b { font-weight: 600; }
.pay-method-text small { color: var(--muted); font-size: .82rem; }
/* знаки платёжных систем — на светлых плашках, как на кассах */
.pay-brands { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-brands img { box-sizing: content-box; height: 10px; width: auto; padding: 4px 7px; border-radius: 5px; background: #fff; }
.pay-brands img[alt="Mastercard"] { height: 14px; padding: 2px 7px; }
.pay-method-price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-submit { width: 100%; height: clamp(44px, 6.4vh, 52px); margin-top: clamp(10px, 2vh, 20px); font-size: 1rem; }
.pay-submit svg { fill: none; }
.pay-submit:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.pay-panel .notice { max-width: none; margin-top: 12px; }
.pay-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: clamp(10px, 2vh, 18px); list-style: none; }
.pay-trust li { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.pay-trust svg { flex-shrink: 0; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Kaspi Pay: слева QR на белом (иначе камера его не читает), справа — что делать по шагам */
.pay-kaspi-head { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(12px, 2.4vh, 24px); }
.pay-kaspi-sum { font: 700 clamp(1.7rem, 4.6vh, 2.4rem)/1 var(--font-display); letter-spacing: -.03em; }
.pay-kaspi-what { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.pay-kaspi-body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: clamp(16px, 2.4vw, 28px); }
.pay-qr { width: clamp(170px, 31vh, 240px); padding: 10px; border-radius: 16px; background: #fff; transition: opacity .3s; }
.pay-qr svg { display: block; width: 100%; height: auto; }
.pay-qr.is-off { opacity: .15; }   /* QR больше не действует */
.pay-kaspi-steps { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(10px, 1.8vh, 16px); min-width: 0; }
.pay-how { display: grid; gap: clamp(6px, 1.2vh, 12px); list-style: none; counter-reset: how; }
.pay-how li { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); font-size: .88rem; line-height: 1.4; counter-increment: how; }
.pay-how li::before {
  content: counter(how);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  font: 600 .75rem/1 var(--font-body);
}
.pay-kaspi-open { width: 100%; height: 44px; }
/* с компьютера QR сканируют телефоном — кнопка приложения второстепенная */
@media (hover: hover) and (pointer: fine) {
  .pay-kaspi-open { border-color: var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--text); }
}
.pay-kaspi-state { color: var(--muted); font-size: .88rem; }
.pay-kaspi-state:not(.is-failed):not(:empty)::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  vertical-align: -1px;
  animation: pay-spin 1s linear infinite;
}
@keyframes pay-spin { to { transform: rotate(360deg); } }
.pay-kaspi-state.is-failed { color: var(--red); }

@media (max-width: 960px) {
  .pay-layout { grid-template-columns: minmax(0, 1fr); }
}
/* телефон: всё главное в один экран. Назад — одной стрелкой, в заказе тариф и цена в строку и срок
   (итог — на кнопке), способы плотнее. С телефона QR не отсканировать — на экране Kaspi первой идёт
   кнопка приложения, QR и шаги ниже, а заказ спрятан: сумма есть в шапке экрана */
@media (max-width: 560px) {
  .pay-page { padding-top: 10px; }
  .pay-top { flex-wrap: nowrap; margin-bottom: 10px; }
  .pay-back { padding: 8px; }
  .pay-back span { display: none; }
  .pay-steps { gap: 6px; }
  .pay-steps li:not(.is-current) span { display: none; }   /* подпись только у текущего шага */
  .pay-steps li + li::before { width: 12px; }
  .pay-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 14px 16px; }
  .pay-summary > .product-kicker, .pay-features, .pay-usd, .pay-total { display: none; }
  .pay-product { margin: 0; gap: 10px; }
  .pay-product-mark { width: 36px; height: 36px; padding: 6px; border-radius: 10px; }
  .pay-product b { font-size: .78rem; }
  .pay-title { font-size: 1.15rem; }
  .pay-price { flex-direction: column; align-items: flex-end; gap: 0; }
  .pay-price b { font-size: 1.35rem; }
  .pay-price span { font-size: .78rem; }
  .pay-lines { grid-column: 1 / -1; margin-top: 10px; }
  .pay-lines div { padding: 8px 0 0; border-bottom: 0; font-size: .85rem; }
  .pay-panel { padding: 14px 16px; }
  .pay-account { margin-bottom: 10px; padding: 8px 12px; }
  .pay-method { grid-template-columns: auto 34px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .pay-method-logo { width: 34px; height: 34px; border-radius: 9px; }
  .pay-method-text small { display: none; }   /* валюта видна по цене справа */
  .pay-submit { margin-top: 12px; }
  .pay-trust { gap: 4px 12px; margin-top: 10px; }
  .pay-trust li { font-size: .74rem; }
  .pay-layout:has(.pay-kaspi:not([hidden])) .pay-summary { display: none; }
  .pay-kaspi-head { margin-bottom: 12px; }
  .pay-kaspi-body { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .pay-kaspi-steps { display: contents; }
  .pay-kaspi-open { order: -2; }
  .pay-kaspi-state { order: -1; text-align: center; }
  .pay-qr { width: 180px; align-self: center; }
  .pay-how li { font-size: .82rem; }
  .pay-kaspi-back { align-self: center; }
}

/* ---------- окно тарифов целиком в экране ---------- */
/* На невысоких экранах ноутбуков (1366×768 и подобных) отступы и шрифты сжимаются по высоте окна,
   чтобы тарифы помещались без прокрутки. Узкие окна и телефоны листаются как обычно. */
@media (min-width: 1201px) and (max-height: 1200px) {
  .plans-modal-inner { padding: clamp(16px, 3.6vh, 72px) var(--gutter) clamp(14px, 2.6vh, 80px); }
  .plans-modal-head { margin-bottom: clamp(10px, 2.2vh, 48px); }
  .plans-modal-head .hero-eyebrow { margin-bottom: clamp(8px, 1.6vh, 18px); }
  .plans-modal-head h2 { font-size: clamp(1.8rem, 6vh, 4rem); }
  .plans-modal .plans-bar { margin-bottom: clamp(10px, 2vh, 24px); }
  .plans-modal .plan-card { padding: clamp(16px, 3.2vh, 40px) clamp(20px, 2vw, 32px); }
  .plans-modal .plan-name { font-size: clamp(1.15rem, 3vh, 1.4rem); }
  .plans-modal .plan-price { margin-top: clamp(6px, 1.4vh, 18px); }
  .plans-modal .plan-amount { font-size: clamp(1.6rem, 4.4vh, 2.6rem); }
  .plans-modal .plan-usd { margin-top: 4px; }
  .plans-modal .plan-list { margin: clamp(8px, 1.8vh, 24px) 0 clamp(10px, 2.2vh, 32px); }
  .plans-modal .plan-list li { padding: clamp(5px, 1.1vh, 12px) 0; font-size: .85rem; line-height: 1.35; }
  .plans-modal .plan-btn { height: clamp(40px, 6.6vh, 56px); }
  .plans-modal .plans-note { margin-top: clamp(8px, 1.6vh, 20px); }
  .plans-modal .plans-status { margin-top: clamp(8px, 1.6vh, 24px); padding: 10px 16px; }
}

/* текущий план */
/* текущий план — пунктирная рамка без свечения и контурная метка: не путать с рекомендуемым */
.plan-card.is-current { border: 1px dashed var(--line-strong); box-shadow: none; background: transparent; }
.plan-card.is-current .plan-name::after {
  content: "✓ " attr(data-mark);
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font: 500 .8rem/1.3 var(--font-body);
}
.plan-card.is-current .plan-flag { display: none; }
.plan-btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

/* «Улучшить план» в меню профиля — кнопка во всю ширину */
.menu-upgrade {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 20px);
  height: 42px;
  margin: 4px 10px 8px;
  border: 0;
  border-radius: 10px;
  background: var(--plate);
  color: var(--plate-text);
  font: 600 .88rem/1 var(--font-body);
  cursor: pointer;
  transition: box-shadow .2s;
}
.menu-upgrade svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .25s;
}
@media (hover: hover) {
  .menu-upgrade:hover { box-shadow: 0 0 0 3px var(--glow-soft), var(--glow); }
  .menu-upgrade:hover svg { transform: translateX(3px); }
}

/* план на странице профиля — крупными буквами */
.pf-plan { flex-direction: column; align-items: flex-start; gap: 10px; }
.pf-plan-name {
  font: 700 clamp(2.4rem, 5vw, 3.6rem)/1 var(--font-display);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.pf-plan-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.pf-action { border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: .95rem; }


/* ---------- ресурсы (главная) ---------- */

/* «Скачать» — во всю ширину, под ней три равные по высоте колонки */
.resources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}
.resources-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.res-card-wide { grid-column: 1 / -1; }
.res-card {
  display: flex;
  flex-direction: column;
  padding: clamp(26px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.res-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 24px;
  font: 700 clamp(1.5rem, 2.4vw, 2rem)/1.1 var(--font-display);
  letter-spacing: -.03em;
}
.res-badge {
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font: 500 .8rem/1.3 var(--font-body);
}
.res-note { margin-top: 20px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.res-note-top { margin: -8px 0 18px; }
.res-more { align-self: flex-start; margin-top: auto; }
.res-note + .res-more { margin-top: 24px; }
.res-card > :last-child:not(.res-more) { margin-bottom: 0; }

/* скачать — файлы в ряд, между ними тонкие линии */
.res-downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-top: 1px solid var(--line);
}

/* быстрый старт — нумерованные шаги через тонкие линии */
.res-steps { list-style: none; counter-reset: step; border-top: 1px solid var(--line); }
.res-steps li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: step;
  font-size: .95rem;
}
.res-steps li::before {
  content: counter(step, decimal-leading-zero);
  color: var(--dim);
  font: 400 .72rem/1 var(--font-mono);
}

/* вопросы — раскрываются по нажатию, плюс превращается в крестик */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-weight: 600;
  font-size: .98rem;
  list-style: none;
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
/* стрелка вниз; у открытого вопроса — вверх */
.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin: -4px 4px 0 0;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), border-color .2s, margin .3s;
}
.faq-item[open] summary::after { margin-top: 4px; border-color: var(--text); transform: rotate(-135deg); }
.faq-item p { padding: 0 0 18px; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.faq-item[open] p { animation: faq-in .3s ease; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-4px); } }

/* история версий */
.res-version { list-style: none; border-top: 1px solid var(--line); }
.res-version li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.res-version li:last-child { border-bottom: 0; }
.res-version li::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 4px;
  margin: 0 1px 3px;
  border-left: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
}

@media (max-width: 1100px) {
  .resources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .resources, .resources-2 { grid-template-columns: 1fr; }
  .res-downloads { grid-template-columns: 1fr; }
}




/* вход в приложение по коду (/link) */
.link-step { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; max-width: 26rem; }
.link-step p:not(.notice) { margin: 20px 0 8px; color: var(--muted); font-size: 1.1rem; }
.link-step .notice { width: 100%; }
.link-code { max-width: 16rem; text-transform: uppercase; }
.link-step p.link-shown-code { margin: 0; color: var(--text); font: 500 1.6rem/1 var(--font-mono); letter-spacing: .1em; }

/* ---------- тарифы: карточки одного вида ----------
   Все четыре карточки одинаковые; выделен только рекомендуемый — светлее рамка и подсветка
   сверху. Металл (--metal-*) остался только у значка тарифа в шапке и в профиле. */
:root {
  --metal-1: #ffffff;
  --metal-2: #5c5c5c;
  --metal-3: #c8c8c8;
}
@keyframes plan-shine { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* текущий тариф — пунктир без подсветки: не путать с рекомендуемым */
.plan-card.is-current[data-plan] {
  border: 1px dashed var(--line-strong);
  background: transparent;
  box-shadow: none;
}

/* значок тарифа в шапке и админке: та же лестница — контур, плашка, плашка с кольцом, металл */
.plan-pro { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--text); }
.plan-llm {
  border-color: transparent;
  background: linear-gradient(110deg, var(--metal-3), var(--metal-1) 45%, var(--metal-3)) ;
  color: var(--bg);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--metal-3);
}
/* тариф на странице профиля */
.pf-plan-name.plan-name-trial { color: var(--muted); }
.pf-plan-name.plan-name-llm {
  background: linear-gradient(100deg, var(--metal-3) 0%, var(--metal-1) 35%, var(--metal-2) 50%, var(--metal-1) 65%, var(--metal-3) 100%) 0 0 / 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: plan-shine 7s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pf-plan-name.plan-name-llm { animation: none; }
}

/* --- телефонный вариант живого окна (demo.js, phoneDemo) --- */
.phone-demo { display: none; }
@media (max-width: 640px) {
  .app-demo { display: none; }
  .phone-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  /* подпись шага над телефоном */
  .pd-caption { display: grid; width: min(82vw, 300px); }
  .pd-caption .demo-step { justify-content: center; }
  .pd-caption .demo-progress { margin-top: 10px; }
  .pd-device {
    position: relative;
    width: min(70vw, 270px);
    padding: 7px;
    border-radius: 40px;
    background: linear-gradient(150deg, #34353b, #15161a 55%, #23242a);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 30px 70px -24px rgba(0, 0, 0, .9);
  }
  /* кнопки на левой грани */
  .pd-device::before {
    content: "";
    position: absolute;
    top: 18%;
    left: -3px;
    width: 3px;
    height: 7%;
    border-radius: 2px 0 0 2px;
    background: #2b2c31;
    box-shadow: 0 calc(100% + 12px) 0 #2b2c31;
  }
  /* экран: полоса статуса (24 из 844) и приложение 400×820 */
  .pd-screen {
    position: relative;
    overflow: hidden;
    aspect-ratio: 400 / 844;
    border-radius: 33px;
    background: #000;
  }
  .pd-screen picture { display: contents; }
  .pd-page {
    position: absolute;
    top: 2.844%;
    left: 0;
    width: 100%;
    height: auto;
    transition: transform .55s cubic-bezier(.65, 0, .35, 1), opacity .35s ease;
    will-change: transform;
  }
  .pd-page[data-at="in"] { transform: none; opacity: 1; }
  .pd-page[data-at="left"] { transform: translateX(-100%); }
  .pd-page[data-at="right"] { transform: translateX(100%); }
  .pd-page[data-at="hidden"] { opacity: 0; }
  .pd-page[data-at="pre"] { z-index: 6; transform: none; opacity: 0; }
  .pd-page[data-at="fade"] { z-index: 6; transform: none; opacity: 1; transition-duration: .55s, .6s; }
  /* меню: только сама панель (84,5 % ширины) выезжает слева, остальное затемняет .pd-scrim */
  .pd-drawer { clip-path: inset(0 15.5% 0 0); }
  .pd-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .45s ease;
  }
  .pd-scrim.is-on { opacity: 1; }
  .phone-demo.is-snapping .pd-page, .phone-demo.is-snapping .pd-touch, .phone-demo.is-snapping .pd-scrim { transition: none !important; }
  .phone-demo .demo-ring, .phone-demo .demo-sweep, .phone-demo .demo-ripple { z-index: 7; }
  .phone-demo .demo-ring::before { border-radius: 9px; }
  .phone-demo .demo-ripple::after { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  /* касание пальцем */
  /* палец: сам элемент только стоит в точке (transform — положение), круг рисует ::before —
     его увеличение и «нажатие» не сдвигают положение */
  .pd-touch {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 8;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    opacity: 0;
    pointer-events: none;
    transition-property: transform, opacity;
    transition-timing-function: cubic-bezier(.65, 0, .35, 1), ease;
  }
  .pd-touch::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.5px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .5);
    transform: scale(1.35);
    transition: transform .18s ease, background-color .12s ease;
  }
  .pd-touch.is-on { opacity: 1; }
  .pd-touch.is-on::before { transform: none; }
  .pd-touch.is-down::before { background: rgba(255, 255, 255, .45); transform: scale(.82); }
  .phone-demo .phone-island { z-index: 9; top: 1.4%; height: 3.1%; width: 27%; }
}

/* ---------- скачивание (страница DDx Host) ---------- */
/* две карточки — Windows и Android; карточка устройства посетителя выделена и стоит первой */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.dl-card {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.6vw, 32px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 50%), var(--surface);
}
.dl-card.is-recommended {
  order: -1;
  border-color: rgba(255, 255, 255, .24);
  background: radial-gradient(120% 70% at 50% 0%, rgba(160, 170, 210, .12), transparent 70%), var(--surface);
}
.dl-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dl-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .01));
}
.dl-logo svg { width: 24px; height: 24px; fill: var(--text); }
.dl-badge {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glow-soft);
  color: var(--text);
  font: 500 .75rem/1.3 var(--font-body);
}
.dl-name { margin-top: 20px; font: 700 1.4rem/1.15 var(--font-display); letter-spacing: -.02em; }
.dl-what { margin-top: 6px; color: var(--muted); font-size: .95rem; }
.dl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; }
/* кнопка: у карточки устройства — светлая, у другой — контур */
.dl-btn { border-color: var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--text); }
.dl-card.is-recommended .dl-btn { border-color: transparent; background: var(--plate); color: var(--plate-text); }
.dl-btn svg { width: 17px; height: 17px; }
.dl-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
@media (hover: hover) { .dl-btn:not([aria-disabled="true"]):hover svg { transform: translateY(2px); } }
.dl-meta { color: var(--dim); font-size: .85rem; font-variant-numeric: tabular-nums; }
.dl-alt {
  align-self: flex-start;
  margin-top: 14px;
  color: var(--muted);
  font-size: .85rem;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}
@media (hover: hover) { .dl-alt:hover { color: var(--text); text-decoration-color: var(--text); } }
@media (max-width: 720px) {
  .dl-grid { grid-template-columns: 1fr; }
  .dl-btn { flex: 1 1 auto; }
}

/* ---------- профиль (/profile) ---------- */
.profile-page { padding-top: clamp(32px, 4vw, 56px); }
/* шапка: карточка во всю ширину с подсветкой сверху */
.pf-head {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 28px);
  margin-bottom: 16px;
  padding: clamp(22px, 2.8vw, 34px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: radial-gradient(90% 120% at 0% 0%, rgba(160, 170, 210, .12), transparent 60%), var(--surface);
}
.profile-page .pf-avatar { flex-shrink: 0; width: clamp(64px, 7vw, 84px); height: clamp(64px, 7vw, 84px); }
.profile-page .pf-avatar .profile-avatar { width: 100%; height: 100%; border: 2px solid var(--line-strong); }
.profile-page .pf-avatar .avatar-letter { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.profile-page .pf-names { flex: 1; min-width: 0; }
.profile-page .pf-name { font: 700 clamp(1.5rem, 2.6vw, 2.1rem)/1.15 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.profile-page .pf-email { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pf-chip { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem; }
.pf-chip:empty { display: none; }
.profile-page .profile-id { padding: 3px 10px; border-radius: 999px; font-size: .78rem; }
.pf-out { flex-shrink: 0; align-self: flex-start; }
/* карточки: тариф шире, рядом аккаунт; ниже способы входа и устройства */
.profile-page .pf-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.profile-page .pf-card {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.6vw, 30px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 50%), var(--surface);
}
.pf-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font: 600 1rem/1.3 var(--font-display); }
.pf-title .ico { width: 32px; height: 32px; margin: 0; border-radius: 9px; }
.pf-title .ico svg { width: 17px; height: 17px; }
.profile-page .pf-plan { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.profile-page .pf-plan-name { font: 700 clamp(2.2rem, 4vw, 3rem)/1 var(--font-display); letter-spacing: -.02em; text-transform: none; }
.profile-page .pf-plan-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; color: var(--muted); }
.profile-page .pf-plan .plan-cost { color: var(--text); font-size: 1.05rem; }
/* полоса срока; в последние 3 дня — жёлтая */
.pf-term { display: grid; gap: 8px; margin-top: 18px; color: var(--muted); font-size: .85rem; }
.pf-term-bar { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: var(--line); }
.pf-term-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--text); transition: width .6s ease; }
.pf-term.is-low { color: var(--warn); }
.pf-term.is-low .pf-term-bar i { background: var(--warn); }
.profile-page .pf-action { align-self: flex-start; margin-top: auto; }
.profile-page .pf-card-plan .pf-action { margin-top: 24px; }
.profile-page .pf-facts { border-top: 0; }
.profile-page .pf-facts .profile-row { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.profile-page .pf-facts .profile-row:last-child { border-bottom: 0; }
/* списки: значок в плитке слева */
.profile-page .pf-list { list-style: none; border-top: 0; }
.profile-page .pf-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile-page .pf-list li:last-child { border-bottom: 0; }
.profile-page .pf-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}
.profile-page .pf-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.profile-page .pf-icon svg path[fill="currentColor"] { stroke: none; }
.profile-page li.current .pf-icon { border-color: var(--line-strong); color: var(--text); }
.profile-page .pf-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-page .pf-item b { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
.profile-page .pf-item small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.pf-now { padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--glow-soft); color: var(--text); font-size: .72rem; font-weight: 500; }
.pf-out-all { margin-top: 16px; }
.pf-link-danger {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font: 500 .88rem/1.3 var(--font-body);
  cursor: pointer;
  opacity: .85;
}
@media (hover: hover) { .pf-link-danger:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; } }
.profile-page .notice { max-width: none; margin: 0 0 16px; }
/* не вошёл */
.pf-guest { align-items: center; text-align: center; }
.pf-guest .auth-mark { margin-bottom: 8px; }
.pf-guest p:not(.hero-eyebrow) { margin-inline: auto; }
@media (max-width: 820px) {
  .profile-page .pf-grid { grid-template-columns: 1fr; }
  .pf-head { flex-wrap: wrap; }
  .pf-out { order: 3; width: 100%; }
  .pf-out .hero-btn { width: 100%; }
}

/* ---------- окно входа ---------- */
.auth-dialog {
  margin: auto;
  width: min(420px, calc(100% - 32px));
  padding: 36px 28px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: radial-gradient(120% 60% at 50% 0%, rgba(160, 170, 210, .14), transparent 70%), var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.auth-dialog[open] { animation: auth-in .35s cubic-bezier(.22, .61, .36, 1); }
@keyframes auth-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.auth-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.auth-close { position: absolute; top: 12px; right: 12px; }
.auth-mark { display: block; width: 56px; height: 56px; margin: 0 auto 18px; border: 1px solid var(--line-strong); border-radius: 16px; }
.auth-dialog h2 { font: 700 1.5rem/1.2 var(--font-display); letter-spacing: -.02em; }
.auth-sub { margin-top: 8px; color: var(--muted); font-size: .95rem; }
.auth-providers { display: grid; gap: 10px; margin-top: 26px; }
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 50px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font: 600 .95rem/1 var(--font-body);
  text-decoration: none;
  transition: border-color .2s, background-color .2s, transform .15s;
}
.auth-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
@media (hover: hover) { .auth-btn:hover { border-color: rgba(255, 255, 255, .3); background: var(--glow-soft); } }
.auth-btn:active { transform: scale(.98); }
/* первый сервис — светлой кнопкой */
.auth-btn:first-child { border-color: transparent; background: var(--plate); color: var(--plate-text); }
@media (hover: hover) { .auth-btn:first-child:hover { background: var(--plate); box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); } }
.auth-btn.unavailable { opacity: .45; cursor: help; }
.auth-empty { color: var(--muted); }
.auth-dialog .notice { max-width: none; margin-top: 14px; text-align: left; }
.auth-note { margin-top: 20px; color: var(--dim); font-size: .82rem; line-height: 1.5; }
/* телефон: панель снизу */
@media (max-width: 640px) {
  .auth-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    padding: 30px 20px calc(22px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
  }
  .auth-dialog[open] { animation: auth-up .38s cubic-bezier(.22, .61, .36, 1); }
}
@keyframes auth-up { from { transform: translateY(100%); } }
