:root {
  color-scheme: light;
  --brand: #d4634f;
  --brand-dark: #b5503f;
  --brand-soft: #fbf1ee;
  --sage: #7d9279;
  --sage-soft: #e9f0e2;
  --page: #faf8f5;
  --card: #ffffff;
  --muted-bg: #f5f2ed;
  --border: #e8e4de;
  --border-strong: #d6cfc8;
  --heading: #5a5550;
  --body: #6e6862;
  --muted: #736c66;
  --danger: #991b1b;
  --success: #047857;
  --macro-protein: var(--success);
  --macro-carbs: #b7791f;
  --macro-fat: var(--brand);
  --success-fill: #059669;
  --info: #2563eb;
  --info-strong: #1d4ed8;
  --purple: #7c3aed;
  --purple-strong: #6d28d9;
  --warning: #e89b3c;
  --warning-deep: #8a6520;
  --brand-border: rgba(212, 99, 79, .22);
  --border-subtle: rgba(232, 228, 222, .5);
  --shadow: 0 2px 8px rgba(90, 85, 80, .06);
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --serif: 'Crimson Pro', Georgia, serif;
  --coach-note-bg: #e9f0e2;
  --coach-note-border: color-mix(in srgb, var(--sage) 30%, transparent);
  --coach-note-accent: color-mix(in srgb, var(--sage) 72%, black);
  --success-strong: #047857;
  --video-thumb-bg: #3b3430;
}

* { box-sizing: border-box; }
html { background: var(--page); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--page); color: var(--body); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(212, 99, 79, .34); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
#screen h1:focus:not(:focus-visible) { outline: none; }

