/* BeautyBook Mini App — редакционная визуальная система «Editorial Beauty».
   Тёплый молочный фон, почти-чёрный тёплый текст, приглушённый винный
   акцент, тонкие линии вместо теней. Тема: системная (prefers-color-scheme)
   + явная тема Telegram через data-theme (tg.colorScheme). Шрифты
   системные (кириллица в обоих стеках), внешние загрузки не выполняются. */

:root {
  color-scheme: light dark;

  /* Светлая палитра */
  --l-bg: #f3eee4;          /* тёплый молочный фон */
  --l-surface: #fbf8f2;     /* возвышенная поверхность */
  --l-surface-2: #eae2d3;   /* мягкая нейтральная поверхность */
  --l-ink: #221a14;         /* почти чёрный тёплый текст */
  --l-muted: #7c6b5c;       /* спокойная вторичная информация */
  --l-line: #dbd0bd;        /* тонкий разделитель */
  --l-accent: #7b2d3c;      /* приглушённый винный акцент */
  --l-accent-strong: #641f2c;
  --l-accent-soft: #eee0d8; /* деликатная подложка выбранного */
  --l-on-accent: #faf5ed;
  --l-danger: #9c3726;
  --l-success: #55693f;     /* олива */
  --l-mark: #ebe0d0;        /* типографический знак на главной */
  --l-ring: rgba(34, 26, 20, 0.25);

  /* Тёмная палитра (тёплая, не сине-чёрная) */
  --d-bg: #161210;
  --d-surface: #1f1a15;
  --d-surface-2: #2b241c;
  --d-ink: #f0e7da;
  --d-muted: #a4917d;
  --d-line: #372d23;
  --d-accent: #d39ba1;
  --d-accent-strong: #dfb1b6;
  --d-accent-soft: #3a2a2b;
  --d-on-accent: #1d1411;
  --d-danger: #e08a72;
  --d-success: #9db388;
  --d-mark: #2c241e;
  --d-ring: rgba(240, 231, 218, 0.28);

  /* Активная палитра (по умолчанию — светлая) */
  --bg: var(--l-bg);
  --surface: var(--l-surface);
  --surface-2: var(--l-surface-2);
  --ink: var(--l-ink);
  --muted: var(--l-muted);
  --line: var(--l-line);
  --accent: var(--l-accent);
  --accent-strong: var(--l-accent-strong);
  --accent-soft: var(--l-accent-soft);
  --on-accent: var(--l-on-accent);
  --danger: var(--l-danger);
  --success: var(--l-success);
  --mark: var(--l-mark);
  --ring: var(--l-ring);

  /* Геометрия */
  --r-s: 6px;
  --r-m: 10px;
  --gutter: 20px;

  /* Шрифты: системные пары с кириллицей, без внешних подключений */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype",
    "Times New Roman", serif;
  --heading-weight: 400;
  --heading-transform: none;
  --heading-tracking: 0em;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--d-bg);
    --surface: var(--d-surface);
    --surface-2: var(--d-surface-2);
    --ink: var(--d-ink);
    --muted: var(--d-muted);
    --line: var(--d-line);
    --accent: var(--d-accent);
    --accent-strong: var(--d-accent-strong);
    --accent-soft: var(--d-accent-soft);
    --on-accent: var(--d-on-accent);
    --danger: var(--d-danger);
    --success: var(--d-success);
    --mark: var(--d-mark);
    --ring: var(--d-ring);
  }
}

/* Явная тема Telegram (устанавливается JS из tg.colorScheme) */
html[data-theme="light"] {
  --bg: var(--l-bg);
  --surface: var(--l-surface);
  --surface-2: var(--l-surface-2);
  --ink: var(--l-ink);
  --muted: var(--l-muted);
  --line: var(--l-line);
  --accent: var(--l-accent);
  --accent-strong: var(--l-accent-strong);
  --accent-soft: var(--l-accent-soft);
  --on-accent: var(--l-on-accent);
  --danger: var(--l-danger);
  --success: var(--l-success);
  --mark: var(--l-mark);
  --ring: var(--l-ring);
}

