/* Spatial Recon — Celestial Synergy Terminal (aligned with openstrate-viewport / Stitch) */
:root {
  --osn-surface-lowest: #0a0a0c;
  --osn-surface-container-low: #1b1b20;
  --osn-surface-container-high: #2a292f;
  --osn-primary: #00f0ff;
  --osn-primary-soft: #dbfcff;
  --osn-primary-container: #00c8dc;
  --osn-on-primary-container: #0e0e13;
  --osn-secondary-soft: #d1bcff;
  --osn-synergy-magenta: #ff00ff;
  --osn-on-surface: #e4e1e9;
  --osn-on-surface-muted: #9a99a3;
  --osn-outline-variant: rgba(219, 252, 255, 0.14);
  --osn-crystalline-edge: linear-gradient(135deg, rgba(0, 240, 255, 0.4) 0%, rgba(255, 0, 255, 0.4) 100%);
  --osn-glass-blur: blur(20px) saturate(180%);
  --osn-synergy-gradient: linear-gradient(135deg, var(--osn-primary) 0%, var(--osn-synergy-magenta) 38%, var(--osn-primary-container) 100%);
  --osn-celestial-bg:
    radial-gradient(ellipse 120% 80% at 8% 12%, rgba(85, 48, 163, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 92% 88%, rgba(0, 240, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% -5%, rgba(219, 252, 255, 0.04) 0%, transparent 45%),
    var(--osn-surface-lowest);
  --osn-synergy-panel-glow:
    0 0 0 1px rgba(0, 240, 255, 0.08),
    0 0 56px rgba(85, 48, 163, 0.12),
    0 0 36px rgba(0, 240, 255, 0.05);
  --osn-font-mono: 'Space Mono', 'JetBrains Mono', ui-monospace, monospace;
  --osn-font-display: 'Space Grotesk', system-ui, sans-serif;
  --osn-radius: 0px;

  /* Legacy aliases used in older rules */
  --bg: var(--osn-surface-lowest);
  --surface: var(--osn-surface-container-low);
  --border: var(--osn-outline-variant);
  --accent: var(--osn-primary-container);
  --accent-dim: rgba(0, 240, 255, 0.12);
  --text: var(--osn-on-surface);
  --text-subtle: var(--osn-on-surface-muted);
  --mono: var(--osn-font-mono);
  --sans: var(--osn-font-display);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Crawlable / screen-reader intro (SEO + a11y); keeps layout unchanged */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#osn-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

body {
  background: var(--osn-celestial-bg);
  color: var(--osn-primary-soft);
  font-family: var(--osn-font-mono);
  font-size: 13px;
  min-height: 100vh;
}

body.mode-landing {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.mode-viewer {
  overflow: hidden;
  height: 100vh;
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 40px;
  max-width: 520px;
  width: 100%;
}

.admin-upload-badge {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(0, 240, 255, 0.92);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.28);
}

.admin-upload-badge a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-upload-badge a:hover {
  color: rgba(0, 240, 255, 1);
}

/* Deep link target + scroll anchor for #scan / #capture (dropzone + SCAN) */
.landing-capture-anchor {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

#logo {
  width: 280px;
  user-select: none;
  filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.25)) drop-shadow(0 0 36px rgba(255, 0, 255, 0.08));
}

#logo .landing-logo-link {
  cursor: pointer;
}

#logo .landing-logo-link:focus {
  outline: none;
}

#logo .landing-logo-link:focus-visible {
  outline: 2px solid rgba(0, 240, 255, 0.55);
  outline-offset: 6px;
  border-radius: 2px;
}

/* Drop zone — refractive energy frame */
#dropzone {
  position: relative;
  width: 100%;
  min-height: 180px;
  background: rgba(0, 0, 0, 0.2);
  border: 2px dashed rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

#dropzone:hover,
#dropzone.dragover {
  border-color: rgba(0, 240, 255, 0.5);
  background: rgba(0, 240, 255, 0.03);
  box-shadow:
    inset 0 0 60px rgba(0, 240, 255, 0.04),
    inset 0 0 30px rgba(120, 0, 255, 0.03),
    0 0 20px rgba(0, 240, 255, 0.1);
  transform: translateY(-1px);
}

