* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
body { display: flex; flex-direction: column; overflow: hidden; }

#banner {
  background: #7a1f1f; color: #ffe9e9; padding: 6px 14px; font-size: 13px;
  line-height: 1.35; position: sticky; top: 0; z-index: 2000;
}
#banner b { color: #fff; }

#app { display: flex; flex: 1; min-height: 0; }
#sidebar {
  width: 340px; min-width: 300px; overflow-y: auto; padding: 12px 14px;
  background: #fafafa; border-right: 1px solid #ddd; font-size: 13.5px;
}
#map { flex: 1; min-width: 0; position: relative; }
#map > .google-map-underlay { position:absolute; inset:0; z-index:0; display:none; pointer-events:none; }
#map.google-map-active > .google-map-underlay { display:block; }
#map.google-map-active > .google-map-underlay .gm-style-cc a,
#map.google-map-active > .google-map-underlay a[href] { pointer-events:auto; }
#map.google-map-active { background:transparent; }
#map > .google-static-export-underlay { position:absolute; inset:0; z-index:0; display:none; overflow:hidden; pointer-events:none; }
#map > .google-static-attribution-overlay { position:absolute; left:0; right:0; bottom:0; height:var(--google-attribution-height, 36px); z-index:1100; display:none; overflow:hidden; pointer-events:none; }
#map.google-map-exporting > .google-map-underlay { display:none; }
#map.google-map-exporting > .google-static-export-underlay,
#map.google-map-exporting > .google-static-attribution-overlay { display:block; }
#map.google-map-exporting .leaflet-control-attribution { display:none; }
#map > .google-static-export-underlay img,
#map > .google-static-attribution-overlay img { position:absolute; display:block; max-width:none; }

