/* ============================================================
   Демо-стенд подбора недвижимости — минималистичный ч/б стиль
   Вдохновлено level.ru, без логотипа, акцент — чёрный.
   ============================================================ */

:root {
  --black: #111418;
  --ink: #1a1d21;
  --muted: #6b7280;
  --line: #e6e7e9;
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --bg-card: #ffffff;
  --accent: #111418;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 20, 24, .06), 0 8px 24px rgba(17, 20, 24, .06);
  --shadow-lg: 0 12px 40px rgba(17, 20, 24, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 800; letter-spacing: .14em; font-size: 20px; }
.logo span { color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.header-nav { font-size: 14px; }

/* ---------- Hero + search ---------- */
.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 12px; }
.hero-sub { color: var(--muted); font-size: 18px; margin: 0 auto 28px; max-width: 560px; }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  max-width: 720px; margin: 0 auto;
  background: var(--bg-card); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 8px 8px 8px 22px;
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.search-bar:focus-within { border-color: var(--black); box-shadow: var(--shadow-lg); }
.search-bar input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 17px; color: var(--ink); min-width: 0;
}
.mic-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--bg-soft); font-size: 18px; display: grid; place-items: center;
  transition: background .15s, transform .1s; flex: none;
}
.mic-btn:hover { background: #ececee; }
.mic-btn.recording { background: #dc2626; color: #fff; animation: pulse 1.2s infinite; }
.mic-btn.busy { pointer-events: none; background: var(--bg-soft); }
.mic-spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--black); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4);} 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0);} }
.search-btn {
  height: 44px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--black); color: #fff; font-size: 15px; font-weight: 600; flex: none;
  transition: opacity .15s;
}
.search-btn:hover { opacity: .88; }