#dropzone-content {
  text-align: center;
  pointer-events: none;
}

#dropzone-content p:first-of-type {
  font-family: var(--osn-font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--osn-primary-soft);
}

#drop-icon {
  font-size: 48px;
  color: var(--osn-on-surface-muted);
  margin-bottom: 12px;
  line-height: 1;
}

#dropzone-content p {
  color: var(--osn-on-surface-muted);
  font-size: 13px;
  margin: 4px 0;
}

.filetypes {
  font-family: var(--osn-font-mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--osn-primary) !important;
  margin-top: 14px !important;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

#file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ── Scan Settings: Celestial Synergy Terminal — Refractive Energy ── */
#scan-settings {
  margin-top: 16px;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  background:
    linear-gradient(135deg,
      rgba(0, 240, 255, 0.06) 0%,
      rgba(120, 0, 255, 0.04) 40%,
      rgba(255, 0, 180, 0.03) 70%,
      rgba(0, 240, 255, 0.05) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  overflow: visible;
  box-shadow:
    0 0 30px rgba(0, 240, 255, 0.08),
    0 0 60px rgba(120, 0, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 240, 255, 0.05);
}
/* Animated prismatic border shimmer */
#scan-settings::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  background: linear-gradient(
    var(--prism-angle, 0deg),
    rgba(0, 240, 255, 0.3),
    rgba(120, 0, 255, 0.2),
    rgba(255, 0, 180, 0.2),
    rgba(0, 240, 255, 0.3)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
  pointer-events: none;
  animation: prismRotate 4s linear infinite;
}
@keyframes prismRotate {
  to { --prism-angle: 360deg; }
}
@property --prism-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
/* Terminal header */
#scan-settings .scan-terminal-header {
  font-family: var(--osn-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #00f0ff, #a855f7, #ff0090, #00f0ff);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: headerShimmer 3s ease-in-out infinite;
}
@keyframes headerShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
#scan-settings .scan-terminal-header::before,
#scan-settings .scan-terminal-header::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  vertical-align: middle;
  margin: 0 10px;
}
#scan-settings .scan-terminal-header::before {
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.5), rgba(168, 85, 247, 0.3));
}
#scan-settings .scan-terminal-header::after {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.3), rgba(255, 0, 144, 0.4), transparent);
}
.scan-setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.scan-setting-row--calibrate {
  align-items: stretch;
  margin-top: 2px;
}
.scan-settings-calibrate-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.scan-settings-calibrate-wrap #calibrate-btn {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.scan-qr-png-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 10px 12px;
  font-family: var(--osn-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(0, 240, 255, 0.85);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 8px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.scan-qr-png-link:hover {
  color: #fff;
  border-color: rgba(0, 240, 255, 0.45);
  background: rgba(0, 240, 255, 0.08);
}
.scan-setting-label {
  font-family: var(--osn-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(0, 240, 255, 0.5);
  min-width: 42px;
  text-align: right;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}
.scan-pills {
  display: flex;
  gap: 3px;
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 3px;
  backdrop-filter: blur(4px);
}
.scan-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  font-family: var(--osn-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.4);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.scan-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 240, 255, 0.15);
  transform: translateY(-1px);
}
.scan-pill.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(120, 0, 255, 0.1));
  color: #fff;
  border-color: rgba(0, 240, 255, 0.4);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  box-shadow:
    0 0 12px rgba(0, 240, 255, 0.15),
    0 0 24px rgba(120, 0, 255, 0.08),
    inset 0 0 16px rgba(0, 240, 255, 0.06);
  transform: translateY(-1px);
}
/* Active pill energy ring */
.scan-pill.active::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), transparent, rgba(168, 85, 247, 0.08));
  pointer-events: none;
}
.scan-pill.active::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 7px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  animation: pillGlow 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pillGlow {
  0%, 100% { opacity: 0.4; box-shadow: 0 0 4px rgba(0, 240, 255, 0.1); }
  50% { opacity: 1; box-shadow: 0 0 12px rgba(0, 240, 255, 0.2); }
}
.scan-pill svg {
  opacity: 0.4;
  flex-shrink: 0;
  transition: all 0.25s;
  width: 15px;
  height: 15px;
}
.scan-pill:hover svg { opacity: 0.7; }
.scan-pill.active svg {
  opacity: 1;
  stroke: #00f0ff;
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.6));
}

