/* Behind-the-scenes view of the demo hotel: four lanes, the ten steps of clause 8.1, a log and the edge counter. */
.flow { --pass: var(--ok); --fail: var(--no); --skip: var(--muted); --run: var(--ink); --t: 420ms; }
@media (prefers-reduced-motion: reduce) { .flow { --t: 0ms; } }
.flow h2 { margin-top: 36px; }
.flow .scenarios { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.flow .scenarios button { background: var(--bg); color: var(--ink); font-size: .9rem; padding: 6px 10px; }
.flow .scenarios button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.flow .scenarios button:disabled { opacity: .55; cursor: wait; }
.flow .scenarios .tag { font-size: .72rem; border: 1px solid currentColor; border-radius: 3px; padding: 0 3px; margin-left: 4px; }

.stage { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 34px 10px 12px; background: var(--soft); }
.wire { position: absolute; left: 12.5%; right: 12.5%; top: 16px; height: 2px; background: var(--line); }
.packet { position: absolute; top: 7px; left: 0; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--run);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--run) 25%, transparent); transition: left var(--t) ease-in-out, background var(--t); opacity: 0; }
.packet.on { opacity: 1; }
.packet.ok { background: var(--pass); } .packet.no { background: var(--fail); }
.packet .tok { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 600 11px/1.2 ui-monospace, Consolas, monospace; color: var(--text); }

.lanes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lane { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; min-height: 120px; transition: border-color var(--t), box-shadow var(--t); }
.lane.active { border-color: var(--run); box-shadow: 0 0 0 2px var(--run); }
.lane.absent { opacity: .55; border-style: dashed; }
.lane h3 { margin: 0 0 2px; font-size: .92rem; color: var(--ink); }
.lane h3 small { font-weight: 500; color: var(--muted); }
.lane .sub { margin: 0 0 6px; font-size: .76rem; color: var(--muted); line-height: 1.3; }
.lane .note-s { font-size: .74rem; color: var(--muted); margin: 6px 0 0; line-height: 1.3; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.steps li { display: flex; align-items: center; gap: 6px; font-size: .78rem; line-height: 1.2; padding: 3px 4px; border-radius: 4px; border: 1px solid transparent; transition: background var(--t), border-color var(--t), color var(--t); }
.steps li .n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 600 11px ui-monospace, Consolas, monospace; border: 1.5px solid var(--line); background: var(--bg); }
.steps li.running { border-color: var(--run); }
.steps li.running .n { border-color: var(--run); animation: pulse 700ms infinite; }
.steps li.pass .n { background: var(--pass); border-color: var(--pass); color: var(--bg); }
.steps li.fail { color: var(--fail); font-weight: 600; border-color: var(--fail); }
.steps li.fail .n { background: var(--fail); border-color: var(--fail); color: var(--bg); }
.steps li.skip { color: var(--skip); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--skip) 50%, transparent); }
.steps li.unreached { opacity: .4; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--run) 30%, transparent); } }
@media (prefers-reduced-motion: reduce) { .steps li.running .n { animation: none; } }
.agent-card { font-size: .76rem; line-height: 1.35; overflow-wrap: anywhere; }
.agent-card code { font-size: .72rem; }
.agent-card .req { margin-top: 6px; font: 600 .78rem ui-monospace, Consolas, monospace; }

.verdict { margin: 12px 0 4px; font-weight: 600; min-height: 1.5em; }
.verdict .ok { color: var(--pass); } .verdict .no { color: var(--fail); }
.log { margin: 6px 0 0; padding: 6px 8px 6px 30px; font-size: .88rem; max-height: 15.5em; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); scroll-behavior: smooth; }
.log:empty { display: none; }
.log li { margin: 0 0 4px; }
.log li .who { font-weight: 600; color: var(--ink); }
.log li.f { color: var(--fail); } .log li.p .who::after, .log li.f .who::after { content: ''; }
.log .muted { color: var(--muted); }

.counter { margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.counter h3 { margin: 0 0 8px; font-size: .98rem; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--soft); border-radius: 6px; padding: 8px; }
.tile b { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.tile span { font-size: .78rem; color: var(--muted); }
.tile.saved b { color: var(--pass); }
.bars { margin-top: 10px; display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 9.5em 1fr 3em; align-items: center; gap: 8px; font-size: .78rem; }
.bar .track { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; width: 0; background: var(--fail); transition: width var(--t); }
.bar .v { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .lanes, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wire, .packet { display: none; }
  .stage { padding-top: 10px; }
}

/* The full-screen view at /flow, sized for a recording. */
body.flowpage main { max-width: 1040px; padding-top: 24px; }
body.flowpage .lane { min-height: 260px; }
body.flowpage .steps li { font-size: .86rem; }
body.flowpage .log { max-height: 11em; }
body.flowpage .flow > h2, body.flowpage .flow > p:first-of-type { display: none; }
