/* ============================================================
   Каталог квартир — Mini App
   Дизайн: фирменный градиент, мягкие карточки, плавные переходы
   Поддержка светлой/тёмной темы Telegram
   ============================================================ */

:root {
  --brand: #6c5ce7;
  --brand-2: #a55cff;
  --brand-3: #4c8dff;
  --grad: linear-gradient(135deg, #6c5ce7 0%, #a55cff 55%, #4c8dff 100%);
  --grad-soft: linear-gradient(135deg, rgba(108, 92, 231, .12), rgba(76, 141, 255, .12));

  --bg: #f4f5fb;
  --bg-2: #eceefb;
  --card: #ffffff;
  --card-2: #f7f8fd;
  --text: #14152a;
  --muted: #8489a6;
  --line: #e7e9f3;
  --chip: #eef0fb;
  --chip-text: #5b5f86;
  --success: #2bb673;
  --shadow: 0 10px 30px -12px rgba(38, 41, 92, .25);
  --shadow-sm: 0 4px 14px -6px rgba(38, 41, 92, .2);
  --radius: 22px;
  --radius-sm: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Говорим WebView, что страница сама красит обе темы — без этого некоторые
     встроенные браузеры (Telegram/МАХ WebView) сами «угадывают» цвета инпутов
     и текста в тёмном режиме и красят их неправильно (тёмным на тёмном). */
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0f1018;
  --bg-2: #15161f;
  --card: #1b1d29;
  --card-2: #20222f;
  --text: #f1f2f7;
  --muted: #9094ad;
  --line: #2a2d3d;
  --chip: #23263699;
  --chip-text: #b9bdd6;
  --shadow: 0 12px 34px -14px rgba(0, 0, 0, .6);
  --shadow-sm: 0 6px 16px -8px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

.view {
  min-height: 100vh;
  padding-bottom: calc(40px + var(--safe-bottom));
}

/* --------- Анимация появления экрана --------- */
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen { animation: screenIn .32s cubic-bezier(.22, .61, .36, 1); }

/* ============================================================
   ШАПКА
   ============================================================ */
.hero {
  position: relative;
  padding: calc(26px + var(--safe-top)) 20px 30px;
  background: var(--grad);
  color: #fff;
  border-radius: 0 0 28px 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -70px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 70%);
  pointer-events: none;
}
.hero__brand { display: flex; align-items: center; gap: 12px; }
.hero__logo {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,.18);
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.25);
}
.hero__title { font-size: 21px; font-weight: 750; letter-spacing: -.2px; }
.hero__subtitle { font-size: 13.5px; opacity: .9; margin-top: 2px; }
.hero__tagline { margin-top: 18px; font-size: 14.5px; opacity: .94; line-height: 1.45; max-width: 80%; }

/* Компактная шапка внутренних экранов */
.topbar {
  position: relative;
  padding: calc(20px + var(--safe-top)) 20px 22px;
  background: var(--grad);
  color: #fff;
  border-radius: 0 0 24px 24px;
  box-shadow: var(--shadow);
}
.topbar__step {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.18);
  padding: 5px 11px; border-radius: 999px;
}
.topbar__title { font-size: 22px; font-weight: 750; margin-top: 12px; letter-spacing: -.3px; }
.topbar__subtitle { font-size: 14px; opacity: .92; margin-top: 4px; }

/* индикатор прогресса (точки шагов) */
.steps { display: flex; gap: 6px; margin-top: 14px; }
.steps span {
  height: 4px; flex: 1; border-radius: 999px;
  background: rgba(255,255,255,.3);
  transition: background .3s;
}
.steps span.on { background: #fff; }

/* ============================================================
   КОНТЕНТ
   ============================================================ */
.content { padding: 18px 16px 0; }
.section-label {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted);
  margin: 16px 4px 10px;
}

