/* css/training.css — Training Plans and the Calendar (the owner, 11–12 Oct 2026; plan Phase C). Everything here is scoped to
   the feature's own prefixes (tp- shared pieces, tws- the worksheet and its edit mode, tpa- approvals and the activity forms,
   tpr- / tpw- a request reviewed in the worksheet, tpb- shared form and menu pieces, cal- the Calendar, mt- My training,
   tdy- Today). Only the app's
   existing colours: the tokens in styles.css, plus the lavender and blue tones already used there, declared on the
   feature's roots. No global selectors. */

.tp-page { --tp-lav: #7c3aed; --tp-lav-bg: #ede9fe; --tp-lav-ink: #5b21b6; --tp-blue: #3646a3; --tp-blue-bg: #eef2ff; --tp-blue-line: #c9d1f7; }
.tp-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; margin-bottom: 6px; }
.tp-head h1 { margin: 0; }
.tp-head p { margin: 4px 0 0; }
.tp-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-sub { margin: -4px 0 14px; }
.tp-empty { margin: 0; }
.tp-err { color: var(--danger); margin: 0; }
.tp-msg { min-height: 18px; margin: 8px 0 0; font-size: 13px; }
.tp-msg.is-err { color: var(--danger); }

/* one request (a training request or a request for a new host) */
.tp-req { max-width: 920px; }
.tp-back { display: inline-block; margin: 0 0 10px; font-size: 13.5px; }
.tp-facts { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 8px 16px; margin: 0; }
.tp-facts dt { color: var(--muted); font-size: 13px; }
.tp-facts dd { margin: 0; overflow-wrap: anywhere; }
.tp-quote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: 0 8px 8px 0; overflow-wrap: anywhere; }
.tp-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.tp-matches { margin: 6px 0 0; padding-left: 18px; }
.tp-matches li { margin: 2px 0; }
.tp-inline { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.tp-inline .field { margin: 0 0 10px; }
.tp-inline label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.tp-inline input[type="text"], .tp-inline textarea, .tp-inline select { width: 100%; }
.tp-inline textarea { min-height: 64px; }

/* Training Plans → Approvals: the list (a table on wide screens; one card per request on narrow ones) */
@media (max-width: 640px) {
  .tpa-table { min-width: 0; }
  .tpa-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tpa-table, .tpa-table tbody, .tpa-table tr, .tpa-table td { display: block; width: 100%; }
  .tpa-table tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .tpa-table tr:last-child { border-bottom: 0; }
  .tpa-table td { padding: 2px 0; border: 0; white-space: normal !important; }
  .tpa-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
  .tpa-table td:last-child { padding-top: 10px; }
  .tpa-table td:last-child .btn { width: 100%; justify-content: center; }
}
.tp-kind { font-size: 12.5px; color: var(--muted); }
.tp-dialog .field input[type="text"], .tp-dialog .field textarea { width: 100%; }
.tp-dialog .field textarea { min-height: 72px; }
.tp-dialog [data-matches]:not(:empty) { margin: -4px 0 12px; }

/* Settings → Training plans */
.tp-set { max-width: 560px; margin-top: 16px; }
.tp-set h3 { margin-top: 0; }
.tp-set h4 { margin: 16px 0 6px; font-size: 14px; }
.tp-set h4:first-of-type { margin-top: 4px; }
.tp-set .tp-note { margin: 0 0 8px; }
.tp-set .tp-builtin { font-size: 12px; color: var(--muted); }
.tp-set .tp-addrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tp-set .tp-addrow input[type="text"] { flex: 1 1 160px; min-width: 0; }
.tp-set .tp-addrow label { white-space: nowrap; flex: 0 0 auto; }

@media (max-width: 560px) {
  .tp-facts { grid-template-columns: 1fr; gap: 2px 0; }
  .tp-facts dd { margin-bottom: 8px; }
  .tp-actions .btn { flex: 1 1 auto; }
}

/* ---- the page overlay (settings, Review changes, details) ---- */
.tp-ov { position: fixed; top: 60px; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--border-strong);
  box-shadow: -8px 0 24px rgba(20, 28, 50, .10); z-index: 45; display: flex; flex-direction: column; }
.tp-ov.is-wide { width: min(880px, 100vw); }
.tp-ov-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.tp-ov-head h2 { flex: 1; margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.tp-ov-back { display: none; }
.tp-ov-body { flex: 1; overflow: auto; padding: 16px; }
.tp-ov-body h3 { font-size: 14px; margin: 18px 0 6px; }
.tp-ov-body h3:first-child { margin-top: 0; }
@media (max-width: 760px) { .tp-ov, .tp-ov.is-wide { top: 0; width: 100vw; } .tp-ov-back { display: inline-flex; } .tp-ov-widen { display: none; } }

/* ---- activity icon tiles (the LMS's own line icons) ---- */
.tp-tile { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; flex: none; }
.tp-t-teal { background: var(--brand-soft); color: var(--brand-ink); }
.tp-t-blue { background: #eef2ff; color: #3646a3; }
.tp-t-lav { background: #ede9fe; color: #5b21b6; }
.tp-t-amber { background: var(--warning-soft); color: #7a4f0e; }
.tp-t-slate { background: var(--surface-2); color: var(--muted); }

/* ---- shared pieces (first made for the route builder, retired 13 Oct 2026): the request page's crumb, form fields, menus ---- */
.tpb-crumb { font-size: 13px; }

/* form fields in the app's input style (styles.css .field input) */
.tpb-form select, .tpb-form input[type="text"], .tpb-form input[type="number"], .tpb-form textarea {
  padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; background: var(--surface); color: inherit; box-sizing: border-box; }

/* menus (a learner's ⋯, a row's Move, a Day's ⋯) */
.tpb-menu { position: relative; }
.tpb-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 28, 50, .12); padding: 4px; display: flex; flex-direction: column; }
.tpb-menu-list button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13.5px; cursor: pointer; }
.tpb-menu-list button:hover, .tpb-menu-list button:focus-visible { background: var(--surface-2); }
.tpb-menu-list button[disabled] { color: var(--muted); cursor: default; }

/* the settings and review panels */
.tpb-form .field { margin: 0 0 14px; }
.tpb-form label.tpb-l { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.tpb-form input[type="text"], .tpb-form input[type="number"], .tpb-form select, .tpb-form textarea { width: 100%; }
.tpb-form textarea { min-height: 64px; }
.tpb-form .tpb-radio { display: flex; gap: 14px; flex-wrap: wrap; }
.tpb-form .tpb-radio label, .tpb-form .tpb-check { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; }
.tpb-help { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.tpb-pre { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.tpb-pre .sd-chip button { border: 0; background: none; padding: 0 0 0 6px; cursor: pointer; font: inherit; }



/* the template / block lists (M2) */
.tp-intro { margin: 0 0 10px; }
.tp-flags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }

/* the course builder's SOP planning list dialog (Phase C, decision 37) */
.spl-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; }
.spl-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--border); }
.spl-row:first-child { border-top: 0; }
.spl-main { min-width: 0; overflow-wrap: anywhere; }
.spl-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: 0 0 auto; }
.spl-h { font-size: 14px; margin: 16px 0 6px; }
@media (max-width: 560px) { .spl-row { flex-direction: column; } .spl-acts { justify-content: flex-start; } }

