/* VFC Analyser, design B ("editorial greeting"). Type: Source Serif 4 for headings people read, Source Sans 3 for everything else.
   One centred 1100px column on a 12-column grid (12 x 77px + 11 x 16px = 1100).
   Colours are variables: light by default, dark when the system asks for it or the
   theme button sets data-theme="dark" on <html>. */

:root {
  color-scheme: light;
  --ground: #ffffff;      /* the page */
  --surface: #f6f7f8;     /* panels: one step off white */
  --raised: #ffffff;      /* rows, inputs, cards inside panels */
  --border: #e6e8ea;
  --rule: #eef0f1;
  --control: #d3d6d9;     /* outlines on buttons and selects */
  --text: #1f201d;
  --muted: #5d615e;
  --accent: #1b6e66;      /* deep teal: trial cells, focus, links that matter */
  --accent-tint: #e2efed;
  --primary: #1f201d;     /* the one filled button per screen */
  --on-primary: #ffffff;
  --positive: #2e7d32;
  --negative: #b42318;
  --warning: #92400e;
  --pill-pos-bg: #dcfae5; --pill-pos-ink: #04250e;
  --pill-neg-bg: #fdecea; --pill-neg-ink: #7a1d14;
  --pill-warn-bg: #fff4e0; --pill-warn-ink: #7a3a0c;
  --pill-neutral-bg: #eceef0; --pill-neutral-ink: #3d3f3c;
  --toast-bg: #1f201d; --toast-ink: #ffffff;
  --shadow-float: 0 8px 24px rgba(0, 0, 0, .12);

  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --radius-card: 22px;
  --radius-row: 14px;
  --radius-input: 12px;
  --gap: 16px;
  --pad: 20px;
  --control-height: 38px;
}

/* the dark palette, written once and used in two places */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #111111; --surface: #1a1a1a; --raised: #222222; --border: #2d2d2d; --rule: #262626; --control: #4a4a4a;
    --text: #f2f2f0; --muted: #b4b4b1; --accent: #5cc0b5; --accent-tint: #1c3431;
    --primary: #f2f2f0; --on-primary: #111111;
    --positive: #4cc38a; --negative: #f08a7c; --warning: #e5a93b;
    --pill-pos-bg: #172a1d; --pill-pos-ink: #4cc38a; --pill-neg-bg: #2e1a18; --pill-neg-ink: #f08a7c;
    --pill-warn-bg: #2b2414; --pill-warn-ink: #e5a93b; --pill-neutral-bg: #2a2a2a; --pill-neutral-ink: #d9d9d6;
    --toast-bg: #f2f2f0; --toast-ink: #111111; --shadow-float: 0 8px 24px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #111111; --surface: #1a1a1a; --raised: #222222; --border: #2d2d2d; --rule: #262626; --control: #4a4a4a;
  --text: #f2f2f0; --muted: #b4b4b1; --accent: #5cc0b5; --accent-tint: #1c3431;
  --primary: #f2f2f0; --on-primary: #111111;
  --positive: #4cc38a; --negative: #f08a7c; --warning: #e5a93b;
  --pill-pos-bg: #172a1d; --pill-pos-ink: #4cc38a; --pill-neg-bg: #2e1a18; --pill-neg-ink: #f08a7c;
  --pill-warn-bg: #2b2414; --pill-warn-ink: #e5a93b; --pill-neutral-bg: #2a2a2a; --pill-neutral-ink: #d9d9d6;
  --toast-bg: #f2f2f0; --toast-ink: #111111; --shadow-float: 0 8px 24px rgba(0, 0, 0, .5);
}

