/* Личный кабинет СистемаПоток — общие стили.
   Дизайн-токены, шрифты, паттерн nav/frame — клон из website/ (Home.html и др).
   Добавлены формы, таблицы, статусы для функционала ЛК.
   Любые правки в шаблоне (новый блок, новый компонент) обновляют
   kabinet/docs/05-frontend-structure.md (см. AGENTS.md living-docs rule). */

:root {
  /* Цвета — те же что в website/Home.html и dems-frontend AppColors */
  --bg: #FFFFFF;
  --bg-2: #F4F6F6;
  --shell: #EBECEC;
  --ink: #14171B;
  --ink-2: #727782;
  --ink-3: #9AA0AB;
  --blue: #3B82F6;
  --mint: #5ED7B2;
  --teal: #14B8A6;
  --violet: #8D82F3;
  --warn: #E09A62;
  --error: #F43F5E;
  --success: #5ED7B2;

  --border: rgba(176, 183, 195, .45);
  --border-strong: rgba(20, 23, 27, .08);
  --shadow-sm: 0 1px 2px rgba(20, 23, 27, .04), 0 1px 1px rgba(20, 23, 27, .03);
  --shadow-md: 0 1px 2px rgba(20, 23, 27, .04), 0 8px 24px -10px rgba(20, 23, 27, .10);
  --shadow-lg: 0 1px 2px rgba(20, 23, 27, .04), 0 24px 60px -22px rgba(20, 23, 27, .18);

  /* Радиусы — те же что AppRadii: xs=6, sm=10, md=14, lg=20, xl=26, full=999 */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-full: 999px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--shell);
  color: var(--ink);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ─── Frame: внешняя «карточка» страницы (как у website) ─── */
.page { padding: 14px; min-height: 100vh; }
.frame {
  background: var(--bg);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border-strong);
}

/* ─── Nav (top bar) ─── */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px 14px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-strong);
}
.nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 10px;
}
.nav .brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #0E1116;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.nav .brand .mark::before,
.nav .brand .mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.nav .brand .mark::before {
  width: 10px;
  height: 10px;
  background: var(--mint);
  top: 8px;
  left: 8px;
}
.nav .brand .mark::after {
  width: 10px;
  height: 10px;
  background: var(--blue);
  bottom: 8px;
  right: 8px;
}
.nav .brand .nm {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.nav .brand .nm .t { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.nav .brand .nm .s {
  font-size: 10.5px;
  color: var(--ink-2);
  margin-top: 3px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: .04em;
}

.nav .tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 14px;
}
.nav .tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--r-full);
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav .tabs a:hover { color: var(--ink); background: rgba(0, 0, 0, .04); }
.nav .tabs a.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-strong);
}

.nav .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav .user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--r-full);
  background: #fff;
  border: 1px solid var(--border-strong);
}
.nav .user .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav .user .who { font-size: 13px; }
.nav .user .who .nm { font-weight: 600; }
.nav .user .who .em { color: var(--ink-2); font-size: 11px; font-family: "JetBrains Mono", monospace; }

/* ─── Layout: side menu + body ─── */
/* Раньше тут был min-height — при длинном main-контенте .shell растягивался,
   .aside (flex-item, stretch) — вместе с ним, footer с margin-top:auto
   уходил за viewport. Фиксируем .shell строго на высоту окна: aside всегда
   виден целиком, скроллится внутреннее содержимое .body. */
