/* landing.css — полный стиль лендинга в дизайн-системе blueprint/glass.

   Токены и шрифты подключаются отдельными <link> в base.html, а НЕ через
   @import отсюда: @import — последовательная загрузка (браузер обязан сначала
   получить и разобрать landing.css, и только потом узнаёт про tokens.css),
   и на критическом пути рендера это лишний круг ожидания. Три параллельных
   <link> обходятся дешевле одного, тянущего за собой цепочку. */

/* ── Blueprint grid ── */
.blueprint {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(186, 215, 247, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(186, 215, 247, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 70%);
}

/* ── Spotlight ── */
.spotlight {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1400px;
  height: 900px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 50% 50% at 50% 0%, rgba(124, 145, 182, 0.12) 0%, transparent 70%);
}

/* ── Container ── */
.container {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 40px);
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 6, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-edge);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px clamp(20px, 3vw, 40px);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--fg-white);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-body);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  color: var(--fg-white);
  background: var(--luminous-subtle);
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--fg-white) !important;
  font-weight: 600 !important;
  box-shadow: 0 0 20px var(--accent-glow);
}

.nav-cta:hover {
  background: var(--accent-hover) !important;
}

/* ── Section eyebrow ── */
.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow-line {
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-edge), transparent);
}

.eyebrow-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--fg-body);
  text-transform: uppercase;
}

/* ── Section heading ── */
.section-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4.5vw, 48px);
  line-height: 1.15;
  text-align: center;
  background: linear-gradient(0deg, #d8ecf8 0%, #98c0ef 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.section-sub {
  text-align: center;
  color: var(--fg-body);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Glass card ── */
.glass-card {
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 1px rgba(199, 211, 234, 0.12),
    inset 0 24px 48px rgba(199, 211, 234, 0.05),
    0 24px 32px rgba(6, 6, 14, 0.7);
  padding: var(--card-pad);
}

/* ── Pill button ── */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill-ghost {
  background: var(--luminous-subtle);
  color: var(--fg-white);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}

.pill-ghost:hover {
  background: rgba(186, 214, 247, 0.12);
}

.pill-primary {
  background: var(--accent);
  color: var(--fg-white);
  font-weight: 600;
  box-shadow: 0 0 24px var(--accent-glow);
}

.pill-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 32px rgba(102, 58, 243, 0.5);
}

/* ── Hero ── */
.hero {
  padding: clamp(80px, 12vw, 160px) 0 clamp(60px, 8vw, 100px);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--luminous-fill);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-body);
  margin-bottom: 32px;
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.1;
  background: linear-gradient(0deg, #d8ecf8 0%, #98c0ef 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  max-width: 800px;
  margin: 0 auto 24px;
}

.hero-sub {
  max-width: 580px;
  margin: 0 auto 40px;
  color: var(--fg-body);
  font-size: 17px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cards {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 64px;
  flex-wrap: wrap;
}

.hero-stat {
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  padding: 20px 28px;
  text-align: center;
  min-width: 140px;
  box-shadow:
    inset 0 1px 1px rgba(199, 211, 234, 0.12),
    inset 0 24px 48px rgba(199, 211, 234, 0.05),
    0 16px 24px rgba(6, 6, 14, 0.6);
}

.hero-stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--fg-white);
  line-height: 1.2;
}

.hero-stat-label {
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* ── Features ── */
.features {
  padding: var(--section-gap) 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow:
    inset 0 1px 1px rgba(199, 211, 234, 0.12),
    inset 0 24px 48px rgba(199, 211, 234, 0.05),
    0 16px 24px rgba(6, 6, 14, 0.5);
  transition: transform 0.25s, box-shadow 0.25s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 1px 1px rgba(199, 211, 234, 0.18),
    inset 0 24px 48px rgba(199, 211, 234, 0.08),
    0 24px 40px rgba(6, 6, 14, 0.8);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-circle);
  background: var(--luminous-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
  color: var(--blueprint);
}

.feature-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--fg-white);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── Models table ── */
.models {
  padding: var(--section-gap) 0;
}

