:root {
  --bg: #fafaf9; --panel: #ffffff; --text: #1c1917; --muted: #78716c; --line: #e7e5e4;
  --accent: #4f46e5; --accent-soft: #eef2ff; --ok: #15803d; --warn: #b45309; --err: #b91c1c;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c0a09; --panel: #1c1917; --text: #f5f5f4; --muted: #a8a29e; --line: #292524;
          --accent: #818cf8; --accent-soft: #1e1b4b; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header { display: flex; align-items: center; gap: 20px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; }
header .brand { font-weight: 700; font-size: 16px; }
header nav { display: flex; gap: 16px; flex: 1; }
main { max-width: 1080px; margin: 0 auto; padding: 28px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, textarea, select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); font: inherit; }
textarea { min-height: 110px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
textarea.brief { font-family: inherit; font-size: 14px; }
button { padding: 8px 14px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button:disabled { opacity: .5; cursor: default; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.done { background: #dcfce7; color: var(--ok); }
.badge.error { background: #fee2e2; color: var(--err); }
.badge.queued, .badge.writing { background: #fef3c7; color: var(--warn); }
.module-title { font-weight: 600; padding-top: 14px; }
.note { line-height: 1.6; }
.note pre { background: var(--bg); border: 1px solid var(--line); padding: 10px; border-radius: 7px; overflow-x: auto; }
.note code { font-size: 13px; }
.note blockquote { border-left: 3px solid var(--accent); margin: 0; padding: 2px 14px; color: var(--muted); }
.note table td, .note table th { border: 1px solid var(--line); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 9; max-width: 420px; }
.token { font-family: ui-monospace, Menlo, monospace; padding: 10px; background: var(--accent-soft); border-radius: 7px; word-break: break-all; }
.login { max-width: 380px; margin: 12vh auto; }
.pins { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; }
.pins label { display: flex; gap: 8px; align-items: center; color: var(--text); margin: 4px 0; }
.pins input { width: auto; }
.stat { font-size: 22px; font-weight: 700; }
