  :root {
    --primary: #3E9569;
    --primary-dark: #164432;
    --cream: #F6F3EE;
    --ivory: #FAF8F4;
    --graphite: #222222;
    --gold: #C9A96A;
  }

  * { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  html { scroll-behavior: smooth; }
  body {
    font-family: 'Manrope', sans-serif;
    background: var(--ivory);
    color: var(--graphite);
    overflow-x: hidden;
  }

  .font-display { font-family: 'Cormorant Garamond', serif; letter-spacing: -0.01em; }

  /* Hero gradient overlay */
  .hero-overlay {
    background:
      linear-gradient(to right, rgba(14,46,34,0.85) 0%, rgba(14,46,34,0.55) 50%, rgba(14,46,34,0.25) 100%),
      linear-gradient(to bottom, rgba(14,46,34,0.2) 0%, rgba(14,46,34,0.6) 100%);
  }

  /* Premium card */
  .premium-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(22, 68, 50, 0.06);
    transition: all 0.4s cubic-bezier(.2,.7,.2,1);
  }
  .premium-card:hover {
    transform: translateY(-6px);
    border-color: rgba(62, 149, 105, 0.2);
    box-shadow: 0 20px 60px -20px rgba(22, 68, 50, 0.2);
  }

  /* Number animation */
  .stat-number {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    line-height: 0.9;
    letter-spacing: -0.04em;
    background: linear-gradient(180deg, #164432 0%, #3E9569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* Fade-up animation */
  .fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.9s cubic-bezier(.2,.7,.2,1);
  }
  .fade-up.in-view {
    opacity: 1;
    transform: translateY(0);
  }

  /* Subtle grain */
  .grain::before {
    content: '';
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: multiply;
  }

  /* Custom underline for links */
  .fancy-link {
    position: relative;
    display: inline-block;
  }
  .fancy-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 1px;
    background: currentColor;
    transition: width 0.35s ease;
  }
  .fancy-link:hover::after { width: 100%; }

  /* Button styles */
  .btn-primary {
    background: var(--primary-dark);
    color: #fff;
    padding: 14px 32px;
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
  }
  .btn-primary:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -10px rgba(22, 68, 50, 0.5);
  }
  .btn-ghost {
    background: transparent;
    color: var(--primary-dark);
    border: 1px solid rgba(22, 68, 50, 0.25);
    padding: 13px 32px;
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
  }
  .btn-ghost:hover {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
  }
  .btn-wa {
    background: #25D366;
    color: #fff;
    padding: 14px 32px;
    border-radius: 999px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
  }
  .btn-wa:hover {
    background: #1fb757;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -10px rgba(37, 211, 102, 0.5);
  }
  .btn-outline-light {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 13px 26px;
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
  }
  .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
  }

  /* Divider */
  .elegant-divider {
    display: flex; align-items: center; gap: 16px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--primary);
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
  }
  .elegant-divider::before,
  .elegant-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(62, 149, 105, 0.3), transparent);
  }

  /* Page transitions */
  .page {
    display: none;
    animation: pageIn 0.6s cubic-bezier(.2,.7,.2,1);
  }
  .page.active { display: block; }
  @keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* WhatsApp floating */
  .wa-float {
    position: fixed; bottom: 24px; right: 24px; z-index: 50;
    width: 60px; height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.45);
    transition: all 0.3s ease;
    cursor: pointer;
  }
  .wa-float:hover { transform: scale(1.08); }
  .wa-float::before {
    content: '';
    position: absolute; inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.4);
    animation: pulse 2s infinite;
  }
  @keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
  }

  /* Logo */
  .logo-svg { width: 32px; height: 32px; }
  .logo-svg path { transition: all 0.3s ease; }

  /* Mobile menu */
  .mobile-menu {
    position: fixed; inset: 0;
    background: var(--ivory);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
  }
  .mobile-menu.open { transform: translateX(0); }

  /* Filter chip */
  .chip {
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid rgba(22, 68, 50, 0.15);
    font-size: 14px;
    color: var(--graphite);
    background: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
  }
  .chip:hover { border-color: var(--primary); color: var(--primary); }
  .chip.active {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
  }

  /* Hide scrollbar on filter row */
  .scroll-hide::-webkit-scrollbar { display: none; }
  .scroll-hide { -ms-overflow-style: none; scrollbar-width: none; }

  /* Property image hover */
  .prop-img { transition: transform 0.8s cubic-bezier(.2,.7,.2,1); }
  .premium-card:hover .prop-img { transform: scale(1.06); }

  /* Section label */
  .section-label {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--primary);
    font-size: 15px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }
  .section-label::before {
    content: ''; width: 32px; height: 1px; background: var(--primary);
  }

  /* Filter chips */
  .filter-chip {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--graphite);
    background: #fff;
    border: 1px solid rgba(22, 68, 50, 0.12);
    border-radius: 999px;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
  }
  .filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
  }
  .filter-chip.active {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
  }
  /* Mini chip (rooms toggles) */
  .mini-chip {
    padding: 8px 14px;
    min-width: 44px;
    font-size: 13px;
    font-weight: 500;
    color: var(--graphite);
    background: #fff;
    border: 1px solid rgba(22, 68, 50, 0.12);
    border-radius: 8px;
    transition: all 0.2s ease;
  }
  .mini-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
  }
  .mini-chip.active {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
  }

  /* Filter form elements */
  .filter-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(34, 34, 34, 0.55);
    font-weight: 500;
  }
  .filter-select,
  .filter-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--graphite);
    background: #fff;
    border: 1px solid rgba(22, 68, 50, 0.15);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    margin-top: 8px;
  }
  .filter-input { margin-top: 0; }
  .filter-select:focus,
  .filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(62, 149, 105, 0.1);
  }
  .filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23164432' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
  }

  /* Gallery thumb */
  .gallery-thumb {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.3s ease;
  }
  .gallery-thumb:hover { opacity: 1; }
  .gallery-thumb.active { opacity: 1; box-shadow: 0 0 0 2px var(--primary); }

  /* Spec row */
  .spec-row {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(22, 68, 50, 0.08);
  }
  .spec-row:last-child { border-bottom: none; }
  .spec-label {
    color: rgba(34, 34, 34, 0.55);
    font-size: 14px;
  }
  .spec-value {
    color: var(--graphite);
    font-weight: 500;
    font-size: 14px;
    text-align: right;
  }

  /* Hero bg with real photo */
  .hero-bg {
    background-image: url('https://images.unsplash.com/photo-1545324418-cc1a3fa10c00?auto=format&fit=crop&w=2000&q=80');
    background-size: cover;
    background-position: center;
  }

  /* Accent dot */
  .accent-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--gold); display: inline-block; margin: 0 4px;
  }

  /* Agent avatar ring */
  .agent-avatar {
    position: relative;
    overflow: hidden;
  }
  .agent-avatar::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(14, 46, 34, 0.85));
    pointer-events: none;
  }

  /* Nav underline */
  .nav-link {
    position: relative;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--graphite);
    transition: color 0.3s;
  }
  .nav-link::after {
    content: '';
    position: absolute; left: 0; bottom: 0;
    width: 0; height: 1px;
    background: var(--primary-dark);
    transition: width 0.3s ease;
  }
  .nav-link:hover, .nav-link.active {
    color: var(--primary-dark);
  }
  .nav-link.active::after { width: 100%; }

  /* Marquee (partners) */
  .marquee {
    display: flex;
    gap: 80px;
    animation: marquee 30s linear infinite;
  }
  @keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }

  /* Check icon pulse for Krisha block */
  .krisha-badge {
    background: linear-gradient(135deg, #F7CE4A 0%, #C9A96A 100%);
  }

  /* Decorative numbers */
  .deco-num {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    color: rgba(62, 149, 105, 0.12);
    line-height: 1;
  }
/* === Card photo slider === */
.card-with-slider {
  display: block;
  position: relative;
}

.card-img-wrap {
  position: relative;
  cursor: default;
}

.card-main-img {
  transition: opacity 0.2s ease;
}

/* Невидимые зоны для навигации по фото */
.card-nav-zone {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
  outline: none;
  transition: background 0.15s ease;
}

.card-nav-prev { left: 0; }
.card-nav-next { right: 0; }

/* На наведении подсвечиваем зону + показываем "стрелку" */
.card-img-wrap:hover .card-nav-zone {
  background: linear-gradient(to right, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0) 60%);
}
.card-img-wrap:hover .card-nav-next {
  background: linear-gradient(to left, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0) 60%);
}