/* ---------------- basics ---------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -48px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 999px; z-index: 30; }
.skip-link:focus { top: 12px; }
.sub { color: var(--muted); }
.meta { color: var(--muted); font-size: 13px; line-height: 18px; }
button, a, label, input, select, textarea { touch-action: manipulation; }

/* ---------------- the page column and its grid ---------------- */
.page { max-width: calc(1100px + 48px); margin: 0 auto; padding: 24px 24px 96px; }
.page:focus { outline: none; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s9 { grid-column: span 9; } .s12 { grid-column: 1 / -1; }

/* the top row on every screen: back link (or the product mark) and the tools. Not a bar: no fill, it scrolls away. */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; margin-bottom: 40px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; text-decoration: none; }
.brand svg { width: 24px; height: 24px; flex: none; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 500; padding: 8px 0; min-width: 0; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; flex: none; }
.back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn { width: var(--control-height); height: var(--control-height); border-radius: 50%; border: 1px solid var(--control); background: var(--raised); display: grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------------- titles ---------------- */
.greeting { font: 400 46px/1.1 var(--serif); letter-spacing: -0.02em; }
.lead { margin: 10px 0 48px; font-size: 15px; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.title-row h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.title-row .sub { margin-top: 2px; }
.title-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.who > div { min-width: 0; }
.who h1 { overflow-wrap: anywhere; }

/* ---------------- panels and rows ---------------- */
.panel { background: var(--surface); border-radius: var(--radius-card); padding: var(--pad); min-width: 0; }
.panel h2 { font-size: 15px; line-height: 20px; font-weight: 600; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head .end { display: flex; align-items: baseline; gap: 12px; }
.panel > h2 { margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); font-size: 12px; font-weight: 500; margin-left: 6px; vertical-align: 1px; }
.rows { display: grid; gap: 8px; }
.rowcard { display: flex; align-items: center; gap: 12px; min-height: 63px; padding: 10px 16px; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-row); text-decoration: none; min-width: 0; }
a.rowcard:hover { border-color: var(--control); }
.rowcard .grow { flex: 1; min-width: 0; }
.rowcard .name { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowcard .end { margin-left: auto; text-align: right; flex: none; }
.link { color: var(--text); font-weight: 500; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; }
.link.neg { color: var(--negative); }
.empty { border: 1px dashed var(--control); border-radius: var(--radius-row); padding: 18px 16px; color: var(--muted); }
.empty b { color: var(--text); font-weight: 500; display: block; margin-bottom: 2px; }
.empty .btn { margin-top: 12px; }

/* a person's initials on a pale tint of their own hue: identity, not data */
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: hsl(var(--h) 45% 91%); color: hsl(var(--h) 40% 26%); }
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 22% 22%); color: hsl(var(--h) 45% 82%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--h) 22% 22%); color: hsl(var(--h) 45% 82%); } }
.avatar.big { width: 52px; height: 52px; font-size: 17px; }

/* ---------------- buttons and fields ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--control); background: var(--raised); color: var(--text); font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, opacity .15s, transform .1s; }
.btn:hover { background: var(--surface); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: var(--negative); }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.btn:disabled { cursor: not-allowed; background: var(--surface); color: var(--muted); border-color: var(--border); opacity: 1; }

.form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend, .label { font-size: 14px; font-weight: 500; padding: 0; }
.field legend { margin-bottom: 8px; }
.opt { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 12px; line-height: 16px; }
.field-error { color: var(--negative); font-size: 13px; line-height: 18px; min-height: 0; }
.field-error:empty { display: none; }
.input { width: 100%; height: 40px; border-radius: var(--radius-input); border: 1px solid var(--border); background: var(--raised); padding: 0 14px; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: var(--control); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.input[aria-invalid="true"] { border-color: var(--negative); }
select.input { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
textarea.input { height: auto; min-height: 120px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair > div { display: grid; gap: 6px; }
.pair label { font-weight: 400; color: var(--muted); font-size: 13px; }
.with-unit { display: flex; align-items: center; gap: 10px; max-width: 200px; }
.with-unit span { color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--raised); border: 1px solid var(--border); border-radius: 999px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { height: 32px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 13px; }
.seg label:hover { color: var(--text); }
.seg input:checked + label { background: var(--primary); color: var(--on-primary); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg input:disabled + label { cursor: not-allowed; opacity: .55; }
.seg[aria-invalid="true"] { border-color: var(--negative); }
.actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

/* file drop area and file lists */
.drop { display: grid; gap: 2px; justify-items: start; padding: 16px; border: 1px dashed var(--control); border-radius: var(--radius-row); background: var(--raised); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.field label.drop { padding: 16px; font-weight: 400; }   /* keep its own padding: the general label rule above removes it */
.drop b { font-weight: 500; }
.drop.fill { flex: 1; margin-top: 8px; align-content: center; min-height: 96px; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.files li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; background: var(--raised); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.files .fname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files a.fname { text-decoration: none; font-weight: 500; }
.files a.fname:hover { text-decoration: underline; }
.files svg { width: 16px; height: 16px; flex: none; color: var(--muted); }

/* ---------------- sign-in ---------------- */
.signin { min-height: calc(100dvh - 160px); display: grid; place-items: center; }
.signin .panel { width: 100%; max-width: 400px; padding: 28px; display: grid; gap: 20px; }
.signin h1 { font: 400 38px/1.1 var(--serif); letter-spacing: -0.02em; }
.error { color: var(--negative); font-size: 13px; }

/* ---------------- home ---------------- */
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 196px; }
.choice h2 { font: 400 25px/1.2 var(--serif); letter-spacing: -0.01em; }
.choice .sub { max-width: 46ch; }
.choice .btn { margin-top: auto; }
.choice form { width: 100%; position: relative; margin-top: auto; }
.matches { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 10; background: var(--raised); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-float); padding: 6px; display: grid; gap: 2px; }
.matches a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; }
.matches a:hover, .matches a:focus-visible { background: var(--surface); outline: none; }
.matches .meta { margin-left: auto; }
.tile { min-height: 128px; padding: 16px 20px; display: flex; flex-direction: column; }
.tile .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.tile .value { font-size: 32px; line-height: 40px; font-weight: 400; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 16px; color: var(--muted); }
.tile .meta { margin-top: auto; }
.status-line { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.status-line + .status-line { border-top: 1px solid var(--rule); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--control); flex: none; }
.dot.on { background: var(--positive); }
.dot.busy { background: var(--accent); }
.panel-foot { margin-top: 12px; }

