:root {
  --bg: #eceff3;
  --panel: #f7f8fa;
  --ink: #121417;
  --muted: #5b6570;
  --line: #c9d0d8;
  --accent: #0f766e;
  --accent-ink: #f4fffd;
  --pin: #ea580c;
  --mapbar: rgba(18, 20, 23, 0.9);
  --font: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

.shell {
  display: grid;
  grid-template-columns: minmax(300px, 22rem) 1fr;
  height: 100%;
  min-height: 100dvh;
}

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

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #f7f8fa;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}
.brand h1 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.03em;
}
.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.search label,
.grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.search-row { display: flex; gap: 6px; }
input, select, textarea, button { font: inherit; color: var(--ink); }
input, select, textarea {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  font-weight: 400;
  width: 100%;
  border-radius: 0;
}
textarea { resize: vertical; min-height: 56px; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: var(--ink);
}

button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #f7f8fa;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 0;
}
button:hover { background: #2a2f36; }
button:active { transform: translateY(1px); }
button.primary {
  width: 100%;
  padding: 12px 14px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-size: 0.95rem;
}
button.primary:hover { background: #0d5e58; }
button.primary:disabled {
  background: #9aa3ad;
  border-color: #9aa3ad;
  cursor: not-allowed;
  transform: none;
}

.hits {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  max-height: 180px;
  overflow: auto;
}
.hits li {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--line);
}
.hits li:hover { background: #e8eef0; }

.block { margin-top: 16px; }
.block h2 {
  margin: 0 0 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.grid { display: grid; gap: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hint { margin: 0; color: var(--muted); font-size: 0.82rem; }
.coords {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  margin-top: 6px;
  white-space: pre-line;
  line-height: 1.45;
}

.zone-list { display: grid; gap: 0; }
.zone-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.zone-row .sym { font-weight: 600; }
.zone-row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.zone-row .meta { font-size: 0.72rem; color: var(--muted); grid-column: 2 / -1; }
.zone-row.missing .val { color: var(--muted); font-weight: 400; }
.swatch {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(18,20,23,.25);
}

.actions { margin-top: 16px; }
.legal {
  margin: 12px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.map-wrap { position: relative; min-width: 0; height: 100%; min-height: 280px; }
#map { position: absolute; inset: 0; background: #c5ccd3; }
.map-bar {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.map-bar > * { pointer-events: auto; }
.basemap, .overlays {
  display: flex;
  background: var(--mapbar);
  padding: 3px;
  gap: 2px;
}
.basemap button, .overlays button {
  background: transparent;
  border: 0;
  color: #eef1f4;
  padding: 7px 11px;
  font-size: 0.78rem;
}
.basemap button.on, .overlays button.on {
  background: #eef1f4;
  color: var(--ink);
}
.overlays { flex-wrap: wrap; margin-left: auto; max-width: 62%; justify-content: flex-end; }

.leaflet-container { font-family: var(--font); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 48vh 1fr; }
  .panel { border-right: 0; border-top: 1px solid var(--line); order: 2; }
  .map-wrap { order: 1; min-height: 48vh; }
}

@media (prefers-reduced-motion: reduce) {
  button:active { transform: none; }
}
