/* Metra remote. The app's own look (ios/JumpLogger/Theme.swift): Ink ground,
   Graphite cards, one accent. Green, amber and red only where they carry
   meaning -- ready, caution, destructive. No web fonts, no images. */

:root {
  --bg: #0A0A0B;
  --surface: #131315;
  --surface-subtle: #161617;
  --sheet: #1C1C1F;
  --raised: #1E1E21;
  --ink: #F4F4F3;
  --ink75: rgba(244, 244, 243, 0.75);
  --ink60: rgba(244, 244, 243, 0.62);
  --ink50: rgba(244, 244, 243, 0.54);
  --ink35: rgba(244, 244, 243, 0.35);
  --hairline: rgba(255, 255, 255, 0.07);
  --rule: rgba(255, 255, 255, 0.08);
  --rule-strong: rgba(255, 255, 255, 0.22);
  --border: rgba(255, 255, 255, 0.14);
  --accent: #6FD8C0;
  --accent-fill: #4FAE98;
  --accent-ink: #03201A;
  --warning: #E0A33C;
  --destructive: #E2685A;
  /* The right leg of a single-leg test, as in the app: data, not decoration. */
  --leg-right: #829EF0;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
ul, ol { padding: 0; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

[hidden] { display: none !important; }
#main:focus { outline: none; }

.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: 30;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.noscript { padding: 40px 24px; text-align: center; color: var(--ink60); }

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

.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
}
.top-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 58px;
}
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 14px; color: var(--ink50); }
.top-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.status {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 14px; color: var(--ink60); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink35); flex: none; }
.status[data-tone="ok"] .status-dot { background: var(--accent); }
.status[data-tone="warn"] .status-dot { background: var(--warning); }
.status[data-tone="warn"] { color: var(--warning); }
.status[data-tone="wait"] .status-dot { background: var(--ink60); animation: breathe 1.4s ease-in-out infinite; }

.info-btn {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  color: var(--accent); background: rgba(111, 216, 192, 0.14);
  border: 1px solid rgba(111, 216, 192, 0.35);
}
.info-btn:hover { background: rgba(111, 216, 192, 0.22); }

.link {
  background: none; border: 0; padding: 6px 4px; border-radius: 6px;
  color: var(--accent); font-weight: 500; font-size: 15px;
  display: inline-flex; align-items: center; gap: 4px;
}
.link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.link.strong { font-weight: 600; }
.link.quiet { color: var(--ink60); font-size: 14px; white-space: nowrap; }
.short { display: none; }
.link:disabled { opacity: 0.4; }

/* ------------------------------------------------------------- layout */

.screen { max-width: 1180px; margin: 0 auto; padding: 28px 24px 56px; }
.screen.narrow { max-width: 600px; display: flex; flex-direction: column; gap: 20px; }
.cols { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.only-wide { display: none; }

@media (min-width: 900px) {
  .cols.framing { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 48px; }
  .cols.live { grid-template-columns: minmax(0, 1fr) 340px; }
  .only-wide { display: flex; }
  .only-narrow { display: none; }
  .cols.framing .side, .cols.live .side { position: sticky; top: 86px; }
}

/* The summary's table is seven columns on a CMJ: it gets the whole width
   until there is room for the buttons beside it. */
@media (min-width: 1100px) {
  .cols.summary { grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; }
  .cols.summary .side { position: sticky; top: 86px; }
}

/* -------------------------------------------------------------- pieces */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
}
.card.padded { padding: 16px; }
.card.subtle { background: var(--surface-subtle); border-color: transparent; }

.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--ink50);
}
.overline { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.overline.accent { color: var(--accent); }
.footnote { font-size: 13.5px; color: var(--ink60); }
.footnote.center, .center { text-align: center; }
.caption { font-size: 12.5px; color: var(--ink50); }
.lead { color: var(--ink60); }
.empty { font-size: 14px; color: var(--ink60); padding: 8px 6px; }

.beta {
  display: inline-block; margin-left: 8px; padding: 1px 4px; vertical-align: middle;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink60);
  border: 1px solid rgba(244, 244, 243, 0.18); border-radius: 4px;
}

