dialog.hw3d-dialog {
  width: min(1080px, 94vw);
  max-height: 90svh;
}

.hw3d-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hw3d-sku-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: rgba(20, 66, 184, 0.12);
  color: var(--brand-cobalt);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

:root[data-theme="dark"] .hw3d-sku-badge {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.hw3d-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 24px;
  padding: 22px 26px 26px;
  align-items: start;
}

.hw3d-stage-col {
  display: grid;
  gap: 12px;
}

.hw3d-stage {
  position: relative;
  aspect-ratio: 4 / 3.1;
  min-height: 320px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.96) 0%, rgba(226, 235, 249, 0.88) 54%, rgba(206, 219, 240, 0.82) 100%);
  display: grid;
  place-items: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  perspective: 1100px;
}

.hw3d-stage:active { cursor: grabbing; }

:root[data-theme="dark"] .hw3d-stage {
  background:
    radial-gradient(circle at 50% 42%, rgba(30, 48, 86, 0.92) 0%, rgba(14, 21, 36, 0.96) 62%, rgba(9, 13, 24, 1) 100%);
  border-color: rgba(255, 255, 255, 0.12);
}

.hw3d-stage-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
  pointer-events: none;
}

:root[data-theme="dark"] .hw3d-stage-badge {
  background: rgba(15, 23, 42, 0.76);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.hw3d-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-orange);
  box-shadow: 0 0 8px var(--brand-orange);
}

.hw3d-angle-readout {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(10, 16, 32, 0.08);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  pointer-events: none;
}

:root[data-theme="dark"] .hw3d-angle-readout {
  background: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
}

.hw3d-turntable {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
}

.hw3d-pedestal-ring {
  position: absolute;
  bottom: 14%;
  width: 62%;
  aspect-ratio: 3.4 / 1;
  border-radius: 50%;
  border: 1.5px dashed rgba(20, 66, 184, 0.32);
  background: radial-gradient(ellipse at center, rgba(20, 66, 184, 0.12) 0%, transparent 72%);
  pointer-events: none;
}

:root[data-theme="dark"] .hw3d-pedestal-ring {
  border-color: rgba(94, 234, 212, 0.34);
  background: radial-gradient(ellipse at center, rgba(20, 66, 184, 0.26) 0%, transparent 72%);
}

.hw3d-object-rig {
  position: relative;
  width: min(74%, 360px);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 2;
}

.hw3d-object-rig img {
  width: 76%;
  height: 76%;
  object-fit: contain;
  transform: translateY(-10%) translateZ(18px);
  filter: drop-shadow(0 22px 24px rgba(10, 20, 48, 0.24));
  pointer-events: none;
  backface-visibility: visible;
}

.hw3d-sheen {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: radial-gradient(circle at var(--sx, 50%) var(--sy, 40%), rgba(255, 255, 255, 0.24), transparent 58%);
  mix-blend-mode: screen;
  mask-image: radial-gradient(ellipse, #000 15%, transparent 68%);
  pointer-events: none;
}

.hw3d-shadow {
  position: absolute;
  bottom: 17%;
  width: 44%;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(10, 20, 48, 0.34) 0%, transparent 74%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 1;
}

/* Live 3D Spatial Sensing / Radar Field Overlay (rotates in preserve-3d with product) */
.hw3d-field-layer {
  position: absolute;
  inset: -29% -31% -25% -31%;
  pointer-events: none;
  transform-style: preserve-3d;
  transform: translateY(10%) translateZ(-18px);
  display: grid;
  place-items: center;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.hw3d-dialog [hidden] { display: none; }

.hw3d-field-layer svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

@keyframes hw3dRadarPulse {
  0% { transform: scale(0.76); opacity: 0.78; }
  70% { transform: scale(1.08); opacity: 0.2; }
  100% { transform: scale(1.14); opacity: 0; }
}

.hw3d-pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: hw3dRadarPulse 2.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.hw3d-pulse-ring--delay {
  animation-delay: 1.4s;
}

.hw3d-field-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(11, 20, 42, 0.76);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
  transition: opacity 0.25s ease;
}



.hw3d-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.hw3d-preset-group,
.hw3d-tool-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.hw3d-ctrl-btn {
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--canvas);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hw3d-ctrl-btn:hover {
  border-color: var(--brand-cobalt);
}

.hw3d-ctrl-btn.is-active {
  background: var(--brand-cobalt);
  border-color: var(--brand-cobalt);
  color: #ffffff;
}

.hw3d-info-col {
  display: grid;
  gap: 16px;
}

.hw3d-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hw3d-desc {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.68;
  color: var(--ink-muted);
}

.hw3d-specs-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hw3d-spec-item {
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--canvas);
  display: grid;
  gap: 3px;
}

