:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --line: #dbe3ee;
  --text: #162235;
  --sub: #5d6b7c;
  --accent: #1b67d8;
  --accent-2: #19a463;
  --surface-soft: #f7faff;
  --surface-contrast: #eef4fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Segoe UI, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.top {
  padding: 20px 24px 8px;
}

h1 {
  margin: 0;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--sub);
}

.path-steps {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.path-step {
  font-size: 12px;
  color: #355072;
  background: #e9f0fb;
  border: 1px solid #cad8ee;
  border-radius: 999px;
  padding: 4px 10px;
}

.path-step.is-active {
  background: #1769e0;
  border-color: #1769e0;
  color: #fff;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 12px 24px 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.04);
}

.lead label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--sub);
}

input,
select,
textarea,
button {
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font: inherit;
}

button {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  border: none;
}

button.ghost {
  background: #e9eef7;
  color: #1f2a37;
}

.cian-filters {
  margin: 8px 24px 0;
  padding: 10px 12px;
}

.filters-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filters-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.filter-toggle {
  width: auto;
  margin: 0;
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.cian-filters.collapsed .filters-body {
  display: none;
}

.filters-body {
  margin-top: 10px;
}

.filter-row.main {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.filter-row.extra {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(180px, 240px) auto;
  gap: 8px;
  align-items: end;
}

.filter-cell {
  display: block;
  margin: 0;
  font-size: 12px;
  color: var(--sub);
}

.filter-cell.grow {
  min-width: 220px;
}

.field-location {
  min-width: 260px;
}

.filter-cell input,
.filter-cell select {
  margin-top: 4px;
  height: 36px;
}

.show-button {
  width: auto;
  min-width: 94px;
  height: 36px;
  margin: 0;
  padding: 0 14px;
  background: #18a94b;
}

.reset-button {
  width: auto;
  height: 36px;
  margin: 0;
  padding: 0 12px;
}

.quick-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  width: auto;
  border-radius: 999px;
  border: 1px solid #b7cbeb;
  background: #f0f5ff;
  color: #25436b;
  padding: 5px 10px;
  margin: 0;
  font-size: 12px;
}

.chip.active {
  background: #1769e0;
  color: #fff;
  border-color: #1769e0;
}

.active-filters {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.active-filter-item {
  font-size: 12px;
  background: #eff3f9;
  border: 1px solid #d5dfec;
  border-radius: 999px;
  padding: 4px 8px;
  color: #334963;
}

.content-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #e5eaf0;
}

.card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

.card-link,
.card-apply,
.card-compare {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 8px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border: 1px solid #cfd8e6;
  background: #fff;
  color: #1f2a37;
  cursor: pointer;
}

.card-link {
  color: #1f2a37;
  background: #fff;
}

.card-apply {
  color: #fff;
  background: #1769e0;
  border-color: #1769e0;
}

.card-compare.is-active {
  color: #1769e0;
  border-color: #1769e0;
  background: #eef4ff;
}

.card-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.small {
  color: var(--sub);
  font-size: 13px;
  margin-bottom: 4px;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #edf3ff;
  color: #1f4b9e;
}

.detail .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.detail .gallery img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.params-wrap {
  border: 1px solid #dde6f2;
  border-radius: 12px;
  background: #fcfdff;
}

.params-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5ecf5;
  background: #f5f9ff;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.params-count {
  font-size: 12px;
  color: #415b7f;
  font-weight: 600;
}

.params-toggle {
  width: auto;
  margin: 0;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #c4d6ee;
  background: #fff;
  color: #25426a;
  font-size: 12px;
  font-weight: 600;
}

.params {
  position: relative;
}

.params.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  background: linear-gradient(to bottom, rgba(252, 253, 255, 0), rgba(252, 253, 255, 1));
  pointer-events: none;
}

.compare-selected-note {
  background: #edf4ff;
  border: 1px solid #c7daf9;
  color: #23426c;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 8px;
}

.param-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f8;
  font-size: 13px;
  line-height: 1.4;
}

.params .param-row:last-child {
  border-bottom: none;
}

.params.is-collapsed .param-row.is-extra {
  display: none;
}

.param-key {
  font-weight: 600;
  color: #304b6d;
}

.param-value {
  color: #1e324f;
}

.placeholder {
  color: var(--sub);
}

.flow-state {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 10px;
  font-size: 13px;
}

.flow-state.is-empty {
  background: #fff4f1;
  border: 1px solid #f2cdc3;
  color: #8b3d2e;
}

.flow-state.is-warning {
  background: #fff9ea;
  border: 1px solid #f2dfaa;
  color: #7a5b17;
}

.flow-state.is-ready {
  background: #edf8ef;
  border: 1px solid #c8e8d0;
  color: #245f32;
}

.lead,
.metrics {
  margin: 0 24px 14px;
}

.compare-bar {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  bottom: 12px;
  z-index: 10;
}

.compare-text {
  font-size: 14px;
  color: #1f2a37;
}

.compare-count {
  font-size: 13px;
  color: #355072;
  background: #eef3fb;
  border: 1px solid #d4e0f3;
  border-radius: 999px;
  padding: 4px 10px;
}

