:root { color-scheme: light dark; font-family: system-ui, sans-serif; --bg:#f1f5fb; --card:#fff; --ink:#17243a; --accent:#2457a6; --danger:#a51e32; }
@media (prefers-color-scheme: dark) { :root { --bg:#111827; --card:#1e293b; --ink:#eff6ff; --accent:#2563eb; --danger:#ff8291; } }
* { box-sizing: border-box; }
body { margin:0; padding: max(16px, env(safe-area-inset-top)) 16px calc(90px + env(safe-area-inset-bottom)); background:var(--bg); color:var(--ink); }
header { max-width:720px; margin:0 auto 20px; } h1 { margin:0; font-size:1.5rem; } header p { margin:4px 0; opacity:.75; }
main { max-width:720px; margin:auto; } h2 { font-size:1.25rem; }
#app > [data-new] { margin-bottom:16px; }
.card, fieldset { border:0; border-radius:16px; padding:16px; margin:0 0 12px; background:var(--card); box-shadow:0 2px 12px #0001; }
.card h2 { margin:0 0 8px; } .muted, .updated { opacity:.72; font-size:.9rem; }
.code { display:inline-block; font:700 1.5rem ui-monospace, monospace; letter-spacing:.12em; padding:8px 10px; border-radius:8px; background:var(--bg); margin:4px 5px 4px 0; }
label { display:block; font-weight:650; margin:14px 0 6px; } input, textarea { width:100%; min-height:48px; padding:11px 12px; border:1px solid #8888; border-radius:10px; font:inherit; color:var(--ink); background:var(--bg); }
textarea { min-height:92px; resize:vertical; } button { min-height:48px; padding:10px 14px; border:0; border-radius:10px; color:white; background:var(--accent); font:inherit; font-weight:650; cursor:pointer; }
button.secondary { color:var(--ink); background:#8883; } button.danger { background:var(--danger); } .actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; } .actions button { flex:1; }
nav { position:fixed; z-index:2; inset:auto 0 0; display:flex; gap:10px; padding:10px 16px calc(10px + env(safe-area-inset-bottom)); background:var(--card); box-shadow:0 -3px 14px #17243a22; } nav button { flex:1; }
dialog { max-width:min(92vw,440px); border:0; border-radius:18px; padding:20px; color:var(--ink); background:var(--card); } dialog::backdrop { background:#0009; }
.empty { padding:32px 16px; text-align:center; } .error { color:var(--danger); font-size:.9rem; } .keypad { display:grid; grid-template-columns:repeat(5,1fr); gap:6px; margin-top:8px; } .keypad button { min-height:44px; padding:4px; font-size:.95rem; } .char-count { text-align:right; font-size:.85rem; opacity:.75; }
.access-row + .access-row { border-top:1px solid #7b8ca522; margin-top:12px; padding-top:12px; }
.match-notice { margin:12px 0; padding:14px; border:1px solid #2457a655; border-radius:12px; background:color-mix(in srgb, var(--accent) 8%, var(--card)); }
.match-notice h3 { margin:0 0 8px; }
#address-suggestions { display:grid; gap:6px; margin:6px 0; }
#address-suggestions:empty { display:none; }
#address-suggestions button { width:100%; min-height:48px; text-align:left; color:var(--ink); background:var(--card); border:1px solid #7b8ca544; }
#geocode-status { min-height:1.25em; margin:5px 0; }
#map-screen { display:flex; flex-direction:column; height:calc(100dvh - 220px); min-height:360px; }
.map-tools { flex:0 0 auto; }
.map-tools label { margin-top:0; }
.map-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.map-actions p { margin:8px 0; }
#map-status { min-height:1.2em; margin:4px 0; }
#map-canvas { flex:1 1 auto; min-height:280px; border-radius:16px; overflow:hidden; background:#dce7f4; }
.access-detail + .access-detail { border-top:1px solid #7b8ca544; margin-top:16px; padding-top:12px; }
.access-detail h3 { margin:8px 0; }
.access-detail h4 { margin:12px 0 4px; }
.maplibregl-ctrl-group button { width:44px; height:44px; }
@media (hover:hover) and (pointer:fine) {
  .keypad { display:none; }
  input:focus + .keypad, .keypad:focus-within { display:grid; }
}
@media (max-width:420px) {
  #map-screen { height:calc(100dvh - 232px); }
}
