:root {
  color-scheme: dark;
  --c-0f172a: #0f172a;
  --c-1e293b: #1e293b;
  --c-334155: #334155;
  --c-475569: #475569;
  --c-94a3b8: #94a3b8;
  --c-cbd5e1: #cbd5e1;
  --c-e2e8f0: #e2e8f0;
  --c-f1f5f9: #f1f5f9;
  --c-111827: #111827;
  --c-1f2937: #1f2937;
  --c-374151: #374151;
  --c-9ca3af: #9ca3af;
  --c-d1d5db: #d1d5db;
  --c-e5e7eb: #e5e7eb;
  --c-f9fafb: #f9fafb;
  --c-2d3d55: #2d3d55;
  --c-1a2332: #1a2332;
  --c-131f35: #131f35;
  --c-0f1f35: #0f1f35;
  --c-0b1629: #0b1629;
  --c-0d1f38: #0d1f38;
  --c-1a2e4a: #1a2e4a;
  --c-0c1a40: #0c1a40;
  --c-1c1917: #1c1917;
  --c-60a5fa: #60a5fa;
  --c-93c5fd: #93c5fd;
  --c-bfdbfe: #bfdbfe;
  --c-1e3a5f: #1e3a5f;
  --c-4b6ea8: #4b6ea8;
  --c-f87171: #f87171;
  --c-fca5a5: #fca5a5;
  --c-7f1d1d: #7f1d1d;
  --c-991b1b: #991b1b;
  --c-450a0a: #450a0a;
  --c-34d399: #34d399;
  --c-6ee7b7: #6ee7b7;
  --c-4ade80: #4ade80;
  --c-064e3b: #064e3b;
  --c-065f46: #065f46;
  --c-052e16: #052e16;
  --c-166534: #166534;
  --c-fbbf24: #fbbf24;
  --c-fcd34d: #fcd34d;
  --c-92400e: #92400e;
  --c-78350f: #78350f;
  --c-854d0e: #854d0e;
  --c-713f12: #713f12;
  --c-422006: #422006;
  --c-1c1a00: #1c1a00;
  --c-1c1400: #1c1400;
  --c-1c1208: #1c1208;
  --c-fb923c: #fb923c;
  --c-fed7aa: #fed7aa;
  --c-7c2d12: #7c2d12;
  --c-431407: #431407;
  --c-a78bfa: #a78bfa;
  --c-c084fc: #c084fc;
  --c-3b0764: #3b0764;
  --c-2e1065: #2e1065;
  --c-1e1b4b: #1e1b4b;
  --c-2d1f5e: #2d1f5e;
  --c-7c6aad: #7c6aad;
  --c-38bdf8: #38bdf8;
  --c-fb7185: #fb7185;
  /* REQ-S-0340: 事务明细"分身自动完成"行（绿系低饱和背景+可读前景） */
  --c-task-auto-done-bg: rgba(74,222,128,0.13);
  --c-task-auto-done-fg: #86efac;
  /* REQ-S-0374: 交付物条目未完成态底色（生成中/失败；已生成复用上方绿系） */
  --c-deliv-idle-bg: rgba(148,163,184,0.10);
  /* REQ-S-0347: 事务板任务词元四态色（深色）——分身完成复用上方绿系；
     我完成=灰、处理中=蓝、待启动=描边灰。阶段带亮/暗二态。
     验收修正二：底色加深（配组件层彩色描边），生产深色下四态可分辨。 */
  --c-tok-user-done-bg: rgba(148,163,184,0.26);
  --c-tok-user-done-fg: #e2e8f0;
  --c-tok-doing-bg: rgba(59,130,246,0.32);
  --c-tok-doing-fg: #bfdbfe;
  --c-tok-todo-bg: rgba(148,163,184,0.10);
  --c-tok-todo-fg: #94a3b8;
  --c-stage-on: #60a5fa;
  --c-stage-off: #475569;
  --c-w04: rgba(255,255,255,0.04);
  --c-w05: rgba(255,255,255,0.05);
  --c-w06: rgba(255,255,255,0.06);
  --c-w08: rgba(255,255,255,0.08);
  --c-w10: rgba(255,255,255,0.1);
  --c-a08: rgba(96,165,250,0.08);
  --c-a10: rgba(96,165,250,0.1);
}

