/* The run page: verdict strip with stepper, metric panels, thresholds. */
.strip {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; padding: 18px 20px; margin-bottom: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.strip-state { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.strip-state .icon { width: 24px; height: 24px; }
.strip[data-tone="passed"] .strip-state { color: var(--good); }
.strip[data-tone="failed"] .strip-state, .strip[data-tone="timed_out"] .strip-state { color: var(--bad); }
.strip[data-tone="aborted"] .strip-state { color: var(--warn); }
.strip[data-tone="live"] .strip-state { color: var(--accent); }
.strip-reason { margin: 4px 0 0; color: var(--text); max-width: 80ch; overflow-wrap: anywhere; }
.strip-next { margin: 4px 0 0; color: var(--text-dim); }
.strip-next:empty { display: none; }
.strip-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.strip-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 260px; text-align: right; }
.strip-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.conn { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.conn[data-conn="live"] { color: var(--good); }
.conn[data-conn="live"]::before { background: var(--good); animation: pulse 1.6s ease-in-out infinite; }
.conn[data-conn="reconnecting"], .conn[data-conn="lost"] { color: var(--warn); }
.conn[data-conn="reconnecting"]::before, .conn[data-conn="lost"]::before { background: var(--warn); }
.strip-facts { grid-column: 1 / -1; margin: 0; color: var(--text-dim); font-size: 13px; overflow-wrap: anywhere; }

.stepper { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 4px 0 0; padding: 0; }
.step { min-width: 0; }
.step-row { display: flex; align-items: center; gap: 8px; }
.step-line { flex: 1; height: 2px; min-width: 12px; margin-right: 8px; border-radius: 1px; background: var(--border); }
.step-done .step-line { background: var(--accent); }
.step-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); background: var(--panel); }
.step-done .step-dot { background: var(--accent); border-color: var(--accent); }
.step-current .step-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-stopped .step-dot { background: var(--warn); border-color: var(--warn); }
.step-completed .step-dot { background: var(--good); border-color: var(--good); }
.step-failed .step-dot, .step-timed_out .step-dot { background: var(--bad); border-color: var(--bad); }
.step-aborted .step-dot { background: var(--warn); border-color: var(--warn); }
.step-label { flex: none; font-size: 13px; font-weight: 600; }
.step-todo .step-label { color: var(--text-dim); font-weight: 500; }
.step-at { display: block; padding-left: 22px; font-size: 12px; color: var(--text-dim); min-height: 18px; }

.banner { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-sm); }
.banner-warn { background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn); }
.banner-info { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }

.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.panel { min-width: 0; padding: 16px 18px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-latency { grid-column: 1 / -1; }
@media (max-width: 1100px) and (min-width: 761px) {
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-errors { grid-column: 1 / -1; }
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-title { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text-dim); }
.panel-scope { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.panel-figure { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 6px; }
.panel-value { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; text-decoration: underline dotted var(--text-faint); text-underline-offset: 6px; text-decoration-thickness: 1px; cursor: help; }
.panel-unit { color: var(--text-dim); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 6px; padding: 0; font-size: 13px; color: var(--text-dim); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 3px; border-radius: 2px; }
.legend-item.s-p50 .swatch { background: var(--s-p50); }
.legend-item.s-p95 .swatch { background: var(--s-p95); }
.legend-item.s-p99 .swatch { background: var(--s-p99); }
.legend-value { color: var(--text); font-weight: 600; text-decoration: underline dotted var(--text-faint); text-underline-offset: 4px; cursor: help; }
.chart-wrap { width: 100%; min-width: 0; }
.chart { display: block; width: 100%; height: 168px; overflow: visible; touch-action: pan-y; border-radius: 4px; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--text-dim); font-size: 11px; font-family: var(--sans); }
.chart .line { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chart .crosshair { stroke: var(--text-faint); stroke-dasharray: 3 3; }
.chart .reset-mark { stroke: var(--warn); stroke-width: 1.25; stroke-dasharray: 4 3; }
.chart .reset-label { fill: var(--warn); font-size: 10.5px; font-weight: 600; font-family: var(--sans); }
.chart .line.s-accent { stroke: var(--accent); }
.chart .line.s-p50 { stroke: var(--s-p50); }
.chart .line.s-p95 { stroke: var(--s-p95); }
.chart .line.s-p99 { stroke: var(--s-p99); }
.chart .line.s-vus { stroke: var(--s-vus); }
.chart .line.s-bad { stroke: var(--bad); }
.chart .dot.s-accent { fill: var(--accent); }
.chart .dot.s-p50 { fill: var(--s-p50); }
.chart .dot.s-p95 { fill: var(--s-p95); }
.chart .dot.s-p99 { fill: var(--s-p99); }
.chart .dot.s-vus { fill: var(--s-vus); }
.chart .dot.s-bad { fill: var(--bad); }
.chart-readout { margin: 6px 0 0; min-height: 20px; font-size: 12.5px; color: var(--text-dim); overflow-wrap: anywhere; }

/* Since reset: one row of attributable figures, wrapping on narrow screens. */
.reset-band { margin-bottom: 16px; }
.reset-figures { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px 16px; margin: 8px 0 4px; }
.reset-figure { min-width: 0; }
.reset-figure dt { font-size: 12px; color: var(--text-dim); }
.reset-value { margin: 2px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: underline dotted var(--text-faint); text-underline-offset: 5px; text-decoration-thickness: 1px; cursor: help; }
.reset-value:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
@media (max-width: 1100px) { .reset-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .reset-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } .reset-band .panel-head, .report-figures .panel-head { flex-wrap: wrap; row-gap: 2px; } .reset-band .panel-scope, .report-figures .panel-scope { white-space: normal; } }

.panel-thresholds .table-scroll { border: 0; border-radius: 0; background: none; margin: 8px -18px -12px; }
.panel-note { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; }
.thresholds td { overflow-wrap: anywhere; }
.thresholds .expr { color: var(--text-dim); }
.tv { font-weight: 600; text-decoration: underline dotted var(--text-faint); text-underline-offset: 4px; cursor: help; white-space: nowrap; }

@media (max-width: 760px) {
  .panels { grid-template-columns: minmax(0, 1fr); }
  .strip { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .strip-side, .strip-actions { align-items: flex-start; text-align: left; }
  .strip-buttons { justify-content: flex-start; }
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .step:nth-child(2) .step-line { display: none; }
  .thresholds th:nth-child(5), .thresholds td:nth-child(5) { display: none; }
  .tv { white-space: normal; }
  .strip-state { font-size: 22px; }
}

/* Download bar (run page): five export links, one row on desktop, wrapping on a phone. */
.exports { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 18px; }
.exports-label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.exports-links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-export { min-height: 32px; padding: 5px 12px 5px 10px; font-size: 13px; font-weight: 600; }
.btn-export .icon { width: 15px; height: 15px; color: var(--text-dim); }
.btn-export:hover .icon, .btn-export:focus-visible .icon { color: var(--accent); }
.exports-note { flex-basis: 100%; font-size: 12px; color: var(--text-dim); }
.exports[data-final="false"] .exports-note { color: var(--warn); }
@media (min-width: 1100px) { .exports-note { flex-basis: auto; } }
@media print { .exports { display: none; } }

/* Run health: live conditions with the next action (health-panel.js). Tinted by the worst active
   severity; elevation is the 1px hue border alone. Hidden when there is nothing to say. */
.health { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel); }
.health.is-warning { background: var(--warn-soft); border-color: var(--warn); }
.health.is-critical { background: var(--bad-soft); border-color: var(--bad); }
.health-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.health.is-warning .health-head .icon { color: var(--warn); }
.health.is-critical .health-head .icon { color: var(--bad); }
.health.is-clear .health-head .icon { color: var(--good); }
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.health-item + .health-item, .health-recovered + .health-recovered { padding-top: 10px; border-top: 1px solid var(--border-soft); }
.health-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.health-sev { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.is-critical > .health-item-head .health-sev { color: var(--bad); }
.is-warning > .health-item-head .health-sev { color: var(--warn); }
.health-title { font-size: 14px; }
.health-since { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.health-msg { margin: 4px 0 0; font-size: 13px; line-height: 1.5; max-width: 110ch; overflow-wrap: anywhere; }
.health-next { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-dim); max-width: 110ch; overflow-wrap: anywhere; }
.health-next-label { font-weight: 650; color: var(--text); }
.health-counters { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.health-counters div { display: flex; gap: 6px; align-items: baseline; }
.health-counters dt { font-size: 12px; color: var(--text-dim); }
.health-counters dd { margin: 0; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.health-counters dd.is-bad { color: var(--bad); }
/* Where a remote run's workers run: host, link, clock offset +/- uncertainty, one line each (wraps at 375 px). */
.health-workers { display: grid; gap: 4px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.health-workers.is-tight { margin-top: 8px; } /* directly under the heading or the condition list (no counters between) */
.health-worker { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; font-size: 13px; }
.health-worker dt { min-width: 7ch; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.health-worker dd { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 12px; min-width: 0; }
.health-host { font-weight: 650; overflow-wrap: anywhere; }
.health-link { color: var(--text-dim); text-transform: uppercase; font-size: 12px; letter-spacing: 0.04em; }
.health-clock, .health-load { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.health-load.is-warn { color: var(--warn); font-weight: 650; } /* the server's agent_lagging condition is active for this worker */
@media (max-width: 480px) { .health-worker { flex-direction: column; gap: 0; } } /* every row wraps the same way on a phone */
.health-workers + [role="status"] > .health-list { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); } /* a bare recovered list under the worker rows: the same rule as every other section */
.health-more { margin-top: 10px; font-size: 13px; }
.health-more summary { cursor: pointer; color: var(--text-dim); }
.health-more summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.health-more[open] .health-list { margin-top: 8px; }
