/* Публічний сайт агентства (apps.site). Bootstrap 5.3 + свої токени; світла тема за замовчуванням, темна — data-bs-theme="dark". */
:root, [data-bs-theme="light"] {
  --ms-primary: #0f766e;
  --ms-primary-rgb: 15, 118, 110;
  --ms-primary-hover: #0b5d57;
  --ms-accent: #f59e0b;
  --ms-bg: #f6f7f9;
  --ms-surface: #ffffff;
  --ms-surface-2: #f1f4f6;
  --ms-text: #17212b;
  --ms-muted: #64707d;
  --ms-border: #e3e7ec;
  --ms-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --ms-shadow-hover: 0 4px 10px rgba(16, 24, 40, .08), 0 16px 36px rgba(16, 24, 40, .10);
  --ms-hero-1: #0f766e;
  --ms-hero-2: #134e4a;
  --ms-footer: #0f1c24;
  --ms-radius: 16px;
  --bs-body-font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-bg: var(--ms-bg);
  --bs-body-color: var(--ms-text);
  --bs-link-color: var(--ms-primary);
  --bs-link-color-rgb: var(--ms-primary-rgb);
  --bs-link-hover-color: var(--ms-primary-hover);
  --bs-border-color: var(--ms-border);
  --bs-primary: var(--ms-primary);
  --bs-primary-rgb: var(--ms-primary-rgb);
}
[data-bs-theme="dark"] {
  --ms-primary: #2dd4bf;
  --ms-primary-rgb: 45, 212, 191;
  --ms-primary-hover: #5eead4;
  --ms-bg: #0e1418;
  --ms-surface: #151d23;
  --ms-surface-2: #1b252c;
  --ms-text: #e6edf2;
  --ms-muted: #94a3af;
  --ms-border: #26323b;
  --ms-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --ms-shadow-hover: 0 8px 28px rgba(0, 0, 0, .45);
  --ms-hero-1: #0d4f4a;
  --ms-hero-2: #0a2a2e;
  --ms-footer: #0a0f12;
  --bs-body-bg: var(--ms-bg);
  --bs-body-color: var(--ms-text);
  --bs-link-color: var(--ms-primary);
  --bs-link-color-rgb: var(--ms-primary-rgb);
  --bs-link-hover-color: var(--ms-primary-hover);
  --bs-border-color: var(--ms-border);
  --bs-primary: var(--ms-primary);
  --bs-primary-rgb: var(--ms-primary-rgb);
}

