:root {
  color-scheme: light;
  --bg: oklch(96.5% 0.012 165);
  --surface: oklch(99.3% 0.004 165);
  --surface-soft: oklch(97.8% 0.012 165);
  --surface-strong: oklch(94.5% 0.022 165);
  --ink: oklch(23% 0.035 165);
  --muted: oklch(50% 0.035 165);
  --faint: oklch(65% 0.025 165);
  --line: oklch(88% 0.02 165);
  --line-strong: oklch(79% 0.04 165);
  --teal-900: oklch(34% 0.09 168);
  --teal-700: oklch(43% 0.11 168);
  --teal-500: oklch(62% 0.13 168);
  --teal-soft: oklch(93% 0.04 168);
  --amber: oklch(68% 0.14 62);
  --amber-soft: oklch(95% 0.045 72);
  --danger: oklch(53% 0.15 28);
  --shadow: 0 16px 40px oklch(23% 0.035 165 / 0.09);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:focus-visible {
  outline: 2px solid var(--teal-700);
  outline-offset: 3px;
}

.app-shell {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand > span:last-child {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: end;
  gap: 3px;
  width: 28px;
  height: 28px;
  padding: 5px 6px;
  border-radius: 9px;
  background: var(--teal-700);
}

.brand-mark i {
  display: block;
  width: 4px;
  border-radius: 4px 4px 2px 2px;
  background: oklch(97% 0.02 165);
}

.brand-mark i:nth-child(1) {
  height: 9px;
  opacity: 0.68;
}

.brand-mark i:nth-child(2) {
  height: 14px;
  opacity: 0.84;
}

.brand-mark i:nth-child(3) {
  height: 18px;
  background: oklch(88% 0.09 83);
}

.topbar-context {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.eyebrow {
  margin: 0;
  color: var(--teal-700);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.privacy-note,
.range-note,
.table-count {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 30%) minmax(0, 70%);
}

.control-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 30px clamp(18px, 2.2vw, 32px) 34px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  scrollbar-color: var(--line-strong) transparent;
}

.intro-block {
  max-width: 430px;
}

.intro-block h1 {
  max-width: 390px;
  margin: 9px 0 13px;
  font-size: clamp(27px, 2.8vw, 38px);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.intro-copy {
  max-width: 385px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 25px;
}

.metric-card {
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 9px;
  padding: 14px 15px 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.metric-card.metric-main {
  background: var(--teal-soft);
  border-color: oklch(84% 0.07 168);
}

.metric-card.metric-alert {
  background: var(--amber-soft);
  border-color: oklch(87% 0.08 72);
}

.metric-card.metric-candidate {
  background: #fff7e9;
  border-color: #e8c995;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.metric-card strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.metric-card small {
  min-height: 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.control-section {
  margin-top: 28px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.point-section {
  padding: 18px;
  background: var(--teal-soft);
  border: 1px solid oklch(86% 0.06 168);
  border-radius: var(--radius);
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.section-heading-tight {
  align-items: end;
}

.section-heading h2,
.filters-section summary h2 {
  margin: 5px 0 0;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.provisional-badge,
.status-badge,
.quality-badge,
.normalization-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.provisional-badge {
  color: oklch(46% 0.11 65);
  background: oklch(95% 0.07 72);
  border-color: oklch(84% 0.1 72);
}

.map-address-search {
  position: relative;
  z-index: 20;
  margin-top: 16px;
}

.map-search-field {
  position: relative;
  margin-top: 6px;
}

.map-search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  color: var(--teal-700);
  font-size: 17px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

#map-address-search {
  padding-left: 37px;
  background: var(--surface);
}

.map-search-suggestions {
  position: absolute;
  z-index: 1000;
  top: 72px;
  right: 0;
  left: 0;
  max-height: 264px;
  padding: 5px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.map-search-result {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
}

.map-search-result:hover,
.map-search-result:focus-visible {
  background: var(--teal-soft);
}

.map-search-result span {
  font-size: 12px;
  font-weight: 750;
}

.map-search-result small,
.map-search-source,
.map-search-empty {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.map-search-source {
  margin: 7px 0 0;
}

.map-search-empty {
  margin: 0;
  padding: 11px;
}

.point-address {
  margin: 14px 0 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.hint-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal-500);
  box-shadow: 0 0 0 4px oklch(89% 0.07 168);
}

.coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 17px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 13px;
}

input::placeholder {
  color: var(--faint);
}

input:hover,
select:hover {
  border-color: var(--teal-500);
}

input:focus,
select:focus {
  border-color: var(--teal-700);
  box-shadow: 0 0 0 3px oklch(79% 0.08 168 / 0.26);
  outline: none;
}

.point-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.button,
.map-button,
.radius-preset {
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
}

.button-primary {
  color: oklch(98% 0.02 165);
  background: var(--teal-700);
  border-color: var(--teal-700);
}

.button-primary:hover {
  background: var(--teal-900);
  border-color: var(--teal-900);
}

.button-quiet {
  color: var(--teal-900);
  background: transparent;
  border-color: oklch(77% 0.06 168);
}

.button-quiet:hover {
  background: oklch(97% 0.04 168);
  border-color: var(--teal-500);
}

.coordinate-readout {
  margin: 11px 0 0;
  color: var(--teal-900);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.radius-section {
  display: grid;
  gap: 14px;
}

.radius-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.radius-preset {
  min-height: 38px;
  padding-inline: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
  font-size: 11px;
}

.radius-preset:hover,
.radius-preset.is-active {
  color: var(--teal-900);
  background: var(--teal-soft);
  border-color: var(--teal-500);
}

.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-label output {
  color: var(--teal-700);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  min-height: 22px;
  height: 22px;
  padding: 0;
  accent-color: var(--teal-700);
  background: transparent;
  border: 0;
  box-shadow: none;
}

input[type="range"]:focus {
  box-shadow: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 9px;
  background: var(--line-strong);
}

input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  appearance: none;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--teal-700);
  box-shadow: 0 0 0 1px var(--teal-700);
}

input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 9px;
  background: var(--line-strong);
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--teal-700);
  box-shadow: 0 0 0 1px var(--teal-700);
}

.filters-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  cursor: pointer;
  list-style: none;
}

.filters-section summary::-webkit-details-marker {
  display: none;
}

.summary-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--teal-700);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
}

.filters-section[open] .summary-icon {
  transform: rotate(180deg);
}

.filter-stack {
  display: grid;
  gap: 14px;
  margin-top: 19px;
}

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

.text-link {
  width: fit-content;
  min-height: 32px;
  padding: 4px 0;
  color: var(--teal-700);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: oklch(77% 0.07 168);
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--teal-900);
}