html[data-theme="dark"] {
  --bg: var(--d-bg);
  --surface: var(--d-surface);
  --surface-2: var(--d-surface-2);
  --ink: var(--d-ink);
  --muted: var(--d-muted);
  --line: var(--d-line);
  --accent: var(--d-accent);
  --accent-strong: var(--d-accent-strong);
  --accent-soft: var(--d-accent-soft);
  --on-accent: var(--d-on-accent);
  --danger: var(--d-danger);
  --success: var(--d-success);
  --mark: var(--d-mark);
  --ring: var(--d-ring);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: var(--app-height, 100dvh);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}

.shell {
  max-width: 470px;
  margin: 0 auto;
  /* --kb-inset (viewport-fit.js) — высота клавиатуры на iOS: без этого запаса
     документ «влезает» в layout viewport и прокручивать его нечем. max(), а не
     сумма: Telegram может сообщить ту же клавиатуру через --tg-bottom-inset. */
  padding: 0 var(--gutter)
    calc(
      30px + env(safe-area-inset-bottom) +
        max(var(--tg-bottom-inset, 0px), var(--kb-inset, 0px))
    );
}

.hidden {
  display: none !important;
}

/* ---------- Шапка ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: calc(14px + env(safe-area-inset-top)) 0 10px;
  transition: background 0.2s ease;
}

.masthead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-index {
  flex-shrink: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress {
  position: relative;
  margin-top: 10px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ---------- Загрузка ---------- */

