:root {
  color-scheme: light dark;
  --bg: #f5f5f5;
  --text: #242424;
  --muted: #616161;
  --accent: #5b5fc7;
  --track: #d1d1d1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1f1f;
    --text: #f5f5f5;
    --muted: #adadad;
    --accent: #7f85f5;
    --track: #424242;
  }
}

* { box-sizing: border-box; }

html, body, main { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
}

main { position: relative; }

#report { position: absolute; inset: 0; }

#report iframe { border: 0; }

#status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
  background: var(--bg);
}

#status[hidden], #spinner[hidden], #retry[hidden] { display: none; }

#status h1 { margin: 8px 0 0; font-size: 20px; font-weight: 600; }

#status p { margin: 0; max-width: 44ch; color: var(--muted); line-height: 1.5; }

#spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--track);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

#retry {
  margin-top: 12px;
  padding: 8px 16px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#retry:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  #spinner { animation-duration: 3s; }
}