/* Стрелка-индикатор появляется при наведении */
.card-nav-zone::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 36px;
  height: 36px;
  background-color: rgba(255,255,255,0.95);
  border-radius: 50%;
  transform: translateY(-50%) scale(0.85);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card-nav-prev::before {
  left: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E");
}

.card-nav-next::before {
  right: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
}

.card-img-wrap:hover .card-nav-zone::before {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Точки-индикаторы внизу */
.card-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.card-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease, width 0.2s ease;
}

.card-dot.active {
  background: rgba(255, 255, 255, 1);
  width: 18px;
  border-radius: 3px;
}

/* На мобильных: скрываем стрелки (там только тапы по зонам и точки) */
@media (hover: none) {
  .card-img-wrap .card-nav-zone::before {
    display: none;
  }
  .card-img-wrap:hover .card-nav-zone {
    background: transparent;
  }
}
/* ============================================ */
/* ===== ROP cards (Career page) ============== */
/* ============================================ */

.rop-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(22, 68, 50, 0.04), 0 1px 2px rgba(22, 68, 50, 0.06);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
}

.rop-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -10px rgba(22, 68, 50, 0.18), 0 8px 16px -8px rgba(22, 68, 50, 0.10);
}

.rop-photo-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #F1F7F3;
}

.rop-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.rop-card:hover .rop-photo {
  transform: scale(1.04);
}