/* Группы моделей по производителю на главной: каждый <details> — один
   производитель, развёрнут по умолчанию (атрибут open в шаблоне) и
   сворачивается по клику на заголовок. */
.models-groups {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.models-group > summary.models-group-title {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-body);
  padding: 10px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.models-group > summary.models-group-title::-webkit-details-marker {
  display: none;
}

/* Собственный маркер сворачивания: вращается при раскрытой группе. */
.models-group > summary.models-group-title::before {
  content: "▸";
  display: inline-block;
  color: var(--fg-muted);
  font-size: 13px;
  transition: transform 0.15s ease;
}

.models-group[open] > summary.models-group-title::before {
  transform: rotate(90deg);
}

.models-group-count {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--luminous-subtle);
  border-radius: 999px;
  padding: 2px 10px;
}

.models-table-wrap {
  overflow-x: auto;
}

.models-table {
  width: 100%;
  /* separate, а не collapse: при collapse браузеры игнорируют border-radius
     на ячейках, и скруглить нижние углы контура featured-best у последней
     видимой строки невозможно — они обрезались бы скруглением glass-card.
     separate + border-spacing: 0 сохраняет привычный вид (разделители строк
     заданы border-bottom на th/td, при separate они тоже работают), но
     включает border-radius на td, от которого зависит контур строки. */
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-body);
  font-size: 14px;
}

/* Каждая группа производителей на главной — отдельная <table>, а auto-раскладка
   считает ширины колонок по содержимому своей таблицы: у длинных ID
   (anthropic/claude-sonnet-4.6) колонка «Модель» шире, чем у коротких, и цены
   в соседних группах вставали на разной вертикали. fixed + явные ширины
   ценовых колонок держат все группы на одной сетке. min-width страхует от
   схлопывания колонки модели на узких экранах — обёртка скроллится. */
.models-groups .models-table {
  table-layout: fixed;
  min-width: 560px;
}

.models-groups .models-table th:nth-child(2),
.models-groups .models-table th:nth-child(3) {
  width: 160px;
}

/* Колонка при fixed больше не растягивается под длинный ID — рвём его внутри
   ячейки, а не за её границей. */
.models-groups .models-table td:first-child {
  overflow-wrap: anywhere;
}

.models-table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 500;
  color: var(--fg-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--glass-edge);
}

.models-table td {
  padding: 14px 16px;
  color: var(--fg-body);
  border-bottom: 1px solid var(--glass-edge);
}

.models-table tr:hover td {
  background: var(--luminous-subtle);
}

/* Выделение строки «выбор большинства» в таблице популярных моделей:
   сплошной зелёный КОНТУР вокруг всего ряда, без внутренних вертикальных
   линий между ячейками (сетка внутри строки смотрелась бы как рамка вокруг
   каждой клетки). border на <tr> в табличной раскладке не работает, а
   box-shadow на каждом <td> единым контуром не ляжет: он обведёт каждую
   ячейку отдельно. Поэтому контур собираем по рёбрам: всем ячейкам ряда —
   верх и низ, первой — левый край, последней — правый; внутренние
   вертикальные рёбра не рисуются вовсе, и ряд получает цельную рамку. */
.models-table tr.featured-best td {
  box-shadow: inset 0 1px 0 #4ade80, inset 0 -1px 0 #4ade80;
  background: rgba(74, 222, 128, 0.06);
}

.models-table tr.featured-best td:first-child {
  box-shadow: inset 1px 0 0 #4ade80, inset 0 1px 0 #4ade80, inset 0 -1px 0 #4ade80;
}

.models-table tr.featured-best td:last-child {
  box-shadow: inset -1px 0 0 #4ade80, inset 0 1px 0 #4ade80, inset 0 -1px 0 #4ade80;
}

.models-table tr.featured-best:hover td {
  background: rgba(74, 222, 128, 0.1);
}

