/* ============================================================
   Галактика — Самара. Минималистичный премиальный стиль.
   Тёмный акцент + светлый фон, аккуратная типографика,
   мягкие тени, плавные анимации.
   ============================================================ */

/* --- Базовая палитра и шрифты ---------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f4f7fb;
  --bg-soft: #e7edf6;
  --surface: #ffffff;
  --surface-2: #f9fbfe;
  --ink: #0c1430;
  --ink-soft: #3a4560;
  --muted: #7a83a0;
  --line: #e5eaf3;
  --line-strong: #d3dbea;
  --accent: #1e3a8a;      /* фирменный тёмно-синий «Галактики» (как в логотипе) */
  --accent-hover: #17307a;
  --accent-deep: #122a6b;
  --accent-soft: rgba(30, 58, 138, 0.1);
  --ok: #12836a;
  --warn: #c8911a;
  --err: #d94a5f;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 26, 60, 0.06), 0 2px 8px rgba(20, 26, 60, 0.05);
  --shadow-md: 0 14px 38px rgba(31, 41, 90, 0.1);
  --shadow-lg: 0 30px 70px rgba(31, 41, 90, 0.16);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { width: min(1160px, 92vw); margin: 0 auto; }

::selection { background: var(--accent); color: #fff; }

/* ============================================================
   Хедер
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 247, 251, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  -webkit-tap-highlight-color: transparent;
}
.header-inner {
  display: flex; align-items: center; gap: 28px;
  padding: 16px 0;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo .logo-img { display: block; height: 48px; width: auto; object-fit: contain; }
.logo .wordmark {
  display: flex; flex-direction: column; line-height: 1.05;
  font-weight: 800; font-size: 24px; letter-spacing: 0.02em;
  color: var(--accent-deep); text-transform: uppercase; white-space: nowrap;
}
.logo .wordmark small {
  margin-top: 5px; font-size: 10.5px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap;
}
.logo .mark {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; font-size: 19px;
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.28);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.logo:hover .mark { transform: rotate(-8deg) scale(1.05); }

/* Слоган в шапке между логотипом и меню */
.header-tagline {
  display: inline-flex; align-items: center; gap: 10px;
  margin-left: 8px; padding-left: 20px;
  border-left: 3px solid var(--accent);
  font-size: 17px; font-weight: 800; letter-spacing: 0.02em;
  color: var(--accent-deep); white-space: nowrap;
  line-height: 1.1;
}

/* Кнопка-бургер мобильного меню (видна только на телефоне/планшете) */
.site-nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--surface); border: 1.5px solid var(--line-strong);
  color: var(--ink-soft); cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.site-nav-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }
.site-nav-toggle svg { width: 22px; height: 22px; }

/* затемнение под открытым мобильным меню */
.nav-overlay {
  position: fixed; inset: 0; z-index: 110; background: rgba(12, 20, 48, 0.42);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none;
  transition: opacity 0.28s var(--ease);
}
body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }

