/* CoachPulse — light surfaces and lime action shared with the Pulse training view. */
#coach-flow {
  --coach-paper:#f7f6fc;
  --coach-white:#fff;
  --coach-ink:#19152b;
  --coach-muted:#59556f;
  --coach-edge:#ddd9e9;
  --coach-violet:#6526cd;
  --coach-wash:#eee7ff;
  --coach-lime:#9aef55;
  --coach-shadow:0 3px 12px #34204e0b,0 1px 3px #34204e0a;
  color:var(--coach-ink);
  font-variant-numeric:tabular-nums;
  min-width:0;
}
#coach-flow .flow-header { margin:0 0 1rem; }
#coach-flow .flow-header h1 { font-size:clamp(1.55rem,4.1vw,2.5rem); line-height:1.08; letter-spacing:-.045em; font-weight:830; }
#coach-flow .flow-header .eyebrow { color:var(--coach-violet); margin:0 0 .35rem; font-weight:750; font-size:.78rem; }
#coach-flow .coach-welcome h1 { font-size:clamp(1.8rem,4.6vw,3rem); }
#coach-flow .coach-welcome p { margin-top:.26rem; color:var(--coach-muted); }
#coach-flow h2 { letter-spacing:-.035em; }
.coach-home-grid { display:grid; gap:.95rem; }
#coach-feature-slot:empty { display:none; }
#coach-flow .coach-feature {
  display:block; margin:0; padding:0; border:0; border-radius:17px;
  background:linear-gradient(125deg,#d9ffac 0%,#b9f89b 52%,#a2d9ba 100%);
  color:#16221b; box-shadow:var(--coach-shadow);
}
.coach-next {
  display:grid; position:relative; isolation:isolate; overflow:hidden;
  align-content:center; justify-items:start; gap:.2rem; text-align:start;
  width:100%; min-height:112px; padding:.9rem 3.4rem .95rem 1.1rem;
  border:1px solid #96c781; border-radius:inherit; background:transparent; color:#16221b;
}
.coach-next::after {
  content:""; position:absolute; z-index:-1; inset:0;
  background:linear-gradient(130deg,transparent 55%,#ffffff24 55%,#ffffff24 67%,transparent 67%),
             linear-gradient(131deg,transparent 73%,#4e729621 73%,#4e729621 79%,transparent 79%);
}
#coach-flow .coach-next:hover { border-color:#70965f; box-shadow:0 4px 14px #2948341a; }
.coach-next strong { font-size:clamp(1.5rem,4vw,2.15rem); letter-spacing:-.045em; line-height:1.09; }
#coach-flow .coach-feature-label { display:inline-flex; align-items:center; gap:.4rem; font-size:.79rem; font-weight:680; color:#273b29; }
.coach-next-meta { font-size:.84rem; font-weight:540; color:#26412e; }
.coach-chevron { display:block; justify-self:center; width:.5rem; height:.5rem; border:solid currentColor; border-width:1.8px 1.8px 0 0; transform:rotate(45deg); }
.coach-next .coach-chevron { position:absolute; right:1.3rem; top:48%; width:.65rem; height:.65rem; }
#coach-flow .coach-directory { margin:0; min-width:0; }
.coach-directory h2,.coach-days-title { margin:0 0 .55rem; font-size:1.12rem; }
#coach-student-count { color:var(--coach-muted); font-size:.86em; font-weight:550; }
.coach-search-field { position:relative; display:block; }
.coach-search-field > svg { pointer-events:none; position:absolute; top:50%; left:.83rem; transform:translateY(-50%); color:var(--coach-muted); }
#coach-flow #coach-search { color:var(--coach-ink); padding:.53rem .75rem .53rem 2.6rem; border:1px solid #cfcadb; border-radius:11px; background:#f1f0f7; font-size:1rem; }
#coach-search::placeholder { color:#605b70; opacity:1; }
.coach-directory[data-searching=false] #coach-search-status { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
#coach-flow .coach-students { padding:0; margin:.55rem 0 0; display:grid; gap:.38rem; }
#coach-flow .coach-students > li {
  margin:0; padding:0; background:var(--coach-white); border:1px solid var(--coach-edge);
  border-radius:12px; box-shadow:var(--coach-shadow); list-style:none;
}
#coach-flow .coach-student-link { display:grid; grid-template-columns:38px minmax(0,1fr) 12px; gap:.65rem; min-height:64px; padding:.63rem .8rem; border:0; }
#coach-flow .coach-student-link:hover { background:#f4f0ff; }
.coach-student-main { display:flex; flex-wrap:wrap; align-items:center; gap:.15rem .5rem; }
.coach-student-main strong { color:var(--coach-ink); font-size:1rem; word-break:break-word; }
#coach-flow .coach-student-main small { flex-basis:100%; margin:0; color:var(--coach-muted); font-size:.8rem; }
#coach-flow .coach-student-state { background:#eee8fa; color:#522a82; border-radius:1rem; padding:.15rem .48rem; font-size:.68rem; font-weight:720; line-height:1.3; letter-spacing:0; white-space:nowrap; }
#coach-flow .coach-student-state[data-state=assigned] { background:#e0f4d6; color:#28532e; }
#coach-flow .coach-student-state[data-state=draft] { background:#fff0ca; color:#694918; }
#coach-flow .coach-student-avatar {
  display:grid; position:relative; overflow:hidden; place-items:center; width:38px; height:38px;
  color:#452568; border-radius:50%; background:linear-gradient(120deg,#e7d7fb,#c0a9e2); font-size:.75rem;
}
.coach-student-avatar[data-portrait]:not([data-portrait=""])::after {
  content:""; position:absolute; inset:0; background-image:url('/athletes.webp'); background-size:200% 200%;
}
.coach-student-avatar[data-portrait=bruno]::after { background-position:100% 0; }
.coach-student-avatar[data-portrait=carla]::after { background-position:0 100%; }
.coach-student-avatar[data-portrait=diego]::after { background-position:100% 100%; }
.coach-student-link > .coach-chevron { color:#66567f; width:.45rem; height:.45rem; }
#coach-flow .coach-student > .ghost { margin-inline-start:.8rem; }
.coach-coverage {
  position:relative; overflow:hidden; isolation:isolate; display:grid; grid-template-columns:minmax(0,1fr) auto;
  gap:.35rem .75rem; align-items:center; color:white; padding:.9rem 1rem; border-radius:14px;
  background:linear-gradient(115deg,#30134e 0%,#421d71 65%,#5a3297 100%);
}
.coach-coverage::after { content:""; position:absolute; z-index:-1; right:-3%; top:-75%; width:45%; height:220%; transform:rotate(-25deg);
  border-radius:50%; border:1px solid #d2a4ff55; box-shadow:0 0 0 11px #a584e817,0 0 0 23px #a584e817,0 0 0 37px #a584e817; }
.coach-coverage p { margin:0; font-weight:750; line-height:1.2; }
.coach-coverage div > span { display:block; margin-top:.15rem; font-size:.79rem; color:#e9dbfa; }
.coach-coverage > strong { font-size:1.6rem; letter-spacing:-.045em; color:#b0ff6d; }
.coach-coverage > strong small { font-size:.72em; }
.coach-coverage progress { width:100%; height:4px; grid-column:1/-1; accent-color:var(--coach-lime); border:0; border-radius:99px; overflow:hidden; background:#ffffff32; }
.coach-coverage progress::-webkit-progress-bar { background:#ffffff32; }
.coach-coverage progress::-webkit-progress-value { background:var(--coach-lime); }
.coach-coverage progress::-moz-progress-bar { background:var(--coach-lime); }

.coach-sequence { display:flex; padding:0; margin:0 auto 1.15rem; list-style:none; max-width:33rem; }
.coach-sequence li { position:relative; display:grid; justify-items:center; gap:.22rem; flex:1; color:var(--coach-muted); font-weight:650; font-size:.77rem; }
.coach-sequence li::before { content:""; position:absolute; height:2px; background:#d4cfdf; top:13px; left:-50%; width:100%; z-index:0; }
.coach-sequence li:first-child::before { content:none; }
.coach-sequence li:not([data-stage=next])::before { background:#a3d67d; }
.coach-sequence li span { position:relative; display:grid; place-items:center; width:27px; height:27px; background:#fcfbff; border:1px solid #b5afc5; border-radius:50%; color:#544965; }
.coach-sequence li[data-stage=done] span { background:#d6f5bf; border-color:#92c86b; color:#285620; }
.coach-sequence li[data-stage=active] span { background:#6627c7; border-color:#6627c7; color:white; box-shadow:0 0 0 3px #e4d4ff; }
.coach-sequence li[data-stage=active] { color:#56249d; }
#coach-flow .coach-plan-intro,.coach-plan-card,.coach-assigned {
  display:flex; align-items:center; gap:.8rem; border:1px solid var(--coach-edge);
  padding:.85rem; border-radius:13px; background:#fff; box-shadow:var(--coach-shadow); min-width:0;
}
#coach-flow .coach-plan-intro,#coach-flow .coach-assigned { display:block; }
#coach-flow .coach-plan-intro h2,#coach-flow .coach-plan-card h2 { margin:0; font-size:1.05rem; }
#coach-flow .coach-plan-intro p,.coach-plan-card p { margin:.16rem 0 0; font-size:.83rem; color:var(--coach-muted); }
.coach-template-icon,.coach-row-mark { display:grid; place-items:center; flex:none; width:42px; height:42px; color:var(--coach-violet); border-radius:12px; background:var(--coach-wash); }
#coach-flow .coach-review-sheet { min-width:0; }
#coach-flow .coach-review-caution { font-size:.82rem; line-height:1.3; padding:.48rem .7rem; color:#553b17; background:#fff7e7; border:1px solid #e9d7b3; margin:.55rem 0 .72rem; }
#coach-flow .coach-days-title { margin-top:.95rem; }
.coach-day-jumps, #coach-edit [aria-label="Elegir día"] { display:flex; align-items:stretch; gap:.4rem; }
.coach-day-jumps button, #coach-edit [aria-label="Elegir día"] button { flex:1; min-width:0; padding:.35rem .2rem; font-size:.85rem; border-radius:10px; }
.coach-day-jumps small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.71rem; font-weight:500; margin-block-start:.16rem; }
#coach-flow .coach-day-jumps button[aria-current=true], #coach-edit [aria-pressed=true] { color:#55229e; background:#ede1ff; border-color:#9b6dd2; }
#coach-flow .coach-review-day { padding:0; margin:.85rem 0; border:0; border-radius:0; background:transparent; scroll-margin-block-start:1rem; }
#coach-flow .coach-review-day > summary { display:flex; align-items:center; justify-content:space-between; gap:.4rem; font-size:1rem; line-height:1.2; margin:0; }
#coach-flow .coach-review-day > summary::-webkit-details-marker { display:none; }
#coach-flow .coach-review-day > summary > .muted { flex:none; font-size:.74rem; font-weight:550; color:var(--coach-muted); }
.coach-review-day > summary > strong { display:flex; align-items:center; gap:.45rem; }
.coach-review-day > summary > strong::before { content:""; flex:0 0 auto; width:.38rem; height:.38rem; border:solid var(--coach-violet); border-width:0 1.5px 1.5px 0; transform:rotate(-45deg); }
.coach-review-day[open] > summary > strong::before { transform:rotate(45deg); }
#coach-flow .coach-review-day ul { margin:0; padding:0; display:grid; list-style:none; gap:.27rem; }
#coach-flow .coach-review-day li {
  display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.65rem;
  padding:.57rem .72rem; border:1px solid var(--coach-edge); border-radius:10px; background:var(--coach-white); box-shadow:var(--coach-shadow);
}
#coach-flow .coach-review-day li .coach-row-mark { width:27px; height:31px; color:var(--coach-violet); border-radius:8px; }
.coach-review-exercise { min-width:0; overflow-wrap:anywhere; }
.coach-review-exercise strong { font-size:.9rem; display:block; color:var(--coach-ink); }
#coach-flow .coach-review-exercise small { display:block; font-size:.74rem; line-height:1.35; margin-top:.13rem; color:var(--coach-muted); }
.coach-dose { background:#f0edf7; color:#373148; border-radius:8px; white-space:nowrap; padding:.3rem .55rem; font-size:.8rem; }
.coach-plan-notes { font-size:.84rem; color:var(--coach-muted); }
#coach-flow .coach-review-actions {
  display:grid; justify-content:stretch; align-items:stretch; gap:0; margin:.45rem 0 0; padding:.45rem .12rem max(.12rem,env(safe-area-inset-bottom,0px));
  position:sticky; bottom:var(--coach-dock-offset,0px); background:var(--coach-paper); z-index:2; border-top:1px solid var(--coach-edge);
}
#coach-flow .coach-review-actions #coach-error:empty { display:none; }
#coach-flow .coach-review-actions #coach-error:not(:empty) { color:#8b242d; padding:.3rem 0; font-size:.86rem; }
#coach-flow .coach-review-actions .primary,#coach-flow .coach-action-bar .primary,#coach-flow .coach-assigned + .actions .primary {
  display:flex; justify-content:center; gap:.5rem; align-items:center; min-height:47px; border:1px solid #8ad746;
  border-radius:13px; background:linear-gradient(115deg,#b1fb61,#85ed4b); color:#182811; font-weight:790;
}
#coach-flow .coach-review-actions .primary:hover,#coach-flow .coach-action-bar .primary:hover { background:#b3f879; }
#coach-flow .coach-review-actions .ghost { min-height:44px; color:#574773; font-size:.83rem; }
#coach-flow .coach-review-sheet :where(summary,button) { scroll-margin-block-end:7.7rem; }
#coach-flow .coach-action-bar { gap:.3rem; justify-content:flex-end; }
#coach-flow .coach-templates { padding:0; margin:0; }
#coach-flow .coach-choice { background:var(--coach-white); border:1px solid var(--coach-edge); box-shadow:var(--coach-shadow); }
#coach-flow .coach-choice:has(input:checked) { background:#f1eaff; border-color:#a675dd; }
#coach-flow .coach-exercise { background:var(--coach-white); border:1px solid var(--coach-edge); border-radius:12px; padding:0 .75rem; }
#coach-flow .coach-exercise > summary { min-height:53px; }
#coach-flow .coach-exercise > summary [data-prescription-summary] { font-size:.78rem; }
#coach-flow .coach-assigned { border-inline-start:4px solid #55aa35; animation:coach-complete .22s ease-out; }
#coach-flow .coach-review-day[open] > ul,#coach-flow .coach-exercise[open] > div { animation:coach-expand .17s ease-out; }
@keyframes coach-expand { from { opacity:.55; transform:translateY(-4px); } to { opacity:1; transform:none; } }
@keyframes coach-complete { from { box-shadow:0 0 0 4px #a1ec8077; transform:translateY(3px); } to { box-shadow:var(--coach-shadow); transform:none; } }
@media(min-width:768px) {
  #coach-flow[data-coach-screen=directory] { max-width:65rem; margin-inline:auto; }
  #coach-flow:not([data-coach-screen=directory]) { max-width:52rem; margin-inline:auto; }
  #coach-flow[data-destination=home] .coach-home-grid:has(#coach-feature-slot:not(:empty)) {
    grid-template-columns:minmax(15rem,.82fr) minmax(19rem,1.2fr); grid-template-rows:auto 1fr; gap:1.1rem 1.5rem; align-items:start;
  }
  #coach-flow[data-destination=home] .coach-home-grid:has(#coach-feature-slot:not(:empty)) .coach-directory { grid-column:2; grid-row:1/3; }
  #coach-flow .coach-next { min-height:156px; padding:1.4rem; }
  #coach-flow .coach-coverage { padding:1.25rem; }
  #coach-flow .coach-templates { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  #coach-flow .coach-preferences { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #coach-flow .coach-review-actions { grid-template-columns:1fr auto; align-items:center; padding:.65rem .1rem; }
  #coach-flow .coach-review-actions #coach-error { grid-column:1/-1; }
}
@media(max-width:360px) {
  #coach-flow .coach-welcome h1 { font-size:1.52rem; }
  #coach-flow .coach-next { min-height:97px; padding:.7rem .9rem; }
  #coach-flow .coach-next-meta { max-width:90%; }
  #coach-flow .coach-student-link { grid-template-columns:33px minmax(0,1fr) 8px; padding:.44rem .55rem; gap:.43rem; }
  #coach-flow .coach-student-avatar { width:33px; height:33px; }
  #coach-flow .coach-review-actions { grid-template-columns:minmax(0,1.42fr) minmax(0,1fr); gap:.3rem; }
  #coach-flow .coach-review-actions #coach-error { grid-column:1/-1; }
  #coach-flow .coach-review-actions .primary { min-height:44px; padding-inline:.35rem; }
  #coach-flow .coach-review-actions .ghost { padding-inline:.2rem; }
  #coach-flow .coach-review-day li { gap:.4rem; padding:.47rem; }
}
@media (max-height:470px) { #coach-flow .coach-review-actions { position:static; } }
@media (prefers-reduced-motion:reduce) {
  #coach-flow *,#coach-flow *::before,#coach-flow *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
