:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #5b6168;
  --line: #d9dcdf;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --error: #b42318;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --card: #1a1f25;
    --text: #e6e8ea;
    --muted: #a0a7af;
    --line: #333a42;
    --accent: #4c8dff;
    --accent-text: #0b0e11;
    --error: #ff7b72;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 28rem;
  margin: 3rem auto;
  padding: 1.5rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

@media (max-width: 30rem) {
  main { margin: 1rem; }
}

h1 { font-size: 1.1rem; margin: 0 0 0.5rem; color: var(--muted); }
h2 { font-size: 1.3rem; margin: 0 0 1rem; }

#status { min-height: 1.5em; margin: 0 0 1rem; color: var(--muted); }
#status.error { color: var(--error); }

label { display: block; margin: 0.75rem 0 0.25rem; font-weight: 600; }

input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

button {
  font: inherit;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.link { border: none; padding: 0; color: var(--accent); text-decoration: underline; }
form button { margin-top: 1.25rem; width: 100%; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0 0 1rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

.hint { font-size: 0.9rem; color: var(--muted); }
.actions { display: flex; gap: 0.75rem; margin: 1rem 0; }
.actions button { flex: 1; }