/* ── Capture Area: Refractive Energy Panel ── */
#capture-area {
  overflow: hidden;
  margin-top: 14px;
  padding: 16px;
  background:
    linear-gradient(160deg,
      rgba(0, 240, 255, 0.04) 0%,
      rgba(120, 0, 255, 0.03) 50%,
      rgba(255, 0, 180, 0.02) 100%);
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 12px;
  position: relative;
  box-shadow:
    0 0 24px rgba(0, 240, 255, 0.06),
    0 0 48px rgba(120, 0, 255, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: opacity 0.3s ease;
}
#capture-area.show {
  display: block !important;
  animation: captureReveal 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes captureReveal {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Prismatic edge — matches scan-settings */
#capture-area::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  background: linear-gradient(
    var(--prism-angle, 0deg),
    rgba(0, 240, 255, 0.2),
    rgba(120, 0, 255, 0.15),
    rgba(255, 0, 180, 0.15),
    rgba(0, 240, 255, 0.2)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
  pointer-events: none;
  animation: prismRotate 4s linear infinite;
}

/* Scan button row (calibrate lives in #scan-settings) */
.capture-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

/* Scan button — energetic gradient */
#scan-btn,
#calibrate-btn {
  display: block;
  width: 100%;
  margin-top: 0;
  padding: 15px 24px;
  font-family: var(--osn-font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(135deg,
    rgba(0, 240, 255, 0.12) 0%,
    rgba(120, 0, 255, 0.08) 50%,
    rgba(255, 0, 180, 0.06) 100%);
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 16px rgba(0, 240, 255, 0.1),
    0 0 32px rgba(120, 0, 255, 0.05);
}
/* Shine sweep — scan button only; calibration button stays static */
#scan-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 240, 255, 0.2) 30%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(168, 85, 247, 0.2) 70%,
    transparent 100%
  );
  animation: scan-shine 2.2s ease-in-out infinite;
}
@keyframes scan-shine {
  0% { left: -100%; }
  100% { left: 200%; }
}
#scan-btn:hover,
#calibrate-btn:hover {
  background: linear-gradient(135deg,
    rgba(0, 240, 255, 0.2) 0%,
    rgba(120, 0, 255, 0.14) 50%,
    rgba(255, 0, 180, 0.1) 100%);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow:
    0 0 24px rgba(0, 240, 255, 0.2),
    0 0 48px rgba(120, 0, 255, 0.08);
  transform: translateY(-1px);
}
#scan-btn:active,
#calibrate-btn:active {
  transform: scale(0.98) translateY(0);
}

/* Scan toast warning */
.scan-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9002;
  font-family: var(--osn-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  background: rgba(14, 14, 19, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 180, 60, 0.3);
  color: #ffb43c;
  white-space: nowrap;
  transition: opacity 0.3s;
  text-shadow: 0 0 6px rgba(255, 180, 60, 0.3);
}
.scan-toast.hidden { opacity: 0; pointer-events: none; }
.scan-toast.error { border-color: rgba(255, 68, 68, 0.4); color: #ff4444; text-shadow: 0 0 6px rgba(255,68,68,0.3); }

/* ── Scan / calibrate camera overlay — Refracted Terminal ─────────── */
#scan-overlay,
#calibrate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #020205;
}
#scan-overlay.hidden,
#calibrate-overlay.hidden { display: none; }

#scan-preview,
#calibrate-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#calibrate-capture-canvas {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 4px;
  height: 4px;
  opacity: 0;
  pointer-events: none;
}

#calibrate-scanline {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, transparent 50%, rgba(110, 69, 189, 0.04) 51%);
  background-size: 100% 4px;
  pointer-events: none;
}

#calibrate-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9001;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.65) 0%, transparent 100%);
}

#calibrate-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--osn-font-mono);
}

#calibrate-dot {
  width: 8px;
  height: 8px;
  background: #00f0ff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  animation: calib-dot-pulse 1.4s ease-in-out infinite;
}
@keyframes calib-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

