/* stat cards, badges, toolbar, client list & detail, charts
   Extracted from index.html 2026-08-01. Load order matters: later files
   override earlier ones, exactly as the single <style> block did. */

/* STAT CARDS */
.stat-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:10px;margin-bottom:22px;}
.stat-card{background:var(--s1);border:1px solid var(--b1);border-radius:var(--r);padding:14px 16px;}
.stat-label{font-size:8px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);margin-bottom:7px;font-weight:600;}
.stat-val{font-family:'Manrope',sans-serif;font-size:30px;letter-spacing:1px;line-height:1;color:var(--text);}
.stat-val.green{color:var(--green);}
.stat-val.red{color:var(--red);}
.stat-val.gold{color:var(--gold);}
.stat-val.orange{color:var(--orange);}
.stat-sub{font-size:11px;color:var(--muted);margin-top:4px;}

/* TRAFFIC LIGHT BADGE */
.tl-dot{width:8px;height:8px;border-radius:50%;display:inline-block;flex-shrink:0;}
.tl-dot.green{background:var(--green);}
.tl-dot.yellow{background:#c9910a;}
.tl-dot.red{background:var(--red);}

/* TOOLBAR / SEARCH */
.toolbar{display:flex;align-items:center;gap:9px;margin-bottom:16px;flex-wrap:wrap;}
.search-wrap{position:relative;flex:1;min-width:180px;}
.search-wrap svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:13px;height:13px;stroke:var(--muted);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.search-input{width:100%;background:var(--s1);border:1px solid var(--b1);color:var(--text);font-family:'Manrope',sans-serif;font-size:12px;padding:8px 12px 8px 32px;border-radius:var(--r);outline:none;transition:.15s;}
.search-input:focus{border-color:var(--gold-border);}
.search-input::placeholder{color:var(--dim);}
.filter-tabs{display:flex;gap:4px;}
.ftab{background:var(--s1);border:1px solid var(--b1);color:var(--muted);font-size:11px;font-weight:500;padding:6px 13px;border-radius:var(--r);cursor:pointer;transition:.15s;}
.ftab:hover{color:var(--text);border-color:var(--b2);}
.ftab.active{border-color:var(--gold-border);color:var(--gold);background:var(--gold-bg);}
.sort-select{background:var(--s1);border:1px solid var(--b1);color:var(--muted);font-family:'Manrope',sans-serif;font-size:11px;font-weight:500;padding:6px 26px 6px 10px;border-radius:var(--r);cursor:pointer;outline:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa49a'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;transition:.15s;}

/* CLIENT LIST */
.client-list{display:flex;flex-direction:column;gap:0;border:1px solid var(--b1);border-radius:var(--r);overflow:hidden;background:var(--s1);}
/* Let the alert-pill hover popover escape the list's rounded clip. */
.client-list:has(.row-alert-pill:hover){overflow:visible;}
.client-row{border-bottom:1px solid var(--b1);padding:13px 18px;display:flex;align-items:center;gap:14px;cursor:pointer;transition:.12s;}
.client-row:last-child{border-bottom:none;}
.client-row:hover{background:var(--s2);}
.client-row.flagged{border-left:3px solid var(--red);}
.client-avatar{width:34px;height:34px;border-radius:50%;background:var(--gold-bg);border:1.5px solid var(--gold-border);display:flex;align-items:center;justify-content:center;font-family:'Manrope',sans-serif;font-size:14px;letter-spacing:1px;color:var(--gold);flex-shrink:0;text-transform:uppercase;}
.client-info{flex:1;min-width:0;}
.client-name{font-weight:600;font-size:13px;margin-bottom:1px;color:var(--text);}
.client-meta{font-size:11px;color:var(--muted);}
.client-stats{display:flex;gap:22px;flex-shrink:0;}
.cstat{text-align:right;}
.cstat-val{font-family:'Manrope',sans-serif;font-size:16px;letter-spacing:.5px;color:var(--text);}
.cstat-val.ok{color:var(--green);}
.cstat-val.warn{color:var(--orange);}
.cstat-val.bad{color:var(--red);}
.cstat-label{font-size:9px;color:var(--dim);margin-top:1px;letter-spacing:.2px;}
.alert-icons{display:flex;gap:4px;flex-shrink:0;}
/* Alert pill on each client row — pulses when urgent so it actually catches
   the eye, hover reveals the exact issues without leaving the list. */
.row-alert-pill{position:relative;display:inline-flex;align-items:center;gap:5px;flex-shrink:0;font-family:'Manrope',sans-serif;font-size:11px;font-weight:700;letter-spacing:.04em;padding:5px 10px;border-radius:14px;cursor:default;transition:transform .12s;}
.row-alert-pill.urgent{background:rgba(217,48,48,.16);color:var(--red);border:1px solid rgba(217,48,48,.5);box-shadow:0 0 0 0 rgba(217,48,48,.6);animation:rap-pulse 1.9s ease-in-out infinite;}
.row-alert-pill.warning{background:rgba(255,140,30,.14);color:var(--orange);border:1px solid rgba(255,140,30,.45);}
.row-alert-pill:hover{transform:translateY(-1px);}
.row-alert-pill .rap-icon{font-size:11px;line-height:1;}
.row-alert-pill .rap-count{font-weight:800;}
@keyframes rap-pulse{0%{box-shadow:0 0 0 0 rgba(217,48,48,.55);}70%{box-shadow:0 0 0 7px rgba(217,48,48,0);}100%{box-shadow:0 0 0 0 rgba(217,48,48,0);}}
.row-alert-pop{display:none;position:absolute;right:0;top:calc(100% + 6px);z-index:20;min-width:260px;max-width:340px;background:var(--bg);border:1px solid var(--b1);border-radius:8px;padding:8px 10px;box-shadow:0 10px 28px rgba(0,0,0,.45);text-align:left;}
.row-alert-pill:hover .row-alert-pop{display:block;}
.row-alert-pop-item{display:flex;align-items:center;gap:8px;padding:5px 4px;font-size:11px;font-weight:600;color:var(--text);letter-spacing:0;text-transform:none;line-height:1.35;}
.row-alert-pop-item + .row-alert-pop-item{border-top:1px solid var(--b1);}
.row-alert-pop-item .pop-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0;}
.row-alert-pop-item.urgent .pop-dot{background:var(--red);}
.row-alert-pop-item.warning .pop-dot{background:var(--orange);}
.active-toggle{background:none;border:1px solid var(--b1);color:var(--muted);font-size:9px;font-weight:600;letter-spacing:.3px;padding:3px 8px;border-radius:var(--r);flex-shrink:0;white-space:nowrap;text-transform:uppercase;}
.active-toggle.on{background:var(--gold);border-color:var(--gold-d);color:#fff;}
.phase-chip{font-size:10px;font-weight:600;padding:3px 7px;border-radius:3px;flex-shrink:0;white-space:nowrap;color:var(--muted);background:rgba(0,0,0,.04);}
.phase-chip.overdue,.phase-chip.this-week{color:var(--red);background:rgba(196,46,46,.08);}
.phase-chip.next-week{color:var(--orange);background:rgba(184,90,20,.08);}
.phase-chip.later{color:var(--muted);background:rgba(0,0,0,.035);}
.flag-btn{background:none;border:none;font-size:16px;cursor:pointer;opacity:.2;transition:.15s;padding:0 2px;flex-shrink:0;}
.flag-btn:hover,.flag-btn.on{opacity:1;}
.empty-state{text-align:center;padding:60px 20px;color:var(--muted);}
.empty-state p{font-size:13px;}
.empty-state svg{width:36px;height:36px;stroke:var(--muted);stroke-width:1.5;fill:none;display:block;margin:0 auto 12px;}
.cl-loader{display:flex;align-items:center;gap:12px;padding:10px 14px;background:var(--gold-bg);border:1px solid var(--gold-border);border-radius:var(--r);margin-bottom:8px;}
.cl-loader-spin{width:14px;height:14px;border:2px solid var(--gold);border-top-color:transparent;border-radius:50%;animation:sync-spin 0.7s linear infinite;flex-shrink:0;}
.cl-loader-text{font-size:11px;color:var(--gold);font-weight:600;letter-spacing:.04em;flex-shrink:0;}
.cl-loader-bar{flex:1;height:5px;background:rgba(160,122,8,.15);border-radius:3px;overflow:hidden;min-width:120px;}
.cl-loader-fill{height:100%;background:var(--gold);border-radius:3px;transition:width .35s ease;}

/* CLIENT DETAIL */
.back-btn{display:inline-flex;align-items:center;gap:6px;background:var(--s1);border:1px solid var(--b1);color:var(--muted);font-size:12px;font-weight:500;padding:6px 13px;border-radius:var(--r);cursor:pointer;transition:.15s;margin-bottom:20px;}
.back-btn:hover{color:var(--text);border-color:var(--b2);}
.client-detail-hdr{display:flex;align-items:center;gap:14px;margin-bottom:22px;padding-bottom:18px;border-bottom:1px solid var(--b1);}
.cd-avatar{width:52px;height:52px;border-radius:50%;background:var(--gold-bg);border:2px solid var(--gold-border);display:flex;align-items:center;justify-content:center;font-family:'Manrope',sans-serif;font-size:20px;letter-spacing:1px;color:var(--gold);flex-shrink:0;text-transform:uppercase;}
.cd-name{font-family:'Manrope',sans-serif;font-size:26px;letter-spacing:2px;color:var(--text);}
.cd-email{font-size:11px;color:var(--muted);margin-top:2px;}
.cd-badges{display:flex;gap:5px;margin-top:6px;flex-wrap:wrap;}
.cd-badge{font-size:9px;letter-spacing:.08em;text-transform:uppercase;padding:2px 8px;border-radius:3px;font-weight:600;}
.cd-badge.green{background:rgba(30,143,80,.1);color:var(--green);border:1px solid rgba(30,143,80,.25);}
.cd-badge.red{background:rgba(196,46,46,.1);color:var(--red);border:1px solid rgba(196,46,46,.25);}
.cd-badge.orange{background:rgba(184,90,20,.1);color:var(--orange);border:1px solid rgba(184,90,20,.25);}
.cd-badge.gold{background:var(--gold-bg);color:var(--gold);border:1px solid var(--gold-border);}
.cd-right{margin-left:auto;display:flex;gap:8px;align-items:flex-start;}
.cd-training-plan{font-size:11px;color:var(--muted);margin-top:2px;}

/* TABS */
.tab-nav{display:flex;gap:0;border-bottom:1px solid var(--b1);margin-bottom:22px;}
.tab-btn{background:none;border:none;border-bottom:2px solid transparent;color:var(--muted);font-family:'Manrope',sans-serif;font-size:12px;font-weight:600;padding:9px 15px;cursor:pointer;transition:.12s;margin-bottom:-1px;}
.tab-btn:hover{color:var(--text);}
.tab-btn.active{color:var(--gold);border-bottom-color:var(--gold);}
.tab-content{display:none;}
.tab-content.active{display:block;}
.tab-loading-note{margin-left:auto;align-self:center;font-family:'Manrope',sans-serif;font-size:11px;font-weight:600;color:var(--muted);white-space:nowrap;animation:tabLoadPulse 1.3s ease-in-out infinite;}
@keyframes tabLoadPulse{0%,100%{opacity:.45}50%{opacity:1}}

/* WOW PANEL */
.wow-panel{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--b1);border:1px solid var(--b1);border-radius:var(--r);overflow:hidden;margin-bottom:20px;}
.wow-cell{background:var(--s1);padding:14px 16px;}
.wow-label{font-size:8px;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:6px;font-weight:600;}
.wow-val{font-family:'Manrope',sans-serif;font-size:24px;letter-spacing:1px;line-height:1;color:var(--text);}
.wow-val.pos{color:var(--green);}
.wow-val.neg{color:var(--red);}
.wow-val.neu{color:var(--muted);}
.wow-val.orange{color:var(--orange);}
.wow-sub{font-size:10px;color:var(--muted);margin-top:3px;}

/* CHARTS */
.chart-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px;margin-bottom:22px;}
.chart-card{background:var(--s1);border:1px solid var(--b1);border-radius:var(--r);padding:16px 18px;}
.chart-title{font-size:8px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;font-weight:600;}
.chart-title span{text-transform:none;letter-spacing:0;font-size:13px;font-weight:600;color:var(--text);font-family:'Manrope',sans-serif;}
.chart-wrap{position:relative;height:150px;}
.chart-range{display:flex;gap:4px;margin-bottom:10px;}
.cr-btn{background:var(--s1);border:1px solid var(--b1);color:var(--muted);font-size:9px;padding:3px 8px;border-radius:var(--r);cursor:pointer;transition:.12s;font-weight:500;}
.cr-btn:hover{color:var(--text);border-color:var(--b2);}
.cr-btn.active{border-color:var(--gold-border);color:var(--gold);background:var(--gold-bg);}
.no-data{text-align:center;padding:36px 20px;color:var(--dim);font-size:12px;}

