:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #1c2430; --muted: #5d6b7c; --line: #d9dee5;
  --accent: #1f5fbf; --accent-text: #ffffff; --danger: #b3261e; --ok: #1e7a45; --warn: #9a6200;
  --field: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c; --surface: #1a2029; --text: #e6ebf2; --muted: #9aa8b9; --line: #2b3441;
    --accent: #6ea2ff; --accent-text: #0b1220; --danger: #ff8a80; --ok: #65d391; --warn: #f0b95a; --field: #121820;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 12px; align-items: center; }
header.top h1 { font-size: 16px; margin: 0; flex: 1; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
section.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 12px 0; }
label { display: block; font-weight: 600; margin: 10px 0 4px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 0 14px 0 0; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit;
}
textarea { min-height: 80px; resize: vertical; }
button, .button {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent);
  color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 8px 0; white-space: pre-wrap; }
.ok { color: var(--ok); }
.notice { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid var(--warn); border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.lines input, table.lines select { padding: 5px 6px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; }
.badge.draft { color: var(--muted); } .badge.submitted { color: var(--accent); border-color: var(--accent); }
.badge.accepted { color: var(--warn); border-color: var(--warn); } .badge.learned { color: var(--ok); border-color: var(--ok); }
.badge.deleted { color: var(--muted); text-decoration: line-through; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.progress > div { height: 100%; width: 0; background: var(--accent); }
.terms { max-height: 340px; overflow: auto; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: var(--field); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.narrow { max-width: 420px; margin: 48px auto; }
.scroll-x { overflow-x: auto; }
pre.json { background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow: auto; max-height: 360px; }
@media (max-width: 640px) { main { padding: 10px; } }
