.robot-viewer { --robot-line: rgba(255,255,255,.16); margin: 0; color: #e7edf3; border: 1px solid var(--robot-line); background: #0d141d; }
.robot-workspace { display: grid; grid-template-columns: minmax(0,1fr) 12rem; }
.robot-stage { position: relative; min-width: 0; height: clamp(24rem,48vw,37rem); background: radial-gradient(ellipse at 50% 48%,#263342 0%,#101923 73%); }
.robot-viewport { width: 100%; height: 100%; }
.robot-viewport canvas { display: block; width: 100%; height: 100%; outline-offset: -4px; }
.robot-viewport canvas:focus-visible { outline: 2px solid #fd8547; }
.robot-status { position: absolute; inset: auto 1rem 1rem; margin: 0; padding: .7rem 1rem; background: #0d141deb; font-size: .9rem; }
.robot-status[hidden], .robot-retry[hidden] { display: none; }
.robot-panel { padding: 1.4rem 1.1rem; border-left: 1px solid var(--robot-line); }
.robot-panel fieldset { min-width: 0; padding: 0; margin: 0 0 1.5rem; border: 0; }
.robot-panel legend { padding: 0; font-size: 1rem; font-weight: 700; }
.robot-panel-intro, .robot-help { color: #b2bfcd; font-size: .875rem; line-height: 1.6; }
.robot-panel label { display: flex; gap: .7rem; align-items: center; padding: .7rem 0; font-size: 1rem; cursor: pointer; }
.robot-panel label:has(input:disabled) { cursor: default; color: #9ca9b6; }
.robot-panel input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: #fd8547; }
.robot-panel button, .robot-retry { border: 1px solid #718398; border-radius: 0; background: transparent; color: #e7edf3; padding: .65rem .85rem; font: inherit; font-size: .875rem; cursor: pointer; }
.robot-panel button:disabled { opacity: .45; cursor: default; }
.robot-panel button:hover:enabled, .robot-retry:hover { background: #263342; }
.robot-retry { position: absolute; top: 1rem; left: 1rem; background: #0d141d; }
.robot-caption { margin: 0; padding: .9rem 1.1rem; border-top: 1px solid var(--robot-line); color: #b2bfcd; font-size: .875rem; line-height: 1.6; }
.robo-notes { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.8; margin-top: 3rem; }
@media(max-width:600px) {
  .robot-workspace { grid-template-columns: minmax(0,1fr) 8.5rem; }
  .robot-panel { padding: 1rem .7rem; }
  .robot-stage { height: 25rem; }
  .robot-panel label { gap: .45rem; }
}
@media(max-width:360px) {
  .robot-workspace { grid-template-columns: minmax(0,1fr); }
  .robot-panel { border-left: 0; border-top: 1px solid var(--robot-line); }
}
/* The layer browser scrolls independently of the model. */
.robot-workspace { grid-template-columns: minmax(0,1fr) 17rem; }
.robot-panel { min-width: 0; max-height: 37rem; display: flex; flex-direction: column; }
.robot-panel-title { margin: 0; font-size: 1rem; }
.robot-layer-tree { min-height: 0; overflow: auto; flex: 1; margin: .5rem -.4rem 1rem; padding: 0 .4rem; }
.robot-layer-tree ul { list-style: none; padding: 0; margin: 0; }
.robot-layer-tree ul ul { margin-left: .65rem; padding-left: .45rem; border-left: 1px solid var(--robot-line); }
.robot-layer-tree ul[hidden] { display: none; }
.robot-layer-row { display: flex; align-items: center; min-height: 2.5rem; }
.robot-layer-tree .robot-layer-label { flex: 1; min-width: 0; padding: .4rem 0; gap: .5rem; font-size: .875rem; }
.robot-layer-label span { overflow-wrap: anywhere; }
.robot-layer-label span:hover, .robot-layer-label:focus-within span { color: #ff8c36; }
.robot-layer-leaf { padding-left: 1.6rem; }
.robot-panel .robot-layer-expand { flex: 0 0 1.6rem; width: 1.6rem; height: 2.1rem; border: 0; padding: 0; font-size: 1.4rem; line-height: 1; }
.robot-layer-expand[aria-expanded="true"] { transform: rotate(90deg); }
.robot-layer-label input { flex-shrink: 0; }
.robot-panel > button { align-self: flex-start; }
@media(max-width:900px) {
  .robot-workspace { grid-template-columns: minmax(0,1fr) 14rem; }
}
@media(max-width:600px) {
  .robot-workspace { grid-template-columns: minmax(0,1fr); }
  .robot-panel { max-height: 24rem; border-left: 0; border-top: 1px solid var(--robot-line); }
  .robot-layer-tree { flex-basis: 12rem; }
}
.robot-animation-row { margin-bottom: .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--robot-line); }
.robot-panel .robot-animation-play { display: flex; gap: .7rem; align-items: center; width: 100%; padding: .65rem .4rem; border: 0; text-align: left; }
.robot-animation-play > span:first-child { width: 1.1rem; color: #ff8a38; font-size: .875rem; }
.robot-animation-status { display: block; color: #b2bfcd; font-size: .875rem; padding-left: 2.2rem; }
.robot-layer-swatch { display: inline-block; flex: 0 0 .65rem; width: .65rem; height: .65rem; border: 1px solid rgba(255,255,255,.35); border-radius: 2px; }
.robot-transparent-row { padding: 0 .4rem .5rem; margin-bottom: .5rem; border-bottom: 1px solid var(--robot-line); }
.robot-layer-tree .robot-transparent-row label { padding: .5rem 0; font-size: .875rem; }
.robot-layer-heading { padding: .4rem .4rem .1rem; }
.robot-layer-heading .robot-help { margin: .5rem 0 .75rem; }
