/* ── Переменные — светлая тема (по умолчанию) ────────────────────────────── */
:root {
  --bg: #F6F3EE;
  --surface: #FFFFFF;
  --surface2: #F0EDE6;
  --border: #E2DDD4;
  --accent: #8B6030;
  --accent-dim: #6B4820;
  --accent-hover: rgba(139,96,48,0.08);
  --text: #1A1A1A;
  --text-muted: #8A8680;
  --bot-bubble: #F7F4EF;
  --user-bubble: #8B6030;
  --user-text: #FFFFFF;
  --radius: 10px;
  --shadow-sm: 0 1px 6px rgba(0,0,0,0.07);
  --shadow: 0 4px 24px rgba(0,0,0,0.09);
  --font: 'Segoe UI', system-ui, sans-serif;
  --bg-pattern: url('/static/bg-pattern.svg');
  --icon-filter: opacity(0.55);
}

/* ── Тёмная тема ─────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #181818;
  --surface2: #242424;
  --border: #2e2e2e;
  --accent: #c9a96e;
  --accent-dim: #a07840;
  --accent-hover: rgba(201,169,110,0.1);
  --text: #e8e8e8;
  --text-muted: #888;
  --bot-bubble: #1e1e1e;
  --user-bubble: #c9a96e;
  --user-text: #111;
  --shadow-sm: 0 1px 6px rgba(0,0,0,0.4);
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --bg-pattern: url('/static/bg-pattern-dark.svg');
  --icon-filter: invert(1) opacity(0.75);
}

/* ── Системная тёмная тема ───────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0e0e0e;
    --surface: #181818;
    --surface2: #242424;
    --border: #2e2e2e;
    --accent: #c9a96e;
    --accent-dim: #a07840;
    --accent-hover: rgba(201,169,110,0.1);
    --text: #e8e8e8;
    --text-muted: #888;
    --bot-bubble: #1e1e1e;
    --user-bubble: #c9a96e;
    --user-text: #111;
    --shadow-sm: 0 1px 6px rgba(0,0,0,0.4);
    --shadow: 0 4px 24px rgba(0,0,0,0.5);
    --bg-pattern: url('/static/bg-pattern-dark.svg');
    --icon-filter: invert(1) opacity(0.75);
  }
}

/* ── Сброс и база ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image: var(--bg-pattern);
  background-repeat: repeat;
  background-size: 620px 480px;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh; /* dvh не «прыгает» при появлении адресной строки/клавиатуры в WebView */
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Обёртка страницы ─────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 56px;
}

/* ── Шапка ────────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}
.header-right {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-decoration: none;
}
.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent);
}
.logo-sub {
  font-size: .68rem;
  color: var(--text-muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tg-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .82rem;
  color: var(--text);
  transition: border-color .2s, color .2s, box-shadow .2s;
}
.tg-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(139,96,48,0.15);
  text-decoration: none;
}

/* ── Переключатель темы ───────────────────────────────────────────────────── */
.theme-switcher {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 1px;
}
.theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 30px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s, box-shadow .18s;
}
.theme-btn:hover { color: var(--accent); }
.theme-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

/* ── Герой ────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 32px;
}
.hero h1 {
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--text);
}
.hero h1 span { color: var(--accent); }
.hero-sub {
  font-size: .95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Чат ─────────────────────────────────────────────────────────────────── */