/* ---------------- participant list ---------------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.toolbar .input { max-width: 340px; }
.toolbar .meta { margin-left: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 400; color: var(--muted); padding: 0 12px 10px 0; white-space: nowrap; }
.table td { padding: 0 12px 0 0; height: 60px; border-top: 1px solid var(--border); white-space: nowrap; }
.table th:last-child, .table td:last-child { padding-right: 0; text-align: right; }
.table .num { text-align: right; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--raised) 60%, transparent); }
.table .person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table .person a { font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.table .person a:hover { text-decoration: underline; }
.table .id { color: var(--muted); font-variant-numeric: tabular-nums; }
.table .dash { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table .person .sub-line { display: none; color: var(--muted); font-size: 13px; }

/* ---------------- profile ---------------- */
.acuity { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.acuity div { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-row); padding: 12px 16px; }
.acuity b { display: block; font-size: 32px; line-height: 40px; font-weight: 400; font-variant-numeric: tabular-nums; margin-top: 2px; }
.acuity b.dash { color: var(--muted); font-size: 20px; }
.remarks { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; max-width: 70ch; }
.remarks.dash { color: var(--muted); }
.test-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 14px 16px; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-row); }
.test-row .when { font-weight: 500; }
.test-row .strip-wrap { grid-column: 1 / -1; display: grid; gap: 4px; }

