:root {
  --explorer-basin-fill: color-mix(in srgb,var(--green) 12%,var(--paper));
  --explorer-building-fill: color-mix(in srgb,var(--ink) 6%,var(--paper));
  --explorer-inferred: #745780;
  --explorer-inferred-fill: #f1ebf4;
  --explorer-nav-height: 0px;
}
.explorer-page .explorer-main{padding-top:0}
.explorer-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);padding:var(--space-5) 0 var(--space-4)}
.explorer-heading h1{font-size:clamp(22px,2.2vw,30px);font-weight:650;letter-spacing:-.8px;line-height:1.15;margin:0}
.explorer-kicker{font-size:var(--text-xs);font-weight:500;color:var(--muted);margin:0 0 var(--space-1)}
.reference-badge{font-size:var(--text-xs);color:var(--muted);background:var(--paper);border:1px solid var(--line);padding:var(--space-2) var(--space-3);border-radius:var(--radius-pill,999px);white-space:nowrap}
.explorer-workspace{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:var(--space-4);align-items:start}
.explorer-map-panel{position:relative;min-width:0;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm)}
.explorer-topbar{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);padding:var(--space-3);border-bottom:1px solid var(--line)}
.explorer-page .view-tabs{display:flex;flex-shrink:0;padding:var(--space-1);gap:2px;border:0;border-radius:var(--radius-sm);background:var(--bg);width:auto}
.explorer-page .view-tabs button{min-width:44px;min-height:44px;font-size:var(--text-xs);padding:var(--space-2) var(--space-3);border:0;border-radius:6px;background:transparent;color:var(--muted);font-weight:550}
.explorer-page .view-tabs button.selected{background:var(--paper);box-shadow:var(--shadow-sm);color:var(--green-dark);font-weight:700}
.explorer-tools{display:flex;align-items:center;gap:var(--space-1)}
.explorer-toggle{display:inline-flex;align-items:center;gap:var(--space-2);min-height:44px;padding:var(--space-2);font-size:var(--text-xs);font-weight:550;color:var(--muted);white-space:nowrap;cursor:pointer}
.explorer-toggle input{width:16px;height:16px;accent-color:var(--green);margin:0}
.explorer-popover{position:relative}
.explorer-popover>summary{min-height:44px;min-width:44px;display:flex;align-items:center;justify-content:center;gap:var(--space-1);padding:var(--space-2);font-size:var(--text-xs);font-weight:550;color:var(--muted);cursor:pointer;list-style:none;border-radius:var(--radius-sm)}
.explorer-popover>summary::-webkit-details-marker{display:none}
.explorer-popover>summary:hover,.explorer-popover[open]>summary{background:var(--tint);color:var(--green-dark)}
.explorer-popover>summary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;flex-shrink:0}
.feature-finder>summary svg{width:19px;height:19px}
.explorer-popover.is-disabled>summary{opacity:.45;cursor:default}
.popover-panel{position:absolute;z-index:60;top:calc(100% + var(--space-2));right:0;width:280px;padding:var(--space-4);background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-lg);font-size:var(--text-sm)}
.popover-title{font-size:var(--text-xs);font-weight:700;color:var(--muted);margin:var(--space-2) 0 var(--space-3)}
.opacity-control{display:grid;grid-template-columns:1fr auto;gap:var(--space-2);margin:var(--space-3) 0 var(--space-4);font-size:var(--text-xs)}
.opacity-control input{grid-column:1/-1;width:100%;height:28px;accent-color:var(--green)}
.opacity-control output{font-family:var(--mono)}
.explorer-legend{display:grid;gap:var(--space-3);font-size:var(--text-xs);color:var(--muted)}
.explorer-legend span{display:flex;align-items:center;gap:var(--space-2)}
.explorer-legend i{width:18px;height:12px;border:1.5px solid var(--green);background:var(--explorer-basin-fill);flex-shrink:0}
.explorer-legend .legend-building{border-color:var(--muted);background:var(--explorer-building-fill)}
.explorer-legend .legend-inferred{border-color:var(--explorer-inferred);background:var(--explorer-inferred-fill);border-style:dashed}
.explorer-legend .legend-boundary{border-color:var(--muted);background:transparent;border-style:dashed}
.feature-finder .popover-panel{width:340px}
.search-label{display:block;font-size:var(--text-xs);font-weight:650;color:var(--muted);margin-bottom:var(--space-2)}
.feature-finder input,.feature-inspector select{width:100%;min-height:44px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--paper);color:var(--ink);padding:var(--space-2) var(--space-3);font-size:var(--text-sm)}
.search-status{font-size:var(--text-xs);color:var(--muted);margin:var(--space-2) 0}
#feature-results{list-style:none;margin:0;padding:0;max-height:320px;overflow:auto}
#feature-results button{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:48px;text-align:left;padding:var(--space-2);border:0;border-radius:var(--radius-sm);background:transparent;color:var(--ink);font-size:var(--text-sm)}
#feature-results button:hover{background:var(--tint)}
#feature-results strong{min-width:34px;font:600 var(--text-xs) var(--mono);color:var(--green-dark)}
#feature-results .search-empty{font-size:var(--text-sm);padding:var(--space-4) 0;color:var(--muted)}
.section-strip{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);background:var(--paper);border-bottom:1px solid var(--line)}
.strip-label{font-size:var(--text-xs);font-weight:600;color:var(--muted);padding-right:var(--space-1);flex-shrink:0}
.explorer-page .section-controls{display:flex;align-items:center;gap:var(--space-1);padding:0;border:0;overflow:auto;flex-wrap:nowrap;scrollbar-width:none;min-width:0}
.section-controls::-webkit-scrollbar{display:none}
.explorer-page .section-controls button{flex:0 0 auto;min-height:44px;min-width:44px;padding:var(--space-2) var(--space-3);border:0;border-radius:var(--radius-sm);font-size:var(--text-xs);font-weight:550;background:transparent;color:var(--muted)}
.explorer-page .section-controls button.selected{background:var(--tint);color:var(--green-dark);font-weight:700}
.explorer-page button:disabled{cursor:default;opacity:.42}
.canvas-stage{position:relative;overflow:hidden;background:var(--bg)}
.explorer-page .map-wrap{height:clamp(460px,65svh,780px);min-height:0;background:var(--bg);overflow:hidden}
.explorer-page .map-wrap svg{width:100%;height:100%;min-height:0;max-height:none;display:block;user-select:none;-webkit-user-select:none;touch-action:pan-y pinch-zoom}
.explorer-page .map-wrap.is-zoomed svg{touch-action:none;cursor:grab}
.explorer-page .map-wrap.is-dragging svg{cursor:grabbing}
.explorer-page .map-wrap svg:focus-visible{outline:3px solid var(--focus-ring);outline-offset:-3px}
.map-orientation{position:absolute;left:var(--space-3);bottom:var(--space-3);display:inline-flex;align-items:center;min-height:28px;padding:var(--space-1) var(--space-2);border:1px solid var(--line);border-radius:6px;background:var(--paper);color:var(--muted);font:600 var(--text-xs) var(--font);box-shadow:var(--shadow-sm);pointer-events:none}
.explorer-page .map-controls{position:absolute;right:var(--space-3);bottom:var(--space-3);display:grid;gap:var(--space-1);z-index:5;padding:var(--space-1);background:var(--paper);border:1px solid var(--line);border-radius:var(--radius-md);box-shadow:var(--shadow-md)}
.map-controls button{display:grid;place-items:center;min-width:44px;width:44px;min-height:44px;height:44px;border:0;border-radius:var(--radius-sm);background:var(--paper);color:var(--ink);font-size:22px;line-height:1}
.map-controls button:hover{background:var(--tint)}
.map-controls button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6}
.explorer-page .map-feature polygon{vector-effect:non-scaling-stroke;stroke-width:1.5;fill-opacity:.7}
.explorer-page .clean-plan .basin-outline{stroke:var(--green);fill:var(--explorer-basin-fill)}
.explorer-page .clean-plan .building-outline{stroke:var(--muted);fill:var(--explorer-building-fill)}
.explorer-page .clean-plan .inferred-outline{stroke:var(--explorer-inferred);fill:var(--explorer-inferred-fill);stroke-dasharray:5 4}
.explorer-page .boundary-outline{stroke:var(--muted)!important;stroke-width:1!important;stroke-dasharray:7 5;fill:none!important}
.explorer-page .road-line{stroke:var(--line);stroke-width:4;fill:none;vector-effect:non-scaling-stroke}
.explorer-page .waterway-line{stroke:color-mix(in srgb,var(--green) 20%,var(--line));stroke-width:2;fill:none;vector-effect:non-scaling-stroke}
.explorer-page .map-feature.section-dimmed{opacity:.22}
.explorer-page .map-feature.section-highlighted polygon{stroke-width:2}
.explorer-page .map-feature.feature-selected polygon{stroke:var(--green-dark);stroke-width:3.5;fill-opacity:1}
.explorer-page .map-feature[role=button]:hover polygon,.explorer-page .map-feature[role=button]:focus-visible polygon{stroke:var(--focus-ring);stroke-width:3}
.explorer-page .map-feature[role=button]:focus-visible{outline:none}
.explorer-page .feature-label{pointer-events:visiblePainted}
.explorer-page .feature-label rect{fill:var(--ink);stroke:var(--paper);stroke-width:.5;vector-effect:non-scaling-stroke}
.explorer-page .feature-label text{fill:var(--paper);font-family:var(--font);font-weight:650;pointer-events:none}
.label-leader{stroke:var(--muted);stroke-width:1;vector-effect:non-scaling-stroke;pointer-events:none}
.area-label{cursor:pointer;outline:none}
.area-label rect{fill:var(--paper);stroke:var(--line);stroke-width:1;vector-effect:non-scaling-stroke}
.area-label text{fill:var(--ink);font-family:var(--font);font-weight:650;pointer-events:none}
.area-label:hover rect,.area-label:focus-visible rect{stroke:var(--green);stroke-width:2;fill:var(--tint)}
.explorer-caption{min-height:58px;display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-2) var(--space-4);padding:var(--space-3);border-top:1px solid var(--line)}
.explorer-caption>div{display:flex;align-items:center;gap:var(--space-2);font-size:var(--text-xs)}
.explorer-caption strong{font-weight:650}
.explorer-caption #section-count{color:var(--muted)}
.explorer-caption>p{font-size:var(--text-xs);color:var(--muted);margin:0;flex:1}
.explorer-caption>a{font-size:var(--text-xs);white-space:nowrap}
.explorer-caption .sr-only{position:absolute}
.canvas-state{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:var(--space-3);padding:var(--space-6);text-align:center;background:var(--bg)}
.canvas-state strong{font-size:18px;font-weight:650}
.canvas-state p{font-size:var(--text-sm);max-width:36ch;color:var(--muted);margin:0}
.canvas-state .state-spinner{width:28px;height:28px;border:2px solid var(--line);border-top-color:var(--green);border-radius:50%;animation:explorer-spin .8s linear infinite}
.canvas-state.is-error .state-spinner{display:none}
#canvas-error-actions{display:flex;gap:var(--space-2);flex-wrap:wrap;justify-content:center}
.explorer-page .static-view{background:var(--bg);padding:var(--space-4);min-height:460px}
.explorer-page .static-view img{width:100%;max-height:65svh;object-fit:contain}
#comparison-error{font-size:var(--text-sm);color:var(--muted)}
.feature-inspector{position:sticky;top:var(--space-4);background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}
.inspector-head{display:flex;justify-content:space-between;align-items:center;gap:var(--space-2);padding:var(--space-5);border-bottom:1px solid var(--line)}
.inspector-kicker{display:block;font-size:var(--text-xs);font-weight:650;letter-spacing:.02em;color:var(--green);margin-bottom:var(--space-1)}
.inspector-head h2{font-size:18px;font-weight:650;line-height:1.3;letter-spacing:-.3px;margin:0}
.inspector-actions{display:flex;gap:var(--space-1);flex-shrink:0}
.inspector-actions button{min-width:44px;min-height:44px;padding:var(--space-2);border:0;border-radius:var(--radius-sm);background:var(--bg);color:var(--muted);font-size:var(--text-xs);font-weight:650}
.inspector-actions button:hover{background:var(--tint);color:var(--green-dark)}
.inspector-actions #close-inspector{font-size:22px;font-weight:400}
.inspector-actions #toggle-inspector{display:none}
.inspector-body{padding:var(--space-5);font-size:var(--text-sm)}
.inspector-body select{margin-bottom:var(--space-4);font-size:var(--text-xs)}
.inspector-empty{font-size:var(--text-sm);line-height:1.55;color:var(--muted);margin:0 0 var(--space-4)}
.source-feature-label{font-size:var(--text-sm);line-height:1.4;margin:0 0 var(--space-3);font-weight:600}
.evidence-badge{display:inline-flex;padding:var(--space-1) var(--space-2);border-radius:6px;background:var(--tint);color:var(--green-dark);font-size:var(--text-xs);line-height:1.5}
.inspector-body .measurement-list{margin:var(--space-4) 0}
.inspector-body dt{font-size:var(--text-xs);letter-spacing:0;text-transform:none;font-weight:650}
.inspector-body dd{font-size:var(--text-sm);line-height:1.5;color:var(--muted)}
.feature-notes{color:var(--muted);font-size:var(--text-sm);line-height:1.55}
.feature-limit{font-size:var(--text-xs);line-height:1.5;color:var(--muted);border-left:2px solid var(--line);padding-left:var(--space-3)}
.context-links{display:grid;gap:var(--space-2);margin-top:var(--space-4)}
.context-links a,.context-link{display:inline-flex;align-items:center;min-height:44px;font-size:var(--text-xs);font-weight:650;color:var(--green)}
.explorer-page .drawing-info{margin-top:var(--space-5)}
.explorer-page .drawing-info>summary{font-size:var(--text-sm)}
@keyframes explorer-spin{to{transform:rotate(360deg)}}
@media(max-width:1100px){.explorer-workspace{grid-template-columns:minmax(0,1fr) 270px}.explorer-heading{padding-top:var(--space-4)}.inspector-head,.inspector-body{padding:var(--space-4)}.finder-label{display:none}}
@media(max-width:900px){
 .explorer-workspace{display:block}
 .feature-inspector{position:fixed;z-index:80;left:var(--space-3);right:var(--space-3);bottom:calc(var(--explorer-nav-height) + var(--space-3));top:auto;border-radius:var(--radius);box-shadow:var(--shadow-lg);max-height:min(48svh,460px)}
 .inspector-head{padding:var(--space-3) var(--space-4);border-bottom:0;min-height:82px}
 .inspector-head>div:first-child{min-width:0}
 .inspector-head h2{font-size:var(--text-base);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
 .inspector-kicker{font-size:var(--text-xs)}
 .inspector-actions #toggle-inspector{display:flex;align-items:center;gap:var(--space-1)}
 .inspector-actions #toggle-inspector span{font-size:var(--text-base)}
 .inspector-body{max-height:calc(48svh - 86px);overflow:auto;overscroll-behavior:contain;padding:0 var(--space-4) var(--space-4)}
 .feature-inspector.is-expanded .inspector-head{border-bottom:1px solid var(--line)}
 .feature-inspector.is-expanded .inspector-body{padding-top:var(--space-4)}
 .feature-finder .popover-panel{max-height:65svh;overflow:auto}
 .explorer-page .map-wrap{height:clamp(390px,62svh,720px)}
}
@media(max-width:700px){
 .explorer-heading{padding:var(--space-3) 0;gap:var(--space-2)}
 .explorer-heading h1{font-size:22px;letter-spacing:-.5px}
 .explorer-kicker{font-size:11px;margin-bottom:2px}
 .reference-badge{font-size:10px;white-space:normal;max-width:108px;padding:var(--space-1) var(--space-2);line-height:1.35}
 .explorer-topbar{padding:var(--space-2);gap:6px}
 .explorer-page .view-tabs{padding:2px;gap:0;min-width:0}
 .explorer-page .view-tabs button{font-size:var(--text-xs);padding:var(--space-2) var(--space-1)}
 .explorer-tools{gap:0}
 .explorer-toggle{gap:var(--space-1);padding:var(--space-1);font-size:var(--text-xs)}
 .explorer-toggle input{width:14px;height:14px}
 .explorer-popover>summary{padding:var(--space-1);gap:2px}
 .explorer-popover>summary svg{width:12px;height:12px}
 .feature-finder>summary svg{width:18px;height:18px}
 .finder-label{display:none}
 .popover-panel{max-width:calc(100vw - 32px)}
 .section-strip{padding:var(--space-1) var(--space-2);gap:var(--space-1)}
 .strip-label{display:none}
 .explorer-page .section-controls button{padding:var(--space-2);font-size:var(--text-xs)}
 .explorer-page .map-wrap{height:var(--explorer-mobile-map-height,clamp(340px,calc(100svh - 342px),560px))}
 .explorer-page .static-view{min-height:350px;padding:var(--space-2)}
 .explorer-page .static-view img{max-height:calc(100svh - 340px)}
 .explorer-caption{min-height:56px;padding:var(--space-2) var(--space-3);gap:var(--space-1)}
 .explorer-caption>div{width:100%;font-size:11px}
 .explorer-caption>p,.explorer-caption>a{font-size:10px}
 .map-orientation{left:var(--space-2);bottom:var(--space-2);font-size:11px}
 .explorer-page .map-controls{right:var(--space-2);bottom:var(--space-2)}
 .map-controls button{width:44px;height:44px}
 .canvas-state{padding:var(--space-5)}
 .canvas-state strong{font-size:var(--text-base)}
 .canvas-state p{font-size:var(--text-xs)}
 .feature-inspector{left:var(--space-2);right:var(--space-2);bottom:calc(var(--explorer-nav-height) + var(--space-2))}
 .inspector-head{padding:var(--space-3)}
 .inspector-actions button{font-size:11px}
 .inspector-actions #close-inspector{font-size:22px}
 .explorer-page .drawing-info>summary{padding:var(--space-4);font-size:var(--text-xs)}
}
@media(max-width:360px){
 .explorer-topbar{flex-wrap:wrap}
 .explorer-page .view-tabs{flex:1}
 .explorer-tools{margin-left:auto}
 .explorer-page .map-wrap{height:var(--explorer-mobile-map-height,clamp(320px,calc(100svh - 360px),500px))}
}
@media(prefers-reduced-motion:reduce){.explorer-page *, .explorer-page *::before,.explorer-page *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

@media(max-width:700px){.explorer-page .section-controls{gap:var(--space-2)}.explorer-page .section-controls button{padding-inline:var(--space-3)}.layer-label{display:none}.explorer-popover>summary[aria-label]{min-width:44px}.explorer-popover>summary[aria-label] svg{width:19px;height:19px}}

/* Per-component provenance leaves the selected map context in place. */
.inspector-head>div:first-child{min-width:0;flex:1}
.inspector-actions #open-component-source{background:var(--tint);color:var(--green-dark);white-space:nowrap}
.component-source-dialog{width:min(680px,calc(100vw - 32px));max-height:min(84svh,820px);margin:auto;padding:0;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--paper);color:var(--ink);box-shadow:var(--shadow-lg);overflow:hidden}
.component-source-dialog[open]{display:flex;flex-direction:column}
.component-source-dialog::backdrop{background:rgb(10 28 39 / .5)}
.component-source-head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-4);padding:var(--space-5);border-bottom:1px solid var(--line);flex-shrink:0}
.component-source-head>div{min-width:0}
.component-source-eyebrow{margin:0 0 var(--space-1);font-size:var(--text-xs);color:var(--green);font-weight:650}
.component-source-head h2{font-size:22px;line-height:1.25;letter-spacing:-.4px;margin:0}
.component-source-head button{flex-shrink:0;width:44px;height:44px;border:0;border-radius:var(--radius-sm);background:var(--bg);color:var(--muted);font-size:24px;line-height:1}
.component-source-head button:hover{background:var(--tint);color:var(--green-dark)}
.component-source-body{overflow:auto;overscroll-behavior:contain;padding:var(--space-5);font-size:var(--text-sm);line-height:1.6}
.component-source-body p{margin:0}
.component-source-summary{font-size:var(--text-base);line-height:1.55;margin-bottom:var(--space-5)!important}
.component-source-card{padding:var(--space-4);border:1px solid var(--line);border-radius:var(--radius-md);margin-bottom:var(--space-3);background:var(--surface)}
.component-source-card h3,.component-source-limit h3,.component-source-error h3{margin:0 0 var(--space-2);font-size:var(--text-sm);line-height:1.4;font-weight:700;letter-spacing:0}
.component-source-card p{color:var(--muted);white-space:pre-line}
.component-source-links{list-style:none;padding:0;margin:var(--space-3) 0 0;display:grid;gap:var(--space-2)}
.component-source-links a{display:inline-flex;align-items:center;min-height:44px;padding:var(--space-1) 0;color:var(--green-dark);font-weight:600;text-underline-offset:3px;overflow-wrap:anywhere}
.component-source-links a:hover{text-decoration-thickness:2px}
.component-source-limit{padding:var(--space-4);border-radius:var(--radius-md);background:var(--tint);margin-top:var(--space-5)}
.component-source-limit p{color:var(--ink);white-space:pre-line}
.component-source-status,.component-source-error{padding:var(--space-4) 0;color:var(--muted)}
.component-source-error-actions{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-4);margin-top:var(--space-4)}
.component-source-error-actions button,.component-source-error-actions a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;font:inherit;font-weight:650}
.component-source-error-actions button{padding:var(--space-2) var(--space-4);border:1px solid var(--green);border-radius:var(--radius-sm);background:var(--green);color:var(--paper)}
.component-source-error-actions a{color:var(--green-dark);text-underline-offset:3px}
.source-link-unavailable{color:var(--muted)}
.component-source-dialog :focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}
@media(max-width:700px){
 .component-source-dialog{width:calc(100vw - 20px);max-height:calc(100svh - 24px);border-radius:var(--radius)}
 .component-source-head{padding:var(--space-4);gap:var(--space-3)}
 .component-source-head h2{font-size:20px}
 .component-source-body{padding:var(--space-4)}
 .inspector-actions #open-component-source{padding:var(--space-2);font-size:11px}
}
@media(max-width:380px){
 .inspector-head{flex-wrap:wrap}
 .inspector-head>div:first-child{flex-basis:100%}
 .inspector-actions{width:100%;justify-content:flex-end}
 .inspector-body{max-height:calc(48svh - 128px)}
}
