/* StarPath — Design System
 * Two themes: Obsidian (default, тёмная) + Aurum (светлая, нейтральная)
 */

/* Кириллица обязана быть в самой гарнитуре: Instrument Serif, с которого
   начинался дизайн, отдаёт только latin/latin-ext, и русские заголовки молча
   уезжали в системный фолбэк. По той же причине мимо прошёл Newsreader —
   ближайшая опенсорсная замена эпловскому New York, но без кириллицы вовсе.
   У Source Serif 4 и Inter она полная. */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..700;1,14..32,300..700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300..700;1,8..60,300..700&display=swap');

:root {
  /* OBSIDIAN — Default theme */
  --bg-base: #0a0816;
  --bg-raised: #14102a;
  --bg-elevated: #1c1736;
  --bg-glass: rgba(20, 16, 42, 0.65);

  --line: #2a2342;
  --line-soft: #1f1a36;
  --line-strong: #3d3458;

  --ink-primary: #f4ede0;
  --ink-secondary: #c2b8a8;
  --ink-muted: #8b82a8;
  --ink-faint: #5a5478;

  --gold: #c9a961;
  --gold-dim: #937a3f;
  --gold-glow: rgba(201, 169, 97, 0.18);

  --rose: #c47a8a;
  --celest: #7a8fc4;
  --sage: #8aa896;
  --signal: #d97757;

  --shadow-soft: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 60px -20px rgba(0,0,0,0.6);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 30px 80px -30px rgba(0,0,0,0.8);

  --noise-opacity: 0.06;

  /* Два семейства на весь продукт: сайт, PDF, письма, карточки.
     Source Serif 4 — заголовки и длинная проза, Inter — всё остальное,
     включая надстрочники и метки, которые раньше набирались моноширинным.

     До этого семейств было шесть: Playfair Display, Literata, Geist,
     JetBrains Mono, Cormorant Garamond и системный стек в письмах. Два из
     них не использовались нигде, а кодовый моношрифт работал акцентом в
     полутора сотнях мест и спорил со всем остальным набором. */
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Моноширинный остался ровно для одного: логов и JSON в админке, где
     колонки держит сам шрифт. Это системный стек, а не пятое загружаемое
     семейство, — на вес страницы он не влияет и в дизайн-систему не лезет. */
  --font-code: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Единый горизонтальный отступ приложения: по нему выравниваются топбар,
     подменю кабинета/админки и контент секций — иначе меню шире контента. */
  --gutter: clamp(16px, 5vw, 56px);
}

[data-theme="aurum"] {
  --bg-base: #eceef2;
  --bg-raised: #f5f6f9;
  --bg-elevated: #fbfbfd;
  --bg-glass: rgba(245, 246, 249, 0.72);

  --line: #c8ccd6;
  --line-soft: #dadde4;
  --line-strong: #a4aab8;

  --ink-primary: #14161c;
  --ink-secondary: #333844;
  --ink-muted: #5c6474;
  --ink-faint: #868d9c;

  --gold: #74601f;
  --gold-dim: #57481a;
  --gold-glow: rgba(116, 96, 31, 0.14);

  --rose: #a44a3f;
  --celest: #1e2845;
  --sage: #4a6450;
  --signal: #a44a3f;

  --shadow-soft: 0 1px 0 rgba(255,255,255,0.6) inset, 0 14px 36px -22px rgba(20,24,34,0.22);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.6) inset, 0 24px 60px -32px rgba(20,24,34,0.28);

  --noise-opacity: 0.03;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* Form elements должны наследовать цвет/шрифт от родителя,
   иначе UA-дефолт (ButtonText/чёрный) рендерится поверх тёмного фона
   в кликабельных карточках вроде <button class="card">. */