.shell {
  display: flex;
  height: calc(100vh - 28px);
}
.aside {
  width: 240px;
  background: var(--bg-2);
  border-right: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  /* Если когда-то меню разрастётся выше окна — пусть скроллится внутри
     самого aside; footer всё равно прижат через margin-top:auto. */
  overflow-y: auto;
  flex-shrink: 0;
}
.aside h4 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 16px 10px 6px;
}
.aside .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  transition: background .12s ease, color .12s ease;
  margin-bottom: 2px;
}
.aside .nav-item:hover { background: rgba(0, 0, 0, .04); color: var(--ink); }
.aside .nav-item.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-strong);
}
.aside .nav-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.aside .footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--border-strong);
  position: relative; /* anchor для .user-popup */
}
/* User-card теперь — <button>-триггер popup'а. */
.aside .footer .user {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: background .12s ease, border-color .12s ease;
}
.aside .footer .user:hover { background: rgba(0, 0, 0, .04); border-color: var(--border-strong); }
.aside .footer .user[aria-expanded="true"] { background: rgba(0, 0, 0, .04); border-color: var(--border-strong); }
.aside .footer .user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.aside .footer .user .who { flex: 1; min-width: 0; }
.aside .footer .user .who .nm {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aside .footer .user .who .em {
  font-size: 11px; color: var(--ink-2);
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aside .footer .user-chev {
  width: 14px; height: 14px;
  color: var(--ink-3); flex-shrink: 0;
  transition: transform .15s ease;
}
.aside .footer .user[aria-expanded="true"] .user-chev { transform: rotate(180deg); }

/* Popup — поднимается над user-card, левый край sidebar'а. */
.user-popup {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% - 6px);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 20;
}
.user-popup[hidden] { display: none; }
.user-popup-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: background .1s ease;
}
.user-popup-item svg { width: 16px; height: 16px; color: var(--ink-2); flex-shrink: 0; }
.user-popup-item:hover { background: rgba(0, 0, 0, .05); }
.user-popup-item.danger { color: var(--error); }
.user-popup-item.danger svg { color: var(--error); }
.user-popup-item.danger:hover { background: rgba(244, 63, 94, .08); }

.body {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  min-width: 0;
}
.body h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.body .sub {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 22px;
}

/* ─── Cards ─── */
/* Карточки — пунктирная рамка по умолчанию (единый «пунктирный» стиль ЛК,
   мотив из ИИ-чата). Плоские, без тени; линия рисуется SVG-фоном --dash-border. */
.card {
  background-color: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  padding: 22px;
  overflow: hidden;
  background-image: var(--dash-border);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}
.card.compact { padding: 14px 16px; }
/* Обёртки таблиц — БЕЗ пунктира: сплошная тонкая рамка (пунктир только у карточек). */
.card.table-wrap {
  background-image: none;
  border-color: var(--border-strong);
  padding: 0;
}
.card .ttl {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}
/* success-карточка больше НЕ красится зелёным — это обычная пунктирная карточка. */

/* ─── SVG-токены пунктирной рамки (мотив из ИИ-чата DashedCard:
   штрих 4 / пропуск 4 / визуально 1px / радиус 20). Без внешних зависимостей,
   адаптивно. stroke-width=2 — половина обрезается краем box'а → ровно 1px.
   --dash-border — серый (--border #B0B7C3), --dash-border-ink — тёмный (акцент). */
:root {
  --dash-border: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='100%25'%20height='100%25'%3E%3Crect%20x='0.5'%20y='0.5'%20width='calc(100%25%20-%201px)'%20height='calc(100%25%20-%201px)'%20rx='19.5'%20ry='19.5'%20fill='none'%20stroke='%23B0B7C3'%20stroke-width='1'%20stroke-dasharray='4%204'/%3E%3C/svg%3E");
  --dash-border-ink: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='100%25'%20height='100%25'%3E%3Crect%20x='0.5'%20y='0.5'%20width='calc(100%25%20-%201px)'%20height='calc(100%25%20-%201px)'%20rx='19.5'%20ry='19.5'%20fill='none'%20stroke='%2314171B'%20stroke-width='1'%20stroke-dasharray='4%204'/%3E%3C/svg%3E");
}