/* --------- Главная: основная CTA-карточка --------- */
.cta {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-top: 14px;
  border-radius: var(--radius);
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s;
  position: relative; overflow: hidden;
}
.cta::after {
  content: ""; position: absolute; right: -30px; bottom: -50px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%);
}
.cta:active { transform: scale(.985); }
.cta__icon {
  width: 54px; height: 54px; flex: none;
  border-radius: 16px;
  background: rgba(255,255,255,.2);
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.28);
}
.cta__body { flex: 1; min-width: 0; }
.cta__title { font-size: 18px; font-weight: 750; }
.cta__sub { font-size: 13.5px; opacity: .92; margin-top: 3px; }
.cta__arrow { opacity: .9; }

/* --------- Сетка прочих разделов --------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 13px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.tile:active { transform: scale(.97); }
.tile__icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 8px;
  color: #fff;
}
.tile__icon svg { width: 21px; height: 21px; }
.tile__title { font-size: 14px; font-weight: 700; line-height: 1.2; }
.tile__sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* Длинная кнопка «Связь» */
.link-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin-top: 12px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 15px;
  font-size: 15px; font-weight: 650; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .12s;
}
.link-btn:active { transform: scale(.98); }
.link-btn svg { color: var(--brand); }
.tile__soon {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
  color: var(--brand);
  background: var(--grad-soft);
  padding: 3px 8px; border-radius: 999px;
}

/* --------- Большие карточки выбора (срок / комнаты) --------- */
.choice {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 16px; margin-bottom: 12px;
  cursor: pointer;
  transition: transform .12s ease, border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
.choice:active { transform: scale(.98); }
.choice:not(.disabled):hover { border-color: var(--brand); }
.choice__icon {
  width: 50px; height: 50px; flex: none; border-radius: 15px;
  background: var(--grad-soft); color: var(--brand);
  display: grid; place-items: center;
}
.choice__body { flex: 1; min-width: 0; }
.choice__title { font-size: 16px; font-weight: 700; }
.choice__sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.choice__count {
  font-size: 12px; font-weight: 700; color: var(--brand);
  background: var(--chip); padding: 5px 10px; border-radius: 999px;
  white-space: nowrap;
}
.choice.disabled { opacity: .5; pointer-events: none; }

.grid .choice { margin-bottom: 0; flex-direction: column; align-items: flex-start; text-align: left; }
.grid .choice .choice__icon { margin-bottom: 4px; }

/* выбранный фильтр-чип */
.filterchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,.18); color: #fff;
  padding: 6px 12px; border-radius: 999px;
}

/* ============================================================
   КАРТОЧКИ КВАРТИР
   ============================================================ */
.apt {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .25s;
}
.apt:active { transform: scale(.985); }
.apt__plan {
  position: relative;
  background: var(--card-2);
  padding: 14px 14px 0;
}
.apt__num {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(20, 21, 42, .82);
  padding: 5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.apt__plan img { width: 100%; height: auto; display: block; border-radius: 12px; }
.apt__body { padding: 14px 16px 16px; }
.apt__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.apt__title { font-size: 16px; font-weight: 750; }
.apt__price { font-size: 17px; font-weight: 800; color: var(--brand); white-space: nowrap; }
.apt__meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.apt__perm2 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.apt__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  font-size: 11.5px; font-weight: 600;
  background: var(--chip); color: var(--chip-text);
  padding: 5px 10px; border-radius: 999px;
}

