/* Palette. theme.js sets data-theme="light|dark" on <html> before first paint;
   cloud.css (sign-in) can rely on the same variables. */
:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --paper: #fff;
  --ink: #172c43;
  --muted: #5d6d82;
  --line: #e5eaf0;
  --blue: #4b7090;
  --mint: #abd8d1;
  --soft: #eef4f8;
  --field: #fbfcfd;
  --field-line: #dce4ec;
  --solid: #172c43;
  --on-solid: #fff;
  --on-solid-muted: #c9d5df;
  --chip-glass: #ffffff77;
  --hero: #172c43;
  --hero-ink: #fff;
  --hero-muted: #b4c4d1;
  --tint: #edf2f6;
  --ok: #3e7d6f;
  --ok-bg: #eaf4f0;
  --ok-line: #d6e8e0;
  --warn-ink: #80643e;
  --warn-bg: #fff9ef;
  --warn-line: #e8d8bb;
  --danger: #9d5c57;
  --workout-bg: #eef6f3;
  --workout-line: #d9e8e1;
  --study-ink: #6a5fa6;
  --study-bg: #f3f1fb;
  --study-line: #e2ddf4;
  --event-ink: #956a2e;
  --event-bg: #fcf6ec;
  --event-line: #efe2c9;
  --glass: #ffffffeb;
  --overlay: #10253c66;
  --shadow: #172c4314;
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Noto Sans HK", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1620;
  --paper: #16212d;
  --ink: #e6edf4;
  --muted: #95a5b7;
  --line: #263443;
  --blue: #8db5d6;
  --mint: #9fd3c9;
  --soft: #1c2937;
  --field: #111b26;
  --field-line: #2f4052;
  --solid: #dbe7f1;
  --on-solid: #0e1620;
  --on-solid-muted: #4d6175;
  --chip-glass: #ffffff10;
  --hero: #1b2c3e;
  --hero-ink: #f1f5f9;
  --hero-muted: #a9bccc;
  --tint: #132030;
  --ok: #82c7b6;
  --ok-bg: #15302a;
  --ok-line: #224a40;
  --warn-ink: #e6c792;
  --warn-bg: #2a2317;
  --warn-line: #4a3c22;
  --danger: #ec9f97;
  --workout-bg: #13292a;
  --workout-line: #22423f;
  --study-ink: #c3baf0;
  --study-bg: #1e1f36;
  --study-line: #33325a;
  --event-ink: #e8be80;
  --event-bg: #2a2218;
  --event-line: #4a3a22;
  --glass: #16212dea;
  --overlay: #000000a6;
  --shadow: #00000040;
}
/* Without theme.js (for example if it fails to load), follow the system. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0e1620;
    --paper: #16212d;
    --ink: #e6edf4;
    --muted: #95a5b7;
    --line: #263443;
    --blue: #8db5d6;
    --soft: #1c2937;
    --field: #111b26;
    --field-line: #2f4052;
    --solid: #dbe7f1;
    --on-solid: #0e1620;
    --on-solid-muted: #4d6175;
    --chip-glass: #ffffff10;
    --hero: #1b2c3e;
    --tint: #132030;
    --glass: #16212dea;
  }
}
body {
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #73a9c7;
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
  color: inherit;
  background: none;
}
svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 42px;
  letter-spacing: -1.7px;
  font-weight: 600;
  line-height: 1.12;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  font-weight: 600;
}
h3 {
  font-size: 16px;
  font-weight: 600;
}
p {
  line-height: 1.6;
}
small {
  font-size: 12px;
}
button {
  min-height: 44px;
}
.app-shell {
  max-width: 1600px;
  margin: auto;
  min-height: 100dvh;
}
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 246px;
  padding: 43px 24px 25px 30px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -1px;
}
.brand-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px var(--shadow);
}
.brand small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.65px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
.desktop-nav {
  margin-top: 63px;
  display: grid;
  gap: 9px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 49px;
  padding: 12px 16px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.nav-item.active {
  background: var(--soft);
  color: var(--ink);
}
.nav-item.active svg {
  stroke-width: 2;
}
.sidebar-note {
  margin-top: auto;
  font-size: 12px;
  color: var(--blue);
  padding: 30px 12px;
}
.sidebar-note p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6f9e94;
  margin-right: 7px;
}
.profile {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.profile small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 4px;
}
.avatar {
  background: #eef2f6;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}
main {
  margin-left: 246px;
  padding: 45px 48px 60px;
  max-width: 1350px;
}
.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 30px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 30px;
  padding: 7px 11px;
  font-size: 10px;
}
.pill svg {
  width: 13px;
  height: 13px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 29px;
}
.intro p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 11px;
}
.intro .date-number {
  font-size: 58px;
  font-weight: 300;
  letter-spacing: -3px;
  line-height: 1;
  text-align: right;
}
.date-number small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 500;
  margin-top: 10px;
  color: var(--muted);
}
.week-strip {
  display: grid;
  grid-template-columns: 44px repeat(7, 1fr) 44px;
  gap: 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin-bottom: 29px;
}
.day-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 10px 3px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 10px;
}
.day-button strong {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}
.day-button.active {
  background: var(--solid);
  color: #c9d5df;
}
.day-button.active strong {
  color: var(--on-solid);
}
.day-button .day-dot {
  height: 3px;
  width: 3px;
  border-radius: 50%;
  background: var(--blue);
}
.day-button.active .day-dot {
  background: var(--mint);
}
.day-button .day-dot.empty {
  background: transparent;
}
.arrow-button {
  align-self: center;
  padding: 0;
  display: grid;
  place-items: center;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(275px, 0.9fr);
  gap: 26px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
}
.section-heading .text-button {
  font-size: 12px;
  color: var(--blue);
  padding: 0 4px;
}
.text-button {
  color: var(--blue);
  font-size: 13px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.training-card {
  background: var(--hero);
  color: var(--hero-ink);
  position: relative;
  overflow: hidden;
  border: 0;
  padding: 27px;
  margin-bottom: 26px;
}
.training-card .eyebrow {
  color: #a9c2d4;
  font-size: 9px;
}
.training-card .training-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.training-glyph {
  width: 43px;
  height: 43px;
  border: 1px solid #52687b;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--mint);
  flex-shrink: 0;
}
.training-card h3 {
  font-size: 25px;
  letter-spacing: -0.7px;
  font-weight: 500;
  margin-top: 14px;
}
.training-card p {
  font-size: 12px;
  color: var(--hero-muted);
  margin-top: 8px;
  max-width: 310px;
}
.training-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 11px;
  color: #d7e1e9;
  margin-top: 19px;
}
.training-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.training-meta svg {
  width: 14px;
  height: 14px;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--solid);
  color: var(--on-solid);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.primary svg {
  width: 16px;
  height: 16px;
}
.training-card .primary {
  background: #e3f1ee;
  color: #172c43;
  width: 100%;
  min-height: 48px;
  font-size: 14px;
}
.training-actions {
  margin-top: 23px;
  display: grid;
  gap: 8px;
}
.alternatives {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.alternatives button {
  padding: 5px 12px;
  min-height: 35px;
  border: 1px solid #536779;
  border-radius: 20px;
  font-size: 10px;
  color: #dae4ec;
}
.timeline {
  position: relative;
  padding-left: 22px;
}
.timeline:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 25px;
  width: 1px;
  background: #d9e1e9;
}
.event-row {
  position: relative;
  margin-bottom: 18px;
}
.event-row:before {
  content: "";
  position: absolute;
  left: -22px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: #8fa9bf;
}
.event-row.workout:before {
  background: #75a99c;
}
.event-time {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}
.event-card {
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.event-card h3 {
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.event-card p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}
.event-card p svg {
  width: 13px;
  height: 13px;
  margin-top: 2px;
  flex-shrink: 0;
}
.event-card .tag {
  display: inline-block;
  font-size: 8px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}
.event-row.workout .event-card {
  background: #eef6f3;
  border-color: #d9e8e1;
}
.empty-state {
  padding: 28px 20px;
  background: var(--paper);
  border: 1px dashed #d6e0e8;
  border-radius: 17px;
  color: var(--muted);
  font-size: 12px;
}
.empty-state h3 {
  color: var(--ink);
  margin-bottom: 7px;
}
.empty-state p {
  margin-bottom: 12px;
}
.nutrition-card {
  padding: 25px;
  margin-bottom: 20px;
}
.nutrition-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.nutrition-head .eyebrow {
  font-size: 9px;
}
.nutrition-head svg {
  color: var(--blue);
}
.calorie-value {
  font-size: 45px;
  font-weight: 500;
  letter-spacing: -2px;
  line-height: 1;
}
.calorie-value small {
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 400;
  margin-left: 5px;
}
.calorie-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 9px;
}
.nutrition-card progress {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  margin: 21px 0 10px;
  background: #edf1f5;
  appearance: none;
}
.nutrition-card progress::-webkit-progress-bar {
  background: #edf1f5;
  border-radius: 6px;
}
.nutrition-card progress::-webkit-progress-value {
  background: #7fa5ba;
  border-radius: 6px;
}
.nutrition-card progress::-moz-progress-bar {
  background: #7fa5ba;
}
.target-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}
.macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.macro strong {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.macro strong small {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 2px;
}
.macro p {
  font-size: 9px;
  color: var(--muted);
  margin-top: 5px;
}
.macro-dot {
  width: 5px;
  height: 5px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 4px;
  background: #739ab3;
}
.macro:nth-child(2) .macro-dot {
  background: #acc9c3;
}
.macro:nth-child(3) .macro-dot {
  background: #c6bbac;
}
.nutrition-card .secondary {
  width: 100%;
  margin-top: 22px;
}
.secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 11px;
  padding: 11px 15px;
  font-size: 12px;
}
.secondary svg {
  width: 15px;
  height: 15px;
}
.meal-list {
  display: grid;
  gap: 0;
}
.meal-row {
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.meal-row:last-child {
  border-bottom: 0;
}
.meal-symbol {
  width: 34px;
  height: 34px;
  background: var(--soft);
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--blue);
  flex-shrink: 0;
}
.meal-symbol svg {
  width: 17px;
  height: 17px;
}
.meal-row .meal-copy {
  flex: 1;
  min-width: 0;
}
.meal-row h3 {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.meal-row p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.meal-row .meal-energy {
  text-align: right;
  font-size: 13px;
  flex-shrink: 0;
}
.meal-energy small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  margin-top: 3px;
}
.meal-row .icon-button {
  padding: 6px;
  min-width: 34px;
  min-height: 44px;
}
.icon-button svg {
  width: 16px;
  height: 16px;
}
.coach-link {
  margin-top: 24px;
  padding: 21px;
  border-radius: 17px;
  background: #eaf0f5;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
}
.coach-link .coach-icon {
  background: var(--paper);
  border-radius: 12px;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.coach-link h3 {
  font-size: 12px;
}
.coach-link p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.coach-link > svg {
  margin-left: auto;
  width: 17px;
}
.sync-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  gap: 8px;
  margin-top: 20px;
  line-height: 1.5;
}
.sync-note button {
  font-size: 10px;
  color: var(--blue);
  min-height: 36px;
  flex-shrink: 0;
}
.warning {
  border: 1px solid #e8d8bb;
  border-radius: 12px;
  background: #fff9ef;
  padding: 13px 16px;
  margin-bottom: 20px;
  font-size: 12px;
  color: #80643e;
  line-height: 1.5;
}
.page-header {
  margin-bottom: 30px;
}
.page-header p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}
.week-column {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  min-height: 300px;
  padding: 13px 9px;
}
.week-column.selected {
  border-color: #9fb7c9;
}
.week-column > button {
  width: 100%;
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  margin-bottom: 10px;
}
.week-column > button strong {
  font-size: 18px;
  color: var(--ink);
}
.week-event {
  padding: 12px 9px;
  border-radius: 10px;
  background: var(--soft);
  margin-bottom: 8px;
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.week-event time {
  font-size: 9px;
  display: block;
  color: var(--blue);
  margin-bottom: 7px;
}
.week-event small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  margin-top: 7px;
}
.week-event.workout {
  background: #eaf5ef;
}
.week-empty {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin-top: 50px;
}
.weekly-summary {
  margin-top: 25px;
  display: flex;
  gap: 18px;
  align-items: center;
}
.weekly-summary strong {
  font-size: 24px;
  font-weight: 500;
}
.weekly-summary p {
  font-size: 12px;
  color: var(--muted);
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.settings-card h2 {
  margin-bottom: 8px;
}
.settings-card > p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.field.full {
  grid-column: 1/-1;
}
.field input,
.field select {
  height: 46px;
  width: 100%;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  padding: 0 12px;
  font-size: 13px;
  min-width: 0;
}
.field small {
  font-size: 10px;
  line-height: 1.5;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.check {
  font-size: 11px;
  color: var(--ink);
  background: #f5f8fa;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.check input {
  accent-color: var(--blue);
  width: 14px;
  height: 14px;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
}
.data-section {
  margin-top: 22px;
}
.data-section p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.danger {
  color: #9d5c57;
}
.install-card {
  margin-top: 22px;
  background: var(--soft);
  border: 0;
}
.install-card h3 {
  margin-bottom: 8px;
}
.install-card ol {
  padding-left: 20px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}
/* Coach: header, scrolling conversation, composer pinned to the bottom. */
.chat-page {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 105px);
  min-height: 420px;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.coach-avatar {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--hero);
  color: var(--mint);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.coach-avatar.large {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  margin: 0 auto 14px;
}
.chat-title {
  flex: 1;
  min-width: 0;
}
.chat-title h1 {
  font-size: 19px;
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.chat-title p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-title p::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9d3dc;
}
.chat-title p.ready::before {
  background: #5fa596;
}
.chat-title p.unavailable::before {
  background: #d1a45f;
}
.chip-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--ink);
}
.chip-button svg {
  width: 16px;
  height: 16px;
  color: var(--blue);
}
.chat-messages {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 2px;
}
.chat-empty {
  margin: auto 0;
  text-align: center;
  padding: 20px 8px;
}
.chat-greeting {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.35;
}
.chat-empty .subtle {
  max-width: 400px;
  margin: 8px auto 0;
  font-size: 12px;
}
.chat-empty .secondary {
  margin: 18px auto 0;
}
.prompt-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}
.prompt-chips button {
  font-size: 13px;
  border: 1px solid #d8e2ea;
  border-radius: 22px;
  padding: 10px 15px;
  background: var(--paper);
  color: var(--ink);
}
.msg-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-row.user {
  align-items: flex-end;
}
.msg-row.assistant {
  align-items: flex-start;
}
.message {
  max-width: 85%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.message.user {
  background: var(--solid);
  color: var(--on-solid);
  border-bottom-right-radius: 6px;
  white-space: pre-wrap;
}
.message.assistant {
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.message.assistant p {
  line-height: 1.55;
}
.message.assistant p + p,
.message.assistant p + ul,
.message.assistant p + ol,
.message.assistant ul + p,
.message.assistant ol + p {
  margin-top: 8px;
}
.message.assistant ul,
.message.assistant ol {
  margin: 4px 0 0;
  padding-left: 20px;
}
.message.assistant li + li {
  margin-top: 3px;
}
.message.assistant code {
  font-size: 0.92em;
  background: var(--soft);
  padding: 1px 4px;
  border-radius: 5px;
}
.msg-heading {
  font-weight: 600;
}
.message.system {
  align-self: flex-start;
  background: #fff9ef;
  border: 1px solid #eadfcf;
  color: #80643e;
  font-size: 13px;
}
.msg-attach {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: #c9d5df;
}
.msg-attach svg {
  width: 14px;
  height: 14px;
}
.msg-error {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 85%;
  font-size: 12px;
  color: #9d5c57;
  text-align: right;
}
.msg-error button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  color: var(--ink);
  border: 1px solid #e3cfcc;
  background: var(--paper);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 12px;
}
.msg-error svg {
  width: 14px;
  height: 14px;
}
.typing {
  padding: 14px 16px;
}
.dots {
  display: flex;
  gap: 5px;
}
.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9fb2c2;
  animation: blink 1.2s infinite ease-in-out;
}
.dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.3;
  }
  40% {
    opacity: 1;
  }
}
.proposal {
  max-width: 85%;
  min-width: 230px;
  background: #eaf4f0;
  border: 1px solid #d6e8e0;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.proposal .eyebrow {
  font-size: 9px;
  letter-spacing: 1.4px;
}
.proposal strong {
  font-size: 15px;
}
.proposal p {
  font-size: 13px;
}
.proposal .primary {
  margin-top: 8px;
  font-size: 13px;
}
.proposal-saved {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #3e7d6f;
  font-size: 12px;
  font-weight: 600;
}
.proposal-saved svg {
  width: 15px;
  height: 15px;
}
.chat-compose {
  flex-shrink: 0;
  background: var(--bg);
  padding: 10px 0 4px;
}
.compose-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid #d5dfe8;
  border-radius: 24px;
  background: var(--paper);
  padding: 5px;
  box-shadow: 0 4px 18px #172c430a;
}
.compose-box:focus-within {
  border-color: #9fbbd0;
}
.compose-box textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 150px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 11px 4px;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.4;
  min-width: 0;
  overflow-y: auto;
}
.compose-box textarea:focus-visible {
  outline: 0;
}
.compose-box button {
  border-radius: 50%;
  background: var(--solid);
  color: var(--on-solid);
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.compose-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
  line-height: 1.4;
}
.bottom-nav {
  display: none;
}
dialog {
  width: min(480px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0;
  color: var(--ink);
  max-height: 90dvh;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 25px 100px #172c4333;
}
dialog.tall {
  width: min(620px, calc(100% - 32px));
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog::backdrop {
  background: #10253c66;
  backdrop-filter: blur(3px);
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}
.dialog-header button {
  padding: 0;
  width: 40px;
}
.dialog-header h2 {
  font-size: 23px;
}
.dialog-description {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
}
.dialog-actions {
  display: flex;
  gap: 9px;
  margin-top: 24px;
}
.dialog-actions .primary {
  flex: 1;
}
.dialog-error {
  font-size: 12px;
  color: #9d5c57;
  margin-top: 12px;
}
.hidden {
  display: none !important;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 13px 20px;
  border-radius: 12px;
  background: var(--solid);
  color: var(--on-solid);
  font-size: 12px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  max-width: 85%;
  text-align: center;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.loading {
  color: var(--muted);
  padding: 50px;
  font-size: 14px;
}
.footer-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 25px;
  text-align: center;
}
.subtle {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.pending {
  font-size: 12px;
  color: var(--muted);
  padding: 10px;
}
.date-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.date-actions span {
  font-size: 14px;
  flex: 1;
  text-align: center;
}
.today-button {
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 8px 13px;
  border-radius: 10px;
}
.stats-line {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}
.view-enter {
  animation: appear 0.3s ease-out;
}
@keyframes appear {
  from {
    opacity: 0.3;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1600px) {
  .sidebar {
    margin-left: 0;
  }
  main {
    max-width: 1354px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 205px;
    padding-left: 22px;
    padding-right: 18px;
  }
  main {
    margin-left: 205px;
    padding: 35px 28px;
  }
  .content-grid {
    gap: 20px;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.9fr);
  }
  h1 {
    font-size: 36px;
  }
  .week-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  main {
    margin: 0;
    padding: calc(25px + env(safe-area-inset-top)) 22px
      calc(100px + env(safe-area-inset-bottom));
  }
  .topline {
    margin-bottom: 25px;
    font-size: 10px;
  }
  .topline .eyebrow {
    font-size: 9px;
    letter-spacing: 1.7px;
  }
  .pill {
    font-size: 9px;
    padding: 6px 9px;
  }
  .intro {
    margin-bottom: 25px;
  }
  h1 {
    font-size: 35px;
    letter-spacing: -1.35px;
  }
  .intro p {
    font-size: 12px;
    margin-top: 9px;
    max-width: 240px;
  }
  .intro .date-number {
    font-size: 47px;
  }
  .date-number small {
    font-size: 8px;
    letter-spacing: 1.2px;
  }
  .week-strip {
    grid-template-columns: 26px repeat(7, minmax(0, 1fr)) 26px;
    gap: 2px;
    margin-bottom: 25px;
    padding: 9px 0;
  }
  .day-button {
    font-size: 9px;
    gap: 8px;
    padding: 9px 1px;
    border-radius: 11px;
  }
  .day-button strong {
    font-size: 15px;
  }
  .arrow-button svg {
    width: 17px;
  }
  .content-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
  }
  .training-card {
    padding: 24px;
    margin-bottom: 25px;
  }
  .training-card h3 {
    font-size: 25px;
  }
  .training-card p {
    font-size: 12px;
  }
  .section-heading {
    margin-bottom: 13px;
  }
  h2 {
    font-size: 19px;
  }
  .nutrition-card {
    padding: 24px;
  }
  .nutrition-card progress {
    margin-top: 19px;
  }
  .nutrition-card .secondary {
    margin-top: 20px;
  }
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--glass);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    z-index: 5;
  }
  .bottom-nav .nav-item {
    flex-direction: column;
    gap: 5px;
    padding: 5px 3px;
    border-radius: 12px;
    font-size: 9px;
    min-height: 48px;
  }
  .bottom-nav .nav-item.active {
    background: transparent;
    color: var(--ink);
  }
  .bottom-nav .nav-item.active svg {
    color: var(--blue);
  }
  .bottom-nav svg {
    width: 21px;
    height: 21px;
  }
  .sync-note {
    margin-top: 16px;
  }
  .week-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .week-column {
    min-height: 0;
    padding: 15px;
    display: grid;
    grid-template-columns: 53px 1fr;
    gap: 0 12px;
  }
  .week-column > button {
    grid-row: 1/10;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    margin: 0;
    padding: 5px;
    align-self: start;
  }
  .week-event {
    margin-bottom: 6px;
    font-size: 12px;
    padding: 13px;
  }
  .week-event time {
    font-size: 10px;
  }
  .week-event small {
    font-size: 10px;
  }
  .week-empty {
    margin: 0;
    padding: 14px 0;
    text-align: left;
    font-size: 11px;
  }
  .weekly-summary {
    padding: 20px;
  }
  .settings-grid {
    gap: 16px;
  }
  .settings-card {
    padding: 23px;
  }
  .form-grid {
    gap: 16px 12px;
  }
  .field {
    font-size: 11px;
  }
  .field input,
  .field select {
    font-size: 16px;
  }
  /* The Coach screen tracks the visual viewport so the composer stays above
     the keyboard and the bottom navigation. */
  body[data-route="coach"] main {
    padding: 0;
  }
  body[data-route="coach"] .view-enter {
    animation: none;
  }
  .chat-page {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--visual-top, 0px);
    height: calc(
      var(--visual-height, 100dvh) - 65px - env(safe-area-inset-bottom)
    );
    min-height: 0;
    max-width: none;
    padding: env(safe-area-inset-top) 16px 0;
    background: var(--bg);
  }
  .keyboard-open .chat-page {
    height: var(--visual-height, 100dvh);
  }
  .chat-header {
    padding: 10px 0 10px;
    gap: 10px;
  }
  .chip-button span {
    display: none;
  }
  .chip-button {
    width: 44px;
    justify-content: center;
    padding: 0;
  }
  .chat-messages {
    padding: 14px 0;
  }
  .prompt-chips {
    flex-direction: column;
    align-items: stretch;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
  .prompt-chips button {
    min-height: 44px;
  }
  .message,
  .proposal,
  .msg-error {
    max-width: 88%;
  }
  .chat-compose {
    padding: 8px 0 8px;
  }
  .keyboard-open .chat-compose {
    padding-bottom: 6px;
  }
  .keyboard-open .compose-note {
    display: none;
  }
  .compose-note {
    font-size: 10px;
  }
  #toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
  .page-header h1 {
    font-size: 34px;
  }
  .page-header p {
    font-size: 12px;
  }
  .footer-note {
    font-size: 9px;
  }
  .card.data-section .form-actions {
    flex-wrap: wrap;
  }
  dialog .field input,
  dialog .field select {
    font-size: 16px;
  }
}
@media (max-width: 360px) {
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  h1 {
    font-size: 30px;
  }
  .intro .date-number {
    font-size: 40px;
  }
  .intro p {
    max-width: 210px;
    font-size: 11px;
  }
  .training-meta {
    gap: 10px;
    font-size: 10px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
}
.city-card {
  border: 1px solid var(--line);
  background: #edf2f6;
  border-radius: 22px;
  overflow: hidden;
  margin-bottom: 29px;
}
.city-heading {
  padding: 22px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.city-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 1.7px;
}
.city-heading h2 {
  font-size: 23px;
  font-weight: 500;
  margin-top: 7px;
  letter-spacing: -0.8px;
}
.city-tag {
  border: 1px solid #cbd9e3;
  border-radius: 20px;
  padding: 6px 9px;
  font-size: 8px;
  color: var(--blue);
  white-space: nowrap;
}
.city-scene {
  height: 285px;
  position: relative;
  overflow: hidden;
  touch-action: none;
}
.city-scene canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.city-loading,
.city-fallback {
  padding: 80px 30px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.city-fallback small {
  display: block;
  margin-top: 15px;
}
.map-label {
  position: absolute;
  transform: translate(-50%, -100%);
  min-height: 25px;
  padding: 5px 9px;
  background: #ffffffec;
  border: 1px solid #d5e1e9;
  border-radius: 7px;
  font-size: 9px;
  white-space: nowrap;
  box-shadow: 0 3px 12px #172c4310;
}
.city-controls {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 0 24px;
  margin-top: -7px;
  position: relative;
}
.city-controls button {
  background: #ffffff77;
  border: 1px solid #d7e1e8;
  border-radius: 9px;
  padding: 8px 12px;
  min-height: 36px;
  font-size: 10px;
}
.city-controls button.active {
  background: var(--solid);
  color: var(--on-solid);
  border-color: var(--solid);
}
.city-detail {
  padding: 16px 24px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.city-detail strong {
  font-size: 11px;
  font-weight: 600;
}
.city-detail span {
  font-size: 10px;
  color: var(--muted);
}
.city-caption {
  padding: 8px 24px 18px;
  font-size: 9px;
  color: var(--muted);
}
.event-time,
time,
.calorie-value,
.macro strong {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  .city-card {
    margin-bottom: 25px;
    border-radius: 19px;
  }
  .city-heading {
    padding: 19px 18px 0;
  }
  .city-heading h2 {
    font-size: 20px;
  }
  .city-scene {
    height: 245px;
  }
  .city-controls {
    padding: 0 15px;
    gap: 5px;
  }
  .city-controls button {
    font-size: 9px;
    padding: 7px 9px;
    min-height: 40px;
  }
  .city-detail {
    padding: 13px 18px 0;
    gap: 4px;
    flex-direction: column;
    align-items: flex-start;
  }
  .city-caption {
    padding: 8px 18px 16px;
    font-size: 8px;
    line-height: 1.6;
  }
  .map-label {
    font-size: 8px;
    padding: 5px 7px;
  }
  .city-tag {
    font-size: 7px;
    padding: 5px 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.training-card {
  border-radius: 22px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 26px;
  align-items: stretch;
  margin-bottom: 28px;
}
.hero-grid > .training-card,
.hero-grid > .route-card {
  margin-bottom: 0;
}
.hero-grid .city-scene {
  height: 210px;
}
.hero-grid .city-heading h2 {
  font-size: 21px;
}
.hero-grid .training-card {
  display: flex;
  flex-direction: column;
}
.hero-grid .training-card > .training-actions {
  margin-top: auto;
}
.hero-grid .training-meta {
  margin-bottom: 23px;
}
.hero-grid .training-card p {
  max-width: none;
}
.hero-grid .training-card h3 .subtle {
  color: #a9c2d4;
}
.hero-grid .city-detail {
  gap: 4px;
  flex-direction: column;
  align-items: flex-start;
}
@media (max-width: 760px) {
  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 25px;
  }
  .hero-grid .city-scene {
    height: 245px;
  }
  .hero-grid .training-card {
    padding: 24px;
  }
  .hero-grid .city-heading h2 {
    font-size: 20px;
  }
  .hero-grid .training-card > .training-actions {
    margin-top: 0;
  }
  .hero-grid .training-meta {
    margin-bottom: 23px;
  }
}
.alternatives button,
.city-controls button,
.sync-note button {
  min-height: 44px;
}
.icon-button {
  min-width: 44px;
}
dialog {
  max-height: min(90dvh, calc(var(--visual-height, 100dvh) - 24px));
}
.keyboard-open .bottom-nav {
  display: none;
}
.keyboard-open .chat-compose {
  bottom: 0;
}
.keyboard-open main {
  padding-bottom: 24px;
}
.compose-box .photo-button {
  background: var(--soft);
  color: var(--blue);
}
.photo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 10px;
  border-radius: 14px;
  margin-bottom: 10px;
}
.photo-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 9px;
}
.photo-preview span {
  font-size: 10px;
  color: var(--muted);
  flex: 1;
}
.photo-preview button {
  width: 44px;
  flex-shrink: 0;
}
.photo-preview img {
  width: 56px;
  height: 56px;
}
.photo-preview span {
  font-size: 12px;
  line-height: 1.4;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Getting there: Apple Maps driving links and the optional 3D overview. */
.route-card {
  border: 1px solid var(--line);
  background: #edf2f6;
  border-radius: 22px;
  overflow: hidden;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
}
.route-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.route-head .eyebrow {
  font-size: 9px;
  letter-spacing: 1.7px;
}
.route-head h2 {
  font-size: 21px;
  font-weight: 500;
  margin-top: 6px;
  letter-spacing: -0.6px;
}
.route-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #cbd9e3;
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 10px;
  color: var(--blue);
  white-space: nowrap;
}
.route-tag svg {
  width: 14px;
  height: 14px;
}
.route-links {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.route-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid #dbe4ec;
  border-radius: 15px;
}
.route-link:active {
  background: #f4f8fb;
}
.route-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--hero);
  color: var(--mint);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.route-icon.home {
  background: #e3f1ee;
  color: #3e7d6f;
}
.route-copy {
  flex: 1;
  min-width: 0;
}
.route-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.route-copy small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-open {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--blue);
  flex-shrink: 0;
}
.route-open svg {
  width: 15px;
  height: 15px;
}
.route-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}
.city-toggle {
  align-self: flex-start;
  font-size: 12px;
  color: var(--blue);
  padding: 0;
  margin-top: 4px;
}
#city-panel {
  margin: 4px -22px -18px;
  border-top: 1px solid #dbe4ec;
}
#city-panel .city-controls {
  margin-top: -7px;
}
#city-panel .city-scene {
  height: 220px;
}
.city-controls button {
  padding: 8px 14px;
  font-size: 12px;
}
.city-detail strong {
  font-size: 12px;
}
.city-detail span {
  font-size: 11px;
}

