/* Blueprint Athlete Evaluation — visual system.
   Light, dense, and built for scanning: a coach reads this with an athlete in
   position and a dynamometer in one hand. Reference points are player-
   development software and a biomechanics lab, not an admin dashboard.
   Colour is carried by small indicators (dots, rules, badges) rather than by
   tinting whole panels, so a disconnected device never becomes the loudest
   thing on screen. */

@font-face {
    font-family: "Garp Sans Wide";
    src: url("/assets/Fonts/Garp Sans Wide.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roboto";
    src: url("/assets/Fonts/Roboto-Medium.ttf") format("truetype");
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --navy: #13294C;
    --navy-2: #1D3A66;
    --blue: #2F6FB0;
    --blue-wash: #EDF3FA;
    --blue-line: #C9DCEF;

    --green: #157F4F;
    --green-wash: #E9F5EF;
    --green-line: #B4DCC8;
    --amber: #94620B;
    --amber-wash: #FDF4E4;
    --amber-line: #E8D2A4;
    --red: #B23A2B;
    --red-wash: #FBEDEB;
    --red-line: #EBC2BB;

    --canvas: #F6F8FA;
    --surface: #FFFFFF;
    --sunk: #F9FAFC;

    --ink: #0F1620;
    --ink-2: #3C4754;
    --ink-3: #68727F;
    --ink-4: #98A1AC;

    --line: #E4E8ED;
    --line-strong: #CDD5DE;

    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 10px;

    --shadow: 0 1px 2px rgba(15, 22, 32, .05);
    --shadow-pop: 0 4px 14px rgba(15, 22, 32, .09);

    /* Garp carries brand identity — headings, section names, test names, and
       primary buttons. Everything a coach has to READ quickly (instructions,
       metadata, helper text, device status, and every number) uses Roboto:
       Garp's digits blur at small sizes and this is a measurement tool. */
    --font-display: "Garp Sans Wide", "Roboto", sans-serif;
    --font-body: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
dl, dd, dt, ol, ul, figure { margin: 0; padding: 0; }
li { list-style: none; }

.is-hidden { display: none !important; }

.eyebrow, .overline {
    font-family: var(--font-body);
    font-size: 10.5px; font-weight: 700;
    letter-spacing: .13em; text-transform: uppercase;
    color: var(--ink-4);
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ============================ Gate ============================ */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 32px; text-align: center; }
.gate-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--shadow);
    padding: 36px 34px; max-width: 440px;
}
.gate-card img { height: 30px; margin-bottom: 18px; }
.gate-card h1 { font-family: var(--font-display); font-size: 17px; text-transform: uppercase; color: var(--navy); }
.gate-card p { color: var(--ink-3); margin: 10px 0 0; }

/* ============================ Header ============================ */