.chat-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.chat-messages {
  min-height: 420px;
  max-height: 680px;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Сообщения */
.msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.msg.user { flex-direction: row-reverse; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.msg.user .avatar { background: var(--surface2); color: var(--text-muted); }
.bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 16px 16px 16px 4px;
  background: var(--bot-bubble);
  font-size: .92rem;
  line-height: 1.6;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  color: var(--text);
}
.msg.user .bubble {
  background: var(--user-bubble);
  color: var(--user-text);
  border-radius: 16px 16px 4px 16px;
  border-color: transparent;
}
.bubble strong { font-weight: 600; }
.bubble em { font-style: italic; color: var(--text-muted); }
/* Абзацы приветствия: отступ margin'ом, а не <br/> — чистое выделение текста */
.bubble p { margin: 0; }
.bubble p + p { margin-top: .55em; }

/* Информационные чипы приветствия */
.intro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0 12px 42px;
}
.intro-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  font-family: var(--font);
}
.intro-chip:hover {
  background: var(--accent-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* Индикатор печати */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
}
.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* ── Зона загрузки фото ───────────────────────────────────────────────────── */
.upload-zone {
  border-top: 1px solid var(--border);
  padding: 0;
  background: var(--surface2);
  display: none;
}
.upload-zone.has-image { display: block; }
.upload-preview {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 10px;
}
.upload-preview img {
  max-height: 80px;
  max-width: 100px;
  border-radius: 8px;
  object-fit: cover;
}
.remove-img {
  position: absolute;
  top: 4px;
  left: 100px;
  background: rgba(0,0,0,0.15);
  border: none;
  color: #333;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.remove-img:hover { background: rgba(0,0,0,0.28); }
.preview-doc-name {
  font-size: .8rem;
  color: var(--text2, #666);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Поле ввода ───────────────────────────────────────────────────────────── */
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.attach-btn, .send-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color .2s, background .2s;
  flex-shrink: 0;
}
.attach-btn:hover { color: var(--accent); background: var(--accent-hover); }
.send-btn {
  background: var(--accent);
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
}
.send-btn:hover { background: var(--accent-dim); }
.send-btn:disabled { opacity: .35; cursor: not-allowed; }
.message-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: .93rem;
  resize: none;
  line-height: 1.5;
  max-height: 140px;
  overflow-y: auto;
}
.message-input::placeholder { color: var(--text-muted); }

/* ── Панель кнопок под чатом ────────────────────────────────────────────── */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.history-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .88rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, color .2s;
  letter-spacing: .02em;
  box-shadow: var(--shadow-sm);
}
.history-btn:hover { background: var(--accent); color: #fff; }

/* ── Быстрые подсказки ────────────────────────────────────────────────────── */
.quick-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 36px;
}
.tip-label { font-size: .8rem; color: var(--text-muted); }
.tip-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .8rem;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s, color .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
.tip-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 2px 8px rgba(139,96,48,0.12); }

/* ── Почему мы ────────────────────────────────────────────────────────────── */
.benefits { margin-bottom: 44px; }
.benefits-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 26px;
}
.benefits-grid { display: flex; flex-direction: column; gap: 24px; }

.benefits-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  column-gap: 20px;
}
.benefits-row--center {
  grid-template-columns: repeat(2, 1fr);
  width: 66%;
  margin: 0 auto;
}

.benefit {
  grid-row: span 2;
  display: grid;
  grid-template-columns: 20px 1fr;
  grid-template-rows: subgrid;
  column-gap: 10px;
}
.benefit-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 20px;
  height: 20px;
  filter: var(--icon-filter);
  align-self: start;
  margin-top: 2px;
}
.benefit-body { display: contents; }
.benefit strong {
  grid-column: 2;
  grid-row: 1;
  display: block;
  font-size: .82rem;
  align-self: end;
  padding-bottom: 5px;
  color: var(--text);
}
.benefit p {
  grid-column: 2;
  grid-row: 2;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  align-self: start;
}

/* ── Футер ────────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.disclaimer {
  margin-top: 10px;
  font-size: .76rem;
  color: #BBB6AF;
}
.credit {
  margin-top: 8px;
  font-size: .74rem;
  color: var(--text-muted);
}

/* ── Фото в чате ─────────────────────────────────────────────────────────── */
.bubble-img {
  padding: 4px;
  background: transparent;
  border: none;
}
.chat-img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* ── Быстрые кнопки-ответы (quick replies) ───────────────────────────────── */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 16px 54px;
}
.qr-btn {
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .82rem;
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.qr-btn:hover { background: var(--accent); color: #fff; }

/* ── Форма ввода размеров ─────────────────────────────────────────────────── */
.dim-form {
  padding: 14px 20px 18px 54px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dim-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dim-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 90px;
}
.dim-field span {
  font-size: .75rem;
  color: var(--text-muted);
}
.dim-field input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  padding: 7px 10px;
  outline: none;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.dim-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,96,48,0.1); }