#calibrate-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #00f0ff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.35);
}

#calibrate-edge-readout {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
}

#calibrate-controls {
  position: fixed;
  bottom: 28px;
  left: 16px;
  right: 16px;
  z-index: 9001;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#calibrate-hint {
  font-family: var(--osn-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-align: center;
  color: rgba(209, 188, 255, 0.65);
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
  max-width: 320px;
}

.calibrate-controls-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.calibrate-show-qr-btn {
  font-family: var(--osn-font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 22px;
  background: rgba(0, 240, 255, 0.08);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.35);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.12s;
  display: inline-block;
  box-sizing: border-box;
}
.calibrate-show-qr-btn:hover {
  color: #fff;
  border-color: rgba(0, 240, 255, 0.55);
  background: rgba(0, 240, 255, 0.14);
}

#calibrate-cancel-btn {
  font-family: var(--osn-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 22px;
  background: rgba(14, 14, 19, 0.55);
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.12s;
}
#calibrate-cancel-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  background: rgba(14, 14, 19, 0.75);
}

/* Animated scanline effect over camera feed */
#scan-scanline {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 240, 255, 0.03) 51%);
  background-size: 100% 4px;
  pointer-events: none;
}

/* Top bar: REC indicator + timer + cancel */
#scan-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9001;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

#scan-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--osn-font-mono);
}

#scan-rec-dot {
  width: 8px;
  height: 8px;
  background: #ff4444;
  border-radius: 50%;
  animation: rec-pulse 1s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

#scan-rec-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #ff4444;
  text-shadow: 0 0 6px rgba(255, 68, 68, 0.4);
}

#scan-timer {
  font-family: var(--osn-font-mono);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
}

#scan-cancel-btn {
  font-family: var(--osn-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 16px;
  background: rgba(14, 14, 19, 0.5);
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.12s;
}
#scan-cancel-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  background: rgba(14, 14, 19, 0.7);
}
#scan-cancel-btn:active {
  transform: scale(0.92);
}

/* Grid wave canvas — lower center */
#scan-grid-wave {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: min(320px, 80vw);
  height: 100px;
  pointer-events: none;
  opacity: 0.6;
}

/* Bottom-right controls — thumb reach zone */
#scan-controls {
  position: fixed;
  bottom: 32px;
  right: 20px;
  z-index: 9001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#scan-hint {
  font-family: var(--osn-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 240, 255, 0.5);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
  padding: 6px 12px;
  background: rgba(14, 14, 19, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 240, 255, 0.12);
  animation: hint-fade 4s ease-in-out forwards;
}
@keyframes hint-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}

#scan-stop-btn {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 14, 19, 0.5);
  border: 2px solid;
  border-image: linear-gradient(135deg, rgba(0,240,255,0.5), rgba(209,188,255,0.5)) 1;
  color: var(--osn-primary, #00f0ff);
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.15s;
  box-shadow:
    0 0 24px rgba(0, 240, 255, 0.1),
    inset 0 0 20px rgba(0, 240, 255, 0.05);
}
#scan-stop-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow:
    0 0 32px rgba(0, 240, 255, 0.2),
    inset 0 0 24px rgba(0, 240, 255, 0.08);
}
#scan-stop-btn:active {
  transform: scale(0.9);
}