.nav { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.nav a {
  position: relative; color: var(--ink-soft); font-weight: 600; font-size: 15px;
  padding: 8px 14px; border-radius: 10px; transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.28s var(--ease); border-radius: 2px;
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a.active { color: var(--ink); }
.nav a.active::after { transform: scaleX(1); }
.nav-close { display: none; }
.nav .nav-title { display: none; }

/* ссылка «панель владельца» — маленький чёрный квадрат, чтобы не путалась с сердечком избранного */
.nav a.nav-owner {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px; padding: 0;
}
.nav a.nav-owner::after { display: none; }
.nav a.nav-owner:hover { background: none; }
.nav-owner-dot {
  display: block; width: 12px; height: 12px; border-radius: 3px;
  background: var(--ink); transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.nav a.nav-owner:hover .nav-owner-dot { background: var(--accent); transform: scale(1.15); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 76px 0 48px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 55% at 80% 8%, rgba(30, 58, 138, 0.14), transparent 60%),
    radial-gradient(55% 50% at 12% 90%, rgba(18, 42, 107, 0.1), transparent 60%);
}
.hero .container { position: relative; }
.hero h1 {
  margin: 0 0 18px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.06;
  font-size: clamp(34px, 5.2vw, 60px);
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: 18px; color: var(--ink-soft); max-width: 640px; margin: 0 0 34px; }

.messenger-row { display: flex; flex-wrap: wrap; gap: 12px; }
.messenger-row .msgr {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 14px;
  font-weight: 700; font-size: 14.5px; color: #fff; text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.messenger-row .msgr svg { width: 20px; height: 20px; }
.messenger-row .msgr:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16); }
.msgr--wa { background: #25d366; }
.msgr--tg { background: #229ed9; }
.msgr--max { background: linear-gradient(135deg, #3f63f5 0%, #8b3ff2 100%); }
@media (max-width: 640px) {
  .messenger-row .msgr { flex: 1; justify-content: center; padding: 12px 10px; }
}

.stats { display: flex; gap: 48px; flex-wrap: wrap; }
.stat { position: relative; }
.stat::before {
  content: ""; width: 34px; height: 3px; border-radius: 3px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--accent), #818cf8); display: block;
}
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 13.5px; color: var(--muted); }

/* ---------- полоса доверия (10 лет заботимся о гостях) ---------- */
.stats { margin-top: 8px; }
.stat b {
  display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink);
}
.stat span { font-size: 14px; color: var(--muted); }
@media (max-width: 640px) {
  .stats { gap: 24px; }
  .stat b { font-size: 26px; }
}

/* ---------- метро на карточке и странице квартиры ---------- */
.metro-line { font-size: 13px; color: var(--accent); font-weight: 600; margin: 2px 0 6px; }

/* ============================================================
   Панель поиска
   ============================================================ */
.search-bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    "in out guests"
    "rooms price btn";
  gap: 14px 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; margin: 20px 0 8px; box-shadow: var(--shadow-md);
}
.search-bar .field:nth-child(1) { grid-area: in; }
.search-bar .field:nth-child(2) { grid-area: out; }
.search-bar .field:nth-child(3) { grid-area: guests; }
.search-bar .field:nth-child(4) { grid-area: rooms; }
.search-bar .field:nth-child(5) { grid-area: price; }
.search-bar #searchBtn { grid-area: btn; justify-self: stretch; align-self: end; padding: 14px 28px; font-size: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 8px 4px; letter-spacing: 0.01em; }

/* инпуты и селекты — единый аккуратный вид, ничего не вылезает */
.field input, .field select,
.field textarea,
.booking-box select {
  width: 100%;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 13px 42px 13px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink); font-size: 16px; font-weight: 500; font-family: inherit;
  outline: none; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  box-sizing: border-box;
}
.field textarea { resize: vertical; min-height: 90px; padding-right: 16px; }
.field select,
.booking-box select {
  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='%237a8090' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 42px;
  cursor: pointer;
}
.field input:hover, .field select:hover, .booking-box select:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .booking-box select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface);
}
.field input::placeholder { color: #a9aeba; }

/* ---------- Собственный русский календарь (дд.мм.гггг) ---------- */
.date-field {
  display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.date-field:hover { border-color: var(--muted); }
.date-field.filled { color: var(--ink); border-color: var(--line-strong); }
.date-field.filled .date-text { font-weight: 600; }
.date-field .date-ico { flex: 0 0 auto; color: var(--muted); }
.date-field .date-text { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cal-popup {
  position: absolute; z-index: 60; width: 288px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity .15s, transform .15s;
}
.cal-popup.show { opacity: 1; pointer-events: auto; transform: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.cal-nav { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; transition: .15s; }
.cal-nav:hover { border-color: var(--accent); color: var(--accent); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 2px; }
.cal-dow span { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-empty { min-height: 34px; }
.cal-day {
  display: flex; align-items: center; justify-content: center; min-height: 34px;
  border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink); transition: .12s;
}
.cal-day:hover { background: var(--accent-soft); color: var(--accent); }
.cal-day.disabled { color: #c9ccd4; cursor: default; }
.cal-day.disabled:hover { background: none; color: #c9ccd4; }
.cal-day.in-range { background: var(--accent-soft); color: var(--accent); }
.cal-day.sel-in, .cal-day.sel-out { background: var(--accent); color: #fff; font-weight: 700; box-shadow: var(--shadow-sm); }
.cal-day.sel-in { border-radius: 8px 0 0 8px; }
.cal-day.sel-out { border-radius: 0 8px 8px 0; }

/* Крупные поля без внешних подписей (ФИО/телефон в форме брони): placeholder сам объясняет поле */
.field.big { width: 100%; padding: 15px 18px; font-size: 16px; border-radius: 12px; }

/* --- степпер выбора числа гостей (вместо системного select) --- */
.stepper {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border: 1.5px solid var(--line-strong); border-radius: 11px;
  padding: 7px; box-sizing: border-box; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper .step-btn {
  width: 38px; height: 38px; min-width: 38px; border-radius: 9px;
  border: none; background: var(--surface); color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease), opacity 0.16s var(--ease);
}
.stepper .step-btn:hover:not(:disabled) { background: var(--accent); color: #fff; transform: scale(1.05); }
.stepper .step-btn:active:not(:disabled) { transform: scale(0.9); }
.stepper .step-btn:disabled { opacity: 0.3; cursor: default; }
.stepper .step-value {
  flex: 1; text-align: center; font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.stepper .step-value .unit { color: var(--muted); font-weight: 500; font-size: 14px; }

/* --- сегмент-переключатель количества комнат --- */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  background: var(--surface-2); border: 1.5px solid var(--line-strong); border-radius: 11px;
  padding: 5px; box-sizing: border-box; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.seg:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.seg .seg-btn {
  border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px;
  padding: 9px 6px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), transform 0.16s var(--ease);
}
.seg .seg-btn:hover:not(.active) { color: var(--ink); background: var(--surface); }
.seg .seg-btn:active { transform: scale(0.95); }
.seg .seg-btn.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border: none; border-radius: 11px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  will-change: transform;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(30, 58, 138, 0.3); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-sm); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); background: var(--surface-2); }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; box-shadow: var(--shadow-sm); }

/* ============================================================
   Секции и заголовки
   ============================================================ */
.section-element, .section-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 52px 0 6px; }
.section-sub { color: var(--muted); margin: 0 0 26px; font-size: 15.5px; }
.rules-section { scroll-margin-top: 80px; }
.rules-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 30px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04); }
.rules-intro { margin-bottom: 16px; }
.rules-important { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: 0.02em; color: var(--accent-deep); }
.rules-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.rules-list li { font-size: 15.5px; line-height: 1.55; color: var(--text); }
.rules-list li::marker { color: var(--accent-deep); font-weight: 800; }
.divider { height: 1px; background: var(--line); margin: 56px 0 0; }

/* ============================================================
   Карточки квартир
   ============================================================ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; }

/* Плюсы «Почему выбирают наши квартиры?» — 4 карточки в один ряд */
.grid-adv { grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-adv .card h3 { font-size: 17px; margin-bottom: 8px; }
.grid-adv .card .meta { font-size: 14px; }
.grid-adv .card .body { padding: 22px 20px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  cursor: pointer; position: relative;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  animation: fadeUp 0.8s var(--ease) both;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }

.card .thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-soft); }
.card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.card:hover .thumb img { transform: scale(1.06); }
.card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 24, 33, 0.14), transparent 55%);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.card:hover .thumb::after { opacity: 1; }
.card:hover .g-slide { transform: none; }

