.sd-page { min-width: 0; display: grid; gap: 16px; }
.sd-header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.sd-header h1 { margin: .1em 0; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -.055em; }
.sd-kicker { margin: 0; color: var(--teal); font-size: .69rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sd-tabs { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg); }
.sd-tabs button { border: 0; padding: 9px 12px; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: .82rem; font-weight: 700; text-align: left; }
.sd-tabs [aria-selected="true"] { background: var(--teal-dark); color: var(--text); }
.sd-banner, .sd-timeline { padding: 11px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.sd-banner[data-severity="1"] { color: var(--amber); border-color: #735431; background: var(--amber-dark); }
.sd-banner[data-severity="2"] { color: var(--red); border-color: #77403b; background: var(--red-dark); }
.sd-banner > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; }
.sd-banner > div + div { margin-top: 6px; }
.sd-banner span { color: var(--text); font-size: .8rem; }
.sd-timeline-head, .sd-timeline-ends { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sd-timeline-head { font-weight: 750; }
.sd-timeline-ends { font-size: .75rem; color: var(--muted); }
.sd-timeline > .sd-helper { margin-left: 10px; }
.sd-layout { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); align-items: start; gap: 16px; }
.sd-controls { display: grid; gap: 12px; min-width: 0; }
.sd-viewer, .sd-section { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sd-viewer { overflow: hidden; }
.sd-viewer-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 16px 18px 8px; }
.sd-height { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; white-space: nowrap; }
.sd-viewer h2, .sd-section h2 { margin: 0; font-size: 1.06rem; letter-spacing: -.02em; }
.sd-stage {
  min-width: 0;
  position: relative;
  --sd-stage-height: clamp(290px, 55vw, 570px);
  height: var(--sd-stage-height);
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  --sd-grid: rgba(118, 185, 165, .055);
  background: radial-gradient(ellipse at 50% 41%, rgba(34, 88, 72, .35), transparent 67%),
    linear-gradient(var(--sd-grid) 1px, transparent 1px) center / 24px 24px,
    linear-gradient(90deg, var(--sd-grid) 1px, transparent 1px) center / 24px 24px, #0a110e;
}
.sd-ring { width: min(94%, calc(var(--sd-stage-height) * .95)); aspect-ratio: 1; border: 1px solid #4a7668; border-radius: 50%; position: absolute; pointer-events: none; box-shadow: 0 0 32px rgba(66, 173, 138, .07), inset 0 0 32px rgba(66, 173, 138, .04); }
.sd-ring::before { content: ""; position: absolute; inset: 0 50%; border-left: 1px solid #334c43; }
.sd-viewport { position: absolute; inset: 0; }
.sd-viewport canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; outline-offset: -2px; }
.sd-viewport canvas:active { cursor: grabbing; }
.sd-avatar-status { z-index: 1; text-align: center; color: var(--muted); padding: 12px 16px; max-width: 30ch; pointer-events: none; }
.sd-model-meta { padding: 10px 15px 15px; min-height: 80px; }
.sd-helper { margin: 2px 0 6px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.sd-viewer-actions, .sd-presets, .sd-record-buttons { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.sd-viewer-actions button, .sd-small {
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; color: var(--muted); min-height: 31px;
  background: var(--surface-2); font-size: .73rem; font-weight: 650; cursor: pointer;
}
.sd-viewer-actions button[aria-pressed="true"] { color: var(--text); border-color: #416454; }
.sd-presets button[aria-pressed="true"] { color: var(--teal); border-color: #52977e; }
.sd-viewer-actions button:hover, .sd-small:hover { color: var(--teal); border-color: #52977e; }
.sd-section { padding: 13px 15px; }
.sd-section-head { display: flex; justify-content: space-between; gap: 4px 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.sd-section-head a { font-size: .72rem; }
.sd-slider { margin: 6px 0 3px; }
.sd-slider-heading { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.sd-slider-heading label { display: inline; color: var(--text); font-weight: 620; font-size: .82rem; }
.sd-value { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.sd-value input[type="number"] { appearance: textfield; width: 4.15em; min-height: 26px; border: 1px solid var(--line); padding: 3px 5px; border-radius: 6px; text-align: right; color: var(--text); background: var(--bg); font-size: .88rem; }
.sd-value input::-webkit-inner-spin-button, .sd-value input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.sd-slider input[type="range"], .sd-timeline input[type="range"] { width: 100%; min-height: 21px; margin: 2px 0 0; padding: 0; border: 0; background: transparent; accent-color: var(--teal); cursor: pointer; }
.sd-unit { background: transparent; border: 0; padding: 3px 2px; color: var(--teal); text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; font: inherit; white-space: nowrap; }
.sd-readouts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.sd-readout { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.sd-readout dt { color: var(--muted); font-size: .75rem; }
.sd-readout dd { margin: 1px 0 0; font-size: 1.125rem; font-weight: 730; font-variant-numeric: tabular-nums; }
.sd-readout small { color: var(--muted); font-size: .73rem; }
.sd-missing { color: var(--muted); font-size: .8rem; font-weight: 500; }
.sd-record-buttons { margin-top: 10px; }
.sd-page [hidden] { display: none !important; }
.sd-page :focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (max-width: 1100px) {
  .sd-layout { grid-template-columns: minmax(0, 1.05fr) minmax(270px, 1fr); }
  .sd-stage { --sd-stage-height: clamp(285px, 46vw, 470px); }
}
@media (max-width: 720px) {
  .sd-layout { grid-template-columns: minmax(0, 1fr); }
  .sd-stage { --sd-stage-height: clamp(290px, 92vw, 470px); }
  .sd-tabs button, .sd-viewer-actions button, .sd-small { min-height: 40px; }
  .sd-slider input[type="range"], .sd-timeline input[type="range"] { min-height: 30px; }
  .sd-value input[type="number"] { font-size: 16px; }
  .sd-unit { min-height: 30px; }
}
