/* ══════════════════════════════════════════════════════════════
   ORIONIX · Личный кабинет — редизайн (LK-02 → боевой)
   Палитра и фактура — 1:1 с лендингом (landing.css) и демо
   orionix-redesign-demo.html: pill-кнопки, синие уголки,
   Unbounded + Inter (self-hosted), светлая тема по умолчанию.
   Единственный CSS кабинета — base.css/layout-cabinet.css
   больше не подключаются.
   ══════════════════════════════════════════════════════════════ */

:root {
  --accent:      #2aabee;
  --accent-deep: #4dbdf5;
  --accent-dim:  rgba(42,171,238,.13);
  --accent-mid:  rgba(42,171,238,.34);
  --bg:     #0b1117;
  --panel:  #141d26;
  --card:   #1d2937;
  --ink:    #f2f6fa;
  --muted:  #a7b4c1;
  --faint:  #74828f;
  --line:   rgba(255,255,255,.10);
  --line-soft: rgba(255,255,255,.05);
  --band:   #0e151d;
  --shadow: 0 18px 45px rgba(0,0,0,.45);
  --shadow-soft: 0 7px 20px rgba(0,0,0,.28);
  --ok:     #34c98e;
  --warn:   #e8a33d;
  --err:    #e5484d;
  --font-d: Unbounded, Inter, sans-serif;
  /* Легаси-алиасы: инлайн-стили модалок/баннеров и twa.js
     ссылаются на старые имена переменных. */
  --tx:     var(--ink);
  --tx-d:   var(--muted);
  --border: var(--line);
  --red:    var(--err);
  --green:  var(--ok);
  --font:   Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  color-scheme: dark;
}
html[data-theme="light"] {
  --accent-deep: #1183c4;
  --accent-dim:  rgba(42,171,238,.10);
  --bg:     #d9dfe7;
  --panel:  #f4f6f9;
  --card:   #ffffff;
  --ink:    #101720;
  --muted:  #4b5663;
  --faint:  #6e7a87;
  --line:   rgba(16,23,32,.12);
  --line-soft: rgba(16,23,32,.06);
  --band:   #e7ecf2;
  --shadow: 0 18px 45px rgba(16,23,32,.12);
  --shadow-soft: 0 7px 20px rgba(16,23,32,.06);
  --ok:     #169a68;
  --warn:   #b97a17;
  --err:    #d13438;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
/* место под полосу прокрутки бронируется всегда — иначе контент
   прыгает на 17px между длинными и короткими страницами */
html { scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* числа во всех метриках — табличные цифры Inter */
.num { font-variant-numeric: tabular-nums; }

/* появление блоков — как хореография hero лендинга */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ── Переходы между страницами ЛК (анти-фликер) ──
   Кросс-документные view transitions: вместо белой вспышки при
   полной перезагрузке — короткое перекрёстное растворение.
   Сайдбар и мобильная шапка получают собственные снапшоты и
   визуально стоят на месте. Firefox правило игнорирует —
   там остаётся обычный переход. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
.sidebar { view-transition-name: cab-sidebar; }
.topbar  { view-transition-name: cab-topbar; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
/* при переходе между страницами кабинета (класс ставит инлайн-скрипт
   в <head>) входную хореографию контента заново не проигрываем */
html.nav-internal .col > * { animation: none; }

/* ── PILL-КНОПКИ (лендинг) ── */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 24px; border-radius: 999px; border: 0;
  background: var(--accent); color: #06121b;
  font-size: 14.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 20px rgba(42,171,238,.35);
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s cubic-bezier(.22,1,.36,1);
}
.pill:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 28px rgba(42,171,238,.5); }
html[data-theme="light"] .pill { color: #fff; }
.pill.line {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); box-shadow: none;
}
/* специфичнее, чем html[data-theme="light"] .pill — иначе текст line-кнопки белеет */
html[data-theme="light"] .pill.line { color: var(--ink); }
.pill.line:hover { border-color: var(--accent-mid); box-shadow: none; transform: translateY(-1px); }
.pill.lg { min-height: 50px; padding: 0 30px; font-size: 15.5px; }
.pill.sm { min-height: 36px; padding: 0 16px; font-size: 13px; }
.pill:disabled { opacity: .55; cursor: default; transform: none; }

/* ── МИКРОТИПОГРАФИКА ── */
.eyebrow {
  color: var(--faint);
  font-size: 11.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
}
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--accent-dim);
  color: var(--accent-deep); font-size: 12px; font-weight: 500; letter-spacing: .04em;
  white-space: nowrap; /* бейдж всегда в одну строку */
}
.chip.ok   { color: var(--ok);   background: color-mix(in srgb, var(--ok) 10%, transparent);   border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.chip.err  { color: var(--err);  background: color-mix(in srgb, var(--err) 10%, transparent);  border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.chip.mut  { color: var(--faint); background: var(--band); border-color: var(--line); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-mid); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* синие уголки-штрихи (фирменный знак hero лендинга) */
.hc { position: absolute; width: 18px; height: 18px; z-index: 2; pointer-events: none; border: 0 solid var(--accent); }
.hc.tl { top: 14px; left: 14px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 4px; }
.hc.tr { top: 14px; right: 14px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 4px; }
.hc.bl { bottom: 14px; left: 14px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 4px; }
.hc.br { bottom: 14px; right: 14px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 4px; }

.brand {
  font-family: var(--font-d);
  font-weight: 400; font-size: 15px; letter-spacing: .06em; line-height: 1;
}
.brand em { font-style: normal; color: var(--accent); }

.ti-sun, .ti-moon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="light"] .ti-sun { display: none; }
html[data-theme="dark"]  .ti-moon { display: none; }
html:not([data-theme="dark"]) .ti-moon { display: block; }
html:not([data-theme="dark"]) .ti-sun { display: none; }

/* ── САЙДБАР ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  width: 284px; display: flex; flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 0 20px;
  transition: transform .32s cubic-bezier(.22,1,.36,1);
}
.sb-brand {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; border-bottom: 1px solid var(--line);
}
.sb-brand .brand { font-size: 16px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; padding: 16px 0; overflow-y: auto; }
.sb-label {
  margin: 13px 14px 5px; color: var(--faint);
  font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
}
.sb-nav > .sb-label:first-child { margin-top: 0; }
.sb-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 11px;
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer; text-align: left;
  transition: background .2s ease, color .2s ease;
}
.sb-item:hover { background: var(--line-soft); color: var(--ink); }
.sb-item.active { background: var(--accent-dim); color: var(--accent-deep); }
.sb-item svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* невысокие экраны ноутбуков: ещё плотнее, чтобы навигация влезала без скролла */
@media (max-height: 820px) {
  .sb-nav { padding: 12px 0; }
  .sb-item { min-height: 36px; font-size: 13.5px; border-radius: 10px; }
  .sb-label { margin: 10px 14px 4px; }
}
.sb-spacer { flex: 1; }

/* ── Пользовательский блок внизу сайдбара: аватар + имя + email,
     клик открывает меню (тема / профиль / выход) над кнопкой ── */
.sb-user { position: relative; border-top: 1px solid var(--line); padding: 12px 0 14px; }
.sb-user-btn {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 13px;
  background: transparent; cursor: pointer; text-align: left;
  font-family: inherit;
  transition: background .2s ease;
}
.sb-user-btn:hover { background: var(--line-soft); }
.sb-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--accent-dim); border: 1px solid var(--accent-mid);
  color: var(--accent-deep);
  font-family: var(--font-d); font-size: 14.5px;
}
.sb-user-i { flex: 1; min-width: 0; }
.sb-user-name { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-mail { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-btn > svg {
  width: 15px; height: 15px; flex: 0 0 auto; color: var(--faint);
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s ease;
}
.sb-user.open .sb-user-btn > svg { transform: rotate(180deg); }
.sb-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 45;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
  animation: rise .22s cubic-bezier(.22,1,.36,1) backwards;
}
.sb-menu[hidden] { display: none; }
.sb-menu-item {
  display: flex; align-items: center; gap: 11px;
  min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left; text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.sb-menu-item:hover { background: var(--band); color: var(--ink); }
.sb-menu-item svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sb-menu-item.danger { color: var(--err); }
.sb-menu-item.danger:hover { background: color-mix(in srgb, var(--err) 9%, transparent); color: var(--err); }

/* ── МОБИЛЬНАЯ ШАПКА ── */
.topbar {
  display: none; position: sticky; top: 0; z-index: 30;
  min-height: 56px; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 18px; border-bottom: 1px solid var(--line);
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.topbar-date { margin-left: auto; color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.burger {
  width: 40px; height: 40px; padding: 0; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); cursor: pointer;
  display: grid; align-content: center; justify-items: center; row-gap: 4px;
}
.burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 35;
  background: rgba(6,12,18,.55); backdrop-filter: blur(3px);
}

/* ── КОНТЕНТ ── */
/* .content — контейнер для container queries: сайдбар съедает фиксированные
   284px, поэтому раскладки страниц решаются по реальной ширине контента,
   а не по ширине окна (боль средних брейкпоинтов 1024–1600) */
.content { margin-left: 284px; padding: 40px 48px 80px; container: page / inline-size; }
.col { max-width: 1200px; margin: 0 auto; }
/* широкая колонна «картных» страниц (решение 2026-08-20): десктоп-ориентир 1920,
   дашборд-страницы не зажимаются в 1200; лонгриды остаются на .col */
.col--wide { max-width: 1660px; }
.col > * { animation: rise .6s cubic-bezier(.22,1,.36,1) backwards; }
.col > :nth-child(1) { animation-delay: .04s; }
.col > :nth-child(2) { animation-delay: .1s; }
.col > :nth-child(3) { animation-delay: .16s; }
.col > :nth-child(4) { animation-delay: .22s; }

.page-head { margin-bottom: 30px; }
.page-title {
  margin: 0;
  font-family: var(--font-d);
  font-size: clamp(22px, 2.6vw, 30px); font-weight: 400; letter-spacing: -.01em;
  line-height: 1.15;
}
.page-title em { font-style: normal; color: var(--accent-deep); }
.page-sub { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }

/* ── БАННЕРЫ (email / Telegram) — скрыты, пока JS не поставит .show ── */
.tg-bind-compact {
  display: none; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; margin-bottom: 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-soft);
}
.tg-bind-compact.show { display: flex; }
.tg-bind-icon {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-dim);
}
.tg-bind-icon svg { width: 20px; height: 20px; }
.tg-bind-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.tg-bind-text b { font-size: 14.5px; font-weight: 500; }
.tg-bind-text span { font-size: 13px; color: var(--muted); }
.tg-bind-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--accent); color: #06121b;
  font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 20px rgba(42,171,238,.35);
  transition: transform .18s cubic-bezier(.22,1,.36,1);
}
.tg-bind-btn:hover { transform: translateY(-1px); }
.tg-bind-btn:disabled { opacity: .55; cursor: default; transform: none; }
html[data-theme="light"] .tg-bind-btn { color: #fff; }
.tg-bind-msg { width: 100%; font-size: 12.5px; }
.tg-bind-msg:empty { display: none; }

/* ── КАРТОЧКИ ── */
.card {
  position: relative; /* якорь для уголков .hc и абсолютных декоров */
  background: var(--card);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
}
.card-pad { padding: 28px 32px; }

/* ── HERO: прибыль ── */
.hero-card { position: relative; overflow: hidden; }
.hero-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 90% at 85% 0%, var(--accent-dim), transparent 60%);
}
.hero-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero-total {
  margin: 14px 0 4px;
  font-family: var(--font-d); font-weight: 400;
  font-size: clamp(38px, 5vw, 56px); line-height: 1.05; letter-spacing: -.01em;
}
.hero-total .cents { font-size: .45em; color: var(--muted); }
.hero-total .ccy { font-size: .38em; color: var(--faint); letter-spacing: .04em; margin-right: 6px; }
.hero-live { display: inline-flex; align-items: center; gap: 9px; color: var(--faint); font-size: 13px; margin-top: 10px; }
.ccy-switch {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--band); border: 1px solid var(--line-soft); border-radius: 999px;
}
.ccy-btn {
  min-height: 32px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 500;
}
.ccy-btn.active { background: var(--accent); color: #06121b; }
html[data-theme="light"] .ccy-btn.active { color: #fff; }
.hero-metrics {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin-top: 26px; border-top: 1px solid var(--line);
}
.hero-metric { padding: 18px 0 2px; }
.hero-metric + .hero-metric { border-left: 1px solid var(--line); padding-left: 28px; }
.hero-metric .v { font-size: 24px; margin-top: 6px; }
.hero-metric .v .cents { font-size: .6em; color: var(--muted); }
.hero-metric .v .ccy { font-size: .7em; color: var(--faint); }

/* деньги: копейки и значок валюты чуть приглушены везде */
.cents { color: var(--muted); }
.ccy { color: var(--faint); }

/* ── СЕКЦИИ ── */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: 34px 0 18px;
}
.section-title {
  margin: 0; font-family: var(--font-d); font-weight: 400;
  font-size: 19px; letter-spacing: .01em;
}
.section-count { color: var(--faint); font-size: 13.5px; }

/* ── ДОГОВОР ── */
.contract { overflow: hidden; }
.ct-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 24px 32px 0;
}
/* блок «название + мета» сжимается (мета переносится), чтобы сумма со
   статусом не выпадали на новую строку раньше времени */
