/* Full-map workspace: presentation and navigation. */
#mapWorkspaceBar { display:none; }
body.graph-workspace-active #mapWorkspaceBar:not([hidden]) {
  display:flex; flex-wrap:wrap; align-items:center; gap:6px; flex:0 0 auto;
  padding:6px 10px; border-bottom:1px solid #cedbd6; background:#fafbf9;
  position:relative; z-index:16; min-width:0;
}
#mapWorkspaceBar button { min-height:36px; padding:6px 10px; font-size:13px; white-space:normal; }
#mapWorkspaceBar button:disabled { opacity:.45; cursor:default; }
#workspaceLocation { flex:1 1 170px; font-size:13px; line-height:1.3; color:#3b5650; overflow-wrap:anywhere; }
#workspaceSizeToggle { border-color:#6b8d83; }
#workspaceWhole { font-weight:750; }
body[data-level="3"] #workspaceGuide, #judgmentCaseStart {
  background:#245b50; color:#fff; border:1px solid #245b50; font-weight:750;
}
body[data-level="3"] #workspaceGuide:hover, #judgmentCaseStart:hover { background:#174a3f; }
#judgmentCaseStart { min-height:48px; padding:12px 20px; }
body.case-active #workspaceGuide { background:transparent; color:#245b50; font-weight:600; }
body.case-active[data-level="3"] #workspaceGuide:hover { color:#fff; }
#mapWorkspaceBar #workspaceTracePlay { min-width:104px; min-height:44px; padding:8px 18px; font-size:16px; font-weight:750; background:#245b50; color:#fff; border-color:#245b50; }
#mapWorkspaceBar #workspaceTracePlay:not(:disabled):hover { background:#174a3f; }
#mapWorkspaceBar #workspaceTracePlay:focus-visible { outline:3px solid #90b5a7; outline-offset:2px; }
#mapWorkspaceBar #workspaceTracePlay:disabled { display:none; }
@media(prefers-reduced-motion:reduce) { #workspaceTraceNext { background:#245b50; color:#fff; font-weight:750; } }
/* Architecture has room for a third title line in its taller, repacked cards. */
body[data-level="2"] #treeSvg .map-node .node-card strong { -webkit-line-clamp:3; }
#workspaceTraceControls, .workspace-zoom { display:inline-flex; gap:3px; align-items:center; }
#workspaceTraceControls[hidden] { display:none; }
#mapWorkspaceBar .workspace-zoom button { min-width:36px; font-size:18px; padding:3px 8px; }
body.graph-workspace-expanded .app-header { display:none; }
body.graph-workspace-active .graph-column { display:flex !important; flex-direction:column; min-height:0; }
body.graph-workspace-active .graph-column > * { flex-shrink:0; }
body.graph-workspace-active #graphShell { flex:1 1 0; height:0; min-height:100px; width:100%; }
body.graph-workspace-active #mapWorkspaceTools { display:none; }
body.graph-workspace-active.workspace-tools-open #mapWorkspaceTools {
  display:flex; flex-wrap:wrap; overflow:auto; max-height:30dvh; padding:8px 10px; gap:8px;
  min-height:0; background:#f2f6f3; box-shadow:none;
}
/* Expose the full tool set without changing the user's normal header preference.
   Context-specific and hidden controls must still remain hidden. */
body.graph-workspace-active.workspace-tools-open.controls-compact #mapWorkspaceTools > :is(#searchForm,#clearRegion,#viewInfoToggle,#legendToggle,#branchGuideToggle,#detachmentPathToggle,#implicationOnly,#historyModeControl,#historyConstructControl,#activeCaseControls,#workedCasesShortcut):not([hidden]) { display:flex !important; }
body.graph-workspace-active #mapWorkspaceTools > :is(#mapReaderReturn,#geometricZoomControl) { display:none !important; }
body.graph-workspace-active #mapWorkspaceTools > .sr-only { position:absolute; }
body.graph-workspace-active #mapWorkspaceTools form { flex:1 1 240px; }
body.graph-workspace-active #mapWorkspaceTools select { min-width:0; }
body.graph-workspace-active .history-key { max-height:28dvh; overflow:auto; }
body.graph-workspace-active:not(.workspace-tools-open) .history-key { display:none !important; }
body.graph-workspace-active #appGrid #caseBanner { display:none !important; }
body.graph-workspace-active.workspace-case-open #appGrid #caseBanner:not([hidden]) {
  display:grid !important; position:relative !important; inset:auto !important; transform:none;
  width:100%; margin:0; border-width:0 0 1px; border-radius:0; padding:10px 48px 10px 14px;
  max-height:30dvh; overflow:auto; box-shadow:none; grid-template-columns:minmax(0,1fr);
}
body.graph-workspace-active #graphLegend:not([hidden]) {
  position:relative !important; inset:auto !important; width:100%; height:auto;
  max-height:32dvh; overflow:auto; border-radius:0; padding-top:46px;
}
body.graph-workspace-expanded .side-panel .panel-content { top:0; }
#mapReaderActions { margin:18px 0 24px; }
#mapReaderActions #architectureWholeMap {
  background:#245b50; color:#fff; border-color:#245b50; min-height:48px; padding:12px 20px; font-weight:750;
}
#mapReaderActions #judgmentWholeMap { min-height:44px; padding:10px 16px; }
#mapReaderActions #architectureWholeMap:focus-visible, #mapReaderActions #judgmentWholeMap:focus-visible { outline:3px solid #90b5a7; }
@media(max-width:900px) {
  #workspaceLocation { flex-basis:100%; order:2; }
  #mapWorkspaceBar button { min-height:40px; }
}
@media(max-width:760px) {
  body.graph-workspace-active #mapWorkspaceBar { padding:5px 7px; gap:4px; }
  #mapWorkspaceBar button { padding:6px 8px; font-size:12px; }
  #workspaceLocation { font-size:12px; }
  body.graph-workspace-active #mapWorkspaceTools form { flex-basis:100%; }
  body.graph-workspace-active #mapWorkspaceTools #regionSelect { flex:1 1 190px; width:auto; }
  body.graph-workspace-active #mapWorkspaceTools #historyModeControl { max-width:100%; }
  body.graph-workspace-active #mapWorkspaceTools #historyModeControl select { max-width:100%; }
  body.graph-workspace-active .graph-column { padding-bottom:64px; }
  body.graph-workspace-active .app-grid[data-definition-open="true"] .graph-column,
  body.graph-workspace-active .app-grid[data-cases-open="true"] .graph-column { padding-bottom:calc(38dvh + 10px); }
  body.graph-workspace-active .side-panel .panel-content { max-height:38dvh; }
}
