:root {
  --bg: #f6f7f9; --card: #fff; --text: #1a1d21; --muted: #6b7280; --line: #e5e7eb;
  --accent: #4f46e5; --accent-soft: rgba(79, 70, 229, .12);
  --ok: #047857; --ok-bg: #ecfdf5; --warn: #92400e; --warn-bg: #fffbeb; --err: #b91c1c; --err-bg: #fef2f2;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --card: #171a21; --text: #e6e8eb; --muted: #9aa3af; --line: #272b34;
    --accent: #818cf8; --accent-soft: rgba(129, 140, 248, .16);
    --ok: #34d399; --ok-bg: #0b2a20; --warn: #fbbf24; --warn-bg: #2b2210; --err: #f87171; --err-bg: #2d1414;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0; }
code, .mono, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 700; color: var(--text); }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); }
.top nav a.on, .top nav a:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
main { max-width: 1200px; margin: 0 auto; padding: 24px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; margin-bottom: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; }
.scroll { overflow-x: auto; }
.empty { color: var(--muted); margin: 8px 0; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; }
.chips a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips a:hover { text-decoration: none; border-color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--muted); font-weight: 500; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.alert { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.err { background: var(--err-bg); color: var(--err); }
select { display: block; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
details summary { cursor: pointer; margin: 8px 0; }
.form label, .field { display: block; margin-bottom: 12px; font-weight: 500; }
input, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; opacity: .9; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn.danger { background: var(--err); border-color: var(--err); }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.login { width: min(360px, calc(100vw - 32px)); }
.login h1 { margin-bottom: 16px; }
.login label { display: block; margin-bottom: 12px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin: 0; }
textarea { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
textarea { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
main { max-width: 1500px; }
.add summary { margin: 0; }
.add[open] summary { margin-bottom: 12px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; }
.col { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 120px; }
.col h2 { display: flex; justify-content: space-between; margin-bottom: 10px; }
.col-in_progress { border-top: 3px solid var(--accent); }
.col-done .task { opacity: .7; }
.task { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--bg); scroll-margin-top: 80px; }
.task:target { outline: 2px solid var(--accent); }
.task-title { display: block; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.task-body { margin: 4px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.task-actions { display: flex; gap: 4px; margin-top: 8px; }
.task-actions form { margin: 0; }
button.icon { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 6px; padding: 2px 9px; cursor: pointer; font: inherit; }
button.icon:hover { background: var(--accent-soft); }
.badge.claude { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 720px) { .board { grid-template-columns: 1fr; } main { padding: 16px; } }
body.center { display: grid; place-items: center; min-height: 100vh; }
.card.danger { border-color: var(--err-bg); }
.side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.doc { min-width: 0; }
.doc-title { font-size: 20px; margin: 0 0 12px; }
.md { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.md img { max-width: 100%; height: auto; border-radius: 6px; }
.md h1, .md h2, .md h3 { margin: 1.2em 0 .4em; font-size: 17px; }
.md blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.md pre { overflow-x: auto; }
.num { text-align: right; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; }
.row input[type=search] { min-width: 240px; }
@media (max-width: 900px) { .side { grid-template-columns: 1fr; } }
.single { max-width: 820px; margin: 0 auto; }
.toggle-es { display: flex; justify-content: flex-end; margin-bottom: 12px; }
