.kangaroo-cube-viewer {
  box-sizing: border-box;
  width: min(100%, 760px);
  margin: 16px auto 4px;
  padding: 10px;
  border: 1px solid #d9cdbb;
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 5px 18px rgb(64 47 34 / 8%);
  color: #392d25;
}

.cube-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cube-viewer-launch {
  display: block;
  min-width: min(100%, 220px);
  min-height: 48px;
  margin: 2px auto;
  padding: 0 22px;
  border: 1px solid #3f7350;
  border-radius: 13px;
  background: #4f8a62;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.cube-viewer-launch:hover {
  background: #3f7350;
}

.cube-viewer-launch:focus-visible {
  outline: 3px solid #3279b7;
  outline-offset: 2px;
}

.cube-viewer-button,
.cube-viewer-model-select {
  min-height: 44px;
  border: 1px solid #bba98f;
  border-radius: 11px;
  background: #fff;
  color: #392d25;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.cube-viewer-button {
  padding: 0 15px;
}

.cube-viewer-icon-button {
  min-width: 44px;
  padding: 0 10px;
  font-size: 1.35rem;
}

.cube-viewer-model-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 700;
}

.cube-viewer-model-select {
  padding: 0 34px 0 12px;
}

.cube-viewer-button:hover,
.cube-viewer-model-select:hover {
  border-color: #77634f;
  background: #f9f1e4;
}

.cube-viewer-button:focus-visible,
.cube-viewer-model-select:focus-visible,
.cube-viewer-stage canvas:focus-visible {
  outline: 3px solid #3279b7;
  outline-offset: 2px;
}

.cube-viewer-stage {
  position: relative;
  height: clamp(320px, 48vw, 400px);
  overflow: hidden;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 42%, #ffffff 0 38%, #f5efe6 100%);
  touch-action: none;
}

.cube-viewer-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.cube-viewer-stage canvas:active {
  cursor: grabbing;
}

.cube-viewer-help,
.cube-viewer-status {
  margin: 7px 4px 0;
  text-align: center;
  font-size: 0.86rem;
  line-height: 1.35;
}

.cube-viewer-help {
  color: #65594f;
}

.cube-viewer-status {
  min-height: 1.2em;
  color: #39714a;
}

.cube-viewer-status.is-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff0ed;
  color: #8b3028;
  font-weight: 700;
}

@media (max-width: 520px) {
  .kangaroo-cube-viewer {
    padding: 8px;
  }

  .cube-viewer-toolbar {
    gap: 6px;
  }

  .cube-viewer-button {
    flex: 1 1 auto;
    padding-inline: 11px;
  }

  .cube-viewer-model-label {
    flex: 1 0 100%;
    justify-content: center;
  }

  .cube-viewer-stage {
    height: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kangaroo-cube-viewer * {
    scroll-behavior: auto;
  }
}

@media print {
  .kangaroo-cube-viewer {
    display: none !important;
  }
}
