:root {
  --bg: #f4f5f3; --surface: #ffffff; --sunk: #eceeeb; --text: #1a201e; --muted: #626b68; --line: #d9ddda;
  --accent: #1f47c6; --accent-soft: #e4e9fb; --on-accent: #ffffff;
  --todo: #6d5bd0; --todo-soft: #ece9fb;
  --doing: #1f47c6; --doing-soft: #e4e9fb;
  --review: #a35a00; --review-soft: #fbefdc;
  --done: #17803d; --done-soft: #e0f2e6;
  --dropped: #6f7774; --dropped-soft: #e7e9e8;
  --ended: #9aa29f; --ended-soft: #eef0ef;
  --bad: #c53030; --bad-soft: #fbe3e3;
  --shadow: 0 1px 2px rgba(20,30,28,.06), 0 2px 8px rgba(20,30,28,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614; --surface: #1a1f1d; --sunk: #151a18; --text: #e5e9e7; --muted: #98a29e; --line: #2c3431;
    --accent: #8aa4ff; --accent-soft: #1f2a4d; --on-accent: #0d1430;
    --todo: #b3a7ff; --todo-soft: #29244a;
    --doing: #8aa4ff; --doing-soft: #1f2a4d;
    --review: #f2b45a; --review-soft: #3a2c14;
    --done: #5fd38a; --done-soft: #16301f;
    --dropped: #a3aca8; --dropped-soft: #262d2a;
    --ended: #7d8783; --ended-soft: #1f2523;
    --bad: #f87171; --bad-soft: #3a1c1c;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 12px; }
.when { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) 10px calc(16px + env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
#q { flex: 1 1 220px; min-width: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunk); }
.toggle { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .row-item:focus-visible, .pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.view { padding: 16px; max-width: 1280px; margin: 0 auto; }
.empty { color: var(--muted); font-size: 13px; padding: 16px 4px; text-align: center; }
.banner { padding: 8px 12px; border-radius: 8px; background: var(--review-soft); color: var(--review); font-size: 13px; }

.pill { display: inline-flex; align-items: center; font-size: 11px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.s-todo { --c: var(--todo); --cs: var(--todo-soft); }
.s-doing { --c: var(--doing); --cs: var(--doing-soft); }
.s-review { --c: var(--review); --cs: var(--review-soft); }
.s-done { --c: var(--done); --cs: var(--done-soft); }
.s-dropped { --c: var(--dropped); --cs: var(--dropped-soft); }
.s-ended { --c: var(--ended); --cs: var(--ended-soft); }
.pill { background: var(--cs); color: var(--c); }
.sdot { background: var(--c); }
.prio { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; flex: none; font-variant-numeric: tabular-nums; }
.prio.p0 { background: var(--bad-soft); color: var(--bad); }
.prio.p1 { background: var(--review-soft); color: var(--review); }
.prio.p3 { background: var(--sunk); color: var(--muted); }

/* ---- reminders ---- */
.home { display: grid; gap: 14px; }
.reminders { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.reminders .rh { display: flex; gap: 8px; align-items: baseline; padding: 9px 14px; background: var(--sunk); font-size: 13px; }
.rem { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); min-width: 0; }
.rem:hover { background: var(--sunk); }
.rem:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rem .mark { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.rem.lvl0 .mark { background: var(--bad); }
.rem.lvl1 .mark { background: var(--review); }
.rem.lvl2 .mark { background: var(--doing); }
.rem .t { flex: 1; min-width: 0; overflow-wrap: anywhere; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rem .t:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.rem .proj-name { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rem .acts { display: flex; gap: 4px; align-items: center; flex: none; }
.rem .act { background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.rem .act:hover { border-color: var(--line); color: inherit; }
.rem .act:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.rem.snoozed { color: var(--muted); }
.rem.snoozed .mark { background: var(--line); }
@media (max-width: 560px) { .rem { flex-wrap: wrap; } .rem .acts { width: 100%; justify-content: flex-end; } }
@media (hover: hover) { .rem:not(:hover):not(:focus-within) .act { opacity: .55; } }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: flex; gap: 12px; align-items: center;
  max-width: calc(100vw - 32px); padding: 8px 10px 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18); font-size: 13px; }

/* ---- home: project wall ---- */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; align-content: start; cursor: pointer; text-decoration: none; color: inherit; box-shadow: var(--shadow); min-width: 0; }
.pcard:hover { border-color: var(--accent); }
.pcard .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.pcard .name { font-weight: 600; font-size: 16px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.pcard .name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--sunk); }
.seg span { display: block; background: var(--c); }
.legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend b { color: var(--text); font-weight: 600; margin-left: 3px; }
.mini { display: grid; gap: 6px; }
.mini .r { display: flex; gap: 8px; align-items: center; min-width: 0; }
.mini .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shots { display: flex; gap: 6px; flex-wrap: wrap; }
.shots img { width: 72px; height: 46px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: var(--sunk); }
.more { font-size: 12px; color: var(--accent); }
.pcard.quiet { box-shadow: none; background: transparent; }
.pcard.quiet .name { font-size: 15px; font-weight: 500; }
.pcard .desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side a.p.quiet { color: var(--muted); }

/* ---- project page ---- */
.proj { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.side { display: grid; gap: 2px; position: sticky; top: 64px; }
.side .back { font-size: 13px; padding: 6px 8px; text-decoration: none; }
.side a.p { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--text); border: 1px solid transparent; min-width: 0; }
.side a.p span.n { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.side a.p span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side a.p[aria-current="page"] { background: var(--surface); border-color: var(--line); font-weight: 600; }
.main { display: grid; gap: 12px; min-width: 0; }
.phead { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.phead h1 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 8px; }
.phead .spacer { flex: 1; }
.seg-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg-ctl button { border: 0; background: transparent; padding: 5px 12px; cursor: pointer; }
.seg-ctl button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sec { padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--sunk); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.sec:first-child { border-top: 0; }
.row-item { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); cursor: pointer; min-width: 0; }
.sec + .row-item { border-top: 0; }
.row-item:hover { background: var(--sunk); }
.row-item .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .proj-name { color: var(--muted); font-size: 12px; white-space: nowrap; }
.fold { display: block; width: 100%; text-align: left; padding: 9px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--accent); cursor: pointer; font-size: 13px; }
.new-plan { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.new-plan select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }
.new-plan input { flex: 1 1 200px; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }

.timeline { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 16px; }
.day { display: grid; gap: 4px; }
.day > .label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .03em; margin-bottom: 4px; }
.entry { display: grid; grid-template-columns: 44px 12px minmax(0, 1fr); gap: 10px; align-items: start; cursor: pointer; padding: 4px 0; border-radius: 6px; }
.entry:hover .t { color: var(--accent); }
.entry .time { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); padding-top: 2px; }
.entry .rail { position: relative; align-self: stretch; }
.entry .rail .sdot { position: absolute; top: 7px; left: 2px; }
.entry .rail::after { content: ""; position: absolute; left: 5.5px; top: 19px; bottom: -8px; width: 1px; background: var(--line); }
.day .entry:last-child .rail::after { display: none; }
.entry .body { display: grid; gap: 5px; min-width: 0; }
.entry .t { font-weight: 500; overflow-wrap: anywhere; }
.entry .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }

/* ---- check-up ---- */
.seg-ctl .prio { margin-left: 4px; }
.audit { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 14px; min-width: 0; }
.audit-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.findings { display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.finding { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-top: 1px solid var(--line); min-width: 0; }
.finding:first-child { border-top: 0; }
.finding .prio { margin-top: 2px; }
.finding .ft { flex: 1; min-width: 0; display: grid; gap: 2px; }
.finding .t { font-weight: 500; overflow-wrap: anywhere; }
.graph-wrap h4 { margin-top: 0; }
.graph { overflow-x: auto; margin-top: 8px; background: var(--sunk); border-radius: 10px; padding: 8px; }
.graph svg { display: block; margin: 0 auto; max-width: none; }
.g-node rect { fill: var(--surface); stroke: var(--line); }
.g-node.weak rect { fill: var(--bad-soft); stroke: var(--bad); }
.g-label { fill: var(--text); font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.g-meta { fill: var(--muted); font-size: 11px; }
.g-edge { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .7; }
.g-edge.cycle { stroke: var(--bad); stroke-dasharray: 4 3; opacity: 1; }
.g-arrow { fill: var(--muted); }

/* ---- drawn change map ---- */
.cmfig { margin: 0; display: grid; gap: 2px; max-width: 100%; }
.changemap { display: block; max-width: 100%; height: auto; }
.changemap text { font-size: 11px; fill: var(--surface); font-weight: 600; pointer-events: none; }
.changemap text.n { font-weight: 400; opacity: .85; }
.cm0 rect { fill: var(--doing); } .cm1 rect { fill: var(--todo); } .cm2 rect { fill: var(--done); }
.cm3 rect { fill: var(--review); } .cm4 rect { fill: var(--dropped); } .cm5 rect { fill: var(--ended); }

/* ---- drawer ---- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 9; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--surface); z-index: 10; display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,.15); }
.drawer-head { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.title-input { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; background: transparent; }
.title-input:hover, .title-input:focus { border-color: var(--line); outline: none; }
.drawer-body { overflow-y: auto; padding: 12px 16px 32px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; margin: 0 0 12px; font-size: 13px; align-items: center; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .tall { align-self: start; }
.facts dt.tall { padding-top: 2px; }
.facts select { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy { cursor: pointer; border-bottom: 1px dashed var(--muted); }
textarea.note { width: 100%; min-height: 72px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--sunk); resize: vertical; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 12px; }
.tab { border: 0; background: transparent; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.prompt { border-left: 2px solid var(--accent); padding: 4px 0 4px 12px; margin-bottom: 14px; }
.prompt .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt .text.clamped { max-height: 12em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.linkbtn { font-size: 12px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
h4 { margin: 16px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
ul.files, ul.cmds { list-style: none; margin: 0; padding: 0; }
ul.files li, ul.cmds li { padding: 4px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; min-width: 0; }
ul.files .p, ul.cmds .p { flex: 1; min-width: 0; overflow-wrap: anywhere; }
ul.cmds .p { white-space: pre-wrap; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.badge.warn { background: var(--review-soft); color: var(--review); }
.badge.wait { background: var(--bad-soft); color: var(--bad); }
.todos { margin-bottom: 16px; }
.todos h4 { margin-top: 0; }
ul.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.todo { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.todo .mk { width: 1em; flex: none; color: var(--muted); }
.todo.completed { color: var(--muted); }
.todo.completed .mk { color: var(--done); }
.todo.in_progress .mk { color: var(--doing); }
.plan-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--sunk); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 12px 0 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.shot { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--sunk); margin: 0; }
.shot img { display: block; width: 100%; height: 120px; object-fit: cover; cursor: zoom-in; }
.shot .cap { padding: 4px 6px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 4px; }
.shot .x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 2px; }
.dropzone { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); margin-bottom: 12px; font-size: 13px; cursor: pointer; }
.dropzone.over { border-color: var(--accent); color: var(--accent); }
.confirm { display: inline-flex; gap: 6px; align-items: center; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 20; display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; }

@media (max-width: 599px) {
  .proj { grid-template-columns: 1fr; }
  .side { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .side a.p span.n { margin-left: 4px; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: 6px; }
  .toggle { display: none; }
}

/* ---- devices & sign-in ---- */
.modal { position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { background: var(--surface); border-radius: 14px; width: min(460px, 100%); max-height: 100%; overflow: auto; box-shadow: var(--shadow); }
.modal-card h2 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 16px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.modal-body img.qr { width: 220px; height: 220px; image-rendering: pixelated; background: #fff; border-radius: 8px; padding: 8px; }
.pair-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 26px; letter-spacing: .12em; font-weight: 600; }
.modal-body ol { text-align: left; margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: min(380px, 100%); display: grid; gap: 16px; }
.login h1 { margin: 0; font-size: 26px; }
.login-form { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.login-form label { font-weight: 600; font-size: 13px; }
.login-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunk); font-size: 16px; letter-spacing: .04em; }
.login-error { margin: 0; color: var(--bad); font-size: 13px; }

/* ---- spending ---- */
.spend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.spend b { font-weight: 600; }
.spend .note { margin-left: auto; font-size: 12px; }
.spend .act { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.spend .act:hover { color: inherit; border-color: var(--accent); }
.spend input { width: 7em; }
.meter { position: relative; display: inline-block; width: 120px; height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; }
.meter.near > span { background: var(--review); }
.meter.over > span { background: var(--bad); }
.spendv { display: flex; flex-direction: column; gap: 14px; }
.spend-head { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.spend-head .big { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.spend-head .small { font-size: 12px; max-width: 46em; }
.daybars { margin: 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.daybars .bars { display: block; width: 100%; height: 100px; margin: 6px 0 4px; }
.daybars .axis { stroke: var(--line); stroke-width: 1; }
.daybars .tick, .daybars .ticks { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.daybars .ticks { display: flex; justify-content: space-between; }
.daybars .axis { vector-effect: non-scaling-stroke; }
.daybars .mark { fill: var(--accent); }
.daybars .hit { fill: transparent; }
.daybars .bar:hover .mark, .daybars .bar:focus .mark { fill: var(--accent); opacity: .75; }
.daybars .bar:focus { outline: none; }
.daybars .bar:focus .hit { fill: var(--accent-soft); }
.row-item .cost { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.row-item.static { cursor: default; }
.row-item.static:hover { background: none; }

/* ---- test runs ---- */
.badge.test-pass { background: var(--done-soft); color: var(--done); }
.badge.test-fail { background: var(--bad-soft); color: var(--bad); }
.badge.stale { opacity: .75; }
.test-sum { font-size: 12px; overflow-wrap: anywhere; }
.test-runs { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.test-runs li { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.test-runs .p { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }

/* ---- search ---- */
.search .found + .found { border-top: 1px solid var(--line); }
.search .found .row-item { border-top: 0; }
.hits { padding: 0 14px 10px 33px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font-size: 12px; min-width: 0; }
.hit { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.hit .field { flex: none; color: var(--muted); min-width: 2.5em; }
.hit .snip { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.hit mark { background: var(--review-soft); color: var(--text); border-radius: 2px; padding: 0 1px; }
.hits .more { padding-left: calc(2.5em + 8px); }

/* ---- goal and milestones ---- */
.goal { display: flex; gap: 10px; align-items: baseline; margin: 6px 0 12px; font-size: 14px; min-width: 0; }
.goal .label, .milestones .label { flex: none; font-size: 12px; color: var(--muted); }
.goal .t { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.goal.editing { flex-direction: column; align-items: stretch; gap: 8px; }
.goal-add { display: block; margin: 6px 0 12px; padding: 0; background: none; border: 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.goal-add:hover { color: var(--accent); }
.goal .act, .milestones .act { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.goal .act:hover, .milestones .act:hover { color: inherit; border-color: var(--accent); }
.milestones .act.danger { color: var(--bad); }
.milestones { margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.ms-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ms { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: inherit; font: inherit; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; max-width: 100%; }
.ms .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16em; }
.ms .n, .ms .due { color: var(--muted); }
.ms .meter { width: 40px; height: 4px; }
.ms[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ms.late .due { color: var(--bad); }
.ms.done { opacity: .7; }
.ms:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ms-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ms-form input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); color: inherit; font: inherit; }
.ms-form input[name="title"] { flex: 1; min-width: 12em; }
.ms-sel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.pgoal { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: -4px 0 8px; }

/* features: the project as a left-to-right tree */
.ftv { display: grid; gap: 14px; margin-top: 12px; min-width: 0; }
.ft-tools, .ft-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ftv .act { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ftv .act:hover { color: inherit; border-color: var(--accent); }
.ftv .act.danger { color: var(--bad); }
.ft-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 4px 16px; color: var(--muted); font-size: 13px; max-width: 70ch; }
.ft-hint { padding: 0 2px; }
.ftree { overflow-x: auto; background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.ft-branch { display: flex; align-items: center; position: relative; }
.ft-head { display: flex; align-items: center; gap: 4px; flex: none; }
.ft-kids { display: flex; flex-direction: column; position: relative; margin-left: 22px; }
.ft-kids::before { content: ""; position: absolute; left: -22px; top: 50%; width: 22px; border-top: 2px solid var(--line); }
.ft-kids > .ft-branch { padding: 3px 0 3px 22px; }
.ft-kids > .ft-branch::before { content: ""; position: absolute; left: 0; top: 50%; width: 22px; border-top: 2px solid var(--line); }
.ft-kids > .ft-branch::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--line); }
.ft-kids > .ft-branch:first-child::after { top: 50%; }
.ft-kids > .ft-branch:last-child::after { bottom: 50%; }
.ft-node { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font: inherit; font-size: 13px; color: inherit; cursor: pointer; white-space: nowrap; }
.ft-node .nm { overflow: hidden; text-overflow: ellipsis; }
.ft-node .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ft-node:hover { border-color: var(--accent); }
.ft-node.top { font-weight: 600; }
.ft-node.root { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; cursor: default; }
.ft-node.loose { border-style: dashed; color: var(--muted); }
.ft-node.sel { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--accent-soft); color: var(--accent); }
.ft-tog { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font: inherit; font-size: 11px; color: var(--muted); padding: 0 7px; line-height: 18px; cursor: pointer; font-variant-numeric: tabular-nums; }
.ft-tog:hover { border-color: var(--accent); color: inherit; }
.ft-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ft-add input { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); min-width: 0; width: 220px; max-width: 100%; }
.ft-detail { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.ft-detail h3 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ft-detail .crumb { font-size: 12px; margin-bottom: -8px; }
.ft-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.ft-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.ft-move select { font-size: 12px; max-width: 180px; }
.ft-box h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.ft-box .note { width: 100%; }
.ft-ev .when { min-width: 3.2em; }
.ft-ev select { font-size: 12px; max-width: 160px; flex: none; }
.ft-tag { margin-left: 8px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.ft-attach { padding: 8px 14px; border-top: 1px solid var(--line); }
.ft-attach select { max-width: 100%; }
.ft-draft { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 13px; }
.ft-draft ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.ft-draft .inline { margin-top: 4px; }
.ft-prompt { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; background: var(--sunk); border-radius: 8px; padding: 10px 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 6px 0 0; }
.ft-draft .note { width: 100%; }
@media (max-width: 560px) { .ft-ev .muted { display: none; } }

/* feature checkup: verdicts, progress and the views around the tree */
.v-ok { --vc: var(--done); --vs: var(--done-soft); }
.v-half { --vc: var(--review); --vs: var(--review-soft); }
.v-miss { --vc: var(--dropped); --vs: var(--dropped-soft); }
.v-bad { --vc: var(--bad); --vs: var(--bad-soft); }
.v-ask { --vc: var(--todo); --vs: var(--todo-soft); }
.v-skip, .v-later { --vc: var(--muted); --vs: var(--sunk); }
.v { display: inline-flex; align-items: center; font-size: 11px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; font-weight: 600; background: var(--vs); color: var(--vc); }
.vmark { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; line-height: 1; background: var(--vs); color: var(--vc); border: 1.5px solid var(--vc); flex: none; }
.vmark.v-miss { border-style: dashed; background: transparent; }
.tier { font-size: 11px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; font-weight: 500; }
.tier.t-B { color: var(--text); border-color: currentColor; font-weight: 600; }
.pct { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-variant-numeric: tabular-nums; }
.pct b { font-weight: 700; min-width: 2.6em; text-align: right; }
.pct .meter { display: inline-flex; width: 48px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--sunk); }
.pct .meter i { display: block; height: 100%; background: var(--done); }
.ft-node.root b { font-size: 12px; opacity: .9; }
.ft-node.ghost { border-style: dashed; background: transparent; color: var(--muted); }
.ft-node.aside { opacity: .55; }
.ft-node.aside .nm { text-decoration: line-through; }
.ft-tools .legend { display: inline-flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-left: auto; }
.ft-tools .legend span, .ft-std .legend span { display: inline-flex; gap: 4px; align-items: center; }
.ft-sum { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ft-sum.empty { grid-template-columns: 1fr auto; align-items: start; font-size: 13px; }
.ft-sum.empty p { margin: 6px 0 0; max-width: 70ch; }
.ft-sum .big { font-size: 32px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ft-sum .delta { color: var(--done); font-size: 12px; font-weight: 600; margin-top: 2px; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; align-content: start; }
.count { display: grid; gap: 1px; padding: 7px 12px; border-radius: 10px; background: var(--vs); color: var(--vc); min-width: 84px; border: 0; text-align: left; cursor: pointer; font: inherit; }
.count b { font-size: 20px; font-variant-numeric: tabular-nums; }
.count span { font-size: 12px; }
.count[aria-pressed="true"] { outline: 2px solid var(--vc); outline-offset: 1px; }
.runline { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.ft-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ft-tabs button { border: 0; background: none; padding: 7px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font: inherit; }
.ft-tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.ft-tabs .n { font-size: 11px; background: var(--sunk); border-radius: 999px; padding: 0 6px; margin-left: 4px; color: var(--muted); font-weight: 500; }
.btn.small { padding: 2px 9px; font-size: 12px; }
.btn.on, .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.claude { border-left: 3px solid var(--vc); background: var(--vs); border-radius: 0 8px 8px 0; padding: 10px 12px; display: grid; gap: 6px; font-size: 13px; }
.claude .who { font-size: 12px; font-weight: 600; color: var(--vc); }
.claude p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.row-item .when.wrap { white-space: normal; text-align: right; max-width: 50%; }
.ft-recs { display: grid; gap: 14px; }
.ft-recs > p { margin: 0; }
.recgroup { display: grid; gap: 8px; }
.recgroup h4 { margin: 0; font-size: 13px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rec { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.rec .what { display: grid; gap: 2px; min-width: 0; }
.rec .why { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.rec .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; font-size: 13px; }
.ft-std { display: grid; gap: 10px; }
.ft-std > p { margin: 0; }
.ft-std .legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.cl-mod { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cl-mod summary { cursor: pointer; display: flex; gap: 10px; align-items: center; padding: 9px 14px; margin: 0; font-weight: 600; font-size: 14px; color: var(--text); list-style: none; }
.cl-mod summary::-webkit-details-marker { display: none; }
.cl-mod summary::before { content: "▸"; color: var(--muted); font-size: 11px; width: 10px; }
.cl-mod[open] summary::before { content: "▾"; }
.cl-mod summary .muted { font-weight: 400; margin-left: auto; }
.cl-row { display: grid; grid-template-columns: 1fr auto auto auto 2.5em; gap: 10px; align-items: center; padding: 6px 14px 6px 28px; border-top: 1px solid var(--line); font-size: 13px; }
.cl-row.add { display: block; }
.cl-row .nm { min-width: 0; }
.cl-row .tier { justify-self: start; }
.cl-row .nm small { display: block; color: var(--muted); font-size: 12px; }
.pick { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; font-size: 12px; }
.pick button { border: 0; background: var(--surface); padding: 2px 9px; cursor: pointer; color: var(--muted); font: inherit; font-size: 12px; }
.pick button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* the checklist: how far each item is built, and its record on demand */
.cl-nm { border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; display: block; width: 100%; border-radius: 4px; }
.cl-nm .tog { display: inline-block; width: 14px; margin-left: -14px; color: var(--muted); font-size: 11px; }
.cl-nm:hover { color: var(--accent); }
.cl-row.open { background: var(--sunk); }
.cl-row .v i { font-style: normal; font-weight: 500; opacity: .75; margin-left: 5px; }
.v-none { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 500; }
/* Operating status: a project's checklist read as a launch pre-check. */
.r-blocker { --vc: var(--bad); --vs: var(--bad-soft); }
.r-action { --vc: var(--review); --vs: var(--review-soft); }
.r-info { --vc: var(--todo); --vs: var(--todo-soft); }
.r-ok { --vc: var(--done); --vs: var(--done-soft); }
.r-na { --vc: var(--muted); --vs: var(--sunk); }
.light { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.l-red { background: var(--bad); }
.l-yellow { background: var(--review); }
.l-green { background: var(--done); }
.l-none { background: transparent; border: 1.5px dashed var(--muted); }
.pcard .ready { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; min-width: 0; }
.pcard .ready .miss { flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-kind { display: flex; gap: 10px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.ft-kind label { display: inline-flex; gap: 8px; align-items: center; }
.ft-todo .sum { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.ft-todo .sum .muted b { color: var(--text); margin-left: 3px; }
.ft-todo .sum .toggle { margin-left: auto; font-size: 12px; }
.ft-todo .recgroup h4 .v { font-size: 11px; }
.cl-legend-tip { white-space: nowrap; }
.cl-detail { grid-column: 1 / -1; display: grid; gap: 10px; padding: 6px 0 8px; min-width: 0; }
.cl-detail > p { margin: 0; font-size: 13px; }
.cl-shots h5 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--text); }
.shots.big { gap: 8px; }
.cl-shot { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--sunk); cursor: zoom-in; line-height: 0; }
.cl-shot img { display: block; width: 180px; height: 112px; object-fit: cover; }
@media (max-width: 640px) { .cl-shot img { width: 132px; height: 84px; } }
@media (max-width: 640px) {
  .ft-sum, .ft-sum.empty { grid-template-columns: 1fr; }
  .rec { grid-template-columns: 1fr; }
  .rec .acts { justify-content: flex-start; }
  .cl-row { grid-template-columns: 1fr auto; padding-left: 14px; }
  .ft-tools .legend { margin-left: 0; }
}

/* ---- project light, stuck tasks, the definition of done ---- */
/* The attention light (web.groupHealth); the readiness light above uses l-* classes. */
.light.green { background: var(--done); box-shadow: 0 0 0 2px var(--done-soft); }
.light.amber { background: var(--review); box-shadow: 0 0 0 2px var(--review-soft); }
.light.red { background: var(--bad); box-shadow: 0 0 0 2px var(--bad-soft); }
.pcard .why { font-size: 12px; color: var(--review); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -4px; }
.pcard .why.red { color: var(--bad); }
.legend .warn b { color: var(--review); }
.badge.blocked { background: var(--bad-soft); color: var(--bad); }
.stuck .why { padding: 0 14px 8px 32px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sec .badge { margin-left: 6px; font-weight: 500; }
.facts input[name="why"] { flex: 1; min-width: 12em; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }

/* ---- quality: test trend and hot spots ---- */
.quality { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.qbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; min-width: 0; }
.qbox h4 { margin: 0; }
.qbox .muted { max-width: 70ch; }
.qbox .daybars { padding: 0; border: 0; }
.tbars .pass { fill: var(--done); }
.tbars .fail { fill: var(--bad); }
.tbars .unknown { fill: var(--line); }
.tbars .bar:hover rect:not(.hit), .tbars .bar:focus rect:not(.hit) { opacity: .75; }
.hot .tasks { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 14px 8px; }
.hot .tasks:empty { display: none; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px 8px; font: inherit; font-size: 12px; color: inherit; cursor: pointer; max-width: 100%; }
.chip:hover { border-color: var(--accent); }

/* ---- milestone burn-up and retrospective ---- */
.ms-panel { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ms-panel .act { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ms-panel .act:hover { color: inherit; border-color: var(--accent); }
.ms-panel .daybars { padding: 0; border: 0; }
.burn-head { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; align-items: center; }
.burn-head .key { display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; background: var(--muted); }
.burn-head .key.done { background: var(--accent); }
.burn-head .key.due { background: repeating-linear-gradient(90deg, var(--bad) 0 3px, transparent 3px 6px); }
.burnup .burn { display: block; width: 100%; height: 150px; margin: 6px 0 4px; }
.burnup .scope { fill: none; stroke: var(--muted); stroke-width: 2; vector-effect: non-scaling-stroke; }
.burnup .done { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.burnup .done-area { fill: var(--accent-soft); }
.burnup .due { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.burnup .hit { fill: transparent; }
.burnup .bar:focus { outline: none; }
.burnup .bar:focus .hit, .burnup .bar:hover .hit { fill: var(--sunk); opacity: .6; }
.burnup .forecast { font-size: 13px; margin-top: 6px; }
.burnup .forecast .late { color: var(--bad); }

/* the cumulative flow diagram and the weekly throughput bars */
.cfdbox .cfd { display: block; width: 100%; height: 140px; margin: 6px 0 4px; }
.cfd .layer { opacity: .6; }
.cfd .layer.done { fill: var(--done); }
.cfd .layer.review { fill: var(--review); }
.cfd .layer.doing { fill: var(--doing); }
.cfd .layer.todo { fill: var(--todo); }
.cfd .hit { fill: transparent; }
.cfd .bar:focus { outline: none; }
.cfd .bar:focus .hit, .cfd .bar:hover .hit { fill: var(--text); opacity: .12; }
.cfdbox .key.done { background: var(--done); }
.cfdbox .key.review { background: var(--review); }
.cfdbox .key.doing { background: var(--doing); }
.cfdbox .key.todo { background: var(--todo); }
.weekbars .done { fill: var(--done); }
.weekbars .started { fill: var(--doing); opacity: .7; }
.weekbars .key.done { background: var(--done); }
.weekbars .key.started { background: var(--doing); opacity: .7; }
.weekbars .bars { height: 70px; }
.kaizen .kz { display: grid; gap: 4px; margin: 6px 0 8px; }
.kaizen .kz b { font-size: 15px; }
.week .spacer { flex: 1; }
.flow .signals { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.flow .retro-grid { margin-top: 8px; }
.risk .btn { flex: none; align-self: center; }
.riskstrip { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; margin-bottom: 12px; }
.riskstrip .label { font-weight: 600; }
.riskstrip .list { margin-top: 6px; }
.weekago { font-size: 12px; margin: 2px 0 4px; }
.msline { font-size: 12px; margin: 2px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msline.late { color: var(--bad); }
.weekago.better { color: var(--done); }
.weekago.worse { color: var(--review); }
.trend .cells { display: flex; gap: 2px; margin: 8px 0; }
.trend .cell { flex: 1; height: 14px; border-radius: 3px; background: var(--line); min-width: 0; }
.trend .cell.none { background: var(--sunk); }
.trend .cell.l0 { background: var(--done); }
.trend .cell.l1 { background: var(--review); }
.trend .cell.l2 { background: var(--bad); }
.trend .week { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.trend .week b { margin-left: 4px; font-variant-numeric: tabular-nums; }
.trend .better b { color: var(--done); }
.trend .worse b { color: var(--review); }
.risk .act { flex: none; align-self: center; }
.risks .accepted { margin-top: 8px; }
.risks .accepted summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.risks .accepted .risk { cursor: default; opacity: .75; }
.todo-list .pick { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.todo-list .pick input { margin-top: 3px; }
.retro { display: grid; gap: 10px; }
.retro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.tile { background: var(--sunk); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.tile .big { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.bad .big { color: var(--bad); }
.tile.warn .big { color: var(--review); }
.retro h4 { margin: 4px 0 0; }

/* ---- weekly review, stale verdicts ---- */
.review .qbox h4 { margin: 0; }
.review .qbox .inline h4 { color: var(--text); font-size: 15px; }
.review .spacer { flex: 1; }
.stale-note { color: var(--review); }
.ft-node .badge { margin-left: 4px; }
.caveats { grid-column: 1 / -1; display: grid; gap: 2px; font-size: 12px; }
.demand .terms { display: flex; flex-wrap: wrap; gap: 6px; }
.demand .chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.demand .rec .tasks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.v.v-none { --vc: var(--muted); --vs: var(--sunk); }

/* ---- today's focus, rules, plan readiness, milestone demo ---- */
.focus .rh .spacer { flex: 1; }
.focus .rh .act { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.focus .rh .act:hover { color: inherit; border-color: var(--accent); }
.focus .rem .icon { width: 1.4em; text-align: center; flex: none; font-size: 13px; }
.focus .rem.lvl0 .mark { background: var(--accent); }
.focus .rem.lvl1 .mark { background: var(--accent); opacity: .7; }
.focus .rem.lvl2 .mark { background: var(--accent); opacity: .45; }
.focus .rem .t b { font-weight: 600; }
.rules-form { padding: 10px 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.rules-form p { margin: 0; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 16px; font-size: 13px; }
.rules-grid label { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.rules-grid input { width: 4.5em; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); font-variant-numeric: tabular-nums; }
.vague-hint { margin: -6px 0 10px; }
.demo { display: grid; gap: 10px; }
.demo .spacer { flex: 1; }
.demo-task { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.demo-task .row-item { border-top: 0; }
.demo-task .shots { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; }
.demo-task .shots img { height: 140px; max-width: 100%; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; object-fit: cover; }

/* ---- risk register, week strip ---- */
.risk { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-top: 1px solid var(--line); min-width: 0; cursor: pointer; }
.risk:first-child { border-top: 0; }
.risk:hover { background: var(--sunk); }
.risk .prio { margin-top: 2px; }
.risk .prio.p2 { background: var(--sunk); color: var(--muted); }
.risk .ft { flex: 1; min-width: 0; display: grid; gap: 2px; }
.risk .t { font-weight: 500; overflow-wrap: anywhere; }
.week .label { font-weight: 600; }
.week .bad b { color: var(--bad); }
