/* Fonts, served from Revia's own origin so no font host sees the phone open the app (privacy P2,
   plan 2026-11-11-plan-privacy-fixes). Files and licences are in public/fonts. The blocks are Google Fonts'
   own, with local URLs, so nothing renders differently.
   Material Symbols Rounded (Apache 2.0) is a subset with only the sport glyphs the app uses, at opsz 24,
   wght 300, FILL 0, GRAD 0. A new glyph in src/ui/icons.ts needs the subset fetched again, with the new
   name added (test/fonts.test.ts checks the list):
   icon_names=directions_bike,directions_run,directions_walk,fitness_center,hiking,pool,route,self_improvement,speed,sports,sports_baseball,sports_basketball,sports_cricket,sports_football,sports_handball,sports_hockey,sports_rugby,sports_score,sports_soccer,sports_tennis,sports_volleyball,sprint,weekend */
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 300;
  font-display: block;
  src: url(fonts/material-symbols-rounded.woff2) format('woff2');
}
/* Newsreader, Atkinson Hyperlegible Next and Mono (SIL Open Font License 1.1). */
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-mono-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-mono-latin.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;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-mono-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-mono-latin.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;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin.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;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin.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;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin.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;
}
/* vietnamese */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/newsreader-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/newsreader-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/newsreader-latin.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;
}

/* Layout: one phone-width column, five tabbed screens, tab bar pinned to the bottom. */
/* Tokens: DESIGN.md 5.1. Dark is the default; light comes from the Appearance setting
   (data-theme on <html>) or, with "System", from the phone. */
:root {
  --bg: #0E1413; --surface: #151C1B; --raised: #1C2524; --sunk: #0A0F0E; --track: var(--raised);
  --pill: rgb(0 0 0 / 0.55); --pill-line: transparent;
  --line: #263130; --control: #64716E;
  --ink: #E7EDEA; --ink-2: #A3B1AD; --ink-3: #7D8B87;
  --accent: #86C3B5; --on-accent: #0E1413;
  --go: #93C9A2; --easy: #93B7DC; --hold: #DDB878; --rest: #B9A9DE; --ask: #86C3B5; --alert: #E3907C; --premium: #E2C25B;
  --go-soft: #27342E; --easy-soft: #273236; --hold-soft: #313228; --rest-soft: #2C3036; --ask-soft: #253331; --alert-soft: #322C29;
  --z1: #6F8FA6; --z2: #6FA7A0; --z3: #A9BF7E; --z4: #D9A86A; --z5: #D9806E;
  /* The route's pace and cadence ramp, low to high (plan 2026-11-09-plan-route-overlay; operator: "a more heatmap style
     color", "Same for both"): bright yellow to deep red, as in light. The red end is lifted so fast stretches read on the
     dark surface. */
  --route-1: #FFE891; --route-2: #FFCB66; --route-3: #FFAC45; --route-4: #FD8A2D; --route-5: #F16B30; --route-6: #DE5237; --route-7: #C5403C; --route-8: #AC2F39;
  --sleep-deep: #5F86AD; --sleep-light: #93B7DC;
  --tabbar: #151C1BEB;
  --hue-body: #7CC6B8; --hue-heart: #E8A3B4; --hue-sleep: #93AEE6; --hue-week: #E3B76C; --hue-why: #A8D08D; --hue-coach: #C3A8EA;
  --hue-body-soft: #283B37; --hue-heart-soft: #3B3437; --hue-sleep-soft: #2C3640; --hue-week-soft: #3A382A; --hue-why-soft: #2F3C30; --hue-coach-soft: #343540;
  /* Charts and section icons (plan 2026-11-10-plan-colour-consistency, option C, "As Load and recovery"): the gold and
     the teal of the Load and recovery card. These follow the theme through the hues; the past gold, the sports and
     the sleep stages have a value per theme. */
  --series-1: var(--hue-week); --series-2: var(--hue-body); --series-band: var(--hue-week-soft);
  --series-1-past: #C4A060;
  --cat-1: #E3B76C; --cat-2: #45B5A0; --cat-3: #8A9BF5; --cat-4: #E07F6A; --cat-5: #C58BE8; --cat-6: #9DB060;
  /* The verdict card's contour lines: neutral, one shade off its state fill (lighter in dark). Contrast where a
     line crosses a letter: DESIGN.md 5.1. */
  --wave: rgb(255 255 255 / 0.045);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F4F2EE; --surface: #FFFFFF; --raised: #FFFFFF; --sunk: #ECE9E3; --track: var(--sunk);
  --pill: rgb(255 255 255 / 0.85); --pill-line: var(--line);
  --line: #DDD8D0; --control: #8A8276;
  --ink: #18201E; --ink-2: #55615D; --ink-3: #65716D;
  --accent: #2F6F64; --on-accent: #FFFFFF;
  --go: #2F7350; --easy: #2F5F8A; --hold: #87580F; --rest: #5E4C94; --ask: #2F6F64; --alert: #A8432F; --premium: #9A7410;
  --go-soft: #E6EEEA; --easy-soft: #E6ECF1; --hold-soft: #F1EBE2; --rest-soft: #ECEAF2; --ask-soft: #E6EEEC; --alert-soft: #F5E8E6;
  --z1: #6A88A3; --z2: #4E8F86; --z3: #768F45; --z4: #B97D35; --z5: #BF5E49;
  /* The route ramp in light: golden yellow to deep red, lightness falling, so the hot end is the darkest on white. */
  --route-1: #D6AE03; --route-2: #CD9306; --route-3: #C37707; --route-4: #B85A03; --route-5: #AC3B03; --route-6: #9C1503; --route-7: #810010; --route-8: #620113;
  --tabbar: #FFFFFFEB;
  --hue-body: #2C6B60; --hue-heart: #A3405A; --hue-sleep: #3A5A9E; --hue-week: #8A5A12; --hue-why: #3F6E26; --hue-coach: #6249A0;
  --hue-body-soft: #E6EDEC; --hue-heart-soft: #F4E8EB; --hue-sleep-soft: #E7EBF3; --hue-week-soft: #F1EBE3; --hue-why-soft: #E8EEE5; --hue-coach-soft: #ECE9F4;
  --series-1-past: #9C7336;
  --cat-1: #8A5A12; --cat-2: #008A78; --cat-3: #4B5FC4; --cat-4: #B4472F; --cat-5: #8A4BB0; --cat-6: #5E7A1F;
  --sleep-deep: #2F5F8A; --sleep-light: #6A90B8;
  --wave: rgb(0 0 0 / 0.045);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #F4F2EE; --surface: #FFFFFF; --raised: #FFFFFF; --sunk: #ECE9E3; --track: var(--sunk);
    --pill: rgb(255 255 255 / 0.85); --pill-line: var(--line);
    --line: #DDD8D0; --control: #8A8276;
    --ink: #18201E; --ink-2: #55615D; --ink-3: #65716D;
    --accent: #2F6F64; --on-accent: #FFFFFF;
    --go: #2F7350; --easy: #2F5F8A; --hold: #87580F; --rest: #5E4C94; --ask: #2F6F64; --alert: #A8432F; --premium: #9A7410;
    --go-soft: #E6EEEA; --easy-soft: #E6ECF1; --hold-soft: #F1EBE2; --rest-soft: #ECEAF2; --ask-soft: #E6EEEC; --alert-soft: #F5E8E6;
    --z1: #6A88A3; --z2: #4E8F86; --z3: #768F45; --z4: #B97D35; --z5: #BF5E49;
    --route-1: #D6AE03; --route-2: #CD9306; --route-3: #C37707; --route-4: #B85A03; --route-5: #AC3B03; --route-6: #9C1503; --route-7: #810010; --route-8: #620113;
    --tabbar: #FFFFFFEB;
    --hue-body: #2C6B60; --hue-heart: #A3405A; --hue-sleep: #3A5A9E; --hue-week: #8A5A12; --hue-why: #3F6E26; --hue-coach: #6249A0;
    --hue-body-soft: #E6EDEC; --hue-heart-soft: #F4E8EB; --hue-sleep-soft: #E7EBF3; --hue-week-soft: #F1EBE3; --hue-why-soft: #E8EEE5; --hue-coach-soft: #ECE9F4;
    --series-1-past: #9C7336;
    --cat-1: #8A5A12; --cat-2: #008A78; --cat-3: #4B5FC4; --cat-4: #B4472F; --cat-5: #8A4BB0; --cat-6: #5E7A1F;
    --sleep-deep: #2F5F8A; --sleep-light: #6A90B8;
    --wave: rgb(0 0 0 / 0.045);
    color-scheme: light;
  }
}
:root {
  --f-display: "Newsreader", Georgia, serif;
  --f-body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --f-data: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
/* Base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
.app {
  max-width: 480px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: calc(12px + env(safe-area-inset-top, 0px)) calc(96px + env(safe-area-inset-bottom, 0px));
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui .chips { display: flex; flex-wrap: wrap; gap: 0 8px; }

/* ===== Screens and components (DESIGN.md 5 and 7), scoped under .ui. ===== */
.ui { font-size: 1rem; line-height: 1.5; display: grid; gap: 24px; }
.ui p { margin: 0; }
.ui .small { font-size: 0.875rem; line-height: 1.43; }
.ui .muted { color: var(--ink-2); }
.ui .faint { color: var(--ink-3); }
.ui .ic { flex: none; }
.ui .msr, .msr { font-family: "Material Symbols Rounded"; font-weight: 300; font-size: 22px; line-height: 1; font-variation-settings: "opsz" 24, "wght" 300, "FILL" 0; display: inline-block; flex: none; -webkit-font-smoothing: antialiased; }
.ui .tone-go { color: var(--go); } .ui .tone-easy { color: var(--easy); } .ui .tone-hold { color: var(--hold); }
.ui .tone-rest { color: var(--rest); } .ui .tone-ask { color: var(--ask); } .ui .tone-alert { color: var(--alert); } .ui .tone-done { color: var(--go); }
.ui .int-z1 { color: var(--z1); } .ui .int-z2 { color: var(--z2); } .ui .int-z3 { color: var(--z3); } .ui .int-z4 { color: var(--z4); } .ui .int-z5 { color: var(--z5); } .ui .int-rest { color: var(--rest); }

/* Header: date or title, sync line, Ask */
.ui .screen-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ui .head-text { display: grid; gap: 2px; min-width: 0; }
.ui .head-actions { display: flex; gap: 8px; flex: none; }
/* Garmin's required credit (API Brand Guidelines): plain text, no logo. */
.ui .garmin-src { margin: 0; font-family: var(--f-data); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.ui .derived { margin: 0; font-size: 0.75rem; line-height: 1.4; color: var(--ink-3); }
.ui .date { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.ui .title { font-family: var(--f-body); font-size: 1.25rem; line-height: 1.3; font-weight: 700; margin: 0; }
.ui .display { font-family: var(--f-display); font-weight: 500; font-size: 1.875rem; line-height: 1.2; letter-spacing: -0.01em; margin: -8px 0 0; text-wrap: balance; font-optical-sizing: auto; }
.ui .headline-note { margin: -4px 0 0; font-size: 1rem; line-height: 1.45; color: var(--ink-2); }
.ui .sync { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--ink-3); }
.ui .sync.tone-hold { color: var(--hold); } .ui .sync.tone-alert { color: var(--alert); }
.ui .quiet-link, .ui .link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.ask-btn, .ui .icon-circle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink); font-weight: 700; font-size: 0.875rem; }
.ask-btn .ic { color: var(--accent); }
.ask-btn:disabled { opacity: 0.45; cursor: default; }
.ui .icon-btn { background: none; border: 0; color: var(--ink-2); width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 10px; flex: none; }

/* Buttons */
.ui .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 10px; font-family: var(--f-body); font-size: 1rem; font-weight: 700; border: 1px solid transparent; }
.ui .btn-primary { background: var(--accent); color: var(--on-accent); }
.ui .btn-secondary { background: transparent; color: var(--ink); border-color: var(--control); }
.ui .btn-secondary .ic { color: var(--accent); }
.ui .btn-quiet { background: none; color: var(--accent); padding: 0; min-height: 44px; justify-self: start; }
.ui .btn-wide { width: 100%; }
.ui .btn.chosen { border-color: var(--accent); color: var(--accent); background: var(--ask-soft); }