.ct-head > .ct-icon + div { flex: 1 1 240px; min-width: 0; }
.ct-icon {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent-dim);
}
.ct-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-deep); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ct-title { font-size: 17.5px; font-weight: 500; }
.ct-meta { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.ct-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ct-sum { text-align: right; }
.ct-sum .v { font-size: 19px; }
.ct-sum .l { color: var(--faint); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }
.ct-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 22px 32px 0; border-top: 1px solid var(--line);
}
.ct-metric { padding: 16px 0 0; }
.ct-metric + .ct-metric { border-left: 1px solid var(--line); padding-left: 24px; }
.ct-metric .v { font-size: 20px; margin-top: 5px; }
.ct-metric .v .cents { font-size: .62em; }
.ct-metric .d { font-size: 12px; color: var(--ok); margin-top: 2px; }
.ct-metric .p { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.ct-metric .p:empty { display: none; }
.ct-next {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 22px 32px 0; padding: 15px 20px;
  background: var(--accent-dim); border: 1px solid var(--line-soft); border-radius: 14px;
}
.ct-next svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: var(--accent-deep); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ct-next-info { flex: 1; min-width: 200px; }
.ct-next .l { color: var(--faint); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }
.ct-next .v { font-size: 14.5px; font-weight: 500; margin-top: 1px; }
.ct-next .v span { color: var(--muted); font-weight: 400; }
.ct-next-amt { font-size: 19px; }
.ct-progress { margin: 20px 32px 0; }
.ct-progress .l { display: flex; justify-content: space-between; color: var(--faint); font-size: 12.5px; margin-bottom: 8px; }
.ct-bar { height: 6px; border-radius: 999px; background: var(--band); overflow: hidden; }
.ct-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); }
.ct-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 18px 32px 22px; margin-top: 22px;
  border-top: 1px solid var(--line);
}
.ct-link {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 0; cursor: pointer;
  color: var(--accent-deep); font-size: 13.5px; font-weight: 500;
}
.ct-link:hover { text-decoration: underline; }
.ct-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s ease; }
.ct-link.open svg { transform: rotate(180deg); }

