/* Metra Performance remote. The phone app's own tokens (`Theme.swift`, dark
   appearance) and its cards, rows, buttons and sheets, laid out for a laptop
   and folding down to the phone's own layout on a narrow window.
   Mint (#6FD8C0) is the only accent: for state, data and links. Filled
   buttons are white (the one that starts) or the deeper mint `accentFill`. */

@font-face {
  font-family: "Sora";
  src: url("assets/sora-latin.woff") format("woff");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0A0A0B;
  --surface: #131315;
  --sub: #161617;
  --alert: #1E1E21;
  --sheet: #1C1C1F;
  --wash: #14252B;
  --ink: #F4F4F3;
  --i75: rgba(244, 244, 243, .75);
  --i60: rgba(244, 244, 243, .6);
  --i50: rgba(244, 244, 243, .5);
  --i45: rgba(244, 244, 243, .45);
  --i40: rgba(244, 244, 243, .4);
  --i35: rgba(244, 244, 243, .35);
  --hair: rgba(255, 255, 255, .07);
  --rule: rgba(255, 255, 255, .08);
  --rule2: rgba(255, 255, 255, .22);
  --bord: rgba(255, 255, 255, .14);
  --mint: #6FD8C0;
  --fill: #4FAE98;
  --fill-ink: #03201A;
  --warn: #E0A33C;
  --red: #E2685A;
  --leg-l: #6FD8C0;
  --leg-r: #829EF0;
  --top: 64px;
  --pad: 32px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Sora", var(--font);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Nothing scrolled into view, or focused, ends up under the top bar. */
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--wash) 0, rgba(20, 37, 43, 0) 300px) no-repeat, var(--bg);
  color: var(--ink);
  font: 15px/1.35 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
p, h1, h2, h3, ol, ul, dl, dd { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
#main:focus { outline: none; }
.icon { flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #0A0A0B; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.noscript { padding: 24px var(--pad); color: var(--i75); }

/* ------------------------------------------------------------- top bar */

.top { position: sticky; top: 0; z-index: 40; height: var(--top); border-bottom: 1px solid transparent; transition: background-color .2s ease, border-color .2s ease; }
.top.scrolled { background: rgba(10, 10, 11, .94); border-bottom-color: var(--hair); }
.top-in { height: 100%; max-width: 1344px; margin: 0 auto; padding: 0 var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; color: inherit; text-decoration: none; border-radius: 10px; }
.brand:hover .brand-word { opacity: .82; }
.brand-mark { width: 40px; height: 40px; display: block; flex: none; }
.brand-word { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -.03em; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 10px; }

.status { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 14px; border-radius: 19px; border: 0; background: none; box-shadow: inset 0 0 0 1px var(--bord); color: var(--i75); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.status.plain { box-shadow: none; padding: 0 4px; color: var(--i50); }
button.status:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.status .icon { color: var(--i45); }
.status .short { display: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--i35); flex: none; }
.status[data-tone="ok"] .status-dot { background: var(--mint); box-shadow: 0 0 0 4px rgba(111, 216, 192, .16); }
.status[data-tone="wait"] .status-dot { background: var(--i60); animation: blink 1.2s ease-in-out infinite; }
.status[data-tone="warn"] .status-dot { background: var(--warn); }

/* The phone's info button: a mint disc with the "i". */
.info-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; background: rgba(111, 216, 192, .14); box-shadow: inset 0 0 0 1px rgba(111, 216, 192, .38); color: var(--mint); transition: background-color .15s ease; }
.info-btn:hover { background: rgba(111, 216, 192, .22); }

.menu { position: fixed; z-index: 70; min-width: 236px; padding: 6px; border-radius: 14px; background: var(--alert); border: 1px solid var(--bord); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.menu-head { padding: 8px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--i40); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: 14.5px; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
.menu-item .icon { color: var(--i60); }
.menu-item.destructive, .menu-item.destructive .icon { color: var(--red); }

/* ----------------------------------------------------------------- tabs */

.tabs { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 41; height: var(--top); display: flex; align-items: stretch; gap: 2px; }
.tab { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 0; background: none; color: var(--i50); font-size: 14px; font-weight: 600; white-space: nowrap; transition: color .15s ease; }
.tab:hover { color: var(--i75); }
.tab.on { color: var(--ink); }
.tab.on .icon { color: var(--mint); }
.tab.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--mint); }
.tab:focus-visible { outline-offset: -4px; border-radius: 12px; }
.soon { padding: 2px 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--hair); font-size: 9px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--i35); }

/* -------------------------------------------------------------- screens */

.screen { max-width: 1344px; margin: 0 auto; padding: 24px var(--pad) 88px; }
.cols { display: grid; gap: 24px; }
.col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.only-wide { display: none; }

.page-title { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 41px; display: flex; align-items: center; gap: 10px; }
.page-title .icon { color: var(--mint); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--mint); }
.display { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 4.6vw, 58px); letter-spacing: -.04em; line-height: 1.04; margin-top: 14px; text-wrap: balance; }
.display.small { font-size: clamp(26px, 2.5vw, 34px); letter-spacing: -.035em; line-height: 1.14; }
.lead { font-size: 17px; line-height: 1.5; color: var(--i60); margin-top: 16px; }
.section-label { font-size: 11px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; color: var(--i40); }
.footnote { font-size: 13px; line-height: 1.42; color: var(--i50); }
.footnote.center { text-align: center; }
.caption { font-size: 12px; color: var(--i45); }
.hint { font-size: 13px; }
.empty { padding: 22px 4px; text-align: center; font-size: 14px; color: var(--i50); }
.unit { font-size: 13px; color: var(--i50); }
.beta { padding: 2px 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--bord); font-size: 10px; font-weight: 700; letter-spacing: .8px; color: var(--i60); }
.overline.accent { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--mint); margin-bottom: 4px; }
.field-error { min-height: 18px; font-size: 13.5px; line-height: 1.35; color: var(--red); }
.field-error:empty { min-height: 0; }

.card { background: var(--surface); border: 1px solid var(--hair); border-radius: 16px; }
.card.padded { padding: 14px 16px; }
.card.subtle { background: var(--sub); }

/* ------------------------------------------------------------- buttons */