/* featured-best-last — «выбор большинства» оказался последней видимой
   строкой таблицы (фильтр по производителю сузил список до одной модели и
   т.п.). Контур строки рисуется box-shadow с прямыми углами, а обёртка
   glass-card скруглена на var(--radius-md) — без этой правки нижние зелёные
   углы обрезаются скруглением и контур выглядит обломанным. Скругляем
   нижние углы контура под радиус контейнера: box-shadow inset обрезается
   по border-radius ячейки, поэтому радиус задаётся именно td. Верх ряда
   остаётся прямым — он не упирается в скругление. */
.models-table tr.featured-best-last td:first-child {
  border-bottom-left-radius: var(--radius-md);
}

.models-table tr.featured-best-last td:last-child {
  border-bottom-right-radius: var(--radius-md);
}

.featured-badge {
  display: block;
  width: fit-content;
  font-size: 11px;
  font-weight: 600;
  color: #06281a;
  background: #4ade80;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
  white-space: nowrap;
}

.models-table td code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--fg-body);
}

.model-name {
  font-weight: 600;
  color: var(--fg-white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-provider {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 400;
}

.model-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  background: var(--luminous-fill);
  color: var(--fg-body);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}

.price-accent {
  color: var(--fg-white);
  font-weight: 600;
}

/* Подсветка экстремумов в таблице сравнения: минимум — зелёным,
   максимум — красным. Считается по каждой ценовой колонке отдельно,
   только среди платных моделей. */
.price-low {
  color: #4ade80;
}

.price-high {
  color: #f87171;
}

.price-free {
  color: var(--accent);
  font-weight: 500;
}

/* ── Compare checkbox ── */
.compare-check {
  width: 40px;
  text-align: center;
  padding: 14px 8px;
}

.compare-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ── Steps ── */
.steps {
  padding: var(--section-gap) 0;
}

.steps-list {
  display: flex;
  gap: 32px;
  margin-top: 48px;
  justify-content: center;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  text-align: center;
}

.step-num {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-circle);
  background: var(--luminous-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg-white);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}

.step-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--fg-white);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ── Code example ── */
.code-demo {
  padding: var(--section-gap) 0;
}

.terminal {
  margin-top: 48px;
  background: rgba(10, 12, 24, 0.95);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 1px rgba(199, 211, 234, 0.12),
    inset 0 24px 48px rgba(199, 211, 234, 0.05),
    0 24px 32px rgba(6, 6, 14, 0.7);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: rgba(199, 211, 234, 0.04);
  border-bottom: 1px solid var(--glass-edge);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.r { background: #ff5f57; }
.terminal-dot.y { background: #febc2e; }
.terminal-dot.g { background: #28c840; }

.terminal-title {
  margin-left: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-muted);
}

.terminal pre {
  padding: 24px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-body);
}

.term-cmd { color: var(--blueprint); }
.term-str { color: #7dd3fc; }
.term-prop { color: #c4b5fd; }
.term-comment { color: #64748b; }

/* ── Code tabs ── */
.code-tabs {
  display: flex;
  gap: 4px;
  margin-top: 48px;
  margin-bottom: 0;
}

.code-tab {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  border-bottom: none;
}

.code-tab:hover {
  color: var(--fg-white);
  background: var(--luminous-subtle);
}

.code-tab.active {
  background: rgba(10, 12, 24, 0.95);
  color: var(--fg-white);
  box-shadow: inset 0 0 0 1px var(--glass-edge), 0 -1px 0 rgba(10, 12, 24, 0.95);
}

.code-demo:has(.code-tabs) .terminal {
  margin-top: 0;
  border-top-left-radius: 0;
}

.terminal.hidden {
  display: none;
}

.terminal-hint {
  padding: 12px 20px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.6;
  border-top: 1px solid var(--glass-edge);
}

.terminal-hint code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--fg-body);
}

/* ── FAQ ── */
.faq {
  padding: var(--section-gap) 0;
}

.faq-list {
  margin-top: 48px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.faq-item {
  border-bottom: 1px solid var(--glass-edge);
}

.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 20px 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--fg-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-q:hover {
  color: var(--fg-headline);
}

.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform 0.25s;
  color: var(--fg-muted);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.6;
  padding: 0;
}

.faq-a p {
  margin: 0;
}

.faq-item.open .faq-a {
  max-height: 400px;
  padding-bottom: 20px;
}

/* ── CTA banner ── */
.cta-banner {
  padding: var(--section-gap) 0;
  text-align: center;
}

.cta-banner-inner {
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  padding: clamp(40px, 6vw, 72px) clamp(24px, 4vw, 48px);
  box-shadow:
    inset 0 1px 1px rgba(199, 211, 234, 0.12),
    inset 0 24px 48px rgba(199, 211, 234, 0.05),
    0 24px 32px rgba(6, 6, 14, 0.6);
  position: relative;
  overflow: hidden;
}

.cta-banner-inner::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(102, 58, 243, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 500;
  color: var(--fg-white);
  margin-bottom: 12px;
  position: relative;
}

.cta-sub {
  color: var(--fg-body);
  font-size: 16px;
  margin-bottom: 32px;
  position: relative;
}

/* ── Footer ── */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--glass-edge);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

/* Ссылки футера — оферта, ПДн, контакты. inline-flex с высотой строки даёт
   им площадь касания: голым текстом они занимали 22 пикселя по высоте, а
   стоят рядом друг с другом, так что промах открывал соседний документ. */
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--fg-body);
}

