:root {
  --ink: #14213d;
  --muted: #4a5672;
  --line: #d9e0ea;
  --surface: #ffffff;
  --page: #f4f7fb;
  --accent: #0b7a75;
  --accent-dark: #075e5a;
  --marker: #ef5d47;
  --error: #b42318;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(20, 33, 61, 0.16);
  --font-text: 'Onest', system-ui, sans-serif;
  --font-title: 'Zen Old Mincho', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--surface);
  border-radius: 8px;
}

.skip-link:focus {
  top: 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100%;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 24px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.panel__eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel__title {
  margin: 0 0 10px;
  font-family: var(--font-title);
  font-size: 32px;
  line-height: 1.15;
}

.panel__lead {
  margin: 0;
  color: var(--muted);
}

.filters {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: 14px;
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

select,
input[type='number'] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

select:focus-visible,
input:focus-visible,
button:focus-visible,
.button:focus-within {
  outline: 3px solid rgba(11, 122, 117, 0.45);
  outline-offset: 2px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.button--primary {
  background: var(--accent);
  color: var(--surface);
}

.button--primary:hover {
  background: var(--accent-dark);
}

.button--ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button--ghost:hover {
  border-color: var(--accent);
}

.status,
.count {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.status--error {
  color: var(--error);
  font-weight: 600;
}

.count {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.results {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result__button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.result__button:hover {
  border-color: var(--accent);
}

.result__title {
  font-weight: 600;
}

.result__price {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--accent-dark);
  font-weight: 600;
}

.result__meta,
.result--more {
  color: var(--muted);
  font-size: 14px;
}

.stage {
  position: relative;
  min-height: 0;
}

.map {
  position: absolute;
  inset: 0;
}

.card {
  position: absolute;
  right: 20px;
  bottom: 28px;
  z-index: 2;
  width: min(360px, calc(100% - 40px));
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card[hidden] {
  display: none;
}

.card__visual {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 120px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0b7a75, #14213d);
  color: var(--surface);
}

.card__visual--villa,
.card__visual--house {
  background: linear-gradient(135deg, #ef5d47, #a3293f);
}

.card__visual--office {
  background: linear-gradient(135deg, #2f5fd0, #14213d);
}

.card__visual--land {
  background: linear-gradient(135deg, #2c9a5b, #0b5a4a);
}

.card__visual svg {
  width: 64px;
  height: 64px;
  fill: currentColor;
  opacity: 0.92;
}

.card__type {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card__body {
  padding: 16px 18px 6px;
}

.card__title {
  margin: 0 0 4px;
  font-family: var(--font-title);
  font-size: 22px;
  line-height: 1.25;
}

.card__place,
.card__address {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card__price {
  margin: 10px 0 8px;
  color: var(--accent-dark);
  font-size: 24px;
  font-weight: 600;
}

.card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.card__facts li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--page);
  font-size: 14px;
}

.card__close {
  width: calc(100% - 36px);
  min-height: 44px;
  margin: 8px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.estate-popup {
  display: grid;
  gap: 2px;
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--ink);
}

.estate-popup span {
  color: var(--accent-dark);
  font-weight: 600;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 58vh auto;
    height: auto;
  }

  .stage {
    grid-row: 1;
    height: 58vh;
  }

  .panel {
    grid-row: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 22px 16px 28px;
    overflow: visible;
  }

  .panel__title {
    font-size: 28px;
  }

  .card {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }

  .card__visual {
    height: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