button, input, select, textarea {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

body {
  background: var(--bg-base);
  color: var(--ink-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.005em;
}

/* Subtle film grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  /* Тайл вместо feTurbulence: SVG-фильтр заставляет браузер растеризовать слой
     заново на каждое изменение размера. Генерится scripts/gen_paper_noise.py. */
  background-image: url("/film-grain.png");
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: var(--noise-opacity);
  mix-blend-mode: overlay;
}

/* ——— TYPOGRAPHY ——— */
.display, .display-xl, .display-lg, .display-md {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.display-xl { font-size: clamp(44px, 6.6vw, 96px); }
.display-lg { font-size: clamp(48px, 6vw, 92px); }
.display-md { font-size: clamp(32px, 4vw, 56px); }

.italic { font-style: italic; }

.mono {
  font-family: var(--font-ui);
  font-feature-settings: 'tnum', 'zero';
}

/* Надстрочники и метки. Раньше набирались JetBrains Mono: моноширинный
   шрифт ради разрядки в заглавных — это лишнее семейство на всём сайте.
   Inter делает ту же работу, но кегль и насыщенность приходится добирать:
   у моно буквы шире и оптически крупнее при том же размере. */
.eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

.label {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

h1,h2,h3,h4 { font-weight: 400; margin: 0; }
p { margin: 0; text-wrap: pretty; }

/* ——— BUTTONS ——— */
.btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--ink-primary);
  transition: all 160ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink-primary);
  color: var(--bg-base);
  border-color: var(--ink-primary);
}
.btn-primary:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-base);
}
.btn-ghost {
  border-color: var(--line);
  color: var(--ink-primary);
}
.btn-ghost:hover { border-color: var(--ink-primary); }
.btn-gold {
  background: var(--gold);
  color: var(--bg-base);
  border-color: var(--gold);
}
.btn-gold:hover { filter: brightness(1.08); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.btn-icon:hover { border-color: var(--ink-primary); }

/* ——— CARDS / SURFACES ——— */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.hairline { border-top: 1px solid var(--line); }
.hairline-v { border-left: 1px solid var(--line); }

/* ——— APP CHROME ——— */
.app-frame {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top role-switcher (prototype helper) */
.role-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: var(--bg-glass);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.role-bar-left { display: flex; align-items: center; gap: 28px; }
.role-pill-row { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-raised); }
.role-pill {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-muted);
  border: none;
  background: transparent;
  transition: all 160ms ease;
}
.role-pill.active { background: var(--ink-primary); color: var(--bg-base); }
.role-pill:not(.active):hover { color: var(--ink-primary); }

.subnav {
  display: flex; align-items: center; gap: 24px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  overflow-x: auto;
}
.subnav-link {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: all 160ms ease;
  white-space: nowrap;
  background: none; border: none; border-bottom: 1px solid transparent;
}
.subnav-link.active { color: var(--ink-primary); border-bottom-color: var(--gold); }
.subnav-link:hover { color: var(--ink-primary); }
/* Точка «есть непрочитанный ответ». Единственный сигнал в кабинете о том,
   что поддержка ответила, — раньше человек узнавал об этом, только если сам
   заходил в раздел. */
.subnav-dot {
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* ——— ВИТРИНА КАБИНЕТА ——— */
/* Две колонки: разборов четыре, и auto-fit на обычной ширине раскладывал их по
   три — четвёртый оставался один в новой строке. */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 720px) {
  .shop-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ——— SIDE NAV ——— */
/*
   Разделы кабинета и админки стояли лентой под шапкой. В кабинете их семь, в
   админке тринадцать — лента уезжала в горизонтальную прокрутку, и половина
   разделов существовала только для тех, кто догадался её проскроллить. Сбоку
   помещаются все сразу, а в админке ещё и группами: «Аналитика» и «Система»
   ищутся глазами быстрее, чем тринадцать равных кнопок подряд.

   Ширина фиксированная: колонка, которая едет вместе с контентом, сбивает
   привычное место пункта при каждом переходе.
*/
.panel-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - 64px);
}
.panel-side {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 24px;
  border-right: 1px solid var(--line-soft);
  min-height: calc(100vh - 64px);
}
.panel-side-group { display: flex; flex-direction: column; gap: 2px; }
.panel-side-title {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint, var(--ink-muted));
  padding: 0 10px 6px;
}
.panel-side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-muted);
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.panel-side-link:hover { background: var(--bg-raised); color: var(--ink-primary); }
.panel-side-link.active { background: var(--bg-raised); color: var(--ink-primary); }
/* Активный раздел помечен полосой слева, а не только цветом: цветовой разницы
   в тёмной теме не хватает, чтобы отличить активный пункт от наведённого. */
.panel-side-link.active { box-shadow: inset 2px 0 0 var(--gold); }
/* Заказ — не такой же пункт, как остальные: это то, ради чего кабинет
   существует, и раньше он был кнопкой в углу, которую не находили. */