.topbar {
    position: sticky; top: 0; z-index: 30;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.shell { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

.topbar-main {
    display: flex; align-items: center; gap: 18px;
    height: 58px;
}

.brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.brand img { height: 22px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 11px; text-transform: uppercase; color: var(--navy); }
.brand-text span { font-size: 10px; color: var(--ink-4); letter-spacing: .05em; text-transform: uppercase; }

.topbar-divider { width: 1px; align-self: stretch; margin: 12px 0; background: var(--line); flex-shrink: 0; }

/* Athlete identity: prominent enough to never be in doubt, quiet enough not to
   compete with the test itself. */
.athlete-chip { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.athlete-chip.is-empty { color: var(--ink-4); font-size: 13px; }
.athlete-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--navy); color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: 12px; flex-shrink: 0;
    object-fit: cover;
}
.athlete-chip-info { min-width: 0; }
.athlete-chip-info strong {
    display: block; font-family: var(--font-display);
    font-size: 13.5px; text-transform: uppercase; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    line-height: 1.25;
}
.athlete-chip-info span {
    display: block; font-size: 11.5px; color: var(--ink-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.save-indicator {
    font-size: 11px; color: var(--ink-4); letter-spacing: .04em;
    opacity: 0; transition: opacity .25s var(--ease);
}
.save-indicator.is-visible { opacity: 1; }

/* ---------- Status badge (device pill and inline statuses) ---------- */

.status-badge {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px 5px 9px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--sunk);
    font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
    color: var(--ink-2); white-space: nowrap;
    transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.status-badge.is-compact { padding: 3px 9px 3px 7px; font-size: 11px; }
.status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--ink-4); flex-shrink: 0;
    transition: background .2s var(--ease);
}
.status-badge.tone-ok { border-color: var(--green-line); background: var(--green-wash); color: var(--green); }
.status-badge.tone-ok .status-dot { background: var(--green); }
.status-badge.tone-warn { border-color: var(--amber-line); background: var(--amber-wash); color: var(--amber); }
.status-badge.tone-warn .status-dot { background: var(--amber); }
.status-badge.tone-error { border-color: var(--red-line); background: var(--red-wash); color: var(--red); }
.status-badge.tone-error .status-dot { background: var(--red); }
.status-badge.tone-live .status-dot { background: var(--green); animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.research-badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: var(--r-xs);
    border: 1px solid var(--amber-line); background: var(--amber-wash);
    color: var(--amber);
    font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    white-space: nowrap;
}

/* ---------- Stage progress track ---------- */

.progress-rail { display: flex; gap: 5px; padding-bottom: 9px; }
.progress-step {
    flex: 1 1 0; min-width: 74px;
    background: none; border: none; padding: 0; text-align: left;
    display: flex; flex-direction: column; gap: 6px;
}
.progress-bar {
    height: 3px; border-radius: 2px; background: var(--line);
    transition: background .25s var(--ease);
}
.progress-label {
    display: flex; align-items: center; gap: 5px;
    font-family: var(--font-body);
    font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
    color: var(--ink-4);
    transition: color .2s var(--ease);
    white-space: nowrap;
}
.progress-step:hover .progress-label { color: var(--ink-2); }
.progress-step.is-partial .progress-bar { background: var(--blue-line); }
.progress-step.is-partial .progress-label { color: var(--ink-3); }
.progress-step.is-complete .progress-bar { background: var(--green); }
.progress-step.is-complete .progress-label { color: var(--green); }
.progress-step.is-active .progress-bar { background: var(--navy); }
.progress-step.is-active .progress-label { color: var(--navy); }
.progress-check { font-size: 9px; line-height: 1; animation: checkIn .28s var(--ease); }

@keyframes checkIn { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }

/* ---------- Section sub-navigation ---------- */

.substep-rail {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0 10px;
    border-top: 1px solid var(--line);
}
.substep-rail-label {
    font-family: var(--font-display);
    font-size: 10.5px; text-transform: uppercase; color: var(--ink-4);
    flex-shrink: 0; padding-right: 12px; border-right: 1px solid var(--line);
}
.substep-list { display: flex; gap: 6px; flex-wrap: wrap; }
.substep {
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface);
    padding: 5px 11px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--ink-3);
    display: inline-flex; align-items: center; gap: 7px;
    transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.substep:hover { border-color: var(--line-strong); color: var(--ink); }
.substep-count { font-weight: 400; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--ink-4); }
.substep.is-partial { border-color: var(--blue-line); color: var(--ink-2); }
.substep.is-complete { border-color: var(--green-line); background: var(--green-wash); color: var(--green); }
.substep.is-complete .substep-count { color: var(--green); }
.substep.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.substep.is-active .substep-count { color: rgba(255, 255, 255, .68); }

/* ============================ Page body ============================ */

.step-scroll { max-width: 1240px; margin: 0 auto; padding: 20px 24px 88px; }
.step-view { animation: viewIn .18s var(--ease); }

@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 16px; }
.page-head-eyebrow {
    margin: 0 0 3px; font-size: 10.5px; font-weight: 700;
    letter-spacing: .13em; text-transform: uppercase; color: var(--ink-4);
}
.page-head-title {
    font-family: var(--font-display);
    font-size: 22px; text-transform: uppercase; color: var(--navy);
    line-height: 1.1;
}
.page-head-blurb { margin: 5px 0 0; color: var(--ink-3); font-size: 13px; }

/* ---------- Panels ---------- */

.panel, .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}
.panel-head, .card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}
.panel-title, .card-head h2 {
    font-family: var(--font-display);
    font-size: 12px; text-transform: uppercase; color: var(--navy);
}
.panel-meta, .card-head .hint { font-size: 11.5px; color: var(--ink-3); }
.panel-body { padding: 18px; }
.card { padding: 18px; }
.card .card-head { margin: -18px -18px 16px; }

