/* Chapter 16: fixed square view, demand rendering, ordinary touch scrolling. */
.homogeneous-overview{margin:0;border:1px solid var(--line);border-radius:13px;overflow:hidden;background:var(--surface)}.homogeneous-overview img{display:block;width:100%;height:auto}.homogeneous-overview figcaption{display:grid;gap:8px;padding:20px 24px;color:var(--muted);font-size:14px;line-height:1.7}.homogeneous-overview figcaption strong{color:var(--ink);font:600 20px/1.4 var(--display)}
.homogeneous-lab-shell{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--surface)}.homogeneous-workbench{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(350px,1fr);align-items:start}.homogeneous-preview{min-width:0;background:#090f17}.homogeneous-stage{position:relative;aspect-ratio:1;background:#090f17}.homogeneous-stage canvas,.homogeneous-stage>img{display:block;width:100%;height:100%;object-fit:contain}.homogeneous-stage:has(>img:not([hidden]))>canvas{display:none}.homogeneous-stage [hidden]{display:none!important}.homogeneous-stage canvas{touch-action:pan-y pinch-zoom;cursor:crosshair}.homogeneous-stage canvas:focus-visible{outline-offset:-3px}
.homogeneous-legend{display:flex;flex-wrap:wrap;gap:10px 18px;padding:15px 20px;border-top:1px solid var(--line);font:400 10px/1.6 var(--mono);color:var(--muted)}.homogeneous-legend span{display:inline-flex;align-items:center;gap:8px}.homogeneous-legend i{width:10px;height:10px;display:inline-block;border-radius:50%;flex:none}.homogeneous-point-color{background:#ffcf4f}.homogeneous-direction-color{border:2px solid #3de0f0}.homogeneous-pointer-color{border:2px solid #fafafa;border-radius:0!important}.homogeneous-pivot-color{border:2px solid #c78fff}.homogeneous-origin-color{background:#66a8ff}.homogeneous-x-color{background:#ff9147}.homogeneous-y-color{background:#66de8f}
.homogeneous-view-note,.homogeneous-fallback-message{padding:0 20px;color:var(--dim);font-size:11px;line-height:1.7;margin:0 0 18px}.homogeneous-fallback-message{color:var(--muted);padding-top:16px}.homogeneous-controls{min-width:0;padding:20px;border-left:1px solid var(--line)}.homogeneous-heading-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.homogeneous-heading-row h3{margin:0;font:500 18px/1.4 var(--display)}.homogeneous-controls button{padding:8px 10px;font-size:10px;border-radius:7px;min-height:36px}.homogeneous-heading-row button{flex:none}.homogeneous-mode-row{display:flex;gap:12px;align-items:center;margin-top:17px}.homogeneous-mode-row label{font:400 11px/1.5 var(--mono);color:var(--muted)}.homogeneous-mode-row select{flex:1;min-width:0;max-width:100%;background:#0b111b;border:1px solid var(--line);border-radius:7px;color:var(--ink);padding:9px;font:400 11px/1.5 var(--mono)}
.homogeneous-controls fieldset{margin:18px 0 0;padding:0;border:0;min-width:0}.homogeneous-controls legend{padding:0;color:var(--ink);font:500 14px/1.5 var(--display)}.homogeneous-input-row{display:grid;grid-template-columns:57px minmax(0,1fr) 96px;gap:8px;align-items:center;margin-top:8px}.homogeneous-input-row label{font:400 10px/1.5 var(--mono);color:var(--muted)}.homogeneous-input-row input[type=range]{min-width:0;width:100%;margin:0;min-height:30px;accent-color:#3de0f0}.homogeneous-input-row input[type=number]{width:100%;min-width:0;border:1px solid var(--line);background:#0b111b;color:var(--ink);border-radius:6px;padding:7px 4px;font:400 11px/1.5 var(--mono);font-variant-numeric:tabular-nums}.homogeneous-preset-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:17px}.homogeneous-option-row{display:flex;flex-wrap:wrap;gap:11px 18px;margin-top:17px}.homogeneous-option-row label{display:flex;gap:7px;align-items:center;font-size:11px;line-height:1.5;color:var(--muted)}.homogeneous-option-row input{accent-color:#3de0f0;flex:none}.homogeneous-help{margin-top:17px;border-top:1px solid var(--line);padding-top:12px}.homogeneous-help summary{font-size:11px;line-height:1.6;color:var(--muted);cursor:pointer}.homogeneous-help p{font-size:11px;line-height:1.7;color:var(--dim);margin:10px 0 0}#homogeneous-shader-status{font:400 10px/1.7 var(--mono);color:var(--accent);margin:16px 0 0;min-height:20px}
.homogeneous-readouts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px 20px;padding:22px;border-block:1px solid var(--line);margin:0;background:#0b111b}.homogeneous-readouts>div{min-width:0}.homogeneous-readouts dt{color:var(--dim);font:400 10px/1.6 var(--mono);margin:0 0 6px}.homogeneous-readouts dd{margin:0;color:var(--ink);font:400 13px/1.6 var(--mono);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.homogeneous-geometry-note{padding:14px 22px;margin:0;border-bottom:1px solid var(--line);font-size:12px;line-height:1.7;color:var(--muted)}.homogeneous-readout-note,.homogeneous-control-help{padding:0 22px;font-size:12px;line-height:1.75;color:var(--muted);margin:16px 0}.homogeneous-readout-note{color:var(--dim);font-size:11px}#homogeneous-error{white-space:pre-wrap;overflow-wrap:anywhere;color:#ffb6a4;background:#291717;padding:16px;border-radius:8px;font-size:12px}.homogeneous-lab-section .code-panel{min-width:0}
@media(max-width:900px){.homogeneous-workbench{grid-template-columns:1fr}.homogeneous-stage{max-width:700px;margin-inline:auto}.homogeneous-controls{border-left:0;border-top:1px solid var(--line)}.homogeneous-readouts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:580px){.homogeneous-controls{padding:18px}.homogeneous-heading-row h3{font-size:16px}.homogeneous-input-row{grid-template-columns:54px minmax(0,1fr) 90px;gap:7px}.homogeneous-readouts{gap:17px 15px;padding:18px}.homogeneous-readouts dd{font-size:12px}.homogeneous-legend{padding:14px 18px;gap:10px 15px}.homogeneous-view-note,.homogeneous-fallback-message,.homogeneous-geometry-note,.homogeneous-readout-note,.homogeneous-control-help{padding-inline:18px}}

.homogeneous-matrix{table-layout:fixed;border-collapse:collapse;width:calc(100% - 40px);margin:0 20px 20px;background:#0b111b;border:1px solid var(--line);font-variant-numeric:tabular-nums}.homogeneous-matrix caption{text-align:left;font:400 11px/1.7 var(--mono);color:var(--muted);padding:0 0 10px}.homogeneous-matrix th{font:500 10px/1.5 var(--mono);padding:9px 5px;border-bottom:1px solid var(--line)}.homogeneous-matrix td{text-align:center;font:400 13px/1.7 var(--mono);padding:7px 5px;overflow-wrap:anywhere}.homogeneous-matrix th:nth-child(1),.homogeneous-matrix td:nth-child(1){color:#ff9147}.homogeneous-matrix th:nth-child(2),.homogeneous-matrix td:nth-child(2){color:#66de8f}.homogeneous-matrix th:nth-child(3),.homogeneous-matrix td:nth-child(3){color:#66a8ff}
@media(max-width:580px){.homogeneous-matrix{width:calc(100% - 36px);margin-inline:18px}.homogeneous-matrix td{font-size:11px}}
