/* India City Officials. One question per screen: "who serves this place?". A calm panel of cards beside the map
   (a bottom sheet on phones); the ward colours carry the map's meaning. */
:root {
  --paper: #eef2f1; --panel: #fbfcfc; --card: #ffffff; --ink: #15212a; --ink2: #33434c; --muted: #5a6a71; --rule: #dbe3e4; --rule2: #e9eeee;
  --land: #e3e9e8; --state: #9fb0b4; --soft: #f1f5f4; --chip: #eef3f2;
  --current: #06705a; --match: #9cc9b8; --cllr: #6aa6c4; --near: #d6a23a; --differs: #c2552d; --hi: #1d4ed8; --hi-soft: #e6edff; --on-hi: #ffffff;
  --el: #6d28d9; --el-soft: #f1eaff; --ap: #0f5e6e; --ap-soft: #e3f2f4; --call: #0b7a4b; --call-soft: #e4f4ec;
  --ok: #2f7d4f; --part: #8a6d1a; --bad: #b0412e; --warn-soft: #fff5e0;
  --stn: #c0392b; --osm: #3949ab; --pl-s: #2e7d32; --pl-h: #c2185b; --pl-b: #6a1b9a; --pl-p: #ef6c00; --pl-f: #d32f2f; --pl-c: #00838f; --pl-r: #8d6e63; --pl-a: #f9a825; --pl-g: #455a64; --pl-k: #1565c0; --pl-m: #5c6bc0; --pl-j: #6d4c41;
  --b-dist: #5f6f74; --b-sub: #8fa0a5; --b-ac: #7c3aed; --b-pc: #b45309; --b-ps: #0f766e; --b-pin: #9d174d;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --body: "Public Sans", "Noto Sans Devanagari", "Segoe UI", system-ui, sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(16, 30, 38, .06), 0 4px 16px rgba(16, 30, 38, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0d1416; --panel: #12191c; --card: #172125; --ink: #e4eced; --ink2: #c3d0d2; --muted: #93a3a8; --rule: #2a383c; --rule2: #223034;
  --land: #172120; --state: #4b5d61; --soft: #1a2529; --chip: #1f2b2f;
  --current: #35c19c; --match: #4f7f71; --cllr: #4d87a6; --near: #e2b34f; --differs: #e07148; --hi: #7aa2ff; --hi-soft: #1d2a4a; --on-hi: #0b1220;
  --el: #c4a5ff; --el-soft: #2a2042; --ap: #7fd3df; --ap-soft: #15333a; --call: #5fd39a; --call-soft: #133325;
  --ok: #6cc28f; --part: #d9b54a; --bad: #e8826f; --warn-soft: #3a2f16;
  --stn: #ff7a6b; --osm: #8c9eff; --pl-s: #66bb6a; --pl-h: #f06292; --pl-b: #b388ff; --pl-p: #ffa040; --pl-f: #ff6e6e; --pl-c: #4dd0e1; --pl-r: #bcaaa4; --pl-a: #ffd54f; --pl-g: #b0bec5; --pl-k: #64b5f6; --pl-m: #9fa8da; --pl-j: #d7ccc8;
  --b-dist: #8a9a9f; --b-sub: #5d6e73; --b-ac: #b794f6; --b-pc: #f6ad55; --b-ps: #4fd1c5; --b-pin: #f687b3;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); color-scheme: dark } }
:root[data-theme="dark"] {
  --paper: #0d1416; --panel: #12191c; --card: #172125; --ink: #e4eced; --ink2: #c3d0d2; --muted: #93a3a8; --rule: #2a383c; --rule2: #223034;
  --land: #172120; --state: #4b5d61; --soft: #1a2529; --chip: #1f2b2f;
  --current: #35c19c; --match: #4f7f71; --cllr: #4d87a6; --near: #e2b34f; --differs: #e07148; --hi: #7aa2ff; --hi-soft: #1d2a4a; --on-hi: #0b1220;
  --el: #c4a5ff; --el-soft: #2a2042; --ap: #7fd3df; --ap-soft: #15333a; --call: #5fd39a; --call-soft: #133325;
  --ok: #6cc28f; --part: #d9b54a; --bad: #e8826f; --warn-soft: #3a2f16;
  --stn: #ff7a6b; --osm: #8c9eff; --pl-s: #66bb6a; --pl-h: #f06292; --pl-b: #b388ff; --pl-p: #ffa040; --pl-f: #ff6e6e; --pl-c: #4dd0e1; --pl-r: #bcaaa4; --pl-a: #ffd54f; --pl-g: #b0bec5; --pl-k: #64b5f6; --pl-m: #9fa8da; --pl-j: #d7ccc8;
  --b-dist: #8a9a9f; --b-sub: #5d6e73; --b-ac: #b794f6; --b-pc: #f6ad55; --b-ps: #4fd1c5; --b-pin: #f687b3;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); color-scheme: dark }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--body); -webkit-text-size-adjust: 100%; overflow: hidden; }
a { color: var(--hi); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--hi); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--hi); color: var(--on-hi); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 8px; }

