/* The coach desk: athletes on the left, the week editor in the middle, the chat on the right (coach-portal.css). */
body.desk main { max-width:none; }
.coach-desk { display:grid; grid-template-columns:200px minmax(0,1fr); gap:16px; align-items:start; min-width:0; }
.coach-desk button { margin:0; min-height:36px; padding:6px 12px; font-size:13px; }
.coach-desk input, .coach-desk textarea { min-height:0; }
.desk-loading { grid-column:1 / -1; }
/* Athletes */
.desk-rail { position:sticky; top:12px; display:grid; gap:6px; align-content:start; max-height:calc(100vh - 24px); overflow-y:auto; }
.desk-rail h2 { font-size:14px; text-transform:uppercase; letter-spacing:.8px; margin:0 0 4px; color:var(--muted); }
.desk-athlete { display:grid; grid-template-columns:32px minmax(0,1fr) auto; grid-template-rows:auto auto; column-gap:8px; text-align:left; background:var(--surface); color:var(--ink); border:1px solid var(--line); border-left:5px solid var(--athlete,var(--accent)); border-radius:10px; padding:6px 8px !important; min-height:52px !important; font-weight:500; }
.desk-athlete .coach-avatar { grid-row:1 / span 2; width:32px; height:32px; font-size:.8rem; }
.desk-athlete-name { font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.desk-athlete-level { grid-column:2; font-size:11px; color:var(--muted); }
.desk-athlete[data-level="attention"] .desk-athlete-level { color:#b3261e; font-weight:700; }
.desk-athlete .coach-unread { grid-row:1 / span 2; grid-column:3; align-self:center; }
.desk-athlete[aria-current="true"] { background:var(--accent-soft); box-shadow:inset 0 0 0 2px var(--athlete,var(--accent)); }
.desk-athlete:hover { background:var(--accent-soft); }
.desk-keys { font-size:11px !important; margin:4px 0 0; }
/* Head, command bar and what it said */
.desk-main { min-width:0; display:grid; gap:10px; }
.desk-head h2 { margin:0; }
.desk-head p { margin:2px 0 0; }
.desk-warn { color:#7a4b00; background:#fbefd0; border:1px solid #e7cf8f; border-radius:8px; padding:6px 10px; font-size:13px; margin:4px 0 0; }
.desk-ask { position:sticky; top:0; z-index:4; display:flex; gap:8px; align-items:center; background:var(--ground,#f5f4f0); padding:6px 0; }
.desk-ask textarea { flex:1; min-width:0; font:inherit; font-size:14px; line-height:1.4; padding:9px 12px; border:2px solid var(--athlete,var(--accent)); border-radius:10px; background:#fff; resize:vertical; min-height:44px; }
.desk-ask textarea:disabled { opacity:.7; }
.desk-kbd { font-family:var(--font-num); font-size:11px; color:var(--muted); border:1px solid var(--line); border-radius:6px; padding:2px 6px; white-space:nowrap; }
.desk-feedback { font-size:13px; min-height:20px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; color:var(--accent); }
.desk-feedback:empty { display:none; }
.desk-feedback.error { color:#8b2a1c; background:#fff1ec; border:1px solid #edcebd; border-radius:8px; padding:6px 10px; }
.desk-feedback.done { background:var(--accent-soft); border-radius:8px; padding:6px 10px; }
.desk-feedback.ai { display:block; background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:8px 10px; color:var(--ink); }
/* Changes to publish */
.desk-panel { border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:var(--surface); display:grid; gap:8px; }
.desk-panel.pending { border:2px solid var(--athlete,var(--accent)); }
.desk-panel h3 { margin:0; font-size:15px; }
.desk-panel p { margin:0; }
.desk-lines { margin:0; padding-left:18px; display:grid; gap:2px; font-size:13px; max-height:28vh; overflow-y:auto; }
.desk-panel textarea { min-height:44px !important; font-size:13px; padding:8px 10px; }
.desk-actions { display:flex; flex-wrap:wrap; gap:8px; }
.desk-publish { background:var(--accent); color:var(--on-accent,#fff); }
/* The week strip and the days */
.desk-strip { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
.desk-chip { display:grid; gap:2px; text-align:left; background:var(--surface) !important; color:var(--ink) !important; border:1px solid var(--line); border-radius:10px; padding:6px 8px !important; min-height:52px !important; font-weight:400; }
.desk-chip strong { font-size:12px; }
.desk-chip span { font-size:11px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.desk-chip.today { border:2px solid var(--athlete,var(--accent)); }
.desk-chip.passed { opacity:.55; }
.desk-chip.drop, .desk-day.drop, .desk-day-head.drop { outline:3px dashed var(--athlete,var(--accent)); outline-offset:2px; }
.desk-days { display:grid; gap:10px; }
.desk-day { border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:#fff; scroll-margin-top:64px; display:grid; gap:8px; }
.desk-day.today { border-color:var(--athlete,var(--accent)); box-shadow:inset 4px 0 0 var(--athlete,var(--accent)); }
.desk-day.passed { background:transparent; opacity:.7; }
.desk-day.changed { box-shadow:inset 4px 0 0 #c98a00; }
.desk-day-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.desk-day-head h3 { margin:0; font-size:15px; min-width:150px; }
.desk-tag { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; border:1px solid var(--line); border-radius:8px; padding:1px 7px; }
.desk-focus { flex:1; min-width:160px; }
.desk-sessions { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,430px),1fr)); gap:8px; }
.desk-rest { margin:0; }
.desk-session { border:1px solid var(--line); border-radius:10px; padding:8px; background:var(--surface); display:grid; gap:6px; min-width:0; }
.desk-session.dragging, .desk-row.dragging { opacity:.4; }
.desk-session-head { display:flex; align-items:center; gap:6px; }
.desk-session-name { flex:1; font-weight:700; }
.desk-grip { cursor:grab; color:var(--muted); user-select:none; font-size:16px; width:18px; text-align:center; }
.desk-grip[draggable="false"] { cursor:default; opacity:.3; }
/* The movement table: one row per movement, Tab moves along it */
.desk-table { display:grid; gap:2px; }
.desk-row { display:grid; grid-template-columns:18px minmax(110px,1fr) 46px 86px 92px 54px 62px; gap:4px; align-items:center; border-radius:6px; }
.desk-row-head span { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.3px; }
.desk-row.changed { background:#fdf3d6; }
.desk-row.drop { box-shadow:inset 0 3px 0 var(--athlete,var(--accent)); }
.desk-cell { padding:5px 7px !important; font-size:13px; border-radius:6px !important; background:#fff !important; border:1px solid transparent !important; width:100%; min-width:0; }
.desk-cell:hover:not(:disabled) { border-color:var(--line) !important; }
.desk-cell:focus { border-color:var(--athlete,var(--accent)) !important; outline:none !important; box-shadow:0 0 0 2px var(--accent-soft); }
.desk-cell:disabled { background:transparent !important; color:var(--ink); }
.desk-num, .desk-reps, .desk-weight, .desk-minutes { font-family:var(--font-num); font-size:12.5px !important; }
.desk-minutes { width:56px !important; flex:0 0 56px; }
.desk-unit { font-size:11px; }
.desk-icon { width:28px; padding:0 !important; min-height:28px !important; line-height:1; }
.desk-block { border-top:1px dashed var(--line); padding-top:6px; display:grid; gap:2px; }
.desk-block-head { display:flex; flex-wrap:wrap; gap:6px; align-items:center; font-size:13px; }
.desk-block-name { flex:1 1 180px; }
.desk-row-actions { display:flex; gap:4px; justify-content:flex-end; }
.desk-ss { font-size:11px !important; font-weight:700; letter-spacing:.3px; }
.desk-split { min-height:30px !important; padding:2px 10px !important; font-size:12px !important; }
.desk-block-head .desk-cell { width:52px; }
.desk-block-row { grid-template-columns:18px minmax(110px,1fr) 56px 50px 64px 20px; }
.desk-name-text { font-size:13px; }
.desk-details { font-size:13px; padding:6px 8px; min-height:44px !important; }
.desk-add input { width:100%; font-size:12.5px; padding:6px 9px; border:1px dashed var(--line-strong,#B9B6AA); background:transparent; border-radius:8px; font-family:var(--font-num); }
.acting-view[aria-pressed="true"] { background:#fff !important; color:var(--athlete,#1d3b5c) !important; }
/* Desktop: the desk and the chat side by side; the chat stays in view while the week scrolls. */
@media (min-width:1180px) {
  body.acting.desk main { grid-template-columns:minmax(0,1fr) 360px; }
}
/* Narrower: the athletes list folds above the week, then the chat goes below. */
@media (max-width:1100px) {
  .coach-desk { grid-template-columns:1fr; }
  .desk-rail { position:static; grid-auto-flow:column; grid-auto-columns:minmax(170px,1fr); overflow-x:auto; max-height:none; }
  .desk-rail h2, .desk-keys { display:none; }
}
@media (max-width:640px) {
  .desk-strip { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .desk-row { grid-template-columns:16px minmax(90px,1fr) 40px 70px 74px 46px 60px; }
  .desk-kbd { display:none; }
}
/* On a phone the movement table keeps its columns and scrolls inside its card, not the page. */
@media (max-width:560px) {
  .desk-session { min-width:0; }
  .desk-table { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .desk-table > .desk-row { min-width:420px; }
}
