:root {
  --ink: #1c3030;
  --muted: #506a61;
  --pine: #173b3c;
  --green: #235b4e;
  --ground: #f2f5f2;
  --line: #d6e2d9;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-synthesis: none;
  scrollbar-color: #78958a var(--ground);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
::selection { background: #c8e1b8; color: var(--pine); }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button, .button { touch-action: manipulation; }
:focus-visible { outline: 3px solid #ab6d1b; outline-offset: 3px; }
input, select, textarea {
  width: 100%; min-width: 0; border: 1px solid #b8ccc0; border-radius: 7px;
  background: white; color: var(--ink); padding: 11px 12px; min-height: 46px;
  caret-color: var(--green);
}
input::placeholder, textarea::placeholder { color: #62766d; opacity: 1; }
input[type=number] { font-variant-numeric: tabular-nums; }
textarea { resize: vertical; line-height: 1.55; }
label { display: block; font-weight: 650; font-size: 13px; margin-bottom: 8px; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  background: var(--green); color: white; border: 1px solid transparent; border-radius: 7px;
  min-height: 46px; padding: 10px 18px; font-weight: 650; text-decoration: none;
  font-size: 14px;
}
button:hover, .button:hover { background: #183e35; }
button:disabled { cursor: wait; opacity: .6; }
.button-light { background: #e5eee3; color: #204b3e; }
.button-light:hover { background: #d4e5ce; color: #173b30; }
.topbar { background: var(--pine); color: #f5fbf7; }
.topbar-inner { max-width: 1200px; margin: auto; min-height: 72px; padding: 0 28px; display: flex; align-items: center; gap: 30px; }
.brand { font-size: 25px; letter-spacing: -.035em; font-weight: 800; text-decoration: none; color: white; }
.brand span { font-weight: 400; }
.brand .brand-dot { color: #bde28c; font-weight: 800; }
.topbar nav { display: flex; gap: 8px; margin-left: auto; }
.topbar nav a { display: flex; align-items: center; min-height: 46px; padding: 10px 14px; text-decoration: none; color: #e0ebe5; font-size: 14px; border-radius: 7px; }
.topbar nav a[aria-current=page] { color: #fff; background: #315554; }
.topbar nav a:hover { background: #294e4d; }
.signout { background: none; border-color: #587674; color: #e0ebe5; font-size: 13px; padding: 8px 12px; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 10; background: white; padding: 12px; }
.skip-link:focus { top: 10px; }
main { max-width: 1200px; margin: auto; padding: 0 28px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 40px 0 28px; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -.03em; margin: 0; text-wrap: balance; }
h2 { font-size: 20px; letter-spacing: -.02em; margin: 0; }
h3 { font-size: 16px; margin: 0; }
p { line-height: 1.55; overflow-wrap: anywhere; }
.page-heading p { color: var(--muted); margin: 10px 0 0; font-size: 15px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 26px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 20px; }
.section-head p { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.badge { font-size: 11px; line-height: 1.4; color: #315e4f; background: #e5f1e4; border-radius: 20px; padding: 6px 9px; flex-shrink: 0; white-space: nowrap; }
.coach-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 24px; align-items: start; }
.chat { padding-bottom: 20px; }
.conversation { max-height: 55vh; min-height: 200px; overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; margin-bottom: 20px; }
.message { padding: 18px 0; border-bottom: 1px solid #e5ede7; }
.message:first-child { padding-top: 0; }
.message h3 { font-size: 12px; color: #416e5d; }
.message p { font-size: 14px; line-height: 1.65; white-space: pre-wrap; margin: 7px 0 0; }
.message.user { padding: 14px 16px; background: #eef3ee; border: 0; border-radius: 9px; margin: 14px 0; }
.message.user h3 { color: #435d54; }
.coach-empty { background: #edf5e9; border-radius: 9px; padding: 24px; }
.coach-empty h3 { font-size: 20px; }
.coach-empty p { font-size: 14px; color: var(--muted); }
.coach-empty button { margin-top: 6px; }
.form-bottom { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 12px; }
.form-bottom button { flex-shrink: 0; }
.helper { font-size: 12px; line-height: 1.6; color: var(--muted); }
.privacy-note { margin: 18px 0 0; }
.coach-sidebar { display: grid; gap: 26px; }
.proposal { background: #e6efdf; border-color: #cfdcc6; }
.proposal > h3 { font-size: 23px; margin-bottom: 18px; letter-spacing: -.02em; }
.plan-notes { font-size: 13px; white-space: pre-wrap; }
.proposal-exercises { margin: 22px 0; padding-left: 22px; }
.proposal-exercises li { padding: 0 0 16px 5px; font-size: 14px; }
.proposal-exercises span { display: block; margin-top: 5px; color: #385f4d; font-size: 13px; }
.proposal-exercises p { margin: 6px 0 0; font-size: 12px; color: #3c594b; }
.proposal form button, .proposal > .button { width: 100%; }
.proposal .helper { color: #3c594b; }
.context-summary { padding: 0 8px; }
.context-summary h2 { font-size: 16px; }
.context-summary p { font-size: 14px; color: var(--muted); }
.context-summary .helper { font-size: 12px; }
.context-summary a { font-size: 13px; }
.summary p { font-size: 14px; color: var(--muted); }
.workout-layout, .profile-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(200px, 1fr); gap: 30px; align-items: start; }
.exercise-list { display: grid; gap: 20px; }
.warmup { padding: 0 4px 4px; }
.warmup h2 { font-size: 16px; }
.warmup p, details p { font-size: 14px; color: var(--muted); white-space: pre-wrap; }
.exercise { scroll-margin-top: 16px; }
.exercise .section-head h2 { font-size: 21px; }
.exercise-guidance { font-size: 13px; color: var(--muted); margin: -6px 0 20px; }
.set-row { display: grid; grid-template-columns: 50px minmax(60px, 1fr) minmax(60px, 1fr) 70px 110px; gap: 10px; align-items: end; border-top: 1px solid var(--line); padding: 16px 0; }
.set-number { font-size: 13px; align-self: center; padding-top: 23px; font-variant-numeric: tabular-nums; }
.set-row label { font-size: 11px; margin-bottom: 6px; }
.set-row input, .set-row select { padding: 10px; }
.set-row button { padding: 10px 8px; font-size: 13px; }
.set-row.is-saved button { background: #e2eddb; color: #2d523e; }
.set-notes { grid-column: 2/-1; }
.set-notes summary { font-size: 12px; color: var(--muted); }
.set-notes input { margin-top: 10px; }
.form-status { font-size: 13px; margin: 8px 0 0; color: #23573a; }
.form-status:empty { display: none; }
.set-row .form-status { grid-column: 2/-1; margin: 0; }
.set-row .restore-draft { grid-column: 1/-1; }
input:disabled, select:disabled, textarea:disabled { background: #edf1ec; color: #435c50; }
.form-status.error { color: #9b3521; }
.workout-help { padding: 8px 0; }
.workout-help h2 { font-size: 18px; }
.workout-help p { font-size: 14px; color: var(--muted); }
.workout-help .helper { font-size: 12px; margin-top: 22px; }
.workout-help a { font-size: 14px; }
details summary { cursor: pointer; min-height: 30px; }
.stacked-form { display: grid; }
.stacked-form label:not(:first-of-type) { margin-top: 22px; }
.stacked-form > button { margin-top: 24px; justify-self: start; }
details .stacked-form { margin-top: 20px; }
.completed-set { display: flex; gap: 20px; flex-wrap: wrap; padding: 15px 0; border-top: 1px solid var(--line); font-size: 14px; }
.completed-set p { width: 100%; margin: 0; color: var(--muted); }
.history-item { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.history-item:first-child { padding-top: 0; }
.history-item:last-child { border: 0; }
.history-item h2 { font-size: 19px; margin: 7px 0; }
.history-item time, .history-item p { font-size: 13px; color: var(--muted); margin: 0; }
.pagination { display: flex; justify-content: space-between; margin-top: 20px; gap: 20px; }
.empty { padding: 28px; }
.empty p { color: var(--muted); font-size: 14px; }
.empty > .button { margin: 16px 0; }
.notices { margin-top: 20px; }
.notice { padding: 12px 16px; background: #e1efde; border-radius: 8px; color: #29533b; font-size: 13px; line-height: 1.6; }
.notice.error { background: #fff0e6; color: #843d2b; }
.notice.warning { background: #fbefd5; color: #765217; }
.login { max-width: 420px; margin: 70px auto; }
.login h1 { font-size: 30px; }
.login p { color: var(--muted); }
.login form { margin-top: 26px; }
.login button { width: 100%; margin-top: 16px; }
.auth-alternative { margin: 24px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.auth-alternative p { font-size: 13px; }
.auth-alternative button { margin-top: 0; }
.honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.passkey-management { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.passkey-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.passkey-item strong { font-size: 14px; overflow-wrap: anywhere; }
.error-page { max-width: 650px; margin: 60px auto; }
.rest-timer { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 25px; padding: 12px 20px; background: var(--pine); color: white; border-radius: 12px; box-shadow: 0 8px 24px #122b3029; font-size: 14px; }
.rest-timer strong { display: inline-block; min-width: 44px; font-variant-numeric: tabular-nums; }
footer { padding: 36px 0; color: var(--muted); font-size: 12px; }
.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: 800px) {
  .coach-layout, .workout-layout, .profile-layout { grid-template-columns: 1fr; gap: 24px; }
  .coach-sidebar { gap: 22px; }
  .conversation { max-height: 45vh; min-height: 100px; }
  .workout-help { padding: 0 8px; }
}
@media (max-width: 600px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  main { padding: 0 16px; }
  .topbar-inner { padding: 0 18px; min-height: 62px; justify-content: space-between; }
  .topbar nav { position: fixed; z-index: 4; bottom: 0; left: 0; right: 0; margin: 0; justify-content: space-around; gap: 0; background: var(--pine); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .topbar nav a { font-size: 13px; padding: 10px 14px; min-height: 44px; }
  .signout { min-height: 40px; }
  .page-heading { padding: 27px 0 22px; display: block; }
  .page-heading > .button { margin-top: 16px; }
  .page-heading p { font-size: 14px; }
  .panel { padding: 20px; }
  .section-head { margin-bottom: 18px; }
  .section-head h2 { font-size: 19px; }
  .section-head .badge { font-size: 10px; }
  input, select, textarea { font-size: 16px; }
  .composer textarea { min-height: 100px; }
  .form-bottom { align-items: start; }
  .form-bottom .helper { max-width: 150px; font-size: 11px; }
  .form-bottom button { padding: 10px 14px; }
  .coach-empty { padding: 18px; }
  .conversation { max-height: 400px; }
  .exercise .section-head h2 { font-size: 18px; }
  .exercise .section-head p { font-size: 12px; }
  .set-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 64px; gap: 10px; }
  .set-number { grid-column: 1/-1; padding: 0; }
  .set-row button { grid-column: 1/-1; width: 100%; }
  .set-notes, .set-row .form-status { grid-column: 1/-1; }
  .set-row input, .set-row select { padding: 11px 10px; }
  .set-row.is-saved { background: #f4f8f1; margin: 0 -8px; padding: 16px 8px; }
  .rest-timer { bottom: calc(80px + env(safe-area-inset-bottom)); width: calc(100% - 32px); justify-content: space-between; padding: 10px 14px; }
  .history-item { gap: 10px; }
  .history-item h2 { font-size: 17px; }
  .history-item .badge { font-size: 10px; }
  .login { margin: 38px auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
