.gemviz-wrap {
  margin: 1em 0;
}

.gemviz-no-scroll {
  overflow: hidden;
}

.gemviz-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gemviz-modal-inner {
  position: relative;
  background: #faf8f4;
  border-radius: 12px;
  padding: 28px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.gemviz-modal-inner h4 {
  margin: 20px 0 4px;
  font-size: 15px;
  color: #1f2937;
}

.gemviz-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
}

/* Option cards */

.gemviz-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 6px;
}

.gemviz-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.gemviz-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.gemviz-card.is-active {
  border-color: #b8860b;
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.25);
}

.gemviz-card-label {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

.gemviz-card-desc {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.gemviz-card-text {
  display: block;
}

.gemviz-card-icon {
  font-size: 18px;
  line-height: 1;
}

/* Metal swatches */

.gemviz-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.15);
}

.gemviz-swatch--white-gold {
  background: radial-gradient(circle at 35% 30%, #f4f4f8, #d9d9e3);
}

.gemviz-swatch--yellow-gold {
  background: radial-gradient(circle at 35% 30%, #e8c766, #c99b2f);
}

.gemviz-swatch--rose-gold {
  background: radial-gradient(circle at 35% 30%, #e0a98d, #c9836a);
}

.gemviz-swatch--platinum {
  background: radial-gradient(circle at 35% 30%, #e3e5ea, #c6c9d0);
}

/* Render button + result */

.gemviz-render {
  margin-top: 18px;
  width: 100%;
}

.gemviz-hint {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  margin: 8px 0 0;
}

.gemviz-result {
  margin-top: 16px;
  text-align: center;
}

.gemviz-status {
  color: #555;
  min-height: 1.4em;
}

.gemviz-image {
  max-width: 100%;
  border-radius: 8px;
}

/* Sketch upload (one per visitor) */

.gemviz-sketch {
  margin-top: 6px;
}

.gemviz-sketch-label {
  display: inline-block;
  cursor: pointer;
}

.gemviz-sketch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.gemviz-sketch-input:disabled + .gemviz-sketch-btn,
.gemviz-sketch-btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.gemviz-sketch-status {
  font-size: 13px;
  color: #555;
  margin: 6px 0 0;
  min-height: 1.2em;
}

.gemviz-sketch-status.is-attached {
  color: #15803d;
}

.gemviz-sketch-note {
  font-size: 11px;
  color: #9ca3af;
  margin: 4px 0 0;
}

/* Design chat */

.gemviz-chat {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #d1d5db;
  text-align: left;
}

.gemviz-chat-log {
  max-height: 180px;
  overflow-y: auto;
  margin: 8px 0;
}

.gemviz-chat-msg {
  margin: 6px 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  max-width: 85%;
}

.gemviz-chat-msg--user {
  background: #b8860b;
  color: #fff;
  margin-left: auto;
  text-align: right;
}

.gemviz-chat-msg--ai {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #374151;
}

.gemviz-chat-row {
  display: flex;
  gap: 8px;
}

.gemviz-chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
}

/* Order this design */

.gemviz-order {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #d1d5db;
}

.gemviz-order-btn {
  width: 100%;
  background: #b8860b !important;
  color: #fff !important;
}

.gemviz-order-btn:disabled {
  opacity: 0.6;
}

.gemviz-order-note {
  font-size: 11px;
  color: #9ca3af;
  margin: 8px 0 0;
}

.gemviz-order-status {
  font-size: 13px;
  color: #15803d;
  margin: 8px 0 0;
}

/* "See it worn" modal (ready jewelry) */

.gemviz-modal-inner--wear {
  max-width: 520px;
  text-align: center;
}

.gemviz-sketch-remove {
  display: inline-block;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: #b91c1c;
  text-decoration: underline;
  cursor: pointer;
}

.gemviz-sketch-remove:hover {
  color: #7f1d1d;
}

.gemviz-sketch-remove[disabled] {
  opacity: 0.6;
  cursor: default;
}

/* Try-on confirmation step */

.gemviz-wear-intro {
  text-align: center;
  padding: 8px 0 4px;
}

.gemviz-wear-intro p {
  font-size: 13px;
  color: #555;
  margin: 0 0 10px;
}

/* Admin 3D export */

.gemviz-3d {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d1d5db;
}

.gemviz-3d-status {
  font-size: 13px;
  color: #555;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.gemviz-3d-stage {
  font-weight: 500;
}

.gemviz-3d-bar {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
}

.gemviz-3d-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #6366f1;
  transition: width 0.4s ease;
}

/* At 99% Meshy stops reporting movement, so the bar sweeps instead of sitting
   still — a frozen bar is what makes people think the job has died. */
.gemviz-3d-bar.is-indeterminate .gemviz-3d-bar-fill {
  width: 100% !important;
  background: linear-gradient(90deg, #e5e7eb 0%, #6366f1 50%, #e5e7eb 100%);
  background-size: 200% 100%;
  animation: gemviz-sweep 1.4s linear infinite;
}

@keyframes gemviz-sweep {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.gemviz-3d-elapsed {
  font-size: 11px;
  color: #9ca3af;
}

@media (prefers-reduced-motion: reduce) {
  .gemviz-3d-bar.is-indeterminate .gemviz-3d-bar-fill {
    animation: none;
    background: #6366f1;
  }
}

.gemviz-3d-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.gemviz-3d-note {
  font-size: 11px;
  color: #9ca3af;
  margin: 8px 0 0;
}

/* Scale summary sits below the download buttons inside the flex row. */
.gemviz-3d-scale {
  flex-basis: 100%;
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 0;
  text-align: center;
}

.gemviz-spinner {
  width: 36px;
  height: 36px;
  margin: 12px auto;
  border: 4px solid #e5e7eb;
  border-top-color: #b8860b;
  border-radius: 50%;
  animation: gemviz-spin 0.9s linear infinite;
}

@keyframes gemviz-spin {
  to {
    transform: rotate(360deg);
  }
}