.primary, .secondary, .busy {
  width: 100%; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.primary {
  height: 54px; border: 0; background: var(--accent-fill); color: var(--accent-ink);
  font-weight: 600;
}
.primary:hover:not(:disabled) { background: #58b9a2; }
.primary:disabled, .secondary:disabled { opacity: 0.4; }
.secondary {
  height: 50px; background: none; border: 1px solid var(--border); font-weight: 500;
}
.secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.04); }
.secondary.destructive { color: var(--destructive); border-color: rgba(226, 104, 90, 0.45); }
.secondary .icon-bolt { color: var(--accent); }
.busy { height: 54px; background: var(--surface-subtle); font-weight: 600; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none; display: inline-block;
  border: 2px solid var(--ink35); border-top-color: var(--ink);
  animation: spin 0.9s linear infinite;
}

.note {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-radius: 14px; background: rgba(244, 244, 243, 0.06);
  color: var(--ink60); font-size: 14px;
}
.note .icon { flex: none; margin-top: 2px; }
.note-text { min-width: 0; flex: 1; }
.note.warning { background: rgba(224, 163, 60, 0.16); color: var(--warning); }
.note.outlined { border: 1px solid rgba(224, 163, 60, 0.45); background: rgba(224, 163, 60, 0.10); }
.note.outlined .note-text { display: flex; flex-direction: column; gap: 3px; color: var(--ink75); }
.note.outlined strong { color: var(--ink); font-size: 16px; }
.notice-ok { display: flex; margin-top: 4px; padding-left: 0; font-weight: 600; font-size: 14px; }
.quiet-slot:empty { display: none; }

.required {
  padding: 2px 6px; border-radius: 4px; margin-left: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--warning); background: rgba(224, 163, 60, 0.18);
}

.segments {
  display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px;
  background: rgba(244, 244, 243, 0.06);
}
.segments.center { align-self: center; }
.segments.wide { display: flex; }
.segments.wide .segment { flex: 1; min-height: 34px; }
.segment {
  border: 0; background: none; border-radius: 7px; padding: 5px 11px; min-height: 30px;
  font-size: 13.5px; font-weight: 500; color: var(--ink60); white-space: nowrap;
}
.segment.on { background: var(--ink); color: var(--bg); font-weight: 600; }
.segment:disabled { opacity: 0.5; }
.segments.center .segment { min-width: 64px; }

.monogram {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--ink75);
  font-size: 12px; font-weight: 600;
}

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

.pair { display: flex; flex-direction: column; gap: 16px; }
.pair h1.with-spinner { display: flex; align-items: center; gap: 12px; font-size: 24px; }
.code-input {
  width: 100%; height: 64px; padding: 0 14px; border-radius: 14px;
  background: var(--surface-subtle); border: 1px solid var(--border);
  font-size: clamp(18px, 5.2vw, 28px); font-weight: 300; letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums; text-align: center;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}
