/* ── 1code — кабинет (server-rendered). Тёмная тема в эстетике Linear/Vercel/Cursor.
   Перенос из прежнего Next.js globals.css; адаптивная вёрстка без внешних зависимостей. ── */
:root {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.178 0 0);
  --muted: oklch(0.22 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --border: oklch(0.27 0 0);
  --input: oklch(0.27 0 0);
  --primary: oklch(0.604 0.216 258);
  --primary-foreground: oklch(0.985 0 0);
  /* Заливка под белым текстом (кнопки, активный сегмент): --primary даёт 3.8:1, это 5.0:1 (WCAG AA ≥ 4.5) */
  --primary-strong: oklch(0.546 0.245 263);
  --accent: oklch(0.24 0.02 258);
  --destructive: oklch(0.68 0.2 27);   /* мелкий текст ошибок: 6:1 на карточке (было 3.9) */
  --success: oklch(0.7 0.17 150);
  --ring: oklch(0.604 0.216 258);
  --radius: 0.625rem;
  --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", monospace;
  /* Нативные контролы (список опций <select>, скроллбары, автозаполнение) рисуются тёмными */
  color-scheme: dark;
}

* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; padding: 0; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--primary); }
a.link:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--font-mono); }
code { color: var(--foreground); }
h1, h2, h3 { margin: 0; font-weight: 600; }