/* Verdict panel and inline question */
.ui .verdict { border-radius: 16px; padding: 20px; display: grid; gap: 10px; justify-items: start; }
.ui .verdict.tone-go { background: var(--go-soft); } .ui .verdict.tone-easy { background: var(--easy-soft); }
.ui .verdict.tone-hold { background: var(--hold-soft); } .ui .verdict.tone-rest { background: var(--rest-soft); }
.ui .verdict.tone-ask { background: var(--ask-soft); } .ui .verdict.tone-done { background: var(--go-soft); }
.ui .verdict-state { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 700; }
.ui .verdict.tone-go .verdict-state { color: var(--go); } .ui .verdict.tone-easy .verdict-state { color: var(--easy); }
.ui .verdict.tone-hold .verdict-state { color: var(--hold); } .ui .verdict.tone-rest .verdict-state { color: var(--rest); }
.ui .verdict.tone-ask .verdict-state { color: var(--ask); } .ui .verdict.tone-done .verdict-state { color: var(--go); }
/* Done, but not as planned: the hold tint, so it reads as "different", not as a miss. */
.ui .verdict.tone-done.differs { background: var(--hold-soft); } .ui .verdict.tone-done.differs .verdict-state { color: var(--hold); }
.ui .verdict-differs { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--hold) 30%, transparent); width: 100%; }
.ui .verdict-differs p { margin: 0; display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; font-size: 0.9375rem; color: var(--ink); }
.ui .verdict-differs p > svg { flex: none; margin-top: 3px; color: var(--hold); }
.ui .verdict-differs .verdict-note, .ui .verdict-differs .sync { color: var(--ink-2); }
.ui .verdict-differs .verdict-note > svg { color: var(--ink-3); }
.ui .verdict-session { font-size: 1.0625rem; font-weight: 700; line-height: 1.4; color: var(--ink); }
/* The check-in's reason, over its question, while the stall is open. */
.ui .verdict-lead { margin: 0; color: var(--ink-2); }
/* The eased panel under the verdict: the hold tint (rest for an illness rung), one summary row, its parts open. */
.ui .eased { border-radius: 16px; padding: 0 16px; background: var(--hold-soft); color: var(--ink); }
.ui .eased.tone-rest { background: var(--rest-soft); }
.ui .eased > .summary-row { border: 0; }
.ui .eased-body { display: grid; gap: 12px; padding: 0 0 16px; }
.ui .eased-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ui .eased-rows > li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
.ui .eased-rows > li > .ic { flex: none; margin-top: 2px; color: var(--ink-2); }
.ui .eased-rows > .eased-signs { flex-wrap: wrap; gap: 6px; }
/* A sign, in the app's own words: sentence case on the panel's raised surface, not a caps tag. */
.ui .eased-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--raised); color: var(--ink-2); font-size: 0.875rem; line-height: 1.35; }
.ui .eased-chip > .ic { flex: none; }
.ui .eased-payoff { display: grid; gap: 6px; margin: 0; }
.ui .eased-payoff > p { margin: 0; }
.ui .verdict-details { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.875rem; color: var(--ink-2); }
.ui .verdict-details span { display: inline-flex; align-items: center; gap: 6px; }
.ui .verdict .btn { min-height: 44px; font-size: 0.875rem; }
/* The done card's activity and its figures (plan 2026-11-19-plan-done-card-figures): label over value, wrapping at
   360 px. Plain ink, no tone: the state line and the match line stay the card's only verdict. */
.ui .verdict-act { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--ink-2); }
.ui .verdict-act .msr { font-size: 18px; }
.ui .verdict-figs { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 2px 0 0; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); width: 100%; }
.ui .verdict-figs div { display: grid; gap: 2px; }
.ui .verdict-figs dt { font-family: var(--f-data); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.ui .verdict-figs dd { margin: 0; font-family: var(--f-data); font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.ui .verdict-figs dd small { margin-left: 2px; font-size: 0.75rem; font-weight: 500; color: var(--ink-2); }
/* Four figures need about 305 px; under a 400 px screen the card has less, so they go two by two, not three and one. */
@media (max-width: 399px) { .ui .verdict-figs:has(> :nth-child(4)) { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 40px; } }
/* See details is sized to its words, as the brief's button (8be7603). */
.ui .verdict.tone-done .btn { min-height: 44px; padding: 0 16px; font-size: 0.9375rem; }
.ui .answers { display: grid; gap: 8px; width: 100%; }

/* Sections, reasons, tags */
/* One panel per section (DESIGN.md 5.7). The answer above stays open on the page. */
.ui .block { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.ui .block .block { background: none; border: 0; border-radius: 0; padding: 0; }
.ui .ai-mark { display: inline-flex; flex: none; color: var(--hue-coach); vertical-align: -2px; }
.ui .sec-h .ai-mark { margin-left: -4px; }
.ui .bubble .ai-mark { margin-right: 6px; }
.ui .proposal-label .ai-mark { margin-left: 6px; }
.ui .ai-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 0.8125rem; line-height: 1.45; color: var(--ink-2); }
.ui .ai-note .ai-mark { margin-top: 2px; }
.ui .sec-h { display: flex; align-items: center; gap: 10px; font-family: var(--f-body); font-size: 1.0625rem; font-weight: 700; line-height: 1.4; margin: 0; }
.ui .sec-h > .ic { color: var(--accent); }
/* Every section icon is the gold on its warm tile, as Load and recovery (operator 2026-11-10, reversing 5.7's hues). */
.ui .sec-h .sec-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--series-band); color: var(--series-1); }
.ui .sec-h .sec-ic .msr { font-size: 18px; color: inherit; }
/* The gold shield on a premium feature (operator 2026-11-01): offset off the icon's top right, ringed in the surface. */
.ui .sec-h .sec-ic, .ask-btn { position: relative; }
.premium-badge { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--premium); color: var(--surface); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
/* The shield is always the surface colour on gold: svg.ic outranks any parent's `.x .ic` colour (a button, a row). */
.premium-badge > svg.ic, .ui .premium-badge > svg.ic { color: var(--surface); stroke-width: 2.5; }
.ask-btn .premium-badge { top: -4px; right: -4px; }
/* On a titled card: the card's top right corner, offset out, ringed in the page colour (operator 2026-11-02). */
.ui :is(.block, .panel):has(> .sec-h > .premium-badge, > .sec-row > .sec-h > .premium-badge) { position: relative; }
.ui .sec-h > .premium-badge { top: -7px; right: -7px; width: 20px; height: 20px; box-shadow: 0 0 0 3px var(--bg); }
.ui .sec-h > .premium-badge > svg.ic { width: 12px; height: 12px; }
.ui .plan-shield { display: inline-flex; color: var(--premium); }
.ui .hue-body { --hue: var(--hue-body); --hue-soft: var(--hue-body-soft); }
.ui .hue-heart { --hue: var(--hue-heart); --hue-soft: var(--hue-heart-soft); }
.ui .hue-sleep { --hue: var(--hue-sleep); --hue-soft: var(--hue-sleep-soft); }
.ui .hue-week { --hue: var(--hue-week); --hue-soft: var(--hue-week-soft); }
.ui .hue-why { --hue: var(--hue-why); --hue-soft: var(--hue-why-soft); }
.ui .hue-coach { --hue: var(--hue-coach); --hue-soft: var(--hue-coach-soft); }
.ui .tint { color: var(--hue); }
.ui .hue-alert { --hue: var(--alert); }
.ui .reasons { gap: 10px; }
.ui .reason { display: flex; gap: 10px; align-items: flex-start; }
.ui .reason .ic { margin-top: 3px; color: var(--ink-2); }
.ui .reason[class] { color: var(--ink); }
.ui .reason.tone-go .ic { color: var(--go); } .ui .reason.tone-hold .ic { color: var(--hold); } .ui .reason.tone-alert .ic { color: var(--alert); }
/* A reason that counts against today (short sleep, HRV below range) reads as a caution, not a fact. */
.ui .reasons .reason.tone-hold { box-shadow: inset 3px 0 0 var(--hold); padding-left: 12px; }
.ui .from-history { display: grid; gap: 6px; justify-items: start; padding-top: 4px; }
.ui .tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-data); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--sunk); color: var(--ink-2); vertical-align: 2px; margin-left: 8px; }
.ui .from-history .tag, .ui .tags .tag { margin-left: 0; }
.ui .tag.tone-go { color: var(--go); } .ui .tag.tone-hold { color: var(--hold); } .ui .tag.tone-race { color: var(--z4); } .ui .tag.tone-long { color: var(--z3); }

/* Strips and notes */
.ui .strip, .ui .note { display: flex; gap: 10px; align-items: center; padding: 10px 6px 10px 14px; border-radius: 12px; font-size: 0.875rem; }
.ui .strip > span, .ui .note > div { flex: 1; }
.ui .strip.tone-rest { background: var(--rest-soft); color: var(--ink); } .ui .strip.tone-rest > .ic { color: var(--rest); }
.ui .strip.tone-hold { background: var(--hold-soft); color: var(--ink); } .ui .strip.tone-hold > .ic { color: var(--hold); }
.ui .strip.tone-go { background: var(--go-soft); color: var(--ink); } .ui .strip.tone-go > .ic { color: var(--go); }
.ui .strip.tone-alert { background: var(--alert-soft); color: var(--ink); } .ui .strip.tone-alert > .ic { color: var(--alert); }
.ui .note { background: var(--surface); border: 1px solid var(--line); align-items: flex-start; }
.ui .note > .ic { color: var(--accent); margin-top: 2px; }
.ui .note p { color: var(--ink-2); }

/* Checks and range bar */
.ui .checks { display: grid; }
.ui .check-row { all: unset; box-sizing: border-box; display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; width: 100%; }
.ui .check-row:first-child { border-top: 0; padding-top: 0; }
.ui .check-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ui .check-top { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 0.8125rem; }
.ui .check-label { flex: 1; }
.ui .status { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-3); }
.ui .status.tone-go { color: var(--go); } .ui .status.tone-alert { color: var(--alert); } .ui .status.tone-hold { color: var(--hold); }
.ui .check-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ui .stat-s { font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.ui .stat-l { font-variant-numeric: tabular-nums; font-size: 1.75rem; font-weight: 500; line-height: 1.15; white-space: nowrap; }
.ui .stat-s small, .ui .stat-l small { font-size: 0.8125rem; color: var(--ink-2); margin-left: 3px; font-weight: 400; }
.ui .range { width: 150px; flex: none; }
.ui .range-track { position: relative; height: 6px; border-radius: 3px; background: var(--track); }
.ui .range-band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--go) 40%, transparent); border-radius: 3px; }
.ui .range-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.ui .range-dot.out { background: var(--alert); }
.ui .range-ends { position: relative; height: 14px; margin-top: 4px; font-family: var(--f-data); font-size: 0.6875rem; color: var(--ink-3); }
.ui .range-ends span { position: absolute; transform: translateX(-50%); }

/* Summary rows (folded sections, Ask your coach) */
.ui .summary-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; width: 100%; min-height: 44px; }
.ui .summary-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui .summary-row > .ic:first-child { color: var(--ink-2); }
/* An open summary row points its chevron up, as the kind toggle does; only expandable rows carry aria-expanded. */
.ui .summary-row[aria-expanded="true"] > .ic:last-child { transform: rotate(180deg); }
.ui .ask-row > .ic:first-child { color: var(--accent); }
/* The schedule panel on Today (plan 2026-11-09-plan-today-schedule-panel): one neutral panel. The eased status is its
   tinted top band, edge to edge; then the reasons; then Up next, under a hairline, with a rest line above it. */
.ui .sched { padding: 0; gap: 0; overflow: hidden; }
.ui .sched > .eased { border-radius: 0; }
.ui .sched > .sched-notes { display: grid; padding: 16px; }
.ui .sched > .next-group { border-top: 1px solid var(--line); }
.ui .sched > .next-group:first-child, .ui .sched > .eased + .next-group { border-top: 0; }
.ui .next-rest { display: flex; gap: 12px; align-items: center; margin: 0; padding: 14px 16px 0; color: var(--ink); }
.ui .next-row { margin: 0; padding: 14px 16px; border: 0; }
.ui .next-rest + .next-row { padding-top: 4px; }
.ui .next-rest > .next-ic, .ui .next-row > .next-ic { display: grid; place-items: center; width: 24px; }
.ui .summary-text { flex: 1; display: grid; gap: 2px; }
.ui .summary-text b { font-weight: 500; }
.ui .summary-text small { font-size: 0.875rem; color: var(--ink-2); }
.ui .watch-note { padding-top: 4px; }