.footer-copy {
  font-size: 13px;
  color: var(--fg-muted);
}

/* ── Legal pages ── */
/* Отдельной страницей <article class="legal"> лежит прямо в <main>, без
   .container: центровку и боковые поля даёт себе сам — теми же значениями,
   что и .container, иначе текст оферты прилипает к левому краю окна. В
   модалке эти отступы снимаются (.legal-modal .legal ниже). */
.legal {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px clamp(20px, 3vw, 40px) 64px;
}

.legal h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  color: var(--fg-white);
  margin-bottom: 24px;
  line-height: 1.2;
}

.legal h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--fg-white);
  margin: 40px 0 12px;
}

.legal p {
  margin-bottom: 16px;
  line-height: 1.7;
  color: var(--fg-body);
}

.legal b {
  color: var(--fg-white);
  font-weight: 500;
}

.legal a {
  color: var(--accent);
  text-decoration: none;
}

.legal a:hover {
  color: var(--accent-hover);
}

.legal .note {
  color: var(--fg-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-edge);
  margin-bottom: 24px;
}

/* ── Pricing page (shared table styles) ── */
.pricing-note {
  color: var(--fg-body);
  max-width: 720px;
  margin-bottom: 20px;
}

.input-field {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  color: var(--fg-body);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.input-field::placeholder {
  color: var(--fg-muted);
}

/* ── Pricing filters (поиск + производитель) ── */
.pricing-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pricing-filters .input-field {
  /* На широком — поиск шире, select у́же; на узком flex-wrap переносит их. */
  flex: 1 1 18rem;
}

#vendor-filter.input-field {
  flex: 0 1 12rem;
}

/* ── Pricing tabs (Все / Платные / Бесплатно) ── */
.pricing-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.pricing-tab {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}

.pricing-tab:hover {
  color: var(--fg-white);
  background: var(--luminous-subtle);
}

.pricing-tab.active {
  background: var(--accent);
  color: var(--fg-white);
  box-shadow: 0 0 24px var(--accent-glow);
}

/* ── Pricing page heading ── */
.page-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 3.5vw, 36px);
  color: var(--fg-white);
  margin-bottom: 16px;
}

/* ── Modal overlay (shared) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 14, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  z-index: 2;
}

.modal-close:hover {
  color: var(--fg-primary);
}

/* ── Image zoom modal ── */
/* Тот же каркас .modal-overlay/.modal-backdrop/.modal-close, но карточка
   становится прозрачной: внутри только изображение во весь размер без рамок. */