/* Pulsing red stop square */
.scan-stop-square {
  animation: stop-pulse 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(255, 68, 68, 0.6));
}
@keyframes stop-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* Edge glow: thick pulsating purple-blue-red gradient on all edges */
#scan-edge-streak {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  animation: edge-pulse 2.5s ease-in-out infinite;
  border-top: 3px solid rgba(100, 60, 220, 0.6);
  border-right: 3px solid rgba(220, 40, 80, 0.5);
  border-bottom: 3px solid rgba(220, 40, 80, 0.4);
  border-left: 3px solid rgba(100, 60, 220, 0.5);
  box-shadow:
    inset 0 80px 80px -20px rgba(80, 40, 200, 0.3),
    inset 0 -70px 80px -20px rgba(220, 40, 80, 0.2),
    inset 70px 0 80px -20px rgba(220, 40, 80, 0.2),
    inset -70px 0 80px -20px rgba(80, 40, 200, 0.2);
}
@keyframes edge-pulse {
  0%, 100% {
    box-shadow:
      inset 0 80px 80px -20px rgba(80, 40, 200, 0.3),
      inset 0 -70px 80px -20px rgba(220, 40, 80, 0.2),
      inset 70px 0 80px -20px rgba(220, 40, 80, 0.2),
      inset -70px 0 80px -20px rgba(80, 40, 200, 0.2);
    border-top-color: rgba(100, 60, 220, 0.6);
    border-right-color: rgba(220, 40, 80, 0.5);
  }
  50% {
    box-shadow:
      inset 0 110px 110px -25px rgba(80, 40, 200, 0.5),
      inset 0 -100px 110px -25px rgba(220, 40, 80, 0.4),
      inset 100px 0 110px -25px rgba(220, 40, 80, 0.35),
      inset -100px 0 110px -25px rgba(80, 40, 200, 0.35);
    border-top-color: rgba(120, 70, 240, 0.8);
    border-right-color: rgba(240, 50, 90, 0.7);
  }
}

/* Progress */
#upload-progress {
  width: 100%;
  text-align: center;
}

#progress-bar,
#progress-bar-recon {
  width: 100%;
  height: 4px;
  background: var(--osn-surface-container-high);
  border-radius: var(--osn-radius);
  overflow: hidden;
  margin-bottom: 12px;
}

#progress-fill,
#progress-fill-recon {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--osn-primary-container), var(--osn-synergy-magenta), var(--osn-primary-soft));
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35), 0 0 20px rgba(255, 0, 255, 0.12);
  border-radius: var(--osn-radius);
  transition: width 0.15s;
}

#progress-fill-recon {
  transition: width 0.3s;
}

#progress-text,
#recon-text {
  font-family: var(--osn-font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--osn-on-surface-muted);
  text-transform: uppercase;
}

/* Result */
#upload-result {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 1.5rem;
  background: rgba(23, 23, 27, 0.45);
  backdrop-filter: var(--osn-glass-blur);
  -webkit-backdrop-filter: var(--osn-glass-blur);
  border: 1px solid transparent;
  border-image: var(--osn-crystalline-edge) 1;
  border-radius: var(--osn-radius);
  box-shadow: var(--osn-synergy-panel-glow);
}

#result-filename {
  font-family: var(--osn-font-mono);
  font-size: 12px;
  color: var(--osn-on-surface-muted);
}

#link-row {
  display: flex;
  width: 100%;
  gap: 8px;
}

#result-link {
  flex: 1;
  background: var(--osn-surface-lowest);
  border: 1px solid var(--osn-outline-variant);
  border-radius: var(--osn-radius);
  padding: 10px 14px;
  color: var(--osn-on-surface);
  font-family: var(--osn-font-mono);
  font-size: 12px;
  outline: none;
}

#result-link:focus {
  border-color: rgba(255, 0, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.2);
}

#copy-btn {
  background: var(--osn-synergy-gradient);
  color: var(--osn-on-primary-container);
  border: none;
  border-radius: var(--osn-radius);
  padding: 10px 20px;
  font-family: var(--osn-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(219, 252, 255, 0.22), 0 0 18px rgba(255, 0, 255, 0.1);
}

#copy-btn:hover,
#share-btn:hover {
  filter: brightness(1.08);
}

#copy-btn.copied {
  background: linear-gradient(135deg, #00c8a0, #00f0ff);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
}

#share-btn {
  background: var(--osn-surface-container-high);
  color: var(--osn-primary-soft);
  border: 1px solid var(--osn-outline-variant);
  border-radius: var(--osn-radius);
  padding: 10px 20px;
  font-family: var(--osn-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

#share-btn:hover {
  border-color: rgba(0, 240, 255, 0.35);
  color: var(--osn-on-surface);
}

#upload-another {
  background: transparent;
  border: 1px solid var(--osn-outline-variant);
  border-radius: var(--osn-radius);
  padding: 8px 20px;
  color: var(--osn-on-surface-muted);
  font-family: var(--osn-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

#upload-another:hover {
  border-color: rgba(255, 0, 255, 0.35);
  color: var(--osn-primary-soft);
}

