/* Push Test page: built on styles.css (same dark driver-station look). Student 1's card on the left,
   Student 2's on the right, settings and the live graph in a strip along the bottom. */
:root {
  --red: #e0383d;
  --blue: #3d7fe8;
  --go: #2e9e57;               /* Start: green while a test can start */
  --contact: #b9c3cf;
  --strip-h: 148px;
  --card-w: 272px;
}
body { padding: 0; }
[hidden] { display: none !important; }
.card, .strip, .results { box-sizing: border-box; }

.topbar {
  position: fixed; top: 12px; left: calc(var(--card-w) + 28px); right: calc(var(--card-w) + 28px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar .brand b { color: var(--fg); }
.back { text-decoration: none; }
.banner {
  font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: 0.04em; text-transform: uppercase;
  text-align: center; flex: 1; min-width: 0; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.banner.count { font-size: 64px; line-height: 1; }
.banner .red { color: var(--red); }
.banner .blue { color: var(--blue); }

.card {
  position: fixed; top: 12px; bottom: calc(var(--strip-h) + 24px); width: var(--card-w);
  overflow-y: auto; scrollbar-width: thin;
  background: var(--panel-solid); border: 1px solid var(--line); border-top: 4px solid var(--team);
  border-radius: 10px; padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.card.red { left: 12px; --team: var(--red); }
.card.blue { right: 12px; --team: var(--blue); }
.card-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.who { white-space: nowrap; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--team); line-height: 1; }
.sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.badges { position: absolute; right: 0; top: 22px; display: flex; gap: 4px; }
.badge { font: 600 10px var(--display); letter-spacing: 0.1em; text-transform: uppercase; border-radius: 3px; padding: 1px 5px; border: 1px solid currentColor; }
.badge.slip { color: var(--rev); }
.badge.stall { color: #f06b6b; }

.readings { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.reading { display: flex; align-items: baseline; gap: 4px; }
.reading .v { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 0.95; font-variant-numeric: tabular-nums; }
.reading .u { font-family: var(--display); font-weight: 600; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.readings .facts { grid-column: 1 / -1; }

.card select, .card input[type="range"] { width: 100%; min-width: 0; font: 12.5px var(--body); color: var(--fg); background: var(--track); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; accent-color: var(--team); }
.card input[type="range"] { padding: 0; border: 0; background: none; }
.card .check input { accent-color: var(--team); }
.fields.compact { margin-top: 0; gap: 6px 10px; }
.limits { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.limits span:nth-child(even) { color: var(--fg); font-family: var(--mono); font-size: 11.5px; }
.limits b { color: var(--team); font-weight: 500; }
.card .keys { border-top: 1px solid var(--line); padding-top: 8px; }
.card .key-row { grid-template-columns: 6.6em 1fr; }

.strip {
  position: fixed; left: 12px; right: 12px; bottom: 12px; height: var(--strip-h);
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 16px;
}
.controls { display: grid; grid-template-columns: repeat(3, minmax(120px, auto)); gap: 8px 14px; align-content: start; }
.group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.group .label { gap: 8px; }
.group .label output { font-family: var(--mono); letter-spacing: 0; color: var(--fg); }
.group input[type="range"] { width: 100%; accent-color: var(--accent); }
.actions { flex-direction: row; align-items: flex-end; gap: 6px; grid-column: span 2; }
.actions button { flex: 1; }
.go { font: 700 14px var(--body); color: #fff; background: var(--go); border: 1px solid var(--go); border-radius: 6px; padding: 9px 8px; cursor: pointer; }
.go:hover:not(:disabled) { filter: brightness(1.12); }
/* Stop turns red while a test is counting down or running (the only time it is enabled). */
.actions #stop:not(:disabled) { color: #fff; background: var(--red); border-color: var(--red); }
.actions #stop:not(:disabled):hover { filter: brightness(1.12); }
/* Unavailable: plain and dim, so the coloured button is the one to press. */
.go:disabled { color: var(--muted); background: var(--track); border-color: var(--line); cursor: default; }
.actions .reset:disabled { opacity: 0.4; cursor: default; }
.live { position: relative; min-width: 0; display: flex; flex-direction: column; }
.live canvas { position: absolute; left: 0; right: 0; top: 22px; bottom: 0; width: 100%; height: calc(100% - 22px); display: block; }
.metric {
  align-self: flex-start; font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; padding: 0 0 4px; cursor: pointer;
}
.metric::after { content: " ›"; }
.metric:hover { color: var(--fg); }

.results {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  width: min(880px, calc(100% - 2 * var(--card-w) - 56px)); max-height: calc(100% - var(--strip-h) - 100px);
  overflow-y: auto; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.results h2 { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.03em; text-transform: uppercase; margin: 0; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 12.5px; }
.summary .who { font-size: 15px; }
.summary p { margin: 2px 0 0; color: var(--muted); }
.summary p b { color: var(--fg); font-weight: 500; }
.graphs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.graphs figure { margin: 0; min-width: 0; }
.graphs figcaption { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.graphs canvas { width: 100%; height: 150px; display: block; }

.hint { bottom: calc(var(--strip-h) + 30px); }

@media (max-width: 1100px) {
  :root { --card-w: 236px; --strip-h: 188px; }
  .reading .v { font-size: 28px; }
  .controls { grid-template-columns: repeat(2, minmax(110px, auto)); }
}
.summary .both { grid-column: 1 / -1; margin-top: 2px; }