.hw3d-spec-item dt {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.hw3d-spec-item dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.hw3d-option-group {
  display: grid;
  gap: 8px;
}

.hw3d-option-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.hw3d-option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hw3d-opt-pill {
  padding: 8px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hw3d-opt-pill:hover {
  border-color: var(--brand-cobalt);
}

.hw3d-opt-pill.is-selected {
  background: rgba(20, 66, 184, 0.12);
  border-color: var(--brand-cobalt);
  color: var(--brand-cobalt);
}

:root[data-theme="dark"] .hw3d-opt-pill.is-selected {
  background: rgba(59, 130, 246, 0.24);
  color: #93c5fd;
}

.hw3d-action-bar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding-top: 6px;
}

@media (max-width: 860px) {
  .hw3d-layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 18px;
  }
  .hw3d-stage {
    min-height: 250px;
    aspect-ratio: 4 / 3;
  }
  .hw3d-action-bar {
    grid-template-columns: 1fr;
  }
}
.hw3d-dialog .dialog-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
}
.hw3d-dialog .dialog-head h2 {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  font-weight: 650;
  line-height: 1.3;
}
.hw3d-dialog .dialog-close-btn { min-height: 44px; width: 44px; color: var(--ink); }
.hw3d-dialog :is(button, a) { touch-action: manipulation; }
:root[data-theme="dark"] .hw3d-field-layer [stroke="#1442b8"] { stroke: #87b3ff; }
:root[data-theme="dark"] .hw3d-field-layer [fill="#0ea5a4"] { fill: #5ce4d6; }
.hw3d-stage-col, .hw3d-info-col, .hw3d-spec-item, .hw3d-head-meta { min-width: 0; }
.hw3d-field-caption { text-align: center; line-height: 1.45; }
.hw3d-spec-item dd { overflow-wrap: anywhere; }
.hw3d-ctrl-btn:disabled { opacity: 0.45; cursor: default; }
.hw3d-copy-status:empty { display: none; }
.hw3d-copy-status { color: var(--ink-muted); font-size: var(--text-sm); }
#hw3d-copy-fallback {
  width: 100%;
  resize: vertical;
  padding: 12px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}
@media (prefers-reduced-motion: reduce) {
  .hw3d-pulse-ring { animation: none; }
}
@media (max-width: 640px) {
  .hw3d-dialog .dialog-head { padding: 12px 16px; }
  .hw3d-head-meta { gap: 4px 8px; }
  .hw3d-stage { min-height: 0; aspect-ratio: auto; grid-template-rows: auto auto; }
  .hw3d-turntable { grid-row: 1; height: auto; aspect-ratio: 4 / 2.85; margin-top: 22px; }
  .hw3d-stage-badge, .hw3d-angle-readout { top: 8px; font-size: 0.68rem; }
  .hw3d-stage-badge { left: 8px; padding: 5px 7px; gap: 5px; }
  .hw3d-angle-readout { right: 8px; padding: 5px 7px; }
  .hw3d-field-caption {
    position: static;
    grid-row: 2;
    width: calc(100% - 16px);
    margin-bottom: 8px;
    border-radius: 12px;
  }
  .hw3d-controls { display: grid; }
  .hw3d-tool-group { display: grid; grid-template-columns: 1fr 1fr 44px 44px; gap: 4px; }
  .hw3d-ctrl-btn, .hw3d-opt-pill { min-width: 0; min-height: 44px; }
  .hw3d-ctrl-btn { padding-inline: 10px; }
}