/* Утилита пунктирной рамки для НЕ-card элементов (плашки, инфо-блоки). */
.dashed {
  border-color: transparent !important;
  box-shadow: none !important;
  border-radius: var(--r-lg);
  background-image: var(--dash-border);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

/* ─── Forms ──────────────────────────────────────────────────────────
   Каноничный стиль = AppTextField / AppFieldContainer из dems-frontend
   UI Kit. Что копируем:
     • border-radius: 20px (= AppRadii.radiusLg)
     • height: 38px, padding-x: 14px (AppFieldConstants.fieldHeight + pickerPadding)
     • border: 1px серый alpha 0.18 (idle) → 1.5px alpha 0.35 (focus)
     • box-shadow на фокусе: тонкая «приподнятая» тень черного/0.06
       (НЕ синий glow — в UI Kit нет синего акцента на фокусе)
     • label: 13px/600, серый
     • font-size в поле: 14px/500
*/
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, border-width .2s ease;
  box-sizing: border-box;
}
.field textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 14px;
  resize: vertical;
  line-height: 1.45;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-3);
  font-weight: 500;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border: 1.5px solid rgba(0, 0, 0, 0.30);
  box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.06);
}
/* Auto-fill в Chrome/Safari/Yandex красит фон бледно-синим / жёлтым.
   Сбрасываем: фон белый, цвет ink, тень-fill через inset-shadow. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s ease-in-out 0s;
}
/* Невалидное состояние — ТОЛЬКО через JS-класс .invalid (ставится после ввода,
   см. updateFieldValidity в app.js). НЕ используем :invalid/:placeholder-shown:
   у части полей (пароли в модалках) нет placeholder, поэтому пустое required-
   поле ложно подсвечивалось красным сразу при открытии модалки. */
.field input.invalid,
.field textarea.invalid {
  border-color: rgba(244, 63, 94, 0.55);
}
.field input.invalid:focus,
.field textarea.invalid:focus {
  border: 1.5px solid rgba(244, 63, 94, 0.7);
  box-shadow: 0 1px 6px 0 rgba(244, 63, 94, 0.10);
}
.field .helper {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 6px;
}
.field .field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 6px;
  display: none;
}
.field.invalid .field-error { display: block; }
.field.invalid input { border-color: rgba(244, 63, 94, 0.55); }
.row { display: flex; gap: 10px; }
.row > .field { flex: 1; }

/* ─── Buttons — точное зеркало UI Kit AppButton (dems-frontend) ──────────
   • радиус pill (var(--r-full)), вес 600, gap 5px (= AppSpacing.xs)
   • medium (по умолчанию): padding 10px 15px, font 14px, иконка 18
   • small: padding 6px 12px, font 13px, иконка 16
   • secondary = белый фон + border ink@15%; primary = ink/белый;
     danger/warn/success = залитые; disabled = bg-2 + ink-2 (как AppButton)
   Базовый прозрачный 1px border у всех вариантов держит одинаковую высоту
   в ряду кнопок (как Container с Border в AppButton). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s ease, transform .08s ease, border-color .12s ease, color .12s ease, filter .12s ease;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled,
.btn[disabled] {
  background: var(--bg-2);
  color: var(--ink-2);
  border-color: rgba(176, 183, 195, .25);
  cursor: not-allowed;
}
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: #000; }
.btn.secondary { background: #fff; color: var(--ink); border-color: rgba(20, 23, 27, .15); }
.btn.secondary:hover:not(:disabled) { background: var(--bg-2); }
.btn.danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn.danger:hover:not(:disabled) { filter: brightness(.95); }
.btn.warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn.warn:hover:not(:disabled) { filter: brightness(.95); }
.btn.success { background: var(--success); color: #0a3b2a; border-color: var(--success); }
.btn.success:hover:not(:disabled) { filter: brightness(0.96); }
/* Fullwidth-кнопки (вход/регистрация/CTA тарифов) — чуть выше базовой small,
   чтобы образовывать ровный стек с OAuth-кнопками и не выглядеть «тонкими».
   Инлайновые кнопки остаются small (как на основном фронте). */
.btn.fullwidth { width: 100%; padding-top: 11px; padding-bottom: 11px; }
/* .btn.small — алиас: базовый .btn уже small (как 95% кнопок основного фронта). */
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn .ic { width: 16px; height: 16px; }