/* Sheets: header, scrolling body, sticky actions. Bottom sheet on iPhone. */
.sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(90dvh, calc(var(--visual-height, 100dvh) - 24px));
  width: 100%;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sheet-head h2 {
  font-size: 21px;
  line-height: 1.25;
}
.sheet-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}
.sheet-head .icon-button {
  width: 44px;
  height: 44px;
  margin: -8px -10px 0 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  flex-shrink: 0;
}
.sheet-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}
.sheet-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
}
.sheet-foot .primary {
  flex: 1;
  min-height: 48px;
  font-size: 14px;
}
.sheet-foot .secondary {
  min-height: 48px;
  font-size: 14px;
}
.sheet-foot .text-button {
  padding: 0 6px;
}
.sheet-note {
  margin-top: 14px;
}
.field fieldset,
fieldset.field {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
fieldset.field legend {
  padding: 0;
  margin-bottom: 8px;
}
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.segmented label {
  position: relative;
}
.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}
.segmented span {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #f7f9fb;
  color: var(--ink);
  font-size: 13px;
}
.segmented input:checked + span {
  background: var(--solid);
  border-color: var(--solid);
  color: var(--on-solid);
}
.segmented input:focus-visible + span {
  outline: 3px solid #73a9c7;
  outline-offset: 2px;
}
.check {
  min-height: 44px;
  font-size: 13px;
}
.check input {
  width: 18px;
  height: 18px;
}
.checks.days .check {
  min-width: 60px;
  justify-content: center;
}
.stepper-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--field);
}
.stepper button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.stepper output {
  min-width: 58px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.mult-chips {
  display: flex;
  gap: 6px;
}
.mult-chips button {
  min-width: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  font-size: 13px;
}
.mult-chips button[aria-pressed="true"] {
  background: var(--soft);
  border-color: #9fbbd0;
  font-weight: 600;
}

/* Workout sheet */
.session-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.session-stats span {
  font-size: 12px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 10px;
  padding: 7px 10px;
}
.session-stats strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.session-stats span.done {
  background: #e3f1ee;
  color: #3e7d6f;
}
.session-note {
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0 16px;
  line-height: 1.5;
}
.exercise {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 8px;
  margin-bottom: 12px;
  background: #fcfdfe;
}
.exercise-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.exercise-index {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--solid);
  color: var(--on-solid);
  font-size: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.exercise-name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 6px;
  background: transparent;
  color: var(--ink);
}
.exercise-name:hover,
.exercise-name:focus {
  border-color: #dce4ec;
  background: var(--paper);
}
.exercise .icon-button {
  color: var(--muted);
  display: grid;
  place-items: center;
}
.exercise-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.exercise-meta input {
  width: 64px;
  height: 36px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  padding: 0 6px;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
}
.exercise-cue {
  font-size: 12px;
  color: #56677b;
  margin-top: 6px;
  line-height: 1.45;
}
.exercise-last {
  font-size: 12px;
  color: #3e7d6f;
  margin-top: 6px;
  line-height: 1.45;
}
.set-table {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}
.set-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) 46px 36px;
  gap: 6px;
  align-items: center;
}
.set-header {
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.set-index {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.set-row input:not([type="checkbox"]) {
  height: 44px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
.set-row.done input:not([type="checkbox"]) {
  background: #eef6f3;
  border-color: #d2e6dd;
}
.set-na {
  text-align: center;
  color: var(--muted);
}
.set-check {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid #cfdbe5;
  display: grid;
  place-items: center;
  color: transparent;
  background: var(--paper);
  cursor: pointer;
}
.set-check input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.set-check:has(input:checked) {
  background: #3e7d6f;
  border-color: #3e7d6f;
  color: #fff;
}
.set-check:has(input:focus-visible) {
  outline: 3px solid #73a9c7;
  outline-offset: 2px;
}
.set-remove {
  width: 36px;
  min-height: 44px;
  display: grid;
  place-items: center;
  color: #a2afbd;
}
.set-remove svg {
  width: 15px;
  height: 15px;
}
.exercise-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.exercise-actions .text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.exercise-actions .text-button svg {
  width: 15px;
  height: 15px;
}
.swap select {
  height: 40px;
  max-width: 190px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--blue);
  font-size: 13px;
  padding: 0 8px;
}
.add-exercise {
  margin-top: 6px;
  display: grid;
  gap: 6px;
}
.add-exercise .text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
}
.add-exercise .text-button svg {
  width: 15px;
  height: 15px;
}

/* Today itinerary workout actions */
.workout-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  border-radius: 12px;
  background: var(--solid);
  color: var(--on-solid);
  font-size: 13px;
  font-weight: 600;
}
.workout-open svg {
  width: 16px;
  height: 16px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 4px;
}
button.week-event {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 0;
}