.rop-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 68, 50, 0.92) 0%, rgba(22, 68, 50, 0.4) 40%, transparent 70%);
  pointer-events: none;
}

.rop-photo-text {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  color: white;
  z-index: 5;
}

.rop-section {
  margin-bottom: 1.5rem;
}
.rop-section:last-of-type {
  margin-bottom: 1.25rem;
}

.rop-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #2D7B53;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.rop-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rop-list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 14.5px;
  color: rgba(34, 34, 34, 0.78);
  font-weight: 400;
  line-height: 1.55;
}

.rop-list li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 1px;
  color: #7BBF9E;
  font-size: 9px;
}

.rop-tagline {
  font-size: 14px;
  background: linear-gradient(135deg, #F1F7F3 0%, #E1EFE6 100%);
  border-left: 3px solid #2D7B53;
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  color: #164432;
  margin: 1.5rem 0 1.75rem 0;
  line-height: 1.5;
}

.rop-tagline strong {
  color: #164432;
  font-weight: 700;
}

.rop-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 14px 20px;
  background: #164432;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  transition: background 0.25s ease, transform 0.2s ease;
  text-decoration: none;
}

.rop-button:hover {
  background: #216140;
  transform: translateY(-1px);
}

/* ============================================================
   ЧАТ-БОТ «Дом Комфорт»
   ============================================================ */
#dk-chat-root { font-family: 'Manrope', sans-serif; }

/* Кнопка запуска (слева снизу, чтобы не пересекаться с WhatsApp справа) */
#dk-chat-launcher {
  position: fixed; bottom: 24px; left: 24px; z-index: 50;
  width: 68px; height: 68px; border: none; cursor: pointer;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 32px rgba(46, 123, 83, 0.55);
  transition: transform 0.25s ease, background 0.25s ease;
  animation: dk-launcher-bounce 3.2s ease-in-out infinite;
}
#dk-chat-launcher:hover { transform: scale(1.1); background: var(--primary-dark); animation-play-state: paused; }
#dk-chat-launcher.hidden { display: none; }
@keyframes dk-launcher-bounce {
  0%, 88%, 100% { transform: translateY(0); }
  92% { transform: translateY(-7px); }
  96% { transform: translateY(-3px); }
}

/* Кружок-счётчик «1» для привлечения внимания */
.dk-chat-launcher-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 22px; height: 22px; padding: 0 5px;
  background: #EF4444; color: #fff;
  border: 2px solid var(--ivory);
  border-radius: 11px;
  font-size: 12px; font-weight: 700; line-height: 18px;
  display: flex; align-items: center; justify-content: center;
}