.primary, .secondary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border-radius: 999px; font-size: 17px; white-space: nowrap; transition: transform .2s var(--ease), background-color .15s ease, opacity .15s ease; }
.primary { height: 54px; border: 0; background: var(--fill); color: var(--fill-ink); font-weight: 600; }
.primary:hover:not(:disabled) { background: #58BBA4; }
.primary.neutral { background: var(--ink); color: #0A0A0B; }
.primary.neutral:hover:not(:disabled) { background: #fff; }
.secondary { height: 50px; border: 1px solid var(--bord); background: none; color: var(--ink); font-weight: 500; }
.secondary:hover:not(:disabled) { background: rgba(255, 255, 255, .04); }
.secondary.destructive { color: var(--red); }
.primary:active:not(:disabled), .secondary:active:not(:disabled) { transform: scale(.985); }
.primary:disabled, .secondary:disabled { opacity: .38; }
.link { display: inline-flex; align-items: center; gap: 4px; padding: 6px 2px; border: 0; background: none; color: var(--mint); font-size: 15px; font-weight: 500; border-radius: 6px; }
.link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.link.strong { font-weight: 600; }
.link:disabled { opacity: .4; }
.link.more { font-size: 13.5px; }
.busy { display: flex; align-items: center; justify-content: center; gap: 10px; height: 54px; border-radius: 999px; background: var(--sub); color: var(--i75); font-size: 16px; font-weight: 500; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(244, 244, 243, .18); border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.row-actions > * { width: auto; min-width: 220px; padding: 0 28px; }

.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--sub); font-size: 14px; line-height: 1.45; color: var(--i75); text-align: left; }
.note > .icon { margin-top: 2px; color: var(--i50); }
.note.warning { background: rgba(224, 163, 60, .1); color: var(--ink); }
.note.warning > .icon { color: var(--warn); }
.note.outlined { box-shadow: inset 0 0 0 1px rgba(224, 163, 60, .4); }
.note-text { min-width: 0; flex: 1; }
.note-text strong { display: block; }
.notice-ok { margin-left: 10px; padding: 0 2px; font-weight: 600; }
.quiet-slot:empty { display: none; }

/* -------------------------------------------------------------- pairing */

.pair-screen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; max-width: 1120px; padding-top: 28px; }
.pair-form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; margin-top: 32px; }
.code-input { width: 100%; height: 76px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--bord); background: var(--surface); color: var(--ink); font-size: 34px; font-weight: 500; letter-spacing: .06em; text-align: center; font-variant-numeric: tabular-nums; transition: border-color .15s ease, box-shadow .15s ease; }
.code-input::placeholder { color: var(--i60); opacity: 1; font-weight: 300; }
.code-input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgba(111, 216, 192, .16); }
.code-input.bad { border-color: var(--red); }
.code-input.bad:focus { box-shadow: 0 0 0 4px rgba(226, 104, 90, .16); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.4; color: var(--i75); cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--mint); }
.check-hint { color: var(--i50); }
.pair-side { display: flex; flex-direction: column; gap: 22px; max-width: 420px; }
.pair-steps { list-style: none; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.pair-steps li { display: flex; gap: 12px; counter-increment: step; font-size: 14.5px; line-height: 1.45; color: var(--i75); }
.pair-steps li::before { content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .07); font-size: 12px; font-weight: 700; color: var(--i75); display: flex; align-items: center; justify-content: center; }

