/* СдамМетр. Один файл стилей: токены, каркас, компоненты, экраны. */

/* ---------- токены ---------- */
:root {
  color-scheme: light;
  /* «Волга»: речная бирюза, песок пляжей, закатный оранжевый. Решение 06.10.2026 */
  --bg: #F3F6F6;                /* речной туман */
  --bg-raise: #E3EAEA;          /* подложка фото и карты, пока грузятся */
  --glass: rgba(243, 246, 246, 0.88);
  --surface: #EAF0F0;
  --surface-2: #DFE8E8;
  --line: #DCE5E5;
  --line-2: #C9D6D6;

  --text: #0D2B36;              /* глубокая вода */
  --text-2: #4C6670;            /* 5.6:1 на фоне */
  --text-3: #5A717A;

  --brand: #0B4F6C;             /* волжская бирюза: логотип, акценты, активные элементы */
  --brand-fill: #0B4F6C;        /* заливки с белым текстом: 8.9:1 */
  --brand-press: #083B51;
  --brand-grad: #0B4F6C;        /* исторически «градиент», теперь сплошной цвет */
  --brand-soft: #E1EDF2;
  --brand-text: #0B4F6C;
  --sand: #F3E3C7;              /* песок: бейдж «0% комиссии», тёмный текст 11.7:1 */
  --sunset: #F0A35E;            /* волна в логотипе, плашка «до Волги» на тёмном */
  --like: #C2531F;              /* «Поехали!»: закат, белый текст 4.6:1 */
  --like-deep: #A94618;
  --like-text: #A94618;
  --ok: #0F7A3D;                /* доверие: собственник подтверждён */
  --ok-soft: #E4F3EA;
  --nope: #0D2B36;
  --undo: #4C6670;
  --warn-text: #8A5300;

  --r-card: 24px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-btn: 14px;                /* кнопки и пульт: скруглённый квадрат, не пилюля */
  --pill: 9999px;

  --blur: blur(24px) saturate(160%);
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 24px 48px -20px rgba(8, 40, 54, 0.45), 0 6px 16px -8px rgba(8, 40, 54, 0.2);
  --shadow-pop: 0 6px 20px rgba(8, 40, 54, 0.12);

  --font: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Golos Text", sans-serif;   /* логотип, цены, заголовки */
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;  /* параметры квартиры */
  --topbar-h: 60px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
h1 { font-family: var(--font-display); font-size: clamp(24px, 3.6vw, 34px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
h2 { font-size: 20px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
h3 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.4; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
::selection { background: #CFE3EA; color: var(--text); }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 3px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: #BFCDCD transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #BFCDCD; border-radius: 8px; }
input, textarea { caret-color: var(--brand); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.ok { color: var(--ok); display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.ok svg { width: 15px; height: 15px; }
.warn { color: var(--warn-text); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 200px; }
kbd {
  display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 7px;
  font: 600 12px/1 var(--font); color: var(--text);
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--r-btn);
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s var(--ease-out), background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand-grad); color: #fff; }
.btn-primary:hover { background: var(--brand-press); }
.btn-like { background: var(--like); color: #fff; }
.btn-like:hover { background: var(--like-deep); }
.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn-danger { background: var(--text); color: #fff; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-wide { width: 100%; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--r-btn); border: 1px solid var(--line); background: #fff; color: var(--text);
  transition: background-color 0.2s, transform 0.15s var(--ease-out);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; border: 0; background: none;
  color: var(--text-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text); }
.link-danger { color: var(--text-2); }
.link-btn svg { width: 16px; height: 16px; }

/* ---------- стекло ---------- */
.glass-panel {
  background: #fff;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: 28px;
}

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  padding: 0 max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 12px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.logo-mark { display: block; width: 34px; height: 34px; }
.logo-mark svg { width: 34px; height: 34px; stroke: none; }
.logo-word { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.logo-word b { font-weight: 700; color: var(--brand); }
.topnav { display: none; }
.saving-pill {
  padding: 6px 12px; border-radius: var(--pill);
  background: var(--ok-soft); border: 1px solid #B9DEC6;
  color: var(--ok); font-size: 13px; font-weight: 650; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.offline-bar {
  padding: 8px 16px; font-size: 13px; text-align: center;
  background: #FFF8E6; color: var(--warn-text); border-bottom: 1px solid #F5E3B5;
}

/* ---------- таббар (телефон) ---------- */
.tabbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(8px + var(--safe-b)); z-index: 40;
  height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); text-decoration: none; font-size: 11px; font-weight: 600;
  transition: color 0.2s;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--text); }
.tabbar a[aria-current="page"] svg { color: var(--brand); }
.tabbar a[aria-current="page"] { color: var(--brand-text); }
.tabbar .badge, .topnav .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill);
  background: var(--brand-fill); color: #fff; font: 700 11px/18px var(--font); font-style: normal; text-align: center;
}
.tabbar .badge { position: absolute; top: 7px; left: calc(50% + 6px); }

/* ---------- экраны ---------- */
main { flex: 1 0 auto; padding-bottom: calc(var(--tabbar-h) + 24px + var(--safe-b)); }
/* Подбор и карта занимают ровно экран: шапка + плашка офлайна + остаток */
body[data-view="swipes"], body[data-view="map"] { height: 100dvh; overflow: hidden; }
body[data-view="swipes"] main, body[data-view="map"] main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-bottom: 0; }
.view { display: none; }
.view.is-active { display: block; }
.page { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; }
.page-head { display: grid; gap: 8px; margin-bottom: 24px; max-width: 64ch; }
.manifesto { color: var(--text-2); font-size: 16px; }

/* ---------- экран подбора: телефон ---------- */
#view-swipes.is-active { display: flex; flex: 1; min-height: 0; }
.ws-left, .ws-right, .keys, .map-toggle { display: none; }
.ws-center { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.viewfinder {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  padding: 8px 10px calc(var(--tabbar-h) + 8px + var(--safe-b));
}

/* ---------- колода и карточка ---------- */
.deck { position: relative; flex: 1; min-height: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.card {
  position: absolute; inset: 0;
  border-radius: var(--r-card);
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 30% 25%, #D5E6EC, transparent 70%),
    radial-gradient(70% 60% at 80% 70%, #F1E6D2, transparent 70%),
    var(--bg-raise);
  box-shadow: var(--shadow-card);
  cursor: grab;
  will-change: transform;
  transform-origin: 50% 90%;
}
.card.is-dragging { cursor: grabbing; }
.card.is-next { transform: scale(0.94); filter: brightness(0.92); pointer-events: none; transition: transform 0.3s var(--ease-out), filter 0.3s; }
.card-media, .card-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-media img { object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
img.is-broken { visibility: hidden; }
.card-stories { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; gap: 4px; z-index: 2; }
.card-stories span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.32); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: background-color 0.2s; }
.card-stories span.is-on { background: #fff; }
.card-scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 68%;
  background: linear-gradient(to top, rgba(6, 34, 46, 0.97) 0%, rgba(6, 34, 46, 0.86) 32%, rgba(6, 34, 46, 0.38) 64%, rgba(6, 34, 46, 0) 100%);
}
.card::after { /* лёгкое затемнение сверху под сторис-полосками */
  content: ""; position: absolute; inset: 0 0 auto; height: 90px;
  background: linear-gradient(to bottom, rgba(6, 34, 46, 0.45), transparent);
}
.card-info { color: #fff; --text-2: #CFE2E8; position: absolute; left: 20px; right: 20px; bottom: 20px; z-index: 2; display: grid; gap: 6px; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.badge-zero, .badge-verified {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-zero { background: var(--sand); color: var(--text); }
.badge-verified { background: #fff; color: var(--ok); border: 1px solid #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.badge-verified svg { width: 14px; height: 14px; }
.detail-pad .badge-verified { background: var(--ok-soft); border-color: #B9DEC6; }
.card-price, .detail-price, .tile-price, .match-price, .own-price, .hero-card-info b { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card-price { font-size: 30px; line-height: 1.1; }
.card-price small, .detail-price small, .match-price small, .tile-price small { font-family: var(--font); font-size: 0.5em; font-weight: 600; letter-spacing: 0; color: var(--text-2); }
.card-meta { font-size: 13px; font-weight: 500; color: var(--text-2); }
/* параметры квартиры: моноширинная сетка «КОМНАТ / ПЛОЩАДЬ / ЭТАЖ» */
.specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 2px 0; font-family: var(--font-mono); }
.specs div { padding: 6px 9px; border-radius: 8px; background: var(--surface); }
.specs dt { font-size: 10px; letter-spacing: 0.06em; color: var(--text-2); }
.specs dd { margin: 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card-info .specs div { background: rgba(255, 255, 255, 0.12); }
/* «8 мин пешком до Волги»: считается по координатам, см. ui.js volgaMin */
.volga-line { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--text); font-size: 14px; font-weight: 600; }
.volga-line svg { width: 20px; height: 20px; color: var(--brand); }
.card-info .volga-line { background: rgba(255, 255, 255, 0.12); color: #fff; }
.card-info .volga-line svg { color: var(--sunset); }
.card-address { display: flex; align-items: flex-start; gap: 6px; font-size: 14px; color: var(--text-2); }
.card-address svg { width: 16px; height: 16px; margin-top: 2px; }
.card-tags, .tag-row, .tile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
}
.tag svg { width: 14px; height: 14px; color: var(--text-2); }
.card-info .tag { color: #fff; background: transparent; border-color: rgba(255, 255, 255, 0.3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.card-info .tag svg { color: rgba(255, 255, 255, 0.85); }

.stamp {
  position: absolute; top: 48px; z-index: 3; opacity: 0;
  padding: 4px 14px; border: 4px solid currentColor; border-radius: 14px;
  font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  pointer-events: none; background: rgba(6, 34, 46, 0.3);
}
.stamp-like { left: 22px; color: var(--sunset); transform: rotate(-14deg); }
.stamp-nope { right: 22px; color: #FFFFFF; transform: rotate(14deg); }

.deck-empty, .empty {
  height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 32px; text-align: center; border-radius: var(--r-card);
  border: 1px dashed var(--line-2); color: var(--text-2);
}
.deck-empty > svg, .empty > svg { width: 40px; height: 40px; color: var(--brand); stroke-width: 1.6; }
.deck-empty h2, .empty h2 { color: var(--text); }
.deck-empty p, .empty p { max-width: 34ch; }
.empty { min-height: 320px; }

/* ---------- пульт ---------- */
.controls { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0 12px; }
.ctl {
  display: grid; place-items: center; border-radius: var(--r-btn);
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(8, 40, 54, 0.10);
  transition: transform 0.2s var(--spring), background-color 0.2s, box-shadow 0.2s;
}
.ctl:hover:not(:disabled) { transform: scale(1.07); box-shadow: 0 10px 22px rgba(8, 40, 54, 0.16); }
.ctl:active:not(:disabled) { transform: scale(0.9); transition-duration: 0.08s; }
.ctl-undo { width: 46px; height: 46px; color: var(--undo); }
.ctl-info { width: 46px; height: 46px; color: var(--text-2); }
.ctl-nope { width: 58px; height: 58px; border-radius: 18px; color: var(--nope); }
.ctl-nope svg { width: 26px; height: 26px; stroke-width: 2.6; }
.ctl-like {
  display: inline-flex; align-items: center; gap: 8px;
  height: 62px; padding: 0 22px; border-radius: 18px; color: #fff; border: 0;
  background: var(--like);
  font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap;
  box-shadow: 0 10px 24px -8px rgba(194, 83, 31, 0.5);
}
.ctl-like:hover:not(:disabled) { background: var(--like-deep); box-shadow: 0 14px 30px -8px rgba(194, 83, 31, 0.6); }
.ctl-like svg { width: 20px; height: 20px; stroke-width: 2.4; }
.ctl-undo svg, .ctl-info svg { width: 21px; height: 21px; }

/* ---------- фильтры ---------- */
.filters { display: grid; gap: 18px; }
.f-block { display: grid; gap: 10px; }
.f-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--text-2); }
.f-label output { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
/* бюджет: два ползунка на одной дорожке, без системной обводки, фокус виден на кружке */
.range2 { position: relative; height: 28px; --lo: 0%; --hi: 100%; --zmin: 1; }
.range2::before {
  content: ""; position: absolute; left: 11px; right: 11px; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px;
  background: linear-gradient(90deg, var(--line-2) var(--lo), var(--brand) var(--lo), var(--brand) var(--hi), var(--line-2) var(--hi));
}
.range2 input {
  position: absolute; inset: 0; width: 100%; height: 28px; margin: 0; padding: 0;
  background: none; -webkit-appearance: none; appearance: none; pointer-events: none; outline: none; z-index: 2;
}
.range2 input[data-p="min"] { z-index: var(--zmin); }
.range2 input:focus-visible { outline: none; }
.range2 input::-webkit-slider-runnable-track { height: 28px; background: none; border: 0; }
.range2 input::-moz-range-track { height: 28px; background: none; border: 0; }
.range2 input::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); cursor: grab;
  transition: box-shadow 0.15s, transform 0.15s var(--ease-out);
}
.range2 input::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); cursor: grab;
}
.range2 input:active::-webkit-slider-thumb { transform: scale(1.12); cursor: grabbing; }
.range2 input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(11, 79, 108, 0.2), 0 2px 6px rgba(0, 0, 0, 0.18); }
.range2 input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 6px rgba(11, 79, 108, 0.2); }
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-num {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 14px; font-size: 13px; color: var(--text-3); cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.price-num:focus-within { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.price-num input[type="text"] {
  flex: 1; min-width: 0; min-height: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font-size: 16px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums;
}
.price-num input[type="text"]:focus { box-shadow: none; }
.price-num i { font-style: normal; }

/* работа или учёба */
.anchor-add {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; text-align: left;
  background: #fff; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--text); font-weight: 600; font-size: 15px;
  transition: border-color 0.2s, background-color 0.2s;
}
.anchor-add:hover { border-color: var(--text-3); }
.anchor-add > svg { width: 20px; height: 20px; flex: none; color: var(--brand); }
.anchor-add span { display: grid; gap: 2px; min-width: 0; }
.anchor-add small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.anchor-add.is-set { border-style: solid; border-color: var(--text); }
.anchor-chip { display: flex; gap: 8px; align-items: center; }
.anchor-chip .anchor-add { flex: 1; min-width: 0; }
.anchor-chip .anchor-add span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anchor-search { position: relative; }
.anchor-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--text-3); pointer-events: none; }
.anchor-search input[type="search"] { padding-left: 42px; }
.anchor-results { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 14px; max-height: 220px; overflow-y: auto; }
.anchor-results li.muted { padding: 10px 12px; }
.anchor-results button { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; text-align: left; border: 0; background: none; border-radius: 10px; color: var(--text); font-weight: 600; }
.anchor-results button:hover, .anchor-results button:focus-visible { background: var(--surface); }
.anchor-results svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--brand); }
.anchor-results span { display: grid; gap: 2px; }
.anchor-results small { font-weight: 500; color: var(--text-2); font-size: 13px; }
.map-anchor { height: 240px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.anchor-actions { align-items: center; }
.detail-commute { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.detail-commute svg { width: 16px; height: 16px; color: var(--brand); }
.addr-row { display: flex; gap: 8px; }
.field:has(.addr-row) { flex-basis: 320px; }
.addr-row .btn { flex: none; min-height: 46px; white-space: nowrap; }
@media (max-width: 480px) { .addr-row { flex-wrap: wrap; } .addr-row .btn { width: 100%; } }
.segmented { display: flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); }
.segmented button, .segmented label {
  flex: 1; min-height: 38px; display: grid; place-items: center; padding: 0 8px;
  border: 0; border-radius: var(--pill); background: none; color: var(--text-2);
  font-size: 14px; font-weight: 650; transition: background-color 0.2s, color 0.2s; cursor: pointer;
}
.segmented button[aria-pressed="true"], .segmented label:has(input:checked) { background: var(--text); color: var(--bg); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #fff;
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px;
  border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.chip svg { width: 16px; height: 16px; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip[aria-pressed="true"], .chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }

/* поля */
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); flex: 1 1 140px; }
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="file"])), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 14px;
  color: var(--text); font-size: 16px; font-weight: 500;
  transition: border-color 0.2s, background-color 0.2s;
}
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #8A8A8A; }
input:where(:not([type="range"])):focus, select:focus, textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.hint { font-size: 13px; color: var(--text-3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; cursor: pointer; }
.check input, .radio input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }

