/* R263 adaptive canvas: use available CSS viewport, not physical monitor pixels.
 * Retains pinned construction source and browser request/preview revision.
 */
@media (min-width:1500px) and (min-height:700px){
 main,.topbar,footer{max-width:none;padding-inline:clamp(1rem,1.65vw,2.75rem)}
 .intro{margin-top:.9rem;margin-bottom:1rem}
 .recipes{margin:.55rem 0 .9rem}
 .workbench{grid-template-columns:clamp(240px,15vw,345px) minmax(0,1fr) clamp(260px,19vw,410px);gap:clamp(.65rem,1vw,1.25rem)}
 .workbench>.panel{position:sticky;top:.75rem;align-self:start;max-height:calc(100dvh - 1.5rem);overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable}
 .workbench .viewport{height:clamp(370px,62dvh,1020px)}
 .workbench .configuration,.workbench .hierarchy{padding:1rem}
 .workbench .part-list{max-height:47dvh;overflow-y:auto}
 .details-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:1200px) and (max-width:1499px) and (min-height:640px){
 .workbench .viewport{height:clamp(330px,53dvh,750px)}
 .workbench>.panel{min-width:0}
}
@media (max-width:760px),(max-height:639px){
 .workbench>.panel{position:static;max-height:none;overflow:visible}
 .workbench .viewport{height:clamp(280px,52dvh,560px)}
}
@media (hover:none) and (pointer:coarse){
 .workbench button,.workbench select,.workbench input{min-height:44px}
}

/* The legacy mobile rule hid Motion and Anatomy links entirely. Keep cross-tool
 * navigation available in a second header row instead of removing features. */
@media(max-width:760px){
 .topbar{display:grid;grid-template-columns:minmax(0,1fr);gap:.45rem;align-items:center;padding-block:.65rem}
 .topbar nav{display:flex;grid-row:2;gap:.5rem;justify-content:flex-start;flex-wrap:wrap;width:100%}
 .topbar nav>a{display:inline-flex;align-items:center;min-height:44px;padding:.35rem .5rem}
 .topbar nav .theme{margin-left:auto}
 .topbar nav .theme select{min-height:44px}
}

/* R264 explicit source-preserving pane collapse and restored stage width. */
.workbench.hide-configuration .configuration,
.workbench.hide-hierarchy .hierarchy{display:none!important}
.workbench.viewer-focus .configuration,
.workbench.viewer-focus .hierarchy{display:none!important}
.workbench.viewer-focus{grid-template-columns:minmax(0,1fr)!important}
.workbench.viewer-focus .stage{grid-column:1/-1;grid-row:1}
@media(min-width:1200px) and (min-height:640px){
 .workbench.hide-configuration:not(.viewer-focus){grid-template-columns:minmax(0,1fr) clamp(260px,19vw,410px)}
 .workbench.hide-configuration:not(.viewer-focus) .stage{grid-column:1;grid-row:1}
 .workbench.hide-configuration:not(.viewer-focus) .hierarchy{grid-column:2;grid-row:1}
 .workbench.hide-hierarchy:not(.viewer-focus){grid-template-columns:clamp(240px,15vw,345px) minmax(0,1fr)}
 .workbench.hide-hierarchy:not(.viewer-focus) .configuration{grid-column:1;grid-row:1}
 .workbench.hide-hierarchy:not(.viewer-focus) .stage{grid-column:2;grid-row:1}
 .workbench.hide-hierarchy.hide-configuration:not(.viewer-focus){grid-template-columns:minmax(0,1fr)}
 .workbench.hide-hierarchy.hide-configuration:not(.viewer-focus) .stage{grid-column:1/-1;grid-row:1}
}
@media(min-width:761px) and (max-width:1199px) and (min-height:640px){
 .workbench.hide-configuration:not(.viewer-focus){grid-template-columns:minmax(0,1fr)}
 .workbench.hide-configuration:not(.viewer-focus) .stage{grid-column:1;grid-row:1}
 .workbench.hide-configuration:not(.viewer-focus) .hierarchy{grid-column:1;grid-row:2}
 .workbench.hide-hierarchy:not(.viewer-focus){grid-template-columns:230px minmax(0,1fr)}
 .workbench.hide-hierarchy:not(.viewer-focus) .stage{grid-column:2;grid-row:1}
 .workbench.hide-hierarchy.hide-configuration:not(.viewer-focus){grid-template-columns:minmax(0,1fr)}
 .workbench.hide-hierarchy.hide-configuration:not(.viewer-focus) .stage{grid-column:1;grid-row:1}
}
@media(max-width:760px),(max-height:639px){
 .workbench.hide-configuration:not(.viewer-focus) .stage{grid-row:1}
 .workbench.hide-configuration:not(.viewer-focus) .hierarchy{grid-row:2}
 .workbench.hide-hierarchy:not(.viewer-focus) .stage{grid-row:1}
 .workbench.hide-hierarchy:not(.viewer-focus) .configuration{grid-row:2}
}