.code-input::placeholder { color: var(--ink60); opacity: 1; }
.drop-input::placeholder, .load-input::placeholder { color: var(--ink50); opacity: 1; }
.code-input:focus-visible { outline-offset: 0; border-color: transparent; }
.field-error { color: var(--warning); font-size: 14px; }
.field-error:empty { display: none; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--ink75); cursor: pointer; align-self: flex-start; }
.check input { flex: none; margin-top: 2px; }
.check-hint { color: var(--ink60); }
.check input { width: 18px; height: 18px; accent-color: var(--accent-fill); }
.help { display: flex; flex-direction: column; gap: 10px; }
.plain-steps { padding-left: 20px; color: var(--ink75); font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.causes { display: flex; flex-direction: column; gap: 8px; }
.causes ul { padding-left: 18px; color: var(--ink75); font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.row-actions { display: flex; flex-direction: column; gap: 10px; }

/* ------------------------------------------------------- the setup card */

.rows > * + * { border-top: 1px solid var(--hairline); }
.row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px;
  padding: 10px 16px; background: none; border: 0; text-align: left;
}
button.row:hover:not(:disabled) { background: rgba(255, 255, 255, 0.03); }
button.row:focus-visible { outline-offset: -2px; border-radius: 12px; }
.rows > button.row:first-child { border-radius: 16px 16px 0 0; }
.rows > button.row:last-child { border-radius: 0 0 16px 16px; }
button.row:disabled { opacity: 0.55; }
.row-label { color: var(--ink60); font-size: 15px; white-space: nowrap; display: inline-flex; align-items: center; }
.row-value {
  margin-left: auto; min-width: 0; display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 500;
}
.row-text, .row-prefix { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-prefix { color: var(--ink50); font-weight: 400; flex: 0 1 auto; }
.row-value .icon-bolt { color: var(--accent); flex: none; }
.row-value.placeholder .row-text { color: var(--ink50); font-weight: 400; }
.row > .icon { color: var(--ink35); flex: none; }
.row.arm { flex-wrap: wrap; row-gap: 8px; }
.row.arm .segments { margin-left: auto; }
.drop-input, .load-input {
  background: none; border: 0; border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums; font-weight: 500; text-align: right;
}
.drop-input { width: 76px; height: 32px; padding: 0 2px; font-size: 15px; }
.drop-input:focus-visible, .load-input:focus-visible { outline: none; border-bottom-color: var(--accent); }
.unit { color: var(--ink50); font-weight: 400; }

/* ----------------------------------------------------- the guide's parts */

.panel { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; width: 100%; max-width: 560px; }
.panel > .card, .panel > ul { width: 100%; }
.guide-heading h2, .guide-heading h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.guide-test, .guide-setup, .guide-protocols, .quick-setup-body { display: flex; flex-direction: column; gap: 12px; }
.guide-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--hairline); }
.guide-tab {
  background: none; border: 0; padding: 4px 0 9px; font-size: 19px; font-weight: 700;
  color: var(--ink50); border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.guide-tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.tiles { display: flex; gap: 7px; }
.tile {
  flex: 1; min-width: 0; height: 64px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--ink60);
  font-size: 12.5px; font-weight: 600;
}
.tile.on { background: rgba(111, 216, 192, 0.12); border-color: rgba(111, 216, 192, 0.7); color: var(--ink); }
.tile.on .glyph { color: var(--accent); }
.chart { display: block; width: 100%; max-width: 480px; height: auto; margin: 6px auto 0; font-family: var(--font); }
.side-view { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; font-family: var(--font); }

.steps ol { list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step; display: flex; gap: 12px; padding: 12px 16px;
  font-size: 15px;
}
.steps li + li { border-top: 1px solid var(--hairline); }
.steps li::before {
  content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.07);
  color: var(--ink75); font-size: 12px; font-weight: 700;
}
.tag-ready { color: var(--accent); font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; }
.tag-floor { font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; }
.steps-reps {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px 11px 19px;
  border-top: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.025);
  border-radius: 0 0 16px 16px; font-size: 13.5px; color: var(--ink60);
}
.steps-reps .icon { flex: none; color: var(--ink50); }

