.preview-wrap { cursor: zoom-in; }
.rotator-viewer[hidden] { display: none; }
.rotator-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 8, 15, .86);
  backdrop-filter: blur(7px);
}
.rotator-viewer-panel {
  display: flex;
  flex-direction: column;
  width: min(1200px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 32px));
  padding: 14px;
  overflow: hidden;
  border: 1px solid #44506a;
  border-radius: 15px;
  background: #111722;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}
.rotator-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #edf1f8;
}
.rotator-viewer-title {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rotator-viewer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 6px;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin-top: 12px;
  padding: 7px;
  border: 1px solid #344158;
  border-radius: 13px;
  background: #171f2e;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
.rotator-viewer-controls > span {
  display: grid;
  min-width: 58px;
  min-height: 38px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid #46536c;
  border-radius: 9px;
  background: #0d1420;
  color: #c7d0e2;
  font: 700 13px 'DM Mono', monospace;
  text-align: center;
}
.rotator-viewer-angle {
  display: flex;
  min-width: 88px;
  flex-direction: column;
  gap: 3px;
  color: #aeb8c9;
  font-size: 9px;
  font-weight: 700;
}
.rotator-viewer-angle-input {
  display: flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid #46536c;
  border-radius: 9px;
  background: #0d1420;
}
.rotator-viewer-angle-input input {
  width: 62px;
  height: 36px;
  padding: 6px 3px 6px 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #edf1f8;
  font: 700 13px 'DM Mono', monospace;
}
.rotator-viewer-angle-input b {
  padding-right: 9px;
  color: #aeb8c9;
  font: 700 12px 'DM Mono', monospace;
}
.rotator-viewer-controls > button:not(.rotator-viewer-close) {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #27334a;
  color: #edf1f8;
  font: 600 12px 'Noto Sans Thai', sans-serif;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.rotator-viewer-controls > button:not(.rotator-viewer-close):hover {
  border-color: #8290ff;
  background: #34436a;
  color: #fff;
  transform: translateY(-1px);
}
.rotator-viewer-controls > button:not(.rotator-viewer-close):active {
  transform: translateY(0);
}
.rotator-viewer-controls > button:nth-of-type(3) {
  margin-left: 7px;
  box-shadow: -8px 0 0 -7px #46536c;
}
.rotator-viewer-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #29344a;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.rotator-viewer-stage {
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #080c14;
}
.rotator-viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  object-fit: contain;
}
body.rotator-viewer-open { overflow: hidden; }
@media (max-width: 650px) {
  .rotator-viewer-panel { padding: 10px; }
  .rotator-viewer-controls { display: grid; grid-template-columns: 58px repeat(2, minmax(0, 1fr)); width: 100%; margin-top: 9px; padding: 6px; }
  .rotator-viewer-angle { grid-row: span 2; min-width: 0; width: 58px; }
  .rotator-viewer-angle-input { height: 100%; }
  .rotator-viewer-angle-input input { width: 38px; padding-left: 6px; }
  .rotator-viewer-controls > button:not(.rotator-viewer-close) { min-width: 0; padding-inline: 6px; font-size: 11px; }
  .rotator-viewer-controls > button:nth-of-type(3) { margin-left: 0; box-shadow: none; }
}