/* график и история выплат (раскрывашка) */
.payout-panel { display: none; margin: 0 32px; padding: 4px 0 22px; }
.payout-panel.open { display: block; }
.payout-h { color: var(--faint); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; margin: 16px 0 4px; }
.pay-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.pay-row::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.pay-row.done::before { background: var(--ok); }
.pay-row.next::before { background: var(--accent); }
.pay-row .d { color: var(--muted); min-width: 96px; }
.pay-row .n { flex: 1; min-width: 0; }
.pay-row .n small { display: block; color: var(--faint); font-size: 12px; }
.pay-row .s { margin-left: auto; white-space: nowrap; }
.pay-row .s.muted { color: var(--faint); font-size: 12.5px; }
.pay-row .st { color: var(--faint); font-size: 12.5px; min-width: 86px; text-align: right; }
.pay-row .st.ok { color: var(--ok); }
.payout-empty { color: var(--faint); font-size: 13.5px; padding: 12px 0; }

.contracts-empty { padding: 34px 32px; text-align: center; }
.contracts-empty-title { font-family: var(--font-d); font-size: 17px; margin-bottom: 8px; }
.contracts-empty-text { color: var(--muted); font-size: 14px; }

/* ── КАЛЬКУЛЯТОР ── */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 40px; }
.calc-field { margin-bottom: 22px; }
.calc-field > label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  color: var(--faint); font-size: 11.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
}
.calc-help {
  position: relative; width: 17px; height: 17px; border-radius: 50%; cursor: help;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); color: var(--faint); font-size: 11px; letter-spacing: 0;
}
.calc-help .tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: 250px; padding: 11px 14px; border-radius: 12px; z-index: 5;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--muted); font-size: 12.5px; line-height: 1.45; text-transform: none; letter-spacing: 0;
  opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.calc-help:hover .tip, .calc-help:focus .tip { opacity: 1; visibility: visible; }
