:root{--accent:#111827;--accent-2:#374151;--accent-t:#fff;--paper:#fff;--ink:#111}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--accent:#e5e7eb;--accent-2:#cbd5e1;--accent-t:#111827;--paper:#0b0b0c;--ink:#eee}}
:root[data-theme="dark"]{--accent:#e5e7eb;--accent-2:#cbd5e1;--accent-t:#111827;--paper:#0b0b0c;--ink:#eee}
*{box-sizing:border-box}[hidden]{display:none!important}
.wrap{max-width:1200px;margin:0 auto;padding:12px}
.mapbox{position:relative;padding:0;overflow:hidden;height:calc(100dvh - var(--dock-h,110px) - 40px);min-height:320px;background:var(--paper)}
#areabox{position:absolute;inset:60px 7% 56px;border:2px dashed var(--accent);border-radius:14px;box-shadow:0 0 0 2000px rgba(0,0,0,.22);pointer-events:none}
@media (max-height:500px){#areabox{inset:10px 24px 52px}}
.picking #reach,.picking #rl,.picking #rr,.picking #nbtn{display:none!important}
#map{width:100%;height:100%;touch-action:none;display:block;cursor:grab}
.parcel{fill:#cfe8c4;stroke:#4d7c3a;stroke-width:1.2;vector-effect:non-scaling-stroke;cursor:pointer}
.parcel.has{fill:#fbbf24}
.parcel.picked{fill:#3b82f6}
.parcel:hover{stroke-width:3}
.house{fill:#d9825b;stroke:#8a4527;stroke-width:1;vector-effect:non-scaling-stroke;pointer-events:none}
.road{fill:none;stroke:#a8adb7;stroke-width:9;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.sat .parcel{fill:transparent;stroke:#fde047}
.sat .parcel.has{fill:rgba(251,191,36,.45)}
.sat .parcel.picked{fill:rgba(59,130,246,.5)}
.sat .house{fill:none;stroke:#67e8f9}
.aerial{pointer-events:none}
.num,.street{text-anchor:middle;dominant-baseline:middle;paint-order:stroke;pointer-events:none}
.num{font-size:5px;fill:#111;stroke:#fff;stroke-width:1.4px}
.street{font-size:8px;font-weight:700;fill:#111;stroke:#fff;stroke-width:2.4px}
.tools{position:absolute;left:10px;right:10px;top:10px;display:flex;gap:6px;flex-wrap:wrap}
.tools [aria-pressed="true"]{background:var(--accent);color:var(--accent-t)}
#north{display:inline-block}
#credit{position:absolute;left:10px;bottom:48px;background:rgba(0,0,0,.55);color:#fff;padding:2px 6px;border-radius:6px;font-size:11px}
.zoom{position:absolute;right:10px;bottom:10px;display:flex;gap:6px}
.empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}
.muted{color:var(--muted)}.err{color:var(--danger);min-height:1em}
#q,#v-set textarea,#dlg input:not([type=checkbox]),#dlg textarea{width:100%;font-size:16px;margin:4px 0 8px}
label{display:block;margin:8px 0}.check{display:flex;gap:8px;align-items:flex-start}
#v-set .card{margin-bottom:12px}
#rows{display:grid;gap:8px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
#rows .card{cursor:pointer;text-align:left}#rows a{display:inline-block;margin-right:10px;color:inherit}
dialog{width:min(520px,94vw);max-height:88dvh;overflow:auto;color:var(--text);background:var(--solid)}
.person{border-bottom:1px solid var(--glass-line);padding-bottom:6px;margin-bottom:8px}
.parcel.mine{fill:#a78bfa}.sat .parcel.mine{fill:rgba(167,139,250,.5)}
#v-admin .card,#profile,#askcard,#v-consent,#pending .card{margin-bottom:12px}
.banner,.previewbar{margin:0 0 8px}.previewbar{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
#profile input,#profile select,#party input,#pwform input,#dbody input,#dbody textarea,#streetname{font-size:16px;width:100%;margin:4px 0 8px}
#streetform{flex-wrap:nowrap}#streetname{flex:1;margin:0}
#v-set,#v-consent,#v-home{max-width:620px;margin-inline:auto}
.person a{display:inline-block;margin-right:10px;color:inherit;overflow-wrap:anywhere}.person .row{margin-top:6px;flex-wrap:wrap}
#streets .row{justify-content:space-between;margin-top:6px}
#pending h2{margin:0 0 8px}#pending{display:grid;gap:8px;margin-bottom:12px}
.reach{position:absolute;left:10px;right:10px;top:60px;max-width:320px;margin:0;padding:6px 10px;font-size:13px}
.reach input{width:100%;margin:2px 0 0}
.reachshape{opacity:.2;pointer-events:none}.reachshape polygon{fill:#8b5cf6;stroke:#8b5cf6;stroke-linejoin:round}
#dbody select{width:100%}
.temp{font:700 1.2rem ui-monospace,monospace;user-select:all}
.banner{margin:0 0 8px;display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.listbtns{flex-wrap:wrap;margin-bottom:8px}.invrow{justify-content:space-between;margin-bottom:6px}
#notesbox{margin-top:16px}#notes{display:grid;gap:8px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
#notes .person,#blocklist .person:last-child{border:0;margin:0;padding:0}
#blockcard,#democard{margin-bottom:12px}
.parcel.noted{stroke-dasharray:4 3;stroke-width:3}
.sat .parcel.noted{fill:rgba(236,72,153,.35)}.parcel.noted{fill:#f9a8d4}
.askbox{border:1px dashed var(--muted);border-radius:10px;padding:8px;margin-top:6px}
#dbody label.agree{display:flex;gap:8px}
/* Desktop, and phones or tablets held sideways: the tabs move into a dock down the left side, under the top bar. Upright they stay across the top. */
@media (min-width:1024px),(orientation:landscape){
  :root{--side:calc(160px + env(safe-area-inset-left,0px))}
  .jz-dock>#tabs.menubar{position:fixed;left:0;top:var(--dock-h,56px);bottom:0;width:var(--side);flex-direction:column;align-items:stretch;gap:4px;padding:12px 10px 12px calc(10px + env(safe-area-inset-left,0px));border-bottom:0;border-right:1px solid var(--glass-line);overflow-x:hidden;overflow-y:auto}
  #tabs.menubar>.mb-btn{flex:none;min-width:0;height:40px;justify-content:flex-start;border-radius:10px;padding:0 12px;white-space:nowrap}
  #tabs.menubar>.mb-btn[aria-selected=true]{box-shadow:inset 3px 0 0 var(--accent)}
  body:has(#tabs:not([hidden])) .wrap{width:auto;max-width:1400px;margin-left:var(--side);padding-right:max(12px,env(safe-area-inset-right,0px))}
  .mapbox{min-height:220px}
}
@media (min-width:1024px){:root{--side:200px}}
/* A phone held sideways is short: keep the distance control small so the map shows. */
@media (orientation:landscape) and (max-height:500px){
  .wrap{padding-top:6px}
  .tools{top:6px;left:6px}.reach{top:46px;left:6px;max-width:230px;padding:4px 8px;font-size:11px}
  .mapbox{height:calc(100dvh - var(--dock-h,56px) - 16px)}
}
/* Demo button in the top bar (master only): the dot is green while Demo is on */
.topbar .tb-btn.demo-btn{width:auto;padding:0 10px;gap:6px;display:inline-flex;align-items:center;font:inherit;font-size:13px;font-weight:600;white-space:nowrap;flex:none}
.topbar .tb-btn.demo-btn[hidden]{display:none}
.demo-dot{width:9px;height:9px;border-radius:50%;background:#9ca3af;flex:none}
.demo-btn.on .demo-dot{background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.25)}
/* OpenStreetMap underneath: see-through outlines so its detail shows */
.osm .parcel{fill:rgba(255,255,255,.08)}.osm .parcel.has{fill:rgba(251,191,36,.55)}.osm .parcel.picked{fill:rgba(59,130,246,.5)}.osm .parcel.mine{fill:rgba(167,139,250,.65)}.osm .parcel.noted{fill:rgba(236,72,153,.4)}
.osm .house{fill:rgba(217,130,91,.35)}
#credit a{color:inherit}
/* Map tab: the page itself never scrolls. The map fills what is left and its buttons stay where they are. */
html.mapmode,html.mapmode body{overflow:hidden;overscroll-behavior:none}
html.mapmode .wrap{position:fixed;left:0;right:0;top:var(--dock-h,102px);bottom:0;display:flex;flex-direction:column;padding-bottom:max(8px,env(safe-area-inset-bottom,0px))}
html.mapmode #v-map{flex:1;min-height:0;display:flex;flex-direction:column}
html.mapmode .mapbox{flex:1;height:auto;min-height:0;touch-action:none;user-select:none;-webkit-user-select:none}
#homeform select,#homeform input{font-size:16px;width:100%;margin:4px 0 8px}
