/* REPS: a calm, dense operations console. IBM Plex Sans for words, IBM
   Plex Mono for anything a person copies or compares (serials, EUIs, chip
   IDs, plan and step IDs, station names). One accent; verdict colors that
   differ in lightness as well as hue, and a tag always carries its word. */

@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-variable.woff2") format("woff2"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ground: #f6f6f4; --surface: #fff; --sunken: #fafaf8; --line: #e2e3e0; --line-soft: #edeeeb; --line-strong: #c9cbc6;
  --ink: #16181b; --ink-2: #4a4f57; --ink-3: #5d636b;
  --accent: #2348c8; --accent-dark: #1a3698; --accent-soft: #eef2fc; --accent-line: #c7d3f5;
  --nav: #16181b; --nav-hover: #2b2f35; --nav-text: #d9dbde; --nav-muted: #9ea3aa;
  --pass: #145f3b; --pass-bg: #e6f4ec; --pass-line: #bfe3cd; --pass-bar: #2e9e62;
  --fail: #a01d12; --fail-bg: #fdecea; --fail-line: #f3c4be; --fail-bar: #b42318; --fail-ink: #7a160e;
  --error: #8a4200; --error-bg: #fff1df; --error-line: #f5d2a3; --error-bar: #e8a33d;
  --aborted: #3e434a; --aborted-bg: #eeefed; --skipped-bar: #8a9099; --not-run-bar: #e2e3e0;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.45 var(--sans); font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 13px; }