/* You */
.you-jump {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: -12px -4px 18px;
  padding: 0 4px 4px;
  scrollbar-width: none;
}
.you-jump::-webkit-scrollbar {
  display: none;
}
.you-jump button {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 20px;
  padding: 0 14px;
  font-size: 13px;
}
.account-card {
  margin-bottom: 22px;
  padding: 18px 20px;
}
.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.account-row > div {
  flex: 1;
  min-width: 0;
}
.account-row h2 {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.account-row p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.settings-card,
.install-card {
  scroll-margin-top: 20px;
}
.view-enter > form ~ .card {
  margin-top: 22px;
}
.settings-card > p.notice {
  font-size: 13px;
  margin-bottom: 0;
}
.settings-card > p:last-child {
  margin-bottom: 0;
}
.settings-card fieldset.field {
  font-size: 12px;
}
.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 10px;
  background: #ffffffe8;
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.save-bar .primary {
  min-height: 48px;
  font-size: 14px;
}
.library {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.library summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}
.library h4 {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 6px;
}
.library ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.library li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.library li span {
  font-size: 12px;
  color: var(--muted);
}
.library-empty {
  margin-top: 16px;
  font-size: 12px;
  color: #80643e;
}
.log-list {
  display: grid;
}
.log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  min-height: 56px;
}
.log-row:last-child {
  border-bottom: 0;
}
.log-row > span:first-child {
  flex: 1;
  min-width: 0;
}
.log-row strong {
  display: block;
  font-size: 14px;
}
.log-row small {
  color: var(--muted);
}
.log-state {
  font-size: 11px;
  color: var(--muted);
}
.log-state.done {
  color: #3e7d6f;
  font-weight: 600;
}
.log-row > svg {
  width: 16px;
  color: var(--muted);
}
.notice {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
  margin-top: 10px;
}
.notice.ok {
  background: #eaf4f0;
  color: #2f6a5d;
}
.notice.warn {
  background: #fff9ef;
  color: #80643e;
}
.notice.muted {
  color: var(--muted);
}
.reminder-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 12px;
}
.reminder-row .field {
  min-width: 150px;
}
.reminder-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.reminder-actions .primary,
.reminder-actions .secondary {
  min-height: 46px;
  font-size: 13px;
}
.install-card h2 {
  margin-bottom: 10px;
}
.install-card ol {
  font-size: 13px;
  line-height: 1.8;
  color: #4d5f73;
}
.install-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #2f6a5d;
}
.form-actions.wrap {
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .route-card {
    padding: 19px 16px 14px;
    border-radius: 19px;
  }
  #city-panel {
    margin: 4px -16px -14px;
  }
  .route-head h2 {
    font-size: 19px;
  }
  dialog.sheet-dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    max-height: calc(var(--visual-height, 100dvh) - 12px);
  }
  dialog.sheet-dialog .sheet {
    max-height: calc(var(--visual-height, 100dvh) - 12px);
  }
  dialog.sheet-dialog.tall,
  dialog.sheet-dialog.tall .sheet {
    height: calc(var(--visual-height, 100dvh) - 12px);
  }
  .sheet-head {
    padding: 18px 16px 12px;
  }
  .sheet-body {
    padding: 16px 16px 20px;
  }
  .sheet-foot {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }
  .keyboard-open .sheet-foot {
    padding-bottom: 10px;
  }
  /* With the keyboard up, pin the sheet to the visible area instead. */
  .keyboard-open dialog.sheet-dialog {
    margin: 0;
    top: var(--visual-top, 0px);
    bottom: auto;
    border-radius: 0;
  }
  .keyboard-open dialog.sheet-dialog,
  .keyboard-open dialog.sheet-dialog .sheet {
    height: var(--visual-height, 100dvh);
    max-height: var(--visual-height, 100dvh);
  }
  .settings-card .form-grid {
    gap: 16px 12px;
  }
  .exercise {
    padding: 10px 10px 6px;
  }
  .set-row {
    grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 44px 32px;
    gap: 5px;
  }
  .save-bar {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .keyboard-open .save-bar {
    bottom: 8px;
  }
  .reminder-row .field {
    flex: 1 1 100%;
  }
  .reminder-actions {
    width: 100%;
  }
  .reminder-actions .primary,
  .reminder-actions .secondary {
    flex: 1 1 auto;
  }
  .row-actions .text-button {
    min-height: 44px;
  }
}

