:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #5f6671;
  --border: #d8dce2;
  --accent: #2f6fde;
  --accent-text: #ffffff;
  --error: #c62828;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card: #1d2026;
    --text: #e8eaed;
    --muted: #9aa1ab;
    --border: #353a43;
    --accent: #5b8ff0;
    --accent-text: #0d1117;
    --error: #ef7b7b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem 2rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  width: 100%;
  max-width: 40rem;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

h1 { margin: 0 0 0.25rem; font-size: 1.6rem; }
h1 a { color: inherit; text-decoration: none; }
.lead { margin: 0 0 1.5rem; color: var(--muted); }
.hint { margin: 0.75rem 0; color: var(--muted); font-size: 0.9rem; }
.error { color: var(--error); margin: 0.75rem 0 0; }
.size { margin: 0.35rem 0 0; text-align: right; font-size: 0.8rem; }
.size.error { color: var(--error); }

label { display: block; margin-bottom: 0.4rem; font-weight: 600; }

textarea, input, select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
textarea { resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9rem; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0 1.25rem; }
.options label { font-weight: 400; color: var(--muted); }
.options select { margin-top: 0.3rem; }

.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85rem; }

button, .button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
#revealed button { margin-top: 0.75rem; }
button:disabled { opacity: 0.6; cursor: wait; }
.secondary { color: var(--accent); background: transparent; }

footer {
  max-width: 40rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 480px) {
  body { padding-top: 1rem; }
  main { padding: 1.25rem; }
  .options { grid-template-columns: 1fr; }
}
