.model-preview-button {
  font-size: 0.78rem;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.customer-model-viewer-frame {
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: zoom-in;
  display: grid;
  height: 190px;
  min-height: 190px;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 100%;
}

.customer-model-viewer-frame:hover,
.customer-model-viewer-frame:focus-visible {
  border-color: var(--cyan);
  outline: 3px solid rgba(18, 189, 210, 0.18);
}

.customer-model-viewer-frame.is-missing {
  border-style: dashed;
}

.customer-model-viewer-frame > span,
.preview-enlarge-label {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: 8px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 950;
  left: 50%;
  padding: 5px 9px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 1;
}

.customer-inline-model-viewer {
  background: transparent;
  height: 190px;
  pointer-events: none;
  width: 100%;
}

.model-preview-dialog,
.customer-image-preview-dialog {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(9, 39, 86, 0.22);
  color: var(--ink);
  max-width: min(880px, calc(100vw - 28px));
  padding: 20px;
  width: 880px;
}

.model-preview-dialog::backdrop,
.customer-image-preview-dialog::backdrop {
  background: rgba(9, 39, 86, 0.42);
}

.model-preview-close,
.image-preview-close {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.4rem;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 38px;
  z-index: 2;
}

.model-preview-header,
.image-preview-header {
  display: grid;
  gap: 6px;
  padding-right: 48px;
}

.model-preview-header h2,
.image-preview-header h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin: 0;
}

.model-preview-header p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.model-preview-order {
  color: var(--ink) !important;
  font-weight: 900;
}

.model-preview-stage,
.image-preview-stage {
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: min(62vh, 560px);
  margin-top: 16px;
  overflow: hidden;
  position: relative;
}

.image-preview-stage {
  align-items: center;
  display: grid;
  justify-items: center;
  overflow: auto;
  padding: 14px;
}

#model-preview-viewer {
  background: transparent;
  height: 100%;
  width: 100%;
}

#customer-image-preview-img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.model-preview-fallback {
  color: var(--muted);
  font-weight: 800;
  left: 50%;
  line-height: 1.5;
  margin: 0;
  max-width: 420px;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
}

.model-preview-fallback a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.model-preview-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.model-change-form {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.model-change-form[hidden] {
  display: none;
}

.model-change-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.model-change-form textarea:focus {
  border-color: var(--cyan);
  outline: 3px solid rgba(18, 189, 210, 0.18);
}

.model-preview-message {
  margin: 12px 0 0;
}

@media (max-width: 720px) {
  .progress-title-row {
    align-items: flex-start;
  }

  .model-preview-button {
    order: 2;
  }

  .model-preview-dialog,
  .customer-image-preview-dialog {
    padding: 16px;
  }

  .model-preview-stage,
  .image-preview-stage {
    height: min(58vh, 460px);
  }

  .model-preview-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