/* ---------- layout: panel beside the map */
.app { display: grid; grid-template-columns: minmax(360px, 440px) 1fr; height: 100%; height: 100dvh; }
.panel { position: relative; background: var(--panel); border-right: 1px solid var(--rule); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; min-width: 0; z-index: 5; scrollbar-gutter: stable; }
.mapwrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }
.grab { display: none; }
.top { position: sticky; top: 0; z-index: 4; background: var(--panel); padding: 14px 18px 12px; border-bottom: 1px solid var(--rule2); }
.brandrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px; letter-spacing: -.005em; min-height: 36px; }
.mark { width: 20px; height: 20px; border-radius: 6px; background:
  conic-gradient(from 45deg, var(--current) 0 25%, var(--match) 0 50%, var(--near) 0 75%, var(--differs) 0); }
.tools { display: flex; gap: 6px; }
.chipbtn, .iconbtn { min-height: 36px; min-width: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--rule); background: var(--card); cursor: pointer; }
.iconbtn { padding: 0; display: grid; place-items: center; font-size: 16px; }
.chipbtn:hover, .iconbtn:hover { border-color: var(--muted); }

/* ---------- search */
.search { position: relative; display: flex; gap: 8px; }
.field { position: relative; flex: 1; min-width: 0; }
.mag { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#q { width: 100%; height: 48px; padding: 0 14px 0 40px; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--card); font-size: 16px; }
#q:focus { border-color: var(--hi); outline: none; box-shadow: 0 0 0 3px var(--hi-soft); }
.locbtn { height: 48px; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px; border-radius: 12px; border: 1.5px solid var(--rule);
  background: var(--card); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 14px; color: var(--hi); }
.locbtn svg { width: 18px; height: 18px; }
.locbtn:hover { border-color: var(--hi); }
.locbtn.busy svg { animation: spin 1s linear infinite; }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 10; list-style: none; margin: 0; padding: 6px; background: var(--card);
  border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow); max-height: min(60vh, 460px); overflow-y: auto; }
.sugg li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; cursor: pointer; min-height: 48px; }
.sugg li[aria-selected="true"], .sugg li:hover { background: var(--soft); }
.sugg li[aria-disabled="true"] { cursor: default; color: var(--muted); }
.sugg .si { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--chip); color: var(--muted); font-size: 13px; }
.sugg .k-loc .si, .sugg .k-ward .si { background: var(--hi-soft); color: var(--hi); }
.sugg .k-person .si { background: var(--el-soft); color: var(--el); }
.sugg .st { min-width: 0; }
.sugg b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagk { font-size: 11px; color: var(--muted); border: 1px solid var(--rule); border-radius: 99px; padding: 1px 8px; }