.calc-input {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--band);
  padding: 6px;
}
.calc-step {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 19px; line-height: 1;
}
.calc-step:hover { border-color: var(--accent-mid); }
.calc-input input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 19px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.calc-input input:focus { outline: none; }
.calc-input .u { color: var(--faint); font-size: 13px; letter-spacing: .06em; padding-right: 10px; }
.seg { display: flex; gap: 6px; padding: 5px; background: var(--band); border: 1px solid var(--line-soft); border-radius: 999px; }
.seg button {
  flex: 1; min-height: 40px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: background .2s ease, color .2s ease;
}
.seg button.active { background: var(--accent); color: #06121b; box-shadow: 0 4px 14px rgba(42,171,238,.3); }
html[data-theme="light"] .seg button.active { color: #fff; }
.term-row { display: flex; align-items: center; gap: 18px; }
.term-row input[type="range"] { flex: 1; accent-color: var(--accent); height: 4px; cursor: pointer; }
.term-val { min-width: 64px; text-align: right; font-size: 15px; color: var(--ink); }
.calc-out { display: flex; flex-direction: column; }
.calc-result {
  position: relative; flex: 1;
  padding: 26px 28px; border-radius: 16px;
  background: var(--band); border: 1px solid var(--line-soft);
}
.calc-result .l { color: var(--faint); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.calc-result .v {
  margin-top: 10px;
  font-family: var(--font-d); font-weight: 400;
  font-size: clamp(30px, 3.4vw, 40px); line-height: 1.05;
}
.calc-result .meta { margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.calc-result-note { color: var(--muted); font-size: 14px; padding: 8px 0; }
.calc-permonth {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 14px; padding: 16px 22px;
  border: 1px solid var(--line); border-radius: 14px;
}
.calc-permonth .v { font-size: 21px; }
.calc-permonth .u { color: var(--muted); font-size: 13.5px; }
.calc-cta { margin-top: 16px; width: 100%; }
.calc-cta svg { width: 17px; height: 17px; fill: currentColor; }

/* ── ПАРТНЁРКА / ПОДДЕРЖКА ── */
.partner-flex { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.partner-icon {
  width: 52px; height: 52px; flex: 0 0 auto; border-radius: 15px;
  display: grid; place-items: center; background: var(--accent-dim);
}
.partner-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent-deep); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.partner-body { flex: 1; min-width: 240px; }
.partner-title { margin: 0; font-family: var(--font-d); font-weight: 400; font-size: 17px; }
.partner-desc { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 56ch; }
.support-card { position: relative; text-align: center; padding: 40px 32px 38px; overflow: hidden; }
.support-card .partner-icon { margin: 0 auto 16px; }
.support-phone {
  display: inline-block; margin: 14px 0 4px;
  font-family: var(--font-d); font-weight: 400; font-size: 23px; letter-spacing: .02em;
}
.support-phone:hover { color: var(--accent-deep); }
.support-note { color: var(--faint); font-size: 13px; margin-bottom: 20px; }

/* ── МОДАЛКИ (структура и классы — как в живом ЛК: twa.js и
     cabinet.js завязаны на эти имена) ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(6,12,18,.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  width: min(440px, 100%); max-height: 90vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow);
  animation: rise .35s cubic-bezier(.22,1,.36,1) backwards;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px; border-bottom: 1px solid var(--line);
}
.modal-title { margin: 0; font-family: var(--font-d); font-weight: 400; font-size: 17px; }
.modal-close {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-size: 17px; line-height: 1; display: grid; place-items: center; padding: 0;
}
.modal-body { padding: 24px 28px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 28px 24px; border-top: 1px solid var(--line);
}
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
.form-group > label {
  display: block; margin-bottom: 8px;
  color: var(--faint); font-size: 11.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
}
.form-input {
  width: 100%; min-height: 48px; padding: 0 16px;
  background: var(--band); color: var(--ink);
  border: 1px solid var(--line); border-radius: 13px;
  font: inherit; font-size: 15.5px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea.form-input { padding: 12px 16px; }
.form-input::placeholder { color: var(--faint); }
.form-input:focus { outline: none; border-color: var(--accent-mid); box-shadow: 0 0 0 3px var(--accent-dim); }
select.form-input { appearance: auto; }

/* кнопки модалок — на классах старого ЛК */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 22px; border-radius: 999px; border: 0;
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s ease, border-color .2s ease;
}
.btn-primary {
  background: var(--accent); color: #06121b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 20px rgba(42,171,238,.35);
}
html[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: default; transform: none; }
.btn-secondary {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--accent-mid); }

/* ── ТОСТ ── */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(12px);
  z-index: 200; max-width: min(420px, calc(100vw - 40px));
  padding: 13px 22px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--ink); font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.toast.error   { border-color: color-mix(in srgb, var(--err) 45%, transparent); }

/* ── ГЛОБАЛЬНЫЙ ЛОАДЕР ── */
#globalLoader {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-items: center;
  background: var(--bg);
}
#globalLoader .loader {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── СКЕЛЕТОНЫ (пока грузятся данные) ── */
.skel-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-soft); padding: 28px 32px; margin-bottom: 22px;
}
.skel { position: relative; overflow: hidden; background: var(--band); border-radius: 8px; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--line-soft), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skel-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.skel-bar { height: 14px; }
.skel-bar-sm { height: 10px; width: 40%; }
.skel-bar-md { height: 16px; width: 70%; }
.skel-bar-lg { height: 38px; width: 130px; }
.skel-metrics { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.skel-metric { flex: 1; min-width: 110px; display: flex; flex-direction: column; gap: 8px; }

/* ── АДАПТИВ ── */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .sidebar-overlay.show { display: block; }
  .topbar { display: flex; }
  .content { margin-left: 0; padding: 26px 18px 60px; }
  .calc-grid { grid-template-columns: 1fr; gap: 8px; }
  .card-pad { padding: 22px 20px; }
  .ct-head { padding: 20px 20px 0; }
  .ct-metrics, .ct-next, .ct-progress, .payout-panel { margin-left: 20px; margin-right: 20px; }
  .ct-foot { padding: 16px 20px 20px; }
  .hero-total { font-size: clamp(34px, 9vw, 44px); }
}
@media (max-width: 560px) {
  .ct-metrics { grid-template-columns: 1fr; }
  .ct-metric { padding: 14px 0; }
  .ct-metric + .ct-metric { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .hero-metrics { grid-template-columns: 1fr; }
  .hero-metric + .hero-metric { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; margin-top: 6px; }
  .ct-right { margin-left: 0; }
  .pay-row .d { min-width: 78px; }
  .pay-row .st { display: none; }
}

/* ── Средняя ширина контента (узкий контент при видимом сайдбаре и
     планшеты): решаем по реальной ширине контента, а не окна ── */
@container page (max-width: 760px) {
  .calc-grid { grid-template-columns: 1fr; gap: 8px; }
  /* сумма и статус договора — отдельной ровной строкой под названием,
     а не «криво» после переноса flex-строки */
  .ct-right { flex-basis: 100%; margin-left: 0; justify-content: space-between; }
  .ct-sum { text-align: left; }
}

/* ══════════════ ВХОД / РЕГИСТРАЦИЯ (login.html, register.html) ══════════════ */
.page-auth { display: flex; flex-direction: column; min-height: 100vh; }
.auth-header {
  min-height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--line);
}
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.auth-stage {
  flex: 1; display: grid; place-items: center; padding: 48px 20px 64px;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, var(--accent-dim), transparent 70%),
    var(--bg);
}
.auth-card {
  position: relative;
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 40px 40px 36px;
  animation: rise .6s cubic-bezier(.22,1,.36,1) backwards;
}
.auth-brand { text-align: center; font-size: 21px; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14.5px; margin: 0 0 28px; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 26px;
  background: var(--band); border: 1px solid var(--line-soft); border-radius: 999px;
}
.auth-tab {
  min-height: 38px; border: 0; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 500;
  transition: color .2s ease, background .2s ease;
}
.auth-tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-soft); }
.auth-form .pill, .auth-card .pill.wide { width: 100%; margin-top: 6px; }
.tg-btn {
  width: 100%; min-height: 48px; margin-bottom: 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: border-color .2s ease, transform .18s cubic-bezier(.22,1,.36,1);
}
.tg-btn:hover { border-color: var(--accent-mid); transform: translateY(-1px); }
.tg-btn:disabled { opacity: .55; cursor: default; transform: none; }
.tg-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.auth-or {
  display: flex; align-items: center; gap: 14px; margin: 0 0 20px;
  color: var(--faint); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-links { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--muted); }
.auth-links a { color: var(--accent-deep); cursor: pointer; }
.auth-links a:hover { text-decoration: underline; }
.auth-error { color: var(--err); font-size: 12.5px; text-align: center; margin-top: 10px; min-height: 18px; }
.auth-status { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 10px; min-height: 18px; }
.spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 1.5px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .65s linear infinite;
  vertical-align: middle; margin-right: 7px;
}
.dev-trigger {
  position: fixed; bottom: 14px; right: 16px;
  color: color-mix(in srgb, var(--faint) 30%, transparent);
  font-size: 11px; cursor: default; user-select: none;
}
/* плавный уход страницы при переходе (как на лендинге, LAND-03) */
html.page-leave body { opacity: 0; transition: opacity .22s ease; }
@media (prefers-reduced-motion: reduce) { html.page-leave body { opacity: 1; transition: none; } }
@media (max-width: 560px) {
  .auth-card { padding: 30px 22px 28px; }
  .auth-stage { padding: 28px 14px 44px; }
}