/* the SOP lesson editor: a slide's subchapter part (Phase C, decisions 38, 81) */
.sd-parts .sd-part-flag { border: 1px solid var(--border-strong); border-left: 3px solid var(--warning, #b7791f); border-radius: 8px; padding: 8px 10px; background: var(--warning-soft); }
.sd-parts .sd-part-opts { display: flex; flex-direction: column; gap: 4px; }
.sd-parts .sd-part-opt { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; }
.sd-partflag { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; border-radius: 8px; background: var(--warning-soft); color: #7a4f0e; font-size: 11px; font-weight: 800; }

/* the lesson reader: a lesson read by SOP subchapter (Phase C, decisions 34, 39–40, 81) */
.sop-parts { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.sop-parts.is-one { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sop-parts-k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sop-part-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sop-part-list .btn { white-space: normal; text-align: left; }
.sop-part-ok { color: var(--success); font-size: 13px; font-weight: 600; }
.sop-finish { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sop-parts-hint { font-size: 13px; color: var(--muted); }

/* Training Plans → Learner plans (decisions 49–57; the owner's "Learner workspace") */
.tpp-av { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }

/* Training Plans → Assign a plan: the assignment worksheet (decisions 58–61) */
.tpw-grid { padding: 0; overflow: hidden; }
.tpw-gh { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tpw-pg { display: inline-flex; gap: 6px; align-items: center; }
.tpw-scroll { overflow-x: auto; }
.tpw-table { display: grid; min-width: 0; }
.tpw-c { padding: 8px 10px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); min-width: 0; overflow-wrap: anywhere; }
.tpw-first { border-left: 0; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tpw-h, .tpw-first.tpw-h { background: var(--surface-2); }
.tpw-day, .tpw-first.tpw-day { background: #f6faf9; }
.tpw-dayt { font-weight: 700; }
.tpw-lh { display: flex; gap: 8px; align-items: flex-start; }
.tpw-lhm { flex: 1; min-width: 0; }
.tpw-it { display: flex; gap: 8px; align-items: flex-start; }
.tpw-itn { font-weight: 600; font-size: 13.5px; }
@media (max-width: 640px) { .tpw-first { position: static; } }

/* Training Plans → Approvals: a learner-plan request reviewed in the worksheet (decisions 63–64) */
.tpr-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin: 4px 0 12px; }
.tpr-head h1 { margin: 0; font-size: 24px; }
.tpr-head p { margin: 4px 0 0; }
.tpr-req { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.tpr-req .tp-quote { margin: 0; }
.tpr-req-top { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.tpr-req-main { flex: 1; min-width: 200px; }
.tpr-when { text-align: right; }
.tpr-views { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 10px; }
.tpr-switch { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tpr-switch .btn.is-on { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.tpr-only { display: inline-flex; gap: 6px; align-items: center; }
.tpr-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-left: auto; }
.tpr-orig { text-decoration: line-through; color: var(--danger); }
.tpr-prop { background: var(--brand-soft); color: var(--brand-ink); border-radius: 4px; padding: 0 5px; font-weight: 600; }
.tpr-mv { color: #8a4a00; font-weight: 600; }
.tpr-tag { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tpr-struck { text-decoration: line-through; color: var(--muted); }
.tpr-ghost { color: var(--muted); }
.tpr-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 4px 6px; margin: -4px -6px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; }
.tpr-cell:hover, .tpr-cell:focus-visible { border-color: var(--border-strong); }
.tpr-cell.is-sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.tpw-c.tpr-in { background: #f3faf8; }
.tpw-h.tpr-in { background: #e3f3ef; }
.tpw-day.tpr-in { background: #e9f5f2; }
.tpr-count { color: var(--brand-ink); font-weight: 600; margin-top: 3px; }
.tpr-ctx { margin-top: 3px; }
.tpr-apnote { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.tpr-exp { margin-top: 10px; border-color: var(--brand); }
.tpr-exp p { margin: 4px 0; }
.tpr-exp-top { display: flex; justify-content: space-between; align-items: center; }
.tpr-bar { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.tpr-bar .tp-actions { margin: 0; }
.tpr-block { border: 1px solid var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 8px 12px; }
.tpr-block ul { margin: 4px 0 0; padding-left: 18px; }
.tpr-more summary { cursor: pointer; font-weight: 600; }
.tpr-more-body h3 { font-size: 15px; margin: 12px 0 6px; }
@media (max-width: 640px) { .tpr-when { text-align: left; } .tpr-legend { margin-left: 0; } .tpr-bar .tp-actions .btn { flex: 1; } }
.tpr-bar .tp-msg:empty, .tpr-bar [data-inline]:empty { display: none; }

/* M5: an activity's actions, the plan's actions, readiness (js/tp-actions.js) */
.tpa-form .tpa-who { margin-top: 0; color: var(--muted); }
.tpa-radios { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 4px; }
.tpa-radios label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.tpa-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .tpa-pair { grid-template-columns: 1fr; } }
.tpa-sessions { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.tpa-sessions ul { margin: 4px 0 8px; padding-left: 18px; }
.tpa-recs { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tpa-recs li { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.tpa-check { list-style: none; margin: 0 0 8px; padding: 0; }
.tpa-check li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.tpa-check li.is-ok > span:first-child { color: var(--success); font-weight: 700; }
.tpa-check li.is-open > span:first-child { color: var(--muted); }
.tpa-flag { color: #8a4a00; }
.tpa-decide { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 4px; }
.tpa-flagform summary { cursor: pointer; font-weight: 600; margin-top: 12px; }

/* ---- a coaching follow-up's link to a training plan (M6): the activity picker ---- */
.tp-cl { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px 12px 8px; }
.tp-cl-day { border: 0; margin: 8px 0 0; padding: 0; min-width: 0; }
.tp-cl-day legend { font-weight: 700; font-size: 13px; padding: 4px 0; }
.tp-cl-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; overflow-wrap: anywhere; }
.tp-cl-row input { margin-top: 3px; flex: none; }
.tp-cl-row .sc-sub { display: block; }


/* ---- M6: the admins' Updates, delegations and My authority (Training Plans → Approvals) ---- */
.tpa-upd-bar { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.tpa-upd-bar > p { flex: 1 1 320px; margin: 0; }
.tpa-upd-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tpa-upd-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface, #fff); }
.tpa-upd { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--border); }
.tpa-upd:first-child { border-top: 0; }
.tpa-upd-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: transparent; }
.tpa-upd.is-unread .tpa-upd-dot { background: var(--brand); }
.tpa-upd:not(.is-unread) strong { font-weight: 600; }
.tpa-upd-main { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.tpa-upd-lines { margin: 4px 0; padding-left: 18px; }
.tpa-upd-acts { flex: none; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .tpa-upd { flex-wrap: wrap; } .tpa-upd-acts { width: 100%; justify-content: flex-start; padding-left: 19px; } }
.tpa-dlg-intro { margin: 0 0 12px; max-width: 72ch; }
.tpa-dlg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.tpa-dlg { padding: 14px 16px; margin: 0; }
.tpa-dlg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tpa-dlg-head h3 { margin: 0; font-size: 16px; }
.tpa-dlg-facts { margin: 10px 0 0; display: grid; gap: 6px; }
.tpa-dlg-facts > div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; font-size: 13.5px; }
.tpa-dlg-facts dt { color: var(--muted); }
.tpa-dlg-facts dd { margin: 0; overflow-wrap: anywhere; }
.tpa-dlg-acts { margin: 0; padding-left: 16px; }
.tpa-dlg-btns { justify-content: flex-start; margin-top: 10px; }
.tpa-dlg-old { margin-top: 16px; }
.tpa-dlg-old > summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.tpa-dlg-pick { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; margin-top: 6px; }
.tpa-dlg-tick { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-weight: 400; overflow-wrap: anywhere; }
.tpa-dlg-tick input { margin-top: 3px; flex: none; }
.tpa-dlg-tick[hidden] { display: none; }
.tpa-dlg-page .tpa-dlg { max-width: 760px; }
.tpa-dlg-sec { margin-top: 20px; max-width: 900px; }
.tpa-dlg-sec h2 { font-size: 16px; margin: 0 0 8px; display: inline; }
.tpa-dlg-sec > summary { cursor: pointer; margin-bottom: 8px; }
section.tpa-dlg-sec h2 { display: block; }
.tpa-dlg-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; }
.tpa-dlg-rows li { padding: 10px 14px; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.tpa-dlg-rows li:first-child { border-top: 0; }
@media (max-width: 480px) { .tpa-dlg-facts > div { grid-template-columns: 1fr; gap: 0; } }
.tpb-form legend.tpb-l { font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 4px; }
.tpa-dlg-pick { margin-bottom: 12px; }

/* ---- M7: the cohort overview (Training Days × learners) ---- */
.tp-stations { border: 0; padding: 0; margin: 0 0 12px; }
.tp-stations legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.tp-stations [data-stations] { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-check { display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
.tp-check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft, #e6f4f1); }


/* ---- M8: the Calendar (staff and learners) — the app's own colours: lavender sessions, teal planned (dashed), amber due,
   amber dashed awaiting approval, grey unavailable; labels as well as colour ---- */
.cal { display: flex; flex-direction: column; gap: 12px; }
.cal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cal-head h1 { margin: 0; }
.cal-head p { margin: 4px 0 0; }
.cal-badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: #fff; color: #9e4900; font-weight: 800; font-size: 12.5px; line-height: 20px; text-align: center; }
.cal-bar, .cal-tool { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-scope, .cal-views { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.cal-vbtn { border: 1px solid transparent; background: none; border-radius: 8px; padding: 6px 12px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.cal-vbtn.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.cal-vbtn:focus-visible, .cal-b:focus-visible, .cal-ev:focus-visible, .cal-ag-row:focus-visible, .cal-mo-i:focus-visible, .cal-mo-n:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.cal-fsum { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cal-nav { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-range { font-size: 18px; min-width: 8.5em; text-align: center; }
.cal-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.cal-k-session { background: #f1edfe; color: #4c2a9e; }
.cal-k-planned { background: #ecf8f5; color: #0a6e63; border: 1px dashed #4fae9d; }
.cal-k-due { background: #fdf0d9; color: #7a4f0e; }
.cal-k-pending { background: #fff7e8; color: #7a4f0e; border: 1px dashed #d79a3c; }
.cal-k-unavailable { background: #edf1f6; color: #46536a; }
.cal-wlc { padding: 12px 16px; }
.cal-wl-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cal-wl-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px 24px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cal-wl-bits { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: var(--muted); }
.cal-wl-bits b { color: var(--text); }
.cal-empty { padding: 20px; }
.cal-empty p { margin: 0 0 8px; }
.cal-who { margin: 0; }
.cal-pad { padding: 10px 14px; margin: 0; }
.cal-note { margin: 0; }
.cal-today { display: inline-block; font-size: 12px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 8px; padding: 0 7px; }
/* agenda */
.cal-ag-day h3 { font-size: 14px; margin: 6px 0; }
.cal-ag { list-style: none; margin: 0 0 6px; padding: 0; }
.cal-ag li + li { border-top: 1px solid var(--border); }
.cal-ag-row { display: flex; gap: 14px; align-items: flex-start; width: 100%; border: 0; background: none; padding: 12px 14px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cal-ag-row:hover { background: var(--surface-2); }
.cal-ag-when { flex: 0 0 150px; color: var(--muted); font-size: 13px; }
.cal-ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; overflow-wrap: anywhere; }
.cal-ag-t { font-size: 14.5px; }
.cal-chev { color: var(--muted); }
@media (max-width: 560px) { .cal-ag-row { flex-wrap: wrap; gap: 4px 10px; } .cal-ag-when { flex-basis: 100%; } .cal-chev { display: none; } }
/* blocks (the week band, the learner week, day lists) */
.cal-b { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; box-sizing: border-box; border-radius: 8px; padding: 6px 8px; margin: 0 0 6px; font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.cal-b.cal-k-session { border-left: 3px solid #6d5bd0; }
.cal-b-k { font-size: 11.5px; opacity: .9; }
.cal-b-t { font-size: 13px; font-weight: 700; }
.cal-more { border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand-ink); cursor: pointer; }
/* the week with an hour grid */
.cal-wk { overflow: hidden; }
.cal-wk-grid { display: grid; grid-template-columns: 70px repeat(7, minmax(0, 1fr)); }
.cal-wk-corner, .cal-wk-h { border-bottom: 1px solid var(--border); }
.cal-wk-h { text-align: center; padding: 8px 4px; border-left: 1px solid var(--border); background: var(--surface-2); }
.cal-wk-h span { display: block; font-size: 12.5px; color: var(--muted); }
.cal-wk-h strong { font-size: 20px; }
.cal-wk-h.is-today strong { color: var(--brand-ink); }
.cal-wk-bandl { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.cal-wk-band { padding: 6px 4px 0; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 40px; }
.cal-wk-body { display: grid; grid-template-columns: 70px 1fr; }
.cal-wk-hr { box-sizing: border-box; padding: 2px 8px 0 0; text-align: right; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.cal-wk-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wk-col { position: relative; border-left: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 1px, transparent 1px, transparent 52px); }
.cal-ev { position: absolute; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border-radius: 8px; padding: 4px 6px; font: inherit; text-align: left; cursor: pointer; }
.cal-ev.cal-k-session { border-left: 3px solid #6d5bd0; }
.cal-ev-time { font-size: 11.5px; }
.cal-ev-t { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.cal-ev-p { font-size: 11.5px; opacity: .85; }
/* the learner week: seven day columns */
.cal-wl7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-wl7-d { padding: 8px; min-height: 120px; }
.cal-wl7-d.is-today { border-color: var(--brand); }
.cal-wl7-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; }
.cal-wl7-h strong { color: var(--text); font-size: 18px; }
/* month */
.cal-mo { overflow: hidden; }
.cal-mo-h { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-mo-h > div { padding: 6px; text-align: center; font-size: 12.5px; color: var(--muted); }
.cal-mo-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mo-d { min-height: 96px; padding: 4px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-mo-d:nth-child(7n+1) { border-left: 0; }
.cal-mo-d.is-out { background: var(--surface-2); }
.cal-mo-d.is-out .cal-mo-n { color: var(--muted); }
.cal-mo-n { align-self: flex-start; border: 0; background: none; padding: 2px 6px; font: inherit; font-weight: 700; cursor: pointer; border-radius: 6px; }
.cal-mo-d.is-today { background: var(--brand-soft); }
.cal-mo-d.is-today .cal-mo-n { background: var(--brand-ink); color: #fff; border-radius: 999px; min-width: 28px; height: 28px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
.cal-mo-i { display: block; width: 100%; box-sizing: border-box; border-radius: 6px; padding: 2px 6px; font: inherit; font-size: 12px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* narrow: the week day selector, the month counts */
.cal-sel { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }
.cal-sel-d { position: relative; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 2px; font: inherit; cursor: pointer; }
.cal-sel-d span { font-size: 11.5px; color: var(--muted); }
.cal-sel-d.is-on { border-color: var(--brand); background: var(--brand-soft); }
.cal-dot { position: absolute; top: 2px; right: 4px; font-size: 10.5px; font-weight: 800; color: var(--brand-ink); }
.cal-nm-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-nm-d { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 54px; border: 0; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); background: none; padding: 4px 2px; font: inherit; cursor: pointer; }
.cal-nm-d:nth-child(7n+1) { border-left: 0; }
.cal-nm-d.is-out { background: var(--surface-2); color: var(--muted); }
.cal-nm-d.is-today { background: var(--brand-soft); }
.cal-nm-d.is-today strong { background: var(--brand-ink); color: #fff; border-radius: 999px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.cal-nm-d .small { font-size: 10.5px; color: var(--brand-ink); font-weight: 700; }
/* details, filters, needs scheduling */
.cal-dt { display: flex; flex-direction: column; gap: 8px; }
.cal-dt-k { padding: 0; background: none !important; border: 0 !important; }
.cal-dt-facts { margin: 0; display: grid; gap: 8px; }
.cal-dt-facts > div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; font-size: 14px; }
.cal-dt-facts dt { color: var(--muted); }
.cal-dt-facts dd { margin: 0; overflow-wrap: anywhere; }
.cal-dt-note { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin: 0; }
.cal-dt-acts { list-style: none; margin: 0; padding: 0; }
.cal-dt-acts li { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cal-dt-lt { border-top: 1px solid var(--border); padding-top: 8px; }
.cal-dt-btns { justify-content: flex-start; flex-wrap: wrap; }
.cal-f-q, .cal-f-sel { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: inherit; }
.cal-f-list { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; margin-top: 6px; }
.cal-f-row { display: flex; gap: 8px; align-items: center; padding: 5px 0; font-weight: 400; }
.cal-f-row[hidden] { display: none; }
.cal-nq { list-style: none; margin: 0; padding: 0; }
.cal-nq li { padding: 12px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
@media (max-width: 480px) { .cal-dt-facts > div { grid-template-columns: 1fr; gap: 0; } .cal-range { font-size: 16px; min-width: 0; } }

/* ---- M9: My training (learners) and Today / Upcoming (both Dashboards) ---- */
.mt { display: flex; flex-direction: column; gap: 14px; }
.mt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mt-head h1 { margin: 0; }
.mt-head p { margin: 4px 0 0; }
.mt-none p { margin: 0; }
.mt-paused { margin: 0; }
.mt-prog { display: flex; align-items: center; gap: 16px; padding: 14px 18px; flex-wrap: wrap; }
.mt-prog-n { font-size: 22px; }
.mt-bar { flex: 1 1 200px; height: 8px; border-radius: 6px; background: var(--brand-soft); overflow: hidden; }
.mt-bar span { display: block; height: 100%; background: var(--brand); }
.mt-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); align-self: flex-start; }
.mt-switch button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); }
.mt-switch button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.mt-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .mt-cols { grid-template-columns: minmax(0, 1fr); } }
.mt-sh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 4px 0 8px; flex-wrap: wrap; }
.mt-sh h2 { margin: 0; font-size: 19px; }
.mt-day { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 8px; padding: 1px 8px; vertical-align: middle; }
.mt-card { padding: 0; overflow: hidden; margin-bottom: 14px; }
.mt-empty p { margin: 0 0 4px; }
.mt-list { list-style: none; margin: 0; padding: 0; }
.mt-it { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-top: 1px solid var(--border); }
.mt-list .mt-it:first-child { border-top: 0; }
.mt-sess + .mt-list .mt-it:first-child, .mt-next-h + .mt-list .mt-it:first-child { border-top: 1px solid var(--border); }
.mt-tile { flex: none; }
.mt-it-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.mt-it-sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mt-it-line { color: var(--text); }
.mt-fb { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 6px; }
.mt-fb p { margin: 2px 0 0; }
.mt-start { flex: none; align-self: center; }
@media (max-width: 560px) { .mt-it { flex-wrap: wrap; } .mt-start { margin-left: 44px; align-self: flex-start; } }
.mt-sess { background: #f1edfe; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.mt-sess + .mt-sess { border-top: 1px solid #ddd3fb; }
.mt-sess-k { color: #4c2a9e; font-weight: 600; }
.mt-sess-t { font-size: 20px; font-weight: 800; color: #4c2a9e; }
.mt-next-h { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface-2); }
.mt-date { display: inline-flex; flex-direction: column; align-items: center; min-width: 54px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--brand-ink); font-size: 11.5px; font-weight: 700; }
.mt-date strong { font-size: 22px; line-height: 1.1; }
.mt-plan { display: flex; flex-direction: column; gap: 10px; }
.mt-dayc { padding: 0; overflow: hidden; }
.mt-dayc.is-today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.mt-dayc > summary { display: flex; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; list-style: none; }
.mt-dayc > summary::-webkit-details-marker { display: none; }
.mt-badge { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.mt-badge.is-done { background: #e3f5ec; color: #136c45; }
.mt-day-t { display: flex; flex-direction: column; }
.mt-dayc .mt-list { border-top: 1px solid var(--border); }
.mt-ready { padding: 14px 18px; }
.mt-ready h2 { margin: 0 0 8px; font-size: 17px; }
.mt-ready-row { padding: 6px 0; }
.mt-ready-row p { margin: 4px 0 0; }
.mt-quiz-host { margin-top: 8px; }
/* Today / Upcoming */
.tdy { padding: 16px 18px; margin: 0 0 16px; }
.tdy-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tdy-head h2 { margin: 0 0 2px; }
.tdy-links { display: flex; gap: 8px; flex-wrap: wrap; }
.tdy-cols { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 860px) { .tdy-cols { grid-template-columns: minmax(0, 1fr); } .tdy-up { border-top: 1px solid var(--border); padding-top: 10px; } }
.tdy-list { list-style: none; margin: 0; padding: 0; }
.tdy-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.tdy-row:first-child { border-top: 0; }
.tdy-row[hidden] { display: none; }
.tdy-when { flex: 0 0 150px; font-size: 13px; color: var(--muted); }
.tdy-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; overflow-wrap: anywhere; }
.tdy-act { flex: none; }
@media (max-width: 560px) { .tdy-row { flex-wrap: wrap; } .tdy-when { flex-basis: 100%; } .tdy-act { flex-basis: 100%; } }
.tdy-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.tdy-k-session { background: #f1edfe; color: #4c2a9e; }
.tdy-k-planned { background: #ecf8f5; color: #0a6e63; border: 1px dashed #4fae9d; }
.tdy-k-due { background: #fdf0d9; color: #7a4f0e; }
.tdy-k-pending { background: #fff7e8; color: #7a4f0e; border: 1px dashed #d79a3c; }
.tdy-k-todo { background: #edf1f6; color: #46536a; }
.tdy-empty { margin: 6px 0; color: var(--muted); }
.tdy-toggle { margin-top: 4px; }
.tdy-uph { font-size: 14px; margin: 0 0 8px; }
.tdy-uprow { display: flex; gap: 10px; align-items: flex-start; }
.tdy-date { display: inline-flex; flex-direction: column; align-items: center; min-width: 64px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; font-size: 11px; color: var(--muted); }
.tdy-date b { font-size: 14px; color: var(--brand-ink); }
.tdy-uplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tdy-uplist li { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }

/* ---- M15: the worksheet — Cohort overview (the owner's one-worksheet redesign, 13 Oct 2026; reference screenshots) ---- */
.view.view-wide.tws-view { max-width: none; }
.tws { display: flex; flex-direction: column; gap: 16px; }
.tws-head { display: flex; gap: 12px 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.tws-head h1 { margin: 0; }
.tws-head p { margin: 4px 0 0; }
.tws-head-r { display: flex; gap: 8px; flex-wrap: wrap; }
.tws-tools { display: flex; gap: 8px 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.tws-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tws-btns .btn { display: inline-flex; align-items: center; text-decoration: none; }
.tws-badge { display: inline-block; min-width: 20px; margin-left: 8px; padding: 0 6px; box-sizing: border-box; border-radius: 999px; background: var(--cta); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.tws-badge[hidden] { display: none; }
.tws-who { margin: 0; padding-top: 6px; }
.tws-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px 16px; }
.tws-filters .field { margin: 0; min-width: 0; }
.tws-foot { margin: 0; }

/* the sheet: rows are display:contents, so the cells sit in one grid; the header row sticks under the top bar */
.tws-card { padding: 0; }
.tws-gh { display: flex; justify-content: space-between; align-items: center; gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tws-gh-t { min-width: 0; overflow-wrap: anywhere; }
.tws-gh-t strong { font-size: 16px; }
.tws-gh-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tws-pg { display: inline-flex; gap: 6px; align-items: center; }
.tws-pg .btn { padding: 4px 10px; }
.tws-pad { padding: 12px 16px; margin: 0; }
.tws-hint { border-top: 1px solid var(--border); }
.tws-scroll { overflow-x: clip; }
.tws-table { display: grid; min-width: 0; }
.tws-row { display: contents; }
.tws-c { padding: 10px 12px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); min-width: 0; overflow-wrap: anywhere; background: var(--surface); }
.tws-first { border-left: 0; position: sticky; left: 0; z-index: 1; }
.tws-h { position: sticky; top: 60px; z-index: 2; background: var(--surface-2); }
.tws-first.tws-h { z-index: 3; font-size: 15px; }
.tws-lh { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.tws-lhn { display: flex; gap: 6px; align-items: flex-start; justify-content: space-between; width: 100%; }
.tws-lhn strong { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.tws-lh .sd-chip { margin-top: 3px; }
.tws-more { border: 1px solid transparent; background: none; border-radius: 6px; padding: 0 7px; font: inherit; font-size: 17px; line-height: 24px; color: var(--muted); cursor: pointer; }
.tws-more:hover, .tws-more[aria-expanded="true"] { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.tws-more:focus-visible, .tws-dayb:focus-visible, .tws-cell:focus-visible, .tws-notebtn:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.tws-rd { color: var(--brand-ink); font-weight: 600; margin-top: 2px; }
.tws-c.tws-day { background: var(--brand-soft); border-left: 0; padding: 8px 12px; }
.tws-dayb { display: inline-flex; align-items: baseline; gap: 6px; position: sticky; left: 12px; border: 0; background: none; padding: 2px 4px; margin-left: -4px; border-radius: 4px; font: inherit; color: var(--brand-ink); cursor: pointer; text-align: left; }
.tws-dayb:hover b { text-decoration: underline; }
.tws-car { display: inline-block; width: 12px; }
.tws-dayn { font-size: 14px; }
.tws-it { display: flex; gap: 8px; align-items: flex-start; }
.tws-itm { min-width: 0; }
.tws-itn { font-size: 14.5px; }
.tws-it .small { margin-top: 2px; }
.tws-warn { color: #8a4a00; }

/* a cell: the learner's side of the activity; the notes button sits in its top-right corner */
.tws-c.tws-cellc { position: relative; padding: 6px; }
.tws-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; height: 100%; box-sizing: border-box; border: 2px solid transparent; border-radius: 8px; padding: 6px 34px 8px 8px;
  background: none; font: inherit; font-size: 14px; line-height: 1.35; color: var(--text); text-align: left; cursor: pointer; }
.tws-cell:hover { background: var(--surface-2); }
.tws-cell.is-sel { border-color: var(--brand); background: var(--brand-soft); }
.tws-cell.is-sel .tws-line:not(.tws-sh) { color: var(--brand-ink); }
.tws-cell.is-none { cursor: default; padding-right: 8px; }
.tws-cell.is-none:hover { background: none; }
.tws-chip { font-size: 12px; padding: 2px 8px; white-space: normal; margin-bottom: 2px; }
.tws-sh { color: var(--muted); }
.tws-cell .tws-person, .tws-booked, .tws-extra { color: var(--brand-ink); font-weight: 600; font-size: 13.5px; }
.tws-pend { font-size: 12px; font-weight: 700; color: #7a4f0e; background: var(--warning-soft); border-radius: 999px; padding: 1px 8px; }
.tws-notebtn { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 2px; border: 1px solid transparent; background: none; border-radius: 6px; padding: 3px 4px;
  color: var(--text); font: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; }
.tws-notebtn:hover, .tws-notebtn[aria-expanded="true"] { border-color: var(--border-strong); background: var(--surface); }
.tws-notebtn.has { color: var(--brand-ink); }
.tws-c.tws-arch { background: var(--surface-2); }
.tws-first.tws-arch .small { margin-top: 2px; }
.tws-list { display: flex; flex-direction: column; gap: 12px; }
.tws-ld ul { margin: 6px 0 0; padding: 0; list-style: none; }
.tws-ld li { padding: 6px 0; border-top: 1px solid var(--border); }

/* the editor beneath the row: Dates & shifts · Exemption, the activity's other actions; the notes panel in amber */
.tws-ed { padding: 16px 18px 18px; border-top: 2px solid var(--brand); border-bottom: 1px solid var(--border); background: #f7fbfa; min-width: 0; }
.tws-ed.is-notes { background: #fdf3e1; }
.tws-edh { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.tws-edh h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.tws-edh p { margin: 3px 0 0; }
.tws-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tws-tabs button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 7px 14px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.tws-tabs button[aria-selected="true"] { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.tws-tabs button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.tws-pane { max-width: 900px; }
.tws-pane .tws-person { max-width: 520px; }
.tws-pane .tws-person p { margin: 4px 0 0; }
.tws-ed textarea, .tws-addl textarea { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-size: 14px; background: var(--surface); color: inherit; }
.tws-dates { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.tws-drow { display: flex; gap: 10px 12px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.tws-drow .field { margin: 0; flex: 1 1 170px; max-width: 240px; }
.tws-drow .tws-hrs { flex: 0 1 150px; }
.btn.tws-rm { border-color: var(--border-strong); background: var(--surface); color: var(--text); padding: 8px 12px; }
.btn.tws-adddate { color: var(--brand-ink); padding-left: 0; }
.tws-nodate { margin: 0 0 6px; }
.tws-warnbox, .tws-pendbox { background: var(--warning-soft); border: 1px solid #ecd3a5; border-radius: 8px; padding: 10px 12px; margin: 10px 0; color: #5c3d0b; }
.tws-warnbox ul { margin: 6px 0 0; padding-left: 18px; }
.tws-pendbox { margin: 0 0 14px; }
.tws-pendbox .tp-actions { margin-top: 8px; }
.tws-ro { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.tws-why { color: var(--muted); }
.tws-edfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.tws-edfoot > p { margin: 0; flex: 1 1 240px; }
.tws-edfoot > .tp-err:empty { display: none; }
.tws-edfoot .tp-actions { margin: 0 0 0 auto; }
.tws-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.tws-acts:empty { display: none; }
.tws-actsl { margin-right: 4px; }
.tws-exf { max-width: 680px; }
.tws-note { background: var(--surface); border: 1px solid #f0e2c4; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.tws-note p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tws-noteform { margin-top: 12px; }
.tws-noteform .field { margin-bottom: 0; }
.tws-noteedit { margin-top: 6px; }
.tws-noteedit .tp-actions { margin-top: 8px; }
.tws-hist { list-style: none; margin: 10px 0 0; padding: 0; }
.tws-hist li { padding: 10px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.tws-hist li:first-child { border-top: 0; }

/* the notes popover: fixed, inside the screen; the ⤡ corner resizes it */
.tws-pop { position: fixed; z-index: 44; display: flex; flex-direction: column; box-sizing: border-box; max-height: calc(100vh - 16px); background: #fdf1dc; border: 1px solid #efd9ad; border-radius: 12px; box-shadow: 0 12px 32px rgba(20,28,50,.22); }
.tws-pop.is-pinned { box-shadow: 0 0 0 2px var(--brand), 0 12px 32px rgba(20,28,50,.22); }
.tws-poph { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid #efd9ad; }
.tws-poph h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.tws-poph p { margin: 2px 0 0; color: var(--muted); }
.tws-poph .btn, .btn.tws-resize { border: 1px solid #e7d3a8; background: var(--surface); color: var(--text); }
.tws-popb { overflow: auto; padding: 10px 14px; min-height: 60px; box-sizing: border-box; }
.tws-popb:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.tws-popf { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid #efd9ad; flex-wrap: wrap; }
.btn.tws-resize { margin-left: auto; cursor: nwse-resize; touch-action: none; font-size: 16px; line-height: 1; padding: 6px 9px; }

/* the dialogs: Routes & templates, Add a route, Add learners */
.tws-mh { align-items: flex-start; }
.tws-mh h2 { font-size: 20px; }
.tws-mh p { margin: 4px 0 0; }
.tws-mh .btn-ghost { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.tws-mf { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.tws-mf > p { margin: 0; }
.tws-routes { display: flex; flex-direction: column; gap: 10px; }
.tws-rcard { display: flex; gap: 10px 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.tws-rcard.is-on { border-color: var(--brand); background: var(--brand-soft); }
.tws-rcm { min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; }
.tws-rca { display: flex; gap: 8px; flex-wrap: wrap; }
.tws-rflags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tws-rarch { margin-top: 6px; }
.tws-rarch > summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.tws-rarch .tws-rcard { margin-bottom: 10px; }
.tws-dupbox, .tws-sum { background: var(--warning-soft); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; color: #5c3d0b; }
.tws-dupbox div { margin-top: 6px; }
.tws-dupbox .linklike { text-decoration: none; font-weight: 600; }
.tws-addl .field { margin-bottom: 8px; }
.tws-ll { list-style: none; margin: 0 0 12px; padding: 0; max-height: 46vh; overflow: auto; }
.tws-ll > li { border-bottom: 1px solid var(--border); }
.tws-li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; }
.tws-li input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--brand-ink); }
.tws-li label { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.tws-li.is-off label { cursor: default; color: var(--muted); }
.tws-blocked { color: #8a4a00; }
.tws-ck { color: var(--brand-ink); }
.tws-bul { margin: 0 0 4px; padding-left: 20px; }
.tws-bul li { margin: 3px 0; }
.tp-check input[type="checkbox"] { width: 18px; height: 18px; padding: 0; margin: 0; flex: none; accent-color: var(--brand-ink); }
.tws-addroute a, .tws-dupbox a, .tws-rset a { color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.tws-addroute a:hover, .tws-rset a:hover { text-decoration: underline; }
.tws-tset-more { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.btn.tws-danger { color: var(--danger); }
.btn.tws-dangerbtn { background: var(--danger); border-color: var(--danger); color: #fff; }

/* phones: the filters stack, one learner column, the date rows as two columns (the ✕ beside the date) */
@media (max-width: 640px) {
  .tws-filters { grid-template-columns: minmax(0, 1fr); }
  .tws-c { padding: 8px; }
  .tws-c.tws-cellc { padding: 4px; }
  .tws-cell { padding-right: 30px; }
  .tws-ed { padding: 14px 12px 16px; }
  .tws-drow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .tws-drow .field { max-width: none; grid-column: 1; }
  .btn.tws-rm { grid-column: 2; grid-row: 1; }
  .tws-edfoot .tp-actions { width: 100%; margin: 0; }
  .tws-edfoot .tp-actions .btn { flex: 1 1 0; }
  .tws-rca { width: 100%; }
}

/* ---- M16: Edit plan on the worksheet (reference screenshots "Editing TB", "Add to Training Day", "Template settings",
   "Review shared plan changes") ---- */
.tws.is-editing [data-appr][aria-disabled="true"] { opacity: .5; pointer-events: none; }
/* the editing bar stays in view while scrolling (under the top bar); the sheet's header row sticks just below it */
.tws-editbar { position: sticky; top: 60px; z-index: 4; padding: 12px 16px; border: 1px solid #a8dccd; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand-ink); box-shadow: 0 8px 16px -12px rgba(20,28,50,.45); }
.tws-editbar:focus { outline: none; }
.tws-editbar:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.tws-editbar-r { display: flex; gap: 10px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tws.is-editing .tws-h { top: calc(60px + var(--tws-bar, 0px)); }
.tws-editbar-x { margin-top: 10px; padding-top: 10px; border-top: 1px solid #a8dccd; color: var(--text); }
.tws-editbar-x[hidden], .tws-editbar-x [hidden] { display: none; }
.tws-editbar-x .tp-err { margin: 0 0 4px; }
.tws-editbar-x .field { margin: 0 0 6px; max-width: 720px; }
.tws-editbar-x textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-size: 14px; background: var(--surface); }
.tws-editbar-x .tp-actions { margin: 0; }
.tws-xlist { margin: 2px 0 0; padding-left: 18px; }
.tws-sm { display: none; }
.tws-editbar-t { min-width: 0; flex: 1 1 320px; }
.tws-editbar-t strong { font-size: 16px; }
.tws-editbar-t .small { margin-top: 2px; }
.tws-savest { color: var(--muted); }
.tws-editbar-b { display: flex; gap: 8px; flex-wrap: wrap; }
.tws-editbar-b .btn:not(.btn-primary) { color: var(--brand-ink); }
.tws-c.tws-day[data-dayrow] { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; }
.tws-dayx { display: inline-flex; gap: 6px; align-items: center; }
.tws-dayx .btn { color: var(--brand-ink); background: var(--surface); }
.tws-it.is-edit { gap: 6px; }
.tws-grip { flex: none; cursor: grab; color: var(--muted); font-size: 17px; line-height: 1.2; padding: 0 2px; touch-action: none; user-select: none; -webkit-user-select: none; }
.tws-grip:hover { color: var(--brand-ink); }
.tws-movew { display: block; margin-top: 6px; }
.tws-movew .tpb-menu-list { left: 0; right: auto; }
.btn.tws-move { padding: 2px 10px; font-size: 12.5px; }
.tws-first:has(.tpb-menu-list), .tws-h:has(.tpb-menu-list) { z-index: 6; }
.tws-cell.is-static { cursor: default; }
.tws-cell.is-static:hover { background: none; }
/* dragging: the row being moved, the line where it lands and its destination ("Move to Training Day 2") */
.tws-row.is-dragging > .tws-c { opacity: .45; }
.tws-row.is-dragging > .tws-first { outline: 2px dashed var(--brand-ink); outline-offset: -3px; opacity: .7; }
body.tws-dragging, body.tws-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.tws-droptag { position: fixed; z-index: 61; pointer-events: none; padding: 3px 10px; border-radius: 999px; background: var(--brand-ink); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 12px rgba(20,28,50,.25); }
.tws-droptag[hidden], .tws-dropline[hidden] { display: none; }
.tws-ghost { position: fixed; z-index: 60; pointer-events: none; max-width: 300px; padding: 6px 12px; border: 1px solid var(--brand); border-radius: 8px; background: var(--surface); font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(20,28,50,.2); }
.tws-dropline { position: fixed; z-index: 59; height: 4px; border-radius: 2px; background: var(--brand); pointer-events: none; }
.tws-editfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); }
.tws-addp { background: var(--surface); }
.tws-apane { max-width: 900px; }
.tws-aform { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.tws-where { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: -4px 0 6px; }
.tws-where:empty { display: none; }
.tws-pick { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.tws-pick > p { margin: 0; padding: 10px 12px; }
.tws-opt { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.tws-opt:last-child { border-bottom: 0; }
.tws-optb { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.tws-optb:hover { background: var(--surface-2); }
.tws-opt.is-on .tws-optb { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.tws-optb:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.tws-optt { font-weight: 600; }
.tws-drill { align-self: center; margin-right: 6px; font-size: 16px; }
.tws-picksub { padding: 8px 12px 4px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.tws-notice { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--warning-soft); color: #5c3d0b; }
.tws-addp .tp-err:empty { display: none; }
/* phones: a compact editing bar (the count, the saving state, short buttons in one row) */
@media (max-width: 640px) {
  .tws-editbar { padding: 10px 12px; }
  .tws-editbar [data-explain] { display: none; }
  .tws-editbar-b { width: 100%; }
  .tws-editbar-b .btn { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
  .tws-lg { display: none; }
  .tws-sm { display: inline; }
  .tws-dayx { width: 100%; justify-content: space-between; }
}

/* ---- 13 Oct 2026 refinements ---- */
/* Training Plans' two main tabs (the Content Library's .lib-tabs) and the attention count beside Coaching tasks */
.tws > .tp-tabs { margin-bottom: 0; }
.lib-tabs.tp-tabs { flex-wrap: wrap; align-items: flex-end; }
.lib-tabs a.tp-attn { align-self: center; margin: 0 0 4px 2px; padding: 2px 10px; border: 0; border-radius: 999px; background: var(--warning-soft); color: #7a4f0e; font-size: 12.5px; font-weight: 700; }
.lib-tabs a.tp-attn:hover { text-decoration: underline; }
.lib-tabs a.tp-attn:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.lib-tabs a.tp-attn[hidden] { display: none; }
.cf-in-tp .cf-lead { margin: -6px 0 12px; }
/* what just happened (applied, sent, saved to the shared draft) and the state lines above the sheet */
.tws-flash { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.tws-flash[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .tws-flash:not([hidden]) { animation: tws-in .25s ease-out; } }
@keyframes tws-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tws-states:empty { display: none; }
.tws-state { display: flex; gap: 10px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); }
.tws-state > div { min-width: 0; flex: 1 1 280px; }
.tws-state strong { font-size: 15px; }
.tws-state .small { margin-top: 2px; }
.tws-state.is-pending { background: var(--warning-soft); border: 1px solid #efd2a0; color: #5c3d0b; }
.tws-state.is-pending strong { color: #7a4f0e; }
.tws-state.is-draft { background: var(--surface); border: 1px dashed var(--border-strong); }
/* Edit plan: a changed row (amber, a bar on its left and what changed — never colour alone); a removed one; a Day's change */
.tws-row.is-chg > .tws-c { background: #fff7e8; }
.tws-row.is-chg > .tws-first { box-shadow: inset 4px 0 0 var(--cta); }
.tws-chgl { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: #8a4a00; }
.tws-chgl > span { font-size: 9px; }
.tws-chgl.is-gone { display: inline-flex; margin: 0 6px 0 0; padding: 1px 8px; border-radius: 999px; background: #fbe8eb; color: #a8263b; }
.tws-c.tws-gone { background: var(--surface-2); color: var(--muted); padding: 8px 12px; overflow-wrap: anywhere; }
.tws-gone s { color: var(--text); }
.tws-daychg { margin-right: auto; padding: 1px 9px; border: 1px solid #f3d9a8; border-radius: 999px; background: #fff7e8; color: #8a4a00; font-size: 12.5px; font-weight: 700; }
/* Route settings (Routes & templates) */
.tws-rsh { margin: 0 0 8px; font-size: 15px; }
.tws-rset .field input[type="text"] { max-width: 100%; }
.tws-mfb { display: inline-flex; gap: 8px; flex-wrap: wrap; }
/* New coaching task: the body scrolls, the actions stay in reach; the examples above the description */
.cf-dlgform { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.cf-dlgform > .cf-dlg { flex: 1 1 auto; min-height: 0; max-height: none; }
.cf-dlghead h2 + p { margin: 2px 0 0; }
.modal-foot.cf-dlgfoot { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.cf-dlgfoot .sc-err { flex: 1 1 100%; margin: 0; }
.cf-dlgfoot .sc-hint { flex: 1 1 260px; margin: 0; }
.cf-dlgbtns { display: flex; gap: 8px; margin-left: auto; }
.cf-ex { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 0 8px; }
.cf-exl { flex: 1 1 100%; font-size: 13px; color: var(--muted); }
.cf-exb { border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; background: var(--surface-2); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.cf-exb:hover { border-color: var(--border-strong); }
.cf-exb[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.cf-exb:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.cf-exask { margin: 0 0 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-soft); color: #5c3d0b; }
.cf-exask[hidden] { display: none; }
.cf-exask p { margin: 0 0 8px; font-size: 14px; }
.cf-exask-b { display: flex; gap: 8px; flex-wrap: wrap; }
.cf-exh { margin: 4px 0 0; }
@media (max-width: 480px) { .cf-dlgbtns { width: 100%; } .cf-dlgbtns .btn { flex: 1 1 0; } }
