/* TRI Momentum. Tokens copied from the 2 Nov 2026 blueprint screens. Light only, by design. */

/* Fonts ship with the app (public/fonts, SIL Open Font License), so no page asks another host for anything.
   Each family is one variable file per subset. The browser fetches the Latin Extended file only when a page uses one of its letters. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url(../fonts/dm-sans-latin-wght.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url(../fonts/dm-sans-latin-ext-wght.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/outfit-latin-wght.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/outfit-latin-ext-wght.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #182542;
  --muted: #566177;
  --label: #5b6578;
  --line: #d9dfe8;
  --line-soft: #eff1f4;
  --field: #aab5c6;
  --accent: #f8c44f;
  --accent-hover: #f6cf69;
  --accent-ink: #6b4d00;
  --accent-bg: #fff6df;
  --go: #116b43;
  --go-bg: #e8f6ee;
  --link: #0070a8;
  --info-bg: #eaf7fc;
  --pick: #92a4c6;
  --pick-bg: #eef2fb;
  --seg-bg: #eef0f4;
  --warn: #9a3412;
  --warn-bg: #fdeee6;
  --display: 'Outfit', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --r: 9px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 64px;
}
.top > * {
  min-width: 0;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.tri {
  display: flex;
  gap: 3px;
}
.tri b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 16px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--surface);
  font: 700 10px var(--display);
}
.word {
  font: 700 17px var(--display);
  letter-spacing: -0.2px;
}
/* The big wordmark on the front page. */
.mark.big {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.mark.big .tri {
  gap: 7px;
}
.mark.big .tri b {
  width: 39px;
  height: 24px;
  font-size: 18px;
}
.mark.big .word {
  font-size: 23px;
  line-height: 1.2;
}
.toplink,
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--body);
}
.back {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.racename {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h1,
h2,
.step p,
.sec p,
.carry li {
  overflow-wrap: anywhere;
}
h1 {
  margin: 0;
  font: 700 30px/1.1 var(--display);
  letter-spacing: -0.6px;
}
h1:focus {
  outline: none;
}
h2 {
  margin: 0;
  font: 600 18px/1.25 var(--display);
}
.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}
.label {
  margin: 0;
  color: var(--label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.15px;
  text-transform: uppercase;
}
.help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.center {
  text-align: center;
}
.stack {
  display: grid;
  gap: 16px;
}
.stack.tight {
  gap: 8px;
}
.row-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* an auto column grows to a native date or time control's own width */
  gap: 4px;
}

.progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.segs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.segs.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.parts b {
  color: var(--ink);
}
.seg {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.seg.done {
  background: var(--go);
}
.seg.now {
  background: var(--accent);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legname {
  margin: 0;
  font: 600 17px var(--display);
}

.field {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
}
.field input,
.field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--field);
  border-radius: var(--r);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  font: 16px var(--body);
}
/* iOS Safari gives date and time inputs their own width and centres the value. Take both back. */
.field input[type='date'],
.field input[type='time'] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}
.field input[type='date']::-webkit-date-and-time-value,
.field input[type='time']::-webkit-date-and-time-value {
  text-align: left;
}
.field input:disabled {
  background: var(--seg-bg);
  color: var(--muted);
}
.field input[aria-invalid='true'] {
  border-color: var(--warn);
  box-shadow: 0 0 0 1px var(--warn);
}
.row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.unit {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
/* On My products, an open "Other" box makes one cell taller. Keep the neighbour its own height. */
.product .two {
  align-items: start;
}
.two > *,
.three > * {
  min-width: 0;
}
.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.error {
  margin: 0;
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--go);
}
.tag {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  font: 700 12px var(--body);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: 600 14px var(--body);
  cursor: pointer;
}
.pill[aria-pressed='true'] {
  border-color: var(--pick);
  background: var(--pick-bg);
  color: var(--ink);
}
.segctl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--seg-bg);
}
.segbtn {
  min-height: 44px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--muted);
  font: 600 14px var(--body);
  cursor: pointer;
}
.segbtn[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(24, 37, 66, 0.15);
}
.opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font: 600 15px var(--body);
  cursor: pointer;
}
.opt span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}
.opt[aria-pressed='true'] {
  border-color: var(--pick);
  background: var(--pick-bg);
  box-shadow: 0 0 0 1px var(--pick);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 17px;
  border: 0;
  border-radius: var(--r);
  background: var(--accent);
  color: var(--ink);
  font: 700 15px var(--body);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  color: var(--ink);
  background: var(--accent-hover);
}
.btn.second {
  background: var(--seg-bg);
}
.btn.ghost {
  background: var(--surface);
  border: 1px solid var(--line);
}
.btn.small {
  min-height: 44px;
  width: auto;
  font-size: 14px;
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.actions .back {
  justify-content: center;
}

.info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: var(--r);
  background: var(--info-bg);
  padding: 12px 14px;
  font-size: 14px;
}
.info.warn {
  background: var(--accent-bg);
  color: var(--accent-ink);
}
.info p {
  margin: 0;
}
.info ul {
  margin: 0;
  padding-left: 18px;
}

