/* Layout: fixed side panel of controls beside a full-height map; stacks on phones. */
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/public-sans.woff2) format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(fonts/source-serif-4.woff2) format('woff2'); }
:root {
  --bg: #f4f5f2; --panel: #ffffff; --fg: #1a2433; --muted: #4a5361; --line: #dde1dc;
  --accent: #1f3a5f; --inside: #c2541b; --in-bg: #f3f5f8; --out-bg: #f6faf7; --out-line: #2f6f62; --warn: #b3261e; --walk: #2f6f62; --home: #1f3a5f; --home-bg: #e6edf6;
  --paper: #f5f1e8; --rule: #d9d3c4; --card: #ffffff; --slide: #6b7280; --shops: #6b3fa0;
  --display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { --bg: #181613; --panel: #1f1c18; --fg: #ede7dc; --muted: #b8af9f; --line: #3a352e; --accent: #7fa6d6; --home: #9dbbe2; --home-bg: #2b2722; --inside: #e8834f; --in-bg: #26231f; --out-bg: #22251f; --out-line: #8cc4a8; --warn: #e3a857; --paper: #26221d; --rule: #3a352e; --card: #221f1b; --slide: #a8a092; --shops: #b892e0; color-scheme: dark; }
}
:root[data-theme=dark] { --bg: #181613; --panel: #1f1c18; --fg: #ede7dc; --muted: #b8af9f; --line: #3a352e; --accent: #7fa6d6; --home: #9dbbe2; --home-bg: #2b2722; --inside: #e8834f; --in-bg: #26231f; --out-bg: #22251f; --out-line: #8cc4a8; --warn: #e3a857; --paper: #26221d; --rule: #3a352e; --card: #221f1b; --slide: #a8a092; --shops: #b892e0; color-scheme: dark; }
:root[data-theme=light] { color-scheme: light; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.5 var(--body); }
.app { --panel-w: 460px; display: grid; grid-template-columns: var(--panel-w) 6px 1fr; height: 100%; }
.resizer { cursor: col-resize; background: var(--line); touch-action: none; }
.resizer:hover, .resizer.dragging { background: var(--accent); }
body.resizing { user-select: none; cursor: col-resize; }
.panel { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 20px 20px 28px; display: grid; gap: 18px; align-content: start; }
.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }
.brand h1 { font-family: var(--display); font-weight: 600; font-size: 26px; margin: 0; letter-spacing: -0.01em; }
.brand .sub { margin: 4px 0 0; color: var(--muted); }
.block { display: grid; gap: 8px; }
.lbl { font-size: 15px; font-weight: 600; color: var(--fg); }
select, input[type=number] { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--fg); }
input[type=number] { width: 6.5em; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; font: inherit; font-size: 13px; padding: 8px 6px; border: 0; background: transparent; color: var(--fg); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed=true] { background: var(--accent); color: var(--panel); font-weight: 600; }
.slider { display: flex; align-items: center; gap: 10px; }
.slider input { flex: 1; accent-color: var(--accent); }
.slider output { min-width: 5.5em; text-align: right; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; }
.chips button { font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--fg); cursor: pointer; }
.chips button[aria-pressed=true] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn { font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--panel); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.hint { margin: 0; color: var(--muted); font-size: 13.5px; }
.cap { color: var(--muted); font-size: 13px; }
.result { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.big { font-family: var(--display); font-size: 48px; line-height: 1; font-variant-numeric: tabular-nums; }
.big.loading { opacity: .4; }
.note { font-size: 13px; }
.status { font-size: 13px; color: var(--inside); }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 5px 5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
th .sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
th .sort:hover { color: var(--fg); }
th[aria-sort=ascending] .sort, th[aria-sort=descending] .sort { color: var(--fg); }
.num { text-align: right; }
tr.home td, tr.home th { font-weight: 700; color: var(--home); }
tr.home { background: var(--home-bg); }
.restaurant { display: grid; gap: 6px; }
.kv { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 13px; }
.kv b { font-variant-numeric: tabular-nums; text-align: right; margin-left: auto; }
.foot { color: var(--muted); font-size: 12px; }
.foot a { color: inherit; }
.legend { position: absolute; left: 12px; bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.legend .dot.in { background: var(--inside); }
.legend .dot.out { background: #8a8f98; opacity: .6; }
.legend .dot.lost { background: #7b4fc9; }
.legend .ring { display: inline-block; width: 14px; height: 0; border-top: 2px dashed var(--walk); margin-right: 5px; vertical-align: 3px; }
.legend .sq { display: inline-block; width: 14px; height: 3px; background: var(--walk); margin-right: 5px; vertical-align: 3px; }
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 55vh auto; height: auto; }
  .resizer { display: none; }
  .mapwrap { grid-row: 1; height: 55vh; }
  .panel { grid-row: 2; border-right: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.lost-btn { border-color: #7b4fc9; color: #7b4fc9; }
.lost-btn[aria-pressed=true] { background: #7b4fc9; color: #fff; }

/* collapsible tool sections */
.tool { border-top: 1px solid var(--line); padding-top: 10px; }
.tool > summary { cursor: pointer; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.tool > summary::before { content: '▸'; font-size: 11px; transition: transform .15s; }
.tool[open] > summary::before { transform: rotate(90deg); }
.tool > summary::-webkit-details-marker { display: none; }
.tool[open] > summary { margin-bottom: 10px; color: var(--fg); }
.tool > * + * { margin-top: 8px; }
.form { display: grid; grid-template-columns: 1fr 7em; gap: 6px 10px; align-items: center; font-size: 13px; }
.form input { width: 100%; }
/* side-by-side maps */
#map2 { position: absolute; top: 0; bottom: 0; right: 0; left: 50%; border-left: 2px solid var(--panel); }
.mapwrap.split #map { right: 50%; }
.maplabel { position: absolute; top: 10px; left: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 13px; font-weight: 600; }
.maplabel.right { left: calc(50% + 10px); }
/* print sheet */
#printSheet { display: none; }
@media print {
  @page { size: letter; margin: 0.5in; }
  body { background: #fff; color: #111; }
  .app { display: none !important; }
  #printSheet { display: block; font: 11pt/1.4 var(--body); color: #111; }
  #printSheet h1 { font-family: var(--display); font-size: 20pt; margin: 0 0 2pt; }
  #printSheet .sub { color: #444; margin: 0 0 8pt; }
  #printSheet .nums { display: flex; gap: 18pt; margin: 6pt 0 8pt; }
  #printSheet .nums b { display: block; font-family: var(--display); font-size: 22pt; }
  #printSheet .maps { display: flex; gap: 6pt; }
  #printSheet .maps img { width: 100%; max-height: 4.2in; object-fit: cover; border: 1px solid #ccc; }
  #printSheet table { font-size: 9pt; }
  #printSheet .small { font-size: 8pt; color: #444; }
}
.legend .dot.gained { background: #e0a100; }
.legend .sq.g0 { background: #0b4f9c; } .legend .sq.g1 { background: #3b86d1; } .legend .sq.g2 { background: #9cc3ea; }
.legend .box { display: inline-block; width: 12px; height: 10px; background: rgba(91,107,130,.35); border: 1px solid #5b6b82; margin-right: 5px; vertical-align: -1px; }
.garage-pin { width: 24px; height: 24px; border-radius: 4px; background: #0b4f9c; color: #fff; font: 700 14px/24px var(--body); text-align: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.chips.wrap { flex-wrap: wrap; }
textarea { font: inherit; font-size: 13px; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--fg); resize: vertical; }
input[type=text] { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--fg); }
@media print { #printSheet .notes { white-space: pre-wrap; border-left: 3px solid #999; padding-left: 8pt; } #printSheet .by { font-size: 9pt; color: #333; } }
.legend .sq.net { background: repeating-linear-gradient(90deg, #7a5c00 0 4px, transparent 4px 6px); opacity: .7; }

/* ---- v17: inputs vs. results, Basic/Advanced, accessibility ---- */
body.basic [data-adv] { display: none !important; }
.sr { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--accent); color: var(--panel); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
.ui-row { margin-top: 10px; }
.seg.small button { font-size: 13px; padding: 6px 14px; }
.seg.small { flex: 0 0 auto; }
.group { display: grid; gap: 14px; padding: 14px; border-radius: 10px; }
.group.inputs { background: var(--in-bg); border: 1px solid var(--line); }
.group.outputs { background: var(--out-bg); border: 1px solid var(--line); border-left: 4px solid var(--out-line); }
.group.outputs:focus { outline: none; }
.group.whatif, .group.share { border: 1px dashed var(--line); }
.group-h { margin: 0; font-family: var(--display); font-weight: 600; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--panel); font: 600 13px/1 var(--body); flex: none; }
.outputs .step { background: var(--out-line); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.card.tool { padding-top: 10px; }
.result.card { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 12px; display: grid; gap: 6px; }
.sentence { margin: 2px 0 0; font-size: 16px; font-weight: 500; }
div.outbox { border-left: 3px solid var(--out-line); background: var(--out-bg); padding: 8px 10px; border-radius: 0 6px 6px 0; display: grid; gap: 6px; font-size: 13px; }
div.outbox p { margin: 0; }
.out-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--out-line); }
fieldset.cols { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
fieldset.cols legend { font-size: 12px; color: var(--muted); padding: 0; margin-bottom: 4px; width: 100%; }
label.chk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; min-height: 28px; }
label.chk input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
td.basis { font-weight: 700; }
td.dim { color: var(--muted); font-style: italic; }
td.off { font-weight: 700; }
tr.grp th { padding-top: 10px; color: var(--fg); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tbody th { font-weight: 400; text-align: left; }
.maptip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--panel); padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: 0 2px 8px rgba(0,0,0,.25); z-index: 3; max-width: calc(100% - 24px); text-align: center; }
.adv-notice { font-size: 13px; background: var(--in-bg); border-radius: 6px; padding: 6px 8px; }
.linklike { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
/* Bigger, easier targets */
.seg button, .chips button, .btn { min-height: 36px; }
body.basic .seg button { min-height: 42px; font-size: 14px; }
/* Larger text: scales the whole panel */
body.big-text .panel { zoom: 1.25; }
body.big-text .legend, body.big-text .maptip { font-size: 15px; }
@media print { #printSheet h2 { font-family: var(--display); font-size: 13pt; margin: 10pt 0 3pt; } #printSheet table { margin-bottom: 3pt; } #printSheet td.off { font-weight: 700; } #printSheet tr.grp th { font-weight: 700; } }
.panel { grid-template-columns: minmax(0, 1fr); position: relative; overscroll-behavior: contain; overflow-x: clip; }
.group, .card, .block, .tool { min-width: 0; }
.group { grid-template-columns: minmax(0, 1fr); }

/* ---- v17 review fixes ---- */
summary h3 { display: inline; font: inherit; margin: 0; }
.tool > summary { min-height: 36px; padding: 6px 0; font-size: 12.5px; }
th .sort { padding: 6px 2px; min-height: 30px; }
tbody th[scope=row] { white-space: normal; min-width: 8em; }
#sideTable td, #slideCheck td { white-space: nowrap; }
.callout { margin: 0; font-size: 15px; background: var(--home-bg); border-radius: 6px; padding: 8px 10px; }
.callout b { font-family: var(--display); font-size: 20px; }
input.wide { width: 100%; }
.answer-bar { position: sticky; top: -20px; z-index: 4; margin: -20px -20px 0; padding: 8px 20px; background: var(--accent); color: var(--panel); font-size: 13.5px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.answer-bar b { font-family: var(--display); font-size: 18px; }
.legend .dot.outside { background: #8a8f98; opacity: .6; }
.cmp-foot { font-size: 12px; }
@media (pointer: coarse) {
  th .sort { padding: 12px 4px; }
  .tool > summary { min-height: 44px; }
  .btn, .seg button, .chips button { min-height: 44px; }
  label.chk { min-height: 40px; }
  input[type=range] { height: 32px; }
}
@media (max-width: 1023px) {
  .legend { font-size: 11px; gap: 4px 10px; padding: 4px 8px; left: 6px; right: 6px; bottom: 6px; max-height: 3.4em; overflow: auto; }
  .mapwrap.split #map { right: 0; bottom: 50%; }
  #map2 { left: 0; top: 50%; border-left: 0; border-top: 2px solid var(--panel); }
  .maplabel.right { left: 10px; top: calc(50% + 10px); }
  .panel { overflow-y: visible; }
  .answer-bar { top: 0; margin: -20px -20px 0; }
}
.answer-bar { cursor: pointer; } .answer-bar .go { text-decoration: underline; white-space: nowrap; }
#compare td.vs { white-space: normal; min-width: 4.5em; } #compare th .sort { white-space: normal; text-align: inherit; }
/* ---- v18 ---- */
.seg button small { display: block; font-size: 11.5px; font-weight: 400; font-style: italic; opacity: .85; margin-top: 1px; }
.switch { font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--fg); cursor: pointer; padding: 6px 4px; min-height: 36px; }
.switch .knob { width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
.switch[aria-checked=true] .knob { background: var(--accent); }
.switch[aria-checked=true] .knob::after { left: 16px; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
tr.home td.off, td.off { font-weight: 700; }
.mapwrap.split #map .maplibregl-ctrl-attrib { display: none; }
.loading-pill { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; display: flex; align-items: center; gap: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.18); z-index: 3; }
.loading-pill[hidden] { display: none; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
.btn.busy { opacity: .7; cursor: progress; }
/* rank chart: two small multiples, each scaled to its own top town */
.rankchart { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.rankchart h4 { margin: 0 0 2px; font-size: 12.5px; font-weight: 600; }
.rankchart .sub { font-size: 11.5px; color: var(--muted); margin: 0 0 6px; }
.rankchart .bar { display: grid; grid-template-columns: 6.6em 1fr; align-items: center; gap: 6px; font-size: 11.5px; height: 18px; }
.rankchart .bar .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.rankchart .bar .track { position: relative; height: 12px; }
.rankchart .bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: #b9c0c9; border-radius: 0 4px 4px 0; }
.rankchart .bar .val { position: absolute; top: -1px; font-size: 11px; color: var(--muted); white-space: nowrap; padding-left: 4px; font-variant-numeric: tabular-nums; }
.rankchart .bar.home .nm, .rankchart .bar.home .val { color: var(--home); font-weight: 700; }
.rankchart .bar.home .fill { background: var(--home); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .rankchart .bar .fill { background: #4a525d; } }
:root[data-theme=dark] .rankchart .bar .fill { background: #4a525d; }
@media (max-width: 420px) { .rankchart { grid-template-columns: 1fr; } }
@media (pointer: coarse) {
  select, input[type=number], input[type=text], .switch, label.chk, th .sort { min-height: 44px; }
  input[type=range] { height: 44px; }
  .maplibregl-ctrl-group button { width: 44px !important; height: 44px !important; }
  .maplibregl-ctrl-attrib-button { width: 44px !important; height: 44px !important; }
}
.warn { margin: 0 0 6px; color: var(--warn); font-size: 13px; }
@media (pointer: coarse) { .seg button, .chips button, .btn, th .sort, .linklike { min-width: 44px; } }
/* ---- v20: section headers are clear accordion buttons on every browser (WebKit ignores display:flex on <summary>) ---- */
.tool > summary { display: block; position: relative; padding: 10px 76px 10px 0; min-height: 44px; line-height: 1.35; }
.tool > summary::before { content: ''; display: inline-block; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin: 0 10px 2px 2px; vertical-align: middle; transition: transform .15s; }
.tool[open] > summary::before { transform: rotate(45deg); }
.tool > summary::after { content: 'Show'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 3px 12px; }
.tool[open] > summary::after { content: 'Hide'; }
.tool > summary:hover::after { background: var(--accent); color: var(--panel); }
summary::marker { content: ''; }
@media print { .tool > summary::after { display: none; } }
@media print {
  #printSheet .ps { break-inside: avoid; page-break-inside: avoid; margin-bottom: 8pt; }
  #printSheet .settings-page { break-before: page; page-break-before: always; }
  #printSheet table.settings { width: 100%; border-collapse: collapse; }
  #printSheet table.settings { table-layout: fixed; }
  #printSheet table.settings th { text-align: left; width: 1.9in; vertical-align: top; padding: 2pt 8pt 2pt 0; font-weight: 600; white-space: normal; }
  #printSheet table.settings td { padding: 2pt 0; white-space: normal; overflow-wrap: anywhere; }
  #printSheet table.settings tr { border-bottom: 1px solid #ddd; }
  #printSheet .reopen { display: flex; gap: 12pt; align-items: flex-start; margin-top: 10pt; }
  #printSheet .reopen .qr { width: 1.4in; height: 1.4in; image-rendering: pixelated; flex: none; }
  #printSheet .reopen .link { font-size: 8pt; word-break: break-all; font-family: ui-monospace, Menlo, monospace; }
  #printSheet h2 { break-after: avoid; page-break-after: avoid; }
  #printSheet .maps.one img { max-height: 5in; }
  #printSheet .maps img { width: 50%; }
  #printSheet .maps.one img { width: 100%; }
}
@media (pointer: coarse) { #dataTool a, .foot a { display: inline-block; min-height: 44px; line-height: 44px; } }
#csvButtons { flex-wrap: wrap; }
/* ---- v28 ---- */
.map-close { position: absolute; top: 10px; right: 56px; z-index: 3; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.map-close:hover { background: var(--accent); color: var(--panel); }
.total-space { margin: 0; font-size: 14px; background: var(--in-bg); border-radius: 6px; padding: 6px 10px; }
.group-h .group-toggle { all: unset; display: flex; align-items: center; gap: 8px; width: 100%; cursor: pointer; }
.group-h .group-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.group-h .chev { margin-left: auto; font-size: 12px; font-family: var(--body); font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 2px 10px; }
body.basic .group-h .chev { display: none; }
body.basic .group-h .group-toggle { cursor: default; }
body.adv .group.collapsed > :not(.group-h) { display: none !important; }
@media (max-width: 1023px) { .map-close { right: 10px; top: auto; bottom: calc(50% + 10px); } }
#luTable .sep { border-left: 2px solid var(--line); }
#luTable .tot { border-left: 2px solid var(--fg); font-weight: 700; }
#luTable th .sort { white-space: normal; text-align: inherit; }
@media (pointer: coarse) { .group-h .group-toggle { min-height: 44px; } }
@media (pointer: coarse) { .map-close { min-height: 44px; } } .chips[role=group] { flex-wrap: wrap; }

/* saved settings */
.saved { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 8px; }
.saved li { border: 1px solid var(--line, #ddd); border-radius: 6px; padding: 8px 10px; }
.saved li.hint { border: 0; padding: 0; }
.saved li b { display: block; }
.saved .row { margin-top: 6px; gap: 8px; }

/* start-over picker and the slide check's fixed-method note */
.preset-pick { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.preset-pick label { font-size: 14px; color: var(--muted); }
.preset-pick select { max-width: 100%; font: inherit; padding: 4px 6px; }
.fixed-note { margin: 6px 0; padding: 8px 10px; border-left: 4px solid var(--accent); background: var(--in-bg); font-size: 15px; }
.fixed-note.same { border-left-color: var(--home); background: var(--home-bg); }
.saved li.builtin { border-style: dashed; }
@media (pointer: coarse) { .preset-pick select { min-height: 44px; } }

/* ---- v42: senior-friendly pass ---- */
/* Section headings in sentence case and full-strength color */
.tool > summary, .tool > summary h3 { text-transform: none; letter-spacing: 0; }
.tool > summary { font-size: 15px; color: var(--fg); }
body.adv .basic-only { display: none !important; }
.byline { margin: 6px 0 0; font-size: 14px; color: var(--fg); }
.big-switch { font-size: 15px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.ui-row .btn { font-size: 14px; }
/* Phones: the map sits in the page (app.js moves it) */
@media (max-width: 1023px) {
  .app { grid-template-rows: auto; }
  .panel { grid-row: 1; }
  .panel .mapwrap { grid-row: auto; height: 45vh; min-height: 260px; margin: 0 -20px; }
}
/* Phones: wide tables become one card per row, each value labeled with its column heading */
@media (max-width: 600px) {
  table.cards, table.cards tbody, table.cards tr, table.cards td, table.cards tbody th { display: block; }
  table.cards { font-size: 15px; }
  table.cards thead tr { display: flex; flex-wrap: wrap; gap: 4px 6px; }
  table.cards thead th { border: 0; padding: 0; }
  table.cards thead th:not(:has(.sort)) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cards thead th .sort { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: var(--fg); }
  table.cards tbody tr { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
  table.cards tbody tr.grp { border: 0; padding: 0; margin-top: 12px; }
  table.cards td, table.cards tbody th { border: 0; padding: 3px 0; white-space: normal; text-align: left; }
  table.cards tbody th[scope=row] { font-weight: 700; font-size: 16px; min-width: 0; padding-bottom: 4px; }
  table.cards tbody tr { display: flex; flex-direction: column; }
  table.cards tbody th[scope=row] { order: -1; }
  table.cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; white-space: normal !important; }
  table.cards td::before { content: attr(data-label); color: var(--fg); font-weight: 400; text-align: left; flex: none; max-width: 55%; }
  table.cards td[data-label="#"]::before { content: 'Rank'; }
  table.cards thead tr:has(.sort)::before { content: 'Sort by'; align-self: center; font-size: 14px; }
  table.cards td[data-label=""]::before { content: none; }
  table.cards td.num { text-align: right; }
  #compare td.vs { min-width: 0; }
}
/* Larger text zooms the panel; the map inside it on phones stays at normal scale so taps land where they should */
body.big-text .panel .mapwrap { zoom: .8; margin: 0 -25px; }
body.big-text .panel .mapwrap .legend { font-size: 18px; }

/* ---- v43: the report ---- */
body.adv .basic-only { display: none !important; }
body.basic #answerBar { display: none !important; }
.report { display: grid; gap: 22px; }
.rp-sec { display: grid; gap: 10px; }
.rp-sec + .rp-sec { border-top: 1px solid var(--line); padding-top: 18px; }
.rp-kicker { margin: 0; font-size: 14px; font-weight: 600; color: var(--accent); }
.report h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.2; }
.report h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.25; }
.rp-answer { margin: 0; font-size: 19px; line-height: 1.4; }
.rp-answer b { display: block; font-family: var(--display); font-size: 44px; line-height: 1.05; color: var(--home); }
.rp-text { margin: 0; font-size: 16px; line-height: 1.55; }
.report .btn { font-size: 15px; padding: 8px 14px; }
.rp-list { margin: 0; padding-left: 20px; font-size: 16px; line-height: 1.55; display: grid; gap: 6px; }
.rp-who { margin: 0; font-size: 14px; }
#rpSlide { font-size: 15px; }
#rpSlide td.off { font-weight: 700; }
/* single ranked bar chart, larger type for reading */
.rankchart.one { grid-template-columns: 1fr; }
.rankchart.one h4 { font-size: 15px; }
.rankchart.one .sub { font-size: 14px; color: var(--fg); }
.rankchart.one .bar { grid-template-columns: 8.2em 1fr; font-size: 14px; height: 24px; }
.rankchart.one .bar .nm { color: var(--fg); }
.rankchart.one .bar .track { height: 16px; }
.rankchart.one .bar .val { font-size: 14px; color: var(--fg); top: -1px; }
@media print {
  #printSheet .rp-print h2 { font-size: 15pt; margin: 4pt 0; }
  #printSheet .rp-print h3 { font-family: var(--display); font-size: 13pt; margin: 8pt 0 3pt; }
  #printSheet .rp-print p, #printSheet .rp-print blockquote { margin: 0 0 4pt; font-size: 10.5pt; }
  #printSheet .rp-print .rp-answer b { font-size: 22pt; display: block; }
  #printSheet .rp-print .rp-kicker { display: none; }
  #printSheet .rankchart.one { display: block; max-width: 5.5in; }
  #printSheet .rankchart .bar { height: 14pt; font-size: 9pt; }
  #printSheet .rankchart .bar .fill { background: #b9c0c9; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printSheet .rankchart .bar.home .fill { background: #17803d; }
}
#rpSlide td:last-child { white-space: normal; min-width: 6.5em; }
#rpSlide th, #rpSlide td { padding: 6px 5px; }
/* place labels on the report's map */
.lm-label { pointer-events: none; font: 600 12px/1.2 var(--body); color: #1d2530; background: rgba(255,255,255,.9); border-radius: 4px; padding: 2px 6px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.lm-label.lm-shops { border-left: 3px solid #c2541b; }
.lm-label.lm-park { border-left: 3px solid #2f6f62; }
.lm-label.lm-civic { border-left: 3px solid #1f3b57; }
body.big-text .lm-label { font-size: 15px; }
@media print { #printSheet .rp-print .maps img { width: auto; max-width: 100%; max-height: 4.6in; object-fit: contain; display: block; margin: 0 auto; } }

/* ---- v45: report opening, slopegraph, small multiples; Northbrook in dark ink in the report ---- */
.rp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rp-pair > div { display: grid; grid-template-rows: 1fr auto; gap: 2px; }
.rp-pair .lab { font-size: 14px; }
.rp-pair b { font-family: var(--display); font-size: 42px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rp-fig { margin: 0; }
.rp-figcap { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.slope { max-width: 460px; }
.slope .sl-h { font: 600 12px var(--body); fill: var(--fg); }
.slope .sl-t { font: 12px var(--body); fill: var(--muted); font-variant-numeric: tabular-nums; }
.slope .sl-t.home { font-weight: 700; fill: var(--fg); }
.slope .sl-line { stroke: #9aa3ad; stroke-width: 1.5; }
.slope .sl-line.home { stroke: var(--fg); stroke-width: 3; }
.slope .sl-dot { fill: #9aa3ad; } .slope .sl-dot.home { fill: var(--fg); }
.rp-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--fg); }
.rankchart.three { grid-template-columns: 1fr; gap: 18px; }
.report .rankchart .bar.home .fill { background: var(--fg); }
.report .rankchart .bar.home .nm, .report .rankchart .bar.home .val { color: var(--fg); }
.report .rankchart .sub { color: var(--fg); }
.report .rankchart h4 { font-size: 15px; }
.report .rankchart .bar { grid-template-columns: 8.2em 1fr; font-size: 14px; height: 24px; }
.report .rankchart .bar .nm { color: var(--fg); }
.report .rankchart .bar .track { height: 16px; }
.report .rankchart .bar .val { font-size: 14px; color: var(--fg); }
#rpSlide tr.home td, #rpSlide tr.home th, #rpPlazaTable tr.home td { color: var(--fg); }
#rpSlide tr.home { background: var(--in-bg); }
#rpPlazaTable td.num { white-space: normal; }
.legend .dot.station { background: #1f3b57; border: 2px solid #fff; box-shadow: 0 0 0 1px #1f3b57; }
.legend .dot.sz5 { width: 5px; height: 5px; } .legend .dot.sz25 { width: 8px; height: 8px; margin-left: 6px; } .legend .dot.sz100 { width: 15px; height: 15px; margin-left: 6px; vertical-align: -3px; }
.lm-label.lm-station { border-left: 3px solid #1f3b57; font-weight: 700; }
@media print {
  #printSheet .rp-print { break-inside: auto; page-break-inside: auto; }
  #printSheet .rp-print .rankchart, #printSheet .rp-print table, #printSheet .rp-print .rp-fig, #printSheet .rp-print .maps { break-inside: avoid; page-break-inside: avoid; }
  #printSheet .rp-print p, #printSheet .rp-print li { font-size: 11pt; }
  #printSheet .rp-print .rp-note, #printSheet .rp-print .hint { font-size: 9.5pt; color: #222; }
  #printSheet .rp-print .rp-pair b { font-size: 24pt; }
  #printSheet .rp-print .slope { max-width: 4.2in; }
  #printSheet .rp-print .rankchart.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10pt; max-width: none; }
  #printSheet .rp-print .rankchart.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10pt; max-width: none; }
  #printSheet .rankchart .bar .nm, #printSheet .rankchart .bar .val { font-size: 9pt; }
  #printSheet .rankchart .bar.home .fill { background: #111; }
  #printSheet .slope .sl-line.home { stroke: #111; }
}
.rankchart.two { grid-template-columns: 1fr; gap: 18px; }
.slope { max-width: 520px; }
#rpSlide th:first-child { min-width: 7em; }
.slope .sl-t { font-size: 14px; } .slope .sl-h { font-size: 14px; }
@media print { #printSheet .rp-print .bar.home .nm, #printSheet .rp-print .bar.home .val, #printSheet .rp-print tr.home td, #printSheet .rp-print tr.home th { color: #111 !important; } #printSheet .rp-print tr.home { background: #eee; } }
.report, .rp-sec { min-width: 0; grid-template-columns: minmax(0, 1fr); }
#drawBtn.drawing { background: #fff4d6; color: #1d2530; font-weight: 700; }
body.basic #drawBtn { display: none; }
/* theme picker */
.theme-pick { display: inline-flex; align-items: center; gap: 6px; }
.theme-pick .lbl2 { font-size: 14px; }
.seg.tiny button { font-size: 13px; padding: 6px 10px; flex: 0 0 auto; }
.lm-label { color: #1d2530; }
/* before/after maps and land-use key */
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .ba { grid-template-columns: 1fr; } }
.ba-h { margin: 0 0 4px; font-weight: 700; font-size: 15px; }
.ba-map svg { display: block; border: 1px solid var(--line); border-radius: 4px; }
.ba-bg { fill: #fbfaf7; }
.ba-lu { stroke: #fff; stroke-width: .4; }
.ba-plan { stroke: #1d2530; stroke-width: .6; }
.ba-outline { fill: none; stroke: #1d2530; stroke-width: 2; }
.ba-station { fill: #1f3b57; stroke: #fff; stroke-width: 2; }
.ba-t { font: 600 12px var(--body); fill: #1d2530; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.ba-cap { margin: 0; }
.ba-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; margin-top: 6px; }
.ba-key i, .legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
@media print { #printSheet .rp-print .ba { grid-template-columns: 1fr 1fr; } #printSheet .ba-cap { font-size: 10pt; } }
/* the report's summary and the "all the numbers" section */
.rp-more > summary h3 { display: inline; font-family: var(--display); font-size: 19px; }
.rp-more[open] { display: grid; gap: 22px; }
.rp-more { border-top: 1px solid var(--line); padding-top: 12px; }
.share-row a.btn { text-decoration: none; display: inline-flex; align-items: center; }
@media print { #printSheet .rp-more { display: block; } }
.rp-about p { margin: 0 0 8px; } .rp-about p:last-child { margin: 0; }
.rp-more > summary h3 { font-size: 18px; text-transform: none; letter-spacing: 0; }

/* ---- v49: one type system, a cover, figure cards, full-width disclosure rows ---- */
/* Type scale: kicker 14 · H1 34 · H2 26 · H3 20 · big numbers 56 · body 18 · captions 16. Two fonts:
   Source Serif 4 for the headline and section titles only, Public Sans for everything else. */
.hint, .cap, .note, .status, .foot { font-size: 15px; }
table { font-size: 14px; }
.brand { display: grid; gap: 12px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
.brand h1 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0; }
body.adv .brand h1 { font-size: 26px; }
.aa { position: relative; }
.aa > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border: 1px solid var(--rule); border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--fg); }
.aa > summary::-webkit-details-marker { display: none; }
.aa-glyph { font-family: var(--display); font-weight: 700; font-size: 18px; }
.aa[open] > summary { background: var(--accent); color: var(--panel); border-color: var(--accent); }
.aa-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 14px; display: grid; gap: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.16); width: max-content; max-width: min(320px, 86vw); }
.seg.tabs { border-radius: 10px; }
.seg.tabs button { font-size: 16px; min-height: 48px; font-weight: 600; }
.trust { display: grid; gap: 2px; font-size: 16px; line-height: 1.45; }
.trust p { margin: 0; }
.trust .byline { font-size: 16px; }
.contact-line { color: var(--muted); }
.contact-line a, .rp-about a { color: var(--accent); font-weight: 600; }
body.basic .brand .sub { display: none; }

/* Key findings */
.report { gap: 40px; }
.report .rp-sec + .rp-sec:not(.rp-card):not(.rp-next):not(.rp-about) { border-top: 0; padding-top: 0; }
.rp-sec { gap: 14px; }
.rp-kicker { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.report h2 { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.15; letter-spacing: -0.005em; }
.report h3 { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.2; }
.report h4 { margin: 8px 0 0; font-size: 20px; font-weight: 700; }
.rp-text, .rp-list, .rp-about p { font-size: 18px; line-height: 1.55; }
.rp-note, .rp-figcap, .ba-cap { font-size: 16px; line-height: 1.5; color: var(--muted); font-weight: 400; }
.rp-answer { font-size: 20px; line-height: 1.45; font-weight: 600; }
.report .btn { font-size: 17px; min-height: 48px; padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.report .btn.big { font-size: 18px; min-height: 56px; padding: 12px 20px; }
/* the cover: a full-width paper band with the question, the two numbers to scale, and one sentence */
.rp-cover { background: var(--paper); margin: 0 -20px; padding: 28px 20px 24px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); gap: 16px; }
.vs { display: grid; gap: 18px; margin: 4px 0; }
.vs-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 12px; }
.vs-row .lab { font-size: 16px; font-weight: 600; line-height: 1.3; }
.vs-num { font: 800 56px/1 var(--body); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.02em; }
.vs-slide .vs-num { color: var(--slide); }
.vs-census .vs-num { color: var(--accent); }
.vs-track { grid-column: 1 / -1; position: relative; height: 18px; margin-top: 6px; }
.vs-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 100%); border-radius: 0 4px 4px 0; }
.vs-slide .vs-fill { background: repeating-linear-gradient(-45deg, var(--paper) 0 3px, transparent 3px 7px), var(--slide); border: 2px solid var(--slide); }
.vs-census .vs-fill { background: var(--accent); }
.vs-gap { position: absolute; top: -2px; bottom: -2px; left: var(--w, 100%); right: 0; border: 2px dashed var(--warn); border-left: 0; border-radius: 0 4px 4px 0; }
.vs-gap:empty { display: none; }
.vs-gap::after { content: attr(data-label); position: absolute; right: 0; top: calc(100% + 6px); font: 700 16px/1.2 var(--body); color: var(--warn); white-space: nowrap; }
.vs-slide { padding-bottom: 22px; }
.rp-dateline { margin: 0; font-size: 15px; color: var(--muted); }
/* figure cards */
.rp-card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 20px; }
.rp-fig { display: grid; gap: 10px; }
.slope { max-width: none; }
.ba-stat { margin: 0; font-size: 18px; line-height: 1.5; }
.ba-stat b { font-weight: 800; }
.ba { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.ba-panel { display: grid; gap: 6px; align-content: start; }
.ba-h { margin: 0; font-size: 20px; font-weight: 700; }
.ba-map svg { border: 1px solid var(--rule); border-radius: 8px; background: #fbfaf7; }
.ba-num { margin: 0; font: 800 34px/1.05 var(--body); font-variant-numeric: tabular-nums; color: var(--shops); }
.ba-num small { display: block; font-size: 16px; font-weight: 600; color: var(--fg); margin-top: 2px; }
.ba-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; font-size: 16px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--rule); }
.ba-key span, .legend span { display: inline-flex; align-items: center; gap: 8px; line-height: 1.3; }
.ba-key svg, .legend svg.sw { flex: none; }
.ba-t { font: 600 13px var(--body); fill: #1a2433; paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round; }
.ba-t.big { font-size: 14px; font-weight: 700; }
.ba-lead { stroke: #1a2433; stroke-width: 1.2; fill: none; }
.ba-tag { font: 600 11px var(--body); fill: #4a5361; }
/* the invitation to dig in */
.rp-next { border: 2px solid var(--accent); border-radius: 12px; padding: 20px; background: var(--card); }
.rp-proof { margin: 0; font: 700 17px/1.4 var(--body); color: var(--accent); }
/* share bar */
.share-more > summary { cursor: pointer; font-size: 16px; color: var(--accent); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.share-more[open] > summary { margin-bottom: 8px; }
.rp-about { border-top: 1px solid var(--rule) !important; padding-top: 24px !important; }

/* Disclosure rows: the whole row is the control, with one chevron on the right */
.tool > summary { display: block; position: relative; min-height: 56px; padding: 14px 44px 14px 0; line-height: 1.35; font-size: 17px; font-weight: 600; }
.tool > summary::before { content: none; }
.tool > summary::after, .tool[open] > summary::after { content: ''; position: absolute; right: 10px; top: 50%; width: 10px; height: 10px; padding: 0; border: 0; border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); border-radius: 0; background: none; transform: translateY(-75%) rotate(45deg); transition: transform .15s; }
.tool[open] > summary::after { transform: translateY(-25%) rotate(-135deg); }
.tool > summary:hover { background: var(--in-bg); }
.tool > summary:hover::after { background: none; }
.tool > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.rp-more { border: 1px solid var(--rule); border-radius: 12px; padding: 0 16px; }
.rp-more > summary { min-height: 72px; padding: 16px 44px 16px 0; }
.rp-more > summary h3 { display: block; font-family: var(--display); font-size: 24px; font-weight: 600; }
.rp-more .sum-sub { display: block; font-size: 16px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.rp-more[open] { padding-bottom: 20px; }
.rp-more[open] > .rp-sec { border-top: 1px solid var(--rule); padding-top: 20px; }
.rp-more .rp-sec h3 { font-size: 22px; }

/* Map card: on phones the map, its key and its caption sit together in one outlined card */
.map-card { border: 1px solid var(--rule); border-radius: 12px; background: var(--card); overflow: hidden; display: grid; }
.map-card .mapcard-h { margin: 0; padding: 16px 16px 10px; font: 700 20px/1.3 var(--body); }
.map-card .mapwrap { margin: 0 !important; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.map-card .legend { position: static; border: 0; border-radius: 0; background: transparent; max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 14px 16px; font-size: 16px; left: auto; right: auto; bottom: auto; }
.map-card .legend span { min-width: 0; }
.map-card .mapcard-cap { margin: 0; padding: 0 16px 16px; font-size: 16px; color: var(--muted); line-height: 1.5; }
body.adv .map-card .mapcard-h, body.adv .map-card .mapcard-cap { display: none; }
@media (max-width: 380px) { .map-card .legend { grid-template-columns: 1fr; } }
body.big-text .panel .map-card .mapwrap { margin: 0 !important; }
.legend .sw { width: 18px; height: 14px; border-radius: 3px; }
.legend .dot.sz100 { margin-left: 0; }
.legend .sizes { gap: 6px; }

/* Explore: one card style; the home town highlighted in neutral blue, not green */
.group.whatif, .group.share { border: 1px solid var(--line); }
.group-h { font-size: 22px; }

@media print {
  #printSheet .trustline { font-size: 9.5pt; color: #222; border-bottom: 1px solid #999; padding-bottom: 4pt; margin: 0 0 8pt; }
  #printSheet h1, #printSheet h2, #printSheet h3, #printSheet .rp-print h3, #printSheet .rp-print h4 { break-after: avoid; page-break-after: avoid; }
  #printSheet .rp-print .rp-cover { background: none; margin: 0; padding: 0; border: 0; }
  #printSheet .rp-print .rp-card { border: 0; padding: 0; }
  #printSheet .rp-print .vs-num { font-size: 24pt; }
  #printSheet .rp-print h2 { font-family: var(--display); }
  #printSheet .vs-fill, #printSheet .vs-gap, #printSheet .ba-key svg, #printSheet .ba-map svg, #printSheet .rankchart .fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printSheet .rp-print .ba { grid-template-columns: 1fr 1fr; }
  #printSheet .rp-print .ba-num { font-size: 18pt; }
  #printSheet .rp-print .ba-key { font-size: 9.5pt; }
  #printSheet .rp-print .rp-about h4 { font-size: 12pt; margin: 6pt 0 2pt; }
}
/* the private message box */
.fb-form { display: grid; gap: 6px; }
.fb-form label { font-size: 17px; font-weight: 600; margin-top: 8px; }
.fb-form .opt { font-weight: 400; color: var(--muted); }
.fb-form textarea, .fb-form input[type=text], .fb-form input[type=email], .fb-form select { font: inherit; font-size: 18px; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #8a93a0; border-radius: 8px; background: var(--panel); color: var(--fg); }
.fb-form textarea { min-height: 150px; line-height: 1.5; }
.fb-form .btn { margin-top: 12px; width: 100%; }
.fb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fb-status { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.fb-status.err { color: var(--warn); }
.fb-done { display: grid; gap: 10px; }
#fbHuman:empty { display: none; }
@media print { #printSheet .rp-feedback { display: none; } }
/* dumbbell: slide (hollow) vs Census (solid) per town */
.dumbbell { display: grid; gap: 14px; }
.db-row { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.db-row:last-child { border-bottom: 0; padding-bottom: 0; }
.db-name { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 18px; }
.db-diff { font-size: 16px; color: var(--muted); }
.db-diff.off { color: var(--warn); font-weight: 700; }
.db-row.home .db-name b { font-size: 20px; }
.db-vals { display: flex; justify-content: space-between; font-size: 16px; color: var(--muted); }
.db-vals b { color: var(--fg); font-variant-numeric: tabular-nums; }
.dumbbell .db-axis { stroke: var(--rule); stroke-width: 1; }
.dumbbell .db-link { stroke: var(--slide); stroke-width: 3; }
.dumbbell .db-a { fill: var(--card); stroke: var(--slide); stroke-width: 2.5; }
.dumbbell .db-b { fill: var(--accent); }
.db-row.home .db-link { stroke: var(--fg); stroke-width: 4; }
.db-legend { display: block; margin-top: 4px; }
.db-k { display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: -1px; margin: 0 4px 0 6px; }
.db-k.hollow { border: 2.5px solid var(--slide); background: var(--card); }
.db-k.solid { background: var(--accent); }
figure.map-card { margin: 0; }
.map-card .legend .sizes { grid-column: 1 / -1; }
.legend .ring { width: 20px; border-top-width: 2.5px; }
@media print { #printSheet .db-row { break-inside: avoid; } #printSheet .dumbbell { max-width: 5in; } #printSheet .db-a, #printSheet .db-b, #printSheet .db-k { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media print {
  #printSheet .rp-print.keep { break-inside: avoid; page-break-inside: avoid; }
  #printSheet .rp-print .maps.one img { max-height: 3.5in; }
}
/* Phones and tablets (iPad in portrait): one column, the map in the page, a comfortable reading width */
@media (max-width: 1023px) {
  .panel { --gut: max(20px, calc((100vw - 720px) / 2)); padding-left: var(--gut); padding-right: var(--gut); }
  .rp-cover { margin-left: calc(-1 * var(--gut)); margin-right: calc(-1 * var(--gut)); padding-left: var(--gut); padding-right: var(--gut); }
  .answer-bar { margin-left: calc(-1 * var(--gut)); margin-right: calc(-1 * var(--gut)); padding-left: var(--gut); padding-right: var(--gut); }
  .map-card .mapwrap { max-height: 560px; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  .report h2 { font-size: 42px; }
  .vs-num { font-size: 64px; }
}
@media (pointer: coarse) {
  .contact-line a, .rp-about a, .share-more > summary { display: inline-block; min-height: 44px; line-height: 44px; }
}
.db-track { position: relative; height: 16px; margin: 14px 8px 12px; border-top: 1px solid var(--rule); }
.db-track i { position: absolute; display: block; }
.db-track .db-link { top: -2.5px; height: 4px; background: var(--slide); }
.db-row.home .db-track .db-link { background: var(--fg); top: -3px; height: 5px; }
.db-track .db-a, .db-track .db-b { top: -9px; width: 17px; height: 17px; margin-left: -8.5px; border-radius: 50%; box-sizing: border-box; }
.db-track .db-a { background: var(--card); border: 3px solid var(--slide); z-index: 1; }
.db-track .db-b { background: var(--accent); }
@media print { #printSheet .db-track i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---- v50 ---- */
/* dark mode: warm charcoal like the paper version; the selected tab is a dark chip with a blue underline, not a pastel fill */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .seg.tabs button[aria-pressed=true] { background: #2f3a4a; color: var(--fg); box-shadow: inset 0 -3px 0 var(--accent); }
  :root:not([data-theme=light]) #map canvas, :root:not([data-theme=light]) .ba-map svg { filter: brightness(.86); }
}
:root[data-theme=dark] .seg.tabs button[aria-pressed=true] { background: #2f3a4a; color: var(--fg); box-shadow: inset 0 -3px 0 var(--accent); }
:root[data-theme=dark] #map canvas, :root[data-theme=dark] .ba-map svg { filter: brightness(.86); }
/* the cover's gap: dashed outline in ink, not alarm red */
.vs-gap { border-color: var(--fg); }
.vs-gap::after { color: var(--fg); }
/* the slide vs. the Census, two bars per town (same look as the cover) */
.tb { display: grid; gap: 20px; }
.tb-town { display: grid; gap: 6px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.tb-town:last-child { border-bottom: 0; padding-bottom: 0; }
.tb-town.home { background: var(--paper); border: 0; border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; padding: 14px 14px 16px 14px; }
.tb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.tb-name { font-size: 19px; font-weight: 700; }
.tb-town.home .tb-name { font-size: 21px; }
.tb-verdict { font-size: 17px; font-weight: 600; }
.tb-verdict.ok { font-weight: 400; color: var(--muted); }
.tb-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; }
.tb-row .lab { font-size: 16px; }
.tb-track { position: relative; height: 18px; margin-right: 64px; }
.tb-track .tb-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 0 3px 3px 0; }
.tb-slide .tb-fill { background: repeating-linear-gradient(-45deg, var(--card) 0 3px, transparent 3px 7px), var(--slide); border: 2px solid var(--slide); }
.tb-town.home .tb-slide .tb-fill { background: repeating-linear-gradient(-45deg, var(--paper) 0 3px, transparent 3px 7px), var(--slide); }
.tb-census .tb-fill { background: var(--accent); }
.tb-track .tb-num { position: absolute; left: calc(var(--w) + 8px); top: 50%; transform: translateY(-50%); font: 700 18px/1 var(--body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-track .tb-gap { position: absolute; top: -2px; bottom: -2px; left: var(--w); width: var(--g); border: 2px dashed var(--fg); border-left: 0; border-radius: 0 3px 3px 0; }
@media print { #printSheet .tb-fill, #printSheet .tb-town.home { -webkit-print-color-adjust: exact; print-color-adjust: exact; } #printSheet .tb-town { break-inside: avoid; } #printSheet .tb { max-width: 5.5in; } }
/* before/after: stacked, one shared key; side by side only where there's room (iPad) */
.ba { grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 700px) and (max-width: 1023px) { .ba { grid-template-columns: 1fr 1fr; } }
.ba-h { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 18px; font-weight: 700; }
.ba-h small { font-size: 16px; font-weight: 600; color: var(--muted); }
.ba-map svg { border: 1px solid var(--rule); }
.ba-lab rect { stroke-width: 1; }
.ba-lab text { font: 600 15px var(--body); fill: #1a2433; }
.ba-nums { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px 12px; margin: 4px 0 0; }
.ba-nums .arrow { font-size: 28px; color: var(--muted); padding-bottom: 6px; }
.ba-nums .ba-cap { font-size: 16px; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.ba-key h4 { grid-column: 1 / -1; margin: 6px 0 0; font-size: 16px; font-weight: 700; }
.ba-dim { fill: #ffffff; fill-opacity: .45; }
.ba-outline { stroke: #111; stroke-width: 2.5; }
.ba-station { fill: #1f3a5f; stroke: #fff; stroke-width: 1.5; }
.ba-nums .ba-num { font-size: 30px; }
.ba-nums .ba-num { font-size: 26px; white-space: nowrap; }
.ba-nums .ba-num small { display: inline; font-size: 17px; font-weight: 700; color: var(--shops); margin: 0; }
.ba-nums > div { min-width: 0; }
@media (max-width: 600px) { .ba-nums { grid-template-columns: 1fr; } .ba-nums .arrow { display: none; } }
.report .rp-sec.rp-card { border-top: 1px solid var(--rule); padding-top: 20px; }
.report .rp-sec.rp-next { border-top: 2px solid var(--accent); padding-top: 20px; }
/* hidden means hidden, even for elements given a display above */
[hidden] { display: none !important; }
/* the two acreage figures stack; side by side only where the card is wide (iPad) */
.ba-nums { grid-template-columns: 1fr; }
.ba-nums .arrow { display: none; }
@media (min-width: 700px) and (max-width: 1023px) { .ba-nums { grid-template-columns: 1fr auto 1fr; } .ba-nums .arrow { display: inline; } }