/* Today: daily brief and time summary */
.hero-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}
.hero-grid > .brief-card {
  margin-bottom: 0;
}
.brief-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brief-card h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
  margin-top: -6px;
}
.time-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.time-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--soft);
  min-width: 0;
}
.time-chip small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.time-chip strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.time-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--blue);
  flex-shrink: 0;
}
.time-icon svg {
  width: 16px;
  height: 16px;
}
.time-chip.study .time-icon {
  color: var(--study-ink);
}
.time-chip.event .time-icon {
  color: var(--event-ink);
}
.time-chip.training .time-icon {
  color: var(--ok);
}
.brief-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.brief-lines li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.5;
}
.brief-lines li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
}
.brief-actions,
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.brief-actions {
  margin-top: auto;
}
.content-grid .route-card {
  margin-top: 26px;
}

/* Itinerary: personal events and study blocks */
.event-card .travel-note {
  color: var(--muted);
}
.event-row.personal:before {
  background: var(--event-ink);
}
.event-row.personal .event-card {
  background: var(--event-bg);
  border-color: var(--event-line);
}
.event-row.personal .tag,
.week-tag {
  color: var(--event-ink);
}
.event-row.study:before {
  background: var(--study-ink);
}
.event-row.study .event-card {
  background: var(--study-bg);
  border-color: var(--study-line);
}
.event-row.study .tag {
  color: var(--study-ink);
}
.week-event.personal {
  background: var(--event-bg);
}
.week-event.personal time {
  color: var(--event-ink);
}
.week-event.study {
  background: var(--study-bg);
}
.week-event.study time {
  color: var(--study-ink);
}
.week-tag {
  display: block;
  font-size: 8px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.week-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 25px;
}
.stat-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
}
.stat-card strong {
  font-size: 22px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stat-card h3 {
  font-size: 14px;
}
.stat-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* Food and energy */
.energy-rows {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.energy-rows div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}
.energy-rows dt {
  color: var(--muted);
}
.energy-rows dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.energy-rows dd small {
  font-weight: 400;
  color: var(--muted);
}
.energy-rows .difference {
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.energy-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 10px;
}
.nutrition-head h2.eyebrow {
  margin: 0;
}
.meal-timing-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.nutrition-card .meal-timing-actions .secondary {
  flex: 1;
  width: auto;
  margin-top: 0;
}
.timing-tag {
  color: var(--ok);
  font-weight: 600;
}

/* Assistant shortcuts */
.assistant-card {
  margin-top: 24px;
  display: grid;
  gap: 14px;
}
.assistant-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.assistant-head h3 {
  font-size: 15px;
}
.assistant-head p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
}
.shortcut-list {
  display: grid;
  gap: 6px;
}
.shortcut-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  font-size: 13px;
  color: var(--ink);
}
.shortcut-list button svg {
  width: 15px;
  height: 15px;
  color: var(--blue);
}
.assistant-card > .text-button {
  justify-self: start;
}