.countdown {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  padding: 16px 18px;
}
.countdown .k {
  margin: 0;
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
}
.countdown .v {
  margin: 2px 0 0;
  font: 700 22px var(--display);
}
.countdown .n {
  margin: 0;
  max-width: 170px;
  color: #edf0f7;
  font-size: 13px;
  line-height: 1.4;
}

/* Pace targets (F5) */
.targets {
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  padding: 6px 18px 14px;
}
.leg {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.leg .n {
  color: #edf0f7;
  font-size: 14px;
  font-weight: 600;
}
.leg .t {
  font: 700 19px var(--display);
  font-variant-numeric: tabular-nums;
}
.leg .t small {
  display: block;
  font: 500 13px var(--body);
  color: #c7cede;
}
.leg .s {
  color: #c7cede;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.finish {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 12px;
}
.finish .k {
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
}
.finish .v {
  font: 700 30px var(--display);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
details.why {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
details.why summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
}
details.why ul {
  margin: 0;
  padding: 0 16px 12px 32px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
}
details.test summary {
  color: var(--link);
  font-size: 13px;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}
details.test p {
  margin: 4px 0 0;
}

/* Home: the four steps, on the front page and on the coming-back screen. They use the same tokens as the rail. */
.home .startmark {
  padding-top: 40px;
}
.home .lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}
.home .startmark + div h1 {
  font-size: 34px;
  letter-spacing: -0.8px;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  left: 41px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: var(--line);
}
.step {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.step .dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  font: 700 13px var(--body);
}
.step.goal {
  border-color: var(--info-bg);
  background: var(--info-bg);
}
.step.done .dot {
  border-color: var(--go);
  background: var(--go);
}
.step.now .dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}
.step.todo .dot {
  border-color: var(--field);
  background: var(--surface);
  color: var(--muted);
}
.step.goal.todo .dot {
  border-color: var(--link);
  background: var(--info-bg);
  color: var(--link);
}
.step p {
  margin: 0;
}
.step .t {
  font: 600 17px/1.25 var(--display);
}
.step .d {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}
.step a {
  min-height: 44px;
  min-width: 44px;
  justify-content: flex-end;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
}
/* The guides, at the bottom of the front page: plain links, so "Get started" stays the one yellow action. */
.guides {
  display: grid;
  gap: 2px;
}
.guides ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.guides .tag {
  align-self: center;
}
.guides a {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-height: 44px;
  padding: 4px 0;
  font-size: 15px;
  font-weight: 600;
}

/* The rail (9 Nov 2026) replaces the floating step bar: Race, Pacing, Nutrition and Race card, each a numbered circle.
   It stays in view as the page scrolls. Step 4 sits on the light blue with a link-blue ring until it is current. */
.rail {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(24, 37, 66, 0.12);
}
.rail::before {
  content: '';
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 25px;
  height: 2px;
  background: var(--line);
}
.rail .r {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  border-radius: 10px;
  color: var(--muted);
  font: 600 12px/1.2 var(--body);
  text-decoration: none;
  text-align: center;
}
.rail .c {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: 700 13px var(--body);
}
.rail .done .c {
  border-color: var(--go);
  background: var(--go);
  color: var(--surface);
}
.rail .goal {
  background: var(--info-bg);
}
.rail .goal .c {
  border-color: var(--link);
  color: var(--link);
}
.rail .now {
  color: var(--ink);
  font-weight: 700;
}
.rail .now .c {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}
.rail .now:not(.goal) {
  background: var(--bg);
}
.rail .now.goal {
  box-shadow: inset 0 0 0 2px var(--link);
}

/* Gel timing on the nutrition step (RD-031) */
.timing {
  gap: 8px;
}

/* Nutrition step (A2) */
.fromplan {
  border-radius: var(--r);
  background: var(--pick-bg);
  padding: 12px 14px;
  display: grid;
  gap: 2px;
}
.fromplan p {
  margin: 0;
}
.fromplan .stats {
  margin: 6px 0 2px;
}
.fromplan .stat {
  background: var(--surface);
}
.legplan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px 16px 8px;
}
.legplan header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px;
}
.badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  font: 700 13px var(--body);
  white-space: nowrap;
}
.carry {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 15px;
}

