.explorer-main{min-width:0;min-height:0;display:flex;flex-direction:column}
.explorer-main>[hidden]{display:none!important}
.explorer-tabs,.investigation-navigation{display:flex;align-items:center;gap:8px;flex-wrap:wrap;flex-shrink:0;margin-bottom:10px}
.explorer-tabs{border-bottom:1px solid var(--border);padding-bottom:9px}
.explorer-tabs button{padding:8px 16px}
.explorer-tabs .active{background:var(--soft);color:var(--teal);border-color:var(--teal)}
.investigation-navigation button{padding:5px 10px;font-size:12px}
.investigation-navigation button:last-child{margin-left:auto}
.trace-dialog.trace-embedded{position:static;inset:auto;display:flex;flex-direction:column;width:100%;max-width:none;height:100%;max-height:none;min-height:0;margin:0;padding:12px;border:1px solid var(--border);border-radius:10px;background:#fff;box-shadow:none;color:var(--ink)}
.trace-embedded>.panel-heading,.trace-embedded #trace-notice{display:none}
.trace-embedded #trace-location{flex-basis:100%;min-width:0;margin:0;font-size:12px;overflow-wrap:anywhere}
.trace-embedded .trace-tools{gap:8px;margin:0 0 10px;flex-shrink:0}
.trace-embedded .trace-tools button{padding:6px 9px;font-size:12px}
.trace-embedded .trace-tools label{margin-left:auto;font-size:12px}
.trace-embedded .trace-tools input{width:100px}
.trace-embedded .trace-layout,.trace-embedded .trace-layout.trace-limited{display:flex;flex:1;min-height:0;grid-template-columns:none}
.trace-embedded .trace-pan,.trace-embedded .trace-limited .trace-pan{flex:1;min-height:250px;height:auto;max-height:none}
.explorer-formula{height:100%;min-height:0;margin:0;overflow:auto;padding:16px}
.explorer-formula .trace-math-expression{max-height:none;overflow:auto}
.explorer-formula details{margin:10px 0}
.explorer-formula .notation-guide{font-size:12px;color:var(--muted)}
.explorer-formula .trace-formula pre{max-height:30vh}
.explorer-checks{font-size:13px;margin-top:14px}
.explorer-checks>button{display:block;text-align:left;margin:6px 0;padding:7px 9px}
.explorer-checks details{margin:12px 0}
.explorer-finding summary{font-weight:600;overflow-wrap:anywhere}
.explorer-finding pre{font-size:12px;max-height:180px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}
.explorer-saved-details{margin-top:18px;font-size:13px}
.explorer-saved-details #cell-detail{margin-top:12px}
.explorer-saved-details #cell-detail>h3{display:none}
.explorer-operation button{margin:10px 8px 0 0}
.explorer-operation details{margin-top:14px;font-size:13px}
.explorer-operation .formula-box{max-height:150px;overflow:auto;font-size:12px}
.grid td[data-check-state]{position:relative;padding-right:20px}
.cell-check-marker{position:absolute;right:4px;top:4px;display:inline-flex;justify-content:center;align-items:center;width:15px;height:17px;font-size:12px;font-weight:700;color:#8b5700;background:#fff0cf;border-radius:3px;line-height:1}
.grid td[data-check-state=limit] .cell-check-marker{background:#eaf0ff;color:#445f93}
.grid td[data-check-state=reviewed] .cell-check-marker{background:#edf2f4;color:#516c7b}
@media(min-width:801px){.shell[data-workspace-page=explore] .explorer-main>.grid-panel{height:100%}.shell[data-workspace-page=explore] .explorer-main{flex:1}}
@media(max-width:800px){.explore-layout{grid-template-columns:minmax(0,1fr)!important}.explorer-main .grid-panel{min-height:320px}.trace-dialog.trace-embedded{min-height:400px}.trace-embedded .trace-pan{min-height:300px;height:55dvh;max-height:max(300px,55dvh)}.trace-embedded .trace-tools label{margin-left:0}.investigation-navigation button:last-child{margin-left:0}.explorer-formula{max-height:none}.explorer-formula .trace-math-expression{max-height:45vh}.explorer-formula{overflow:visible}}

.explorer-check-legend{
 display:flex;flex-wrap:wrap;gap:2px 12px;flex-shrink:0;margin:0;padding:4px 8px;
 border-top:1px solid var(--border);list-style:none;font-size:12px;line-height:1.4;color:var(--muted);
}
.explorer-check-legend span{font-weight:700;color:var(--ink)}

.investigation-navigation[hidden]{display:none}
.explorer-selection{border-bottom:1px solid var(--border);padding-bottom:12px;margin-bottom:14px;overflow-wrap:anywhere}
.explorer-selection h3{font-size:14px;margin:0 0 8px}
.explorer-value{font-size:24px;font-weight:600;max-height:96px;overflow:auto;white-space:pre-wrap}
.explorer-selection p{font-size:12px;margin:5px 0 0}


/* Keep controls compact so the evidence owns the viewport. */
.explorer-viewbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;margin-bottom:8px;flex-shrink:0;min-width:0}
.explorer-viewbar .explorer-tabs{margin:0;padding:0;border:0;gap:6px;min-width:0;max-width:100%}
.explorer-viewbar .explorer-tabs button{padding:6px 12px;min-height:32px}
.explorer-viewbar .investigation-navigation{margin:0;gap:6px;min-width:0;max-width:100%}
.explorer-viewbar .investigation-navigation button{min-height:32px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.trace-dialog.trace-embedded{padding:8px}
.trace-embedded .trace-tools{gap:6px;margin:0 0 6px}
.trace-embedded .trace-tools button{min-height:32px}
.trace-embedded .trace-tools #trace-location{order:1;flex-basis:100%;margin:0;line-height:1.3}
.trace-embedded .trace-tools label{display:flex;flex-direction:row;align-items:center;gap:6px;margin-left:auto;white-space:nowrap;min-height:32px}
.trace-embedded .trace-tools input[type=range]{width:100px;height:24px;margin:0;padding:0;border:0;background:transparent}
@media(min-width:801px){
 .shell[data-workspace-page=explore] .workspace .topbar{min-height:52px;padding-top:5px;padding-bottom:5px}
 .shell[data-workspace-page=explore] .workspace main{padding-top:10px;padding-bottom:10px}
 .trace-embedded .trace-pan,.trace-embedded .trace-limited .trace-pan{min-height:0}
 .shell[data-workspace-page=explore] .workspace .explore-toolbar{gap:8px;margin-bottom:8px}
 .shell[data-workspace-page=explore] .explore-toolbar label{gap:3px}
 .shell[data-workspace-page=explore] .explore-toolbar select,.shell[data-workspace-page=explore] .explore-toolbar input{padding:6px 9px;min-height:34px}
 .shell[data-workspace-page=explore] .explore-toolbar button,.shell[data-workspace-page=explore] .explore-toolbar summary{padding:7px 12px;min-height:34px}
}
@media(max-width:800px){
 .explorer-viewbar{align-items:stretch}
 .explorer-viewbar .explorer-tabs{width:100%}
 .explorer-viewbar .explorer-tabs button,.explorer-viewbar .investigation-navigation button,.trace-embedded .trace-tools button{min-height:44px}
 .trace-embedded .trace-tools label{margin-left:0;min-height:44px}
}

.trace-embedded .trace-layout,.trace-embedded .trace-tools{min-width:0;max-width:100%}
.trace-embedded .trace-pan{min-width:0;max-width:100%}

.trace-embedded > .trace-map-legend{flex-shrink:0;align-self:flex-start}
.trace-embedded :is(.scenario-map-cell:not(button), .node:not([role=button])){cursor:default}
.explorer-drawer-formula{margin:12px 0}
.explorer-drawer-formula details{margin:8px 0}
.explorer-drawer-formula .trace-math-expression{max-height:min(28vh,240px);overflow:auto}
.explorer-drawer-formula .notation-guide{font-size:12px;color:var(--muted)}
.explorer-map-item .explorer-operation>button{margin:0 8px 8px 0}
.explorer-map-item .explorer-operation>.trace-source{margin:0 0 8px}
.explorer-map-item .explorer-operation>p{margin:6px 0}
.explorer-map-item .explorer-checks:empty{display:none}
.trace-embedded .scenario-map-cell:not(button){border:1px solid var(--map-border)}
