/* Bike Fit. One loud thing: the tape-measure band at the top. Everything below it is quiet and high-contrast,
   sized for a thumb while standing next to a trainer. */

:root {
  color-scheme: light dark;
  --bg: #F3F5F6;          /* chalk */
  --surface: #FFFFFF;
  --ink: #20272D;         /* graphite */
  --muted: #55626D;       /* steel */
  --line: #B9C3CA;
  --unit-bg: #E6EAED;
  --tape: #F4C20D;        /* tape blade */
  --tape-ink: #20272D;
  --chip-on: #FFF3C4;
  --link: #1C56D0;
  --focus: #1C56D0;
  --error: #B3261E;
  --btn-bg: #20272D;
  --btn-ink: #FFFFFF;
  --danger-ink: #FFFFFF;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Avenir Next Condensed", "Roboto Condensed", "sans-serif-condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  --radius: 10px;
  --tap: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181B;          /* asphalt */
    --surface: #1D2327;
    --ink: #E9EDF0;
    --muted: #A5B1BA;
    --line: #47525A;
    --unit-bg: #283035;
    --tape: #E9B908;
    --chip-on: #3A3313;
    --link: #8DB2FF;
    --focus: #F4C20D;
    --error: #FF9086;
    --btn-bg: #F4C20D;
    --btn-ink: #14181B;
    --danger-ink: #14181B;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font-body);
  min-height: 100vh;
}

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

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- the tape band ---- */

.band {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(.625rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 1.25rem max(1rem, env(safe-area-inset-left));
  background: var(--tape);
  color: var(--tape-ink);
}

/* millimetre ticks, a longer tick each half centimetre, the longest each centimetre */
.band::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 11px;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--tape-ink) 0 2px, transparent 2px 60px) left bottom / 100% 11px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 30px, var(--tape-ink) 30px 31.5px, transparent 31.5px 60px) left bottom / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, var(--tape-ink) 0 1px, transparent 1px 6px) left bottom / 100% 4px no-repeat;
  opacity: .85;
}

.brand {
  font: 700 1.625rem/1 var(--font-display);
  font-stretch: condensed;
  color: inherit;
  text-decoration: none;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}

.band :focus-visible { outline-color: var(--tape-ink); }
.account-menu :focus-visible { outline-color: var(--focus); outline-offset: -3px; }

.account { position: relative; }

.account-button {
  min-height: 44px;
  max-width: 12rem;
  padding: 0 .875rem 0 1rem;
  border: 2px solid var(--tape-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--tape-ink);
  font: 600 1rem/1 var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.account-button::after { content: " ▾"; }
.account-button[aria-expanded="true"] { background: var(--tape-ink); color: var(--tape); }

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  z-index: 10;
  min-width: 16rem;
  padding: .375rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .22);
}
.account-name { margin: .5rem .75rem; color: var(--muted); font-size: .9375rem; }
.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--tap);
  padding: 0 .75rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover { background: var(--unit-bg); }
.menu-item.danger { color: var(--error); }

/* ---- page ---- */

main {
  max-width: 38rem;
  margin: 0 auto;
  padding: 1.75rem max(1rem, env(safe-area-inset-right)) 4rem max(1rem, env(safe-area-inset-left));
}
main:focus { outline: none; }

h1, h2 {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 700;
  line-height: 1.08;
  text-wrap: balance;
}
h1 { font-size: clamp(2.125rem, 9vw, 2.875rem); margin: 0 0 .75rem; }
h1:focus { outline: none; }
h2 { font-size: 1.5rem; margin: 0; }

.lede { margin: 0 0 1.5rem; max-width: 34em; color: var(--ink); }
.muted { color: var(--muted); margin: 0; }
.loading { color: var(--muted); }

a { color: var(--link); }

.flash {
  margin: 0 0 1.5rem;
  padding: .75rem 1rem;
  background: var(--surface);
  border-left: 6px solid var(--tape);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 600;
}

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

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: 650 1.0625rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.btn.secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn.danger { background: var(--error); border-color: var(--error); color: var(--danger-ink); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: progress; }

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 .25rem;
  border: 0;
  background: none;
  color: var(--link);
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.text-link.danger { color: var(--error); }