/* Error */
.error-msg {
  color: #f0a0a0;
  font-family: var(--osn-font-mono);
  font-size: 12px;
  text-align: center;
  border: 1px solid rgba(255, 100, 100, 0.25);
  padding: 12px;
  background: rgba(30, 14, 18, 0.6);
  border-radius: var(--osn-radius);
}

#reconstruct-progress {
  width: 100%;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* ── Embedded 3D viewer (same page as upload / recon) ───────────── */
#viewer-stage {
  position: fixed;
  inset: 0;
  z-index: 50;
}

#viewer-grid {
  position: fixed;
  inset: 0;
  z-index: 51;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

#viewer-viewport {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 50;
}

#viewer-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: var(--osn-glass-blur);
  -webkit-backdrop-filter: var(--osn-glass-blur);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 0 8px 40px rgba(10, 10, 12, 0.5), var(--osn-synergy-panel-glow);
}

#viewer-toolbar-logo {
  height: 22px;
  opacity: 0.9;
}

#viewer-logo-link {
  display: flex;
}

#viewer-filename {
  flex: 1;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--osn-on-surface-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#viewer-download-btn {
  background: var(--osn-surface-container-high);
  color: var(--osn-primary-soft);
  border: 1px solid var(--osn-outline-variant);
  border-radius: var(--osn-radius);
  padding: 8px 18px;
  font-family: var(--osn-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, filter 0.15s;
}

#viewer-download-btn:hover {
  border-color: rgba(0, 240, 255, 0.35);
  filter: brightness(1.05);
}

/* Point size slider — cosmic glass style */
#point-size-slider {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(14, 14, 19, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: 20px;
  touch-action: none;
}
#point-size-slider.hidden { display: none; }

#point-size-label {
  font-family: var(--osn-font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(0, 240, 255, 0.5);
  white-space: nowrap;
}

#point-size-range {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.2), rgba(209, 188, 255, 0.3));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#point-size-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #00f0ff 30%, rgba(0, 240, 255, 0.3) 100%);
  border: 2px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  cursor: pointer;
}
#point-size-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #00f0ff 30%, rgba(0, 240, 255, 0.3) 100%);
  border: 2px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  cursor: pointer;
}

/* Hidden for now — re-enable display when stream fallback is ready */
#viewer-stream-btn {
  display: none !important;
  position: fixed;
  bottom: 24px;
  right: 120px;
  z-index: 100;
  background: rgba(0, 229, 255, 0.08);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--osn-radius);
  padding: 12px 20px;
  font-family: var(--osn-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 12px rgba(0, 229, 255, 0.08);
  transition: background 0.15s, border-color 0.15s;
}

#viewer-stream-btn:hover {
  background: rgba(0, 229, 255, 0.16);
  border-color: rgba(0, 229, 255, 0.4);
}

#viewer-embed-btn {
  position: fixed;
  bottom: 24px;
  right: 110px;
  z-index: 100;
  background: rgba(19, 19, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--osn-on-surface);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--osn-radius);
  padding: 12px 24px;
  font-family: var(--osn-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
#viewer-embed-btn:hover {
  border-color: rgba(0, 240, 255, 0.4);
  color: #dbfcff;
}

/* Embed modal */
#viewer-embed-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}
#viewer-embed-modal.hidden { display: none; }
#viewer-embed-card {
  background: rgba(19, 19, 24, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 12px;
  padding: 28px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 560px; width: 90%;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
}
#viewer-embed-title {
  font-family: var(--osn-font-mono);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #dbfcff;
}
#viewer-embed-sub {
  font-family: var(--osn-font-mono);
  font-size: 10px; color: #849495;
  letter-spacing: 0.08em;
}
#viewer-embed-code {
  width: 100%; padding: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 8px;
  font-family: var(--osn-font-mono);
  font-size: 11px; color: #00f0ff;
  white-space: pre-wrap; word-break: break-all;
  line-height: 1.5; margin: 0;
  max-height: 200px; overflow-y: auto;
}
#viewer-embed-copy, #viewer-embed-close {
  padding: 8px 24px;
  border-radius: var(--osn-radius);
  font-family: var(--osn-font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; cursor: pointer;
  transition: background 0.12s;
}
#viewer-embed-copy {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #dbfcff;
}
#viewer-embed-copy:hover { background: rgba(0, 240, 255, 0.25); }
#viewer-embed-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #849495;
}
#viewer-embed-close:hover { background: rgba(255, 255, 255, 0.05); }

