:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #e8d8cf;
  color: #1b1a17;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: clamp(14px, 3vw, 32px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.panel {
  width: min(100%, 1080px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a3328;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  font-weight: 760;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid #1b1a17;
  background: #fffdf8;
  color: #1b1a17;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-button[aria-pressed="false"] {
  color: #77716b;
  border-color: #bdb1a9;
}

.eye-shape {
  position: relative;
  width: 24px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.eye-shape::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.icon-button[aria-pressed="false"] .eye-shape::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 2px;
  background: currentColor;
  left: -4px;
  top: 5px;
  transform: rotate(-32deg);
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  padding: 12px;
  background: #fffdf8;
  border: 1px solid #e4ddd6;
  align-items: end;
}

label {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

label span {
  white-space: nowrap;
  font-weight: 650;
}

input {
  min-width: 0;
  height: 38px;
  border: 1px solid #9e9891;
  padding: 0 12px;
  background: #ffffff;
  color: #171513;
}

.suggestions {
  position: absolute;
  left: calc(100% - (100% - 74px));
  right: 0;
  top: calc(100% + 4px);
  z-index: 800;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #b8aca2;
  background: #fffdf8;
  box-shadow: 0 14px 34px rgba(34, 27, 21, 0.18);
}

.suggestions.is-hidden {
  display: none;
}

.suggestion-button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eee6df;
  background: transparent;
  color: #1b1a17;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.suggestion-button:hover,
.suggestion-button:focus {
  background: #f2ebe4;
  outline: none;
}

.suggestion-title {
  display: block;
  font-size: 13px;
  font-weight: 750;
}

.suggestion-meta {
  display: block;
  margin-top: 2px;
  color: #73685f;
  font-size: 12px;
  line-height: 1.25;
}

.primary-button {
  height: 38px;
  border: 1px solid #1b1a17;
  background: #1b1a17;
  color: #fffdf8;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}

.result-bar {
  min-height: 34px;
  padding: 7px 12px;
  background: #fffdf8;
  border-inline: 1px solid #e4ddd6;
  border-bottom: 2px solid #d71920;
  font-size: 16px;
}

.map-wrap {
  position: relative;
  height: clamp(560px, 68vh, 760px);
  min-height: 0;
  overflow: hidden;
  background: #eef6f8;
  border: 1px solid #e4ddd6;
  border-top: 0;
}

#map {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 0;
  width: 100%;
  background: #eef6f8;
  z-index: 1;
}

.maplibregl-map {
  background: #eef6f8;
}

.maplibregl-canvas {
  outline: none;
}

.map-loading {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 450;
  padding: 7px 10px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(27, 26, 23, 0.12);
  color: #5d534b;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(34, 27, 21, 0.12);
  pointer-events: none;
}

.map-loading.is-hidden {
  display: none;
}

.facade-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100% - 34px));
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: translate(-50%, -50%);
  z-index: 500;
  pointer-events: none;
}

.facade-card.is-hidden {
  display: none;
}

.facade-wheel {
  position: relative;
  width: min(460px, 82vw, 62vh);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 2px solid rgba(27, 26, 23, 0.78);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.1);
  box-shadow: 0 18px 42px rgba(34, 27, 21, 0.16);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.facade-wheel:active {
  cursor: grabbing;
}

.facade-wheel::before,
.facade-wheel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.facade-wheel::before {
  inset: 18%;
  border: 1px solid rgba(27, 26, 23, 0.58);
  background: rgba(255, 253, 248, 0.1);
}

.facade-wheel::after {
  inset: 37%;
  border: 2px solid rgba(27, 26, 23, 0.7);
  background: rgba(255, 253, 248, 0.1);
}

.sector-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.sector-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  margin-left: -27px;
  margin-top: -8px;
  color: rgba(27, 26, 23, 0.92);
  font-size: clamp(9px, 1.6vw, 13px);
  font-weight: 800;
  line-height: 1;
  text-align: center;
  transform: rotate(var(--angle)) translateY(clamp(-196px, -35vw, -130px)) rotate(calc(-1 * var(--angle)));
}

.sector-spoke {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 1px;
  height: 50%;
  background: rgba(27, 26, 23, 0.52);
  transform: rotate(var(--angle));
  transform-origin: bottom center;
}

.facade-line {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 3px;
  height: 45%;
  background: #ef2d32;
  transform-origin: bottom center;
  transform: rotate(var(--facade-bearing, 0deg));
  z-index: 4;
  pointer-events: none;
}

.facade-line::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 86%;
  background: #ef2d32;
  transform: translateX(-50%) rotate(90deg);
  transform-origin: bottom center;
}

.facade-handle {
  position: absolute;
  left: 50%;
  top: -24px;
  min-width: 46px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #ef2d32;
  color: #fffdf8;
  font-size: 14px;
  font-weight: 800;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: grab;
}

.facade-handle:active {
  cursor: grabbing;
}

.facade-handle::after {
  content: "deg";
  margin-left: 2px;
  font-size: 9px;
  font-weight: 700;
}

.facade-cross {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  background: rgba(27, 26, 23, 0.34);
  pointer-events: none;
}

.facade-cross-x {
  width: 100%;
  height: 1px;
  transform: translate(-50%, -50%);
}

.facade-cross-y {
  width: 1px;
  height: 100%;
  transform: translate(-50%, -50%);
}

.center-dot {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d71920;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.facade-wheel > span {
  position: absolute;
  font-size: 15px;
  font-weight: 800;
  color: #d71920;
  z-index: 3;
}

.north {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.east {
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.south {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.west {
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

dl {
  width: min(300px, 86vw);
  margin: 10px auto 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(27, 26, 23, 0.16);
  box-shadow: 0 12px 28px rgba(34, 27, 21, 0.15);
  pointer-events: auto;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #e3d8cf;
  padding-top: 8px;
}

dt {
  color: #766b62;
}

dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.note {
  margin: 10px 0 0;
  color: #5d534b;
  font-size: 14px;
}

.maplibregl-ctrl-attrib {
  font-size: 10px;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
    place-items: start center;
  }

  .panel-header {
    align-items: center;
  }

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

  label {
    grid-template-columns: 74px 1fr;
  }

  .primary-button {
    width: 100%;
  }

  #map,
  .map-wrap {
    height: 62vh;
    min-height: 500px;
  }

  .facade-card {
    width: calc(100% - 20px);
  }
}