/* ---------- the view */
.view { padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 14px; outline: none; }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 24px 4px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--rule); border-top-color: var(--hi); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: 38px; line-height: 1.05; margin: 6px 0 8px; letter-spacing: -.005em; text-wrap: balance; }
.lede { color: var(--ink2); margin: 0 0 14px; font-size: 15.5px; }
.bigacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.eyebrow.sect { margin: 8px 2px -4px; }
.placehead h2 { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.08; margin: 2px 0 4px; text-wrap: balance; overflow-wrap: anywhere; }
.where { margin: 0 0 6px; color: var(--ink2); font-size: 14px; }
.fine { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 6px 0 0; }
.fine.warn { background: var(--warn-soft); color: var(--ink2); padding: 8px 10px; border-radius: 10px; }
.cov { font-size: 13px; color: var(--muted); margin: 8px 0 0; padding: 8px 10px; background: var(--soft); border-radius: 10px; line-height: 1.5; }
.covt { color: var(--ink2); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.act { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--rule); background: var(--card); cursor: pointer; font-weight: 600; font-size: 14px; }
.act:hover { border-color: var(--muted); }
.act.primary { background: var(--hi); border-color: var(--hi); color: var(--on-hi); }
.act.primary:hover { filter: brightness(1.08); }
.act.big { min-height: 52px; font-size: 15px; }
.probwrap { margin-top: 10px; }
.probgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.prob { display: flex; align-items: center; gap: 9px; text-align: left; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--rule);
  background: var(--card); cursor: pointer; font-size: 13.5px; line-height: 1.3; }
.prob span { font-size: 18px; flex: none; }
.prob:hover { border-color: var(--muted); }
.prob.on { border-color: var(--hi); background: var(--hi-soft); box-shadow: inset 0 0 0 1px var(--hi); }