html, body { overflow-x: hidden; }
body.ms { background: var(--ms-bg); color: var(--ms-text); font-family: var(--bs-body-font-family); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.min-w-0 { min-width: 0; }
.ms-muted { color: var(--ms-muted) !important; }
.ms-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
img { max-width: 100%; }

/* кнопки */
.btn-ms { --bs-btn-color: #fff; --bs-btn-bg: var(--ms-primary); --bs-btn-border-color: var(--ms-primary);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ms-primary-hover); --bs-btn-hover-border-color: var(--ms-primary-hover);
  --bs-btn-active-bg: var(--ms-primary-hover); --bs-btn-active-border-color: var(--ms-primary-hover); --bs-btn-active-color: #fff;
  font-weight: 700; border-radius: 12px; padding: .6rem 1.1rem; }
[data-bs-theme="dark"] .btn-ms { --bs-btn-color: #04211e; --bs-btn-hover-color: #04211e; --bs-btn-active-color: #04211e; }
.btn { border-radius: 12px; }
.form-control, .form-select { border-radius: 12px; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--ms-primary); box-shadow: 0 0 0 .2rem rgba(var(--ms-primary-rgb), .18); }
.form-check-input:checked { background-color: var(--ms-primary); border-color: var(--ms-primary); }
.page-link { color: var(--ms-primary); }
.active > .page-link, .page-link.active { background: var(--ms-primary); border-color: var(--ms-primary); color: #fff; }
.pagination { gap: 4px; }
.pagination .page-link { border-radius: 10px !important; min-width: 40px; text-align: center; }

/* верхня смуга і шапка */
.ms-topbar { background: var(--ms-footer); color: #cbd5dc; font-size: .85rem; padding: .4rem 0; }
.ms-topbar a, .ms-topbar span { color: #cbd5dc; white-space: nowrap; }
.ms-topbar a:hover { color: #fff; }
.ms-topbar i { margin-right: .35rem; opacity: .8; }
.ms-header { background: color-mix(in srgb, var(--ms-surface) 92%, transparent); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--ms-border); }
.ms-header .navbar { padding: .6rem 0; }
.ms-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; color: var(--ms-text) !important;
  letter-spacing: .02em; text-decoration: none !important; min-width: 0; }
.ms-brand > span:last-child:not(.ms-logo-pic) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* логотип агентства: висота з налаштувань (--logo-h), на телефоні — 70%; варіант для темного тла / світла підкладка */
.ms-brand { --logo-h: 40px; }
.ms-logo-pic { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.ms-logo-pic img { display: block; height: var(--logo-h); width: auto; max-width: min(280px, 50vw); object-fit: contain; }
.ms-logo-pic .ms-logo-d { display: none; }
.ms-brand-name { min-width: 0; }
@media (max-width: 575.98px) {
  .ms-logo-pic img { height: calc(var(--logo-h) * .7); max-width: 42vw; }
  .ms-header .ms-brand-name { font-size: 1rem; max-width: 34vw; }
}
:is([data-bs-theme="dark"] .ms-header, [data-bs-theme="dark"] .ms-footer, .ms-head-dark, .ms-foot-dark) .ms-logo-pic.has-dark .ms-logo-l { display: none; }
:is([data-bs-theme="dark"] .ms-header, [data-bs-theme="dark"] .ms-footer, .ms-head-dark, .ms-foot-dark) .ms-logo-pic.has-dark .ms-logo-d { display: block; }
:is([data-bs-theme="dark"] .ms-header, [data-bs-theme="dark"] .ms-footer, .ms-head-dark, .ms-foot-dark) .ms-logo-pic.is-plate {
  background: #fff; border-radius: 10px; padding: 5px 7px; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 14px rgba(0, 0, 0, .18); }
.ms-logo { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--ms-primary), var(--ms-hero-2)); color: #fff; font-size: 1.05rem; }
.ms-header .nav-link { font-weight: 600; color: var(--ms-text); padding: .5rem .8rem !important; border-radius: 10px; }
.ms-header .nav-link:hover, .ms-header .nav-link.show { color: var(--ms-primary); background: var(--ms-surface-2); text-decoration: none; }
.ms-header .dropdown-menu { border: 1px solid var(--ms-border); border-radius: 14px; box-shadow: var(--ms-shadow-hover); padding: .4rem;
  background: var(--ms-surface); min-width: 16rem; }
.ms-header .dropdown-item { border-radius: 9px; padding: .45rem .7rem; }
.ms-header .dropdown-item:hover { background: var(--ms-surface-2); text-decoration: none; }
.ms-icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--ms-border); background: var(--ms-surface);
  color: var(--ms-text); display: inline-grid; place-items: center; padding: 0; }
.ms-icon-btn:hover { background: var(--ms-surface-2); }
.navbar-toggler:focus { box-shadow: none; }
.ms-lang-btn { display: inline-flex; align-items: center; gap: .4rem; height: 40px; padding: 0 .65rem; border-radius: 11px;
  border: 1px solid var(--ms-border); background: var(--ms-surface); color: var(--ms-text); font-weight: 700; font-size: .85rem; }
.ms-lang-menu .dropdown-item { display: flex; align-items: center; gap: .5rem; }
.ms-lang-menu .dropdown-item span { color: var(--ms-muted); font-size: .85rem; }
.ms-lang-menu .dropdown-item.active span { color: inherit; }
.crm-flag { display: inline-block; width: 20px; height: 14px; border-radius: 3px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.crm-flag svg { width: 100%; height: 100%; display: block; }
@media (max-width: 991.98px) {
  .ms-header .offcanvas-lg { background: var(--ms-surface); }
  .ms-header .navbar-nav .dropdown-menu { box-shadow: none; border: 0; padding-left: .6rem; background: transparent; }
}

/* hero */
.ms-hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(245, 158, 11, .25), transparent 60%),
  linear-gradient(135deg, var(--ms-hero-1), var(--ms-hero-2)); color: #fff; padding: 3.5rem 0 2.5rem; }
.ms-hero-text { max-width: 760px; }
.ms-hero h1 { font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1.15; letter-spacing: -.01em; }
.ms-hero p { font-size: 1.08rem; opacity: .9; margin: .8rem 0 1.6rem; }
.ms-search { background: var(--ms-surface); color: var(--ms-text); border-radius: 20px; padding: 1rem 1rem 1.1rem; box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.ms-search .form-label { font-weight: 600; color: var(--ms-muted); margin-bottom: .25rem; }
.ms-search-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--ms-surface-2); border-radius: 12px; margin-bottom: .8rem; }
.ms-search-tab { padding: .4rem 1rem; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--ms-muted); margin: 0; }
.btn-check:checked + .ms-search-tab { background: var(--ms-surface); color: var(--ms-primary); box-shadow: var(--ms-shadow); }
.ms-cur { max-width: 4.6rem; flex: 0 0 4.6rem !important; padding-right: 1.6rem; }
.ms-stats { display: flex; flex-wrap: wrap; gap: 1.2rem 2.5rem; margin-top: 1.8rem; }
.ms-stats div { display: flex; flex-direction: column; }
.ms-stats b { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.ms-stats span { opacity: .85; font-size: .9rem; }

/* секції */
.ms-section { padding-top: 2.2rem; } /* лише зверху — бічні відступи .container зберігаються на телефоні */
.ms-section:last-child { padding-bottom: 2.5rem; }
.ms-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.ms-section-head h2 { font-weight: 800; font-size: clamp(1.25rem, 2.5vw, 1.6rem); margin: 0; }
.ms-page { padding-top: 1.2rem; padding-bottom: 3rem; }
.ms-h1 { font-weight: 800; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; margin-bottom: .35rem; overflow-wrap: anywhere; }
.ms-breadcrumb { font-size: .85rem; margin-bottom: .8rem; flex-wrap: nowrap; overflow: hidden; }
.ms-breadcrumb .breadcrumb-item { white-space: nowrap; }
.ms-breadcrumb .breadcrumb-item.active { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* плитки рубрик */
.ms-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.ms-tile { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; background: var(--ms-surface); border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius); color: var(--ms-text); transition: box-shadow .15s, transform .15s; min-width: 0; }
.ms-tile:hover { box-shadow: var(--ms-shadow-hover); transform: translateY(-1px); text-decoration: none; color: var(--ms-text); }
.ms-tile.is-empty { opacity: .6; }
.ms-tile-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 1.1rem; }
.ms-tile-icon.ms-sale { background: rgba(var(--ms-primary-rgb), .12); color: var(--ms-primary); }
.ms-tile-icon.ms-rent { background: rgba(245, 158, 11, .15); color: #b45309; }
[data-bs-theme="dark"] .ms-tile-icon.ms-rent { color: #fbbf24; }
.ms-tile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ms-tile-text small { color: var(--ms-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.ms-tile-text b { font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.ms-tile-count { font-weight: 800; color: var(--ms-muted); }

/* картки об'єктів */
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.ms-grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ms-card { background: var(--ms-surface); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s; min-width: 0; }
.ms-card:hover { box-shadow: var(--ms-shadow-hover); transform: translateY(-2px); }
.ms-card-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--ms-surface-2); overflow: hidden; }
.ms-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.ms-card:hover .ms-card-img img { transform: scale(1.04); }
.ms-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ms-muted); font-size: 2.2rem; opacity: .5; }
/* ЖК без фото: згенерована обкладинка з назвою (кольори теми сайту) */
.ms-zhk-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  padding: 1rem; text-align: center; color: #fff; background: linear-gradient(135deg, var(--ms-hero-1), var(--ms-hero-2)); overflow: hidden; }
.ms-zhk-ph::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: 0; height: 46%; opacity: .14;
  background: repeating-linear-gradient(90deg, #fff 0 18%, transparent 18% 22%), repeating-linear-gradient(0deg, transparent 0 9px, rgba(0, 0, 0, .55) 9px 14px);
  clip-path: polygon(0 30%, 22% 30%, 22% 0, 48% 0, 48% 18%, 74% 18%, 74% 42%, 100% 42%, 100% 100%, 0 100%); }
.ms-zhk-ph i { position: relative; font-size: 1.9rem; opacity: .85; }
.ms-zhk-ph b { position: relative; font-weight: 800; font-size: 1.1rem; line-height: 1.2; max-width: 92%; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ms-zhk-ph-cover { position: relative; aspect-ratio: 16 / 9; border-radius: var(--ms-radius); overflow: hidden; }
.ms-zhk-ph-cover .ms-zhk-ph i { font-size: 2.6rem; }
.ms-zhk-ph-cover .ms-zhk-ph b { font-size: clamp(1.3rem, 3vw, 2rem); }
.ms-card-badges { position: absolute; left: .6rem; top: .6rem; right: .6rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.ms-badge { background: rgba(15, 23, 30, .72); color: #fff; font-size: .75rem; font-weight: 700; padding: .2rem .5rem; border-radius: 8px; }
.ms-badge-accent { background: var(--ms-accent); color: #3b2300; }
.ms-card-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.ms-card-price { font-weight: 800; font-size: 1.2rem; color: var(--ms-text); }
.ms-card-price small { font-weight: 600; font-size: .78rem; color: var(--ms-muted); margin-left: .2rem; }
.ms-card-title { font-size: .98rem; font-weight: 600; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ms-card-title a { color: var(--ms-text); }
.ms-card-title a::after { content: ""; position: absolute; inset: 0; }
.ms-card { position: relative; }
.ms-card-loc { color: var(--ms-muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-card-facts { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .85rem; color: var(--ms-muted); margin-top: auto; padding-top: .45rem;
  border-top: 1px dashed var(--ms-border); }
.ms-card-facts i { opacity: .7; margin-right: .15rem; }
.ms-card-code { margin-left: auto; font-size: .78rem; }

/* CTA */
.ms-cta { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; padding: 1.6rem 1.8rem;
  border-radius: 20px; color: #fff; background: linear-gradient(120deg, var(--ms-hero-2), var(--ms-hero-1)); }
.ms-cta h2 { font-weight: 800; font-size: 1.35rem; }
.ms-cta p { opacity: .9; max-width: 640px; }

/* каталог */
.ms-list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ms-list-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.ms-sortbar { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-bottom: .8rem; }
.ms-sortbar select { width: auto; max-width: 100%; }
.ms-filter { background: var(--ms-surface); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); padding: 1rem; }
.ms-filter .form-label { font-weight: 700; font-size: .85rem; margin-bottom: .35rem; }
.ms-range { display: flex; gap: .4rem; }
.ms-range .form-control { min-width: 0; }
.ms-checklist { max-height: 210px; overflow-y: auto; padding: .35rem .5rem; border: 1px solid var(--ms-border); border-radius: 12px; background: var(--ms-surface); }
.ms-checklist .form-check { margin: 0; padding: .15rem 0 .15rem 1.6rem; display: block; font-size: .92rem; }
.ms-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.ms-chips .btn { min-width: 42px; border-radius: 10px; }
.ms-chips .btn-check:checked + .btn { background: var(--ms-primary); border-color: var(--ms-primary); color: #fff; }
@media (max-width: 991.98px) {
  .ms-filter-col { margin-top: 0 !important; }
  #ms-filter .ms-filter { border: 0; padding: 0; }
  #ms-filter.offcanvas-lg { background: var(--ms-surface); }
}
.ms-empty { text-align: center; padding: 3rem 1rem; }
.ms-empty > i { font-size: 2.6rem; color: var(--ms-muted); opacity: .6; margin-bottom: .8rem; display: block; }

/* карти */
.ms-map { height: 360px; border-radius: var(--ms-radius); overflow: hidden; border: 1px solid var(--ms-border); background: var(--ms-surface-2); z-index: 0; }
.ms-map-lg { height: min(70vh, 640px); }
.ms-map-popup { width: 200px; }
.ms-map-popup img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; margin-bottom: .35rem; }
.ms-map-popup b { display: block; }
.leaflet-popup-content { margin: 10px 12px; }
/* панель фільтра карти (поверх карти; на телефоні — на всю карту) */
.ms-mapbox { position: relative; }
.ms-map.is-loading { opacity: .75; transition: opacity .2s; }
.ms-mapf { position: absolute; z-index: 1000; top: 12px; left: 12px; width: 300px; max-height: calc(100% - 24px); overflow-y: auto;
  background: var(--ms-surface); color: var(--ms-text); border: 1px solid var(--ms-border); border-radius: 14px; box-shadow: var(--ms-shadow-hover);
  padding: .75rem .85rem; font-size: .9rem; }
.ms-mapf[hidden] { display: none; }
.ms-mapf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.ms-mapf-row { margin-bottom: .6rem; }
.ms-mapf-row .form-label { font-weight: 700; font-size: .8rem; margin-bottom: .25rem; }
.ms-mapf-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ms-mapf .ms-chips .btn { min-width: 38px; }
.ms-mapf .ms-cur { flex: 0 0 64px; }
.ms-mapf-checks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.ms-mapf-checks .form-check { margin: 0; }
.ms-mapf-foot { display: flex; gap: .5rem; position: sticky; bottom: -.75rem; background: var(--ms-surface); padding: .5rem 0 .1rem; }
.ms-mapf-show { display: none; }
.ms-mapf-toggle.active { background: var(--ms-primary); border-color: var(--ms-primary); color: #fff; }
[data-bs-theme="dark"] .ms-mapf-toggle.active { color: #04211e; }
.ms-mapf-badge { background: var(--ms-accent); color: #1f2328; font-size: .7rem; }
[data-bs-theme="dark"] .ms-mapf .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
@media (max-width: 767.98px) {
  .ms-mapf { inset: 0; width: auto; max-height: none; border-radius: var(--ms-radius); }
  .ms-mapf-show { display: inline-block; flex: 1; }
}
[data-bs-theme="dark"] .ms-map .leaflet-control-attribution { background: rgba(21, 29, 35, .8); color: var(--ms-muted); }
[data-bs-theme="dark"] .ms-map .leaflet-control-attribution a { color: var(--ms-primary); }
[data-bs-theme="dark"] .ms-map .leaflet-bar a { background: var(--ms-surface); color: var(--ms-text); border-color: var(--ms-border); }
/* картка об'єкта на карті (наведення / тап) */
.ms-mc-pop .leaflet-popup-content-wrapper { padding: 0; border-radius: 14px; overflow: hidden; background: var(--ms-surface); color: var(--ms-text);
  box-shadow: var(--ms-shadow-hover); border: 1px solid var(--ms-border); }
.ms-mc-pop .leaflet-popup-content { margin: 0; width: auto !important; }
.ms-mc-pop .leaflet-popup-tip { background: var(--ms-surface); }
.leaflet-container .ms-mc-pop a.leaflet-popup-close-button { z-index: 4; top: 6px; right: 6px; width: 26px; height: 26px; font: 18px/26px sans-serif;
  border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; }
.leaflet-container .ms-mc-pop a.leaflet-popup-close-button:hover { background: rgba(0, 0, 0, .65); color: #fff; }
.ms-mc { width: 264px; max-width: calc(100vw - 72px); font-size: .85rem; line-height: 1.35; }
.ms-mc-photo { position: relative; height: 150px; background: var(--ms-surface-2); }
.ms-mc-photo img { width: 100%; height: 150px; object-fit: cover; display: block; }
.ms-mc-nophoto { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--ms-muted); font-size: 2rem; opacity: .6; }
.ms-mc-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .88); color: #1f2328;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25); font-size: .75rem; cursor: pointer; padding: 0; }
.ms-mc-nav:hover { background: #fff; }
.ms-mc-prev { left: 8px; }
.ms-mc-next { right: 8px; }
.ms-mc-count { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .72rem;
  padding: .05rem .45rem; border-radius: 999px; pointer-events: none; }
.ms-mc-body { padding: .6rem .75rem .7rem; }
.ms-mc-price { font-weight: 800; font-size: 1.05rem; color: var(--ms-primary); }
.ms-mc-body a.ms-mc-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ms-text);
  font-weight: 600; text-decoration: none; margin: .1rem 0 .2rem; }
.ms-mc-body a.ms-mc-title:hover { color: var(--ms-primary); }
.ms-mc-params { color: var(--ms-text); }
.ms-mc-addr { color: var(--ms-muted); margin-top: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-mc-addr i { color: var(--ms-primary); }
.ms-mc-body a.ms-mc-more { display: inline-block; margin-top: .45rem; font-weight: 700; color: var(--ms-primary); text-decoration: none; }
.ms-mc-body a.ms-mc-more:hover { text-decoration: underline; }

/* сторінка об'єкта */
.ms-obj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ms-obj-head > .min-w-0 { flex: 1 1 420px; }
.ms-obj-price { text-align: right; display: flex; flex-direction: column; }
.ms-obj-price b { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: var(--ms-primary); white-space: nowrap; }
.ms-obj-price span { color: var(--ms-muted); font-size: .9rem; }
@media (max-width: 575.98px) { .ms-obj-price { text-align: left; } }
.ms-gallery { border-radius: var(--ms-radius); overflow: hidden; background: #0b1114; position: relative; }
.ms-gallery .carousel-item { background: #0b1114; }
.ms-gallery-open { border: 0; padding: 0; background: none; width: 100%; cursor: zoom-in; display: block; }
.ms-gallery-open img { display: block; width: 100%; height: auto; }
.ms-gallery .carousel-item.is-portrait { aspect-ratio: 16 / 10; }
.ms-gallery .is-portrait .ms-gallery-open { height: 100%; }
.ms-gallery .is-portrait .ms-gallery-open img { height: 100%; object-fit: contain; }
.ms-gallery-count { position: absolute; right: .8rem; bottom: .8rem; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; font-weight: 700;
  padding: .2rem .55rem; border-radius: 8px; z-index: 3; }
.ms-gallery-empty { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  color: var(--ms-muted); background: var(--ms-surface-2); font-size: 1rem; }
.ms-gallery-empty i { font-size: 2.5rem; opacity: .5; }
.ms-thumbs { display: flex; gap: 6px; padding: 6px; overflow-x: auto; background: var(--ms-surface); scrollbar-width: thin; }
.ms-thumbs button { flex: 0 0 84px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; opacity: .7; }
.ms-thumbs button.active { border-color: var(--ms-primary); opacity: 1; }
.ms-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.ms-lightbox .modal-content { background: rgba(5, 8, 10, .96); border: 0; }
.ms-lightbox .carousel-item img { width: 100%; height: 100%; object-fit: contain; }
.ms-lightbox-close { position: absolute; right: 1rem; top: 1rem; z-index: 5; background-color: rgba(255,255,255,.15); border-radius: 50%; padding: .7rem; opacity: 1; }
.ms-keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin-top: 1rem; }
.ms-keyfacts > div { background: var(--ms-surface); border: 1px solid var(--ms-border); border-radius: 14px; padding: .7rem .9rem; display: grid;
  grid-template-columns: auto 1fr; column-gap: .6rem; align-items: center; }
.ms-keyfacts i { grid-row: span 2; color: var(--ms-primary); font-size: 1.15rem; }
.ms-keyfacts b { font-size: 1.1rem; font-weight: 800; line-height: 1.1; }
.ms-keyfacts span { color: var(--ms-muted); font-size: .8rem; }
.ms-block { background: var(--ms-surface); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); padding: 1.2rem 1.3rem; margin-top: 1rem; }
.ms-block h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: .9rem; }
.ms-params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; margin: 0; }
.ms-params-1 { grid-template-columns: minmax(0, 1fr); background: var(--ms-surface); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); padding: .4rem 1.1rem; }
.ms-params > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--ms-border); min-width: 0; }
.ms-params dt { font-weight: 500; color: var(--ms-muted); }
.ms-params dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .ms-params { grid-template-columns: minmax(0, 1fr); } }
.ms-features { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.ms-features span { background: rgba(var(--ms-primary-rgb), .09); color: var(--ms-text); border-radius: 999px; padding: .3rem .75rem; font-size: .88rem; font-weight: 600; }
.ms-features i { color: var(--ms-primary); margin-right: .35rem; font-size: .8rem; }
.ms-features .is-tag { background: rgba(245, 158, 11, .14); }
.ms-description { line-height: 1.7; overflow-wrap: anywhere; }
.ms-description p:last-child { margin-bottom: 0; }
.ms-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1rem; }
.ms-realtor, .ms-formcard { background: var(--ms-surface); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); padding: 1.2rem; box-shadow: var(--ms-shadow); }
.ms-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.ms-avatar-ph { display: inline-grid; place-items: center; background: rgba(var(--ms-primary-rgb), .12); color: var(--ms-primary); font-size: 1.5rem; }
.ms-messengers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.ms-messengers a { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .3rem; border-radius: 12px; font-weight: 700;
  font-size: .85rem; color: #fff; text-decoration: none; min-width: 0; }
.ms-messengers a span { overflow: hidden; text-overflow: ellipsis; }
.ms-messengers .is-viber { background: #7360f2; }
.ms-messengers .is-telegram { background: #229ed9; }
.ms-messengers .is-whatsapp { background: #25d366; color: #083d22; }
.ms-cover { width: 100%; border-radius: var(--ms-radius); aspect-ratio: 16 / 9; object-fit: cover; }

.ms-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.ms-quick .btn { font-size: .9rem; padding: .55rem .5rem; line-height: 1.2; }

/* команда */
.ms-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.ms-person { background: var(--ms-surface); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); overflow: hidden; display: flex; flex-direction: column; }
.ms-person-photo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: grid; place-items: center; font-size: 3rem; border-radius: 0; }
.ms-person-body { padding: 1rem; }

/* контент сторінок */
.ms-content { background: var(--ms-surface); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); padding: 1.4rem 1.6rem; line-height: 1.75; overflow-wrap: anywhere; }
.ms-content img { height: auto; border-radius: 12px; }
.ms-content > :last-child { margin-bottom: 0; }
.ms-contacts li { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .55rem; min-width: 0; overflow-wrap: anywhere; }
.ms-contacts i { width: 1.1rem; margin-top: .25rem; opacity: .8; flex: none; }
.ms-contacts-lg li { margin-bottom: 1rem; font-size: 1.05rem; }
.ms-contacts-lg i { color: var(--ms-primary); font-size: 1.15rem; opacity: 1; }

/* підвал */
.ms-footer { background: var(--ms-footer); color: #c3ccd3; padding: 2.8rem 0 1.2rem; margin-top: 2rem; }
.ms-footer h6 { color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; margin-bottom: .9rem; }
.ms-footer a { color: #c3ccd3; }
.ms-footer a:hover { color: #fff; }
.ms-footer li { margin-bottom: .35rem; }
.ms-footer .ms-brand { color: #fff !important; }
.ms-footer .ms-muted { color: #93a1ab !important; }
.ms-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 2rem; padding-top: 1.1rem; font-size: .85rem; }
.ms-social a { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; }
.ms-social a:hover { background: var(--ms-primary); text-decoration: none; }
.ms-social-sm a { width: 34px; height: 34px; background: var(--ms-surface-2); color: var(--ms-text); }

/* плаваюча кнопка дзвінка (телефон) */
.ms-fab { position: fixed; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; border: 0; z-index: 1030;
  background: var(--ms-primary); color: #fff; font-size: 1.3rem; box-shadow: 0 10px 25px rgba(var(--ms-primary-rgb), .45); }
[data-bs-theme="dark"] .ms-fab { color: #04211e; }
@media (min-width: 992px) { .ms-fab { display: none; } }

@media (max-width: 575.98px) {
  .ms-hero { padding: 2rem 0 1.8rem; }
  .ms-search { padding: .8rem; border-radius: 16px; }
  .ms-stats { gap: .8rem 1.6rem; }
  .ms-stats b { font-size: 1.3rem; }
  .ms-grid, .ms-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .ms-block { padding: 1rem; }
  .ms-content { padding: 1rem; }
  .ms-cta { padding: 1.2rem; }
  .ms-list-tools { width: 100%; }
  .ms-list-tools > * { flex: 1; }
  .ms-list-tools .btn-group .btn { flex: 1; }
}

/* гортання фото на картці */
.ms-slide { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 34px; height: 34px; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.85); color: #1f2328;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); opacity: 0; transition: opacity .15s; cursor: pointer; font-size: .85rem; }
.ms-slide-prev { left: .5rem; }
.ms-slide-next { right: .5rem; }
.ms-card:hover .ms-slide, .ms-slide:focus-visible { opacity: 1; }
.ms-slide:hover { background: #fff; }
@media (hover: none) { .ms-slide { opacity: .85; width: 30px; height: 30px; } }
.ms-slide-count { position: absolute; right: .5rem; bottom: .5rem; z-index: 3; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem;
  padding: .1rem .45rem; border-radius: 999px; pointer-events: none; }
.ms-card-img[data-swiped] img, .ms-card-img img[data-photos] { transition: opacity .15s; }

/* кнопка «Особистий кабінет» у шапці — у стилі інших кнопок (40px, радіус 11px), фірмовий колір */
.ms-cabinet { display: inline-flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .85rem 0 .35rem; border-radius: 11px;
  border: 1px solid rgba(var(--ms-primary-rgb), .28); background: rgba(var(--ms-primary-rgb), .08); color: var(--ms-primary);
  font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.ms-cabinet-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--ms-primary); color: #fff; font-size: .8rem; font-weight: 700; }
.ms-cabinet:hover { background: var(--ms-primary); border-color: var(--ms-primary); color: #fff; text-decoration: none; }
.ms-cabinet:hover .ms-cabinet-ico { background: rgba(255,255,255,.2); }
[data-bs-theme="dark"] .ms-cabinet-ico { color: #0b1a19; }
[data-bs-theme="dark"] .ms-cabinet:hover { color: #0b1a19; }
@media (max-width: 767.98px) { .ms-cabinet { padding: 0 .35rem; } }

/* фільтр карти відкритою панеллю під заголовком + список об'єктів у видимій частині карти */
.ms-mapf.ms-mapf-inline { position: static; width: auto; max-height: none; overflow: visible; margin-bottom: 1rem; padding: 1rem 1.1rem .4rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .25rem 1.1rem; align-items: end;
  border: 1px solid var(--ms-border); border-radius: var(--ms-radius); background: var(--ms-surface); box-shadow: none; }
.ms-mapf.ms-mapf-inline[hidden] { display: none; }
.ms-mapf-inline .ms-mapf-head { display: none; }
.ms-mapf-inline .ms-mapf-foot { position: static; background: none; padding: 0; margin-bottom: .6rem; align-self: end; }
.ms-mapf-inline .ms-mapf-show { display: none !important; }
.ms-maplayout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.ms-maplist { max-height: min(70vh, 640px); overflow-y: auto; padding-right: .25rem; }
.ms-maplist-head { position: sticky; top: 0; z-index: 2; background: var(--ms-bg, var(--ms-surface-2)); padding: .1rem 0 .5rem; font-weight: 700; font-size: .9rem; }
.ms-maplist-hint { color: var(--ms-muted, #6b7280); font-size: .9rem; padding: 1rem; border: 1px dashed var(--ms-border); border-radius: 12px; text-align: center; }
.ms-li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: .7rem; padding: .5rem; margin-bottom: .5rem; border: 1px solid var(--ms-border);
  border-radius: 12px; background: var(--ms-surface); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.ms-li:hover, .ms-li.is-active { border-color: var(--ms-primary); box-shadow: 0 4px 14px rgba(0,0,0,.08); text-decoration: none; color: inherit; }
.ms-li-img { width: 112px; height: 84px; border-radius: 8px; object-fit: cover; background: var(--ms-surface-2); }
.ms-li-noimg { display: flex; align-items: center; justify-content: center; color: var(--ms-muted, #9aa4ae); }
.ms-li-price { font-weight: 800; }
.ms-li-title { font-size: .85rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ms-li-meta { font-size: .78rem; color: var(--ms-muted, #6b7280); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 991.98px) {
  .ms-maplayout { grid-template-columns: 1fr; }
  .ms-maplist { max-height: none; overflow: visible; }
}

/* підвал: «Сайт працює на Relto» (власні домени агентств) — колір від тексту підвалу, тож пасує до всіх дизайнів */
.ms-powered { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .8rem; border-radius: 999px;
  border: 1px solid currentColor; color: inherit; opacity: .72; font-size: .82rem; line-height: 1.2; transition: opacity .15s, transform .15s; }
.ms-powered:hover { opacity: 1; text-decoration: none; transform: translateY(-1px); }
.ms-powered b { font-weight: 800; letter-spacing: .02em; }
.ms-powered i { font-size: .8em; }
.ms-powered-sub { opacity: .7; padding-left: .45rem; margin-left: .1rem; border-left: 1px solid currentColor; }
@media (max-width: 575.98px) { .ms-powered-sub { display: none; } }

/* переноси рядків: заголовки рівними рядками, текст без «висячих» слів */
h1, h2, h3, h4, h5, .ms-card-title { text-wrap: balance; }
p, li, .lead, .small, .text-muted, dd, figcaption { text-wrap: pretty; }