.image-modal .modal-card {
  max-width: min(92vw, 1280px);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.image-modal img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.image-modal .modal-close {
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  background: rgba(6, 6, 14, 0.7);
  border-radius: 50%;
  color: var(--fg-white);
  font-size: 22px;
}

/* ── Downloads section ── */
/* Сетка карточек GUI-клиентов: 2 в ряд на широком экране, 1 в столбик на
   узком. align-items не задаём — по умолчанию stretch, и grid сам вытягивает
   карточки под высоту самой высокой в ряду. Каждая карточка — flex-колонкой,
   чтобы прижать кнопку к низу: при разной длине описаний кнопки выстраиваются
   на одном уровне, а сами карточки одной высоты. */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.download-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-elevated);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  padding: var(--card-pad);
}

/* Картинки разной пропорции вписываем в один слот фиксированной высоты:
   object-fit:contain вписывает скриншот целиком без обрезки, а единая
   высота области делает карточки визуально одинаковыми. */
.download-shot-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 16px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  background: rgba(6, 6, 14, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

.download-shot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.download-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--fg-headline);
  margin: 0 0 6px;
}

.download-desc {
  color: var(--fg-body);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 16px;
}

/* Кнопка прижата к низу карточки: flex:1 на описании или margin-top:auto
   здесь — простой способ вытолкнуть ссылку в низ независимо от длины текста. */
.download-card .pill-btn {
  margin-top: auto;
}

/* ── Auth card (shared glass-card for login & registration modals) ── */
.modal-card.auth-card {
  background: var(--surface-elevated);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  padding: var(--card-pad);
  box-shadow:
    inset 0 1px 1px rgba(199, 211, 234, 0.12),
    inset 0 24px 48px rgba(199, 211, 234, 0.05),
    0 24px 32px rgba(6, 6, 14, 0.7);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-card .auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.auth-card .auth-field span {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}

.auth-card .auth-field small {
  color: var(--fg-muted);
  font-size: 12px;
}

.auth-card .auth-error {
  color: var(--danger);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
  text-align: center;
}

.auth-card .auth-alt {
  margin: 0;
  font-size: 14px;
  text-align: center;
  color: var(--fg-muted);
}

.auth-card .auth-alt a {
  color: var(--accent);
  font-weight: 500;
  transition: color 0.15s;
}

.auth-card .auth-alt a:hover {
  color: var(--accent-hover);
}

.auth-card .auth-divider {
  text-align: center;
  color: var(--fg-muted);
  font-size: 13px;
  margin: 4px 0;
  position: relative;
}

.auth-card .auth-divider::before,
.auth-card .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: var(--glass-edge);
}

.auth-card .auth-divider::before {
  left: 0;
}

.auth-card .auth-divider::after {
  right: 0;
}

.auth-card .auth-telegram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-card .auth-telegram-disabled {
  text-align: center;
  color: var(--fg-muted);
  font-size: 13px;
}