/* ---------- модалки ---------- */
dialog.sheet {
  width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0;
  padding: 20px 16px calc(20px + var(--safe-b));
  border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0;
  background: #fff; color: var(--text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  overflow-y: auto; overscroll-behavior: contain;
}
dialog.sheet[open] { display: grid; gap: 16px; align-content: start; animation: sheet-up 0.38s var(--ease-out); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h2 { padding-top: 8px; }
.sheet-tall { padding-top: 0 !important; }
dialog.sheet-tall[open] { display: block; }
.sheet-x { position: sticky; top: 12px; margin: 12px 12px -56px auto; display: grid; z-index: 5; background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

.gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0;
  margin: 0 -16px; border-radius: 0; scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; background: var(--bg-raise); }
.detail-pad { display: grid; gap: 10px; padding-top: 16px; }
.detail-price { font-size: 30px; }
.detail-meta { font-weight: 600; color: var(--text); }
.detail-addr { display: flex; gap: 6px; color: var(--text-2); }
.detail-addr svg { width: 18px; height: 18px; margin-top: 2px; }
.detail-desc { color: var(--text-2); max-width: 65ch; margin-top: 4px; }
.inv { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); font-size: 14px; }
.inv li::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--text-3); }
.owner { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; padding: 14px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line-2); }
.owner p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--text); color: #fff; font-weight: 800; font-size: 18px; }
.owner > div { display: grid; gap: 4px; flex: 1; }
.trust-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.trust-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.detail-actions .btn { flex: 1 1 auto; }

