/* The workspace fills the viewport; scientific rendering stays in explorer-nodes.css. */
header { padding: .45rem .75rem; gap: .7rem; }
header h1 { font-size: 1.2rem; white-space: nowrap; }
.workspace-tools { display: flex; gap: .25rem; margin-left: auto; }
.workspace-tools button { font-size: .75rem; padding: .25rem .5rem; }
#theme-toggle { margin-left: .25rem; }
main { max-width: none; margin: 0; padding: 0 .6rem .6rem; }
.intro { margin: .35rem 0; font-size: .75rem; }
.workspace { --dock-width: 360px; display: grid; grid-template-columns: var(--dock-width) 8px minmax(0, 1fr); height: max(620px, calc(100dvh - 124px)); min-width: 0; }
.workspace.dock-hidden { grid-template-columns: minmax(0, 1fr); }
.editors { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.workspace-panel { display: flex; flex: 1 1 0; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: .3rem; background: var(--surface); }
#code-panel { flex-grow: 1.2; }
.panel-head { min-height: 2.1rem; gap: .4rem; }
.workspace-panel > .panel-head { flex: none; padding: .2rem .5rem; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: .875rem; }
.panel-collapse { padding: 0 .4rem; border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; }
.panel-content { display: flex; flex-direction: column; gap: .4rem; flex: 1 1 auto; overflow: auto; min-height: 0; padding: .5rem; }
.example-toolbar { display: flex; align-items: center; gap: .4rem; font-size: .75rem; flex-wrap: wrap; }
.example-toolbar select { flex: 1; width: 10rem; min-width: 0; }
.example-toolbar button, .example-toolbar select, .panel-content .toolbar button { font-size: .75rem; padding: .25rem .4rem; }
.panel-content .toolbar { flex: none; }
#source { height: auto; min-height: 150px; flex: 1 0 150px; margin: 0; padding: .5rem; font-size: .78rem; resize: none; }
#inputs { flex: none; margin-top: 0; padding: .4rem; font-size: .75rem; }
.inputs-grid { grid-template-columns: 1fr; }
#spec-panel .panel-content { gap: .2rem; }
.spec-hint { margin: 0; font-size: .7rem; }
#spec-scenario { font-size: .65rem; }
#model-spec { flex: 1 0 auto; min-height: 0; border: 0; padding: 0; overflow: visible; }
.model-equation { gap: .2rem; padding: .35rem .1rem; }
.equation-math { font-size: 1rem; }
#syntax-status { font-size: .67rem; margin: .15rem 0; }
#syntax-migration { margin: 0; }
#dock-resizer { cursor: col-resize; touch-action: none; position: relative; outline: none; }
#dock-resizer::after { content: ''; position: absolute; left: 3px; width: 2px; top: 15%; bottom: 15%; border-radius: 2px; background: var(--border); }
#dock-resizer:hover::after, #dock-resizer:focus-visible::after, #dock-resizer.is-dragging::after { background: var(--primary); }
#explorer { min-width: 0; min-height: 0; display: flex; flex-direction: column; margin: 0; border: 1px solid var(--border); border-radius: .3rem; padding: .35rem .5rem; }
#explorer > .panel-head { flex: none; }
.explore-settings { gap: .35rem .65rem; font-size: .72rem; flex: none; }
.explore-settings select, .explore-settings button, .explore-settings input { font-size: .75rem; padding: .2rem .3rem; }
#simulation-seed { width: 5rem; }
#explore-status { font-size: .7rem; margin: .25rem 0; }
#explore-error, #explore-stale { margin: .25rem 0; }
.graph-scroll { flex: 1 1 0; min-height: 210px; max-height: none; border-radius: .2rem; }
.diagram-help { flex: none; margin: .2rem 0; padding: .1rem 0; border: 0; border-radius: 0; }
.diagram-help summary, .simulation-help summary { font-size: .67rem; font-weight: 400; color: var(--muted); }
.diagram-help[open] { max-height: 100px; overflow: auto; }
.diagram-help .graph-key { margin: .2rem 0; }
#diagram-notes { margin: .25rem 0; }
.distribution-panel { flex: none; min-height: 0; border-top: 1px solid var(--border); }
.distribution-panel .panel-head { min-height: 1.8rem; }
#toggle-distributions { border: 0; font-size: .7rem; padding: .1rem .3rem; background: transparent; color: var(--muted); }
#distribution-content { max-height: 230px; overflow: auto; }
.scenario-line { font-size: .68rem; margin: .1rem 0 .3rem; }
.scenario-line button { font-size: .67rem; padding: .1rem .35rem; }
.marginals { grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: .4rem; }
.marginal { padding: .25rem .4rem; }
.marginal svg { height: 120px; }
#comparison-key { margin: .2rem 0; font-size: .7rem; }
.simulation-help { margin: .2rem 0 0; padding: 0; border: 0; }
.simulation-help p { margin: .3rem 0; }
.export-panel, main > details { margin-top: .35rem; padding: .4rem .6rem; }
main > details > summary { font-size: .8rem; }
@media (min-width: 1800px) {
  .workspace { --dock-width: 440px; }
  .panel-content { padding: .65rem; }
  #source { font-size: .85rem; }
  #distribution-content { max-height: 255px; }
  .marginal svg { height: 150px; }
}
@media (max-width: 999px) {
  .workspace, .workspace.dock-hidden { display: flex; flex-direction: column; gap: .5rem; height: auto; }
  #dock-resizer { display: none; }
  .editors { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .editors:has(> [hidden]) { grid-template-columns: 1fr; }
  .workspace-panel, .editors { flex: none; }
  .panel-content { flex: none; max-height: 450px; }
  #source { min-height: 230px; }
  #model-spec { min-height: 0; }
  #explorer { min-height: 620px; }
  .graph-scroll { flex: none; height: 440px; max-height: 440px; }
  #distribution-content { max-height: none; }
  .subtitle { display: none; }
}
@media (max-width: 600px) {
  header { flex-wrap: wrap; padding: .4rem .6rem; gap: .3rem .6rem; }
  header h1 { font-size: 1.1rem; }
  .workspace-tools { order: 2; width: 100%; margin-left: 0; }
  #theme-toggle { margin-left: auto; }
  .intro { font-size: .7rem; }
  .editors { display: flex; }
  .panel-content { max-height: none; }
  #spec-panel .panel-content { max-height: 340px; }
  #source { height: 260px; flex: none; resize: vertical; }
  .marginals { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .marginal svg { height: auto; }
}
