/* surface microscope */
.scope { border: 1px solid var(--line-strong); background: var(--surface); }
.scope-controls, .scope-zoom { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; padding: var(--s3) var(--s4); }
.scope-controls { border-bottom: 1px solid var(--line); }
.scope-zoom { border-top: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); }
.seg button { font: 500 var(--t-xs) var(--font); padding: .5rem .7rem; border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.scope-view { position: relative; aspect-ratio: 16 / 10; background: oklch(55% 0.01 245); overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.scope-view:active { cursor: grabbing; }
.scope-view canvas, .scope-still { position: absolute; inset: 0; width: 100%; height: 100%; }
.scope-still { object-fit: cover; }
.scope.scope-gl .scope-still { display: none; }
.scope:not(.scope-gl) canvas, .scope:not(.scope-gl) .scope-handle, .scope:not(.scope-gl) .scope-tag, .scope:not(.scope-gl) .scope-hint, .scope:not(.scope-gl) .scope-scale { display: none; }
.scope-tag { position: absolute; top: var(--s3); display: grid; gap: 4px; max-width: 46%; }
.scope-tag.left { left: var(--s3); } .scope-tag.right { right: var(--s3); justify-items: end; }
.scope-tag select { font: 600 var(--t-xs) var(--font); padding: .35rem .5rem; background: oklch(20% 0.02 255 / .82); color: #fff; border: 1px solid oklch(100% 0 0 / .25); border-radius: 2px; max-width: 100%; }
.scope-tag span { font: 500 11px var(--mono); color: #fff; background: oklch(20% 0.02 255 / .7); padding: 2px 6px; }
.scope-tag span:empty { display: none; }
.scope[data-split=off] .scope-tag.right, .scope[data-split=off] .scope-handle, .scope[data-split=off] .scope-tag.left select { display: none; }
.scope-handle { position: absolute; top: 0; bottom: 0; width: 44px; margin-left: -22px; background: none; border: 0; cursor: ew-resize; padding: 0; }
.scope-handle span { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px oklch(0% 0 0 / .4); }
.scope-handle span::before, .scope-handle span::after { content: ""; position: absolute; top: 10px; border: 5px solid transparent; }
.scope-handle span::before { left: 2px; border-right-color: oklch(30% 0.02 255); } .scope-handle span::after { right: 2px; border-left-color: oklch(30% 0.02 255); }
.scope-scale { position: absolute; left: var(--s3); bottom: var(--s3); display: grid; gap: 4px; color: #fff; font: 600 11px var(--mono); background: oklch(20% 0.02 255 / .72); padding: 6px 8px; pointer-events: none; }
.scope-scale i { display: block; height: 4px; background: #fff; border-inline: 1px solid #fff; }
.scope-hint { position: absolute; right: var(--s4); bottom: var(--s4); font: 500 11px var(--font); color: #fff; background: oklch(20% 0.02 255 / .6); padding: 3px 8px; pointer-events: none; }
.zoom-range { flex: 1 1 160px; }
.zoom-range input { width: 100%; accent-color: var(--laser-ink); }
.scope-zoom output { font: 600 var(--t-sm) var(--mono); min-width: 11ch; text-align: right; }
.scope-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); padding: var(--s3) var(--s4) var(--s4); border-top: 1px solid var(--line); align-items: start; }
.scope-text { margin: 0; font-size: var(--t-sm); max-width: 80ch; }
.scope-foot .check { font-size: var(--t-xs); color: var(--muted); }
@media (max-width: 760px) {
  .scope-view { aspect-ratio: 4 / 3; }
  .scope-controls .seg, .scope-zoom .seg { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
  .scope-controls, .scope-zoom { min-width: 0; }
  .scope-foot { grid-template-columns: 1fr; }
  .scope-hint { display: none; }
}
