:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --card: #171a21;
  --text: #e6e8ec;
  --muted: #9aa2af;
  --accent: #5b8def;
  --error: #e5484d;
  --ok: #3fb950;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #1a1d23;
    --muted: #5c6470;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 16px;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

h1 { font-size: 1.3rem; margin: 0 0 12px; word-break: break-word; }

.hint { color: var(--muted); font-size: 0.9rem; line-height: 1.4; }

.field {
  display: block;
  margin: 16px 0;
}

.field span { display: block; margin-bottom: 6px; font-size: 0.9rem; }

.field input[type="file"],
.field select {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--muted);
  background: transparent;
  color: var(--text);
}

.field.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field.checkbox input { width: auto; }
.field.checkbox span { margin: 0; }

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }

.error {
  color: var(--error);
  margin-top: 16px;
  font-size: 0.9rem;
}

.ok { color: var(--ok); font-weight: 600; }

.downloads {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.downloads a {
  color: var(--accent);
  text-decoration: none;
  padding: 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  text-align: center;
}

.spinner {
  margin-top: 16px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--muted);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.back { margin-top: 20px; }
.back a { color: var(--muted); font-size: 0.85rem; }
