:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #1c2330; --muted: #667085; --line: #e3e6ea;
  --accent: #2563eb; --accent-soft: #e8efff; --high: #c2410c; --med: #a16207; --low: #4d7c0f;
  --agent: #7c3aed; --radius: 8px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --panel: #1a1f26; --ink: #e6e9ee; --muted: #98a2b3; --line: #2c333d;
    --accent: #6b9cff; --accent-soft: #1d2a44; --high: #fb923c; --med: #facc15; --low: #a3e635; --agent: #b794f6;
    color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 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 0 6px; } h2 { font-size: 14px; margin: 22px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .error { color: var(--high); }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-width: 0; }
textarea { width: 100%; resize: vertical; }
button { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { background: none; border: none; padding: 0; color: var(--muted); }
button.link:hover { color: var(--ink); }

header.top { display: flex; align-items: center; gap: 18px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 650; color: var(--ink); }
header nav { display: flex; gap: 14px; flex: 1; overflow-x: auto; }
header nav a { color: var(--muted); white-space: nowrap; } header nav a[aria-current] { color: var(--ink); font-weight: 600; }
main { padding: 14px 16px 40px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.quick { display: flex; gap: 6px; flex: 1 1 420px; } .quick input { flex: 1; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 8px; }
.col { background: color-mix(in srgb, var(--line) 35%, transparent); border-radius: var(--radius); padding: 8px; min-height: 120px; }
.col.proposed { outline: 2px dashed var(--agent); outline-offset: -2px; }
.col h2 { margin: 2px 4px 8px; font-size: 13px; display: flex; justify-content: space-between; }
.count { color: var(--muted); font-weight: 400; }
ol.cards { list-style: none; margin: 0; padding: 0; min-height: 40px; display: flex; flex-direction: column; gap: 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; cursor: grab; }
.card.high { border-left: 3px solid var(--high); }
.card .title { color: var(--ink); display: block; overflow-wrap: anywhere; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 11.5px; color: var(--muted); align-items: center; }
.who { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 0 6px; font-weight: 600; }
.prio.high { color: var(--high); } .prio.medium { color: var(--med); } .prio.low { color: var(--low); }
.tag { border: 1px solid var(--line); border-radius: 10px; padding: 0 6px; }
.agent { color: var(--agent); }
.ghost { opacity: .4; }

.task { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; max-width: 1180px; }
.task-side { border-left: 1px solid var(--line); padding-left: 22px; }
.crumb { margin: 0 0 4px; font-size: 12px; }
.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--accent-soft); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }
.banner pre { white-space: pre-wrap; word-break: break-all; background: var(--panel); padding: 8px; border-radius: 6px; font-size: 12px; }
.md { overflow-wrap: anywhere; } .md p { margin: 0 0 8px; } .md pre { overflow-x: auto; background: var(--panel); padding: 8px; border-radius: 6px; }
.md table { border-collapse: collapse; } .md td, .md th { border: 1px solid var(--line); padding: 3px 6px; }
.md li.todo { list-style: none; margin-left: -1.3em; } .md li.todo input { margin: 0 6px 0 0; vertical-align: -1px; cursor: pointer; }
.card .n.done { color: var(--low); }
.comment { border-top: 1px solid var(--line); padding: 8px 0; }
.stack { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; align-items: flex-start; }
.stack input, .stack textarea { width: 100%; }
.row { display: flex; gap: 6px; width: 100%; } .row input { flex: 1; }
.fields label { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.fields button { margin-top: 4px; }
details.edit { margin-top: 24px; } details.edit summary { cursor: pointer; color: var(--muted); }
.pill { font-size: 11px; border: 1px solid var(--line); border-radius: 10px; padding: 0 6px; color: var(--muted); }
ul.plain, ul.evidence, ol.history { list-style: none; padding: 0; margin: 0; }
ul.evidence li { padding: 4px 0; overflow-wrap: anywhere; } ul.evidence img { display: block; max-width: 100%; border-radius: 6px; margin: 4px 0; }
ol.history li { font-size: 12px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.small-form { font-size: 13px; }
ol.sessions { padding-left: 20px; margin: 0; } ol.sessions li { padding: 4px 0; overflow-wrap: anywhere; }
ol.sessions code { font-size: 11.5px; }

.narrow { max-width: 560px; margin: 0 auto; }
.card-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 8vh; display: flex; flex-direction: column; gap: 10px; }
.card-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); }
table.list td { padding: 6px 10px; border-bottom: 1px solid var(--line); }

@media (max-width: 760px) {
  .board { grid-auto-flow: row; grid-auto-columns: auto; }
  .task { grid-template-columns: 1fr; }
  .task-side { border-left: none; padding-left: 0; border-top: 1px solid var(--line); }
  .quick { flex-wrap: wrap; } .quick input { flex-basis: 100%; }
}
.job { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; margin-bottom: 6px; font-size: 13px; }
.job.running { border-color: var(--accent); } .job.failed { border-color: var(--high); }
.narrow.wide { max-width: 860px; }
.card .flag { color: var(--high); font-weight: 600; }
pre.digest-text { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 12px; }
.card button.accept { margin-top: 6px; padding: 2px 10px; font-size: 12px; border-color: var(--agent); color: var(--agent); }
.num { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
a.button.primary { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.button.google { display: block; text-align: center; padding: 10px; border-radius: var(--radius); text-decoration: none; }
.or { text-align: center; margin: 4px 0; }
.side-actions { display: flex; gap: 8px; margin: 6px 0 18px; }
.side-actions button { flex: 1; }
button.archive { background: none; border-color: var(--muted); color: var(--muted); }
button.archive:hover { border-color: var(--ink); color: var(--ink); }
