/* BerdukVPN — тарифы и кабинет. Вариант B (тёмный): почти чёрный фон с сеткой и свечением сверху,
   тёмные карточки с тонкой светлой обводкой, глянцевые графитовые карточки с изолиниями
   (assets/contour.svg), светлые «металлические» пилюли для главных действий и выбранного. Шрифт — системный SF Pro. */
:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --surface: #161618;
  --card-bg: linear-gradient(180deg, #1b1b1e 0%, #131315 100%);
  --soft: #202023;
  --soft-2: #2a2a2e;
  --text: #f2f2f4;
  --muted: #8e9097;
  --line: rgba(255, 255, 255, .08);
  --field-line: #6e7079;
  --black: #141416;
  --on-black: #ffffff;
  --on-black-muted: #a9aab1;
  --metal: linear-gradient(180deg, #fbfbfc 0%, #d9dadd 55%, #a9aaaf 100%);
  --metal-hover: linear-gradient(180deg, #ffffff 0%, #e4e5e8 55%, #b6b7bc 100%);
  --on-metal: #121214;
  --on-metal-muted: #45474e;
  /* мелкий текст у нижнего края металла (#a9aaaf): 5,2:1 */
  --on-metal-soft: #34363c;
  --metal-edge: inset 0 0 0 1px rgba(255, 255, 255, .6), 0 10px 24px -10px rgba(0, 0, 0, .7);
  --green: #6ee39d;
  --green-bg: rgba(110, 227, 157, .14);
  --green-on-black: #6ee39d;
  --green-on-metal: #146c37;
  --green-chip-on-metal: #e3f3e8;
  --danger: #ff8f8f;
  /* текст статуса на тёмной плашке: 6:1 */
  --danger-status: #ffa3a3;
  --warn: #ffcf6e;
  --err-bg: rgba(255, 120, 120, .14);
  --err-text: #ffd5d5;
  --field-bg: #1c1c1f;
  --field-hover: #212124;
  --soft-hover: #333338;
  --tab: #26262a;
  --tabbar-bg: rgba(22, 22, 24, .9);
  --hero-fade: #9c9da3;
  --tg: #1a7ab5;
  --tg-hover: #176fa6;
  --radius-xl: 32px;
  --radius-l: 24px;
  --radius-m: 18px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  --shadow-lift: inset 0 1px 0 rgba(255, 255, 255, .14), 0 28px 56px -22px rgba(0, 0, 0, .85);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
/* Фокус и прокрутка к якорю не уходят под плавающие пилюли внизу */
html.has-tabbar { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (max-width: 960px) { html.route-landing { scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom)); } }
body {
  min-height: 100vh;
  /* сетка со свечением только в верхней части страницы */
  background:
    radial-gradient(900px 560px at 12% -14%, rgba(255, 255, 255, .13) 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(11, 11, 12, 0) 0, rgba(11, 11, 12, .6) 380px, var(--bg) 680px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(180deg, rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 64px 64px,
    var(--bg);
  background-repeat: no-repeat, no-repeat, repeat, repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--text); color: var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
/* Заголовок получает фокус программно при переходе (для озвучки) — рамка ему не нужна */
[tabindex="-1"]:focus { outline: none; }
.total :focus-visible, .bar :focus-visible, .card-dark :focus-visible, .trial-banner:focus-visible, .plan.on:focus-visible, .period.on:focus-visible { outline-color: var(--on-black); }
.plan.on:focus-visible { outline: 2px solid var(--text); }
.period.on:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* Графитовые карточки: изолинии — сигнатура мира */
.contour, .card-dark, .total, .plan.on, .bar, .trial-banner {
  background-color: var(--black);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 45%), url(/assets/contour.svg);
  border: 1px solid rgba(255, 255, 255, .12);
  background-size: 100% 100%, cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--on-black);
}

/* ---------- Шапка ---------- */
nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 26px 0 22px; }
.logo { display: flex; align-items: center; min-height: 44px; gap: 10px; font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.logo-mark { width: auto; height: 28px; color: var(--text); flex: none; display: block; }
.links { display: flex; gap: 4px; background: var(--card-bg); border: 1px solid var(--line); padding: 5px; border-radius: 999px; box-shadow: var(--shadow); }
.links:empty { display: none; }
.links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; padding: 0 18px; border-radius: 999px; color: var(--muted); transition: background-color .2s var(--ease-out), color .2s var(--ease-out); }
.links a:hover { color: var(--text); }
.links a[aria-current="true"], .links a[aria-current="page"] { background: var(--metal); color: var(--on-metal); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-balance { font-size: 15px; font-weight: 600; padding: 0 16px; height: 44px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--line); }
.wa-nav .wa-ico { display: none; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; letter-spacing: -.1px; border-radius: 999px; white-space: nowrap; transition: transform .15s var(--ease-out), background-color .2s var(--ease-out), border-color .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-sm { font-size: 15px; height: 44px; padding: 0 20px; }
.btn-lg { font-size: 17px; height: 58px; padding: 0 28px; }
/* Главное действие — светлая «металлическая» пилюля */
.btn-black, .btn-white { background: var(--metal); color: var(--on-metal); box-shadow: var(--metal-edge); }
.btn-black:hover, .btn-white:hover { background: var(--metal-hover); }
.btn-soft { background: var(--soft-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-soft:hover { background: var(--soft-hover); }
.wa-nav.btn-black { background: var(--card-bg); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.wa-nav.btn-black:hover { background: var(--soft-2); }
.btn-ghost { background: rgba(255, 255, 255, .06); color: var(--on-black); border: 1.5px solid rgba(255, 255, 255, .24); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, .5); }
.btn-lg.full, .btn-sm.full { width: 100%; }
.wa-ico { width: 22px; height: 22px; flex: none; }
.tg-btn { background: var(--tg); color: #fff; }
.tg-btn:hover { background: var(--tg-hover); }
.tg-btn svg { width: 22px; height: 22px; }
.link { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .35); }
.link:hover { text-decoration-color: currentColor; }
.card-dark .link { text-decoration-color: rgba(255, 255, 255, .4); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--soft); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Главная: заголовок и плашка пробного периода ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 24px; align-items: end; padding: 18px 0 32px; }
.hero-title { font-family: var(--font-display); font-size: clamp(44px, 6.4vw, 76px); line-height: .98; font-weight: 700; letter-spacing: -.035em; text-wrap: balance; }
/* Заголовок — светлый градиент; на строках SplitText тоже, иначе анимированные строки не обрезаются по тексту */
.hero-title { background-image: linear-gradient(180deg, #ffffff 15%, var(--hero-fade) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* Вступление: заголовок виден сразу и только «собирается» — проявление, подъём и снятие размытия */
@keyframes hero-in { from { opacity: .3; transform: translateY(.16em); filter: blur(8px); } }
.route-landing .hero-title { animation: hero-in .9s var(--ease-out) both; }
.trial-banner { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 16px 16px 18px; border-radius: var(--radius-l); box-shadow: var(--shadow-lift);
  background-color: #1c1c1f; background-image: url(/assets/contour.svg), linear-gradient(105deg, #2e2e33 0%, #141416 70%); background-size: cover, 100% 100%; }
.trial-banner .tb-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.trial-banner .tb-ico svg { width: 20px; height: 20px; }
.trial-banner b { display: block; font-size: 16px; font-weight: 700; }
.trial-banner span.tb-text { display: block; font-size: 13.5px; color: var(--on-black-muted); margin-top: 2px; }
.trial-banner .tb-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--metal); color: var(--on-metal); box-shadow: var(--metal-edge); font-size: 15px; font-weight: 600; }
.trial-banner:hover .tb-btn { background: var(--metal-hover); }

/* ---------- Видеоинструкция (только buy.r: data-wa) — компактная строка под заголовком ---------- */
.video-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; width: 100%; max-width: 420px; margin-top: 18px; padding: 10px 18px 10px 10px; text-align: left; color: inherit; font: inherit; cursor: pointer; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .2s var(--ease-out); }
.video-card:hover { border-color: rgba(255, 255, 255, .22); }
.vc-play { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--soft-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.vc-play svg { width: 16px; height: 16px; margin-left: 2px; }
.vc-body { display: grid; gap: 1px; min-width: 0; }
.vc-body b { font-size: 16px; font-weight: 700; line-height: 1.3; }
.vc-text { font-size: 14px; line-height: 1.4; color: var(--muted); }
.vplayer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5, 5, 6, .86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.vplayer video { width: min(86vw, 400px, calc((100dvh - 120px) * 9 / 16)); aspect-ratio: 9 / 16; border-radius: 26px; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, .8); border: 1px solid rgba(255, 255, 255, .12); }
.vplayer .vp-close { position: absolute; top: calc(18px + env(safe-area-inset-top)); right: 18px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card-bg); border: 1px solid rgba(255, 255, 255, .14); color: var(--text); }
.vplayer .vp-close svg { width: 20px; height: 20px; }
.vp-open { overflow: hidden; }

/* ---------- Конфигуратор ---------- */
.config { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.panel { display: grid; gap: 30px; }
.label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; padding: 0 4px; }
.label h2 { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.label small { font-size: 14px; color: var(--muted); text-align: right; }

.plans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.plan, .period { -webkit-tap-highlight-color: transparent; }
.plan:active, .period:active { transform: scale(.985); }
.plan { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; text-align: left; min-height: 216px; padding: 20px 22px 22px; border-radius: var(--radius-xl); background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background-color .2s var(--ease-out), color .2s var(--ease-out); }
.plan:hover:not(.on) { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.plan.on { border-color: rgba(255, 255, 255, .38); box-shadow: var(--shadow-lift), 0 0 48px rgba(255, 255, 255, .07); }
.plan .p-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); margin-bottom: 10px; }
.plan .p-ico svg { width: 22px; height: 22px; }
.plan.on .p-ico { background: rgba(255, 255, 255, .12); }
.plan .p-name { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.plan .p-desc { display: block; font-size: 14.5px; line-height: 1.45; color: var(--muted); max-width: 30ch; }
.plan .p-price { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.6px; margin-top: 14px; }
.plan .p-price span { font-family: var(--font); font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.plan.on .p-desc, .plan.on .p-price span { color: var(--on-black-muted); }
.plan .tag { position: absolute; top: 20px; right: 20px; font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 999px; background: var(--soft-2); }
.plan.on .tag { background: rgba(255, 255, 255, .14); color: var(--on-black); }
.plan .p-check { position: absolute; right: 18px; bottom: 18px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid rgba(255, 255, 255, .2); transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out); }
.plan .p-check svg { width: 16px; height: 16px; opacity: 0; }
.plan.on .p-check { background: var(--metal); border-color: rgba(255, 255, 255, .6); color: var(--on-metal); }
.plan.on .p-check svg { opacity: 1; }
.plan-hint { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 14px; padding: 0 4px; }
.plan-hint b { color: var(--text); font-weight: 600; }

/* Срок — капсулы, как выбор даты */
.periods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px; border-radius: var(--radius-xl); background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow); }
.period { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-height: 104px; padding: 20px 8px 14px; border-radius: 26px; text-align: center; transition: background-color .2s var(--ease-out), color .2s var(--ease-out); }
.period:hover:not(.on) { background: var(--soft); }
.period b { display: block; font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.period span { display: block; font-size: 14px; color: var(--muted); }
.period .save { margin-top: 6px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--green); background: var(--green-bg); padding: 3px 9px; border-radius: 999px; }
.period.on { background: var(--metal); color: var(--on-metal); box-shadow: var(--metal-edge); }
.period.on span { color: var(--on-metal-muted); }
/* Сплошная светлая плашка: тёмно-зелёный текст 5,6:1 при любом тоне металла */
.period.on .save { color: var(--green-on-metal); background: var(--green-chip-on-metal); }
.period b span { display: inline; font-size: inherit; color: inherit; }
.period .pu-s { display: none; }

/* Устройства — плитка с числом */
.devices { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 18px 18px 22px; border-radius: var(--radius-xl); background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow); }
.devices-info b { display: block; font-size: 17px; font-weight: 700; }
.devices-info span { display: block; font-size: 14px; line-height: 1.45; color: var(--muted); margin-top: 3px; }
.devices-info a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--soft); border-radius: 999px; padding: 5px; flex: none; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; background: var(--metal); color: var(--on-metal); box-shadow: var(--metal-edge); font-size: 22px; font-weight: 500; display: grid; place-items: center; transition: background-color .2s var(--ease-out); }
.stepper button svg { width: 20px; height: 20px; }
.stepper button:hover:not(:disabled) { background: var(--metal-hover); }
.stepper button[aria-disabled="true"] { opacity: .3; cursor: default; }
.stepper button[aria-disabled="true"]:hover { background: var(--metal); }
.stepper .dev-count { min-width: 52px; text-align: center; font-family: var(--font-display); font-size: 26px; font-weight: 700; }