/* trial cells: the element only this app has. Blue-teal = recorded, outline = skipped, ring = now. */
.strip { display: grid; grid-template-columns: 52px repeat(12, minmax(0, 1fr)); gap: 3px; align-items: center; }
.strip .eye { font-size: 12px; color: var(--muted); }
.strip i { height: 10px; border-radius: 3px; background: var(--rule); }
.strip i.ok { background: var(--accent); }
.strip i.skip { background: transparent; outline: 1px solid var(--control); outline-offset: -1px; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; flex: none;
  background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill.pos { background: var(--pill-pos-bg); color: var(--pill-pos-ink); }
.pill.neg { background: var(--pill-neg-bg); color: var(--pill-neg-ink); }
.pill.warn { background: var(--pill-warn-bg); color: var(--pill-warn-ink); }

/* ---------------- run test ---------------- */
.state-lead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.state { font: 400 32px/1.15 var(--serif); letter-spacing: -0.01em; }
.finding { margin-top: 6px; color: var(--muted); font-size: 15px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 20px 0; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-row); }
.facts div { padding: 12px 16px; min-width: 0; }
.facts div + div { border-left: 1px solid var(--border); }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 2px 0 0; font-size: 20px; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.facts dd small { font-size: 13px; color: var(--muted); }
.track { display: grid; gap: 8px; }
.track-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; }
.cells { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.cell { height: 38px; border-radius: 8px; background: var(--raised); border: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 500; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.cell.ok { background: var(--accent); border-color: var(--accent); color: var(--on-primary); }
:root[data-theme="dark"] .cell.ok { color: #0d2421; }
.cell.skip { background: transparent; border-color: var(--control); text-decoration: line-through; }
.cell.now { border: 2px solid var(--accent); color: var(--text); }
.cell.now.paused { border-color: var(--warning); }
.controls { display: flex; flex-direction: column; gap: 14px; }
.controls .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }


/* panels whose last line is pinned to the bottom (an action or a total), so a taller neighbour never leaves a hole */
.panel.col { display: flex; flex-direction: column; }
.panel.col > .foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rowcard .grow .meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
select.input:disabled { opacity: .7; cursor: not-allowed; }

/* ---------------- toast ---------------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; background: var(--toast-bg); color: var(--toast-ink); border-radius: 14px; padding: 12px 16px;
  font-weight: 500; max-width: calc(100vw - 32px); box-shadow: var(--shadow-float); transition: opacity .2s, transform .2s; z-index: 40; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: inherit; font-weight: 600; }
.toast.bad { background: var(--pill-neg-bg); color: var(--pill-neg-ink); }

/* ---------------- tablet and phone ---------------- */
@media (max-width: 960px) {
  .s3 { grid-column: span 6; }
  .s4, .s5, .s7, .s8, .s9 { grid-column: 1 / -1; }
  .s6.choice { grid-column: span 6; }
}
@media (max-width: 680px) {
  .page { padding: 16px 16px 96px; }
  .top { margin-bottom: 24px; }
  .greeting { font-size: 34px; }
  .lead { margin-bottom: 28px; }
  .rowcard .end .t { display: none; }
  .s6, .s6.choice { grid-column: 1 / -1; }
  .choice { min-height: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .track-row { grid-template-columns: 1fr; gap: 6px; }
  .cell { height: 32px; }
  .pair { grid-template-columns: 1fr; }
  .title-row .actions { width: 100%; }
  .title-row .actions .btn { flex: 1; }
  .toolbar .input { max-width: none; }
  /* the table becomes a list of two-line rows */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--border); }
  .table td { height: auto; border: 0; padding: 0; white-space: normal; }
  .table td.c-person { grid-column: 1; grid-row: 1 / span 2; }
  .table td.c-created { grid-column: 2; grid-row: 1; text-align: right; }
  .table td.c-open { grid-column: 2; grid-row: 2; text-align: right; }
  .table td.c-id, .table td.c-age, .table td.c-gender, .table td.c-va, .table td.c-tests { display: none; }
  .table .person .sub-line { display: block; }
  .table tr { position: relative; }
  .table .person a::after { content: ""; position: absolute; inset: 0; }   /* the name's link covers the whole row */
  .table td.c-open a { position: relative; z-index: 1; }
  .test-row { grid-template-columns: 1fr; }
  .test-row > div:nth-child(2) { text-align: left !important; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .test-row > div:nth-child(2) .meta { margin-top: 0 !important; }
}
/* On touch screens every control is at least 44px tall, about the size of a fingertip */
@media (pointer: coarse), (max-width: 680px) {
  :root { --control-height: 44px; }
  .btn.small { height: 44px; padding: 0 16px; font-size: 14px; }
  .icon-btn { width: 44px; height: 44px; }
  .input { height: 48px; font-size: 16px; }        /* 16px also stops iPhones zooming into the field */
  textarea.input { height: auto; }
  .seg label { height: 44px; padding: 0 16px; font-size: 14px; }
  .back, .brand { min-height: 44px; }
  .link { display: inline-flex; align-items: center; min-height: 44px; }
  .files li, .matches a { min-height: 48px; }
  .panel-head { margin-bottom: 4px; }
}
@media (max-width: 680px) {
  /* choices become a tidy grid instead of a pill that wraps */
  .seg { display: grid; grid-template-columns: 1fr 1fr; border-radius: 16px; width: 100%; }
  #tEye { grid-template-columns: repeat(3, 1fr); }
  .controls { order: -1; }   /* on a phone the test controls come first, so Start is on the first screen */
  .seg label { justify-content: center; border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