/* The phone's Settings > Remote control, drawn. */
.sketch { display: none; }
.sk-phone { position: relative; width: 320px; height: 452px; padding: 12px 18px 0; border: 1px solid #34363A; border-bottom: 0; border-radius: 46px 46px 0 0; background: linear-gradient(var(--wash), rgba(20, 37, 43, 0) 36%), var(--bg); overflow: hidden; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.sk-island { width: 92px; height: 27px; margin: 0 auto 12px; border-radius: 14px; background: #000; }
.sk-back { display: flex; align-items: center; gap: 2px; font-size: 13px; color: var(--mint); }
.sk-title { margin: 6px 0 12px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.sk-card { margin-bottom: 10px; border-radius: 14px; border: 1px solid var(--hair); background: var(--surface); }
.sk-row { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.sk-row > :first-child { margin-right: auto; }
.sk-row + .sk-row { border-top: 1px solid var(--hair); }
.sk-toggle { position: relative; flex: none; width: 40px; height: 24px; border-radius: 12px; background: var(--mint); }
.sk-toggle::after { content: ""; position: absolute; right: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.sk-code { padding: 4px 8px; border-radius: 9px; background: rgba(111, 216, 192, .12); box-shadow: inset 0 0 0 1px rgba(111, 216, 192, .55); font-size: 15px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.sk-dim { color: var(--i50); }
.sk-link { color: var(--mint); font-size: 12px; }
.sk-head { margin: 12px 4px 6px; font-size: 10px; font-weight: 500; letter-spacing: 1.1px; text-transform: uppercase; color: var(--i40); }

/* -------------------------------------- one-statement screens (states) */

.screen.state-screen { max-width: 600px; padding-top: max(9vh, 28px); text-align: center; }
.state { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.state > .display { margin-top: 2px; }
.state > .lead { margin-top: 0; }
.state > .note, .state > .card { align-self: stretch; }
.state-mark { width: 68px; height: 68px; margin-bottom: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--bord); display: flex; align-items: center; justify-content: center; color: var(--i75); }
.state-mark.warn { color: var(--warn); box-shadow: inset 0 0 0 1px rgba(224, 163, 60, .4); }
.state-mark .spinner { width: 26px; height: 26px; }
.causes { text-align: left; }
.causes ul { margin-top: 8px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; color: var(--i75); }

/* ---------------------------------------------------------------- setup */

.rows { overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 16px; border: 0; background: none; color: var(--ink); font-size: 15px; text-align: left; }
.row + .row::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--hair); }
button.row:hover:not(:disabled) { background: rgba(255, 255, 255, .03); }
button.row:focus-visible { outline-offset: -3px; border-radius: 14px; }
button.row:disabled { opacity: .5; }
.row-label { display: flex; align-items: center; gap: 8px; color: var(--i50); white-space: nowrap; }
.row-value { margin-left: auto; min-width: 0; display: flex; align-items: center; gap: 6px; font-weight: 500; }
.row-value.placeholder { color: var(--i40); font-weight: 400; }
.row-value .icon { color: var(--mint); }
.row-prefix { color: var(--i50); font-weight: 400; white-space: nowrap; }
.row-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row > .icon { color: var(--i35); }
.required { padding: 2px 6px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(224, 163, 60, .5); font-size: 9.5px; font-weight: 700; letter-spacing: .8px; color: var(--warn); }
.segments { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(244, 244, 243, .06); }
.row .segments { margin-left: auto; }
.segment { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--i60); font-size: 13px; font-weight: 500; white-space: nowrap; }
.segment.on { background: var(--ink); color: #0A0A0B; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.segment:disabled { opacity: .5; }
.segments.wide { display: flex; }
.segments.wide .segment { flex: 1; height: 34px; border-radius: 8px; }
.segments.center { align-self: center; }
.drop-input { width: 76px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid transparent; background: rgba(244, 244, 243, .06); text-align: right; font-size: 15px; font-weight: 500; }
.drop-input::placeholder { color: var(--i50); opacity: 1; }
.drop-input:focus { outline: none; border-color: var(--mint); }
.camera-line { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.42; color: var(--i50); }
.camera-line .icon { margin-top: 1px; color: var(--i40); }
.setup-col > .primary, .setup-col > .busy { margin-top: 6px; }

.panel { display: flex; flex-direction: column; gap: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 41px; }

/* ---------------------------------------------------------------- guide */

.guide-card { border-radius: 20px; border-color: rgba(255, 255, 255, .06); }
.guide-card.padded { padding: 14px 16px; }
.guide-heading h2, .guide-heading h3 { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.diagram { padding: 12px 20px 8px; }
.side-view { display: block; width: 100%; height: auto; }
.side-view text, .chart text { font-family: var(--font); }
.sv-pulse { transform-box: fill-box; transform-origin: center; animation: svpulse 2.4s ease-out infinite; }
.chart-card { padding: 14px 20px 8px; }
.chart { display: block; width: 100%; height: auto; margin-top: 6px; }
.panel .chart, .panel .side-view { max-width: 460px; margin-left: auto; margin-right: auto; }
.rules { list-style: none; margin: 0; padding: 4px 14px; }
.rule { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
.rule.plain { align-items: center; }
.rule + .rule { border-top: 1px solid var(--hair); }
.rule-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--sub); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); display: flex; align-items: center; justify-content: center; color: var(--mint); }
.rule-title { font-size: 15px; font-weight: 700; }
.rule-detail { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--i50); }
.rule:not(.plain) > div { padding-top: 1px; }
.quick-setup { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin-top: 4px; padding: 8px 14px; border-radius: 18px; border: 1px solid var(--bord); background: none; color: var(--ink); font-size: 15px; font-weight: 700; text-align: left; }
.quick-setup > span:not(.rule-icon) { flex: 1; }
.quick-setup > .icon { color: var(--i45); transition: transform .2s ease; }
.quick-setup[aria-expanded="true"] > .icon { transform: rotate(90deg); }
.quick-setup-body { display: flex; flex-direction: column; gap: 12px; }
.steps { overflow: hidden; }
.steps ol { list-style: none; padding: 0; counter-reset: step; }
.steps li { display: flex; gap: 12px; padding: 12px 16px; counter-increment: step; font-size: 15px; line-height: 1.4; }
.steps li + li { border-top: 1px solid var(--hair); }
.steps li::before { content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .07); font-size: 12px; font-weight: 700; color: var(--i75); display: flex; align-items: center; justify-content: center; }
.steps-reps { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--hair); background: rgba(255, 255, 255, .025); font-size: 13px; color: var(--i60); }
.steps-reps .icon { width: 22px; color: var(--i50); }
.tag-ready { color: var(--mint); font-size: .8em; font-weight: 700; letter-spacing: .6px; }
.tag-floor { font-size: .8em; font-weight: 700; letter-spacing: .6px; }
.arm-tiles { display: flex; gap: 10px; margin: 12px 0; }
.arm-figure { width: 52px; height: 76px; }
.arm-tile { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 12px 12px; border-radius: 14px; background: rgba(30, 30, 33, .6); font-size: 15px; font-weight: 600; }
.free-leg { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.free-leg-figure { flex: none; padding: 12px 16px; border-radius: 14px; background: rgba(30, 30, 33, .6); }
.free-leg-figure svg { display: block; }

.guide-tabs { display: flex; gap: 28px; margin: 0 -22px 18px; padding: 2px 22px 0; border-bottom: 1px solid var(--hair); }
.guide-tab { position: relative; padding: 4px 0 11px; border: 0; background: none; font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--i35); }
.guide-tab:hover { color: var(--i60); }
.guide-tab.on { color: var(--ink); }
.guide-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; background: var(--mint); }
.guide-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.guide-col { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.guide-protocols, .guide-test { display: flex; flex-direction: column; gap: 14px; }
.guide-pick { display: flex; flex-direction: column; gap: 12px; }
.guide-heading { padding: 2px 4px 0; }
.tiles { display: flex; gap: 7px; }
.tile { flex: 1; min-width: 0; height: 62px; border-radius: 14px; border: 1px solid var(--hair); background: var(--surface); color: var(--i60); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 600; }
.tile span { color: var(--i50); }
.tile.on { background: rgba(111, 216, 192, .12); border-color: rgba(111, 216, 192, .7); color: var(--mint); }
.tile.on span { color: var(--ink); }

/* -------------------------------------------------------------- dialogs */

dialog.dlg { padding: 0; border: 1px solid var(--hair); border-radius: 22px; background: var(--sheet); color: var(--ink); width: min(480px, calc(100vw - 32px)); max-height: min(780px, calc(100vh - 48px)); overflow: hidden; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
dialog.dlg[open] { display: flex; flex-direction: column; animation: rise .28s var(--ease); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .62); }
.dlg.small { width: min(390px, calc(100vw - 32px)); }
.dlg.wide { width: min(1060px, calc(100vw - 48px)); }
.dlg.tall { height: min(780px, calc(100vh - 48px)); }
/* As tall as what it holds (`fit-content`: plain `auto` would stretch a dialog between its top and bottom). */
.dlg.guide { height: fit-content; max-height: min(900px, calc(100vh - 48px)); background: var(--bg); }
.dlg-head { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 54px; padding: 0 16px; border-bottom: 1px solid var(--hair); }
.dlg-title { font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg-side { display: flex; align-items: center; min-width: 0; }
.dlg-side.right { justify-content: flex-end; }
.dlg-side .link { font-size: 16px; }
.dlg-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 22px 24px; overscroll-behavior: contain; }
.dlg.small .dlg-head { border-bottom: 0; min-height: 0; padding-top: 22px; }
.dlg.small .dlg-body { padding-top: 10px; }
.dlg-message { margin-bottom: 18px; font-size: 15px; line-height: 1.45; color: var(--i75); text-align: center; }
.dlg-actions { display: flex; gap: 10px; }
.dlg-actions > * { flex: 1; }
.dlg-actions.stack { flex-direction: column; }
.dlg-actions.stack > * { flex: none; }
.dlg-actions.stack > .link { align-self: center; flex: none; }

.pick-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.pick-head .secondary { height: 46px; font-size: 15.5px; font-weight: 600; }
.pick-head .secondary .icon { color: var(--mint); }
.search-wrap { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--sub); border: 1px solid transparent; color: var(--i40); }
.search-wrap:focus-within { border-color: var(--mint); }
.search { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font-size: 15px; outline: none; }
.search::placeholder { color: var(--i45); opacity: 1; }
.pick-results .section-label { margin: 16px 0 4px; font-weight: 600; }
.pick-list { list-style: none; margin: 0; padding: 0; }
.pick-list.card { padding: 0 12px; }
.pick-list li + li { border-top: 1px solid var(--hair); }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 4px; border: 0; background: none; color: var(--ink); font-size: 15px; text-align: left; border-radius: 8px; }
.pick:hover { background: rgba(255, 255, 255, .03); }
.pick:focus-visible { outline-offset: -2px; }
.pick-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; overflow-wrap: anywhere; }
.pick.test .pick-name { flex-direction: row; align-items: center; gap: 8px; }
.pick-sub { font-size: 13px; font-weight: 400; color: var(--i50); }
.pick-detail { flex: none; max-width: 45%; font-size: 13px; color: var(--i50); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick > .icon { color: var(--i35); }
.tick { flex: none; color: var(--mint); }
.monogram { flex: none; width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--bord); color: var(--i75); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.glyph-box { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--sub); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); display: flex; align-items: center; justify-content: center; color: var(--i75); }
.pick.on .glyph-box { color: var(--mint); }