/* Итого */
.total { position: sticky; top: 20px; padding: 30px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lift); }
.total h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.rows { margin-top: 20px; display: grid; gap: 12px; }
.row { display: flex; justify-content: space-between; gap: 16px; font-size: 15.5px; }
.row dt { color: var(--on-black-muted); }
.row dd { font-weight: 600; text-align: right; }
.sum { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 22px; padding-top: 20px; }
.sum .cap { font-size: 14.5px; color: var(--on-black-muted); }
.sum .big { font-family: var(--font-display); font-size: 62px; font-weight: 700; letter-spacing: -.04em; line-height: 1.04; margin-top: 4px; font-variant-numeric: tabular-nums; }
.sum .old { font-family: var(--font); font-size: 18px; color: var(--on-black-muted); text-decoration: line-through; margin-left: 10px; font-weight: 500; letter-spacing: 0; }
.actions { display: grid; gap: 10px; margin-top: 24px; }
.actions .btn { width: 100%; }
.actions .btn-white { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
/* На buy.r покупка только через WhatsApp; на site.r это главная кнопка «Оформить подписку» */
html:not(.no-wa) #buyBtn, html:not(.no-wa) #buyNote { display: none; }
.host-buy [data-cabinet] { display: none !important; }
.no-wa #buyBtn { background: var(--metal); color: var(--on-metal); border: 0; box-shadow: var(--metal-edge); }
.no-wa #buyBtn:hover { background: var(--metal-hover); }
.pay-note { font-size: 13px; color: var(--on-black-muted); text-align: center; margin-top: 14px; line-height: 1.5; text-wrap: balance; }
.pay-note a { color: var(--on-black); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .4); }

