.wcrv-room-visualizer {
  margin: 40px 0;
  padding: 24px;
  border: 1px solid #e5e5e5;
  background: #fff;
}

.wcrv-header h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

.wcrv-header p,
.wcrv-note,
.wcrv-status {
  margin: 0 0 18px;
  color: #555;
}

.wcrv-status {
  min-height: 20px;
  font-size: 14px;
}

.wcrv-status.is-error {
  color: #b00020;
  font-weight: 600;
}

/* ── Main toolbar ─────────────────────────────────────────────────────────── */

.wcrv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.wcrv-upload-btn,
.wcrv-camera-btn,
.wcrv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.wcrv-camera-btn,
.wcrv-btn {
  background: #fff;
  color: #111;
}

.wcrv-camera-btn {
  background: #7f7859;
  color: #fff;
}

.wcrv-room-input,
.wcrv-camera-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Position toolbar (3×3 grid) ──────────────────────────────────────────── */

.wcrv-position-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.wcrv-position-label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.wcrv-position-grid {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  grid-template-rows: repeat(3, 34px);
  gap: 4px;
}

.wcrv-pos-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  min-height: unset !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid #aaa !important;
  background: #f8f8f8 !important;
  color: #333 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  text-shadow: none !important;
  text-decoration: none !important;
  font-weight: normal !important;
  letter-spacing: normal !important;
  transition: background 0.15s, color 0.15s, border-color 0.15s !important;
  -webkit-tap-highlight-color: transparent !important;
}

.wcrv-pos-btn:hover {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}

.wcrv-pos-btn:active {
  background: #444 !important;
  color: #fff !important;
}

/* Center button — slightly distinct */
.wcrv-pos-btn.wcrv-pos-center {
  background: #fff !important;
  border-color: #555 !important;
  font-size: 14px !important;
}

.wcrv-pos-btn.wcrv-pos-center:hover {
  background: #111 !important;
  color: #fff !important;
}

/* ── Stage ────────────────────────────────────────────────────────────────── */

.wcrv-stage-wrap {
  width: 100%;
  max-width: 980px;
}

.wcrv-stage {
  position: relative;
  width: 100%;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #ddd;
  background: #f5f5f5;
  touch-action: none;
}

.wcrv-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  user-select: none;
  pointer-events: none;
}

.wcrv-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #444;
  text-align: center;
  padding: 20px;
  z-index: 3;
}

.wcrv-stage.has-image .wcrv-empty-state {
  display: none;
}

/* ── Model layer ──────────────────────────────────────────────────────────── */

.wcrv-model-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  transform-origin: center center;
  display: block;
  pointer-events: none;
}

.wcrv-stage.has-image .wcrv-model-layer {
  display: block;
}

.wcrv-model-viewer {
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.wcrv-model-viewer:active {
  cursor: grabbing;
}

.wcrv-move-capture {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: none;
  cursor: move;
  touch-action: none;
  pointer-events: none;
}

.wcrv-stage.wcrv-move-mode .wcrv-move-capture {
  display: block;
  pointer-events: auto;
}

.wcrv-stage.wcrv-move-mode .wcrv-model-viewer {
  pointer-events: none;
}

/* ── Move handle — compact icon-only button ───────────────────────────────── */

.wcrv-move-handle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 8;
  width: 28px;
  height: 28px;
  border: 1px solid #555;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.90);
  color: #333;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
  cursor: move;
  pointer-events: auto;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
  transition: background 0.15s, color 0.15s;
}

.wcrv-move-handle:hover,
.wcrv-move-handle.is-active {
  background: #111;
  color: #fff;
}

.wcrv-move-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Fallback (2-D) product overlay ──────────────────────────────────────── */

.wcrv-fallback-product {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 45%;
  max-height: 45%;
  display: none;
  transform-origin: center center;
  z-index: 4;
  cursor: grab;
  user-select: none;
  pointer-events: none;
}

.wcrv-stage.has-image .wcrv-fallback-product {
  display: block;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .wcrv-room-visualizer {
    padding: 14px;
  }

  .wcrv-header h2 {
    font-size: 24px;
  }

  .wcrv-stage {
    min-height: 360px;
  }

  .wcrv-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .wcrv-upload-btn,
  .wcrv-camera-btn {
    grid-column: span 1;
  }

  .wcrv-upload-btn,
  .wcrv-camera-btn,
  .wcrv-btn {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .wcrv-position-grid {
    grid-template-columns: repeat(3, 38px);
    grid-template-rows: repeat(3, 38px);
    gap: 5px;
  }

  .wcrv-pos-btn {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .wcrv-move-handle {
    width: 28px;
    height: 28px;
    right: 6px;
    bottom: 6px;
  }

  .wcrv-model-layer {
    width: 100%;
    height: 100%;
  }
}
