:root {
  --brand: #3E68A3;
  --brand-dark: #26456F;
  --brand-soft: #E0E9F6;
  --accent: #A1C6EA;
  --accent-dark: #6E9BCB;
  --accent-soft: #EAF2FB;
  --ink: #04080F;
  --muted: #4A5A72;
  --muted-faint: #8B9AB3;
  --paper: #EEF3FB;
  --surface: #FFFFFF;
  --border: #D3E0F2;
  --border-strong: #A1C6EA;
  --danger: #C0392B;
  --danger-soft: #F7E1DE;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(4,8,15,.05), 0 14px 32px -16px rgba(4,8,15,.22);
  --shadow-md: 0 20px 50px -14px rgba(4,8,15,.28);
  --page-max: 1400px;
  --font-mono: ui-monospace, "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3, .font-display { font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 600; letter-spacing: -0.01em; }
.section-title { font-family: 'Unbounded', 'Manrope', sans-serif; }
.price-mono { font-family: var(--font-mono); font-weight: 700; letter-spacing: -0.01em; }

a { color: inherit; }

/* ---------- Full-width page wrapper ---------- */
.page-wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 992px) { .page-wrap { padding: 0 32px; } }
@media (min-width: 1400px) { .page-wrap { padding: 0 40px; } }

/* ---------- Nav ---------- */
.main-nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; padding-top: 8px; padding-bottom: 8px; }
.navbar-brand { font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 700; font-size: 1.2rem; color: var(--brand-dark) !important; display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.navbar-brand img { width: 30px; height: 30px; border-radius: 8px; }

.main-nav-links { display: flex; gap: 4px; flex: 1; min-width: 0; list-style: none; margin: 0; padding: 0; }
.main-nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  color: var(--muted); white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.main-nav-links a:hover { background: var(--brand-soft); color: var(--brand-dark); }

.header-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.city-picker-btn {
  display: flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand-dark);
  border: none; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .84rem;
  cursor: pointer; flex-shrink: 0; white-space: nowrap; transition: background .15s ease;
}
.city-picker-btn:hover { background: var(--border-strong); }
.city-picker-list { max-height: 50vh; overflow-y: auto; }
.city-picker-region { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-faint); padding: 10px 4px 4px; }
.city-picker-item { display: block; padding: 9px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.city-picker-item:hover { background: var(--paper); color: var(--brand); }
.icon-link { font-weight: 600; color: var(--muted); font-size: .88rem; position: relative; white-space: nowrap; }
.icon-link:hover { color: var(--brand-dark); }
.header-actions .nav-link { color: var(--muted) !important; font-weight: 600; font-size: .88rem; }
.header-actions .nav-link:hover { color: var(--brand-dark) !important; }
.badge-count {
  background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700;
  border-radius: 999px; padding: 1px 6px; margin-left: 4px; vertical-align: top;
}
.btn-primary { background: var(--brand); border-color: var(--brand); font-weight: 700; border-radius: 999px; box-shadow: 0 8px 20px -8px rgba(62,104,163,.65); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline-primary { color: var(--ink); border-color: var(--border-strong); font-weight: 700; border-radius: 999px; }
.btn-outline-primary:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.avatar-sm { width: 30px; height: 30px; object-fit: cover; }

/* ---------- Mobile hamburger menu ---------- */
.mobile-menu-toggle {
  display: none; align-items: center; justify-content: center; width: 40px; height: 40px;
  background: var(--brand-soft); border: none; border-radius: 10px; cursor: pointer; color: var(--brand-dark);
  flex-shrink: 0; transition: background .15s ease;
}
.mobile-menu-toggle:hover { background: var(--border-strong); }
.mobile-menu-toggle svg { width: 20px; height: 20px; }
.mobile-menu-toggle .icon-close { display: none; }
.mobile-menu-toggle.open .icon-burger { display: none; }
.mobile-menu-toggle.open .icon-close { display: block; }

.mobile-menu-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(4,8,15,.45); z-index: 1038;
  opacity: 0; transition: opacity .22s ease;
}
.mobile-menu-backdrop.open { display: block; opacity: 1; }

.mobile-menu-panel {
  position: fixed; top: 60px; left: 0; right: 0; z-index: 1039;
  background: var(--surface); padding: 18px 16px 26px;
  max-height: calc(100vh - 60px); overflow-y: auto;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 28px 56px -20px rgba(4,8,15,.4);
  transform: translateY(-10px); opacity: 0; pointer-events: none;
  transition: transform .22s cubic-bezier(.2,.8,.3,1), opacity .18s ease;
}
.mobile-menu-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }

