.demo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e6e6e6;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #111111;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.title {
  font-size: 18px;
}

.header-controls {
  display: flex;
  gap: 12px;
}

.control-group {
  display: grid;
  gap: 6px;
}

.control-label {
  font-size: 12px;
  color: #666666;
}

.toggle-group {
  display: inline-flex;
  border: 1px solid #d7d7d7;
  border-radius: 999px;
  overflow: hidden;
}

.toggle {
  padding: 6px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.toggle.active {
  background: #111111;
  color: #ffffff;
}

.is-hidden {
  display: none !important;
}

.demo-main {
  padding: 28px 24px 48px;
}

.layout {
  width: min(1160px, 100%);
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}

.card {
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.viewer-card {
  display: grid;
  gap: 16px;
}

.panel-card {
  display: grid;
  gap: 16px;
}

.panel-section {
  display: grid;
  gap: 12px;
}

.viewer-shell {
  position: relative;
  background: #f7f7f7;
  border-radius: 20px;
  overflow: hidden;
  min-height: 520px;
  display: grid;
  place-items: center;
  z-index: 1;
}

.viewer-shell.plan-pro::before,
.viewer-shell.plan-pro::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at top, rgba(130, 200, 255, 0.35), transparent 60%);
  opacity: 0.65;
  pointer-events: none;
  z-index: 1;
}

.viewer-shell.plan-pro::after {
  background: radial-gradient(circle at bottom, rgba(255, 200, 140, 0.25), transparent 65%);
  opacity: 0.5;
}

.viewer-shell.plan-standard::before {
  content: "";
  position: absolute;
  inset: -15%;
  background: radial-gradient(circle at top, rgba(180, 180, 180, 0.25), transparent 60%);
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}

.viewer-shell.plan-pro {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.viewer-shell.plan-standard {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.viewer-shell.plan-transition {
  animation: planPulse 0.4s ease;
}

.watermark {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  z-index: 2;
}

.model-viewer {
  width: 100%;
  height: 520px;
  background: #f1f1f1;
}

.viewer-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #666666;
  background: #ffffff;
  z-index: 2;
  text-align: center;
  padding: 24px;
}

.compare-layer {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 3;
}

.compare-layer.is-open {
  display: block;
}

.viewer-shell.is-compare #modelViewer {
  display: none;
}

.compare-before,
.compare-after {
  position: absolute;
  inset: 0;
}

.compare-after {
  width: 50%;
  overflow: hidden;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.compare-line {
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
}

.compare-knob {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #111111;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.compare-slider {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  width: calc(100% - 32px);
  z-index: 4;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
}

.helper-text {
  font-size: 12px;
  color: #666666;
}

.preset-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-chip,
.action-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #d7d7d7;
  background: #ffffff;
  cursor: pointer;
}

.preset-chip.active {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.preset-chip.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.viewer-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.share-panel {
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 16px;
}

.qr-mode {
  display: none;
  gap: 8px;
  flex-direction: column;
}

.qr-mode.is-active {
  display: flex;
}

.locked-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid #e6e6e6;
  padding: 16px;
  background: #f8f8f8;
  overflow: hidden;
  display: grid;
  gap: 10px;
}

.locked-card .locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 12px;
}

.locked-card .lock-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #111111;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.panel-section details {
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fafafa;
}

.panel-section summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.panel-section summary::-webkit-details-marker {
  display: none;
}

.panel-controls {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.panel-controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.panel-controls select,
.panel-controls input[type="range"] {
  width: 100%;
}

.qr-box {
  width: 180px;
  height: 180px;
}

.qr-box canvas,
.qr-box img {
  width: 180px;
  height: 180px;
  display: block;
}

.qr-label {
  font-weight: 600;
}

.qr-url {
  font-size: 13px;
  color: #333333;
  word-break: break-all;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111111;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 20;
}

.toast.show {
  opacity: 1;
}

.ar-cta {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.ar-cta.is-open {
  display: flex;
}

.ar-cta-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 18px;
  text-align: center;
  display: grid;
  gap: 10px;
}

.ar-cta-title {
  font-size: 18px;
  font-weight: 600;
}

.ar-cta-subtitle {
  font-size: 12px;
  color: #666666;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.overlay-panel {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  max-width: 420px;
  width: calc(100% - 32px);
  z-index: 2;
  transform: translateY(6px) scale(0.98);
  transition: transform 0.2s ease;
}

.overlay.is-open .overlay-panel {
  transform: translateY(0) scale(1);
}

.overlay-table {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
}

.overlay-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f7f7f7;
}

.overlay-row strong {
  font-weight: 600;
}

.upgrade-highlight {
  animation: upgradePulse 0.6s ease;
}

@keyframes upgradePulse {
  0% {
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    transform: translateX(-50%) scale(0.98);
  }
  100% {
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    transform: translateX(-50%) scale(1.03);
  }
}

.overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: #111111;
  color: #ffffff;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

@keyframes proGlow {
  0% {
    transform: translateX(-50%) scale(0.98);
    opacity: 0.6;
  }
  100% {
    transform: translateX(-50%) scale(1.03);
    opacity: 1;
  }
}

@keyframes proUpgrade {
  0% {
    transform: translateX(-50%) scale(0.94);
    opacity: 0.6;
  }
  100% {
    transform: translateX(-50%) scale(1.03);
    opacity: 1;
  }
}

@keyframes planPulse {
  0% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .demo-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .viewer-shell {
    min-height: 420px;
  }

  .model-viewer {
    height: 420px;
  }
}