/* CHECK-IN ROWS */
.ci-filter-bar{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;background:var(--s1);border:1px solid var(--b1);border-radius:var(--r);padding:12px 16px;margin-bottom:14px;}
.ci-filter-group{display:flex;flex-direction:column;gap:3px;}
.ci-filter-label{font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600;}
.ci-date-input{background:var(--s2);border:1px solid var(--b1);color:var(--text);font-family:'Manrope',sans-serif;font-size:12px;padding:6px 9px;border-radius:var(--r);outline:none;cursor:pointer;min-width:130px;}
.ci-clear-btn{background:transparent;border:1px solid var(--b1);color:var(--muted);font-size:11px;font-weight:500;padding:6px 13px;border-radius:var(--r);cursor:pointer;transition:.15s;align-self:flex-end;}
.ci-clear-btn:hover{border-color:var(--gold-border);color:var(--gold);}
.target-input{background:var(--s2);border:1px solid var(--b1);color:var(--text);font-family:'Manrope',sans-serif;font-size:13px;padding:5px 8px;border-radius:5px;text-align:center;outline:none;}
.target-input:focus{border-color:var(--gold-border);}
.target-input::placeholder{color:var(--muted);}
.ci-section{margin-bottom:14px;}
.ci-section-title{font-size:8px;letter-spacing:.14em;text-transform:uppercase;color:var(--gold);font-weight:600;margin-bottom:7px;padding-bottom:5px;border-bottom:1px solid var(--b1);}
.mp-rename-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--gold-bg);border:1px solid var(--gold-border);border-radius:var(--r);padding:9px 12px;}
.mp-rename-lead{display:flex;align-items:center;gap:9px;}
/* Clickable summary of interactive meal-plan changes — jumps to the full section. */
/* THE DROP-DOWN READS AS ONE BLOCK, not a bar with a card under it: the wrap
   owns the border and the radius, the header loses its own, and the body sits
   inside with a hairline between them. Open or shut, the outline is the same
   shape — which is what stops an expanded row looking like two components
   that happen to be touching. */