.panel-side-cta {
  color: var(--bg-base);
  background: var(--gold);
  margin-bottom: 4px;
}
.panel-side-cta:hover { background: var(--gold); color: var(--bg-base); filter: brightness(1.08); }
.panel-side-cta.active { background: var(--gold); color: var(--bg-base); box-shadow: none; }
.panel-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
/* Отступы задаёт сам раздел (у каждого свой .section с padding) — добавь их
   здесь, и слева получится двойной жёлоб. */
.panel-main { min-width: 0; }

/* Полоса с кнопкой меню — только на узком экране. */
.panel-bar { display: none; }

/* Узкий экран: колонка сбоку съела бы половину ширины, поэтому она уезжает за
   край и открывается кнопкой.
   Лентой сверху разделы жили до этого, и вели себя ровно так же, как в
   подшапке: уезжали за правый край. В мини-аппе, где экран узкий всегда, это
   означало, что половина кабинета доступна только через горизонтальную
   прокрутку, о которой никто не догадывается. */
@media (max-width: 900px) {
  .panel-shell { grid-template-columns: minmax(0, 1fr); }

  .panel-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px var(--gutter);
    border-bottom: 1px solid var(--line-soft);
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg-base);
  }
  .panel-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-raised);
    color: var(--ink-primary);
    cursor: pointer;
  }
  /* Название текущего раздела рядом с кнопкой: закрыв панель, человек иначе не
     видит, где находится. */
  .panel-bar-title { font-family: var(--font-ui); font-size: 14px; }

  .panel-side {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    /* Выше шапки сайта (z-index 100): под ней прятался первый пункт панели —
       золотой «Новый разбор», ровно тот, ради которого меню и открывают.
       Выдвижное меню и должно перекрывать всё, включая шапку. */
    z-index: 120;
    width: min(78vw, 300px);
    min-height: 100vh;
    overflow-y: auto;
    background: var(--bg-base);
    border-right: 1px solid var(--line-soft);
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }
  .panel-side.open { transform: translateX(0); }

  .panel-scrim {
    position: fixed;
    inset: 0;
    /* Между шапкой и панелью: затемнение обязано накрывать и шапку тоже,
       иначе «Выйти» остаётся кликабельным поверх открытого меню. */
    z-index: 110;
    background: rgba(0, 0, 0, 0.5);
  }
}

/* Уважение к системной настройке: панель, которая выезжает рывком, для
   человека с укачиванием хуже, чем панель, которая просто появляется. */
@media (prefers-reduced-motion: reduce) {
  .panel-side { transition: none; }
}

/* ——— LOGO ——— */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  text-decoration: none;
}
.logo-mark {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ——— INPUTS ——— */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-primary);
  transition: border-color 160ms ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--gold);
}
.input-bare {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
}
.input-bare:focus { outline: none; border-bottom-color: var(--gold); }

.field { display: block; }
.field > .label { display: block; margin-bottom: 6px; }

/* ——— BADGES / CHIPS ——— */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
}
.chip-gold {
  background: var(--gold-glow);
  border-color: var(--gold-dim);
  color: var(--gold);
}
.chip-rose { color: var(--rose); border-color: color-mix(in oklab, var(--rose) 50%, transparent); background: color-mix(in oklab, var(--rose) 10%, transparent); }
.chip-sage { color: var(--sage); border-color: color-mix(in oklab, var(--sage) 50%, transparent); background: color-mix(in oklab, var(--sage) 10%, transparent); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted); display: inline-block; }
.dot-gold { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot-rose { background: var(--rose); }
.dot-sage { background: var(--sage); }

/* ——— SCROLLBARS ——— */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* ——— UTILITY ——— */
.section { padding: 96px 56px; position: relative; }
.section-sm { padding: 56px 56px; }
.section-lg { padding: 140px 56px; }
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; } .gap-10 { gap: 40px; } .gap-12 { gap: 48px; }
.center { display: flex; align-items: center; justify-content: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--ink-muted); }
.secondary { color: var(--ink-secondary); }
.gold { color: var(--gold); }
.rose { color: var(--rose); }
.sage { color: var(--sage); }
.celest { color: var(--celest); }

.grid { display: grid; }
.relative { position: relative; }
.absolute { position: absolute; }
.full { width: 100%; }

.divider { height: 1px; background: var(--line); width: 100%; }
.divider-v { width: 1px; background: var(--line); height: 100%; align-self: stretch; }

/* keyframes for natal chart */
@keyframes orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
/* Бегущая строка (контент утроён → сдвиг на 1/3 = один набор, бесшовный цикл). */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-33.333%); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 4px var(--gold-glow)); }
  50% { filter: drop-shadow(0 0 16px var(--gold)); }
}
@keyframes drift {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 600ms ease both; }