.vote { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vote-btn {
  display: grid; justify-items: center; gap: 8px; padding: 18px 10px; cursor: pointer;
  border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 700; text-align: center; transition: background-color 0.2s, border-color 0.2s;
}
.vote-btn svg { width: 26px; height: 26px; }
.vote-btn input { position: absolute; opacity: 0; pointer-events: none; }
.vote-yes:has(input:checked) { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.vote-no:has(input:checked) { background: #FFF1EE; border-color: var(--nope); color: var(--nope); }
#review-form, #report-form { display: grid; gap: 14px; }
.radio-list { display: grid; gap: 8px; }
.radio { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--text); background: var(--surface); }
.contract-text { font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace !important; min-height: 280px; white-space: pre-wrap; }

/* ---------- тост ---------- */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(var(--tabbar-h) + 22px + var(--safe-b));
  width: min(560px, calc(100% - 24px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: 20px;
  background: #fff; border: 1px solid var(--line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow-pop);
  font-size: 14px; font-weight: 600;
  opacity: 0; transform: translate(-50%, 16px);
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1023px) {   /* на телефоне тост сверху, чтобы не закрывать пульт */
  .toast { bottom: auto; top: calc(var(--topbar-h) + 10px); transform: translate(-50%, -16px); }
}
@media (max-width: 479px) {
  .saving-pill { display: none; }
}
.saving-line { color: var(--like-text); font-weight: 650; }
.toast-text { display: grid; flex: 1 1 200px; }
.toast-text span { color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- карта ---------- */
.map { background: var(--bg-raise); }
.leaflet-container { background: var(--bg-raise); font-family: var(--font); }
.leaflet-control-attribution { background: rgba(255, 255, 255, 0.8) !important; color: var(--text-3) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-bar a { background: #fff !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-bar { border: 1px solid var(--line) !important; border-radius: 12px !important; overflow: hidden; }
.pin-wrap { background: none; border: 0; }
.pin-c { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); white-space: nowrap; }
.pin.pin-anchor { display: inline-flex; align-items: center; gap: 5px; background: var(--brand-fill); color: #fff; border-color: var(--brand-fill); }
.pin.pin-anchor svg { width: 14px; height: 14px; }
[class*="ymaps-2"][class*="-copyright"] { font-size: 10px; }
.pin {
  display: inline-block; padding: 5px 10px; border-radius: var(--pill);
  background: #fff; color: var(--text); font: 750 13px/1.2 var(--font); border: 1px solid var(--line-2); white-space: nowrap;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s var(--spring), background-color 0.2s;
  font-variant-numeric: tabular-nums;
}
.pin.is-verified { box-shadow: 0 0 0 2px var(--ok), 0 6px 14px -4px rgba(0, 0, 0, 0.55); }
.pin.is-active { background: var(--text); color: #fff; border-color: var(--text); transform: scale(1.15); }
.pin:hover { transform: scale(1.08); }

#view-map.is-active { position: relative; display: block; flex: 1; min-height: 0; }
.map-full { position: absolute; inset: 0; }
.map-chips {
  position: absolute; z-index: 500; top: 12px; left: 0; right: 0;
  flex-wrap: nowrap; overflow-x: auto; padding: 0 12px 6px; scrollbar-width: none;
}
.map-chips::-webkit-scrollbar { display: none; }
.map-chips .chip { background: #fff; box-shadow: var(--shadow-pop); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--text); }
.map-chips .chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
#view-map .leaflet-bottom { bottom: calc(var(--tabbar-h) + 16px + var(--safe-b)); }

/* ---------- каталог ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px 20px; }
.tile { position: relative; display: grid; gap: 10px; align-content: start; }
.tile-photo {
  position: relative; padding: 0; border: 0; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3;
  background: var(--bg-raise);
}
.tile-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease-out); }
.tile-photo:hover img { transform: scale(1.04); }
.tile-photo .badge-verified { position: absolute; left: 10px; bottom: 10px; }
.tile-like {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); color: #fff;
  background: rgba(11, 15, 25, 0.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform 0.2s var(--spring), background-color 0.2s;
}
.tile-like:hover { transform: scale(1.08); }
.tile-like:active { transform: scale(0.9); }
.tile-like[aria-pressed="true"] { background: var(--brand-fill); border-color: var(--brand-fill); }
.tile-like[aria-pressed="true"] svg { fill: currentColor; }
.tile-body { display: grid; gap: 2px; }
.tile-price { font-size: 19px; }
.tile-meta { font-weight: 600; color: var(--text); font-size: 14px; }
.tile-addr { color: var(--text-2); font-size: 14px; }

/* ---------- мэтчи ---------- */
.match-list { display: grid; gap: 14px; }
.match {
  display: grid; grid-template-columns: 104px 1fr; gap: 14px; padding: 12px;
  border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.match-photo { padding: 0; border: 0; border-radius: 18px; overflow: hidden; aspect-ratio: 1; background: var(--bg-raise); align-self: start; }
.match-photo img { width: 100%; height: 100%; object-fit: cover; }
.match-body { display: grid; gap: 3px; min-width: 0; }
.match-price { font-size: 19px; }
.match-meta { font-weight: 600; font-size: 14px; color: var(--text); }
.match-addr { color: var(--text-2); font-size: 14px; }
.match-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; margin-top: 2px; }
.match-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; grid-column: 1 / -1; }
.match-actions .icon-btn { width: 40px; height: 40px; color: var(--text-2); }
.match-actions .icon-btn svg { width: 18px; height: 18px; }

.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recent-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; text-align: left;
  border-radius: var(--r-md); border: 1px solid transparent; background: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.recent-item:hover { background: var(--surface); border-color: var(--line); }
.recent-photo { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; background: var(--bg-raise); }
.recent-item span { display: grid; min-width: 0; }
.recent-item b { font-variant-numeric: tabular-nums; }
.recent-item small { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- форма собственника ---------- */
.add-form { display: grid; gap: 8px; padding: 8px 20px 24px; max-width: 760px; }
.add-form fieldset { border: 0; margin: 0; padding: 16px 0 12px; display: grid; gap: 14px; border-bottom: 1px solid var(--line); }
.add-form fieldset:last-of-type { border-bottom: 0; }
.add-form legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.dropzone {
  display: flex; align-items: center; gap: 14px; padding: 18px; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: var(--r-md); color: var(--text-2);
  transition: border-color 0.2s, background-color 0.2s;
}
.dropzone:hover { border-color: var(--text); background: var(--surface); }
.dropzone svg { width: 28px; height: 28px; color: var(--brand-text); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 2px solid var(--brand-text); outline-offset: 3px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
.thumbs:empty { display: none; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; flex: none; }
.map-pick { height: 260px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.form-error { padding: 12px 14px; border-radius: var(--r-sm); background: #FFF1EE; border: 1px solid #F5C2B5; color: var(--nope); font-weight: 600; }
.add-form .btn-primary { margin-top: 8px; min-height: 52px; font-size: 16px; }

/* ---------- приветствие ---------- */
#view-home.is-active { display: block; }
.hero {
  max-width: 1120px; margin: 0 auto; padding: 32px 16px 24px;
  display: grid; gap: 28px; align-items: center;
}
.hero-city { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.hero-city svg { width: 16px; height: 16px; color: var(--brand); }
.hero-text { display: grid; gap: 16px; }
.hero h1 { font-size: clamp(30px, 5.6vw, 52px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero-sub { font-size: clamp(16px, 1.6vw, 19px); color: var(--text-2); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 16px; }
.hero-count { font-size: 14px; }
.hero-stack { position: relative; height: 380px; max-width: 420px; width: 100%; margin: 0 auto; }
.hero-card {
  position: absolute; top: 10px; left: 50%; width: 250px; height: 340px; margin-left: -125px;
  border-radius: 28px; overflow: hidden; background: var(--bg-raise); box-shadow: var(--shadow-card);
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card::after { content: ""; position: absolute; inset: auto 0 0; height: 55%; background: linear-gradient(to top, rgba(6, 34, 46, 0.9), transparent); }
.hero-card-info { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 16px; display: grid; gap: 4px; color: #fff; justify-items: start; }
.hero-card-info b { font-size: 26px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-card-info small { font-size: 13px; font-weight: 600; opacity: 0.85; }
.hero-card-info span:last-child { font-size: 14px; opacity: 0.9; }
.hero-card-0 { transform: translateX(-70px) rotate(-9deg) scale(0.9); filter: brightness(0.95); }
.hero-card-1 { transform: translateX(70px) rotate(8deg) scale(0.92); filter: brightness(0.97); }
.hero-card-2 { transform: rotate(-1.5deg); animation: hero-swipe 5s var(--ease-out) 1.2s infinite; }
@keyframes hero-swipe {
  0%, 55% { transform: rotate(-1.5deg); }
  68% { transform: translateX(46px) rotate(6deg); }
  80%, 100% { transform: rotate(-1.5deg); }
}
.hero-stamp {
  position: absolute; z-index: 2; top: 44px; left: 50%; margin-left: -104px;
  padding: 3px 12px; border: 4px solid var(--like); border-radius: 12px; color: var(--like);
  font-family: var(--font-display); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: 0.04em;
  transform: rotate(-14deg); background: rgba(255, 255, 255, 0.85);
  opacity: 0; animation: hero-stamp 5s var(--ease-out) 1.2s infinite;
}
@keyframes hero-stamp { 0%, 55% { opacity: 0; } 66%, 74% { opacity: 1; } 82%, 100% { opacity: 0; } }

.home-section { max-width: 1120px; margin: 0 auto; padding: 32px 16px; display: grid; gap: 20px; justify-items: start; }
.home-section h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.03em; }
.facts { display: grid; gap: 14px; width: 100%; }
.fact { display: grid; gap: 8px; align-content: start; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.fact h3 { margin: 4px 0 0; font-size: 18px; }
.fact p { color: var(--text-2); font-size: 15px; }
.fact-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-press); font-weight: 850; font-size: 17px; }
.fact-ico svg { width: 24px; height: 24px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; width: 100%; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 2px 14px; align-items: start; }
.steps li::before {
  content: counter(step); grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--text); color: #fff; font-weight: 800;
}
.steps b { font-size: 17px; padding-top: 2px; }
.steps span { color: var(--text-2); }
body[data-view="home"] .tabbar, body[data-view="start"] .tabbar { display: none; }
body[data-view="home"] main, body[data-view="start"] main { padding-bottom: 32px; }

/* ---------- шаг «Что ищете?» ---------- */
.start-card { max-width: 520px; margin: 0 auto; display: grid; gap: 18px; }
.start-card .filters { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06); }
.start-skip { justify-self: center; }
.btn.is-disabled { opacity: 0.45; pointer-events: none; }

/* ---------- кабинет собственника ---------- */
.back-link { margin-bottom: 8px; text-decoration: none; }
.owner-empty { max-width: 640px; display: grid; gap: 18px; justify-items: start; }
.owner-pros { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.owner-pros li { display: flex; gap: 12px; align-items: flex-start; }
.owner-pros svg { width: 22px; height: 22px; color: var(--brand); margin-top: 1px; }
.owner-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.owner-head h1 { margin-bottom: 4px; }
.owner-list { display: grid; gap: 16px; }
.own {
  display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.own-photo { padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: var(--bg-raise); align-self: start; }
.own-photo img { width: 100%; height: 100%; object-fit: cover; }
.own-body { display: grid; gap: 6px; min-width: 0; }
.own-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--pill); font-size: 12px; font-weight: 700; }
.status.is-on { background: var(--ok-soft); color: var(--ok); }
.status.is-off { background: var(--surface-2); color: var(--text-2); }
.status.is-warn { background: #FFF8E6; color: var(--warn-text); }
.own-price { font-size: 21px; }
.own-price small { font-size: 0.55em; color: var(--text-2); font-weight: 600; letter-spacing: 0; }
.own-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 6px 0 0; }
.own-stats div { display: grid; }
.own-stats dt { font-size: 12px; color: var(--text-2); }
.own-stats dd { margin: 0; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.own-price-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.own-price-form .field { flex: 0 1 200px; }
.own-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.owner-note { margin-top: 20px; }

@media (max-width: 560px) {
  .own { grid-template-columns: 84px 1fr; }
  .own-actions { grid-column: 1 / -1; }
  .hero-stack { height: 330px; }
  .hero-card { width: 210px; height: 290px; margin-left: -105px; }
  .hero-card-0 { transform: translateX(-56px) rotate(-9deg) scale(0.88); }
  .hero-card-1 { transform: translateX(56px) rotate(8deg) scale(0.9); }
}
@media (min-width: 760px) {
  .facts { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
@media (min-width: 1024px) {
  .hero { grid-template-columns: 1.1fr 0.9fr; padding: 64px 32px 40px; min-height: calc(100dvh - var(--topbar-h) - 120px); }
  .hero-stack { height: 460px; }
  .hero-card { width: 290px; height: 400px; margin-left: -145px; }
  .home-section { padding: 40px 32px; }
}

/* ---------- десктоп: студийный воркспейс ---------- */
@media (min-width: 1024px) {
  :root { --topbar-h: 68px; }
  main { padding-bottom: 0; }
  .tabbar, .only-mobile { display: none !important; }
  .topbar { padding: 0 24px; gap: 20px; }
  .logo { margin-right: 0; }
  .topnav { display: flex; gap: 4px; margin-right: auto; }
  .topnav a {
    position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
    border-radius: var(--pill); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 15px;
    transition: background-color 0.2s, color 0.2s;
  }
  .topnav a:hover { color: var(--text); background: var(--surface); }
  .topnav a[aria-current="page"] { color: var(--text); }
  .topnav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -14px; height: 2px; border-radius: 2px; background: var(--text); }

  /* Подбор: фильтры | крупная карточка | узкая карта (сворачивается) */
  #view-swipes.is-active {
    display: grid; grid-template-columns: 300px minmax(0, 1fr) 380px; gap: 32px; padding: 28px 32px 20px;
  }
  body.map-collapsed #view-swipes.is-active { grid-template-columns: 300px minmax(0, 1fr) 0; gap: 32px 0; }
  body.map-collapsed .ws-right { visibility: hidden; }
  .ws-left { display: flex; flex-direction: column; gap: 18px; padding: 0 4px 0 0; border: 0; border-radius: 0; overflow-y: auto; min-height: 0; }
  .intro { display: grid; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
  .intro h1 { font-size: 30px; line-height: 1.1; }
  .intro h1 em { font-style: normal; color: var(--brand); }
  .intro p { color: var(--text-2); font-size: 15px; }
  .panel-title { font-size: 16px; }
  .ws-left .panel-title + .recent { margin-top: -6px; }
  .ws-center { align-items: center; min-height: 0; }
  .viewfinder { width: min(100%, 520px); flex: 1; min-height: 0; max-height: 900px; padding: 0; }
  .controls { padding: 18px 0 10px; gap: 20px; }
  .keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; margin-top: 4px; color: var(--text-3); font-size: 12px; }
  .keys span { display: inline-flex; align-items: center; gap: 6px; }
  .ws-right { position: relative; display: block; min-height: 0; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); }
  .ws-right .map { width: 100%; height: 100%; }
  .map-toggle {
    position: fixed; z-index: 30; right: 48px; bottom: 44px;
    display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
    border: 0; border-radius: var(--pill); background: var(--text); color: #fff; font-weight: 650; font-size: 14px;
    box-shadow: var(--shadow-pop); transition: transform 0.15s var(--ease-out);
  }
  .map-toggle:hover { transform: scale(1.04); }
  .map-toggle svg { width: 18px; height: 18px; }
  body:not([data-view="swipes"]) .map-toggle { display: none; }

  .page { padding: 40px 24px 64px; }
  #view-map .leaflet-bottom { bottom: 0; }
  .map-chips { left: 16px; right: 16px; top: 16px; padding: 0; flex-wrap: wrap; }

  dialog.sheet {
    width: min(600px, calc(100% - 48px)); margin: auto;
    border: 1px solid var(--line-2); border-radius: 28px; padding: 24px;
    max-height: min(860px, 90dvh);
  }
  dialog.sheet[open] { animation: sheet-pop 0.32s var(--ease-out); }
  .gallery { margin: 0 -24px; }
  .toast { bottom: 28px; }
  .match { grid-template-columns: 140px 1fr; padding: 14px; }
  .match-actions { grid-column: 2; }
  .card-price { font-size: 34px; }
}
@keyframes sheet-pop { from { transform: translateY(12px) scale(0.98); opacity: 0; } }

@media (max-height: 700px) and (max-width: 1023px) {
  .card-tags .tag:nth-child(n+3) { display: none; }
  .card-price { font-size: 26px; }
  .card-info { bottom: 16px; gap: 4px; }
  .card-meta { display: none; }
  .volga-line { padding: 6px 10px; font-size: 13px; }
  .controls { padding: 10px 0 8px; }
}
@media (max-width: 380px) {
  .card-price { font-size: 27px; }
  .controls { gap: 10px; }
  .ctl-like { padding: 0 16px; }
  .saving-pill { font-size: 12px; padding: 5px 10px; }
  .logo-word { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- поправки приветствия и кабинета --- */
.hero-card-0 .hero-card-info, .hero-card-1 .hero-card-info { display: none; }
body:not([data-view="swipes"]):not([data-view="catalog"]):not([data-view="map"]) #open-filters { display: none !important; }
@media (max-width: 560px) {
  .own { grid-template-columns: 1fr; }
  .own-photo { aspect-ratio: 16 / 9; }
}
