/* Earlyman trace view (2026-10-25): the ONE stylesheet for a trace, shared by the landing-page demo (console-demo.js)
   and the dashboard trace drawer (trace-live.js), both rendered by /site/trace-view.js. Near-monochrome on the Lantern
   tokens; muted red (--bad) only for failures and waste. Motion: transform and opacity only, 150-400 ms; reduced motion
   (OS setting or html.rm) shows end states at once. Moved here from console-demo.css so both pages read the same rules. */
.dc-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: var(--t-base); color: var(--fg-0); }
.dc-h b { font-weight: 500; }
.dc-h > span { font: 400 var(--t-xs)/16px var(--font-mono); color: var(--fg-3); }
.dc-h .dc-link { margin-left: auto; }
.dc-link { appearance: none; border: 0; background: none; padding: 0; color: var(--fg-1); font: 400 var(--t-xs)/16px var(--font-mono); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; white-space: nowrap; }
.dc-link:hover { color: var(--fg-0); text-decoration-color: var(--fg-0); }
.dc-btn { appearance: none; height: 28px; padding: 0 12px; border: 1px solid var(--fg-0); background: var(--fg-0); color: var(--bg-0); font: 500 var(--t-xs)/1 var(--font-mono); cursor: pointer; transition: transform 160ms var(--ease, ease); }
.dc-btn:active { transform: scale(.96); }
.dc-small { margin: 8px 0 0; font: 400 var(--t-xs)/18px var(--font-mono); color: var(--fg-3); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.dc-dl { font: 400 var(--t-xs)/16px var(--font-mono); color: var(--fg-2); white-space: nowrap; }
.dc-dl i { font-style: normal; margin-left: 5px; color: var(--fg-3); }
.dc-dl.worse, .dc-dl.worse i { color: var(--bad); }
.dc-dl.good { color: var(--fg-0); }
.dc-tbl .nm { font-size: var(--t-sm); color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-scroll { overflow-x: auto; max-width: 100%; }
.dc-tbl { width: 100%; border-collapse: collapse; font: 400 var(--t-xs)/16px var(--font-mono); color: var(--fg-1); font-variant-numeric: tabular-nums; }
.dc-tbl th { text-align: right; font-weight: 400; color: var(--fg-3); padding: 6px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.dc-tbl td { text-align: right; padding: 8px; border-bottom: 1px solid var(--line-1); white-space: nowrap; }
.dc-tbl th:first-child, .dc-tbl td:first-child { text-align: left; padding-left: 0; }
.dc-tbl td.nm { font-family: var(--font-ui); max-width: 260px; }
.dc-tbl td.w, .dc-tbl th.w { width: 18%; min-width: 70px; }
.dc-tbl tr[data-dc-go] { cursor: pointer; }
.dc-tbl tbody tr:hover td { background: var(--bg-2); }
.dc-tbl tr.on td { background: var(--bg-2); } .dc-tbl tr.on td:first-child { box-shadow: inset 2px 0 0 var(--fg-0); padding-left: 8px; }
.dc-stats { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 10px 0 12px; border-bottom: 1px solid var(--line-1); margin-bottom: 12px; }
.dc-stats span { display: grid; gap: 2px; font: 400 var(--t-sm)/18px var(--font-mono); color: var(--fg-0); }
.dc-stats i, .dc-io i { font-style: normal; font: 400 10px/14px var(--font-mono); color: var(--fg-3); text-transform: uppercase; letter-spacing: .08em; }
.dc-tdetail { min-width: 0; }
.dc-wf { border-top: 1px solid var(--line-2); }
.dc-wfh, .dc-wf .r { display: grid; grid-template-columns: minmax(150px, 34%) minmax(0, 1fr) 58px 58px; gap: 10px; align-items: center; }
.dc-wfh { padding: 6px 0; font: 400 10px/14px var(--font-mono); color: var(--fg-3); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line-1); }
.dc-wf .r { appearance: none; width: 100%; border: 0; border-bottom: 1px solid var(--line-1); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 4px 0; }
.dc-wf .r:hover { background: var(--bg-2); }
.dc-wf .r.on { background: var(--bg-2); box-shadow: inset 2px 0 0 var(--fg-0); }
.dc-wf .nm { font-size: var(--t-xs); line-height: 16px; color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.dc-wf .nm i { flex: none; width: 6px; height: 6px; background: var(--fg-2); }
.dc-wf .nm i.k-llm { background: var(--fg-0); } .dc-wf .nm i.k-tool { background: none; border: 1px solid var(--fg-2); } .dc-wf .nm i.k-agent { background: var(--fg-3); border-radius: 50%; }
.dc-wf .tl { position: relative; height: 12px; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--line-1) calc(25% - 1px) 25%); }
.dc-wf .tl i { position: absolute; top: 2px; bottom: 2px; background: var(--fg-2); transform-origin: left; }
.dc-wf .r.llm .tl i, .dc-wf .r .tl i { background: var(--fg-2); }
.dc-wf .r.error .tl i, .dc-wf .r.retry .tl i, .dc-wf .r.blocked .tl i { background: var(--bad); }
.dc-wf .r.on .tl i { background: var(--fg-0); }
.dc-wf .r.error .nm, .dc-wf .r.blocked .nm { color: var(--bad); }
.dc-wf .m { font: 400 var(--t-xs)/16px var(--font-mono); color: var(--fg-2); text-align: right; }
.dc-span { margin-top: 12px; padding: 12px 14px; background: var(--bg-2); border-left: 2px solid var(--fg-0); }
.dc-io { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dc-io div { display: grid; gap: 3px; align-content: start; font-size: var(--t-sm); line-height: 18px; color: var(--fg-0); }
.dc-io small { font: 400 var(--t-xs)/16px var(--font-mono); color: var(--fg-3); }
.dc-iotx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.dc-iotx > div { display: grid; gap: 4px; min-width: 0; align-content: start; }
.dc-iotx i { font-style: normal; font: 400 10px/14px var(--font-mono); color: var(--fg-3); text-transform: uppercase; letter-spacing: .08em; }
.dc-iotx pre { margin: 0; padding: 8px 10px; background: var(--bg-1); border: 1px solid var(--line-1); font: 400 var(--t-xs)/17px var(--font-mono); color: var(--fg-1); white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow: auto; }
.dc-verdict { margin: 0 0 12px; padding: 10px 12px; border-left: 2px solid var(--bad); background: var(--bg-2); font-size: var(--t-sm); line-height: 20px; color: var(--fg-1); }
.dc-verdict b { color: var(--fg-0); font-weight: 500; }
/* ---- additions the live drawer needs (the demo never sets these, so it looks the same) ---- */
.dc-h .bad, .dc-stats .bad, .dc-io .bad, .dc-tbl .bad, .dc-cmp .bad { color: var(--bad); }
.dc-wf .r:focus-visible, .dc-link:focus-visible, .dc-btn:focus-visible, .dc-wf .tw:focus-visible { outline: 2px solid var(--fg-0); outline-offset: -2px; }
.dc-wf .nm small { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 400 10.5px/16px var(--font-mono); color: var(--fg-3); }
.dc-wf .r.error .nm small, .dc-wf .r.stuck .nm small { color: var(--bad); opacity: .85; }
.dc-wf .nm .tg { flex: none; font: 400 10px/14px var(--font-mono); font-style: normal; color: var(--fg-1); border: 1px solid var(--line-2); padding: 0 4px; }
.dc-wf .nm .tw { flex: none; width: 12px; margin-left: -14px; margin-right: 2px; color: var(--fg-3); cursor: pointer; text-align: center; font-size: 10px; line-height: 16px; transition: color 150ms var(--ease, ease); }
.dc-wf .nm .tw:hover { color: var(--fg-0); }
.dc-wf .nm i.k-more { width: 6px; height: 0; border-top: 1px dashed var(--fg-3); background: none; }
.dc-wf .r.more .nm { color: var(--fg-3); }
.dc-wf .r.more .tl i { background: var(--line-2); }
.dc-wf .nm i.k-band { background: var(--bad); }
.dc-wf .r.stuck .nm { color: var(--bad); }
.dc-wf .r.stuck .tl i { background: repeating-linear-gradient(135deg, var(--bad) 0 3px, transparent 3px 6px); }
.dc-wf .r.stuck.on .tl i { background: repeating-linear-gradient(135deg, var(--fg-0) 0 3px, transparent 3px 6px); }
.dc-wf .r .tl i { transition: background-color 150ms var(--ease, ease); }
.dc-wf .r { transition: background-color 150ms var(--ease, ease); }
.dc-acts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.dc-iotx .dc-wait { margin: 0; font: 400 var(--t-xs)/18px var(--font-mono); color: var(--fg-3); }
.dc-wfnote { margin: 8px 0 0; font: 400 var(--t-xs)/18px var(--font-mono); color: var(--fg-3); }
.dc-cmp + .dc-cmp { margin-top: 16px; }

/* motion: the waterfall bars grow from the left once per trace, the step panel fades up when the step changes */
.tv-enter .dc-wf .tl i { animation: tv-grow 400ms cubic-bezier(.22, 1, .36, 1) both; }
.dc-span.tv-in { animation: tv-in 240ms cubic-bezier(.22, 1, .36, 1) both; }
@keyframes tv-grow { from { transform: scaleX(0); } }
@keyframes tv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
html.rm .tv-enter .dc-wf .tl i, html.rm .dc-span.tv-in { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .tv-enter .dc-wf .tl i, .dc-span.tv-in { animation: none !important; }
  .dc-wf .r, .dc-wf .r .tl i, .dc-wf .nm .tw { transition: none; }
}

@media (max-width: 760px) {
  .dc-io, .dc-iotx { grid-template-columns: minmax(0, 1fr); }
  .dc-wfh, .dc-wf .r { grid-template-columns: minmax(110px, 42%) minmax(0, 1fr) 46px; }
  .dc-wfh span:last-child, .dc-wf .r .m:last-child { display: none; }
}
/* ticket 4: a context compaction, inline under the agent it happened in */
.dc-wf .nm i.k-compact { width: 7px; height: 7px; background: none; border: 1px dashed var(--fg-2); transform: rotate(45deg); }
.dc-wf .r.compact .nm { color: var(--fg-2); font-style: italic; }
.dc-wf .r.compact .tl i { background: none; border-left: 2px dashed var(--fg-2); width: 0 !important; }
/* U3: incomplete-trace notice above the steps */
.tv-gap { margin: 0 0 10px; padding: 8px 12px; border: 1px dashed var(--line-2); color: var(--fg-1); font-size: 12px; line-height: 1.5; }
.tv-gap b { font-weight: 500; color: var(--fg-0); }
