/* V5 outer UI only. The 640×640 microscope model and all science coordinates remain unchanged. */
body.scope-full-lock{overflow:hidden}
.scope-workbench{--ar:1;--side:340px;--view-h:560px;display:grid;grid-template-columns:1fr;gap:18px;min-width:0}
.scope-workbench .scope-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--rule);padding-bottom:12px}
.scope-head h3{margin:0;font-size:26px;line-height:1.4;color:var(--teal)}
.scope-head-tools{display:flex;flex-wrap:wrap;gap:8px}
.scope-head-tools button{min-height:48px;font-size:22px}
.scope-head-tools .scope-language{display:none}
.scope-sidebar,.scope-view{min-width:0;min-height:0}
.scope-sidebar .scope-controls{margin:0;grid-template-columns:repeat(2,minmax(0,1fr))}
.scope-sidebar .stage-panel{margin-bottom:18px}
.scope-sidebar .scope-selector{margin-top:0}
.scope-sidebar .scope-readouts{justify-content:flex-start}
.scope-view .lens-wrap{max-width:620px;margin:auto}
.scope-photo-frame{display:flex;flex-direction:column;align-items:center;gap:12px;padding:16px;border:1px solid var(--rule);border-radius:14px}
.scope-photo-frame .scope-instrument{width:100%;height:auto;max-width:455px;max-height:600px;object-fit:contain;margin:0;border-radius:10px}
.scope-photo-frame .photo-credit{font-size:18px;line-height:1.5;margin:0;text-align:center;color:var(--muted)}
.scope-full-help{display:none;color:var(--muted);font-size:22px;margin:0 0 14px}
.scope-workbench.scope-full{
  position:fixed;inset:0;z-index:15000;width:100%;height:100vh;height:100dvh;
  max-width:none;margin:0;border:0;border-radius:0;background:var(--bg-base);
  padding:12px;padding: max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  grid-template-columns:var(--side) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:12px 16px;overflow:hidden;
}
.scope-full .scope-head{grid-column:1/-1;grid-row:1;padding:0 0 10px}
.scope-full .scope-head-tools .scope-language{display:block}
.scope-full .scope-sidebar{grid-column:1;grid-row:2;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:8px;touch-action:pan-y}
.scope-full .scope-view{grid-column:2;grid-row:2;display:flex;align-items:center;justify-content:center;overflow:hidden}
.scope-full .scope-view .lens-wrap,.scope-full .scope-photo-frame{width:100%;height:100%;max-width:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;margin:0;padding:12px}
.scope-full .scope-view .lens-title{flex:0 0 auto;line-height:1.4;margin:0;text-align:center}
/* Width is constrained by BOTH the right-hand grid cell and available screen height × --ar. */
.scope-full .scope-view .scope-lens,.scope-full .scope-view .scope-instrument{flex:0 0 auto;width:min(100%,calc(var(--view-h)*var(--ar)));height:auto;max-width:100%;max-height:var(--view-h);object-fit:contain;margin:0}
.scope-full .scope-controls{grid-template-columns:1fr;gap:10px}
.scope-full .scope-control{padding:10px}
.scope-full .scope-control small{display:none}
.scope-full .scope-selector>label,.scope-full .stage-panel h3{font-size:22px}
.scope-full .stage-panel h3{margin:0 0 8px}
.scope-full .stage-panel>p{display:none}
.scope-full .slide-control{height:160px}
.scope-full .move-buttons{margin:10px 0;gap:6px}
.scope-full .move-buttons button{font-size:22px;line-height:1.35;min-height:48px}
.scope-full .choice,.scope-full .action-btn{font-size:22px;min-height:48px;padding:7px 10px}
.scope-full .choice-row,.scope-full .control-row{gap:8px;margin:10px 0}
.scope-full .status{font-size:22px;line-height:1.5;min-height:0;margin:10px 0;padding:10px}
.scope-full .scope-readouts{gap:6px;margin:12px 0}
.scope-full .scope-readouts span{font-size:18px;line-height:1.45;padding:6px 8px}
.scope-full .scope-full-help{display:block}
.scope-side-details{margin-top:16px;padding:12px;border:1px solid var(--rule);border-radius:10px}
.scope-side-details summary{font-size:22px;color:var(--teal);cursor:pointer}
.scope-side-details p{font-size:22px;line-height:1.6;margin:10px 0 0}
@media(max-width:700px){.scope-sidebar .scope-controls{grid-template-columns:1fr}}
@media(max-aspect-ratio:1/1){
  .scope-workbench.scope-full{display:flex;flex-direction:column;overflow:auto;gap:14px}
  .scope-full .scope-head{position:sticky;top:0;z-index:2;background:var(--bg-base);flex:0 0 auto;padding-bottom:10px}
  .scope-full .scope-view{order:1;flex:0 0 auto;overflow:visible}
  .scope-full .scope-sidebar{order:2;flex:0 0 auto;overflow:visible;scrollbar-gutter:auto;padding:0}
  .scope-full .scope-view .lens-wrap,.scope-full .scope-photo-frame{height:auto;max-width:560px;margin:auto}
  .scope-full .scope-view .scope-lens,.scope-full .scope-view .scope-instrument{width:100%;max-height:none}
  .scope-full .scope-head h3{font-size:22px}
}
