:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #5d6862;
  --line: #d9dfdb;
  --panel: #ffffff;
  --wash: #f4f1ea;
  --accent: #27695f;
  --accent-dark: #164c45;
  --gold: #c8912d;
  --clay: #bb5b3f;
  --sky: #4b7d9d;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--wash);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #102822;
  color: #f8fbf8;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.4rem);
}

h3 {
  font-size: 1.05rem;
}

.search-panel {
  display: grid;
  gap: 10px;
}

label {
  color: #d7e4de;
  font-size: 0.9rem;
  font-weight: 700;
}

.search-row {
  display: grid;
  gap: 10px;
}

.property-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.property-inputs label {
  display: grid;
  gap: 6px;
  color: #d7e4de;
  font-size: 0.78rem;
}

.cost-field {
  display: grid;
  gap: 6px;
  color: #d7e4de;
  font-size: 0.82rem;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

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

.hint {
  margin: 0;
  color: #adc1ba;
  font-size: 0.82rem;
  line-height: 1.4;
}

.data-status {
  margin: 0;
  color: #f1d79a;
  font-size: 0.82rem;
  line-height: 1.4;
}

.metric-stack {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.metric-stack article {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.metric-stack span,
.confidence span,
.fact-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-stack span {
  color: #bbccc6;
}

.metric-stack strong {
  color: #fff;
  font-size: 1.55rem;
}

.workspace {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.topbar,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.confidence {
  min-width: 150px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: #fff;
}

.confidence strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
}

.property-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
}

.property-card,
.map-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.property-photo {
  min-height: 210px;
  background:
    linear-gradient(135deg, rgba(23, 32, 29, 0.12), rgba(23, 32, 29, 0)),
    url("https://images.unsplash.com/photo-1564013799919-ab600027ffc6?auto=format&fit=crop&w=1200&q=80")
      center/cover;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.fact-grid div {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 14px;
  background: #fff;
}

.fact-grid strong {
  font-size: 1.05rem;
}

.map-panel {
  position: relative;
  min-height: 332px;
  padding: 18px;
}

.map-label {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 18px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 29, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
}

.map-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 296px;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px) 0 0 /
      72px 72px,
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px) 0 0 / 72px
      72px,
    #cfd8cf;
}

.road {
  position: absolute;
  height: 18px;
  border-radius: 99px;
  background: #edf0ed;
  transform-origin: center;
}

.pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(23, 32, 29, 0.22);
  transform: translate(-50%, -50%);
}

.pin.subject {
  width: 40px;
  height: 40px;
  background: var(--clay);
}

.pin.comp {
  background: var(--sky);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover {
  background: #eef3f0;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

td {
  font-size: 0.92rem;
}

.rehab-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.rehab-item {
  display: grid;
  gap: 8px;
}

.rehab-item header,
.rehab-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rehab-item header {
  font-weight: 800;
}

.rehab-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

input[type="range"] {
  min-height: 22px;
  padding: 0;
  accent-color: var(--accent);
}

@media (max-width: 980px) {
  .app-shell,
  .property-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .sidebar,
  .workspace {
    padding: 18px;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .property-inputs {
    grid-template-columns: 1fr;
  }
}