/* Products */
.product {
  display: grid;
  gap: 8px;
}
.product .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Race card (C1) */
.racecard {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.racecard .band {
  display: grid;
  gap: 14px;
  padding: 14px 18px 16px;
  background: var(--ink);
  color: #fff;
}
.racecard .band .toprow,
.racecard .band .who,
.racecard .band .count {
  display: flex;
  align-items: center;
  gap: 16px;
}
.racecard .band .toprow {
  justify-content: space-between;
  gap: 8px;
}
.racecard .band .k {
  margin: 0;
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
}
.racecard .band .editbtn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  margin: -10px -6px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--accent-hover);
  font: 700 14px var(--body);
  cursor: pointer;
}
.racecard .band .editbtn:hover {
  color: #fff;
}
.racecard .band .editbtn:focus-visible {
  outline-color: #fff;
}
.racecard .band .rule {
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}
.racecard .band .count {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4px 16px;
}
.racecard .band .count .v {
  margin: 0;
  font: 700 28px/1.1 var(--display);
}
.racecard .band .taper {
  display: grid;
  justify-items: end;
  gap: 0;
  margin-left: auto;
}
.racecard .band .taper .editbtn {
  margin: 0 -6px -10px;
}
.racecard .band .panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
}
.racecard .band .panel:focus {
  outline: 0;
}
.racecard .date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  padding-right: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
}
.racecard .date strong {
  font: 700 24px/1.1 var(--display);
}
.racecard .date span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 700;
}
.racecard h1 {
  font: 600 20px var(--display);
  letter-spacing: 0;
  color: #fff;
}
.racecard .band .bt {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}
.sec {
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 6px;
}
.sec:first-of-type {
  border-top: 0;
}
.sechead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}
.sechead a {
  min-height: 44px;
  min-width: 44px;
  justify-content: flex-end;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stat {
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--bg);
  display: grid;
}
.stat b {
  font: 700 16px var(--display);
  font-variant-numeric: tabular-nums;
}
.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.sec p {
  margin: 0;
  font-size: 15px;
}
/* Fuel on the race card: a notice, then one card per leg with each gel as a row (time, name, km). */
.notice {
  padding: 12px 14px;
  border-radius: var(--r);
  line-height: 1.4;
}
.sec p.notice.warn,
.mail p.notice.warn {
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 14px;
  font-weight: 700;
}
/* A link in a card line is a tap target of its own: at least 44 px high. */
.sec p.small a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
/* Email the race card (RD-039): a card under the race card, above Print. The result line is always in the page, empty
   until there is something to say, so a screen reader announces it when it fills. */
.mail p.notice.warn {
  margin: 0;
}
.mailnote {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}
.mailnote.ok {
  color: var(--go);
}
.mailnote.bad {
  color: var(--warn);
}
p.notice.go {
  margin: 0;
  background: var(--accent-bg);
  color: var(--accent-ink);
  font-size: 15px;
}
.tl {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.tl header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
}
.tl h3 {
  margin: 0;
  font: 700 18px var(--display);
}
.tl .tlline {
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 15px;
}
.tl .tlrow {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 16px;
}
.tl .tlrow b {
  font: 700 22px/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.tl .tlrow .km {
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}
/* Wrap at spaces only. The global "anywhere" rule on .sec p would break a word in the middle in a narrow card. */
.tl .tlline,
.tl .tlrow span {
  overflow-wrap: normal;
}
.tl .badge {
  background: var(--pick-bg);
  color: var(--ink);
}
.planhead {
  font: 700 24px/1.15 var(--display);
  letter-spacing: -0.4px;
}
/* A label on the left and its value on the right, as in "Your gut and sweat". */
.kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
}
.kv span:last-child {
  color: var(--muted);
  text-align: right;
}
.kv b {
  color: var(--ink);
}

/* Guides: an article with the tool inside it (F7) */
.article {
  display: grid;
  gap: 12px;
}
.article p {
  margin: 0;
}
.article h1 {
  font-size: 28px;
}
.draftnote {
  border-left: 3px solid var(--warn);
  background: var(--warn-bg);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.tool {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
  display: grid;
  gap: 12px;
}
.tool .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tool .free {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--go-bg);
  color: var(--go);
  font: 700 12px var(--body);
}
.result {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
}
.result .k {
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
}
.result .v {
  font: 700 24px var(--display);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.savebox {
  border-radius: 12px;
  background: var(--accent-bg);
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}
.savebox p {
  margin: 0;
}

.foot {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Print: only the top-tube card (RD-07-A2). About 7 cm wide, big type, high contrast. */
#print-root {
  display: none;
}
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }
  body {
    background: #fff;
  }
  .app,
  .noprint {
    display: none !important;
  }
  #print-root {
    display: block;
  }
  .tt {
    width: 70mm;
    border: 1.5px dashed #000;
    padding: 4mm;
    color: #000;
    font: 10.5pt/1.3 var(--body);
  }
  .tt h2 {
    font: 700 13pt var(--display);
    margin: 0 0 1mm;
  }
  .tt h3 {
    font: 700 10pt var(--body);
    text-transform: uppercase;
    letter-spacing: 0.5pt;
    margin: 3mm 0 1mm;
    border-bottom: 1px solid #000;
  }
  .tt p {
    margin: 0 0 1mm;
  }
  .tt .big {
    font: 700 14pt var(--display);
  }
  .tt .fine {
    font-size: 7.5pt;
    margin-top: 3mm;
  }
}

/* The rule between the product choice and the carry list inside the "Your nutrition" card. */
.divider { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; width: 100%; }