/* ─── Status badges ─── */
/* Статус-бейджи — БЕЗ цветной подложки: только цветной текст + цветная точка. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.running { color: #0a8765; }
.badge.provisioning { color: #4d3fc7; }
.badge.pending { color: #a35b1c; }
.badge.failed,
.badge.rejected { color: #b91537; }
.badge.archived { color: var(--ink-2); }
.badge.admin { color: #1d4ed8; }

/* ─── Alerts ─── */
.alert {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.alert.error { background: rgba(244, 63, 94, .08); color: #b91537; border: 1px solid rgba(244, 63, 94, .3); }
.alert.warning { background: rgba(224, 154, 98, .10); color: #a35b1c; border: 1px solid rgba(224, 154, 98, .3); }
.alert.info { background: rgba(59, 130, 246, .08); color: #1d4ed8; border: 1px solid rgba(59, 130, 246, .25); }
.alert.success { background: rgba(94, 215, 178, .10); color: #0a8765; border: 1px solid rgba(94, 215, 178, .35); }

/* ─── Tables ─── */
.table {
  width: 100%;
  /* separate + border-spacing:0 нужно чтобы скруглить углы у first/last <th>
     и last-row <td>: collapse ломает border-radius на ячейках. Визуально
     ведёт себя как collapse — мы используем только border-bottom на ячейках. */
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--bg-2);
}
.table th:first-child { border-top-left-radius: var(--r-lg); }
.table th:last-child  { border-top-right-radius: var(--r-lg); }
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-strong);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r-lg); }
.table tbody tr:last-child td:last-child  { border-bottom-right-radius: var(--r-lg); }
.table tbody tr:hover { background: var(--bg-2); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ─── Empty state ─── */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-2);
}
.empty .ic {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  color: var(--ink-3);
}
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0 0 18px; font-size: 13.5px; }

/* ─── Centered auth pages ─── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;            /* над анимированным фоном-«потоком» */
  background: transparent; /* фон даёт body (--shell), чтобы был виден поток */
}

/* ─── Точечная сетка-канвас как в редакторе пайплайнов (DotGridPainter:
   spacing 24, radius 1.2, цвет #D5D5D5 на белом). У нас фон серый (--shell
   #EBECEC), поэтому точка темнее (#C2C2C2) — даёт ту же видимость, что у
   редактора на белом. Отдельный слой ПОД потоком, чтобы точки были чёткими и
   не гасли вместе с opacity:.5 потока. ─── */
.flow-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #C2C2C2 1.2px, transparent 1.6px);
  background-size: 24px 24px;
  background-position: -12px -12px;
  opacity: 0;
  animation: gridFadeIn 1s ease .1s forwards;
}
@keyframes gridFadeIn { to { opacity: 1; } }

/* ─── Анимированный «поток» на фоне страниц входа (как hero-лента на сайте):
   горизонтально плывущие ленты нод-пайплайна. Декоративно, pointer-events:none,
   плавно появляется, мягко гаснет по краям. ─── */