/* ——— responsive ——— */
/* Натальное колесо в hero масштабируется по ширине колонки (а не фикс. 520px). */
.hero-chart { position: relative; width: 100%; max-width: 520px; margin: 0 auto; }
.hero-chart > svg { width: 100%; height: auto; display: block; }

/* Оболочка мастера заказа: десктопный паддинг + мобильный. */
.wizard-shell { --wz-pad: 56px; padding: 40px var(--wz-pad) 32px; }

/* Панель «Назад / Дальше» липнет к нижней кромке экрана: шаги визарда длиннее
   одного экрана (4 карточки продуктов, форма данных), и без этого кнопка
   «Дальше» остаётся под фолдом — юзер не понимает, что делать. Раскрываем её
   отрицательными margin'ами на всю ширину оболочки, чтобы контент не
   просвечивал по бокам. */
/* Кнопки шага. Липкими они остаются — на длинных шагах «Дальше» иначе уезжает
   под фолд, — но без собственной плашки: полоса с рамкой и подложкой резала
   страницу пополам и читалась как чужой элемент поверх контента. */
.wizard-nav {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin: 48px 0 0;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.wizard-nav > * { pointer-events: auto; }

/* ——— Сводка кабинета («Сегодня») ——— */
/* Четыре плитки одинаковой высоты: короткий список и ссылка в раздел. Кнопка
   прижата к низу через margin-top:auto, иначе у соседних плиток с разным
   числом строк ссылки «Все разборы» и «Весь месяц» встают на разной высоте и
   сетка выглядит съехавшей. */
.cab-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
.cab-tile {
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
}
.cab-tile-cta { align-self: flex-start; margin-top: auto; }
/* Развёрнутый прогноз на главной — во всю ширину сводки. */
.cab-tile-wide { grid-column: 1 / -1; }

/* Строка списка внутри плитки: кликабельна целиком, но по весу это строка,
   а не кнопка — рамка только снизу, как разделитель. */
.cab-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 160ms;
}
.cab-line:last-child { border-bottom: none; }
.cab-line:hover { color: var(--gold); }
.cab-line:hover .muted { color: var(--ink-secondary); }

@media (max-width: 900px) {
  .section { padding: 56px 24px; }
  .section-sm { padding: 32px 24px; }
  .section-lg { padding: 72px 24px; }
  .role-bar { padding: 12px 16px; }
  .subnav { padding: 8px var(--gutter); }

  /* Любой многоколоночный grid сворачивается в одну колонку. */
  .rgrid { grid-template-columns: 1fr !important; }
  .cab-tiles { grid-template-columns: 1fr; gap: 16px; }
  .cab-tile { padding: 22px; }
  /* Сетки из карточек: 2 колонки на планшете. */
  .rgrid-2 { grid-template-columns: repeat(2, 1fr) !important; }

  /* Hero: копи сверху, колесо снизу. */
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    padding: 32px 24px 56px !important;
    min-height: auto !important;
  }
  .hero-copy { max-width: 100% !important; }

  /* Шапки секций «заголовок + подпись» стекаются. */
  .between-stack { flex-direction: column; align-items: flex-start !important; gap: 16px; }

  /* «Как это работает»: вертикальные разделители → горизонтальные. */
  .howit-grid > div { border-right: none !important; border-bottom: 1px solid var(--line); }
  .howit-grid > div:last-child { border-bottom: none; }

  /* Плашка «правило второй недели»: иконка над текстом, а не сбоку — иначе
     на телефоне она съедает колонку и текст читается в два слова в строку. */
  .how-payoff { flex-direction: column; gap: 14px !important; }

  /* FAQ: левая колонка перестаёт «липнуть». */
  .faq-aside { position: static !important; top: auto !important; }

  /* Навигация лендинга: прячем центральные ссылки, оставляем лого + кнопки. */
  .landing-nav { grid-template-columns: 1fr auto !important; gap: 16px !important; padding: 14px 20px !important; }
  .landing-nav-links { display: none !important; }

  /* Футер — свои стили и адаптив в /site-footer.css (общий со статикой). */

  /* Мастер заказа. */
  .wizard-shell { --wz-pad: 20px; padding: 32px var(--wz-pad) 24px; }
}

