:root {
  --primary: #621397; --hover: #4D0F77; --on-dark: #CA98FD; --accent: #BC6F38; --accent-soft: #E0A877;
  --bg: #FAF8FC; --card: #FFFFFF; --text: #1E1528; --muted: #6B6275; --line: #E7E1EE;
  --ok: #1E7B4F; --warn: #9A5B14; --bad: #A12A2A;
  --font: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
header { background: var(--primary); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header h1 { font-size: 18px; margin: 0; font-weight: 600; }
header .who { font-size: 13px; color: var(--on-dark); }
header a { color: #fff; }
nav { display: flex; gap: 4px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; overflow-x: auto; z-index: 2; }
nav button { flex: none; border: 0; background: none; font: inherit; font-size: 15px; padding: 8px 12px; border-radius: 8px; color: var(--muted); cursor: pointer; }
nav button.on { background: #F1E8F8; color: var(--primary); font-weight: 600; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; text-align: center; }
main { max-width: 880px; margin: 0 auto; padding: 16px 12px 64px; }
h2 { font-size: 17px; margin: 20px 4px 8px; font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.title { font-weight: 500; }
.title a { color: var(--text); text-decoration: none; }
.title a:hover { color: var(--primary); text-decoration: underline; }
.meta { color: var(--muted); font-size: 13px; }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #F1E8F8; color: var(--hover); margin: 4px 4px 0 0; }
.chip.client { background: #FBF0E6; color: #7A4520; }
.empty { color: var(--muted); padding: 8px 4px; }
.md { font-size: 15px; overflow-wrap: anywhere; }
.md table { border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
.md pre, pre.json { background: #F6F3F9; border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 13px; white-space: pre-wrap; }
.action { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 10px; }
.action label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.action input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--primary); }
.tool { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
button.btn, a.btn { display: inline-block; text-decoration: none; font: inherit; font-size: 15px; border-radius: 8px; padding: 9px 14px; cursor: pointer; border: 1px solid var(--primary); background: var(--primary); color: #fff; }
button.btn:hover { background: var(--hover); }
button.btn.ghost { background: #fff; color: var(--primary); }
button.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button.btn:disabled { opacity: .5; cursor: default; }
form .f { margin-bottom: 14px; }
form label { display: block; font-weight: 500; margin-bottom: 4px; }
input[type=text], input[type=date], select, textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
textarea { min-height: 140px; }
.err { color: var(--bad); font-size: 14px; margin-top: 4px; }
.note { font-size: 14px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat .n { font-size: 24px; font-weight: 600; }
.stat .l { font-size: 13px; color: var(--muted); }
table.runs { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border-radius: 12px; overflow: hidden; }
table.runs th, table.runs td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.runs th { font-weight: 500; color: var(--muted); font-size: 13px; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.ok { color: var(--ok); } .bad { color: var(--bad); }
.toast { position: sticky; bottom: 12px; margin: 12px auto 0; max-width: 880px; background: var(--text); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.center { text-align: center; padding: 64px 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (min-width: 700px) { main { padding-top: 24px; } }
a.task { display: block; color: inherit; text-decoration: none; }
a.task:hover .title { color: var(--primary); text-decoration: underline; }
.chip.high { background: #FBE7E7; color: var(--bad); }
.chip.status { background: #EEF0F3; color: #3A4250; }
.ev { border-left: 3px solid var(--line); padding: 6px 0 6px 12px; margin: 0 0 10px 4px; }
.ev.owner { border-left-color: var(--primary); }
.ev.agent { border-left-color: var(--accent); }
.ev .who { font-size: 13px; color: var(--muted); }
.ev.small { font-size: 14px; color: var(--muted); }
.back { font: inherit; border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0; margin: 0 0 8px; }
.hash { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline select { width: auto; }
.hidden { display: none; }
