:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1d1c1a;
  --muted: #6f6b64;
  --line: #e2dfd8;
  --accent: #c2410c;
  --accent-text: #ffffff;
  --bad: #dc2626;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #161514;
    --surface: #1e1d1b;
    --text: #ece9e3;
    --muted: #9a958c;
    --line: #2d2b28;
    --accent: #f97316;
    --accent-text: #161514;
    --bad: #f87171;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10vh 16px 32px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: 22px;
}

.lead,
.note,
.version {
  margin: 0;
  color: var(--muted);
}

.version {
  font-weight: 600;
  color: var(--text);
}

form,
#downloads,
.files {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

form[hidden],
section[hidden],
p[hidden] {
  display: none;
}

input,
button {
  font: inherit;
  color: inherit;
  border-radius: 8px;
}

input {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 10px 12px;
}

button {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
}

button:hover {
  border-color: var(--muted);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

button.link {
  align-self: flex-start;
  border: none;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  background: none;
}

a {
  color: var(--accent);
}

.error {
  margin: 0;
  color: var(--bad);
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

ol {
  margin: 8px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

pre,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

pre {
  margin: 6px 0 0;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-all;
}
