:root { --bg: #fbfbfa; --fg: #1c1d1f; --muted: #5b5f66; --line: #d9dbde; --accent: #1f5fbf;
  --on-accent: #fff; --card: #fff; --code: #eef0f2; --warn: #9a3d00; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #141518; --fg: #e8e9eb; --muted: #a2a6ad; --line: #34373d; --accent: #7fb0ff;
    --on-accent: #0b1a33; --card: #1b1d21; --code: #24272c; --warn: #ffb07a; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 16px; }
header.wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap; padding-top: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 650; font-size: 1.1rem; }
nav a, a { color: var(--accent); }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 2.5rem 0 1rem; text-wrap: balance; }
h2 { font-size: 1.1rem; margin: 2rem 0 .5rem; }
.lead { color: var(--muted); font-size: 1.1rem; }
ul { padding-left: 1.2rem; } li { margin: .4rem 0; }
section + section { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
footer.wrap { margin-top: 4rem; padding-bottom: 2rem; color: var(--muted); font-size: .9rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- forms, cards, admin ---------------------------------------------------- */
.muted, .hint { color: var(--muted); font-weight: 400; }
.hint { font-size: .85rem; }
.home { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.form { display: grid; gap: 1rem; margin: 1.5rem 0; }
.form label { display: grid; gap: .35rem; font-weight: 550; }
.form .check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: .35rem; width: 1.1rem; height: 1.1rem; flex: none; }
input, textarea, select, button { font: inherit; color: inherit; }
input:not([type=checkbox]), textarea, select {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); }
textarea { resize: vertical; }
button { padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; }
.form button[type=submit], button.primary { background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); font-weight: 600; justify-self: start; }
button:disabled { opacity: .6; cursor: progress; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.msg { min-height: 1.6em; margin: 0; color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; background: var(--card);
  margin: 1.5rem 0; }
code { font: .95em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere;
  background: var(--code); padding: .1em .35em; border-radius: 4px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; } dd { margin: 0; }
.warn { color: var(--warn); }
.wrap.wide { max-width: 72rem; }
.narrow { max-width: 24rem; }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.toolbar label { display: grid; gap: .3rem; font-size: .9rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--card); white-space: nowrap; }
td:nth-child(4) { min-width: 18rem; }
td button { margin: 0 .3rem .3rem 0; }
