/* 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;
  --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;
  --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;
  --sleep-deep: #5F86AD; --sleep-light: #93B7DC80;
  --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;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F4F2EE; --surface: #FFFFFF; --raised: #FFFFFF; --sunk: #ECE9E3;
  --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;
  --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;
  --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;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #F4F2EE; --surface: #FFFFFF; --raised: #FFFFFF; --sunk: #ECE9E3;
    --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;
    --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;
    --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;
    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; }
.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 .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); }
.ui .verdict-session { font-size: 1.0625rem; font-weight: 700; line-height: 1.4; color: var(--ink); }
.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; }
.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 .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); }
.ui .sec-h .sec-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--hue-soft); color: var(--hue); }
.ui .sec-h .sec-ic .msr { font-size: 18px; color: inherit; }
.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); }
.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); }

/* 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 .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(--raised); }
.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); }
.ui .ask-row > .ic:first-child { color: var(--accent); }
.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; }

/* 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 .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: 48px 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 .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: 48px 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; }
.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); }
.ui .empty { display: grid; gap: 12px; justify-items: start; color: var(--ink-2); }

/* 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(4, 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; }
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); }
.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 .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-links { display: flex; gap: 20px; }

/* 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; }
.ui .seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--raised); 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; }
.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 .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; }
.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; }
.ui .sb i.fast { right: 50%; background: var(--go); }
.ui .sb i.slow { left: 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; }
.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; }
.ui .zones { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; }
.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 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-card header { display: flex; gap: 12px; align-items: center; }
.ui .goal-card header > .ic { color: var(--accent); flex: none; }
.ui .goal-card h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.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; }
.ui .recovery { display: grid; gap: 10px; }
.ui .rec-row { display: grid; grid-template-columns: 24px 1fr 1.2fr auto; gap: 10px; align-items: center; font-size: 0.875rem; }
.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; }

/* 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); }
.ui .input-wrap { 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); }
.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 .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); }
.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; }
.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-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); }
.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 { display: grid; gap: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.ui .privacy p { padding-left: 30px; }
.ui .sheet-form { display: grid; gap: 14px; }
.ui .plain { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ui .btn[data-tone="alert"] { background: var(--alert); color: var(--on-accent); }

/* 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; }
.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-template-columns: repeat(5, 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; }
.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 .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; }
.ui .cal-form { gap: 12px; }
.ui .pair-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 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 .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 .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 { justify-self: start; }
.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 .streams { display: grid; gap: 4px; }
.ui .streams .sec-h { margin-bottom: 6px; }
.ui .stream p { margin: 0; }
/* Session type once confirmed: a quiet line and links, not a card. */
.ui .read-done { display: grid; gap: 0; padding-top: 4px; border-top: 1px solid var(--line); }
.ui .read-done p { margin: 0; }
.ui .read-actions { display: flex; flex-wrap: wrap; gap: 0 20px; }
.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(--hue-coach-soft); color: var(--hue-coach); }
