/* /try/lab/: the shared run layout for every flow on /try/ (form, board, view switcher, panel, log).
   Rule for everything in here: text that changes during a run sits in a box
   whose size is set up front, so nothing below it moves. */
:root { --warn: #a3401a; --warn-tint: #fbeee7; --info: #3c5f8a; --wire: #82938e; }
@media (prefers-color-scheme: dark) { :root { --warn: #f3a47e; --warn-tint: #3a2a22; --info: #9cc0ea; --wire: #718982; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[tabindex="-1"]:focus { outline: none; }
.hero-short { padding-bottom: var(--space-6); }
.hero-short h1 { font-size: 52px; }
.lab { margin-top: var(--space-4); }
.lab h2 { font-size: 28px; margin: 0; }
.plain-ol { padding-left: 1.2em; max-width: 36em; }
.plain-ol li { margin-bottom: var(--space-3); color: var(--color-neutral-300); }

/* — the start form — */
.lab-fields { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--space-4); margin-bottom: var(--space-5); }
.lab-form label { display: flex; flex-direction: column; gap: 6px; font-size: 16px; font-weight: 600; color: var(--color-neutral-300); }
.lab-form input[name=name], .lab-form select {
  font: inherit; font-weight: 400; font-size: 17px; color: var(--color-text);
  background: var(--color-bg); border: 1px solid var(--color-neutral-600); border-radius: var(--radius-md);
  padding: 9px 10px; min-height: 44px; width: 100%;
}
.lab-fields .wide { grid-column: 1 / -1; }
button.btn { font-family: var(--font-body); }
button.btn:disabled, .btn-quiet:disabled { opacity: .45; cursor: not-allowed; text-decoration: none; }
.btn-quiet {
  font: 600 17px/1.2 var(--font-body); color: var(--color-accent); background: transparent;
  border: 1px solid var(--color-neutral-600); border-radius: var(--radius-md); padding: 11px 18px; cursor: pointer;
}
.btn-quiet:hover:not(:disabled) { border-color: var(--color-accent); text-decoration: underline; }
.chosen { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* — run bar: heading, clock, controls. Fixed widths so the clock and buttons never shift. — */
.lab-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.lab-bar h2 { margin-right: auto; }
.lab-clock { margin: 0; font: 600 17px/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--color-neutral-300);
  min-width: 9.4em; text-align: right; transition: color .2s; }
.lab-clock.rolling { color: var(--color-accent); }
.lab-ctl { display: inline-flex; height: 24px; border: 1px solid var(--color-neutral-700); border-radius: 6px; }
/* Playback is one slim segmented strip, about the height of the clock text beside it.
   Each button's tap area reaches past the visible strip (::after), so it stays easy to hit on a phone. */
.ctl { position: relative; display: grid; place-items: center; width: 30px; height: 100%; padding: 0; border: 0; border-left: 1px solid var(--color-neutral-800);
  background: transparent; color: var(--color-neutral-300); cursor: pointer; transition: color .15s, background .15s; }
.ctl::after { content: ""; position: absolute; left: 0; right: 0; top: -10px; bottom: -10px; }
.ctl:first-child { border-left: 0; border-radius: 5px 0 0 5px; }
.ctl:last-child { border-radius: 0 5px 5px 0; }
.ctl svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ctl .i-play { fill: currentColor; stroke-width: 1.2; }
.ctl .i-play, .ctl[aria-pressed=true] .i-pause { display: none; }
.ctl[aria-pressed=true] .i-play { display: block; }
.ctl-speed { width: 34px; font: 650 12.5px/1 var(--font-body); font-variant-numeric: tabular-nums; }
/* On touch screens the buttons get wider too, so each target is close to 44px square. */
@media (pointer: coarse) { .ctl, .ctl-speed { width: 44px; } .ctl::after { top: -11px; bottom: -11px; } }
.ctl:hover:not(:disabled) { color: var(--color-accent); background: var(--color-surface); }
.ctl:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; z-index: 1; }
.ctl:disabled { color: var(--color-neutral-600); cursor: default; }
.ctl[aria-pressed=true] { background: var(--color-accent-900); color: var(--color-accent); }
@media (max-width: 520px) {
  .lab-bar { gap: var(--space-2) var(--space-3); }
  .lab-clock { order: 3; flex-basis: 100%; min-width: 0; text-align: left; font-size: 15px; }
}

/* — the board each version draws into: full-bleed up to 1080px — */
.board { position: relative; margin: var(--space-5) 0; }
/* Pause means everything on the board holds still, spinners and pulses included. */
/* Pausing holds every looping motion still (spinners, pulses, progress sweeps). One-off entrance
   fades are left to finish, so a view opened during a pause shows its current state in full. */
.is-paused .ticks li[data-s=run] .tick, .is-paused .ladder li[data-s=run] .rung, .is-paused .jc-track li[data-s=run] .seg::after,
.is-paused .tile[data-s=run], .is-paused .tile[data-s=retry], .is-paused .jc[data-state=wait], .is-paused .bar.active::after,
.is-paused .bar.run::after, .is-paused .n[data-state=active] .n-bar::after, .is-paused .n[data-state=wait]:not(.land):not(.halt),
.is-paused .n-apps i[data-s=run], .is-paused .n-apps i[data-s=retry], .is-paused .owner-dot { animation-play-state: paused !important; }

/* — under the board: the current step, the panel, the log — */
.deck { display: grid; gap: var(--space-5); }
/* On wide screens the board and the deck break out of the text column, up to 1080px.
   Below that they keep to the column, so a tablet doesn't get a 30px offset. */
@media (min-width: 1000px) {
  .board, .deck { width: min(1080px, calc(100vw - 40px)); margin-left: calc(50% - min(540px, 50vw - 20px)); }
}
/* Side by side only once the deck is full width; below that the log sits under the panel, so the now line keeps a
   comfortable measure instead of squeezing into a narrow column. */
@media (min-width: 1000px) { .deck { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }

/* The "now" line holds up to four lines; it never grows past that. */
.now { margin: 0 0 var(--space-4); padding-left: var(--space-4); border-left: 3px solid var(--color-accent);
  font-size: 19px; line-height: 1.45; color: var(--color-neutral-200);
  height: calc(1.45em * 4); overflow: hidden; transition: border-color .3s; }
.now.fresh { animation: now-in .28s ease-out both; }
@keyframes now-in { from { opacity: .25; } }
.now.bad { border-left-color: var(--warn); }
@media (max-width: 520px) { .now { font-size: 17px; height: calc(1.45em * 5); } }

/* The panel has a fixed floor tall enough for the approval card. Shorter cards
   leave quiet space instead of letting the log jump up. */
.panel { min-height: var(--panel, 404px); }
@media (max-width: 999px) { .panel { min-height: var(--panel-narrow, 470px); } }
@media (max-width: 359px) { .panel { min-height: var(--panel-tiny, 500px); } }
.panel-idle:focus, .card h3:focus { outline: none; }
.panel-idle:focus-visible, .card h3:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 2px; }
.panel-idle { margin: 0; padding: var(--space-5); color: var(--color-neutral-500); font-size: 16px;
  border: 1px dashed var(--color-divider); border-radius: var(--radius-lg); }
.card { padding: var(--space-5); background: var(--color-surface); border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-accent); animation: card-in .35s ease both; }
.card.alert { border-left-color: var(--warn); }
.card h3 { font-size: 22px; margin-bottom: var(--space-3); }
.card p { color: var(--color-neutral-300); }
.card-from { font-size: 14px; color: var(--color-neutral-500); margin-bottom: 4px; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }

.rows { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 4px var(--space-4); margin: 0 0 var(--space-4); font-size: 17px; }
.rows dt { color: var(--color-neutral-500); }
.rows dd { margin: 0; font-weight: 600; color: var(--color-neutral-100); overflow-wrap: anywhere; }
.ask-q { font-weight: 600; color: var(--color-neutral-100) !important; }
.ask-btns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }

/* Checklists: every item is laid out from the start, then ticks. */
.ticks { list-style: none; margin: 0; padding: 0; }
/* Each row is sized for its longest message up front: one line on wide screens, two on phones. */
.ticks li { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; padding: 5px 0; color: var(--color-neutral-500); transition: color .25s; }
.ticks li > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 999px) {
  .ticks li > span:last-child { white-space: normal; height: calc(1.5em * 2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.tick { width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; border: 1.5px solid var(--color-neutral-700); position: relative; transition: background .25s, border-color .25s; }
.ticks li[data-s=run] { color: var(--color-neutral-200); }
.ticks li[data-s=run] .tick { border-color: var(--color-accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.ticks li[data-s=pass] { color: var(--color-neutral-200); }
.ticks li[data-s=pass] .tick { background: var(--color-accent); border-color: var(--color-accent); }
.ticks li[data-s=pass] .tick::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 4.5px; height: 9px;
  border: solid var(--color-on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ticks li[data-s=fail] { color: var(--warn); font-weight: 600; }
.ticks li[data-s=fail] .tick { background: var(--warn); border-color: var(--warn); }
.ticks li[data-s=fail] .tick::after { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 2px; background: var(--color-bg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Retry and escalation ladders: rungs on one line, filled as the clock moves. */
.ladder { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), 1fr); position: relative; }
.ladder::before { content: ""; position: absolute; left: 9px; right: 9px; top: 9px; height: 2px; background: var(--color-divider); }
.ladder li { position: relative; display: flex; flex-direction: column; gap: 2px; padding-right: 6px; font-size: 15px; line-height: 1.25; color: var(--color-neutral-500); }
.ladder li b { margin-top: 8px; font-weight: 650; color: var(--color-neutral-400); font-variant-numeric: tabular-nums; }
.ladder li span:last-child { min-height: 2.5em; }
.rung { width: 20px; height: 20px; border-radius: 50%; background: var(--color-surface); border: 2px solid var(--color-neutral-700); position: relative; z-index: 1; transition: background .25s, border-color .25s, transform .25s; }
.ladder li[data-s=run] .rung { border-color: var(--color-accent); animation: pulse 1.1s ease-in-out infinite; }
.ladder li[data-s=done] .rung { background: var(--color-accent); border-color: var(--color-accent); }
.ladder li[data-s=fail] .rung { background: var(--warn); border-color: var(--warn); }
.ladder li[data-s=fail] { color: var(--warn); }
.ladder li[data-s=done] { color: var(--color-neutral-200); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px var(--color-accent-800); } }
@media (max-width: 520px) { .ladder li { font-size: 13px; } }

/* — the run log: a fixed-height box that scrolls inside itself — */
.logbox h3 { font-size: 20px; margin-bottom: var(--space-2); }
.log { list-style: none; margin: 0; padding: 0 4px 0 0; height: 424px; overflow-y: auto; border-top: 1px solid var(--color-divider);
  scrollbar-width: thin; font-size: 15px; line-height: 1.4; }
@media (max-width: 699px) { .log { height: 300px; } }
.log li { display: grid; grid-template-columns: 3.4em 1fr; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--color-divider);
  color: var(--color-neutral-300); animation: log-in .3s ease both; border-radius: 2px; }
.log li[tabindex]:hover, .log li[tabindex]:focus-visible { background: var(--color-surface); }
.log li[tabindex]:focus { outline: none; }
.log li[tabindex]:focus-visible { box-shadow: inset 2px 0 0 var(--color-accent); }
.log:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.log time { color: var(--color-neutral-500); font-variant-numeric: tabular-nums; }
.log li.day { display: block; padding: 12px 2px 4px; font-size: 13px; font-weight: 650; color: var(--color-neutral-500); border-bottom: 0; }
.log li.day:first-child { padding-top: 6px; }
.log .bad, .log .alert { color: var(--warn); }
.log .alert span::before { content: "Alert · "; font-weight: 650; }
.log .good span { color: var(--color-neutral-200); }
.log .you span { font-weight: 650; color: var(--color-accent); }
@keyframes log-in { from { opacity: 0; transform: translateY(4px); } }

@media (max-width: 620px) {
  .hero-short h1 { font-size: 40px; }
  .lab-fields { grid-template-columns: 1fr; }
  .rows { grid-template-columns: 7em minmax(0, 1fr); font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* — the view switcher: plain text choices, the current one underlined — */
.switch { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; margin: var(--space-4) 0 0; }
.switch-label { font-size: 15px; color: var(--color-neutral-500); }
@media (max-width: 520px) { .switch-label { display: none; } .switch { gap: 2px 16px; } .switch button { font-size: 16px; } }
.switch button { font: 600 17px/1.2 var(--font-body); color: var(--color-neutral-400); background: none; border: 0; padding: 10px 0 6px;
  border-bottom: 2.5px solid transparent; cursor: pointer; transition: color .2s, border-color .2s; }
.switch button:hover { color: var(--color-accent); }
.switch button[aria-pressed=true] { color: var(--color-neutral-100); border-bottom-color: var(--color-accent); }
.view[hidden] { display: none; }
.done-hint { font-size: 15px; color: var(--color-neutral-500); }
@media (min-width: 700px) { .board { min-height: 472px; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

/* — all together: map on top, timeline and path cards under it — */
.combo-board { display: flex; flex-direction: column; gap: 22px; }
.combo-low { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.combo-board .tl-board { grid-template-columns: 132px minmax(0, 1fr); column-gap: 10px; }
.combo-board .tl-label, .combo-board .tl-row { height: 50px; }
.combo-board .tl-label.lane-own, .combo-board .tl-row.lane-own { height: 54px; }
.combo-board .tl-label b { font-size: 15px; }
.combo-board .lane-status { font-size: 12px; height: 2.5em; -webkit-line-clamp: 2; }
.combo-board .tl-row .track { height: 14px; }
.combo-board .tl-row.lane-apps .track { height: 30px; }
.combo-board .tl-row.lane-apps .sub { height: 4px; }
.combo-board .tl-flag { font-size: 11px; padding: 2px 6px; }
.combo-board .j-board .j-desk, .combo-board .j-board .j-desk.two, .combo-board .j-board .jc { height: 268px; }
.combo-board .j-board .j-desk.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.combo-board .j-board .two .jc-station { font-size: 20px; }
.combo-board .j-board .j-desk { grid-template-columns: minmax(0, 1fr); }
.combo-board .j-board .jc { padding: 12px 14px 10px; }
.combo-board .j-board .jc-station { font-size: 22px; }
.combo-board .j-board .jc-sub { font-size: 14px; }
.combo-board .j-board .seg-label, .combo-board .j-board .jc-rows, .combo-board .j-board .j-trays { display: none; }
/* The record card keeps the two fields that most often go wrong: department and manager. */
.combo-board .j-board .jc-rec .jc-rows { display: grid; font-size: 13.5px; gap: 1px 10px; grid-template-columns: 6.5em minmax(0, 1fr); }
.combo-board .j-board .jc-rec .jc-rows > :nth-child(n+9) { display: none; }
.combo-board .j-board .note, .combo-board .st-step { display: none; }
.combo-board .j-board .jc-tiles { grid-template-columns: repeat(5, 1fr); gap: 4px; }
.combo-board .j-board .tile { height: 24px; font-size: 0; padding: 0; }
.combo-board .j-board .jc-final { grid-template-columns: 1fr 1fr; gap: 6px; }
.combo-board .j-board .jc-final li { padding: 5px 8px; font-size: 13.5px; }
.combo-board .j-board .jc-stamps { height: 56px; }
.combo-board .j-board .stamp { font-size: 12px; padding: 2px 6px; }
.combo-board .j-board .jc-outcome { font-size: 17px; margin-top: 8px; }
@media (max-width: 999px) {
  .combo-map { margin-bottom: var(--space-4); }
  .combo-low { grid-template-columns: 1fr; }
  .combo-cards { order: -1; }
}

.jump { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20;
  font: 600 16px/1.2 var(--font-body); color: var(--color-on-accent); background: var(--color-accent);
  border: 0; border-radius: var(--radius-md); padding: 12px 18px; cursor: pointer; animation: jump-in .3s ease both; }
.jump::after { content: " \2193"; }
.jump[hidden] { display: none; }
@keyframes jump-in { from { opacity: 0; transform: translate(-50%, 8px); } }
/* In "All together" the record cards swap without a page transition; their contents fade in instead. */
:where(.combo-board .j-board .jc) > * { animation: jc-in .3s ease both; }
@keyframes jc-in { from { opacity: 0; } }
/* Scripts on: hide the no-script summary at once and hold the form's space until the lab starts. */
.lab-js [data-static] { display: none; }
.lab-js .lab-form[hidden]:not(.started) { display: block; visibility: hidden; }

/* — parts the longer flows use: wrapped checklists, noted items, flagged rows, the result's facts — */
/* A checklist whose items are full sentences wraps them instead of clipping; the panel grows to fit once and holds. */
.ticks.wrap li > span:last-child { white-space: normal; height: auto; display: block; overflow: visible; }
.ticks li[data-s=info] { color: var(--color-neutral-100); font-weight: 600; }
.ticks li[data-s=info] .tick { border-color: var(--color-accent); }
.ticks li[data-s=info] .tick::after { content: ""; position: absolute; left: 6px; top: 3px; width: 3px; height: 9px; border-radius: 1px; background: var(--color-accent); }
.checks-done { opacity: .8; }
.rows dd.flag { color: var(--warn); }
.ask-err { color: var(--warn) !important; }
.card .facts { margin: 0 0 var(--space-4); padding-left: 1.1em; color: var(--color-neutral-300); }
.card .facts li { overflow-wrap: anywhere; }
.card .facts li::marker { color: var(--color-neutral-600); }
.done-card .ask-btns a { font-weight: 600; }
.card { overflow-wrap: anywhere; }
.log details summary { cursor: pointer; }
.log details ul { list-style: none; margin: 4px 0 0; padding: 0; }
.log details ul li { display: block; padding: 2px 0 2px 20px; border: 0; position: relative; animation: none; }
.log details ul li::before { position: absolute; left: 0; content: "\2022"; }
.log details ul li[data-s=pass]::before { content: "\2713"; color: var(--color-accent); }
.log details ul li[data-s=fail] { color: var(--warn); }
.log details ul li[data-s=fail]::before { content: "\2715"; }
.log details ul li[data-s=info]::before { content: "\21AA"; color: var(--color-accent); }
/* The now line holds as many lines as the flow says (FLOW.room), so its longest sentence fits from the start. */
.now { height: calc(1.45em * var(--now-lines, 4)); }
@media (max-width: 520px) { .now { height: calc(1.45em * var(--now-lines-narrow, 5)); } }
