/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Full-bleed dark canvas */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111111;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Viewer container */
#viewer {
  width: 100%;
  height: 100svh;
}

/* Canvas — no gaps, no gestures */
#viewer canvas {
  display: block;
  touch-action: none;
}

/* Overlay — shared loading + error surface */
#overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 48px));
  padding: 16px;
  background: rgba(26, 26, 26, 0.92);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 120ms ease-out;
  pointer-events: none;
}

#overlay.visible {
  opacity: 1;
}

/* Percentage / status label */
#overlay-label {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  color: #e0e0e0;
  margin-bottom: 4px;
}

/* Progress bar track */
#overlay-bar-track {
  width: 100%;
  height: 2px;
  background: #333333;
  border-radius: 2px;
}

/* Progress bar fill */
#overlay-bar-fill {
  height: 2px;
  background: #e0e0e0;
  border-radius: 2px;
  width: 0%;
}

/* Error text (replaces label; bar track hidden in error state) */
#overlay-error {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #e0e0e0;
  display: none;
}

#overlay.error #overlay-label { display: none; }
#overlay.error #overlay-bar-track { display: none; }
#overlay.error #overlay-error { display: block; }
