/* The coach portal: athlete list, the banner while an athlete is open, and the chat with its three modes. */
.coach-entry { min-height:44px; }
.coach-portal { max-width:900px; margin:0 auto; padding:16px; }
.coach-client-list { display:grid; gap:10px; }
.coach-client { display:grid; gap:4px; text-align:left; min-height:64px; padding:12px 14px; border-radius:12px; background:var(--surface, transparent); color:var(--ink); border:1px solid var(--line); border-left-width:6px; font-weight:400; white-space:normal; }
.coach-client[data-level="attention"] { border-left-color:#b3261e; }
.coach-client[data-level="watch"] { border-left-color:#c98a00; }
.coach-client[data-level="ok"] { border-left-color:var(--accent); }
.coach-client-head { display:flex; align-items:center; gap:8px; font-size:1.05rem; }
.coach-dot { width:10px; height:10px; border-radius:50%; background:currentColor; opacity:.5; flex:0 0 auto; }
.coach-unread { margin-left:auto; min-width:24px; text-align:center; padding:1px 7px; border-radius:12px; background:var(--accent); color:#fff; font-size:.8rem; font-weight:700; }
.coach-client-why { overflow-wrap:anywhere; }
.coach-client-facts { font-size:.85rem; }
.acting-banner { position:sticky; top:0; z-index:5; margin:0 0 10px; padding:10px 14px; border-radius:10px; background:#1d3b5c; color:#fff; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.acting-banner span { flex:1 1 220px; font-size:.9rem; opacity:.92; }
.acting-banner button { min-height:44px; color:#fff; border-color:rgba(255,255,255,.6); background:transparent; }
.coach-chat { border:1px solid var(--line); border-radius:12px; padding:12px; display:grid; gap:10px; margin:12px 0 90px; min-width:0; background:var(--surface, transparent); }
.coach-chat-modes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.coach-mode { min-height:44px; background:transparent; color:var(--ink); border:1px solid var(--line); white-space:normal; padding:6px; }
.coach-mode[aria-selected="true"] { color:#fff; border-color:transparent; }
.coach-chat[data-mode="client"] .coach-mode[aria-selected="true"], .coach-chat[data-mode="client"] .coach-chat-note { background:#1d3b5c; color:#fff; }
.coach-chat[data-mode="with_ai"] .coach-mode[aria-selected="true"], .coach-chat[data-mode="with_ai"] .coach-chat-note { background:#5a3d8a; color:#fff; }
.coach-chat[data-mode="private"] .coach-mode[aria-selected="true"], .coach-chat[data-mode="private"] .coach-chat-note { background:#3a3a3a; color:#fff; }
.coach-chat-note { margin:0; padding:8px 12px; border-radius:8px; font-size:.9rem; font-weight:600; }
.coach-chat-log { display:grid; gap:8px; max-height:46vh; overflow-y:auto; }
.coach-msg { border:1px solid var(--line); border-radius:10px; padding:8px 12px; min-width:0; }
.coach-msg.mine { background:var(--accent-soft); }
.coach-msg.ai { border-style:dashed; }
.coach-msg strong { margin-right:8px; }
.coach-msg time { color:var(--muted); font-size:.8rem; }
.coach-msg p { margin:4px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.coach-chat-form { display:grid; gap:8px; }
.coach-chat-form textarea, .coach-chat-form button { width:100%; min-height:44px; }
/* Desktop: the athlete's training and the chat side by side. */
@media (min-width:1180px) {
  body.acting main { display:grid; grid-template-columns:minmax(0,1fr) 380px; gap:16px; align-items:start; }
  body.acting main > * { grid-column:1; }
  body.acting main > .coach-chat { grid-column:2; grid-row:1 / span 20; position:sticky; top:12px; margin:0; }
  body.acting .coach-chat-log { max-height:60vh; }
}
/* The Chat / Session switch belongs to a training view, not to the athlete list. */
.coach-list [role="tablist"][aria-label="Coach workspace"] { display:none; }
@media (max-width:520px) { .coach-entry { padding:0 10px; font-size:.9rem; } }
/* Each athlete has their own colour (--athlete): avatar, card edge and the banner while they are open. */
.coach-client { border-left-color:var(--athlete, var(--accent)) !important; gap:6px; }
.coach-avatar { flex:0 0 auto; width:36px; height:36px; border-radius:50%; display:grid; place-items:center; background:var(--athlete, var(--accent)); color:#fff; font-weight:700; font-size:.9rem; }
.coach-level { margin-left:auto; font-size:.72rem; font-weight:700; letter-spacing:.3px; text-transform:uppercase; padding:3px 9px; border-radius:10px; border:1px solid var(--line); white-space:nowrap; }
[data-level="attention"] .coach-level { background:#b3261e; color:#fff; border-color:#b3261e; }
[data-level="watch"] .coach-level { background:#fbe7b0; color:#5c4300; border-color:#c98a00; }
.coach-level + .coach-unread { margin-left:0; }
.coach-ready { font-weight:600; font-size:.9rem; }
.coach-ready[data-ready="low"] { color:#b3261e; }
.coach-ready[data-ready="watch"] { color:#8a5a00; }
.coach-chips { display:flex; flex-wrap:wrap; gap:6px; }
.coach-chip { display:inline-flex; gap:6px; align-items:baseline; padding:3px 9px; border:1px solid var(--line); border-radius:8px; font-size:.85rem; }
.coach-chip-label { color:var(--muted); font-size:.78rem; }
.acting-banner { background:var(--athlete, #1d3b5c); }
.coach-summary { border:1px solid var(--line); border-left:6px solid var(--athlete, var(--accent)); border-radius:10px; padding:8px 12px; }
.coach-summary > summary { display:flex; align-items:center; gap:10px; min-height:44px; cursor:pointer; }
.coach-summary-group { margin-top:10px; display:grid; gap:6px; }
.coach-summary-group h5, .coach-summary-group p { margin:0; }
.coach-summary-group ul, .coach-summary-why { margin:0; padding-left:18px; display:grid; gap:2px; font-size:.92rem; }
/* A coach in the athlete's app: the athlete's own chat is hidden, so Session uses the whole width. */
body.acting #viewContent[data-active-view=today] { grid-template-columns:minmax(0,1fr); }
body.acting #viewContent[data-active-view=today] > #proposal, body.acting #viewContent[data-active-view=today] > #checkin { grid-column:1; }
/* Actions only the athlete can take (the server refuses them for a coach) are not offered. */
body.acting .athlete-only { display:none !important; }
/* The coach's own first-run invitation never shows inside an athlete's app. */
body.acting .tour-invite { display:none; }
/* A compact banner on a phone. */
@media (max-width:640px) {
  .acting-banner { padding:8px 10px; gap:6px; }
  .acting-banner span { flex-basis:100%; font-size:.85rem; }
  .acting-banner button { min-height:40px; padding:6px 12px; font-size:14px; }
}