/* ---- home ---- */

.bikes, .sessions { list-style: none; margin: 0; padding: 0; }

.bike {
  padding: 1rem 0 1.25rem;
  border-top: 3px solid var(--ink);
}
.bike + .bike { margin-top: .5rem; }
.bike-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.bike-head h2 { overflow-wrap: anywhere; }

/* the saddle height reads like a mark on the tape */
.reading { margin: 0; text-align: right; flex: none; }
.reading-value {
  display: block;
  font: 700 2.25rem/1 var(--font-display);
  font-stretch: condensed;
  font-variant-numeric: tabular-nums;
}
.reading-label { display: block; color: var(--muted); font-size: .875rem; }

.actions.quiet { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); gap: 1.25rem; }

.recent { margin-top: 2.5rem; }
.recent h2 { margin-bottom: .5rem; }
.sessions li { border-bottom: 1px solid var(--line); }
.sessions a {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .75rem;
  align-items: baseline;
  min-height: var(--tap);
  padding: .75rem 0;
  color: var(--ink);
  text-decoration: none;
}
.session-bike { font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* ---- forms ---- */

.field { margin: 1.375rem 0 0; padding: 0; border: 0; min-width: 0; }

.field > label, .field > legend {
  display: block;
  padding: 0;
  margin-bottom: .4375rem;
  font-weight: 650;
  font-size: 1.0625rem;
}
.optional { font-weight: 400; color: var(--muted); font-size: .9375rem; }

.measure {
  display: flex;
  max-width: 13rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.measure:focus-within { border-color: var(--ink); outline: 3px solid var(--focus); outline-offset: 2px; }
.measure input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 .875rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 600 1.375rem/1 var(--font-body);
  font-variant-numeric: tabular-nums;
}
.measure input:focus { outline: none; }
.unit {
  display: flex;
  align-items: center;
  min-width: 3.25rem;
  justify-content: center;
  padding: 0 .75rem;
  background: var(--unit-bg);
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-weight: 650;
}

.text-input, textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: .625rem .875rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: 400 1.125rem/1.4 var(--font-body);
}
textarea { resize: vertical; }
.text-input:focus-visible, textarea:focus-visible { border-color: var(--ink); }

.field.invalid .measure, .field.invalid .text-input, .field.invalid textarea, .field.invalid .choice { border-color: var(--error); }
.text-input[aria-invalid="true"] { border-color: var(--error); }

.hint { margin: .5rem 0 0; max-width: 34em; color: var(--muted); font-size: .9375rem; line-height: 1.45; }

.error, .form-error { margin: .5rem 0 0; color: var(--error); font-weight: 650; }
.error:empty, .form-error:empty { display: none; }
.error::before, .form-error::before { content: "! "; font-weight: 800; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr)); gap: .5rem; }
.kind-checks .choices { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.choice {
  display: flex;
  align-items: center;
  gap: .625rem;
  min-height: var(--tap);
  padding: .5rem .875rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1.25;
}
.choice input { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; accent-color: var(--ink); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--chip-on); font-weight: 650; }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input:focus-visible { outline: none; }

.group { margin-top: 2.25rem; padding-top: .875rem; border-top: 3px solid var(--ink); }
.group:first-child { margin-top: .5rem; }

/* the save button stays in reach on a long form */
.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 2rem;
  padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.form-actions .form-error { margin: 0 0 .625rem; }
.form-actions .btn { width: 100%; }

.signin { max-width: 24rem; }
.signin .form-error { margin-top: 1rem; }
.signin .btn { margin-top: 1.5rem; }