/* Stats and sleep stages */
.ui .stats { display: flex; gap: 40px; }
.ui .stat { display: grid; gap: 2px; }
.ui .caption { font-size: 0.8125rem; color: var(--ink-2); }
.ui .stages { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.ui .stages span, .ui .stage-legend i { background: var(--ink-3); }
.ui .st-deep { background: var(--sleep-deep) !important; } .ui .st-light { background: var(--sleep-light) !important; }
.ui .st-rem { background: var(--accent) !important; } .ui .st-awake { background: var(--control) !important; }
.ui .stage-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: 0.8125rem; color: var(--ink-2); }
.ui .stage-legend span { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; }
.ui .stage-legend i { width: 8px; height: 8px; border-radius: 50%; }
.ui .stage-legend b { grid-column: 1 / -1; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
/* Each stage against the athlete's usual (Last night): laid out like a check row, the band in the stage's colour. */
.ui .stage-vs { list-style: none; margin: 0; padding: 0; display: grid; }
.ui .stage-vs li { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.ui .stage-vs li:first-child { border-top: 0; padding-top: 2px; }
.ui .sv-top { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--ink-2); }
.ui .sv-top i { width: 8px; height: 8px; border-radius: 50%; }
.ui .sv-mark { margin-left: auto; }
.ui .sv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ui .sv-bottom b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui .sv-bottom .range { flex: 0 1 55%; }
.ui .sv-deep .range-band { background: color-mix(in srgb, var(--sleep-deep) 50%, transparent); }
.ui .sv-light .range-band { background: color-mix(in srgb, var(--sleep-light) 50%, transparent); }
.ui .sv-rem .range-band { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.ui .sv-awake .range-band { background: color-mix(in srgb, var(--control) 70%, transparent); }

/* Week strip */
.ui .week { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.ui .hard-count { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.ui .hard-count > .ic { color: var(--z4); }
.ui .hard-count > .msr { font-size: 16px; }
.ui .hard-count.tone-rest > .msr { color: var(--rest); }
.ui .segs { display: inline-flex; gap: 4px; margin-left: 8px; }
.ui .segs i { width: 28px; height: 4px; border-radius: 2px; background: var(--raised); }
.ui .segs i.on { background: var(--accent); }
.ui .hard-count .segs i.on { background: var(--z4); }
.ui .week-days { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.ui .week-day { display: grid; grid-template-columns: 64px 28px 1fr; gap: 12px; align-items: start; padding: 12px 12px 12px 0; border-top: 1px solid var(--line); }
.ui .week-day.today { background: var(--raised); box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; margin-left: -12px; border-radius: 0 10px 10px 0; border-top-color: transparent; }
.ui .wd { display: grid; line-height: 1.2; }
.ui .wd b { font-size: 0.8125rem; font-weight: 500; }
.ui .wd small { font-family: var(--f-data); font-size: 0.6875rem; color: var(--ink-3); letter-spacing: 0.04em; }
.ui .wk-ic { display: grid; place-items: center; height: 24px; }
.ui .wk-body { display: grid; gap: 2px; }
.ui .wk-body small { font-size: 0.875rem; color: var(--ink-2); }
.ui .wk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ui .wk-tags .tag { margin-left: 0; vertical-align: baseline; }
.ui .week-day.rest .wk-body > span { color: var(--ink-2); }
.ui .week-day.has-why { display: block; padding: 0; }
.ui .week-day.today.has-why { padding-left: 12px; }
.ui .wk-row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 64px 28px 1fr 18px; gap: 12px; align-items: start; width: 100%; min-height: 44px; padding: 12px 12px 12px 0; cursor: pointer; }
.ui .wk-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ui .wk-chev { color: var(--ink-3); padding-top: 2px; }
.ui .wk-body .wk-why { color: var(--ink); margin-top: 4px; line-height: 1.4; }
/* A session's structure (contract: session-how), in a panel a step deeper than what it sits on (operator, 2026-11-04):
   the card's own tone on Today's card, the accent in a week day. */
.ui .verdict.tone-go, .ui .verdict.tone-done { --how: var(--go); } .ui .verdict.tone-easy { --how: var(--easy); }
.ui .verdict.tone-hold { --how: var(--hold); } .ui .verdict.tone-rest { --how: var(--rest); } .ui .verdict.tone-ask { --how: var(--ask); }
.ui .how { justify-self: stretch; margin: 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--how, var(--accent)) 16%, transparent); font-size: 0.875rem; line-height: 1.5; color: var(--ink); }
.ui .wk-how { display: grid; gap: 8px; padding: 0 12px 12px 60px; }
.ui .wk-how .ready-more { justify-self: start; width: auto; text-align: left; }
/* Into the card's padding a little, so "Quality" has room inside its tile on a 360 px phone. */
.ui .week-glance { list-style: none; margin: 4px -8px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.ui .wg-day { all: unset; box-sizing: border-box; width: 100%; display: grid; justify-items: center; gap: 4px; padding: 8px 2px; border-radius: 10px; background: var(--raised); cursor: pointer; text-align: center; }
.ui .wg-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui .wg-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.ui .wg-day b { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.ui .wg-day.today b { color: var(--accent); }
.ui .wg-ic { display: grid; place-items: center; height: 24px; }
.ui .wg-day small { font-size: 0.65rem; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.ui .wg-day.rest small { color: var(--ink-2); }
.ui .week-summary { margin: 0; font-size: 0.9375rem; line-height: 1.45; }
.ui .stands-out { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ui .stands-out li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.875rem; color: var(--ink-2); }
.ui .stands-out .ic { flex: none; margin-top: 2px; }
.ui .verdict-why { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 0.875rem; line-height: 1.4; color: var(--ink-2); }
.ui .verdict-why .ic { flex: none; margin-top: 2px; }

/* Session rows */
.ui .session-row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 40px 1fr auto 16px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; width: 100%; }
.ui .session-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui .tile { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; color: var(--ink-2); }
.ui .session-body { display: grid; gap: 2px; min-width: 0; }
.ui .session-body b { font-weight: 500; }
.ui .session-body small { font-size: 0.875rem; color: var(--ink-2); }
.ui .tags { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.ui .session-row > .ic { color: var(--ink-3); }

/* Panels, empty states */
.ui .panel { background: var(--surface); border-radius: 16px; padding: 16px; display: grid; gap: 14px; }
.ui .need { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px 10px; align-items: center; }
.ui .need small { font-size: 0.875rem; color: var(--ink-2); }
.ui .need .bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.ui .need .bar i { display: block; height: 100%; background: var(--accent); }
/* The one no-data state: centred in the space the chart or list would take (operator, 2026-10-29). */
.ui .empty { display: grid; gap: 12px; justify-items: center; align-content: center; text-align: center; min-height: 140px; padding: 16px 8px; color: var(--ink-2); }
.ui .empty p { margin: 0; max-width: 32ch; }
.ui .ready-waiting { text-align: center; } .ui .ready-waiting .ready-top { justify-content: center; flex-direction: column; align-items: center; gap: 2px; }

/* Tab bar */
nav.ui-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--tabbar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
nav.ui-tabs .tabs-inner { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
nav.ui-tabs button { background: none; border: 0; padding: 10px 2px 12px; min-height: 56px; display: grid; justify-items: center; gap: 4px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); position: relative; }
nav.ui-tabs button[aria-selected="true"] { color: var(--accent); font-weight: 700; }
/* A new version is ready (plan 2026-11-11-plan-update-refresh): fixed just above the tab bar, so it moves nothing on
   the page and takes no focus. */
.update-bar { position: fixed; z-index: 6; left: 12px; right: 12px; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); max-width: 456px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); box-shadow: 0 6px 20px rgb(0 0 0 / 0.28); font-family: var(--f-body); color: var(--ink); }
.update-bar p { flex: 1; margin: 0; font-size: 0.875rem; line-height: 1.35; }
.update-bar .btn { flex: none; min-height: 36px; padding: 6px 14px; }
.update-bar .icon-btn { flex: none; }
.update-bar.must { border-color: var(--alert); }
/* While a banner shows, the page scrolls clear of it. */
body.has-update .app { padding-bottom: calc(164px + env(safe-area-inset-bottom, 0px)); }
nav.ui-tabs button[aria-selected="true"]::before { content: ""; position: absolute; top: -1px; width: 28px; height: 2px; background: var(--accent); border-radius: 1px; }

/* Bottom sheet */
.sheet-host .scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.5); z-index: 20; }
.sheet-host .sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 90vh; overflow: auto; background: var(--raised); border-radius: 24px 24px 0 0; padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 24px rgb(0 0 0 / 0.4); max-width: 480px; margin: 0 auto; }
.sheet-host .grab { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--control); margin: 4px auto 8px; }
.sheet-host header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-host header h2 { font-family: var(--f-body); font-size: 1.125rem; font-weight: 700; margin: 0; }
.sheet-host .sheet-body { display: grid; gap: 12px; padding-top: 8px; }
.sheet-host .icon-btn { background: none; border: 0; color: var(--ink-2); width: 44px; height: 44px; display: inline-grid; place-items: center; }

@media (prefers-reduced-motion: no-preference) {
  .sheet-host .sheet { animation: sheet-in 280ms cubic-bezier(0.2, 0, 0, 1); }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
}

