  :root{
    --bg:#0B0D12; --surface:#12151D; --surface2:#171B25;
    --red:#FF4D5E; --redSoft:#FF7886; --green:#54E0B0; --blue:#5EA8FF; --purple:#B58CFF; --amber:#FFC55C;
    --text:#F4F5F7; --muted:#818BA1; --faint:#5A6275;
    --stroke:rgba(255,255,255,.07); --stroke2:rgba(255,255,255,.12);
    --display:'Nunito',system-ui,sans-serif; --mono:'JetBrains Mono',ui-monospace,monospace;
  }
  *{box-sizing:border-box;margin:0;padding:0}
  /* `overflow-x:hidden` makes body a scroll container, which silently kills
     position:sticky on the ribbon and sidebar. `clip` prevents the sideways
     scroll without creating one. */
  html,body{max-width:100%;overflow-x:clip}
  body{background:var(--bg);color:var(--text);font-family:var(--display);-webkit-font-smoothing:antialiased;line-height:1.5}
  button{font-family:inherit;color:inherit;background:none;border:none;cursor:pointer}
  input,select{font-family:inherit}
  svg{max-width:100%}
  .label{font-family:var(--mono);font-size:10.5px;font-weight:700;letter-spacing:.18em;text-transform:uppercase;color:var(--muted)}

  .ribbon{position:sticky;top:0;z-index:40;background:rgba(11,13,18,.92);backdrop-filter:blur(8px);
    border-bottom:1px solid rgba(255,197,92,.22);
    font-family:var(--mono);font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--amber);
    text-align:center;padding:7px 12px}
  .ribbon a{color:inherit;text-decoration:none;font-weight:700}
  .ribbon.live{background:rgba(84,224,176,.10);border-bottom-color:rgba(84,224,176,.32);color:var(--green)}
  .ribbon a:hover{text-decoration:underline}

  .shell{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:calc(100vh - var(--ribbonH,31px))}
  .shell.rail{grid-template-columns:74px minmax(0,1fr)}

  /* ---------- sidebar ---------- */
  aside{border-right:1px solid var(--stroke);display:flex;flex-direction:column;
    position:sticky;top:var(--ribbonH,31px);height:calc(100vh - var(--ribbonH,31px));overflow:hidden}
  .side-top{padding:16px 14px 10px;border-bottom:1px solid var(--stroke)}
  .brandrow{display:flex;align-items:center;justify-content:space-between;padding:0 4px 12px}
  .brand{display:flex;align-items:center;gap:10px;font-weight:900;font-size:18px}
  .brand .fit{color:var(--red)}
  .brand small{font-family:var(--mono);font-size:9px;letter-spacing:.22em;color:var(--muted);display:block;margin-top:1px}
  .collapse{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;color:var(--faint);
    border:1px solid var(--stroke);flex:none}
  .collapse:hover{color:var(--text)}
  .navbtn{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border-radius:13px;
    font-weight:800;font-size:13.5px;color:var(--muted);border:1px solid transparent;margin-bottom:8px}
  .navbtn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;flex:none}
  .navbtn.on{color:var(--text);background:rgba(255,77,94,.1);border-color:rgba(255,77,94,.4)}
  .navbtn:hover{background:var(--surface)}
  .search{display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--stroke);
    border-radius:12px;padding:9px 12px}
  .search input{flex:1;background:none;border:none;outline:none;color:var(--text);font-size:13px;min-width:0}
  .search svg{width:14px;height:14px;stroke:var(--faint);fill:none;stroke-width:2;flex:none}
  .qsug{display:none;flex-wrap:wrap;gap:6px;margin-top:8px}
  .qsug.open{display:flex}
  .fchips{display:flex;gap:6px;margin-top:10px;flex-wrap:wrap}
  .fchip{font-family:var(--mono);font-size:10px;font-weight:700;padding:5px 10px;border-radius:999px;
    color:var(--muted);background:var(--surface);border:1px solid var(--stroke)}
  .fchip.on{color:var(--text);background:rgba(255,77,94,.12);border-color:rgba(255,77,94,.5)}
  .clihead{display:none;align-items:center;justify-content:space-between;padding:10px 16px 2px}
  .clients{flex:1;overflow-y:auto;padding:8px 10px 14px;display:flex;flex-direction:column;gap:4px}
  .client{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:14px;text-align:left;
    border:1px solid transparent;width:100%}
  .client:hover{background:var(--surface)}
  .client.on{background:var(--surface);border-color:var(--stroke2)}
  .ava{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;flex:none;
    font-weight:900;font-size:12px;background:var(--surface2);border:1px solid var(--stroke)}
  .client.on .ava{background:rgba(255,77,94,.14);border-color:rgba(255,77,94,.4);color:var(--redSoft)}
  .client .nm{font-size:13px;font-weight:800;line-height:1.15}
  .client .st{font-family:var(--mono);font-size:9.5px;color:var(--muted);display:flex;align-items:center;gap:5px;margin-top:2px}
  .dot{width:6px;height:6px;border-radius:50%;flex:none}
  .warn{margin-left:auto;flex:none;width:7px;height:7px;border-radius:50%;background:var(--red)}
  .coachcard{border-top:1px solid var(--stroke);padding:12px 14px;display:flex;align-items:center;gap:10px}
  .coachcard .ava{background:rgba(255,77,94,.14);border-color:rgba(255,77,94,.35);color:var(--redSoft)}
  .coachcard .nm{font-size:13px;font-weight:800}
  .coachcard .rl{font-family:var(--mono);font-size:9.5px;color:var(--faint);letter-spacing:.1em;text-transform:uppercase}
  /* rail (collapsed) mode — desktop */
  .rail .side-top .search,.rail .qsug,.rail .fchips,.rail .navbtn span,.rail .brand span,
  .rail .client .nm,.rail .client .st,.rail .client span:not(.ava),.rail .coachcard div,.rail .warn,.rail .clihead{display:none}
  .rail .navbtn{justify-content:center;padding:10px 0}
  .rail .client{justify-content:center;padding:8px 0}
  .rail .brandrow{flex-direction:column;gap:10px}

  /* ---------- main ---------- */
  main{padding:24px 26px 80px;min-width:0}
  .topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
  .topbar h1{font-size:25px;font-weight:900;letter-spacing:-.02em}
  .goal{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:10.5px;letter-spacing:.1em;
    text-transform:uppercase;color:var(--muted);margin-top:3px;padding:0}
  button.goal:hover{color:var(--text)}
  .actions{display:flex;gap:9px;flex-wrap:wrap}
  .btn{font-weight:800;font-size:13px;padding:9px 16px;border-radius:999px;border:1px solid var(--stroke2);
    display:inline-flex;align-items:center;gap:7px}
  .flag .ic{width:12px;height:12px}
  .btn:hover{border-color:rgba(255,255,255,.3)}
  .btn.red{background:var(--red);border-color:transparent;color:#fff}
  .btn.red:hover{background:#ff5e6e}
  .btn:disabled{opacity:.4;cursor:default}

  .ctags{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin:12px 0 0}
  .ctag{display:inline-flex;align-items:center;gap:7px;font-family:var(--mono);font-size:10.5px;font-weight:700;
    padding:6px 11px;border-radius:999px;color:var(--purple);background:rgba(181,140,255,.08);
    border:1px solid rgba(181,140,255,.25)}
  .ctag b{cursor:pointer;color:var(--faint)}
  .ctag b:hover{color:var(--redSoft)}
  .evchip{display:inline-flex;align-items:center;gap:7px;font-family:var(--mono);font-size:10.5px;font-weight:700;
    padding:6px 11px;border-radius:999px;border:1px solid}
  .evchip b{cursor:pointer;color:var(--faint)} .evchip b:hover{color:var(--redSoft)}
  .addtag{font-family:var(--mono);font-size:10.5px;font-weight:700;padding:6px 11px;border-radius:999px;
    color:var(--muted);border:1px dashed var(--stroke2)}
  .addtag:hover{color:var(--text)}
  .tagmenu{display:none;flex-direction:column;gap:10px;margin-top:10px;padding:12px;background:var(--surface);
    border:1px solid var(--stroke);border-radius:14px}
  .tagmenu.open{display:flex}
  .tagmenu .row{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
  .tagmenu input{background:var(--bg);border:1px solid var(--stroke);border-radius:10px;padding:6px 10px;
    color:var(--text);font-size:12px;outline:none;min-width:0;width:150px}
  .tagmenu input:focus{border-color:rgba(255,77,94,.5)}
  .tfilter{font-family:var(--mono);font-size:10px;padding:5px 10px;border-radius:999px;white-space:nowrap;
    color:var(--purple);background:rgba(181,140,255,.08);border:1px solid rgba(181,140,255,.2)}
  .tfilter.on{color:#fff;background:var(--purple);border-color:var(--purple)}

  .flags{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 0}
  .flag{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:10.5px;font-weight:700;
    padding:6px 11px;border-radius:999px;border:1px solid;cursor:pointer}
  .flag.amber{color:var(--amber);background:rgba(255,197,92,.08);border-color:rgba(255,197,92,.25)}
  .flag.redf{color:var(--redSoft);background:rgba(255,77,94,.08);border-color:rgba(255,77,94,.3)}
  .flag.greenf{color:var(--green);background:rgba(84,224,176,.08);border-color:rgba(84,224,176,.25)}

  .tabs{display:flex;gap:8px;margin:16px 0 20px}
  .tab{font-weight:800;font-size:13.5px;padding:9px 18px;border-radius:12px;color:var(--muted);
    background:var(--surface);border:1px solid var(--stroke)}
  .tab.on{color:var(--text);background:rgba(255,77,94,.1);border-color:rgba(255,77,94,.45)}

  .grid{display:grid;gap:16px}
  .g4{grid-template-columns:repeat(4,minmax(0,1fr))}
  .g2{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}
  /* paired cards that should match height rather than shrink-wrap */
  .g2.g2s{align-items:stretch}
  .g2.g2s>.card{display:flex;flex-direction:column}
  .g2.g2s>.card>div[style*="margin-top"]{flex:1;display:flex;flex-direction:column;justify-content:center}
  .card{background:var(--surface);border:1px solid var(--stroke);border-radius:18px;padding:18px;min-width:0}
  .card h3{font-size:15px;font-weight:800;letter-spacing:-.01em}
  .stat .v{font-size:21px;font-weight:900;letter-spacing:-.02em;margin-top:6px;overflow-wrap:anywhere}
  .stat .l{font-family:var(--mono);font-size:9.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--faint);margin-top:3px}
  .stat .of{font-size:13px;font-weight:700;color:var(--faint)}
  button.stat:hover{border-color:var(--stroke2)}
  .ring{width:50px;height:50px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:900;position:relative;flex:none}
  .ring::before{content:"";position:absolute;inset:5px;border-radius:50%;background:var(--surface)}
  .ring span{position:relative}
  .rowflex{display:flex;align-items:center;justify-content:space-between;gap:12px}
  .sechead{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}

  .chip{font-family:var(--mono);font-size:10.5px;font-weight:500;padding:4px 9px;border-radius:999px;
    display:inline-flex;align-items:center;gap:5px;border:1px solid transparent}
  .chip .cd{width:5px;height:5px;border-radius:50%}
  /* chip colour comes from its tag group, so it matches the app's Library */

  /* plan card */
  .plan{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
  .plan .pn{font-size:16px;font-weight:900;letter-spacing:-.01em}
  .plan .pm{font-family:var(--mono);font-size:10.5px;color:var(--muted);margin-top:2px}
  .daychips{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
  .daychip{font-family:var(--mono);font-size:10px;padding:5px 10px;border-radius:999px;color:var(--muted);
    background:var(--bg);border:1px solid var(--stroke);cursor:pointer}
  .daychip:hover{color:var(--text);border-color:var(--stroke2)}
  .daychip.byclient{border-style:dashed;color:var(--blue);border-color:rgba(94,168,255,.35)}
  .pbar{height:7px;border-radius:5px;background:var(--surface2);overflow:hidden;flex:1;min-width:120px}
  .pbar i{display:block;height:100%;background:linear-gradient(90deg,var(--red),var(--redSoft))}

  .wk{border:1px solid var(--stroke);border-radius:14px;overflow:hidden;margin-top:10px}
  .wkrow{display:flex;align-items:center;gap:14px;padding:12px 14px;width:100%;text-align:left;background:var(--bg)}
  .wkrow:hover{background:var(--surface2)}
  .wkrow .nm{font-size:13.5px;font-weight:800}
  .wkrow .meta{font-family:var(--mono);font-size:10px;color:var(--muted);margin-top:2px}
  .pr{font-family:var(--mono);font-size:9px;font-weight:700;letter-spacing:.1em;color:#fff;background:var(--red);padding:3px 8px;border-radius:999px}
  .wkdetail{display:none;background:var(--surface2);border-top:1px solid var(--stroke);padding:12px 14px}
  .wkdetail.open{display:block}
  .exline{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap;padding:7px 0;border-bottom:1px solid var(--stroke)}
  .exline:last-child{border-bottom:none}
  .exline .en{font-size:13px;font-weight:800;min-width:110px}
  .exline .sets{font-family:var(--mono);font-size:11px;color:var(--muted)}
  .exline .sets b{color:var(--text)}
  .exline .exnote{flex-basis:100%;font-size:11.5px;color:var(--green);opacity:.85;padding-left:2px}

  /* exercise explorer */
  .exsel{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 4px}
  .exbtn{font-weight:800;font-size:12.5px;padding:8px 14px;border-radius:999px;color:var(--muted);
    background:var(--bg);border:1px solid var(--stroke)}
  .exbtn.on{color:var(--text);background:rgba(255,77,94,.1);border-color:rgba(255,77,94,.5)}
  .rangesel{display:flex;gap:6px;flex-wrap:wrap}
  .rbtn{font-family:var(--mono);font-size:10px;font-weight:700;padding:5px 11px;border-radius:999px;
    color:var(--muted);background:var(--bg);border:1px solid var(--stroke)}
  .rbtn.on{color:var(--text);border-color:rgba(255,255,255,.3)}
  .axis{display:flex;justify-content:space-between;font-family:var(--mono);font-size:9px;color:var(--faint);margin-top:4px}
  .legend{display:flex;flex-direction:column;gap:8px;margin-top:12px}
  .leg{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:12px;background:var(--bg);
    border:1px solid var(--stroke);width:100%;text-align:left;flex-wrap:wrap}
  .leg.off{opacity:.38}
  .leg .sw{width:12px;height:12px;border-radius:4px;flex:none}
  .leg .tags{display:flex;gap:6px;flex-wrap:wrap;flex:1;min-width:140px}
  .leg .lv{font-weight:900;font-size:14px}
  .leg .ld{font-family:var(--mono);font-size:9.5px;color:var(--green)}
  .note-hint{font-family:var(--mono);font-size:10px;color:var(--faint);margin-top:10px}

  /* muscle split */
  .mrow{display:grid;grid-template-columns:82px minmax(0,1fr) 44px;align-items:center;gap:10px;padding:6px 0}
  .mrow .mn{font-size:12.5px;font-weight:800}
  .mbar{height:9px;border-radius:6px;background:var(--surface2);overflow:hidden}
  .mbar i{display:block;height:100%;border-radius:6px}
  .mrow .mp{font-family:var(--mono);font-size:10.5px;color:var(--muted);text-align:right}

  /* prep */
  .shots{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
  .shot{width:94px;height:124px;border:1.5px dashed rgba(255,255,255,.16);border-radius:14px;background:var(--bg);
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:8px;text-align:center;position:relative}
  .shot b{font-family:var(--mono);font-size:10.5px;font-weight:700;color:var(--muted)}
  .shot span{font-size:9px;color:var(--faint);line-height:1.25}
  .shot.sel{border-style:solid;border-color:var(--red)}
  .shot .selno{position:absolute;top:6px;right:6px;width:18px;height:18px;border-radius:50%;background:var(--red);
    color:#fff;font-family:var(--mono);font-size:10px;font-weight:700;display:grid;place-items:center}
  .sess{padding:13px 0;border-bottom:1px solid var(--stroke)}
  .sess:last-child{border-bottom:none}
  .sess .hd{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
  .sess .hd .d{font-size:14px;font-weight:800}
  .sess .hd .m{font-family:var(--mono);font-size:10.5px;color:var(--muted)}

  /* Sits over the photo tiles, so it has to be opaque and explicitly above
     them — the tiles are positioned too, and z-index:auto left it to DOM order. */
  .cmpbar{position:sticky;bottom:14px;margin-top:16px;display:none;align-items:center;gap:10px;flex-wrap:nowrap;
    z-index:30;background:var(--surface2);border:1px solid var(--stroke2);border-radius:22px;
    padding:10px 12px 10px 16px;box-shadow:0 18px 40px -18px rgba(0,0,0,.8)}
  .cmpbar.show{display:flex}
  .cmpbar .t{font-family:var(--mono);font-size:11px;color:var(--muted);flex:1;min-width:0}
  .cmpbar .t b{color:var(--text);font-weight:700}
  .cmpbar .t em{font-style:normal}
  .cmpbar .btn{flex:none}
  .modal{position:fixed;inset:0;background:rgba(5,6,9,.9);backdrop-filter:blur(6px);z-index:60;display:none;
    align-items:center;justify-content:center;padding:18px}
  .modal.open{display:flex}
  .mbox{background:var(--surface);border:1px solid var(--stroke2);border-radius:22px;padding:20px;max-width:860px;width:100%;
    max-height:92vh;overflow-y:auto}
  .mbox.wide{max-width:1020px}
  /* compare — viewing only: the shots as large as they'll go, no branding */
  .cmpgrid{display:grid;gap:12px;margin-top:14px}
  .cmpgrid.n1{grid-template-columns:minmax(0,1fr);max-width:520px;margin-inline:auto}
  .cmpgrid.n2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cmpgrid.n3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .cmpgrid.n4{grid-template-columns:repeat(4,minmax(0,1fr))}
  .shotbig{position:relative;margin:0;background:var(--surface2);border:1px solid var(--stroke2);border-radius:16px;
    aspect-ratio:3/4;display:grid;place-items:center;text-align:center;overflow:hidden;min-height:0}
  .cmpgrid.n1 .shotbig,.cmpgrid.n2 .shotbig{max-height:64vh}
  .cmpgrid.n3 .shotbig,.cmpgrid.n4 .shotbig{max-height:56vh}
  .shotbig .ph{font-family:var(--mono);font-size:13px;font-weight:700;color:var(--muted);line-height:1.8;padding:8px}
  .shotbig .ph em{font-style:normal;font-family:var(--display);font-size:.9em;font-weight:500;color:var(--faint)}
  .shotbig figcaption{position:absolute;left:10px;bottom:10px;font-family:var(--mono);font-size:10.5px;font-weight:700;
    color:#fff;background:rgba(0,0,0,.55);padding:5px 10px;border-radius:999px;white-space:nowrap}
  .shotbig figcaption b{color:var(--redSoft)}
  @media (max-width:820px){
    .cmpgrid.n3,.cmpgrid.n4{grid-template-columns:repeat(2,minmax(0,1fr))}
    .cmpgrid.n3 .shotbig,.cmpgrid.n4 .shotbig{max-height:none}
  }
  .mgrid{display:grid;gap:14px;margin-top:16px;grid-template-columns:1fr 1fr}
  .mcell{background:var(--bg);border:1.5px dashed rgba(255,255,255,.16);border-radius:16px;aspect-ratio:3/4;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:12px;text-align:center;position:relative}
  .mcell b{font-family:var(--mono);font-size:13px;color:var(--muted)}
  .mcell span{font-size:11px;color:var(--faint)}
  .mcell .tagd{position:absolute;top:10px;left:10px;font-family:var(--mono);font-size:9px;font-weight:700;
    letter-spacing:.1em;color:#fff;background:var(--red);padding:3px 9px;border-radius:999px}
  .mcell .wt{font-size:14px;font-weight:900;color:var(--text)}
  .mdelta{margin-top:14px;text-align:center}
  .delta{font-family:var(--mono);font-size:12px;font-weight:700;padding:8px 14px;border-radius:999px;
    background:var(--surface2);border:1px solid var(--stroke2);display:inline-block}
  .delta i{color:var(--red);font-style:normal;margin-right:6px}
  .field{margin-top:12px}
  .field label{display:block;font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
  /* textarea was missing here, so the bio box fell back to the browser default —
     system font, its own border, a resize grabber — next to fields that don't. */
  .field input,.field select,.field textarea{width:100%;background:var(--bg);border:1px solid var(--stroke);
    border-radius:12px;padding:10px 13px;color:var(--text);font-size:13.5px;outline:none;color-scheme:dark;
    font-family:var(--display)}
  .field input:focus,.field select:focus,.field textarea:focus{border-color:rgba(255,77,94,.5)}
  .field textarea{display:block;line-height:1.6;resize:vertical;min-height:96px}
  .field input::placeholder,.field textarea::placeholder{color:var(--faint)}
  .swrow{display:flex;gap:9px;margin-top:6px}
  .swb{width:26px;height:26px;border-radius:50%;border:2px solid transparent;flex:none}
  .swb.on{border-color:#fff}

  /* dashboard + calendar */
  .dstats{display:grid;grid-template-columns:repeat(auto-fit,minmax(158px,1fr));gap:14px}
  .cal-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;flex-wrap:wrap}
  .cal-head h3{font-size:16px;font-weight:900}
  .cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
  .cal .dow{font-family:var(--mono);font-size:9.5px;letter-spacing:.1em;color:var(--faint);text-align:center;padding:4px 0;text-transform:uppercase}
  .day{min-height:74px;background:var(--bg);border:1px solid var(--stroke);border-radius:12px;padding:6px;display:flex;flex-direction:column;gap:4px}
  .day.blank{background:transparent;border-color:transparent}
  .day .dn{font-family:var(--mono);font-size:10px;color:var(--muted)}
  .day.today{border-color:rgba(255,77,94,.6)}
  .day[data-day]{cursor:pointer}
  .day[data-day]:hover{border-color:var(--stroke2);background:var(--surface)}
  .dayrows{margin-top:8px;display:flex;flex-direction:column;gap:7px}
  .dayrows .client{width:100%}
  .day.today .dn{color:var(--redSoft);font-weight:700}
  .pills{display:flex;flex-direction:column;gap:4px;min-width:0}
  .pill{display:flex;align-items:center;gap:5px;font-family:var(--mono);font-size:8.5px;font-weight:700;
    padding:3px 6px;border-radius:7px;color:var(--text);background:var(--surface2);border:1px solid var(--stroke);
    width:100%;text-align:left;overflow:hidden;white-space:nowrap}
  .pill.more{justify-content:center;color:var(--muted)}
  .pill .pd{width:6px;height:6px;border-radius:50%;flex:none}
  .up{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--stroke);width:100%;text-align:left}
  .up:last-child{border-bottom:none}
  .up .ud{font-family:var(--mono);font-size:10px;color:var(--muted);width:52px;flex:none}
  .up .un{font-size:13.5px;font-weight:800;flex:1;min-width:0}
  .up .ut{font-family:var(--mono);font-size:9.5px;font-weight:700;padding:4px 9px;border-radius:999px;border:1px solid}

  .note{padding:10px 0;border-bottom:1px solid var(--stroke);font-size:13.5px;color:#c9cedb}
  .note:last-of-type{border-bottom:none}
  .note .nd{font-family:var(--mono);font-size:9.5px;color:var(--faint);margin-top:3px}
  .nact{color:var(--faint);font-size:12.5px;padding:3px 7px;border-radius:8px;flex:none}
  .nact:hover{color:var(--text);background:var(--surface2)}
  .notein{display:flex;gap:8px;margin-top:12px}
  .notein input{flex:1;min-width:0;background:var(--bg);border:1px solid var(--stroke);border-radius:12px;padding:10px 13px;
    color:var(--text);font-size:13px;outline:none}
  .notein input:focus{border-color:rgba(255,77,94,.5)}

  /* ---------- messaging ---------- */
  .thread{display:flex;flex-direction:column;gap:9px;max-height:min(52vh,460px);overflow-y:auto;padding:6px 2px 4px;margin-top:6px}
  .daysep{align-self:center;font-family:var(--mono);font-size:9px;letter-spacing:.16em;text-transform:uppercase;
    color:var(--faint);padding:6px 0 2px}
  .bub{max-width:78%;padding:10px 13px;border-radius:16px;font-size:13.5px;line-height:1.45;word-break:break-word}
  .bub.k{align-self:flex-end;background:rgba(255,77,94,.13);border:1px solid rgba(255,77,94,.28);border-bottom-right-radius:6px}
  .bub.c{align-self:flex-start;background:var(--surface2);border:1px solid var(--stroke);border-bottom-left-radius:6px}
  .bub.sys{align-self:center;max-width:100%;text-align:center;background:transparent;border:1px dashed var(--stroke2);
    color:var(--muted);font-family:var(--mono);font-size:10.5px;padding:7px 13px}
  .bub .tm{font-family:var(--mono);font-size:9px;color:var(--faint);margin-top:5px}
  .bub.c.unread{border-color:rgba(255,77,94,.45)}
  .composer{display:flex;gap:8px;margin-top:12px;align-items:flex-end}
  .composer textarea{flex:1;min-width:0;background:var(--bg);border:1px solid var(--stroke);border-radius:14px;
    padding:11px 13px;color:var(--text);font-size:13.5px;outline:none;resize:none;font-family:inherit;line-height:1.45;height:44px;max-height:130px}
  .composer textarea:focus{border-color:rgba(255,77,94,.5)}
  .quickreps{display:flex;gap:6px;flex-wrap:wrap;margin-top:9px}
  .badge{font-family:var(--mono);font-size:9px;font-weight:700;min-width:17px;height:17px;padding:0 5px;border-radius:999px;
    background:var(--red);color:#fff;display:inline-grid;place-items:center;flex:none}
  .client .badge{margin-left:auto}
  .tab .badge{margin-left:7px;vertical-align:1px}
  /* roster table */
  .rostbar{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:12px}
  .rsearch{flex:1;min-width:150px;display:flex}
  .rsearch input{flex:1;min-width:0;background:var(--bg);border:1px solid var(--stroke);border-radius:999px;
    padding:6px 13px;color:var(--text);font-size:12.5px;outline:none}
  .rsearch input:focus{border-color:rgba(255,77,94,.5)}
  .rostwrap{overflow-x:auto;margin-top:6px}
  .roster{width:100%;border-collapse:collapse;min-width:600px}
  .roster th{font-family:var(--mono);font-size:8.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
    color:var(--faint);text-align:left;padding:6px 10px 8px}
  .roster td{padding:10px;border-top:1px solid var(--stroke);vertical-align:middle}
  .roster tbody tr{cursor:pointer}
  .roster tbody tr:hover{background:var(--surface2)}
  .th-name{display:flex;align-items:center;gap:10px;min-width:0}
  .roster .rn{display:flex;flex-direction:column;min-width:0}
  .roster .rn b{font-size:13.5px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .roster .rn i{font-style:normal;font-family:var(--mono);font-size:9.5px;color:var(--faint)}
  .strip{display:inline-flex;gap:3px;align-items:center}
  .tick{width:8px;height:16px;border-radius:3px;background:var(--surface2);flex:none}
  .tick.on{background:var(--green)}
  /* not "no session" — "we don't know", because their app hasn't synced */
  .tick.unk{background:repeating-linear-gradient(135deg,rgba(255,197,92,.30) 0 2px,transparent 2px 4px);
    box-shadow:inset 0 0 0 1px rgba(255,197,92,.30)}
  .sessn{font-family:var(--mono);font-size:9.5px;color:var(--faint);margin-left:9px}
  .adhv{font-family:var(--mono);font-size:13px;font-weight:700}
  .th-vol{font-family:var(--mono);font-size:12px;font-weight:700}
  .roster .nx{font-family:var(--mono);font-size:10px;font-weight:700;display:block}
  .roster .nxd{font-family:var(--mono);font-size:9.5px;color:var(--faint)}
  .th-msg{text-align:right;white-space:nowrap}
  .inbox{display:flex;align-items:flex-start;gap:11px;padding:10px 0;border-bottom:1px solid var(--stroke);width:100%;text-align:left}
  .inbox:last-child{border-bottom:none}
  .inbox .ix{font-size:13px;color:#c9cedb;flex:1;min-width:0}
  .inbox .ix b{font-weight:800;color:var(--text)}
  .inbox .ix .p{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .inbox .when{font-family:var(--mono);font-size:9.5px;color:var(--faint);flex:none;text-align:right}
  .inbox .ageb{display:block;font-weight:700;letter-spacing:.06em}
  .inbox .agew{display:block;opacity:.65;margin-top:2px}
  .inbox.age-fresh .ageb{color:var(--muted)}
  .inbox.age-soon  .ageb{color:var(--amber)}
  .inbox.age-late  .ageb{color:var(--redSoft)}
  /* a bar down the left edge so the backlog is visible without reading */
  .inbox{position:relative;padding-left:11px}
  .inbox::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:2px;background:transparent}
  .inbox.age-soon::before{background:rgba(255,197,92,.55)}
  .inbox.age-late::before{background:var(--red)}

  /* week at a glance */
  .wag{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;margin-top:14px;align-items:end}
  .wagd{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
  .wagn{font-family:var(--mono);font-size:12.5px;font-weight:700;color:var(--text)}
  .wagbar{display:block;width:100%;height:74px;background:var(--bg);border:1px solid var(--stroke);
    border-radius:9px;display:flex;align-items:flex-end;overflow:hidden}
  .wagbar i{display:block;width:100%;background:rgba(255,77,94,.34);border-radius:8px 8px 0 0;min-height:2px}
  .wagd.today .wagbar{border-color:rgba(255,77,94,.55)}
  .wagd.today .wagbar i{background:var(--red)}
  .wagd.today .wagl{color:var(--redSoft);font-weight:700}
  .wagd.empty .wagn{color:var(--faint)}
  .wagl{font-family:var(--mono);font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}

  /* ---------- plan builder ---------- */
  .bday{border:1px solid var(--stroke);border-radius:14px;padding:12px;margin-top:10px;background:var(--bg)}
  .bdhead{display:flex;gap:8px;align-items:center}
  .bdhead input{flex:1;min-width:0;background:var(--surface);border:1px solid var(--stroke);border-radius:10px;
    padding:8px 11px;color:var(--text);font-size:13px;font-weight:800;outline:none}
  .bdhead input:focus{border-color:rgba(255,77,94,.5)}
  /* one card per exercise — mirrors the app's New routine screen */
  .bitem{background:var(--surface);border:1px solid var(--stroke);border-radius:14px;padding:12px;margin-top:9px}
  .bitem input{background:var(--bg);border:1px solid var(--stroke);border-radius:9px;padding:8px 10px;
    color:var(--text);font-size:13.5px;outline:none;min-width:0;width:100%}
  .bitem input:focus{border-color:rgba(255,77,94,.5)}
  .bitem input::placeholder{color:var(--faint)}
  .bitop{display:flex;align-items:center;gap:6px}
  .bitop .c-ex{flex:1;font-weight:800;color:var(--redSoft)}
  .binote{display:flex;align-items:flex-start;gap:6px;margin-top:8px;font-size:12px;color:var(--green);opacity:.9}
  .binote .ic{width:13px;height:13px;flex:none;margin-top:1px}
  .ic{display:inline-grid;place-items:center;width:15px;height:15px;flex:none}
  .ic svg{width:100%;height:100%;display:block}

  .tagpills{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
  .tagpill{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;
    background:var(--bg);border:1px solid var(--stroke);border-radius:999px;padding:7px 11px;font-size:12.5px}
  .tagpill:hover{border-color:var(--stroke2)}
  .tagpill.empty{color:var(--muted)}
  .tagpill .cd{width:7px;height:7px;border-radius:50%;flex:none}
  .tagpill i{font-style:normal;font-weight:700;font-size:12px;color:var(--muted)}
  .tagpill.empty i{color:var(--muted)}
  .tagpill b{font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
  .tagpill .chev{width:12px;height:12px;flex:none;opacity:.55}

  .setlist{margin-top:10px;display:flex;flex-direction:column}
  .setrow{display:flex;align-items:center;gap:4px;border-radius:9px;padding-right:4px}
  .setrow.drop{background:rgba(255,197,92,.07);border-left:3px solid var(--amber);margin:2px 0}
  .setkind{flex:1;display:flex;align-items:center;gap:12px;padding:8px;min-width:0}
  .setkind .ic{width:16px;height:16px}
  .setrow.warm .setkind{color:var(--green)}
  .setrow.drop .setkind{color:var(--amber)}
  .setn{width:16px;text-align:center;font-family:var(--mono);font-size:12px;font-weight:700;color:var(--muted);flex:none}
  .setname{font-size:13.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .setrow.work .setname{color:var(--text)}
  .setrow .mini .ic{width:13px;height:13px}
  .mini.on.green{color:var(--green);border-color:rgba(84,224,176,.5);background:rgba(84,224,176,.1)}
  .mini.on.amber{color:var(--amber);border-color:rgba(255,197,92,.5);background:rgba(255,197,92,.1)}
  .addset{width:100%;margin-top:8px;padding:9px;border-radius:11px;border:1.5px dashed var(--stroke2);
    color:var(--muted);font-weight:700;font-size:12.5px}
  .addset:hover{color:var(--text);border-color:rgba(255,255,255,.28)}
  .bmeta{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;margin-top:14px}
  .grouprow{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:14px;padding:11px 12px;
    background:var(--bg);border:1px solid var(--stroke);border-radius:14px}
  .grouprow .tfilter{cursor:pointer}
  .grouprow .tfilter[disabled]{cursor:help}
  .pro{font-family:var(--mono);font-size:8.5px;font-weight:700;letter-spacing:.14em;color:var(--amber);
    background:rgba(255,197,92,.1);border:1px solid rgba(255,197,92,.3);padding:3px 7px;border-radius:999px}
  .mini{width:27px;height:27px;border-radius:8px;display:grid;place-items:center;flex:none;
    color:var(--faint);border:1px solid var(--stroke);font-family:var(--mono);font-size:10px;font-weight:700}
  .mini:hover{color:var(--text);border-color:var(--stroke2)}
  .mini.on{color:var(--red);border-color:rgba(255,77,94,.5);background:rgba(255,77,94,.09)}
  .bitem .ctl{display:flex;gap:4px}
  /* The indent + bracket marks a supersetted row when READING a routine. The
     builder shows the link between two exercises instead, so this is scoped to
     the viewer — both at once was a red bracket fighting an amber rail. */
  .exline.chained{position:relative;padding-left:14px}
  .exline.chained::before{content:"";position:absolute;left:4px;top:-5px;bottom:50%;width:7px;
    border-left:1.5px solid rgba(255,77,94,.45);border-bottom:1.5px solid rgba(255,77,94,.45);border-bottom-left-radius:6px}
  pre.json{background:var(--bg);border:1px solid var(--stroke);border-radius:12px;padding:12px;font-family:var(--mono);
    font-size:10.5px;line-height:1.5;color:var(--muted);overflow:auto;max-height:280px;white-space:pre;margin-top:10px}
  .mfoot{display:flex;justify-content:flex-end;gap:9px;margin-top:16px;flex-wrap:wrap}
  .mfoot .grow{flex:1}

  .oauth{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
  .btn.oa{justify-content:center;display:inline-flex;align-items:center;gap:9px;padding:12px 14px;
    background:var(--surface2);border-color:var(--stroke2);font-size:13.5px}
  .btn.oa:hover{border-color:rgba(255,255,255,.3);background:#1b1f2b}
  .orline{display:flex;align-items:center;gap:12px;margin:18px 0 4px;color:var(--faint)}
  .orline::before,.orline::after{content:"";flex:1;height:1px;background:var(--stroke)}
  .orline span{font-family:var(--mono);font-size:9.5px;letter-spacing:.14em;text-transform:uppercase}
  @media (max-width:560px){ .oauth{grid-template-columns:1fr} }

  /* ---------- tag picker (mirrors TagPickerView in the app) ---------- */
  .sheet{position:fixed;inset:0;background:rgba(5,6,9,.72);backdrop-filter:blur(5px);z-index:70;display:none;
    align-items:center;justify-content:center;padding:18px}
  .sheet.open{display:flex}
  .sheetbox{background:var(--surface);border:1px solid var(--stroke2);border-radius:22px;padding:18px;
    max-width:520px;width:100%;max-height:86vh;overflow-y:auto}
  .sheethead{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
  .sheethead b{font-size:16px;font-weight:900}
  .sheethead .gdot{width:10px;height:10px;border-radius:3px;flex:none}
  .sheethead .btn{margin-left:auto}
  .chiprow{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
  .pchip{font-family:var(--mono);font-size:12px;font-weight:500;padding:8px 13px;border-radius:999px;
    border:1px solid;line-height:1.2}
  .pchip.on{color:#fff!important;font-weight:700}
  /* a tag that came from a client's own library — still a pill, just hollow */
  .pchip.derived{background:transparent;border-style:dashed;opacity:.72}
  .catrow{margin-top:12px}
  .cathead{font-family:var(--mono);font-size:9px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;opacity:.8}
  /* exercise catalogue */
  .catlist{margin-top:12px;max-height:min(52vh,520px);overflow-y:auto;border:1px solid var(--stroke);border-radius:14px}
  .catrowx{display:flex;align-items:center;gap:6px;padding:4px 8px 4px 4px;border-bottom:1px solid var(--stroke)}
  .catrowx:last-child{border-bottom:none}
  .catrowx:hover{background:var(--surface2)}
  .catmain{flex:1;min-width:0;text-align:left;padding:11px 10px;display:flex;flex-direction:column;gap:6px}
  .catmain .cn{font-size:14px;font-weight:800}
  .catmain .ct{display:flex;flex-wrap:wrap;gap:5px}
  .catmain .cnote{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--green);opacity:.85}
  .catmain .cnote .ic{width:12px;height:12px}
  .exgroup{background:var(--bg);border:1px solid var(--stroke);border-radius:14px;padding:12px;margin-top:10px}
  .inlineadd{display:flex;align-items:center;gap:5px}
  .inlineadd input{background:var(--bg);border:1px solid var(--stroke);border-radius:9px;padding:7px 10px;
    color:var(--text);font-size:13.5px;outline:none;width:150px;min-width:0}
  .inlineadd input:focus{border-color:rgba(255,77,94,.5)}
  @media (max-width:720px){
    .sheet{align-items:flex-end;padding:0}
    .sheetbox{border-radius:22px 22px 0 0;max-width:100%;max-height:80vh;padding:18px 16px 26px}
    .pchip{font-size:13px;padding:10px 15px}
  }

  /* ---------- rules ---------- */
  .rule{display:grid;grid-template-columns:1fr 92px;gap:10px;align-items:center;padding:11px 0;border-bottom:1px solid var(--stroke)}
  .rule:last-of-type{border-bottom:none}
  .rule .rn{font-size:13.5px;font-weight:800}
  .rule .rd{font-family:var(--mono);font-size:10px;color:var(--faint);margin-top:2px}
  .rule input{width:100%;background:var(--bg);border:1px solid var(--stroke);border-radius:10px;padding:8px 10px;
    color:var(--text);font-size:13px;outline:none;text-align:center}
  .rule input:focus{border-color:rgba(255,77,94,.5)}

  #toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%) translateY(16px);opacity:0;pointer-events:none;
    background:var(--surface2);border:1px solid var(--stroke2);border-radius:999px;padding:10px 18px;
    font-size:13px;font-weight:700;z-index:99;max-width:92vw;text-align:center;
    /* not `all`: that animates the radius, so a long toast visibly morphs out
       of a pill on its way to being a card */
    transition:opacity .25s, transform .25s}
  /* A pill radius on a multi-line block draws an ellipse. Long messages — the
     flag explanations — are a card instead. */
  /* An explicit width, not just max-width: with left:50% the shrink-to-fit
     box can only use the right half of the viewport, so it came out narrow
     and very tall. */
  #toast.long{border-radius:16px;padding:13px 16px;width:min(420px,92vw);max-width:none;text-align:left;
    font-size:12.5px;font-weight:600;line-height:1.55;color:var(--muted)}
  #toast.show{opacity:1;transform:translateX(-50%)}

  @media (max-width:980px){
    .shell,.shell.rail{grid-template-columns:minmax(0,1fr)}
    aside{position:static;height:auto;border-right:none;border-bottom:1px solid var(--stroke)}
    .brandrow .collapse{display:none}          /* desktop rail toggle hidden on phone */
    .clihead{display:flex}                     /* list toggle lives beside the list */
    .shell.mclosed .clients{display:none}
    .shell.mclosed .clihead .collapse svg{transform:rotate(180deg)}
    .clients{max-height:240px}
    /* The coach card is the only route to your own profile, so it must not
       vanish on a phone — it just gets out of the way at the end of the list. */
    .coachcard{display:flex;border-top:1px solid var(--stroke);border-bottom:1px solid var(--stroke)}
    main{padding:18px 12px 80px}
    .g4{grid-template-columns:1fr 1fr}
    .dstats{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}
    .g2{grid-template-columns:minmax(0,1fr)}
    .bub{max-width:88%}
    /* Calendar fits the width instead of scrolling sideways: pills become dots,
       and the tappable "Next 14 days" list below carries the detail. */
    .cal{gap:4px}
    .day{min-height:56px;padding:5px 4px;gap:3px}
    .day .dn{font-size:9.5px;text-align:center}
    .pills{flex-direction:row;flex-wrap:wrap;gap:3px;justify-content:center}
    .pill{width:8px;height:8px;padding:0;border-radius:50%;border:none;background:transparent;
      font-size:0;overflow:visible}
    .pill .pd{width:8px;height:8px}
    .pill.more{width:auto;height:auto;font-size:8px;padding:0 2px;background:transparent}
    .day .pill{pointer-events:none}
  }
  /* ---- roster on small screens: rows become stacked cards, never a scroller ---- */
  @media (max-width:760px){
    .rostwrap{overflow-x:visible}
    .roster{min-width:0;display:block}
    .roster thead{display:none}
    .roster tbody{display:block}
    .roster tr{display:grid;grid-template-columns:1fr auto auto;
      grid-template-areas:"nm nm ms" "st st st" "ad vo nx";
      gap:10px 12px;align-items:end;
      background:var(--bg);border:1px solid var(--stroke);border-radius:14px;padding:12px;margin-top:9px}
    .roster td{display:block;border-top:none;padding:0;min-width:0}
    .th-name{grid-area:nm;align-items:center} .th-msg{grid-area:ms;align-self:center}
    .th-strip{grid-area:st} .th-adh{grid-area:ad} .th-vol{grid-area:vo}
    .th-next{grid-area:nx;text-align:right}
    /* the header row is gone on mobile, so each cell names itself */
    .roster td[data-l]::before{content:attr(data-l);display:block;font-family:var(--mono);font-size:8.5px;
      font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--faint);margin-bottom:5px}
    .th-strip{display:flex;flex-wrap:wrap;align-items:center;gap:0 10px}
    .th-strip::before{flex-basis:100%}
    .strip{gap:3px}                    /* 14 × 11px fits inside 375px — no stretching needed */
    .sessn{margin-left:0}
    .roster .nxd{display:inline}
  }
  @media (max-width:720px){
    .bday{padding:10px}

    .mini{width:32px;height:32px}
    .tagpill{flex:1 1 auto}
  }
  @media (max-width:560px){
    .topbar h1{font-size:21px}
    .mgrid{grid-template-columns:1fr 1fr}
    .bmeta{grid-template-columns:1fr 1fr;gap:8px}
    .bmeta .field:first-child{grid-column:1/-1}
    .mbox{padding:16px 14px}
  }

  /* ---------- sign-in gate (live app only) ---------- */
  .gate{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:32px 20px}
  .gatebox{width:100%;max-width:520px;text-align:center}
  .gbrand{display:flex;align-items:center;justify-content:center;gap:11px;margin-bottom:26px;
    font-size:21px;font-weight:900;letter-spacing:-.02em}
  .gbrand .fit{color:var(--red)}
  .gbrand small{font-family:var(--mono);font-size:9.5px;letter-spacing:.2em;color:var(--faint);
    margin-left:5px;vertical-align:middle}
  .gatebox h2{font-size:26px;font-weight:900;letter-spacing:-.025em;margin:0 0 12px}
  .gsub{color:var(--muted);font-size:14px;line-height:1.65;margin:0 0 12px}
  .gfine{color:var(--faint);font-size:12px;line-height:1.7;margin:18px 0 0}
  .gfine a{color:var(--muted);text-decoration:underline;text-underline-offset:2px}
  .gfine a:hover{color:var(--text)}
  .gate .oauth .btn.oa{width:100%}

  /* Prototype access gate. The page ships locked and demo-gate.js unlocks it,
     so a script that never arrives leaves the door shut instead of open. */
  body.locked .ribbon,body.locked .shell{display:none}
  .gate.demogate{display:none}
  body.locked .gate.demogate{display:flex}
  .demogate #dgcode{font-family:var(--mono);letter-spacing:.14em;text-align:center;
    text-transform:uppercase;font-size:15px;padding:12px}
  .demogate .btn.red{margin-top:14px;padding:11px;font-size:13.5px}
  .shell.gated{grid-template-columns:1fr}
  .shell.gated aside{display:none}
  /* anchors used as buttons inherit link colour otherwise */
  a.btn.oa{color:var(--text);text-decoration:none}
  a.btn.oa:hover{color:var(--text)}

  /* ---------- real prep photos (live build) ---------- */
  .shot.hasimg{position:relative;overflow:hidden;padding:0;border-style:solid;
    border-color:rgba(255,255,255,.14);background:#000;justify-content:flex-end}
  .shot.hasimg img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
  /* Scrim only at the foot, and only as deep as the caption needs — the point
     is to read the label without veiling the photograph. */
  .shot.hasimg::after{content:"";position:absolute;left:0;right:0;bottom:0;height:52%;z-index:1;
    background:linear-gradient(to top,rgba(0,0,0,.82),rgba(0,0,0,0))}
  .shot.hasimg figcaption{position:relative;z-index:2;width:100%;padding:0 7px 7px;
    font-size:9.5px;line-height:1.25;font-weight:700;color:#fff;text-align:left;
    text-shadow:0 1px 3px rgba(0,0,0,.9);
    overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .shot.hasimg .keep{position:absolute;top:6px;left:6px;z-index:2;font-style:normal;font-size:11px;
    line-height:1;color:#FFC55C;text-shadow:0 1px 4px rgba(0,0,0,.9)}
  .shot.hasimg .selno{z-index:3}
  .shotbig img{width:100%;height:100%;object-fit:contain;display:block;border-radius:10px}

  /* ---------- chart tooltips ---------- */
  .ctip{position:fixed;z-index:200;pointer-events:none;opacity:0;transform:translateY(3px);
    transition:opacity .12s ease, transform .12s ease;
    background:#0B0D12;border:1px solid var(--stroke2);border-radius:10px;padding:7px 10px;
    box-shadow:0 10px 28px rgba(0,0,0,.6);max-width:220px}
  .ctip.on{opacity:1;transform:translateY(0)}
  .ctip b{display:block;font-size:11px;font-weight:800;color:var(--text);letter-spacing:-.01em}
  .ctip span{display:block;font-family:var(--mono);font-size:10.5px;color:var(--muted);margin-top:2px}
  [data-tip]{cursor:crosshair}
  @media (hover:none){ [data-tip]{cursor:default} }

  @media (max-width:560px){
    /* The full explanation wrapped to three lines and swallowed the tiles. */
    .cmpbar .t em{display:none}
    .cmpbar{gap:8px;padding:9px 10px 9px 14px}
  }

  /* ---------- client profile pictures ---------- */
  .ava.hasimg{position:relative;overflow:hidden;padding:0;background:var(--surface2)}
  .ava.hasimg img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;z-index:1}
  /* initials sit underneath, so a slow or failed image still shows something */
  .ava.hasimg i{font-style:normal;position:relative;z-index:0}

  /* ---------- posing session paging ---------- */
  .showmore{width:100%;justify-content:center;margin-top:12px;gap:8px}
  .showmore span{font-family:var(--mono);font-size:10px;color:var(--faint);letter-spacing:.08em}

  /* skeleton while a tile waits for its thumbnail or signed url */
  .shot.hasimg.loading{background:linear-gradient(100deg,#141821 30%,#1d2231 50%,#141821 70%);
    background-size:220% 100%;animation:shimmer 1.15s linear infinite}
  @keyframes shimmer{from{background-position:130% 0}to{background-position:-130% 0}}
  .shot.hasimg.loading figcaption,.shot.hasimg.loading .keep{opacity:0}
  @media (prefers-reduced-motion:reduce){ .shot.hasimg.loading{animation:none} }

  /* ---------- coach public profile form ---------- */
  .cpgrid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,300px);gap:22px;margin-top:16px;align-items:start}
  .cplabel{font-family:var(--mono);font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;
    color:var(--faint);margin-bottom:8px}
  .fhint{font-size:11px;line-height:1.55;color:var(--faint);margin-top:5px}
  .fhint b{color:var(--muted);font-weight:700}
  .linkbtn{background:none;border:none;padding:0;font:inherit;color:var(--redSoft);
    text-decoration:underline;text-underline-offset:2px;cursor:pointer}
  .linkbtn:hover{color:var(--red)}
  .cpphoto{display:flex;align-items:center;gap:12px}

  /* the card as the client sees it */
  .cpcard{background:var(--bg);border:1px solid var(--stroke2);border-radius:16px;padding:14px}
  .cphead{display:flex;align-items:center;gap:12px;min-width:0}
  .cpnm{font-size:15px;font-weight:900;letter-spacing:-.02em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .cporg{font-size:12px;color:var(--muted);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .cprows{margin-top:12px;border-top:1px solid var(--stroke);padding-top:4px}
  .cprow{display:flex;align-items:baseline;gap:10px;padding:7px 0;border-bottom:1px solid var(--stroke)}
  .cprow:last-child{border-bottom:none}
  .cprow span{font-family:var(--mono);font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;
    color:var(--faint);flex:none;width:74px}
  .cprow b{font-size:12.5px;font-weight:700;color:var(--redSoft);min-width:0;overflow:hidden;
    text-overflow:ellipsis;white-space:nowrap}
  @media (max-width:720px){ .cpgrid{grid-template-columns:minmax(0,1fr)} }

  /* the coach card doubles as the way into your own profile */
  .coachcard.clickable{cursor:pointer;transition:background .15s}
  .coachcard.clickable:hover{background:var(--surface2)}
  .coachcard.clickable:hover .nm{color:var(--redSoft)}
  .coachcard .cchev{width:14px;height:14px;margin-left:auto;color:var(--faint);flex:none}
  .coachcard.clickable:hover .cchev{color:var(--muted)}

  /* a thread that can be read but not continued */
  .closedbox{margin-top:12px;padding:12px 14px;border:1px dashed var(--stroke2);border-radius:14px;
    background:var(--bg);font-size:12.5px;line-height:1.6;color:var(--muted)}
  .closedbox b{display:block;color:var(--text);font-weight:800;font-size:13px;margin-bottom:3px}
  .client.past .nm{color:var(--muted)}
  .pastsep{font-family:var(--mono);font-size:9px;letter-spacing:.14em;text-transform:uppercase;
    color:var(--faint);padding:12px 10px 6px;border-top:1px solid var(--stroke);margin-top:6px}

  /* the provider you used before — the other one is a different account */
  .btn.oa.used{border-color:rgba(84,224,176,.45);background:rgba(84,224,176,.07)}
  .btn.oa.used::after{content:"last used";font-family:var(--mono);font-size:8.5px;letter-spacing:.1em;
    text-transform:uppercase;color:var(--green);margin-left:6px}
  .gnote{border:1px dashed var(--stroke2);border-radius:12px;padding:10px 12px;text-align:left}

  /* ---------- check-ins (client -> coach) ---------- */
  .cins{margin-top:10px}
  .cin{padding:12px 0;border-bottom:1px solid var(--stroke)}
  .cin:last-child{border-bottom:none;padding-bottom:2px}
  .cinhead{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
  .cinw{font-size:17px;font-weight:900;letter-spacing:-.02em}
  .cind{font-family:var(--mono);font-size:10.5px;color:var(--muted)}
  .cinago{font-family:var(--mono);font-size:10px;color:var(--faint)}
  .cinbadge{font-family:var(--mono);font-size:9px;letter-spacing:.1em;text-transform:uppercase;
    color:var(--green);border:1px solid rgba(84,224,176,.35);background:rgba(84,224,176,.08);
    border-radius:999px;padding:2px 7px}
  .cinnote{margin-top:7px;font-size:13px;line-height:1.6;color:var(--muted)}
  .cinshots{margin-top:10px}
  .cintag{font-family:var(--mono);font-size:8.5px;letter-spacing:.1em;text-transform:uppercase;
    color:var(--green);border:1px solid rgba(84,224,176,.35);background:rgba(84,224,176,.08);
    border-radius:999px;padding:1px 6px;margin-left:6px;vertical-align:1px}

  /* ---------- programmes a coach has assigned ---------- */
  .asgs{margin-top:10px}
  .asg{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px 12px;align-items:center;
    padding:10px 0;border-bottom:1px solid var(--stroke)}
  .asg:last-child{border-bottom:none}
  .asg.dupe{background:rgba(255,197,92,.05);border-radius:10px;padding-left:9px;padding-right:9px}
  .asgn{font-size:13.5px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .asgm{grid-column:1;font-family:var(--mono);font-size:10px;color:var(--faint)}
  .asgst{grid-column:2;grid-row:1/3;font-family:var(--mono);font-size:9px;letter-spacing:.1em;
    text-transform:uppercase;border-radius:999px;padding:3px 9px;border:1px solid}
  .asgst.live{color:var(--green);border-color:rgba(84,224,176,.35);background:rgba(84,224,176,.08)}
  .asgst.acc{color:var(--blue);border-color:rgba(94,168,255,.3);background:rgba(94,168,255,.07)}
  .asgst.wait{color:var(--amber);border-color:rgba(255,197,92,.3);background:rgba(255,197,92,.07)}
  .asg .btn.sm{grid-column:3;grid-row:1/3;padding:6px 11px;font-size:12px}
  .asgnote{grid-column:3;grid-row:1/3;font-family:var(--mono);font-size:9px;color:var(--faint);max-width:120px;text-align:right}
  @media (max-width:560px){
    .asg{grid-template-columns:minmax(0,1fr) auto}
    .asg .btn.sm,.asgnote{grid-column:1/3;grid-row:auto;text-align:left;justify-self:start;max-width:none}
  }

  /* ---------- supersets: a link between two exercises, not a flag on one ---------- */
  .chainrow{display:flex;justify-content:center;align-items:center;position:relative;height:26px;margin:-4px 0}
  /* the rail that visibly joins the pair */
  .chainrow::before{content:"";position:absolute;left:50%;top:0;bottom:0;width:2px;margin-left:-1px;
    background:var(--stroke2);border-radius:2px}
  .chainrow.on::before{background:var(--amber)}
  .chainbtn{position:relative;z-index:1;display:inline-flex;align-items:center;gap:5px;
    background:var(--surface);border:1px solid var(--stroke2);border-radius:999px;padding:3px 10px;
    color:var(--faint);cursor:pointer;font-family:var(--mono);font-size:9px;letter-spacing:.1em;
    text-transform:uppercase;transition:all .14s}
  .chainbtn svg{width:12px;height:12px}
  .chainrow:not(.on) .chainbtn{opacity:.5}
  .chainrow:not(.on):hover .chainbtn{opacity:1;color:var(--muted);border-color:rgba(255,255,255,.28)}
  /* The tint has to sit ON an opaque base — a translucent background let the
     rail behind it show straight through the pill, which read as the label
     having a line struck through it. */
  .chainrow.on .chainbtn{color:var(--amber);border-color:rgba(255,197,92,.5);opacity:1;
    background:linear-gradient(rgba(255,197,92,.12),rgba(255,197,92,.12)) var(--surface)}
  /* square off the facing corners so a supersetted pair reads as one block */
  .bitem.chained{border-top-left-radius:4px;border-top-right-radius:4px;border-top-color:rgba(255,197,92,.4)}
  .bitem.chainedNext{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom-color:rgba(255,197,92,.4)}
  .asgbtns{grid-column:3;grid-row:1/3;display:flex;gap:6px;align-items:center}
  @media (max-width:560px){ .asgbtns{grid-column:1/3;grid-row:auto;justify-self:start} }

  /* Client-authored text keeps its line breaks. CSS does this; building HTML
     out of a note or a message would be an injection hole for no gain. */
  .cinnote{white-space:pre-wrap}
  .bub .bt{white-space:pre-wrap}
  .bub.sys{white-space:pre-wrap}
  .pastnote{font-family:var(--mono);font-size:9px;line-height:1.5;color:var(--faint);
    padding:8px 10px 4px;letter-spacing:.04em}
  .pchip .tcount{font-style:normal;font-family:var(--mono);font-size:9px;opacity:.75;margin-left:6px}

  /* ---------- coach profile: about them ---------- */
  .cpyrs{display:inline-block;font-family:var(--mono);font-size:9.5px;letter-spacing:.1em;
    text-transform:uppercase;color:var(--amber);background:rgba(255,197,92,.09);
    border:1px solid rgba(255,197,92,.3);border-radius:999px;padding:3px 9px;margin-bottom:9px}
  .cpbio{font-size:12.5px;line-height:1.65;color:var(--muted);white-space:pre-wrap;margin:0}
  .cpach{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
  .cpach li{font-size:12px;line-height:1.5;color:var(--muted);padding-left:17px;position:relative}
  .cpach li::before{content:"❋";position:absolute;left:0;top:0;color:var(--amber);font-size:10px}
  .achrow{display:flex;gap:8px;align-items:center;margin-top:7px}
  .achrow input{flex:1;min-width:0}
  .cpcount{font-family:var(--mono);font-size:10px;color:var(--faint);text-align:right;margin-top:4px}
  .cpcount.over{color:var(--redSoft)}
  .achrow input.overlong{border-color:rgba(255,120,134,.55);background:rgba(255,77,94,.06)}
  .card.nudge{display:flex;align-items:center;gap:14px;flex-wrap:wrap;
    border-color:rgba(255,197,92,.32);background:linear-gradient(rgba(255,197,92,.05),rgba(255,197,92,.05)) var(--surface)}
  .card.nudge b{font-size:14.5px;font-weight:900;display:block}
  .card.nudge p{font-size:13px;color:var(--muted);margin-top:4px;max-width:560px}
  /* Anchors used as buttons must not fall back to default link styling. */
  a.btn{color:var(--text);text-decoration:none}
  a.btn:hover{color:var(--text)}