.dim-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.dim-submit {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  padding: 8px 20px;
  cursor: pointer;
  transition: background .2s;
}
.dim-submit:hover { background: var(--accent-dim); }
.dim-standard {
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 600;
  padding: 8px 20px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.dim-standard:hover { background: var(--accent); color: #fff; }

/* ── Кнопка обратной связи ───────────────────────────────────────────────── */
.feedback-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8rem;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  box-shadow: var(--shadow-sm);
}
.feedback-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Модалка обратной связи ───────────────────────────────────────────────── */
.feedback-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.feedback-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.14);
}
.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}
.feedback-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.feedback-close:hover { color: var(--text); background: var(--surface2); }
.feedback-desc {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.feedback-textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: .9rem;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  line-height: 1.55;
  transition: border-color .2s, box-shadow .2s;
}
.feedback-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,96,48,0.1); }
.feedback-actions { display: flex; justify-content: flex-end; }
.feedback-submit {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  padding: 9px 24px;
  cursor: pointer;
  transition: background .2s;
}
.feedback-submit:hover { background: var(--accent-dim); }
.feedback-submit:disabled { opacity: .4; cursor: not-allowed; }

/* ── Блок «Получить переписку» ───────────────────────────────────────────── */
.history-offer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 42px;
}
.history-offer-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.history-offer-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.history-offer-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: .82rem;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.history-offer-btn:hover { border-color: var(--accent); color: var(--accent); }
.history-email-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.history-email-form input[type="email"] {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  padding: 7px 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.history-email-form input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,96,48,0.1);
}

/* ── Согласие на обработку ПД (152-ФЗ) ──────────────────────────────────────── */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  font-size: .72rem;
  line-height: 1.35;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
}
.consent-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}
.consent-row a { color: var(--accent); text-decoration: underline; }
.dim-submit:disabled { opacity: .5; cursor: not-allowed; }
.dim-submit:disabled:hover { background: var(--accent); }

/* ── Адаптив ──────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .chat-messages { min-height: 360px; max-height: 560px; }
}
@media (max-width: 640px) {
  .page-wrap { padding: 0 16px 48px; }
  .benefits-row { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 20px; }
  .benefits-row--center { width: 100%; grid-template-columns: 1fr; }
  .benefit { grid-row: auto; grid-template-rows: none; display: flex; align-items: flex-start; gap: 12px; }
  .benefit-icon { grid-row: auto; grid-column: auto; flex-shrink: 0; }
  .benefit-body { display: flex; flex-direction: column; gap: 4px; }
  .benefit strong { grid-row: auto; grid-column: auto; padding-bottom: 0; }
  .benefit p { grid-row: auto; grid-column: auto; }
  .chat-messages { min-height: 320px; max-height: 480px; }
}
@media (max-width: 520px) {
  .hero-sub br { display: none; }
  .bubble { max-width: 90%; }
}

/* ── Каталог: кнопка «Показать наши примеры» и карточки ───────────────────── */
.catalog-btn-wrap {
  padding: 0 20px 16px 54px;
}
.catalog-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-size: .85rem;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, opacity .2s;
  box-shadow: var(--shadow-sm);
}
.catalog-btn:hover { background: var(--accent-dim); }
.catalog-btn:disabled { opacity: .6; cursor: default; }

.catalog-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 0 20px 18px 54px;
}
.catalog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.catalog-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(139,96,48,0.18);
  transform: translateY(-2px);
  text-decoration: none;
}
.catalog-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-color: var(--surface2);
}
.catalog-card-body { padding: 10px 12px; }
.catalog-card-name {
  font-size: .82rem;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}