.auth-card .auth-passkey {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-card .auth-passkey button {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 24px;
  border: 1px solid var(--glass-edge-strong);
  border-radius: var(--radius-pill);
  background: var(--luminous-subtle);
  color: var(--fg-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.auth-card .auth-passkey button:hover:not(:disabled) {
  background: var(--luminous-fill);
  border-color: var(--glass-edge-strong);
  transform: translateY(-1px);
}

.auth-card .auth-passkey button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* ── Registration modal ── */
.modal-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--fg-headline) 0%, var(--fg-muted) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.modal-card > p {
  text-align: center;
  color: var(--fg-body);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.modal-card .auth-field input {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-card .auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-card .auth-field input::placeholder {
  color: var(--fg-muted);
  opacity: 0.5;
}

.modal-card .auth-field input[readonly] {
  background: var(--canvas);
  color: var(--accent);
  cursor: default;
}

.modal-card button[type="submit"] {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--fg-white);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.modal-card button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.modal-card button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

.modal-card button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* ── Legal modal ── */
.legal-modal .modal-card {
  max-width: 760px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.legal-modal .modal-card h2 {
  flex-shrink: 0;
  padding-right: 32px;
  text-align: left;
  margin-bottom: 1rem;
}

.legal-modal .modal-body {
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}

/* Стили .legal внутри модалки — те же, что на отдельной странице */
.legal-modal .legal {
  max-width: none;
  margin: 0;
  padding: 0;
}

.legal-modal .legal h1 {
  display: none;
}

/* ── Compare bar + modal ── */
#compare-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

#compare-hint {
  color: var(--fg-muted);
  font-size: 0.8rem;
}

#compare-bar {
  margin-left: auto;
}

#compare-bar .pill-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: none;
}

#compare-bar .pill-btn:not(:disabled) {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.compare-modal .modal-card {
  max-width: 720px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  padding: var(--card-pad);
  box-shadow:
    inset 0 1px 1px rgba(199, 211, 234, 0.12),
    inset 0 24px 48px rgba(199, 211, 234, 0.05),
    0 24px 32px rgba(6, 6, 14, 0.7);
}

.compare-modal .modal-card h2 {
  flex-shrink: 0;
  padding-right: 32px;
  text-align: left;
  margin-bottom: 1rem;
}

.compare-modal .modal-body {
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}

.compare-modal .models-table td:first-child {
  width: auto;
  text-align: left;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links .hide-mobile {
    display: none;
  }

  .hero-title {
    font-size: clamp(28px, 8vw, 42px);
  }

  .hero-cards {
    gap: 10px;
  }

  .hero-stat {
    min-width: 100px;
    padding: 14px 18px;
  }

  .hero-stat-num {
    font-size: 22px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    font-size: clamp(24px, 6vw, 34px);
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .faq-list {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .steps-list {
    gap: 24px;
  }
}
/* ══════════════════════════════════════════════════════════════════════
   Chat page
   ══════════════════════════════════════════════════════════════════════ */
.chat-page { padding-top: 40px; padding-bottom: 40px; }
.chat-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--fg-headline); margin-bottom: 4px; }
.chat-sub { font-size: 15px; color: var(--fg-muted); margin-bottom: 24px; }

.chat-layout { display: flex; gap: 24px; }
.chat-sidebar { width: 240px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--glass-edge); border-radius: var(--radius-md); padding: 16px; }
.chat-main { flex: 1; min-width: 0; }

.chat-model-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.chat-model-bar .input-field { margin-bottom: 0; }
.chat-balance {
  font-size: 14px; color: var(--fg-body); white-space: nowrap;
  padding: 10px 16px; background: var(--luminous-subtle);
  border-radius: var(--radius-sm); border: 1px solid var(--glass-edge);
  line-height: 1.4;
}

