@quolu/lattice 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,196 @@
1
+ import { renderTodoGanttSvg, TODO_GANTT_STATUS_PRESENTATION } from './todo-gantt-svg.mjs';
2
+
3
+ export const DOCUMENT_STATUS = TODO_GANTT_STATUS_PRESENTATION;
4
+
5
+ export function statusMarkup(status, suffix = '') {
6
+ const value = DOCUMENT_STATUS[status] ?? { mark: '?', label: '状態不明' };
7
+ return `<span class="status-symbol status-${escapeHtmlAttribute(status)}" role="img" aria-label="${escapeHtmlAttribute(value.label)}">${escapeHtmlText(value.mark)}</span>${suffix}`;
8
+ }
9
+
10
+ export function escapeHtmlAttribute(value) {
11
+ return String(value).replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;')
12
+ .replaceAll('"', '&quot;').replaceAll("'", '&#39;').replace(/[\u0000-\u001f\u007f]/gu, '');
13
+ }
14
+
15
+ export function escapeHtmlText(value) {
16
+ return String(value).replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;');
17
+ }
18
+
19
+ export function refKey(ref) {
20
+ return JSON.stringify([ref.project_id, ref.plan_key, ref.task_id]);
21
+ }
22
+
23
+ export function compareText(left, right) {
24
+ return left < right ? -1 : left > right ? 1 : 0;
25
+ }
26
+
27
+ /** Keys of the ToDos the diagram does not draw, empty when nothing was folded. */
28
+ export function foldIndex(layout) {
29
+ return new Set((layout?.folded ?? []).map((ref) => refKey(ref)));
30
+ }
31
+
32
+ export function renderTaskIndexEntry(section, lookup) {
33
+ const key = refKey(section.ref);
34
+ const status = DOCUMENT_STATUS[section.state.status] ?? { mark: '?', label: '状態不明' };
35
+ const blockedReason = section.state.status === 'blocked'
36
+ ? `<span class="task-index-blocked-reason">— ${escapeHtmlText(section.state.blocked_reason ?? '理由未記録')}</span>` : '';
37
+ // A ToDo the diagram does not draw keeps its row here — the index is the
38
+ // complete list — and it selects its own detail, which exists either way.
39
+ const selectKey = key;
40
+ return `<li><button type="button" data-select-node-key="${escapeHtmlAttribute(selectKey)}"><span class="task-index-status status-${escapeHtmlAttribute(section.state.status)}" role="img" aria-label="${escapeHtmlAttribute(status.label)}">${escapeHtmlText(status.mark)}</span><span class="task-index-reference">${escapeHtmlText(taskReference(section, lookup))}</span><strong>${escapeHtmlText(section.task.title)}</strong>${blockedReason}</button></li>`;
41
+ }
42
+
43
+ /** plan_key -> 最終活動時刻。journalの末尾eventが、そのplanが最後に動いた時点。 */
44
+ export function planActivity(readModel) {
45
+ return new Map((readModel?.members ?? []).map((member) => {
46
+ const events = member.journal?.events ?? [];
47
+ const last = events.at(-1)?.recorded_at ?? events[0]?.recorded_at ?? '';
48
+ return [member.plan.plan_key, last];
49
+ }));
50
+ }
51
+
52
+ export function renderTaskIndex(sections, lookup, folds = new Set(), activity = new Map()) {
53
+ const byPlan = new Map();
54
+ for (const section of sections) {
55
+ if (!byPlan.has(section.ref.plan_key)) byPlan.set(section.ref.plan_key, []);
56
+ byPlan.get(section.ref.plan_key).push(section);
57
+ }
58
+ // 全ToDoが図から外れたplanは終わった仕事。読む側が先に見たいのは動いているplanなので、
59
+ // 動いているものを最終活動の新しい順で上へ、終わったものを古い順で下へまとめる。
60
+ // plan内のToDo順は登録順のまま触らない。
61
+ const plans = [...byPlan.entries()].map(([planKey, tasks]) => ({
62
+ planKey,
63
+ tasks,
64
+ settled: tasks.every((section) => folds.has(refKey(section.ref))),
65
+ lastActivity: activity.get(planKey) ?? '',
66
+ }));
67
+ plans.sort((left, right) => {
68
+ if (left.settled !== right.settled) return left.settled ? 1 : -1;
69
+ const order = left.settled
70
+ ? compareText(left.lastActivity, right.lastActivity)
71
+ : compareText(right.lastActivity, left.lastActivity);
72
+ return order !== 0 ? order : compareText(left.planKey, right.planKey);
73
+ });
74
+ return plans.map((plan) => {
75
+ const drawn = plan.tasks.filter((section) => !folds.has(refKey(section.ref)));
76
+ const folded = plan.tasks.filter((section) => folds.has(refKey(section.ref)));
77
+ const drawnList = drawn.length === 0 ? ''
78
+ : `<ol class="task-index-list">${drawn.map((section) => renderTaskIndexEntry(section, lookup)).join('')}</ol>`;
79
+ const foldedList = folded.length === 0 ? ''
80
+ : `<details class="task-index-folded"><summary>完走済みとして畳んだ工程 ${folded.length}件</summary><ol class="task-index-list">${folded.map((section) => renderTaskIndexEntry(section, lookup)).join('')}</ol></details>`;
81
+ return `<section class="task-index-plan"><h2><code>${escapeHtmlText(plan.planKey)}</code></h2>${drawnList}${foldedList}</section>`;
82
+ }).join('');
83
+ }
84
+
85
+ export function presentationLookup(presentation) {
86
+ return {
87
+ lanes: new Map((presentation?.lanes ?? []).map((lane) => [JSON.stringify([lane.plan_key, lane.lane]), lane])),
88
+ taskNumbers: new Map((presentation?.task_numbers ?? []).map((entry) => [refKey(entry), entry])),
89
+ };
90
+ }
91
+
92
+ export function taskReference(section, lookup) {
93
+ const number = lookup.taskNumbers.get(refKey(section.ref));
94
+ return number === undefined ? `ID ${section.task.task_id}` : `工程 ${number.display_number}`;
95
+ }
96
+
97
+ export function renderRelationList(relations, sectionByKey, lookup, emptyText, folds = new Set()) {
98
+ if (relations.length === 0) return `<p class="relation-empty">${escapeHtmlText(emptyText)}</p>`;
99
+ return `<ul class="relation-list">${relations.map((relation) => {
100
+ const targetKey = refKey(relation.ref);
101
+ const target = sectionByKey.get(targetKey);
102
+ if (target === undefined) return '';
103
+ const join = relation.joinIds.length === 0 ? ''
104
+ : `<span class="relation-kind">合流条件: ${escapeHtmlText(relation.joinIds.join(', '))}</span>`;
105
+ // Say which ones the diagram does not draw, so the reader stops looking.
106
+ const reference = folds.has(targetKey)
107
+ ? `${taskReference(target, lookup)}(図では非表示)` : taskReference(target, lookup);
108
+ return `<li><button type="button" data-select-node-key="${escapeHtmlAttribute(targetKey)}"><strong>${escapeHtmlText(reference)}</strong><span>${escapeHtmlText(target.task.title)}</span></button>${join}</li>`;
109
+ }).join('')}</ul>`;
110
+ }
111
+
112
+ /** Phase states that are over: nothing is dispatched or judged under them again. */
113
+ export const SETTLED_PHASE_STATUS = Object.freeze(['accepted', 'rejected']);
114
+
115
+ export function renderPhaseProgress(readModel) {
116
+ const rows = [];
117
+ const settledRows = [];
118
+ for (const member of readModel.members) {
119
+ if (!['lattice.todo_plan.v4', 'lattice.todo_plan.v5'].includes(member.plan.schema)) continue;
120
+ const phases = new Map(member.snapshot.phases.map((phase) => [phase.phase_id, phase]));
121
+ for (const phase of member.plan.phases) {
122
+ const tasks = member.plan.tasks.filter((task) => task.phase_id === phase.phase_id);
123
+ const states = new Map(member.tasks.map((task) => [task.task_id, task.status]));
124
+ const done = tasks.filter((task) => states.get(task.task_id) === 'done').length;
125
+ const state = phases.get(phase.phase_id);
126
+ const row = `<li class="phase-progress status-${escapeHtmlAttribute(state.status)}"><header><strong>${escapeHtmlText(phase.title ?? phase.phase_id)}</strong><span>${escapeHtmlText(state.status)}</span></header><p><code>${escapeHtmlText(`${member.plan.plan_key}/${phase.phase_id}`)}</code> — policy <code>${escapeHtmlText(phase.gate_policy)}</code> — ToDo ${done}/${tasks.length}</p><progress max="${tasks.length}" value="${done}">${done}/${tasks.length}</progress></li>`;
127
+ // A settled Phase is history. It stays reachable, but it does not push the
128
+ // live ones off the first screen.
129
+ (SETTLED_PHASE_STATUS.includes(state.status) ? settledRows : rows).push(row);
130
+ }
131
+ }
132
+ const decoupled = readModel.members.some(({ plan }) => plan.schema === 'lattice.todo_plan.v5');
133
+ const guidance = decoupled
134
+ ? 'ToDo完了とPhase受理は別です。Phaseは重監査の順序を表し、通常ToDoの開始順はToDo依存だけで決まります。'
135
+ : 'ToDo完了とPhase受理は別です。<code>gate_ready</code>では後続Phaseはまだ解放されません。';
136
+ if (rows.length === 0 && settledRows.length === 0) return '';
137
+ const liveList = rows.length === 0
138
+ ? '<p class="readiness-note">進行中のPhaseはありません。</p>'
139
+ : `<ol>${rows.join('')}</ol>`;
140
+ const settledList = settledRows.length === 0 ? ''
141
+ : `<details class="phase-settled"><summary>決着済みPhase ${settledRows.length}件</summary><ol>${settledRows.join('')}</ol></details>`;
142
+ return `<section class="phase-overview"><h2>Phase進捗</h2><p>${guidance}</p>${liveList}${settledList}</section>`;
143
+ }
144
+
145
+ export const SEVERABILITY_LABEL = Object.freeze({
146
+ code_seam: 'コードの分割で並列化しうる',
147
+ serial: '共有状態のため直列必須',
148
+ });
149
+
150
+ export function renderSeamComponent(component) {
151
+ const conflicts = component.conflicts.map((conflict) => {
152
+ const pairs = conflict.task_pairs
153
+ .map(([left, right]) => `<span class="seam-task-pair"><code>${escapeHtmlText(left)}</code><span aria-hidden="true"> ↔ </span><code>${escapeHtmlText(right)}</code></span>`)
154
+ .join('');
155
+ return `<li class="seam-conflict"><strong class="seam-target">${escapeHtmlText(conflict.target)}</strong><span class="seam-conflict-kind"><code>${escapeHtmlText(conflict.kind)}</code></span><span class="seam-pairs">${pairs}</span></li>`;
156
+ }).join('');
157
+ const unknowns = component.unknowns.length === 0 ? '' : `<section class="seam-evidence-needed"><h4>次に必要な証拠</h4><ul>${component.unknowns.map((unknown) => {
158
+ const reference = component.task_ids.includes(unknown.ref)
159
+ ? `ToDo <code>${escapeHtmlText(unknown.ref)}</code>`
160
+ : `ref <code>${escapeHtmlText(unknown.ref)}</code>`;
161
+ return `<li><code>${escapeHtmlText(unknown.kind)}</code><span>${reference}</span></li>`;
162
+ }).join('')}</ul></section>`;
163
+ const reasons = component.reasons.length === 0 ? '' : `<section class="seam-reasons"><h4>判定理由</h4><ul>${component.reasons.map((reason) => `<li><code>${escapeHtmlText(reason.code)}</code><span>${escapeHtmlText(reason.detail)}</span></li>`).join('')}</ul></section>`;
164
+ const proposed = component.proposed_surfaces.length === 0 ? '' : `<section class="seam-surfaces"><h4>提案する所有境界</h4><ul>${component.proposed_surfaces.map((surface) => `<li><strong>${escapeHtmlText(surface.target)}</strong><span><code>${escapeHtmlText(surface.kind)}</code> / <code>${escapeHtmlText(surface.role)}</code> / owner ${surface.owner_task_ids.map((taskId) => `<code>${escapeHtmlText(taskId)}</code>`).join(', ') || '—'}</span></li>`).join('')}</ul></section>`;
165
+ const affectedTests = component.affected_tests.length === 0 ? ''
166
+ : `<p class="seam-tests"><strong>影響test:</strong> ${component.affected_tests.map((testRef) => `<code>${escapeHtmlText(testRef)}</code>`).join(', ')}</p>`;
167
+ return `<article class="seam-component verdict-${escapeHtmlAttribute(component.verdict)}"><header><span>Seam判定</span><code>${escapeHtmlText(component.verdict)}</code></header><ul class="seam-conflicts">${conflicts}</ul>${unknowns}${reasons}${proposed}${affectedTests}</article>`;
168
+ }
169
+
170
+ export function renderSeamPlan(plan, { compact = false } = {}) {
171
+ const components = plan.components.map(renderSeamComponent).join('');
172
+ const count = plan.component_count === null ? '—' : String(plan.component_count);
173
+ const nextAction = plan.guidance.next_action === 'none' ? ''
174
+ : `<p class="seam-next-action"><strong>次の一歩:</strong> <code>${escapeHtmlText(plan.guidance.next_action)}</code></p>`;
175
+ return `<section class="seam-plan${compact ? ' seam-plan-compact' : ''}" data-seam-plan="${escapeHtmlAttribute(plan.plan_key)}"><header><code>${escapeHtmlText(plan.plan_key)}</code><span class="seam-coverage coverage-${escapeHtmlAttribute(plan.coverage)}">${escapeHtmlText(plan.guidance.code)}</span><span class="seam-component-count">component ${escapeHtmlText(count)}件</span></header><p class="seam-guidance">${escapeHtmlText(plan.guidance.message)}</p>${nextAction}${components}</section>`;
176
+ }
177
+
178
+ /**
179
+ * componentがあるplanを先に展開し、0件planはcoverageごとに畳む。
180
+ * 実データのunknownと係争資源を、未生成planの列より先に視認できるようにする。
181
+ */
182
+ export function renderSeamProposalOverview(layout) {
183
+ const plans = layout.seam_proposals?.plans;
184
+ if (!Array.isArray(plans)) return '';
185
+ const withComponents = plans.filter((plan) => plan.components.length > 0);
186
+ const emptyByGuidance = new Map();
187
+ for (const plan of plans.filter((entry) => entry.components.length === 0)) {
188
+ if (!emptyByGuidance.has(plan.guidance.code)) emptyByGuidance.set(plan.guidance.code, []);
189
+ emptyByGuidance.get(plan.guidance.code).push(plan);
190
+ }
191
+ const decisions = withComponents.map((plan) => renderSeamPlan(plan)).join('');
192
+ const emptyGroups = [...emptyByGuidance.entries()].sort(([left], [right]) => compareText(left, right))
193
+ .map(([code, grouped]) => `<details class="seam-empty-group"><summary><code>${escapeHtmlText(code)}</code><span>${grouped.length} plan</span></summary>${grouped.map((plan) => renderSeamPlan(plan, { compact: true })).join('')}</details>`)
194
+ .join('');
195
+ return `<section class="seam-overview"><h2>Seam提案</h2>${decisions}${emptyGroups}</section>`;
196
+ }
@@ -0,0 +1,107 @@
1
+ export const CSS = `
2
+ :root{
3
+ color-scheme:light;
4
+ --surface-1:#fcfcfb;
5
+ --surface-2:#f4f4f2;
6
+ --text-primary:#0b0b0b;
7
+ --text-secondary:#52514e;
8
+ --border:#d9d8d4;
9
+ --accent:#2a78d6;
10
+ --good:#0ca30c;
11
+ --critical:#d03b3b;
12
+ font-family:system-ui,-apple-system,"Hiragino Sans","Yu Gothic UI",sans-serif;
13
+ font-size:13.5px;
14
+ font-weight:400;
15
+ line-height:1.6;
16
+ }
17
+ *{box-sizing:border-box}
18
+ body{display:grid;grid-template-rows:minmax(0,1fr);height:100vh;margin:0;background:var(--surface-1);color:var(--text-primary)}
19
+ .shell{display:grid;grid-template-columns:minmax(0,var(--split,58%)) auto minmax(24rem,1fr);min-width:0;min-height:0}
20
+ .gantt-pane{display:grid;grid-template-rows:auto auto minmax(0,1fr);min-width:0;min-height:0;overflow:hidden;background:var(--surface-1)}
21
+ .pane-divider{width:8px;cursor:col-resize;background:rgba(217,216,212,.5);touch-action:none}
22
+ .diagram-toolbar{z-index:3;display:flex;align-items:center;gap:8px;padding:8px 16px;border-bottom:1px solid var(--border);background:var(--surface-2);color:var(--text-secondary)}
23
+ .diagram-toolbar button{min-height:32px;padding:0 8px;border:1px solid var(--border);border-radius:4px;background:var(--surface-2);color:var(--text-primary);font:500 12px/1.6 system-ui,-apple-system,"Hiragino Sans","Yu Gothic UI",sans-serif}
24
+ .diagram-toolbar button:focus-visible{outline:2px solid var(--text-primary);outline-offset:2px}
25
+ .zoom-readout{min-width:48px;text-align:center;font-size:12px;font-weight:500;font-variant-numeric:tabular-nums}
26
+ .diagram-note{margin-left:auto;color:var(--text-secondary);font-size:12px;font-weight:500}
27
+ .project-heading{margin-right:8px;color:var(--text-primary);font-size:13px;font-weight:650;white-space:nowrap}.status-symbol.status-in-progress{color:var(--accent)}.status-symbol.status-done{color:var(--good)}.status-symbol.status-blocked{color:var(--critical)}
28
+ .diagram-legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:8px 16px;border-bottom:1px solid var(--border);background:var(--surface-1);color:var(--text-secondary);font-size:12px;font-weight:500}
29
+ .diagram-legend>span{white-space:nowrap}.diagram-legend>p{flex:1 0 100%;margin:0;font-weight:400}
30
+ .category-legend{margin-left:auto}.category-legend summary{cursor:pointer;color:var(--text-primary)}
31
+ .category-legend dl{position:absolute;z-index:4;right:16px;max-width:38rem;margin:8px 0 0;padding:12px 16px;border:1px solid var(--border);background:var(--surface-1);box-shadow:0 4px 16px rgba(11,11,11,.12)}
32
+ .category-entry+ .category-entry{margin-top:8px}.category-entry dt{color:var(--text-primary)}.category-entry dd{margin:0;color:var(--text-secondary);font-weight:400}
33
+ .diagram-scroll{min-width:0;min-height:0;max-width:calc(100% - 16px);margin:8px;overflow:auto;overscroll-behavior:contain;border:1px solid rgba(217,216,212,.5)}
34
+ .todo-gantt{display:block;max-width:none}
35
+ .narrative-pane{min-width:0;overflow:auto;background:var(--surface-1)}
36
+ [hidden]{display:none!important}
37
+ .right-toolbar{position:sticky;z-index:3;top:0;display:flex;gap:8px;padding:8px 16px;border-bottom:1px solid var(--border);background:var(--surface-1)}
38
+ .right-toolbar button,.relation-list button,.active-list button,.task-index-list button{padding:6px 8px;border:1px solid var(--border);border-radius:4px;background:var(--surface-2);color:var(--text-primary);font:500 12px/1.6 system-ui,-apple-system,"Hiragino Sans","Yu Gothic UI",sans-serif;text-align:left;cursor:pointer}
39
+ .right-toolbar button:focus-visible,.relation-list button:focus-visible,.active-list button:focus-visible,.task-index-list button:focus-visible{outline:2px solid var(--text-primary);outline-offset:2px}
40
+ .right-content{max-width:72ch;margin:0 auto;padding:16px 24px 48px}
41
+ .right-overview h1,.task-detail h1{margin:0 0 16px;font-size:19px;font-weight:650;line-height:1.45}
42
+ .right-overview h2,.task-detail h2{margin:24px 0 8px;font-size:16px;font-weight:600}
43
+ .status-summary{display:flex;flex-wrap:wrap;gap:8px 16px;margin:16px 0;padding:12px;background:var(--surface-2)}
44
+ .seam-overview{margin:24px 0}.seam-overview>h2{margin-bottom:8px}
45
+ .seam-plan{margin:8px 0;padding:12px;border:1px solid var(--border);border-left:4px solid var(--accent);background:var(--surface-2)}
46
+ .seam-plan>header{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}.seam-plan>header>code{font-weight:650}.seam-component-count{margin-left:auto;color:var(--text-secondary);font-size:12px}
47
+ .seam-coverage{padding:1px 7px;border:1px solid var(--border);border-radius:9999px;background:var(--surface-1);font-size:11px;font-weight:650}.seam-coverage.coverage-missing,.seam-coverage.coverage-stale,.seam-coverage.coverage-superseded{border-color:var(--critical);color:var(--critical)}
48
+ .seam-guidance,.seam-next-action{margin:6px 0 0;color:var(--text-secondary);font-size:12px}.seam-next-action code{color:var(--text-primary);font-weight:650}
49
+ .seam-component{margin-top:10px;padding:10px;border:1px solid var(--border);border-left:4px solid var(--text-secondary);background:var(--surface-1)}.seam-component.verdict-seam_candidate{border-left-color:var(--good)}.seam-component.verdict-intentional_serial{border-left-color:var(--critical)}.seam-component.verdict-unknown_requires_evidence{border-left-color:var(--accent)}
50
+ .seam-component>header{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;font-weight:650}.seam-component>header code{overflow-wrap:anywhere}
51
+ .seam-conflicts,.seam-evidence-needed ul,.seam-reasons ul,.seam-surfaces ul{margin:8px 0 0;padding:0;list-style:none}.seam-conflict{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;padding:8px;border:1px solid var(--border)}.seam-conflict+.seam-conflict{margin-top:6px}
52
+ .seam-target{font-size:13.5px;overflow-wrap:anywhere}.seam-conflict-kind{color:var(--text-secondary);font-size:11px}.seam-pairs{grid-column:1 / -1;display:flex;flex-wrap:wrap;gap:4px 10px}.seam-task-pair{font-weight:650}
53
+ .seam-evidence-needed,.seam-reasons,.seam-surfaces{margin-top:10px}.seam-evidence-needed h4,.seam-reasons h4,.seam-surfaces h4{margin:0;font-size:12px}.seam-evidence-needed li,.seam-reasons li,.seam-surfaces li{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px;padding:5px 8px;background:var(--surface-2)}.seam-evidence-needed li+li,.seam-reasons li+li,.seam-surfaces li+li{margin-top:4px}.seam-evidence-needed li>code{font-weight:650}.seam-evidence-needed li>span,.seam-reasons li>span,.seam-surfaces li>span{color:var(--text-secondary)}
54
+ .seam-tests{margin:8px 0 0;color:var(--text-secondary);font-size:12px}.seam-empty-group{margin-top:8px;border-top:1px solid var(--border)}.seam-empty-group>summary{display:flex;gap:10px;padding:8px 0;cursor:pointer;color:var(--text-secondary)}.seam-empty-group>summary span{margin-left:auto}.seam-plan-compact{border-left-width:1px}
55
+ .phase-overview>p{color:var(--text-secondary)}.phase-overview>ol{display:grid;gap:8px;margin:0;padding:0;list-style:none}.phase-progress{padding:10px 12px;border:1px solid var(--border);border-left-width:4px;background:var(--surface-2)}.phase-progress>header{display:flex;justify-content:space-between;gap:12px}.phase-progress>p{margin:4px 0;color:var(--text-secondary);font-size:12px}.phase-progress progress{display:block;width:100%}.phase-progress.status-accepted{border-left-color:var(--good)}.phase-progress.status-reviewing,.phase-progress.status-gate_ready{border-left-color:var(--accent)}.phase-progress.status-rejected{border-left-color:var(--critical)}
56
+ .active-list,.relation-list{margin:0;padding:0;list-style:none}.active-list li+li,.relation-list li+li{margin-top:8px}
57
+ .active-list button{width:100%}.anchor-status,.readiness-note,.category-description,.relation-empty{color:var(--text-secondary)}
58
+ .task-detail>header{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px}.detail-status,.detail-reference{font-size:12px;font-weight:600}.detail-reference{color:var(--text-secondary)}
59
+ .relation-list button{display:flex;width:100%;flex-direction:column}.relation-list button span{font-weight:400}.relation-kind{display:block;margin-top:4px;color:var(--text-secondary);font-size:12px}
60
+ .task-diagnostics{margin:16px 0;color:var(--text-secondary);font-size:12px}.task-diagnostics summary{cursor:pointer;color:var(--text-primary);font-weight:600}.task-diagnostics dl{display:grid;grid-template-columns:auto 1fr;gap:4px 12px}.task-diagnostics dd{margin:0;overflow-wrap:anywhere}
61
+ .task-index>h1{margin:0 0 8px;font-size:19px;font-weight:650;line-height:1.45}.task-index>p{margin:0 0 24px;color:var(--text-secondary)}
62
+ .task-index-plan+.task-index-plan{margin-top:32px}.task-index-plan h2{margin:0 0 12px;font-size:16px;font-weight:600}.task-index-plan h2 code{font-size:inherit}
63
+ .task-index-list{margin:0;padding:0;list-style:none}.task-index-list li+li{margin-top:8px}.task-index-list button{display:grid;width:100%;grid-template-columns:1.5rem auto minmax(0,1fr);gap:4px 8px;align-items:baseline}
64
+ .task-index-status{grid-row:1 / span 2;color:var(--text-secondary);font-size:13.5px;text-align:center}.task-index-status.status-in-progress{color:var(--accent)}.task-index-status.status-done{color:var(--good)}.task-index-status.status-blocked{color:var(--critical)}
65
+ .task-index-reference{color:var(--text-secondary);font-size:12px;white-space:nowrap}.task-index-list strong{font-size:13.5px;font-weight:600;overflow-wrap:anywhere}.task-index-blocked-reason{grid-column:2 / -1;color:var(--text-secondary);font-size:12px;overflow-wrap:anywhere}
66
+ .todo-gantt text{font-family:system-ui,-apple-system,"Hiragino Sans","Yu Gothic UI",sans-serif;pointer-events:none}
67
+ .todo-node .node-surface{fill:var(--surface-2);stroke:var(--border);stroke-width:1}
68
+ .todo-node .node-meta{fill:var(--text-secondary);font-size:12px;font-weight:500}
69
+ .todo-node .node-title{fill:var(--text-primary);font-size:13.5px;font-weight:400}
70
+ .todo-node .node-title-line{font-size:13.5px;font-weight:400}
71
+ .todo-node .status-mark{fill:var(--text-secondary);font-size:13.5px;font-weight:400}
72
+ .fold-chip{padding:2px 8px;border:1px solid var(--border);border-radius:9999px;background:var(--surface-2);color:var(--text-primary);font:650 13.5px/1.6 system-ui,-apple-system,"Hiragino Sans","Yu Gothic UI",sans-serif}
73
+ button.fold-chip{cursor:pointer}button.fold-chip:focus-visible{outline:2px solid var(--text-primary);outline-offset:2px}
74
+ button.fold-chip[aria-expanded="true"]{border-color:var(--text-primary)}
75
+ [data-diagram][hidden]{display:none}
76
+ .fold-note{flex:1 0 100%;margin:4px 0 0;color:var(--text-secondary);font-weight:400}
77
+ .task-index-folded{margin-top:8px}
78
+ .task-index-folded>summary,.phase-settled>summary{cursor:pointer;padding:6px 0;color:var(--text-secondary);font-weight:600}
79
+ .phase-settled>summary:focus-visible{outline:2px solid var(--text-primary);outline-offset:2px}
80
+ .status-in-progress .node-surface{fill:var(--surface-1);stroke:var(--accent);stroke-width:2}
81
+ .status-in-progress .status-mark{fill:var(--accent)}
82
+ .status-in-progress .status-bar{stroke:var(--accent);stroke-width:2;stroke-linecap:round}
83
+ .status-done .node-surface{fill:var(--surface-2);stroke:var(--border);stroke-width:1}
84
+ .status-done .status-mark{fill:var(--good)}
85
+ .status-blocked .node-surface{fill:var(--surface-1);stroke:var(--critical);stroke-width:2}
86
+ .status-blocked .status-mark{fill:var(--critical)}
87
+ .next-ready-node .node-surface{stroke:var(--accent);stroke-width:2;stroke-dasharray:4 3}
88
+ /* 独立性は記号と色で示す。枠線はstatusとready frontierが使い切っている(ADR 0129)。 */
89
+ .independence-badge{font-size:10px;font-weight:600;letter-spacing:0.02em}
90
+ .independence-verified .independence-badge{fill:var(--good)}
91
+ .independence-conflict .independence-badge{fill:var(--critical)}
92
+ .independence-unknown .independence-badge{fill:var(--text-secondary)}
93
+ .todo-node:focus .node-surface,.selected-node .node-surface{stroke:var(--text-primary);stroke-width:2.5}
94
+ .dependency-edge .edge-route{fill:none;stroke:var(--text-secondary);stroke-width:1.5;stroke-linejoin:round;opacity:.4}
95
+ .dependency-edge .edge-arrow{fill:var(--text-secondary);opacity:.7}
96
+ .longest-chain-edge .edge-route,.selected-incident-edge .edge-route{stroke:var(--text-primary);stroke-width:2.5;opacity:1}
97
+ .longest-chain-edge .edge-arrow,.selected-incident-edge .edge-arrow{fill:var(--text-primary);opacity:1}
98
+ .join-marker circle{fill:var(--text-primary);stroke:none}
99
+ .join-contact-marker{fill:var(--text-primary);stroke:none}.join-connector .edge-route{fill:none;stroke:var(--text-secondary);stroke-width:1.5;opacity:.7}
100
+ .summary-container{fill:var(--surface-1);stroke:var(--border);stroke-width:1;stroke-opacity:.5}
101
+ .summary-chip{fill:var(--surface-2);stroke:none}
102
+ .summary-plan text{fill:var(--text-primary);font-size:12px;font-weight:500}
103
+ .summary-lane text{fill:var(--text-secondary);font-size:12px;font-weight:500}
104
+ .summary-lane{cursor:pointer}
105
+ .lane-dimmed{opacity:.35}
106
+ @media(max-width:900px){body{display:block;height:auto}.shell{display:block}.pane-divider{display:none}.gantt-pane,.narrative-pane{height:70vh}.gantt-pane{border-bottom:1px solid var(--border)}}
107
+ `;