.compare-primary {
  width: auto;
  padding: 0 14px;
  height: 34px;
}

.compare-clear {
  width: auto;
  height: 34px;
  padding: 0 12px;
}

.compare-panel {
  margin: 0;
  border-color: #cdd9ea;
}

.compare-actions {
  margin: 8px 0 6px;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.compare-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e4ecf6;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
  table-layout: auto;
  min-width: max-content;
}

.compare-table th,
.compare-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.compare-table th {
  background: var(--surface-soft);
}

.compare-table thead th {
  font-weight: 700;
  color: #1f3553;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.compare-table th:first-child,
.compare-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f7f9fc;
}

.compare-table td:first-child {
  z-index: 1;
  background: #fff;
  font-weight: 600;
  color: #2a3f5b;
}

.compare-col-param {
  width: 190px;
}

.compare-col-lot {
  width: 240px;
}

#compareTableWrap {
  overflow-x: auto;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
}

.compare-lot-head {
  font-weight: 700;
  margin-bottom: 2px;
  font-size: 14px;
  color: #173a69;
}

.compare-lot-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.compare-lot-address {
  font-size: 13px;
  color: #2e4766;
  line-height: 1.3;
  max-width: 280px;
}

.compare-recommend-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 7px;
  background: #0f6a2f;
  color: #fff;
  white-space: nowrap;
}

.compare-best {
  background: #e8f2ff;
  border-color: #a9c8f1;
  font-weight: 600;
}

.compare-recommend {
  background: #edf8f2;
  border-color: #9bd9b5;
}

.compare-lot-col.compare-recommend {
  box-shadow: inset 0 0 0 2px #5bb87a;
}

.compare-recommend-link {
  background: #109049;
  border-color: #109049;
}

.compare-panel-full .compare-lot-address {
  display: block;
  white-space: normal;
  overflow: visible;
  max-width: none;
}

.compare-panel-full .compare-col-lot {
  width: 270px;
}

.compare-panel-full .compare-table {
  table-layout: auto;
}

.lead-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.lead-grid .wide {
  grid-column: 1 / -1;
}

.lead-message {
  margin-top: 8px;
  color: #236f2a;
}

.stats {
  margin-top: 10px;
  font-size: 13px;
  color: var(--sub);
}

.lot-layout {
  padding: 16px 24px 20px;
}

.lot-topbar {
  margin-bottom: 14px;
}

.lot-back {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #2b4d7a;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.lot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.lot-aside {
  position: sticky;
  top: 12px;
}

.aside-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.04);
}

.aside-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aside-price-card {
  margin-bottom: 10px;
}

.aside-caption {
  font-size: 11px;
  color: #4a6384;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.aside-price {
  font-size: 36px;
  line-height: 1.1;
  font-weight: 700;
  color: #132845;
}

.aside-sub {
  color: #334f74;
  font-size: 14px;
}

.aside-facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #e7ebf0;
}

.aside-fact {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.aside-fact-key {
  color: var(--sub);
}

.aside-fact-value {
  color: #1f2a37;
  text-align: right;
}

.aside-cta {
  margin-top: 0;
  height: 38px;
  width: 100%;
  border-radius: 8px;
  background: #1769e0;
  color: #fff;
  font-weight: 600;
}

.aside-action {
  border-top: 1px solid #e7ebf0;
  padding-top: 10px;
}

.aside-action-lot {
  margin-top: 6px;
  font-size: 12px;
  color: #4b6380;
}

.aside-form {
  margin-top: 4px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
}

.aside-form.hidden {
  display: none;
}

.hidden {
  display: none;
}

.aside-form-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.aside-form-lot {
  font-size: 12px;
  color: #4d627c;
  margin-bottom: 10px;
}

.aside-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.aside-form label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  color: var(--sub);
}

.aside-form input,
.aside-form textarea {
  margin-top: 4px;
  padding: 7px 8px;
  font-size: 13px;
}

.aside-form button {
  margin-top: 7px;
  height: 34px;
}

.lot-gallery {
  border: 1px solid #dce5f2;
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px;
}

.lot-gallery-view {
  display: grid;
  gap: 10px;
}

.lot-gallery-main-wrap {
  border: 1px solid #d6e3f4;
  border-radius: 10px;
  overflow: hidden;
  background: #eef3fb;
}

.lot-gallery-main-image {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.lot-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.lot-gallery-thumb {
  margin: 0;
  width: 100%;
  padding: 0;
  border-radius: 8px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.lot-gallery-thumb img {
  width: 100%;
  height: 68px;
  object-fit: cover;
  display: block;
  border: 1px solid #d8e1ed;
}

.lot-gallery-thumb.is-active {
  border-color: #1769e0;
}

.lot-main-panel {
  padding: 18px;
}

.lot-anchor-nav {
  position: sticky;
  top: 8px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #d7e3f3;
  border-radius: 10px;
  background: #f8fbff;
}

.lot-anchor-link {
  text-decoration: none;
  color: #2b4d7a;
  font-size: 13px;
  border: 1px solid #cad8ec;
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
}

.lot-anchor-link.is-active {
  color: #fff;
  border-color: #1769e0;
  background: #1769e0;
}

.lot-hero {
  border-bottom: 1px solid #e7edf5;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.lot-id {
  font-size: 12px;
  color: #4a6384;
  margin-bottom: 6px;
}

.lot-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  color: #14253b;
}

.lot-subline {
  margin-top: 6px;
  font-size: 13px;
  color: #4c6483;
}

.lot-meta-chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lot-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d7e3f3;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  color: #294569;
  background: #f5f9ff;
}