.flow-bg {
  /* поток рисуется ПОВЕРХ точечной сетки */
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* один поток, по центру за карточкой */
  /* opacity:1 — ноды/линии НЕПРОЗРАЧНЫЕ, сетка-точки не просвечивают сквозь
     карточки (как в редакторе: ноды лежат ПОВЕРХ канваса). Мягкость по краям
     даёт только горизонтальная маска. */
  opacity: 0;
  animation: flowFadeIn 1.4s ease .15s forwards;
  -webkit-mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
          mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
@keyframes flowFadeIn { to { opacity: 1; } }
.flow-row {
  display: flex;
  align-items: center;
  width: max-content;
  flex-shrink: 0;
  will-change: transform;
  animation: flowScroll 100s linear infinite;
}
.flow-row.rev { animation-direction: reverse; }
.flow-row.slow { animation-duration: 135s; }
@keyframes flowScroll { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
/* Ноды/связи/разветвления — ТОЧНАЯ копия карточек редактора пайплайнов
   (pipeline_graph_editor): 260×84, белая, радиус 20, border #E2E8F0, две мягкие
   тени, padding 12/14; иконка 56 (brand-SVG или Lucide) + заголовок #0F172A 14/700
   + превью #64748B 11.5. Связи — сплошные cubic-bezier, окрашены цветом ноды. */
.flow-bg .hero-chain { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.flow-bg .tnode {
  position: relative;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .05), 0 2px 4px -1px rgba(0, 0, 0, .03);
  width: 260px;
  height: 84px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.flow-bg .tnode .ico { width: 56px; height: 56px; flex: 0 0 56px; display: flex; align-items: center; justify-content: center; }
.flow-bg .tnode .ico svg { width: 36px; height: 36px; display: block; }
/* Иконки фиксированной высоты 34px (как LlmProviderIcon/brand в редакторе) — не мелкие. */
.flow-bg .tnode .ico img { height: 34px; width: auto; max-width: 60px; display: block; }
.flow-bg .tnode .meta { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.flow-bg .tnode .label { font-size: 14px; font-weight: 700; color: #0F172A; line-height: 1.25; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-bg .tnode .sub { font-size: 11.5px; color: #64748B; line-height: 1.3; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Фирменные порты-точки как на воркфлоу в Конструкторе (_drawPortCircle):
   цветное кольцо (цвет ноды, r7) + белая обводка 1.5 + белая точка в центре (r2.5)
   + мягкое свечение цветом ноды (r10, alpha .18). Цвет задаётся per-node --port/--pg. */
.flow-bg .tnode::before, .flow-bg .tnode::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at center, #fff 0 2.5px, var(--port, #9AA0AB) 3.2px 100%);
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 3px var(--pg, rgba(148, 163, 184, .18));
  top: 50%; transform: translateY(-50%); z-index: 2; box-sizing: border-box;
}
.flow-bg .tnode::before { left: -7px; }
.flow-bg .tnode::after { right: -7px; }
/* Суб-ноды (ресурсы под агентом) — БЕЗ кружочков-портов: к ним приходит
   только пунктирный градиентный коннектор сверху. */
.flow-bg .tnode.res::before, .flow-bg .tnode.res::after { display: none; content: none; }
/* Триггер (первая нода) — без входного порта слева; терминальная нода (отправка
   в конце потока) — без выходного порта справа. Порт = только там, где есть связь. */
.flow-bg .tnode.no-in::before { display: none; content: none; }
.flow-bg .tnode.no-out::after { display: none; content: none; }
.flow-bg .twire { flex: 0 0 auto; height: 2.5px; border-radius: 2px; }
.flow-bg .branch-label { background: #fff; border: 1px solid #E2E8F0; border-radius: 999px; padding: 2px 9px; font-size: 10px; color: #64748B; font-family: "JetBrains Mono", monospace; white-space: nowrap; letter-spacing: .02em; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
/* Ресурс-подузел (1С/Битрикс24/Метрика/БД под агентом, dashed-связь снизу). */
.flow-bg .tres { display: inline-flex; align-items: center; gap: 9px; background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .05), 0 2px 4px -1px rgba(0, 0, 0, .03); padding: 7px 12px; height: 50px; box-sizing: border-box; }
.flow-bg .tres .rico { width: 30px; height: 30px; flex: 0 0 30px; display: flex; align-items: center; justify-content: center; }
.flow-bg .tres .rico img { max-width: 30px; max-height: 24px; display: block; }
.flow-bg .tres .rico svg { width: 22px; height: 22px; display: block; }
.flow-bg .tres .rlabel { font-size: 12px; font-weight: 600; color: #334155; line-height: 1.2; white-space: nowrap; }
.flow-bg .tres .rsub { font-size: 10px; color: #94A3B8; line-height: 1.2; white-space: nowrap; }
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  border: 1px solid var(--border-strong);
}
.auth-card.wide { max-width: 560px; }
.auth-card .logo { display: flex; justify-content: center; margin-bottom: 16px; }
.auth-card .logo img { height: 36px; }
.auth-card h1 {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}
.auth-card .sub {
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 24px;
}
.auth-card .switch {
  margin-top: 10px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-2);
}
.auth-card .switch a { color: var(--blue); font-weight: 600; cursor: pointer; }

/* ─── kv list (детали tenant) ─── */
.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 14px;
}
.kv dt { color: var(--ink-2); font-size: 12.5px; }
.kv dd { margin: 0; color: var(--ink); font-size: 13.5px; word-break: break-word; }
.kv dd.mono { font-family: "JetBrains Mono", monospace; font-size: 13px; }
.kv dd.big { font-size: 18px; font-weight: 700; color: var(--error); }

/* ─── Spinner ─── */
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin .8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Движение: лёгкие, не назойливые анимации ─────────────────────────
   Контент раздела плавно «всплывает» при смене route; модалки — аккуратный
   fade + scale; строки таблиц мягко подсвечиваются. Всё уважает
   prefers-reduced-motion (для пользователей с отключённой анимацией). */
@keyframes kRise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes kFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kModalIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.body > *:not(dialog) { animation: kRise .3s cubic-bezier(.22, .61, .36, 1) both; }
.table tbody tr { transition: background .12s ease; }
dialog.modal[open] { animation: kModalIn .2s ease both; }
dialog.modal[open]::backdrop { animation: kFade .2s ease both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Modal (native <dialog>) ─── */
dialog.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 480px;
  width: calc(100% - 40px);
}
dialog.modal::backdrop {
  background: rgba(20, 23, 27, .55);
  backdrop-filter: blur(2px);
}
dialog.modal .modal-card {
  background: var(--bg);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  border: 1px solid var(--border-strong);
}
dialog.modal h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}
dialog.modal .mhint {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 18px;
}
dialog.modal .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ─── Page loading ─── */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--ink-2);
}