/* Settings */
.settings-card.full-span {
  grid-column: 1 / -1;
}
.settings-stack {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}
.settings-stack > .install-card {
  margin-top: 0;
}
.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.inline-form .field {
  flex: 1 1 220px;
}
.inline-form .primary {
  min-height: 46px;
}
.account-card h2 {
  margin-bottom: 14px;
}
.account-row h3 {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
}
.account-actions .secondary {
  min-height: 46px;
  font-size: 13px;
}
.secondary.danger-outline {
  color: var(--danger);
}
.you-settings-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 20px;
  padding: 0 14px;
  min-height: 44px;
  font-size: 13px;
  color: var(--blue);
}
.you-settings-link svg {
  width: 15px;
  height: 15px;
}

/* Study sheet and workout energy */
.field.duration-chips {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
}
.duration-chips button {
  min-width: 56px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  font-size: 13px;
  color: var(--ink);
}
.energy-edit {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  display: grid;
  gap: 10px;
}
.energy-edit h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.energy-edit h3 svg {
  width: 16px;
  height: 16px;
  color: var(--ok);
}
.energy-edit p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
}
.energy-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}
.energy-edit .dialog-error {
  margin-top: 0;
}
.energy-edit .dialog-error:empty {
  display: none;
}

/* Long assistant names stay on one line in navigation. */
.nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bottom-nav .nav-item span {
  max-width: 100%;
}