/* Ask sheet (DESIGN.md 6) and shared bits used inside sheets */
.sheet-host .sheet-body.ui { gap: 16px; }
.ui .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ui .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--control); background: transparent; color: var(--ink); font-size: 0.875rem; margin-block: 4px; }
.ui label.chip { cursor: pointer; }
.ui label.chip input { position: absolute; opacity: 0; pointer-events: none; }
.ui label.chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui .chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* The long days' pills (operator, 2026-11-13): radios drawn as these chips; the fill and tick follow the checked one. */
.ui .pill-group { border: 0; margin: 0; padding: 0; min-width: 0; }
/* Patterns' Still learning rows (W4): plain lines, one per detector still waiting for data. */
.ui .learning { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
/* The session page's reps (W3): one plain row each, rep and pace on a line, the end reading under them. */
.ui .rep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ui .rep-list li { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.ui .rep-list li small { flex-basis: 100%; color: var(--ink-2); }
/* The Your week sheet's picks, redrawn as days are ticked: spaced as the sheet form's own rows are. */
.ui .week-picks { display: grid; gap: 14px; min-width: 0; }
/* The sheet form's own gap, so the label sits as far from its pills as Quality sessions does. */
.ui .pill-group legend { padding: 0; margin-bottom: 14px; }
.ui .chip.pill { cursor: pointer; }
.ui .chip.pill .pill-tick { display: none; }
.ui .chip.pill:has(> input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ui .chip.pill:has(> input:checked) .pill-tick { display: inline-flex; }
.ui .field-error { display: flex; align-items: flex-start; gap: 6px; font-size: 0.875rem; color: var(--alert); }
.ui .field-error .ic { margin-top: 2px; }
.ui .ask { display: grid; gap: 16px; }
.ui .ask-context { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--sunk); font-size: 0.875rem; color: var(--ink-2); }
.ui .ask-context .ic { color: var(--accent); }
.ui .thread { display: grid; gap: 10px; }
.ui .bubble { max-width: 85%; padding: 12px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ui .bubble.coach { background: var(--surface); justify-self: start; border-bottom-left-radius: 4px; }
.ui .bubble.you { background: var(--ask-soft); justify-self: end; border-bottom-right-radius: 4px; }
.ui .quick { display: flex; flex-wrap: wrap; gap: 0 8px; }
.ui .noted { display: flex; align-items: flex-start; gap: 6px; margin: -2px 0 0 4px; font-size: 0.8125rem; color: var(--ink-3); justify-self: start; }
.ui .noted .ic { color: var(--accent); flex: none; margin-top: 2px; }
.ui .coach-notes { display: grid; gap: 8px; margin-top: 24px; }
.ui .coach-notes .group-title { margin: 0; }
.ui .group-note { margin: 0; }
.ui .illness-list:not(:empty) { margin: 12px 0 20px; }
.ui .coach-notes ul, .ui .illness-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ui .coach-notes li, .ui .illness-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0 8px 12px; background: var(--surface); border-radius: 12px; }
.ui .coach-notes li > span, .ui .illness-list li > span { flex: 1; display: grid; gap: 2px; font-size: 0.875rem; }
.ui .coach-notes li small, .ui .illness-list li small { font-size: 0.75rem; }
.ui .proposal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 8px; }
.ui .proposal.settled { opacity: 0.85; }
.ui .proposal-label { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--ink-2); }
.ui .proposal-label .ic { color: var(--accent); }
.ui .proposal-summary { font-weight: 700; }
.ui .warnings { list-style: none; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--alert-soft); display: grid; gap: 6px; font-size: 0.875rem; }
.ui .warnings li { display: flex; gap: 8px; align-items: flex-start; }
.ui .warnings .ic { color: var(--alert); margin-top: 2px; }
.ui .card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 4px; }
.ui .card-result { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 500; }
.ui .ask-input { display: flex; gap: 8px; align-items: center; }
.ui .ask-input input { flex: 1; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.ui .ask-input input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ui .send { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.ui .send.stop { background: var(--raised); color: var(--ink); border: 1px solid var(--control); }
.ui .ask-foot { display: grid; gap: 4px; }
.ui .ask-foot .ask-end { justify-self: start; color: var(--ink-2); font-weight: 500; }
.ui .ask-fail { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ui .ask-fail .link { flex: none; }

/* Segmented control, charts, legends, tables (DESIGN.md 7 and 9) */
.ui .seg-wrap { position: relative; margin: 0 -20px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.ui .seg-wrap::-webkit-scrollbar { display: none; }
/* The track is --track, as the chart's view toggle: raised in dark, sunk in light, where raised is the surface's white
   and the selected pill vanished into it (operator, 2026-11-09). */
.ui .seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--track); white-space: nowrap; margin-right: 40px; }
.ui .seg button { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: 0.875rem; color: var(--ink-2); cursor: pointer; }
.ui .seg button .msr { font-size: 18px; }
.ui .seg button[aria-selected="true"] { background: var(--surface); color: var(--accent); font-weight: 700; }
.ui .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Today's tabs (operator 2026-11-02): the panel keeps the screen's own spacing. */
.ui .today-view { display: grid; gap: 24px; }
.ui .key { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.ui .key .stat-l { font-size: 2rem; }
.ui .chart { width: 100%; height: auto; display: block; overflow: visible; }
.ui .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8125rem; color: var(--ink-2); }
.ui .legend span { display: inline-flex; align-items: center; gap: 6px; }
.ui .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ui .legend .msr { font-size: 16px; }
.ui .legend .hard { color: var(--ink-2); } .ui .legend .hard .ic { color: var(--z4); }
.ui .legend i.dash { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--ink-2); }
/* Keys for a chart's round marks: a filled dot, and a ring that is empty inside. */
.ui .legend i.dot { width: 8px; height: 8px; border-radius: 50%; }
.ui .legend i.ring { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid; background: transparent; }
.ui .legend i.tri { width: 9px; height: 8px; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ui .hrv-weeks-fig { margin: 8px 0 4px; display: grid; gap: 8px; }
.ui .tablewrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.ui table { width: 100%; min-width: 340px; border-collapse: collapse; font-family: var(--f-data); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.ui th { text-align: right; font-weight: 500; font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ui td { text-align: right; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
/* The laps table fits a 360 px phone with HR in view: its few short columns need no 340 px floor. The splits table keeps it, as its pace bars need the room. */
.ui table.laps { min-width: 0; }
.ui .splits .sb-h, .ui .splits .sb-c { width: 38%; text-align: center; padding-left: 14px; }
.ui .splits .sb-h { display: table-cell; }
.ui .splits .sb-h span { display: inline-block; width: 50%; }
.ui .splits .sb-h span:first-child { text-align: left; }
.ui .splits .sb-h span:last-child { text-align: right; }
.ui .sb { position: relative; display: block; height: 10px; }
.ui .sb::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--ink-3); }
.ui .sb i { position: absolute; top: 0; height: 10px; border-radius: 3px; }
/* Slower grows left of the average line, faster right (operator, 2026-11-09). */
.ui .sb i.fast { left: 50%; background: var(--go); }
.ui .sb i.slow { right: 50%; background: var(--easy); }
.ui .lead { margin: 0 0 4px; font-size: 1.0625rem; line-height: 1.4; color: var(--ink); }
.ui .sub-h { margin: 18px 0 6px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.ui .metrics { display: grid; gap: 14px; margin-top: 16px; }
.ui .metric-top { display: flex; justify-content: space-between; align-items: baseline; }
.ui .metric-top b { font-family: var(--f-data); font-weight: 500; }
.ui .metric p { margin: 4px 0 0; }
.ui .spread { position: relative; height: 14px; margin: 6px 7px 0; background: linear-gradient(var(--line), var(--line)) 0 50% / 100% 2px no-repeat; }
.ui .spread-range { position: absolute; top: 4px; height: 6px; border-radius: 3px; background: var(--control); }
.ui .spread-usual { position: absolute; top: 0; width: 2px; height: 14px; margin-left: -1px; background: var(--ink-3); }
.ui .spread-dot { position: absolute; top: 2px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--easy); border: 2px solid var(--bg); box-sizing: content-box; }
.ui .spread-dot.good { background: var(--go); }
.ui .zscale { margin: -6px 0 6px; }
.ui .zbar, .ui .zticks { display: flex; gap: 2px; }
.ui .zbar span, .ui .zticks span { min-width: 0; }
.ui .zbar b { display: block; height: 22px; line-height: 22px; border-radius: 4px; font-size: 0.6875rem; font-weight: 700; text-align: center; color: var(--bg); overflow: hidden; }
.ui .zticks { position: relative; margin-top: 4px; font-family: var(--f-data); font-size: 0.6875rem; color: var(--ink-3); }
.ui .zticks span { white-space: nowrap; overflow: visible; }
.ui .zticks i { position: absolute; right: 0; font-style: normal; }
.ui .zdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.ui th:first-child, .ui td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg); }
.ui .block th:first-child, .ui .block td:first-child { background: var(--surface); }
.ui .stats.two { gap: 48px; }

/* Trends: weeks and the pattern timeline */
.ui .week-row { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.ui .week-row header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ui .week-row header small { font-size: 0.8125rem; color: var(--ink-3); }
.ui .counts { margin-left: auto; display: inline-flex; gap: 10px; color: var(--ink-2); font-size: 0.875rem; }
.ui .counts span { display: inline-flex; align-items: center; gap: 2px; }
.ui .counts .msr { font-size: 18px; }
.ui .tl-row { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ui .tl-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.875rem; }
.ui .tl-head small { color: var(--ink-3); font-size: 0.8125rem; }

/* Finding rows */
.ui .finding { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.ui .finding h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.ui .finding-mark { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--ink-2); }
.ui .finding-mark span { display: inline-flex; align-items: center; gap: 4px; }
.ui .finding-mark .conf svg { color: var(--accent); }
.ui .finding-mark .sep { color: var(--ink-3); }

/* Training and activity detail (DESIGN.md 8.4) */
.ui .back, .sheet-host .back { all: unset; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--accent); font-weight: 500; cursor: pointer; }
.ui .group { padding-top: 4px; }
.ui .detail-title { display: flex; gap: 14px; align-items: center; }
/* A session abroad: show it in the saved zone, or put it back (plan 2026-11-10-plan-races-abroad). */
.ui .zone-fix { display: grid; justify-items: start; gap: 4px; margin-top: -8px; }
.ui .zone-fix p { margin: 0; }
.ui .tile.big { width: 52px; height: 52px; border-radius: 14px; }
.ui .tile.big .msr { font-size: 28px; }
.ui .pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.ui .stat-ic { display: flex; gap: 10px; align-items: flex-start; }
.ui .stat-ic > .ic { color: var(--ink-2); margin-top: 4px; }
/* Session weather: one slim panel, the source note behind the corner info button (DESIGN.md 8.4). */
.ui .weather { position: relative; display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 44px 12px 14px; }
.ui .weather .weather-info { position: absolute; top: 0; right: 0; }
.ui .wx-head { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--ink-2); }
.ui .wx-head > .ic { color: var(--series-1); }
.ui .wx-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ui .wx-i { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ui .wx-i > .ic { color: var(--ink-2); }
.ui .wx-i > b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ui .wx-i > small { color: var(--ink-2); }
.ui .wx-hot { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.ui .wx-hot > .ic { flex: none; margin-top: 2px; color: var(--ink-2); }
.ui .weather-note { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.ui .weather-note[hidden] { display: none; }
.ui .weather-note p { margin: 0; }
.ui .zones { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; }
/* The route (plan 2026-11-09-plan-route-overlay): a line with no map. Pace, heart rate and cadence take the --route heat
   ramp, 8 steps low to high (operator, 2026-11-09). Grey is a stretch with no reading; dashed is a GPS gap. */
.ui .route > svg { display: block; width: 100%; height: auto; }
.ui .route path { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.ui .route .r0 { stroke: var(--route-1); }
.ui .route .r1 { stroke: var(--route-2); }
.ui .route .r2 { stroke: var(--route-3); }
.ui .route .r3 { stroke: var(--route-4); }
.ui .route .r4 { stroke: var(--route-5); }
.ui .route .r5 { stroke: var(--route-6); }
.ui .route .r6 { stroke: var(--route-7); }
.ui .route .r7 { stroke: var(--route-8); }
/* The grid behind the route (operator, 2026-11-09): hairlines and dots off the card's own tokens, faded by an alpha mask. */
.ui .route .rt-grid line { stroke: var(--line); stroke-width: 1; }
.ui .route .rt-grid circle { fill: color-mix(in srgb, var(--ink-3) 55%, transparent); stroke: none; }
.ui .route mask { mask-type: alpha; }
.ui .route .none { stroke: var(--control); }
.ui .route .gap { stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 3 6; }
.ui .route circle { stroke-width: 2.5; }
.ui .route circle.start { fill: var(--surface); stroke: var(--ink); }
.ui .route circle.finish { fill: var(--ink); stroke: var(--surface); }
/* The route's segmented control sits on a card, not the page: no bleed or fade, since the card's padding is narrower
   than the page gutter and three segments always fit. */
.ui .route .seg-wrap { margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
.ui .route .seg { margin-right: 0; }
.ui .rt-scale { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ui .rt-ramp { height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--route-1), var(--route-2), var(--route-3), var(--route-4), var(--route-5), var(--route-6), var(--route-7), var(--route-8)); }
.ui .rt-keys { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8125rem; color: var(--ink-2); }
/* Route replay (plan 2026-11-11-plan-route-replay): the route ahead grey, the covered stretch in its channel colour
   through a mask that follows the dot, and a half ring per series in one row, filling from its lowest to its highest
   (heart rate in its zone colour). A frame changes attributes and the slider's value only, so it lays nothing out. */
.ui .rt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ui .route .rt-ahead path { stroke: var(--control); }
.ui .route .rt-cover-line { stroke: #fff; stroke-width: 18; }
.ui .route circle.rt-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 3; }
.ui .route circle.rt-halo { fill: color-mix(in srgb, var(--ink) 16%, transparent); stroke: none; }
.ui .rt-slider { width: 100%; margin: 0; accent-color: var(--accent); }
.ui .rt-clock { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0; font-family: var(--f-data); font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ui .rt-clock b { color: var(--ink); font-weight: 500; }
.ui .gauges { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; padding: 12px; border-radius: 12px; background: var(--sunk); }
.ui .gauge { display: grid; grid-template-areas: "label" "ring" "ends" "unit"; justify-items: center; gap: 2px; min-width: 0; --g: var(--series-1); }
.ui .gauge.z1 { --g: var(--z1); } .ui .gauge.z2 { --g: var(--z2); } .ui .gauge.z3 { --g: var(--z3); } .ui .gauge.z4 { --g: var(--z4); } .ui .gauge.z5 { --g: var(--z5); }
.ui .gauge .g-head, .ui .gauge .g-val { display: contents; }
.ui .gauge .g-label { grid-area: label; justify-self: start; max-width: 100%; font-size: 0.75rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui .gauge .g-ring { grid-area: ring; display: block; width: 100%; max-width: 80px; }
.ui .gauge .g-ring svg { display: block; width: 100%; height: auto; overflow: visible; }
.ui .route .gauge path { fill: none; stroke-width: 7; stroke-linecap: round; }
.ui .route .gauge .g-track { stroke: var(--line); }
.ui .route .gauge .g-fill { stroke: var(--g); }
.ui .gauge .g-val b { grid-area: ring; align-self: end; padding-bottom: 3px; font-size: 0.8125rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ui .gauge .g-val small { grid-area: unit; font-size: 0.6875rem; line-height: 1.2; color: var(--ink-2); }
.ui .gauge .g-ends { grid-area: ends; display: flex; justify-content: space-between; gap: 4px; width: 100%; max-width: 88px; margin: -2px 0 0; font-family: var(--f-data); font-size: 0.625rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ui .rt-keys span { display: inline-flex; align-items: center; gap: 6px; }
.ui .rt-key { width: 10px; height: 10px; border-radius: 50%; box-sizing: border-box; }
.ui .rt-key.grid { border-radius: 2px; border: 1px solid var(--ink-3); }
.ui .rt-key.start { border: 2.5px solid var(--ink); background: var(--surface); }
.ui .rt-key.finish { background: var(--ink); }
.ui .rt-key.none { width: 16px; height: 4px; border-radius: 2px; background: var(--control); }
.ui .rt-key.gap { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--ink-3); }
.ui .zone-legend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; font-size: 0.8125rem; color: var(--ink-2); }
.ui .zone-legend span { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; }
.ui .zone-legend i { width: 8px; height: 8px; border-radius: 50%; }
.ui .zone-legend small { grid-column: 1 / -1; color: var(--ink-3); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.ui .zone-legend b { grid-column: 1 / -1; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.ui .panel .chips { display: flex; flex-wrap: wrap; gap: 0 8px; }
.ui .panel .btn { min-height: 48px; }
.ui .head-actions .back { margin-right: auto; }
.ui .screen-head .head-text:empty { display: none; }
.ui .tile.int-z1 { color: var(--z1); } .ui .tile.int-z2 { color: var(--z2); } .ui .tile.int-z3 { color: var(--z3); }
.ui .tile.int-z4 { color: var(--z4); } .ui .tile.int-z5 { color: var(--z5); } .ui .tile.int-rest { color: var(--rest); }

/* You (DESIGN.md 8.5) */
.ui .icon-circle { width: 44px; padding: 0; justify-content: center; }
.ui .icon-circle .ic { color: var(--ink); }
.ui .goal-card { background: var(--surface); border-radius: 16px; padding: 16px; display: grid; gap: 10px; }
.ui .goal-head { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 12px; align-items: center; min-height: 48px; cursor: pointer; }
.ui .goal-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.ui .goal-head > .ic:first-child { color: var(--accent); flex: none; }
.ui .goal-head > .ic:last-child { color: var(--ink-3); flex: none; margin-left: auto; }
.ui .goal-name { display: grid; gap: 2px; }
/* Collapsed goals sit in a list, one row each */
.ui .goal-card:not(.open) { padding: 8px 16px; }
.ui .goal-card + .goal-card { border-top: 1px solid var(--line); border-radius: 0; }
.ui .goal-card h3, .ui .goal-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink); }
.ui .goal-headline { font-weight: 500; }
.ui .goal-metrics { margin: 0; display: grid; gap: 6px; }
.ui .goal-metrics div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.875rem; }
.ui .goal-metrics dt { color: var(--ink-2); }
.ui .goal-metrics dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.ui .goal-metrics small { color: var(--ink-3); font-weight: 400; }
.ui .goal-actions { display: flex; flex-wrap: wrap; gap: 0 8px; }
.ui .bests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ui .best { background: var(--surface); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.ui .best > .ic { color: var(--hold); }
.ui .best small { font-size: 0.8125rem; color: var(--ink-2); }
.ui .best small.faint { color: var(--ink-3); font-size: 0.75rem; }
.ui .best b { font-size: 1.25rem; font-weight: 500; font-variant-numeric: tabular-nums; }
/* Each label on one line (operator, 2026-11-08): the rows share one set of columns, the label column as wide as the
   longest label, so every bar starts at the same place and takes what is left. */
.ui .recovery { display: grid; grid-template-columns: 24px max-content 1fr auto; gap: 10px; }
.ui .rec-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; font-size: 0.875rem; }
.ui .rec-label { white-space: nowrap; }
/* A sport's name over its rows, when the section has more than one sport. */
.ui .rec-group { grid-column: 1 / -1; margin: 6px 0 0; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.ui .rec-group:first-child { margin-top: 0; }
/* A lone Weights row with no heading: a group's gap above, so it doesn't read as the last row of the group before. */
.ui .rec-row.rec-solo { margin-top: 6px; }
.ui .rec-row .msr { font-size: 20px; color: var(--ink-2); }
.ui .rec-row small { color: var(--ink-2); text-align: right; min-width: 92px; }
.ui .rec-bar { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.ui .rec-bar i { display: block; height: 100%; border-radius: 3px; background: currentColor; }
.ui .ack { padding-bottom: 8px; }
.ui .link small { font-weight: 400; margin-left: 6px; }
/* A link that has to wait (Send a new code, Analyse while it runs) reads as a note, not a button. */
.ui .link:disabled { color: var(--ink-3); font-weight: 400; cursor: default; }

/* Fields and forms (DESIGN.md 7) */
.ui .field { display: grid; gap: 6px; }
.ui .field label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
/* min-width: 0 on the field and its box: an input's own width (about 20 characters) can't push a form past a 360 px phone. */
.ui .field { min-width: 0; }
.ui .input-wrap { min-width: 0; display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 6px 0 14px; border-radius: 10px; border: 1px solid var(--control); background: var(--raised); }
.ui .input-wrap:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.ui .input-wrap input, .ui .input-wrap select, .ui .input-wrap textarea { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; padding: 12px 0; outline: none; }
.ui .input-wrap select { appearance: none; -webkit-appearance: none; }
.ui .field.has-error .input-wrap { border-color: var(--alert); }
/* A field the app fills (zone floors on Auto): sunk and quieter, so it doesn't read as one to type in. */
.ui .input-wrap:has(input[readonly]) { background: var(--sunk); border-color: var(--line); }
.ui .input-wrap input[readonly] { color: var(--ink-2); }
.ui .goal-form, .ui .goal-form .fields { display: grid; gap: 14px; }
.ui .kinds { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.ui .radio-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--control); cursor: pointer; }
.ui .radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.ui .radio-row .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--control); flex: none; display: grid; place-items: center; }
.ui .radio-row.on { border-color: var(--accent); background: var(--ask-soft); }
.ui .radio-row.on .radio { border-color: var(--accent); }
.ui .radio-row.on .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ui .radio-row.multi .radio { border-radius: 6px; }
.ui .rr-text { display: flex; flex-direction: column; gap: 2px; }
.ui .radio-row.multi.on .radio { background: var(--accent); }
.ui .radio-row.multi.on .radio::after { width: 10px; height: 5px; border-radius: 0; background: none; border: solid var(--bg); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.ui .radio-row:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui .radio-row > .ic { color: var(--ink-2); }
/* A goal's own fields hang under its row, in the same outline. */
.ui .kind-opt { display: grid; }
.ui .kind-opt:has(> .kind-fields:not([hidden]), > .kind-more:not([hidden])) > .radio-row { border-radius: 12px 12px 0 0; }
/* Onboarding and Goals and preferences: a picked goal closes to its key values. */
.ui .kind-more { border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 12px 12px; }
.ui .kind-more .kind-fields { border: 0; border-radius: 0; padding: 0 16px 16px; }
.ui .kind-sum { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 16px; border: 0; background: none; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.ui .kind-sum[aria-expanded="true"] { color: var(--ink-2); }
.ui .kind-sum span { flex: 1; }
.ui .kind-sum .ic { flex: none; color: var(--ink-2); }
.ui .kind-sum[aria-expanded="true"] .ic { transform: rotate(180deg); }
.ui div.kind-fields { display: grid; gap: 14px; }
.ui .kind-fields { margin: 0; padding: 16px; border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 12px 12px; }
.ui .check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.ui .check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Settings (DESIGN.md 8.6) and What leaves this phone (8.7) */
.ui .group { display: grid; gap: 8px; }
.ui .group-title { font-family: var(--f-body); font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); margin: 0; }
.ui .list { background: var(--surface); border-radius: 16px; padding: 0 16px; }
.ui .list-row { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.ui .list-row:first-child { border-top: 0; }
/* A row that only says something (the plan in Settings) is not a button. */
.ui div.list-row { cursor: default; }
.ui .list-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ui .list-row > .ic:first-child { color: var(--ink-2); flex: none; }
.ui .list-row > .ic:last-child { color: var(--ink-3); }
.ui .list-row > .row-logo { flex: none; width: 28px; height: 28px; border-radius: 7px; }
/* The sheet body is the .ui element, inside .sheet, so ".ui .sheet" would never match here. */
.sheet-host .connected { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--go); font-weight: 600; }
.ui .list-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.ui .list-text b { font-weight: 400; }
.ui .list-text small { font-size: 0.875rem; color: var(--ink-2); overflow-wrap: anywhere; }
.ui .list-row.tone-accent, .ui .list-row.tone-accent > .ic:first-child { color: var(--accent); }
.ui .list-row.tone-alert b, .ui .list-row.tone-alert > .ic:first-child { color: var(--alert); }
.ui .tone-accent { color: var(--accent); }
.ui .row-link { color: var(--accent); font-weight: 700; font-size: 0.875rem; white-space: nowrap; }
.ui .footer { padding-bottom: 8px; }
.ui .privacy-short { display: grid; gap: 10px; }
.ui .privacy-short .plain { gap: 8px; color: var(--ink-2); }
/* The full details: one closed section per topic, a native disclosure (no script), with a 44 px tap target. */
.ui details.privacy { border-top: 1px solid var(--line); }
.ui details.privacy summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.ui details.privacy summary::-webkit-details-marker { display: none; }
.ui details.privacy summary > .ic { flex: none; color: var(--ink-2); transition: transform 0.15s ease; }
.ui details.privacy[open] summary > .ic { transform: rotate(180deg); }
.ui details.privacy p { padding-left: 30px; margin: 0 0 10px; }
@media (prefers-reduced-motion: reduce) { .ui details.privacy summary > .ic { transition: none; } }
.ui .sheet-form { display: grid; gap: 14px; }
.ui .plain { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
/* Destructive actions (DESIGN.md 6): alert, never the accent. */
.ui .btn-primary.btn-alert { background: var(--alert); color: var(--on-accent); }
.ui .btn-secondary.btn-alert { color: var(--alert); border-color: var(--alert); }
.ui .btn-secondary.btn-alert .ic, .ui .btn-quiet.btn-alert { color: var(--alert); }
.ui .chip.tone-alert { color: var(--alert); border-color: var(--alert); }
.ui .icon-btn.tone-alert { color: var(--alert); }
.ui.confirm { border: 0; padding: 20px; border-radius: 20px; background: var(--raised); color: var(--ink); width: min(360px, calc(100vw - 32px)); box-shadow: 0 12px 32px rgb(0 0 0 / 0.35); }
.ui.confirm::backdrop { background: rgb(0 0 0 / 0.5); }
.ui.confirm h2 { font-family: var(--f-body); font-size: 1.125rem; font-weight: 700; margin: 0 0 8px; }
.ui.confirm .confirm-body { display: grid; gap: 8px; margin-bottom: 20px; overflow-wrap: anywhere; }
.ui.confirm .confirm-body p { margin: 0; }
.ui.confirm .confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Onboarding (DESIGN.md 8.1) */
.onboarding { min-height: 100vh; min-height: 100dvh; align-content: start; }
.ui .welcome { display: grid; gap: 20px; padding-top: 48px; }
.ui .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.ui .app-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--go-soft); display: grid; place-items: center; color: var(--accent); }
.ui .brand .word { font: 500 1.625rem/1.3 var(--f-display); }
.ui .brand.small .app-mark { width: 28px; height: 28px; border-radius: 8px; }
.ui .brand.small .word { font-size: 1.25rem; }
.ui .welcome .brand { margin-bottom: 12px; }
.ui .footer:has(.brand) { display: flex; align-items: center; justify-content: center; gap: 10px; }
/* This install's usage id under the footer (operator, 2026-11-11): faint, and a tap copies it. */
.ui .device-id { margin: -16px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ui .device-id-btn { background: none; border: 0; padding: 0 4px; min-height: 44px; font: inherit; color: inherit; font-variant-numeric: tabular-nums; }
.ui .device-id-text { font-family: var(--f-data); overflow-wrap: anywhere; }
.ui .device-id-note { color: var(--accent); font-weight: 700; }

/* Loading: the logo's sunrise rises, its rays light up, the arrow lifts, then it starts again */
.loader { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; }
.loader-mark { width: 72px; height: 72px; border-radius: 20px; background: var(--go-soft); color: var(--accent); display: grid; place-items: center; }
.loader-mark svg { overflow: visible; }
@media (prefers-reduced-motion: no-preference) {
  .loader-mark .l-sun { animation: l-sun 2.4s cubic-bezier(0.2, 0, 0, 1) infinite; }
  .loader-mark .l-ray { animation: l-ray 2.4s ease-out infinite; }
  .loader-mark .l-r2 { animation-delay: 0.12s; }
  .loader-mark .l-up { animation: l-up 2.4s cubic-bezier(0.2, 0, 0, 1) infinite; }
  @keyframes l-sun { 0% { transform: translateY(5px); } 40%, 82% { transform: translateY(0); } 100% { transform: translateY(5px); } }
  @keyframes l-ray { 0%, 28% { opacity: 0; } 45%, 82% { opacity: 1; } 100% { opacity: 0; } }
  @keyframes l-up { 0%, 38% { opacity: 0; transform: translateY(4px); } 58%, 82% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-2px); } }
}
.ui .facts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; }
.ui .facts li { display: flex; gap: 14px; align-items: center; }
.ui .facts .ic { color: var(--accent); flex: none; width: 40px; height: 40px; padding: 10px; border-radius: 10px; background: var(--surface); }
.ui .step-foot { display: grid; gap: 10px; padding-top: 8px; }
.ui .center { text-align: center; }
.ui .step { display: grid; gap: 20px; }
.ui .step-bar { display: grid; gap: 8px; }
.ui .step-top { display: flex; justify-content: space-between; align-items: center; }
.ui .step-segs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0; }
.ui .step-segs i { width: auto; }
.ui .history-read { display: grid; grid-template-columns: auto 1fr; gap: 4px 6px; align-items: center; font-size: 0.875rem; color: var(--ink-3); }
.ui .history-read.tone-go { color: var(--go); }
.ui .hr-line { grid-column: 1 / -1; height: 2px; background: var(--raised); }
.ui .hr-line i { display: block; height: 100%; background: var(--accent); }
.ui .steps-list { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.ui .steps-list li { counter-increment: s; display: grid; grid-template-columns: 24px 1fr; gap: 8px 12px; align-items: start; }
.ui .steps-list li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 0.8125rem; font-weight: 700; }
.ui .steps-list li .btn { grid-column: 2; justify-self: start; min-height: 44px; font-size: 0.875rem; text-decoration: none; }
.ui a.btn { text-decoration: none; }
.ui .with-ic { display: flex; gap: 8px; align-items: flex-start; }
.ui .with-ic .ic { flex: none; margin-top: 2px; }
/* An inline link keeps its 44px tap area but lines up with the sentence it ends. */
.ui .with-ic > .link { min-height: 0; padding: 12px 4px; margin: -12px 0; }
/* Reset at the end of "You said: …": the same 44px target, kept out of the line's height when the line wraps. */
.ui .type-said > .link { min-height: 0; padding: 12px 4px; margin: -12px 0; }
.ui .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface); cursor: pointer; }
.ui .switch-row > span:first-child { display: flex; gap: 10px; align-items: center; }
.ui .switch-row > span:first-child .ic { color: var(--rest); }
.ui .switch-row input { position: absolute; opacity: 0; }
.ui .switch { width: 48px; height: 28px; border-radius: 14px; background: var(--raised); border: 1px solid var(--control); position: relative; flex: none; }
.ui .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-2); transition: transform 200ms cubic-bezier(0.2, 0, 0, 1); }
.ui .switch-row input:checked + .switch { background: var(--accent); border-color: var(--accent); }
.ui .switch-row input:checked + .switch::after { transform: translateX(20px); background: var(--on-accent); }
.ui .switch-row:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui .voices { display: grid; gap: 12px; }
.ui .voice { display: grid; gap: 12px; padding: 16px; border-radius: 16px; border: 1px solid var(--control); cursor: pointer; }
.ui .voice.on { border-color: var(--accent); background: var(--ask-soft); }
.ui .voice input { position: absolute; opacity: 0; }
.ui .voice-head { display: flex; gap: 12px; align-items: center; }
.ui .voice .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--control); display: grid; place-items: center; }
.ui .voice.on .radio { border-color: var(--accent); }
.ui .voice.on .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ui .sample { font-family: var(--f-display); font-size: 1.0625rem; line-height: 1.45; padding: 12px 14px; border-radius: 10px; background: var(--sunk); }
.ui .voice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui .fact { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.ui .fact > .ic:first-child, .ui .fact > .msr { color: var(--ink-2); }
.ui .fact > .ic:last-child { color: var(--ink-3); }
.ui .fact-text { flex: 1; display: grid; gap: 2px; justify-items: start; }
.ui .fact-text small { font-size: 0.8125rem; color: var(--ink-2); }
.ui .fact-text b { font-weight: 500; }
.ui .fact .tag { margin-left: 0; }
.ui .days { all: unset; box-sizing: border-box; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; cursor: pointer; width: 100%; }
.ui .days .day { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 4px; padding: 0; border: 0; min-width: 0; }
.ui .days .day i { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-style: normal; }
.ui .days .day.on i { border-color: var(--accent); background: var(--ask-soft); }
.ui .days .day.on i::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ui .days .day.long i::after { display: none; }
.ui .days .day.long .msr { font-size: 18px; color: var(--z3); }
.ui .days .day.quality i::after { display: none; }
.ui .days .day.quality .ic { color: var(--z4); }
/* Garmin's fastest under an empty best in Preferences: tucked under the row's value, not a row of its own. */
.ui .best-hint { margin: -18px 0 0; padding-left: 32px; }
.ui .noticed { margin: 0; color: var(--ink); font-size: 0.9375rem; line-height: 1.45; }
.ui .days .day small { font-size: 0.75rem; color: var(--ink-2); }
.ui .days:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.ui .unsure { display: flex; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface); }
.ui .unsure > .ic { color: var(--accent); flex: none; margin-top: 2px; }
.ui .unsure > div { display: grid; gap: 6px; }
.ui .block > .tag { justify-self: start; margin-left: 0; }

