/* Overpass – derived from highway signage lettering (SIL OFL) */
@font-face { font-family: "Overpass"; font-weight: 400; font-display: swap; src: url("/static/vendor/fonts/overpass-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-weight: 600; font-display: swap; src: url("/static/vendor/fonts/overpass-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-weight: 700; font-display: swap; src: url("/static/vendor/fonts/overpass-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-weight: 800; font-display: swap; src: url("/static/vendor/fonts/overpass-latin-800-normal.woff2") format("woff2"); }

:root {
  --ink: #14202e;
  --ink-2: #2a3a4d;
  --slate: #5b6878;
  --line: #d9dfd8;
  --paper: #eef1ec;
  --surface: #ffffff;
  --signal: #f5c518;
  --signal-deep: #c99a00;
  --go: #157f5b;
  --go-deep: #0f6448;
  --stop: #b42318;
  --info-bg: #e9eef5;
  --warn-bg: #fff5d1;
  --stop-bg: #fdecea;
  --go-bg: #e3f3ec;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --font: "Overpass", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
a { color: var(--ink); text-decoration-color: var(--signal-deep); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons & fields */
button, .btn { font: inherit; font-weight: 700; border: 0; cursor: pointer; border-radius: var(--r-md); padding: 12px 18px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1.2; }
button:hover, .btn:hover { background: var(--ink-2); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: #f4f6f3; }
.btn-small { padding: 7px 11px; font-size: .86rem; border-radius: var(--r-sm); }
.btn-danger { background: transparent; color: var(--stop); box-shadow: inset 0 0 0 1.5px #efc6c1; }
.btn-danger:hover { background: var(--stop-bg); }
input, select, textarea { font: inherit; color: var(--ink); width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(245, 197, 24, .45); }
textarea { resize: vertical; min-height: 76px; }
label { display: block; font-weight: 700; font-size: .92rem; margin: 16px 0 6px; }
.hint { color: var(--slate); font-size: .9rem; }

.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: .94rem; margin: 12px 0 0; background: var(--info-bg); color: var(--ink-2); }
.note svg.i { width: 20px; height: 20px; margin-top: 1px; }
.note.warn { background: var(--warn-bg); color: #6b4f00; }
.note.err { background: var(--stop-bg); color: var(--stop); }
.note.ok { background: var(--go-bg); color: var(--go-deep); }

/* =====================================================================
   Public location page
   ===================================================================== */
.lp { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.lp-head { background: var(--ink); color: #fff; padding: 18px 20px 26px; }
@media (min-width: 600px) { .lp-head { border-radius: 0 0 var(--r-lg) var(--r-lg); } }
.lp-brand { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: #c3ccd6; font-weight: 600; }
.lp-brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--signal); color: var(--ink); display: grid; place-items: center; }
.lp-brand .mark svg.i { width: 17px; height: 17px; stroke-width: 2.4; }
.lp-head h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); line-height: 1.08; font-weight: 800; letter-spacing: -.015em; margin: 22px 0 12px; }
.plate { display: inline-flex; align-items: baseline; gap: 8px; background: var(--signal); color: var(--ink); border-radius: var(--r-sm); padding: 5px 12px 3px; box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 2px var(--signal); font-weight: 800; font-size: 1.05rem; }
.plate small { font-weight: 600; font-size: .82rem; }
.lp-head p { margin: 16px 0 0; color: #dfe5ec; max-width: 44ch; }

.lp-body { padding: 18px 16px 120px; flex: 1; }
.q { font-weight: 700; margin: 4px 4px 10px; }

.choices { display: grid; gap: 10px; }
.choice { width: 100%; text-align: left; justify-content: flex-start; gap: 14px; padding: 14px 16px; background: var(--surface); color: var(--ink); font-weight: 400; border-radius: var(--r-md); box-shadow: inset 0 0 0 1.5px var(--line); }
.choice:hover { background: #fafbf9; box-shadow: inset 0 0 0 1.5px #b9c2b8; }
.choice .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; flex: none; }
.choice .txt { flex: 1; }
.choice b { display: block; font-weight: 700; font-size: 1.02rem; }
.choice .sub { color: var(--slate); font-size: .9rem; }
.choice .radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px #b9c2b8; flex: none; }
.choice[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.choice[aria-checked="true"] .ico { background: var(--signal); }
.choice[role="button"] .radio { display: none; }
.choice[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.choice[aria-pressed="true"] .ico { background: var(--signal); }
.choice[aria-checked="true"] .radio { box-shadow: inset 0 0 0 7px var(--ink); }

.map-wrap { position: relative; margin-top: 16px; border-radius: var(--r-lg); overflow: visible; background: var(--surface); box-shadow: 0 0 0 1.5px var(--line); }
#map { height: 54vh; min-height: 320px; border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 1; }
.map-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; font-size: .88rem; color: var(--slate); border-top: 1.5px solid var(--line); min-height: 44px; }
.map-foot #coords { text-align: right; white-space: nowrap; }
.map-foot .acc { display: inline-block; margin-left: 6px; background: var(--paper); color: var(--ink-2); padding: 2px 8px; border-radius: 99px; font-weight: 600; white-space: nowrap; }

/* floating search */
.search { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 1100; }
.search-field { position: relative; }
.search-field svg.i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--slate); width: 20px; height: 20px; pointer-events: none; }
.search-field input { padding-left: 42px; padding-right: 42px; border-color: transparent; box-shadow: 0 2px 10px rgba(20, 32, 46, .18); }
.search-field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(245, 197, 24, .5), 0 2px 10px rgba(20, 32, 46, .18); }
.search-field .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; color: var(--slate); padding: 8px; border-radius: 50%; }
.search-field .clear:hover { background: var(--paper); color: var(--ink); }
.search-field .clear svg.i { position: static; transform: none; width: 18px; height: 18px; }
.suggest { list-style: none; margin: 6px 0 0; padding: 6px; background: var(--surface); border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(20, 32, 46, .22); max-height: 46vh; overflow: auto; }
.suggest li { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: var(--r-sm); cursor: pointer; }
.suggest li .pin { color: var(--slate); margin-top: 2px; }
.suggest li .pin svg.i { width: 18px; height: 18px; }
.suggest li .p { font-weight: 600; }
.suggest li .p mark { background: none; color: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 3px; text-underline-offset: 2px; }
.suggest li .s { color: var(--slate); font-size: .86rem; line-height: 1.35; }
.suggest li:hover { background: #f5f7f4; }
.suggest li[aria-selected="true"] { background: var(--paper); box-shadow: inset 3px 0 0 var(--signal-deep); }
.suggest li[aria-selected="true"] .pin { color: var(--ink); }
.suggest .empty { color: var(--slate); font-size: .9rem; cursor: default; }
.suggest .empty:hover { background: none; }

.leaflet-control-zoom { border: 0 !important; box-shadow: 0 2px 8px rgba(20, 32, 46, .2) !important; }
.leaflet-control-zoom a { color: var(--ink) !important; }
.lp-pin { filter: drop-shadow(0 3px 3px rgba(20, 32, 46, .35)); }

.fields { margin-top: 4px; }
.confirm-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(238, 241, 236, 0), var(--paper) 35%); z-index: 2000; }
.confirm-bar button { display: flex; width: 100%; max-width: 528px; margin: 0 auto; padding: 16px; font-size: 1.08rem; background: var(--go); }
.confirm-bar button:hover { background: var(--go-deep); }

.result { padding: 48px 24px; text-align: left; }
.result .badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 20px; }
.result .badge svg.i { width: 32px; height: 32px; stroke-width: 2.4; }
.result .badge.ok { background: var(--go); color: #fff; }
.result .badge.err { background: var(--stop-bg); color: var(--stop); }
.result h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin: 0 0 10px; }
.result p { color: var(--ink-2); max-width: 44ch; }
.result .where { margin: 20px 0; padding: 14px 16px; background: var(--surface); border-radius: var(--r-md); box-shadow: inset 0 0 0 1.5px var(--line); font-size: .92rem; color: var(--slate); }
.loading { padding: 60px 24px; color: var(--slate); }

@media (prefers-reduced-motion: no-preference) {
  .choice, .suggest li { transition: background-color .12s, box-shadow .12s; }
  .result .badge.ok { animation: pop .35s ease-out; }
  @keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
}

/* =====================================================================
   Admin dashboard
   ===================================================================== */
.topbar { background: var(--ink); color: #fff; padding: 0 24px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; min-height: 60px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.topbar .brand .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--signal); color: var(--ink); display: grid; place-items: center; }
.topbar .brand .mark svg.i { width: 18px; height: 18px; stroke-width: 2.4; }
.tabs { display: flex; gap: 2px; align-self: stretch; }
.tabs button { background: transparent; color: #b8c3cf; border-radius: 0; padding: 0 14px; font-weight: 600; box-shadow: inset 0 -3px 0 transparent; }
.tabs button:hover { color: #fff; background: transparent; }
.tabs button.active { color: #fff; box-shadow: inset 0 -3px 0 var(--signal); }
.topbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.topbar .right .stamp { color: #8fa0b2; font-size: .85rem; }
.topbar .btn-ghost { color: #fff; box-shadow: inset 0 0 0 1.5px #3a4b5f; }
.topbar .btn-ghost:hover { background: #22324a; }

.wrap { max-width: 1360px; margin: 0 auto; padding: 24px; }
.grid2 { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .grid2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 22px; box-shadow: 0 0 0 1px var(--line); }
.panel h2 { font-size: 1.2rem; font-weight: 800; margin: 0 0 4px; }
.panel h3 { font-size: 1rem; margin: 22px 0 6px; }
.panel > .hint:first-of-type { margin-top: 0; }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar label { margin: 0; font-weight: 600; color: var(--slate); }
.toolbar select { width: auto; padding: 8px 12px; }

table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .84rem; font-weight: 700; color: var(--slate); border-bottom-width: 1.5px; white-space: nowrap; }
tr.sub td { background: #f7f9f6; }
td.actions { white-space: nowrap; }
td:first-child b, a.num, .tag.dist { white-space: nowrap; }
td.actions .row { flex-wrap: nowrap; }
.tag { display: inline-block; padding: 3px 9px 1px; border-radius: var(--r-sm); font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--paper); color: var(--ink-2); }
.tag.ok { background: var(--go-bg); color: var(--go-deep); }
.tag.warn { background: var(--warn-bg); color: #6b4f00; }
.tag.err { background: var(--stop-bg); color: var(--stop); }
.tag.dist { background: var(--signal); color: var(--ink); }
.sm { color: var(--slate); font-size: .86rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linkbox { word-break: break-all; font-size: .88rem; background: var(--paper); padding: 12px; border-radius: var(--r-md); margin: 10px 0; }
pre.linkbox { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
fieldset.events { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
fieldset.events legend { padding: 0; margin-bottom: 4px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 700px) { .grid-2col { grid-template-columns: 1fr; } }
.seg { display: inline-flex; background: var(--paper); border-radius: var(--r-md); padding: 3px; }
.seg button { background: transparent; color: var(--slate); padding: 7px 12px; border-radius: 7px; font-size: .88rem; }
.seg button:hover { background: transparent; color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 32, 46, .15); }
pre.code { max-height: 420px; overflow: auto; }
details > summary { margin: 4px 0; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
.check input { width: auto; }
.admin-map-wrap { position: relative; }
#adminMap { height: 72vh; border-radius: var(--r-md); z-index: 1; }
.admin-map-wrap .search { left: 56px; right: auto; width: min(440px, calc(100% - 68px)); }
.legend { display: flex; gap: 18px; font-size: .88rem; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(20, 32, 46, .25); }
.near-list { margin: 6px 0 0; padding-left: 20px; }
.near-list li { margin: 3px 0; }
.empty-state { padding: 28px 4px 8px; color: var(--slate); }

.login { max-width: 400px; margin: 14vh auto; padding: 0 16px; }
.login .panel { padding: 28px; }
.login .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; margin-bottom: 8px; }
.login .brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--signal); display: grid; place-items: center; }
.login button { width: 100%; margin-top: 16px; }