/* --------- Детали квартиры --------- */
.detail__plan { background: var(--card-2); padding: 18px; border-radius: var(--radius); margin-top: 18px; box-shadow: var(--shadow-sm); }
.detail__plan img { width: 100%; height: auto; border-radius: 14px; }
.detail__price { font-size: 26px; font-weight: 850; color: var(--brand); margin-top: 18px; }
.detail__title { font-size: 19px; font-weight: 750; margin-top: 4px; }
.detail__complex { font-size: 13px; color: var(--muted); margin-top: 2px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.spec {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 14px;
}
.spec__label { font-size: 11.5px; color: var(--muted); }
.spec__value { font-size: 15.5px; font-weight: 700; margin-top: 3px; }
.detail__desc { font-size: 14.5px; line-height: 1.55; color: var(--text); margin-top: 18px; }
.feature-list { list-style: none; padding: 0; margin: 14px 0 0; }
.feature-list li {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; padding: 9px 0; border-bottom: 1px solid var(--line);
}
.feature-list li:last-child { border-bottom: none; }
.feature-list svg { flex: none; color: var(--success); }

/* Кнопки действий в карточке квартиры (2×2) */
.apt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.apt-act {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  min-height: 86px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 14px;
  font-size: 13px; font-weight: 650; line-height: 1.25; text-align: left;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .12s;
}
.apt-act:active { transform: scale(.97); }
.apt-act svg { width: 22px; height: 22px; color: var(--brand); }
.apt-act--primary { background: var(--grad); color: #fff; border: none; }
.apt-act--primary svg { color: #fff; }
.apt-act:disabled { opacity: .6; pointer-events: none; }

/* ============================================================
   СОСТОЯНИЯ: загрузка / пусто
   ============================================================ */
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--card-2) 30%, var(--line) 50%, var(--card-2) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  height: 210px; margin-bottom: 16px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty { text-align: center; padding: 60px 30px; color: var(--muted); }
.empty__icon { font-size: 46px; margin-bottom: 12px; }
.empty__title { font-size: 17px; font-weight: 700; color: var(--text); }
.empty__sub { font-size: 14px; margin-top: 6px; }

/* кнопка «назад» (запасная, если нет нативной кнопки Telegram) */
.backbtn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.16);
  border: none; border-radius: 999px; padding: 7px 13px;
  cursor: pointer; margin-bottom: 4px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 21, 42, .94); color: #fff;
  font-size: 13.5px; font-weight: 500;
  padding: 12px 18px; border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 100; max-width: 86%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* запасная нижняя кнопка действия (если MainButton недоступна вне Telegram) */