.mobile-menu-user { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--paper); border-radius: 16px; }
.mobile-menu-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex-shrink: 0;
  font-family: 'Unbounded', sans-serif;
}
.mobile-menu-user > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mobile-menu-username { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu-user-sub { font-size: .78rem; color: var(--muted); }

.mobile-menu-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.mobile-menu-nav a { padding: 13px 14px; border-radius: 12px; font-weight: 600; font-size: .95rem; color: var(--ink); transition: background .12s ease; }
.mobile-menu-nav a:active, .mobile-menu-nav a:hover { background: var(--paper); }
.mobile-menu-divider { height: 1px; background: var(--border); margin: 6px 0 14px; }
.mobile-menu-actions { display: flex; flex-direction: column; gap: 2px; }
.mobile-menu-actions a {
  padding: 13px 14px; border-radius: 12px; font-weight: 600; font-size: .95rem; color: var(--ink);
  display: flex; align-items: center; gap: 10px; transition: background .12s ease;
}
.mobile-menu-actions a:active, .mobile-menu-actions a:hover { background: var(--paper); }
.mobile-menu-actions a svg, .mobile-menu-actions a i { width: 18px; flex-shrink: 0; color: var(--muted-faint); font-size: 1.05rem; }
.mobile-menu-actions .btn { margin-top: 8px; justify-content: center; color: #fff !important; }
.mobile-menu-actions .btn i { color: #fff; }
.mobile-menu-actions .mobile-menu-logout { color: var(--danger); }
.mobile-menu-actions .mobile-menu-logout i { color: var(--danger); }

@media (max-width: 1100px) {
  .main-nav-links, .header-actions { display: none; }
  .mobile-menu-toggle { display: flex; }
}

/* ---------- Hero (full width) ---------- */
.hero {
  background: var(--ink);
  color: #EAF2FF;
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(224,233,246,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224,233,246,.06) 1px, transparent 1px);
  background-size: 34px 34px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(150deg, #0F2A52 0%, #0A1830 55%, #060D1C 100%);
  opacity: .96;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(ellipse 700px 480px at 88% 5%, rgba(161,198,234,.32), transparent 60%),
                     radial-gradient(ellipse 800px 560px at 6% 105%, rgba(62,104,163,.55), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; padding: 64px 0 120px; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
  padding: 6px 16px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
  font-family: var(--font-mono);
}
.hero h1 { font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 600; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.14; margin: 18px 0 12px; max-width: 760px; }
.hero p.lead { font-size: 1.1rem; opacity: .82; max-width: 560px; }

.hero-stats { display: flex; gap: 34px; margin-top: 30px; flex-wrap: wrap; }
.hero-stat-num { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: #fff; }
.hero-stat-lbl { font-size: .74rem; color: rgba(255,255,255,.55); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

.hero-search {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin-top: -68px;
  position: relative;
  z-index: 3;
}

/* ---------- Category tiles ---------- */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
}
.category-pill {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px 18px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .92rem;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  height: 100%; position: relative; overflow: hidden;
}
.category-pill::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 14px 14px; opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.category-pill:hover {
  transform: translateY(-4px); box-shadow: 0 18px 34px rgba(10,24,48,.28); color: #fff;
  background: linear-gradient(150deg, #12305C 0%, #0A1830 100%);
}
.category-pill:hover::after { opacity: 1; }
.category-pill:hover .icon-badge { background: rgba(255,255,255,.16); }
.category-pill:hover .icon-badge i { color: var(--accent); }
.category-pill .icon-badge {
  width: 48px; height: 48px; border-radius: 13px;
  background: linear-gradient(150deg, var(--brand-soft) 0%, #DCE8FF 100%);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .2s ease; position: relative; z-index: 1;
}
.category-pill .icon-badge i { font-size: 1.3rem; color: var(--brand); transition: color .2s ease; }
.category-pill span:not(.icon-badge) { position: relative; z-index: 1; }

.quick-action {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 18px; text-decoration: none; color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease; height: 100%;
}
.quick-action:hover {
  transform: translateY(-4px); box-shadow: 0 18px 34px rgba(10,24,48,.28); color: #fff;
  background: linear-gradient(150deg, #12305C 0%, #0A1830 100%);
}
.quick-action:hover .icon-badge { background: rgba(255,255,255,.16); }
.quick-action:hover .icon-badge i { color: #FFB020; }
.quick-action .icon-badge {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(150deg, var(--brand-soft) 0%, #DCE8FF 100%);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .2s ease;
}
.quick-action .icon-badge i { font-size: 1.3rem; color: var(--brand); transition: color .2s ease; }

/* ---------- Section headers ---------- */
.section-eyebrow { color: var(--brand); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; font-size: .76rem; }
.section-title { font-weight: 700; margin: 4px 0 6px; font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
.section-sub { color: var(--muted); }

/* ---------- Listing cards ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.cards-grid .grid-item { min-width: 0; }
.cards-grid .grid-empty { grid-column: 1 / -1; }

.cards-grid.view-list { grid-template-columns: 1fr; gap: 14px; }
.cards-grid.view-list .card { flex-direction: row; }
.cards-grid.view-list .card .card-link { flex-direction: row; }
.cards-grid.view-list .card .card-media { width: 240px; height: 168px; flex-shrink: 0; }
.cards-grid.view-list .card .card-body { flex: 1; justify-content: center; }

.view-toggle { display: inline-flex; background: var(--brand-soft); border-radius: 10px; padding: 3px; gap: 2px; flex-shrink: 0; }
.view-toggle button { width: 34px; height: 30px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 7px; color: var(--muted); cursor: pointer; transition: background .15s ease, color .15s ease; }
.view-toggle button.active { background: var(--surface); color: var(--brand-dark); box-shadow: 0 1px 3px rgba(4,8,15,.15); }
.view-toggle button:hover { color: var(--brand-dark); }

/* ---- Real listing card (home, catalog, dashboard) ---- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  position: relative; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
  height: 100%; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; height: 100%; }
.card-highlighted { border-color: var(--accent-dark); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-sm); }

.card-media { position: relative; aspect-ratio: 4/3; height: auto; background: var(--brand-soft); overflow: hidden; flex-shrink: 0; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.06); }
.card-media-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.8rem; }

.badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.badges .badge {
  font-family: var(--font-mono); font-size: .68rem; font-weight: 700; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase; color: #fff;
}
.badge-sale { background: var(--brand); }
.badge-rent { background: var(--accent-dark); }
.badge-promo {
  display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: .68rem; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent-dark); color: #fff;
}

.card-fav {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none; display: flex; align-items: center; justify-content: center;
  color: var(--muted-faint); cursor: pointer; box-shadow: 0 4px 10px rgba(4,8,15,.15); transition: color .15s ease, transform .12s ease;
}
.card-fav:hover { transform: scale(1.08); }
.card-fav.text-danger { color: var(--danger); }

.card-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-price { font-size: 1.05rem; color: var(--ink); }
.card-price small { font-size: .72rem; color: var(--muted-faint); font-weight: 500; margin-left: 3px; }
.card-title { font-size: .95rem; font-weight: 700; color: var(--ink); margin: 2px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-loc { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-loc i { flex-shrink: 0; color: var(--muted-faint); }
.card-specs { display: flex; gap: 12px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 9px; margin-top: 8px; }

/* ---- Compact "preview" card used only in listing form live preview ---- */
.listing-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  height: 100%; display: flex; flex-direction: column;
}
.listing-card .img-wrap { position: relative; aspect-ratio: 4/3; background: var(--brand-soft); overflow: hidden; }
.listing-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.listing-card .no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.listing-card .price-tag {
  position: absolute; bottom: -1px; left: 14px;
  background: linear-gradient(135deg, #16233C 0%, #060D1C 100%); color: #fff; font-weight: 700; font-size: 1rem;
  font-family: var(--font-mono);
  padding: 8px 16px 8px 14px; border-radius: 10px 10px 0 0;
  display: flex; align-items: center; gap: 6px; max-width: calc(100% - 28px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.listing-card .body { padding: 22px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.listing-card .title { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.02rem; line-height: 1.35; }
.listing-card .meta { color: var(--muted); font-size: .86rem; display: flex; align-items: center; gap: 6px; }

/* ---------- Tariffs ---------- */
.tariff-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); padding: 30px 26px; height: 100%; }
.tariff-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-md); position: relative; }
.tariff-price { font-size: 2.1rem; font-weight: 700; font-family: var(--font-mono); }

/* ---------- Forms ---------- */
.section-nav {
  display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  position: sticky; top: 76px; z-index: 5; background: var(--paper); padding-top: 6px;
  -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
}
.section-nav-pill {
  flex-shrink: 0; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .86rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  scroll-snap-align: start;
}
.section-nav-pill:hover { color: var(--brand-dark); border-color: var(--brand); }
.section-nav-pill.active {
  color: #fff; border-color: transparent; background: var(--ink);
}
.section-nav-pill .step-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(4,8,15,.08); font-size: .72rem; font-weight: 800; margin-right: 2px;
}
.section-nav-pill.active .step-dot { background: rgba(255,255,255,.22); }

.room-row { background: var(--paper); border-radius: 10px; padding: 8px; }
.room-price-card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; height: 100%; position: relative; overflow: hidden; }
.room-price-card-img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }

/* ---- Хлебные крошки ---- */
.breadcrumb-trail a { text-decoration: none; }
.breadcrumb-trail a:hover { color: var(--brand); }

/* ---- Галерея объявления ---- */
.gallery-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery-main { position: relative; aspect-ratio: 16/10; background: var(--brand-soft); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--muted-faint); }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--ink); box-shadow: var(--shadow-sm); cursor: pointer; transition: background .15s ease;
}
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: 14px; }
.gallery-nav.next { right: 14px; }
.gallery-counter {
  position: absolute; bottom: 12px; right: 14px; background: rgba(4,8,15,.65); color: #fff;
  font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; font-family: var(--font-mono);
}
.gallery-badge { position: absolute; top: 14px; left: 14px; }
.gallery-fav { top: 14px; right: 14px; width: 40px; height: 40px; }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery-thumb {
  flex-shrink: 0; width: 74px; height: 58px; border-radius: 8px; overflow: hidden; border: 2px solid transparent;
  padding: 0; cursor: pointer; background: none; opacity: .65; transition: opacity .15s ease, border-color .15s ease;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active, .gallery-thumb:hover { opacity: 1; border-color: var(--brand); }

/* ---- Сетка характеристик ---- */
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.spec-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.spec-row:nth-last-child(-n+2) { border-bottom: none; }
.spec-label { color: var(--muted); }
.spec-value { font-weight: 700; text-align: right; }
@media (max-width: 576px) {
  .spec-grid { grid-template-columns: 1fr; }
  .spec-row:nth-last-child(-n+2) { border-bottom: 1px dashed var(--border); }
  .spec-row:last-child { border-bottom: none; }
  .gallery-thumb { width: 62px; height: 48px; }
}
.form-shell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.form-section { padding: 26px 28px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: none; }
.form-section-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.02rem; margin-bottom: 18px; }
.form-section-title .num { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 800; flex-shrink: 0; }
.field-label-sm { font-size: .76rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.free-post-banner {
  display: flex; align-items: center; gap: 12px; background: var(--brand-soft); color: var(--brand-dark);
  border-radius: var(--radius-sm); padding: 14px 18px; font-weight: 600; margin-bottom: 22px;
}
.free-post-banner.warn { background: var(--accent-soft); color: var(--brand-dark); border: 1px solid var(--border-strong); }

.form-control, .form-select {
  border-radius: 10px; padding: 11px 14px; border: 1.5px solid var(--border); background: var(--paper);
}
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .18rem rgba(62,104,163,.16); background: var(--surface); }
.form-label { font-weight: 700; font-size: .87rem; margin-bottom: 6px; color: var(--ink); }

/* ---- Icon-toggle radio groups (deal type / category) ---- */
.icon-toggle { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.icon-toggle.two { grid-template-columns: repeat(2, 1fr); max-width: 420px; }
.icon-toggle.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 560px) { .icon-toggle.five { grid-template-columns: repeat(2, 1fr); } }
.icon-toggle label { margin: 0; }
.icon-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.icon-toggle span {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 14px;
  border: 1.5px solid var(--border); cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); text-align: center;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .1s ease;
}
.icon-toggle span i { font-size: 1.3rem; }
.icon-toggle input:checked + span {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 8px 20px -10px rgba(62,104,163,.6);
}
.icon-toggle span:hover { border-color: var(--brand); transform: translateY(-1px); }

/* ---- Photo dropzone ---- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 34px 20px; text-align: center;
  cursor: pointer; position: relative; background: var(--paper); transition: border-color .15s ease, background .15s ease;
}
.dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone-hint { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: .92rem; pointer-events: none; }
.dropzone-hint i { font-size: 1.9rem; color: var(--brand); margin-bottom: 2px; }
.dropzone-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.dropzone-preview img { width: 84px; height: 68px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }

/* ---------- Live preview (listing form) ---------- */
.preview-card { position: sticky; top: 96px; }
.preview-card .listing-card { box-shadow: var(--shadow-sm); }
.preview-empty { color: var(--muted); text-align: center; padding: 40px 20px; }

/* ---------- Map ---------- */
#map, #search-map, #location-picker { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }
/* Служебная декоративная иконка Leaflet в подписи атрибуции (не имеет отношения
   к какой-либо стране) — скрываем, оставляя только текстовую атрибуцию. */
.leaflet-attribution-flag { display: none !important; }
#map { height: 380px; }
#location-picker { height: 300px; }
.map-shell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.map-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; align-items: center; }

/* ---- Round gradient markers ---- */
.round-pin-wrap { background: transparent; border: none; }
.round-pin {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; border: 3px solid #fff; border-radius: 999px;
  box-shadow: 0 8px 20px -6px rgba(4,8,15,.5);
  transform: translate(-50%, -50%); cursor: pointer;
  transition: transform .12s ease;
}
.round-pin.single { width: 36px; height: 36px; font-size: 16px; }
.round-pin-price {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; white-space: nowrap;
  padding: 8px 14px;
}
.round-pin.rent { background: linear-gradient(135deg, var(--accent-dark) 0%, var(--brand) 100%); }
.round-pin-wrap .is-hovered, .round-pin-wrap:hover .round-pin { transform: translate(-50%, -50%) scale(1.12); z-index: 1000; }

/* ---- Popup: horizontal floating card ---- */
.leaflet-popup-content-wrapper { padding: 0; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.leaflet-popup-content { margin: 0 !important; width: 260px !important; }
.leaflet-popup-tip { box-shadow: none; }
.map-popup { display: flex; }
.map-popup-media { width: 92px; min-width: 92px; height: 92px; background: var(--brand-soft); }
.map-popup-media img { width: 100%; height: 100%; object-fit: cover; }
.map-popup-body { padding: 10px 12px; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.map-popup-price { font-size: 14px; }
.map-popup-title { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.map-popup-loc { font-size: 11px; color: var(--muted-faint); }
.map-popup-btn { display: inline-block; background: var(--brand); color: #fff !important; font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; text-decoration: none; margin-top: 4px; align-self: flex-start; }
.map-popup-btn:hover { background: var(--brand-dark); }

.split-map-view #search-map { height: 78vh; position: sticky; top: 88px; }
.map-cards-list {
  height: 78vh; overflow-y: auto; padding-right: 4px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-content: start;
}
.map-cards-list.view-list { display: flex; flex-direction: column; }
.map-cards-list .map-cards-empty { grid-column: 1 / -1; }

.map-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; text-decoration: none; color: var(--ink); transition: box-shadow .15s ease, border-color .15s ease, transform .12s ease;
}
.map-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); color: var(--ink); transform: translateY(-2px); }
.map-card-img { position: relative; aspect-ratio: 4/3; background: var(--brand-soft); }
.map-card-img img { width: 100%; height: 100%; object-fit: cover; }
.map-card-img .no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.map-card-badge {
  position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; background: var(--brand); color: #fff;
}
.map-card-badge.rent { background: var(--accent-dark); }
.map-card-body { padding: 10px 12px 12px; min-width: 0; }
.map-card-price { font-weight: 700; font-size: .95rem; }
.map-card-title { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0; }
.map-card-meta { color: var(--muted); font-size: .78rem; }

/* Список: горизонтальные строки вместо плиток 2-в-ряд */
.map-cards-list.view-list .map-card { flex-direction: row; }
.map-cards-list.view-list .map-card-img { width: 110px; min-width: 110px; aspect-ratio: auto; }
.map-cards-list.view-list .map-card-body { padding: 10px 14px; align-self: center; }

@media (max-width: 991px) {
  .split-map-view #search-map { height: 46vh; position: static; margin-top: 12px; }
  .map-cards-list { height: auto; max-height: 46vh; }
}
@media (max-width: 480px) {
  .map-cards-list { grid-template-columns: 1fr; }
}

/* ---------- Chat ---------- */
.chat-bubble { max-width: 75%; padding: 12px 16px; border-radius: 16px; margin-bottom: 10px; }
.chat-bubble.mine { background: var(--brand); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { background: var(--paper); border: 1px solid var(--border); border-bottom-left-radius: 4px; }

/* ---------- Footer ---------- */
.footer { background: linear-gradient(180deg, #16233C 0%, #060D1C 100%); color: #C6D0E0; }
.footer h5, .footer h6 { color: #fff; }
.footer-link { color: #9FADC4; text-decoration: none; }
.footer-link:hover { color: #fff; }

/* ---------- Misc ---------- */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 22px; text-align: center; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; font-family: var(--font-mono); }

@media (max-width: 576px) {
  .section-nav { top: 66px; }
  .section-nav-pill { padding: 7px 13px; font-size: .8rem; }
  .cards-grid.view-list .listing-card { flex-direction: column; }
  .cards-grid.view-list .listing-card .img-wrap { width: 100%; aspect-ratio: 4/3; }
  .cards-grid.view-list .listing-card .price-tag { position: absolute; bottom: -1px; left: 14px; border-radius: 10px 10px 0 0; }
  .hero-inner { padding: 44px 0 90px; }
  .hero-search { margin-top: -54px; padding: 16px; }
  .navbar-brand span, .navbar-brand { font-size: 1rem; }
  .city-picker-btn { padding: 6px 10px; font-size: 0; gap: 0; }
  .city-picker-btn i { font-size: 1rem; }
  .listing-card .price-tag { font-size: .86rem; padding: 6px 12px 6px 10px; }
  .preview-card { position: static; margin-top: 24px; }
  .form-section { padding: 18px 16px; }
  .form-section-title { font-size: .95rem; }
  .tariff-card { padding: 22px 18px; }
}
