.model-band { border-bottom:1px solid #dce8e1; background:#f7fbf8; }
.model-section { padding-top:45px; }
#facility-explorer { --m-line:#ccdcd4; --m-fill:#f5faf6; --m-text:#294d47; }
.m-counts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.m-counts > div { display:flex; align-items:center; gap:8px; min-height:58px; padding:8px 11px; background:#fff; border:1px solid var(--m-line); border-radius:9px; }
.m-counts strong { font-size:1.35rem; line-height:1.1; font-variant-numeric:tabular-nums; }
.m-counts > div > span:last-child { font-size:.87rem; color:var(--m-text); }
.m-count-icon { display:inline-grid; place-items:center; width:31px; height:31px; background:color-mix(in srgb,var(--m-tone) 12%,#f7fcf9); color:var(--m-tone); border-radius:7px; flex:none; }
.m-count-icon .icon { width:18px;height:18px; }
.m-frame { background:#fff; border:1px solid var(--m-line); border-radius:12px; overflow:hidden; }
.m-toolbar { display:flex; justify-content:space-between; gap:8px; align-items:center; flex-wrap:wrap; padding:0 12px; border-bottom:1px solid var(--m-line); background:#edf5ef; }
.m-views { display:flex; gap:8px; flex-wrap:wrap; }
.m-views button,.m-detail-tabs button { padding:10px 6px 8px; min-height:39px; border:0; border-bottom:2px solid transparent; background:none; color:#3f5f56; font-size:.9rem; font-weight:620; white-space:nowrap; }
.m-views button[aria-pressed=true],.m-detail-tabs button[aria-pressed=true] { border-bottom-color:#257568; color:#1d655a; font-weight:730; }
.m-views button:hover,.m-detail-tabs button:hover { color:#0f594e; }
.m-views button .icon { margin-right:5px; width:16px; height:16px; }
.m-basis { display:inline-flex; align-items:center; gap:4px; font-size:.78rem; color:#774d22; background:#f8efdf; border:1px solid #ecdbbf; border-radius:5px; padding:2px 6px; }
.m-basis .icon { width:14px;height:14px; }
.m-workspace { display:grid; grid-template-columns:minmax(0,1fr) minmax(295px,340px); align-items:stretch; }
.m-map-panel,.m-catalog { display:flex; flex-direction:column; min-width:0; }
.m-tools { display:flex; align-items:center; gap:7px; flex-wrap:wrap; padding:9px 11px; border-bottom:1px solid var(--m-line); }
.m-search { display:flex; align-items:center; gap:6px; color:#4a7064; background:#f7faf8; border:1px solid var(--m-line); border-radius:6px; padding:0 7px; min-width:0; }
.m-search:focus-within { outline:2px solid #2e7e70; outline-offset:1px; }
.m-search input { width:10rem; min-height:33px; border:none; background:none; border-radius:0; padding:4px 0; font-size:.84rem; }
.m-search input:focus-visible { outline:none; }
.m-search .icon { width:16px; height:16px; }
.m-group { display:flex; align-items:center; gap:5px; font-size:.83rem; color:#47665e; }
.m-group select { width:auto; min-height:35px; background-color:#f7faf8; padding-block:4px; font-size:.84rem; }
.m-map { min-height:390px; position:relative; flex:1; isolation:isolate; background:#e2ede5; overflow:hidden; touch-action:pan-y; }
.m-map canvas,.m-map .marker-layer { position:absolute; inset:0; width:100%; height:100%; touch-action:pan-y; }
.m-map .marker-layer { pointer-events:none; }
.map-control { position:absolute; z-index:3; right:10px; top:11px; display:grid; gap:4px; }
.map-control button { width:32px; height:32px; display:grid; place-items:center; border:1px solid #aac3ba; border-radius:6px; background:#eff8f3; color:#26574e; padding:0; }
.map-control button:hover { border-color:#467f73; }
.map-control button .icon { width:16px; height:16px; }
.m-map-north { position:absolute; left:11px; top:9px; display:grid; text-align:center; color:#38645f; pointer-events:none; font:650 .71rem/1.1 system-ui; }
.m-map-north .icon { margin:3px auto 0; width:12px;height:15px; }
.m-map-status { position:absolute; left:10px; bottom:9px; z-index:2; pointer-events:none; color:#385e55; border:1px solid #a7c1b6; border-radius:5px; background:#eff8f4ed; padding:3px 6px; font-size:.75rem; }
.m-search-results { position:absolute; z-index:6; left:11px; top:9px; width:min(290px,calc(100% - 22px)); padding:4px; background:#fff; border:1px solid #a9c3b8; border-radius:8px; box-shadow:0 8px 19px #30483b34; }
.m-search-results button { width:100%; display:block; text-align:left; color:#21554b; background:none; border:0; border-radius:5px; padding:6px 8px; font-size:.86rem; }
.m-search-results button:hover { background:#eaf4ee; }
.m-search-results small { display:block; color:#567168; }
.m-search-results p { padding:3px 7px; margin:0; font-size:.88rem; }
.model-marker { --tone:#476861; position:absolute; z-index:1; transform:translate(-50%,-50%); width:24px;height:24px; display:grid; place-items:center; padding:0; border-radius:6px; border:1px solid color-mix(in srgb,var(--tone) 74%,#fff); background:#f8fffb; color:var(--tone); pointer-events:auto; }
.model-marker .icon { width:14px; height:14px; }
.model-marker:hover,.model-marker.is-active { z-index:3; background:var(--tone); color:#fff; box-shadow:0 0 0 4px color-mix(in srgb,var(--tone) 18%,transparent); }
.model-marker.is-active { width:29px;height:29px; }
.model-marker.is-active .icon { width:16px;height:16px; }
.model-marker[data-density=secondary]:not(:hover):not(.is-active) { width:17px;height:17px;border-radius:4px; }
.model-marker[data-density=secondary] .icon { width:11px;height:11px; }
.model-marker-label { position:absolute; pointer-events:none; left:calc(100% + 4px); top:50%; transform:translateY(-50%); display:none; background:#f2f8eeed; padding:1px 3px; border-radius:3px; color:#234d43; white-space:nowrap; line-height:1.4; font-size:.72rem; font-weight:700; }
.model-marker[data-label=yes] .model-marker-label,.model-marker.is-active .model-marker-label,.model-marker:hover .model-marker-label,.model-marker:focus-visible .model-marker-label { display:block; }
.model-marker[data-side=left] .model-marker-label { right:calc(100% + 4px); left:auto; }
.m-legend,.m-trials { min-height:36px; padding:6px 10px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; color:#49685e; font-size:.78rem; }
.m-legend { border-top:1px solid var(--m-line); }
.m-legend i { display:inline-block; margin-right:4px; width:15px; border-top:2px solid var(--m-key); vertical-align:middle; }
.m-legend .m-dash { border-top-style:dashed; }
.m-legend label { display:flex; gap:4px; align-items:center; margin-left:auto; }
.m-legend input[type=checkbox] { margin:0; width:auto; min-height:0; accent-color:#24695c; }
.m-trials { border-top:1px solid var(--m-line); }
.m-trials .button[aria-pressed=true] { background:#ddefe4; border-color:#84b6a4; }
.m-trials .button { min-height:31px; }
.m-trials .icon { width:15px;height:15px; }
.m-detail { min-width:0; border-left:1px solid var(--m-line); display:flex; flex-direction:column; }
.m-detail-head { padding:13px 13px 10px; }
.m-detail-kicker { font-size:.78rem; color:#4b6a61; }
.m-detail-head h3 { display:flex; align-items:center; gap:8px; font-size:1.19rem; line-height:1.3; margin:5px 0 8px; overflow-wrap:anywhere; }
.m-pills { display:flex; gap:5px; flex-wrap:wrap; }
.m-pill { display:inline-flex; align-items:center; padding:2px 6px; border:1px solid #c7ddd1; background:#eef7f1; color:#365f54; border-radius:5px; font-size:.74rem; white-space:nowrap; }
.m-status-published { background:#e4f1e9; border-color:#bdd7c8; color:#2a6351; }
.m-status-historical { background:#eeeaf6; border-color:#d6cae5; color:#604a83; }
.m-status-pending,.m-status-schematic { background:#f8f0e3; border-color:#e8d8bd; color:#835820; }
.m-detail-tabs { padding:0 10px; display:flex; align-items:center; gap:8px; overflow-x:auto; border-block:1px solid var(--m-line); background:#f5faf7; }
.m-detail-tabs button { padding:6px 4px 5px; min-height:34px; font-size:.84rem; }
.m-detail-content { padding:10px 13px 13px; }
.m-detail-content p { font-size:.88rem; color:#405d55; margin:0 0 10px; overflow-wrap:anywhere; }
.m-detail-content h4 { font-size:.92rem; margin:10px 0 5px; }
.m-detail-list { margin:0; }
.m-detail-list div { display:grid; grid-template-columns:66px minmax(0,1fr); gap:6px; padding:5px 0; border-bottom:1px solid #e3eee6; }
.m-detail-list dt { font-size:.78rem; color:#4c6d62; }
.m-detail-list dd { margin:0; font-size:.83rem; color:#2f564b; overflow-wrap:anywhere; }
.m-detail-actions { margin-top:auto; border-top:1px solid var(--m-line); padding:8px 12px; display:flex; gap:6px; flex-wrap:wrap; }
.m-detail-actions .icon { width:15px;height:15px; }
.m-related,.m-sources { list-style:none; padding:0; margin:0; }
.m-related li,.m-sources li { border-bottom:1px solid #dce9e2; padding:6px 0; overflow-wrap:anywhere; }
.m-related small,.m-sources small { display:block; color:#4c6d62; font-size:.77rem; }
.m-link,.m-sources a { color:#166a5b; text-decoration:underline; text-underline-offset:3px; }
.m-link { border:0; background:none; text-align:left; padding:0; font:inherit; }
.m-sources strong { font-weight:690; color:#325b50; font-size:.87rem; }
.m-sources strong span { color:#51786b; font-size:.76rem; }
.m-sources a .icon { width:13px;height:13px; }
.m-sources li p,.m-evidence .m-sources p { margin:3px 0 0; color:#46675a; font-size:.82rem; }
.m-endpoints { display:flex; gap:5px; flex-wrap:wrap; }
.m-tablescroll { max-height:560px; overflow:auto; }
.m-tablescroll table { width:100%; border-collapse:collapse; text-align:left; }
.m-tablescroll th,.m-tablescroll td { padding:9px 10px; border-bottom:1px solid #e1ece5; font-size:.85rem; }
.m-tablescroll th { position:sticky; top:0; white-space:nowrap; background:#edf5ef; color:#3b6256; }
.m-tablescroll tr.active td,.m-tablescroll tr:hover td { background:#eaf5ee; }
.m-tablescroll td small { display:block; color:#4e6f64; font-size:.75rem; }
.m-evidence { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:18px; padding:13px; }
.m-evidence h3 { margin:0 0 4px; font-size:1.1rem; }
.m-evidence p { margin:0 0 8px; color:#48675d; font-size:.9rem; }
.m-evidence .m-search { display:inline-flex; }
.m-evidence .m-search input { width:13.5rem; max-width:75vw; }
.m-checklist { list-style:none; margin:11px 0 0; padding:0; }
.m-checklist li { border:1px solid var(--m-line); border-radius:7px; padding:9px; margin-bottom:6px; }
.m-checklist li p { margin:2px 0 0; }
.m-scene-dialog { width:min(1100px,100% - 24px); max-height:min(91dvh,850px); padding:0; border:1px solid #a9c5b5; border-radius:10px; color:#21423a; background:#fff; }
.m-scene-dialog::backdrop { background:#17352c77; }
.m-dialog-body { padding:0 13px 15px; }
.m-dialog-head { display:flex; justify-content:space-between; gap:8px; align-items:center; position:sticky; top:0; z-index:4; background:#fff; padding:10px 0 8px; }
.m-dialog-head h3 { margin:0; font-size:1.19rem; }
.m-walk-layout { display:grid; gap:12px; min-width:0; align-items:start; }
.m-walk-layout > * { min-width:0; }
.m-walk-variants { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin:0 0 8px; color:#385c53; font-size:.82rem; font-weight:650; }
.m-walk-variants select { min-height:36px; max-width:100%; padding:4px 9px; font:inherit; color:#164d42; background:#edf6f0; border:1px solid #c6dbcf; border-radius:7px; }
.m-walk-guide { padding:10px; border:1px solid #cfded6; border-radius:10px; background:#f5f9f6; color:#234e43; }
.m-walk-heading { display:flex; justify-content:space-between; gap:6px; align-items:center; margin-bottom:5px; }
.m-walk-guide .m-walk-heading h4 { margin:0; font-size:1rem; }
.m-walk-heading span { color:#506a61; font-size:.74rem; }
.m-walk-guide p { margin:0 0 8px; font-size:.82rem; line-height:1.5; overflow-wrap:anywhere; }
.m-walk-basis { color:#48665c; }
.m-walk-steps { list-style:none; padding:0; margin:0 0 10px; display:grid; gap:9px; }
.m-walk-steps li { position:relative; min-width:0; }
.m-walk-steps li:not(:last-child)::after { content:''; position:absolute; bottom:-6px; left:17px; width:5px; height:5px; border-inline-end:1px solid #52796b; border-block-end:1px solid #52796b; transform:rotate(45deg); pointer-events:none; }
.m-walk-steps button { --walk-tone:#365b53; display:grid; grid-template-columns:24px minmax(0,1fr) auto; width:100%; gap:7px; align-items:center; text-align:start; min-height:36px; border:1px solid #d4e1da; background:#fff; color:#294c43; border-radius:7px; padding:4px 7px; font:inherit; font-size:.81rem; line-height:1.3; cursor:pointer; overflow-wrap:anywhere; }
.m-walk-steps button:is([aria-pressed=true],:hover) { border-color:var(--walk-tone); }
.m-walk-steps button[aria-pressed=true] { color:#174237; background:#e1f2e9; box-shadow:inset 3px 0 0 var(--walk-tone); font-weight:670; }
.m-walk-steps button:focus-visible,.m-walk-fold summary:focus-visible { outline:2px solid #287169; outline-offset:2px; }
.m-walk-steps [data-walk-medium=raw],.m-walk-steps [data-walk-medium=river] { --walk-tone:#196e75; }
.m-walk-steps [data-walk-medium=supply],.m-walk-steps [data-walk-medium=treated] { --walk-tone:#195d90; }
.m-walk-steps [data-walk-medium=sewer] { --walk-tone:#7c572a; }
.m-walk-steps [data-walk-medium=rain],.m-walk-steps [data-walk-medium=effluent] { --walk-tone:#136b53; }
.m-walk-steps [data-walk-medium=return],.m-walk-steps [data-walk-medium=sludge] { --walk-tone:#77487c; }
.m-walk-steps small { color:var(--walk-tone); white-space:nowrap; font-size:.69rem; }
.m-walk-number { display:grid; place-items:center; border-radius:50%; width:21px; height:21px; background:var(--walk-tone); color:#fff; font-size:.71rem; font-variant-numeric:tabular-nums; }
.m-walk-reading { background:#fff; padding:8px; border:1px solid #d6e4db; border-radius:7px; }
.m-walk-reading strong { display:block; margin-bottom:4px; font-size:.86rem; color:#224c42; }
.m-walk-guide .m-walk-reading p:last-child { margin:0; }
.m-walk-guide .m-walk-check { color:#674c2a; background:#faf2e3; border-radius:5px; padding:6px 7px; }
.m-walk-check b { margin-inline-end:3px; }
.m-walk-nav { display:flex; flex-wrap:wrap; gap:5px; margin:8px 0; }
.m-walk-nav .button { min-height:35px; padding:4px 8px; font-size:.77rem; }
.m-walk-nav .button:disabled { opacity:.55; cursor:default; }
.m-walk-nav [hidden] { display:none; }
.m-walk-guide .m-walk-warning { color:#604e30; }
.m-walk-fold { border-top:1px solid #d7e5dc; padding:6px 0 2px; font-size:.81rem; }
.m-walk-fold summary { font-weight:650; min-height:24px; cursor:pointer; }
.m-walk-fold ul { padding:0 0 0 16px; margin:4px 0; }
.m-walk-fold li { margin:0 0 6px; overflow-wrap:anywhere; }
.m-walk-fold a { color:#14675a; text-underline-offset:2px; }
.m-walk-fold a span { font-variant-numeric:tabular-nums; }
.m-walk-history li strong { display:block; }
.m-walk-guide .m-walk-history p { margin:2px 0 3px; }
.m-walk-flow { margin:3px 0; }
.m-walk-flow dt { font-weight:650; }
.m-walk-flow dd { margin:2px 0 9px; color:#355b51; line-height:1.55; }
.m-walk-flow dd span { color:#236d60; font-weight:750; }
@media (min-width:761px) {
  #model-dialog-scene .m-walk-layout { grid-template-columns:minmax(0,1.6fr) minmax(265px,1fr); }
  #model-dialog-scene .m-walk-stage { position:sticky; top:53px; }
}
#model-dialog-scene .jnsw-scene-view { min-height:min(58dvh,475px); }
@media (max-width:540px) { #model-dialog-scene .jnsw-scene-view { min-height:245px; } }
@media(max-width:900px) { .m-workspace{grid-template-columns:minmax(0,1fr) minmax(275px,310px);} }
@media(max-width:760px) {
  .m-workspace,.m-evidence { grid-template-columns:1fr; }
  .m-detail { border-left:0; border-top:1px solid var(--m-line); }
  .m-map{min-height:350px;} .model-marker[data-label=yes]:not(.is-active):not(:hover):not(:focus-visible) .model-marker-label{display:none;}
}
@media(max-width:510px) {
  .m-counts{grid-template-columns:1fr 1fr;gap:6px;}.m-counts>div{min-height:49px;padding:5px 7px;gap:5px;}
  .m-counts>div>span:last-child{font-size:.77rem;}.m-counts strong{font-size:1.16rem;}.m-count-icon{width:25px;height:25px;}
  .m-basis{margin-bottom:5px;}.m-tools{padding:7px;}.m-search input{width:8.4rem;}.m-group select{max-width:145px;}
  .m-map{min-height:326px;}.m-legend{gap:6px;}.m-legend label{margin-left:0;}
  .m-tablescroll th,.m-tablescroll td{padding:6px;font-size:.79rem;}
}