.notice {
    border-radius: var(--r-sm); padding: 10px 13px; font-size: 12.5px;
    border: 1px solid var(--line); background: var(--sunk); color: var(--ink-2);
    margin: 0;
}
.notice-warn { border-color: var(--amber-line); background: var(--amber-wash); color: var(--amber); }
.notice-error { border-color: var(--red-line); background: var(--red-wash); color: var(--red); }

/* ---------- Fields ---------- */

.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field label, .field > span.field-label {
    display: block;
    font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
    color: var(--ink-3); margin-bottom: 6px;
}
.field-input {
    display: flex; align-items: stretch;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    background: var(--surface); overflow: hidden;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 176, .13); }
.field-input input {
    flex: 1; min-width: 0; border: none; outline: none; background: none;
    padding: 0 12px; height: 46px;
    font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink);
}
.field-input input::placeholder { color: #C6CDD5; font-weight: 400; }
.field-input input::-webkit-outer-spin-button,
.field-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field-input input[type="number"] { -moz-appearance: textfield; }
.field-unit {
    display: grid; place-items: center; padding: 0 12px;
    background: var(--sunk); border-left: 1px solid var(--line);
    font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--ink-3);
    min-width: 46px;
}

.derived-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.derived {
    background: var(--blue-wash); border: 1px solid var(--blue-line);
    border-radius: var(--r-sm); padding: 8px 13px; min-width: 128px;
}
.derived span {
    display: block; font-size: 9.5px; font-weight: 700;
    letter-spacing: .11em; text-transform: uppercase; color: var(--blue); margin-bottom: 2px;
}
.derived strong { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }

.attempt-row { display: grid; grid-template-columns: 1fr 1fr 118px; gap: 14px; align-items: end; }
.best-cell {
    background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm);
    height: 46px; display: grid; place-items: center;
}
.best-cell strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.best-cell.is-empty strong { color: var(--ink-4); font-weight: 400; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border-radius: var(--r-sm); border: 1px solid transparent;
    font-family: var(--font-display);
    font-size: 11.5px; text-transform: uppercase;
    padding: 0 18px; height: 40px;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .08s var(--ease);
}
.btn:not(:disabled):active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--navy-2); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:not(:disabled):hover { border-color: var(--ink-4); color: var(--ink); }
.btn-lg { height: 48px; font-size: 12.5px; padding: 0 26px; }
.btn-block { width: 100%; }
.btn-quiet {
    background: none; border: none; color: var(--ink-3);
    font-family: var(--font-body); text-transform: none; letter-spacing: 0;
    font-size: 12.5px; padding: 0 6px; height: auto;
}
.btn-quiet:hover { color: var(--navy); text-decoration: underline; }
.btn-danger-quiet {
    background: none; border: none; color: var(--red);
    font-family: var(--font-body); text-transform: none; letter-spacing: 0;
    font-size: 12.5px; height: auto; padding: 0 4px;
}

/* ---------- Athlete search ---------- */

.search-wrap { position: relative; max-width: 560px; }
.search-input {
    width: 100%; height: 52px;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    background: var(--surface); padding: 0 16px; font-size: 16px; outline: none;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 176, .13); }
.search-input::placeholder { color: #B4BCC5; }

.search-results {
    margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface); box-shadow: var(--shadow-pop);
    max-height: 340px; overflow-y: auto;
}
.search-result {
    display: flex; align-items: center; gap: 12px;
    width: 100%; text-align: left; padding: 10px 14px;
    background: none; border: none; border-bottom: 1px solid var(--line);
    transition: background .12s var(--ease);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result:focus-visible { background: var(--blue-wash); outline: none; }
.search-result-info { min-width: 0; flex: 1; }
.search-result-info strong { display: block; font-size: 14px; color: var(--ink); }
.search-result-info span { display: block; font-size: 12px; color: var(--ink-3); }
.search-empty { padding: 18px 14px; color: var(--ink-3); text-align: center; }

.selected-athlete {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface); border: 1px solid var(--line);
    border-left: 3px solid var(--navy);
    border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow);
}
.selected-athlete .athlete-avatar { width: 48px; height: 48px; font-size: 16px; }
.selected-athlete h2 { font-family: var(--font-display); font-size: 18px; text-transform: uppercase; color: var(--ink); }
.selected-athlete .meta { color: var(--ink-3); font-size: 13px; margin: 2px 0 0; }