/* ─── Consents (галки на регистрации) ─── */
.consents {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 14px 16px;
  background: var(--bg-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
}
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.consent-row input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
  cursor: pointer;
}
.consent-row a { color: var(--blue); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.consent-row a:hover { color: #1d4ed8; }

/* ─── Lifecycle action row (на /dashboard/:id) ─── */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-strong);
}
.actions-row .btn {
  font-size: 13px;
  padding: 6px 12px;
}
.actions-row .btn.danger {
  background: var(--error);
  color: #fff;
}
.actions-row .btn.danger:hover:not(:disabled) {
  background: #c41a3a;
}
.actions-row .btn.warn {
  background: var(--warn);
  color: #fff;
}
.actions-row .btn.warn:hover:not(:disabled) {
  background: #b87a44;
}

/* ─── Tariffs page ─── */
.tariffs-body {
  background: var(--bg);
  min-height: 100vh;
}
.tariffs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand-link img { height: 36px; }
.tariffs-nav { display: flex; gap: 18px; }
.tariffs-nav a {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.tariffs-nav a:hover { color: var(--ink); }

.tariffs-hero {
  text-align: center;
  padding: 40px 20px 56px;
  max-width: 760px;
  margin: 0 auto;
}
.tariffs-hero h1 {
  font-size: 44px;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -1px;
  line-height: 1.1;
}
.tariffs-hero-sub {
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0;
}

.tariffs-grid-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.tariffs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1000px) {
  .tariffs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .tariffs-grid { grid-template-columns: 1fr; }
}
.tariffs-loading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 60px 20px;
  color: var(--ink-2);
}
.tariff-card {
  background-color: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .16s ease;
  background-image: var(--dash-border);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}
.tariff-card:hover {
  transform: translateY(-2px);
}
/* «Популярный» — тот же пунктир, но тёмной (акцентной) линией + мелкий бейдж. */
.tariff-card.popular {
  background-image: var(--dash-border-ink);
}
.popular-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.tariff-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.tariff-tagline {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
  min-height: 34px;
  margin-bottom: 14px;
}
.tariff-price {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.tariff-trial {
  font-size: 11px;
  color: #0a8765;
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  /* Высота строки задана явно чтобы spacer совпадал по высоте — карточки
     без бейджа остаются ровно той же высоты, что и карточки с бейджем. */
  line-height: 16px;
  min-height: 16px;
}
/* Spacer когда «14 дней бесплатно» не показывается (sub уже есть / Enterprise). */
.tariff-trial-spacer { height: 16px; margin-bottom: 14px; }
.tariff-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
}
.tariff-features li {
  padding: 5px 0 5px 20px;
  position: relative;
  color: var(--ink);
}
.tariff-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 13px;
  height: 13px;
  background: var(--mint);
  border-radius: var(--r-full);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'><polyline points='20 6 9 17 4 12'/></svg>") center/8px no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'><polyline points='20 6 9 17 4 12'/></svg>") center/8px no-repeat;
}