/* Theme-aware surfaces: earlier rules used fixed light tints. */
.avatar {
  background: var(--soft);
}
.day-button.active,
.msg-attach {
  color: var(--on-solid-muted);
}
.timeline:before {
  background: var(--line);
}
.event-row.workout .event-card {
  background: var(--workout-bg);
  border-color: var(--workout-line);
}
.empty-state {
  border-color: var(--line);
}
.nutrition-card progress,
.nutrition-card progress::-webkit-progress-bar {
  background: var(--soft);
}
.warning,
.message.system,
.notice.warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-ink);
}
.week-column.selected {
  border-color: var(--blue);
}
.week-event.workout {
  background: var(--workout-bg);
}
.check,
.segmented span {
  background: var(--soft);
}
.prompt-chips button,
.msg-error button,
.route-tag,
.city-tag,
.route-link {
  border-color: var(--line);
}
.proposal {
  background: var(--ok-bg);
  border-color: var(--ok-line);
}
.proposal-saved,
.exercise-last,
.log-state.done,
.install-ok {
  color: var(--ok);
}
.compose-box {
  border-color: var(--field-line);
  box-shadow: 0 4px 18px var(--shadow);
}
.compose-box:focus-within {
  border-color: var(--blue);
}
dialog {
  box-shadow: 0 25px 100px var(--shadow);
}
dialog::backdrop {
  background: var(--overlay);
}
.route-card,
.city-card {
  background: var(--tint);
}
.route-link:active {
  background: var(--soft);
}
.route-icon.home {
  background: var(--ok-bg);
  color: var(--ok);
}
#city-panel {
  border-top-color: var(--line);
}
.map-label {
  background: var(--glass);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 3px 12px var(--shadow);
}
.city-controls button {
  background: var(--chip-glass);
  border-color: var(--line);
}
.mult-chips button[aria-pressed="true"] {
  border-color: var(--blue);
}
.session-stats span.done {
  background: var(--ok-bg);
  color: var(--ok);
}
.exercise {
  background: var(--field);
}
.exercise-name:hover,
.exercise-name:focus {
  border-color: var(--field-line);
}
.exercise-cue,
.install-card ol {
  color: var(--muted);
}
.set-row.done input:not([type="checkbox"]) {
  background: var(--ok-bg);
  border-color: var(--ok-line);
}
.set-check {
  border-color: var(--field-line);
}
.save-bar {
  background: var(--glass);
}
.library-empty {
  color: var(--warn-ink);
}
.notice.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.danger,
.msg-error,
.dialog-error {
  color: var(--danger);
}
:root[data-theme="dark"] .brand-icon {
  box-shadow: 0 0 0 1px var(--line);
}