html.light {
  color-scheme: light;
  --c-0f172a: #f1f5f9;
  --c-1e293b: #ffffff;
  --c-334155: #cbd5e1;
  --c-475569: #94a3b8;
  --c-94a3b8: #64748b;
  --c-cbd5e1: #334155;
  --c-e2e8f0: #1e293b;
  --c-f1f5f9: #0f172a;
  --c-111827: #f3f4f6;
  --c-1f2937: #ffffff;
  --c-374151: #d1d5db;
  --c-9ca3af: #6b7280;
  --c-d1d5db: #374151;
  --c-e5e7eb: #374151;
  --c-f9fafb: #111827;
  --c-2d3d55: #e2e8f0;
  --c-1a2332: #f8fafc;
  --c-131f35: #f8fafc;
  --c-0f1f35: #eff6ff;
  --c-0b1629: #f1f5f9;
  --c-0d1f38: #eff6ff;
  --c-1a2e4a: #dbeafe;
  --c-0c1a40: #e0e7ff;
  --c-1c1917: #f5f5f4;
  --c-60a5fa: #2563eb;
  --c-93c5fd: #1d4ed8;
  --c-bfdbfe: #1e40af;
  --c-1e3a5f: #dbeafe;
  --c-4b6ea8: #93c5fd;
  --c-f87171: #dc2626;
  --c-fca5a5: #b91c1c;
  --c-7f1d1d: #fecaca;
  --c-991b1b: #fca5a5;
  --c-450a0a: #fee2e2;
  --c-34d399: #059669;
  --c-6ee7b7: #047857;
  --c-4ade80: #16a34a;
  --c-064e3b: #d1fae5;
  --c-065f46: #a7f3d0;
  --c-052e16: #dcfce7;
  --c-166534: #bbf7d0;
  --c-fbbf24: #d97706;
  --c-fcd34d: #b45309;
  --c-92400e: #fde68a;
  --c-78350f: #fef3c7;
  --c-854d0e: #fde68a;
  --c-713f12: #fef3c7;
  --c-422006: #fef9c3;
  --c-1c1a00: #fefce8;
  --c-1c1400: #fef9c3;
  --c-1c1208: #fffbeb;
  --c-fb923c: #ea580c;
  --c-fed7aa: #9a3412;
  --c-7c2d12: #ffedd5;
  --c-431407: #ffedd5;
  --c-a78bfa: #7c3aed;
  --c-c084fc: #9333ea;
  --c-3b0764: #f3e8ff;
  --c-2e1065: #ede9fe;
  --c-1e1b4b: #e0e7ff;
  --c-2d1f5e: #ede9fe;
  --c-7c6aad: #8b5cf6;
  --c-38bdf8: #0284c7;
  --c-fb7185: #e11d48;
  /* REQ-S-0340: 事务明细"分身自动完成"行（浅色主题对应色） */
  --c-task-auto-done-bg: #dcfce7;
  --c-task-auto-done-fg: #15803d;
  /* REQ-S-0374: 交付物条目未完成态底色（浅色对应） */
  --c-deliv-idle-bg: #f1f5f9;
  /* REQ-S-0347: 事务板任务词元四态色（浅色对应；验收修正二同步加深） */
  --c-tok-user-done-bg: #cbd5e1;
  --c-tok-user-done-fg: #334155;
  --c-tok-doing-bg: #bfdbfe;
  --c-tok-doing-fg: #1d4ed8;
  --c-tok-todo-bg: #f1f5f9;
  --c-tok-todo-fg: #64748b;
  --c-stage-on: #2563eb;
  --c-stage-off: #cbd5e1;
  --c-w04: rgba(0,0,0,0.04);
  --c-w05: rgba(0,0,0,0.05);
  --c-w06: rgba(0,0,0,0.08);
  --c-w08: rgba(0,0,0,0.10);
  --c-w10: rgba(0,0,0,0.12);
  --c-a08: rgba(37,99,235,0.08);
  --c-a10: rgba(37,99,235,0.10);
}

/* Floating theme toggle (bottom-right, injected by theme.js) */
#theme-toggle-btn {
  position: fixed; bottom: 20px; right: 20px; z-index: 10000;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--c-334155);
  background: var(--c-1e293b); color: var(--c-e2e8f0);
  font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
#theme-toggle-btn:hover { border-color: #3b82f6; transform: scale(1.04); }

/* Branded confirm dialog (REQ-S-0332, injected by theme.js) */
#aeon-confirm-overlay {
  position: fixed; inset: 0; z-index: 20000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
}
#aeon-confirm-box {
  min-width: 300px; max-width: 420px; margin: 16px;
  background: var(--c-1e293b); color: var(--c-e2e8f0);
  border: 1px solid var(--c-334155); border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
#aeon-confirm-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
#aeon-confirm-msg {
  font-size: 14px; line-height: 1.6; color: var(--c-cbd5e1);
  word-break: break-word; white-space: pre-wrap;
}
#aeon-confirm-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px;
}
#aeon-confirm-actions button {
  padding: 7px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer;
}
#aeon-confirm-cancel {
  background: transparent; color: var(--c-cbd5e1);
  border: 1px solid var(--c-475569);
}
#aeon-confirm-cancel:hover { border-color: var(--c-94a3b8); }
#aeon-confirm-ok {
  background: #3b82f6; color: #fff; border: 1px solid #3b82f6;
}
#aeon-confirm-ok:hover { background: #2563eb; border-color: #2563eb; }