@media (max-width: 560px) {
  .rgrid-2 { grid-template-columns: 1fr !important; }
  /* Ряды из инпутов/селектов/кнопок (форма персоны, билдер совместимости)
     складываются в столбец, чтобы не переполнять узкий экран. */
  .row-stack { flex-direction: column; align-items: stretch; gap: 12px !important; }
  .row-stack > * { width: 100%; }
  /* Плавающие подписи у колеса встают в поток под ним. */
  .hero-chart .card-glass {
    position: static !important;
    max-width: 100% !important;
    margin: 12px 0 0 !important;
  }
}

/* ——— SELECT (свой, вместо системного) ———
   Нативный <select> рисует список средствами ОС: на тёмной теме он выпадает
   светлым системным меню. Здесь список — обычная разметка, поэтому подчиняется
   тем же переменным, что и остальные поля.

   Дублируется в app.css для легаси-страниц: SPA грузит только этот файл,
   а /login и /privacy — только app.css. */
.ui-select { position: relative; width: 100%; }

.ui-select-trigger {
  width: 100%;
  min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.ui-select-trigger:focus-visible,
.ui-select.open .ui-select-trigger {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-glow);
}
.ui-select.disabled .ui-select-trigger { opacity: 0.5; cursor: not-allowed; }

.ui-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select-value.placeholder { color: var(--ink-faint); }

.ui-select-chev { flex: none; color: var(--ink-muted); transition: transform 160ms ease; }
.ui-select.open .ui-select-chev { transform: rotate(180deg); }

.ui-select-menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.ui-select-search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
}
/* Перебиваем .input: поиск стоит внутри поля и иначе получил бы вторую рамку. */
.ui-select-search input,
.field .ui-select-search input {
  flex: 1; min-width: 0; width: auto;
  min-height: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-family: var(--font-ui); font-size: 14px; color: var(--ink-primary);
}
.ui-select-search input:focus,
.field .ui-select-search input:focus {
  outline: none; border: none; box-shadow: none;
}
.ui-select-search input::placeholder { color: var(--ink-faint); }

/* Ограничение по высоте — в списке часовых поясов больше 40 пунктов. */
.ui-select-list { max-height: 264px; overflow-y: auto; padding: 6px; }

.ui-select-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--ink-secondary);
  cursor: pointer;
}
.ui-select-option.active { background: var(--bg-raised); color: var(--ink-primary); }
.ui-select-option.selected { color: var(--gold); }
.ui-select-option-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select-option-hint {
  flex: none;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink-faint);
}
.ui-select-tick { flex: none; color: var(--gold); }

.ui-select-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

/* ——— ДАТА / ВРЕМЯ (ui-datetime.jsx) ———
   Нативные input[type=date|time] выпадают системным календарём: светлым на
   тёмной теме и мимо нашей типографики. Здесь всплывашка — обычная разметка,
   поэтому подчиняется тем же переменным, что .input и .ui-select. */
.ui-dt { position: relative; width: 100%; }
.ui-dt-control { position: relative; }
/* Место под кнопку пикера внутри поля. */
.ui-dt-input { padding-right: 42px; }
.ui-dt-input::placeholder { color: var(--ink-faint); }
.ui-dt.open .ui-dt-input {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-glow);
}
.ui-dt-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 8px;
  color: var(--ink-muted); cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.ui-dt-btn:hover { color: var(--gold); background: var(--bg-raised); }
.ui-dt-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ui-dt.open .ui-dt-btn { color: var(--gold); }

.ui-dt-pop {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  padding: 10px;
}
.ui-dt-pop.up { top: auto; bottom: calc(100% + 6px); }
.ui-dt-cal { width: 292px; max-width: calc(100vw - 32px); }
.ui-dt-time { width: 208px; }

.ui-dt-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.ui-dt-nav {
  flex: none; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 8px;
  color: var(--ink-muted); cursor: pointer;
}
.ui-dt-nav:hover { color: var(--ink-primary); background: var(--bg-raised); }
.ui-dt-title {
  flex: 1; min-width: 0;
  background: transparent; border: none; border-radius: 8px;
  padding: 6px 8px;
  font-family: var(--font-ui); font-size: 13.5px;
  color: var(--ink-primary); cursor: pointer;
}
.ui-dt-title:hover { background: var(--bg-raised); color: var(--gold); }

.ui-dt-week {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 2px;
}
.ui-dt-week span {
  text-align: center;
  font-family: var(--font-ui); font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint);
  padding: 4px 0;
}

