:root {
  --bg: #0b0a09;
  --bg-elev: #161311;
  --bg-soft: #1c1815;
  --ink: #f0eae4;
  --muted: #9a9088;
  --line: rgba(240, 234, 228, 0.08);
  --line-strong: rgba(240, 234, 228, 0.14);
  /* цвет с логотипа канала Nadodom */
  --accent: #a64028;
  --accent-2: #e8896e;
  --accent-deep: #8b3420;
  --accent-dim: rgba(166, 64, 40, 0.18);
  --accent-glow: rgba(166, 64, 40, 0.4);
  --on-accent: #f0eae4;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  font-family: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(166, 64, 40, 0.22), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(232, 137, 110, 0.08), transparent 50%),
    radial-gradient(600px 500px at 50% 120%, rgba(166, 64, 40, 0.08), transparent 55%),
    linear-gradient(180deg, #14100e 0%, var(--bg) 40%, #080706 100%);
  background-attachment: fixed;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  --map-h: 42vh;
  --map-h-min: 52px;
  --map-h-max: 42vh;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 12px 0;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  animation: appIn 0.45s var(--ease-out) both;
}

.top.compact {
  padding: 2px 2px 0;
  flex-shrink: 0;
}
.top.compact .brand { font-size: 22px; }
.top.compact .sub { font-size: 12px; margin-top: 2px; }

.filters.compact {
  padding: 10px;
  flex-shrink: 0;
}
.filters.compact .row { margin-top: 6px; }
.filters.compact .chips { margin-bottom: 6px; }


@keyframes appIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.top {
  padding: 10px 4px 18px;
}
.brand {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  background: linear-gradient(120deg, #fff 10%, var(--accent-2) 55%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.filters {
  position: relative;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), transparent 55%),
    var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: riseIn 0.5s var(--ease-out) 0.08s both;
}
.filters::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 140%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(166, 64, 40, 0.7), transparent);
  opacity: 0.7;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.chip {
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform 0.18s var(--ease-spring),
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
  touch-action: manipulation;
}
.chip:hover {
  border-color: rgba(166, 64, 40, 0.45);
  transform: translateY(-1px);
}
.chip:active {
  transform: scale(0.94);
}
.chip.active {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent) 55%, #c45a3e);
  border-color: transparent;
  color: var(--on-accent);
  box-shadow: 0 0 0 1px rgba(166, 64, 40, 0.35), 0 8px 22px var(--accent-glow);
}