.street-section {
  min-width: 0;
}

.street-table-wrap {
  min-width: 0;
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.street-table {
  min-width: 430px;
}

.street-table-head,
.street-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(50px, 0.45fr) minmax(90px, 0.68fr);
  align-items: center;
  gap: 10px;
  text-align: left;
}

.street-table-head {
  min-height: 32px;
  padding: 0 10px;
  color: var(--faint);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.street-table-head span:nth-child(2),
.street-row > :nth-child(2),
.street-table-head span:nth-child(3),
.street-row > :nth-child(3) {
  text-align: right;
}

.street-row {
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.street-row:last-child {
  border-bottom: 0;
}

.street-row:hover,
.street-row.is-selected {
  background: var(--teal-soft);
}

.street-name {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.street-name strong,
.street-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.street-name strong {
  font-size: 11px;
}

.street-name small {
  color: var(--muted);
  font-size: 10px;
}

.street-people {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.status-badge {
  justify-self: end;
  font-size: 9px;
}

.status-inside {
  color: oklch(39% 0.1 168);
  background: oklch(93% 0.06 168);
  border-color: oklch(82% 0.08 168);
}

.status-partial {
  color: oklch(48% 0.12 65);
  background: oklch(95% 0.07 72);
  border-color: oklch(85% 0.1 72);
}

.status-outside {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
}

.status-unresolved {
  color: oklch(50% 0.08 28);
  background: oklch(95% 0.035 28);
  border-color: oklch(86% 0.06 28);
}

.table-footnote {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.empty-state {
  display: grid;
  gap: 5px;
  padding: 20px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.empty-state strong {
  color: var(--ink);
}

.street-detail {
  display: grid;
  gap: 14px;
  margin-top: 13px;
  padding: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.detail-heading h3 {
  margin: 5px 0 3px;
  font-size: 14px;
  line-height: 1.2;
}

.detail-heading > div > span {
  color: var(--muted);
  font-size: 11px;
}

.icon-button {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface);
}

.detail-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.detail-stats > span:first-child {
  margin-right: auto;
  font-size: 12px;
}

.detail-stats strong {
  font-size: 19px;
  letter-spacing: -0.03em;
}

.quality-badge,
.normalization-badge {
  font-size: 9px;
}

.quality-high,
.normalization-confirmed {
  color: oklch(39% 0.1 168);
  background: oklch(93% 0.06 168);
  border-color: oklch(82% 0.08 168);
}

.quality-medium {
  color: oklch(48% 0.12 65);
  background: oklch(95% 0.07 72);
  border-color: oklch(85% 0.1 72);
}

.quality-low,
.normalization-review {
  color: oklch(50% 0.1 28);
  background: oklch(95% 0.04 28);
  border-color: oklch(86% 0.07 28);
}

.quality-unresolved,
.normalization-neutral {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line-strong);
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.detail-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  text-align: right;
}

.variant-note {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.candidate-note {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  color: #72501e;
  background: #fff8e9;
  border: 1px solid #ecd8ad;
  border-radius: 9px;
  font-size: 10px;
  line-height: 1.4;
}

.candidate-note ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 17px;
}

.candidate-note small {
  color: #806638;
  font-size: 9px;
}

.quality-note {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 10px;
  margin-top: 27px;
  padding: 15px 0 0;
  border-top: 1px solid var(--line);
}

.quality-note-mark {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--teal-700);
  border: 1px solid var(--teal-500);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.quality-note strong {
  font-size: 12px;
}

.quality-note p {
  margin: 5px 0 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.map-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  min-height: 620px;
  overflow: hidden;
  background: oklch(88% 0.026 165);
}

.map-canvas {
  position: absolute;
  inset: 0;
}

.leaflet-container {
  color: var(--ink);
  font-family: inherit;
  background: oklch(89% 0.025 165);
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-control-zoom a {
  width: 38px !important;
  height: 38px !important;
  color: var(--teal-900) !important;
  background: rgb(255 255 255 / 0.94) !important;
  border: 0 !important;
  font-size: 20px !important;
  line-height: 38px !important;
}

.leaflet-control-zoom a:first-child {
  border-bottom: 1px solid var(--line) !important;
  border-radius: 10px 10px 0 0;
}

.leaflet-control-zoom a:last-child {
  border-radius: 0 0 10px 10px;
}

.leaflet-control-attribution {
  color: var(--muted) !important;
  background: rgb(255 255 255 / 0.7) !important;
  font-size: 9px !important;
}

.leaflet-control-attribution a {
  color: var(--teal-700) !important;
}

.map-topline {
  position: absolute;
  z-index: 500;
  top: 20px;
  right: 20px;
  left: 20px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
  pointer-events: none;
}

.map-context-chip,
.map-button,
.map-status,
.map-legend {
  box-shadow: 0 10px 30px rgb(19 48 50 / 0.12);
  backdrop-filter: blur(12px);
}

.map-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 13px;
  color: var(--muted);
  background: rgb(255 255 255 / 0.88);
  border: 1px solid rgb(255 255 255 / 0.9);
  border-radius: 11px;
  font-size: 12px;
  pointer-events: auto;
}

.map-context-chip strong {
  color: var(--teal-900);
  font-size: 14px;
}

.map-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal-500);
  box-shadow: 0 0 0 5px oklch(75% 0.13 168 / 0.2);
}

.map-actions {
  display: flex;
  gap: 7px;
  pointer-events: auto;
}

.map-button {
  min-height: 42px;
  color: var(--teal-900);
  background: rgb(255 255 255 / 0.9);
  border-color: rgb(255 255 255 / 0.96);
}

.map-button:hover,
.map-button.is-active {
  color: oklch(98% 0.02 165);
  background: var(--teal-700);
  border-color: var(--teal-700);
}

.map-status {
  position: absolute;
  z-index: 500;
  bottom: 19px;
  left: 20px;
  display: grid;
  gap: 3px;
  min-width: 210px;
  padding: 11px 13px;
  background: rgb(255 255 255 / 0.88);
  border: 1px solid rgb(255 255 255 / 0.9);
  border-radius: 11px;
  pointer-events: none;
}

.map-status strong {
  font-size: 13px;
}

.map-status span {
  color: var(--muted);
  font-size: 11px;
}

.map-legend {
  position: absolute;
  z-index: 500;
  right: 20px;
  bottom: 19px;
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px 13px;
  max-width: 410px;
  padding: 11px 13px;
  color: var(--muted);
  background: rgb(255 255 255 / 0.82);
  border: 1px solid rgb(255 255 255 / 0.9);
  border-radius: 11px;
  font-size: 10px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-line,
.legend-dash {
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 8px;
}

.density-high {
  background: #087f75;
}

.density-mid {
  background: #2ca69b;
}

.density-low {
  background: #8dafa9;
}

.network-unlinked {
  height: 0;
  background: transparent;
  border-top: 2px dashed #839894;
}

.network-candidate {
  height: 0;
  background: transparent;
  border-top: 2px dashed #bd812f;
}

.legend-marker {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: #bd812f;
  border: 2px solid #fffdf8;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #bd812f;
}

.legend-dash {
  height: 0;
  border-top: 2px dashed var(--teal-700);
}

.analysis-point-icon,
.radius-handle-icon,
.facility-marker {
  background: transparent;
  border: 0;
}

.analysis-point-icon span {
  position: relative;
  display: block;
  width: 36px;
  height: 44px;
  filter: drop-shadow(0 5px 7px rgb(12 52 52 / 0.26));
}

.analysis-point-icon span::before {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 26px;
  height: 26px;
  content: "";
  background: var(--teal-700);
  border: 3px solid var(--surface);
  border-radius: 50% 50% 50% 2px;
  transform: rotate(-45deg);
}

.analysis-point-icon i {
  position: absolute;
  z-index: 1;
  top: 11px;
  left: 14px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--amber);
}

.radius-handle-icon span {
  display: block;
  width: 28px;
  height: 28px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 1px 0 1px oklch(58% 0.12 65), 0 4px 9px rgb(12 52 52 / 0.26);
}

.facility-marker span {
  display: block;
  width: 15px;
  height: 15px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--teal-500);
  box-shadow: 0 1px 0 1px var(--teal-700), 0 2px 6px rgb(12 52 52 / 0.24);
}

.street-tooltip {
  padding: 8px 10px !important;
  color: var(--ink) !important;
  background: rgb(255 255 255 / 0.96) !important;
  border: 1px solid var(--line) !important;
  border-radius: 9px !important;
  box-shadow: var(--shadow) !important;
  font-family: inherit !important;
  font-size: 11px !important;
  line-height: 1.35;
}

.street-tooltip::before {
  border-top-color: rgb(255 255 255 / 0.96) !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  font-size: 12px;
  line-height: 1.45;
}

.leaflet-popup-content strong {
  color: var(--teal-900);
}

.leaflet-popup-content span {
  color: var(--muted);
  font-size: 10px;
}

.map-fallback {
  position: absolute;
  z-index: 800;
  inset: 50% auto auto 50%;
  display: grid;
  gap: 5px;
  width: min(360px, calc(100% - 40px));
  padding: 18px;
  background: rgb(255 255 255 / 0.94);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.map-fallback span {
  color: var(--muted);
  font-size: 12px;
}

.site-footer {
  min-height: 35px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 24px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.toast-region {
  position: fixed;
  z-index: 1500;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100% - 40px));
  padding: 11px 14px;
  color: oklch(98% 0.02 165);
  background: var(--teal-900);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.toast-region.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-loading,
.error-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  gap: 12px;
  align-content: center;
  padding: 24px;
  color: var(--muted);
  background: var(--bg);
  text-align: center;
}

.loading-orbit {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--teal-700);
  border-radius: 50%;
}

.app-loading p {
  margin: 0;
  font-size: 13px;
}

.error-card {
  width: min(430px, 100%);
  display: grid;
  gap: 10px;
  padding: 26px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.error-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.error-card p:not(.eyebrow) {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .map-button,
  .radius-preset,
  .text-link,
  .street-row,
  .icon-button,
  .summary-icon,
  .toast-region,
  .analysis-point-icon span,
  .radius-handle-icon span {
    transition-property: background-color, border-color, color, box-shadow, transform, opacity;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
  }

  .button:active,
  .map-button:active,
  .radius-preset:active {
    transform: scale(0.96);
  }
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(360px, 38%) minmax(0, 62%);
  }

  .privacy-note {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    overflow: visible;
  }

  .workspace {
    grid-template-rows: auto minmax(560px, 1fr);
    grid-template-columns: 1fr;
  }

  .control-panel {
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-panel {
    min-height: 600px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 0 16px;
  }

  .topbar-context {
    display: none;
  }

  .control-panel {
    padding: 22px 16px 28px;
  }

  .metric-strip,
  .filter-grid,
  .coordinate-grid {
    gap: 8px;
  }

  .metric-card {
    min-height: 104px;
    padding: 12px;
  }

  .point-actions {
    grid-template-columns: 1fr;
  }

  .map-panel {
    min-height: 520px;
  }

  .map-topline {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .map-actions {
    display: none;
  }

  .map-legend {
    right: 12px;
    bottom: 58px;
    left: 12px;
    justify-content: start;
  }

  .map-status {
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .site-footer {
    display: grid;
    gap: 4px;
    padding: 9px 16px;
  }
}

@media (max-width: 440px) {
  .radius-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .street-table-wrap {
    overflow-x: auto;
  }
}
