.ply-scan-shell {
  margin: 0;
}

.ply-scan-viewer {
  width: 100%;
  height: min(72vh, 660px);
  min-height: 440px;
  overflow: hidden;
  border: 1px solid rgba(77, 74, 69, 0.32);
  border-radius: 6px;
  background: #141414;
  position: relative;
  /* Keep orbit gestures from scrolling the page on phones. */
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.ply-scan-viewer.is-idle {
  display: grid;
  place-items: center;
  /* Idle is not an interactive orbit surface. */
  touch-action: manipulation;
  background:
    radial-gradient(ellipse at center, rgba(201, 76, 47, 0.12), transparent 62%),
    #141414;
}

.ply-scan-viewer.is-idle::after {
  content: "3D SCAN";
  color: rgba(242, 236, 225, 0.35);
  font-family: "Source Code Pro", "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.ply-scan-viewer.is-loading-scan::after {
  content: "LOADING…";
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: rgba(242, 236, 225, 0.55);
  font-family: "Source Code Pro", "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 700;
  background: rgba(20, 20, 20, 0.35);
}

.ply-scan-viewer.is-mobile-desktop-only {
  display: grid;
  place-items: center;
  touch-action: manipulation;
  padding: 24px 20px;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse at center, rgba(201, 76, 47, 0.14), transparent 64%),
    #141414;
}

.ply-scan-mobile-notice {
  max-width: 22rem;
  text-align: center;
  font-family: "Source Code Pro", "IBM Plex Mono", monospace;
  color: #f2ece1;
}

.ply-scan-mobile-notice-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(242, 236, 225, 0.45);
}

.ply-scan-mobile-notice-body {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #f2ece1;
}

.ply-scan-mobile-notice-detail {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(201, 76, 47, 0.95);
}

.ply-scan-controls.is-mobile-hidden {
  display: none;
}

.ply-scan-viewer canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  /* Opaque compositing layer — transparent WebGL clears look blank on some mobile Safari builds. */
  background: #141414;
}

.ply-scan-load {
  appearance: none;
  border: 1px solid rgba(4, 82, 51, 0.55);
  border-radius: 4px;
  background: #045233;
  color: #f2ece1;
  font-family: "Source Code Pro", "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 16px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ply-scan-load:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ply-scan-load:disabled,
.ply-scan-load.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.ply-scan-status,
.ply-scan-controls {
  color: #4d4a45;
  font-family: 'Source Code Pro', 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.25;
  text-transform: uppercase;
}

.ply-scan-status {
  margin-top: 8px;
  color: #c94c2f;
  font-weight: 700;
}

.ply-scan-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
}

.ply-scan-controls label {
  color: #045233;
  font-weight: 700;
}

.ply-scan-controls input {
  max-width: 100%;
}

@media (max-width: 560px) {
  .ply-scan-viewer {
    /* Prefer dynamic viewport height when available (mobile browser chrome). */
    height: min(58dvh, 420px);
    min-height: 280px;
  }

  .ply-scan-controls {
    gap: 12px;
  }

  .ply-scan-load {
    width: 100%;
    justify-content: center;
  }

  .ply-scan-status {
    font-size: 11px;
    word-break: break-word;
  }
}