.load-number { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 22px 0 18px; }
.round { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--bord); background: none; display: flex; align-items: center; justify-content: center; }
.round:disabled { opacity: .35; }
.load-field { display: flex; align-items: baseline; gap: 6px; }
.load-input { width: 150px; padding: 0; border: 0; border-bottom: 1px solid var(--bord); background: none; font-size: 54px; font-weight: 300; text-align: center; font-variant-numeric: tabular-nums; }
.load-input:focus { outline: none; border-bottom-color: var(--mint); }
.dlg-body > .note { margin-bottom: 12px; }
.note-area { display: block; width: 100%; min-height: 150px; margin-bottom: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--hair); background: var(--sub); font-size: 15px; line-height: 1.45; resize: vertical; }
.note-area:focus { outline: none; border-color: var(--mint); }
.dlg-body > .secondary { margin-top: 14px; }

/* ----------------------------------------------------------------- live */

.live-card { gap: 0; padding: 14px 14px 0; border-radius: 26px; border: 1px solid var(--hair); background: linear-gradient(180deg, var(--wash) 0, rgba(20, 37, 43, 0) 26%), #0D0D0F; }
.ready-banner { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 18px; border-radius: 18px; background: var(--sub); }
.ready-banner.ready { background: rgba(111, 216, 192, .12); }
.ready-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.ready-banner.ready .ready-dot { background: var(--mint); box-shadow: 0 0 0 5px rgba(111, 216, 192, .18); animation: readypulse 1.6s ease-in-out infinite; }
.ready-label { flex: 1; font-size: 13.5px; font-weight: 700; letter-spacing: 1.1px; }
.thermal { padding: 3px 7px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(224, 163, 60, .5); font-size: 10.5px; font-weight: 700; letter-spacing: .8px; color: var(--warn); }
.elapsed { font-size: 13px; color: var(--i50); font-variant-numeric: tabular-nums; }
.context { margin-top: 16px; text-align: center; font-size: 11.5px; font-weight: 500; letter-spacing: 1.4px; text-transform: uppercase; color: var(--i40); }
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 12px 30px; text-align: center; }
.hero-rep { font-size: 12px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--i50); }
.hero-value { display: flex; align-items: baseline; justify-content: center; margin-top: 6px; }
.hero-num { font-size: clamp(104px, 13.5vw, 200px); font-weight: 200; line-height: 1; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.hero-unit { margin-left: 10px; font-size: clamp(22px, 2.4vw, 32px); font-weight: 300; color: var(--i45); }
.hero-label { margin-top: 12px; font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--i60); }
.hero-sub { margin-top: 6px; font-size: 14px; color: var(--i50); }
.hero-best { margin-top: 8px; font-size: 15px; color: var(--i60); }
.hero-best.is-best { color: var(--mint); font-weight: 600; }
.hero-best.hidden { visibility: hidden; }
.hero-avg { margin-top: 10px; font-size: 14px; color: var(--i50); min-height: 19px; }
.hero-note { margin-top: 12px; font-size: 14px; color: var(--i50); }
.hero.waiting { gap: 10px; }
.hero-wait { font-size: clamp(24px, 3vw, 40px); font-weight: 300; letter-spacing: 1px; color: var(--i35); }
.hero-wait.ready { color: var(--mint); }
.hero-instruction { max-width: 22em; font-size: clamp(20px, 2.2vw, 28px); font-weight: 300; line-height: 1.35; color: var(--i75); }
.hero-instruction strong { font-weight: 700; color: var(--ink); }
.strip { display: flex; align-items: flex-end; justify-content: center; gap: 8px; min-height: 92px; margin-top: 26px; }
.strip.hidden { visibility: hidden; }
.strip-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.strip-bar { width: 26px; border-radius: 6px; background: rgba(244, 244, 243, .2); transform-origin: bottom; }
.strip-bar.best { background: var(--mint); }
.strip-bar.newest { background: var(--ink); }
.strip-bar.grow { animation: grow .4s var(--ease); }
.strip-bar.leg-l { background: rgba(111, 216, 192, .32); }
.strip-bar.leg-r { background: rgba(130, 158, 240, .32); }
.strip-bar.leg-l.strong { background: var(--leg-l); }
.strip-bar.leg-r.strong { background: var(--leg-r); }
.strip-n { font-size: 11px; color: var(--i40); font-variant-numeric: tabular-nums; }
.strip-leg { font-size: 10px; font-weight: 700; min-height: 12px; }
.strip-leg.leg-l, strong.leg-l, .leg-title.leg-l, .bar-leg.leg-l { color: var(--leg-l); }
.strip-leg.leg-r, strong.leg-r, .leg-title.leg-r, .bar-leg.leg-r { color: var(--leg-r); }
.bottom { display: flex; margin: 0 -14px; padding: 0 14px; border-top: 1px solid var(--hair); }
.metric { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column-reverse; align-items: center; gap: 5px; padding: 20px 6px 22px; text-align: center; }
.metric + .metric::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 1px; background: var(--hair); }
.metric dt { font-size: 11px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--i40); }
.metric-value { font-size: clamp(26px, 2.6vw, 36px); font-weight: 300; font-variant-numeric: tabular-nums; }
.metric-unit { margin-left: 4px; font-size: 13px; color: var(--i45); }