.danger-zone { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.confirm { margin-top: .5rem; padding: 1rem; border: 2px solid var(--error); border-radius: var(--radius); }
.confirm p:first-child { margin-top: 0; font-weight: 600; }
.confirm-form .actions { margin-top: 1.5rem; }

@media (min-width: 40rem) {
  main { padding-top: 2.5rem; }
  .form-actions .btn { width: auto; min-width: 14rem; }
  .band { padding-inline: max(1.5rem, calc((100vw - 38rem) / 2 + 1rem)); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ======== session, results, history ======== */

:root {
  --rec: #C8211A;          /* recording dot */
  --stage: #11161A;        /* behind clips and the skeleton */
  --bone-field: #1B2227;
}
@media (prefers-color-scheme: dark) {
  :root { --rec: #FF6B5E; }
}

/* the session and history screens need room for a clip and a table */
main:has(> .view.wide) { max-width: 56rem; }
@media (min-width: 40rem) {
  body:has(.view.wide) .band { padding-inline: max(1.5rem, calc((100vw - 56rem) / 2 + 1rem)); }
}

.session-meta { margin: -.25rem 0 1rem; font-weight: 600; }

/* ---- capture cards ---- */

.cards { display: grid; gap: 1.5rem; margin-bottom: 1rem; }
@media (min-width: 52rem) { .cards { grid-template-columns: 1fr 1fr; align-items: start; } }

.capture-card { padding-top: .875rem; border-top: 3px solid var(--ink); min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; margin-bottom: .75rem; }
.state { margin: 0; font-weight: 650; }
.state:focus { outline: none; }
.state::before { display: inline-block; width: 1.25em; font-weight: 800; }
.state.empty { color: var(--muted); }
.state.empty::before { content: "○"; }
.state.uploading::before, .state.queued::before, .state.running::before { content: "↻"; }
.state.done::before { content: "✓"; }
.state.failed { color: var(--error); }
.state.failed::before { content: "!"; }

/* progress reads like a strip of tape filling up */
.meter { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; }
.meter progress {
  flex: 1; height: 16px; appearance: none; -webkit-appearance: none;
  border: 2px solid var(--ink); border-radius: 4px; background: var(--unit-bg); overflow: hidden;
}
.meter progress::-webkit-progress-bar { background: var(--unit-bg); }
.meter progress::-webkit-progress-value { background: var(--tape); }
.meter progress::-moz-progress-bar { background: var(--tape); }
.percent { min-width: 3.5ch; font: 700 1.5rem/1 var(--font-display); font-stretch: condensed; font-variant-numeric: tabular-nums; text-align: right; }

.card-error { margin: 0 0 .875rem; }
/* the server is not answering: said in words, with a way to ask again */
.reach-note { margin: 0 0 .875rem; padding: .5rem .75rem; border-left: 4px solid var(--muted); font-weight: 600; }
.reach-note .text-link { min-height: 44px; }
.fit-note { margin: 1.5rem 0 0; }
/* Record (or Try again) across the top, the other two side by side under it */
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .625rem; }
.card-actions .btn { padding-inline: .75rem; }
.card-actions .btn.primary { grid-column: 1 / -1; }
.replace-note { margin-top: .5rem; font-size: .9375rem; }
.replace-note .text-link { min-height: 44px; font-size: .9375rem; }
.results-title:focus { outline: none; }

.panel { margin-top: 1rem; padding: 1rem; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); }
.panel h3 { margin: 0 0 .75rem; font: 700 1.375rem/1.15 var(--font-display); font-stretch: condensed; }
.panel h3:focus { outline: none; }
.panel .confirm { margin: 0; padding: 0; border: 0; }
.panel .actions { margin-top: 1rem; }
.plan { margin: .75rem 0 0; max-width: 36em; }

.guidance { display: grid; gap: .75rem 1rem; align-items: center; }
@media (min-width: 30rem) { .guidance { grid-template-columns: minmax(8rem, 11rem) 1fr; } }
.outline-box { color: var(--muted); }
.outline-box .outline { display: block; width: 100%; max-height: 9rem; }
.tips { margin: 0; padding-left: 1.25rem; }
.tips li + li { margin-top: .25rem; }

/* ---- camera ---- */

.viewfinder {
  position: relative; display: grid; place-items: center;
  width: 100%; height: min(60vh, 26rem); background: #000; border-radius: 8px; overflow: hidden;
}
.viewfinder video { width: 100%; height: 100%; object-fit: contain; }
.viewfinder video.mirrored { transform: scaleX(-1); }
.viewfinder .outline { position: absolute; inset: 6%; width: 88%; height: 88%; color: var(--tape); opacity: .75; pointer-events: none; }
/* the count sits over the whole full-screen panel, so it is as large as the screen allows whatever the camera's shape */
.panel { position: relative; }
.count {
  position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; margin: 0;
  font: 800 min(58vh, 78vw)/1 var(--font-display); font-stretch: condensed; font-variant-numeric: tabular-nums;
  color: var(--tape); text-shadow: 0 0 .06em #000, 0 0 .25em rgb(0 0 0 / .7); pointer-events: none;
}
.count:empty { display: none; }
.count.recording { color: #fff; font-size: min(24vh, 34vw); place-items: start end; padding: .15em .25em 0 0; }
.viewfinder.recording { box-shadow: inset 0 0 0 6px var(--rec); }
.camera-status { margin: .75rem 0 0; font-weight: 700; font-size: 1.25rem; }
.viewfinder.recording ~ .camera-status::before { content: "● "; color: var(--rec); }
.camera .muted { margin-top: .5rem; }

/* while counting down and recording the camera takes the whole screen, readable from the bike */
.panel.live {
  position: fixed; inset: 0; z-index: 50; margin: 0; border: 0; border-radius: 0;
  display: flex; flex-direction: column; padding: calc(.75rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
  background: #000; color: #fff;
}
.panel.live .camera { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.panel.live .viewfinder { flex: 1; height: auto; min-height: 0; }
.panel.live .muted { color: #C9D1D7; }
.panel.live .camera-status { font-size: clamp(1.25rem, 5vw, 2rem); }
.panel.live .btn.secondary { border-color: #fff; color: #fff; }
.panel.live :focus-visible { outline-color: var(--tape); }

/* ---- results ---- */

.results:empty { display: none; }
.results > h2, .measurements > h2, .advice-head h2 {
  margin: 2.5rem 0 .75rem; padding-top: .875rem; border-top: 3px solid var(--ink); font-size: 1.875rem;
}
.results > .results-title { font-size: 2.25rem; }
.results > .results-title + * { margin-top: 0; }
.caveat { margin: .75rem 0; padding: .625rem .875rem; border-left: 6px solid var(--tape); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }

.media-list { display: grid; gap: 1.5rem; }
.media h3 { margin: 0 0 .5rem; font: 700 1.375rem/1.15 var(--font-display); font-stretch: condensed; }
.media-note { margin: 0 0 .5rem; font-size: .9375rem; }

.stage { position: relative; width: 100%; max-height: 72vh; margin: 0 auto; background: var(--stage); border-radius: 8px; overflow: hidden; }
.stage.empty { background: var(--bone-field); }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage video { object-fit: contain; }
.controls { display: flex; align-items: center; gap: .75rem; margin-top: .75rem; }
.controls .play { min-width: 6rem; }
.scrub { flex: 1; min-width: 0; height: var(--tap); margin: 0; accent-color: var(--ink); }
.clock { flex: none; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9375rem; }
.player .actions { margin-top: .75rem; }

.key-frames { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
.key-frames.single { grid-template-columns: minmax(0, 1fr); }
.key-frame { margin: 0; }
.key-frame img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--stage); }
.key-frame figcaption { margin-top: .25rem; color: var(--muted); font-size: .875rem; }

/* the readings: name and gloss, the value large, the target with a short piece of tape, and the status in words */
.readings { width: 100%; border-collapse: collapse; }
.readings thead th { padding: 0 .5rem .375rem 0; text-align: left; font-size: .875rem; font-weight: 650; color: var(--muted); border-bottom: 2px solid var(--ink); }
.readings tbody th, .readings td { padding: .75rem .5rem .75rem 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.readings tbody th { font-weight: 400; }
.reading-name { display: block; font-weight: 650; line-height: 1.3; }
.gloss { display: block; margin-top: .125rem; color: var(--muted); font-size: .8125rem; line-height: 1.35; }
.readings .value { font: 700 1.5rem/1.1 var(--font-display); font-stretch: condensed; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readings .target { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .9375rem; }
.readings th:last-child, .readings td:last-child { padding-right: 0; text-align: right; }
.readings tr.out .reading-name { font-weight: 750; }

.gauge {
  position: relative; display: block; width: 100%; min-width: 4.5rem; height: 10px; margin-top: .375rem;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 8px) var(--unit-bg);
  border-radius: 2px;
}
.gauge-slack, .gauge-target { position: absolute; top: 0; bottom: 0; }
.gauge-slack { background: color-mix(in srgb, var(--tape) 35%, transparent); }
.gauge-target { background: var(--tape); }
.gauge-value { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 1px; }

.status-tag {
  display: inline-block; min-width: 3.25rem; padding: .125rem .5rem; text-align: center;
  border: 2px solid var(--ink); border-radius: 999px; font-weight: 750; font-size: .9375rem;
}
.status-tag.low, .status-tag.high { background: var(--ink); color: var(--bg); }
.status-tag.info { border-color: var(--line); color: var(--muted); font-weight: 500; }

@media (max-width: 30rem) {
  .readings thead th:nth-child(3) { font-size: 0; }
  .readings thead th:nth-child(3)::after { content: "Target"; font-size: .875rem; }
  .readings .value { font-size: 1.3125rem; }
}

/* ---- suggestions ---- */

.advice-head { display: flex; justify-content: space-between; align-items: baseline; }
.advice-head h2 { flex: 1; }
.advice-head h2:focus { outline: none; }
.writing { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; color: var(--muted); font-weight: 600; }
.pulse { width: .625rem; height: .625rem; border-radius: 50%; background: var(--tape); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.builtin { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: 0 0 1rem; padding: .875rem 1rem; border: 2px solid var(--line); border-radius: var(--radius); }
.builtin p { margin: 0; flex: 1 1 16rem; }
.summary { margin: 0 0 1rem; max-width: 40em; font-size: 1.125rem; }

.suggestions { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.suggestion {
  counter-increment: step; position: relative; padding: 1rem 0 1.25rem 2.75rem; border-top: 1px solid var(--line);
}
.suggestion::before {
  content: counter(step); position: absolute; left: 0; top: .75rem;
  font: 800 2.25rem/1 var(--font-display); font-stretch: condensed; color: var(--ink);
}
.suggestion h3 { margin: 0 0 .5rem; font: 700 1.5rem/1.15 var(--font-display); font-stretch: condensed; }
.change-line {
  display: inline-block; margin: 0 0 .75rem; padding: .25rem .625rem; background: var(--tape); color: var(--tape-ink);
  border-radius: 4px; font: 700 1.25rem/1.25 var(--font-display); font-stretch: condensed; font-variant-numeric: tabular-nums;
}
.tag { display: inline-block; margin: 0 .5rem .5rem 0; padding: .125rem .625rem; border: 2px dashed var(--ink); border-radius: 999px; font-size: .875rem; font-weight: 650; }
.suggestion dl { margin: 0; max-width: 40em; }
.suggestion dt { font-weight: 700; }
.suggestion dd { margin: 0 0 .5rem; }
.cross-check, .needs { margin: .5rem 0 0; max-width: 40em; font-size: .9375rem; }
.needs { padding-left: .75rem; border-left: 4px solid var(--link); }

.notes { margin-top: 1.5rem; padding: .25rem 0 .25rem 1rem; border-left: 6px solid var(--line); color: var(--muted); }
.notes p { margin: .5rem 0; max-width: 40em; }

/* ---- history ---- */

.history-note { margin-bottom: 1rem; }
/* positioned, so the visually hidden text in its cells is clipped with it rather than widening the page */
.table-scroll { position: relative; overflow-x: auto; border-top: 3px solid var(--ink); }
.table-scroll:focus-visible { outline-offset: 4px; }
.history { border-collapse: collapse; min-width: 100%; }
.history th, .history td { padding: .625rem .875rem .625rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.history thead th { white-space: nowrap; font-size: .9375rem; vertical-align: bottom; }
.history thead th a { display: inline-flex; flex-direction: column; justify-content: flex-end; min-height: var(--tap); font-weight: 650; line-height: 1.3; }
.history thead th .time { font-weight: 400; }
.history tbody th { position: sticky; left: 0; z-index: 1; min-width: 7.5rem; max-width: 14rem; background: var(--bg); font-weight: 600; font-size: .9375rem; }
.history td { white-space: nowrap; }
.history-value { display: block; font: 700 1.375rem/1.1 var(--font-display); font-stretch: condensed; font-variant-numeric: tabular-nums; }
.change { display: block; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}
