:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: #d1d5db;
  --soft: #f3f4f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --fg: #f3f4f6;
    --muted: #9ca3af;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --border: #374151;
    --soft: #1f2937;
  }
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
  padding: 2rem 1rem;
}

main {
  max-width: 720px;
  margin: 0 auto;
}

h1 { font-size: 2rem; margin-bottom: .25rem; }
.lead { color: var(--muted); margin-top: 0; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--soft);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.dropzone input { display: none; }

.access-label {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .35rem;
}

.access-input {
  width: 100%;
  padding: .6rem .8rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  margin-bottom: .9rem;
}

.access-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

button, .btn {
  display: inline-block;
  margin-top: 1rem;
  padding: .75rem 1.25rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  cursor: pointer;
}

button:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

button:not(:disabled):hover, .btn:hover { background: var(--accent-hover); }

.btn-secondary {
  display: inline-block;
  margin-top: .5rem;
  padding: .5rem 1rem;
  font-size: .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.btn-secondary:hover { color: var(--fg); border-color: var(--muted); }

.file-name { min-height: 1.5rem; color: var(--muted); }

.privacy-notice {
  font-size: .9rem;
  color: var(--muted);
  margin-top: 1rem;
}

.limits { font-size: .85rem; color: var(--muted); }

.hidden { display: none !important; }

#waiting-section { text-align: center; padding: 2rem 0; }

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.capacity-panel {
  background: #fff7ed;
  border-left: 4px solid #f59e0b;
  color: #7c2d12;
  padding: 1rem;
  margin-top: 1rem;
  text-align: left;
  border-radius: 6px;
}

@media (prefers-color-scheme: dark) {
  .capacity-panel { background: #271a0b; color: #fdba74; }
}

#report-actions { margin-bottom: 1rem; }
#report-actions .btn { margin-right: .5rem; }

#report-frame-container {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-height: 400px;
}

#report-frame {
  width: 100%;
  min-height: 400px;
  border: none;
}

#how-it-works { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
#how-it-works h2 { font-size: 1.4rem; }
#how-it-works h3 { font-size: 1.1rem; margin-top: 1.5rem; }