/* --- слайдер фото на карточке (свайп влево/вправо) --- */
.card .g-track { display: flex; width: 100%; height: 100%; transition: transform 0.35s var(--ease); will-change: transform; }
.card .g-slide { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }
.card .g-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line-strong);
  color: var(--ink); font-size: 18px; line-height: 1; z-index: 3;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.card .g-nav:hover { background: #fff; color: var(--accent); }
.card .g-prev { left: 8px; }
.card .g-next { right: 8px; }
.card .g-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px; z-index: 3;
}
.card .g-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer; transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
.card .g-dot.active { background: #fff; transform: scale(1.2); }

.card .badges { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; z-index: 2; max-width: 55%; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(6px); }
.badge.type { background: rgba(255, 255, 255, 0.9); color: var(--ink); box-shadow: var(--shadow-sm); }
.badge.rating { background: var(--accent); color: #fff; }
.badge.popular { background: linear-gradient(135deg, #ff7a18, #ff3d54); color: #fff; box-shadow: 0 4px 12px rgba(255, 90, 40, 0.35); }

/* --- кнопки на карточке («В избранное» и «Сравнить») --- */
.card-tools {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; max-width: 45%;
}
.card-tools .fav-toggle,
.card-tools .compare-toggle {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255, 255, 255, 0.9); color: var(--ink); font-size: 11.5px; font-weight: 700;
  cursor: pointer; backdrop-filter: blur(6px); box-shadow: var(--shadow-sm);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.card-tools .fav-toggle:hover,
.card-tools .compare-toggle:hover { transform: translateY(-2px); background: #fff; }
.card-tools .compare-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.card-tools .fav-toggle.active {
  background: linear-gradient(135deg, #ff5a7a, #ff2d55); color: #fff; border-color: #ff2d55;
  box-shadow: 0 4px 12px rgba(255, 45, 85, 0.35);
}
.card-tools .fav-heart { font-size: 14px; line-height: 1; }
.card-tools .fav-toggle.active .fav-heart { animation: heartPop 0.3s var(--ease); }
@keyframes heartPop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (max-width: 560px) {
  .card .badges { max-width: 48%; }
  .card-tools { top: 10px; right: 10px; max-width: 48%; justify-content: flex-end; }
  .card-tools .fav-toggle, .card-tools .compare-toggle { font-size: 12px; padding: 7px 11px; }
}

/* --- панель сравнения внизу --- */
.compare-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 16px; box-shadow: var(--shadow-lg); max-width: min(92vw, 720px);
  animation: fadeUp 0.35s var(--ease) both;
}
.compare-bar__head { font-weight: 800; font-size: 14px; white-space: nowrap; }
.compare-bar__chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.compare-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  color: var(--ink);
}
.compare-chip .compare-x { background: none; border: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 0 0 2px; }
.compare-chip .compare-x:hover { color: var(--err); }

/* --- модальное окно сравнения --- */
.modal--compare { max-width: 860px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-lg); }
.compare-table-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th, .compare-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.compare-table th { background: var(--bg-soft); font-weight: 700; color: var(--ink); }
.compare-table .cmp-label { color: var(--muted); font-weight: 600; white-space: nowrap; }

.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.card h3 a { transition: color 0.2s var(--ease); }
.card:hover h3 a { color: var(--accent-hover); }
.card .meta { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.card .meta .dot { margin: 0 7px; color: var(--line-strong); }
.card .amenities { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { font-size: 12px; background: var(--bg-soft); color: var(--ink-soft); padding: 4px 11px; border-radius: 999px; font-weight: 600; }

.card .price-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.card .price b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.card .price span { display: block; font-size: 12px; color: var(--muted); }
.card .price-row .btn { padding: 11px 18px; font-size: 14px; }

/* --- тулбар над списком: фильтр «Избранные» --- */
.list-toolbar { display: flex; justify-content: flex-end; margin: 4px 0 18px; }
.fav-filter {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.fav-filter .fav-heart { font-size: 16px; line-height: 1; color: var(--err); transition: transform 0.2s var(--ease); }
.fav-filter .fav-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 999px; background: var(--bg-soft); color: var(--ink); font-size: 12px; font-weight: 800;
}
.fav-filter:hover { transform: translateY(-2px); background: #fff; }
.fav-filter.active {
  background: linear-gradient(135deg, #ff5a7a, #ff2d55); color: #fff; border-color: #ff2d55;
  box-shadow: 0 4px 12px rgba(255, 45, 85, 0.35);
}
.fav-filter.active .fav-heart { color: #fff; }
.fav-filter.active .fav-count { background: rgba(255,255,255,0.25); color: #fff; }
@media (max-width: 560px) { .list-toolbar { justify-content: stretch; } .fav-filter { flex: 1; justify-content: center; } }

/* ============================================================
   Страница квартиры
   ============================================================ */
.crumbs { font-size: 14px; color: var(--muted); margin: 26px 0 12px; }
.crumbs a { color: var(--muted); transition: color 0.2s var(--ease); }
.crumbs a:hover { color: var(--ink); }

.detail-head h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 10px; }
.detail-head .sub { color: var(--muted); font-size: 15.5px; }
.rating-pill { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-weight: 700; }

/* кнопка-сердечко на странице квартиры (общий вариант карточки переопределён) */
.fav-toggle--head {
  position: static; margin-top: 16px;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.fav-toggle--head:hover { transform: translateY(-2px); background: #fff; }
.fav-toggle--head .fav-heart { font-size: 17px; line-height: 1; color: var(--err); transition: transform 0.2s var(--ease); }
.fav-toggle--head.active {
  background: linear-gradient(135deg, #ff5a7a, #ff2d55); color: #fff; border-color: #ff2d55;
  box-shadow: 0 4px 12px rgba(255, 45, 85, 0.35);
}
.fav-toggle--head.active .fav-heart { color: #fff; animation: heartPop 0.3s var(--ease); }

.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.share-btn--main { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: #fff; border: none; }

/* Галерея: первое фото — широкое (во всю ширину), остальные — сеткой.
   Показывает ЛЮБОЕ количество фотографий без ограничений и без пустых ячеек. */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 26px 0; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow-sm); transition: transform 0.5s var(--ease); cursor: zoom-in; }
.gallery .main { grid-column: 1 / -1; aspect-ratio: 16/9; }
.gallery img:hover { transform: scale(1.02); }

/* ============================================================
   Лайтбокс — просмотр фотографии квартиры в полный экран
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 400; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(6, 10, 24, 0.92); backdrop-filter: blur(6px); flex-direction: column;
}
.lightbox--open { display: flex; }
.lightbox__img {
  max-width: min(92vw, 1200px); max-height: 82vh; max-height: 82dvh;
  width: auto; height: auto; object-fit: contain; border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55); position: relative; z-index: 2;
}
.lightbox__counter {
  color: rgba(255, 255, 255, 0.85); font-size: 14px; font-weight: 600;
  margin-bottom: 14px; letter-spacing: 0.04em; z-index: 2;
}
.lightbox__btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 28px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.18s var(--ease);
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox__btn--prev { left: 12px; }
.lightbox__btn--next { right: 12px; }
.lightbox__close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 46px; height: 46px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 26px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.18s var(--ease);
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.24); }

.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.detail-info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.fact { background: var(--bg-soft); border-radius: 12px; padding: 14px 16px; transition: transform 0.2s var(--ease), background 0.2s var(--ease); }
.fact:hover { transform: translateY(-2px); background: var(--surface-2); }
.fact b { display: block; font-size: 17px; font-weight: 800; }
.fact span { color: var(--muted); font-size: 12.5px; }

.detail-info h2 { font-size: 19px; margin: 26px 0 10px; letter-spacing: -0.01em; }
.detail-info p { color: var(--ink-soft); }
.detail-info .about-text { white-space: normal; line-height: 1.55; }
.detail-info .about-text br { display: block; content: ""; margin-bottom: 6px; }
.detail-info .amenities { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- карта на странице квартиры --- */
.map-wrap {
  margin: 18px 0 6px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--bg-soft); box-shadow: var(--shadow-sm);
}
.map-wrap iframe, .map-wrap .map-canvas { display: block; width: 100%; height: 380px; border: 0; z-index: 0; }
.map-canvas { width: 100%; height: 380px; }
.map-link {
  display: inline-block; margin: 12px 16px 14px; font-size: 13.5px; font-weight: 700;
  color: var(--accent); transition: color 0.2s var(--ease);
}
.map-link:hover { color: var(--accent-hover); }

/* --- метро рядом: время пешком --- */
.metro-list { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 6px; }
.metro-near { display: inline-flex; align-items: baseline; gap: 6px; font-size: 14.5px; color: var(--ink); }
.metro-near b { font-weight: 700; color: var(--ink); }
.metro-near .metro-walk { color: var(--muted); font-weight: 600; white-space: nowrap; }

/* --- сайдбар бронирования --- */
.booking-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; position: sticky; top: 90px; box-shadow: var(--shadow-md);
  max-height: calc(100vh - 110px); overflow-y: auto;
}
.booking-box .price-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.booking-box .price-head b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.booking-box .price-head span { font-size: 13px; color: var(--muted); }
.booking-box .field { margin-bottom: 14px; }

.pricing { background: var(--bg-soft); border-radius: 12px; padding: 16px; margin: 16px 0; }
.pricing .row { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 14px; color: var(--ink-soft); }
.pricing .row:last-child { margin-bottom: 0; }
.pricing .row.total { font-size: 17px; color: var(--ink); font-weight: 800; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.pricing .row.deposit { color: var(--accent-hover); font-weight: 700; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

.msg { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; animation: fadeUp 0.4s var(--ease) both; }
.msg.err { background: #fdecec; color: var(--err); }
.msg.ok { background: #e8f7ef; color: var(--ok); }

.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Календарь
   ============================================================ */
.calendar { margin-top: 8px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface-2); }
.calendar .cal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cal-head .cal-month { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.cal-head button {
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  width: 32px; height: 32px; border-radius: 9px; font-size: 18px; line-height: 1;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
  display: grid; place-items: center;
}
.cal-head button:hover:not(:disabled) { background: var(--bg-soft); transform: scale(1.06); }
.cal-head button:active:not(:disabled) { transform: scale(0.94); }
.cal-head button:disabled { opacity: 0.35; cursor: default; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px; }
.cal-grid .dow { text-align: center; font-size: 11px; color: var(--muted); padding: 5px 0 7px; font-weight: 700; }
.day {
  text-align: center; font-size: 13.5px; font-weight: 600; padding: 8px 2px; border-radius: 8px;
  margin: 1px; cursor: pointer; user-select: none; transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}
.day.empty { cursor: default; }
.day.disable { color: #c2c7d1; cursor: not-allowed; }
.day.busy { color: #c2c7d1; text-decoration: line-through; cursor: not-allowed; background: var(--bg-soft); }
.day.avail { color: var(--ink); }
.day.avail:hover { background: var(--accent); color: #fff; transform: scale(1.05); }
.day.in-range { background: var(--bg-soft); color: var(--ink); }
.day.edge { background: var(--accent); color: #fff; font-weight: 800; box-shadow: var(--shadow-sm); }

/* --- легенда календаря занятости --- */
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 10px 14px 12px; border-top: 1px solid var(--line);
  background: var(--surface);
}
.cal-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-legend .lg-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lg-dot.lg-sel { background: var(--accent); }
.lg-dot.lg-busy { background: var(--bg-soft); border: 1px solid var(--line-strong); }
.lg-dot.lg-free { background: var(--surface); border: 1px solid var(--line-strong); }

/* ============================================================
   Подтверждение
   ============================================================ */
#confirmation { box-shadow: var(--shadow-md); animation: fadeUp 0.5s var(--ease) both; }

/* ============================================================
   Футер
   ============================================================ */
.site-footer { margin-top: 70px; border-top: 1px solid var(--line); background: var(--surface); padding: 44px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 14px; align-items: center; }
.footer-inner .brand { display: flex; gap: 12px; align-items: center; color: var(--ink); }
.footer-inner a { color: var(--ink-soft); transition: color 0.2s var(--ease); }
.footer-inner a:hover { color: var(--accent); }

/* ============================================================
   Анимации: появление при прокрутке
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.in { opacity: 1; transform: translateY(0); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }

/* появление карточек с задержкой динамически задаётся через style.animationDelay */

/* ============================================================
   Админ-панель
   ============================================================ */
.admin-wrap { padding: 40px 0; }
.admin-card {
  max-width: 560px; margin: 6vh auto 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow-md); text-align: center;
}
.admin-card h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -0.02em; }
.admin-card p { color: var(--muted); margin: 0 0 24px; font-size: 15px; }
.admin-card .field { text-align: left; margin-bottom: 18px; }
.admin-card input[type="password"] { appearance: none; padding: 13px 16px; }
.pin-input {
  letter-spacing: 0.5em; font-size: 20px !important; font-weight: 700; text-align: center;
}
.admin-card .hint { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

.admin-shell { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.admin-top h1 { font-size: 26px; margin: 0; letter-spacing: -0.02em; }

.admin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.admin-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: fadeUp 0.6s var(--ease) both;
}
.admin-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.admin-item .thumb { width: 100%; height: 148px; object-fit: cover; display: block; background: var(--bg-soft); }
.admin-item .info { padding: 14px 16px 0; min-width: 0; }
.admin-item .info b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-item .info > span { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-item .price-line { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; font-size: 16px; font-weight: 800; color: var(--ink); }
.admin-item .price-line em { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.admin-item .ical-status { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); width: fit-content; }
.admin-item .ical-status.ok { background: #e7f7ee; color: #1a7f43; }
.admin-item .ical-status.error { background: #fdeaea; color: #c0392b; }
.admin-item .ical-status.pending { background: #fff4e0; color: #b9770e; }
.admin-item .vis { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin: 12px 16px 0; }
.admin-item .switch { position: relative; width: 46px; height: 27px; flex-shrink: 0; cursor: pointer; }
.admin-item .switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.admin-item .switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background 0.22s var(--ease); }
.admin-item .switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(20, 26, 60, 0.25); transition: transform 0.22s var(--ease);
}
.admin-item .switch input:checked + .track { background: var(--accent); }
.admin-item .switch input:checked + .track::after { transform: translateX(19px); }
.admin-item .switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--accent-soft); }
.admin-item .actions { display: flex; gap: 8px; align-items: center; padding: 14px 16px; margin-top: auto; }

.icon-btn {
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 9px;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  color: var(--ink-soft); font-size: 13px; font-weight: 600;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(30, 58, 138, 0.22); }
.icon-btn.danger:hover { background: var(--err); border-color: var(--err); box-shadow: 0 6px 14px rgba(224, 66, 90, 0.22); }

.form-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; text-align: left; }
.form-body .wide { grid-column: 1 / -1; }
.form-body .field label { text-align: left; }
.form-footer { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.msg-inline { margin-top: 18px; }
.modal-overlay { position: fixed; inset: 0; background: rgba(16, 18, 24, 0.5); display: grid; place-items: center; z-index: 200; padding: 20px; backdrop-filter: blur(3px); animation: fadeUp 0.3s var(--ease) both; }
.modal { max-width: 640px; width: 100%; max-height: 88vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head b { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 6px; border-radius: 8px; }
.modal-close:hover { color: var(--ink); background: var(--surface-2); }
.rc-modal { max-width: 760px; padding: 18px; overflow: hidden; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ---------- галерея фото в форме владельца ---------- */
.photo-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 4px; }
.photo-picker .slot {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative;
  background: var(--surface-2); border: 1.5px dashed var(--line-strong);
  display: grid; place-items: center; color: var(--muted); text-align: center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.photo-picker .slot.add { cursor: pointer; color: var(--accent); font-size: 26px; font-weight: 600; }
.photo-picker .slot.add:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.photo-picker .slot.add span { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-top: 4px; }
.photo-picker .slot.add .lbl { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.photo-picker .slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-picker .slot .rm {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 7px;
  background: rgba(15, 18, 34, 0.72); color: #fff; border: none; font-size: 13px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(2px);
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
.photo-picker .slot .rm:hover { background: var(--err); transform: scale(1.08); }
.photo-picker .slot .cover {
  position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 700;
  background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 6px; cursor: pointer;
}
.upload-progress { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--accent); }
.upload-hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 2px; }

/* ---------- выбор удобств со значками в форме владельца ---------- */
.amen-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.amen-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface-2);
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}
.amen-item .ami { font-size: 16px; line-height: 1; }
.amen-item .amchk { width: 16px; color: var(--accent); font-weight: 800; }
.amen-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.amen-item.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
/* ---------- видео в форме владельца ---------- */
.video-picker { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.video-status { font-size: 13px; color: var(--muted); }
.form-sub { font-size: 15px; margin: 4px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); color: var(--ink); }
/* ---------- блоки «О квартире» и «Правила» на странице квартиры ---------- */
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px; }
.detail-cols .dc { display: flex; flex-direction: column; gap: 4px; font-size: 14.5px; line-height: 1.45; }
.detail-cols .dc-label { color: var(--muted); font-weight: 600; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.02em; }
.detail-cols .dc-val { color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: break-word; }
.detail-panel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.detail-empty { color: var(--muted); }
@media (max-width: 640px) { .detail-cols { grid-template-columns: 1fr; gap: 14px; } .detail-panel { padding: 16px; } }
.video-block { margin: 18px 0; }
.video-block video { width: 100%; max-height: 480px; border-radius: 14px; background: #000; display: block; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 900px) {
  .search-bar { grid-template-columns: 1fr 1fr; grid-template-areas: "in out" "guests rooms" "price price" "btn btn"; }
  .search-bar #searchBtn { justify-self: stretch; width: 100%; }
  .detail-layout { grid-template-columns: 1fr; }
  .booking-box { position: static; }
  .gallery { grid-template-columns: 1fr; grid-template-rows: auto; }
  .gallery .main { grid-row: auto; }
  .hero { padding: 46px 0 30px; }
  .hero h1 { font-size: clamp(30px, 6.5vw, 42px); }
  .hero .lead { font-size: 16px; margin-bottom: 26px; }
  .stats { gap: 28px; }
  .stat b { font-size: 24px; }
  .section-title { font-size: 24px; margin: 40px 0 4px; }

  /* Мобильная навигация вместо полного скрытия меню */
  .nav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 120;
    width: 282px; max-width: 88vw; height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    margin: 0; padding: calc(22px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg); overflow-y: auto;
    transform: translateX(-100%); transition: transform 0.3s var(--ease);
  }
  body.nav-open .nav { transform: translateX(0); }
  .nav .nav-title {
    display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--muted); padding: 0 16px 10px; margin-bottom: 6px;
  }
  .nav a {
    display: block; padding: 14px 16px; font-size: 16px; font-weight: 600;
    border-radius: 12px; color: var(--ink-soft); text-align: left; min-height: 52px;
  }
  .nav a:hover { background: var(--surface-2); color: var(--ink); }
  .nav a::after { display: none; }
  /* ссылка «панель владельца» в мобильном меню — небольшая плитка-строка */
  .nav a.nav-owner {
    display: block; margin-top: auto; margin-left: 0; padding: 14px 16px;
    border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2);
  }
  .nav a.nav-owner::after { display: none; }
  .nav a.nav-owner .nav-owner-dot { display: inline-block; vertical-align: middle; margin-right: 10px; }
  .nav a.nav-owner::before { content: "Владельцам"; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
  .nav-close {
    display: grid; place-items: center; align-self: flex-start;
    width: 38px; height: 38px; margin-bottom: 8px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
    font-size: 20px; line-height: 1; cursor: pointer;
  }
  .site-nav-toggle { display: inline-flex; margin-left: auto; }
  .header-inner { gap: 12px; }
  /* на телефоне слоган в шапке скрываем, чтобы не перегружать */
  .header-tagline { display: none; }
}

/* Отключаем hover-поднятие карточек на сенсорных экранах */
@media (hover: none) {
  .card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--line); }
  .card:hover .thumb img { transform: none; }
  .card:hover .thumb::after { opacity: 0; }
  .btn:hover { transform: none; }
  .fav-toggle--head:hover, .fav-filter:hover, .share-btn:hover, .btn-guest:hover { transform: none; }
  .card h3 a:hover, .fav-filter:hover { color: inherit; }
}

/* ---------- узкие экраны (маленький ноутбук / телефон) ---------- */
@media (max-width: 640px) {
  .detail-info { padding: 18px; }
  .facts { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 9px; }
  .fact { padding: 11px 13px; }
  .fact b { font-size: 15px; }
  .booking-box { padding: 16px; top: 84px; max-height: none; }
  .gallery { grid-template-columns: 1fr; grid-template-rows: auto; gap: 10px; }
  .gallery .main { grid-column: auto; aspect-ratio: 16/10; }
  .map-wrap iframe { height: 280px; }
  .cal-grid { padding: 6px; }
  .day { font-size: 13px; padding: 7px 1px; border-radius: 7px; }
  .cal-legend { gap: 8px; padding: 8px 12px 10px; }

  /* Компактная шапка под телефон */
  .header-inner {
    padding: 12px 0;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }
  .site-header, .site-nav-toggle, .nav { -webkit-tap-highlight-color: transparent; }
  .logo .logo-img { height: 40px; }
  .logo .wordmark { font-size: 19px; }
  .logo .wordmark small { font-size: 9px; letter-spacing: 0.1em; }
  .container { width: min(1160px, 94vw); }

  /* Поиск: поля и кнопка во всю ширину, без «выпирания» */
  .search-bar { gap: 12px; }

  .hero h1 { font-size: clamp(26px, 8.4vw, 38px); }
  .hero .lead { font-size: 15px; margin-bottom: 22px; }
  .section-title { font-size: 22px; }
  .section-sub { font-size: 14px; }

  /* Карточки */
  .grid { gap: 16px; }
  .grid-adv { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card .body { padding: 15px 16px 16px; }
  .card h3 { font-size: 16.5px; }

  /* Кнопка «В избранное» на странице квартиры */
  .fav-toggle--head { width: 100%; justify-content: center; }
  .list-toolbar { margin-bottom: 14px; }
}

/* ---------- узкие телефоны (≤560px) ---------- */
@media (max-width: 560px) {
  .stats { gap: 20px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 13px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer { padding: 30px 0; }
  .btn { width: 100%; }
  .detail-head h1 { font-size: clamp(24px, 7vw, 32px); }
  .detail-head .sub { font-size: 14px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .review-date { margin-left: 0; }
  .review-top { gap: 6px; }
}

/* ---------- очень узкие экраны (телефоны) ---------- */
@media (max-width: 420px) {
  .booking-box .price-head b { font-size: 22px; }
  .cal-head .cal-month { font-size: 14px; }
  .detail-info h2 { font-size: 17px; }
}

/* ============================================================
   Авторизация гостя (кнопка «Войти» + модалка входа)
   ============================================================ */
.guest-box { display: flex; align-items: center; margin-left: auto; }
.btn-guest {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1;
  cursor: pointer; transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn-guest svg { width: 17px; height: 17px; }
.btn-guest:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-2); transform: translateY(-1px); }

.auth-modal { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; padding: 20px; }
.auth-modal--open { display: flex; }
.auth-modal__overlay { position: absolute; inset: 0; background: rgba(16, 18, 24, 0.55); backdrop-filter: blur(4px); animation: fadeIn 0.25s var(--ease) both; }
.auth-modal__card {
  position: relative; width: 100%; max-width: 400px; background: var(--surface);
  border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-lg);
  transform: translateY(20px); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.auth-modal__card--in { transform: translateY(0); opacity: 1; }
.auth-modal__close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
  font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.auth-modal__close:hover { background: var(--err); color: #fff; }
.auth-modal__logo { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; color: var(--accent); margin-bottom: 6px; }
.auth-modal__card h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.02em; }
.auth-modal__sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.auth-modal__card form { display: flex; flex-direction: column; gap: 14px; }
.auth-code-row { display: flex; gap: 10px; align-items: flex-end; }
.auth-code-row .field { flex: 1; }
.auth-resend {
  flex-shrink: 0; padding: 14px 12px; border-radius: 11px; border: 1.5px solid var(--line-strong);
  background: var(--surface-2); color: var(--ink-soft); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.auth-resend:hover { border-color: var(--accent); color: var(--accent); }
.auth-demo {
  background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: 11px;
  padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.auth-demo small { font-size: 11.5px; color: var(--ink-soft); }
.auth-demo b { font-size: 20px; letter-spacing: 0.12em; color: var(--accent); }
.auth-error { color: var(--err); font-size: 13px; font-weight: 600; margin: 0; }
.auth-terms { font-size: 11.5px; color: var(--muted); margin: 20px 0 0; text-align: center; }
.auth-modal__card [hidden] { display: none !important; }
/* ФИО + обязательные галочки (условия использования и персональные данные) */
.auth-terms-check { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 11px; }
.auth-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.auth-check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin-top: 1px; flex-shrink: 0;
  width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.auth-check input[type="checkbox"]:hover { border-color: var(--accent); }
.auth-check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.auth-check input[type="checkbox"]:checked::after {
  content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0.5px, -1px);
}
.auth-check a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-check a:hover { text-decoration: underline; }

/* ============================================================
   Окно согласия (условия + cookie) при первом визите
   ============================================================ */
.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
  display: flex; justify-content: center; padding: 18px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  background: none; pointer-events: none;
  animation: fadeIn 0.35s var(--ease) both;
}
.consent-card {
  pointer-events: auto;
  width: 100%; max-width: 560px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 24px 26px;
  transform: translateY(16px); opacity: 0;
  animation: consentIn 0.4s var(--ease) 0.1s both;
}
@keyframes consentIn { to { transform: translateY(0); opacity: 1; } }
.consent-banner--out { animation: fadeOut 0.4s var(--ease) both; }
.consent-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; margin-bottom: 14px;
}
.consent-icon svg { width: 24px; height: 24px; }
.consent-card h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.consent-card p { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.consent-card p a { color: var(--accent); font-weight: 600; text-decoration: none; }
.consent-card p a:hover { text-decoration: underline; }
.consent-card p em { font-style: normal; font-weight: 600; }
.consent-actions { display: flex; gap: 10px; }
.consent-actions .btn-primary { flex: 1; }

/* ============================================================
   Онлайн-ассистент (плавающий чат)
   ============================================================ */
.chat-fab {
  position: fixed; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 200;
  width: 60px; height: 60px; border-radius: 18px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 12px 30px rgba(30, 58, 138, 0.42);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.chat-fab svg { width: 26px; height: 26px; }
.chat-fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 40px rgba(30, 58, 138, 0.46); }
.chat-fab--active { transform: scale(0.96); }
.chat-fab__badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px;
  background: var(--err); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg);
}
.chat-window {
  position: fixed; right: 22px; bottom: calc(94px + env(safe-area-inset-bottom, 0px)); z-index: 250;
  width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
  background: var(--surface); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); animation: chatIn 0.3s var(--ease) both;
}
@keyframes chatIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.chat-window[hidden] { display: none; }
.chat-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff;
}
.chat-head__avatar {
  width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.18);
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
}
.chat-head b { display: block; font-size: 15px; }
.chat-head span { font-size: 12px; opacity: 0.85; }
.chat-head__close {
  margin-left: auto; width: 30px; height: 30px; border-radius: 9px; border: none;
  background: rgba(255,255,255,0.14); color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.chat-head__close:hover { background: rgba(255,255,255,0.26); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.chat-msg { max-width: 82%; padding: 10px 13px; border-radius: 15px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.chat-msg--user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.chat-msg--assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 6px; }
.chat-msg--typing span { color: var(--muted); animation: pulse 1.2s infinite; }
.chat-msg em { display: block; margin-top: 3px; font-size: 10.5px; font-style: normal; opacity: .7; }
.chat-msg--assistant em { color: var(--muted); }
.chat-msg--user em { color: rgba(255,255,255,.85); }
.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 4px; background: var(--surface); border-top: 1px solid var(--line); }
.chat-quick__btn {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--ink-soft); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}
.chat-quick__btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chat-form { display: flex; gap: 10px; padding: 12px 16px 16px; background: var(--surface); border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 11px 14px;
  font-size: 16px; font-family: inherit; color: var(--ink); background: var(--surface-2);
}
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-send {
  width: 44px; height: 44px; align-self: flex-end; border-radius: 12px; border: none;
  background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: background 0.18s var(--ease);
}
.chat-send svg { width: 20px; height: 20px; }
.chat-send:hover { background: var(--accent-hover); }

/* ============================================================
   Блок «Запросы владельцу» в админке
   ============================================================ */
.admin-requests { display: flex; flex-direction: column; gap: 12px; }
.request-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.request-item--pending { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.request-item--approved { border-color: var(--ok); }
.request-item--rejected { border-color: var(--line-strong); opacity: 0.7; }
.request-item__info { flex: 1; min-width: 0; }
.request-item__info b { display: block; font-size: 14.5px; }
.request-item__info span { font-size: 12.5px; color: var(--muted); }
.request-item__actions { display: flex; gap: 8px; flex-shrink: 0; }
.req-btn { padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.18s var(--ease); }
.req-btn--ok { border-color: var(--ok); color: var(--ok); }
.req-btn--ok:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.req-btn--no { border-color: var(--err); color: var(--err); }
.req-btn--no:hover { background: var(--err); border-color: var(--err); color: #fff; }
.req-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.req-status--pending { background: var(--accent-soft); color: var(--accent); }
.req-status--approved { background: rgba(22,168,118,0.14); color: var(--ok); }
.req-status--rejected { background: rgba(224,66,90,0.12); color: var(--err); }

/* --- Секция запросов в админке --- */
.req-section { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.req-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.req-head h2 { font-size: 21px; font-weight: 800; color: var(--ink); }
.req-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; max-width: 720px; }
.req-list { display: flex; flex-direction: column; gap: 12px; }
.req-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 18px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 14px; }
.request-item { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.request-item.pending { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.r-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.r-type { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.r-type.t-extend, .r-type.t-shorten { background: var(--accent-soft); color: var(--accent); }
.r-type.t-cancel { background: rgba(224,66,90,0.12); color: var(--err); }
.r-type.t-booking { background: rgba(22,168,118,0.14); color: var(--ok); }
.r-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.r-status.s-pending { background: var(--accent-soft); color: var(--accent); }
.r-status.s-approved { background: rgba(22,168,118,0.14); color: var(--ok); }
.r-status.s-rejected { background: rgba(224,66,90,0.12); color: var(--err); }
.r-status.s-conflict { background: rgba(240,148,32,0.14); color: #c0650a; }
.r-title { font-size: 15px; color: var(--ink); }
.r-meta { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.r-guest { font-size: 12.5px; color: var(--muted); }
.r-reason { font-size: 12.5px; color: var(--err); background: rgba(224,66,90,0.08); padding: 6px 10px; border-radius: 8px; align-self: start; }
.r-actions { display: flex; gap: 10px; margin-top: 4px; }
.danger-text { color: var(--err); }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.ghost.small { border-color: var(--line-strong); }

/* поля владельцев (получатели SMS) — единый вид с остальными инпутами */
.owner-name, .owner-phone {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink); font-size: 14.5px; font-weight: 500; font-family: inherit;
  outline: none; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  box-sizing: border-box;
}
.owner-name:hover, .owner-phone:hover { border-color: var(--muted); }
.owner-name:focus, .owner-phone:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.owner-name::placeholder, .owner-phone::placeholder { color: #a9aeba; }
.owner-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.owner-form-row .owner-name { flex: 1 1 180px; min-width: 160px; }
.owner-form-row .owner-phone { flex: 1.4 1 240px; min-width: 200px; }

/* ---- чаты с гостями (админка) ---- */
.admin-chats { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.admin-chats__list { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; }
.admin-chats__thread { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-height: 480px; display: flex; flex-direction: column; overflow: hidden; }
.ac-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ac-item:hover { border-color: var(--accent); }
.ac-item.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ac-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.ac-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ac-name { font-size: 14px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.ac-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; font-weight: 800; }
.ac-tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.ac-tag.ok { background: rgba(46, 160, 84, .14); color: #2ea054; }
.ac-tag.no { background: var(--accent-soft); color: var(--accent); }
.ac-tag.none { background: var(--surface-2); color: var(--muted); }
.ac-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-last { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-del { flex: 0 0 auto; width: 26px; height: 26px; border: none; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 6px; transition: color .15s, background .15s; display: flex; align-items: center; justify-content: center; }
.ac-del:hover { color: var(--err); background: rgba(217,74,95,.12); }
.thread-head { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.thread-back { display: none; align-items: center; gap: 6px; border: none; background: transparent; color: var(--accent); font-size: 14px; font-weight: 700; cursor: pointer; padding: 0; }
.thread-back svg { width: 18px; height: 18px; }
.thread-head b { font-size: 15px; color: var(--ink); }
.thread-head span { font-size: 13px; color: var(--muted); }
.thread-bookings { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tb-label { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.bk-item { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 6px; }
.bk-item.paid { border-left: 3px solid var(--ok); }
.bk-item.unpaid { border-left: 3px solid var(--accent); }
.bk-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.bk-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.bk-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.bk-tag.ok { background: rgba(46, 160, 84, .14); color: #2ea054; }
.bk-tag.no { background: var(--accent-soft); color: var(--accent); }
.bk-guest { font-size: 12.5px; color: var(--ink); }
.bk-guest a { color: var(--accent); }
.bk-dates { font-size: 12px; color: var(--muted); }
.bk-sum { font-size: 13px; font-weight: 800; color: var(--ink); }
.tb-empty { font-size: 12.5px; color: var(--muted); }
.thread-body { flex: 1 1 auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 360px; }
.th-msg { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.th-msg span { display: block; color: var(--ink); }
.th-msg em { display: block; margin-top: 4px; font-size: 11px; font-style: normal; color: var(--muted); }
.th-msg.guest { align-self: flex-start; background: var(--accent-soft); border-bottom-left-radius: 4px; }
.th-msg.owner { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.th-msg.owner span { color: #fff; }
.th-msg.owner em { color: rgba(255,255,255,0.75); }
.thread-form { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.thread-form input {
  flex: 1 1 auto; min-width: 0; border: 1.5px solid var(--line-strong);
  border-radius: 12px; padding: 11px 14px; font-size: 14px; font-family: inherit;
  color: var(--ink); background: var(--surface-2);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.thread-form input::placeholder { color: var(--muted); }
.thread-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.thread-form .btn { flex: 0 0 auto; width: auto; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 700; }
.thread-empty { margin: auto; text-align: center; color: var(--muted); font-size: 14px; padding: 24px; }
.thread-empty-small { color: var(--muted); font-size: 13px; text-align: center; padding: 8px; }

/* ---- статистика ---- */
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; line-height: 1.1; }
.stat-label { margin-top: 6px; font-size: 12px; color: var(--muted); }
.stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.stats-col h3, .stats-monthly + h3, #statsMonthly ~ h3 { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.stats-upcoming, .stats-apartments { display: flex; flex-direction: column; gap: 8px; }
.stat-row { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.sr-main { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.sr-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.stats-monthly .bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 8px 4px 0; }
.stats-monthly .bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.stats-monthly .bar { width: 100%; max-width: 34px; background: var(--accent); border-radius: 6px 6px 0 0; transition: height .4s var(--ease); }
.stats-monthly .bar-label { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ---- всплывающие уведомления владельцу (без поддержки Notification) ---- */
.owner-toast { position: fixed; right: 20px; bottom: 20px; z-index: 9999; max-width: 320px; background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 13px; animation: toastIn .3s var(--ease); }
.owner-toast b { display: block; margin-bottom: 3px; }
.owner-toast span { display: block; color: rgba(255,255,255,.85); }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---- отзывы ---- */
.reviews-rating { font-size: 14px; font-weight: 600; color: var(--accent); margin-left: 8px; }
.reviews-list { display: flex; flex-direction: column; gap: 12px; }
.review-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.review-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-top b { font-size: 14px; }
.review-stars { color: var(--accent); font-size: 14px; letter-spacing: 1px; }
.review-date { margin-left: auto; font-size: 12px; color: var(--muted); }
.review-text { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.reviews-form { margin-top: 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.reviews-form h3 { font-size: 16px; margin: 0; }
.stars-input { display: flex; gap: 4px; }
.star-btn { border: none; background: transparent; font-size: 28px; line-height: 1; color: #c8cede; cursor: pointer; transition: color .15s, transform .15s; }
.star-btn.on, .star-btn:hover { color: var(--accent); transform: scale(1.08); }

@media (max-width: 760px) {
  .admin-chats { grid-template-columns: 1fr; }
  .admin-chats__list { max-height: none; }
  /* На телефоне показываем либо список, либо переписку (не одновременно) */
  .admin-chats { display: block; }
  .admin-chats__list { display: block; }
  .admin-chats__thread { display: none; min-height: 0; }
  body.chat-open .admin-chats__list { display: none; }
  body.chat-open .admin-chats__thread { display: flex; }
  .thread-back { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--accent); font-size: 14px; font-weight: 700; cursor: pointer; padding: 0; }
  .thread-back svg { width: 18px; height: 18px; }
  .stats-cols { grid-template-columns: 1fr; }
}

/* --- Шаг подтверждения номера звонком --- */
.call-step__number {
  text-align: center;
  margin: 16px 0 6px;
}
/* Кнопка «Я позвонил» размещается сразу под номером как главное действие */
.call-step #callDone { width: 100%; margin: 14px 0 6px; }
.call-step__number a {
  display: inline-block;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-decoration: none;
  padding: 10px 22px;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: var(--surface-2);
}
.call-step__hint { font-size: 14px; color: var(--ink-soft); }
.call-step__status {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0;
}
.call-step__status--ok { color: #0a7a3a; border-color: #bfe0c9; background: #f0fbf3; }
.call-step__status--warn { color: #a4700a; border-color: #f0dcb0; background: #fff9ee; }
.call-step__status--err { color: #c0392b; border-color: #f0bdb8; background: #fdf2f1; }
.auth-submit { width: 100%; }
.auth-submit--ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); width: 100%; }
.auth-submit--ghost:hover { background: var(--surface-2); }
/* Шаг ввода SMS-кода: равные отступы между полем, «Подтвердить» и «Изменить номер» */
.auth-modal__card form { gap: 16px; }
.auth-code-step { display: flex; flex-direction: column; gap: 16px; }

/* ---- Поиск брони по номеру в панели владельца ---- */
.search-booking-row { display: flex; gap: 10px; align-items: center; max-width: 460px; }
.search-booking-row input {
  flex: 1; padding: 13px 15px; font-size: 16px; border: 1.5px solid var(--line-strong);
  border-radius: 12px; background: var(--surface); color: var(--ink);
}
.search-booking-row input:focus { border-color: var(--accent); outline: none; }
@media (max-width: 520px) { .search-booking-row { flex-direction: column; align-items: stretch; } }

/* --- 404 --- */
.e404 { text-align: center; padding: 60px 16px; }
.e404__code {
  font-size: 120px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--accent);
  opacity: .25;
}
.e404 h1 { margin: 8px 0 12px; font-size: 30px; }
.e404__text { color: var(--muted); max-width: 520px; margin: 0 auto 24px; }
@media (max-width: 560px) { .e404__code { font-size: 84px; } .e404 h1 { font-size: 24px; } }
@media (max-width: 560px) { .search-bar { grid-template-columns: 1fr; grid-template-areas: "in" "out" "guests" "rooms" "price" "btn"; } }

/* ============================================================
   Мобильная оптимизация (финальный блок — перекрывает стили ниже)
   ============================================================ */
@media (max-width: 640px) {
  /* Все поля ввода не меньше 16px, иначе Safari на iPhone сам приближает страницу */
  input, select, textarea,
  .owner-name, .owner-phone, .thread-form input { font-size: 16px; }

  /* Админ-форма в одну колонку, компактная карточка входа */
  .form-body { grid-template-columns: 1fr; }
  .admin-card { padding: 24px 18px; }
  .modal-overlay { padding: 12px; }
  .req-head { flex-wrap: wrap; }

  /* Календарь поиска не вылезает за край экрана */
  .cal-popup { width: min(288px, calc(100vw - 40px)); }

  /* Галерея фото: главное фото во всю ширину, остальные — сеткой 2×N */
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: auto; gap: 8px; }
  .gallery .main { grid-column: 1 / -1; aspect-ratio: 16/10; border-radius: 12px; }
  .gallery img { aspect-ratio: 1/1; border-radius: 12px; }

  /* Лайтбокс: стрелки внизу по центру, не перекрывают фото */
  .lightbox { padding: 20px 14px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .lightbox__img { max-height: 74dvh; }
  .lightbox__btn {
    top: auto; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: none; width: 48px; height: 48px;
  }
  .lightbox__btn--prev { left: calc(14px + env(safe-area-inset-left, 0px)); }
  .lightbox__btn--next { right: calc(14px + env(safe-area-inset-right, 0px)); }
  .lightbox__close { top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); }
  .lightbox__counter { margin-bottom: 0; }

  /* Панель сравнения учитывает нижнюю «полоску» на телефоне */
  .compare-bar { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .compare-bar__head { width: 100%; }

  /* Переключатель комнат не даёт тексту вылезать */
  .seg .seg-btn { font-size: 12.5px; padding: 9px 4px; }

  /* Кнопки выбора в шапке админки не растягиваются на всю ширину */
  .admin-top .btn { width: auto; }
  .req-head .btn { width: auto; }
}


