.cell-viewer {
  position: relative;
  min-width: 0;
  min-height: 245px;
  aspect-ratio: 1.46;
  display: flex;
  flex-direction: column;
  background: #09182e;
  color: #e8f0fc;
  border: 1px solid #203959;
  border-radius: 24px;
  isolation: isolate;
  overflow: hidden;
}
.cell-viewer [hidden] { display: none; }
.cell-viewer-scene {
  position: relative;
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(ellipse at 51% 48%, #234069b5, transparent 69%),
    repeating-linear-gradient(90deg, #456a982a 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, #456a982a 0 1px, transparent 1px 34px),
    #0f2240;
}
.cell-viewer-scene::before { content: ""; position: absolute; inset: 46px 18px 19px; border: 1px solid #7a9dc338; pointer-events: none; }
.cell-viewer-scene img, .cell-viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cell-viewer-scene img { object-fit: cover; object-position: 56% 53%; }
.cell-viewer canvas { cursor: grab; touch-action: pan-y pinch-zoom; }
.cell-viewer canvas:active { cursor: grabbing; }
.cell-viewer figcaption, #cell-viewer-hint { position: absolute; inset-block-start: 12px; font-size: 12px; font-weight: 600; pointer-events: none; }
.cell-viewer figcaption { inset-inline-start: 13px; padding: 2px 7px; border-radius: 5px; background: #0f2240d9; }
#cell-viewer-hint { inset-inline-end: 13px; padding: 2px 7px; border-radius: 5px; color: #c1d4f1; background: #0f2240d9; }
.cell-drag-touch { display: none; }
.cell-viewer-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 7px 12px 7px 17px; border-top: 1px solid #2a4264; }
.cell-viewer-scale { color: #b3c9e5; font-size: 11px; }
.cell-viewer-actions { display: flex; gap: 4px; align-items: center; }
.cell-viewer-actions button { min-width: 44px; min-height: 44px; padding-inline: 10px; border: 1px solid #3c587a; border-radius: 8px; color: #e8f0fc; font: 640 13px/1.3 var(--lab-ui); background: #162d4b; cursor: pointer; }
.cell-viewer-actions button:is(:hover, [aria-pressed="true"]) { background: #294b76; border-color: #739bd1; }
.cell-viewer-actions button[aria-disabled="true"] { opacity: .55; cursor: default; }
.cell-viewer-actions .cell-icon { font-size: 20px; line-height: 1; }
.cell-viewer :focus-visible { outline: 2px solid #add1ff; outline-offset: 2px; }
.cell-viewer canvas:focus-visible { outline-offset: -4px; }
.cell-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (pointer: coarse) {
  .cell-drag-mouse { display: none; }
  .cell-drag-touch { display: inline; }
}
@media (max-width: 950px) {
  .cell-viewer-tools { justify-content: center; }
}
@media (max-width: 650px) {
  .cell-viewer { aspect-ratio: 1.12; border-radius: 17px; }
  .cell-viewer-scale { order: 1; text-align: center; width: 100%; }
}