.rules { list-style: none; padding: 4px 14px; }
.rule { display: flex; gap: 12px; padding: 9px 0; align-items: flex-start; }
.rule.plain { align-items: center; }
.rule + .rule { border-top: 1px solid var(--hairline); }
.rule-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--surface-subtle); border: 1px solid rgba(255, 255, 255, 0.06); color: var(--accent);
}
.rule-title { font-size: 15px; font-weight: 700; }
.rule-detail { font-size: 13.5px; color: var(--ink60); }
.quick-setup summary {
  list-style: none; display: flex; align-items: center; gap: 12px; min-height: 52px;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 18px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.quick-setup summary::-webkit-details-marker { display: none; }
.quick-setup summary > span:nth-child(2) { flex: 1; }
.quick-setup summary > .icon { color: var(--ink50); transition: transform 0.2s; }
.quick-setup[open] summary > .icon { transform: rotate(90deg); }
.quick-setup-body { margin-top: 12px; }

.arm-tiles { display: flex; gap: 10px; margin: 12px 0; }
.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, 0.6);
  font-size: 15px; font-weight: 600;
}
.free-leg { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.free-leg-figure { padding: 12px 16px; border-radius: 14px; background: rgba(30, 30, 33, 0.6); flex: none; }

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

.live-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 24px;
  padding: 18px; min-height: min(640px, calc(100vh - 150px));
}
.ready-banner {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 16px;
  border-radius: 18px; background: var(--surface-subtle);
}
.ready-banner.ready { background: rgba(111, 216, 192, 0.12); }
.ready-dot {
  position: relative; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--warning); animation: breathe 1.4s ease-in-out infinite;
}
.ready .ready-dot { background: var(--accent); animation: none; }
.ready .ready-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: ring 1.6s ease-out infinite;
}
.ready-label {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.07em;
}
.thermal {
  padding: 3px 6px; border-radius: 5px; background: var(--warning); color: #000;
  font-size: 11px; font-weight: 700;
}
.elapsed { font-size: 14px; color: var(--ink60); font-variant-numeric: tabular-nums; }
.context {
  text-align: center; font-size: 12px; letter-spacing: 0.06em; color: var(--ink50);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 16px 0; min-height: 300px;
}
.hero-rep, .hero-label {
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em; color: var(--ink50);
  font-variant-numeric: tabular-nums;
}
.hero-value { display: flex; align-items: baseline; justify-content: center; gap: 8px; line-height: 1; }
.hero-num {
  font-size: clamp(84px, 13vw, 164px); font-weight: 200; letter-spacing: -0.03em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.hero-unit { font-size: 26px; font-weight: 300; color: var(--ink50); }
.hero-sub, .hero-avg { font-size: 14px; color: var(--ink60); font-variant-numeric: tabular-nums; }
.hero-best { font-size: 14px; color: var(--ink60); }
.hero-best.is-best { color: var(--accent); }
.hero-note { font-size: 14px; color: var(--ink60); margin-top: 8px; }
.hero-instruction { max-width: 440px; font-size: 16px; color: var(--ink60); }
.hero-instruction strong { color: var(--ink); font-size: 14px; letter-spacing: 0.03em; }
.hero-wait { font-size: 14px; color: var(--ink50); }
.hero-wait.ready { color: var(--accent); font-weight: 700; letter-spacing: 0.05em; }
.hidden { visibility: hidden; }
.leg-l { color: var(--accent); }
.leg-r { color: var(--leg-right); }

.strip { display: flex; align-items: flex-end; gap: 8px; height: 96px; margin-top: 8px; }
.strip.legs { height: 114px; }
.strip-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.strip-bar { width: 26px; border-radius: 6px; background: rgba(244, 244, 243, 0.2); transform-origin: bottom; }
.strip-bar.best { background: var(--accent); }
.strip-bar.newest { background: var(--ink); }
.strip-bar.leg-l { background: rgba(111, 216, 192, 0.32); }
.strip-bar.leg-r { background: rgba(130, 158, 240, 0.32); }
.strip-bar.leg-none { background: rgba(244, 244, 243, 0.32); }
.strip-bar.leg-l.strong { background: var(--accent); }
.strip-bar.leg-r.strong { background: var(--leg-right); }
.strip-bar.leg-none.strong { background: var(--ink); }
.strip-bar.grow { animation: grow 0.5s ease-out; }
.strip-n { font-size: 11px; color: var(--ink50); font-variant-numeric: tabular-nums; }
.strip-leg { font-size: 11px; font-weight: 700; margin-top: -3px; }

.bottom { display: flex; padding: 12px 0 4px; }
.metric { flex: 1; min-width: 0; display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
.metric + .metric { border-left: 1px solid var(--hairline); }
.metric dd { display: flex; align-items: baseline; gap: 3px; }
.metric-value { font-size: 30px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric-unit { font-size: 13px; color: var(--ink50); }
.metric dt {
  font-size: 11px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink50); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.live-footer { display: flex; align-items: center; gap: 10px; }
.facts { padding: 4px 16px; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: 14.5px; }
.fact + .fact { border-top: 1px solid var(--hairline); }
.fact dt { color: var(--ink60); white-space: nowrap; }
.fact dd { font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.rep-pill {
  width: 76px; height: 54px; border-radius: 14px; flex: none; background: var(--surface-subtle);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.rep-pill-n { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rep-pill-l { font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; color: var(--ink50); }
.finish { height: 54px; }

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

.summary-title h1 { display: flex; align-items: center; gap: 8px; }
.summary-title h1 .icon { color: var(--accent); }
.subtitle { margin-top: 4px; font-size: 14px; color: var(--ink60); }
.summary-hero { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.summary-best { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.summary-num {
  font-size: 72px; font-weight: 200; letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.summary-unit { margin-left: 8px; font-size: 15px; color: var(--ink60); }
.fatigue { text-align: right; padding-bottom: 4px; }
.fatigue-num { font-size: 28px; font-weight: 300; font-variant-numeric: tabular-nums; }
.fatigue-pct { margin-left: 3px; font-size: 13px; color: var(--ink50); }
.fatigue-label { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.07em; color: var(--ink50); }
.summary-line { font-size: 14px; color: var(--ink60); font-variant-numeric: tabular-nums; }
.summary-line.better { color: var(--accent); }

.rep-tables { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.rep-tables.legs { gap: 20px; }
.leg-group { display: flex; flex-direction: column; gap: 6px; }
.leg-title { font-size: 15px; font-weight: 600; }
.leg-title.leg-none { color: var(--ink); }

.bars { overflow: hidden; }
.bars-plot { position: relative; display: inline-flex; gap: 8px; max-width: 100%; padding-top: 14px; }
.bars.long .bars-plot { display: flex; }
.bars.long .bars-plot { gap: 3px; }
.bar-col { flex: 0 1 40px; width: 40px; min-width: 3px; display: flex; flex-direction: column; align-items: center; }
.bar-slot { width: 100%; height: 64px; display: flex; align-items: flex-end; }
.bar { width: 100%; border-radius: 4px; background: rgba(244, 244, 243, 0.22); }
.bar.best { background: var(--accent); }
.bar.leg-l { background: rgba(111, 216, 192, 0.32); }
.bar.leg-r { background: rgba(130, 158, 240, 0.32); }
.bar.leg-none { background: rgba(244, 244, 243, 0.32); }
.bar.leg-l.best { background: var(--accent); }
.bar.leg-r.best { background: var(--leg-right); }
.bar.leg-none.best { background: var(--ink); }
.bar-n { height: 16px; padding-top: 2px; font-size: 10.5px; color: var(--ink50); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-leg { height: 13px; font-size: 10.5px; font-weight: 700; line-height: 1; }
.bars-avg { position: absolute; left: 0; right: -6px; height: 0; border-top: 1px dashed var(--ink60); }
.bars-avg span {
  position: absolute; left: calc(100% + 6px); top: -8px; white-space: nowrap;
  font-size: 11px; color: var(--ink60); font-variant-numeric: tabular-nums;
}
.bars:not(.long) { padding-right: 130px; }

.table-wrap { overflow-x: auto; border-radius: 4px; }
.table-wrap:focus-visible { outline-offset: 4px; }
.reps { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.reps th, .reps td { height: 34px; padding: 0 9px; text-align: center; white-space: nowrap; font-weight: 400; }
.reps thead th { height: auto; vertical-align: bottom; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.th-name { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink50); }
.th-unit { display: block; font-size: 11px; color: var(--ink50); }
.reps .rep-col {
  position: sticky; left: 0; z-index: 1; width: 92px; min-width: 92px; padding-left: 0;
  text-align: left; background: var(--bg); color: var(--ink75);
}
.reps tbody tr.suspect td { color: var(--ink50); }
.suspect-mark { margin-left: 8px; color: var(--warning); vertical-align: -2px; }
.aggs tr:first-child > * { border-top: 1px solid var(--rule-strong); }
.aggs tr + tr > * { border-top: 1px solid var(--rule); }
.aggs th { font-size: 11px; font-weight: 500; letter-spacing: 0.11em; text-transform: uppercase; }
.agg.average th { color: var(--ink60); }
.agg.average td { color: var(--ink75); }
.agg.best th { color: var(--accent); }
.agg.fatigue th { color: var(--ink); }
.num { display: inline-block; text-align: right; }
.num.dash { text-align: center; }

.actions { display: flex; flex-direction: column; gap: 10px; }
.pair-buttons { display: flex; gap: 10px; }
.note-card { text-align: left; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.note-body { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }

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

.outcome { min-height: calc(100vh - 140px); justify-content: center; }
.outcome-body { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px 0 12px; }
.outcome-lines { display: flex; flex-direction: column; gap: 4px; color: var(--ink60); font-size: 15px; }
.outcome-best { margin-top: 6px; font-variant-numeric: tabular-nums; }
.discard-mark { color: var(--ink50); }
.saved-ring { margin-bottom: 6px; }
.ring-track { fill: none; stroke: rgba(244, 244, 243, 0.07); stroke-width: 4; }
.ring-draw, .ring-tick {
  fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 4.5;
  stroke-dasharray: 100; stroke-dashoffset: 100;
}
.ring-draw { stroke: var(--accent); animation: draw 1s 0.1s ease-in-out forwards; }
.ring-tick { stroke: var(--ink); animation: draw 0.4s 0.95s ease-out forwards; }
.saved-ring.done .ring-draw, .saved-ring.done .ring-tick { animation: none; stroke-dashoffset: 0; }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 40;
  max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--border);
  font-size: 15px; font-weight: 500; text-align: center;
  animation: fade 0.2s ease-out;
}
.toast[hidden] { display: none; }

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

.dlg {
  width: min(520px, calc(100vw - 24px)); max-height: min(780px, calc(100vh - 24px));
  padding: 0; border: 1px solid var(--border); border-radius: 20px;
  background: var(--sheet); color: var(--ink); overflow: hidden;
}
.dlg[open] { display: flex; flex-direction: column; }
.dlg.wide { width: min(640px, calc(100vw - 24px)); }
.dlg.small { width: min(400px, calc(100vw - 24px)); }
.dlg.tall { height: min(720px, calc(100vh - 24px)); }
.dlg::backdrop { background: rgba(0, 0, 0, 0.62); }
.dlg-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 8px 12px; min-height: 52px; border-bottom: 1px solid var(--hairline); flex: none;
}
.dlg-title { font-size: 16px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-side { display: flex; }
.dlg-side.right { justify-content: flex-end; }
.dlg-side [hidden] { display: none; }
.dlg-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-body section { display: flex; flex-direction: column; gap: 8px; }
.dlg-message { color: var(--ink75); font-size: 15px; }
.dlg-actions { display: flex; gap: 10px; }
.dlg-actions.stack { flex-direction: column; align-items: center; }

.pick-head { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.search-wrap {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px;
  border-radius: 10px; background: rgba(244, 244, 243, 0.07); color: var(--ink50);
}
.search-wrap:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search { flex: 1; min-width: 0; height: 100%; background: none; border: 0; font-size: 15px; }
.search:focus-visible { outline: none; }
.search::placeholder { color: var(--ink50); }
.pick-results { display: flex; flex-direction: column; gap: 14px; }
.pick-list { list-style: none; }
.pick-list li + li { border-top: 1px solid var(--hairline); }
.pick-list.card { background: rgba(244, 244, 243, 0.03); overflow: hidden; }
.pick {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px;
  padding: 9px 8px; background: none; border: 0; border-radius: 10px; text-align: left;
}
.pick:hover { background: rgba(255, 255, 255, 0.05); }
.pick:focus-visible { outline-offset: -2px; }
.pick-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-sub { display: block; font-size: 13px; font-weight: 400; color: var(--ink60); }
.pick-detail { flex: 0 1 auto; max-width: 45%; font-size: 13px; color: var(--ink60); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick > .icon { color: var(--ink35); flex: none; }
.tick { color: var(--accent); display: inline-flex; flex: none; }
.pick.test { padding: 10px 14px 10px 12px; border-radius: 0; }
.pick.test.on { background: rgba(111, 216, 192, 0.06); }
.glyph-box {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: rgba(244, 244, 243, 0.06); color: var(--ink60);
}
.pick.test.on .glyph-box { background: rgba(111, 216, 192, 0.14); color: var(--accent); }

.load-number { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 4px; }
.load-field { display: flex; align-items: baseline; gap: 6px; }
.load-input { width: 3.2ch; min-width: 150px; font-size: 76px; font-weight: 200; text-align: center; line-height: 1.1; border-bottom-color: transparent; }
.load-field .unit { font-size: 20px; }
.round {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface-subtle); border: 1px solid var(--border);
}
.round:disabled { color: var(--ink35); }
.note-area {
  width: 100%; min-height: 150px; padding: 12px; border-radius: 12px; resize: vertical;
  background: rgba(244, 244, 243, 0.06); border: 1px solid var(--border); font-size: 15px;
}

/* --------------------------------------------------------------- motion */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes ring { from { transform: scale(1); opacity: 0.8; } to { transform: scale(2.8); opacity: 0; } }
@keyframes grow { from { transform: scaleY(0.02); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ready-dot, .ready .ready-dot::after, .status-dot, .strip-bar.grow, .toast { animation: none !important; }
  .ready .ready-dot::after { display: none; }
  .ring-draw, .ring-tick { animation: none; stroke-dashoffset: 0; }
  .spinner { animation-duration: 2.4s; }
}

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

@media (max-width: 899px) {
  .live-card { min-height: 0; }
  .hero { min-height: 260px; }
  /* One column: the warnings above the card, and Finish always in reach at
     the bottom of the window. The side column's parts join the page's own
     column so that Finish can stay put while the rest scrolls. */
  .cols.live { gap: 14px; }
  .cols.live .side { display: contents; }
  .cols.live .side > .note, .cols.live .side > .quiet-slot { order: -1; }
  .cols.live .live-footer {
    position: sticky; bottom: 0; z-index: 2; background: var(--bg);
    padding: 10px 0; margin: -10px 0;
  }
  .bars:not(.long) { padding-right: 0; }
  .bars-avg span { left: auto; right: 6px; top: -16px; }
}

@media (max-width: 520px) {
  h1 { font-size: 26px; }
  .top-inner { padding: 8px 16px; gap: 10px; }
  .brand-sub { display: none; }
  .long { display: none; }
  .short { display: inline; }
  .screen { padding: 20px 16px 44px; }
  .status { font-size: 13px; }
  .link.quiet { font-size: 13px; }
  .live-card { padding: 12px; border-radius: 20px; }
  .ready-label { font-size: 12.5px; letter-spacing: 0.04em; }
  .metric-value { font-size: 24px; }
  .metric dt { font-size: 10px; letter-spacing: 0.03em; }
  .summary-num { font-size: 60px; }
  .strip { gap: 5px; }
  .strip-bar { width: 20px; }
  .load-input { font-size: 60px; min-width: 110px; }
  .dlg-body { padding: 14px; }
  .pair-buttons { flex-direction: column; }
}
