:root {
  --modelora-accent: #0b84ff;
  --modelora-surface: #ffffff;
  --modelora-border: #dbe3ed;
  --modelora-text: #1c2a39;
  --modelora-muted: #6d7c8f;
  --modelora-shadow: 0 10px 35px rgba(16, 34, 58, 0.08);
}

.modelora-viewer-shell {
  position: relative;
  border-radius: 16px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
  padding: 14px;
  /* Slow laptops: skip rendering work while off-screen. */
  content-visibility: auto;
  contain-intrinsic-size: auto 460px;
}

.modelora-viewer-shell.modelora-no-bg {
  background: transparent;
  box-shadow: none;
}

.modelora-viewer-shell.modelora-no-bg model-viewer {
  background: transparent;
}

.modelora-viewer-shell model-viewer {
  display: block;
  width: 100%;
  min-height: 420px;
  border-radius: 14px;
  background: transparent;
  background-image: none;
  --poster-color: transparent;
}

.modelora-viewer-shell .modelora-skeleton {
  position: absolute;
  inset: 14px;
  border-radius: 14px;
  background: linear-gradient(100deg, #eef3f9 40%, #f8fbff 50%, #eef3f9 60%);
  background-size: 200% 100%;
  animation: modelora-skeleton-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}

.modelora-viewer-shell.is-ready .modelora-skeleton {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .modelora-viewer-shell .modelora-skeleton {
    animation: none;
  }
}

@keyframes modelora-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.modelora-toolbar {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.modelora-btn {
  border: 1px solid #cfdcec;
  background: rgba(255, 255, 255, 0.95);
  color: #2b3c52;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.modelora-btn:hover {
  transform: translateY(-1px);
  border-color: #a2c8f6;
  box-shadow: 0 8px 20px rgba(11, 132, 255, 0.14);
}

.modelora-friendly-error,
.modelora-inline-error {
  margin: 14px 0 0;
  color: #9b1d1d;
  background: #fff1f1;
  border: 1px solid #ffd5d5;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.modelora-compare-shell {
  border: 1px solid var(--modelora-border);
  border-radius: 16px;
  background: var(--modelora-surface);
  box-shadow: var(--modelora-shadow);
  padding: 14px;
}

.modelora-compare-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.modelora-compare-select-label,
.modelora-compare-color-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--modelora-muted);
  font-size: 13px;
}

.modelora-compare-select {
  border: 1px solid #cfdcec;
  border-radius: 8px;
  background: #ffffff;
  color: #2b3c52;
  padding: 6px 8px;
}

.modelora-compare-color {
  width: 34px;
  height: 30px;
  border: 1px solid #cfdcec;
  border-radius: 8px;
  background: #ffffff;
  padding: 0;
}

.modelora-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modelora-compare-panel {
  min-width: 0;
}

.modelora-compare-stage {
  position: relative;
  border: 1px solid var(--modelora-border);
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  min-height: 360px;
}

.modelora-compare-stage model-viewer {
  width: 100%;
  min-height: 360px;
  display: block;
  background: transparent;
  background-image: none;
  --poster-color: transparent;
}

.modelora-compare-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.82);
  color: #2b3c52;
  font-size: 13px;
}

.modelora-compare-fullscreen {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
}

.modelora-compare-caption {
  margin: 8px 2px 0;
  color: #5f728a;
  font-size: 13px;
  text-align: center;
}

.modelora-compare-stage:fullscreen,
.modelora-compare-stage:-webkit-full-screen {
  background: #0f172a;
}

.modelora-compare-stage:fullscreen model-viewer,
.modelora-compare-stage:-webkit-full-screen model-viewer {
  min-height: 100vh;
}

@media (max-width: 782px) {
  .modelora-viewer-shell model-viewer {
    min-height: 320px;
  }

  .modelora-toolbar {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .modelora-btn {
    flex: 1;
    text-align: center;
  }

  .modelora-compare-grid {
    grid-template-columns: 1fr;
  }

  .modelora-compare-stage,
  .modelora-compare-stage model-viewer {
    min-height: 300px;
  }

  .modelora-compare-controls {
    flex-direction: column;
    align-items: stretch;
  }
}
