/* Coach workouts (coachwo.js): the "+" sheet's Ask your coach, the workout card (sheet + chats),
   Add to my program. The coach's own orange (--coach) marks the coach's pieces in every theme
   (decided 2026-10-24); actions keep the theme's buttons. Light themes get a darker orange so
   text on white passes 4.5:1. */
:root, [data-theme] { --coach: #ff8a4c; --coach-soft: rgba(255,138,76,.16); --coach-line: rgba(255,138,76,.45); }
[data-theme="light"], [data-theme="orchid"], [data-theme="glacier"], [data-theme="sandstone"], [data-theme="blush"],
[data-theme="lanai-day"], [data-theme="miami"], [data-theme="maverick"], [data-theme="pulp"], [data-theme="bubblegum"],
[data-theme="cerulean"], [data-theme="cover"], [data-theme="papercut"], [data-theme="peppermint"] {
  --coach: #c2571a; --coach-soft: rgba(234,110,40,.13); --coach-line: rgba(194,87,26,.38);
}

/* "+" sheet row */
.aw-opt.cwo-opt { background: linear-gradient(0deg, var(--coach-soft), var(--coach-soft)), var(--bg2); border-color: var(--coach-line); }
.aw-opt.cwo-opt span { flex: 1; }
.aw-ic.cwo-ic { background: var(--coach); color: #fff; }
.aw-ic.cwo-ic svg { width: 20px; height: 20px; }
.cwo-new { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #fff; background: var(--coach); padding: 3px 6px; border-radius: 6px; flex-shrink: 0; }

/* the sheet */
.cwo { display: flex; flex-direction: column; gap: 10px; }
.cwo-h { margin: 0; }
.cwo-sub { font-size: 13px; color: var(--text2); margin-top: -6px; }
.cwo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cwo-ask { display: flex; align-items: flex-end; gap: 8px; border: 1.5px solid var(--coach-line); border-radius: 14px; background: var(--bg2); padding: 8px 8px 8px 12px; }
.cwo-ask textarea, .cwo-ask input { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: none; color: var(--text); font: inherit; font-size: 16px; line-height: 1.35; padding: 8px 0; }
.cwo-ask button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--coach); color: #fff; font-size: 18px; font-weight: 800; flex-shrink: 0; cursor: pointer; }
.cwo-ask button:disabled { background: var(--bg4); color: var(--text3); cursor: default; }
.cwo-ask.sm { border-width: 1px; border-color: var(--border); padding: 4px 4px 4px 12px; }
.cwo-ask.sm input { font-size: 15px; padding: 6px 0; }
.cwo-ask.sm button { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
.cwo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cwo-chips button { min-height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cwo-chips button:disabled { opacity: .5; cursor: default; }
.cwo-foot { font-size: 12.5px; color: var(--text2); line-height: 1.4; }
.cwo-thread { display: flex; flex-direction: column; gap: 10px; }
.cwo-you { align-self: flex-end; max-width: 82%; background: var(--accent); color: var(--on-accent, #fff); padding: 9px 13px; border-radius: 16px 16px 4px 16px; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.cwo-co { display: flex; gap: 8px; align-items: flex-start; }
.cwo-co p { margin: 0; font-size: 14.5px; line-height: 1.4; }
.cwo-mk { width: 28px; height: 28px; border-radius: 9px; background: var(--coach); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.cwo-mk svg { width: 15px; height: 15px; }
.cwo-busy { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 22px 8px 12px; }
.cwo-busy b { font-size: 16px; }
.cwo-busy small { font-size: 12.5px; color: var(--text2); line-height: 1.4; max-width: 280px; }
.cwo-spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--coach-soft); border-top-color: var(--coach); animation: cwo-spin 0.9s linear infinite; }
@keyframes cwo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cwo-spin { animation-duration: 3s; } }
.cwo-acts { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.cwo-row2 { display: flex; gap: 8px; }
.cwo-row2 .btn { flex: 1; min-width: 0; }

/* the workout card */
.cwo-card { border: 1px solid var(--border); border-radius: 14px; background: var(--bg2); overflow: hidden; }
.cwo-card-hd { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px 9px; border-bottom: 1px solid var(--border); }
.cwo-card-hd > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cwo-card-hd b { font-size: 16.5px; font-weight: 800; }
.cwo-card-hd small { font-size: 12.5px; color: var(--text2); }
.cwo-tag { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.cwo-tag.hiit { background: var(--blue-soft); color: var(--blue); }
.cwo-tag.lift { background: var(--green-soft); color: var(--green); }
.cwo-mv { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 14px; }
.cwo-mv + .cwo-mv { border-top: 1px solid var(--border); }
.cwo-mv b { flex: 1; min-width: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cwo-mv em { font-style: normal; color: var(--text2); font-size: 13px; white-space: nowrap; }
/* A lift's sets when they differ (warm-up ramp, top single), under its row. */
.cwo-ps { margin-top: -6px; padding: 0 14px 8px 48px; font-size: 12.5px; color: var(--text2); font-variant-numeric: tabular-nums; }
.cwo-ps + .cwo-mv { border-top: 1px solid var(--border); }
.cwo-n { min-width: 24px; height: 22px; padding: 0 4px; border-radius: 7px; background: var(--bg3); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--text2); flex-shrink: 0; }
.cwo-n.h { background: var(--blue-soft); color: var(--blue); }
.cwo-why { padding: 9px 14px; font-size: 12.5px; color: var(--text2); background: var(--bg3); line-height: 1.4; }

/* in a chat */
.cwo-chat { align-self: stretch; display: flex; flex-direction: column; gap: 8px; }
.cwo-chat-acts { display: flex; flex-direction: column; gap: 8px; }
.cwo-ask-q { font-size: 13.5px; font-weight: 600; }
.cwo-done { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--green); font-weight: 600; }
.cwo-done .bd-link { margin-left: auto; }
.cwo-pick { display: flex; flex-direction: column; gap: 8px; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 10px; }
.cwo-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: var(--bg3); padding: 4px; border-radius: 11px; }
.cwo-seg button { border: 0; background: none; min-height: 36px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; color: var(--text2); cursor: pointer; }
.cwo-seg button.on { background: var(--bg2); color: var(--text); box-shadow: var(--card-shadow); }
.cwo-seg button:disabled { opacity: .45; cursor: default; }
.cwo-day { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg3); color: var(--text); font: inherit; cursor: pointer; }
.cwo-day .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cwo-day b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cwo-day small { font-size: 12px; color: var(--text2); }
.cwo-wd { width: 40px; flex-shrink: 0; font-size: 12px; font-weight: 800; color: var(--text2); }
.cwo-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bg4); flex-shrink: 0; }
.cwo-day.on { border-color: var(--accent); background: var(--accent-faint); }
.cwo-day.on .cwo-radio { border: 6px solid var(--accent); }
.cwo-wds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cwo-wds button { min-height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.cwo-wds button.on { border-color: var(--accent); background: var(--accent-faint); color: var(--accent); }

/* Lift: "Built by your coach" (the .cw-from line, in the coach's color) */
.cw-from.cwo-from svg { color: var(--coach); width: 14px; height: 14px; }

/* Train: a coach HIIT on its day (v104) */
.cwo-day-card .hc-head { margin-top: 4px; }
.cwo-day-tag { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--coach); }
.cwo-day-tag .cwo-mk { width: 22px; height: 22px; border-radius: 7px; }
.cwo-day-tag .cwo-mk svg { width: 13px; height: 13px; }
.cwo-day-tag.miss { color: var(--text2); }
.cwo-day-card .btn { margin-top: 12px; }
.cw-from.cwo-missed { gap: 10px; }
.cw-from.cwo-missed span { flex: 1; }
.cw-from.cwo-missed .btn { flex-shrink: 0; }

/* The card's foot in a chat (the "MODE Coach Workout Card" canvas, option A): the day, then what to do. */
.cwo-where { display: flex; align-items: center; gap: 12px; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.cwo-cal { width: 44px; height: 48px; flex-shrink: 0; background: var(--bg3); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cwo-cal span { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; }
.cwo-cal b { font-size: 18px; font-weight: 800; line-height: 1.1; }
.cwo-where-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cwo-where-t b { font-size: 15px; font-weight: 700; line-height: 1.25; }
.cwo-where-t small { font-size: 13px; color: var(--text2); line-height: 1.3; }
.cwo-chg { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; font-size: 14px; min-height: 44px; padding: 0 4px; cursor: pointer; flex-shrink: 0; }
.cwo-good { border: 0; background: none; color: var(--text2); font: inherit; font-size: 14px; min-height: 36px; cursor: pointer; }
.cwo-free { align-self: flex-start; font-size: 12.5px; font-weight: 600; color: var(--green); background: var(--green-soft); border-radius: 99px; padding: 4px 11px; }
.cwo-done-acts { display: inline-flex; gap: 14px; margin-left: auto; }
.cwo-done-acts .bd-link { margin: 0; }
/* An older version, folded */
.cwo-old { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; text-align: left; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg2); color: var(--text); font: inherit; cursor: pointer; }
.cwo-old span { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cwo-old b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cwo-old small { font-size: 13px; color: var(--text2); }
.cwo-old em { font-style: normal; font-size: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* The day sheet (its own layer: the chat sits at z-index 170) */
.cwo-pl-bk { position: fixed; inset: 0; z-index: 180; background: var(--backdrop, rgba(0,0,0,.5)); display: flex; align-items: flex-end; justify-content: center; }
.cwo-pl { width: 100%; max-width: 560px; max-height: 92%; overflow-y: auto; background: var(--bg2); color: var(--text); border-radius: 20px 20px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.cwo-tls { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cwo-tl { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 60px; min-width: 0; padding: 6px 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg3); color: var(--text); font: inherit; cursor: pointer; overflow: hidden; }
.cwo-tl span { font-size: 11px; color: var(--text2); }
.cwo-tl b { font-size: 15px; font-weight: 800; }
.cwo-tl small { font-size: 10px; color: var(--text2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cwo-tl small.ok { color: var(--green); }
.cwo-tl.on { border: 2px solid var(--accent); background: var(--accent-faint); padding: 5px 1px; }
.cwo-tl.on span, .cwo-tl.on small { color: var(--accent); font-weight: 700; }
.cwo-tl.more { border-style: dashed; }
.cwo-tl.more input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.cwo-pl-q { font-size: 14px; color: var(--text2); line-height: 1.4; }
.cwo-pl-q b { color: var(--text); }
.cwo-rd { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg3); color: var(--text); font: inherit; cursor: pointer; }
.cwo-rd i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bg4); flex-shrink: 0; box-sizing: border-box; }
.cwo-rd span { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cwo-rd b { font-size: 15px; }
.cwo-rd small { font-size: 13px; color: var(--text2); }
.cwo-rd.on { border-color: var(--accent); background: var(--accent-faint); }
.cwo-rd.on i { border: 5px solid var(--accent); }

/* Train: a coach lift's note (instead of the plan = the coach's color) */
.cwo-note { display: flex; flex-direction: column; gap: 8px; background: var(--bg2); border: var(--card-bw, 1px) solid var(--card-border, var(--border)); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.cwo-note.inst { background: linear-gradient(0deg, var(--coach-soft), var(--coach-soft)), var(--bg2); border: 1px solid var(--coach-line); }
.cwo-note-t { display: flex; gap: 10px; align-items: flex-start; }
.cwo-note-t p { margin: 0; font-size: 14px; line-height: 1.4; }
.cwo-note-s { margin: 0; font-size: 12.5px; color: var(--text2); line-height: 1.4; }
.cwo-note-a { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cwo-note-a .bd-link { font-size: 14px; font-weight: 700; min-height: 32px; }
.cwo-inst-line { font-size: 14px; line-height: 1.4; margin-bottom: 10px; }

/* Train's + › Saved workouts */
.cwo-sv { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 56px; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg2); color: var(--text); font: inherit; cursor: pointer; }
.cwo-sv span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cwo-sv b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cwo-sv small { font-size: 13px; color: var(--text2); }
.cwo-sv em { font-style: normal; font-size: 13px; color: var(--text2); white-space: nowrap; flex-shrink: 0; }
.cwo-rm { color: var(--red); }