/* ---------- cards: one per role */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 14px 10px; box-shadow: var(--shadow); min-width: 0; }
.card.soft { background: var(--soft); box-shadow: none; }
.ch { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start; margin-bottom: 6px; }
.ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--soft); }
.card h3 { margin: 0; font-size: 16.5px; font-weight: 700; line-height: 1.3; letter-spacing: -.005em; }
.area { margin: 2px 0 0; font-weight: 600; color: var(--hi); font-size: 13.5px; overflow-wrap: anywhere; }
.desc { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.gh { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 12px 0 2px; }
.gh .n { font-weight: 500; }
.plist { list-style: none; margin: 0; padding: 0; }
.person { padding: 11px 0; border-top: 1px solid var(--rule2); min-width: 0; }
.plist .person:first-child { border-top: 0; }
.who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.who b { font-size: 15.5px; font-weight: 650; overflow-wrap: anywhere; }
.post { color: var(--ink2); font-size: 14px; overflow-wrap: anywhere; }
.pnote { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.badge { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.badge.el { background: var(--el-soft); color: var(--el); }
.badge.ap { background: var(--ap-soft); color: var(--ap); }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--rule);
  background: var(--card); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; max-width: 100%; }
.btn .em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.btn.call { background: var(--call-soft); border-color: transparent; color: var(--call); font-variant-numeric: tabular-nums; }
.btn.call svg { width: 15px; height: 15px; flex: none; }
.btn.ghost { color: var(--muted); font-weight: 500; }
.btn.sm { min-height: 34px; padding: 0 10px; font-size: 13px; }
.btn:hover { border-color: var(--muted); }
.trust { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.trust a { color: var(--muted); }
.sx { margin-top: 3px; font-size: 12px; color: var(--muted); }
.sx > summary { cursor: pointer; width: fit-content; text-decoration: underline dotted; text-underline-offset: 3px; }
.sx > summary::marker { content: ""; }
.sx > summary::-webkit-details-marker { display: none; }
.sx .sxb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 4px; overflow-wrap: anywhere; }
.sx a { color: var(--muted); }
.sx .sha { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.sx .sxl { flex-basis: 100%; margin-top: 3px; padding: 4px 8px; border-left: 2px solid var(--rule); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; white-space: pre-wrap; color: var(--ink2); }
.dotsep { opacity: .6; }
.ck.ok { color: var(--ok); } .ck.part { color: var(--part); } .ck.bad { color: var(--bad); }
.trust .old { color: var(--bad); font-weight: 600; }
.fold { border-top: 1px solid var(--rule2); }
.fold > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 46px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--ink2); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; flex: none; }
.fold[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.fold > summary > span:first-child { flex: 1; min-width: 0; }
.fold .n { color: var(--muted); font-weight: 500; font-size: 13px; }
.fold-body { padding: 0 0 8px; }
.fold .fold { margin-left: 4px; }
/* the same person on other source pages: a small fold under the person's source line */
.person .fold.also { border-top: 0; margin-top: 4px; }
.person .fold.also > summary { min-height: 36px; font-size: 13px; font-weight: 500; color: var(--muted); }
.also { list-style: none; margin: 0; padding: 0; font-size: 13.5px; color: var(--ink2); }
.also li { padding: 6px 0; border-top: 1px solid var(--rule2); overflow-wrap: anywhere; }
.also li b { font-weight: 600; }
.also .trust { margin-top: 3px; }
.near { list-style: none; margin: 0; padding: 0; }
.near li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--rule2); }
.near li:first-child { border-top: 0; }
.near .nm { min-width: 0; }
.near .nm b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.near .nm small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.near .dist { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink2); font-size: 13px; white-space: nowrap; }
.near .acts { grid-column: 1 / -1; margin-top: 4px; }
.problem { border-color: var(--hi); box-shadow: 0 0 0 1px var(--hi), var(--shadow); }
.problem .ic { background: var(--hi-soft); }
.linkbtn { background: none; border: 0; color: var(--hi); cursor: pointer; font-weight: 600; padding: 8px 4px; min-height: 40px; }
.steps { list-style: none; margin: 4px 0 0; padding: 0; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; position: relative; padding-bottom: 6px; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 32px; bottom: 0; width: 2px; background: var(--rule); }
.sn { width: 30px; height: 30px; border-radius: 50%; background: var(--hi); color: var(--on-hi); display: grid; place-items: center; font-weight: 700; font-size: 14px; z-index: 1; }
.step:not(:first-child) .sn { background: var(--card); color: var(--hi); border: 2px solid var(--hi); }
.sb { min-width: 0; }
.sl { margin: 4px 0 0; font-size: 14px; color: var(--ink2); }
.sl b { color: var(--ink); }
.sos { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.sosbtn { background: #b42318; border-color: #b42318; color: #fff; min-height: 46px; font-size: 15px; }
.sosbtn b { font-size: 17px; }
.missing { padding: 12px 14px; border-radius: var(--r); border: 1px dashed var(--rule); }
.missing h3 { margin: 0 0 4px; font-size: 14px; }
.missing ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.links { display: grid; gap: 8px; }
.wide { width: 100%; min-height: 48px; text-align: left; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--card);
  cursor: pointer; font-weight: 600; color: var(--hi); }
.wide:hover { border-color: var(--hi); }
a.wide { display: flex; align-items: center; text-decoration: none; }
.card .wide { margin: 10px 0 4px; }
.back { align-self: flex-start; background: none; border: 0; color: var(--hi); font-weight: 600; cursor: pointer; padding: 6px 0; min-height: 40px; }
.wardgrid { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px;
  max-height: 260px; overflow-y: auto; }
.wardgrid button { width: 100%; min-height: 48px; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); cursor: pointer; text-align: left; }
.wardgrid button:hover { border-color: var(--hi); }
.wardgrid b { display: block; font-size: 14px; }
.wardgrid small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .act { margin-top: 6px; }
.wfilter { width: 100%; height: 44px; margin-top: 10px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--rule); background: var(--card); font-size: 15px; }
.wfilter:focus { border-color: var(--hi); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vpick { margin: 2px 0 10px; }
.vpick .chips { max-height: 220px; overflow-y: auto; }
.chips button, .tabs button { min-height: 40px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--rule); background: var(--card); cursor: pointer; font-size: 13.5px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.statgrid div { background: var(--card); border: 1px solid var(--rule2); border-radius: 12px; padding: 10px 12px; }
.statgrid b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.statgrid span { color: var(--muted); font-size: 12.5px; line-height: 1.35; display: block; }
.about { border-top: 1px solid var(--rule); padding-top: 6px; color: var(--ink2); font-size: 13.5px; }
.about summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.about p { margin: 0 0 8px; }
.printhead { display: none; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--c); vertical-align: -2px; flex: none; }
.sw.ring { background: transparent; border: 1.5px dashed var(--c); border-radius: 50%; }

