:root { color-scheme: light; font-family: system-ui, Arial, sans-serif; color: #17283c; background: #f5f7fa; }
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.5; }
header { background: #12345b; color: white; padding: 26px 18px; }
.header-content, .wrap { max-width: 1100px; margin: 0 auto; }
header h1 { margin: 0; font-size: clamp(24px, 4vw, 38px); line-height: 1.2; }
header p { margin: 8px 0 0; }
.wrap { padding: 24px 18px 0; }
.panel { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 2px 12px #0001; margin-bottom: 18px; }
h2 { margin: 0; font-size: 23px; line-height: 1.3; }
p { margin: 12px 0; }
a { color: #14558f; text-underline-offset: 3px; }
label { display: block; font-weight: 600; margin-bottom: 7px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
input { flex: 1 1 260px; min-width: 0; width: 100%; padding: 13px; border: 1px solid #8b9caf; border-radius: 6px; font: inherit; }
button { background: #165a99; color: white; border: 1px solid transparent; padding: 12px 20px; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; }
button:hover:not(:disabled) { background: #0d416f; }
button:disabled { opacity: .6; cursor: not-allowed; }
button.secondary { background: #edf3f9; color: #164d7e; border-color: #c8d7e7; }
button.secondary:hover:not(:disabled) { background: #dce9f5; }
:focus-visible { outline: 3px solid #d29116; outline-offset: 3px; }
#result { margin-top: 14px; font-weight: 600; }
#result[data-state] { padding: 12px 14px; border-radius: 6px; background: #edf3f9; border-left: 4px solid #165a99; }
#result[data-state="inside"] { background: #edf8f1; border-color: #277344; color: #19502e; }
#result[data-state="outside"] { background: #f2f4f7; border-color: #64748b; }
#result[data-state="warning"], #result[data-state="near_boundary"] { background: #fff7e7; border-color: #a06a12; color: #654308; }
#result p { margin: 5px 0 0; font-weight: 400; }
#retry-boundary { margin-top: 12px; }
.map-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.map-heading button { font-size: 14px; }
#map { height: min(65vh, 650px); min-height: 390px; border-radius: 8px; background: #e9eff4; z-index: 0; }
.small { font-size: 13px; color: #526273; line-height: 1.6; }
#address-help { margin-bottom: 0; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.legend span { display: inline-block; width: 22px; height: 16px; border: 2px solid #135ba0; background: #2c7ec433; border-radius: 3px; }
.leaflet-popup-content { font: 14px/1.5 system-ui, Arial, sans-serif; }
footer { max-width: 1100px; margin: 0 auto; padding: 0 18px 24px; font-size: 13px; color: #526273; }
[hidden] { display: none !important; }
@media (max-width: 520px) {
  .wrap { padding: 16px 12px 0; }
  .panel { padding: 16px; }
  .form-row button { width: 100%; }
  #map { height: 52vh; min-height: 340px; }
  h2 { font-size: 21px; }
}
