:root {
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
  color: #181b1b;
  background: #f4f4f0;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }

.viewer {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 27px clamp(16px, 3vw, 36px) 24px;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.back { color: #353c3b; text-underline-offset: 3px; font-size: 14px; }
h1 { font-size: clamp(24px, 4.4vw, 43px); letter-spacing: -.035em; margin: 7px 0 3px; }
.model-label { margin: 0; font-size: 14px; color: #565c5a; }

.modes, .actions { display: flex; align-items: center; gap: 8px; }

button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #272b2b;
  background: #fff;
  border: 1px solid #d8dad3;
  border-radius: 6px;
  padding: 9px 12px;
  min-height: 42px;
  cursor: pointer;
}

button:hover:not(:disabled) { background: #ebece8; }
button[aria-pressed="true"], button[aria-pressed="true"]:hover { background: #343a39; color: #fff; border-color: #343a39; }
button:disabled { color: #626764; cursor: default; }
:focus-visible { outline: 2px solid #ab420a; outline-offset: 3px; }

.stage {
  position: relative;
  isolation: isolate;
  height: clamp(310px, 62vh, 720px);
  overflow: hidden;
  border-radius: 8px;
  background: #e3e6e4;
}

.stage canvas, .poster { display: block; width: 100%; height: 100%; }
.stage canvas { touch-action: none; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.poster { position: absolute; object-fit: cover; z-index: 1; }

.message {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  background: #edf0ece0;
  z-index: 2;
}

.message p { margin: 0; font-weight: 600; }
.actions { margin-top: 12px; }
.actions input { min-width: 65px; flex: 1; accent-color: #b84b16; }

@media (max-width: 520px) {
  .viewer { padding-top: 16px; }
  .stage { height: clamp(300px, 55svh, 520px); }
  .actions { gap: 6px; }
  button { padding-inline: 9px; }
}
