/* Simulation detail (#/run/:id): screen-only styles (D88, spec §4.6).
   Owned by the run screen builder. Tokens only (no raw colour values), every
   selector under .scr-run, the components in style.css reused first.
   Breakpoints: <=640px phone, <=900px the answer cards go to one column. */

/* ---------------------------------------------------------------- rhythm */
/* The page is a column of blocks; empty blocks take no space, so the gap
   stays even whether the result, the progress or the problem is showing. */
.scr-run .run-main { display: flex; flex-direction: column; gap: var(--s7); }
.scr-run .run-main > :empty { display: none; }
.scr-run .run-main .section { margin-top: 0; }
.scr-run .page-head { margin-bottom: var(--s6); }
.scr-run .page-head .answer { max-width: 26em; }
@media (max-width: 640px) {
  .scr-run .run-main { gap: var(--s6); }
  .scr-run .page-head { margin-bottom: var(--s5); }
}

/* ---------------------------------------------------------------- status line */
.scr-run .page-meta { margin-top: var(--s2); }
.scr-run .run-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.scr-run .run-st-main { color: var(--text); }
.scr-run .run-st-sub { color: var(--text-2); }
.scr-run .run-st-ico { color: var(--text-2); }
.scr-run .run-st-ico.down { color: var(--down); }
.scr-run .run-id { color: var(--text-2); padding-left: 10px; border-left: 1px solid var(--line-2); line-height: 1.1; }
@media (max-width: 640px) {
  /* the number gets its own line rather than a divider stranded at a wrap */
  .scr-run .run-id { flex-basis: 100%; padding-left: 0; border-left: 0; }
}

/* ---------------------------------------------------------------- result */
.scr-run .run-result .panel { padding: var(--s5) var(--s6) var(--s6); }
.scr-run .run-result .gap-lg { margin-top: var(--s1); }
.scr-run .run-result .figures { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.scr-run .run-of { font-size: var(--fs-body); font-weight: 400; color: var(--text-2); letter-spacing: 0; }
.scr-run .run-result .notice { margin-top: var(--s5); }
.scr-run .run-why { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); margin-top: var(--s5);
  padding: var(--s4) var(--s5) var(--s4) var(--s4); }
.scr-run .run-why-ico { color: var(--text-2); padding-top: 1px; }
.scr-run .run-why-q { margin: 0 0 4px; font-weight: 600; }
.scr-run .run-why-a { margin: 0; color: var(--text-2); max-width: 72ch; }
.scr-run .run-basis { margin: var(--s4) 0 0; color: var(--text-2); max-width: 78ch; }
.scr-run .run-basis b { color: var(--text); font-weight: 600; }
.scr-run .run-why + .run-basis { margin-top: var(--s4); }
.scr-run .run-actions { margin-top: var(--s5); }
@media (max-width: 640px) {
  .scr-run .run-result .panel { padding: var(--s4); }
  .scr-run .run-why { padding: var(--s3) var(--s4) var(--s3) var(--s3); gap: 10px; }
}

/* ---------------------------------------------------------------- the step tracker */
.scr-run .run-steps { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); }
.scr-run .run-step { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-right: var(--s3); }
/* the line to the next step, from this mark's right edge */
.scr-run .run-step:not(:last-child)::after { content: ""; position: absolute; top: 11px; left: 30px; right: 6px; height: 2px;
  border-radius: 1px; background: var(--line-2); }
.scr-run .run-step.is-done:not(:last-child)::after { background: color-mix(in srgb, var(--text-2) 55%, transparent); }
.scr-run .run-step-mark { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--text); background: var(--surface); }
.scr-run .is-done .run-step-mark { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--text-3); }
.scr-run .is-now .run-step-mark { box-shadow: inset 0 0 0 2px var(--crowd); }
.scr-run .is-now .run-step-mark i { width: 10px; height: 10px; border-radius: 50%; background: var(--crowd);
  animation: sdot-pulse 1.6s ease-in-out infinite; }
