.grid-section .grid { cursor: zoom-in; }
.grid-section .grid:focus-visible { outline: 1px solid #111; outline-offset: 6px; }
.bit-viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; box-sizing: border-box; border: 0; margin: 0; padding: 48px 16px; background: #fff; color: #111; overflow: hidden; }
.bit-viewer[open] { display: grid; place-items: center; }
.bit-viewer::backdrop { background: #fff; }
.bit-viewer button { display: block; border: 0; padding: 0; margin: 0; border-radius: 0; box-shadow: none; background: transparent; color: inherit; touch-action: manipulation; }
.bit-viewer [hidden] { display: none !important; }
.bit-viewer .bit-close { position: absolute; z-index: 2; right: 12px; top: 4px; width: 44px; height: 44px; font: 32px/1 serif; cursor: pointer; }
.bit-nine { display: grid; direction: rtl; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(3,minmax(0,1fr)); gap: 6px; width: min(calc(100vw - 32px),calc(100vh - 96px)); width: min(calc(100vw - 32px),calc(100dvh - 96px)); aspect-ratio: 1; }
.bit-nine button { min-width: 0; min-height: 0; cursor: zoom-in; }
.bit-nine img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.bit-viewer .bit-single { width: 100%; height: 100%; min-height: 0; min-width: 0; cursor: zoom-in; }
.bit-crop { position: relative; display: block; width: 100%; height: 100%; margin: auto; overflow: hidden; }
.bit-single img { display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; image-rendering: pixelated; }
.bit-viewer[data-view="pixels"] .bit-single { cursor: zoom-out; }
.bit-viewer[data-view="pixels"] .bit-crop img { position: absolute; object-fit: fill; }
.bit-hint { position: absolute; bottom: 14px; left: 16px; right: 16px; margin: 0; font: 11px/1.4 monospace; text-align: center; color: #777; cursor: pointer; }
.bit-viewer button:focus-visible { outline: 1px solid #777; outline-offset: 2px; }
/* Override the legacy shared dialog dimensions, including the native-pixel crop. */
.bit-viewer .bit-nine { width: min(calc(100vw - 32px),calc(100vh - 96px)); height: min(calc(100vw - 32px),calc(100vh - 96px)); }
@supports (height: 100dvh) { .bit-viewer .bit-nine { width: min(calc(100vw - 32px),calc(100dvh - 96px)); height: min(calc(100vw - 32px),calc(100dvh - 96px)); } }
.bit-viewer .bit-single img { max-height: none; }

.bit-standalone { display:block; width:100%; margin:0; padding:0; border:0; background:none; cursor:zoom-in; touch-action:manipulation; }
.bit-standalone:focus-visible { outline:1px solid #777; outline-offset:6px; }
.bit-standalone img { display:block; width:100%; height:auto; }
/* Native SVG geometry and selectable labels: sharp at any page zoom. */
.gestalt-diagram { margin:36px 0; padding:0; color:#111; font:11px/1.4 'Times New Roman',serif; }
.gestalt-diagram figcaption { margin:0 0 16px; font-size:12px; }
.gestalt-row { display:grid; grid-template-columns:12px minmax(0,1.65fr) minmax(0,1fr); align-items:center; column-gap:8px; padding:4px 0; }
.gestalt-row svg { display:block; width:100%; height:auto; fill:currentColor; }
.gestalt-key { color:#777; font:10px/1 monospace; }
.gestalt-row .gestalt-lines { fill:none; stroke:currentColor; stroke-width:1.3; stroke-linecap:round; }
