.pmi {
  --ink: #111418;
  --muted: #5F6A73;
  --line: #DEDAD2;
  --card: #ffffff;
  --green: #3D7A6F;
  --green-ink: #ffffff;
  --gold: #B8924A;
  --danger: #8c2f2f;
  --shadow: none;
  --serif: "Lora", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
.pmi button, .pmi input, .pmi select { font: inherit; }
.pmi h2 { margin: 0 0 8px; font-size: 20px; font-weight: 500; }
.lede, .hint, .field-note, .foot p { color: var(--muted); }
.lede { max-width: 68ch; margin: 0 0 22px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}
.pmi .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: clamp(20px, 3vw, 32px);
}
.map-card { display: flex; flex-direction: column; }
.pmi #map {
  flex: 1;
  min-height: 480px;
  margin-top: 12px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: #F0EDE6;
  overflow: hidden;
}
#map .maplibregl-map { height: 100%; min-height: 480px; }
.search-row, .locate-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-row { margin-top: 6px; }
.search-row input { flex: 1; min-width: 180px; margin-top: 0; }
.locate-row { margin-top: 8px; }
#use-my-location {
  border: 1px solid #111418;
  background: transparent;
  color: #111418;
  border-radius: 2px;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 500;
  cursor: pointer;
}
#use-my-location:hover { background: #111418; color: #fff; }
.search-results { list-style: none; margin: 8px 0 0; padding: 0; }
.search-results li { margin: 0; }
.search-results button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 8px 0;
  cursor: pointer;
  color: var(--ink);
}
.search-results button span { color: var(--muted); font-size: 12px; }
.research-failure { white-space: pre-line; color: var(--danger); font-weight: 650; }
details summary { cursor: pointer; font-weight: 700; }
details .pair, details label { margin-top: 12px; }
.pmi label { display: block; margin-top: 14px; font-size: 15px; font-weight: 500; }
.pmi input, .pmi select {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}
.pmi input:focus, .pmi select:focus, .pmi button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 0;
}
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-note, .hint, .readout { margin: 8px 0 0; font-size: 13px; }
.readout { font-weight: 650; color: var(--ink); }
.actions { display: flex; align-items: center; gap: 16px; margin: 18px 0 28px; }
#generate, #use-test-location {
  border: 0;
  cursor: pointer;
}
#generate {
  background: var(--green);
  color: var(--green-ink);
  min-height: 52px;
  padding: 0 24px;
  border-radius: 2px;
  font-weight: 500;
}
#generate:disabled { cursor: wait; opacity: 0.55; }
#use-test-location {
  margin-top: 10px;
  background: transparent;
  color: var(--green);
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}
.form-error { margin: 0; color: var(--danger); font-weight: 650; }
.result { margin-bottom: 28px; }
.result-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.status {
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #efe7d6;
  font-size: 13px;
  font-weight: 700;
}
.status.completed { background: #e5f0e6; color: var(--green); }
.status.failed { background: #f8e6e6; color: var(--danger); }
.job-id { margin: 8px 0 0; color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.facts { width: 100%; border-collapse: collapse; margin-top: 16px; }
.facts th, .facts td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { width: 42%; color: var(--muted); font-weight: 600; }
.evidence-wrap { overflow-x: auto; margin-top: 12px; }
.evidence { width: 100%; border-collapse: collapse; font-size: 14px; }
.evidence th, .evidence td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.evidence th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.market-evidence { margin-top: 8px; }
.market-evidence h2 { font-family: Fraunces, serif; font-size: 28px; margin: 8px 0; }
.calc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.calc article {
  padding: 12px;
  border-radius: 12px;
  background: #f7f3ea;
}
.calc span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.calc strong { display: block; margin-top: 4px; font-family: var(--serif); font-size: 22px; font-weight: 560; }
.checklist { margin: 16px 0 0; padding: 0; list-style: none; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.limitations { margin: 8px 0 0; padding-left: 18px; }
.location-narrative, .location-research { margin-top: 22px; }
.location-narrative h2, .location-research h2 { font-family: var(--serif); font-size: 28px; font-weight: 560; }
.narrative-block { margin-top: 14px; }
.narrative-block h3 { margin: 0 0 6px; font-size: 16px; }
.fact-line, .interpretation { margin: 6px 0; }
.fact-label, .interp-label {
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fact-label { color: var(--green); }
.interp-label { color: var(--gold); }
.interpretation { padding-left: 10px; border-left: 3px solid var(--gold); }
.cited-place { margin: 0 0 12px; }
.ai-unavailable { margin: 8px 0 0; color: var(--danger); font-weight: 650; }
.place-group { margin: 14px 0 0; }
.place-group h3 { margin: 0 0 6px; font-size: 16px; }
.places { margin: 0; padding-left: 18px; }
.places li { margin: 0 0 10px; }
.pmi .page-note { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.noscript { width: min(1280px, calc(100% - 40px)); margin: 12px auto; color: #8c2f2f; }

@media (max-width: 860px) {
  .pmi .layout, .pmi .pair, .pmi .calc { grid-template-columns: 1fr; }
  .pmi #map, .pmi #map .maplibregl-map { min-height: 280px; }
}
