:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1c2330;
  --muted: #5b6472;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --line: #dde2ea;
  --ok-bg: #e6f6ec;  --ok-ink: #17663a;
  --err-bg: #fdeaea; --err-ink: #8f1f1f;
  --code-bg: #eef1f5;
  --input-bg: #ffffff;
  font-size: 16px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1.4rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
header.top nav { display: flex; gap: 1rem; align-items: center; }
header.top a { color: var(--muted); text-decoration: none; }
header.top a:hover { color: var(--ink); }
.admin-link { font-weight: 600; color: var(--accent) !important; }

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 2rem 1.2rem; }
footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 1.2rem; }

main a { color: var(--accent); }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 0.6rem; }
p, li { line-height: 1.55; }
.muted { color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}

label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

.addr-row { display: flex; align-items: center; gap: 0.4rem; }
.addr-row input { flex: 1; }
.addr-suffix { font-weight: 600; color: var(--muted); white-space: nowrap; }

button, .btn {
  display: inline-block;
  margin-top: 1.1rem;
  padding: 0.6rem 1.3rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1rem; font-weight: 600;
  border: 0; border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button.linklike {
  background: none; color: var(--muted); font-weight: 400;
  padding: 0; margin: 0; border-radius: 0;
}
button.linklike:hover { color: var(--ink); filter: none; }
form.inline { display: inline; }

.flash { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1.2rem; }
.flash-ok  { background: var(--ok-bg);  color: var(--ok-ink); }
.flash-err { background: var(--err-bg); color: var(--err-ink); }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
code, .mono { font-family: ui-monospace, Consolas, monospace; background: var(--code-bg); padding: 0.1rem 0.35rem; border-radius: 4px; }

.honeypot { position: absolute; left: -9999px; }

.limit-form { display: flex; align-items: center; gap: 0.4rem; }
.limit-form input[type=number] { width: 4.5rem; padding: 0.3rem 0.4rem; }

/* Destructive actions */
button.danger { background: #b3261e; }
.danger-link { color: #b3261e !important; }
.btn-quiet {
  display: inline-block; margin: 1.1rem 0 0 0.8rem;
  color: var(--muted); text-decoration: none; font-weight: 600;
}
.btn-quiet:hover { color: var(--ink); }

/* Theme picker on the admin settings page */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; margin-top: 0.6rem; }
.theme-option {
  display: flex; align-items: center; gap: 0.6rem;
  border: 2px solid var(--line); border-radius: 10px;
  padding: 0.7rem 0.8rem; cursor: pointer; font-weight: 600;
}
.theme-option:has(input:checked) { border-color: var(--accent); }
.theme-option input { accent-color: var(--accent); }
.swatches { display: inline-flex; }
.swatch {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.25); margin-left: -5px;
}
.swatch:first-child { margin-left: 0; }