/* ---------- map controls */
.maptools { position: absolute; top: 10px; right: 52px; z-index: 3; }
.mapbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--rule);
  background: var(--card); box-shadow: var(--shadow); cursor: pointer; font-weight: 600; font-size: 14px; }
.mapbtn svg { width: 18px; height: 18px; }
.layers { position: absolute; right: 0; top: 48px; width: min(320px, calc(100vw - 24px)); max-height: calc(100vh - 140px); overflow-y: auto; background: var(--card);
  border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow); padding: 6px 14px 12px; }
.lhead { display: flex; justify-content: space-between; align-items: center; }
.lhead h2 { font-size: 15px; margin: 6px 0; }
.layers fieldset { border: 0; margin: 0; padding: 8px 0 4px; border-top: 1px solid var(--rule2); }
.layers fieldset:first-of-type { border-top: 0; }
.layers legend { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 2px; }
.layers label { display: grid; grid-template-columns: 20px 22px 1fr; gap: 8px; align-items: center; min-height: 38px; cursor: pointer; font-size: 14px; }
.layers label:has(> span:only-of-type):not(:has(i)) { grid-template-columns: 20px 1fr; }
.layers label.off { opacity: .45; cursor: default; }
.layers input { width: 18px; height: 18px; accent-color: var(--hi); margin: 0; }
.ln { height: 0; border-top: 2.5px solid var(--c); }
.ln.dash { border-top-style: dashed; } .ln.dot { border-top-style: dotted; }
.pt { width: 10px; height: 10px; border-radius: 50%; background: var(--c); justify-self: center; }
.key { display: grid; gap: 4px; }
.krow { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; min-height: 26px; }
.krow small { color: var(--muted); font-variant-numeric: tabular-nums; }
.legend { position: absolute; left: 10px; bottom: 26px; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px;
  border: 1px solid var(--rule); background: var(--card); box-shadow: var(--shadow); cursor: pointer; font-size: 12.5px; color: var(--ink2); }
.legend .key { display: flex; gap: 4px; }
.legend .lt { font-weight: 600; }
.mapnote { position: absolute; left: 10px; bottom: 64px; z-index: 2; font-size: 12px; color: var(--muted); background: var(--card); border-radius: 8px; padding: 0 8px;
  pointer-events: none; }