.app-shell { min-height: 100dvh; }
.sticky-top { position: sticky; top: 0; z-index: 20; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px max(16px, env(safe-area-inset-left)) 8px max(16px, env(safe-area-inset-right)); border-bottom: 1px solid #c9ddec; background: #eef5fb; color: var(--heading); font-size: 13px; line-height: 1.4; }
.demo-banner__copy { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; }
.demo-banner__copy strong { color: #245b7a; font-size: 13px; }
.demo-banner__copy a { display: inline-block; margin: -8px 0; padding: 8px 0; color: #245b7a; font-weight: 700; text-underline-offset: 2px; }
.demo-banner__actions { display: flex; flex: none; align-items: center; gap: 4px; }
.demo-banner__reset { min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: #245b7a; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; white-space: nowrap; }
.demo-banner__info { display: grid; width: 44px; height: 44px; margin: -2px 0; place-items: center; border: 1px solid #c9ddec; border-radius: 50%; background: rgba(255,255,255,.72); color: #245b7a; font-family: var(--serif); font-size: 19px; font-weight: 700; text-decoration: none; }

.app-header { display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.97); }
.brand { display: flex; align-items: center; min-height: 44px; color: var(--heading); text-decoration: none; }
.brand__name { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.header-user { display: flex; flex: none; align-items: center; justify-content: flex-end; gap: 8px; }
.header-avatar { display: flex; width: 44px; height: 44px; flex: none; align-items: center; justify-content: center; border: 2px solid var(--border); border-radius: 50%; background: linear-gradient(135deg,#f5f2ed 0%,#e8e4de 100%); color: var(--body); font-size: 14px; font-weight: 700; }
.header-user__name { color: var(--heading); font-size: 14px; font-weight: 600; }
.header-icon-button { display: grid; width: 44px; height: 44px; margin: -7px 0; padding: 0; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.header-icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-icon-button[aria-current='page'] { background: var(--brand-soft); color: var(--brand-dark); }
.notification-anchor { position: relative; }
.notification-bell { position: relative; }
.notification-bell__dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border: 2px solid var(--card); border-radius: 50%; background: var(--success); animation: notification-bell-pulse 1.6s ease-out infinite; pointer-events: none; }
@keyframes notification-bell-pulse {
  0% { box-shadow: 0 0 0 0 rgba(4,120,87,.55); }
  70% { box-shadow: 0 0 0 8px rgba(4,120,87,0); }
  100% { box-shadow: 0 0 0 0 rgba(4,120,87,0); }
}
.notification-panel { position: fixed; z-index: 45; display: flex; width: min(360px, calc(100vw - 24px)); max-height: min(70dvh,480px); flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: 0 10px 28px rgba(60,50,40,.16); color: var(--body); animation: notification-panel-enter 120ms ease-out; }
.notification-panel__header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.notification-panel__header h2 { margin: 0; font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1.35; }
.notification-panel__mark-all { padding: 4px 0; border: 0; background: transparent; color: var(--body); cursor: pointer; font-size: 14px; font-weight: 500; line-height: 1.35; }
.notification-panel__mark-all:disabled { cursor: default; opacity: .5; }
.notification-panel__message { flex: none; padding: 8px 16px; border-bottom: 1px solid var(--border); color: var(--body); font-size: 14px; line-height: 1.4; }
.notification-panel__message:empty { height: 0; overflow: hidden; padding-block: 0; border-bottom: 0; }
.notification-panel__list { display: flex; min-height: 0; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.notification-panel__item { display: grid; width: 100%; min-height: 56px; grid-template-columns: 8px minmax(0,1fr) auto; align-items: start; gap: 10px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: inherit; cursor: pointer; text-align: left; }
.notification-panel__item:last-child { border-bottom: 0; }
.notification-panel__item:hover { background: var(--muted-bg); }
.notification-panel__item:active { background: #eeeae4; }
.notification-panel__item-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; }
.notification-panel__item--unread .notification-panel__item-dot { background: var(--brand); }
.notification-panel__item-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.notification-panel__item-title, .notification-panel__item-body { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-overflow: ellipsis; }
.notification-panel__item-title { color: var(--heading); font-size: 16px; font-weight: 500; line-height: 1.35; }
.notification-panel__item--unread .notification-panel__item-title { font-weight: 600; }
.notification-panel__item-body { color: var(--body); font-size: 14px; line-height: 1.35; }
.notification-panel__item-time { min-width: 48px; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.35; text-align: right; white-space: nowrap; }
@keyframes notification-panel-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.desktop-nav { display: flex; gap: 6px; }
.desktop-nav a { padding: 9px 12px; border-radius: 8px; color: var(--body); text-decoration: none; font-size: 14px; font-weight: 600; }
.desktop-nav a[aria-current='page'] { background: var(--brand-soft); color: var(--brand-dark); }

.screen { width: min(100%, 680px); min-height: calc(100dvh - 126px); margin: 0 auto; padding: 32px 32px 72px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--heading); font-family: var(--serif); line-height: 1.15; }
h1 { margin-bottom: 4px; font-size: 32px; }
h2 { margin-bottom: 14px; font-size: 24px; }
h3 { margin-bottom: 6px; font-size: 19px; }
.page-subtitle, .muted { color: var(--muted); }
.section { margin-top: 28px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card--warm { padding: 20px; border-color: #efddd8; background: #fcf5f3; }
.card--sage { border-color: #dce7d7; background: var(--sage-soft); }
.card__meta { color: var(--muted); font-size: 14px; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--brand-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.big-value { color: var(--heading); font-size: 36px; font-weight: 700; line-height: 1; }
.big-value small { font-size: 16px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 16px; border: 1px solid var(--brand); border-radius: 9px; background: var(--brand); color: #fff; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; }
.button--secondary { border-color: var(--border-strong); background: var(--card); color: var(--heading); }
.button--small { min-height: 44px; padding: 8px 13px; font-size: 14px; }
.button--quiet { border-color: transparent; background: transparent; color: var(--brand-dark); }
.tab-header-link { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.round-button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; font-size: 25px; line-height: 1; box-shadow: 0 4px 12px rgba(212,99,79,.25); cursor: pointer; }
.stack { display: grid; gap: 12px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }


.measurement-card { position: relative; padding: 16px; }
.measurement-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.measurement-card__metric { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.measurement-card__metric--picker { display: inline-flex; min-height: 44px; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.measurement-picker { position: relative; }
.measurement-picker__chevron, .measurement-disclosure__chevron { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.measurement-picker__chevron { margin-top: -1px; }
.measurement-disclosure__chevron { transition: transform .18s ease; }
.measurement-disclosure__chevron.is-open { transform: rotate(180deg); }
.measurement-picker__menu { position: absolute; z-index: 15; top: 38px; left: 0; display: grid; min-width: 128px; overflow: hidden; padding: 5px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); box-shadow: 0 10px 28px rgba(60,50,40,.16); }
.measurement-picker__option { min-height: 38px; padding: 7px 9px; border: 0; border-radius: 5px; background: transparent; color: var(--heading); text-align: left; cursor: pointer; }
.measurement-picker__option:focus-visible { background: var(--muted-bg); }
.measurement-card__value { color: var(--heading); font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.measurement-card__unit { margin-left: 3px; color: var(--body); font-size: 17px; font-weight: 700; letter-spacing: 0; }
.measurement-card__add { position: absolute; z-index: 2; top: 12px; right: 12px; display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; padding: 0 0 3px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; font-size: 25px; line-height: 1; box-shadow: 0 2px 8px rgba(212,99,79,.28); cursor: pointer; }
.chart { position: relative; height: 130px; margin-top: 14px; border-bottom: 1px solid var(--border); background: linear-gradient(to bottom, transparent 32%, rgba(232,228,222,.65) 33%, transparent 34%, transparent 65%, rgba(232,228,222,.65) 66%, transparent 67%); }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-line { fill: none; stroke: #d99a48; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: rgba(217,154,72,.1); }
.chart-point { fill: #d99a48; }
.chart-endpoint-label { fill: var(--heading); font-size: 12px; font-weight: 700; }
.chart-labels { display: flex; justify-content: space-between; margin-top: 9px; color: var(--muted); font-size: 12px; }

.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.goal-card { min-width: 0; padding: 16px; }
.goal-card--value { overflow: visible; border-color: rgba(237,203,174,.5); background: linear-gradient(150deg, #fffaf6 0%, #fff 55%, #fff3e6 100%); }
.goal-card__header, .adherence-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.goal-card__title-row { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 5px; }
.goal-card__title-row h3, .adherence-card__header h3 { margin-bottom: 0; font-family: var(--sans); font-size: 18px; font-weight: 600; line-height: 1.3; }
.goal-trend-button { display: grid; width: 44px; height: 44px; margin: -10px 0; place-items: center; border: 0; background: transparent; color: #8092b5; cursor: pointer; }
.goal-trend-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.goal-percent { flex: none; padding: 5px 9px; border: 1px solid rgba(255,170,123,.4); border-radius: 999px; background: rgba(255,170,123,.2); color: #6b2c1f; font-size: 13px; font-weight: 700; }
.goal-description { margin: 12px 0 0; color: var(--body); font-size: 14px; line-height: 1.45; }
.goal-axis { display: grid; min-width: 0; color: var(--body); font-size: 11px; line-height: 1.25; }
.goal-axis--dates { grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; color: var(--muted); }
.goal-axis--dates span:last-child { text-align: right; }
.goal-progress { position: relative; }
.goal-progress__track { height: 12px; overflow: hidden; border-radius: 999px; background: rgba(243,228,214,.8); box-shadow: inset 0 0 0 1px rgba(229,204,184,.6); }
.goal-progress__fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff8a65 0%, #f7b24f 45%, #f6d06b 100%); box-shadow: 0 6px 12px rgba(247,150,91,.35); }
.goal-progress__marker { position: absolute; top: 50%; display: block; width: 8px; height: 8px; transform: translate(-50%, -50%); border-radius: 50%; background: #c25b3e; box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 4px 10px rgba(107,44,31,.35); }
.goal-axis--values { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; font-weight: 600; }
.goal-axis__start { color: #6b2c1f; }
.goal-axis__current { color: #c25b3e; text-align: center; }
.goal-axis__end { color: #1f5b3a; text-align: right; }
.goal-action { min-height: 44px; margin-top: 5px; padding: 8px 0; border: 0; background: transparent; color: var(--body); font-size: 12px; text-decoration: underline; text-decoration-color: rgba(90,85,80,.35); cursor: pointer; }
.adherence-card { font-family: var(--sans); }
.adherence-card__subtitle { margin: 4px 0 0; color: var(--body); font-size: 13px; }
.adherence-pill { flex: none; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.adherence-pill--amber { background: #fff6df; color: #8a5a00; }
.adherence-pill--red { background: #fde8e8; color: #991b1b; }
.adherence-dots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 16px 0 8px; }
.adherence-dot { width: 14px; height: 14px; border-radius: 50%; }
.adherence-dot--hit { background: var(--success); }
.adherence-dot--miss { background: var(--danger); }
.adherence-caption { margin: 0 0 16px; font-size: 14px; }
.adherence-caption strong { color: var(--heading); font-size: 16px; }
.adherence-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; }
.adherence-summary strong { flex: none; color: var(--heading); font-size: 16px; }
.status-chip { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: var(--sage-soft); color: #315f4d; font-size: 12px; font-weight: 700; white-space: nowrap; }

.session-list { display: grid; gap: 8px; }
.session-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.session-card__body { flex: 1; min-width: 0; }
.session-card__header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.session-card__name { display: flex; align-items: center; gap: 8px; }
.session-card__title { display: inline-block; margin: -10px 0; padding: 10px 0; color: var(--heading); font-size: 15px; font-weight: 600; text-decoration: none; }
.session-card__up-next { padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.session-card__type { color: var(--muted); font-size: 12px; }
.session-card__meta { display: flex; flex-wrap: wrap; gap: 0 12px; color: var(--muted); font-size: 13px; }
.session-card__start.button--secondary { border-color: var(--border); background: var(--muted-bg); color: var(--heading); }
.session-card__start { flex: none; min-height: 44px; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.exercise-list, .food-list, .detail-list { margin: 0; padding: 0; list-style: none; }
.exercise-list li, .food-list li, .detail-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.exercise-list li:last-child, .food-list li:last-child, .detail-list li:last-child { border-bottom: 0; }
.workout-calendar { padding: 14px; }
.workout-calendar__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.workout-calendar__title { margin: 0; font-size: 18px; }
.workout-calendar__count { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.workout-calendar__nav { display: inline-flex; flex: none; align-items: center; gap: 4px; }
.workout-calendar__nav-button, .workout-calendar__today { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; border: 1px solid transparent; background: transparent; color: var(--heading); cursor: pointer; }
.workout-calendar__nav-button { padding: 8px; border-radius: 999px; font-size: 25px; line-height: 1; }
.workout-calendar__nav-button:disabled { opacity: .25; cursor: default; }
.workout-calendar__today { min-height: 40px; padding: 5px 13px; border-color: var(--border); border-radius: 999px; background: var(--muted-bg); font-size: 12px; font-weight: 600; }
.workout-calendar__weekdays, .workout-calendar__grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; }
.workout-calendar__weekdays { margin-bottom: 6px; }
.workout-calendar__weekdays span { color: var(--body); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-align: center; }
.workout-calendar__day { display: flex; aspect-ratio: 1/1; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--heading); font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1; }
.workout-calendar__day--blank { visibility: hidden; }
.workout-calendar__day--workout { background: rgba(212,99,79,.18); cursor: pointer; }
.workout-calendar__day--today:not(.workout-calendar__day--workout) { color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.workout-calendar__day--today.workout-calendar__day--workout { background: var(--brand); color: #fff; }
.exercise-search { position: relative; z-index: 3; margin-bottom: 14px; }
.exercise-search__field { display: flex; min-height: 48px; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card); }
.exercise-search__field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(212,99,79,.14); }
.exercise-search__field svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.exercise-search__field input { width: 100%; min-width: 0; height: 46px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--heading); font-size: 16px; }
.exercise-search__results { position: absolute; top: calc(100% + 6px); right: 0; left: 0; max-height: min(336px,45dvh); overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: 0 12px 32px rgba(61,58,55,.16); }
.exercise-search__result { display: flex; width: 100%; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--heading); text-align: left; cursor: pointer; }
.exercise-search__result:last-child { border-bottom: 0; }
.exercise-search__result span { display: grid; min-width: 0; }
.exercise-search__result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exercise-search__result small { color: var(--muted); font-size: 12px; }
.exercise-search__result .goal-trend-icon { width: 19px; height: 19px; flex: none; color: var(--brand); }
.exercise-search__empty { margin: 0; padding: 16px; color: var(--muted); text-align: center; }
.workout-log-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -16px 0 16px; color: var(--body); font-size: 14px; }
.workout-log-summary__dot { color: var(--muted); }
.icon-back-link { display: inline-grid; width: 44px; height: 44px; margin: -6px 0 4px -12px; place-items: center; color: var(--heading); }
.icon-back-link .line-icon { width: 20px; height: 20px; }
.workout-log-note { margin-top: 12px; border-left: 4px solid var(--sage); }
.workout-log-note h2 { margin-bottom: 8px; font-size: 19px; }
.workout-log-note p { margin-bottom: 0; }
.workout-log-exercise { padding: 0 16px; }
.workout-log-exercise__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 0 10px; }
.workout-log-exercise__header h3 { margin: 0; font-family: var(--sans); font-size: 16px; }
.workout-log-exercise__trend { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--brand-dark); cursor: pointer; }
.workout-log-exercise__trend .goal-trend-icon { width: 21px; height: 21px; }
.workout-log-pr { flex: none; padding: 4px 8px; border-radius: 999px; background: #fff6df; color: #8a5a00; font-size: 11px; font-weight: 700; }
.workout-log-sets { margin: 0; padding: 0; list-style: none; }
.workout-log-sets li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.workout-log-sets li span { color: var(--muted); }
.workout-log-sets li strong { color: var(--heading); font-variant-numeric: tabular-nums; }
.macro-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.macro-row--three { grid-template-columns: repeat(3, 1fr); }
.macro { padding: 10px 6px; border-radius: 8px; background: var(--muted-bg); text-align: center; }
.macro strong, .macro span { display: block; }
.macro span { color: var(--muted); font-size: 12px; }
.meal-card__head, .checkin-card__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.daily-nutrition-summary { width: 100%; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--heading); }
.daily-nutrition-summary__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.daily-nutrition-summary__header h2, .daily-nutrition-summary__header span, .daily-nutrition-summary p { margin: 0; }
.daily-nutrition-summary__header h2 { font-size: 18px; }
.daily-nutrition-summary__header span, .daily-nutrition-summary__provenance, .daily-nutrition-summary__metric small { color: var(--muted); }
.daily-nutrition-summary__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
.daily-nutrition-summary__metric p { display: flex; justify-content: space-between; gap: 12px; }
.daily-nutrition-summary__bar { height: 7px; margin: 9px 0 7px; overflow: hidden; border-radius: 999px; background: var(--brand-soft); }
.daily-nutrition-summary__bar span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.daily-nutrition-summary__metric--calories .daily-nutrition-summary__bar span { background: var(--brand); }
.daily-nutrition-summary__range { display: block; margin-top: 2px; font-size: 13px; }
.daily-nutrition-summary__provenance { min-height: 20px; margin-top: 18px !important; font-size: 13px; }
.daily-nutrition-summary__trends { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 9px; margin-top: 14px; padding: 11px 2px 2px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--brand); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.daily-nutrition-summary__trends span { flex: 1; }
.daily-nutrition-summary__trends svg { flex: none; }
.nutrition-summary__action-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.meal-history-group + .meal-history-group { margin-top: 16px; }
.meal-history-list { display: grid; gap: 12px; }
.meal-history-date { margin: 0 0 8px 2px; color: var(--body); font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.meal-history-entry { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.meal-history-entry--no-image { grid-template-columns: minmax(0, 1fr); }
.meal-history-entry > img { width: 92px; aspect-ratio: 1; border-radius: 10px; background: var(--muted-bg); object-fit: cover; }
.meal-history-entry__body { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 7px; }
.meal-history-entry__body h3, .meal-history-entry__body p { margin-bottom: 0; }
.meal-history-entry__note { color: var(--body); font-size: 14px; font-style: italic; line-height: 1.45; }
.meal-type-chip { padding: 1px 9px; }
.meal-breakdown { width: 100%; min-width: 0; margin-top: 5px; }
.meal-breakdown__list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.meal-breakdown__item { min-width: 0; }
.meal-breakdown__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.meal-breakdown__name { min-width: 0; color: var(--heading); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.meal-breakdown__amt { color: var(--muted); font-weight: 400; }
.meal-breakdown__cal { flex-shrink: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meal-breakdown__cal-value { color: var(--heading); font-size: 14px; font-weight: 600; }
.meal-breakdown__cal-unit { margin-left: 3px; color: var(--muted); font-size: 11px; }
.meal-breakdown__macros { display: grid; grid-template-columns: repeat(3, 64px); margin-top: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.meal-breakdown__macro { white-space: nowrap; }
.meal-breakdown__macro--protein { color: var(--macro-protein); }
.meal-breakdown__macro--carbs { color: var(--macro-carbs); }
.meal-breakdown__macro--fat { color: var(--macro-fat); }
.meal-breakdown__total { width: 100%; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border); }
.meal-breakdown__total-label { color: var(--heading); font-size: 14px; font-weight: 700; }
.meal-coach-response { margin-top: 4px; padding: 10px 12px; border-radius: 9px; background: var(--sage-soft); font-size: 13px; }
.meal-coach-response strong { display: block; margin-bottom: 3px; color: var(--heading); }
.meal-coach-response p { line-height: 1.4; }
.cp-mpv-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -32px -32px 0; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.cp-mpv-back { display: inline-flex; min-height: 44px; align-items: center; gap: 4px; padding: 4px 0; color: var(--heading); font-size: 14px; font-weight: 600; text-decoration: none; }
.cp-mpv-heading { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.cp-mpv-title { margin: 0; color: var(--heading); font-size: 17px; font-weight: 700; }
.cp-mpv-subtitle { max-width: 60vw; margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.cp-mpv-pdf { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; padding: 4px 0; border: 0; background: none; color: var(--brand); font-size: 13px; font-weight: 600; cursor: pointer; }
.cp-mpv-pdf-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cp-mpv-content { max-width: 640px; margin: 0 auto; padding: 16px 0 0; }
.cp-mpv-targets { margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.cp-mpv-targets-head { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cp-mpv-targets-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cp-mpv-cal { display: flex; flex-direction: column; }
.cp-mpv-cal-value { color: var(--brand); font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1; }
.cp-mpv-cal-label { margin-top: 3px; color: var(--muted); font-size: 12px; }
.cp-mpv-macros3 { display: flex; gap: 16px; }
.cp-mpv-m3 { display: flex; flex-direction: column; align-items: flex-end; }
.cp-mpv-m3-value { color: var(--heading); font-size: 16px; font-weight: 700; }
.cp-mpv-m3-label { color: var(--muted); font-size: 11px; }
.cp-mpv-note { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #efcfc7; border-radius: 12px; background: var(--brand-soft); }
.cp-mpv-note-label { margin: 0 0 4px; color: var(--brand-dark); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.cp-mpv-note-body { margin: 0; color: var(--body); font-size: 13.5px; line-height: 1.5; }
.cp-mpv-meal { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.cp-mpv-meal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cp-mpv-meal-name { min-width: 0; margin: 0; color: var(--heading); font-family: var(--sans); font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.cp-mpv-meal-total { flex-shrink: 0; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.cp-mpv-food { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--muted-bg); }
.cp-mpv-food:first-child { border-top: 0; }
.cp-mpv-food-main { min-width: 0; }
.cp-mpv-food-name { color: var(--heading); font-size: 14px; overflow-wrap: anywhere; }
.cp-mpv-food-macros { margin-top: 1px; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.cp-mpv-food-qty { flex-shrink: 0; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.cp-mpv-opt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cp-mpv-opt-tab { display: inline-flex; min-height: 44px; align-items: center; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--body); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cp-mpv-opt-tab--active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

.checkin-card { display: block; color: inherit; text-decoration: none; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.metric { padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); }
.metric span, .metric strong { display: block; }
.metric span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.metric strong { margin-top: 5px; color: var(--heading); font-size: 20px; }
.metric__delta { margin: 7px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.metric__delta--positive { color: var(--success); }
.metric__delta--negative { color: var(--danger); }
.checkin-section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.checkin-section-header h2 { margin: 0; }
.checkin-section-header__action { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; padding: 7px 2px; border: 0; background: transparent; color: var(--brand-dark); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.checkin-section-header__action .goal-trend-icon { width: 17px; height: 17px; }
.checkin-trends-panel { margin-bottom: 16px; }
.checkin-trends { padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); box-shadow: var(--shadow); }
.checkin-trends__tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: thin; }
.checkin-trends__tab { flex: none; min-height: 40px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--body); font-size: 13px; font-weight: 600; cursor: pointer; }
.checkin-trends__tab--active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.checkin-trends__chart .chart { margin-top: 0; }
.coach-response { border-left: 4px solid var(--sage); }

.form-section { margin-top: 24px; padding-top: 4px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field legend { color: var(--heading); font-weight: 600; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: var(--heading); font-size: 16px; }
.field textarea { min-height: 108px; resize: vertical; }
.field-hint, .field-error { margin: 0; font-size: 13px; }
.field-hint { color: var(--muted); }
.field-error { color: var(--danger); }
.photo-preview { display: flex; gap: 14px; align-items: center; margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.photo-preview img { width: 78px; height: 96px; border-radius: 8px; object-fit: cover; }
.progress-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.progress-photo { margin: 0; }
.progress-photo img { display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; background: var(--muted-bg); object-fit: cover; }
.progress-photo figcaption { margin-top: 7px; color: var(--muted); font-size: 13px; text-align: center; }

.resource-grid { display: grid; gap: 12px; }
.cp-plan-card { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 16px; }
.cp-plan-card__body { display: flex; flex: 1; flex-direction: column; gap: 6px; }
.cp-plan-card__title { margin: 0; font-family: var(--sans); font-size: 17px; font-weight: 700; }
.cp-plan-card__text { margin: 0; color: var(--body); font-size: 14px; opacity: .85; overflow-wrap: anywhere; }
.cp-plan-card__meta { margin-top: 2px; }
.cp-plan-card__actions { display: flex; gap: 8px; }
.cp-plan-card__actions .button { flex: 1; gap: 5px; }
.resource-action__icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.signup-card { margin-top: 32px; text-align: center; }
.signup-card .button { margin-top: 8px; }
.empty-state { padding: 32px 20px; border: 1px dashed var(--border-strong); border-radius: 12px; color: var(--muted); text-align: center; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { margin-bottom: 0; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; margin: -8px 0 10px; color: var(--heading); font-weight: 600; text-decoration: none; }

.bottom-nav { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; padding: 20px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.modal__backdrop { position: absolute; inset: 0; background: rgba(38,31,28,.52); }
.modal__panel { position: relative; width: min(100%, 470px); max-height: calc(100dvh - 40px); margin: 0 auto; padding: 24px; overflow: auto; border-radius: 16px; background: var(--card); box-shadow: 0 24px 80px rgba(38,31,28,.25); }
.modal__panel h2 { margin-bottom: 10px; }
.modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal__extra { margin-top: 16px; }
.modal__extra .preview-sheet { padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--page); }
.measurement-sheet-wrap { position: fixed; inset: 0; z-index: 55; display: grid; align-items: end; }
.measurement-sheet-wrap__backdrop { position: absolute; inset: 0; background: rgba(45,35,28,.12); }
.measurement-sheet { position: relative; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; width: min(100%,520px); max-height: 88dvh; margin: 0 auto; overflow: hidden; border: 0; border-radius: 18px 18px 0 0; background: var(--card); box-shadow: 0 -10px 34px rgba(45,35,28,.26); }
.measurement-sheet__grip { justify-self: center; width: 36px; height: 4px; margin-top: 9px; border-radius: 2px; background: var(--border-strong); }
.measurement-sheet__head { padding: 9px 18px 14px; }
.measurement-sheet__head h2 { margin: 0; font-size: 21px; }
.measurement-sheet__body { display: grid; min-height: 0; gap: 14px; overflow-y: auto; padding: 4px 18px 18px; overscroll-behavior: contain; }
.measurement-sheet__actions { display: flex; gap: 10px; padding: 14px max(18px,env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); border-top: 1px solid var(--border); }
.measurement-sheet__actions button { flex: 1; }
.measurement-sheet__actions button:disabled { border-color: #e6d4cf; background: #dda89d; cursor: not-allowed; }
.measurement-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.measurement-fields--primary { grid-template-columns: 1fr; }
.measurement-field { display: grid; min-width: 0; gap: 6px; color: var(--heading); font-size: 13px; font-weight: 600; }
.measurement-field--weight { grid-column: 1/-1; }
.measurement-input-wrap { display: flex; min-width: 0; height: 46px; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card); }
.measurement-field--weight .measurement-input-wrap { height: 52px; }
.measurement-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(212,99,79,.16); }
.measurement-input-wrap input { width: 100%; min-width: 0; height: 100%; padding: 0 8px 0 12px; border: 0; outline: 0; background: transparent; color: var(--heading); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; appearance: textfield; }
.measurement-input-wrap input::-webkit-outer-spin-button, .measurement-input-wrap input::-webkit-inner-spin-button { margin: 0; appearance: none; }
.measurement-field--weight .measurement-input-wrap input { font-size: 22px; }
.measurement-input-wrap > span { flex: none; padding-right: 12px; color: var(--muted); font-size: 15px; }
.measurement-last { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.measurement-disclosure { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; justify-self: start; padding: 0; border: 0; background: transparent; color: var(--brand-dark); font-size: 14.5px; font-weight: 600; cursor: pointer; }
.nutrition-trends-wrap { position: fixed; inset: 0; z-index: 55; display: grid; align-items: end; }
.nutrition-trends-wrap__backdrop { position: absolute; inset: 0; background: rgba(61,58,55,.4); }
.nutrition-trends-sheet { position: relative; display: flex; width: min(100%,640px); max-height: 88dvh; flex-direction: column; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); overflow: hidden; border-radius: 18px 18px 0 0; background: var(--card); box-shadow: 0 -8px 30px rgba(61,58,55,.22); }
.nutrition-trends-sheet__grip { width: 38px; height: 4px; margin: 10px auto 2px; border-radius: 999px; background: var(--border); }
.nutrition-trends-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px 10px; }
.nutrition-trends-sheet__head h2 { margin: 0; font-size: 20px; }
.nutrition-trends-sheet__close, .habit-sheet__close { display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 50%; background: var(--muted-bg); color: var(--heading); font-size: 26px; line-height: 1; cursor: pointer; }
.nutrition-trends-sheet__body { min-height: 0; padding: 4px 18px 24px; overflow-y: auto; overscroll-behavior: contain; }
.nutrition-trend { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.nutrition-trend + .nutrition-trend { margin-top: 14px; }
.nutrition-trend__head { display: flex; align-items: baseline; justify-content: flex-start; gap: 10px; }
.nutrition-trend__label { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.nutrition-trend__target { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.nutrition-trend__chart { position: relative; display: grid; height: 70px; margin-top: 26px; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 0 6px; border-bottom: 1px solid var(--border); }
.nutrition-trend__chart::after { position: absolute; right: 0; bottom: var(--target-position); left: 0; border-top: 1.5px dashed currentColor; content: ''; opacity: .5; pointer-events: none; }
.nutrition-trend__chart--axis { margin-bottom: 34px; }
.nutrition-trend__column { position: relative; display: block; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.nutrition-trend__bar-wrap { position: absolute; inset: 0; }
.nutrition-trend__bar { position: absolute; left: 50%; width: min(28px, 78%); background: currentColor; transform: translateX(-50%); }
.nutrition-trend__bar--low { bottom: 0; }
.nutrition-trend__bar--band { border-radius: 5px 5px 0 0; opacity: .3; }
.nutrition-trend__value { position: absolute; left: 50%; display: grid; justify-items: center; color: currentColor; font-size: 10.5px; font-weight: 600; line-height: 1.15; white-space: nowrap; transform: translateX(-50%); font-variant-numeric: tabular-nums; paint-order: stroke fill; }
.nutrition-trend__day { position: absolute; top: calc(100% + 6px); left: 50%; display: grid; justify-items: center; color: var(--muted); font-size: 11px; line-height: 14px; transform: translateX(-50%); }
.nutrition-trend__day.is-today { color: var(--heading); font-weight: 700; }
.nutrition-trend--calories { color: #9a6236; }
.nutrition-trend--protein { color: var(--macro-protein); }
.nutrition-trend--carbs { color: var(--macro-carbs); }
.nutrition-trend--fat { color: var(--macro-fat); }
.exercise-history-wrap { position: fixed; inset: 0; z-index: 56; display: grid; align-items: end; }
.exercise-history-wrap__backdrop { position: absolute; inset: 0; background: rgba(61,58,55,.4); }
.exercise-history-sheet { position: relative; display: flex; width: min(100%,640px); max-height: 88dvh; flex-direction: column; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); overflow: hidden; border-radius: 18px 18px 0 0; background: var(--card); box-shadow: 0 -8px 30px rgba(61,58,55,.22); }
.exercise-history-sheet__grip { width: 38px; height: 4px; margin: 10px auto 2px; border-radius: 999px; background: var(--border); }
.exercise-history-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 16px 10px; }
.exercise-history-sheet__head .eyebrow { font-size: 11px; }
.exercise-history-sheet__head h2 { margin: 1px 0 0; font-family: var(--sans); font-size: 20px; }
.exercise-history-sheet__close { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border: 0; border-radius: 50%; background: var(--muted-bg); color: var(--heading); font-size: 27px; line-height: 1; cursor: pointer; }
.exercise-history-tabs { display: grid; grid-template-columns: repeat(2,1fr); padding: 0 16px; border-bottom: 1px solid var(--border); }
.exercise-history-tabs__button { min-height: 44px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.exercise-history-tabs__button.is-active { border-bottom-color: var(--brand); color: var(--brand-dark); }
.exercise-history-sheet__body { min-height: 0; padding: 16px 18px 26px; overflow-y: auto; overscroll-behavior: contain; }
.exercise-history-list { display: grid; gap: 12px; }
.exercise-history-session { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.exercise-history-session__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.exercise-history-session__head div { display: grid; }
.exercise-history-session__head small { color: var(--muted); }
.exercise-pr { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--muted-bg); color: var(--muted); font-size: 11px; font-weight: 700; }
.exercise-pr--current { background: var(--sage-soft); color: #315f50; }
.exercise-history-session__sets { margin: 0; padding: 0; list-style: none; }
.exercise-history-session__sets li { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 43px; padding: 8px 14px; border-top: 1px solid var(--muted-bg); }
.exercise-history-session__sets li:first-child { border-top: 0; }
.exercise-history-session__sets span { color: var(--muted); font-size: 13px; }
.exercise-trend-metrics { display: flex; gap: 7px; margin: 0 -2px 18px; padding: 2px; overflow-x: auto; scrollbar-width: thin; }
.exercise-trend-metrics__button { min-height: 42px; flex: none; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--body); font-size: 13px; font-weight: 700; cursor: pointer; }
.exercise-trend-metrics__button.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.exercise-trend-chart { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.exercise-trend-chart svg { display: block; width: 100%; height: auto; }
.exercise-trend-chart__grid { fill: none; stroke: var(--border); stroke-width: 1; }
.exercise-trend-chart__area { fill: rgba(212,99,79,.10); }
.exercise-trend-chart__line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.exercise-trend-chart__point { fill: var(--card); stroke: var(--brand); stroke-width: 2.5; }
.exercise-trend-chart__value { fill: var(--heading); font-family: var(--sans); font-size: 11px; font-weight: 700; }
.exercise-trend-chart__labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.exercise-trend-chart__summary { margin: 10px 0 0; color: var(--heading); font-weight: 700; text-align: center; }
.exercise-rep-maxes { display: grid; gap: 13px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.exercise-rep-maxes__row { display: grid; grid-template-columns: 58px minmax(70px,1fr) 50px; align-items: center; gap: 9px; font-size: 13px; }
.exercise-rep-maxes__track { height: 9px; overflow: hidden; border-radius: 999px; background: var(--muted-bg); }
.exercise-rep-maxes__bar { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.exercise-rep-maxes__row > span:last-child { text-align: right; }
/* Daily habits: the Today card on Home, its number sheet and See your progress. */
.habit-today, .habit-sheet { --habit-ring: color-mix(in srgb, var(--muted) 75%, var(--card)); }
.habit-today { margin: 12px 0 0; padding: 0; overflow: hidden; }
.habit-today__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 4px; }
.habit-today__title { margin: 0; font-size: 22px; line-height: 1.5; }
.habit-today__date { color: var(--body); font-size: 14px; }
.habit-today__done { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: 14px; font-weight: 600; }
.habit-today__done .habit-icon { width: 15px; height: 15px; }
.habit-today__progress { display: flex; width: calc(100% - 28px); min-height: 46px; align-items: center; gap: 9px; margin: 0 14px; padding: 0 2px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--brand); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.habit-today__progress span { flex: 1; }
.habit-today__progress .goal-trend-icon { width: 16px; height: 16px; flex: none; stroke-width: 2; }
.habit-today__progress .nutrition-summary__action-icon { flex: none; }
.habit-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.habit-row { display: grid; min-height: 62px; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--border-subtle); }
.habit-rows .habit-row:first-child { border-top: 0; }
.habit-row--wide { grid-template-columns: 38px minmax(0,1fr); align-items: start; }
.habit-row__icon { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 50%; background: var(--muted-bg); color: var(--heading); }
.habit-row__icon--done { background: var(--sage-soft); color: var(--sage); }
.habit-row__main { min-width: 0; }
.habit-row__name { color: var(--heading); font-size: 16px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.habit-row__sub { margin-top: 3px; color: var(--body); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.habit-row__sub--ok { color: var(--success); }
.habit-row__sub--answer { color: var(--heading); font-weight: 600; }
.habit-row__bar { max-width: 190px; height: 6px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: var(--brand-soft); }
.habit-row__bar span { display: block; height: 100%; border-radius: 999px; background: var(--success-fill); transition: width 200ms ease; }
.habit-row__add { display: inline-flex; min-height: 40px; align-items: center; gap: 4px; padding: 0 14px; border: 1px solid var(--brand-border); border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font: inherit; font-size: 14.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.habit-row__add .habit-icon { width: 15px; height: 15px; }
.habit-row__edit { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--brand); cursor: pointer; }
.habit-row__tick { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; padding: 0; border: 2px solid var(--habit-ring); border-radius: 50%; background: var(--card); color: transparent; cursor: pointer; transition: background 120ms ease, border-color 120ms ease; }
.habit-row__tick .habit-icon { width: 20px; height: 20px; }
.habit-row__tick--done { border-color: var(--sage); background: var(--sage); color: #fff; }
.habit-row__scale { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.habit-row__scale button { min-width: fit-content; min-height: 40px; flex: 1 1 0; padding: 6px 4px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--card); color: var(--heading); font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; overflow-wrap: break-word; cursor: pointer; }
.habit-row__scale button[aria-pressed='true'] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.habit-number-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.habit-number-sheet__day { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.habit-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 8px; }
.habit-pager__label { min-width: 110px; color: var(--heading); font-size: 15px; font-weight: 600; text-align: center; }
.habit-pager__button { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--brand); cursor: pointer; }
.habit-pager__button:disabled { color: var(--muted); opacity: .4; cursor: not-allowed; }
.habit-days { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; margin-bottom: 6px; }
.habit-days__day { display: flex; height: 58px; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.habit-days__day small { color: var(--muted); font-size: 10.5px; }
.habit-days__day strong { color: var(--heading); font-size: 14px; }
.habit-days__day em { display: inline-flex; height: 14px; align-items: center; color: var(--success-fill); font-style: normal; }
.habit-days__day em .habit-icon { width: 12px; height: 12px; }
.habit-days__day--today { border-color: var(--brand); }
.habit-days__day--today strong { color: var(--brand); }
.habit-days__day--future { opacity: .45; }
.habit-week-block { padding: 8px 0 4px; border-top: 1px solid var(--border-subtle); }
.habit-days + .habit-week-block { border-top: 0; }
.habit-week-block__head { display: flex; min-height: 34px; align-items: center; gap: 8px; }
.habit-week-block__label { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.habit-week-block__name { margin: 0; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .04em; line-height: 1.35; text-transform: uppercase; overflow-wrap: anywhere; }
.habit-week-block__target { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.habit-week-dots { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); padding: 4px 0 2px; }
.habit-week-dots__day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.habit-week-dots__day i { display: block; width: 12px; height: 12px; border-radius: 50%; }
.habit-week-dots__day--missed i { border: 1.5px solid var(--habit-ring); background: var(--card); }
.habit-week-dots__day--open i { width: 4px; height: 4px; margin: 4px 0; background: var(--border-strong); }
.habit-week-dots__day small { color: var(--muted); font-size: 11px; font-weight: 500; }
.habit-week-dots__day small.habit-week-dots__today { color: var(--brand); font-weight: 700; }
.habit-bars, .habit-scale-line { position: relative; width: 100%; min-width: 0; }
.habit-bars svg, .habit-scale-line svg { display: block; overflow: visible; }
.habit-chart__today { fill: var(--brand-soft); }
.habit-chart__baseline { stroke: var(--border); }
.habit-bars__speck { fill: var(--border-strong); }
.habit-bars__label { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.habit-bars__label--today { stroke: var(--brand-soft); }
.habit-bars__target { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.habit-bars__tick { fill: var(--muted); font-size: 11px; font-weight: 500; }
.habit-bars__tick--today { fill: var(--brand); font-weight: 700; }
.habit-scale-line__line { fill: none; stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round; }
.habit-scale-line__bridge { opacity: .45; stroke-width: 2px; stroke-dasharray: 3 4; stroke-linecap: round; }
.habit-row__add:focus-visible, .habit-row__edit:focus-visible, .habit-row__tick:focus-visible, .habit-row__scale button:focus-visible, .habit-today__progress:focus-visible, .habit-pager__button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.toast { position: fixed; z-index: 60; right: 20px; bottom: 24px; max-width: min(340px, calc(100% - 40px)); padding: 12px 16px; border-radius: 9px; background: #433f3b; color: #fff; box-shadow: var(--shadow); }
.error-card { border-color: #f1c8c2; background: #fff7f5; color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 767px) {
  .desktop-nav { display: none; }
  .brand__name { font-size: 19px; }
  .screen { min-height: calc(100dvh - 206px); padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }
  .bottom-nav { position: fixed; z-index: 25; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: calc(62px + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--border); background: rgba(255,255,255,.98); }
  .bottom-nav a { display: grid; min-width: 0; min-height: 50px; place-items: center; align-content: center; gap: 1px; color: var(--body); text-decoration: none; }
  .nav-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav small { font-size: 11px; }
  .bottom-nav a[aria-current='page'] { color: var(--brand-dark); }
  .bottom-nav.is-hidden { display: none; }
  .screen.no-bottom-nav { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .screen.no-bottom-nav .cp-mpv-header { margin: -16px -16px 0; }
  .app-header { height: 58px; }
  .header-user__name { display: none; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  .habit-today__title, .sessions-card__head h2 { font-size: 22px; }
  .goal-grid { grid-template-columns: 1fr; }
  .modal__actions { flex-direction: column-reverse; }
  .modal__actions .button { width: 100%; }
  .toast { right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); }
}

@media (max-width: 400px) {
  .brand__name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-user { gap: 6px; }
}

@media (max-width: 520px) {
  .daily-nutrition-summary { padding: 15px; }
  .daily-nutrition-summary__metric p { display: block; line-height: 1.5; }
}

@media (max-width: 359px) {
  .daily-nutrition-summary__grid { grid-template-columns: 1fr; }
}

@media (min-width: 640px) {
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-plan-card__actions .button { flex: none; }
}

@media (max-height: 667px) and (max-width: 767px) {
  .sticky-top { position: static; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .meal-history-entry { padding: 14px; }
  .meal-history-entry:not(.meal-history-entry--no-image) { grid-template-columns: 76px minmax(0, 1fr); }
  .meal-history-entry > img { width: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .notification-bell__dot { animation: none; }
}

@media (hover: hover) and (pointer: fine) {
  .header-icon-button:hover { background: var(--muted-bg); color: var(--brand-dark); }
  .button:hover { background: var(--brand-dark); }
  .button--secondary:hover { background: var(--muted-bg); }
  .goal-trend-button:hover { color: var(--brand-dark); }
  .goal-action:hover { color: var(--brand-dark); }
  .session-card__title:hover { color: var(--brand-dark); text-decoration: underline; }
  .workout-calendar__nav-button:hover:not(:disabled), .workout-calendar__today:hover { background: var(--muted-bg); }
  .workout-calendar__day--workout:hover { background: rgba(212,99,79,.30); }
  .daily-nutrition-summary__trends:hover span { text-decoration: underline; }
  .habit-row__edit:hover { background: var(--brand-soft); }
  .checkin-card:hover { border-color: rgba(212,99,79,.4); }
  .checkin-section-header__action:hover { text-decoration: underline; }
  .measurement-picker__option:hover { background: var(--muted-bg); }
}

/* Icons drawn from lucide-react paths. */
.line-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* What's new strip under the header (client app ClientPortalWhatsNewBanner). */
.whats-new__inner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 6px 4px 12px; border-bottom: 1px solid color-mix(in srgb, var(--brand) 22%, white); background: color-mix(in srgb, var(--brand) 10%, white); }
.whats-new__content { display: flex; min-width: 0; align-items: center; gap: 8px; }
.whats-new__badge { display: inline-flex; flex-shrink: 0; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.whats-new__badge .line-icon { width: 13px; height: 13px; }
.whats-new__message { color: var(--heading); font-size: 12px; font-weight: 500; line-height: 1.4; text-decoration: none; }
.whats-new__close { display: inline-grid; width: 44px; height: 44px; flex-shrink: 0; place-items: center; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }

/* Your sessions (client app ClientSessionsCard). */
.sessions-card { margin-bottom: 24px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); color: var(--body); }
.sessions-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 4px; }
.sessions-card__head h2 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--heading); }
.sessions-card__left { color: var(--muted); font-size: 14px; white-space: nowrap; }
.sessions-card__left b { color: var(--heading); font-size: 17px; font-weight: 700; }
.sessions-card__rows { margin: 0; padding: 2px 0 4px; list-style: none; }
.sessions-card__row { display: flex; min-height: 44px; align-items: center; gap: 10px; padding: 11px 16px; color: var(--heading); font-size: 15px; }
.sessions-card__row + .sessions-card__row { border-top: 1px solid var(--border-subtle); }
.sessions-card__day { flex: 1; font-weight: 600; }
.sessions-card__time { color: var(--body); white-space: nowrap; }
.sessions-card__row--next { background: var(--brand-soft); }
.sessions-card__row--next .sessions-card__day, .sessions-card__row--next .sessions-card__time { color: var(--brand-dark); }
.sessions-card__next { padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.sessions-card__row--used .sessions-card__day { color: var(--body); font-weight: 500; }
.sessions-card__row--used .sessions-card__time { color: var(--muted); }
.sessions-card__sub { margin: 0; padding: 14px 16px 4px; border-top: 1px solid var(--border); color: var(--muted); font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sessions-card__unbooked { margin: 0; padding: 2px 16px 12px; color: var(--muted); font-size: 14px; }
.sessions-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-top: 1px solid var(--border-subtle); color: var(--muted); font-size: 13.5px; }
.sessions-card__toggle { display: inline-flex; min-height: 44px; align-items: center; gap: 3px; padding: 0; border: 0; background: none; color: var(--brand-dark); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

/* Coach notes: one sage treatment for every coach comment (client app CoachCommentThread). */
.coach-note { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--coach-note-border); border-radius: 12px; background: var(--coach-note-bg); align-self: stretch; }
.coach-note__head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-bottom: 6px; color: var(--coach-note-accent); font-size: 13px; font-weight: 600; }
.coach-note__avatar { display: inline-flex; width: 22px; height: 22px; flex-shrink: 0; align-items: center; justify-content: center; border-radius: 50%; background: var(--coach-note-accent); color: #fff; }
.coach-note__avatar .line-icon { width: 13px; height: 13px; }
.coach-note__when { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.coach-note__text { color: var(--heading); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.coach-note__photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.coach-note__photo { width: 64px; height: 64px; padding: 0; overflow: hidden; border: 1px solid var(--coach-note-border); border-radius: 8px; background: var(--muted-bg); cursor: zoom-in; }
.coach-note__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.coach-note__reply-row { margin: 8px 0 0 18px; }
.coach-note__reply { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; margin: -6px 0 -10px -10px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--heading); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.coach-note__reply .line-icon { width: 14px; height: 14px; }
.workout-feedback { margin-top: 12px; }
.workout-feedback .coach-note { margin-top: 0; }

/* Voice messages (client app VoiceRecordingPlayer). */
.voice-player { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 8px; }
.voice-player__pill { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border: 1px solid var(--border); border-radius: 999px; background: var(--page); }
.voice-player__play { position: relative; display: inline-flex; width: 34px; height: 34px; flex: none; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; }
.voice-player__play::after { content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.voice-player__icon { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.voice-player__bars { display: flex; flex: 1; min-width: 0; height: 22px; align-items: center; justify-content: space-between; gap: 2px; overflow: hidden; }
.voice-player__bars span { width: 3px; flex: none; border-radius: 2px; background: var(--brand-border); }
.voice-player__bars span.is-played { background: var(--brand); }
.voice-player__time { flex: none; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.voice-player__download { display: inline-flex; min-height: 44px; align-items: center; align-self: flex-start; gap: 6px; margin: -10px 0 -12px; padding: 0 4px; color: var(--body); font-size: 13px; font-weight: 600; text-decoration: none; }

/* Photo lightbox. */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(20,16,14,.86); }
.lightbox__body { position: relative; max-width: min(100%, 720px); }
.lightbox__image { display: block; max-width: 100%; max-height: 82dvh; border-radius: 10px; }
.lightbox__close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; cursor: pointer; }

/* Plan update from your coach (client app PlanUpdateNote). */
.plan-update { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--coach-note-border); border-radius: 12px; background: var(--coach-note-bg); }
.plan-update .coach-note__head { margin-bottom: 8px; }
.plan-update__title { margin: 0; color: var(--coach-note-accent); font-family: var(--sans); font-size: 13px; font-weight: 600; }
.plan-update__hide { display: inline-grid; width: 44px; height: 44px; margin: -12px -12px -12px auto; flex-shrink: 0; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--coach-note-accent); cursor: pointer; }
.plan-update__text { margin: 0; color: var(--heading); font-size: 15px; line-height: 1.5; }

/* Meals: Today / Yesterday menu on the summary card. */
.daily-nutrition-summary__picker { position: relative; }
.daily-nutrition-summary__day-trigger { display: inline-flex; min-height: 44px; align-items: center; gap: 3px; margin: -10px -8px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.daily-nutrition-summary__day-chevron { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.daily-nutrition-summary__day-menu { position: absolute; top: calc(100% + 10px); left: -8px; z-index: 5; min-width: 220px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); box-shadow: 0 10px 28px rgba(60,50,40,.16); }
.daily-nutrition-summary__day-option { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 8px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--heading); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.daily-nutrition-summary__day-option .line-icon { color: var(--brand); }
.daily-nutrition-summary__day-check { width: 16px; flex: none; }
.daily-nutrition-summary__day-label { font-weight: 600; }
.daily-nutrition-summary__day-date { margin-left: auto; color: var(--muted); }
.daily-nutrition-summary__over { color: var(--brand-dark) !important; }

/* Log a meal (client app ClientPortalNutritionPage and ManualFoodComposer). */
.log-meal { display: grid; gap: 10px; }
.log-meal__label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.log-meal__label { color: var(--heading); font-size: 16px; font-weight: 500; }
.log-meal__required { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.log-meal__options { display: grid; gap: 8px; }
.log-meal__option { display: flex; min-height: 44px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card); color: var(--heading); font-size: 15px; font-weight: 600; cursor: pointer; }
.log-meal__option input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--brand); }
.log-meal__option--unavailable { border-color: var(--border); background: var(--muted-bg); color: var(--muted); cursor: not-allowed; }
.log-meal__option--unavailable input { opacity: .55; }
.log-meal__logged, .log-meal__selected-check { display: inline-flex; width: 24px; height: 24px; flex-shrink: 0; align-items: center; justify-content: center; border: 1px solid rgba(5,150,105,.24); border-radius: 999px; background: #ecfdf5; color: var(--success); }
.log-meal__logged { margin-left: auto; }
.log-meal__add { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed color-mix(in srgb, var(--brand) 45%, white); border-radius: 10px; background: transparent; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.log-meal__add .line-icon { width: 18px; height: 18px; }
.log-meal__selected { display: flex; min-height: 44px; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--brand); border-radius: 10px; background: color-mix(in srgb, var(--brand) 8%, white); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent); }
.log-meal__selected-label { min-width: 0; color: var(--heading); font-size: 15px; font-weight: 600; }
.log-meal__change { min-height: 44px; margin-left: auto; padding: 0 4px; border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.log-meal__rest { display: grid; gap: 12px; min-width: 0; }
.form-usuals { display: grid; gap: 8px; margin-bottom: 4px; }
.form-usuals__head { padding: 4px 2px 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.usual-row { display: grid; width: 100%; min-height: 60px; grid-template-columns: minmax(0,1fr) 36px; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.usual-row__body { display: grid; min-width: 0; gap: 2px; }
.usual-row__title { overflow: hidden; color: var(--heading); font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.usual-row__title--foods { overflow: visible; font-size: 14.5px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.usual-row__meta { color: var(--muted); font-size: 13px; }
.usual-row__meta strong { color: var(--heading); font-weight: 600; }
.usual-row__go { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; background: var(--sage-soft); color: var(--sage); }
.usual-row__go .line-icon { width: 20px; height: 20px; }
.form-usuals__toggle { display: inline-flex; min-height: 44px; align-items: center; justify-self: start; gap: 4px; margin: -4px 0 0 -4px; padding: 0 4px; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.barcode-entry { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.food-search-trigger { display: flex; min-width: 0; min-height: 48px; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
.food-search-trigger .line-icon { width: 20px; height: 20px; }
.barcode-button { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--brand); border-radius: 10px; background: var(--card); color: var(--brand); cursor: pointer; }
.barcode-button .line-icon { width: 22px; height: 22px; }
.log-meal__or { justify-self: center; margin: 2px 0; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.log-meal__photo-link { display: grid; width: 100%; min-height: 44px; justify-items: start; gap: 3px; padding: 6px 0 2px; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.log-meal__photo-lead { color: var(--muted); font-size: 13px; }
.log-meal__photo-act { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: 14.5px; font-weight: 600; }

/* Meal history. */
.meal-history-entry__head { display: flex; width: 100%; align-items: flex-start; justify-content: space-between; gap: 8px; }
.meal-history-entry__heading { display: grid; min-width: 0; gap: 2px; }
.meal-history-entry__heading h3 { margin: 0; color: var(--heading); font-family: var(--sans); font-size: 16px; font-weight: 700; }
.meal-history-entry__time { color: var(--muted); font-size: 13px; font-weight: 600; }
.meal-history-entry__more { display: grid; width: 44px; height: 44px; flex: none; margin: -10px -10px -10px 0; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.meal-history-entry__more .line-icon { width: 18px; height: 18px; stroke-width: 3; }
.meal-history-more { display: grid; justify-items: center; gap: 8px; margin-top: 16px; }
.meal-history-more__count { margin: 0; color: var(--muted); font-size: 13px; }

/* Nutrition trends: back to the week, the hint, and a tapped day. */
.nutrition-trends-sheet__back { display: grid; width: 44px; height: 44px; margin: 0 -8px 0 -10px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--heading); font-size: 22px; cursor: pointer; }
.nutrition-trends-sheet__head h2 { flex: 1; }
.nutrition-trends__hint { margin: -6px 0 14px; color: var(--body); font-size: 13px; text-align: center; }
.nutrition-trends__empty { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 24px; color: var(--muted); font-size: 14px; }
.trends-pager { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.trends-pager__range { flex: 1; color: var(--heading); font-size: 15px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.trends-pager__step { position: relative; display: inline-flex; width: 36px; height: 36px; flex-shrink: 0; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--brand-border); border-radius: 999px; background: transparent; color: var(--brand); cursor: pointer; }
.trends-pager__step::after { content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.trends-pager__step:disabled { border-color: transparent; color: var(--brand-border); cursor: default; }
.trends-pager__step .line-icon { width: 18px; height: 18px; }
.trends-day__totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.trends-day__total { display: grid; gap: 1px; }
.trends-day__value { color: var(--heading); font-weight: 700; }
.trends-day__target { color: var(--muted); font-size: 12px; }

/* Check-ins: Coach Response sheet and the one reply (client app ClientResponseDrawer). */
.checkin-response-button { width: 100%; margin-bottom: 8px; }
.response-sheet-wrap { position: fixed; inset: 0; z-index: 55; display: grid; align-items: end; }
.response-sheet-wrap__backdrop { position: absolute; inset: 0; background: rgba(61,58,55,.4); }
.response-sheet { position: relative; display: flex; width: min(100%, 640px); max-height: 80dvh; flex-direction: column; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); overflow: hidden; border-radius: 18px 18px 0 0; background: var(--card); box-shadow: 0 -8px 30px rgba(61,58,55,.22); }
.response-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.response-sheet__head h2 { margin: 0; font-size: 20px; }
.response-sheet__close { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--muted-bg); color: var(--heading); font-size: 16px; cursor: pointer; }
.response-sheet__body { min-height: 0; padding: 16px; overflow-y: auto; }
.response-sheet__text { color: var(--heading); font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; }
.response-sheet__awaiting { display: grid; justify-items: center; gap: 6px; padding: 18px 8px; text-align: center; }
.response-sheet__awaiting-icon { font-size: 32px; }
.response-sheet__awaiting h3 { margin: 0; font-family: var(--sans); font-size: 17px; }
.response-sheet__awaiting p { margin: 0; color: var(--body); font-size: 14px; }
.reply-card { margin-top: 14px; padding: 4px 0 4px 12px; border-left: 2px solid var(--brand); }
.reply-card__head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 13px; }
.reply-card__who { color: var(--heading); font-weight: 700; }
.reply-card__avatar { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand); color: #fff; }
.reply-card__avatar .line-icon { width: 12px; height: 12px; }
.reply-card__when { color: var(--muted); }
.reply-card__text { color: var(--heading); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-bar { padding: 10px 12px 12px; border-top: 1px solid var(--border); background: var(--card); }
.reply-bar__row { display: flex; align-items: flex-end; gap: 6px; }
.reply-bar__reactions { display: flex; gap: 6px; }
.reply-bar__reaction { display: grid; width: 44px; height: 44px; flex-shrink: 0; place-items: center; padding: 0; border: 1px solid var(--brand-border); border-radius: 999px; background: var(--brand-soft); color: var(--heading); font-size: 19px; cursor: pointer; }
.reply-bar__input { display: flex; flex: 1; min-width: 0; align-items: flex-end; gap: 4px; padding: 3px 3px 3px 12px; border: 1px solid var(--border-strong); border-radius: 22px; background: var(--card); }
.reply-bar__input textarea { flex: 1; min-width: 0; min-height: 36px; max-height: 120px; padding: 8px 0; border: 0; background: transparent; color: var(--heading); font: inherit; font-size: 16px; line-height: 1.3; resize: none; outline: none; }
.reply-bar__send { display: grid; width: 38px; height: 38px; flex-shrink: 0; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; }
.reply-bar__send:disabled { opacity: .45; cursor: default; }
.reply-bar__hint { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }

/* Resources: the client how-to videos (client app ClientPortalResourcesSection). */
.resource-card { position: relative; }
.resource-card__new { position: absolute; top: 10px; right: 12px; padding: 2px 8px; border-radius: 999px; background: var(--success-strong); color: #fff; font-size: 11.5px; font-weight: 700; }
.resource-card:has(.resource-card__new) .resource-card__text { padding-right: 44px; }
.resource-card__summary { display: flex; align-items: flex-start; gap: 12px; }
.resource-card__text { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 6px; }
.resource-card__thumb { position: relative; display: block; width: 96px; height: 54px; flex-shrink: 0; overflow: hidden; border-radius: 7px; background: var(--video-thumb-bg); }
.resource-card__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.resource-card__thumb--vertical { width: 64px; height: 86px; }
.resource-card__thumb--vertical img { position: absolute; top: 50%; left: 50%; width: 237.04%; max-width: none; height: auto; transform: translate(-50%, -50%); }
.video-dialog__panel { padding: 20px 16px 16px; }
.video-dialog__panel h2 { padding-right: 44px; font-size: 19px; }
.video-dialog__panel p { margin: -4px 0 14px; color: var(--muted); font-size: 14px; }
.video-dialog__close { position: absolute; top: 10px; right: 10px; display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 26px; cursor: pointer; }
.video-dialog__frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: var(--video-thumb-bg); }
.video-dialog__frame--vertical { width: auto; height: min(62dvh, 560px); margin: 0 auto; aspect-ratio: 9 / 16; }

/* Phone widths, as the client app's DailyNutritionSummaryCard. */
.daily-nutrition-summary__header h2 { font-family: var(--sans); font-size: 17.6px; font-weight: 400; }
@media (max-width: 520px) {
  .daily-nutrition-summary { padding: 15px; }
  .daily-nutrition-summary__metric p { display: block; line-height: 1.5; }
}
@media (max-width: 359px), (min-resolution: 2dppx) and (max-width: 420px) {
  .daily-nutrition-summary__grid { grid-template-columns: 1fr; }
}

/* Trends sheet header buttons as the client app's: quiet, 40px, no fill. */
.nutrition-trends-sheet__close { width: 40px; height: 40px; border-radius: 10px; background: transparent; color: var(--muted); }
.nutrition-trends-sheet__back { width: 40px; height: 40px; margin: 0 0 0 -8px; border-radius: 10px; }
.nutrition-trends-sheet__body { padding: 4px 16px 20px; }
.trends-day__totals { padding: 2px 2px 14px; }
.trends-day__value { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-icon { width: 20px; height: 20px; }

/* Resources, as the client app's plan cards. */
.resource-card .cp-plan-card__title { font-weight: 700; line-height: 1.5; }
.resource-card .resource-action { min-height: 44px; border-color: var(--border); border-radius: 8px; background: var(--page); color: var(--heading); font-size: 14px; font-weight: 600; }
.bottom-nav a { position: relative; }
.resources-nav-dot { position: absolute; top: 5px; left: calc(50% + 7px); width: 9px; height: 9px; border-radius: 50%; background: var(--success-fill); box-shadow: 0 0 0 2px var(--card); }

/* 44px tap areas for controls drawn smaller to match the client app. */
.nutrition-trends-sheet__close, .nutrition-trends-sheet__back, .reply-bar__send { position: relative; }
.nutrition-trends-sheet__close::after, .nutrition-trends-sheet__back::after, .reply-bar__send::after { content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.session-card__title { margin: -11px 0; padding: 11px 0; }

/* Habit buttons are drawn 40px tall like the client app's; the tap area is 44px. */
.habit-row__add, .habit-row__edit, .habit-row__scale button { position: relative; }
.habit-row__add::after, .habit-row__edit::after, .habit-row__scale button::after { content: ''; position: absolute; top: 50%; left: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }
