:root { color-scheme: dark; font: 14px/1.45 system-ui, sans-serif; background: #14212a; color: #ecf3f8; }
* { box-sizing: border-box; }
body, p { margin: 0; }
[hidden] { display: none !important; }
.viewer { display: grid; height: 100vh; grid-template-rows: auto minmax(0, 1fr) auto; }
.toolbar, .controls { background: #14212a; padding: 12px 16px; }
.toolbar, .views, .action-row, .part-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.views { gap: 5px; }
.toolbar { border-bottom: 1px solid #385064; }
.toolbar > label { margin-inline-end: auto; }
label { display: inline-flex; align-items: center; gap: 7px; }
button, select { border: 1px solid #557389; background: #213543; border-radius: 4px; color: inherit; font: inherit; min-height: 35px; padding: 5px 10px; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .57; }
button:not(:disabled):hover { background: #2c485c; }
button[aria-pressed="true"], button#load { background: #13689f; border-color: #65b5ed; }
button:focus-visible, select:focus-visible, input:focus-visible, canvas:focus-visible { outline: 2px solid #94d2ff; outline-offset: 3px; }
select { max-width: min(65vw, 310px); }
.stage { position: relative; min-height: 0; background: radial-gradient(ellipse at 52% 46%, #537488 0, #293f50 60%, #1a2b37 100%); overflow: hidden; }
.stage canvas { width: 100%; height: 100%; display: block; touch-action: pan-y !important; pointer-events: none; }
.stage canvas.is-interactive { cursor: grab; touch-action: none !important; pointer-events: auto; }
.stage canvas.is-interactive:active { cursor: grabbing; }
.stage canvas:focus-visible { outline-offset: -4px; }
.preview { position: absolute; z-index: 2; inset: 0; display: grid; place-content: end center; justify-items: center; text-align: center; padding: 18px; gap: 10px; }
.preview img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.preview::before { content: ''; position: absolute; z-index: -1; inset: 62% 0 0; background: linear-gradient(transparent, #0b1823); }
.preview button { max-width: 90vw; min-height: 43px; padding-inline: 18px; font-weight: 650; }
.tools { position: absolute; inset: 12px 12px auto auto; display: grid; gap: 6px; }
.tools button { width: 40px; height: 40px; padding: 0; font-size: 22px; }
.callouts { position: absolute; inset: 0; pointer-events: none; }
.callouts button { position: absolute; transform: translate(-50%, 0); min-height: 28px; padding: 3px 8px; background: #14212af0; border-color: #8cc5e7; font-size: 12px; white-space: nowrap; pointer-events: auto; }
.callouts button::before { content: ''; display: block; width: 6px; height: 6px; border-radius: 50%; position: absolute; top: -9px; left: calc(50% - 3px); background: #95d6ff; }
.selection { position: absolute; bottom: 12px; left: 12px; right: 64px; width: fit-content; max-width: calc(100% - 76px); padding: 7px 10px; color: #fff; background: #132734ee; border-left: 3px solid #86ceff; pointer-events: none; }
.controls { display: grid; gap: 9px; border-top: 1px solid #385064; }
.controls p, .controls small { color: #c1d6e5; }
.range { flex: 1; }
.range input { flex: 1; min-width: 70px; max-width: 360px; accent-color: #74baf0; }
.range output { min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
    :root { font-size: 12px; }
    .toolbar, .controls { padding: 9px; gap: 7px; }
    .views, .part-row, .action-row { gap: 5px 9px; }
    .toolbar > label { order: 1; width: 100%; }
    .toolbar > label select { flex: 1; max-width: none; }
    .callouts { display: none; }
}