.finish-card { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.live-footer { display: flex; gap: 10px; }
.rep-pill { flex: none; width: 76px; height: 54px; border-radius: 14px; background: var(--sub); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.rep-pill-n { font-size: 21px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.rep-pill-l { font-size: 10.5px; font-weight: 500; letter-spacing: .8px; color: var(--i40); }
.live-footer .finish, .live-footer .busy { flex: 1; height: 54px; font-weight: 600; }
.rail-label { margin: 8px 4px -4px; }
.facts { padding: 2px 16px; }
.fact { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 13px 0; font-size: 15px; }
.fact + .fact { border-top: 1px solid var(--hair); }
.fact dt { color: var(--i50); white-space: nowrap; }
.fact dd { font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* -------------------------------------------------------------- summary */

.summary-title { display: flex; flex-direction: column; gap: 4px; }
.subtitle { font-size: 14px; color: var(--i50); }
.summary-hero { padding: 10px 0 4px; }
.summary-best { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.summary-num { font-size: clamp(60px, 6.4vw, 84px); font-weight: 300; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.summary-unit { margin-left: 10px; font-size: 17px; color: var(--i50); }
.summary-best > .fatigue { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; padding-bottom: 6px; }
.fatigue-num { font-size: 34px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.fatigue-pct { margin-left: 3px; font-size: 15px; color: var(--i45); }
.fatigue-label { font-size: 11px; font-weight: 500; letter-spacing: 1.2px; color: var(--i40); }
.summary-line { margin-top: 10px; font-size: 15px; color: var(--i60); }
.summary-line.better { color: var(--mint); }

.rep-tables { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px 12px; border-radius: 16px; border: 1px solid var(--hair); background: var(--surface); }
.bars { overflow-x: auto; }
.bars-plot { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 10px; }
.bar-col { flex: 0 1 56px; min-width: 6px; display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.bar-slot { height: 78px; display: flex; align-items: flex-end; }
.bar { width: 100%; border-radius: 5px; background: rgba(244, 244, 243, .2); }
.bar.best { background: var(--mint); }
.bar.leg-l { background: rgba(111, 216, 192, .32); }
.bar.leg-r { background: rgba(130, 158, 240, .32); }
.bar.leg-l.best { background: var(--leg-l); }
.bar.leg-r.best { background: var(--leg-r); }
.bar-n, .bar-leg { min-height: 13px; text-align: center; font-size: 11px; color: var(--i40); font-variant-numeric: tabular-nums; }
.bar-leg { font-size: 10px; font-weight: 700; }
.bars.long .bars-plot { gap: 4px; }
.bars.long .bar-col { flex: 1 1 0; max-width: 26px; }
.bars-avg { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--i35); }
.bars-avg span { position: absolute; right: 0; bottom: 5px; padding-left: 8px; font-size: 11px; color: var(--i60); white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: 8px; }
table.reps { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.reps th, .reps td { padding: 0 14px; white-space: nowrap; }
.reps thead th { padding-bottom: 7px; vertical-align: bottom; font-weight: 500; text-align: center; }
.th-name { display: block; font-size: 11px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; color: var(--i40); }
.th-unit { display: block; min-height: 15px; font-size: 11px; font-weight: 400; color: var(--i35); }
.reps tbody th, .reps tbody td { height: 37px; border-top: 1px solid var(--rule); font-size: 17px; font-weight: 400; text-align: center; }
.reps .rep-col { position: sticky; left: 0; padding-left: 2px; text-align: left; background: var(--surface); color: var(--i75); }
.reps thead .rep-col { text-align: left; }
.num { display: inline-block; text-align: right; }
.num.dash { text-align: center; color: var(--i40); }
.reps .aggs tr:first-child > * { border-top-color: var(--rule2); }
.reps .agg th { font-size: 11px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; color: var(--i50); }
.reps .agg td { color: var(--i75); }
.reps .agg.best th { color: var(--mint); }
.suspect-mark { display: inline-flex; margin-left: 6px; color: var(--warn); vertical-align: -1px; }
.leg-title { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; }
.leg-title.leg-none { color: var(--i50); }

.actions-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.pair-buttons { display: flex; gap: 10px; }
.pair-buttons > * { flex: 1; min-width: 0; font-size: 16px; }
.note-card { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; color: var(--ink); }
.note-card:hover:not(:disabled) { border-color: var(--bord); }
.note-body { font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }

/* -------------------------------------------------------------- outcome */

.outcome { display: flex; flex-direction: column; gap: 22px; }
.screen.outcome { padding-top: max(13vh, 28px); }
.outcome-body { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.outcome-body .display { margin-top: 10px; }
.outcome-lines { display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 1.45; color: var(--i60); }
.outcome-best { color: var(--ink); font-weight: 500; }
.outcome > .actions { width: min(380px, 100%); margin: 6px auto 0; }
.saved-ring { display: block; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 4; }
.ring-draw { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw .75s .1s var(--ease) forwards; }
.ring-tick { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw .35s .7s ease-out forwards; }
.saved-ring.done .ring-draw, .saved-ring.done .ring-tick { animation: none; stroke-dashoffset: 0; }
.discard-mark { color: var(--i40); }

/* A line of news, never in the way of a click on what is under it. */
.toast { pointer-events: none; position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 999px; background: var(--alert); border: 1px solid var(--bord); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); font-size: 14px; font-weight: 500; text-align: center; }

/* ------------------------------------ Athletes, History, Settings (tabs) */

.manage-screen { display: flex; flex-direction: column; gap: 16px; max-width: 1240px; }
.manage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.manage-count { margin-top: 2px; font-size: 14px; color: var(--i50); }
.primary.compact, .secondary.compact { width: auto; height: 44px; padding: 0 20px; font-size: 15px; font-weight: 600; flex: none; }
.manage-banner { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; background: rgba(111, 216, 192, .1); color: var(--mint); font-size: 14px; }
.manage-banner.quiet { background: var(--sub); color: var(--i75); }
.manage-banner.quiet .icon { color: var(--i50); }
.manage-banner-slot:empty { display: none; }
.manage-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.manage-cols .section-label { margin: 8px 4px -2px; }
/* A heading, its card and its footnote, spaced (athletes.js `parts`). */
.mblock { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mblock:empty { display: none; }
.mblock > .compact { align-self: flex-start; }
.manage-cols .footnote { padding: 0 4px; }
.manage-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.manage-tools .search-wrap { flex: 1 1 220px; height: 42px; }
.manage-seg-slot:empty { display: none; }
.search-clear { flex: none; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(244, 244, 243, .1); color: var(--i75); display: flex; align-items: center; justify-content: center; }
.gate.inline { padding: 48px 0; text-align: center; }

.mlist { list-style: none; margin: 0; padding: 0 6px; }
.empty.card { padding: 26px 16px; }
.mrow { position: relative; display: flex; align-items: center; gap: 4px; }
.mrow + .mrow::before, .dup + .dup::before { content: ""; position: absolute; left: 54px; right: 6px; top: 0; height: 1px; background: var(--hair); }
.mrow-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 8px; border: 0; border-radius: 12px; background: none; color: var(--ink); font-size: 15px; text-align: left; }
button.mrow-main:hover { background: rgba(255, 255, 255, .03); }
button.mrow-main:focus-visible { outline-offset: -2px; }
.mrow-main > .icon { color: var(--i35); }
.mrow-main.accent, .mrow-main.accent .monogram { color: var(--mint); }
.mrow-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mrow-name { font-weight: 600; overflow-wrap: anywhere; }
.mrow-sub { font-size: 13px; color: var(--i50); }
.mrow-value { flex: none; font-size: 14px; color: var(--i50); font-variant-numeric: tabular-nums; }
.incomplete-dot { margin-left: 6px; color: var(--warn); }
.monogram.plain { box-shadow: inset 0 0 0 1px rgba(111, 216, 192, .4); }
.icon-btn { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--i60); display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
.icon-btn.destructive:hover { color: var(--red); }
.link.quiet { color: var(--i60); font-size: 13.5px; }
.link.destructive { color: var(--red); }
.dup { position: relative; padding: 12px 8px 8px; }
.dup-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 2px; }

/* Forms: the phone's grouped rows. */
.dlg.form { width: min(560px, calc(100vw - 32px)); }
.dlg.form .dlg-body, .dlg.form .section-label { display: block; }
.dlg.form .dlg-body > * + * { margin-top: 12px; }
.dlg.form .dlg-body > .section-label { margin: 20px 4px -4px; }
.dlg.form .dlg-body > .footnote { padding: 0 4px; margin-top: 8px; }
.fgroup { padding: 0 16px; }
.frow { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 7px 0; font-size: 15px; }
.frow + .frow, .fgroup-rows > .frow, .check-list + .frow { border-top: 1px solid var(--hair); }
.frow-label { color: var(--i60); white-space: nowrap; }
.frow-label.ink { color: var(--ink); }
.frow-note { padding: 0 0 12px; }
.frow-note:empty { display: none; }
.input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid transparent; background: rgba(244, 244, 243, .06); font-size: 15px; color: var(--ink); color-scheme: dark; }
.input::placeholder { color: var(--i45); opacity: 1; }
.input:focus { outline: none; border-color: var(--mint); }
.input.bad { border-color: var(--red); }
.frow > .input:only-child, .frow > .input:first-child { background: none; padding-left: 0; font-size: 16px; }
.frow > .input:first-child:focus { border-color: transparent; }
.frow-label + .input, .with-unit .input { flex: 0 1 190px; text-align: right; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit .input { flex: 0 0 110px; }
.select { max-width: 62%; height: 38px; padding: 0 30px 0 10px; border-radius: 9px; border: 1px solid transparent; background-color: rgba(244, 244, 243, .06); color: var(--ink); font-size: 15px; text-align: right; appearance: none; -webkit-appearance: none; color-scheme: dark; 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='%23F4F4F3' stroke-opacity='.55' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 10l4-4 4 4M8 14l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.select:focus { outline: none; border-color: var(--mint); }
.select.accent { color: var(--mint); }
.select option { background: var(--sheet); color: var(--ink); }
.required-star { color: var(--red); font-weight: 700; font-size: 18px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: 16px; background: rgba(120, 120, 128, .32); cursor: pointer; transition: background-color .15s ease; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.switch:checked { background: var(--mint); }
.switch:checked::after { transform: translateX(20px); }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li + li { border-top: 1px solid var(--hair); }
.check-list .empty { padding: 16px 0; text-align: left; }
.check-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; border: 0; background: none; color: var(--ink); font-size: 15px; text-align: left; }
.tickbox { flex: none; width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--i35); display: flex; align-items: center; justify-content: center; color: #0A0A0B; }
.tickbox.round { border-radius: 50%; }
.tickbox.on { background: var(--mint); box-shadow: none; }
.add-group .link { flex: none; }
.dlg-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--hair); }
.member { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 4px; }
.member .link { flex: none; font-size: 14px; }
.pick-head .input { flex: none; height: 46px; padding: 0 14px; border-radius: 12px; font-size: 16px; }
.pick-head .primary.compact, .pick-head .secondary.compact { width: 100%; }
.pick[role="checkbox"] { padding-left: 2px; }
.pick:disabled { opacity: .4; }
.pick-name.stack { flex-direction: column; align-items: flex-start; gap: 1px; }
.pick-name.stack > span:first-child { display: flex; align-items: center; gap: 8px; }
.section-label.split { display: flex; justify-content: space-between; }
.section-label .plain { letter-spacing: 0; text-transform: none; font-size: 12px; }
.dlg-body > .primary { margin-top: 16px; }

/* History */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 14px; border: 0; border-radius: 18px; background: var(--sub); box-shadow: inset 0 0 0 1px var(--hair); color: var(--ink); font-size: 15px; font-weight: 500; white-space: nowrap; }
.chip .icon { opacity: .75; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--bord); }
.chip.on { color: var(--mint); background: rgba(111, 216, 192, .14); box-shadow: inset 0 0 0 1px rgba(111, 216, 192, .42); }
.filter-count { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--i50); }
.filter-count:empty { display: none; }
.history-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.history-cols.detail-open .history-pane { display: none; }
.history-cols:not(.detail-open) .history-detail { display: none; }
.day-head { position: sticky; top: 0; z-index: 1; margin: 0; padding: 14px 4px 6px; background: var(--bg); }
.dlg-body h3.section-label { margin: 18px 4px 8px; }
.dlg-body .pick-list.card + h3.section-label { margin-top: 20px; }
.hlist { list-style: none; margin: 0; padding: 0; }
.hlist li + li { border-top: 1px solid var(--hair); }
.hrow { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 10px; border: 0; border-radius: 12px; background: none; color: var(--ink); text-align: left; }
.hrow:hover { background: rgba(255, 255, 255, .03); }
.hrow.on { background: rgba(244, 244, 243, .07); }
.hrow:focus-visible { outline-offset: -2px; }
.hrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hrow-name { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.warn-mark { color: var(--warn); display: inline-flex; }
.hrow-sub { font-size: 13px; color: var(--i50); }
.hrow-note { font-size: 13px; font-style: italic; color: var(--i50); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hrow-when { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hrow-date { font-size: 13px; }
.hrow-time { font-size: 12px; color: var(--i50); }
.history-detail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-title { margin: 4px 0 2px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.detail-title:focus { outline: none; }
.detail-stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: end; }
.detail-stats .summary-line { grid-column: 1 / -1; margin-top: 2px; font-size: 13.5px; color: var(--i50); font-variant-numeric: tabular-nums; }
.detail-side { display: flex; gap: 28px; padding-bottom: 6px; }
.stat { text-align: right; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--i50); margin-bottom: 4px; }
.detail-best .stat-label { margin-bottom: 2px; }
.detail-best .summary-num { font-size: clamp(54px, 5vw, 68px); font-weight: 200; }
.reps-head { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--hair); }
.reps-head h3 { font-size: 17px; font-weight: 600; }
.add-note { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 4px; border: 0; border-top: 1px solid var(--hair); background: none; color: var(--mint); font-size: 15px; text-align: left; }
.add-note .icon { color: var(--i35); }
.capture-line { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; color: var(--i60); }
.capture-line .icon { margin-top: 1px; color: var(--mint); }
.capture-line.reps .icon, .capture-line.unknown .icon { color: var(--warn); }
.rep-del { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 8px; border: 0; border-radius: 50%; background: var(--red); color: #fff; vertical-align: -4px; }
.reps.best-accent .agg.best td { color: var(--mint); }
.history-detail .reps th, .history-detail .reps td { padding: 0 8px; }
.history-detail .rep-tables { padding: 18px 16px 12px; }
.only-narrow-detail { align-self: flex-start; }

/* Settings */
.settings-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 32px; align-items: start; }
.settings-cols .col { gap: 10px; }
.settings-cols .section-label { margin: 14px 4px -2px; }
.settings-cols .footnote { padding: 0 4px; }
.srows { overflow: hidden; }
.srow { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 9px 16px; border: 0; background: none; color: var(--ink); font-size: 15px; text-align: left; }
.srow + .srow::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--hair); }
button.srow:hover { background: rgba(255, 255, 255, .03); }
button.srow:focus-visible { outline-offset: -3px; border-radius: 14px; }
.srow > .icon { color: var(--i35); }
.srow-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.srow-text strong { font-weight: 600; }
.srow-text .beta { margin-left: 8px; }
.srow-sub { font-size: 13px; color: var(--i50); }
.srow-value { flex: none; font-size: 14px; color: var(--i50); }
.srow.destructive strong { color: var(--red); }
.dim { color: var(--i50); font-weight: 400; }

/* ------------------------------------------------------------ keyframes */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(.1); } }
@keyframes readypulse { 50% { box-shadow: 0 0 0 9px rgba(111, 216, 192, .08); } }
@keyframes svpulse { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(3.2); opacity: 0; } }