.dk-chat-launcher-pulse {
  content: ''; position: absolute; inset: -6px;
  border-radius: 50%; border: 2px solid rgba(62, 149, 105, 0.5);
  animation: dk-pulse 2s infinite;
}
@keyframes dk-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Подсказка-бабл рядом с иконкой */
.dk-chat-hint {
  position: fixed; bottom: 30px; left: 104px; z-index: 50;
  max-width: 240px;
  background: #fff; color: var(--graphite);
  padding: 12px 34px 12px 16px;
  border-radius: 16px; border-bottom-left-radius: 5px;
  box-shadow: 0 8px 28px rgba(22, 68, 50, 0.22);
  font-size: 13.5px; line-height: 1.4; cursor: pointer;
  animation: dk-hint-in 0.4s ease both;
}
.dk-chat-hint.hidden { display: none; }
.dk-chat-hint-close {
  position: absolute; top: 6px; right: 8px;
  background: transparent; border: none; cursor: pointer;
  color: rgba(34, 34, 34, 0.4); font-size: 18px; line-height: 1;
}
.dk-chat-hint-close:hover { color: var(--graphite); }
@keyframes dk-hint-in {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Описание объекта — сохраняем переносы строк */
.prop-description { white-space: pre-line; }

/* Панель чата */
#dk-chat-panel {
  position: fixed; bottom: 24px; left: 24px; z-index: 51;
  width: 380px; max-width: calc(100vw - 32px);
  height: 580px; max-height: calc(100vh - 48px);
  background: var(--ivory);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(22, 68, 50, 0.28);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(24px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
#dk-chat-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* Шапка */
.dk-chat-header {
  background: var(--primary-dark); color: #fff;
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.dk-chat-header-info { display: flex; align-items: center; gap: 12px; }
.dk-chat-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 17px;
  flex-shrink: 0;
}
.dk-chat-title { font-weight: 600; font-size: 15px; line-height: 1.2; }
.dk-chat-status {
  font-size: 11.5px; opacity: 0.8; margin-top: 3px;
  display: flex; align-items: center; gap: 6px;
}
.dk-chat-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); animation: dk-blink 2s infinite;
}
@keyframes dk-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
#dk-chat-close {
  background: transparent; border: none; color: #fff; cursor: pointer;
  opacity: 0.7; transition: opacity 0.2s; padding: 4px; line-height: 0;
}
#dk-chat-close:hover { opacity: 1; }

/* Лента сообщений */
.dk-chat-log {
  flex: 1; overflow-y: auto; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--ivory);
}
.dk-chat-log::-webkit-scrollbar { width: 6px; }
.dk-chat-log::-webkit-scrollbar-thumb { background: rgba(22,68,50,0.18); border-radius: 3px; }

.dk-chat-msg { display: flex; max-width: 88%; }
.dk-chat-msg-bot { align-self: flex-start; }
.dk-chat-msg-user { align-self: flex-end; }
.dk-chat-bubble {
  padding: 11px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45;
  word-wrap: break-word;
}
.dk-chat-msg-bot .dk-chat-bubble {
  background: #fff; color: var(--graphite);
  border: 1px solid rgba(22,68,50,0.08);
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 8px rgba(22,68,50,0.05);
}
.dk-chat-msg-user .dk-chat-bubble {
  background: var(--primary-dark); color: #fff;
  border-bottom-right-radius: 5px;
}
.dk-chat-bubble b { font-weight: 700; }
.dk-chat-bubble i { font-style: italic; opacity: 0.85; }
.dk-chat-link {
  color: var(--primary); font-weight: 600; text-decoration: none;
  display: inline-block; margin-top: 4px;
}
.dk-chat-link:hover { text-decoration: underline; }