@media (max-width: 1150px) {
  .week-stats {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .brief-card {
    padding: 22px;
  }
  .brief-card h2 {
    font-size: 20px;
  }
  .brief-lines li {
    font-size: 13px;
  }
  .content-grid .route-card {
    margin-top: 22px;
  }
  .settings-stack {
    gap: 16px;
    margin-top: 16px;
  }
  .settings-card.full-span {
    grid-column: auto;
  }
  .account-actions .secondary {
    flex: 1 1 auto;
  }
  .energy-fields {
    grid-template-columns: 1fr;
  }
  .bottom-nav {
    padding-left: 6px;
    padding-right: 6px;
  }
}
/* Conversation history shares the planner's native sheet language. */
.history-sheet {height:min(80dvh,760px);min-height:360px;}
.history-toolbar {padding:14px 22px;border-bottom:1px solid var(--line);display:flex;gap:10px;flex-wrap:wrap;}
.history-search {display:flex;gap:9px;align-items:center;flex:1;min-width:160px;border:1px solid var(--field-line);border-radius:12px;background:var(--field);padding:0 12px;}
.history-search svg {width:17px;height:17px;flex-shrink:0;color:var(--muted);}
.history-search input {border:0;background:transparent;color:var(--ink);font:inherit;font-size:16px;width:100%;padding:12px 0;outline-offset:3px;min-width:0;}
.history-toolbar .secondary {font-size:12px;white-space:nowrap;}
.history-list {display:flex;flex-direction:column;gap:10px;padding:16px 22px;}
.history-row {display:flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:15px;background:var(--paper);}
.history-row.active {border-color:var(--blue);background:var(--tint);}
.history-open {text-align:left;display:flex;flex-direction:column;gap:7px;flex:1;min-width:0;padding:15px;border:0;background:transparent;border-radius:15px;color:var(--ink);}
.history-meta {display:flex;gap:9px;flex-wrap:wrap;font-size:11px;color:var(--muted);}
.history-meta span {margin-left:auto;}
.history-open strong {font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;}
.history-preview {font-size:12px;line-height:1.5;color:var(--muted);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}
.history-actions {display:flex;flex-direction:column;gap:6px;padding:5px;}
.history-actions .icon-button {width:44px;height:44px;min-height:44px;}
.history-actions svg {width:16px;height:16px;}
.history-empty {text-align:center;padding:35px 10px;color:var(--muted);margin:auto 0;}
.history-empty>svg {width:28px;height:28px;margin-bottom:14px;color:var(--blue);}
.history-empty h3 {font-size:17px;color:var(--ink);margin-bottom:8px;}
.history-empty p {font-size:13px;line-height:1.6;max-width:300px;margin:auto;}
.history-rename {border:1px solid var(--line);border-radius:15px;padding:16px;background:var(--paper);}
.history-rename>div {display:flex;justify-content:flex-end;gap:8px;margin-top:12px;}
@media(max-width:600px) {.history-toolbar {padding:12px 16px;}.history-list {padding:14px 16px;}.history-sheet {height:82dvh;}.chat-header {gap:8px;}.chat-header .icon-button {width:44px;min-width:44px;}}

/* Conversation continuity, with controls large enough for a thumb. */
.chat-header .icon-button {width:44px;height:44px;flex-shrink:0;border:1px solid var(--line);background:var(--paper);border-radius:12px;}
.chat-tool span {display:none;}
.chat-title h1,.chat-title p {overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.chat-title p::before {flex-shrink:0;}
.chat-context {display:flex;align-items:center;gap:10px;flex-shrink:0;border-bottom:1px solid var(--line);min-height:44px;}
.conversation-name {display:flex;gap:5px;align-items:center;min-height:44px;min-width:0;flex:1;border:0;background:transparent;color:var(--muted);text-align:left;font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.conversation-name svg {width:14px;flex-shrink:0;}
.conversation-day {font-size:11px;color:var(--muted);white-space:nowrap;}
.history-row {flex-wrap:wrap;}
.history-open {width:calc(100% - 60px);}
.history-plan-day {display:flex;gap:6px;align-items:center;width:100%;border:0;border-top:1px solid var(--line);border-radius:0 0 15px 15px;background:transparent;color:var(--blue);padding:10px 15px;font-size:11px;min-height:44px;text-align:left;}
.history-plan-day svg {width:14px;height:14px;flex-shrink:0;}
.history-plan-day svg:last-child {margin-left:auto;}
.history-confirm {padding:16px;border:1px solid var(--line);border-radius:15px;background:var(--paper);}
.history-confirm>strong {font-size:14px;overflow-wrap:anywhere;}
.history-confirm p {font-size:13px;color:var(--muted);line-height:1.6;margin:10px 0 14px;}
.history-confirm>div {display:flex;gap:8px;justify-content:flex-end;}
.danger {color:var(--danger);}
#history-title:focus {outline:none;}
body[data-route="coach"] #toast {bottom:calc(65px + env(safe-area-inset-bottom) + var(--compose-height,84px) + 12px);}
body.keyboard-open[data-route="coach"] #toast {bottom:calc(100dvh - var(--visual-height,100dvh) - var(--visual-top,0px) + var(--compose-height,60px) + 12px);}
@media(max-width:600px) {.history-search {flex:1 1 100%;}.history-toolbar .secondary {margin-left:auto;}.chat-title p {font-size:10px;}.chat-context {gap:8px;}}

.conversation-name>span {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.history-new {display:flex;gap:6px;align-items:center;justify-content:center;min-width:44px;}
.history-new svg {width:16px;height:16px;}
@media(max-width:600px) {
  .history-search {flex:1;min-width:0;}
  .history-new {width:44px;height:44px;padding:0;flex-shrink:0;}
  .history-new span {display:none;}
}

/* Quiet, opaque navigation keeps scrolling content separate from its labels. */
.bottom-nav {background:var(--paper);}
.history-title-line {display:flex;align-items:center;gap:8px;width:100%;min-width:0;}
.history-title-line strong {flex:1;min-width:0;}
.draft-badge {font-size:10px;font-style:normal;line-height:1.4;letter-spacing:0;border:1px solid var(--field-line);border-radius:5px;padding:2px 5px;color:var(--muted);white-space:nowrap;flex-shrink:0;}
.draft-badge[hidden] {display:none;}
.conversation-name .draft-badge {overflow:visible;}
.compose-box textarea::placeholder {white-space:nowrap;}
.sheet-sub {text-wrap:pretty;}
.time-summary strong {overflow-wrap:anywhere;}
@media(max-width:360px) {.time-summary strong {font-size:12px;}.time-summary {gap:8px;}}
.time-chip>span:last-child {min-width:0;flex:1;}
.time-chip strong {font-size:13px;white-space:normal;overflow-wrap:normal;line-height:1.35;}
.duration-part {display:inline-block;white-space:nowrap;}