/* --------------------------------------------- a laptop: 980 px and up */

@media (min-width: 980px) {
  .only-wide { display: flex; }
  .only-narrow { display: none; }
  .screen { padding-top: 28px; }
  .cols.framing { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 56px; max-width: 1180px; }
  .cols.live { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: stretch; }
  .live-card { min-height: calc(100vh - var(--top) - 28px - 40px); }
  .screen.live { padding-bottom: 40px; }
  .cols.summary { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; max-width: 1240px; }
  .cols.summary > .side { position: sticky; top: calc(var(--top) + 16px); }
  .pair-screen { grid-template-columns: minmax(0, 1fr) 420px; gap: 80px; align-items: center; min-height: calc(100vh - var(--top) - 40px); padding-top: 12px; padding-bottom: 72px; }
  .sketch { display: flex; justify-content: center; }
  .guide .guide-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .manage-cols { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
  .settings-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .guide .guide-pick { max-width: 520px; }
  .guide .dlg-body { padding: 16px 28px 28px; }
  .guide .guide-tabs { margin: 0 -28px 20px; padding: 2px 28px 0; }
}

/* History beside its session: 1100 px and up */
@media (min-width: 1100px) {
  .history-cols { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 32px; }
  .history-cols.detail-open .history-pane { display: block; }
  .history-cols:not(.detail-open) .history-detail { display: flex; }
  .history-pane { position: sticky; top: calc(var(--top) + 8px); padding: 6px 6px 6px 10px; border-radius: 16px; border: 1px solid var(--hair); background: var(--surface); }
  .history-pane .day-head { background: var(--surface); }
  .history-list { max-height: calc(100vh - var(--top) - 200px); overflow: auto; padding-right: 6px; overscroll-behavior: contain; }
  .history-list:focus { outline: none; }
  .day-head:first-child { padding-top: 2px; }
  .only-narrow-detail { display: none; }
}

/* ------------------------------ between: the top bar runs out of room */

@media (max-width: 1180px) {
  .status .long { display: none; }
  .status .short { display: inline; }
  .tab { padding: 0 10px; gap: 6px; }
  .tab.on::after { left: 10px; right: 10px; }
  .soon { display: none; }
}
@media (max-width: 1020px) {
  .tab .icon { display: none; }
}

/* ------------------------- a narrow window: the phone's own tab bar */

@media (max-width: 859px) {
  :root { --pad: 20px; --top: 56px; }
  body.has-tabs { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* Nothing scrolled into view, or focused, ends up under the tab bar. */
  html { scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom)); scroll-padding-top: calc(var(--top) + 8px); }
  .brand-mark { width: 34px; height: 34px; }
  .brand-word { font-size: 16px; }
  .tabs { top: auto; bottom: 0; left: 0; right: 0; transform: none; height: calc(64px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); justify-content: space-around; gap: 0; background: var(--bg); border-top: 1px solid var(--hair); }
  .tab { flex: 1; flex-direction: column; justify-content: center; gap: 4px; padding: 0; font-size: 10px; font-weight: 500; color: var(--i45); }
  .tab .icon { display: block; width: 23px; height: 23px; }
  .tab.on { color: var(--mint); }
  .tab.on::after { display: none; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .screen { padding-top: 12px; padding-bottom: 40px; }
  /* The phone's own proportions: the reps and Finish stay on screen under the card. */
  .live-card { min-height: 0; }
  .hero { padding: 16px 8px 18px; }
  .strip { margin-top: 16px; min-height: 80px; }
  .metric { padding: 14px 4px 16px; }
  .finish-card .footnote { display: none; }
  .finish-card { padding: 0; border: 0; background: none; }
  .row-actions > * { width: 100%; }
  .screen.state-screen, .screen.outcome { padding-top: 5vh; }
  .code-input { height: 68px; font-size: 28px; }
  .rep-tables { padding: 14px 12px 8px; margin: 0 -6px; }
  .reps th, .reps td { padding: 0 9px; }
}
@media (max-width: 520px) {
  .brand-word { font-size: 15px; }
  .status { padding: 0 10px; height: 34px; font-size: 12.5px; }
  .info-btn { width: 36px; height: 36px; }
  dialog.dlg, .dlg.wide, .dlg.small { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; max-height: 94vh; }
  .dlg.tall { height: 94vh; }
  .dlg.guide { height: fit-content; max-height: 94vh; }
  .dlg-body { padding: 14px 16px 22px; }
  .guide-tabs { margin: 0 -16px 16px; padding: 2px 16px 0; }
  .hero-num { font-size: clamp(88px, 27vw, 120px); }
  .pair-buttons { flex-direction: column; } .pair-buttons > * { flex: none; }
}
@media (max-width: 430px) {
  /* The words stay; the connection line gives way to its dot. */
  .status .short { display: none; }
  .status { padding: 0 9px; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}

/* Research files (a phone in developer mode only): files.js. Quiet: a card
   among the others, never a dialog. */
.files-card { display: flex; flex-direction: column; gap: 10px; text-align: left; min-width: 0; }
.files-card:focus { outline: none; }
.files-card:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.outcome > .files-card { width: min(440px, 100%); margin: 0 auto; }
.files-stem { font-size: 14px; line-height: 1.4; color: var(--i75); overflow-wrap: anywhere; }
.files-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; line-height: 1.45; color: var(--i75); }
.files-line .spinner { flex: none; }
.files-pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.files-bar { display: block; width: 100%; height: 4px; border: 0; border-radius: 2px; background: var(--rule); overflow: hidden; appearance: none; -webkit-appearance: none; }
.files-bar::-webkit-progress-bar { background: var(--rule); border-radius: 2px; }
.files-bar::-webkit-progress-value { background: var(--mint); border-radius: 2px; transition: width .25s ease; }
.files-bar::-moz-progress-bar { background: var(--mint); border-radius: 2px; }
.files-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.files-main:empty { display: none; }
.files-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--i50); }
.files-done { display: inline-flex; align-items: center; gap: 4px; color: var(--mint); font-weight: 600; }
.files-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.files-list li { min-width: 0; }
.files-one { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 5px 0; text-align: left; }
.files-name { min-width: 0; overflow-wrap: anywhere; }
.files-size { flex: none; color: var(--i45); font-variant-numeric: tabular-nums; }
.files-mail { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.files-mail a.link { text-decoration: none; padding: 2px 0; }
.files-mail a.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Developer mode: "Save and send research files", under the summary's own
   buttons. Dashed, as the phone's developer button is. */
.secondary.dashed { height: 46px; border-style: dashed; border-color: rgba(255, 255, 255, .22); color: var(--i75); font-size: 15px; white-space: normal; line-height: 1.2; text-align: center; padding: 0 14px; }

/* The iPhone's camera on the setup screen (preview.js). The picture's box
   keeps its shape whether or not a picture has come: nothing moves. */
.camera-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.camera-card:focus { outline: none; }
.camera-card:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.pv-closed { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pv-line { flex: 1; min-width: 180px; font-size: 14px; line-height: 1.45; color: var(--i60); }
.pv-line strong { color: var(--ink); font-weight: 600; }
.pv-box { position: relative; flex: none; width: min(300px, 100%); aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #000; box-shadow: inset 0 0 0 1px var(--hair); }
.pv-img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.pv-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; font-size: 14px; color: var(--i75); }
.pv-wait.over { background: rgba(0, 0, 0, .6); }
.pv-side { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.pv-caption { font-size: 13px; line-height: 1.42; color: var(--i50); }
@media (min-width: 980px) {
  .camera-card.open { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .camera-card.open > .section-label { grid-column: 1 / -1; }
  .camera-card.open .pv-box { width: 270px; }
}
@media (max-width: 979px) {
  .camera-card.open { align-items: center; }
  .camera-card.open > .section-label { align-self: flex-start; }
  .camera-card.open .pv-side { align-items: center; text-align: center; }
}
