/* The causal trace view's own look, wherever it is mounted: the experiment
   page or a lesson. Scoped to its root, at the specificity it had as page rules.
   Its layout follows the width of its host, not of the window. */
:where(.trace-view), :where(.trace-view) * { box-sizing: border-box; }
:where(.trace-view) { container: trace-view / inline-size; color: var(--ink-strong); font: 16px/1.65 var(--mono); }
/* A container keeps its first child's margin inside, so that margin goes: the page's spacing above the view stays as it was. */
:where(.trace-view) > .controls:first-child { margin-top: 0; }
:where(.trace-view) h2 { font-size: 1.15rem; margin: 20px 0 8px; }
:where(.trace-view) p { margin: 8px 0 16px; }
:where(.trace-view) a { color: var(--focus); text-underline-offset: 3px; }
:where(.trace-view) .small { font-size: .875rem; overflow-wrap: anywhere; }
:where(.trace-view) .authored { border-left: 3px solid var(--violet); padding-left: 12px; color: var(--violet); }
:where(.trace-view) .controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
:where(.trace-view) label { display: grid; gap: 4px; }
:where(.trace-view) button, :where(.trace-view) select { font: inherit; color: var(--ink-strong); background: var(--cream); border: 1px solid var(--rule); border-radius: 0; padding: 8px 12px; min-height: 44px; max-width: 100%; }
:where(.trace-view) button { cursor: pointer; }
:where(.trace-view) button:disabled { opacity: .55; cursor: default; }
:where(.trace-view) :focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }
:where(.trace-view) .reading { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); gap: 28px; align-items: start; }
:where(.trace-view) .reading > section { min-width: 0; }
:where(.trace-view) .inspector { border-top: 3px solid var(--focus); }
:where(.trace-view) .legend { padding-left: 20px; font-size: .875rem; }
:where(.trace-view) .key { display: inline-block; width: 30px; vertical-align: middle; border-top: 3px solid; }
:where(.trace-view) .causal { color: var(--focus); }
:where(.trace-view) .local { color: var(--rule); border-top-style: dashed; }
:where(.trace-view) .caption-key { color: var(--violet); text-decoration: underline dotted; }
:where(.trace-view) .violation { color: var(--danger); }
:where(.trace-view) .coverage-witness { color: var(--blue); }
:where(.trace-view) .figure-scroll { overflow-x: auto; border: 1px solid var(--rule); }
:where(.trace-view) #timeline { display: block; width: 100%; min-width: 650px; }
:where(.trace-view) .lane { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 7; opacity: .5; }
:where(.trace-view) .local-order { stroke: var(--rule); stroke-width: 3; stroke-dasharray: 4 5; }
:where(.trace-view) [data-emission-root], :where(.trace-view) marker, :where(.trace-view) .branch-key { --branch-ink: hsl(var(--branch-hue) 65% 30%); }
[data-theme="dark"] :where(.trace-view) [data-emission-root], [data-theme="dark"] :where(.trace-view) marker, [data-theme="dark"] :where(.trace-view) .branch-key { --branch-ink: hsl(var(--branch-hue) 65% 65%); }
:where(.trace-view) .branch-key { display: inline-block; margin-right: 12px; color: var(--branch-ink); border-bottom: 3px solid; }
:where(.trace-view) .message { stroke: var(--branch-ink); stroke-width: 2; fill: none; }
:where(.trace-view) .message[data-emission-ancestor="true"] { stroke-width: 4; }
:where(.trace-view) marker path { fill: var(--branch-ink); }
:where(.trace-view) svg text { fill: var(--ink-strong); font: 16px var(--mono); }
:where(.trace-view) svg .node-id { font-weight: 600; }
:where(.trace-view) svg .lane-note { fill: var(--violet); font-size: 14px; text-decoration: underline dotted; }
:where(.trace-view) svg .message-label { font-size: 15px; }
:where(.trace-view) .message-backing { fill: var(--cream); }
:where(.trace-view) .label-leader { stroke: var(--ink-strong); stroke-width: 1.75; stroke-dasharray: 2 3; pointer-events: none; }
:where(.trace-view) .outside-cone { opacity: .9; }
:where(.trace-view) .message.outside-cone, :where(.trace-view) .local-order.outside-cone { opacity: .25; }
:where(.trace-view) .outside-cone:hover, :where(.trace-view) .outside-cone:focus-within { opacity: 1; }
:where(.trace-view) .message-caption.outside-cone { opacity: 1; }
:where(.trace-view) .message-caption.outside-cone .message-label { opacity: .8; }
:where(.trace-view) .message-caption.outside-cone:hover .message-label { opacity: 1; }
:where(.trace-view) .activation { cursor: pointer; }
:where(.trace-view) .activation circle { fill: var(--cream); stroke: var(--branch-ink); stroke-width: 2; }
:where(.trace-view) .activation[aria-pressed="true"] circle { fill: var(--branch-ink); }
:where(.trace-view) .activation[aria-pressed="true"] text { fill: var(--cream); }
:where(.trace-view) .activation[data-emission-ancestor="true"] circle { stroke-width: 3; }
:where(.trace-view) .activation.violation circle { stroke: var(--danger); fill: var(--danger); }
:where(.trace-view) .activation.violation text { fill: var(--cream); }
:where(.trace-view) .activation.violation .endpoint-label { fill: var(--danger); }
:where(.trace-view) .activation.coverage-witness circle { stroke: var(--blue); }
:where(.trace-view) .activation.coverage-witness[aria-pressed="true"] circle { fill: var(--blue); }
:where(.trace-view) .activation.coverage-witness .endpoint-label { fill: var(--blue); }
:where(.trace-view) .endpoint-label { font-size: 14px; }
:where(.trace-view) .endpoint-status { font-weight: 600; }
:where(.trace-view) .activation:focus { outline: none; }
:where(.trace-view) .activation:focus-visible circle { stroke: var(--violet); stroke-width: 5; }
:where(.trace-view) dl { margin: 8px 0; }
:where(.trace-view) dt { font-weight: bold; margin-top: 8px; }
:where(.trace-view) dd { margin: 0 0 10px; overflow-wrap: anywhere; }
:where(.trace-view) code { overflow-wrap: anywhere; }
:where(.trace-view) details { border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 12px; }
:where(.trace-view) summary { cursor: pointer; min-height: 44px; }
:where(.trace-view) pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.6 var(--mono); background: var(--cream-raised); padding: 16px; }
:where(.trace-view) #list { padding-left: 28px; }
:where(.trace-view) #list button { text-align: left; width: 100%; margin: 6px 0; }
:where(.trace-view) #list button[aria-pressed="true"] { border: 2px solid var(--focus); }
:where(.trace-view) #list button.violation { border-color: var(--danger); }
:where(.trace-view) [hidden] { display: none !important; }
@container trace-view (max-width: 900px) { :where(.trace-view) .reading { grid-template-columns: 1fr; } }
@container trace-view (max-width: 500px) { :where(.trace-view) .controls { align-items: stretch; } :where(.trace-view) select { width: 100%; } }