h1 { font-size: 22px; margin: 0 0 10px; line-height: 1.1; }
h1 span { font-size: 13px; font-weight: 400; color: #666; }

.row { display: flex; gap: 6px; margin-bottom: 8px; }
.row input[type="text"] { flex: 1; }
.search-row { position: relative; }
.address-combobox { flex: 1; min-width: 0; position: relative; }
.suggestions {
  position: absolute; z-index: 2100; top: calc(100% + 3px); left: 0; right: 0;
  max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid #bbb;
  border-radius: 7px; box-shadow: 0 5px 18px rgba(0, 0, 0, .16);
}
.suggestion {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 0;
  text-align: left; line-height: 1.3; background: #fff;
}
.suggestion + .suggestion { border-top: 1px solid #eee; }
.suggestion:hover, .suggestion.active { background: #e7f1ff; }
.location-button { margin-top: -2px; }
input[type="text"], input[type="number"], select {
  padding: 6px 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; width: 100%;
}
input[type="number"] { width: 110px; }
button {
  padding: 6px 12px; border: 1px solid #bbb; border-radius: 6px; background: #fff;
  cursor: pointer; font-size: 13px;
}
button:hover { background: #f0f0f0; }
button.primary {
  width: 100%; background: #1a6b2f; color: #fff; border-color: #1a6b2f;
  font-weight: 600; padding: 9px; margin-bottom: 6px;
}
button.primary:disabled { background: #9bb8a3; border-color: #9bb8a3; cursor: not-allowed; }
button.primary:hover:not(:disabled) { background: #14571f; }
button.subtle { width: 100%; font-size: 12px; color: #666; margin-bottom: 6px; }

#status { font-size: 12.5px; color: #444; min-height: 18px; margin: 4px 0 10px; }
.calc-progress { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin:-2px 0 10px; }
.calc-progress[hidden] { display:none; }
.calc-progress span { padding:7px 5px; border-radius:8px; background:#edf0ef; color:#8a9490; font-size:10px; text-align:center; }
.calc-progress span b { display:block; margin-top:2px; font-size:10px; font-weight:650; }
.calc-progress span.done { background:#e5f3ed; color:#176b52; }
.calc-progress span.active { background:#176b52; color:#fff; box-shadow:0 0 0 3px rgba(23,107,82,.11); }
.method-callout { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:4px 0; padding:8px 10px; border:1px solid #b9d8cc; background:#eef8f4; }
.method-callout strong,.method-callout small { display:block; }.method-callout small { margin-top:2px; color:#52635d; font-size:10px; }.method-callout label { white-space:nowrap; }
.profile-explanation,.fixed-rule { margin:5px 0; padding:6px 7px; background:#f4f7f5; color:#46534e; font-size:10px; line-height:1.35; }
.performance-report { display:grid; grid-template-columns:1fr auto; gap:2px 8px; align-items:center; margin:3px 0; padding:6px 8px; border-left:3px solid #176b52; background:#f2f6f4; font-size:10px; }.performance-report strong,.performance-report span { display:block; }.performance-report button { grid-column:2; grid-row:1 / span 2; font-size:9px; }
button.primary[aria-busy="true"] .calc-action { width:14px; height:14px; border:2px solid rgba(255,255,255,.45); border-top-color:#fff; border-radius:50%; font-size:0; animation:calc-spin .7s linear infinite; }
@keyframes calc-spin { to { transform:rotate(360deg); } }

details { margin: 6px 0; border: 1px solid #e3e3e3; border-radius: 8px; padding: 6px 10px; background: #fff; }
summary { font-weight: 600; cursor: pointer; font-size: 13.5px; padding: 2px 0; }
details label { display: block; margin: 8px 0; color: #333; }
details label small { display: block; color: #888; font-size: 11px; font-weight: 400; }
label.check { display: flex; align-items: flex-start; gap: 6px; }
label.check input { margin-top: 3px; }
label.check small { display: block; }

.exports { margin-top: 8px; }
.exports button { flex: 1; }

#results { margin-top: 10px; }
.stat { padding: 4px 0; border-bottom: 1px dotted #e0e0e0; }
.warn {
  background: #fff3cd; border: 1px solid #ffe08a; border-radius: 6px;
  padding: 7px 9px; margin: 6px 0; font-size: 12.5px;
}
.pin-confirmation > span,.accuracy-status > span { display:block; margin-top:4px; }
.pin-confirm-actions { display:flex!important; flex-wrap:wrap; gap:7px; margin-top:8px!important; }
.pin-confirm-actions button { min-height:38px; padding:6px 10px; border:1px solid #c9a957; border-radius:8px; background:#fff; color:#4d3b0e; font-weight:700; }
.note {
  background: #e7f1ff; border: 1px solid #b8d4ff; border-radius: 6px;
  padding: 7px 9px; margin: 6px 0; font-size: 12.5px;
}

.legend { margin-top:12px; padding:12px; border:1px solid var(--line); border-radius:11px; background:#f8faf9; font-size:11.5px; color:#555; line-height:1.45; }
.legend > b { display:block; margin-bottom:8px; color:var(--ink); font-size:12.5px; }
.legend > div { display:flex; align-items:flex-start; gap:5px; margin:6px 0; }
.legend strong { color:#38413e; white-space:nowrap; }.legend .ln { flex:0 0 22px; margin-top:7px; }.legend .sw { flex:0 0 11px; margin-top:2px; }
.legend .building-key { flex-wrap:wrap; }.legend .hint { display:block; margin-top:8px; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 3px; }
.sw.dw { background: #2ecc40; } .sw.un { background: #ff9f1a; }
.sw.rv { background: #b45cff; } .sw.no { background: #9aa0a6; }
.ln { display: inline-block; width: 22px; height: 0; vertical-align: 3px; margin-right: 3px; border-top: 3px solid; }
.ln.techum { border-color: #a94364; } .ln.city { border-color: #4f713d; }
.ln.karpef { border-color: #4f713d; border-top-style: dashed; border-top-width: 2px; }
.ln.verified { border-color: #ffb300; border-top-style: dashed; border-top-width: 2px; }
.muted { color: #999; display: block; margin-top: 4px; line-height: 1.4; }
.hint { color: #888; font-style: italic; }
.audit-toggle { margin:10px 0 8px; padding:11px; border-radius:10px; background:#eef7f3; }
.audit-toggle b { color:#145c48; }
.audit-guide { margin:0 0 11px; padding:11px; border:1px solid #cfe0d9; border-radius:10px; background:#f8fbfa; }
.audit-guide > b { font-size:12px; }
.audit-guide ol { margin:8px 0 6px; padding:0; list-style:none; }
.audit-guide li { display:flex; gap:8px; align-items:flex-start; margin:7px 0; color:#4f5b57; font-size:11.5px; line-height:1.35; }
.audit-key { width:22px; height:12px; flex:0 0 auto; margin-top:2px; border:2px solid #2ecc40; border-radius:2px; background:rgba(46,204,64,.18); }
.audit-key.reach { border-style:dotted; border-color:#00a6ff; background:transparent; border-radius:8px; }
.audit-key.settlement { border-style:dashed; border-color:#7b61ff; background:transparent; }
.audit-key.home { border:3px solid #00c916; background:transparent; }
.cluster-label { width:auto !important; height:auto !important; border:0 !important; background:transparent !important; }
.cluster-label span { display:inline-block; transform:translate(-50%,-50%); padding:3px 6px; border:1px solid rgba(25,40,35,.25); border-radius:5px; background:rgba(255,255,255,.9); color:#17201d; box-shadow:0 1px 4px rgba(0,0,0,.16); font:700 10px/1.15 system-ui,sans-serif; white-space:nowrap; }
.confidence { margin:8px 0; padding:10px 11px; border:1px solid; border-radius:10px; font-size:12px; }
.confidence b,.confidence span { display:block; }.confidence span { margin-top:3px; line-height:1.4; color:#52605b; }
.confidence.good { background:#eaf7ef; border-color:#b9dfc8; }.confidence.mixed { background:#fff7df; border-color:#ead28a; }.confidence.poor { background:#fff0ed; border-color:#e9b5aa; }
.review-queue { margin:10px 0; border:1px solid var(--line); border-radius:11px; overflow:hidden; background:#fff; }
.review-title { padding:10px 11px; background:#f5f7f6; }.review-title b,.review-title span { display:block; }.review-title span { margin-top:2px; color:var(--muted); font-size:11px; }
.review-list { max-height:245px; overflow:auto; padding:5px; }.review-list button { display:grid; grid-template-columns:14px 75px 1fr; align-items:center; gap:5px; width:100%; padding:7px; border:0; text-align:left; }
.review-list button small { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cluster-review { max-height:310px; overflow:auto; margin-top:10px; padding:9px 3px 0 0; border-top:1px solid #dfe7e3; }.cluster-review > b { display:block; margin-bottom:5px; font-size:11.5px; }
.cluster-review label { display:grid; grid-template-columns:1fr 145px; gap:7px; align-items:center; margin:6px 0; }.cluster-review label span,.cluster-review label small { display:block; }.cluster-review label small { color:var(--muted); font-size:10px; }.cluster-review select { min-height:30px; margin:0; font-size:11px; }
.cluster-review label > input { grid-column:1 / -1; min-height:30px; margin:0; font-size:11px; }
.pdf-sheet { position:absolute; z-index:5000; left:0; top:0; width:1050px; padding:30px; background:#fff; color:#17201d; font:14px/1.4 system-ui,sans-serif; }
.pdf-heading { display:flex; justify-content:space-between; gap:25px; align-items:flex-start; margin-bottom:18px; border-bottom:2px solid #176b52; }
.pdf-heading h1 { margin:0 0 4px; font-size:25px; }.pdf-heading p { margin:0 0 14px; color:#7a1f1f; font-weight:650; }.pdf-heading > b { max-width:390px; text-align:right; }
.pdf-sheet > img { display:block; width:100%; max-height:540px; object-fit:contain; background:#eef1ef; border:1px solid #ccd4d0; }
.pdf-summary { padding-top:15px; }.pdf-summary h2 { margin:13px 0 5px; font-size:16px; letter-spacing:0; }.pdf-summary p { margin:0; white-space:pre-line; }.pdf-summary pre { margin:0; padding:12px; background:#f5f7f6; border:1px solid #e1e7e4; white-space:pre-wrap; font:11px/1.45 ui-monospace,monospace; }
.source-report { margin:8px 0; }.source-candidate,.registry-entry { display:grid; grid-template-columns:1fr auto auto; gap:5px; align-items:center; padding:6px 0; border-top:1px solid var(--line); }
.source-candidate span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }.source-candidate button,.registry-entry button { padding:5px 7px; font-size:11px; }
.registry-entry { grid-template-columns:1fr auto; }.registry-entry span,.registry-entry small { display:block; }.registry-entry small { margin-top:2px; color:var(--muted); font-size:10px; }

footer { margin-top: 14px; font-size: 11.5px; color: #999; }

@media (max-width: 700px) {
  body { overflow: auto; }

  #banner {
    position: relative; flex: none; padding: 7px 10px; font-size: 11.5px;
  }

  #app { flex: none; min-height: 0; flex-direction: column; }
  #map {
    order: 1; flex: none; width: 100%; height: 46dvh; min-height: 280px;
    border-bottom: 1px solid #ccc;
  }
  #sidebar {
    order: 2; width: 100%; min-width: 0; overflow: visible; padding: 14px 12px 28px;
    border-right: 0; background: #f7f7f5;
  }

  h1 { font-size: 20px; }
  h1 br { display: none; }
  h1 span { margin-left: 6px; }

  input[type="text"], input[type="number"], select { min-height: 44px; font-size: 16px; }
  input[type="number"] { width: 120px; }
  button { min-height: 44px; padding: 9px 12px; font-size: 14px; touch-action: manipulation; }
  button.subtle { font-size: 13px; }

  details { margin: 8px 0; padding: 8px 10px; }
  summary { min-height: 36px; padding: 7px 0; font-size: 14px; }
  details label { margin: 10px 0; }
  label.check { min-height: 36px; }
  label.check input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 0; }

  .leaflet-control-zoom a { width: 38px !important; height: 38px !important; line-height: 38px !important; }
  .legend { line-height: 2.15; }
}

@media (max-width: 380px) {
  #map { height: 42dvh; min-height: 240px; }
  .row { flex-wrap: wrap; }
  .row > * { flex: 1 1 120px; }
  h1 span { display: block; margin: 3px 0 0; }
}

/* Modern guided shell */
:root { --ink:#17201d; --muted:#68726e; --line:#e5e9e7; --soft:#f5f7f6; --accent:#176b52; }
body { background:var(--soft); color:var(--ink); }
#banner { min-height:34px; padding:8px 20px; text-align:center; background:var(--ink); color:#dce3e0; font-size:12px; }
.banner-mark { margin-right:7px; padding:2px 7px; border:1px solid #61706a; border-radius:99px; color:#fff; font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
#app { padding:12px; gap:12px; }
#sidebar { width:390px; min-width:340px; padding:24px; background:rgba(255,255,255,.97); border:1px solid #dae1de; border-radius:18px; box-shadow:0 20px 60px rgba(25,45,37,.12); }
#map { border-radius:18px; overflow:hidden; }
.brand { display:flex; align-items:center; gap:11px; margin-bottom:38px; }
.brand-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; background:var(--ink); color:#fff; text-decoration:none; font:600 22px Georgia,serif; }
.brand h1 { margin:0; font-size:17px; }.brand p { margin:3px 0 0; color:var(--muted); font-size:11.5px; }
.about-link { margin-left:auto; color:var(--muted); text-decoration:none; font-size:12px; }
.intro { margin-bottom:18px; }.eyebrow { color:var(--accent); font-size:11px; font-weight:750; letter-spacing:.1em; text-transform:uppercase; }
h2 { margin:9px 0 8px; max-width:300px; font-size:27px; line-height:1.12; letter-spacing:-.04em; }
.intro p { margin:0; max-width:315px; color:var(--muted); font-size:13.5px; line-height:1.55; }
.search-row { display:flex; gap:8px; }.search-icon { position:absolute; left:13px; top:50%; z-index:1; transform:translateY(-52%); color:#7b8581; font-size:21px; }
#address { height:50px; padding:0 14px 0 40px; border-color:#cfd7d3; border-radius:12px; font-size:15px; outline:none; }
#address:focus { border-color:var(--accent); box-shadow:0 0 0 4px rgba(23,107,82,.1); }
.suggestions { top:calc(100% + 7px); padding:5px; border-color:var(--line); border-radius:12px; box-shadow:0 18px 40px rgba(20,35,29,.16); }
.suggestion { padding:10px 11px; border:0; border-radius:8px; }.suggestion:hover,.suggestion.active { background:#eaf4f0; }
button { border-color:#ccd4d0; border-radius:10px; }.text-button { width:auto; padding:9px 2px; border:0; background:transparent; color:var(--muted); font-size:12.5px; }
#status { margin:5px 0 12px; color:var(--muted); line-height:1.45; }
.next-step { display:flex; align-items:center; gap:10px; margin:12px 0 10px; padding:12px; border-radius:11px; background:var(--soft); color:var(--muted); opacity:.55; }
.has-pin .next-step { background:#eaf4f0; color:var(--ink); opacity:1; }.step-number { display:grid; place-items:center; width:27px; height:27px; flex:0 0 auto; border-radius:50%; background:#dde3e0; font-weight:700; font-size:12px; }
.has-pin .step-number { background:var(--accent); color:#fff; }.next-step strong,.next-step div span { display:block; }.next-step div span { margin-top:2px; color:var(--muted); font-size:11.5px; }
button.primary { display:flex; justify-content:space-between; align-items:center; min-height:47px; padding:0 16px; border:0; background:var(--accent); }.advanced-heading { display:flex; justify-content:space-between; margin:24px 2px 8px; font-size:12px; font-weight:700; }.advanced-heading small { color:#929a97; letter-spacing:.06em; text-transform:uppercase; }
details { margin:7px 0; padding:0 12px; border-color:var(--line); border-radius:11px; }summary { display:flex; align-items:center; min-height:46px; list-style:none; }summary::-webkit-details-marker { display:none; }summary small { margin-left:8px; color:#8b9490; font-size:11px; font-weight:400; }summary:after { content:'+'; margin-left:auto; color:#87918d; font-size:18px; font-weight:400; }details[open] summary:after { content:'−'; }
input[type="number"],select { min-height:37px; margin-top:5px; border-color:#d4dbd8; border-radius:8px; }.secondary { width:100%; margin:7px 0; }
#results:empty { display:none; }.stat { padding:7px 2px; border-color:var(--line); }.warn,.note { border-radius:9px; line-height:1.45; }.legend { color:var(--muted); }.exports { margin-top:10px; }footer { padding-top:14px; border-top:1px solid var(--line); }
@media (max-width:700px) { #app { padding:0; gap:0; } #map { height:42dvh; border-radius:0; } #sidebar { width:100%; min-width:0; padding:20px; border:0; border-radius:20px 20px 0 0; box-shadow:0 -12px 35px rgba(20,35,29,.1); } .brand { margin-bottom:25px; } h2 { font-size:25px; } #address { font-size:16px; } }

/* Edge-to-edge, all-settings-visible desktop workspace */
#banner { position:relative; }
#btn-dismiss-banner { position:absolute; top:50%; right:10px; width:24px; height:24px; min-height:0; padding:0; transform:translateY(-50%); border:0; border-radius:50%; background:transparent; color:#aeb9b4; font-size:20px; line-height:22px; }
#btn-dismiss-banner:hover { background:rgba(255,255,255,.1); color:#fff; }
#app { padding:0; gap:0; }
#sidebar { width:54vw; min-width:720px; overflow:hidden; padding:12px 15px 8px; border:0; border-radius:0; box-shadow:none; }
#map { border:0; border-radius:0; box-shadow:none; }
.brand { margin-bottom:8px; }
.intro { display:flex; align-items:baseline; gap:12px; margin-bottom:8px; }
.intro h2 { max-width:none; margin:0; font-size:21px; white-space:nowrap; }
.intro p { max-width:none; margin-left:auto; font-size:11.5px; white-space:nowrap; }
.intro .eyebrow { display:none; }
#address { height:40px; }
.text-button { min-height:24px; padding:2px; }
#status { min-height:15px; margin:0 0 3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.next-step { float:left; width:41%; min-height:38px; margin:0 7px 6px 0; padding:6px 9px; }
button.primary { width:calc(59% - 7px); min-height:38px; margin:0 0 6px; }
#confidence,#review-queue { clear:both; max-height:55px; overflow:hidden; margin:2px 0; font-size:10.5px; }
#results { clear:both; max-height:58px; margin:0 0 2px; overflow:hidden; font-size:10.5px; line-height:1.2; }
#results .stat { display:inline-block; padding:2px 7px 2px 0; border:0; }
#results .warn,#results .note { display:inline; padding:0; border:0; background:transparent; }
.advanced-heading { clear:both; margin:3px 2px 4px; }
.settings-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; align-items:start; }
.settings-grid details { display:block; min-width:0; margin:0; padding:6px 8px; }
.settings-grid summary { min-height:23px; padding:0 0 4px; border-bottom:1px solid var(--line); cursor:default; font-size:11.5px; }
.settings-grid summary:after { display:none; }
.settings-grid details label { position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px; margin:3px 0; min-height:22px; font-size:11px; line-height:1.1; }
.settings-grid details label.check { grid-template-columns:auto minmax(0,1fr) auto; }
.settings-grid details label > small,.settings-grid .muted { display:none; }
.settings-grid .audit-toggle span small { display:none; }
.settings-grid input[type="number"],.settings-grid select { width:100%; min-height:25px; height:25px; margin:0; padding:2px 4px; font-size:10.5px; }
.settings-grid input[type="number"] { width:65px; }
.settings-grid label.check input { width:13px; height:13px; margin:0; }
.settings-grid button:not(.setting-help) { min-height:25px; padding:2px 6px; font-size:10px; }
.settings-grid .row { gap:3px; margin:3px 0; }
.settings-grid details label { padding-right:20px; }
.setting-help { position:absolute; top:2px; right:0; display:grid; place-items:center; width:16px; height:16px; min-height:0!important; padding:0!important; border:1px solid #bdc7c2; border-radius:50%; background:#fff; color:#66716d; font-size:10px!important; font-weight:700; line-height:1; }
.setting-help:before { content:attr(data-tip); position:absolute; z-index:3000; right:-4px; bottom:calc(100% + 7px); width:190px; padding:7px 8px; border-radius:7px; background:#17201d; color:#fff; font-size:10.5px; font-weight:400; line-height:1.35; text-align:left; box-shadow:0 8px 22px rgba(0,0,0,.2); opacity:0; visibility:hidden; pointer-events:none; }
.setting-help:after { content:''; position:absolute; right:4px; bottom:calc(100% + 2px); border:5px solid transparent; border-top-color:#17201d; opacity:0; visibility:hidden; }
.setting-help:hover:before,.setting-help:hover:after,.setting-help:focus-visible:before,.setting-help:focus-visible:after { opacity:1; visibility:visible; }
.audit-guide { position:absolute; z-index:2500; width:260px; max-height:260px; overflow:auto; background:#fff; box-shadow:0 10px 30px rgba(0,0,0,.18); }
.exports { margin:5px 0 2px; }
.exports button { min-height:26px; padding:2px 7px; font-size:10.5px; }
.legend { display:flex; flex-wrap:wrap; gap:1px 10px; margin-top:2px; font-size:9.5px; line-height:1.25; }
.legend .hint { display:none; }
footer { margin-top:3px; padding-top:3px; font-size:9.5px; }

@media (max-width:900px) {
  body { overflow:auto; }
  #app { flex-direction:column; }
  #map { order:1; width:100%; height:40dvh; min-height:260px; }
  #sidebar { order:2; width:100%; min-width:0; overflow:visible; padding:16px; }
  .intro { display:block; }.intro h2 { white-space:normal; }.intro p { margin:5px 0 0; white-space:normal; }
  .settings-grid { grid-template-columns:1fr; }
}

@media (min-width:901px) and (max-height:800px) {
  #sidebar { padding:6px 10px 4px; }
  .brand { margin-bottom:3px; }.brand-mark { width:30px; height:30px; border-radius:8px; font-size:17px; }.brand p { display:none; }
  .intro { margin-bottom:4px; }.intro h2 { font-size:17px; }.intro p { display:none; }
  #address { height:34px; }.text-button { min-height:18px; padding:0; font-size:10.5px; }
  #status { min-height:12px; margin:0 0 2px; font-size:10px; }
  .calc-progress { gap:3px; margin:0 0 3px; }.calc-progress span { padding:3px; }.calc-progress span b { display:inline; margin-left:3px; }
  .next-step,button.primary { min-height:31px; height:31px; margin-bottom:3px; padding-top:3px; padding-bottom:3px; }
  .next-step div span { display:none; }.step-number { width:21px; height:21px; }
  .advanced-heading { margin:1px 2px 2px; }
  .settings-grid { gap:4px; }.settings-grid details { padding:3px 6px; }.settings-grid summary { min-height:19px; padding-bottom:2px; }
  .settings-grid details label { min-height:18px; margin:1px 0; font-size:10px; }.settings-grid input[type="number"],.settings-grid select { min-height:21px; height:21px; font-size:9.5px; }
  .settings-grid button:not(.setting-help) { min-height:21px; }.setting-help { top:1px; width:14px; height:14px; }
  .exports { margin:3px 0 1px; }.exports button { min-height:22px; }
  #sidebar > details { margin:3px 0; padding:0 8px; } #sidebar > details summary { min-height:28px; }
  .legend { gap:0 7px; margin:1px 0; font-size:8px; line-height:1.1; }.legend b { font-size:9px; }.legend .building-key { display:none; }
  footer { margin:1px 0 0; padding:1px 0 0; }
}

/* Compact mission: a narrow instrument rail, not a dashboard of cards. */
:root { --rail: 480px; }
#banner { min-height:28px; padding:5px 34px 5px 10px; font-size:10.5px; }
.banner-mark { padding:1px 6px; font-size:9px; }
#btn-dismiss-banner { right:6px; width:20px; height:20px; font-size:17px; }

#sidebar {
  width:var(--rail); min-width:var(--rail); padding:8px 10px 5px; overflow:hidden;
  background:#fff; font-size:11px;
}
.brand { height:29px; margin:0 0 5px; gap:7px; }
.brand-mark { width:auto; height:auto; padding:0; border-radius:0; background:none; color:var(--accent); font-size:18px; }
.brand h1 { font-size:15px; letter-spacing:-.01em; }
.brand p { display:none; }
.about-link { font-size:10px; }
.intro { display:none; }

.search-row { gap:4px; margin:0; }
#address { height:34px; padding-left:31px; border-radius:4px; font-size:12px; }
.search-icon { left:10px; font-size:16px; }
.location-button { min-height:18px; margin:1px 0 0; padding:1px 0; font-size:10px; }
#status { min-height:15px; margin:0 0 3px; font-size:10px; }
.calc-progress { gap:2px; margin:0 0 3px; }
.calc-progress span { padding:3px; border-radius:2px; font-size:9px; }
.calc-progress span b { display:inline; margin:0 0 0 2px; font-size:9px; }
.next-step { display:none; }
button.primary { width:100%; min-height:32px; height:32px; margin:0 0 4px; padding:0 10px; border-radius:3px; font-size:11px; }

.advanced-heading { display:none; }
.settings-grid { display:block; }
.settings-grid details {
  display:block; margin:0; padding:0 0 3px; border:0; border-radius:0; background:none;
}
.settings-grid summary {
  min-height:19px; margin-top:2px; padding:2px 0 1px; border:0; border-top:1px solid #dfe4e1;
  color:#68726e; font-size:9px; font-weight:750; letter-spacing:.08em; text-transform:uppercase;
}
.settings-grid summary small,.settings-grid summary:after { display:none; }
.setting-items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:8px; }
.settings-grid details label {
  display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:5px;
  min-height:23px; margin:0; padding:0 17px 0 0; font-size:10px; line-height:1.05;
}
.settings-grid details label.check { grid-template-columns:auto minmax(0,1fr); }
.settings-grid details label > small,.settings-grid .muted,.settings-grid .audit-toggle span small { display:none; }
.settings-grid input[type="number"],.settings-grid select {
  min-width:0; width:100%; height:22px; min-height:22px; margin:0; padding:1px 4px;
  border-radius:3px; font-size:9.5px;
}
.settings-grid input[type="number"] { width:58px; justify-self:end; }
.settings-grid label.check input { width:13px; height:13px; }
.settings-grid button:not(.setting-help) { min-height:22px; height:22px; padding:1px 6px; border-radius:3px; font-size:9px; }
.settings-grid .row { margin:0; gap:3px; }
.setting-help { top:4px; width:13px; height:13px; border-color:#c7ceca; font-size:8px!important; }
.setting-help:before { width:175px; font-size:10px; }
.audit-toggle { background:none!important; border:0!important; border-radius:0!important; }

#confidence,#review-queue,#results {
  max-height:54px; margin:2px 0; padding:3px 0; overflow:hidden;
  border:0; border-radius:0; background:none; font-size:9.5px; line-height:1.2;
}
.confidence b,.confidence span { display:inline; margin:0 5px 0 0; }
.review-title { display:none; }
.review-list { display:flex; max-height:45px; padding:0; overflow:hidden; gap:2px; }
.review-list button { display:block; width:auto; min-width:0; padding:3px 5px; border:1px solid var(--line); border-radius:2px; }
.review-list button small { display:none; }

#sidebar > .exports { display:flex; gap:3px; margin:3px 0; }
#sidebar > .exports button { min-height:23px; height:23px; padding:1px 5px; border-radius:3px; font-size:9px; }
#sidebar > details {
  margin:0; padding:0; border:0; border-top:1px solid #e2e6e4; border-radius:0; background:none;
}
#sidebar > details summary {
  min-height:25px; padding:2px 1px; color:#33403b; font-size:10px; font-weight:600;
}
#sidebar > details summary small { margin-left:5px; font-size:9px; }
#sidebar > details summary:after { font-size:13px; }
#sidebar > details[open] { padding-bottom:4px; }
#sidebar > details[open] p { display:none; }
#sidebar > details .row { margin:2px 0; }
#sidebar > details button { min-height:23px; padding:2px 6px; border-radius:3px; font-size:9px; }
#sidebar > details label { margin:3px 0; font-size:9.5px; }
.source-report { margin:2px 0; }

.legend { display:none; }
body.has-result .legend {
  display:flex; align-items:center; gap:3px 9px; margin:2px 0 0; padding-top:3px;
  border-top:1px solid #e2e6e4; font-size:8px; line-height:1;
}
.legend > b,.legend .building-key,.legend .hint { display:none; }
.legend div { white-space:nowrap; }
.legend .ln { width:13px; }
footer { display:none; }

@media (max-width:900px) {
  :root { --rail:100%; }
  #sidebar { width:100%; min-width:0; overflow:visible; padding:10px; }
  .setting-items { grid-template-columns:1fr; }
  #map { border:0; }
}

/* Final safety cascade: no compact layout may conceal guidance or warnings. */
@media (min-width:901px) {
  #sidebar { overflow-y:auto; overflow-x:hidden; scrollbar-gutter:stable; }
}
#status { height:auto; white-space:normal; overflow:visible; overflow-wrap:anywhere; }
#confidence,#review-queue,#results { max-height:none; overflow:visible; }
.review-title { display:flex; justify-content:space-between; gap:8px; margin:4px 0; }
.review-title span { color:var(--muted); }
.review-list { display:block; max-height:245px; overflow-y:auto; overflow-x:hidden; padding:3px; }
.review-list button { display:grid; grid-template-columns:14px 68px minmax(0,1fr); width:100%; padding:6px; text-align:left; }
.review-list button small { display:block; overflow:visible; white-space:normal; }
#sidebar > details[open] p { display:block; }
.settings-grid details label > small,.settings-grid .muted { display:block; grid-column:1 / -1; }
.setting-help[aria-expanded="true"]:before,.setting-help[aria-expanded="true"]:after { opacity:1; visibility:visible; }
.legend,body.has-result .legend { display:block; padding:8px; font-size:9.5px; line-height:1.35; }
.legend > b,.legend .building-key,.legend .hint { display:flex; }
.legend div { white-space:normal; }
footer { display:block; }
.map-mode-active #map { outline:4px solid #d43f8d; outline-offset:-4px; }
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible { outline:3px solid rgba(23,107,82,.35); outline-offset:2px; }
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto!important; } .calc-action { animation:none!important; } }
@media (max-width:900px) {
  .settings-grid button:not(.setting-help),#sidebar > .exports button,#sidebar > details button { min-height:44px; height:auto; font-size:12px; }
  #status,#results,#confidence,#review-queue { font-size:12px; line-height:1.4; }
  #btn-calc { position:sticky; bottom:8px; z-index:1200; box-shadow:0 5px 18px rgba(0,0,0,.2); }
  .setting-help:before,.setting-help:after { display:none; }
  .setting-help[aria-expanded="true"]:before {
    display:block; position:fixed; left:16px; right:16px; bottom:16px; width:auto;
    font-size:13px; line-height:1.45;
  }
}