.side-toggle { display: flex; gap: 10px; }
.side-option {
    flex: 1; height: 50px;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    background: var(--surface);
    font-family: var(--font-display); font-size: 14px; text-transform: uppercase;
    color: var(--ink-2);
    transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.side-option:hover { border-color: var(--ink-4); }
.side-option.is-selected { border-color: var(--navy); background: var(--navy); color: #fff; }

/* ============================ Device bar ============================ */

/* Deliberately neutral. Only the status dot and its badge carry colour — an
   earlier amber-tinted panel made "not connected" read as the most important
   thing on the page, above the test itself. */
.device-bar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--shadow);
    padding: 12px 16px; margin-bottom: 14px;
}
.device-bar-id { display: flex; flex-direction: column; gap: 1px; padding-right: 16px; border-right: 1px solid var(--line); }
.device-bar-id strong { font-family: var(--font-display); font-size: 12px; text-transform: uppercase; color: var(--navy); }
.device-bar-id span { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); }
.device-bar-state { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; flex-wrap: wrap; }
.device-bar-hint { font-size: 12px; color: var(--ink-3); }
.device-bar-streams { display: flex; gap: 6px; }
.device-bar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.device-bar-detail { flex-basis: 100%; }
.device-troubleshoot { margin: 8px 0 0; padding-left: 16px; font-size: 12px; color: var(--ink-2); line-height: 1.65; }
.device-troubleshoot li { list-style: disc; }

/* ============================ Test selector ============================ */

.test-selector { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.test-option {
    flex: 1 1 0; min-width: 132px;
    display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface); padding: 9px 13px; text-align: left;
    transition: border-color .15s var(--ease), background .15s var(--ease), transform .1s var(--ease);
}
.test-option:hover { border-color: var(--line-strong); }
.test-option-code {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--font-display); font-size: 12.5px; text-transform: uppercase; color: var(--ink);
}
.test-option-name { font-size: 11px; color: var(--ink-3); }
.test-option.is-complete { border-color: var(--green-line); background: var(--green-wash); }
.test-option.is-complete .test-option-code { color: var(--green); }
.test-option.is-complete .test-option-name { color: var(--green); opacity: .85; }
.test-option.is-active { border-color: var(--navy); background: var(--navy); box-shadow: var(--shadow-pop); }
.test-option.is-active .test-option-code { color: #fff; }
.test-option.is-active .test-option-name { color: rgba(255, 255, 255, .72); }
.test-option-check { font-size: 10px; animation: checkIn .28s var(--ease); }

/* ============================ Test workspace ============================ */

.test-stage {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden;
}
.test-stage-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.test-stage-head .counter {
    display: block; font-size: 10px; font-weight: 700;
    letter-spacing: .13em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 2px;
}
.test-stage-head h2 { font-family: var(--font-display); font-size: 17px; text-transform: uppercase; color: var(--ink); line-height: 1.15; }
.test-stage-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }

.test-body { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); }
.setup-pane { padding: 18px; border-right: 1px solid var(--line); }
.setup-pane h3 {
    font-size: 10px; font-weight: 700; letter-spacing: .13em;
    text-transform: uppercase; color: var(--ink-4); margin-bottom: 10px;
}

