.dk-3dmv-wrap {
  max-width: 100%;
  position: relative;
}

.dk-3dmv {
  width: 100%;
  height: 100%;
  display: block;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
}

.dk-3dmv-three {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
}

.dk-3dmv-three canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Loading fallback before custom element is defined */
model-viewer:not(:defined) {
  position: relative;
}

model-viewer:not(:defined)::before {
  content: "3Dモデルを読み込み中…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #111827;
  font-size: 14px;
}

.dk-3dmv-three[data-status="loading"]::before {
  content: "3Dモデルを読み込み中…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #111827;
  font-size: 14px;
}

.dk-3dmv-three[data-status="error"]::before {
  content: attr(data-error-message);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  white-space: pre-wrap;
}

.dk-3dmv-usdz {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
  padding: 16px;
}

.dk-3dmv-usdz-link {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 9999px;
  background: #111827;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
}

.dk-3dmv-usdz-link:hover {
  opacity: 0.9;
}

.dk-3dmv-error {
  color: #b91c1c;
  font-weight: 600;
}

.dk-3dmv-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: grid;
  gap: 6px;
  pointer-events: auto;
}

.dk-3dmv-controls__row {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.dk-3dmv-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.15);
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
}

.dk-3dmv-btn.is-active {
  background: rgba(17, 24, 39, 0.92);
  color: #ffffff;
  border-color: rgba(17, 24, 39, 0.35);
}

.dk-3dmv-btn:hover {
  background: rgba(255, 255, 255, 1);
}

.dk-3dmv-btn.is-active:hover {
  background: rgba(17, 24, 39, 1);
}

.dk-3dmv-btn:active {
  transform: translateY(1px);
}

/* Tooltip */
.dk-3dmv-btn[data-tooltip]:hover::after,
.dk-3dmv-btn[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 10;
}

