/* aud-trace · /ai-agents/audit hero · "the kept trace". Every selector is scoped under .aud-trace (sub-prefix aud-tr-).
   Final frame by default (no JS, reduced motion, print). .is-live rewinds to the bare track; the cumulative phase classes
   .aud-tr-p0 … .aud-tr-p5 (set by asset.js from one clock) restore it in order. asset.js writes only stroke-dashoffset inline.
   .is-sim kills transitions so ?sim frames are exact. Wide composition >= 420px figure; compact at <= 760px or a figure < 420px. */
.aud-trace{
  --aud-tr-t2:var(--t2,200ms); --aud-tr-t3:var(--t3,320ms); --aud-tr-t4:var(--t4,560ms);
  --aud-tr-ease:var(--ease,cubic-bezier(.25,1,.5,1));
  --aud-tr-okr:#B6D7BD;                  /* ALLOWED at rest: 50% ok-d over w-85, 10.9:1 on --dk */
  --aud-tr-dnr:#E8A7A7;                  /* DENIED at rest: 50% deny-d over w-85, 8.6:1 */
  --aud-tr-rail:rgba(255,255,255,.2);    /* the track: V14's floor, the ag-siding strength */
  --aud-tr-ink:var(--w-60,rgba(255,255,255,.6));
  --aud-tr-ink-live:var(--w-85,rgba(255,255,255,.85));
  container:aud-tr / inline-size;
  position:relative;margin:0;width:100%;min-width:0;text-align:right;color:#fff;
}
.aud-trace .aud-tr-stage{position:relative;height:340px}
.aud-trace .aud-tr-svg{position:absolute;right:0;top:0;display:block;overflow:visible}
.aud-trace .aud-tr-c{display:none}
.aud-trace .aud-tr-svg path{fill:none;stroke-linecap:butt;stroke-linejoin:miter}
.aud-trace .aud-tr-rail{stroke:var(--aud-tr-rail);stroke-width:1px}
.aud-trace .aud-tr-ink{stroke:var(--aud-tr-ink);stroke-width:1.5px}
.aud-trace .aud-tr-head{stroke:#fff;stroke-width:1.5px;stroke-dasharray:20 800;stroke-dashoffset:0;opacity:0}

/* the two record blocks: right-aligned, 40px in from the stage's right edge (22.75px clear of the inner strand) */
.aud-trace .aud-tr-rec{position:absolute;right:40px;margin:0;white-space:nowrap}
.aud-trace .aud-tr-rec-d{top:91px}
.aud-trace .aud-tr-rec-a{top:271px}
/* white-space on the p itself: v4.css sets p{text-wrap:pretty}, which would re-enable wrapping under an inherited nowrap */
.aud-trace .aud-tr-l1,.aud-trace .aud-tr-l2{margin:0;font:400 13px/20px var(--mono);color:var(--w-85,rgba(255,255,255,.85));white-space:nowrap}
.aud-trace .aud-tr-l2{margin-top:2px}
.aud-trace .aud-tr-dim{color:var(--w-60,rgba(255,255,255,.6))}
.aud-trace .aud-tr-who{font:450 14px/20px var(--sans);letter-spacing:-.005em;color:var(--w-85,rgba(255,255,255,.85))}
.aud-trace .aud-tr-sep{margin:0 8px;color:var(--w-45,rgba(255,255,255,.45))}
.aud-trace .aud-tr-out{font:500 11px/16px var(--mono);letter-spacing:.08em;text-transform:uppercase;margin-right:-.08em}
.aud-trace .aud-tr-ok{color:var(--aud-tr-okr)}
.aud-trace .aud-tr-deny{color:var(--aud-tr-dnr)}
.aud-trace .aud-tr-cap{margin:0;padding-right:40px;white-space:nowrap;font:400 11px/16px var(--mono);color:var(--w-60,rgba(255,255,255,.6))}

/* ---------- live: rewind to t0 (the bare track with its crimp; the Authorizer is there before any call arrives) ---------- */
.aud-trace.is-live .aud-tr-ink{stroke:var(--aud-tr-ink-live);stroke-dasharray:400 400;stroke-dashoffset:400;
  transition:stroke var(--aud-tr-t4) var(--aud-tr-ease)}
.aud-trace.is-live .aud-tr-head{opacity:0;transition:opacity var(--aud-tr-t3) var(--aud-tr-ease)}
.aud-trace.is-live .aud-tr-rec{opacity:0;transition:opacity var(--aud-tr-t3) var(--aud-tr-ease)}
.aud-trace.is-live .aud-tr-out{transition:color var(--aud-tr-t4) var(--aud-tr-ease)}
.aud-trace.is-live .aud-tr-ok{color:var(--ok-d,#8FD19E)}
.aud-trace.is-live .aud-tr-deny{color:var(--deny-d,#F47272)}
/* call 1 (outer strand) */
.aud-trace.is-live.aud-tr-p0 .aud-tr-head-a{opacity:1;transition-duration:var(--aud-tr-t2)}
.aud-trace.is-live.aud-tr-p1 .aud-tr-head-a{opacity:0;transition-duration:var(--aud-tr-t3)}
.aud-trace.is-live.aud-tr-p1 .aud-tr-rec-a{opacity:1}
.aud-trace.is-live.aud-tr-p2 .aud-tr-ok{color:var(--aud-tr-okr)}
.aud-trace.is-live.aud-tr-p2 .aud-tr-ink-a{stroke:var(--aud-tr-ink)}
/* call 2 (inner strand) */
.aud-trace.is-live.aud-tr-p3 .aud-tr-head-d{opacity:1;transition-duration:var(--aud-tr-t2)}
.aud-trace.is-live.aud-tr-p4 .aud-tr-head-d{opacity:0;transition-duration:var(--aud-tr-t3)}
.aud-trace.is-live.aud-tr-p4 .aud-tr-rec-d{opacity:1}
.aud-trace.is-live.aud-tr-p5 .aud-tr-deny{color:var(--aud-tr-dnr)}
.aud-trace.is-live.aud-tr-p5 .aud-tr-ink-d{stroke:var(--aud-tr-ink)}
.aud-trace.is-sim,.aud-trace.is-sim *{transition:none!important}

/* ---------- <= 1100: the row is 560 | 64 | 428 (never under 420: the page grid's minmax); the wide composition holds,
   since the widest line is 351 + 40 = 391. The labels keep their 40px offset; nothing else changes until the compact recompose. ---------- */
@media (max-width:1100px){
  .aud-trace .aud-tr-rec{right:40px}
}

/* ---------- compact: recomposed, not shrunk. Shorter track, crimp moved up, type a step down. ----------
   The same block twice: once for phones (<= 760px viewport), once for any figure under 420px wide (container query). */
@media (max-width:760px){
  .aud-trace .aud-tr-stage{height:280px}
  .aud-trace .aud-tr-w{display:none}
  .aud-trace .aud-tr-c{display:block}
  .aud-trace .aud-tr-l1,.aud-trace .aud-tr-l2{font-size:12px;line-height:20px}
  .aud-trace .aud-tr-who{font-size:13px;line-height:20px}
  .aud-trace .aud-tr-rec-d{top:59px}
  .aud-trace .aud-tr-rec-a{top:215px}
}
@container aud-tr (max-width:419px){
  .aud-trace .aud-tr-stage{height:280px}
  .aud-trace .aud-tr-w{display:none}
  .aud-trace .aud-tr-c{display:block}
  .aud-trace .aud-tr-l1,.aud-trace .aud-tr-l2{font-size:12px;line-height:20px}
  .aud-trace .aud-tr-who{font-size:13px;line-height:20px}
  .aud-trace .aud-tr-rec-d{top:59px}
  .aud-trace .aud-tr-rec-a{top:215px}
}
/* phones up to 390 (figure < 380; the unwrapped line is 331 + 40): the person drops to a line of their own; l2 stays on the track's end. <= 340 viewports (figure <= 308): mono 11 */
@container aud-tr (max-width:379px){
  .aud-trace .aud-tr-rec-a{top:193px}
  .aud-trace .aud-tr-who{display:block;margin-top:2px}
}
@container aud-tr (max-width:308px){
  .aud-trace .aud-tr-l1,.aud-trace .aud-tr-l2{font-size:11px;line-height:20px}
  .aud-trace .aud-tr-sep{margin:0 6px}
}

/* ---------- reduced motion, print, forced colours ---------- */
@media (prefers-reduced-motion:reduce){
  .aud-trace,.aud-trace *{transition:none!important}
}
@media print{
  .aud-trace .aud-tr-head{display:none}
}
@media (forced-colors:active){
  .aud-trace .aud-tr-rail{stroke:GrayText}
  .aud-trace .aud-tr-ink,.aud-trace .aud-tr-head{stroke:CanvasText}
  .aud-trace .aud-tr-l1,.aud-trace .aud-tr-l2,.aud-trace .aud-tr-dim,.aud-trace .aud-tr-who,.aud-trace .aud-tr-out,.aud-trace .aud-tr-sep,.aud-trace .aud-tr-cap{color:CanvasText}
}