.catalog-card-price {
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
}
.catalog-card-lead {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
@media (max-width: 520px) {
  .catalog-gallery { padding-left: 20px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .catalog-btn-wrap { padding-left: 20px; }
}

/* ── Telegram Mini App ───────────────────────────────────────────────────────── */
/* Учёт «вырезов»/домашней черты iPhone, чтобы низ не перекрывался системой */
body.tg-miniapp { padding-bottom: env(safe-area-inset-bottom); }
/* Переключатель темы оставляем и в Mini App — пользователь задаёт тему сам (фидбэк 16.06) */

/* Компактный режим: в Telegram скрываем витрину сайта (hero/выгоды/футер/подсказки),
   но панель действий под чатом ОСТАВЛЯЕМ — там кнопка «Сохранить переписку»
   (фидбэк Владимира 16.06: «одно окно с ботом», но кнопки сохранения нужны). */
body.tg-miniapp .hero,
body.tg-miniapp .benefits,
body.tg-miniapp .footer,
body.tg-miniapp .quick-tips { display: none; }
body.tg-miniapp .page-wrap { padding-top: 6px; padding-left: 12px; padding-right: 12px; }
body.tg-miniapp .header { margin-bottom: 10px; padding: 8px 0; }
body.tg-miniapp .chat-container { margin-bottom: 0; }
/* Высота чата = реальная высота окна Telegram (var задаётся из JS по viewportStableHeight),
   минус шапка, поле ввода и панель кнопок. Поле ввода и кнопки всегда видны над клавиатурой. */
body.tg-miniapp .chat-messages {
  min-height: 0;
  max-height: none;
  height: calc(var(--tg-vh, 100dvh) - 210px);
}

/* ── Встраивание в лендинг (iframe ?embed=1) ─────────────────────────────────── */
/* Только чат на всю область iframe: прячем витрину И сайтовую обвязку калькулятора
   (шапку, выгоды, футер, подсказки), убираем рамку-«окно» чата. Панель кнопок
   (.action-bar — «Предложить улучшение»/«Сохранить переписку») ОСТАВЛЯЕМ внизу. */
html, body.embed-web { height: 100%; margin: 0; }
body.embed-web { position: relative; background: #fff; }
body.embed-web .header,
body.embed-web .hero,
body.embed-web .benefits,
body.embed-web .footer,
body.embed-web .quick-tips { display: none !important; }
/* page-wrap гарантированно заполняет окно iframe (absolute), а не зависит от
   цепочки height:100% — иначе при коротком чате внизу оставалась пустая зона. */
body.embed-web .page-wrap {
  position: absolute; inset: 0;
  max-width: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; min-height: 0;
  background: #fff;
}
body.embed-web .chat-container {
  flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0;
  margin: 0; border: 0; border-radius: 0; box-shadow: none;
  background: #fff; overflow: hidden;
}
/* Лента сообщений растягивается на всё свободное место → поле ввода прижато к низу */
body.embed-web .chat-messages {
  flex: 1 1 auto;
  min-height: 0 !important; max-height: none !important; height: auto !important;
  overflow-y: auto; background: #fff;
}
body.embed-web .upload-zone,
body.embed-web .input-row { flex: none; }
body.embed-web .action-bar {
  flex: none; margin: 0; padding: 8px 16px 10px;
  border-top: 1px solid var(--border); background: #fff;
}
/* Мобильный embed: компактное приветствие, чтобы пузырь + чипы + поле ввода
   помещались в невысокий iframe лендинга (автофокус скроллит сюда — этот экран
   первое, что видит посетитель с рекламы) */
@media (max-width: 480px) {
  body.embed-web .msg { gap: 6px; }
  body.embed-web .avatar { width: 24px; height: 24px; font-size: .7rem; }
  body.embed-web .bubble {
    max-width: 100%;
    padding: 8px 11px;
    font-size: .84rem;
    line-height: 1.4;
  }
  body.embed-web .bubble p + p { margin-top: .3em; }
  /* Чипы в 2 ряда при реальной ширине iframe лендинга (318px на экране 375,
     ~303px на 360): уже поля ленты, плотные чипы, а «Фото с Pinterest»
     поднят вторым через order — жадный flex-wrap иначе оставляет 3 ряда */
  body.embed-web .chat-messages { padding-left: 10px; padding-right: 10px; }
  body.embed-web .intro-chips { padding: 4px 0 8px; gap: 3px; }
  body.embed-web .intro-chip { padding: 3px 5px; font-size: .7rem; }
  body.embed-web .intro-chip:nth-child(2) { order: 3; }  /* Фото */
  body.embed-web .intro-chip:nth-child(3) { order: 2; }  /* Фото с Pinterest */
  body.embed-web .intro-chip:nth-child(4) { order: 4; }
  body.embed-web .intro-chip:nth-child(5) { order: 5; }
  body.embed-web .action-bar { padding: 6px 12px 8px; }
}