.ui-dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ui-dt-grid.months { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ui-dt-grid.years { grid-template-columns: repeat(4, 1fr); gap: 4px; }

.ui-dt-day, .ui-dt-cell {
  background: transparent; border: none; border-radius: 9px;
  color: var(--ink-secondary); cursor: pointer;
  font-family: var(--font-ui); font-size: 12.5px;
  transition: background 120ms ease, color 120ms ease;
}
.ui-dt-day { height: 34px; }
.ui-dt-cell { height: 34px; font-family: var(--font-ui); font-size: 13px; }
.ui-dt-day:hover, .ui-dt-cell:hover { background: var(--bg-raised); color: var(--ink-primary); }
.ui-dt-day.empty { pointer-events: none; }
/* Сегодня — только точкой снизу: выбранная дата должна оставаться единственным
   золотым пятном в сетке. */
.ui-dt-day.today { position: relative; color: var(--ink-primary); }
.ui-dt-day.today::after {
  content: ''; position: absolute; left: 50%; bottom: 5px;
  width: 3px; height: 3px; margin-left: -1.5px;
  border-radius: 50%; background: var(--ink-muted);
}
.ui-dt-day.selected, .ui-dt-cell.selected {
  background: var(--gold-glow);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold-dim);
}
.ui-dt-day.selected.today::after { background: var(--gold); }

.ui-dt-cols { display: flex; gap: 6px; }
.ui-dt-col { flex: 1; min-width: 0; }
.ui-dt-col-cap {
  font-family: var(--font-ui); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); text-align: center; padding: 2px 0 6px;
}
.ui-dt-col-list {
  max-height: 208px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding-right: 2px;
}
.ui-dt-tick {
  flex: none; padding: 7px 0;
  background: transparent; border: none; border-radius: 8px;
  font-family: var(--font-ui); font-size: 13px;
  color: var(--ink-secondary); cursor: pointer;
}
.ui-dt-tick:hover { background: var(--bg-raised); color: var(--ink-primary); }
.ui-dt-tick.selected {
  background: var(--gold-glow); color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold-dim);
}

.ui-dt-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.ui-dt-link {
  background: transparent; border: none; padding: 2px 4px;
  font-family: var(--font-ui); font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-muted); cursor: pointer;
}
.ui-dt-link:hover { color: var(--gold); }

/* ——— МОДАЛКА И ТОСТ ИЗ app.js ———
   window.astro.confirm/prompt/toast рисуют разметку классами .modal-bg,
   .modal, .toast. Их стили лежали только в app.css, а SPA подключает эту
   таблицу — поэтому окно подтверждения приходило голым блоком в конец
   страницы. Дублируем правила здесь, на токенах редизайна. */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10, 8, 22, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
}
.modal-bg.open, .modal-bg.shown { display: flex; }
.modal {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-card);
}
.modal h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink-primary);
}
.modal .subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-secondary);
}
.modal .field { margin-bottom: 4px; }
.modal .field > label {
  display: block; margin-bottom: 6px;
  font-size: 13px; color: var(--ink-secondary);
}
.modal input[type="text"], .modal input[type="password"], .modal input[type="email"] {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-primary);
}
.modal input:focus { outline: none; border-color: var(--gold); }
.modal .status { font-size: 13px; min-height: 18px; margin-top: 8px; color: var(--ink-secondary); }
.modal .status.error { color: var(--rose); }
/* app.js пишет классы старой сетки — .btn ghost / .btn danger, а не .btn-ghost. */
.modal .btn { border-color: var(--line); }
.modal .btn.ghost { background: transparent; color: var(--ink-primary); }
.modal .btn.ghost:hover { border-color: var(--ink-primary); }
.modal .btn:not(.ghost):not(.danger) {
  background: var(--gold); border-color: var(--gold); color: var(--bg-base);
}
.modal .btn.danger {
  background: var(--rose); border-color: var(--rose); color: var(--bg-base);
}

.toast {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1100;
  max-width: 360px;
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-primary);
  cursor: pointer;
}
.toast.error { border-color: var(--rose); }
.toast.success { border-color: var(--gold); }
.toast.hide { opacity: 0; transition: opacity 200ms ease; }
#toast-host .toast { position: static; margin-top: 10px; }
#toast-host {
  position: fixed; bottom: 24px; right: 24px; z-index: 1100;
  display: flex; flex-direction: column; align-items: flex-end;
}