h1 { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.25; }
h1.mono, h1 .mono { font-size: 22px; font-weight: 500; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
h2.mono, h2 .mono { font-size: 15px; font-weight: 500; }
h3 { margin: 0; font-size: 14px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 220px; min-width: 0; }
.danger-text { color: var(--fail); }

/* Layout: a sidebar and the page; on a phone the sidebar stacks above. */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; flex: 0 0 216px; max-width: 100%; background: var(--nav); color: var(--nav-text); padding: 20px 16px; display: flex; flex-direction: column; gap: 22px; }
.side .brand { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; color: #fff; text-decoration: none; }
.side .brand:hover { color: #fff; text-decoration: none; }
.side .brand strong { font-size: 18px; letter-spacing: .02em; }
.side .brand span { font-size: 12px; color: var(--nav-muted); }
.side .group { display: flex; flex-direction: column; gap: 2px; }
.side .group > span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--nav-muted); padding: 0 8px 6px; }
.side .group a { color: var(--nav-text); padding: 8px; border-radius: 6px; text-decoration: none; }
.side .group a:hover { background: var(--nav-hover); color: #fff; }
.side .group a[aria-current="page"] { background: var(--nav-hover); color: #fff; font-weight: 500; }
.side .who { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--nav-hover); display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--nav-muted); }
.side .who strong { color: #fff; font-weight: 400; overflow-wrap: anywhere; }
.side .who .link { color: var(--nav-muted); align-self: flex-start; }
.page { flex: 1 1 0; min-width: 0; max-width: 1180px; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.page.alone { margin: 48px auto; max-width: 440px; flex: 0 1 440px; }
@media (max-width: 800px) {
  .page { flex-basis: 100%; padding: 20px 16px 40px; }
  /* The sidebar becomes a compact bar of links above the page. */
  .side { position: static; height: auto; flex: 1 1 100%; flex-flow: row wrap; align-items: center; gap: 6px 4px; padding: 12px 16px; }
  .side .brand { flex-basis: 100%; flex-direction: row; align-items: baseline; gap: 8px; padding: 0 0 4px; }
  .side .group { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .side .group > span { display: none; }
  .side .group a { padding: 6px 8px; }
  .side .who { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; padding: 8px 0 0; }
}

/* Page parts */
.crumbs { font-size: 13px; color: var(--ink-2); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-head .title { display: flex; flex-flow: row wrap; align-items: center; gap: 6px 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.panel > header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel > header p { font-size: 13px; color: var(--ink-2); flex-basis: 100%; }
.panel .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.panel > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.scroll { overflow-x: auto; }
.section { display: flex; flex-direction: column; gap: 10px; }
.section > header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.split { display: flex; flex-wrap: wrap; gap: 20px; }
.split > * { flex: 1 1 340px; min-width: 0; }
.note { font-size: 13px; color: var(--ink-2); }

/* Tabs and segmented controls */
/* The line is a shadow inside the strip, which the current tab's underline
   covers: a border pulled under it by a negative margin overflowed by a pixel,
   and the scrolling strip showed a scroll bar for it. */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tabs a span { color: var(--ink-3); font-weight: 400; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; background: var(--surface); }
.segmented a, .segmented strong { padding: 7px 12px; color: var(--ink-2); text-decoration: none; white-space: nowrap; font-weight: 400; }
.segmented > * + * { border-left: 1px solid var(--line-strong); }
.segmented a:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
.segmented strong { background: var(--ink); color: #fff; }

/* Actions */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 600 14px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--sunken); color: var(--ink); }
.button.danger { background: var(--surface); color: var(--fail); border-color: var(--fail-bar); }
.button.danger:hover { background: var(--fail-bg); color: var(--fail); }
.button.wide { width: 100%; }
.button:disabled { background: var(--line-strong); border-color: var(--line-strong); color: var(--ink-2); cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--fail); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Forms: a visible label above every field, help or an error below it. */
form { margin: 0; }
input, select, textarea { font: 14px var(--sans); color: var(--ink); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); min-height: 38px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input.mono { font-family: var(--mono); font-size: 14px; }
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
input[type="file"] { padding: 6px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; min-width: 0; }
.field input, .field select { width: 100%; font-weight: 400; }
.field small { font-size: 12px; font-weight: 400; color: var(--ink-2); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: start; }
/* Fields line up by their tops, so a field with help text below it does not
   lift its input above the others; the button drops by a label's height to
   sit level with the inputs. */
.inline-form, .panel .body.inline-form { display: flex; flex-flow: row wrap; gap: 10px; align-items: flex-start; }
.inline-form > .button { margin-top: calc(13px * 1.45 + 4px); }
.inline-form .field { flex: 1 1 180px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; }
.notice { padding: 10px 14px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--accent-line); }
.notice.success { background: var(--pass-bg); color: var(--pass); border-color: var(--pass-line); }
.notice.danger { background: var(--fail-bg); color: var(--fail-ink); border-color: var(--fail-line); }
.notice a { color: inherit; text-decoration: underline; }
dl.preview { margin: 0; background: var(--ground); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; font-size: 13px; }
dl.preview dt { color: var(--ink-2); }
dl.preview dd { margin: 0; overflow-wrap: anywhere; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; vertical-align: top; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
thead th { font-size: 12px; font-weight: 500; color: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap; padding-top: 10px; }
tbody tr + tr > * { border-top: 1px solid var(--line-soft); }
tbody th.group { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--sunken); padding-top: 14px; padding-bottom: 6px; }
tbody + tbody th.group { border-top: 1px solid var(--line-soft); }
td.num, th.num { text-align: right; }
td.mid, th.mid { text-align: center; }
/* A column no wider than its content, so the next one sits right beside it (a time, then its verdict). */
td.tight { width: 1%; white-space: nowrap; }
td.end, th.end { text-align: right; white-space: nowrap; }
table.lines { white-space: nowrap; }
td.clip { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Columns headed from above (a series' plans): each name on its own line, ending at its narrow column; every other one shaded, line and column. */
thead.stair tr:not(:last-child) th { border-bottom: 0; padding-top: 5px; padding-bottom: 5px; }
thead.stair th.plan { text-align: right; }
thead.stair th.band, td.band { background: var(--ground); }
td.in-plan { width: 1%; text-align: center; padding-left: 10px; padding-right: 10px; }
td.in-plan small { display: block; font-size: 11px; margin-top: 2px; }
tr.empty td { color: var(--ink-2); padding-top: 18px; padding-bottom: 18px; }
tr.notable td, tr.flagged td { background: #fffbf4; }

/* Verdicts, outcomes and tags */
.verdict, .tag { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .04em; padding: 4px 7px; border-radius: 4px; text-transform: uppercase; white-space: nowrap; vertical-align: 1px; }
.verdict.pass, .verdict.passed, .verdict.xpass { background: var(--pass-bg); color: var(--pass); }
.verdict.fail, .verdict.failed { background: var(--fail-bg); color: var(--fail); }
.verdict.error { background: var(--error-bg); color: var(--error); }
.verdict.aborted, .verdict.skipped, .verdict.xfail { background: var(--aborted-bg); color: var(--aborted); }
.verdict.not_run { background: var(--surface); color: var(--ink-3); border: 1px dashed var(--line-strong); padding: 3px 6px; }
.verdict.big { font-size: 13px; padding: 6px 9px; }
.tag { background: var(--accent-soft); color: var(--accent-dark); }
.tag.station { background: var(--error-bg); color: var(--error); }
.tag.neutral { background: var(--aborted-bg); color: var(--aborted); }

/* Figures */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tiles > div { color: var(--ink-2); font-size: 13px; }
.tiles .big { display: block; color: var(--ink); font-size: 26px; font-weight: 600; line-height: 1.2; }
.tiles.boxed > div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); min-width: 2px; }
.stackbar { display: flex; height: 10px; border-radius: 3px; overflow: hidden; background: var(--line); }
.stackbar > span { display: block; height: 100%; }
.counts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.plan-card { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.plan-card > header, .panel.plan-card > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 4px 12px; padding: 0; border: 0; }

/* Needs attention */
.attention { list-style: none; margin: 0; padding: 0; }
.attention li + li { border-top: 1px solid var(--line-soft); }
.attention a { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 12px 18px; color: var(--ink); text-decoration: none; }
.attention a:hover { background: var(--sunken); text-decoration: none; color: var(--ink); }
.attention .what { flex: 1 1 320px; }
.attention .count { color: var(--ink-2); }
.calm { padding: 14px 18px; color: var(--ink-2); }

/* A run */
.banner { border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; border: 1px solid; }
.banner.fail { background: var(--fail-bg); border-color: var(--fail-line); color: var(--fail-ink); }
.banner.error, .banner.aborted { background: var(--error-bg); border-color: var(--error-line); color: #5c2c00; }
.banner strong { color: var(--ink); }
dl.facts { margin: 0; padding: 16px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; }
dl.facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
dl.facts dt { font-size: 12px; color: var(--ink-2); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
ol.steps { list-style: none; margin: 0; padding: 0; }
ol.steps > li { padding: 12px 18px; display: flex; flex-direction: column; gap: 10px; }
ol.steps > li + li { border-top: 1px solid var(--line-soft); }
ol.steps > li.failed, ol.steps > li.error { background: #fffbfa; }
ol.steps > li.not_run { color: var(--ink-3); padding-top: 9px; padding-bottom: 9px; }
.step-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.step-head .verdict { min-width: 64px; text-align: center; }
.step-head .name { flex: 1 1 280px; }
.step-head .name .mono { color: var(--ink-2); font-size: 12px; margin-left: 4px; }
.step-body { padding-left: 76px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 640px) { .step-body { padding-left: 0; } }
.step-body table { border: 1px solid var(--line); border-radius: 6px; }
.step-body th:first-child, .step-body td:first-child { padding-left: 10px; }
.step-body th:last-child, .step-body td:last-child { padding-right: 10px; }
table.measurements tr.failed td { background: var(--fail-bg); }
details > summary { cursor: pointer; color: var(--accent); }
pre.traceback { margin: 8px 0 0; padding: 12px; background: var(--ink); color: #e6e7e9; border-radius: 6px; font: 12px/1.5 var(--mono); overflow-x: auto; max-height: 480px; }
table.env td { font-family: var(--mono); font-size: 12px; padding-top: 5px; padding-bottom: 5px; overflow-wrap: anywhere; }

/* Charts */
.chart { overflow-x: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); align-items: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend.levels { gap: 4px; }
.legend.levels i { margin: 0; }
svg.calendar { width: 100%; height: auto; display: block; }
svg.calendar text { font: 9px var(--sans); fill: var(--ink-2); }
svg.calendar rect { stroke: rgba(0, 0, 0, .04); }
svg.calendar .l0 { fill: #ebecea; } .legend i.l0 { background: #ebecea; }
svg.calendar .l1 { fill: #c7d3f5; } .legend i.l1 { background: #c7d3f5; }
svg.calendar .l2 { fill: #7f98e6; } .legend i.l2 { background: #7f98e6; }
svg.calendar .l3 { fill: #3e62d6; } .legend i.l3 { background: #3e62d6; }
svg.calendar .l4 { fill: #1e3a8a; } .legend i.l4 { background: #1e3a8a; }
svg.calendar a rect:hover { stroke: var(--ink); stroke-width: 1.5; }
svg.calendar .future { fill: none; stroke: var(--line); }
.outcomes { display: flex; height: 16px; width: 100%; min-width: 200px; border-radius: 3px; overflow: hidden; background: var(--line); }
.outcomes .seg { display: block; height: 100%; }
.seg.passed, .seg.pass { background: var(--pass-bar); }
.seg.failed, .seg.fail { background: var(--fail-bar); }
.seg.error { background: var(--error-bar); }
.seg.skipped, .seg.aborted { background: var(--skipped-bar); }
.seg.not_run { background: var(--not-run-bar); }
.outcomes-col { width: 34%; }
.timing-col { width: 26%; }
svg.spark { width: 100%; height: 16px; display: block; }
svg.spark .range { stroke: var(--skipped-bar); stroke-width: 1.5; }
svg.spark .spread { fill: var(--accent-line); }
svg.spark .mark { stroke: var(--accent); stroke-width: 2; }
svg.histogram { width: 100%; max-width: 720px; height: auto; display: block; }
/* The accepted region shaded, what falls outside it in the failure color,
   the limits labelled min and max, and the median a marker of its own. */
svg.histogram .accepted, svg.spark .accepted { fill: var(--pass-bg); }
svg.histogram .hist-bar { fill: var(--accent); opacity: .85; }
svg.histogram .hist-bar.out { fill: var(--fail-bar); opacity: .9; }
svg.histogram .hist-outside { fill: var(--skipped-bar); }
svg.histogram .hist-outside.out { fill: var(--fail-bar); opacity: .9; }
svg.histogram .limit { stroke: var(--pass); stroke-width: 1.5; }
svg.histogram .median { fill: var(--ink); }
svg.histogram .median-label { font: 12px var(--sans); fill: var(--ink); }
svg.histogram .axis { stroke: var(--line-strong); }
svg.histogram text { font: 12px var(--mono); fill: var(--ink-2); }
svg.histogram .limit-label { fill: var(--pass); font-weight: 500; }

/* Products */
.artifact { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.artifact + .artifact { border-top: 1px solid var(--line); }
.artifact > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.artifact table { border: 1px solid var(--line); border-radius: 6px; }
.artifact table td:first-child { padding-left: 10px; }
.artifact table td:last-child { padding-right: 10px; }
.artifact details form { margin-top: 10px; }

/* Sign-in and station authorization */
.code { font: 600 32px/1.2 var(--mono); letter-spacing: 4px; text-align: center; padding: 8px 0; }
.dev { border-top: 1px dashed var(--line-strong); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }

/* Label designs: the layout beside its preview */
.label-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: stretch; }
.label-editor textarea { width: 100%; min-height: 420px; font: 13px/1.5 var(--mono); padding: 10px 12px; resize: vertical; tab-size: 4; }
.label-preview { width: 100%; min-height: 420px; height: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--sunken); }

/* The sign-in page's tagline. */
.tagline { margin: 18px 0 0; color: var(--ink-2); font-style: italic; }
.tagline cite { font-style: normal; color: var(--ink-3); }
.tagline cite::before { content: " — "; }