.chat-messages {
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  padding: 20px;
  min-height: 320px;
  max-height: 55vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-empty { color: var(--fg-muted); text-align: center; padding: 60px 20px; }

.chat-message { max-width: 85%; padding: 10px 14px; border-radius: var(--radius-sm); line-height: 1.55; font-size: 14px; }
.chat-msg-user { align-self: flex-end; background: var(--accent); color: #fff; }
.chat-msg-assistant { align-self: flex-start; background: var(--luminous-fill); color: var(--fg-body); }
.chat-message pre { background: rgba(0,0,0,.25); padding: 10px 14px; border-radius: var(--radius-sm); overflow-x: auto; margin: 6px 0; font-family: var(--font-mono); font-size: 13px; }
.chat-message code { font-family: var(--font-mono); font-size: 13px; background: rgba(0,0,0,.15); padding: 1px 4px; border-radius: 3px; }
.chat-message pre code { background: none; padding: 0; }

.chat-input-row { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.chat-textarea { resize: none; flex: 1; min-height: 44px; }
.chat-input-row .pill-btn { flex-shrink: 0; align-self: center; }

.chat-retry-btn {
  display: block; margin-top: 4px; background: none; border: none;
  color: var(--fg-muted); cursor: pointer; font-size: 13px; padding: 2px 4px;
  opacity: 0; transition: opacity .15s;
}
.chat-msg-user:hover .chat-retry-btn { opacity: 1; }
.chat-retry-btn:hover { color: var(--accent); }

.chat-usage-line { font-size: 11px; color: var(--fg-muted); margin-top: 4px; }

/* Размышления reasoning-моделей: стрим идёт в delta.reasoning, а content
   приходит в конце — без блока генерация выглядит пустым ответом. Пока
   ответа нет, блок раскрыт (виден прогресс), с первым токеном ответа
   сворачивается сам (см. chat.html). */
.chat-reasoning {
  margin-bottom: 6px; font-size: 12px; color: var(--fg-muted);
  border-left: 2px solid var(--glass-edge); padding-left: 10px;
}
.chat-reasoning summary {
  cursor: pointer; user-select: none; color: var(--fg-muted);
  list-style: none;
}
.chat-reasoning summary::before { content: '▸ '; }
.chat-reasoning[open] summary::before { content: '▾ '; }
.chat-reasoning-body {
  white-space: pre-wrap; word-break: break-word;
  max-height: 200px; overflow-y: auto; margin-top: 4px; opacity: .85;
}
.chat-answer { min-width: 0; }

/* Гостевой экран /chat: чат только для авторизованных, анониму —
   предложение зарегистрироваться вместо пустой формы. */
.chat-guest { text-align: center; padding: 90px 20px; }
.chat-guest .chat-sub { max-width: 520px; margin: 0 auto 24px; }
.chat-guest-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── RAG-проекты в сайдбаре чата ── */
.chat-side-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--fg-muted); margin: 14px 0 6px;
}
.chat-icon-btn {
  background: none; border: none; color: var(--fg-muted); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.chat-icon-btn:hover { color: var(--accent); background: var(--luminous-fill); }

.chat-projects-list { display: flex; flex-direction: column; gap: 2px; }
.chat-project-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
}
.chat-project-item:hover { background: var(--luminous-fill); }
.chat-project-item.active { background: var(--luminous-fill); color: var(--accent); }
.chat-project-item .chat-history-title {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-project-meta { font-size: 11px; color: var(--fg-muted); flex-shrink: 0; }
.chat-project-name {
  font-size: 13px; padding: 4px 8px; flex: 1; min-width: 0;
  /* Инлайн-форма живёт в flex-строке: обнуляем глобальные поля .input-field
     (margin-bottom форм, width:100%) — иначе поле смещало центрирование,
     и кнопки ✓/× оказывались ниже строки ввода. */
  margin-bottom: 0; width: auto; max-width: none;
}

/* Файлы проекта: статус слева, имя и подпись состояния, удалить справа. */
.chat-files { margin-top: 14px; }
.chat-files-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.chat-file-item {
  display: flex; align-items: center; gap: 6px; padding: 5px 26px 5px 8px;
  border-radius: var(--radius-sm); font-size: 12px;
  /* position: relative + правый паддинг — якорь для абсолютно
     позиционированного крестика удаления (.chat-history-del): без него
     кнопка цеплялась к дальнему предку и не была видна в строке. */
  position: relative;
}
.chat-file-item:hover { background: var(--luminous-fill); }
.chat-file-status { flex-shrink: 0; width: 14px; text-align: center; }
.chat-file-item.st-ready .chat-file-status { color: var(--success, #22c55e); }
.chat-file-item.st-failed .chat-file-status { color: var(--danger, #ef4444); }
.chat-file-item.st-failed .chat-file-meta { color: var(--danger, #ef4444); }
.chat-file-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-file-meta { color: var(--fg-muted); flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-files-empty { font-size: 12px; color: var(--fg-muted); padding: 6px 8px; }
.chat-upload-btn {
  display: inline-block; font-size: 11px; cursor: pointer; padding: 2px 8px;
  border: 1px solid var(--glass-edge); border-radius: var(--radius-sm);
}
.chat-upload-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Раздел архива: скрытые из работы чаты и проекты; отсюда же — полное
   удаление (в рабочих списках только архивация). */
.chat-archive { margin-top: 14px; }
.chat-svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }

/* Полоса прикреплённых файлов под окном чата: чипы с именем, статусом
   индексации и удалением. */
.chat-files-strip {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.chat-file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 8px; border-radius: var(--radius-sm);
  background: var(--luminous-fill); border: 1px solid var(--glass-edge);
  max-width: 260px;
}
.chat-file-chip .chat-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-chip .chat-file-meta { color: var(--fg-muted); flex-shrink: 0; }
.chat-file-chip.st-failed { border-color: rgba(239, 68, 68, .4); }
.chat-file-chip.st-failed .chat-file-meta { color: var(--danger, #ef4444); }
.chat-file-chip .chat-icon-btn { flex-shrink: 0; display: inline-flex; padding: 0 2px; }

/* Скрепка прикрепления — квадратная кнопка слева от поля ввода. */
.chat-attach-btn {
  flex-shrink: 0; align-self: center; cursor: pointer;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-edge); background: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-muted);
}
.chat-attach-btn:hover { color: var(--accent); border-color: var(--accent); }
.chat-arch-item {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  border-radius: var(--radius-sm); cursor: default; font-size: 12px;
  opacity: .8;
}
.chat-arch-item:hover { background: var(--luminous-fill); opacity: 1; }
.chat-arch-kind {
  flex-shrink: 0; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--fg-muted); border: 1px solid var(--glass-edge);
  border-radius: 3px; padding: 0 4px; max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}



.chat-warning-banner {
  margin-top: 8px; padding: 8px 12px; font-size: 12px;
  background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm); color: var(--danger);
}
.chat-warning-banner a { color: var(--accent); }

/* Delete modal */
.chat-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 6, 15, 0.85); backdrop-filter: blur(6px);
}
.chat-modal-card {
  background: var(--surface); border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md); padding: 24px; max-width: 360px; width: 90%;
  text-align: center;
}
.chat-modal-card p { margin-bottom: 20px; font-size: 15px; color: var(--fg-body); }
.chat-modal-actions { display: flex; gap: 10px; justify-content: center; }
.pill-danger {
  background: var(--danger); color: #fff; border: none;
  padding: 10px 24px; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: opacity .2s;
}
.pill-danger:hover { opacity: 0.85; }

.chat-history-list { display: flex; flex-direction: column; gap: 4px; }
.chat-history-item {
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; transition: background .15s;
  /* Одна строка: тема с обрезкой, иконка архива прижата вправо. */
  display: flex; align-items: center; gap: 4px; position: relative;
}
.chat-history-item .chat-history-title { flex: 1; min-width: 0; }
.chat-history-model { display: none; }
.chat-history-item .chat-icon-btn { flex-shrink: 0; display: inline-flex; padding: 2px; }
.chat-history-item:hover { background: var(--luminous-subtle); }
.chat-history-item.active { background: var(--luminous-fill); border-color: var(--glass-edge); }
.chat-history-title { font-size: 13px; font-weight: 500; color: var(--fg-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-history-model { font-size: 11px; color: var(--fg-muted); }
.chat-history-del {
  position: absolute; top: 6px; right: 6px;
  background: none; border: none; color: var(--fg-muted); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 4px;
}
.chat-history-del:hover { color: var(--danger); }

@media (max-width: 860px) {
  .chat-layout { flex-direction: column; }
  .chat-sidebar { width: 100%; }
}

/* ── Referral section ── */
.referral {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}
.referral-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.referral-step {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  transition: border-color .2s, transform .2s;
}
.referral-step:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.referral-step-icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  color: var(--accent);
}
.referral-step-icon svg {
  width: 100%; height: 100%;
}
.referral-step-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--fg);
}
.referral-step-desc {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── Уведомление о cookie ──
   Position fixed и hidden по умолчанию: баннер не участвует в потоке и не
   двигает содержимое (CLS), а показывается скриптом только тому, кто его ещё
   не закрывал — постоянный посетитель не видит вспышки баннера при каждой
   загрузке. */
.cookie-notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: none;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: var(--surface-modal);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 32px rgba(6, 6, 14, 0.7);
  backdrop-filter: blur(12px);
}
.cookie-notice.open {
  display: flex;
}
.cookie-notice-text {
  flex: 1 1 320px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-muted);
}
.cookie-notice-text a {
  color: var(--fg-body);
  text-decoration: underline;
}