/* Индикатор «печатает» */
.dk-chat-typing .dk-chat-bubble { display: flex; gap: 4px; padding: 14px; }
.dk-chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(22,68,50,0.35);
  animation: dk-typing 1.2s infinite;
}
.dk-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.dk-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dk-typing { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Карточки объектов в чате */
.dk-chat-cards { display: flex; flex-direction: column; gap: 10px; }
.dk-chat-card {
  display: flex; gap: 11px; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid rgba(22,68,50,0.1);
  border-radius: 12px; overflow: hidden; padding: 8px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.dk-chat-card:hover {
  border-color: var(--primary); transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(22,68,50,0.1);
}
.dk-chat-card-img { width: 84px; height: 70px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.dk-chat-card-img img { width: 100%; height: 100%; object-fit: cover; }
.dk-chat-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.dk-chat-card-title {
  font-size: 13.5px; font-weight: 600; color: var(--primary-dark); line-height: 1.25;
  margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dk-chat-card-meta { font-size: 11.5px; color: rgba(34,34,34,0.55); margin-bottom: 4px; }
.dk-chat-card-price { font-size: 14px; font-weight: 700; color: var(--primary); }

/* Быстрые подсказки */
.dk-chat-quick {
  display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px;
  flex-shrink: 0;
}
.dk-chat-quick:not(:empty) { padding-bottom: 10px; }
.dk-chat-qbtn {
  background: #fff; border: 1px solid var(--primary);
  color: var(--primary); font-size: 12.5px; font-weight: 500;
  padding: 7px 13px; border-radius: 18px; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.dk-chat-qbtn:hover { background: var(--primary); color: #fff; }

/* Поле ввода */
.dk-chat-form {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-top: 1px solid rgba(22,68,50,0.08);
  background: #fff; flex-shrink: 0;
}
.dk-chat-input {
  flex: 1; border: 1px solid rgba(22,68,50,0.15); border-radius: 22px;
  padding: 11px 16px; font-size: 14px; font-family: inherit;
  outline: none; transition: border-color 0.2s; background: var(--ivory);
}
.dk-chat-input:focus { border-color: var(--primary); }
.dk-chat-send {
  width: 42px; height: 42px; flex-shrink: 0; border: none; cursor: pointer;
  background: var(--primary-dark); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.dk-chat-send:hover { background: var(--primary); transform: scale(1.05); }

@media (max-width: 480px) {
  #dk-chat-panel {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
    bottom: 0; left: 0; border-radius: 0;
  }
  #dk-chat-launcher { bottom: 18px; left: 18px; }
  .dk-chat-hint { bottom: 94px; left: 18px; max-width: calc(100vw - 36px); }
}

/* ============================================================
   КАРТА ОБЪЕКТОВ + ПЕРЕКЛЮЧАТЕЛЬ ВИДА
   ============================================================ */
.view-toggle-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 22px;
  border: 1px solid rgba(22, 68, 50, 0.15);
  background: #fff; color: var(--graphite);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.view-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }
.view-toggle-btn.active {
  background: var(--primary-dark); color: #fff; border-color: var(--primary-dark);
}

#properties-map {
  position: relative;       /* локализуем stacking context Leaflet */
  z-index: 0;
  height: 560px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(22, 68, 50, 0.1);
  margin-bottom: 2.5rem;
}
#properties-map.hidden { display: none; }

/* Карточка во всплывающем окне Leaflet */
.leaflet-popup-content { margin: 0; }
.leaflet-popup-content-wrapper { border-radius: 12px; overflow: hidden; padding: 0; }
.map-popup { width: 220px; font-family: 'Manrope', sans-serif; }
.map-popup-img { width: 100%; height: 120px; overflow: hidden; }
.map-popup-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-popup-title {
  font-size: 14px; font-weight: 600; color: var(--primary-dark);
  line-height: 1.25; margin: 10px 12px 4px;
}
.map-popup-meta { font-size: 12px; color: rgba(34, 34, 34, 0.55); margin: 0 12px 6px; }
.map-popup-price { font-size: 16px; font-weight: 700; color: var(--primary); margin: 0 12px 10px; }
.map-popup-btn {
  display: block; width: calc(100% - 24px); margin: 0 12px 12px;
  padding: 9px 0; border: none; border-radius: 8px; cursor: pointer;
  background: var(--primary-dark); color: #fff;
  font-size: 13px; font-weight: 600; font-family: inherit;
  transition: background 0.2s;
}
.map-popup-btn:hover { background: var(--primary); }

/* ============================================================
   ИПОТЕЧНЫЙ КАЛЬКУЛЯТОР
   ============================================================ */
.mortgage-field { margin-bottom: 1.25rem; }
.mortgage-range {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px; background: rgba(22, 68, 50, 0.15);
  outline: none; cursor: pointer;
}
.mortgage-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); cursor: pointer; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(22, 68, 50, 0.3);
}
.mortgage-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); cursor: pointer; border: 3px solid #fff;
}
.mortgage-range-val {
  min-width: 48px; text-align: right;
  font-weight: 600; color: var(--primary-dark); font-size: 14px;
}

@media (max-width: 768px) {
  #properties-map { height: 420px; }
}