.grid-bg {
  background-image:
    linear-gradient(to right, oklch(1 0 0 / 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(1 0 0 / 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* ── Каркас кабинета ─────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 15rem; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: color-mix(in oklch, var(--card) 40%, transparent);
  padding: 1rem;
}
.brand {
  display: flex; align-items: center; gap: .5rem; padding: 0 .5rem 0 .5rem;
  margin-bottom: 1.5rem; font-family: var(--font-mono); font-weight: 600;
}
.brand svg { color: var(--primary); }
.brand-logo { display: block; height: 1.75rem; width: auto; }
.auth-header .brand-logo { height: 2rem; }
.nav { display: flex; flex-direction: column; gap: .25rem; }
.nav a {
  display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem;
  border-radius: var(--radius); color: var(--muted-foreground); transition: background .15s, color .15s;
}
.nav a:hover { background: var(--accent); color: var(--foreground); }
.nav a.active { background: var(--accent); color: var(--foreground); }

.content { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 3.5rem; border-bottom: 1px solid var(--border); padding: 0 1.5rem; gap: 1rem;
}
.topbar h1 { font-size: .875rem; }
.main { flex: 1; min-width: 0; padding: 1.5rem; }   /* min-width:0 — широкая таблица не раздувает колонку шире экрана */
.main.narrow { max-width: 56rem; }

.menu-btn {
  display: none; align-items: center; justify-content: center;
  height: 2.25rem; width: 2.25rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: transparent; color: var(--foreground); cursor: pointer;
}
.scrim { display: none; }

@media (max-width: 768px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%);
    transition: transform .2s ease; background: var(--card);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .scrim.show { display: block; position: fixed; inset: 0; z-index: 40; background: oklch(0 0 0 / .5); }
}

/* ── Профиль-меню ────────────────────────────────────────────────────────── */
.profile { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: .5rem; padding: .375rem .625rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: transparent;
  color: var(--foreground); cursor: pointer; font-size: .875rem; transition: background .15s;
}
.profile-btn:hover, .profile-btn.open { background: var(--accent); }
.avatar {
  display: flex; height: 1.5rem; width: 1.5rem; align-items: center; justify-content: center;
  border-radius: 9999px; background: color-mix(in oklch, var(--primary) 15%, transparent); color: var(--primary);
}
.profile-email { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .profile-email { display: none; } }
.profile-menu {
  position: absolute; right: 0; z-index: 50; margin-top: .5rem; width: 15rem; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  box-shadow: 0 10px 30px oklch(0 0 0 / .5); display: none;
}
.profile-menu.open { display: block; }
.profile-menu .head { border-bottom: 1px solid var(--border); padding: .75rem 1rem; }
.profile-menu .items { padding: .25rem; }
.profile-menu .items a, .profile-menu .items button {
  display: flex; width: 100%; align-items: center; gap: .5rem; padding: .5rem .75rem;
  border: none; background: transparent; border-radius: var(--radius); color: var(--muted-foreground);
  font-size: .875rem; cursor: pointer; transition: background .15s, color .15s;
}
.profile-menu .items a:hover { background: var(--accent); color: var(--foreground); }
.profile-menu .items .danger { color: var(--destructive); }
.profile-menu .items .danger:hover { background: color-mix(in oklch, var(--destructive) 10%, transparent); }

/* ── Карточки ─────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  box-shadow: 0 1px 2px oklch(0 0 0 / .2);
}
.card-head { display: flex; flex-direction: column; gap: .25rem; padding: 1.25rem; }
.card-head.between { flex-direction: row; align-items: center; justify-content: space-between; }
.card-title { font-size: .875rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.card-title svg { color: var(--primary); }
.card-body { padding: 0 1.25rem 1.25rem; }
.card-body.flush { padding: 0; }
.card > .card-body:first-child { padding-top: 1.25rem; } /* карточка без заголовка: содержимое не липнет к верхней рамке */

/* ── Кнопки ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.25rem; padding: 0 1rem; border-radius: var(--radius); border: 1px solid transparent;
  font-size: .875rem; font-weight: 500; cursor: pointer; transition: background .15s, opacity .15s, color .15s;
  background: var(--primary-strong); color: var(--primary-foreground);
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.btn.outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn.outline:hover { background: var(--accent); opacity: 1; }
.btn.ghost { background: transparent; color: var(--foreground); }
.btn.ghost:hover { background: var(--accent); }
.btn.sm { height: 2rem; padding: 0 .75rem; }
.btn.xs { height: 1.75rem; padding: 0 .625rem; font-size: .8125rem; }
.btn svg { height: 1rem; width: 1rem; }

/* ── Бейджи ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; border-radius: 9999px; padding: .125rem .625rem;
  font-size: .75rem; font-weight: 500; background: var(--muted); color: var(--muted-foreground);
}
.badge.success { background: color-mix(in oklch, var(--success) 15%, transparent); color: var(--success); }
.badge.primary { background: color-mix(in oklch, var(--primary) 15%, transparent); color: var(--primary); }
.badge.destructive { background: color-mix(in oklch, var(--destructive) 15%, transparent); color: var(--destructive); }

/* ── Плашка-уведомление ───────────────────────────────────────────────────── */
.banner {
  display: flex; align-items: flex-start; gap: .625rem;
  border-radius: var(--radius); padding: .875rem 1rem;
  border: 1px solid var(--border); background: var(--muted); color: var(--foreground);
  font-size: .875rem; line-height: 1.35;
}
.banner .banner-icon { flex: 0 0 auto; margin-top: .05rem; }
.banner.success {
  border-color: color-mix(in oklch, var(--success) 45%, transparent);
  background: color-mix(in oklch, var(--success) 12%, transparent);
}
.banner.success .banner-icon { color: var(--success); }
.banner.warn {
  border-color: color-mix(in oklch, oklch(0.78 0.15 75) 55%, transparent);
  background: color-mix(in oklch, oklch(0.78 0.15 75) 12%, transparent);
}
.banner.warn .banner-icon { color: oklch(0.72 0.16 65); }
.banner strong { font-weight: 600; }
@keyframes banner-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.banner { animation: banner-in .2s ease-out; }

/* ── Поля ввода ───────────────────────────────────────────────────────────── */
.field, textarea.field {
  width: 100%; border: 1px solid var(--input); background: transparent; color: var(--foreground);
  border-radius: var(--radius); padding: 0 .75rem; height: 2.25rem; font-size: .875rem; outline: none;
}
textarea.field { height: 6rem; padding: .75rem; resize: vertical; font-family: inherit; }
.field:focus { outline: 2px solid var(--ring); outline-offset: -1px; }
.field[aria-invalid="true"] { border-color: var(--destructive); }
.field[aria-invalid="true"]:focus { outline-color: var(--destructive); }
.field::placeholder { color: var(--muted-foreground); }
/* Список <option> в некоторых движках не наследует тему контрола — задаём явно */
select.field option, select.field optgroup { background: var(--card); color: var(--foreground); }

/* ── Переключатели (мгновенное сохранение) ────────────────────────────────── */
.switch-row { display: flex; align-items: flex-start; gap: .75rem; }
.switch-row .switch-label { flex: 1; font-size: .875rem; cursor: pointer; }
.switch {
  position: relative; flex: none; display: inline-block; width: 2.5rem; height: 1.375rem; margin-top: .0625rem;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--muted);
  border: 1px solid var(--border); transition: background .15s, border-color .15s;
}
.switch .track::before {
  content: ""; position: absolute; top: 50%; left: .1875rem; width: 1rem; height: 1rem;
  border-radius: 50%; background: var(--foreground); transform: translateY(-50%); transition: transform .15s;
}
.switch input:checked + .track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .track::before { transform: translate(1.125rem, -50%); }
.switch input:focus-visible + .track { outline: 2px solid var(--ring); outline-offset: 2px; }
.switch input:disabled { cursor: default; }
.switch input:disabled + .track { opacity: .5; }

/* ── Radio-карточки: выбор одного из N режимов с описанием (мгновенное сохранение) ── */
.choice-group { display: flex; flex-direction: column; gap: .5rem; }
.choice {
  position: relative; display: block; padding: .625rem .875rem;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.choice:hover { background: var(--accent); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .choice-title { display: flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 600; }
.choice .choice-title::before {
  content: ""; flex: none; width: .875rem; height: .875rem; border-radius: 9999px;
  border: 1px solid var(--muted-foreground); transition: border-color .15s, box-shadow .15s;
}
.choice .choice-desc { display: block; margin: .375rem 0 0 1.375rem; font-size: .75rem; line-height: 1.45; color: var(--muted-foreground); }
.choice:has(input:checked) { border-color: var(--primary); background: color-mix(in oklch, var(--primary) 8%, transparent); }
.choice:has(input:checked) .choice-title::before { border-color: var(--primary); box-shadow: inset 0 0 0 3.5px var(--primary); }
.choice:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.choice:has(input:disabled) { opacity: .6; cursor: default; }

/* ── Таблицы ──────────────────────────────────────────────────────────────── */
table.t { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.t thead th { text-align: left; font-size: .75rem; font-weight: 500; color: var(--muted-foreground); padding-bottom: .5rem; }
table.t.padded thead th { padding: 1rem; }
table.t tbody td { padding: .5rem 0; border-bottom: 1px solid color-mix(in oklch, var(--border) 50%, transparent); }
table.t.padded tbody td { padding: 1rem; }
table.t thead tr { border-bottom: 1px solid var(--border); }
table.t .right { text-align: right; }
table.t tbody.mono td { font-family: var(--font-mono); }

/* ── Утилиты ──────────────────────────────────────────────────────────────── */
.muted { color: var(--muted-foreground); }
.success-text { color: var(--success); }
.destructive-text { color: var(--destructive); }
.warn-text { color: oklch(0.82 0.14 75); }
/* Широкая таблица на телефоне листается внутри себя, а не сдвигает всю страницу вбок */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.primary-text { color: var(--primary); }
.text-xs { font-size: .75rem; }
.text-sm { font-size: .875rem; }
.stat { font-size: 1.5rem; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.stack-sm { display: flex; flex-direction: column; gap: .25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-2 { margin-top: .5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.cols-3 { grid-template-columns: 1fr; }
.cols-2 { grid-template-columns: 1fr; }
.cols-4 { grid-template-columns: 1fr; }
@media (min-width: 768px) { .cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px)  { .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cols-4 { grid-template-columns: repeat(4, 1fr); } }
.hidden { display: none !important; } /* !important: иначе любой позже объявленный display (.section-title, .seg, .btn…) перебивает скрытие */

pre.box {
  overflow: auto; white-space: pre-wrap; border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 40%, transparent);
  border-radius: var(--radius); padding: .75rem; font-size: .75rem; color: var(--muted-foreground);
}
pre.box.code { white-space: pre; padding-right: 3rem; color: var(--foreground); }
pre.box.tall { max-height: 24rem; }
.token-box {
  border: 1px solid var(--border); background: var(--muted); border-radius: var(--radius);
  padding: .75rem; font-size: .75rem;
}
.token-box code { word-break: break-all; color: var(--success); }
.step-num {
  display: flex; height: 1.5rem; width: 1.5rem; flex-shrink: 0; align-items: center; justify-content: center;
  border-radius: 9999px; background: color-mix(in oklch, var(--primary) 15%, transparent);
  color: var(--primary); font-size: .75rem; font-weight: 600;
}
.copy-btn {
  position: absolute; right: .5rem; top: .5rem; border: 1px solid var(--border); background: var(--card);
  border-radius: var(--radius); padding: .375rem; color: var(--muted-foreground); cursor: pointer;
}
.copy-btn:hover { color: var(--foreground); }
.rel { position: relative; }
details summary { cursor: pointer; user-select: none; color: var(--muted-foreground); font-size: .75rem; }
details summary:hover { color: var(--foreground); }

/* ── График вызовов (bar chart без зависимостей) ──────────────────────────── */
.chart { display: flex; height: 8rem; align-items: flex-end; gap: .5rem; }
.bar-col { display: flex; flex: 1; flex-direction: column; align-items: center; gap: .25rem; }
.bar-area { display: flex; flex-direction: column; height: 100%; width: 100%; align-items: center; justify-content: flex-end; gap: .125rem; }
.bar-num { font-size: 10px; line-height: 1; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.bar-track {
  position: relative; width: 1.5rem; border-radius: .25rem .25rem 0 0;
  background: color-mix(in oklch, var(--primary) 25%, transparent);
}
.bar-fill { position: absolute; bottom: 0; width: 100%; border-radius: .25rem .25rem 0 0; background: var(--primary); }
.bar-label { font-size: 10px; color: var(--muted-foreground); }

/* ── Прогресс-бары (расход лимита / квота) ─────────────────────────────────── */
.meter { width: 100%; height: .5rem; border-radius: 9999px; overflow: hidden;
  background: color-mix(in oklch, var(--primary) 15%, transparent); }
.meter-lg { height: .75rem; }
.meter-fill { height: 100%; border-radius: 9999px; background: var(--primary); transition: width .3s ease; }
.meter-fill.warn { background: oklch(0.78 0.15 75); }   /* ≥75% окна израсходовано */
.meter-fill.over { background: var(--destructive); }    /* лимит окна исчерпан */

/* Разбивка расхода лимита по дням: дата · бар · число */
.day-rows { display: flex; flex-direction: column; gap: .625rem; }
.day-row { display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; gap: .75rem; }
.day-date { font-size: .75rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.day-val { font-size: .8125rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.day-val .muted { font-size: .75rem; }

/* ── Страница входа ───────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; }
.auth-inner { max-width: 72rem; margin: 0 auto; display: flex; flex-direction: column; padding: 0 1.5rem; }
.auth-header { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 0; }
.auth-grid { display: grid; gap: 3rem; padding: 4rem 0; align-items: center; }
@media (min-width: 768px) { .auth-grid { grid-template-columns: 1fr 1fr; } }
.hero h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
@media (min-width: 768px) { .hero h1 { font-size: 3rem; } }
.hero p { max-width: 28rem; color: var(--muted-foreground); }
.hero ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .75rem; font-size: .875rem; }
.hero li { display: flex; align-items: center; gap: .75rem; }
.auth-card { width: 100%; max-width: 24rem; justify-self: end; }
@media (max-width: 768px) { .auth-card { justify-self: stretch; } }
.tabs { display: flex; gap: .25rem; border-radius: var(--radius); background: var(--muted); padding: .25rem; font-size: .75rem; }
.tab { flex: 1; border: none; background: transparent; border-radius: .375rem; padding: .375rem .5rem; color: var(--muted-foreground); cursor: pointer; }
.tab.active { background: var(--card); color: var(--foreground); }

/* ── Суб-навигация раздела админки (горизонтальные вкладки-ссылки) ─────────── */
.subnav {
  display: flex; flex-wrap: wrap; gap: .25rem;
  margin-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}
.subnav a {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; margin-bottom: -1px;
  border-bottom: 2px solid transparent; border-radius: var(--radius) var(--radius) 0 0;
  color: var(--muted-foreground); font-size: .875rem; white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}
.subnav a:hover { color: var(--foreground); background: var(--accent); }
.subnav a.active { color: var(--foreground); border-bottom-color: var(--primary); }
.subnav a svg { flex-shrink: 0; }

/* Отдельная страница /login — центрированная карточка (лендинг живёт на «/») */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; }
.login-inner { width: 100%; max-width: 24rem; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: .625rem; margin-bottom: 1.5rem; }
.login-card { width: 100%; max-width: none; }

/* Стили лендинга («/») вынесены в отдельный wwwroot/css/landing.css — он подключается
   второй строкой только на самой странице лендинга. Кабинет и админка их не качают.
   Правила лендинга живут под префиксом .lp-, но опираются на токены и компоненты
   ОТСЮДА (.card/.btn/.grid/.badge/table.t/pre.box/…) — см. шапку landing.css. */

/* ── Тариф и оплата ───────────────────────────────────────────────────────── */
.sub-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem; }
.sub-hero .sub-plan { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.sub-hero .sub-plan-name { font-size: 1.75rem; font-weight: 650; letter-spacing: -.01em; }
.sub-hero .sub-meta { margin: .375rem 0 0; font-size: .875rem; color: var(--muted-foreground); }
.sub-hero .sub-meta strong { color: var(--foreground); font-weight: 600; }
.badge.warn { background: color-mix(in oklch, oklch(0.78 0.15 75) 16%, transparent); color: oklch(0.82 0.14 75); }

.section-title { font-size: .9375rem; font-weight: 600; margin: 2rem 0 .875rem; display: flex; align-items: center; gap: .5rem; }
.section-title .num {
  display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: 9999px;
  font-size: .75rem; background: color-mix(in oklch, var(--primary) 18%, transparent); color: var(--primary);
}

.plan-grid { display: grid; gap: .875rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .plan-grid { grid-template-columns: repeat(3, 1fr); } }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: .75rem; padding: 1.25rem; text-align: left;
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--card);
  color: var(--foreground); font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.plan-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.plan-card:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.plan-card.selected {
  border-color: var(--primary);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 9%, var(--card)), var(--card) 70%);
  box-shadow: 0 0 0 1px var(--primary), 0 8px 24px -12px color-mix(in srgb, var(--primary) 60%, transparent);
}
.plan-card[disabled] { cursor: default; opacity: .75; }
.plan-card .plan-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 1.5rem; }
.plan-card .plan-name { font-size: 1.0625rem; font-weight: 650; }
.plan-card .plan-tag { font-size: .75rem; color: var(--muted-foreground); }
.plan-card .plan-price { font-size: 1.625rem; font-weight: 700; letter-spacing: -.02em; }
.plan-card .plan-price small { font-size: .8125rem; font-weight: 500; color: var(--muted-foreground); letter-spacing: 0; }
.plan-card .plan-limit {
  font-size: .8125rem; padding: .5rem .625rem; border-radius: calc(var(--radius) - 2px);
  background: var(--muted); color: var(--foreground);
}
.plan-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .375rem; font-size: .8125rem; color: var(--muted-foreground); }
.plan-card li { display: flex; gap: .5rem; align-items: flex-start; }
.plan-card li::before { content: "✓"; color: var(--success); font-weight: 700; flex: none; }
.plan-card .plan-check {
  position: absolute; top: .875rem; right: .875rem; width: 1.25rem; height: 1.25rem; border-radius: 9999px;
  border: 1px solid var(--muted-foreground); display: grid; place-items: center; transition: all .15s;
}
.plan-card.selected .plan-check { border-color: var(--primary); background: var(--primary); }
.plan-card.selected .plan-check::after { content: ""; width: .375rem; height: .625rem; border: solid var(--primary-foreground); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.plan-card .plan-head .badge { margin-right: 1.75rem; }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .25rem; padding: .25rem; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--card); }
.seg button {
  border: 0; background: transparent; color: var(--muted-foreground); font: inherit; font-size: .875rem; font-weight: 500;
  padding: .5rem 1rem; border-radius: var(--radius); cursor: pointer; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--foreground); }
.seg button.active { background: var(--primary-strong); color: var(--primary-foreground); }
.seg button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
@media (max-width: 480px) {
  .seg { display: grid; grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .seg button { padding: .5rem .5rem; }
}

.checkout { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .checkout { grid-template-columns: 1fr 1fr; } }
.summary { display: flex; flex-direction: column; gap: .625rem; font-size: .875rem; }
.summary .line { display: flex; justify-content: space-between; gap: 1rem; }
.summary .line span:first-child { color: var(--muted-foreground); }
.summary .total { padding-top: .75rem; border-top: 1px dashed var(--border); font-size: 1rem; font-weight: 600; }
.summary .total span:last-child { font-size: 1.375rem; font-weight: 700; letter-spacing: -.02em; }
.hint { display: flex; gap: .5rem; align-items: flex-start; font-size: .8125rem; line-height: 1.45; color: var(--muted-foreground); }
.hint svg { flex: none; margin-top: .125rem; color: var(--primary); }
.btn.lg { height: 2.75rem; padding: 0 1.25rem; font-size: .9375rem; font-weight: 600; width: 100%; }
.field.lg { height: 2.75rem; font-size: 1rem; letter-spacing: .02em; }

.how { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-top: .25rem; }
@media (min-width: 640px) { .how { grid-template-columns: repeat(3, 1fr); } }
.how div { display: flex; gap: .625rem; align-items: flex-start; font-size: .8125rem; color: var(--muted-foreground); line-height: 1.4; }
.how b { color: var(--foreground); font-weight: 600; display: block; margin-bottom: .125rem; }
.how .n {
  flex: none; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 9999px;
  border: 1px solid var(--border); font-size: .75rem; color: var(--foreground);
}

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .25rem 0 1rem; }
.stepper .step { position: relative; display: flex; flex-direction: column; gap: .375rem; font-size: .8125rem; color: var(--muted-foreground); }
.stepper .step .bar { height: .25rem; border-radius: 9999px; background: var(--muted); }
.stepper .step.done .bar { background: var(--success); }
.stepper .step.now .bar { background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 25%, var(--muted))); }
.stepper .step.done, .stepper .step.now { color: var(--foreground); }
.stepper .step b { font-weight: 600; }
.stepper .step small { color: var(--muted-foreground); font-size: .75rem; }
/* Смешивание в srgb: в oklch серый (оттенок 0) уводит цвет через жёлтый/красный — рамка «успеха» выходила бурой. */
.req-card.success { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); }
.req-card.progress { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.req-details { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .8125rem; color: var(--muted-foreground); }
.req-details b { color: var(--foreground); font-weight: 600; }

/* Напоминание об окончании подписки — над содержимым любой страницы кабинета */
.sub-alert { margin-bottom: 1.25rem; }
.sub-alert .btn { margin-left: auto; flex: none; }
.sub-alert .x { background: none; border: 0; color: var(--muted-foreground); cursor: pointer; font-size: 1.125rem; line-height: 1; padding: 0 .25rem; }
.phone-field { display: flex; align-items: center; gap: .5rem; padding: 0 .875rem; cursor: text; }
.phone-field:focus-within { outline: 2px solid var(--ring); outline-offset: -1px; }
.phone-field .cc { color: var(--muted-foreground); font-weight: 500; }
.phone-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--foreground); font: inherit; letter-spacing: inherit; }

