/* DAG: white canvas, dark labels, and distinct status colors. */
.dag-page {
  --dag-ink: #172b4d;
  --dag-muted: #52627a;
  --dag-line: #dce3ed;
  --dag-blue: #2563eb;
  --dag-green: #16804a;
  --dag-orange: #b45309;
  --dag-red: #dc2626;
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: #f6f8fb; color: var(--dag-ink); overflow: auto;
}
.dag-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 23px 32px; background: #fff; border-bottom: 1px solid #e4e9f0; flex-shrink: 0; }
.dag-heading { display: flex; align-items: center; gap: 12px; }
.dag-heading h1 { font-size: 1.25rem; font-weight: 650; margin: 5px 0; color: #12233f; }
.dag-eyebrow { font-size: .6875rem; letter-spacing: 1.2px; color: #69788f; }
.dag-header-actions { display: flex; gap: 9px; align-items: center; }
.dag-header-actions .quiet-button { border: 1px solid #d8e0ec; background: #fff; color: #334866; font-size: .8125rem; white-space: nowrap; }
.dag-header-actions .quiet-button:hover { background: #f1f5fc; border-color: #9bafcb; }
.dag-content { padding: 24px 30px 22px; display: flex; flex-direction: column; gap: 18px; flex: 1 0 auto; }
.dag-task-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dag-task-picker { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 12px; font-size: .8125rem; color: #465570; }
.dag-task-picker select { width: min(600px,100%); min-width: 0; background: #fff; padding: 11px 34px 11px 13px; font-size: .8125rem; color: #233b60; border: 1px solid #ccd7e5; border-radius: 8px; }
.dag-task-meta { display: flex; align-items: center; gap: 12px; font-size: .75rem; color: #52627a; }
.dag-task-meta > span:first-child { padding: 5px 10px; background: #eef2f7; border: 1px solid #dce3ed; border-radius: 5px; color: #475569; font-weight: 600; }
#dag-task-status[data-status="running"], #dag-task-status[data-status="starting"] { color: #1d4ed8; border-color: #b8d2ff; background: #eff6ff; }
#dag-task-status[data-status="completed"] { color: #166534; border-color: #b7dfc5; background: #f0fdf4; }
#dag-task-status[data-status="failed"] { color: #b91c1c; border-color: #fecaca; background: #fff1f2; }
#dag-task-status[data-status="partial"], #dag-task-status[data-status="stopped"], #dag-task-status[data-status="interrupted"] { color: #9a3412; border-color: #fed7aa; background: #fff7ed; }
.dag-board { border: 1px solid #d5deeb; border-radius: 10px; overflow: hidden; background: #fff; flex-shrink: 0; box-shadow: 0 3px 14px #0f2c4d05; }
.dag-board:fullscreen { display: flex; flex-direction: column; width: 100%; height: 100%; border-radius: 0; background: #fff; }
.dag-board:fullscreen .dag-viewport { height: auto; flex: 1; }
.dag-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.dag-toolbar-title { display: flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 600; color: #213a60; }
.dag-toolbar-title > span:first-child { width: 8px; height: 8px; border-radius: 2px; background: #3b82f6; box-shadow: 0 0 0 4px #eff6ff; }
.dag-toolbar-title small { padding: 4px 8px; border-radius: 5px; background: #f1f5f9; color: #53647d; font-size: .6875rem; font-weight: 500; }
.dag-tools { display: flex; gap: 6px; align-items: center; }
.dag-tools button { border: 1px solid #d8e0eb; background: #fff; color: #3d5170; border-radius: 6px; padding: 6px 10px; font-size: .75rem; min-height: 31px; }
.dag-tools button:hover { background: #eff6ff; border-color: #a1bde6; color: #1d4ed8; }
.dag-tools button:disabled { opacity: .4; cursor: default; }
.dag-tools output { min-width: 46px; text-align: center; font-size: .75rem; color: #344b6b; font-variant-numeric: tabular-nums; }
.dag-follow { display: flex; align-items: center; gap: 5px; color: #465b79; font-size: .75rem; margin-right: 8px; white-space: nowrap; }
.dag-follow input { accent-color: #2563eb; }
.dag-page button:focus-visible, .dag-page select:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.dag-viewport { position: relative; height: clamp(370px,49vh,600px); min-height: 320px; overflow: auto; background-color: #fcfdff; background-image: radial-gradient(#dbe3ef .7px,transparent .7px); background-size: 18px 18px; overscroll-behavior: contain; cursor: grab; scrollbar-gutter: stable; }
.dag-viewport.dragging { cursor: grabbing; user-select: none; }
.dag-viewport:focus-visible { outline: 2px solid #2563eb; outline-offset: -3px; }
.dag-space { position: relative; margin: 16px auto; flex-shrink: 0; }
.dag-plane { position: absolute; left: 0; top: 0; width: 1336px; height: 500px; transform-origin: 0 0; }
.dag-plane svg { position: absolute; inset: 0; width: 1336px; height: 500px; pointer-events: none; overflow: visible; }
.dag-section-label { position: absolute; font-size: 12px; font-weight: 600; letter-spacing: 1px; color: #4f6381; pointer-events: none; }
.dag-section-label.execution { left: 32px; top: 34px; }
.dag-section-label.reporting { left: 372px; top: 298px; }
.dag-section-label.output { left: 1132px; top: 34px; }
.dag-merge-label { position: absolute; left: 390px; top: 225px; color: #64748b; font-size: 11px; letter-spacing: .4px; padding: 2px 6px; background: #fcfdff; }
.dag-report-group { position: absolute; left: 232px; top: 282px; width: 884px; height: 194px; border: 1px dashed #cbd7e6; border-radius: 10px; background: #f4f7fc70; pointer-events: none; }
.dag-edge { stroke: #9aaec5; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.dag-edge.completed { stroke: #20a363; stroke-width: 2; }
.dag-edge.running { stroke: #2563eb; stroke-width: 2.5; stroke-dasharray: 8 5; animation: dag-flow 1.1s linear infinite; }
.dag-edge.partial { stroke: #d97706; stroke-width: 2; }
.dag-edge.skipped { stroke: #b7c3d2; stroke-dasharray: 4 5; }
.dag-arrow { stroke: #9aaec5; }
.dag-arrow.completed { stroke: #20a363; }
.dag-arrow.running { stroke: #2563eb; }
.dag-arrow.partial { stroke: #d97706; }
.dag-arrow.skipped { stroke: #b7c3d2; }
.dag-node { --node-color: #64748b; --node-soft: #f1f5f9; position: absolute; width: 184px; height: 124px; text-align: left; display: flex; flex-direction: column; background: #fff; border: 1px solid #c7d3e2; border-left: 3px solid #a9b9cd; border-radius: 8px; padding: 12px 13px 11px 12px; color: #334155; box-shadow: 0 3px 9px #142d4a09; cursor: pointer; transition: border-color .18s,box-shadow .18s,background-color .18s; overflow: hidden; }
.dag-node:hover { box-shadow: 0 5px 16px #173b6617; border-color: #7c9abd; }
.dag-node.selected { outline: 2px solid #536b8d; outline-offset: 4px; }
.dag-node-heading { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.dag-node-heading strong { font-size: 16px; line-height: 24px; font-weight: 650; color: #172b4d; }
.dag-node-symbol { display: flex; align-items: center; justify-content: center; width: 27px; height: 27px; border-radius: 6px; background: var(--node-soft); color: var(--node-color); flex-shrink: 0; }
.dag-node-symbol svg { position: static; width: 18px; height: 18px; }
.dag-node-english { font-size: 10.5px; line-height: 15px; color: #64748b; padding-left: 35px; margin-top: -1px; letter-spacing: 0; white-space: nowrap; }
.dag-node-description { display: block; font-size: 12px; line-height: 18px; margin-top: 7px; padding-left: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; color: #475569; }
.dag-node-state { display: flex; align-items: center; align-self: flex-start; gap: 5px; margin-top: auto; padding: 2px 6px; border-radius: 4px; background: var(--node-soft); font-size: 11px; line-height: 16px; font-weight: 600; color: var(--node-color); }
.dag-node-state i { display: flex; align-items: center; justify-content: center; width: 11px; height: 11px; font-size: 10px; font-style: normal; line-height: 1; flex-shrink: 0; }
.dag-node-state i::before { content: '·'; font-size: 18px; }
.dag-node.completed { --node-color: #16743f; --node-soft: #e9f8ee; border-color: #acd9bd; border-left-color: #16a34a; background: #fff; }
.dag-node.completed .dag-node-state i::before { content: '✓'; font-size: 11px; }
.dag-node.running { --node-color: #1d4ed8; --node-soft: #dbeafe; border-color: #3b82f6; border-left-color: #2563eb; background: #f0f6ff; box-shadow: 0 0 0 3px #2563eb12,0 4px 14px #2563eb14; }
.dag-node.running .dag-node-state i { border: 1.5px solid #93b4ff; border-top-color: #1d4ed8; border-right-color: #1d4ed8; border-radius: 50%; animation: dag-spin .9s linear infinite; }
.dag-node.running .dag-node-state i::before { content: ''; }
.dag-node.failed { --node-color: #b91c1c; --node-soft: #fee2e2; border-color: #f5a3a3; border-left-color: #dc2626; background: #fff7f7; }
.dag-node.failed .dag-node-state i::before { content: '×'; font-size: 15px; }
.dag-node.partial, .dag-node.stopped, .dag-node.interrupted, .dag-node.stopping { --node-color: #9a4409; --node-soft: #ffedd5; border-color: #f0c392; border-left-color: #d97706; background: #fffbf5; }
.dag-node.partial .dag-node-state i::before, .dag-node.interrupted .dag-node-state i::before { content: '!'; font-size: 11px; }
.dag-node.stopped .dag-node-state i::before, .dag-node.stopping .dag-node-state i::before { content: 'Ⅱ'; font-size: 10px; }
.dag-node.skipped { --node-color: #64748b; --node-soft: #eaf0f6; border: 1px dashed #aab9cd; border-left-width: 3px; background: #f8fafc; box-shadow: none; }
.dag-node.skipped .dag-node-heading strong { color: #53657d; }
.dag-node.skipped .dag-node-state i::before { content: '−'; font-size: 13px; }
.dag-node.unknown, .dag-node.legacy { --node-color: #64748b; border-style: dashed; }
.dag-node.queued { --node-color: #6941c6; --node-soft: #f0eafe; border-color: #c6b5ef; border-left-color: #8b5cf6; }
.dag-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: #64748b; text-align: center; padding: 30px; }
.dag-empty span { font: 2rem/1 Consolas,monospace; color: #93a9c7; }
.dag-empty strong { font-size: 1rem; font-weight: 550; color: #334b70; }
.dag-empty p { margin: 0; font-size: .8125rem; line-height: 1.8; }
.dag-board-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 13px 18px; border-top: 1px solid #e2e8f0; font-size: .6875rem; color: #64748b; background: #fff; }
.dag-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .75rem; color: #465570; }
.dag-legend span { display: flex; align-items: center; gap: 6px; }
.dag-legend i { width: 8px; height: 8px; border-radius: 2px; background: #94a3b8; }
.dag-legend .running i { background: #2563eb; }
.dag-legend .completed i { background: #16a34a; }
.dag-legend .partial i { background: #d97706; }
.dag-legend .failed i { background: #dc2626; }
.dag-legend .skipped i { background: #f8fafc; border: 1px dashed #8b9db6; }
.dag-summary-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: .8125rem; color: #233b60; }
.dag-current { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dag-current-caption { font-size: .6875rem; font-weight: 500; color: #64748b; }
#dag-current { font-weight: 600; }
.dag-current > i { width: 8px; height: 8px; background: #94a3b8; border-radius: 50%; }
.dag-page[data-current-status="running"] .dag-current > i { background: #2563eb; box-shadow: 0 0 0 4px #dbeafe; }
.dag-page[data-current-status="running"] #dag-current { color: #1d4ed8; }
.dag-page[data-current-status="completed"] .dag-current > i { background: #16a34a; }
.dag-page[data-current-status="failed"] .dag-current > i { background: #dc2626; }
.dag-page[data-current-status="failed"] #dag-current { color: #b91c1c; }
.dag-page[data-current-status="partial"] .dag-current > i, .dag-page[data-current-status="stopped"] .dag-current > i, .dag-page[data-current-status="interrupted"] .dag-current > i { background: #d97706; }
.dag-summary-line small { font-size: .6875rem; color: #64748b; white-space: nowrap; }
.dag-detail { flex-shrink: 0; border: 1px solid #d9e2ee; background: #fff; border-radius: 10px; overflow: hidden; }
.dag-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 21px 0; }
.dag-detail-title { display: flex; align-items: center; gap: 12px; }
.dag-detail-title h2 { font-size: .9375rem; font-weight: 600; margin: 0; color: #172b4d; }
.dag-status { font-size: .6875rem; font-weight: 600; color: #475569; border-radius: 4px; padding: 4px 8px; background: #f1f5f9; }
.dag-status.running { color: #1d4ed8; background: #eaf2ff; }
.dag-status.completed { color: #16743f; background: #e9f8ee; }
.dag-status.failed { color: #b91c1c; background: #fee2e2; }
.dag-status.partial, .dag-status.stopped, .dag-status.interrupted, .dag-status.stopping { color: #9a4409; background: #ffedd5; }
.dag-status.queued { color: #6941c6; background: #f0eafe; }
.dag-detail-header > span { font-size: .6875rem; color: #64748b; }
.dag-detail-body { display: grid; grid-template-columns: minmax(220px,.8fr) minmax(0,1.5fr); gap: 24px; padding: 16px 21px 20px; }
.dag-detail-description { font-size: .8125rem; line-height: 1.9; color: #475569; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 150px; overflow: auto; margin: 0 0 15px; }
.dag-detail-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 20px; margin: 0; }
.dag-detail-metrics dt { font-size: .6875rem; color: #64748b; margin-bottom: 5px; }
.dag-detail-metrics dd { font-size: .75rem; color: #334b6b; margin: 0; overflow-wrap: anywhere; }
.dag-events { max-height: 248px; overflow: auto; min-width: 0; }
.dag-event { border-left: 2px solid #ccd8eb; padding: 0 0 0 13px; margin-bottom: 14px; }
.dag-event header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .6875rem; color: #64748b; }
.dag-event-id { font-family: Consolas,monospace; color: #2563eb; font-weight: 600; }
.dag-event small { font-size: .6875rem; }
.dag-event pre { font-family: Consolas,'Microsoft YaHei UI',monospace; font-size: .75rem; white-space: pre-wrap; overflow-wrap: anywhere; color: #3c506e; line-height: 1.8; margin: 6px 0 0; max-height: 105px; overflow: auto; }
.dag-event-empty { font-size: .8125rem; color: #64748b; padding: 15px 0; line-height: 1.9; }
.dag-page-note { margin: 0; padding: 0 2px; color: #64748b; font-size: .6875rem; line-height: 1.9; }
.dag-stale .dag-edge.running, .dag-stale .dag-node.running .dag-node-state i, .page-hidden .dag-edge, .page-hidden .dag-node-state i { animation-play-state: paused; }
@keyframes dag-flow { to { stroke-dashoffset: -26; } }
@keyframes dag-spin { to { transform: rotate(360deg); } }
@media(max-width:1100px) {
  .dag-header { padding: 20px 22px; } .dag-content { padding: 20px; }
  .dag-detail-body { grid-template-columns: minmax(0,1fr); }
  .dag-events { border-top: 1px solid #e2e8f0; padding-top: 15px; }
  .dag-tools { flex-wrap: wrap; }
}
@media(max-width:700px) {
  .dag-header { padding: 16px; flex-wrap: wrap; } .dag-content { padding: 16px 12px; }
  .dag-header-actions { margin-left: auto; } .dag-task-picker { min-width: 100%; flex-wrap: wrap; }
  .dag-task-picker select { width: 100%; } .dag-toolbar { padding: 12px; }
  .dag-toolbar-title { width: 100%; } .dag-tools { gap: 4px; } .dag-follow { margin-right: 3px; }
  .dag-viewport { height: 390px; } .dag-detail-body { padding: 14px; }
  .dag-detail-header { padding: 16px 14px 0; } .dag-detail-metrics { gap: 13px; }
  .dag-summary-line { align-items: flex-start; } .dag-summary-line small { max-width: 115px; text-align: right; white-space: normal; }
  .dag-board-footer { padding: 12px; } .dag-legend { gap: 10px; }
}
@media(prefers-reduced-motion:reduce) { .dag-edge, .dag-node-state i { animation: none!important; } .dag-node { transition: none; } }