.scr-run .is-failed .run-step-mark { color: var(--down); background: var(--tint-down);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--down) 70%, transparent); }
.scr-run .run-step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scr-run .run-step-label { font-size: var(--fs-small); color: var(--text-2); line-height: 1.35; }
.scr-run .is-now .run-step-label { color: var(--text); font-weight: 600; }
.scr-run .is-failed .run-step-label { color: var(--text); font-weight: 600; }
.scr-run .is-todo .run-step-label { color: var(--text-3); }
.scr-run .run-step-sub { font-size: var(--fs-micro); color: var(--text-2); }
.scr-run .is-failed .run-step-sub { color: var(--down); }
.scr-run .run-detail { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.scr-run .run-detail > p { margin: 0; max-width: 72ch; }
.scr-run .run-detail > p + p { margin-top: 6px; }
.scr-run .run-upd { margin: var(--s2) 0 0; color: var(--text-2); font-size: var(--fs-small); }
.scr-run .run-problem .fold-inline { margin-top: var(--s3); }
@media (max-width: 760px) {
  /* a vertical list: six labels don't fit side by side */
  .scr-run .run-steps { grid-template-columns: 1fr; }
  .scr-run .run-step { flex-direction: row; align-items: flex-start; gap: var(--s3); padding: 0 0 var(--s4); }
  .scr-run .run-step:last-child { padding-bottom: 0; }
  .scr-run .run-step:not(:last-child)::after { top: 26px; bottom: 2px; left: 11px; right: auto; width: 2px; height: auto; }
  .scr-run .run-step-text { padding-top: 2px; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
  .scr-run .run-step-label { font-size: var(--fs-body); }
  .scr-run .run-step-sub { font-size: var(--fs-small); }
}

/* ---------------------------------------------------------------- tabs */
.scr-run .run-tabs > .tabs { margin-bottom: var(--s4); }
.scr-run .run-lead { margin: 0; color: var(--text); max-width: 72ch; }
.scr-run .run-sub { margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-small); max-width: 78ch; }
.scr-run .run-h3 { font-size: var(--fs-body); font-weight: 600; margin: 0; }
.scr-run .run-more { margin-top: var(--s4); }
.scr-run .panel .empty, .scr-run .run-main > .empty { padding: 0; }

/* What the agents said */
.scr-run .run-votes { margin-top: var(--s5); }
.scr-run .run-votes .votes { margin-top: var(--s3); }
.scr-run .run-iv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s5); }
.scr-run .run-iv { background: var(--surface-2); border-radius: var(--r-nested); padding: var(--s4); min-width: 0;
  display: flex; flex-direction: column; gap: 10px; }
.scr-run .run-iv[hidden] { display: none; }
.scr-run .run-iv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); }
.scr-run .run-iv-who { min-width: 0; display: flex; flex-direction: column; }
.scr-run .run-iv-who b { font-weight: 600; overflow-wrap: anywhere; }
.scr-run .run-iv-plat { color: var(--text-2); font-size: var(--fs-small); }
.scr-run .run-iv-p { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.scr-run .run-iv-pv { font-size: var(--fs-title); font-weight: 600; line-height: 1.2; white-space: nowrap; }
.scr-run .run-iv-alt { font-size: var(--fs-micro); color: var(--text-2); white-space: nowrap; }
.scr-run .run-iv-line { margin: 0; overflow-wrap: anywhere; }
.scr-run .run-iv-lbl { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--text-2); margin-bottom: 1px; }
.scr-run .run-iv-ev { margin: 0; font-size: var(--fs-small); color: var(--text-2); }
.scr-run .run-iv .fold-inline { margin-top: -4px; }
.scr-run .run-raw { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-small); color: var(--text-2); }
@media (max-width: 900px) { .scr-run .run-iv-grid { grid-template-columns: 1fr; } }

/* Live feed */
.scr-run .run-feed { list-style: none; margin: var(--s4) 0 0; padding: 0; border-top: 1px solid var(--line); }
.scr-run .run-feed:not(.all) > .run-act:nth-child(n+11) { display: none; }   /* FEED_FIRST in run.js */
.scr-run .run-feed + .run-more { margin-top: var(--s2); }
.scr-run .run-act { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.scr-run .run-act:last-child { border-bottom: 0; }
.scr-run .run-act-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: var(--fs-small); }
.scr-run .run-act-head b { font-size: var(--fs-body); font-weight: 600; color: var(--text); }
.scr-run .run-act-when { margin-left: auto; color: var(--text-2); white-space: nowrap; }
.scr-run .run-act-text { margin: 4px 0 0; max-width: 76ch; overflow-wrap: anywhere; }
.scr-run .run-act-quote { margin: 6px 0 0; padding-left: var(--s3); border-left: 2px solid var(--line-2); color: var(--text-2);
  font-size: var(--fs-small); max-width: 76ch; overflow-wrap: anywhere; }
.scr-run .run-agents-wrap { margin-top: var(--s3); }
.scr-run .run-agents { margin-top: var(--s2); }
@media (max-width: 640px) {
  .scr-run .run-act-when { margin-left: 0; flex-basis: 100%; }
}

/* Full report */
.scr-run .run-report-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.scr-run .run-report-head .btn-row { gap: var(--s4); }
/* the MiroFish page is white and cross-origin: frame it, don't fight it */
.scr-run .run-frame { display: block; width: 100%; height: 72vh; min-height: 420px; margin-top: var(--s4);
  border: 1px solid var(--line); border-radius: var(--r-nested); background: var(--text); }

/* ---------------------------------------------------------------- related questions */
.scr-run .run-leg-gap { display: inline-flex; align-items: center; gap: var(--s3); }

/* ---------------------------------------------------------------- technical details */
.scr-run .run-sub-line { display: block; margin-top: 2px; color: var(--text-2); font-size: var(--fs-small); }
.scr-run .run-notes { margin: 0; padding-left: 18px; color: var(--text-2); font-size: var(--fs-small); }
.scr-run .run-notes li + li { margin-top: 4px; }
.scr-run .run-links > div + div { margin-top: var(--s2); }
.scr-run .run-ext { margin-left: 4px; vertical-align: -2px; }
.scr-run .run-warn { display: block; color: var(--text-2); font-size: var(--fs-small); margin-top: 2px; }