.row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.field.grow { flex: 2; }
.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 13px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: #100e0c;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #a8988c 50%),
    linear-gradient(135deg, #a8988c 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
  cursor: pointer;
}
.field input::placeholder {
  color: #6a615a;
  font-weight: 500;
}
.field input:focus,
.field select:focus {
  border-color: rgba(166, 64, 40, 0.65);
  background-color: #161210;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.count {
  margin: 16px 4px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  animation: riseIn 0.45s var(--ease-out) 0.12s both;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  --i: 0;
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform-origin: center top;
  animation: cardIn 0.48s var(--ease-out) both;
  animation-delay: calc(var(--i) * 45ms);
  transition:
    transform 0.22s var(--ease-out),
    border-color 0.22s ease,
    box-shadow 0.22s ease;
  touch-action: manipulation;
}
.card-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 112px;
  cursor: pointer;
}
.card-row .thumb {
  position: relative;
  width: 112px;
  min-height: 112px;
  background: #100e0c;
  overflow: hidden;
}
.card-row .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}
.card-row .thumb .photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px;
  text-align: center;
}
.card-row .body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.card-row .price {
  font-size: 16px;
  margin: 0;
}
.card-row .title {
  font-size: 13px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.obj-id {
  font-weight: 650;
  color: var(--muted);
}
.card-row .addr {
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-row .meta {
  margin-top: 6px;
}
.card-row .cta-btn {
  margin-top: 8px;
  align-self: flex-start;
}
.card.is-selected {
  border-color: rgba(166, 64, 40, 0.55);
  box-shadow: 0 0 0 1px rgba(166, 64, 40, 0.25), var(--shadow);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.card:active {
  transform: scale(0.985);
  transition-duration: 0.1s;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.photo {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(145deg, #2a1a15, #181210 55%, #100e0c);
  position: relative;
  overflow: hidden;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease-out);
}
.photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(10, 12, 11, 0.55), transparent);
  pointer-events: none;
}

.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
  background: rgba(10, 12, 11, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.body {
  padding: 13px 13px 15px;
}
.price {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 5px;
  color: #fff;
}
.title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 5px;
  line-height: 1.25;
}
.addr {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}
.meta {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  background: var(--accent-dim);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(166, 64, 40, 0.18);
}

.cta {
  margin-top: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  transition: color 0.2s ease, gap 0.22s var(--ease-out);
}
.cta-btn {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.cta-btn:active .cta-arrow {
  transform: translateX(4px);
}
.cta-arrow {
  display: inline-block;
  transition: transform 0.22s var(--ease-spring);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 16px;
  font-weight: 600;
}

.map-shell {
  flex: none;
  height: var(--map-h);
  min-height: var(--map-h-min);
  position: relative;
  z-index: 2;
  overflow: hidden;
  transition: none;
}
.app.is-map-snapping .map-shell {
  transition: height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.map-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--map-h-max);
  min-height: var(--map-h-max);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  background: #1a1411;
}
.map-canvas { width: 100%; height: 100%; }
.map-hint {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  background: rgba(11, 10, 9, 0.78);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.map-strip-btn {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 8;
  border: 0;
  margin: 0;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(90deg, #1c1411, #2a1812 45%, #1c1411);
  color: #f0eae4;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  letter-spacing: 0.01em;
}
.map-strip-pin { font-size: 15px; line-height: 1; }
.map-strip-chevron { opacity: 0.75; font-size: 12px; margin-left: 2px; }

.app.is-map-collapsed .map-panel {
  opacity: 0;
  pointer-events: none;
}
.app.is-map-collapsed .map-strip-btn {
  display: flex;
}
.app.is-map-collapsed .map-shell {
  border-radius: 14px;
}

.list-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 calc(18px + var(--safe-bottom));
  overscroll-behavior: contain;
}
.list-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 8px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(11, 10, 9, 0.96), rgba(11, 10, 9, 0.82) 75%, transparent);
}
.list-bar .count { margin: 0; animation: none; }
.place-clear {
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.place-banner {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(166, 64, 40, 0.28);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

.sheet[hidden] { display: none !important; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
.sheet.is-open { pointer-events: auto; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sheet.is-open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  max-height: min(58vh, 520px);
  background: #14100e;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(110%);
  transition: transform 0.32s var(--ease-out);
  display: flex;
  flex-direction: column;
  padding: 0 12px calc(12px + var(--safe-bottom));
  max-width: 720px;
  margin: 0 auto;
}
.sheet.is-open .sheet-panel { transform: translateY(0); }
.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  margin: 10px auto 8px;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 10px;
}
.sheet-title { font-size: 16px; font-weight: 800; }
.sheet-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.sheet-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.sheet-feed {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 4px;
  position: relative;
  z-index: 1;
}
.sheet-feed .card {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(166, 64, 40, 0.25);
}

.geo-pin {
  position: relative;
  transform: translate(-50%, -100%);
  color: var(--accent);
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4));
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), color 0.15s ease;
}
.geo-pin-svg { display: block; }
.geo-pin-count {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #fff;
  color: #1a100e;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(166, 64, 40, 0.4);
}
.geo-pin.is-active {
  color: #e8896e;
  transform: translate(-50%, -100%) scale(1.15);
  filter: drop-shadow(0 0 0 1px rgba(232, 137, 110, 0.35)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
  z-index: 2;
}

@media (hover: none) {
  .card:active {
    transform: scale(0.97);
    border-color: rgba(166, 64, 40, 0.35);
  }
}
