/* R263: adaptive presentation only; never change source geometry or actors.
 * Width breakpoints use CSS pixels, not physical-device/DPR assumptions.
 * CSS-only fallback is a readable one-column view if the tab JS cannot run.
 */
:root{--workspace-header:66px}
[hidden]{display:none!important}
.topbar{max-width:none;height:var(--workspace-header);position:sticky;top:0;z-index:30;background:#0b1118;border-bottom:1px solid var(--line)}
main,footer{max-width:none;padding-inline:clamp(.8rem,1.8vw,3rem)}
.intro{padding:1.25rem 0 .7rem;gap:clamp(1rem,3vw,3rem)}
.intro h1{margin:.25rem 0}.intro .lede{margin:.45rem 0}
.current-review{max-width:none;margin-bottom:.8rem;padding:.8rem 1rem}
.current-review h2{font-size:1.25rem}
.current-review p{margin:.35rem 0;max-width:95ch}
.current-review .review-actions{margin:.6rem 0}
.studio{overflow:visible;align-items:start}
.stage-panel{display:contents}
.viewer-column,.tool-column,.clip-panel{min-width:0}
.workspace-chrome{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.35rem .85rem;background:#101923}
.workspace-chrome .source-notice{margin:0;max-width:70ch;font-size:.75rem}
.workspace-focus{flex:none;min-height:44px;white-space:nowrap}
.tool-column{background:#121c26}
.tool-tabs{position:sticky;top:0;z-index:3;display:flex;gap:.25rem;padding:.6rem;overflow-x:auto;scrollbar-gutter:stable;background:#101923;border-bottom:1px solid var(--line);scroll-snap-type:x proximity}
.tool-tabs button{flex:none;min-height:44px;white-space:nowrap;font-size:.8rem;padding:.5rem .65rem;scroll-snap-align:start}
.tool-tabs button[aria-selected=true]{background:#23483f;color:#c8ffeb;border-color:#72bfa5}
.tool-tabs button:focus-visible,.workspace-focus:focus-visible{outline:3px solid #f5ca84;outline-offset:2px}
.tool-column>section,.tool-column>details{margin:0;min-width:0}
.tool-column>section[hidden],.tool-column>details[hidden]{display:none}
.tool-column .human-editor,.tool-column .anatomy-panel{padding:1rem}
.tool-column .human-control-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,165px),1fr));gap:.5rem}
.tool-column .anatomy-systems{grid-template-columns:repeat(2,minmax(0,1fr))}
.tool-column .score-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
.tool-column .anatomy-tools{gap:.5rem}
.tool-column fieldset,.tool-column select,.tool-column input{min-width:0;max-width:100%}
.tool-column .score-scroll{max-height:min(46dvh,440px);overflow:auto}
.tool-column summary{cursor:pointer}
.clip-panel{background:#101923}
.clip-list{scrollbar-gutter:stable}
.studio.viewer-focused{grid-template-columns:minmax(0,1fr)}
.studio.viewer-focused .clip-panel,.studio.viewer-focused .tool-column{display:none!important}
.studio.viewer-focused .viewer-column{grid-column:1/-1}
@media (min-width:1500px) and (min-height:680px){
 .studio{grid-template-columns:clamp(225px,13vw,310px) minmax(0,1fr) clamp(345px,23vw,480px);grid-template-rows:auto}
 .viewer-column{grid-column:2;grid-row:1;border-inline:1px solid var(--line)}
 .tool-column{grid-column:3;grid-row:1;border-left:1px solid var(--line)}
 .clip-panel{grid-column:1;grid-row:1;border-left:0;border-right:0}
 .viewer-column,.tool-column,.clip-panel{position:sticky;top:var(--workspace-header);align-self:start;max-height:calc(100dvh - var(--workspace-header) - .3rem);overflow-y:auto;overscroll-behavior-y:contain}
 .viewer-column .stage{aspect-ratio:auto;height:clamp(320px,57dvh,900px);max-height:none}
 .viewer-column .stage-heading{padding:.7rem 1rem}
 .viewer-column .mode-bar{padding:.45rem .8rem}
 .viewer-column .playback{padding:.35rem .8rem}
 .viewer-column .playback .small{margin:.35rem 0 0}
 .clip-panel .clip-list{max-height:44dvh}
 .clip-panel .clip-info{overflow-wrap:anywhere}
 .studio.viewer-focused .viewer-column .stage{height:clamp(440px,69dvh,1150px)}
}
@media (min-width:1050px) and (max-width:1499px) and (min-height:640px){
 .studio{grid-template-columns:minmax(0,1fr) minmax(310px,34%);grid-template-rows:auto auto}
 .viewer-column{grid-column:1;grid-row:1}
 .tool-column{grid-column:2;grid-row:1;border-left:1px solid var(--line)}
 .viewer-column,.tool-column{position:sticky;top:var(--workspace-header);align-self:start;max-height:calc(100dvh - var(--workspace-header) - .3rem);overflow-y:auto;overscroll-behavior-y:contain}
 .viewer-column .stage{aspect-ratio:auto;height:clamp(290px,51dvh,640px);max-height:none}
 .viewer-column .stage-heading{padding:.7rem .9rem}
 .viewer-column .mode-bar{padding:.45rem .8rem}
 .viewer-column .playback{padding:.3rem .8rem}
 .clip-panel{grid-column:1/-1;grid-row:2;display:block;border:0;border-top:1px solid var(--line);padding:.6rem 1rem}
 .clip-list{max-height:none;display:flex;flex-direction:row;overflow-x:auto;gap:.5rem}
 .clip-list button{min-width:145px;flex:none}
 .clip-info{max-width:70ch}
 .studio.viewer-focused .viewer-column .stage{height:clamp(400px,64dvh,780px)}
}
@media (max-width:1049px),(max-height:639px){
 .topbar{position:relative;height:auto;min-height:64px}
 .studio{grid-template-columns:minmax(0,1fr);overflow:hidden}
 .viewer-column{grid-column:1;grid-row:1}
 .clip-panel{grid-column:1;grid-row:2;display:block;border:0;border-top:1px solid var(--line);padding:.85rem}
 .clip-list{display:flex;flex-direction:row;max-height:none;overflow-x:auto}
 .clip-list button{flex:none;min-width:135px}
 .tool-column{grid-column:1;grid-row:3;max-height:none;overflow:visible;border-top:1px solid var(--line)}
 .workspace-focus{display:none}
 .viewer-column .stage{max-height:min(60dvh,620px)}
 .tool-tabs{position:sticky;top:0}
 .studio.viewer-focused .tool-column,.studio.viewer-focused .clip-panel{display:block!important}
}
@media(max-width:500px){
 .intro{padding:.8rem 0 .3rem}
 .current-review{padding:.7rem}
 .tool-column .score-controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .tool-tabs button{font-size:.78rem}
 .workspace-chrome{padding:.5rem}
 .clip-panel .clip-info{font-size:.85rem}
 .viewer-column .stage{max-height:55dvh}
}
@media(hover:none) and (pointer:coarse){
 .tool-column button,.tool-column input,.tool-column select,.clip-panel button{min-height:44px}
 .tool-column input[type=range]{min-height:44px}
}
@media(forced-colors:active){
 .tool-tabs button[aria-selected=true]{outline:2px solid Highlight;outline-offset:-2px}
}
@media(prefers-reduced-motion:reduce){.tool-tabs{scroll-behavior:auto;scroll-snap-type:none}}

/* Shared human-shell selectors have higher specificity than the base Motion
 * rules. Override them explicitly so a 2560px viewport does not render a
 * 1340px column floating in unused space. */
html[data-human-route=motion] main{max-width:none;width:100%;margin:0;padding-inline:clamp(.8rem,1.3vw,2.5rem)}
html[data-human-route=motion] .human-header{max-width:none;width:100%;padding-inline:clamp(.8rem,1.3vw,2.5rem)}
/* Original dark-only motion.css and the shared light/dark human.css used
 * conflicting inherited foregrounds. Keep every R263 workspace surface and
 * selected tab on a coherent theme-aware color scale. */
html[data-human-route=motion] .studio,
html[data-human-route=motion] .viewer-column,
html[data-human-route=motion] .tool-column,
html[data-human-route=motion] .clip-panel,
html[data-human-route=motion] .workspace-chrome,
html[data-human-route=motion] .tool-tabs {
 background:var(--human-panel,#121c26);color:var(--human-text,#e9f0f3);
 border-color:var(--human-line,#293540)
}
html[data-human-route=motion] .workspace-chrome,
html[data-human-route=motion] .tool-tabs{background:var(--human-subtle,#182431)}
html[data-human-route=motion] .tool-tabs button{
 color:var(--human-text,#e9f0f3);
 background:var(--human-panel,#121c26);
 border-color:var(--human-line,#293540)
}
html[data-human-route=motion] .tool-tabs button[aria-selected=true]{
 color:var(--human-text,#e9f0f3);background:var(--human-active,#244c3e);border-color:var(--human-accent,#91e7c4)
}
html[data-human-route=motion] .clip-list button{color:var(--human-text,#e9f0f3)}
html[data-human-route=motion] .clip-list button[aria-pressed=true]{color:var(--human-text,#e9f0f3);background:var(--human-active,#244c3e)}
html[data-human-route=motion] .workspace-chrome .source-notice,
html[data-human-route=motion] .clip-panel .clip-meta,
html[data-human-route=motion] .clip-panel .quiet{color:var(--human-muted,#9cabb9)}
html[data-human-route=motion] .tool-column :is(h3,legend,label,p,summary){color:inherit}
html[data-human-route=motion] .tool-column :is(select,input,button){color:var(--human-text,#e9f0f3);background:var(--human-panel,#121c26);border-color:var(--human-line,#293540)}
@media(max-width:1049px),(max-height:639px){
 html[data-human-route=motion] main{padding-inline:clamp(.7rem,3vw,1.4rem)}
}

/* Current-first review uses one-line shortcuts, not a second full page before
 * the viewer. Long explanation remains keyboard/screen-reader discoverable. */
.current-review .review-explainer{margin:.4rem 0}
.current-review .review-explainer>summary{cursor:pointer;font-size:.85rem;font-weight:600;min-height:36px;display:flex;align-items:center}
.current-review .review-explainer p{max-width:80ch;margin:.45rem 0}
@media(max-width:1049px),(max-height:639px){
 html[data-human-route=motion] .intro{padding:.65rem 0 .4rem;gap:.5rem}
 html[data-human-route=motion] .intro h1{font-size:clamp(1.8rem,6vw,2.8rem);line-height:1.12;margin:.1rem 0}
 html[data-human-route=motion] .intro .lede{font-size:.88rem;line-height:1.35;margin:.25rem 0}
 html[data-human-route=motion] .intro-note{font-size:.8rem;max-width:none}
 html[data-human-route=motion] .intro-note .quiet{margin:.15rem 0}
 html[data-human-route=motion] .current-review{margin-bottom:.5rem;padding:.45rem .65rem}
 html[data-human-route=motion] .current-review h2{font-size:1rem;line-height:1.25;margin:.2rem 0}
 html[data-human-route=motion] .current-review .eyebrow{margin:.1rem 0;font-size:.65rem}
 html[data-human-route=motion] .current-review .quiet.small{font-size:.75rem;line-height:1.4;margin:.3rem 0}
 html[data-human-route=motion] .review-actions{display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scroll-snap-type:x proximity;margin:.3rem 0;gap:.4rem;padding-bottom:.25rem}
 html[data-human-route=motion] .review-actions a{flex:none;white-space:nowrap;min-height:40px;padding:.45rem .65rem;scroll-snap-align:start}
}

/* R264: independent side-panel visibility. Handles always remain inside viewer;
 * hidden panels leave no inactive hit targets and do not modify scene state.
 */
.studio.library-collapsed .clip-panel,
.studio.inspector-collapsed .tool-column{display:none!important}
.workspace-chrome{flex-wrap:wrap;gap:.4rem;padding:.4rem .7rem}
.workspace-actions{display:flex;gap:.35rem;flex-wrap:wrap;align-items:center;margin-left:auto}
.workspace-actions button{min-height:40px;padding:.45rem .65rem;font-size:.78rem;white-space:nowrap}
.workspace-actions button[aria-expanded=false]{border-style:dashed}
.workspace-actions button[aria-expanded=true]{border-color:var(--human-accent,var(--accent))}
.workspace-chrome details.source-notice{margin:0;min-width:0;font-size:.76rem;flex:1 1 150px;max-width:58ch}
.workspace-chrome details.source-notice summary{cursor:pointer;min-height:36px;display:flex;align-items:center;font-weight:600}
.workspace-chrome details.source-notice p{margin:.4rem 0;overflow-wrap:anywhere}
.journey-strip{display:flex;gap:.4rem;align-items:center;overflow-x:auto;padding:.3rem 0 .5rem;margin:.15rem 0;scrollbar-width:thin;overscroll-behavior-x:contain}
.journey-strip button,.journey-strip a{flex:none;display:inline-flex;align-items:center;justify-content:center;min-height:40px;border-radius:.48rem;padding:.44rem .85rem;font-size:.86rem}
.journey-strip a{border:1px solid var(--human-line,var(--line));text-decoration:none}
.journey-strip button[aria-pressed=true]{border-color:var(--human-accent,var(--accent));background:var(--human-active,#244c3e);color:var(--human-text,#e9f0f3)}
.journey-strip .journey-guide{margin-left:auto}
.help-toolbar{display:flex;gap:.3rem .5rem;align-items:center;flex-wrap:wrap;margin:.3rem 0}
.help-toolbar .help-toolbar-label{font-size:.75rem;font-weight:700;opacity:.85}
.help-toolbar button,.help-toolbar a{min-height:36px;padding:.35rem .65rem;border-radius:.4rem;font-size:.76rem}
.help-toolbar button[aria-pressed=true]{background:var(--human-active,#244c3e);border-color:var(--human-accent,var(--accent));color:var(--human-text,#e9f0f3)}
.help-toolbar a{display:inline-flex;align-items:center;padding-inline:.3rem}
details.help-explain{margin:.35rem 0;border-block-start:1px solid var(--human-line,var(--line))}
details.help-explain>summary{cursor:pointer;display:flex;align-items:center;gap:.4rem;min-height:38px;padding:.35rem .2rem;font-weight:600;font-size:.78rem;color:var(--human-muted,var(--muted));overflow-wrap:anywhere}
details.help-explain>summary:hover{text-decoration:underline}
details.help-explain p{font-size:.82rem;line-height:1.45;margin:.4rem 0 .7rem;max-width:80ch;overflow-wrap:anywhere}
details.help-explain[open]>summary{color:var(--human-text,var(--light))}
.intro-note details.help-explain p{font-size:.8rem}
.evidence-drawer{border:1px solid var(--human-line,var(--line));border-radius:.65rem;margin:1rem 0;background:var(--human-panel,#121c26)}
.evidence-drawer>summary{cursor:pointer;min-height:44px;padding:.65rem 1rem;font-size:1rem;font-weight:700}
.evidence-drawer>.detail-grid{padding:1rem;gap:1.4rem}
.about{padding:1rem 0 1.5rem}
.about h2{font-size:1.1rem}
.about h3{margin:.2rem 0 .5rem;font-size:1rem}
.about .pack-downloads{max-height:min(40dvh,520px);overflow-y:auto;scrollbar-gutter:stable}
html[data-human-route=motion] .journey-strip button,
html[data-human-route=motion] .workspace-actions button,
html[data-human-route=motion] .help-toolbar button{color:var(--human-text);background:var(--human-panel);border-color:var(--human-line)}
html[data-human-route=motion] .journey-strip button[aria-pressed=true],
html[data-human-route=motion] .help-toolbar button[aria-pressed=true]{background:var(--human-active);border-color:var(--human-accent)}
html[data-human-route=motion] .evidence-drawer{background:var(--human-panel);color:var(--human-text)}
html[data-human-route=motion] details.help-explain>summary{color:var(--human-muted)}
html[data-human-route=motion] details.help-explain[open]>summary{color:var(--human-text)}
html[data-human-route=motion] .workspace-actions button:focus-visible,
html[data-human-route=motion] .help-toolbar button:focus-visible,
html[data-human-route=motion] .journey-strip :focus-visible,
html[data-human-route=motion] details.help-explain>summary:focus-visible{outline:3px solid var(--human-accent);outline-offset:2px}
@media(min-width:1500px) and (min-height:680px){
 .studio.library-collapsed:not(.viewer-focused){grid-template-columns:minmax(0,1fr) clamp(345px,23vw,480px)}
 .studio.library-collapsed:not(.viewer-focused) .viewer-column{grid-column:1;grid-row:1}
 .studio.library-collapsed:not(.viewer-focused) .tool-column{grid-column:2;grid-row:1}
 .studio.inspector-collapsed:not(.viewer-focused){grid-template-columns:clamp(225px,13vw,310px) minmax(0,1fr)}
 .studio.inspector-collapsed:not(.viewer-focused) .clip-panel{grid-column:1;grid-row:1}
 .studio.inspector-collapsed:not(.viewer-focused) .viewer-column{grid-column:2;grid-row:1}
 .studio.library-collapsed.inspector-collapsed:not(.viewer-focused){grid-template-columns:minmax(0,1fr)}
 .studio.library-collapsed.inspector-collapsed:not(.viewer-focused) .viewer-column{grid-column:1;grid-row:1}
}
@media(min-width:1050px) and (max-width:1499px) and (min-height:640px){
 .studio.inspector-collapsed:not(.viewer-focused){grid-template-columns:minmax(0,1fr)}
 .studio.inspector-collapsed:not(.viewer-focused) .viewer-column{grid-column:1;grid-row:1}
 .studio.library-collapsed:not(.viewer-focused) .clip-panel{display:none}
 .studio.library-collapsed.inspector-collapsed:not(.viewer-focused){grid-template-columns:minmax(0,1fr)}
}
@media(max-width:1049px),(max-height:639px){
 .studio.library-collapsed:not(.viewer-focused) .tool-column{grid-row:2}
 .studio.library-collapsed.inspector-collapsed:not(.viewer-focused) .viewer-column{grid-row:1}
 .studio.inspector-collapsed:not(.viewer-focused) .clip-panel{grid-row:2}
 .workspace-chrome details.source-notice{flex-basis:100%}
 .journey-strip .journey-guide{margin-left:0}
}
@media(max-width:500px){
 .workspace-chrome{padding:.4rem .5rem}
 .workspace-actions{margin:0;width:100%;justify-content:flex-start}
 .workspace-actions button{font-size:.75rem;min-height:44px;padding:.45rem .55rem}
 .journey-strip{gap:.3rem}
 .journey-strip button,.journey-strip a{font-size:.8rem;min-height:44px;padding:.4rem .65rem}
 .help-toolbar button,.help-toolbar a{min-height:44px}
 .evidence-drawer>.detail-grid{padding:.6rem}
}
@media(prefers-reduced-motion:reduce){.journey-strip{scroll-behavior:auto}}
