.cube-panel { grid-column: 1 / -1; min-width: 0; }
.study-sheet [hidden] { display: none !important; }
.cube-layout { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(310px,1fr); }
.cube-model,.cube-info { min-width:0; padding:clamp(16px,3vw,30px); }
.cube-info { border-left:1px solid var(--study-rule); }
.cube-stage { isolation:isolate; width:100%; aspect-ratio: 760/540; position:relative; overflow:hidden; background:#f5f7f8; }
.cube-stage :is(canvas,img) { position:absolute; inset:0; display:block; width:100%;height:100%; }
.cube-stage img {object-fit:contain;}
.cube-stage canvas {touch-action:none; cursor:default;}
.cube-stage canvas:focus-visible { outline:2px solid var(--study-accent);outline-offset:-3px; }


.cube-kicker,.cube-mode {font-family:var(--study-mono);font-size:.78rem;letter-spacing:.035em;color:var(--study-muted);}
.cube-kicker {margin:0 0 .65rem;}
.cube-info h3 { font-size:clamp(1.45rem,2.3vw,2.15rem);margin:0;line-height:1.12; }
.cube-info p:not(.cube-kicker) {font-size:1rem;line-height:1.45;}
.cube-variants,.cube-controls,.cube-replay {display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:12px;}
.cube-layout button { min-height:44px; padding:7px 11px;border:1px solid var(--study-rule);border-radius:3px;font-size:.91rem; }
.cube-layout button[aria-pressed="true"] {border-color:#456b60;background:#ecf3ef;color:#1c503e;box-shadow:inset 0 -2px #456b60;}
.cube-replay { display:grid;grid-template-columns:auto 1fr auto; }
.cube-replay label { position:absolute;clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;overflow:hidden; }
.cube-replay input { min-width:0;width:100%;height:32px;accent-color:#426c62; }
.cube-replay output {font-family:var(--study-mono);font-size:.8rem;}
.cube-results table {width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:.88rem; }
.cube-results caption {text-align:left;font-weight:600;padding:1rem 0 .55rem;}
.cube-results th,.cube-results td { border-bottom:1px solid var(--study-rule);padding:.53rem .33rem;text-align:right;white-space:nowrap; }
.cube-results th:first-child {text-align:left;white-space:normal;}
.cube-results table[data-highlight="0"] :is(td,th):nth-child(2),.cube-results table[data-highlight="1"] :is(td,th):nth-child(3) {background:#edf3ef;}
.cube-finding { padding:.68rem 0 .65rem; margin:.45rem 0; }
.cube-method summary{cursor:pointer;font-size:.95rem;text-decoration:underline;text-underline-offset:.15em;}
.cube-method p { color:var(--study-muted); }
@media(max-width:820px) {
  .cube-layout{grid-template-columns:minmax(0,1fr);}
  .cube-info {border-left:none;border-top:1px solid var(--study-rule);}
  .cube-stage {aspect-ratio:760/490;}
}

.cube-controls {display:block;}
.cube-camera-tools, .cube-tool-group, .cube-key, .cube-key span {display:flex;align-items:center;}
.cube-camera-tools {flex-wrap:wrap;gap:6px 10px;}
.cube-tool-group {gap:0;}
.cube-tool-group button {min-width:44px;}
.cube-tool-group button + button {margin-left:-1px;}
.cube-tool-group button:not(:last-child) {border-top-right-radius:0;border-bottom-right-radius:0;}
.cube-tool-group button:not(:first-child) {border-top-left-radius:0;border-bottom-left-radius:0;}
.cube-tool-group button:focus-visible {position:relative;z-index:1;}
.cube-tool-group [data-camera] {font:500 1.25rem/1 var(--study-mono);padding:6px;}
.cube-tool-group button svg {display:block;margin:auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.cube-camera-help {font-size:.875rem;margin-top:8px;color:var(--study-muted);}
.cube-camera-help summary {cursor:pointer;width:fit-content;text-underline-offset:.18em;}
.cube-camera-help summary:hover {text-decoration:underline;}
.cube-camera-help p {max-width:58ch;line-height:1.45;margin:.45rem 0;}
.cube-key {gap:14px;flex-wrap:wrap;margin-top:12px;font-size:.875rem;color:var(--study-muted);}
.cube-key span {gap:6px;}
.cube-key i {display:inline-block;width:14px;height:10px;border-radius:2px;}
.cube-key-robot {background:#3aa0a8;border-bottom:3px solid #2e3740;}
.cube-key-bin {background:#dfaa5f;border:1px solid #8e612c;}
