body.sms-3d-preview-open {
  overflow: hidden;
}

.sms-3d-preview {
  position: fixed;
  inset: 0;
  z-index: 1000002;
  display: grid;
  color: #18181e;
  font-family: inherit;
  opacity: 0;
  transition: opacity 220ms cubic-bezier(.22, 1, .36, 1);
}

.sms-3d-preview[hidden] {
  display: none !important;
}

.sms-3d-preview.is-open {
  opacity: 1;
}

.sms-3d-preview__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 19, 22, .76);
}

.sms-3d-preview__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1500px, calc(100vw - 36px));
  height: min(920px, calc(100vh - 36px));
  margin: auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .32);
  opacity: 0;
  transform: scale(.96) translateY(8px);
  transition:
    opacity 260ms cubic-bezier(.22, 1, .36, 1),
    transform 260ms cubic-bezier(.22, 1, .36, 1);
}

.sms-3d-preview.is-open .sms-3d-preview__dialog {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.sms-3d-preview__topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 22px;
  background: #fff;
  border-bottom: 1px solid #dedee2;
}

.sms-3d-preview__topbar > div {
  display: grid;
  gap: 2px;
}

.sms-3d-preview__topbar small {
  color: #77777d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
}

.sms-3d-preview__topbar strong {
  font-size: 16px;
  font-weight: 600;
}

.sms-3d-preview__close {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: #18181e;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    color 160ms cubic-bezier(.22, 1, .36, 1),
    background-color 160ms cubic-bezier(.22, 1, .36, 1),
    transform 160ms cubic-bezier(.22, 1, .36, 1);
}

.sms-3d-preview__close:hover,
.sms-3d-preview__close:focus-visible {
  color: #fff;
  background: #18181e;
}

.sms-3d-preview__close:active {
  transform: scale(.97);
}

.sms-3d-preview__close:focus-visible,
.sms-3d-preview__controls button:focus-visible {
  outline: 2px solid #2271b1;
  outline-offset: 2px;
}

.sms-3d-preview__viewport {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #e9eaeb;
}

.sms-3d-preview__canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}

.sms-3d-preview__canvas.is-pannable {
  cursor: grab;
}

.sms-3d-preview__canvas.is-over-magnet {
  cursor: move;
}

.sms-3d-preview__canvas.is-dragging-magnet,
.sms-3d-preview__canvas.is-panning {
  cursor: grabbing;
}

.sms-3d-preview__loading {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 13px;
  color: #18181e;
  background: rgba(238, 241, 243, .86);
  pointer-events: none;
}

.sms-3d-preview__loading[hidden] {
  display: none;
}

.sms-3d-preview__loading > span {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(24, 24, 30, .18);
  border-top-color: #18181e;
  border-radius: 50%;
  animation: sms-3d-spin 700ms linear infinite;
}

.sms-3d-preview__loading.is-error > span {
  display: none;
}

.sms-3d-preview__loading strong {
  font-size: 12px;
  font-weight: 600;
}

@keyframes sms-3d-spin {
  to { transform: rotate(360deg); }
}

.sms-3d-preview__counter,
.sms-3d-preview__hint {
  position: absolute;
  z-index: 2;
  margin: 0;
  color: #18181e;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(24, 24, 30, .12);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.sms-3d-preview__counter {
  top: 18px;
  left: 18px;
  padding: 8px 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sms-3d-preview__hint {
  bottom: 18px;
  left: 50%;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: calc(100% - 36px);
  padding: 9px 12px;
  font-size: 10px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.sms-3d-preview__controls {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 74px;
  padding: 12px 18px;
  background: #fff;
  border-top: 1px solid #dedee2;
}

.sms-3d-preview__finishes {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sms-3d-preview__finishes > span {
  margin-right: 5px;
  color: #77777d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sms-3d-preview__rotation {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-left: 12px;
  border-left: 1px solid #dedee2;
}

.sms-3d-preview__rotation > span {
  min-width: 70px;
  color: #77777d;
  font-size: 10px;
  white-space: nowrap;
}

.sms-3d-preview__rotation button {
  width: 38px;
  padding: 0;
}

.sms-3d-preview__controls button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  color: #18181e;
  background: #fff;
  border: 1px solid #c8c8cc;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  transition:
    color 160ms cubic-bezier(.22, 1, .36, 1),
    background-color 160ms cubic-bezier(.22, 1, .36, 1),
    border-color 160ms cubic-bezier(.22, 1, .36, 1),
    transform 160ms cubic-bezier(.22, 1, .36, 1);
}

.sms-3d-preview__controls button:hover,
.sms-3d-preview__controls button.is-active {
  color: #fff;
  background: #18181e;
  border-color: #18181e;
}

.sms-3d-preview__controls button:active {
  transform: scale(.97);
}

.sms-3d-preview__controls button:disabled {
  color: #aaaab0;
  background: #f4f4f5;
  border-color: #dedee2;
  cursor: not-allowed;
}

.sms-3d-preview__finishes button i {
  width: 14px;
  height: 14px;
  background: #c6cdd1;
  border: 1px solid rgba(24, 24, 30, .24);
  border-radius: 50%;
}

.sms-3d-preview__finishes button[data-sms-3d-finish="white"] i {
  background: #f4f4f1;
}

.sms-3d-preview__finishes button[data-sms-3d-finish="black"] i {
  background: #22252a;
}

.sms-3d-preview__scale-note {
  margin-left: auto;
  color: #77777d;
  font-size: 10px;
}

.sms-3d-preview__reset {
  flex: 0 0 auto;
}

.sms-open-3d {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 9px;
  color: #18181e;
  background: #fff;
  border: 1px solid #18181e;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  transition:
    color 180ms cubic-bezier(.22, 1, .36, 1),
    background-color 180ms cubic-bezier(.22, 1, .36, 1),
    transform 140ms cubic-bezier(.22, 1, .36, 1);
}

.sms-open-3d:hover:not(:disabled),
.sms-open-3d:focus-visible {
  color: #fff;
  background: #18181e;
}

.sms-open-3d:active:not(:disabled) {
  transform: scale(.985);
}

.sms-open-3d:disabled {
  color: #a0a0a5;
  background: #f4f4f5;
  border-color: #d5d5d8;
  cursor: not-allowed;
}

@media (max-width: 1024px) {
  .sms-3d-preview__dialog {
    width: 100%;
    height: 100%;
    border: 0;
  }

  .sms-3d-preview__topbar {
    min-height: 58px;
    padding: 0 12px 0 16px;
  }

  .sms-3d-preview__controls {
    gap: 10px;
    min-height: 68px;
    overflow-x: auto;
    padding: 10px 12px;
  }

  .sms-3d-preview__finishes > span,
  .sms-3d-preview__scale-note {
    display: none;
  }

  .sms-3d-preview__hint {
    bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 480px) {
  .sms-3d-preview__hint {
    white-space: normal;
    text-align: center;
  }

  .sms-3d-preview__finishes button {
    padding: 0 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sms-3d-preview,
  .sms-3d-preview__dialog,
  .sms-3d-preview__close,
  .sms-3d-preview__controls button,
  .sms-open-3d {
    transition: none !important;
  }

  .sms-3d-preview__loading > span {
    animation-duration: 1400ms;
  }
}