/* Included-blok под карточками */
.tariffs-included {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  border-top: 1px solid var(--border-strong);
}
.tariffs-included h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 28px;
  text-align: center;
}
.tariffs-included-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 720px) {
  .tariffs-included-grid { grid-template-columns: 1fr; }
}
.incl-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.incl-item .ic {
  width: 32px;
  height: 32px;
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 2px;
}
.incl-item h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}
.incl-item p {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0;
}

/* Addons */
.tariffs-addons {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
  border-top: 1px solid var(--border-strong);
  padding-top: 40px;
}
.tariffs-addons h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 4px;
  text-align: center;
}
.tariffs-addons-sub {
  text-align: center;
  color: var(--ink-2);
  margin: 0 0 28px;
  font-size: 14px;
}
.addons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 720px) {
  .addons-grid { grid-template-columns: 1fr; }
}
.addon-card {
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 22px 20px;
}
.addon-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
}
.addon-card p {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 0 16px;
}
.addon-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

/* Footer */
.tariffs-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  border-top: 1px solid var(--border-strong);
}
.tariffs-footer a { color: var(--blue); }
.tariffs-footer-meta { margin-top: 10px; font-size: 12px; }
.tariffs-footer-meta a { color: var(--ink-2); }

/* ─── Subscription page — компактный hero (одна строка, status pill + tariff + actions справа) ─── */
.sub-page { width: 100%; }

/* Большая «зелёная» карточка текущего тарифа удалена (была вычурной):
   текущий план показывает компактный .sub-hero выше + таблица сравнения. */

/* ─── Collapse «Сравнить с другими тарифами» ─── */
.sub-collapse { margin-top: 8px; }
.sub-collapse-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.sub-collapse-toggle:hover { background: var(--bg-2); border-color: var(--ink-3); }
.sub-collapse-chev { width: 16px; height: 16px; transition: transform 200ms ease; }
.sub-collapse[data-collapsed="0"] .sub-collapse-chev { transform: rotate(180deg); }
.sub-collapse-body {
  display: none;
  padding-top: 24px;
}
.sub-collapse[data-collapsed="0"] .sub-collapse-body { display: block; }

/* ─── Compare table ─── */
.cmp-wrap { margin-top: 24px; }
.cmp-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 14px; }
/* Таблица сравнения — обычная таблица, без пунктира: сплошная рамка. */
.cmp-scroll {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg);
}
@media (max-width: 760px) { .cmp-scroll { overflow-x: auto; } }
.cmp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.cmp-table thead th {
  padding: 14px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-strong);
  text-align: center;
  font-weight: 600;
  position: relative;
  min-width: 110px;
}
.cmp-table thead th.cmp-feat-head { text-align: left; }
.cmp-table thead th.current { color: var(--ink); }
/* Бейдж «Ваш» в шапке таблицы — inline, не absolute, чтобы overflow:hidden
   контейнера не резал его. Centered внутри <th>. */
.cmp-current-mark {
  display: inline-block;
  color: #0a8765;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  margin-bottom: 4px;
}
.cmp-th-name { font-size: 14px; }
.cmp-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-strong);
  text-align: center;
  vertical-align: middle;
}
.cmp-table tbody tr:last-child td { border-bottom: 0; }
/* колонка «ВАШ» — без цветной заливки, отмечена только меткой «ВАШ» */
.cmp-table td.cmp-feat { text-align: left; color: var(--ink); font-weight: 500; }
.cmp-yes { width: 18px; height: 18px; color: var(--mint); display: inline-block; vertical-align: middle; }
.cmp-no  { color: var(--ink-3); font-size: 16px; }
.sub-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  /* Статус-плашка — тоже пунктирная (статус читается по цветной точке в pill). */
  background-color: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  background-image: var(--dash-border);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.sub-hero-main { flex: 1; min-width: 0; }