/* Your calendar */
.ui .cal-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.ui .cal-row > .ic { color: var(--ink-2); flex: none; }
.ui .cal-sport { flex: none; width: 20px; color: var(--ink-2); display: inline-flex; justify-content: center; }
.ui .cal-sport .msr { font-size: 22px; }
.ui .cal-form [hidden] { display: none; }
.ui .cal-limit, .ui .cal-activity { display: grid; gap: 12px; }
.ui .cal-row .tag { margin-left: 0; justify-self: start; }
/* Changes to your plan, each row Now and Was (plan 2026-11-18-plan-changes-now-was): the date small, Now's session the
   only bold text, Was struck through in --ink-3 (4.87:1 dark, 5.08:1 light on the card) and clamped to two lines. */
.ui .chg-row { align-items: flex-start; }
.ui .chg-row .list-text { gap: 6px; }
.ui .chg-row > .btn { margin-top: -6px; }
.ui .chg-date { font-size: 0.8125rem; color: var(--ink-2); }
.ui .chg-line { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 8px; align-items: baseline; }
.ui .chg-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.ui .chg-now .chg-label { color: var(--accent); }
.ui .chg-now b { font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.ui .chg-was .chg-label { color: var(--ink-3); }
.ui .chg-was s { font-size: 0.875rem; line-height: 1.45; color: var(--ink-3); text-decoration-color: var(--ink-3); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ui .cal-form { gap: 12px; min-width: 0; }
/* minmax(0, 1fr): a date input's own minimum width (Chrome's is wide) can't push the pair past a 360 px phone. */
.ui .pair-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.ui .pair-fields input, .ui .pair-fields select { min-width: 0; width: 100%; }

/* Accessibility pass (DESIGN.md 11) */
.ui .chip { position: relative; }
.ui .chip::after { content: ""; position: absolute; inset: -4px 0; }
.ui .input-wrap:has(select)::after { content: ""; width: 8px; height: 8px; margin: 0 10px 4px 0; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); flex: none; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .ui .switch::after { transition: none; }
}
.ui .pb-fields [data-pbfor="cycling"] > p { margin: 12px 0 0; }
/* The coach's review of the week */
.ui .strip.stale { align-items: flex-start; padding: 12px 14px; }
.ui .strip.stale > .ic { margin-top: 2px; }
.ui .strip.stale p { margin: 0; }
.ui .strip.injury, .ui .strip.black, .ui .strip.import-ask, .ui .strip.weight-ask { align-items: flex-start; padding: 12px 14px; }
.ui .strip.injury > .ic, .ui .strip.black > .ic, .ui .strip.import-ask > .ic, .ui .strip.weight-ask > .ic { margin-top: 2px; }
.ui .strip.injury > div, .ui .strip.black > div, .ui .strip.import-ask > div, .ui .strip.weight-ask > div { display: grid; gap: 4px; }
.ui .strip.injury p, .ui .strip.black p, .ui .strip.import-ask p, .ui .strip.weight-ask p { margin: 0; }
.ui .strip.injury .ease-actions, .ui .strip.black .ease-actions, .ui .strip.import-ask .ease-actions, .ui .strip.weight-ask .ease-actions { margin-top: 6px; align-items: center; }
/* An offer, not a problem or a verdict: a plain card with the Ask colour on the icon only. A soft fill
   would read as hold's warning, or, as --ask-soft is almost --go-soft, as a second Go card. */
.ui .strip.tone-ask { background: var(--surface); border: 1px solid var(--line); color: var(--ink); } .ui .strip.tone-ask > .ic { color: var(--ask); }
.ui .yes-no legend { padding: 0; margin-bottom: 4px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.ui .reports { display: flex; flex-wrap: wrap; gap: 0 24px; }
/* Take a few days: How long, one day at a time between a minus and a plus (plan 2026-11-14-plan-take-a-few-days). */
.ui .stepper { display: flex; align-items: center; gap: 16px; }
.ui .stepper output { min-width: 5.5em; text-align: center; font-weight: 700; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.ui .stepper .btn { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; }
.ui .pause-form fieldset + fieldset, .ui .pause-form fieldset p { margin-top: 0; }
.ui .strip.pause { align-items: flex-start; padding: 12px 14px; }
.ui .strip.pause > .ic { margin-top: 2px; }
.ui .strip.pause p { margin: 0; }
.ui .stale-what { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.45; }
.ui .stale-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ui .review-line { display: grid; gap: 4px; }
.ui .review-line p { margin: 0; }
.ui .verdict p:has(> .tag) { margin: 0; }
.ui .week > p:has(> .tag) { margin: 0; }
.ui .verdict p > .tag:first-child, .ui .week > p > .tag:first-child { margin-left: 0; }
/* Coach's take on a session */
.ui .take { display: grid; gap: 10px; }
.ui .take .sec-h, .ui .take p { margin: 0; }
.ui .take-head { font-weight: 600; line-height: 1.4; }
.ui .take-points { margin: 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.45; color: var(--ink-2); }
.ui .take-next { line-height: 1.45; }
.ui .did { border-top: 1px solid var(--line); padding-top: 4px; }
.ui .did .sub-h { margin-top: 8px; }
.ui .good-for, .ui .goal-fit { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ui .goal-fit { margin-top: 14px; }
.ui .good-for li, .ui .goal-fit li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; }
.ui .did li > svg { margin-top: 2px; color: var(--ink-3); }
.ui .good-for li > svg { color: var(--accent); }
.ui .goal-fit li.tone-hold > svg, .ui .goal-fit li.tone-hold b { color: var(--hold); }
.ui .did p { margin: 0; display: grid; gap: 2px; line-height: 1.45; }
.ui .did p span { color: var(--ink-2); }
.ui .take-next b { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); margin-bottom: 2px; }
.ui .take .link, .ui .take > .btn { justify-self: start; }
/* A written take folds under its heading row (operator, 2026-11-09); folded, its whole headline sits under the title. */
.ui .take-fold { all: unset; box-sizing: border-box; display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 44px; cursor: pointer; }
.ui .take-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ui .take-fold-text { display: grid; gap: 2px; min-width: 0; }
.ui .take-fold-title { display: flex; align-items: center; gap: 10px; }
.ui .take-fold-text small { font-size: 0.9375rem; font-weight: 400; line-height: 1.4; color: var(--ink-2); }
/* The tile and chevron stay level with the title, however long the headline under it. */
.ui .take-fold > .ic:last-child { flex: none; margin-left: auto; margin-top: 5px; color: var(--ink-2); }
.ui .take-fold[aria-expanded="true"] > .ic:last-child { transform: rotate(180deg); }
.ui .take .strip { padding: 8px 6px 8px 12px; }

/* After the session: body response, plan, fitness at the same effort, drift. */
.ui .after { display: grid; gap: 10px; }
.ui .after .sec-h, .ui .after p { margin: 0; }
.ui .after-head { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; line-height: 1.4; }
.ui .after-head .state-ic, .ui .after-head .ic { flex: none; margin-top: 3px; }
.ui .after-head.tone-go .state-ic { color: var(--go); } .ui .after-head.tone-easy .state-ic { color: var(--easy); }
.ui .after-head.tone-hold .state-ic { color: var(--hold); } .ui .after-head.tone-rest .state-ic { color: var(--rest); }
.ui .after-head.tone-ask .state-ic { color: var(--ask); }
.ui .after-readings { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.ui .after-reading { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.ui .after-reading span { font-size: 0.8125rem; color: var(--ink-3); }
.ui .after-reading b { font-family: var(--f-data); font-size: 1rem; display: inline-flex; align-items: center; gap: 4px; }
.ui .after-reading b.tone-hold { color: var(--hold); }
.ui .after-reading small { font-size: 0.75rem; color: var(--ink-3); }
.ui .after-lead { font-weight: 600; line-height: 1.4; }
.ui .stream p { margin: 0; }
.ui .stats.three { gap: 32px; }
/* Cadence with running form: three columns, so each form figure sits under a cadence one, and the cadence row stays
   where the three-stat row puts it. */
.ui .stats.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; }
.ui .chart-note { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; color: var(--ink-2); }
.ui .chart-note .ai-mark { margin-top: 3px; }
/* Session type once confirmed: a quiet line and links, not a card. */
.ui .read-done { display: grid; gap: 0; padding-top: 4px; padding-bottom: 4px; border-top: 1px solid var(--line); }
/* The quiet buttons' 44px targets add 12px round their text, so the card's own padding is 4px and
   the confirmed line, which has none, takes 12px more: about 16px of space on every side. */
.ui .read-done > .with-ic:first-child { padding-top: 12px; }
.ui .read-done > [role="status"] { padding-bottom: 12px; }
.ui .read-done p { margin: 0; }
.ui .read-actions { display: flex; flex-wrap: wrap; gap: 0 20px; }
/* Edit mode's Save and Cancel, side by side. */
.ui .read-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
/* The session type card's one rhythm (operator, 2026-11-14): 16px between its groups (the line, the chips, how it
   felt, the buttons, the actions) and 8px inside one, from the card's gap, not margins. How it felt is 4px apart
   inside, as the slider's 44px target already puts air round its track. The quiet actions' 44px targets carry 12px
   above their text, so that row sits 12px up to look 16px away like the rest. */
.ui .read-card { gap: 16px; }
.ui .read-head, .ui .read-save { display: grid; gap: 8px; }
/* Save waits for a type on a session the app can't read (zoneless grade): dimmed, as the Ask button is while it waits. */
.ui .read-save .btn:disabled { opacity: 0.45; cursor: default; }
.ui .read-card > * + .read-actions { margin-top: -12px; }
.ui .read-actions .btn { font-size: 0.875rem; font-weight: 600; gap: 6px; }
.ui .read-actions .btn svg { width: 16px; height: 16px; }

.ui .block .tablewrap { margin: 0 -16px; padding: 0 16px; }

/* Section hues outside the heading tile (DESIGN.md 5.7). */
.ui .week-row.now header b { color: var(--hue-week); }
.ui .ask-row > .ic:first-child { box-sizing: content-box; padding: 9px; border-radius: 10px; background: var(--series-band); color: var(--series-1); }

/* What changed in the week since yesterday (plan 2026-10-27-plan-week-changes). */
.ui .since { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--hold-soft); }
.ui .since-h { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; width: 100%; background: none; border: 0; font: inherit; font-size: 0.875rem; font-weight: 700; color: var(--hold); text-align: left; min-height: 32px; cursor: pointer; }
.ui .since-h span { flex: 1; }
.ui .since:has(.since-h[aria-expanded="false"]) { gap: 0; padding: 8px 12px; }
.ui .since ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ui .since li { display: grid; gap: 2px; font-size: 0.875rem; }
.ui .since li span { color: var(--ink-2); }
.ui .wk-was { color: var(--ink); }
/* The first sync (onboarding): the loader mark, a changing line, a bar that creeps toward the next phase */
.ui .sync-screen { min-height: 80vh; min-height: 80dvh; display: grid; align-content: center; justify-items: center; gap: 16px; text-align: center; padding: 24px 0; }
.ui .sync-screen .title { margin: 8px 0 0; }
.ui .sync-msg { margin: 0; min-height: 3em; color: var(--ink-2); max-width: 30ch; }
.ui .sync-bar { width: min(280px, 100%); height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.ui .sync-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transform-origin: left; transform: scaleX(var(--from)); }
.ui .sync-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; justify-items: start; }
.ui .sync-steps li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.ui .sync-steps li.done { color: var(--ink-2); }
.ui .sync-steps li.done .ic { color: var(--go); }
.ui .sync-steps li.now { color: var(--ink); font-weight: 500; }
.ui .sync-steps .dot { width: 18px; height: 18px; display: grid; place-items: center; }
.ui .sync-steps .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.ui .sync-steps li.now .dot::after { background: var(--accent); border-color: var(--accent); }
.ui .sync-screen > .small { max-width: 34ch; margin: 8px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  /* Most of the way to the next phase over two minutes, easing off so it never seems to stall at the end. */
  .ui .sync-bar i { animation: sync-creep 120s cubic-bezier(0.1, 0.6, 0.3, 1) forwards; }
  @keyframes sync-creep { to { transform: scaleX(calc(var(--from) + (var(--to) - var(--from)) * 0.9)); } }
  .ui .sync-steps li.now .dot::after { animation: sync-pulse 1.6s ease-in-out infinite; }
  @keyframes sync-pulse { 50% { transform: scale(1.35); opacity: 0.6; } }
  .ui .sync-msg { animation: sync-msg 400ms ease-out; }
  @keyframes sync-msg { from { opacity: 0; transform: translateY(4px); } }
  /* The refresh icon on a loading state turns until the work is done (operator, 2026-11-06). */
  .ui .ic.spin { animation: ic-spin 1.2s linear infinite; }
  @keyframes ic-spin { to { transform: rotate(360deg); } }
}
/* "Share usage data" sits in the Privacy group, so it reads like the rows around it, not the illness switch */
.ui .usage-row { background: none; padding: 12px 0; border-radius: 0; border-top: 1px solid var(--line); min-height: 56px; }
.ui .usage-row > span:first-child { gap: 12px; }
.ui .usage-row > span:first-child .ic { color: var(--ink-2); flex: none; }
.ui .usage-row + .field-error { padding-bottom: 14px; }
.ui .usage-row .list-text { display: grid; gap: 2px; }
.ui .usage-row .list-text small { color: var(--ink-2); }

/* Share an activity as an image (plan 2026-11-01-plan-share-styles: choices as pills). */
.ui .share-preview { display: flex; justify-content: center; }
.ui .share-preview canvas { display: block; height: min(46vh, 420px); width: auto; border-radius: 12px; border: 1px solid var(--line); background: #0E1413; }
/* The preview moves the route: a drag there must not scroll the sheet. */
.ui .share-preview canvas { touch-action: none; cursor: grab; }
.ui .share-preview canvas:active { cursor: grabbing; }
.ui .share-preview canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ui .share-move { justify-content: space-between; }
.ui .share-move p { margin: 0; flex: 1; min-width: 180px; }
.ui .share-preview.square canvas { height: auto; width: min(100%, 46vh, 420px); }
.ui .share-controls { display: grid; gap: 12px; }
.ui .share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ui .share-row .seg-wrap { flex: 1; min-width: 160px; }
.ui .share-label { font-family: var(--f-data); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 -4px; }
/* The Photo pill holds the file picker, out of sight; the pill shows focus for it. */
.ui .chip input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ui .share-note { text-align: center; margin: 0; }

/* A block that switches between charts and its table from the title row (Trends, by month). */
.ui .sec-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ui .view-toggle { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--track); flex: none; }
.ui .view-toggle .vt { all: unset; box-sizing: border-box; display: grid; place-items: center; width: 34px; height: 30px; border-radius: 999px; color: var(--ink-3); cursor: pointer; }
.ui .view-toggle .vt.on { background: var(--surface); color: var(--accent); cursor: default; }
.ui .view-toggle .vt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Readiness track (plan 2026-10-29-plan-readiness-indicator): a position, never a number. */
.ui .ready { display: grid; gap: 8px; }
.ui .ready p { margin: 0; }
.ui .ready-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ui .ready-word { font-weight: 700; font-size: 0.9375rem; }
.ui .ready-sub { font-size: 0.8125rem; color: var(--ink-3); text-align: right; }
.ui .ready-track { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--rest) 0%, var(--easy) 45%, var(--go) 100%); }
.ui .ready-dot { position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--line); transform: translate(-50%, -50%); }
.ui .ready-ghost { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; border: 2px dashed var(--ink); opacity: 0.7; transform: translate(-50%, -50%); }
.ui .ready-ends { display: flex; justify-content: space-between; font-family: var(--f-data); font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.ui .ready-why { font-size: 0.9375rem; line-height: 1.45; color: var(--ink-2); }
.ui .verdict .ease { width: 100%; }
.ui .ease-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* The week departs from the athlete's set long or quality days: say so and why. */
.ui .departs { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--hold-soft); }
.ui .departs-h { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.875rem; font-weight: 700; color: var(--hold); }
.ui .departs ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 0.875rem; color: var(--ink); }
.ui .departs li { display: grid; gap: 2px; } .ui .departs li span { color: var(--ink-2); }
.ui .departs .link { justify-self: start; font-size: 0.875rem; }
.ui .ready-more { justify-self: start; display: inline-flex; align-items: center; gap: 4px; padding: 0; background: none; border: 0; font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--accent); min-height: 32px; cursor: pointer; }
.ui .ready-factors { list-style: none; margin: 0; padding: 0; display: grid; }
/* Each factor: the label, then its words under it, left-aligned (operator, 2026-11-04). */
.ui .ready-factors li { display: grid; grid-template-columns: 10px 1fr; align-items: center; column-gap: 10px; row-gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.ui .ready-factors .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.ui .ready-factors b, .ui .ready-factors b[class] { grid-column: 2; font-weight: 600; text-align: left; color: var(--ink); }
.ui .ready-factors li > span:nth-child(2) { color: var(--ink-2); }
.ui .ready-waiting .ready-track { background: var(--sunk); overflow: hidden; }
.ui .ready-waiting .ready-track i { display: block; height: 100%; border-radius: inherit; background: var(--easy); }
.ui .ready-waiting .ready-word { color: var(--ink-2); }

/* Sign-in and Garmin Connect linking (app2). The tile is Garmin's, shown unaltered. */
.ui .signin, #onboarding .signin { display: grid; gap: 16px; }
.signin .gc { display: flex; gap: 14px; align-items: flex-start; }
.signin .gc p { margin: 0; }
.signin .gc-tile { flex: none; width: 64px; height: 64px; border-radius: 14px; }
.signin .signin-links { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; margin-top: 4px; }
.signin .back { justify-self: start; }

/* A premium feature on the free plan: one quiet line with the offers. */
.ui .locked { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; }
.ui .locked p { margin: 0; color: var(--ink-2); }
.ui .locked .locked-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 2px; }