.lot-overview-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lot-overview-item {
  border: 1px solid #dce7f5;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}

.lot-overview-key {
  font-size: 12px;
  color: #516a8b;
  margin-bottom: 4px;
}

.lot-overview-value {
  font-size: 14px;
  color: #183354;
  font-weight: 600;
  line-height: 1.35;
}

.lot-section {
  margin-top: 14px;
}

.lot-section-title {
  margin: 0 0 8px;
  font-size: 16px;
  color: #1a2f4c;
}

.lot-highlights {
  display: grid;
  gap: 8px;
}

.lot-highlight-item {
  border: 1px solid #dde6f2;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fafcff;
}

.lot-highlight-key {
  font-size: 12px;
  color: #4f6481;
  margin-bottom: 3px;
}

.lot-highlight-value {
  font-size: 13px;
  color: #1b2f4a;
  line-height: 1.35;
}

.lot-headline {
  padding: 12px 24px 0;
}

.lot-layout-cian {
  padding-top: 8px;
}

.lot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.lot-main-panel {
  padding: 12px;
}

.lot-gallery-main-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #cddaea;
  background: rgba(255, 255, 255, 0.95);
  color: #1f3553;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  z-index: 2;
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

.gallery-counter {
  position: absolute;
  right: 12px;
  bottom: 10px;
  background: rgba(17, 33, 51, 0.75);
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.cian-param-row {
  grid-template-columns: minmax(220px, 320px) 1fr;
  border-bottom-style: dashed;
  border-bottom-color: #dde6f2;
}

.lot-location-card {
  border: 1px solid #dce5f2;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.lot-location-address {
  font-size: 15px;
  color: #17395f;
  font-weight: 600;
}

.lot-location-sub {
  margin-top: 6px;
  color: #456184;
  font-size: 13px;
}

.lot-map {
  margin-top: 10px;
  height: 340px;
  border: 1px solid #d6e2f1;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f7ff;
}

.lot-map.is-empty {
  display: none;
}

.lot-map-state {
  margin-top: 8px;
  color: #4a6485;
  font-size: 12px;
}

.lot-offer-head {
  margin-top: 0;
}

.lot-only-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ebf4ff;
  color: #1769e0;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.lot-title-address {
  margin-top: 4px;
  font-size: 38px;
  line-height: 1.05;
  color: #1162d6;
  font-weight: 700;
}

.lot-short-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.lot-mini-btn {
  width: auto;
  margin: 0;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #ccdbef;
  background: #fff;
  color: #1b3658;
  font-size: 12px;
  font-weight: 600;
}

.lot-mini-btn.is-active {
  border-color: #1769e0;
  background: #eaf2ff;
  color: #0f4aa7;
}

.lot-icon-favorite {
  width: 30px;
  height: 30px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid #ccdbef;
  background: #fff;
  color: #355174;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.lot-icon-favorite.is-active {
  border-color: #f2c94c;
  color: #d89b00;
  background: #fff8dc;
}

.lot-aside {
  position: sticky;
  top: 12px;
}

.aside-contact-name {
  font-size: 14px;
  color: #1a3658;
  font-weight: 600;
}

.aside-phone {
  font-size: 20px;
  line-height: 1.2;
  color: #163252;
  font-weight: 700;
}

.aside-contact-hint {
  font-size: 12px;
  color: #4e6787;
}

.aside-contact-card .aside-cta {
  background: #1769e0;
  color: #fff;
  border: 1px solid #1769e0;
}

.aside-company-card {
  background: #f7fbff;
}

.aside-company-name {
  font-size: 24px;
  font-weight: 800;
  color: #1957a7;
  line-height: 1.1;
}

.aside-company-rating {
  font-size: 13px;
  color: #39587f;
}

.aside-company-meta {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.aside-company-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #355172;
}

@media (max-width: 1200px) {
  .filter-row.main {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-row.extra {
    grid-template-columns: repeat(2, 1fr);
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .lot-grid {
    grid-template-columns: 1fr;
  }

  .lot-title {
    font-size: 22px;
  }

  .lot-main-panel {
    padding: 14px;
  }

  .lot-headline {
    padding: 10px 16px 0;
  }

  .lot-overview-grid {
    grid-template-columns: 1fr;
  }

  .lot-gallery-main-image {
    height: 320px;
  }

  .lot-title-address {
    font-size: 28px;
  }

  .aside-form-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .params-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .param-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .compare-col-param {
    width: 170px;
  }

  .compare-col-lot {
    width: 190px;
  }
}