/* ── Чек-лист «Начало работы» (Обзор) и живой статус подключения (Установка) ── */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.checklist li { display: flex; gap: .75rem; align-items: flex-start; }
.checklist .ck { flex: 0 0 auto; width: 1.5rem; height: 1.5rem; border-radius: 999px; display: grid; place-items: center;
  font-size: .75rem; font-weight: 600; border: 1px solid var(--border); color: var(--muted-foreground); }
.checklist li.done .ck { background: color-mix(in oklch, var(--success) 18%, transparent); border-color: transparent; color: var(--success); }
.checklist li.now .ck { border-color: var(--primary); color: var(--primary); }
.checklist .ck-body { flex: 1; min-width: 0; }
.checklist .ck-title { font-size: .875rem; font-weight: 500; }
.checklist li.done .ck-title { color: var(--muted-foreground); } /* без зачёркивания: зачёркнутый текст плохо читается, галочка и так говорит «готово» */
.checklist .ck-desc { font-size: .75rem; color: var(--muted-foreground); margin: .125rem 0 0; }
.checklist .ck-act { margin-top: .5rem; }
.empty-state { padding: 1.5rem 1rem; text-align: center; font-size: .8125rem; color: var(--muted-foreground); border: 1px dashed var(--border); border-radius: var(--radius); }
.live-status { display: flex; gap: .5rem; align-items: center; font-size: .8125rem; }
.live-status .dot { width: .5rem; height: .5rem; border-radius: 999px; background: var(--muted-foreground); }
.live-status.wait .dot { background: var(--primary); animation: pulse 1.4s ease-in-out infinite; }
.live-status.ok .dot { background: var(--success); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-status.wait .dot { animation: none; } }
.pw-wrap { position: relative; }
.pw-wrap .field { padding-right: 2.5rem; }
.pw-toggle { position: absolute; right: .375rem; top: 50%; transform: translateY(-50%); background: none; border: 0;
  color: var(--muted-foreground); cursor: pointer; padding: .375rem; border-radius: .375rem; line-height: 0; }
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--foreground); }
/* Регистрация: «Подтвердить» у поля email и короткое поле кода из письма под ним. */
.email-row { display: flex; gap: .5rem; }
.email-row .field { flex: 1 1 auto; min-width: 0; }
.email-row .btn { flex: none; height: 2.25rem; }
.field[readonly] { color: var(--muted-foreground); }
.verify-box { display: flex; flex-direction: column; gap: .375rem; margin-top: -.25rem; }
.verify-box .row { gap: .5rem; flex-wrap: nowrap; }
.code-field { width: 7.5rem; flex: none; text-align: center; font-family: var(--font-mono); letter-spacing: .3em; }
.verify-box button.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--primary); }
.verify-box button.link:hover:not(:disabled) { text-decoration: underline; }
.verify-box button.link:disabled { color: var(--muted-foreground); cursor: default; text-decoration: none; }