/* The morning brief, at the top of Today (plan 2026-11-02-plan-morning-brief). */
.ui .brief { gap: 10px; }
.ui .brief .sec-h, .ui .brief p { margin: 0; }
.ui .brief-head { font-weight: 600; line-height: 1.4; }
.ui .brief-part { line-height: 1.45; }
.ui .brief-part b { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); margin-bottom: 2px; }
.ui .brief-actions { display: flex; gap: 8px; }
/* The offer's Ready for my brief and the text form's Replay (operator 2026-11-18 and 2026-11-19, "smaller"): each
   sized to its icon and words, still a 44 px target. */
.ui .brief-actions .btn:not(.btn-quiet) { flex: none; min-height: 44px; padding: 0 16px; font-size: 0.9375rem; }
/* Skip and Close at the right end of the row (operator 2026-11-18). */
.ui .brief-actions .btn-quiet { flex: none; margin-left: auto; }
.ui .brief > .link, .ui .brief > .btn { justify-self: start; }
.ui .brief-wait { margin: 0 0 12px; }
.ui .brief-ic { position: relative; display: inline-grid; place-items: center; padding: 9px; border-radius: 10px; background: var(--series-band); color: var(--series-1); }

/* The brief's recap (plan 2026-11-18-plan-brief-recap): a full-screen dialog of cards over Today, one card at a time.
   Each card is tinted by its part's hue; the coach's words in body type, the headline in display type. */