.instruction-steps { counter-reset: setup; display: flex; flex-direction: column; gap: 8px; }
.instruction-steps li { display: flex; gap: 10px; align-items: flex-start; counter-increment: setup; }
.instruction-index {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: var(--r-xs);
    background: var(--sunk); border: 1px solid var(--line);
    display: grid; place-items: center;
    font-size: 10.5px; font-weight: 700; color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
.instruction-index::before { content: counter(setup); }
.instruction-text { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.movement-callout {
    margin-top: 14px; padding: 11px 13px;
    border-left: 3px solid var(--blue); border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: var(--blue-wash);
}
.movement-label {
    margin: 0 0 2px; font-size: 9.5px; font-weight: 700;
    letter-spacing: .13em; text-transform: uppercase; color: var(--blue);
}
.movement-text { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* Reserved slot for a future per-test illustration. Until real artwork exists
   it shows only facts the protocol actually establishes — never an invented
   anatomy diagram. */
.test-figure { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); padding: 12px 14px; }
.test-figure.has-art { padding: 0; overflow: hidden; }
.test-figure-caption {
    font-size: 9.5px; font-weight: 700; letter-spacing: .13em;
    text-transform: uppercase; color: var(--ink-4); margin-bottom: 8px;
}
.test-figure-list { display: flex; flex-wrap: wrap; gap: 18px; }
.test-figure-list dt { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }
.test-figure-list dd { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }

/* ---------- Measurement panel ---------- */

.readout-pane {
    padding: 18px; background: var(--sunk);
    display: flex; flex-direction: column; gap: 12px;
    min-height: 250px;
}
.readout-label { font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-4); }
.readout-value {
    font-family: var(--font-body);
    font-size: 54px; font-weight: 700; line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--navy); letter-spacing: -.02em;
}
.readout-value.is-idle { color: var(--ink-4); }
.readout-value .unit { font-size: 20px; font-weight: 700; margin-left: 4px; color: var(--ink-3); }
.cue { font-family: var(--font-display); font-size: 24px; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.countdown {
    font-family: var(--font-body); font-size: 76px; font-weight: 700; line-height: 1;
    color: var(--navy); font-variant-numeric: tabular-nums;
    animation: countTick .3s var(--ease);
}

@keyframes countTick { from { opacity: .3; transform: scale(.94); } to { opacity: 1; transform: none; } }

.capture-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.capture-bar span { display: block; height: 100%; background: var(--blue); width: 0; transition: width .1s linear; }

.result-block .readout-value { color: var(--green); }
.test-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.test-actions .btn { flex: 1 1 128px; }

/* Device-required state: the panel still has a job instead of holding an alert */
.device-required { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin: auto 0; }
.device-required-mark {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--line-strong); background: var(--surface);
    display: grid; place-items: center; color: var(--ink-4); font-size: 15px;
}
.device-required strong { font-family: var(--font-display); font-size: 12.5px; text-transform: uppercase; color: var(--ink-2); }
.device-required p { margin: 0; font-size: 12.5px; color: var(--ink-3); }

/* ============================ Medical history ============================ */

.entry-card { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; margin-bottom: 10px; background: var(--sunk); }
.entry-grid { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1fr; gap: 12px; }
.entry-card .field-input input, .entry-card select, .entry-card input[type="date"] { height: 40px; font-size: 14px; font-weight: 400; }
.entry-card select, .entry-card input[type="date"], .entry-card textarea {
    width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    background: var(--surface); padding: 0 10px; outline: none;
}
.entry-card textarea { padding: 10px; height: 62px; resize: vertical; font-size: 13px; }
.entry-card select:focus, .entry-card input:focus, .entry-card textarea:focus {
    border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 176, .13);
}
.entry-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ============================ Review ============================ */

.review-section { margin-bottom: 12px; }
.review-head {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding-bottom: 9px; margin-bottom: 10px; border-bottom: 2px solid var(--navy);
}
.review-head h2 { font-family: var(--font-display); font-size: 12px; text-transform: uppercase; color: var(--navy); }
.review-table { width: 100%; border-collapse: collapse; }
.review-table th {
    text-align: left; font-size: 9.5px; font-weight: 700;
    letter-spacing: .11em; text-transform: uppercase; color: var(--ink-4);
    padding: 0 9px 7px;
}
.review-table th.num, .review-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.review-table td { padding: 7px 9px; border-top: 1px solid var(--line); font-size: 13px; }
.review-table td.label { color: var(--ink-2); }
.review-table tr.is-derived td { background: var(--blue-wash); color: var(--navy); font-weight: 700; }
.review-table td.empty, .review-table .empty { color: var(--ink-4); }
.review-list { display: flex; flex-direction: column; gap: 5px; color: var(--ink-2); font-size: 13px; }
.review-list li { list-style: disc; margin-left: 18px; }

/* ============================ Footer ============================ */