.actionbar {
  position: sticky; bottom: 0;
  padding: 14px 16px calc(14px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.action-btn {
  width: 100%; border: none; cursor: pointer;
  background: var(--grad); color: #fff;
  font-size: 16px; font-weight: 700;
  padding: 16px; border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform .12s;
}
.action-btn:active { transform: scale(.98); }

/* ============================================================
   РАЗДЕЛЫ: Презентация / Рендеры / Акции
   ============================================================ */

/* --- Обложка (презентация) --- */
.cover {
  position: relative;
  min-height: 230px;
  padding: calc(20px + var(--safe-top)) 20px 20px;
  background-size: cover;
  background-position: center;
  border-radius: 0 0 24px 24px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cover__grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,21,42,.15) 0%, rgba(20,21,42,.78) 100%);
}
.cover .backbtn { position: absolute; top: calc(14px + var(--safe-top)); left: 16px; z-index: 2; }
.cover__text { position: relative; color: #fff; }
.cover__title { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.cover__sub { font-size: 14px; opacity: .92; margin-top: 4px; }

/* --- Факты --- */
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fact {
  flex: 1 1 30%;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.fact__v { font-size: 15px; font-weight: 750; }
.fact__l { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.prose { font-size: 14.5px; line-height: 1.6; color: var(--text); margin: 18px 0 4px; }

/* --- Карточка файла (презентация) --- */
.filecard {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 16px;
  margin-top: 18px; box-shadow: var(--shadow-sm);
}
.filecard__icon {
  width: 50px; height: 50px; flex: none; border-radius: 14px;
  background: var(--grad-soft); display: grid; place-items: center; font-size: 24px;
}
.filecard__name { font-size: 15.5px; font-weight: 700; word-break: break-word; }
.filecard__hint { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.filecard--empty { opacity: .55; }
.filecard + .action-btn { margin-top: 16px; }
.action-btn + .ghost-btn--wide { margin-top: 10px; }
.mort-slider + .action-btn { margin-top: 22px; }

/* --- Вторичные кнопки-ссылки --- */
.prez-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grad-soft); color: var(--brand);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 15px; font-size: 14px; font-weight: 650;
  cursor: pointer; transition: transform .12s;
}
.ghost-btn:active { transform: scale(.97); }
.ghost-btn--wide { width: 100%; justify-content: center; margin-top: 10px; }

/* --- Галерея рендеров --- */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gallery__item {
  border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--card-2); box-shadow: var(--shadow-sm);
  aspect-ratio: 4 / 3;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.gallery__item:active img { transform: scale(.97); }

/* --- Список папок (креативы / рендеры) --- */
.folder-list {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.folder-row {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 11px 14px; background: transparent; border: none;
  border-bottom: 1px solid var(--line); cursor: pointer;
  text-align: left; color: var(--text); font: inherit;
  transition: background .15s;
}
.folder-row:last-child { border-bottom: none; }
.folder-row:active { background: var(--card-2); }
.folder-row__cover {
  width: 54px; height: 54px; border-radius: 13px; overflow: hidden;
  flex: 0 0 auto; background: var(--grad-soft); display: grid; place-items: center;
}
.folder-row__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.folder-row__ph { color: var(--brand); opacity: .55; }
.folder-row__ph svg { width: 26px; height: 26px; }
.folder-row__body { flex: 1; min-width: 0; }
.folder-row__name {
  font-weight: 700; font-size: 15px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.folder-row__count { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.folder-row__chev { color: var(--muted); flex: 0 0 auto; display: flex; }
.folder-row__chev svg { width: 20px; height: 20px; }

/* --- Экран «нет доступа» --- */
.noaccess {
  min-height: 82vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 40px 28px; gap: 14px;
}
.noaccess__icon { font-size: 54px; }
.noaccess__title { font-size: 21px; font-weight: 800; }
.noaccess__text {
  font-size: 15px; color: var(--muted); line-height: 1.5;
  max-width: 340px; white-space: pre-line;
}

/* --- Мультивыбор рендеров --- */
.gallery-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.gallery-toolbar .ghost-btn { padding: 9px 14px; font-size: 13.5px; }
.gallery__check {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  display: none; place-items: center;
  background: rgba(20,21,42,.5); color: #fff;
  border: 2px solid #fff;
}
.gallery__check svg { width: 16px; height: 16px; opacity: 0; }
.gallery.selecting .gallery__item { position: relative; }
.gallery.selecting .gallery__check { display: grid; }
.gallery__item.selected .gallery__check { background: var(--brand); border-color: var(--brand); }
.gallery__item.selected .gallery__check svg { opacity: 1; }
.gallery__item.selected img { transform: scale(.92); border-radius: 12px; }
.gallery__item.selected { outline: 3px solid var(--brand); outline-offset: -1px; border-radius: 14px; }

/* --- Нижняя панель выбора --- */
.selbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none; gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
.selbar.show { display: flex; }
.selbar__cancel {
  flex: none; border: 1px solid var(--line); background: var(--card);
  color: var(--text); border-radius: 14px; padding: 0 18px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.selbar__send {
  flex: 1; border: none; cursor: pointer;
  background: var(--grad); color: #fff;
  font-size: 15.5px; font-weight: 700; padding: 15px; border-radius: 14px;
  box-shadow: var(--shadow);
}
.selbar__send:disabled { opacity: .5; }

/* --- Лайтбокс --- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 9, 18, .94);
  display: grid; place-items: center; padding: 20px;
  animation: screenIn .2s ease;
}
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 12px; }
.lightbox__close {
  position: absolute; top: calc(16px + var(--safe-top)); right: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.16); color: #fff;
  font-size: 18px; cursor: pointer;
}

/* --- Акции --- */
.offer {
  position: relative;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px 16px 16px 20px;
  margin-bottom: 14px; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.offer::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px; background: var(--accent, var(--brand));
}
.offer__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.offer__badge {
  font-size: 11.5px; font-weight: 700; color: #1c1d2b;
  background: var(--accent, var(--brand)); padding: 4px 10px; border-radius: 999px;
}
.offer__exp { font-size: 12px; color: var(--muted); font-weight: 600; }
.offer__title { font-size: 16px; font-weight: 750; line-height: 1.3; }
.offer__desc { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 6px; }

/* ============================================================
   РЕГЛАМЕНТ РАБОТЫ (в стиле фирменного документа «Альянс/Ривьера»)
   ============================================================ */
.cta--rule { background: linear-gradient(135deg, #0f3b54 0%, #1d5e7e 100%); }

.rule-intro {
  background: linear-gradient(135deg, #0f3b54 0%, #1d5e7e 100%);
  color: #fff; border-radius: var(--radius); padding: 18px 18px 20px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.rule-intro::after {
  content: ""; position: absolute; right: -40px; bottom: -60px;
  width: 170px; height: 170px;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%);
}
.rule-intro__t { font-size: 19px; font-weight: 750; }
.rule-intro__badge {
  display: inline-block; margin-top: 10px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 700;
}
.rule-intro__s { font-size: 13.5px; opacity: .93; margin-top: 12px; line-height: 1.55; }

.rule-sec { margin-top: 18px; }
.rule-head {
  display: flex; align-items: center; gap: 13px;
  background: linear-gradient(135deg, #0f3b54 0%, #1d5e7e 100%);
  color: #fff; border-radius: 16px 16px 6px 6px; padding: 13px 15px;
  box-shadow: var(--shadow-sm);
}
.rule-head__num {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.28);
  display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: .5px;
}
.rule-head__t { font-size: 16px; font-weight: 750; line-height: 1.2; }
.rule-head__s { font-size: 12.5px; opacity: .9; margin-top: 2px; }

.rule-body {
  background: var(--card); border: 1px solid var(--line); border-top: none;
  border-radius: 6px 6px 16px 16px; padding: 15px 16px; box-shadow: var(--shadow-sm);
}
.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.rule-list li { position: relative; padding-left: 20px; font-size: 14px; line-height: 1.5; color: var(--text); }
.rule-list li::before {
  content: ""; position: absolute; left: 4px; top: 8px;
  width: 7px; height: 7px; border-radius: 50%; background: #1d5e7e;
}
.rule-sub { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .4px; }

.rule-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rule-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(29, 94, 126, .1); border: 1px solid rgba(29, 94, 126, .25);
  color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 700;
}
html[data-theme="dark"] .rule-chip { background: rgba(76, 141, 255, .14); border-color: rgba(76, 141, 255, .3); }

.rule-note {
  margin-top: 12px; background: var(--card-2); border: 1px solid var(--line);
  border-left: 3px solid #1d5e7e; border-radius: 10px; padding: 11px 13px;
  font-size: 13px; color: var(--muted); line-height: 1.5;
}

.rule-col { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow-sm); }
.rule-col__h { padding: 11px 14px; font-weight: 750; font-size: 14px; color: #fff; display: flex; align-items: center; gap: 7px; }
.rule-col--bad .rule-col__h { background: linear-gradient(135deg, #d2433f, #e9694e); }
.rule-col--good .rule-col__h { background: linear-gradient(135deg, #1f9d57, #37b87a); }
.rule-col__b { padding: 13px 14px; }

/* ============================================================
   СВЯЗЬ — карточки контактов менеджера
   ============================================================ */
.contact-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; text-align: left; color: var(--text);
  transition: transform .12s ease, border-color .2s;
  font-family: inherit;
}
.contact-card:active { transform: scale(.98); }
.contact-card__ic {
  width: 48px; height: 48px; flex: none; border-radius: 14px;
  display: grid; place-items: center; font-size: 23px;
  background: var(--grad-soft);
}
.contact-card__b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.contact-card__t { display: block; font-size: 15.5px; font-weight: 700; }
.contact-card__s { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.contact-card__ar { color: var(--muted); }

/* ============================================================
   ИПОТЕЧНЫЙ КАЛЬКУЛЯТОР
   ============================================================ */
.cta--mortgage { background: linear-gradient(135deg, #0e9f6e 0%, #16b8a6 55%, #4c8dff 100%); }

/* поля ввода (в основном приложении — для калькулятора; в админке свои в admin.css) */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input[type="text"], .field input[type="number"] {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text); font-size: 15px; font-family: inherit;
}
.field input:focus { outline: 2px solid rgba(108, 92, 231, .35); border-color: transparent; }

.mort-apt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; box-shadow: var(--shadow-sm); margin-bottom: 6px;
}
.mort-apt span { color: var(--muted); font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mort-apt b { font-size: 17px; color: var(--brand); flex: none; white-space: nowrap; }

.mort-progs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mort-prog {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; cursor: pointer; box-shadow: var(--shadow-sm); color: var(--text);
  transition: transform .1s, border-color .15s; text-align: left; font-family: inherit;
}
.mort-prog:active { transform: scale(.97); }
.mort-prog.on { border-color: var(--brand); background: var(--grad-soft); }
.mort-prog__name { font-size: 13.5px; font-weight: 700; line-height: 1.2; color: var(--text); }
.mort-prog__rate { font-size: 15px; font-weight: 800; color: var(--brand); }
.mort-prog__lim { font-size: 10.5px; color: var(--muted); }

.mort-slider { margin-top: 14px; }
.mort-slider__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mort-slider__top span { font-size: 13.5px; color: var(--muted); }
.mort-slider__top b { font-size: 15px; font-weight: 800; color: var(--brand); }
.mort-slider input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: var(--line); outline: none;
}
.mort-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); cursor: pointer; box-shadow: var(--shadow-sm); border: 3px solid #fff;
}
.mort-slider input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand); cursor: pointer; border: 3px solid #fff;
}

.mort-res { margin-top: 18px; }
.mort-res__head { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.mort-res__pay {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--grad); color: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.mort-res__pay span { font-size: 13px; opacity: .9; }
.mort-res__pay b { font-size: 26px; font-weight: 800; }
.mort-note { font-size: 12.5px; color: var(--muted); margin: 8px 2px 0; }
.mort-note--warn {
  color: #d23a5b; background: rgba(210, 58, 91, .1); border: 1px solid rgba(210, 58, 91, .3);
  border-radius: 12px; padding: 10px 12px; margin: 10px 0 0; line-height: 1.4;
}
.mort-phases { margin: 8px 2px 0; font-size: 13px; color: var(--text); display: flex; flex-direction: column; gap: 4px; }

.mort-block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 16px; box-shadow: var(--shadow-sm); margin-top: 12px;
}
.mort-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mort-row:last-child { border-bottom: none; }
.mort-row span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mort-row b { text-align: right; flex: none; white-space: nowrap; color: var(--text); }
.mort-sub { font-size: 12px; color: var(--muted); padding: 0 0 10px; margin-top: -4px; }

.mort-devtoggle {
  width: 100%; margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px;
  background: var(--card-2); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.mort-dev {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 16px; margin-top: 8px; box-shadow: var(--shadow-sm);
}
.mort-err {
  margin-top: 16px; background: rgba(255,92,122,.12); border: 1px solid rgba(255,92,122,.4);
  border-radius: 14px; padding: 14px 16px; font-size: 14px; color: var(--text);
}

/* --- заявка на ипотеку --- */
.mort-consent {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 8px;
  font-size: 13px; color: var(--muted); line-height: 1.45; cursor: pointer;
}
.mort-consent input { margin-top: 2px; width: 18px; height: 18px; flex: none; }
.mort-done { text-align: center; padding: 40px 20px; }
.mort-done__ic { font-size: 52px; }
.mort-done__t { font-size: 20px; font-weight: 750; margin-top: 10px; color: var(--text); }
.mort-done__s { font-size: 14px; color: var(--muted); margin-top: 8px; }
