:root {
  --on-navy: #16324f;
  --on-blue: #1467a9;
  --on-blue-light: #eaf4fb;
  --on-green: #377a54;
  --on-text: #1f2933;
  --on-muted: #667085;
  --on-border: #d0d7de;
  --on-white: #ffffff;
  --on-focus: #f0a500;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--on-text);
  background: #f4f7f9;
  font-family: Arial, Helvetica, sans-serif;
}

.on-header {
  color: var(--on-white);
  background: var(--on-navy);
  border-bottom: 4px solid var(--on-blue);
}

.on-header__inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 24px;
}

.on-header h1 {
  margin: 2px 0 6px;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.1;
}

.on-header p { margin: 0; }

.on-header__eyebrow {
  color: #b9d7ed;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.on-header__prototype {
  position: absolute;
  right: 24px;
  top: 24px;
  padding: 5px 9px;
  border: 1px solid #a9cbe6;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.on-app {
  max-width: 1440px;
  margin: 24px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
}

.on-map-card,
.on-info {
  background: var(--on-white);
  border: 1px solid var(--on-border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(22 50 79 / 8%);
}

.on-map-card { overflow: hidden; }

.on-map-toolbar {
  min-height: 70px;
  padding: 10px 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--on-border);
}

.on-map-instruction {
  margin: 0;
  padding: 9px 12px;
  color: #234a68;
  background: var(--on-blue-light);
  border-bottom: 1px solid #c8ddeb;
  font-size: 0.85rem;
}

.on-map-toolbar label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.78rem;
  font-weight: 700;
}

.on-select {
  min-width: 180px;
  min-height: 38px;
  padding: 7px 30px 7px 9px;
  color: var(--on-text);
  background: var(--on-white);
  border: 1px solid var(--on-border);
  border-radius: 4px;
}

#map {
  width: 100%;
  height: 650px;
  background: #dfe8ec;
}

.on-map-status {
  min-height: 38px;
  margin: 0;
  padding: 10px 12px;
  color: var(--on-muted);
  border-top: 1px solid var(--on-border);
  font-size: 0.82rem;
}

.on-info {
  align-self: start;
  padding: 20px;
}

.on-info h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
}

.on-selection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--on-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.on-selection-status__dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #98a2b3;
}

.on-selection-status.is-selected {
  color: var(--on-green);
}

.on-selection-status.is-selected .on-selection-status__dot {
  background: var(--on-green);
}

.on-coordinates {
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--on-border);
  border-radius: 6px;
}

.on-coordinates div {
  min-width: 0;
  padding: 12px;
}

.on-coordinates div + div { border-left: 1px solid var(--on-border); }
.on-coordinates dt { color: var(--on-muted); font-size: 0.75rem; }
.on-coordinates dd { margin: 5px 0 0; font-size: 0.9rem; font-weight: 700; overflow-wrap: anywhere; }

.on-w3w {
  margin-bottom: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--on-border);
}

.on-w3w h3 { margin: 0 0 8px; font-size: 0.9rem; }
.on-w3w__address { min-height: 38px; color: var(--on-muted); font-size: 0.82rem; }
.on-w3w__help { color: var(--on-muted); font-size: 0.78rem; line-height: 1.45; }

.on-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.on-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--on-blue);
  border-radius: 4px;
  color: var(--on-white);
  background: var(--on-blue);
  font-weight: 700;
  cursor: pointer;
}

.on-button--secondary {
  color: var(--on-blue);
  background: var(--on-white);
}

.on-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.on-button:focus-visible,
.on-select:focus-visible,
button.leaflet-control-zoom-in:focus-visible,
button.leaflet-control-zoom-out:focus-visible {
  outline: 3px solid var(--on-focus);
  outline-offset: 2px;
}

.on-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 1000;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  transform: translate(-50%, 20px);
  border-radius: 4px;
  color: var(--on-white);
  background: var(--on-navy);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.on-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.on-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.leaflet-container { font-family: Arial, Helvetica, sans-serif; }

.leaflet-control-layers {
  border: 1px solid var(--on-border) !important;
  border-radius: 5px !important;
  box-shadow: 0 1px 5px rgb(22 50 79 / 25%) !important;
}

.on-selected-marker {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #bd2430;
  box-shadow: 0 2px 6px rgb(0 0 0 / 55%);
  transform: rotate(-45deg);
}

.on-selected-marker__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: rotate(45deg);
}

@media (max-width: 820px) {
  .on-app {
    grid-template-columns: 1fr;
  }

  #map { height: clamp(360px, 62vh, 520px); }
  .on-info {
    width: 100%;
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .on-header__inner { padding: 18px 16px 24px; }
  .on-header__prototype { position: static; display: inline-block; margin-top: 12px; }
  .on-app { margin: 12px auto; padding: 0 12px; }
  .on-map-toolbar { align-items: stretch; flex-direction: column; }
  .on-select { width: 100%; }
  #map { height: clamp(320px, 55vh, 440px); }
  .on-coordinates { grid-template-columns: 1fr; }
  .on-coordinates div + div { border-left: 0; border-top: 1px solid var(--on-border); }
}

@media (prefers-reduced-motion: reduce) {
  .on-toast { transition: none; }
}
