dialog.cw-model-dialog {
  position: fixed;
  inset: 0;
  opacity: 1;
  transform: none;
  width: min(1080px, calc(100vw - 24px));
  min-width: 0;
  height: fit-content;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 16px;
  color: var(--text-default, #eee);
  overflow: auto;
  animation: none;
  transition: none;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(28, 30, 38, .96), rgba(18, 19, 26, .98));
  border: 1px solid var(--transparent-10-w, #ffffff1a);
  border-radius: var(--br-16, 16px);
  box-shadow: 0 24px 60px #0009;
}

.cw-model-dialog::backdrop { background: rgba(7, 8, 12, 0.88); }

.cw-model-header,
.cw-model-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cw-model-header h2 { margin: 0; font-size: clamp(18px, 3vw, 28px); text-align: left; }
.cw-model-header button { min-width: 44px; min-height: 44px; flex-shrink: 0; }
.cw-model-footer { flex-wrap: wrap; margin-top: 12px; }
.cw-model-footer p { margin: 0; font-size: 13px; text-align: left; flex: 1 1 220px; }
.cw-model-footer button { min-height: 44px; }

.cw-model-stage {
  position: relative;
  height: min(58vh, 590px);
  min-height: 180px;
  margin-top: 12px;
  overflow: hidden;
}

.cw-model-stage model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  --poster-color: transparent;
  --progress-bar-color: var(--span, #e0a252);
}

.cw-model-loading,
.cw-model-error {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 16px;
  align-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(7, 8, 12, 0.72);
  color: #fff;
}
.cw-model-stage[data-state='loading'] .cw-model-loading,
.cw-model-stage[data-state='error'] .cw-model-error { display: grid; }

/* One scene for custom weapon inspection and the equipment fitting room. */
.cw-model-stage, .editor-background--studio {
  background: #090c0e url('../custom-weapons/studio.webp') center / cover;
}