.ci-actwrap{margin-top:8px;border:1px solid var(--b1);border-radius:var(--r);background:var(--card,var(--s1));overflow:hidden;transition:border-color .12s;}
.ci-actwrap.is-open{border-color:var(--gold-border);}
.ci-actwrap.is-failed{border-color:var(--red,#b3453a);}
/* .is-open used to be derived with :has(.ci-actsummary.is-open). The painter
   writes it now: the test harness asserts JS, so a structural CSS match is a
   second mechanism no negative control can see, and a renamed class would
   leave this border stale in silence. */
.ci-actsummary{display:flex;align-items:center;gap:9px;background:transparent;border:none;border-radius:0;padding:8px 12px;cursor:pointer;transition:background .12s;}
.ci-actsummary:hover{background:var(--gold-bg);}
.ci-actsummary.is-open{background:var(--gold-bg);border-bottom:1px solid var(--b1);}
.ci-actbody{padding:11px 13px 13px;}
/* The date a note was WRITTEN, beside its text. Quiet, because the note is the
   content and the date is the filing — but on screen, not on hover, because
   "which Saturday" is the question it exists to answer. */
.ci-note-when{font-size:10px;color:var(--dim);font-weight:600;white-space:nowrap;}
/* The note-history fold's header. Closed by default: the face is plan-scoped,
   the history is one click. */
.ci-notes-head{display:flex;align-items:center;justify-content:space-between;gap:9px;cursor:pointer;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);}
.ci-notes-head:hover{color:var(--text);}
.ci-notes-head .ci-notes-go{font-size:10px;font-weight:700;color:var(--gold);text-transform:none;letter-spacing:0;white-space:nowrap;}
/* The window the notes were sliced to, beside the count. Quiet and not
   uppercase, because it qualifies the count rather than competing with it. */
.ci-notes-head .ci-notes-win{font-weight:600;color:var(--dim);text-transform:none;letter-spacing:0;}
/* The CHANGES box is a button when there is a log behind it, and looks like
   one: a count nobody can tell is clickable is a feature nobody finds. */
.ci-act-box{flex:1;min-width:0;border:1px solid var(--b1);border-radius:9px;padding:9px 6px;text-align:center;background:var(--card);}
.ci-act-box.is-click{cursor:pointer;transition:border-color .12s,background .12s;}
.ci-act-box.is-click:hover{border-color:var(--gold-border);background:var(--gold-bg);}
/* The per-day average under the net-cal total. Small, because it qualifies
   the figure above rather than competing with it. */
.ci-act-foot{font-size:9px;color:var(--dim);font-weight:600;margin-top:3px;line-height:1.2;}
/* The activity-log modal rows. One day heading, then its changes. */
.ci-log-day{font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--gold);margin:12px 0 4px;}
.ci-log-day:first-child{margin-top:0;}
.ci-log-row{display:flex;align-items:baseline;gap:8px;padding:5px 0;border-bottom:1px solid var(--b1);font-size:12px;line-height:1.4;}
.ci-log-row:last-child{border-bottom:none;}
.ci-log-ic{flex:none;}
.ci-log-main{flex:1;min-width:0;color:var(--text);}
.ci-log-at{flex:none;font-size:10px;color:var(--dim);font-variant-numeric:tabular-nums;white-space:nowrap;}
.ci-log-note{font-size:11.5px;color:var(--muted);padding:4px 0 8px;}
/* A truncated read is not a note, it is a caveat on every figure beside it. */
.ci-log-warn{color:var(--gold);}
.ci-actsummary .mps-ic{font-size:14px;flex:none;}
.ci-actsummary .mps-body{flex:1;min-width:0;font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ci-actsummary .mps-body b{color:var(--text);font-weight:700;}
.ci-actsummary .mps-go{font-size:11px;font-weight:700;color:var(--gold);white-space:nowrap;flex:none;}
/* The anchor note: small and quiet, because it qualifies the sentence rather
   than competing with it — but on the row, not behind a hover, since a coach
   comparing this to the check-in-anchored PR line is the mistake it prevents. */
/* .mps-anchor was the "current week, not the check-in's" note. Georgiy removed
   it on 2026-10-30 as redundant, and it had been wide enough to truncate the
   summary beside it. The rule goes with the span. */
.ci-actsummary.is-failed .mps-body b{color:var(--red,#b3453a);}
.mp-field-label{font-size:8px;letter-spacing:.14em;text-transform:uppercase;color:var(--gold);font-weight:600;margin-bottom:5px;}
.mp-current-box{background:var(--s2,var(--s1));border:1px solid var(--b1);border-radius:var(--r);padding:9px 11px;font-size:13px;color:var(--text);word-break:break-word;}
.ci-blank{color:var(--dim);font-style:italic;font-size:11px;}
/* "Not asked" must read as absent rather than empty: greyed, struck through and
   dotted, so a coach scanning a check-in never mistakes a question we withheld
   for a question the client ignored. Deliberately quieter than .ci-blank. */
.ci-notasked{color:var(--dim);opacity:.55;font-size:11px;font-style:italic;
  text-decoration:line-through;text-decoration-style:dotted;cursor:help;}
.checkin-list{display:flex;flex-direction:column;gap:6px;}
.checkin-row{background:var(--s1);border:1px solid var(--b1);border-radius:var(--r);overflow:hidden;}
.checkin-hdr{display:flex;align-items:center;gap:10px;padding:11px 16px;cursor:pointer;transition:.12s;}
.checkin-hdr:hover{background:var(--s2);}
.checkin-date{font-size:10px;color:var(--gold);flex-shrink:0;min-width:85px;font-weight:600;letter-spacing:.3px;}
.checkin-client{font-weight:600;font-size:12px;flex:1;color:var(--text);}
.checkin-weight{font-size:11px;color:var(--muted);flex-shrink:0;font-weight:500;}
/* NEW LOW. Green because it is the good news on this row, and the only green
   thing in the strip, so it reads at a glance without being shouted. Sized
   and shaped like the other row chips rather than larger: it sits beside
   NOT STARTED and must not out-rank the status the coach is acting on. */
/* The card the tag opens. Fixed-ish width so two lines of numbers do not
   reflow into one long line on a narrow window. */
#ci-newlow-pop{position:absolute;z-index:900;display:none;max-width:250px;background:var(--s1);
  border:1px solid var(--b1);border-radius:var(--r);box-shadow:0 6px 24px rgba(0,0,0,.14);
  padding:10px 12px;font-size:12.5px;color:var(--text);line-height:1.45;}
#ci-newlow-pop.open{display:block;}
.ci-nlp-t{font-size:9px;letter-spacing:.08em;text-transform:uppercase;color:var(--green);font-weight:700;margin-bottom:5px;}
.ci-nlp-m{font-size:13px;}
.ci-nlp-p{color:var(--muted);margin-top:3px;}
.ci-nlp-c{color:var(--orange);margin-top:6px;font-size:11px;}
/* a button now, not a span, so it resets the chrome a button brings with it */
/* ── PERSONAL RECORDS, check-in panel ────────────────────────────────────
   One row per lift. The WEIGHT is the loud thing; the qualifier that says
   which kind of record it was is 10px and grey, because Georgiy asked for
   "smaller and more feint letters (10RM) so it doesn't make the card too
   cluttered looking". #7a7264 on white is 4.9:1, so it is quiet and still
   legible rather than merely decorative. */
.ci-pr-head{font-size:11px;color:var(--text);font-weight:600;margin-bottom:6px;}
.ci-pr-note{font-size:11px;color:var(--muted);font-weight:400;}
.ci-pr-err{font-size:12px;color:var(--orange);font-weight:600;}
.ci-pr-err .ci-pr-note{display:block;margin-top:3px;font-weight:400;}
.ci-pr-list{list-style:none;margin:0;padding:0;}
.ci-pr-row{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid var(--b1);font-size:12.5px;}
.ci-pr-row:last-child{border-bottom:none;}
.ci-pr-ex{flex:1 1 auto;min-width:0;color:var(--text);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ci-pr-val{flex:0 0 auto;color:var(--text);font-weight:700;white-space:nowrap;}
.ci-pr-q{font-size:10px;color:var(--muted);font-weight:600;letter-spacing:.02em;}
.ci-pr-chg{flex:0 0 auto;min-width:46px;text-align:right;color:var(--green);font-weight:700;font-size:12px;white-space:nowrap;}/* min-width, NOT width: the string grew from "+10" to "+10 vs prev" and a fixed 46px   box with nowrap overflowed LEFTWARD across the gap and over .ci-pr-val. Measured   2026-10-29 at this font size, and the numbers go stale if anyone changes it:   "+10 vs prev" needed 65px, "+165 vs prev" 71px, all four rows colliding. The 46px   floor never binds today; it is kept so the column cannot collapse if the string   ever shrinks back. */
.ci-pr-more{display:block;width:100%;text-align:left;margin-top:7px;padding:4px 0;background:none;border:none;font:inherit;font-size:11.5px;color:var(--gold);font-weight:600;cursor:pointer;}
.ci-pr-more:hover{color:var(--gold-d);}
@media (max-width:560px){.ci-pr-row{flex-wrap:wrap}.ci-pr-chg{text-align:left}}
.ci-newlow{font:inherit;cursor:pointer;font-size:9px;letter-spacing:.05em;background:rgba(42,122,69,.12);color:var(--green);border:1px solid rgba(42,122,69,.42);border-radius:3px;padding:2px 8px;flex-shrink:0;font-weight:700;text-transform:uppercase;white-space:nowrap;}
.checkin-expand{font-size:10px;color:var(--dim);flex-shrink:0;transition:.2s;}
.checkin-body{display:none;padding:14px 16px;border-top:1px solid var(--b1);font-size:12px;color:var(--muted);line-height:1.7;}
.checkin-body.open{display:block;}
.ci-stat{background:var(--s2);border:1px solid var(--b1);border-radius:var(--r);padding:8px 11px;}
.ci-stat-label{font-size:8px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-bottom:2px;font-weight:600;}
.ci-stat-val{font-size:13px;font-weight:600;color:var(--text);}
.ci-field{margin-bottom:10px;font-size:13px;color:var(--text);line-height:1.5;}
.ci-field strong{color:var(--muted);font-size:9px;letter-spacing:.1em;text-transform:uppercase;display:block;margin-bottom:3px;font-weight:600;}
.coach-note{background:var(--gold-bg);border:1px solid var(--gold-border);border-radius:var(--r);padding:11px 14px;margin-top:12px;}
.coach-note strong{color:var(--gold);font-size:8px;letter-spacing:.14em;text-transform:uppercase;display:block;margin-bottom:6px;font-weight:600;}
.note-input{width:100%;background:var(--s1);border:1px solid var(--b1);color:var(--text);font-family:'Manrope',sans-serif;font-size:12px;padding:8px 10px;border-radius:var(--r);outline:none;resize:vertical;min-height:60px;line-height:1.55;transition:.15s;}
.note-input:focus{border-color:var(--gold-border);}
.note-save-btn{margin-top:7px;background:var(--gold);color:#fff;border:none;font-family:'Manrope',sans-serif;font-size:11px;font-weight:600;padding:7px 15px;border-radius:var(--r);cursor:pointer;transition:.15s;letter-spacing:.3px;}
.note-save-btn:hover{background:var(--gold-d);}

/* ALERTS */
.alert-section{margin-bottom:26px;}
.alert-section-title{font-size:9px;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:10px;display:flex;align-items:center;gap:8px;font-weight:600;cursor:pointer;user-select:none;}
.alert-section-title:hover{color:var(--text);}
.alert-section-title .caret{font-size:11px;color:var(--dim);transition:transform .15s;width:10px;text-align:center;display:inline-block;}
.alert-section.collapsed .caret{transform:rotate(-90deg);}
.alert-section.collapsed .alert-cards{display:none;}
.alert-section-title::after{content:'';flex:1;height:1px;background:var(--b1);}
.alert-dismiss-btn{background:transparent;border:1px solid var(--b1);color:var(--dim);font-family:'Manrope',sans-serif;font-size:10px;font-weight:600;letter-spacing:.04em;padding:4px 8px;border-radius:5px;cursor:pointer;transition:.12s;}
.alert-dismiss-btn:hover{background:rgba(217,48,48,.08);border-color:rgba(217,48,48,.3);color:var(--red);}
/* Alert card — expandable variant. The card grows to host an inline
   profile+message panel when the coach clicks the client's name. */
.alert-card.expanded{flex-direction:column;align-items:stretch;}
.alert-row-hdr{display:flex;align-items:center;gap:12px;width:100%;}
.alert-name-btn{background:none;border:none;padding:0;cursor:pointer;font-family:'Manrope',sans-serif;font-size:14px;letter-spacing:.04em;color:var(--text);text-align:left;display:flex;align-items:center;gap:6px;}
.alert-name-btn:hover{color:var(--gold);}
.alert-caret{font-size:10px;color:var(--muted);width:8px;display:inline-block;}
.alert-expand{margin-top:12px;padding:12px;background:var(--s1);border:1px solid var(--b1);border-radius:8px;display:flex;flex-direction:column;gap:10px;}
.alert-tab-nav{display:flex;gap:4px;border-bottom:1px solid var(--b1);padding-bottom:4px;margin-bottom:4px;}
.alert-tab-btn{background:none;border:none;color:var(--muted);font-family:'Manrope',sans-serif;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;padding:6px 12px;border-radius:5px;cursor:pointer;}
.alert-tab-btn.active{background:var(--s2);color:var(--text);}
.alert-tab-btn:hover{color:var(--text);}
.alert-stat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;}
.alert-stat-card{background:var(--bg);border:1px solid var(--b1);border-radius:6px;padding:8px 10px;}
.alert-stat-card .label{font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600;margin-bottom:2px;}
.alert-stat-card .val{font-size:14px;font-weight:700;color:var(--text);}
.alert-stat-card .val.red{color:var(--red);}
.alert-stat-card .val.warn{color:var(--orange);}
.alert-msg-row{display:flex;flex-direction:column;gap:8px;}
.alert-msg-textarea{width:100%;background:var(--bg);border:1px solid var(--b1);border-radius:6px;padding:9px 12px;font-family:'Manrope',sans-serif;font-size:13px;color:var(--text);resize:vertical;min-height:90px;line-height:1.45;}
.alert-msg-textarea:focus{outline:none;border-color:var(--gold-border);}
.alert-msg-toolbar{display:flex;align-items:center;gap:8px;}
.alert-msg-toolbar .meta{flex:1;font-size:10px;color:var(--muted);letter-spacing:.04em;}
.alert-msg-send{background:rgba(46,140,196,.18);border:1px solid rgba(46,140,196,.5);color:#3aa9d9;font-family:'Manrope',sans-serif;font-size:11px;font-weight:700;letter-spacing:.04em;padding:7px 14px;border-radius:6px;cursor:pointer;white-space:nowrap;}
.alert-msg-send:disabled{opacity:.5;cursor:not-allowed;}
/* Messages / inbox UI */
.msg-thread-list{width:340px;flex-shrink:0;border-right:1px solid var(--b1);overflow-y:auto;background:var(--s1);}
.msg-thread-row{display:flex;gap:10px;padding:10px 12px;border-bottom:1px solid var(--b1);cursor:pointer;transition:.12s;align-items:flex-start;}
.msg-thread-row:hover{background:var(--s2);}
.msg-thread-row.selected{background:var(--gold-bg);}
.msg-thread-row.unread{border-left:3px solid var(--red);padding-left:9px;}
.msg-thread-flag{font-size:11px;vertical-align:1px;}
/* Filter pills above the thread list — independent toggles, can both be on. */
/* WRAPS. The thread list is a fixed narrow column and this row grew from three
   pills to five; without wrapping the last one ran off the edge and the rest
   were squeezed until their labels broke mid-phrase ("Unread / only" over two
   lines). Pills keep their natural width and flow onto a second row instead. */
.msg-filter-bar{display:flex;flex-wrap:wrap;gap:5px;padding:0 10px 8px;border-bottom:1px solid var(--b1);}
/* nowrap is what stops a squeezed pill from breaking its own label in half —
   the row wraps, the words inside a pill never do. */
.msg-filter-pill{flex:0 0 auto;white-space:nowrap;background:var(--s2);border:1px solid var(--b1);color:var(--muted);font-family:'Manrope',sans-serif;font-size:9.5px;font-weight:600;letter-spacing:.03em;padding:4px 9px;border-radius:999px;cursor:pointer;transition:.12s;}
.msg-filter-pill:hover{color:var(--text);border-color:var(--b2);}
.msg-filter-pill.active{background:var(--gold-bg);border-color:var(--gold-border);color:var(--gold);}
.msg-filter-pill.disabled,.msg-filter-pill:disabled{opacity:.4;cursor:not-allowed;background:var(--s2);border-color:var(--b1);color:var(--muted);}
.msg-filter-pill.disabled:hover,.msg-filter-pill:disabled:hover{color:var(--muted);border-color:var(--b1);}
.msg-thread-avatar{width:34px;height:34px;border-radius:50%;background:var(--s3);flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--muted);overflow:hidden;}
.msg-thread-avatar img{width:100%;height:100%;object-fit:cover;}
.msg-thread-meta{flex:1;min-width:0;}
.msg-thread-name{font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.msg-thread-excerpt{font-size:11px;color:var(--muted);line-height:1.35;margin-top:2px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.msg-thread-time{font-size:10px;color:var(--dim);margin-top:3px;letter-spacing:.04em;}
.msg-thread-buried{font-size:9px;color:var(--red);font-weight:700;letter-spacing:.04em;margin-top:3px;background:rgba(217,48,48,.07);border:1px solid rgba(217,48,48,.25);border-radius:3px;padding:2px 5px;display:inline-block;}
/* "Waiting on you" + its dismiss control, shown only inside the Unresponded
   view. Amber rather than the red the buried-message chip owns: this is work
   outstanding, not an alarm. The cleared variant is deliberately quiet — it is
   an undo affordance, not a status worth drawing the eye. */
.msg-thread-unresp{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:9px;font-weight:700;letter-spacing:.04em;margin-top:3px;padding:2px 5px;border-radius:3px;color:var(--gold);background:var(--gold-bg);border:1px solid var(--gold-border);width:fit-content}
.msg-thread-unresp button{font:inherit;font-size:9px;font-weight:700;letter-spacing:.03em;background:none;border:1px solid currentColor;color:inherit;border-radius:3px;padding:1px 5px;cursor:pointer;opacity:.75}
.msg-thread-unresp button:hover{opacity:1}
.msg-thread-unresp.dismissed{color:var(--muted);background:transparent;border-color:var(--b1);font-weight:600}
/* Touch-base reminders */
.tb-pill{background:rgba(217,48,48,.1);border-color:rgba(217,48,48,.35);color:var(--red);}
.tb-badge{background:var(--red);color:#fff;border-radius:8px;padding:0 5px;margin-left:3px;font-size:9px;font-weight:800;}
.msg-thread-row.tb-due{background:rgba(217,48,48,.07);border-left:3px solid var(--red);padding-left:9px;}
.msg-thread-row.tb-due.selected{background:var(--gold-bg);}
.msg-thread-tb{font-size:10px;color:var(--red);font-weight:600;margin-top:4px;background:rgba(217,48,48,.1);border:1px solid rgba(217,48,48,.3);border-radius:4px;padding:3px 6px;display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.msg-thread-tb button{margin-left:auto;background:var(--red);color:#fff;border:none;border-radius:4px;padding:2px 7px;font-size:10px;font-weight:700;cursor:pointer;}
/* Backend-override "owner's client" pinned thread (e.g. Alex's Shannon in Tyler's inbox) */
.msg-thread-row.injected{background:rgba(46,140,196,.06);border-left:3px solid #3aa9d9;padding-left:9px;}
.msg-thread-row.injected.selected{background:var(--gold-bg);}
.msg-thread-inject-tag{font-size:10px;color:#2e8cc4;font-weight:700;letter-spacing:.02em;margin-top:3px;background:rgba(46,140,196,.1);border:1px solid rgba(46,140,196,.32);border-radius:4px;padding:2px 6px;display:inline-block;}
.msg-inject-banner{background:rgba(46,140,196,.1);border-bottom:1px solid rgba(46,140,196,.3);color:#2e8cc4;font-size:12px;font-weight:600;padding:8px 14px;line-height:1.45;}
/* Message reactions — hover bar mirrors Trainerize's own picker */
.msg-react-zone{display:flex;flex-direction:column;}
.msg-react-bar{display:flex;gap:2px;align-self:flex-start;margin-top:5px;background:var(--bg);border:1px solid var(--b1);border-radius:999px;padding:3px 6px;box-shadow:0 2px 10px rgba(0,0,0,.14);}
.msg-row.from-trainer .msg-react-bar{align-self:flex-end;}
.msg-react-opt{background:none;border:none;cursor:pointer;font-size:15px;line-height:1;padding:3px 4px;border-radius:50%;transition:.12s;}
.msg-react-opt:hover{transform:scale(1.28);background:var(--s2);}
.msg-reactions{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;}
.msg-reaction{background:var(--s2);border:1px solid var(--b1);border-radius:999px;padding:1px 7px;font-size:11px;line-height:1.5;cursor:pointer;color:var(--text);transition:.12s;}
.msg-reaction:hover{border-color:var(--b2);}
.msg-reaction.mine{background:rgba(58,169,217,.14);border-color:rgba(58,169,217,.45);}
/* Group messages tab */
.msg-group-icon{font-size:17px;background:rgba(58,169,217,.12);}
.msg-thread-row.msg-group-row.group-flagged{background:rgba(58,169,217,.07);border-left:3px solid #3aa9d9;padding-left:9px;}
.msg-thread-row.msg-group-row.group-flagged.selected{background:var(--gold-bg);}
.msg-group-flag{font-size:10px;color:#2e8cc4;font-weight:600;margin-top:4px;background:rgba(58,169,217,.1);border:1px solid rgba(58,169,217,.32);border-radius:4px;padding:3px 6px;line-height:1.4;}
.msg-group-flag-names{color:var(--muted);font-weight:500;margin-top:2px;}
.msg-group-flagbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;background:rgba(58,169,217,.07);border-bottom:1px solid rgba(58,169,217,.25);color:#2e8cc4;font-size:11px;font-weight:600;padding:7px 14px;}
.msg-group-chip{background:rgba(58,169,217,.14);border:1px solid rgba(58,169,217,.4);color:#2e8cc4;font-family:'Manrope',sans-serif;font-size:10px;font-weight:700;padding:2px 8px;border-radius:999px;cursor:pointer;}
.msg-group-chip:hover{background:rgba(58,169,217,.26);}
/* Tier 2 "needs you": @mention of the coach. Red, outranks the client flag. */
.msg-thread-row.msg-group-row.group-mentioned{border-left-color:var(--red);background:rgba(217,48,48,.06);}
.msg-thread-row.msg-group-row.group-mentioned.selected{background:var(--gold-bg);}
.msg-group-flag.mention{color:var(--red);background:rgba(217,48,48,.1);border-color:rgba(217,48,48,.32);}
.msg-group-flagbar.mention{background:rgba(217,48,48,.08);border-bottom-color:rgba(217,48,48,.28);color:var(--red);}
.msg-group-mention-excerpt{color:var(--muted);font-weight:500;font-style:italic;}
/* Tab badge — neutral by default, red when action is on this coach. */
.msg-group-tab-badge{display:inline-block;background:var(--s3);color:var(--muted);border-radius:8px;padding:0 5px;margin-left:3px;font-size:9px;font-weight:800;vertical-align:1px;}
.msg-group-tab-badge.needs{background:var(--red);color:#fff;}
.msg-unread-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--red);margin-right:6px;vertical-align:1px;}
.msg-thread-row.msg-group-row.unread .msg-thread-name{font-weight:700;}
.tb-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:1000;display:flex;align-items:center;justify-content:center;}
.tb-card{background:var(--bg);border:1px solid var(--b1);border-radius:12px;width:min(560px,92vw);max-height:88vh;overflow:auto;font-family:'Manrope',sans-serif;}
.tb-card-head{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid var(--b1);font-weight:700;font-size:15px;color:var(--text);}
.tb-card-head button{background:none;border:none;font-size:18px;cursor:pointer;color:var(--muted);}
.tb-form{padding:14px 18px;display:flex;flex-direction:column;gap:5px;}
.tb-form label{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-top:6px;}
.tb-form select,.tb-form textarea,.tb-form input[type=date]{background:var(--s1);border:1px solid var(--b1);border-radius:6px;padding:8px;color:var(--text);font-family:inherit;font-size:13px;width:100%;box-sizing:border-box;}
.tb-when{display:flex;gap:16px;margin-top:2px;}
.tb-radio{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text);}
#tbRecur{align-items:center;gap:6px;font-size:13px;color:var(--text);}
#tbRecur input{width:56px;background:var(--s1);border:1px solid var(--b1);border-radius:6px;padding:6px;color:var(--text);}
#tbRecur select{width:auto;background:var(--s1);border:1px solid var(--b1);border-radius:6px;padding:6px;color:var(--text);}
.tb-save{margin-top:12px;background:var(--gold);color:#fff;border:none;border-radius:6px;padding:9px;font-weight:700;cursor:pointer;font-family:inherit;}
.tb-list{padding:4px 18px 18px;display:flex;flex-direction:column;gap:6px;}
.tb-item{display:flex;justify-content:space-between;gap:10px;background:var(--s1);border:1px solid var(--b1);border-radius:8px;padding:9px 12px;}
.tb-item.due{border-color:var(--red);background:rgba(217,48,48,.06);}
.tb-sched{font-size:11px;color:var(--muted);}
.tb-note{font-size:12px;color:var(--text);margin-top:3px;white-space:pre-wrap;}
.tb-item-actions{display:flex;gap:6px;align-items:flex-start;flex-shrink:0;}
.tb-item-actions button{background:var(--s2);border:1px solid var(--b1);border-radius:5px;padding:3px 8px;font-size:12px;cursor:pointer;color:var(--text);}
.tb-empty{color:var(--muted);font-size:12px;padding:8px;}
/* Touch-base full-page view */
.tbv-wrap{flex:1;overflow-y:auto;background:var(--bg);padding:18px 22px;font-family:'Manrope',sans-serif;}
.tbv-form{background:var(--s1);border:1px solid var(--b1);border-radius:10px;padding:16px 18px;margin-bottom:16px;max-width:760px;}
.tbv-form-title{font-family:'Manrope',sans-serif;font-size:18px;letter-spacing:.04em;color:var(--text);margin-bottom:10px;}
.tbv-form label{display:block;font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:8px 0 4px;}
.tbv-form input,.tbv-form select{background:var(--bg);border:1px solid var(--b1);border-radius:6px;padding:8px;color:var(--text);font-family:inherit;font-size:13px;box-sizing:border-box;}
.tbv-grid{display:grid;grid-template-columns:1fr 1.4fr;gap:14px;}
.tbv-grid input{width:100%;}
@media(max-width:640px){.tbv-grid{grid-template-columns:1fr;}}
.tbv-when{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:4px;}
#tbRecur{align-items:center;gap:6px;font-size:13px;color:var(--text);}
#tbRecur input{width:56px;}
.tbv-actions{display:flex;gap:8px;margin-top:14px;}
.tb-cancel{background:var(--s2);border:1px solid var(--b1);color:var(--text);border-radius:6px;padding:9px 14px;cursor:pointer;font-family:inherit;font-weight:600;}
.tbv-list{max-width:760px;}
.tbv-list-title{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px;}
.tbv-item{display:flex;justify-content:space-between;gap:12px;background:var(--s1);border:1px solid var(--b1);border-radius:8px;padding:11px 14px;margin-bottom:7px;}
.tbv-item.due{border-color:var(--red);background:rgba(217,48,48,.06);}
.tbv-item.editing{border-color:var(--gold-border);box-shadow:0 0 0 1px var(--gold-border) inset;}
.msg-thread-unread{background:var(--red);color:#fff;font-size:9px;font-weight:700;padding:2px 6px;border-radius:9px;flex-shrink:0;margin-top:2px;}
.msg-chat-pane{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg);}
.msg-chat-hdr{padding:12px 16px;border-bottom:1px solid var(--b1);display:flex;align-items:center;gap:10px;background:var(--s1);}
.msg-chat-hdr-avatar{width:36px;height:36px;border-radius:50%;background:var(--s3);flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--muted);}
.msg-chat-hdr-avatar img{width:100%;height:100%;object-fit:cover;}
.msg-chat-hdr-name{font-weight:700;font-size:14px;color:var(--text);}
.msg-chat-hdr-sub{font-size:10px;color:var(--muted);letter-spacing:.06em;text-transform:uppercase;}
.msg-list{flex:1;overflow-y:auto;padding:18px 20px;display:flex;flex-direction:column;gap:8px;}
.msg-row{display:flex;gap:8px;max-width:75%;}
.msg-row.from-trainer{align-self:flex-end;flex-direction:row-reverse;}
.msg-bubble{padding:8px 12px;border-radius:12px;font-size:13px;line-height:1.4;color:var(--text);word-wrap:break-word;white-space:pre-wrap;}
.msg-row.from-trainer .msg-bubble{background:rgba(46,140,196,.14);color:var(--text);border:1px solid rgba(46,140,196,.3);border-bottom-right-radius:4px;}
.msg-row.from-client .msg-bubble{background:var(--s2);border:1px solid var(--b1);border-bottom-left-radius:4px;}
.msg-row .msg-time{font-size:9px;color:var(--muted);letter-spacing:.04em;}
.msg-row.from-trainer .msg-time{text-align:right;}
.msg-row .msg-avatar{width:26px;height:26px;border-radius:50%;background:var(--s3);flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;color:var(--muted);align-self:flex-end;}
.msg-row .msg-avatar img{width:100%;height:100%;object-fit:cover;}
.msg-system{align-self:center;background:var(--s2);border:1px dashed var(--b1);color:var(--muted);font-size:11px;padding:6px 12px;border-radius:14px;letter-spacing:.04em;margin:6px 0;}
.msg-compose{padding:12px 16px;border-top:1px solid var(--b1);background:var(--s1);display:flex;gap:8px;align-items:flex-end;}
.msg-compose textarea{flex:1;background:var(--bg);border:1px solid var(--b1);border-radius:8px;padding:10px 12px;font-family:'Manrope',sans-serif;font-size:13px;color:var(--text);resize:vertical;min-height:42px;max-height:520px;line-height:1.45;overflow-y:auto;}
.msg-compose textarea:focus{outline:none;border-color:var(--gold-border);}
.msg-compose-send{background:rgba(46,140,196,.18);border:1px solid rgba(46,140,196,.5);color:#3aa9d9;font-family:'Manrope',sans-serif;font-size:12px;font-weight:700;letter-spacing:.04em;padding:10px 18px;border-radius:8px;cursor:pointer;white-space:nowrap;}
.msg-compose-send:hover{background:rgba(46,140,196,.28);}
.msg-compose-send:disabled{opacity:.45;cursor:not-allowed;}
/* Emoji picker — anchored to the compose row, opens on click. Curated list
   (no full unicode index) since coach messages use a focused subset and
   pulling in a 1000-emoji library would dwarf the rest of the dash JS. */
.msg-emoji-wrap{position:relative;align-self:stretch;display:flex;align-items:flex-end;}
.msg-emoji-btn{background:var(--s2);border:1px solid var(--b1);color:var(--muted);font-size:18px;line-height:1;width:38px;height:38px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;flex-shrink:0;align-self:flex-end;}
.msg-emoji-btn:hover{border-color:var(--gold-border);color:var(--gold);}
.msg-emoji-btn.open{background:var(--gold-bg);border-color:var(--gold-border);color:var(--gold);}
.msg-emoji-pop{position:fixed;background:var(--s1);border:1px solid var(--b1);border-radius:10px;box-shadow:0 10px 28px rgba(0,0,0,.45);padding:8px;z-index:55;width:280px;max-height:min(70vh,360px);overflow-y:auto;display:none;}
.msg-emoji-pop.open{display:block;}
.msg-emoji-section{font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);padding:4px 4px 6px;font-family:'Manrope',sans-serif;}
.msg-emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:2px;}
.msg-emoji-cell{background:transparent;border:none;color:inherit;font-size:18px;line-height:1;padding:6px 0;border-radius:6px;cursor:pointer;}
.msg-emoji-cell:hover{background:var(--s2);}
.msg-search-input{margin:8px 10px;width:calc(100% - 20px);}
.msg-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);font-size:13px;padding:32px;text-align:center;gap:6px;}
#messages-wrap.messages-picker-mode{align-items:center;justify-content:center;}
/* Back-to-inbox button injected into chat header. Hidden on desktop; CSS
   below flips it on inside .mobile-mode so the same DOM works in both modes. */
.msg-chat-back{display:none;background:var(--s2);border:1px solid var(--b1);color:var(--text);font-family:'Manrope',sans-serif;font-size:12px;font-weight:700;padding:6px 10px;border-radius:6px;cursor:pointer;align-items:center;gap:4px;flex-shrink:0;}
.msg-chat-back:hover{background:var(--s3);}
/* Mobile mode — applied via JS based on viewport width OR ?mobile=1.
   Strips the dash down to just the Messages page so a coach can triage on
   their phone. Scripts/AI drawer buttons in the header stay accessible. */
@media (max-width:768px){
  body.mobile-mode .sidebar{display:none;}
  body.mobile-mode .layout{display:block;padding:0;min-height:0;}
  body.mobile-mode .page:not(#page-messages){display:none !important;}
  /* The header on a phone was seven full-width buttons — ＋ Task, 🪄, ❓ Ask,
     📋 Scripts, ☑ Checklist, 🎫 Ticket, 🔐 Admin — crammed edge to edge and
     spilling. A phone is for triaging messages, so it keeps the four tools
     that feed a reply, as icons: draft, ask, scripts, checklist. Quick-add
     Task, Ticket and Admin are desk work and stand down (all still there on
     any wider screen, and on the same phone in landscape). */
  body.mobile-mode header{padding:6px 10px;gap:6px;justify-content:flex-end;}
  body.mobile-mode header .brand,
  body.mobile-mode header .hdr-sep,
  body.mobile-mode header .hdr-space,
  body.mobile-mode header .sync-info,
  body.mobile-mode header .bell-btn,
  body.mobile-mode header .hdr-lbl,
  body.mobile-mode header #global-addtask-btn,
  body.mobile-mode header #global-ticket-btn,
  body.mobile-mode header #global-admin-btn,
  body.mobile-mode header #sync-btn{display:none !important;}
  /* Even, thumb-sized, and no horizontal scroll to hunt through. */
  body.mobile-mode header .sync-btn{
    width:40px;height:36px;padding:0;display:inline-flex;align-items:center;
    justify-content:center;font-size:16px;line-height:1;flex-shrink:0;position:relative;
  }
  body.mobile-mode header .cl-badge{position:absolute;top:-3px;right:-3px;}
  body.mobile-mode #page-messages{padding:8px;}
  body.mobile-mode #page-messages .pg-hdr{padding:0 0 8px;flex-wrap:wrap;gap:6px;}
  body.mobile-mode #page-messages .eyebrow{display:none;}
  body.mobile-mode #messages-title{font-size:16px;display:flex;flex-wrap:wrap;align-items:center;gap:4px;}
  /* 186px of chrome sat above the first thread on a 390x844 phone. The
     "Refreshed 12s ago" label is the least of it and the ↻ button beside it
     says the same thing. */
  body.mobile-mode #messages-refresh-info{display:none !important;}
  /* The all-coaches reply-time leaderboard. 971px of panel under the inbox on
     a phone — the page went 768px → 1755px, so scrolling past the last thread
     landed on a screen and a half of nothing. Desk work; hidden here, and
     `_loadReplyBar` skips fetching it too. */
  body.mobile-mode #replyStatsBar{display:none !important;}
  body.mobile-mode #messages-wrap{min-height:0 !important;height:auto !important;border-radius:0;flex-direction:column;}
  /* The inbox used to be a fixed `100dvh - 140px` box with its own scrollbar.
     Measured on a 390x844 phone it starts 186px down (header + page padding +
     title + filter chips), so it ran 47px past the bottom of the screen AND
     nested a scroller inside a page that also scrolls — the shape that jams a
     drag on iOS. On a phone the inbox is just a list: it scrolls with the
     page, one scroller, and its end is its end. */
  body.mobile-mode .msg-thread-list{width:100%;border-right:none;height:auto;max-height:none;overflow:visible;}
  body.mobile-mode .msg-chat-pane{display:none;}
  /* When a thread is open on mobile, lift the chat pane to a fixed overlay
     covering the whole viewport. This sidesteps the layout-cascade quirks
     that were leaving the compose box off-screen, and guarantees msg-list
     gets a real bounded height to scroll within.
     ── and then the KEYBOARD comes up ─────────────────────────────────────
     A fixed element is laid out against the LAYOUT viewport, which iOS does
     not shrink for the keyboard (Android Chrome does). So `bottom:0` meant
     the bottom of the page, not the bottom of what you can see: the compose
     box and Send sat behind the keys the entire time a coach was typing.
     `100dvh` doesn't help — dvh tracks the browser's own toolbars, not the
     keyboard. The only thing that knows where the keyboard ends is
     `visualViewport`, so `_msgSyncBand()` in 17-messages.js writes the
     visible band into these two properties and this rule sits on it. The
     fallback values are the pre-keyboard behaviour, for anything without
     visualViewport. */
  body.mobile-mode.thread-open .msg-chat-pane{
    display:flex;flex-direction:column;
    position:fixed;left:0;right:0;bottom:auto;
    top:var(--msg-band-top, 50px);
    height:var(--msg-band-h, calc(100dvh - 50px));
    z-index:30;background:var(--bg);
  }
  /* Keyboard-up fallback for engines where the LAYOUT viewport resizes for the
     keyboard (Chromium / Samsung Internet with interactive-widget=resizes-content):
     the JS clears the band vars there because `dvh` already excludes the keyboard
     AND the browser's own toolbars. The dash header is hidden (kb-up) so the pane
     takes the full — now shorter — dvh from the top. This makes the compose bar
     land correctly even in the frame before _msgSyncBand runs, or if Samsung's
     visualViewport events fire late. iOS still sets the vars, so they win there. */
  body.mobile-mode.thread-open.kb-up .msg-chat-pane{
    top:var(--msg-band-top, 0px);
    height:var(--msg-band-h, 100dvh);
  }
  /* Nothing behind a full-screen thread should scroll — a drag that started
     on the thread used to chain into the page under it and drift the inbox.
     Scoped to thread-open so `body` is never a lingering scroll container
     (a bare overflow on body makes it a second scroller, which jams iOS). */
  body.mobile-mode.thread-open{overflow:hidden;}
  /* The dash header is `position:sticky; z-index:200` — it paints OVER the
     pane. With the keyboard up the pane claims the header's 50px, so the top
     of the thread (the ‹ Inbox button and the client's name) ended up
     underneath it: while typing you could see neither who you were replying
     to nor the way back. It carries nothing worth 50px of a 336px screen, so
     it stands down until the keyboard does. */
  body.mobile-mode.kb-up header{display:none;}
  /* Scripts / AI / checklist are how a canned reply gets into the composer,
     so they are part of typing and get the same treatment: pinned to the
     visible band rather than to a page bottom behind the keys. */
  body.mobile-mode.thread-open .scripts-drawer,
  body.mobile-mode.thread-open .ai-drawer,
  body.mobile-mode.thread-open .cl-drawer{
    top:var(--msg-band-top, 50px);
    height:var(--msg-band-h, calc(100dvh - 50px));
    bottom:auto;
  }
  body.mobile-mode.thread-open.kb-up .scripts-drawer,
  body.mobile-mode.thread-open.kb-up .ai-drawer,
  body.mobile-mode.thread-open.kb-up .cl-drawer{
    top:var(--msg-band-top, 0px);
    height:var(--msg-band-h, 100dvh);
  }
  body.mobile-mode .msg-chat-back{display:inline-flex !important;flex-shrink:0;}
  body.mobile-mode .msg-chat-hdr{gap:6px;padding:8px 10px;flex-wrap:nowrap;overflow-x:auto;flex-shrink:0;-webkit-overflow-scrolling:touch;}
  body.mobile-mode .msg-chat-hdr > *{flex-shrink:0;}
  body.mobile-mode .msg-chat-hdr > div[style*="flex:1"]{flex:0 1 auto !important;min-width:0;}
  body.mobile-mode .msg-chat-hdr-sub{display:none;}
  body.mobile-mode .msg-chat-open-profile{display:none !important;}
  body.mobile-mode .msg-chat-hdr-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  body.mobile-mode .msg-list{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:12px 14px;overscroll-behavior:contain;}
  body.mobile-mode .msg-row{max-width:88%;}
  /* Keyboard down, the compose row is the last thing above the home
     indicator, so it owes it the safe-area inset. Keyboard up, the keys are
     the bottom edge and that inset is just wasted height. */
  body.mobile-mode .msg-compose{padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px));flex-shrink:0;gap:6px;}
  body.mobile-mode.kb-up .msg-compose{padding-bottom:8px;}
  /* 16px prevents iOS auto-zoom on focus. The drag handle is unusable with a
     finger and fights the thread's scroll, and the desktop 520px cap is most
     of a phone screen — `--msg-ta-max` is a share of the visible band, so a
     long reply grows into the room that exists and never eats the thread or
     pushes Send off the bottom. */
  body.mobile-mode .msg-compose textarea{font-size:16px;resize:none;max-height:var(--msg-ta-max,180px);}
  /* Send has to survive a long client name and a narrow phone: it never
     shrinks, and the textarea is what gives up width. */
  body.mobile-mode .msg-compose-send{padding:10px 14px;flex-shrink:0;}
  body.mobile-mode .msg-compose textarea{min-width:0;}
  body.mobile-mode .msg-emoji-btn{width:34px;height:34px;font-size:16px;}
  /* Scripts + AI + checklist drawers become full-width on mobile so they don't
     fall off-screen. The checklist's stored width is a desktop preference and
     must not follow a coach onto a phone. */
  body.mobile-mode .scripts-drawer,
  body.mobile-mode .cl-drawer,
  body.mobile-mode .ai-drawer{width:100% !important;max-width:100% !important;}
}
/* Asana shortcut on each message bubble — fade in on hover so it stays out of
   the way when the coach is just reading the thread. */
.msg-time-row{display:flex;align-items:center;gap:8px;margin-top:3px;min-height:17px;}
.msg-row.from-trainer .msg-time-row{flex-direction:row-reverse;}
/* Internal-only "who actually typed this" marker — subtle, subordinate to the
   bubble, never sent to the client. Only rendered on ghost-written messages.
   Sits inline on the timestamp row (flex + gap keeps it clear of the time no
   matter how the relative-time text resizes) so it stays one clean line. */
.msg-attr{font-size:9.5px;color:var(--muted);letter-spacing:.03em;opacity:.85;white-space:nowrap;}
.msg-actions{display:flex;align-items:center;gap:4px;opacity:0;transition:.15s;}
.msg-row:hover .msg-actions{opacity:1;}
.msg-actions:has(.msg-react-btn.open){opacity:1;}
.msg-react-btn{background:var(--bg);border:1px solid var(--b1);color:var(--text);font-size:13px;line-height:1;padding:2px 7px;border-radius:999px;cursor:pointer;transition:.15s;}
.msg-react-btn:hover{color:var(--text);border-color:var(--b2);background:var(--s2);}
.msg-asana-btn{position:static;background:rgba(247,166,69,.18);border:1px solid rgba(247,166,69,.5);color:#f7a645;font-family:'Manrope',sans-serif;font-size:9px;font-weight:700;letter-spacing:.04em;padding:3px 7px;border-radius:4px;cursor:pointer;transition:.15s;white-space:nowrap;}


.msg-asana-btn:hover{background:rgba(247,166,69,.3);}

/* The per-message actions are revealed by :hover, which a touch device never
   fires — so "→ Task" was rendered on every message and invisible on every
   phone. A feature query, NOT a width breakpoint: a narrow desktop window still
   has a pointer and should keep the quiet hover behaviour, while an iPad in
   landscape is wide and still has no hover.
   They also get real tap targets here; 9px text with 3px padding is a fingertip
   coin-toss, and the two buttons sit next to each other. */
@media (hover:none){
  .msg-actions{opacity:1;}
  .msg-asana-btn{font-size:11px;padding:7px 11px;border-radius:6px;}
  .msg-react-btn{font-size:15px;padding:5px 11px;}
}
.alert-count-badge{background:var(--s3);color:var(--muted);font-size:9px;padding:2px 7px;border-radius:3px;font-weight:600;}
.alert-count-badge.red{background:rgba(196,46,46,.1);color:var(--red);}
.alert-count-badge.orange{background:rgba(184,90,20,.1);color:var(--orange);}
.alert-count-badge.blue{background:rgba(58,169,217,.12);color:#3aa9d9;}
.alert-cards{display:flex;flex-direction:column;gap:6px;}
.alert-card{background:var(--s1);border:1px solid var(--b1);border-radius:var(--r);padding:12px 16px;display:flex;align-items:center;gap:12px;}
.alert-card.urgent{border-left:3px solid var(--red);}
.alert-card.warning{border-left:3px solid var(--orange);}
.alert-card.info{border-left:3px solid #3aa9d9;}
.alert-dot.blue{background:#3aa9d9;}
.alert-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0;}
.alert-dot.red{background:var(--red);}
.alert-dot.orange{background:var(--orange);}
.alert-dot.gold{background:var(--gold);}
.alert-text{flex:1;min-width:0;}
.alert-name{font-weight:600;font-size:13px;margin-bottom:1px;color:var(--text);}
.alert-desc{font-size:11px;color:var(--muted);}
.alert-action{background:var(--s2);border:1px solid var(--b1);color:var(--muted);font-size:11px;font-weight:500;padding:5px 12px;border-radius:var(--r);cursor:pointer;transition:.15s;white-space:nowrap;flex-shrink:0;}
.alert-action:hover{border-color:var(--gold-border);color:var(--gold);}

/* The clock time beside a date, shown only when a client checked in twice on
   the same day (one form each, during the transition). Quieter than the date:
   it is a tiebreaker, not a second date. */
.checkin-time{display:block;font-size:10px;color:var(--muted);opacity:.85;
  font-variant-numeric:tabular-nums;line-height:1.3;margin-top:1px}

/* Check-in attachments. Fixed-ratio tiles so the grid does not reflow as each
   signed image arrives one by one, which on a check-in with six photos is six
   separate jumps under the coach's cursor. */
.ci-uploads{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,82px));gap:8px}
.ci-upload{min-width:0}
.ci-upload[data-slot]{cursor:pointer}
.ci-upload-thumb{position:relative;aspect-ratio:1;border:1px solid var(--border);border-radius:6px;overflow:hidden;
  background:var(--bg-alt,#f4f2ec);display:flex;align-items:center;justify-content:center;
  font-size:10px;color:var(--muted)}
.ci-upload[data-slot]:hover .ci-upload-thumb{border-color:var(--gold)}
.ci-up-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;z-index:1;background:var(--bg-alt,#f4f2ec)}
.ci-up-fallback{position:absolute;inset:0;z-index:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:16px;line-height:1}
.ci-up-fallback small{font-size:8px;color:var(--gold);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.ci-upload-thumb.has-img .ci-up-fallback{display:none}
.ci-up-hint{font-size:10px;color:var(--muted);font-weight:400;text-transform:none;letter-spacing:0}
.ci-upload-name{font-size:9px;color:var(--muted);margin-top:3px;text-transform:uppercase;
  letter-spacing:.04em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}
/* attachment preview popup */
.ci-prev-overlay{position:fixed;inset:0;background:rgba(8,7,5,.72);z-index:9300;display:none;align-items:center;justify-content:center;padding:32px}
.ci-prev-overlay.open{display:flex}
.ci-prev-card{background:var(--s1,#fff);border-radius:8px;width:min(920px,95vw);max-height:92vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.4)}
.ci-prev-hdr{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 16px;border-bottom:1px solid var(--b1,#dedad0);font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text)}
.ci-prev-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ci-prev-actions{display:flex;align-items:center;gap:14px;flex-shrink:0}
.ci-prev-open{font-size:11px;color:var(--gold);text-decoration:none;font-weight:600;text-transform:none;letter-spacing:0;white-space:nowrap}
.ci-prev-x{background:none;border:none;color:var(--muted);font-size:18px;cursor:pointer;line-height:1;padding:0 2px}
.ci-prev-body{flex:1;min-height:0;background:#111;display:flex;align-items:center;justify-content:center}
.ci-prev-body iframe{width:100%;height:78vh;border:0}
.ci-prev-body img{max-width:100%;max-height:82vh;object-fit:contain;display:block}

/* What is still loading. Fixed to the top so it is visible on any page, thin
   enough to ignore, and gone the moment everything is in. */
#sync-progress{background:var(--bg,#faf9f6);border-bottom:1px solid var(--border,#e6e2d8);
  padding:5px 16px 6px;font-size:11px}
#sync-progress .sp-track{height:2px;background:var(--border,#e6e2d8);border-radius:2px;overflow:hidden}
#sync-progress .sp-fill{height:100%;background:var(--gold,#9a7b1f);transition:width .25s ease}
#sync-progress .sp-items{display:flex;gap:14px;flex-wrap:wrap;margin-top:5px}
#sync-progress .sp-item{color:var(--muted,#6b6455);letter-spacing:.02em;white-space:nowrap}
#sync-progress .sp-running{color:var(--gold,#9a7b1f);font-weight:600}
#sync-progress .sp-done{opacity:.55}
#sync-progress .sp-failed{color:var(--red,#c42e2e);font-weight:600}

/* The same load state, inline in the page header, because the bar under the
   global header is above the fold and a coach reading the list is scrolled past
   it. Quieter than the bar: it sits beside a page title, not across the top. */
#sync-progress-inline{flex:1;min-width:120px;max-width:520px;align-self:center;
  font-size:10.5px;margin:0 18px}
#sync-progress-inline:empty{display:none}
#sync-progress-inline .sp-track{height:4px;background:var(--border,#e6e2d8);border-radius:3px;overflow:hidden}
#sync-progress-inline .sp-fill{height:100%;background:var(--gold,#9a7b1f);transition:width .3s ease}
#sync-progress-inline .sp-items{display:flex;gap:10px;flex-wrap:wrap;margin-top:4px}
#sync-progress-inline .sp-item{color:var(--muted,#6b6455);white-space:nowrap}
#sync-progress-inline .sp-running{color:var(--gold,#9a7b1f);font-weight:700}
#sync-progress-inline .sp-done{opacity:.45}
#sync-progress-inline .sp-failed{color:var(--red,#c42e2e);font-weight:700}