/* ---------- Подвал ---------- */
footer { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding: 40px 0 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
footer .f-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
footer a { display: inline-flex; align-items: center; min-height: 44px; }
footer a:hover { color: var(--text); }

/* Нижняя пилюля с суммой (главная, телефон) */
.bar { display: none; }

/* ---------- Кабинет ---------- */
.view-app { min-height: 60vh; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 860px; margin: 0 auto; }
.page-narrow { max-width: 460px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 4px 4px; }
.page-head h1 { font-family: var(--font-display); font-size: 46px; line-height: 1; letter-spacing: -.035em; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 15.5px; margin-top: 8px; }
.greet { display: flex; align-items: center; gap: 14px; padding: 8px 4px 4px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--metal); color: var(--on-metal); box-shadow: var(--metal-edge); font-family: var(--font-display); font-size: 21px; font-weight: 700; flex: none; }
.greet small { display: block; font-size: 13.5px; color: var(--muted); }
.greet b { display: block; font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.greet-text { min-width: 0; }
.card { background-color: var(--surface); background-image: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 28px; display: grid; gap: 18px; box-shadow: var(--shadow); min-width: 0; }
.card > * { min-width: 0; }
.card.card-dark { background-color: var(--black); background-image: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 45%), url(/assets/contour.svg); border-color: rgba(255, 255, 255, .12); box-shadow: var(--shadow-lift); }
.card h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.card h3 { font-size: 17px; font-weight: 700; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.card-dark .muted { color: var(--on-black-muted); }
.small { font-size: 14px; line-height: 1.5; }
.center { text-align: center; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.row-actions .btn { flex: 1 1 auto; }
.sub-title { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.08; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.sub-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: var(--radius-m); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.sub-link-label { display: block; font-size: 12.5px; color: var(--on-black-muted); }
.sub-link-url { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.sub-link .btn { height: 44px; padding: 0 16px; gap: 8px; }
.sub-link .btn svg { width: 18px; height: 18px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--green-on-black); }
.status.warn { color: var(--warn); }
.status.off { color: var(--danger-status); }

/* Плитки цифр */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.facts.facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fact { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 16px; text-align: center; box-shadow: var(--shadow); min-width: 0; }
.fact b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; overflow-wrap: anywhere; }
.fact span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.meter { height: 6px; border-radius: 99px; background: var(--soft-2); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--text); border-radius: inherit; }

/* Плашка действия (как «Go premium») */
.cta-banner { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: var(--radius-l); background: url(/assets/contour.svg) center / cover no-repeat, linear-gradient(105deg, #2e2e33 0%, #141416 70%); border: 1px solid rgba(255, 255, 255, .12); color: var(--on-black); box-shadow: var(--shadow-lift); }
.cta-banner .tb-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.cta-banner .tb-ico svg { width: 20px; height: 20px; }
.cta-banner b { display: block; font-size: 16px; font-weight: 700; }
.cta-banner span.tb-text { display: block; font-size: 13.5px; color: var(--on-black-muted); margin-top: 2px; }
.cta-banner .btn { height: 42px; padding: 0 18px; font-size: 15px; box-shadow: none; }

/* Меню-список (как «Fotoğraflarım») */
.menu { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 6px; display: grid; }
.menu a, .menu button { display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px; align-items: center; gap: 14px; min-height: 60px; padding: 8px 14px; border-radius: 22px; text-align: left; font-size: 16px; font-weight: 600; }
.menu a + a, .menu a + button, .menu button + a { border-top: 1px solid var(--line); border-radius: 0; }
.menu a:hover, .menu button:hover { background: var(--soft); border-radius: 22px; }
.menu svg { width: 22px; height: 22px; }
.menu .chev { width: 18px; height: 18px; color: var(--muted); }

/* Подключение */
.seg { display: inline-flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 999px; }
.seg button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; font-size: 15px; padding: 0 16px 0 8px; border-radius: 999px; color: var(--muted); }
.seg button img { width: 28px; height: 28px; border-radius: 8px; }
.seg button[aria-pressed="true"] { background: var(--metal); color: var(--on-metal); box-shadow: var(--metal-edge); }
.steps-list { list-style: none; display: grid; gap: 10px; counter-reset: s; }
.steps-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px; background: var(--soft); border-radius: var(--radius-l); padding: 14px 14px 14px 16px; counter-increment: s; }
.steps-list li::before { content: counter(s); width: 44px; height: 44px; border-radius: 50%; background: var(--metal); color: var(--on-metal); display: grid; place-items: center; font-weight: 800; font-size: 17px; box-shadow: var(--metal-edge); }
.steps-list b { display: block; font-size: 16px; font-weight: 700; }
.steps-list span { font-size: 14px; color: var(--muted); }

/* Списки */
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; list-style: none; }
.item { min-width: 0; display: flex; align-items: center; gap: 14px; background: var(--soft); border-radius: 20px; padding: 12px 12px 12px 14px; }
.item-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--soft-2); display: grid; place-items: center; flex: none; overflow: hidden; }
.item-ico img { width: 100%; height: 100%; object-fit: cover; }
.item-ico svg { width: 20px; height: 20px; }
.item-body { flex: 1; min-width: 0; }
.item-body b { display: block; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-body b.clamp { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-body b.wrap-all { white-space: normal; overflow-wrap: anywhere; font-size: 14.5px; font-weight: 600; }
.item > b { flex: none; white-space: nowrap; }
.item-body span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.item a.item-body:hover b { text-decoration: underline; }
.item .item-body[href] { min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
.item-wrap { flex-wrap: wrap; }
.item-wrap .item-body b { white-space: normal; }
.empty { background: var(--soft); border-radius: var(--radius-l); padding: 22px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.5; }
.pill { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--green); }

/* Формы */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .field > span:first-child { font-size: 14px; font-weight: 600; }
.input { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--field-bg); border: 1.5px solid var(--field-line); border-radius: 18px; padding: 14px 16px; transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.input:hover { background: var(--field-hover); }
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); background: var(--field-bg); }
.input::placeholder { color: var(--muted); }
.input[aria-invalid="true"] { border-color: var(--danger); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--text); flex: none; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); padding: 4px; border-radius: 999px; }
.tabs a { display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; font-weight: 600; font-size: 15px; padding: 0 10px; border-radius: 999px; color: var(--muted); }
.tabs a[aria-current="page"] { background: var(--metal); color: var(--on-metal); box-shadow: var(--metal-edge); }
.app-tabs { display: none !important; }
.or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.alert { border-radius: 18px; padding: 14px 16px; font-size: 14px; line-height: 1.5; background: var(--soft); }
.alert.err { background: var(--err-bg); color: var(--err-text); }
.alert.ok { background: var(--green-bg); color: var(--green); }
.card-dark .alert { background: rgba(255, 255, 255, .08); color: var(--on-black); }
.card-dark .alert.err { background: rgba(255, 120, 120, .16); color: var(--err-text); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick button { min-height: 44px; font-weight: 600; font-size: 15px; padding: 0 18px; border-radius: 999px; background: var(--soft); }
.quick button:hover { background: var(--soft-2); }

/* Оформление и продление */
.summary { display: grid; gap: 12px; }
.summary .row span { color: var(--on-black-muted); }
.summary .total-row { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 14px; font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.periods-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.periods-pick legend { margin-bottom: 8px; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 18px; border-radius: var(--radius-m); background: rgba(255, 255, 255, .07); cursor: pointer; }
.pick span { flex: 1; font-weight: 600; }
.pick input { width: 20px; height: 20px; accent-color: var(--on-black); }
.pick:has(input:checked) { background: rgba(255, 255, 255, .16); }

/* Поддержка */
.thread { display: grid; gap: 10px; }
.msg { max-width: 80%; padding: 12px 16px; border-radius: 20px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; background: var(--soft); justify-self: start; }
.msg.me { background: var(--metal); color: var(--on-metal); justify-self: end; }
.msg time { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.msg-who { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.msg.me time, .msg.me .msg-who { color: var(--on-metal-soft); }

/* Документы */
.prose { font-size: 16px; line-height: 1.65; max-width: 72ch; }
.prose h1 { font-family: var(--font-display); font-size: 32px; letter-spacing: -.03em; line-height: 1.12; margin: 0 0 16px; }
.prose h2 { font-size: 21px; margin: 28px 0 10px; }
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* Загрузка и уведомления */
.loading { display: grid; place-items: center; min-height: 40vh; }
.loading-sm { min-height: 120px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: var(--field-bg); color: var(--text); border: 1px solid rgba(255, 255, 255, .14); padding: 14px 20px; border-radius: 999px; font-size: 15px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: var(--shadow-lift); transition: transform .35s var(--ease-out), opacity .25s var(--ease-out); z-index: 30; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* Нижняя навигация кабинета — плавающая тёмная пилюля, активный раздел — металлическая капсула */
.tabbar { display: none; }

/* Появление страницы кабинета */
@keyframes view-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.view-enter > .page { animation: view-enter .45s var(--ease-out) both; }

/* До загрузки скриптов лендинг виден только на главной; WhatsApp только на buy.r */
.route-app #landing { display: none; }
.no-wa [data-wa] { display: none !important; }


/* ---------- Планшет и телефон ---------- */
@media (max-width: 960px) {
  .links { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 18px; }
  .config, .plans { grid-template-columns: minmax(0, 1fr); }
  .plan { min-height: 0; }
  .total { position: static; }
  .bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    border-radius: 999px; padding: 8px 8px 8px 24px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .85);
    transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none;
    transition: transform .45s var(--ease-out), opacity .3s var(--ease-out); z-index: 10;
  }
  .bar.show { transform: none; opacity: 1; pointer-events: auto; }
  .bar b { display: block; font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
  .bar span { display: block; font-size: 13px; color: var(--on-black-muted); }
  .bar .btn { height: 48px; padding: 0 22px; font-size: 16px; box-shadow: none; }
  .route-app.has-tabbar .tabbar {
    display: flex; gap: 6px; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom));
    padding: 6px; border-radius: 999px; background: var(--tabbar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(255, 255, 255, .1); z-index: 20;
  }
  .tabbar a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 52px; height: 52px; padding: 0 15px; border-radius: 999px; color: var(--text); font-size: 15px; font-weight: 600; background: var(--tab); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); transition: background-color .2s var(--ease-out); }
  .tabbar a svg { width: 22px; height: 22px; flex: none; }
  .tabbar a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tabbar a[aria-current="page"] { background: var(--metal); color: var(--on-metal); box-shadow: var(--metal-edge); padding: 0 20px 0 16px; }
  .tabbar a[aria-current="page"] span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .route-app.has-tabbar footer { padding-bottom: 110px; }
}
@media (max-width: 760px) {
  .card { padding: 22px; border-radius: 28px; }
  .page-head h1 { font-size: 38px; }
  .steps-list li { grid-template-columns: 44px minmax(0, 1fr); }
  .steps-list li .btn { grid-column: 1 / -1; width: 100%; }
  .card-head .seg { width: 100%; }
  .card-head .seg button { flex: 1; justify-content: center; }
  .nav-balance { display: none; }
  .msg { max-width: 92%; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  body { background-size: auto, auto, 40px 40px, 40px 40px; }
  nav { padding: 16px 0 14px; }
  .wa-nav { width: 44px; padding: 0; }
  .wa-nav .wa-text { display: none; }
  .wa-nav .wa-ico { display: block; }
  .hero { padding: 6px 0 22px; }
  .panel { gap: 26px; }
  .plan { padding: 18px 18px 20px; border-radius: 28px; }
  .plan .p-price { font-size: 28px; margin-top: 10px; }
  .period { min-height: 96px; }
  .period b { font-size: 17px; }
  .period span { font-size: 13px; }
  .devices { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; }
  .stepper { justify-content: space-between; }
  .total { padding: 24px; border-radius: 28px; }
  .sum .big { font-size: 50px; }
  .label small { display: none; }
  .facts { gap: 8px; }
  .fact { padding: 16px 10px; }
  .fact b { font-size: 22px; }
  footer { flex-direction: column; gap: 4px; text-align: center; padding-bottom: 104px; }
  footer .f-links { justify-content: center; }
}
@media (max-width: 360px) {
  .wrap { padding: 0 12px; }
  .logo { font-size: 18px; gap: 8px; }
  .logo-mark { height: 24px; }
  .sub-link { padding-left: 14px; gap: 8px; }
  .sub-link .btn { padding: 0 14px; }
  .sub-link .btn svg { display: none; }
  .nav-right .btn-sm { padding: 0 12px; }
  nav { gap: 8px; }
  .nav-right { gap: 6px; }
  .btn-lg { white-space: normal; height: auto; min-height: 56px; padding: 14px 22px; text-align: center; }
  .trial-banner { grid-template-columns: minmax(0, 1fr) auto; }
  .trial-banner .tb-ico { display: none; }
  .total { padding: 20px; }
  .sum .big { font-size: 42px; }
  /* «6 месяцев» не помещается в капсулу: на экране «6 мес», для озвучки полное слово */
  .period { padding: 18px 4px 12px; }
  .period b { font-size: 17px; white-space: nowrap; }
  .period .pu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .period .pu-s { display: inline; }
  .tabbar a { min-width: 48px; height: 48px; }
  .video-card { padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .route-landing .hero-title { animation: none; }
  .plan:active, .period:active { transform: none; }
  .bar { transform: none; transition: opacity .2s linear; }
  .btn:active { transform: none; }
  .plan:hover:not(.on) { transform: none; }
  .view-enter > .page { animation: none; }
  .spinner { animation-duration: 2s; }
  .toast { transition: opacity .2s linear; transform: translate(-50%, 0); }
}

/* Меню кабинета: на всех ширинах */
.menu .item-ico { width: 40px; height: 40px; background: var(--soft); }
.menu .item-ico svg { width: 20px; height: 20px; }
.menu { grid-template-columns: minmax(0, 1fr); }
.menu a, .menu button { width: 100%; }

/* ---------- Кабинет: подключение, подтверждения, выбор в оформлении ---------- */
.lead-sm { margin-top: 8px; }
.lead-xs { margin-top: 6px; }
.self-center { justify-self: center; }
a.link.small { display: inline-flex; align-items: center; min-height: 44px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--muted); }
.back-link:hover { color: var(--text); }
.back-link svg { width: 18px; height: 18px; }
.page-head h1.h-ticket { font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.done-banner { display: grid; gap: 4px; }
.done-banner b { font-size: 16px; }
/* Встроенное подтверждение вместо системного окна: текст + два действия в той же строке */
.confirm { display: grid; gap: 12px; width: 100%; padding: 14px; border-radius: var(--radius-m); background: var(--soft-2); box-shadow: inset 0 0 0 1px var(--line); }
.confirm p { font-size: 15px; line-height: 1.45; }
.confirm .row-actions .btn { flex: 1 1 140px; }
.item .confirm { margin-top: 4px; }
/* Выбор тарифа прямо в оформлении */
.choice { display: grid; gap: 14px; }
.choice-seg { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 999px; background: var(--soft); }
.choice-seg button { min-height: 44px; padding: 0 8px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--muted); }
.choice-seg button:hover { color: var(--text); }
.choice-seg button[aria-checked="true"] { background: var(--soft-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.choice-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.choice-row .stepper { background: var(--soft-2); }
.choice-row .stepper button { width: 44px; height: 44px; background: var(--soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.choice-row .stepper button:hover:not([aria-disabled="true"]) { background: var(--soft-hover); }
.choice-row .stepper button[aria-disabled="true"]:hover { background: var(--soft); }
.choice-row .stepper .dev-count { min-width: 40px; font-size: 21px; }
.choice-label { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.steps-more { border-radius: var(--radius-l); background: var(--soft); }
.steps-more summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; font-weight: 600; cursor: pointer; list-style: none; }
.steps-more summary::-webkit-details-marker { display: none; }
.steps-more summary svg { width: 18px; height: 18px; color: var(--muted); transition: transform .2s var(--ease-out); transform: rotate(90deg); }
.steps-more[open] summary svg { transform: rotate(-90deg); }
.steps-more .steps-list { padding: 0 8px 8px; }
.steps-more .steps-list li { background: var(--soft-2); }
.in-tg.route-app footer { display: none; }
.in-tg.route-app.has-tabbar .wrap { padding-bottom: 110px; }

/* Документы: оглавление и таблицы */
.prose h2, .prose h3 { scroll-margin-top: 16px; }
.toc { margin: 0 0 20px; padding: 14px 18px; border-radius: var(--radius-m); background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); }
.toc summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.toc ol { margin: 4px 0 6px; padding-left: 22px; display: grid; gap: 2px; }
.toc a { display: inline-block; padding: 4px 0; text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--text); text-decoration: underline; }
.prose .table-wrap { overflow-x: auto; margin: 0 0 16px; border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose a { overflow-wrap: anywhere; }
.to-top { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