body.recap-open { overflow: hidden; }
#recap .recap { position: fixed; inset: 0; z-index: 60; background: var(--sunk); display: flex; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
#recap .recap-stage { flex: 1; display: flex; min-height: 0; max-width: 520px; margin: 0 auto; width: 100%; }
#recap .recap-card { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding: 12px 20px 20px; border-radius: 28px; border: 1px solid var(--hue-soft); background: color-mix(in srgb, var(--hue) 7%, var(--surface)); color: var(--ink); }
#recap .recap-top { display: flex; align-items: center; gap: 12px; }
#recap .recap-progress { flex: 1; display: flex; gap: 4px; }
#recap .recap-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
#recap .recap-progress span.on { background: var(--ink); }
#recap .recap-top .icon-btn { color: var(--ink); margin-right: -10px; }
#recap .recap-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
#recap .recap-first .recap-body { justify-content: center; gap: 22px; }
#recap .recap-h { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--f-body); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hue); }
#recap .recap-date { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--f-data); font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--hue); }
#recap .recap-headline { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: 2rem; line-height: 1.22; text-wrap: balance; }
#recap .recap-text { margin: 0; font-size: 1rem; line-height: 1.55; }
/* A card with no chart (Watch for, or a brief saved before the figures): its words centred in display type. */
#recap .recap-plain .recap-body { justify-content: center; }
#recap .recap-plain .recap-text { font-family: var(--f-display); font-weight: 500; font-size: 1.5rem; line-height: 1.3; text-wrap: pretty; }
#recap .recap-nav { display: flex; align-items: center; gap: 12px; }
#recap .recap-nav .btn { border-radius: 999px; }
#recap .recap-nav .btn-primary { margin-left: auto; }
#recap .recap-count { font-size: 0.8125rem; color: var(--ink-3); }
#recap .recap-nav .btn-secondary + .recap-count { margin: 0 auto; }
@media (prefers-reduced-motion: no-preference) {
  #recap .recap-next .recap-card { animation: recap-in-next 240ms cubic-bezier(0.2, 0, 0, 1); }
  #recap .recap-back .recap-card { animation: recap-in-back 240ms cubic-bezier(0.2, 0, 0, 1); }
  #recap .recap > .recap-stage:not(.recap-next):not(.recap-back) .recap-card { animation: sheet-in 280ms cubic-bezier(0.2, 0, 0, 1); }
  @keyframes recap-in-next { from { transform: translateX(32px); opacity: 0; } }
  @keyframes recap-in-back { from { transform: translateX(-32px); opacity: 0; } }
}
/* The recap's charts (recap-charts.ts). Shown above the coach's words; read after them (DOM order). */
#recap .recap-h { order: -2; }
#recap .recap-vis { order: -1; display: flex; flex-direction: column; gap: 14px; }
#recap .recap-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
#recap .recap-chip { padding: 6px 12px; font-size: 0.8125rem; font-weight: 700; }
/* A chip's colour is its verdict (plan 2026-11-20-plan-brief-chip-tones): the text stays ink on the tone's soft fill and
   only the icon takes the tone, as a strip does. A neutral chip is a light tint of ink in both themes, so it never reads
   heavier than a toned one; the clear border keeps both the same size. */
#recap .recap-chip, #recap .recap-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); border: 1px solid transparent; color: var(--ink); }
#recap .recap-chip > .ic, #recap .recap-pill > .ic { flex: none; color: var(--ink-2); }
#recap .tone-go:is(.recap-chip, .recap-pill) { background: var(--go-soft); border-color: transparent; } #recap .tone-go:is(.recap-chip, .recap-pill) > .ic { color: var(--go); }
#recap .tone-hold:is(.recap-chip, .recap-pill) { background: var(--hold-soft); border-color: transparent; } #recap .tone-hold:is(.recap-chip, .recap-pill) > .ic { color: var(--hold); }
#recap .tone-rest:is(.recap-chip, .recap-pill) { background: var(--rest-soft); border-color: transparent; } #recap .tone-rest:is(.recap-chip, .recap-pill) > .ic { color: var(--rest); }
#recap .recap-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0; }
#recap .recap-big > b { font-family: var(--f-data); font-size: 3rem; font-weight: 600; line-height: 1; }
#recap .recap-big > span { font-size: 1.0625rem; color: var(--ink-2); }
#recap .recap-big > small { font-size: 0.8125rem; color: var(--ink-2); }
#recap .recap-big > small:first-child { flex-basis: 100%; }
#recap .recap-big > small:not(:first-child) { margin-left: auto; font-family: var(--f-data); font-size: 0.875rem; }
#recap .recap-big > small b { color: var(--ink); }
#recap .recap-figure-row { display: flex; align-items: flex-end; gap: 12px; }
#recap .recap-pill, #recap .recap-before { margin-left: auto; margin-bottom: 4px; font-size: 0.8125rem; white-space: nowrap; }
#recap .recap-pill { padding: 6px 12px; font-weight: 700; text-align: right; }
#recap .recap-before { color: var(--ink-2); }
#recap .recap-track { position: relative; display: block; height: 12px; border-radius: 6px; background: var(--track); }
#recap .recap-night .recap-track { height: 32px; border-radius: 10px; }
#recap .recap-night .recap-track i { position: absolute; top: 0; bottom: 0; border-radius: 10px; background: var(--sleep-deep); }
#recap .recap-ends { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-family: var(--f-data); font-size: 0.75rem; color: var(--ink-2); }
#recap .recap-stages { display: grid; gap: 10px; padding: 12px; border-radius: 16px; background: var(--hue-soft); }
#recap .recap-stage-rows { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; }
#recap .recap-stage-name { font-size: 0.875rem; }
#recap .recap-track > b { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: color-mix(in srgb, var(--hue) 30%, var(--track)); }
#recap .recap-dot { position: absolute; top: -3px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; border: 2px solid var(--ink); box-sizing: border-box; background: var(--sleep-light); }
#recap .recap-dot.stage-deep { background: var(--sleep-deep); }
#recap .recap-dot.stage-rem { background: var(--hue-sleep); }
#recap .recap-dot.stage-awake { background: var(--ink-3); }
#recap .recap-num { font-family: var(--f-data); font-size: 0.8125rem; text-align: right; }
#recap .recap-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin: 0; font-size: 0.75rem; color: var(--ink-2); }
#recap .recap-legend span { display: inline-flex; align-items: center; gap: 6px; }
#recap .recap-legend span:first-child:not(:has(i)) { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
#recap .recap-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
#recap .recap-legend i.recap-key-band { width: 18px; height: 8px; background: color-mix(in srgb, var(--hue) 30%, var(--track)); }
#recap .recap-legend i.recap-key-dot { border-radius: 50%; width: 10px; height: 10px; background: var(--hue); }
#recap .recap-legend i.recap-key-avg { width: 16px; height: 0; border-top: 2px dashed var(--ink); border-radius: 0; }
#recap .recap-chart { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: var(--hue-soft); }
#recap .recap-hrv { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--f-data); }
#recap .recap-band { fill: color-mix(in srgb, var(--hue) 22%, transparent); }
#recap .recap-axis { font-size: 11px; fill: var(--ink-2); }
#recap .recap-band-label { font-family: var(--f-body); font-size: 11px; fill: var(--hue); }
#recap .recap-avg { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
#recap .recap-line { fill: none; stroke: var(--hue); stroke-width: 1.5; stroke-opacity: 0.5; }
#recap .recap-night-dot { fill: var(--hue); }
#recap .recap-last { fill: var(--hue); stroke: var(--ink); stroke-width: 2.5; }
#recap .recap-last-label { font-size: 12px; font-weight: 600; fill: var(--ink); text-anchor: middle; }
#recap .recap-hrv .recap-day { font-family: var(--f-body); font-size: 11px; fill: var(--ink-2); text-anchor: middle; }
#recap .recap-hrv .recap-day-last { fill: var(--ink); font-weight: 700; }
#recap .recap-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#recap .recap-tile { display: grid; gap: 4px; padding: 12px; border-radius: 14px; background: var(--hue-soft); }
#recap .recap-tile span { font-size: 0.75rem; color: var(--ink-2); }
#recap .recap-tile b { font-family: var(--f-data); font-size: 1.25rem; font-weight: 600; }
#recap .recap-tile b small { font-family: var(--f-body); font-size: 0.8125rem; font-weight: 400; color: var(--ink-2); }
#recap .recap-tile b.recap-label { font-size: 1rem; }
/* The tile's line sits on the label row, so the tile keeps its height (plan 2026-11-20-plan-brief-tile-lines). Its
   word follows the chips' rule: ink text, only the icon takes the tone. */