.search-status { min-height: 22px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.search-status.error { color: #dc2626; }

.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip {
  border: 1px solid var(--line); background: var(--bg-card);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--muted);
  transition: all .15s;
}
.chip:hover { border-color: var(--black); color: var(--ink); }
.hero-modes { margin-top: 18px; }
.mode-link { display: inline-block; border: 1.5px solid var(--black); border-radius: 999px; padding: 10px 20px; font-size: 14px; font-weight: 600; transition: all .15s; }
.mode-link:hover { background: var(--black); color: #fff; }

/* ---------- AI message ---------- */
.ai-message {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-left: 3px solid var(--black);
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 8px 0 24px;
  font-size: 15px;
}

/* ---------- Results head ---------- */
.results-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 18px; }
.results-head h2 { font-size: 22px; font-weight: 700; margin: 0; }
.reset-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font-size: 14px; }
.reset-btn:hover { border-color: var(--black); }
.results-actions { display: flex; align-items: center; gap: 10px; }
.sort-select { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-family: inherit; background: #fff; cursor: pointer; }
.sort-select:hover { border-color: var(--black); }

/* Встроенная ИИ-карточка в гриде (.card.card-ai — выше специфичности, чем .card ниже по файлу) */
.card.card-ai { background: var(--black); color: #fff; }
.card.card-ai:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-ai-body { padding: 26px 24px; display: flex; flex-direction: column; gap: 12px; height: 100%; justify-content: center; }
.card-ai-body h3 { font-size: 23px; font-weight: 800; margin: 0; line-height: 1.15; letter-spacing: -.01em; }
.card-ai-body p { font-size: 14px; color: rgba(255,255,255,.72); margin: 0; line-height: 1.5; }
.card-ai-btn { margin-top: 6px; align-self: flex-start; background: #fff; color: var(--black); border: 0; border-radius: 999px; padding: 11px 22px; font-size: 14px; font-weight: 700; cursor: pointer; }
.card-ai-btn:hover { opacity: .9; }

/* ---------- Grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; padding-bottom: 64px; }

.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-media { position: relative; aspect-ratio: 16 / 11; background: var(--bg-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-tl { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; max-width: 78%; }
.card-tr { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; align-items: center; }
.card-class { background: rgba(17,20,24,.80); color: #fff; backdrop-filter: blur(4px); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; }
.np { border-radius: 999px; padding: 5px 10px; font-size: 11.5px; font-weight: 700; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.np-hot { background: #e11d48; }
.np-deluxe { background: linear-gradient(90deg, #7c5cff, #3b82f6); }
.card-3d { background: rgba(255,255,255,.92); color: #111; border-radius: 999px; min-width: 30px; height: 24px; display: grid; place-items: center; font-size: 11px; font-weight: 800; padding: 0 8px; }
.card-rank { background: var(--black); color: #fff; border-radius: 999px; width: 28px; height: 28px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.card-status { position: absolute; bottom: 12px; left: 12px; background: rgba(255,255,255,.92); backdrop-filter: blur(4px); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-reason {
  background: #f0f7ff; border: 1px solid #d8e9ff; color: #0b4a8f;
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px; line-height: 1.45;
  margin-bottom: 4px;
}
.card-title { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.card-metro { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.card-price { font-size: 18px; font-weight: 700; margin-top: 2px; }
.card-meta { font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 6px; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 16px; grid-column: 1 / -1; }

/* ---------- Chat widget ---------- */
.chat-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 50;
  width: 60px; height: 60px; border-radius: 50%; border: 0;
  background: var(--black); color: #fff; font-size: 26px;
  box-shadow: var(--shadow-lg); display: grid; place-items: center;
  transition: transform .15s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-panel {
  position: fixed; bottom: 24px; right: 24px; z-index: 51;
  width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 48px);
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
}
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chat-head h4 { margin: 0; font-size: 16px; }
.chat-head .sub { font-size: 12px; color: var(--muted); }
.chat-close { border: 0; background: transparent; font-size: 22px; color: var(--muted); line-height: 1; }
.chat-head-actions { display: flex; align-items: center; gap: 10px; }
.chat-clear { border: 0; background: transparent; font-size: 12px; color: var(--muted); cursor: pointer; }
.chat-clear:hover { color: var(--ink); text-decoration: underline; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-soft); }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--black); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.assistant a { color: #0b4a8f; text-decoration: underline; }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; align-items: flex-end; }
.chat-input textarea { flex: 1; border: 1px solid var(--line); border-radius: 18px; padding: 10px 16px; font-size: 14px; font-family: inherit; outline: 0; resize: none; max-height: 120px; line-height: 1.4; }
.chat-input textarea:focus { border-color: var(--black); }
.chat-input button { border: 0; background: var(--black); color: #fff; border-radius: 999px; padding: 0 24px; font-size: 16px; font-weight: 600; min-height: 44px; }
.chat-input .mic-btn { padding: 0; width: 40px; height: 40px; }

/* ---------- Project detail ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin: 24px 0 8px; }
.back-link:hover { color: var(--ink); }
.project-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin: 12px 0 28px; }
.project-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.project-gallery .main { aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.project-gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.project-gallery .thumbs { display: flex; flex-direction: column; gap: 12px; }
.project-gallery .thumbs img { aspect-ratio: 4/3; border-radius: var(--radius-sm); object-fit: cover; cursor: pointer; transition: opacity .15s; }
.project-gallery .thumbs img:hover { opacity: .85; }
.project-info h1 { font-size: 30px; font-weight: 800; margin: 0 0 10px; letter-spacing: -.02em; }
.project-info .meta-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; margin-bottom: 8px; }
.project-info .price-big { font-size: 26px; font-weight: 800; margin: 14px 0 6px; }
.project-info .desc { color: #374151; font-size: 15px; line-height: 1.6; margin-top: 12px; }
.tag { display: inline-block; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; margin: 0 6px 6px 0; }
.tag-3d { font-size: 12px; background: var(--black); color: #fff; border-radius: 999px; padding: 3px 9px; vertical-align: middle; font-weight: 600; }

/* Факты о ЖК */
.facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 28px; }
.fact { border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; min-width: 110px; }
.fact b { display: block; font-size: 20px; font-weight: 800; }
.fact span { font-size: 12.5px; color: var(--muted); }

/* Преимущества с картинками */
.adv { margin: 8px 0 32px; }
.adv h2 { font-size: 22px; font-weight: 700; margin: 0 0 16px; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.adv-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.adv-img { aspect-ratio: 16/10; background: var(--bg-soft); overflow: hidden; }
.adv-img img { width: 100%; height: 100%; object-fit: cover; }
.adv-body { padding: 14px 16px; }
.adv-body b { font-size: 15px; display: block; margin-bottom: 4px; }
.adv-body span { font-size: 13px; color: var(--muted); }

/* Фотогалерея проекта */
.gallery { margin: 8px 0 32px; }
.gallery h2 { font-size: 22px; font-weight: 700; margin: 0 0 16px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; cursor: pointer; transition: opacity .15s; }
.gallery-grid img:hover { opacity: .85; }

/* Галерея в модалке квартиры */
.m-thumbs { display: flex; gap: 8px; margin-top: 12px; justify-content: center; }
.m-thumb { width: 56px; height: 56px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; padding: 4px; }
.m-thumb.active { border-color: var(--black); }

.detail-layout { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; padding-bottom: 64px; }

/* Advisor panel (sticky left) */
.advisor { position: sticky; top: 88px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.advisor h3 { margin: 0 0 4px; font-size: 18px; }
.advisor .hint { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.advisor textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-family: inherit; font-size: 14px; resize: vertical; min-height: 80px; outline: 0; }
.advisor textarea:focus { border-color: var(--black); }
.advisor-actions { display: flex; gap: 8px; margin-top: 10px; }
.advisor-actions button.primary { flex: 1; border: 0; background: var(--black); color: #fff; border-radius: 999px; padding: 11px; font-size: 14px; font-weight: 600; }
.advisor-msg { margin-top: 14px; padding: 12px; background: var(--bg-soft); border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; }
.advisor-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* Apartments grid */
.apts-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.apts-head h2 { margin: 0; font-size: 22px; }
.apts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.apt-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; transition: transform .15s, box-shadow .15s; cursor: pointer; display: flex; flex-direction: column; }
.apt-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.apt-card.matched { border-color: var(--black); box-shadow: 0 0 0 2px var(--black); }
.apt-plan { aspect-ratio: 1/1; background: var(--bg-soft); padding: 14px; display: grid; place-items: center; }
.apt-plan img { max-width: 100%; max-height: 100%; object-fit: contain; }
.apt-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.apt-rooms { font-weight: 700; font-size: 15px; }
.apt-area { color: var(--muted); font-size: 13px; }
.apt-price { font-weight: 700; font-size: 15px; margin-top: 2px; }
.apt-hint { background: #f0f7ff; border: 1px solid #d8e9ff; color: #0b4a8f; border-radius: 8px; padding: 7px 9px; font-size: 12.5px; margin-top: 6px; line-height: 1.4; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(17,20,24,.55); z-index: 60; display: grid; place-items: center; padding: 24px; }
.modal { background: #fff; border-radius: var(--radius); max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; }
.modal .m-plan { background: var(--bg-soft); padding: 28px; display: grid; place-items: center; }
.modal .m-plan img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.modal .m-info { padding: 28px; position: relative; }
.modal .m-info h3 { margin: 0 0 14px; font-size: 22px; }
.modal .m-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.modal .m-row .k { color: var(--muted); }
.modal-close { position: absolute; top: 16px; right: 16px; border: 0; background: var(--bg-soft); width: 36px; height: 36px; border-radius: 50%; font-size: 20px; }

/* Loading spinner */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--black); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- КП / оффер ---------- */
.kp-btn { display: inline-block; margin-top: 14px; background: var(--black); color: #fff; border-radius: 999px; padding: 11px 20px; font-size: 14px; font-weight: 600; }
.kp-btn:hover { opacity: .9; }

/* ---------- Mortgage calculator ---------- */
.apt-mort { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-mort { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.mort-head { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.mort-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; font-size: 13px; }
.mort-row select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; font-family: inherit; background: #fff; }
.mort-down { width: 100%; accent-color: var(--black); margin: 2px 0 6px; }
.mort-result { margin-top: 10px; min-height: 48px; }
.mort-pay { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.mort-pay span { font-size: 14px; font-weight: 600; color: var(--muted); }
.mort-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mort-note { font-size: 11.5px; margin-top: 6px; line-height: 1.4; }

/* Поля калькулятора + горизонтальный режим */
.mort-fields { display: flex; flex-direction: column; gap: 10px; }
.mort-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.mort-field > span { color: var(--muted); font-size: 12.5px; }
.mort-field select { border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 14px; font-family: inherit; background: #fff; }
.mort-kp { width: 100%; margin-top: 12px; background: var(--black); color: #fff; border: 0; border-radius: 999px; padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer; }
.mort-kp:hover { opacity: .9; }
.mort-h .mort-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; }
.mort-h .mort-result { margin-top: 14px; }
@media (max-width: 640px) { .mort-h .mort-fields { grid-template-columns: 1fr; } }

/* Банки-кредиторы */
.banks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 14px; }
.bank { color: #fff; border-radius: 6px; padding: 3px 9px; font-size: 11px; font-weight: 700; letter-spacing: .01em; }

/* Интерактивная форма ипотеки в чате */
.chat-mort { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.chat-mort-h { font-weight: 700; font-size: 14px; }
.chat-mort label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.chat-mort input, .chat-mort select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 13px; font-family: inherit; color: var(--ink); background: #fff; }
.chat-mort .cm-calc { margin-top: 4px; background: var(--black); color: #fff; border: 0; border-radius: 999px; padding: 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cm-kp { background: var(--black); color: #fff; border: 0; border-radius: 999px; padding: 10px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cm-kp:hover, .chat-mort .cm-calc:hover { opacity: .9; }

/* Форма захвата контактов (лид) перед выдачей КП */
.lead-form { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.lead-h { font-weight: 700; font-size: 14px; }
.lead-form input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit; outline: 0; }
.lead-form input:focus { border-color: var(--black); }
.lead-submit { background: var(--black); color: #fff; border: 0; border-radius: 999px; padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer; }
.lead-submit:hover { opacity: .9; }
.lead-policy { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.lead-policy a { text-decoration: underline; }

/* Страница политики конфиденциальности */
.legal { max-width: 760px; margin: 32px auto 64px; }
.legal h1 { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
.legal h2 { font-size: 18px; font-weight: 700; margin: 24px 0 8px; }
.legal p, .legal li { font-size: 14.5px; line-height: 1.65; color: #374151; }
.legal .muted { font-size: 13px; }

/* ---------- Tinder / swipe ---------- */
.sw-setup { max-width: 560px; margin: 30px auto; }
.sw-setup h1 { font-size: 30px; font-weight: 800; margin: 6px 0 8px; letter-spacing: -.02em; }
.sw-search { display: flex; gap: 8px; margin: 20px 0 6px; }
.sw-search input { flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: 14px 20px; font-size: 16px; outline: 0; }
.sw-search input:focus { border-color: var(--black); }
.sw-styles-label { font-size: 14px; color: var(--muted); margin: 16px 0 8px; }
.sw-styles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sw-style { text-align: left; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: all .15s; }
.sw-style b { font-size: 15px; }
.sw-style span { font-size: 12px; color: var(--muted); }
.sw-style.active { border-color: var(--black); box-shadow: 0 0 0 2px var(--black); }
.sw-start { margin-top: 20px; background: var(--black); color: #fff; border: 0; border-radius: 999px; padding: 15px 28px; font-size: 16px; font-weight: 700; cursor: pointer; width: 100%; }
.sw-start:hover { opacity: .9; }
.sw-loading { text-align: center; padding: 80px 20px; color: var(--muted); font-size: 16px; }
.sw-deck-wrap { max-width: 420px; margin: 16px auto; text-align: center; }
.sw-counter { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.sw-deck { position: relative; height: 540px; }
.sw-card { position: absolute; inset: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sw-card.top { cursor: grab; touch-action: none; }
.sw-card:nth-last-child(2) { transform: scale(.95) translateY(12px); }
.sw-card:nth-last-child(3) { transform: scale(.90) translateY(24px); }
.sw-card-img { position: relative; flex: 1; background: var(--bg-soft); display: grid; place-items: center; padding: 18px; min-height: 0; }
.sw-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sw-like-lbl, .sw-nope-lbl { position: absolute; top: 24px; font-size: 24px; font-weight: 900; padding: 6px 14px; border-radius: 10px; border: 3px solid; opacity: 0; pointer-events: none; }
.sw-like-lbl { left: 20px; color: #16a34a; border-color: #16a34a; transform: rotate(-12deg); }
.sw-nope-lbl { right: 20px; color: #dc2626; border-color: #dc2626; transform: rotate(12deg); }
.sw-style-badge { position: absolute; top: 14px; right: 14px; background: var(--black); color: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; }
.sw-plan-badge { position: absolute; bottom: 14px; left: 14px; background: rgba(255,255,255,.9); border-radius: 999px; padding: 4px 10px; font-size: 11px; color: var(--muted); }
.sw-card-info { padding: 14px 18px; text-align: left; border-top: 1px solid var(--line); }
.sw-card-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; font-weight: 700; }
.sw-card-jk { font-size: 14px; margin: 2px 0; }
.sw-actions { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 20px; }
.sw-btn { width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 24px; cursor: pointer; box-shadow: var(--shadow); transition: transform .1s; }
.sw-btn:hover { transform: scale(1.08); }
.sw-btn.like { color: #16a34a; }
.sw-btn.nope { color: #dc2626; }
.sw-btn.info { color: var(--muted); font-size: 20px; width: 50px; height: 50px; }
.sw-hint { margin-top: 14px; font-size: 12px; }
.sw-results { max-width: 1000px; margin: 24px auto; }
.sw-results h1 { font-size: 26px; font-weight: 800; margin: 8px 0 6px; }
.sw-results-foot { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.res-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.res-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.res-media .apt-plan { aspect-ratio: 1/1; background: var(--bg-soft); padding: 14px; display: grid; place-items: center; }
.res-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.res-actions { display: flex; gap: 6px; margin-top: 10px; }
.res-btn { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.res-btn:hover { border-color: var(--black); }
.res-btn.kp { background: var(--black); color: #fff; border-color: var(--black); }

/* КП-карточка в чате */
.kp-card { display: flex; flex-direction: column; background: var(--black); color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-top: 4px; text-decoration: none; }
.kp-card b { font-size: 14px; }
.kp-card span { font-size: 11px; opacity: .7; }
.kp-card:hover { opacity: .92; }

/* Профиль + калькулятор на странице ЖК */
.profile-h1 { font-size: 28px; font-weight: 800; margin: 16px 0 4px; }
.profile-sec { font-size: 18px; font-weight: 700; margin: 28px 0 14px; }
.proj-mort { margin: 8px 0 28px; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: var(--bg-soft); }
.proj-mort h2 { font-size: 20px; font-weight: 700; margin: 0 0 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .project-hero { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .advisor { position: static; }
  .modal { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .hero { padding: 36px 0 20px; }
  .search-bar { flex-wrap: wrap; border-radius: 20px; padding: 10px 12px; }
  .search-bar input { width: 100%; order: -1; padding: 6px 4px 10px; }
  .chat-panel { bottom: 0; right: 0; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
}