.mapnote:empty { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 60; background: var(--ink); color: var(--panel);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); overflow-wrap: anywhere; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--shadow) !important; background: var(--card) !important; }
.maplibregl-ctrl-group button { width: 36px !important; height: 36px !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--rule) !important; }
:root[data-theme="dark"] .maplibregl-ctrl-icon { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .maplibregl-ctrl-icon { filter: invert(1); } }
.maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--card) 85%, transparent) !important; color: var(--muted); font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-popup-content { background: var(--card); color: var(--ink); font-family: var(--body); border-radius: 12px; padding: 12px 34px 12px 14px; box-shadow: var(--shadow); font-size: 14px; }
.maplibregl-popup-tip { border-top-color: var(--card) !important; border-bottom-color: var(--card) !important; }
.maplibregl-popup-close-button { width: 32px; height: 32px; font-size: 20px; color: var(--muted); }
.pop .pk { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pop .mut { color: var(--muted); font-size: 13px; }
.pop .acts { margin-top: 6px; }

/* ---------- phones: the panel is a bottom sheet over the map */
/* ---------- "by S1D Labs" beside the site name (brand kit ~/setup/brand: navy wordmark on light, white on dark) */
.by { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; min-height: 36px; color: var(--muted); font-size: 12px; text-decoration: none; }
.by img { display: block; height: 20px; width: auto; }
.by .wm-d { display: none; }
:root[data-theme="dark"] .by .wm-l { display: none; }
:root[data-theme="dark"] .by .wm-d { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .by .wm-l { display: none; } :root:not([data-theme="light"]) .by .wm-d { display: block; } }
@media (max-width: 420px) { .by span { display: none; } .by img { height: 16px; } }

@media (max-width: 760px) {
  .app { display: block; }
  .mapwrap { position: fixed; inset: 0; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; height: 52vh; border-right: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.14);
    transition: height .25s ease; padding-bottom: env(safe-area-inset-bottom, 0px); scrollbar-gutter: auto; }
  .panel.dragging { transition: none; }
  .grab { display: flex; justify-content: center; align-items: center; position: sticky; top: 0; z-index: 5; height: 22px; background: var(--panel); cursor: grab; touch-action: none; }
  .grab span { width: 42px; height: 5px; border-radius: 99px; background: var(--rule); }
  .top { top: 22px; padding: 0 14px 10px; }
  .brandrow { margin-bottom: 8px; touch-action: none; }
  .brand { font-size: 14px; }
  .view { padding: 12px 14px 32px; }
  .locbtn span { display: none; }
  .locbtn { width: 48px; justify-content: center; padding: 0; }
  .hero h1 { font-size: 32px; }
  .placehead h2 { font-size: 28px; }
  .maptools { top: calc(10px + env(safe-area-inset-top, 0px)); right: 56px; }
  .mapbtn span { display: none; }
  .mapbtn { width: 40px; padding: 0; justify-content: center; }
  .layers { position: fixed; top: calc(60px + env(safe-area-inset-top, 0px)); right: 12px; max-height: calc(100vh - 140px); }
  .legend, .mapnote { display: none; }
  .maplibregl-ctrl-top-right { top: env(safe-area-inset-top, 0px); }
  .maplibregl-ctrl-bottom-right { display: none; }
  .toast { bottom: auto; top: 16px; }
}
@media (max-width: 380px) {
  .probgrid { grid-template-columns: 1fr; }
  .bigacts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- print: the cards only, everything open */
@media print {
  body { overflow: visible; background: #fff; color: #000; font-size: 11pt; }
  .app { display: block; height: auto; }
  .mapwrap { position: fixed !important; left: -10000px; width: 800px; height: 600px; visibility: hidden; }
  .top, .grab, .actions, .probwrap, .toast, .skip, .links, .back, .acts .ghost, .wfilter, .tabs, .wardgrid, .pick, .missing p a { display: none !important; }
  .panel { position: static; height: auto !important; overflow: visible; border: 0; box-shadow: none; }
  .view { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; border-color: #bbb; }
  .printhead { display: grid; gap: 2px; border-bottom: 1px solid #999; padding-bottom: 6px; font-size: 10pt; }
  .printhead b { font-size: 14pt; }
  .btn.call { background: none; color: #000; border: 1px solid #999; }
  .fold > summary::after { display: none; }
  a { color: #000; }
}

/* directory (#org=): path, child list with counts */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; margin: 0 0 4px; font-size: 13.5px; min-width: 0; }
.crumbs .linkbtn { padding: 6px 2px; min-height: 36px; font-weight: 500; overflow-wrap: anywhere; text-align: left; }
.crumbs .sep { color: var(--muted); padding: 0 2px; }
.orglist { list-style: none; margin: 4px 0 0; padding: 0; }
.orglist li { border-top: 1px solid var(--rule2); }
.orglist li:first-child { border-top: 0; }
.orglist button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 8px 2px;
  background: none; border: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.orglist button:hover .on { color: var(--hi); }
.orglist .on { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.orglist .on small, .orglist .oc small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.orglist .oc { flex: none; text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.layers i.pt.osm { background: var(--paper); box-shadow: inset 0 0 0 2px var(--c); }
