:root {
  --bg: #ffffff;
  --surface: #f2f7f6;
  --line: #d7e4e1;
  --text: #14211f;
  --muted: #52615e;
  --accent: #01b49f;
  --danger: #ef4444;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1716; --surface: #18221f; --line: #2a3734; --text: #e7efed; --muted: #9db0ac; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, sans-serif; }
header { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
header h1 { font-size: 17px; margin: 0; flex: 1; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
section { background: var(--surface); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.note { color: var(--muted); font-size: 13px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
textarea { font-family: ui-monospace, monospace; font-size: 12px; width: 100%; }
#boundary-map { height: 440px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.map-tools { display: flex; gap: 8px; align-items: end; margin-bottom: 8px; }
.map-tools label { flex: 1; }
.search-results { max-height: 180px; overflow: auto; margin: -4px 0 10px; }
.search-result { width: 100%; text-align: left; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 0; }
details { display: flex; flex-direction: column; gap: 8px; }
button { font: inherit; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--accent); color: #fff; cursor: pointer; align-self: end; }
button.secondary { background: var(--line); color: var(--text); }
button.danger { background: var(--danger); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
form { display: flex; flex-direction: column; gap: 10px; }
form.grid { display: grid; }
label.inline { flex-direction: row; align-items: center; gap: 8px; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
th, td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
td pre { margin: 0; white-space: pre-wrap; font-size: 11px; max-width: 320px; }
#message { min-height: 1.5em; }
#message.error { color: var(--danger); }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; max-width: 360px; box-shadow: 0 16px 48px rgb(0 0 0 / 0.28); }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
dialog form { align-items: end; }
@media (max-width: 600px) { th:nth-child(5), td:nth-child(5) { display: none; } }
