/* Map and readable theory share one workspace; no modal-sized overlay blocks the map. */
.map-theory-picker{display:flex;gap:12px;align-items:end;padding:14px 16px;background:#f1f7f8;border-block:1px solid #c5d6dd}
.map-theory-picker label{display:grid;gap:6px;flex:1;font:13px/1.4 Arial;color:#244f61}
.map-theory-picker select,.map-theory-picker button,.map-record-choice,.map-record-links button{min-height:44px;font:14px/1.4 Arial;padding:10px 12px;border:1px solid #9fbac5;border-radius:5px;background:#fff;color:#244f61;cursor:pointer;max-width:100%}
.map-context-thumbnails>summary{cursor:pointer;padding:14px 16px;min-height:20px;font:15px/1.4 Arial;color:#244f61}
.theory-selection-ready:not(.ux-theories-mode):not(.has-unmapped-theory) .map-theory-picker,.theory-selection-ready:not(.ux-theories-mode):not(.has-unmapped-theory) .map-context-thumbnails{display:none}
.theory-selection-ready.has-unmapped-theory .map-record-library{display:block!important}
.theory-selection-ready .map-record-library{border-bottom:1px solid #bdcfd6;padding:14px 16px}
.theory-selection-ready .map-record-library summary{font:16px/1.5 Arial;min-height:24px}
.theory-selection-ready .map-record-library:not([open])>*:not(summary){display:none}
.theory-selection-ready.ux-theories-mode .workbench-viewport,.theory-selection-ready.has-unmapped-theory .workbench-viewport{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,360px);align-items:start}
.theory-selection-ready .map-satellite-toolbar{grid-column:1/-1}
.theory-selection-ready .map-theory-reader{display:none;min-width:0;background:#fff;border-left:1px solid #bdcfd6}
.theory-selection-ready.ux-theories-mode .map-theory-reader,.theory-selection-ready.has-unmapped-theory .map-theory-reader{display:block;grid-column:2}
.theory-selection-ready.ux-theories-mode .gleason-stage,.theory-selection-ready.has-unmapped-theory .gleason-stage{height:clamp(520px,70svh,740px)!important;grid-column:1;min-width:0}
.theory-selection-ready .map-theory-reader .gleason-story{position:static!important;inset:auto!important;width:auto!important;max-height:none!important;box-shadow:none;border:0;border-radius:0;padding:18px;backdrop-filter:none}
.theory-selection-ready .map-theory-reader .gleason-story[hidden],.theory-selection-ready.has-exact-theory .gleason-story{display:none!important}
.theory-selection-ready .map-record-selected{border:0;padding:18px;scroll-margin-top:12px;outline:none}
.theory-selection-ready .map-record-selected h3{font:25px/1.25 Georgia;margin:7px 0 18px}
.theory-selection-ready .map-record-selected h4{font:600 14px/1.45 Arial;margin:20px 0 6px}
.theory-selection-ready .map-record-selected p,.theory-selection-ready .map-record-selected strong,.theory-selection-ready .map-record-links a{font-size:14px;line-height:1.65}
.theory-selection-ready .map-record-selected small{font-size:11px;line-height:1.5}
.map-record-choice{display:block;width:100%;text-align:left;margin:9px 0}
.theory-selection-ready .map-record-card strong{font-size:14px}.theory-selection-ready .map-record-card small{font-size:12px}
.theory-selection-ready .workbench-viewport{scroll-margin-top:16px}
.theory-selection-ready:fullscreen .map-theory-picker,.theory-selection-ready:fullscreen .map-context-thumbnails,.theory-selection-ready:fullscreen .map-record-library{display:none!important}
.theory-selection-ready:fullscreen .map-theory-reader{max-height:100%;overflow:auto}
@media(max-width:760px){
 .map-theory-picker{display:grid;grid-template-columns:minmax(0,1fr);padding:12px;gap:10px}
 .map-theory-picker select,.map-theory-picker button{width:100%;font-size:16px}
 .theory-selection-ready.ux-theories-mode .workbench-viewport,.theory-selection-ready.has-unmapped-theory .workbench-viewport{display:block}
 .theory-selection-ready.ux-theories-mode .gleason-stage,.theory-selection-ready.has-unmapped-theory .gleason-stage{height:clamp(390px,60svh,600px)!important}
 .theory-selection-ready .map-theory-reader{border-left:0;border-top:1px solid #bdcfd6}
 .theory-selection-ready .map-record-selected,.theory-selection-ready .map-theory-reader .gleason-story{padding:18px!important}
 .theory-selection-ready .map-record-selected p,.theory-selection-ready .map-record-selected strong,.theory-selection-ready .map-record-links a,.theory-selection-ready .map-theory-reader .gleason-story p{font-size:16px!important;line-height:1.65!important}
 .theory-selection-ready .map-record-selected h3{font-size:27px}
 .theory-selection-ready .map-record-list{grid-template-columns:1fr}
 .theory-selection-ready .map-record-card{display:grid;grid-template-columns:104px minmax(0,1fr);min-height:104px}
 .theory-selection-ready .map-record-card img{grid-row:1/3;height:104px!important;object-fit:cover}
 .theory-selection-ready .map-record-card strong,.theory-selection-ready .map-record-card small{grid-column:2}
 .theory-selection-ready .map-record-card:not(:has(img)) strong,.theory-selection-ready .map-record-card:not(:has(img)) small{grid-column:1/-1}
 .theory-selection-ready .map-record-choice{font-size:16px}
}
/* Expanded mode is deliberately a map-only view; exit restores the selected reader. */
.theory-selection-ready:fullscreen .map-theory-reader,.theory-selection-ready.gleason-expanded .map-theory-reader{display:none!important}
.theory-selection-ready:fullscreen .workbench-viewport,.theory-selection-ready.gleason-expanded .workbench-viewport{display:flex!important;flex-direction:column;min-height:0}
.theory-selection-ready:fullscreen .gleason-stage,.theory-selection-ready.gleason-expanded .gleason-stage{height:auto!important;min-height:280px!important;flex:1}
.theory-selection-ready:fullscreen .gleason-stage{min-height:0!important}

.theory-selection-ready.theory-reader-closed .map-theory-reader{display:none!important}
.theory-selection-ready.theory-reader-closed .workbench-viewport{grid-template-columns:minmax(0,1fr)}