.sub-hero-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
/* Статус-пилюля тарифа — без подложки: точка + цветной текст. */
.sub-status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sub-status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
}
.sub-status-pill.mint  { color: #0a8765; }
.sub-status-pill.blue  { color: #1d4ed8; }
.sub-status-pill.error { color: #b91537; }

.sub-tariff-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.sub-meta { font-size: 13px; color: var(--ink-2); }
.sub-meta-line { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

.sub-hero-progress-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 540px;
}
.sub-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(20, 23, 27, .08);
  border-radius: 999px;
  overflow: hidden;
}
.sub-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--blue));
  border-radius: 999px;
  transition: width 400ms ease;
}
.sub-progress-text { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.sub-progress-text strong { color: var(--ink); font-weight: 600; }

.sub-hero-actions { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 720px) {
  .sub-hero { flex-direction: column; align-items: stretch; }
  .sub-hero-actions { width: 100%; }
  .sub-hero-actions .btn { flex: 1; }
}

/* Компактный info-блок для empty-state (без подписки) */
.sub-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  /* background-color (не shorthand) — чтобы .dashed мог наложить SVG-фон */
  background-color: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  margin-bottom: 22px;
}
.sub-info-ic {
  width: 22px;
  height: 22px;
  color: var(--blue);
  flex-shrink: 0;
}
.sub-info-text {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
}
.sub-info-text strong { font-weight: 600; }

.sub-section-title { margin: 6px 0 12px; }
.sub-section-title h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
.sub-section-hint { font-size: 13px; color: var(--ink-2); margin: 0; }

/* ─── Tariffs included grid (под карточками) ─── */
.tariffs-included-wrap {
  margin-top: 32px;
  border-top: 1px solid var(--border-strong);
  padding-top: 28px;
}
.ti-title { font-size: 18px; font-weight: 600; margin: 0 0 16px; }
.ti-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 920px) { .ti-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .ti-grid { grid-template-columns: 1fr; } }
.ti-card {
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 16px 16px 18px;
}
/* Иконка без контейнера-плашки — просто чёрная линия (канон фронта). */
.ti-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: flex-start;
  color: var(--ink);
  margin-bottom: 10px;
}
.ti-icon svg { width: 22px; height: 22px; }
.ti-card h4 { font-size: 14px; font-weight: 600; margin: 0 0 4px; line-height: 1.35; }
.ti-card p { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; margin: 0; }

/* ─── Тариф-карточка: current state ─── */
/* текущий тариф — отмечен тёмным пунктиром + бейджем, без зелёной заливки */
.tariff-card.current { background-image: var(--dash-border-ink); }
.popular-badge.current { background: var(--mint); }

/* ─── Toast ─── */
.k-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
  z-index: 9999;
  max-width: 90vw;
}
.k-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Trial banner на dashboard */
.trial-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(94, 215, 178, .15), rgba(59, 130, 246, .12));
  border: 1px solid rgba(94, 215, 178, .35);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.trial-banner.expired {
  background: rgba(244, 63, 94, .08);
  border-color: rgba(244, 63, 94, .35);
}
.trial-banner .tb-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.trial-banner .tb-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
}
.trial-banner .tb-text strong { color: var(--ink); }
.trial-banner .tb-cta { flex-shrink: 0; }

/* ─── OAuth-блок на login/register ─── */
.oauth-block {
  margin-top: 18px;
}
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 12px;
  margin: 18px 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  /* высота ≈ .btn.fullwidth, чтобы стек «Войти + OAuth» был ровным */
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 120ms ease;
  text-decoration: none;
}
.oauth-btn:hover {
  background: var(--bg-2);
  border-color: var(--ink);
}
.oauth-btn svg { flex-shrink: 0; }
.oauth-btn.oauth-github { color: #14171B; }
.oauth-btn.oauth-yandex { color: #14171B; }
.oauth-hint {
  font-size: 12px;
  color: var(--ink-2);
  margin: 12px 0 0;
  line-height: 1.5;
}

/* ─── Confirm dialog «введите subdomain» ─── */
.danger-confirm-input {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  width: 100%;
  margin-top: 8px;
}
.danger-confirm-input:focus {
  outline: 0;
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, .15);
}
