:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --fg: #1d2321;
  --muted: #5b6460;
  --line: #dfe3df;
  --accent: #1f7a5c;
  --accent-ink: #ffffff;
  --error: #b42318;
  --error-bg: #fdecea;
  --notice-bg: #e6f4ee;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151917; --surface: #1d2320; --fg: #e9ece9; --muted: #a3aca7; --line: #2f3833;
    --accent: #5cc49b; --accent-ink: #0d1f17; --error: #ff8a80; --error-bg: #3a1d1b; --notice-bg: #183328;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-underline-offset: 0.15em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--line); padding: 0.05em 0.3em; border-radius: 4px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--fg); text-decoration: none; }
.mark { width: 1.5rem; height: 1.5rem; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 0.95rem; }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }

.page { flex: 1; width: 100%; max-width: 44rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; margin: 0 0 0.6rem; }
.hero { padding-top: 10vh; }
.hero h1 { font-size: clamp(2rem, 7vw, 2.75rem); }
.lede { font-size: 1.2rem; }
.muted, .hint, .crumb { color: var(--muted); }
.hint { font-size: 0.9rem; margin: 0; }

.button {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 8px; padding: 0.75rem 1.2rem;
  font: 600 1rem/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.08); }

.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; margin: 1rem 0; }
.stack label { font-weight: 600; }
.stack button { margin-top: 0.5rem; }
input[type=email], input[type=text], input:not([type]), input[type=file] {
  width: 100%; max-width: 26rem; font: inherit; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.75rem;
}
input[aria-invalid=true] { border-color: var(--error); }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400 !important; }
.slug-field { display: flex; align-items: center; width: 100%; max-width: 26rem; }
.slug-field input { flex: 1; min-width: 0; border-radius: 8px 0 0 8px; }
.suffix {
  padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0;
  background: var(--line); color: var(--muted); white-space: nowrap;
}

.notice { background: var(--notice-bg); border-radius: 8px; padding: 0.75rem 1rem; }
.error { color: var(--error); margin: 0; }
.problems { background: var(--error-bg); border-radius: 8px; padding: 0.75rem 1rem; margin: 1rem 0; }
.problems p { margin: 0 0 0.25rem; }
.problems ul { margin: 0; padding-left: 1.2rem; overflow-wrap: anywhere; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; margin: 1.5rem 0; }
.cards { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.25rem; }
.card h2 { margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.card p { margin: 0; color: var(--muted); }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--line); color: var(--fg); }
.badge.live { background: var(--notice-bg); color: var(--accent); }

.rules summary { cursor: pointer; font-weight: 600; }
.rules ul { padding-left: 1.2rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.table th { color: var(--muted); font-weight: 600; }

.footer { padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: 0.875rem; }
.footer p { margin: 0; }