#viewer-share-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: var(--osn-synergy-gradient);
  color: var(--osn-on-primary-container);
  border: none;
  border-radius: var(--osn-radius);
  padding: 12px 24px;
  font-family: var(--osn-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(255, 0, 255, 0.12),
    inset 0 0 0 1px rgba(219, 252, 255, 0.22);
  transition: filter 0.15s;
}

#viewer-share-btn:hover {
  filter: brightness(1.08);
}

/* Share pop-up menu */
#viewer-share-menu {
  position: fixed;
  bottom: 72px;
  right: 24px;
  z-index: 101;
  display: none;
  flex-direction: column;
  gap: 4px;
  background: rgba(19, 19, 24, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: var(--osn-radius);
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
#viewer-share-menu.open { display: flex; }
#viewer-share-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--osn-on-surface);
  font-family: var(--osn-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}
#viewer-share-menu button:hover {
  background: rgba(0, 240, 255, 0.06);
  color: #dbfcff;
}

/* QR modal */
#viewer-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}
#viewer-qr-modal.hidden { display: none; }
#viewer-qr-card {
  background: rgba(19, 19, 24, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 12px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
}
#viewer-qr-title {
  font-family: var(--osn-font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dbfcff;
}
#viewer-qr-sub {
  font-family: var(--osn-font-mono);
  font-size: 10px;
  color: #849495;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
#viewer-qr-img {
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
#viewer-qr-link {
  font-family: var(--osn-font-mono);
  font-size: 10px;
  color: #00f0ff;
  word-break: break-all;
  max-width: 260px;
  text-align: center;
  margin-top: 4px;
}
#viewer-qr-close {
  margin-top: 12px;
  padding: 8px 24px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--osn-radius);
  color: #dbfcff;
  font-family: var(--osn-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.12s;
}
#viewer-qr-close:hover { background: rgba(0, 240, 255, 0.15); }

#viewer-share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(23, 23, 27, 0.92);
  backdrop-filter: var(--osn-glass-blur);
  -webkit-backdrop-filter: var(--osn-glass-blur);
  color: var(--osn-primary-soft);
  border: 1px solid transparent;
  border-image: var(--osn-crystalline-edge) 1;
  font-family: var(--osn-font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 10px 22px;
  border-radius: var(--osn-radius);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  box-shadow: var(--osn-synergy-panel-glow);
}

#viewer-share-toast.visible {
  opacity: 1;
}

#viewer-loading {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--osn-celestial-bg);
}

#viewer-loading.hidden {
  display: none;
}

#viewer-logo-loading {
  position: relative;
  overflow: hidden;
  animation: viewer-logo-pulse 2.5s ease-in-out infinite;
}

#viewer-logo-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 240, 255, 0.15) 40%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(209, 188, 255, 0.15) 60%,
    transparent 100%
  );
  animation: viewer-logo-shine 2.5s ease-in-out infinite;
}

@keyframes viewer-logo-shine {
  0% { left: -100%; }
  100% { left: 200%; }
}

@keyframes viewer-logo-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

#viewer-loading-text {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--osn-on-surface-muted);
}

#viewer-error-screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--osn-celestial-bg);
  padding: 24px;
}

#viewer-error-screen.hidden {
  display: none;
}

#viewer-error-text {
  color: #f0a0a0;
  font-size: 14px;
  text-align: center;
  max-width: 360px;
}

#viewer-back-upload {
  background: var(--osn-surface-container-high);
  color: var(--osn-primary-soft);
  border: 1px solid var(--osn-outline-variant);
  border-radius: var(--osn-radius);
  padding: 10px 22px;
  font-family: var(--osn-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

#viewer-back-upload:hover {
  border-color: rgba(0, 240, 255, 0.35);
}