#recap .recap-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#recap .recap-tile-head > span { white-space: nowrap; }
/* The name keeps one line: on a narrow tile the line gives way, keeping its shape. */
#recap .recap-tile-line { flex: 0 1 56px; min-width: 0; height: 14px; align-self: center; overflow: visible; }
#recap .recap-tile-line polyline { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#recap .recap-tile-line circle { fill: var(--ink-2); }
#recap .recap-tile-word { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--ink-2); }
#recap .recap-tile-word > .ic { flex: none; color: var(--ink-2); }
#recap .recap-tile-word.tone-go > .ic { color: var(--go); } #recap .recap-tile-word.tone-hold > .ic { color: var(--hold); }
#recap .recap-session { display: grid; gap: 12px; padding: 16px; border-radius: 20px; background: var(--raised); border: 1px solid var(--line); }
#recap .recap-session-name { font-family: var(--f-display); font-weight: 500; font-size: 1.625rem; line-height: 1.1; }
#recap .recap-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
#recap .recap-facts dt { font-size: 0.75rem; color: var(--ink-2); }
#recap .recap-facts dd { margin: 2px 0 0; font-family: var(--f-data); font-size: 1rem; font-weight: 600; }
#recap .recap-zbar { position: relative; display: flex; gap: 3px; height: 14px; }
#recap .recap-zbar > span:first-child { border-radius: 7px 0 0 7px; }
#recap .recap-zbar > span:last-of-type { border-radius: 0 7px 7px 0; }
#recap .recap-zbar > span.over { opacity: 0.25; }
#recap .recap-zbar i { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); }
#recap .recap-zlabels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.75rem; color: var(--ink-2); }
#recap .recap-zlabels span:nth-child(2) { color: var(--ink); font-family: var(--f-data); }
#recap .recap-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; padding-top: 18px; }
#recap .recap-col { display: grid; justify-items: center; gap: 4px; }
#recap .recap-bar > small { position: absolute; left: 0; right: 0; margin-bottom: 4px; text-align: center; font-family: var(--f-data); font-size: 0.6875rem; line-height: 1; color: var(--ink-2); }
#recap .recap-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; width: 100%; height: 140px; gap: 2px; }
#recap .recap-bar > span { display: block; width: 100%; border-radius: 6px 6px 2px 2px; }
#recap .recap-run, #recap .recap-key-run { background: var(--hue-week); }
#recap .recap-walk, #recap .recap-key-walk { background: var(--series-1-past); }
#recap .recap-other, #recap .recap-key-other { background: var(--control); }
#recap .recap-bar > .recap-plan { position: absolute; bottom: 0; box-sizing: border-box; border: 2px dashed var(--hue-week); background: none; }
#recap .recap-col .recap-day { display: grid; justify-items: center; font-size: 0.75rem; color: var(--ink-2); text-align: center; }
#recap .recap-col .recap-day b { font-size: 0.6875rem; color: var(--hue-week); }
#recap .recap-col .recap-day-last { color: var(--ink); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  #recap .recap-bar > span:not(.recap-plan) { animation: recap-grow 420ms cubic-bezier(0.2, 0, 0, 1) both; transform-origin: bottom; }
  #recap .recap-night .recap-track i, #recap .recap-track > i.recap-dot { animation: recap-fade 420ms ease-out both; }
  @keyframes recap-grow { from { transform: scaleY(0); } }
  @keyframes recap-fade { from { opacity: 0; } }
}
/* Reduced motion: a cross-fade, no slide (plan). */
@media (prefers-reduced-motion: reduce) {
  #recap .recap-card { animation: recap-fade 160ms linear; }
  @keyframes recap-fade { from { opacity: 0; } }
}

/* Last night, explained (plan 2026-11-02-plan-night-read): under the figures on the Last night card. */
.ui .night-read { display: grid; gap: 8px; margin-top: 4px; }
.ui .night-read p { margin: 0; }
.ui .night-read > .btn { justify-self: start; }
.ui .night-btn { position: relative; }
.ui .night-btn .ai-mark .ic { color: var(--hue-coach); }
.ui .night-btn .premium-badge { top: -6px; right: -6px; }
.ui .night-read.has-read { padding: 12px 14px; border-radius: 12px; background: var(--hue-coach-soft); }
.ui .night-sum { display: flex; gap: 8px; align-items: baseline; font-weight: 600; line-height: 1.4; }

/* Import Garmin history (store accounts). */
.ui .import-pick { cursor: pointer; }
.ui .import-bar { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.ui .import-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.3s; }
.ui .import-work #importLive { display: grid; justify-items: center; gap: 16px; width: 100%; }
.ui .import-work .import-bar { display: block; width: min(280px, 100%); height: 6px; }
/* Counts change with every batch: no fade, or the line flickers. */
.ui .import-work .sync-msg { animation: none; min-height: 0; }

/* The weight log in Body details (plan 2026-11-10-plan-weight-log): under the form, Add first, then the list. */
.ui .weight-log { display: grid; gap: 10px; margin-top: 20px; }
.ui .weight-log .group-title { margin: 0; }
.ui .weight-log .list-row .btn { margin-left: auto; }

/* Providers (merge plan A11): one row each, with its own mark and Connect. Onboarding's provider
   screen and the no-source state on the main tabs use the same list. */
.ui .providers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ui .provider { display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ui .provider img { flex: none; width: 64px; height: 64px; border-radius: 14px; }
.ui .provider > span { flex: 1; display: grid; gap: 2px; }
.ui .provider small { color: var(--ink-2); font-size: 0.8125rem; }
.ui .provider .btn { flex: none; }
/* A provider shown with a plain icon in place of its mark (Apple, operator 2026-11-14): a tile the logo's size. */
.ui .provider-icon { display: grid; place-items: center; flex: none; background: var(--sunk); color: var(--ink-2); }
.ui .provider > span.provider-icon { flex: none; width: 64px; height: 64px; border-radius: 14px; }
.ui .list-row > .provider-icon.row-logo { display: grid; }
.ui .no-source { display: grid; gap: 16px; padding-top: 24px; }
/* Apple: Health Auto Export's setup sheet (plan 2026-11-14-plan-apple-hae-v2, section 8). */
.ui .apple-head, .ui .apple-step h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.ui .apple-step { display: grid; gap: 10px; }
.ui .apple-step h4 { margin: 6px 0 0; font-size: 0.9375rem; font-weight: 700; }
.ui .apple-step p, .ui .apple-head + p { margin: 0; }
.ui .apple-list { display: grid; gap: 6px; margin: 0; padding-left: 20px; }
.ui .apple-list b { font-weight: 700; overflow-wrap: anywhere; }
.ui .apple-step p.small.muted { margin-bottom: -6px; }
.ui .copy-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ui .copy-text { flex: 1 1 200px; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--sunk); color: var(--ink); font-family: var(--f-data); font-size: 0.8125rem; line-height: 1.4; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.ui .copy-field .btn { flex: none; }
.ui .copy-note { color: var(--accent); font-weight: 700; font-size: 0.875rem; }
.ui .copy-note:empty { display: none; }
.ui .apple-choice { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ui .apple-choice p { margin: 0; }
.ui .apple-choice-label { font-size: 0.875rem; font-weight: 700; color: var(--ink-2); }
.ui .apple-data-note { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.ui .apple-data-note > .ic { flex: none; margin-top: 2px; color: var(--hold); }
.ui details.apple-how p { padding-left: 0; margin: 0; }
.ui details.apple-how > .apple-step { padding-bottom: 12px; }
.ui details.apple-how > .apple-step + .apple-step { margin-top: 4px; }
.ui .no-source p { margin: 0; }
/* Trends' blocks (contract trainingcoach-trends): the read's sentence, the plan line, the side lines, Sleep's nights */
/* Cards on each tab sit apart as Today's do. */
.ui .trends-view { display: grid; gap: 24px; }
/* A session chart's average, in a pill on its line: translucent dark in the dark theme, light with a hairline in the light
   one, so the chart-coloured figure stays readable on both. */
.ui .avg-pill > rect { fill: var(--pill); stroke: var(--pill-line); }
.ui .trend .key { margin: 4px 0 8px; }
/* The headline's arrow, by the number in its colour: the direction, where the colour is the judgement. */
.ui .stat-arrow { display: inline-flex; vertical-align: middle; margin-left: 6px; }
/* Your progress inside the Your goals card: a block's rhythm, under a subheading in place of its own heading. */
.ui .goal-progress { display: grid; gap: 12px; }
.ui .goal-progress > .sub-h { margin: 12px 0 0; }
/* The coach's read under the goal's projection: a small heading, the three fields as labelled paragraphs, the date. */
.ui .goal-read { display: grid; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.ui .goal-read-h { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.ui .goal-read-field { margin: 0; line-height: 1.5; }
.ui .goal-read-field > b { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
/* "What did you train?" on a strength session: the question over its three answers. */
/* A session past the athlete's usual: its tag, and what that means under it. */
.ui .past-usual { display: grid; gap: 4px; }
.ui .past-usual > p { margin: 0; }
.ui .trained-ask { display: grid; gap: 8px; }
.ui .trained-q { margin: 0; font-weight: 600; }
.ui .trend-sentence { margin: 12px 0 0; }
.ui .trend-plan { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; color: var(--ink-2); }
.ui .trend-plan > .ic { margin-top: 3px; color: var(--ink-3); }
/* A goal's projection with no date to give: a step quieter than the plan line, which is already ink-2. */
.ui .trend-projection.faint { color: var(--ink-3); }
.ui .trend-also { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.ui .trend-also > p { margin: 0 0 4px; color: var(--ink-2); }
.ui .trend-also > p b { color: var(--ink); font-weight: 500; }
.ui .trend-link { margin: 4px 0 0; }

/* How it felt (W8): the slider under the session type, its three words under the track. */
.ui .feel { display: grid; gap: 4px; }
.ui .feel-slider { width: 100%; margin: 0; accent-color: var(--accent); min-height: 44px; }
.ui .feel-scale { display: flex; justify-content: space-between; }
.ui .feel-scale span:nth-child(2) { text-align: center; }

/* Faint contour lines on Today's verdict card only (DESIGN.md 4, the operator's exception). Texture only: one layer
   behind the content in the neutral --wave token, through one tile of nested strokes that repeats without a seam, so
   it is one shade off the card's state fill. It takes no taps and no space. Gone when contrast matters most. */
.ui .verdict { position: relative; isolation: isolate; }
.ui .verdict::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background-color: var(--wave);
  --wave-tile: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='440'%20height='300'%3E%3Cpath%20d='M0%20-68L20%20-65L40%20-65L60%20-65L80%20-65L100%20-64L120%20-61L140%20-56L160%20-50L180%20-44L200%20-39L220%20-37L240%20-39L260%20-44L280%20-52L300%20-61L320%20-69L340%20-75L360%20-78L380%20-77L400%20-75L420%20-71L440%20-68M0%20-35L20%20-28L40%20-23L60%20-21L80%20-20L100%20-21L120%20-22L140%20-22L160%20-21L180%20-19L200%20-17L220%20-16L240%20-17L260%20-21L280%20-28L300%20-36L320%20-44L340%20-50L360%20-54L380%20-53L400%20-49L420%20-42L440%20-35M0%200L20%209L40%2016L60%2020L80%2021L100%2018L120%2014L140%209L160%204L180%201L200%200L220%200L240%20-0L260%20-1L280%20-4L300%20-9L320%20-14L340%20-18L360%20-21L380%20-20L400%20-16L420%20-9L440%20-0M0%2035L20%2042L40%2049L60%2053L80%2054L100%2050L120%2044L140%2036L160%2028L180%2021L200%2017L220%2016L240%2017L260%2019L280%2021L300%2022L320%2022L340%2021L360%2020L380%2021L400%2023L420%2028L440%2035M0%2068L20%2071L40%2075L60%2077L80%2078L100%2075L120%2069L140%2061L160%2052L180%2044L200%2039L220%2037L240%2039L260%2044L280%2050L300%2056L320%2061L340%2064L360%2065L380%2065L400%2065L420%2065L440%2068M0%2098L20%2095L40%2095L60%2095L80%2095L100%2094L120%2091L140%2086L160%2080L180%2074L200%2069L220%2067L240%2069L260%2074L280%2082L300%2091L320%2099L340%20105L360%20108L380%20107L400%20105L420%20101L440%2098M0%20125L20%20118L40%20113L60%20111L80%20110L100%20111L120%20112L140%20112L160%20111L180%20109L200%20107L220%20106L240%20107L260%20111L280%20118L300%20126L320%20134L340%20140L360%20144L380%20143L400%20139L420%20132L440%20125M0%20150L20%20141L40%20134L60%20130L80%20129L100%20132L120%20136L140%20141L160%20146L180%20149L200%20150L220%20150L240%20150L260%20151L280%20154L300%20159L320%20164L340%20168L360%20171L380%20170L400%20166L420%20159L440%20150M0%20175L20%20168L40%20161L60%20157L80%20156L100%20160L120%20166L140%20174L160%20182L180%20189L200%20193L220%20194L240%20193L260%20191L280%20189L300%20188L320%20188L340%20189L360%20190L380%20189L400%20187L420%20182L440%20175M0%20202L20%20199L40%20195L60%20193L80%20192L100%20195L120%20201L140%20209L160%20218L180%20226L200%20231L220%20233L240%20231L260%20226L280%20220L300%20214L320%20209L340%20206L360%20205L380%20205L400%20205L420%20205L440%20202M0%20232L20%20235L40%20235L60%20235L80%20235L100%20236L120%20239L140%20244L160%20250L180%20256L200%20261L220%20263L240%20261L260%20256L280%20248L300%20239L320%20231L340%20225L360%20222L380%20223L400%20225L420%20229L440%20232M0%20265L20%20272L40%20277L60%20279L80%20280L100%20279L120%20278L140%20278L160%20279L180%20281L200%20283L220%20284L240%20283L260%20279L280%20272L300%20264L320%20256L340%20250L360%20246L380%20247L400%20251L420%20258L440%20265M0%20300L20%20309L40%20316L60%20320L80%20321L100%20318L120%20314L140%20309L160%20304L180%20301L200%20300L220%20300L240%20300L260%20299L280%20296L300%20291L320%20286L340%20282L360%20279L380%20280L400%20284L420%20291L440%20300M0%20335L20%20342L40%20349L60%20353L80%20354L100%20350L120%20344L140%20336L160%20328L180%20321L200%20317L220%20316L240%20317L260%20319L280%20321L300%20322L320%20322L340%20321L360%20320L380%20321L400%20323L420%20328L440%20335'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask: var(--wave-tile) 0 0 / 440px 300px repeat; mask: var(--wave-tile) 0 0 / 440px 300px repeat;
}
@media (prefers-contrast: more), (forced-colors: active) {
  .ui .verdict::before { display: none; }
}