.step-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
.step-nav-progress { height: 2px; background: var(--line); }
.step-nav-progress span { display: block; height: 100%; background: var(--navy); transition: width .25s var(--ease); }
.step-nav-inner {
    max-width: 1240px; margin: 0 auto;
    padding: 9px 24px calc(9px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 14px;
}
.step-nav .spacer { flex: 1; }
.nav-position { text-align: center; line-height: 1.25; }
.nav-position .nav-step-count {
    display: block; font-size: 10px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4);
}
.nav-position .nav-step-name { display: block; font-family: var(--font-display); font-size: 12px; text-transform: uppercase; color: var(--ink-2); }

/* ============================ Completion ============================ */

.complete-panel { text-align: center; padding: 38px 26px; }
.complete-panel .mark { font-size: 38px; color: var(--green); line-height: 1; }
.complete-panel h1 { font-family: var(--font-display); font-size: 22px; text-transform: uppercase; color: var(--navy); margin: 12px 0 6px; }
.complete-panel p { color: var(--ink-3); margin: 0 auto; max-width: 46ch; }
.complete-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ============================ Responsive ============================ */

@media (max-width: 1080px) {
    .test-body { grid-template-columns: 1fr; }
    .setup-pane { border-right: none; border-bottom: 1px solid var(--line); }
    .readout-pane { min-height: 0; }
    .entry-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    .field-grid, .field-grid.cols-2 { grid-template-columns: 1fr 1fr; }
    .attempt-row { grid-template-columns: 1fr 1fr; }
    .attempt-row .best-wrap { grid-column: 1 / -1; }
    .shell { padding: 0 16px; }
    .step-scroll { padding: 16px 16px 92px; }
    .topbar-main { height: auto; padding: 10px 0; flex-wrap: wrap; }
    .topbar-divider { display: none; }
    .progress-rail { overflow-x: auto; scrollbar-width: none; }
    .progress-rail::-webkit-scrollbar { display: none; }
    .progress-step { flex: 1 0 auto; min-width: 90px; }
    .substep-rail { flex-wrap: wrap; }
    .step-nav-inner { padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); }
    /* Touch targets stay full size on tablets — this is used one-handed. */
    .btn { height: 44px; }
    .test-option { min-width: 118px; padding: 10px 13px; }
}

@media (max-width: 600px) {
    .field-grid, .field-grid.cols-2, .attempt-row, .entry-grid { grid-template-columns: 1fr; }
    .selected-athlete { flex-direction: column; align-items: flex-start; }
    .nav-position { display: none; }
    .readout-value { font-size: 46px; }
    .countdown { font-size: 62px; }
}

@media print {
    .topbar, .step-nav { display: none; }
}

/* ---------- Mobility screen (tap-to-score 1-10) ---------- */

.score-rows { display: flex; flex-direction: column; gap: 10px; }
.score-row {
    display: grid; grid-template-columns: 170px 1fr 52px;
    align-items: center; gap: 14px;
}
.score-label {
    font-size: 10.5px; font-weight: 700; letter-spacing: .11em;
    text-transform: uppercase; color: var(--ink-3);
}
.score-scale { display: flex; gap: 4px; }
.score-dot {
    flex: 1 1 0; min-width: 0; height: 38px;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--ink-3);
    transition: border-color .12s var(--ease), background .12s var(--ease), color .12s var(--ease), transform .08s var(--ease);
}
.score-dot:hover { border-color: var(--ink-4); color: var(--ink); }
.score-dot:active { transform: translateY(1px); }
.score-dot.is-selected {
    border-color: var(--navy); background: var(--navy); color: #fff;
}
.score-clear {
    background: none; border: none; padding: 0;
    font-size: 11.5px; color: var(--ink-4); text-align: right;
}
.score-clear:hover { color: var(--red); text-decoration: underline; }

@media (max-width: 860px) {
    .score-row { grid-template-columns: 1fr; gap: 6px; }
    .score-clear { text-align: left; }
    .score-dot { height: 42px; }
}

/* Motion-sensor diagnostic on the ROM steps (guided.js's imuDiagnosticHTML).
   "Device data lost" alone can't distinguish a sensor that never streamed from
   one that stopped mid-test, so the state is named in colour and the packet
   count is shown next to it. */
.hint .ok { color: var(--green); font-weight: 600; }
.hint .bad { color: var(--red); font-weight: 600; }