.loader {
  display: flex;
  justify-content: center;
  padding: 42px 0;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Экраны и типографика ---------- */

.screen {
  min-height: 140px;
}

.kicker {
  margin: 24px 0 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.screen-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

/* Появление контента: без fill-mode «both» — если движок не проигрывает
   анимации (фоновая вкладка, старый WebView), контент остаётся видимым. */
.enter {
  animation: rise 0.26s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Главный экран: hero-блок салона ---------- */

.hero {
  position: relative;
  overflow: hidden; /* декоративная монограмма не создаёт горизонтальный скролл */
  padding: 12px 0 22px;
  border-bottom: 1px solid var(--line);
}

.hero-mark {
  position: absolute;
  top: -12px;
  right: -6px;
  font-family: var(--font-display);
  font-size: 128px;
  line-height: 1;
  color: var(--mark);
  pointer-events: none;
  user-select: none;
}

.hero-kicker {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 11vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0;
  max-width: 11ch;
  overflow-wrap: anywhere;
}

.hero-meta {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 0 8px;
}

.preview {
  padding: 18px 0 8px;
}

.preview-label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Списки-строки (услуги, мастера) ---------- */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 17px 2px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.row:first-child {
  border-top: 1px solid var(--line);
}

.row:active {
  transform: scale(0.995);
  background: var(--surface-2);
}

.row-index {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.row-main {
  min-width: 0;
}

.row-title {
  display: block;
  font-family: var(--font-display);
  font-size: 19.5px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.row-desc {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.row-meta {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.row-price {
  font-weight: 650;
  font-size: 15px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row.is-selected {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.row.is-selected .row-price {
  color: var(--accent);
}

/* Мастера: типографическая монограмма вместо отсутствующего фото */

.row-master {
  align-items: center;
  grid-template-columns: auto 1fr auto;
}

.monogram {
  width: 52px;
  height: 52px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  flex-shrink: 0;
}

.row-master .row-title {
  font-size: 20px;
}

.row-arrow {
  color: var(--muted);
  font-size: 17px;
}

/* ---------- Кнопки ---------- */

.btn {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--r-s);
  padding: 15px 22px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease,
    background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn:focus-visible,
.row:focus-visible,
.slot:focus-visible,
.calendar-day:focus-visible,
.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  width: 100%;
  letter-spacing: 0.01em;
}

.btn-primary:active {
  background: var(--accent-strong);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  width: 100%;
}

.btn-quiet {
  background: none;
  color: var(--muted);
  padding: 15px 12px;
}

.btn-quiet:active {
  color: var(--ink);
}

.link {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  color: var(--accent);
}

/* ---------- Нижняя панель кнопок (фолбэк вне Telegram) ---------- */

.bottom-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 26px;
  position: sticky;
  bottom: 0;
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  background: var(--bg);
}

.bottom-bar .btn-primary {
  flex: 1;
}

/* ---------- Тост ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom) + var(--tg-bottom-inset, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--r-s);
  font-size: 14px;
  max-width: 86vw;
  text-align: center;
  z-index: 50;
  animation: toast-in 0.2s ease;
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Календарь ---------- */

.calendar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 16px 12px 12px;
}

.calendar-month {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  margin: 0 6px 12px;
  text-transform: capitalize;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-dow {
  text-align: center;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  text-transform: lowercase;
}

.calendar-day {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.calendar-day:disabled {
  opacity: 0.3;
  cursor: default;
  background: transparent;
}

/* Доступная дата: точка-маркер под числом */
.calendar-day.available::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.calendar-day.today {
  border-color: var(--ring);
}

.calendar-day.selected {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}

.calendar-day.selected::after {
  background: var(--on-accent);
}

/* ---------- Сетка слотов ---------- */

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.slot {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  padding: 13px 0;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, transform 0.12s ease;
}

.slot:active {
  transform: scale(0.97);
}

.slot.selected {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* ---------- Резюме выбора (услуга · мастер) ---------- */

.context {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 12px 0 2px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}

.context strong {
  color: var(--ink);
  font-weight: 600;
}

.context-sep {
  color: var(--line);
}

/* ---------- Пустое состояние ---------- */

.empty-note {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  background: var(--surface-2);
  border-radius: var(--r-m);
  padding: 24px 18px;
  margin: 8px 0 0;
}

/* ---------- Форма ---------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field input {
  font: inherit;
  font-size: 16px;
  width: 100%;
  padding: 10px 2px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus {
  border-bottom-color: var(--accent);
}

.field input.invalid {
  border-bottom-color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 7px;
  min-height: 1em;
}

/* ---------- Сводка ---------- */

.review-card {
  border-top: 1px solid var(--line);
}

.review-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.review-row .key {
  color: var(--muted);
  flex-shrink: 0;
}

.review-row .value {
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.review-row .value.accent {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Дата как крупная типографическая деталь сводки */
.review-date {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 4px 0 18px;
  overflow-wrap: anywhere;
}

/* ---------- Экран результата ---------- */

.result {
  padding: 28px 0 8px;
}

.result-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  background: var(--accent-soft);
  color: var(--success);
}

.result.error .result-mark {
  color: var(--danger);
}

.result h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 8px;
}

.result p {
  color: var(--muted);
  margin: 0 0 6px;
  font-size: 15px;
}

.result-detail {
  margin-top: 20px;
}

.result-actions {
  margin-top: 24px;
}

/* ---------- Авторизация ---------- */

.auth-note {
  background: var(--surface-2);
  border-radius: var(--r-m);
  padding: 22px 20px;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.6;
  margin-top: 24px;
}

.auth-note strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  display: block;
  margin-bottom: 10px;
}

.auth-note code {
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* ---------- Десктоп: мягкая рамка приложения ---------- */

@media (min-width: 520px) {
  .shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    margin-top: 26px;
    margin-bottom: 26px;
    padding-left: 30px;
    padding-right: 30px;
  }

  .masthead {
    background: var(--surface);
  }

  .bottom-bar {
    background: var(--surface);
  }
}

/* ---------- Общие параметры тем ---------- */
.hero-title, .screen-title, .review-date, .result h2, .auth-note strong {
  font-weight: var(--heading-weight);
  text-transform: var(--heading-transform);
  letter-spacing: var(--heading-tracking);
}

[data-card-style="filled"] .row,
[data-card-style="outline"] .row,
[data-card-style="shadow"] .row,
[data-card-style="hard"] .row {
  margin: 8px 0;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
}
[data-card-style="filled"] .row { border-color: transparent; background: var(--surface-2); }
[data-card-style="shadow"] .row { box-shadow: 0 10px 28px var(--line); }
[data-card-style="hard"] .row { border-width: 2px; box-shadow: 4px 4px 0 var(--ink); }
[data-card-style]:not([data-card-style="lines"]) .row:first-child { border-top: 1px solid var(--line); }
[data-card-style="filled"] .row:first-child { border-top-color: transparent; }
[data-card-style="hard"] .row:first-child { border-top-width: 2px; }

[data-button-style="outline"] .btn-primary {
  color: var(--accent); background: transparent; border: 1px solid var(--accent);
}
[data-button-style="hard"] .btn {
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
}
[data-calendar-style="boxed"] .calendar { border-width: 2px; }
[data-calendar-style="pills"] .calendar-day { border-radius: 999px; }
[data-calendar-style="hard"] .calendar { border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
[data-calendar-style="hard"] .calendar-day.available { border-color: var(--ink); }
[data-slot-style="filled"] .slot { background: var(--surface-2); border-color: transparent; }
[data-slot-style="pills"] .slot { border-radius: 999px; }
[data-slot-style="hard"] .slot { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
[data-hero-style="centered"] .hero { text-align: center; }
[data-hero-style="centered"] .hero-title { margin-inline: auto; }
[data-hero-style="minimal"] .hero { padding-top: 42px; }
[data-hero-style="minimal"] .hero-mark { display: none; }
[data-hero-style="poster"] .hero-title { max-width: none; font-size: clamp(38px, 13vw, 58px); line-height: .92; }
[data-hero-style="glow"] .hero-title { text-shadow: 0 0 24px var(--accent); }
[data-hero-style="glow"] .hero-mark { color: var(--accent); opacity: .2; }

/* ---------- Интерфейс выбора и редактирования ---------- */
.theme-grid { display: grid; gap: 22px; margin: 22px 0; }
.theme-card { min-width: 0; }
.theme-card-copy { padding: 12px 2px 0; }
.theme-card-copy h2 { margin: 0 0 4px; font: var(--heading-weight) 23px/1.15 var(--font-display); }
.theme-card-copy p { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.theme-preview {
  --gutter: 12px; position: relative; overflow: hidden; min-height: 218px;
  padding: 17px 15px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-m); font-family: var(--font-sans);
}
.theme-mini-brand { font-size: 8px; font-weight: 700; letter-spacing: .18em; }
.theme-mini-title { margin: 24px 0 18px; max-width: 9ch; font: var(--heading-weight) 29px/.95 var(--font-display); text-transform: var(--heading-transform); letter-spacing: var(--heading-tracking); }
.theme-mini-card { display: flex; justify-content: space-between; gap: 8px; padding: 12px 2px; border-block: 1px solid var(--line); font-size: 11px; }
.theme-mini-slots { display: flex; gap: 5px; margin: 12px 0; }
.theme-mini-slots span { flex: 1; padding: 6px 2px; text-align: center; border: 1px solid var(--line); border-radius: var(--r-s); font-size: 9px; }
.theme-mini-button { padding: 8px; color: var(--on-accent); background: var(--accent); border-radius: var(--r-s); text-align: center; font-size: 10px; font-weight: 700; }
.theme-preview[data-hero-style="centered"] .theme-mini-title { margin-inline: auto; text-align: center; }
.theme-preview[data-hero-style="poster"] .theme-mini-title { max-width: none; font-size: 34px; }
.theme-preview[data-hero-style="glow"] .theme-mini-title { text-shadow: 0 0 16px var(--accent); }
.theme-preview[data-card-style="filled"] .theme-mini-card { padding: 12px 9px; border: 0; border-radius: var(--r-m); background: var(--surface-2); }
.theme-preview[data-card-style="outline"] .theme-mini-card,
.theme-preview[data-card-style="shadow"] .theme-mini-card,
.theme-preview[data-card-style="hard"] .theme-mini-card { padding: 12px 9px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.theme-preview[data-card-style="hard"] .theme-mini-card { border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
.theme-preview[data-slot-style="filled"] .theme-mini-slots span { background: var(--surface-2); border-color: transparent; }
.theme-preview[data-slot-style="pills"] .theme-mini-slots span { border-radius: 999px; }
.theme-preview[data-slot-style="hard"] .theme-mini-slots span { border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.theme-preview[data-button-style="outline"] .theme-mini-button { color: var(--accent); background: transparent; border: 1px solid var(--accent); }
.theme-preview[data-button-style="hard"] .theme-mini-button { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }

/* ---------- Десять самостоятельных визуальных концепций ---------- */
[data-theme-id="luxury"] .masthead { border-bottom: 1px solid var(--accent); }
[data-theme-id="luxury"] .hero-mark { top: 4px; right: 4px; font-size: 72px; color: transparent; -webkit-text-stroke: 1px var(--accent); }
[data-theme-id="luxury"] .hero-title { font-size: clamp(35px, 10vw, 46px); }
[data-theme-id="luxury"] .row-price { color: var(--accent); font-family: var(--font-display); }
[data-theme-id="luxury"] .monogram { border-radius: 50%; border-color: var(--accent); }
[data-theme-id="luxury"].theme-preview .theme-mini-brand { color: var(--accent); text-align: center; }
[data-theme-id="blush"] .hero-mark { width: 100px; height: 120px; border-radius: 50% 50% 45% 55%; background: var(--mark); color: transparent; transform: rotate(18deg); }
[data-theme-id="blush"] .hero { border-bottom: 0; }
[data-theme-id="blush"] .monogram { border-radius: 50% 50% 45% 55%; }
[data-theme-id="blush"] .result-mark { border-radius: 45% 55% 50% 50%; }
[data-theme-id="brutalist"] .masthead-row { border-block: 2px solid var(--ink); padding-block: 8px; }
[data-theme-id="brutalist"] .wordmark { font-size: 13px; font-weight: 900; }
[data-theme-id="brutalist"] .hero { border-bottom: 4px solid var(--ink); }
[data-theme-id="brutalist"] .hero-mark { font-size: 150px; color: var(--mark); transform: rotate(-8deg); }
[data-theme-id="brutalist"] .kicker { display: inline-block; padding: 3px 7px; color: var(--on-accent); background: var(--accent); }
[data-theme-id="brutalist"] .empty-note, [data-theme-id="brutalist"] .auth-note { border: 2px solid var(--ink); border-radius: 0; box-shadow: 4px 4px 0 var(--ink); }
[data-theme-id="brutalist"] .monogram { border: 2px solid var(--ink); border-radius: 0; background: var(--surface-2); }
[data-theme-id="organic"] .hero-mark { width: 105px; height: 145px; border-radius: 90% 10% 80% 20%; background: var(--mark); color: transparent; transform: rotate(25deg); }
[data-theme-id="organic"] .hero { border-bottom-color: transparent; }
[data-theme-id="organic"] .monogram { border-radius: 65% 35% 60% 40%; }
[data-theme-id="organic"] .calendar { border-radius: 28px 12px 28px 12px; }
[data-theme-id="organic"] .result-mark { border-radius: 70% 30% 65% 35%; }
[data-theme-id="neon"] .masthead { border-bottom: 1px solid var(--line); box-shadow: 0 8px 24px var(--accent-soft); }
[data-theme-id="neon"] .hero { border-bottom-color: var(--accent); }
[data-theme-id="neon"] .monogram { border-radius: 50%; color: var(--accent); box-shadow: inset 0 0 18px var(--accent-soft), 0 0 14px var(--accent-soft); }
[data-theme-id="neon"] .slot.selected, [data-theme-id="neon"] .btn-primary { box-shadow: 0 0 18px var(--accent-soft); }
[data-theme-id="neon"] .result-mark { box-shadow: 0 0 22px var(--accent-soft); }

[data-theme-id="nordic"] .shell { max-width: 450px; }
[data-theme-id="nordic"] .hero { padding-bottom: 38px; }
[data-theme-id="nordic"] .hero-kicker { font-weight: 500; }
[data-theme-id="nordic"] .row { padding-block: 21px; }
[data-theme-id="nordic"] .row-title { font-size: 18px; }
[data-theme-id="nordic"] .monogram { border: 0; border-radius: 50%; font-family: var(--font-sans); font-size: 14px; }
[data-theme-id="nordic"] .calendar { border: 0; background: transparent; padding-inline: 0; }
[data-theme-id="rouge"] .hero-title, [data-theme-id="rouge"] .screen-title { font-style: italic; }
[data-theme-id="rouge"] .hero-mark { font-style: italic; color: var(--mark); }
[data-theme-id="rouge"] .row-price { font-family: var(--font-display); font-size: 18px; color: var(--accent); }
[data-theme-id="rouge"] .monogram { border-radius: 50% 50% 8px 8px; }
[data-theme-id="rouge"] .calendar-month { font-style: italic; }
[data-theme-id="chrome"] .masthead { border-bottom: 1px solid var(--line); }
[data-theme-id="chrome"] .hero-mark { font-family: var(--font-sans); font-size: 110px; color: transparent; -webkit-text-stroke: 1px var(--muted); }
[data-theme-id="chrome"] .calendar, [data-theme-id="chrome"] .monogram { background: linear-gradient(135deg, var(--surface), var(--surface-2)); }
[data-theme-id="chrome"] .row-index, [data-theme-id="chrome"] .step-index { font-family: var(--font-display); }
[data-theme-id="chrome"] .result-mark { border-radius: var(--r-s); }
[data-theme-id="pop"] .hero-mark { width: 115px; height: 105px; display: grid; place-items: center; color: var(--ink); background: var(--mark); border: 2px solid var(--ink); border-radius: 48% 52% 40% 60%; font-size: 70px; transform: rotate(10deg); }
[data-theme-id="pop"] .rows li:nth-child(even) .row { transform: rotate(1deg); }
[data-theme-id="pop"] .rows li:nth-child(odd) .row { transform: rotate(-.5deg); }
[data-theme-id="pop"] .slots .slot:nth-child(3n + 2) { background: var(--surface-2); }
[data-theme-id="pop"] .monogram { border: 2px solid var(--ink); background: var(--mark); transform: rotate(-5deg); }
[data-theme-id="pop"] .result-mark { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }

.theme-warning { padding: 12px; color: var(--danger); background: var(--accent-soft); border-radius: var(--r-m); }
.theme-status { font-size: 10px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.theme-status.published { color: var(--success) !important; }
.theme-status.draft { color: var(--muted) !important; }
.theme-usage { overflow-wrap: anywhere; }
.theme-admin-actions { display: grid; gap: 6px; }
.theme-create, .theme-form details { margin: 16px 0; border-block: 1px solid var(--line); }
.theme-create summary, .theme-form summary { padding: 12px 0; cursor: pointer; font-weight: 650; }
.theme-form { display: grid; gap: 13px; padding-bottom: 18px; }
.theme-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.theme-form input:not([type="color"]), .theme-form textarea, .theme-form select {
  width: 100%; min-width: 0; padding: 10px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-s); font: 16px var(--font-sans);
}
.theme-form textarea { min-height: 74px; resize: vertical; }
.theme-form .theme-check { display: flex; align-items: center; color: var(--ink); }
.theme-form .theme-check input { width: 20px; height: 20px; }
.theme-color-grid, .theme-select-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 14px; }
.theme-color-grid input { width: 100%; height: 42px; padding: 2px; border: 1px solid var(--line); background: var(--surface); }
#theme-editor-preview { margin: 20px 0; }
#theme-editor-preview .theme-preview { max-width: 360px; margin-inline: auto; }

/* ---------- Уважение к prefers-reduced-motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Юридическая информация и согласия ---------- */

/* Футер с документами и поддержкой: виден на всех режимах страницы. */
.legal-footer {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.legal-footer p {
  margin: 5px 0;
}

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

.legal-footer a:hover {
  text-decoration: underline;
}

/* Карточка согласия на экране подтверждения записи. */
.consent-card {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-m);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}

.consent-row input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--accent);
}

.consent-row a {
  color: var(--accent);
}