/* Progressive 3D layer. The original poster remains the loading/fallback view. */
.hero-workbench:not([data-fallback-ready="true"]) .device-overlay {
  display: none;
}

.workbench-replay {
  display: none;
  min-height: 44px;
  padding: 10px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  flex-shrink: 0;
}

.hero-workbench[data-3d-state="ready"] .workbench-replay {
  display: block;
}
.workbench-replay:hover {
  color: var(--orange-dark);
}
.workbench-replay[aria-disabled="true"],
.workbench-reset[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}
.workbench-stage {
  min-width: 0;
  aspect-ratio: 3 / 2;
  isolation: isolate;
}

.workbench-stage .workbench-visual {
  z-index: 0;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.workbench-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  cursor: default;
  pointer-events: none;
  touch-action: pan-y;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.hero-workbench[data-3d-state="ready"] .workbench-visual {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero-workbench[data-3d-state="ready"] .workbench-canvas {
  opacity: 1;
  visibility: visible;
}

.component-annotation {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.hero-workbench[data-3d-state="ready"] .component-annotation {
  opacity: 1;
  visibility: visible;
}

.component-leader {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.component-leader-path {
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.component-leader-dot {
  fill: var(--orange);
  stroke: var(--white);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.component-leader-pulse {
  fill: none;
  stroke: var(--orange);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

.component-leader-ring {
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

.component-label {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: max-content;
  max-width: 170px;
  padding: 8px 11px;
  border-left: 2px solid var(--orange);
  background: #ffffffed;
  box-shadow: 0 2px 10px #181a1d05;
  color: var(--ink);
  font-family: var(--body);
  white-space: normal;
  overflow-wrap: break-word;
}

.component-label-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.component-label-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.workbench-status {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  max-width: calc(100% - 28px);
  padding: 6px 10px;
  border-left: 2px solid var(--orange);
  background: #fffffff2;
  color: var(--muted);
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.45;
  pointer-events: none;
}

.hero-workbench:not([data-3d-state="loading"]) .workbench-status {
  display: none;
}

.workbench-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  margin: 4px 0 18px;
}

.workbench-meta .workbench-caption {
  flex: 1;
  margin: 0;
}

.hero-workbench[data-3d-state="ready"] .workbench-meta .workbench-caption {
  text-align: left;
}

.workbench-reset {
  position: relative;
  z-index: 5;
  display: none;
  min-height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  pointer-events: auto;
}

.hero-workbench[data-3d-state="ready"] .workbench-reset:not([hidden]) {
  display: inline-flex;
}

.workbench-reset .icon {
  width: 17px;
  height: 17px;
}

.workbench-reset:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.workbench-reset:active,
.workbench-reset[aria-pressed="true"],
.workbench-reset[data-active="true"] {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--ink);
}

.workbench-reset:focus-visible {
  outline: 3px solid var(--orange-dark);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .workbench-meta {
    flex-wrap: wrap;
    gap: 4px 12px;
    min-height: 72px;
  }
  .workbench-meta .workbench-caption {
    flex-basis: 100%;
  }
  .component-label {
    max-width: 160px;
    padding: 7px 9px;
  }

  .workbench-status {
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding-inline: 8px;
  }

  .workbench-reset {
    padding-inline: 11px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workbench-stage .workbench-visual,
  .workbench-canvas,
  .component-annotation,
  .workbench-reset {
    transition: none;
  }
}
