/* Layout: phone-first single column (max 520px). Screens: routines, live workout, routine editor, summary.
   UNLOCK look, single dark theme by design: true black, red-to-teal spectrum as the one loud element, wide display face for titles and big numbers. */
:root {
  --bg: #000000; --panel: #070B11; --card: #0B1118; --raise: #121C27; --border: #1B2D41; --hairline: #101A26;
  --bright: #FFFFFF; --text: #E8ECF0; --body: #A9B8C6; --dim: #7E94AA;
  --teal: #26C6BA; --teal-ink: #001A17; --amber: #F5A524; --green: #2EDC86; --red: #E74C3C;
  --tint: rgba(38,198,186,0.10); --tint-hi: rgba(38,198,186,0.22);
  --spectrum: linear-gradient(90deg, #E74C3C 0%, #C34DAE 34%, #8056D9 58%, #2DA5D3 80%, #26C6BA 100%);
  --display: 'Michroma', 'Eurostile', 'IBM Plex Sans', system-ui, sans-serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(520px 280px at 0% -40px, rgba(195,77,174,.20), transparent 70%), radial-gradient(560px 300px at 100% -20px, rgba(38,198,186,.17), transparent 70%), var(--bg); background-repeat: no-repeat; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.app { max-width: 520px; margin: 0 auto; padding-block: 20px 132px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 16px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--dim); font-size: 13px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.brand { display: flex; flex-direction: column; gap: 8px; }
.brand .rule { width: 64px; height: 3px; background: var(--spectrum); border-radius: 2px; box-shadow: 0 0 18px rgba(128,86,217,.7); }
.brand .eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.15; letter-spacing: .06em; text-transform: uppercase; text-wrap: balance;
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { margin: 0; font-size: 12px; font-family: var(--mono); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.demo { font-size: 12.5px; color: var(--body); background: rgba(11,17,24,.7); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; }
.err { background: rgba(231,76,60,.12); border: 1px solid rgba(231,76,60,.45); color: #FFB3AA; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* buttons */
.btn { border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 600; font-size: 15px; transition: transform .08s ease, filter .15s ease; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--teal); color: var(--teal-ink); box-shadow: 0 0 0 1px rgba(38,198,186,.35), 0 10px 28px -10px rgba(38,198,186,.75); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: rgba(18,28,39,.6); border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--dim); }
.btn.wide { width: 100%; }
.btn.small { padding: 8px 12px; font-size: 13.5px; border-radius: 9px; }
.btn.danger { color: #FF9A8F; border-color: rgba(231,76,60,.5); }
.linkbtn { background: none; border: 0; color: var(--dim); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; padding: 4px 0; }

/* hero cards: up next, in progress */
.next, .livecard { position: relative; border: 1px solid transparent; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, #0E1620, #080D13) padding-box, var(--spectrum) border-box; box-shadow: 0 18px 50px -24px rgba(128,86,217,.8), 0 0 0 1px rgba(0,0,0,.4) inset; }
.next .lab, .livecard .lab { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); }
.livecard .lab { color: var(--green); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(46,220,134,.7); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px rgba(46,220,134,0); } }
.next .nm, .livecard .nm { font-family: var(--display); font-size: 19px; line-height: 1.25; letter-spacing: .03em; color: var(--bright); text-wrap: balance; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(18,28,39,.8); color: var(--body); border: 1px solid var(--border); }
.pv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--hairline); }
.pv li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: 13.5px; color: var(--text); }
.pv li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv li .t { font-family: var(--mono); font-size: 12px; color: var(--dim); white-space: nowrap; }
.pv li.more { color: var(--dim); font-size: 12.5px; border-bottom: 0; }
.pair { display: flex; gap: 8px; }
.pair .btn { flex: 1; }
.prog { height: 5px; background: var(--raise); border-radius: 3px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--spectrum); border-radius: 3px; transition: width .35s ease; box-shadow: 0 0 12px rgba(38,198,186,.6); }

/* routine list */
.sechead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.rt { --ac: var(--teal); position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 18px; background: rgba(11,17,24,.85); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.rt::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ac); box-shadow: 0 0 16px var(--ac); }
.rt:hover { border-color: #2A4059; }
.rtmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; background: none; border: 0; text-align: left; padding: 4px 0; }
.rtmain .nm { font-weight: 600; color: var(--bright); }
.rtmain .meta { font-size: 12.5px; color: var(--dim); }
.rtedit, .rtgo { background: var(--raise); border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px; font-size: 13px; color: var(--text); white-space: nowrap; }
.rtgo { color: var(--teal); border-color: rgba(38,198,186,.45); font-weight: 600; }
.rtedit:hover, .rtgo:hover { border-color: var(--dim); }
.hist { display: flex; flex-direction: column; }
.hrow { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--body); padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.hrow b { color: var(--text); font-weight: 500; }

/* sticky header for workout and editor */
.barwrap { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; margin-inline: -8px; padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 8px;
  background: rgba(0,0,0,.82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--hairline); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.back { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--raise); color: var(--text); font-size: 22px; line-height: 1; padding-bottom: 3px; }
.back:hover { border-color: var(--dim); }
.bar .ttl { flex: 1; min-width: 0; }
.bar .ttl .nm, .bar .ttl.nm { font-weight: 600; color: var(--bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .ttl .clock { font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.stats { display: flex; gap: 12px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.stats b { color: var(--bright); font-family: var(--mono); font-weight: 600; font-size: 14px; }

/* exercise cards */
.ex { background: linear-gradient(180deg, rgba(14,22,32,.95), rgba(9,14,20,.95)); border: 1px solid var(--border); border-radius: 16px; padding: 14px 12px 10px; display: flex; flex-direction: column; gap: 9px; transition: border-color .2s ease, box-shadow .2s ease; }
.ex.done { border-color: rgba(46,220,134,.5); box-shadow: 0 0 28px -14px rgba(46,220,134,.9); }
.exhead { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 0 2px; }
.exl { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.idx { font-family: var(--display); font-size: 12px; letter-spacing: .06em; color: var(--teal); }
.ex.done .idx { color: var(--green); }
.exhead .nm { font-weight: 600; color: var(--bright); }
.cr { font-size: 11.5px; color: var(--dim); text-align: right; }
.cr.left { text-align: left; padding: 0 2px; }
.target { font-size: 12.5px; color: var(--body); padding: 0 2px; }
.target b { color: var(--teal); font-weight: 500; }
.sets { display: grid; grid-template-columns: 36px minmax(0,1.45fr) minmax(0,1fr) minmax(0,.9fr) minmax(0,.9fr) 42px; gap: 6px; align-items: center; }
.hd { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-align: center; }
.hd.l { text-align: left; }
.sn { height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--raise); font-family: var(--mono); font-size: 13px; color: var(--body); }
.sn.w { color: var(--amber); border-color: rgba(245,165,36,.5); }
.prev { font-family: var(--mono); font-size: 12px; letter-spacing: -.01em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--bright); text-align: center; font-family: var(--mono); font-size: 15px; padding: 0 4px; }
.num::placeholder { color: #5E758C; }
.num:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--tint); }
.num:disabled { background: var(--raise); color: var(--dim); }
.num.ok { border-color: rgba(46,220,134,.4); background: rgba(46,220,134,.07); }
.chk { height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--raise); color: var(--dim); font-size: 17px; transition: transform .08s ease; }
.chk:active { transform: scale(.92); }
.chk.on { background: linear-gradient(135deg, #2EDC86, #26C6BA); border-color: transparent; color: #00140A; box-shadow: 0 0 18px -4px rgba(46,220,134,.9); animation: pop .22s ease; }
@keyframes pop { 0% { transform: scale(.8); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.beat { grid-column: 2 / -1; font-size: 11.5px; color: var(--green); margin-top: -2px; }
.exfoot { display: flex; gap: 8px; }
.exfoot button { flex: 1; background: transparent; border: 1px dashed var(--border); border-radius: 10px; padding: 8px; font-size: 13px; color: var(--body); }
.exfoot button:hover { border-color: var(--dim); color: var(--text); }
.finishbar { display: flex; gap: 8px; }
.finishbar .btn { flex: 1; }

/* rest timer sheet */
.rest { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(7,11,17,.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--border); border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 40px -20px rgba(38,198,186,.55); padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.rest .in { max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.ring { width: 52px; height: 52px; flex-shrink: 0; transform: rotate(-90deg); }
.ring .rg { stroke: var(--raise); }
.ring .rf { stroke: var(--teal); stroke-linecap: round; transition: stroke-dashoffset .5s linear, stroke .2s ease; filter: drop-shadow(0 0 4px rgba(38,198,186,.8)); }
.ring.up .rf { stroke: var(--amber); filter: drop-shadow(0 0 4px rgba(245,165,36,.8)); }
.rest .tx { flex: 1; min-width: 0; }
.rest .tm { font-family: var(--display); font-size: 22px; color: var(--bright); font-variant-numeric: tabular-nums; }
.rest .tm.up { color: var(--amber); }
.rest .lt { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest button { background: var(--raise); border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; font-family: var(--mono); font-size: 13px; color: var(--text); }

/* summary */
.sumhead { border: 1px solid transparent; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, #0E1620, #080D13) padding-box, var(--spectrum) border-box; box-shadow: 0 18px 50px -24px rgba(128,86,217,.8); }
.sumgrid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.kv .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.kv .v { font-family: var(--display); font-size: 19px; color: var(--bright); font-variant-numeric: tabular-nums; margin-top: 4px; overflow-wrap: anywhere; }
.mus { display: flex; flex-direction: column; gap: 8px; }
.mrow { display: grid; grid-template-columns: 96px minmax(0,1fr) 44px; gap: 10px; align-items: center; font-size: 13px; }
.mrow .t { height: 8px; background: var(--raise); border-radius: 4px; overflow: hidden; }
.mrow .t i { display: block; height: 100%; background: var(--spectrum); border-radius: 4px; }
.mrow .n { font-family: var(--mono); text-align: right; color: var(--bright); }
.prs { display: flex; flex-direction: column; gap: 6px; }
.pr { font-size: 13.5px; color: var(--body); }
.pr b { color: var(--green); font-weight: 500; }

/* routine editor */
.form, .addex { display: flex; flex-direction: column; gap: 6px; background: rgba(11,17,24,.9); border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.fl { font-size: 11.5px; color: var(--dim); font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.tin { width: 100%; background: var(--panel); color: var(--bright); border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-size: 15px; resize: vertical; }
.tin:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--tint); }
.ex.edit .exhead { align-items: center; }
.exname { font-weight: 600; }
.tools { display: flex; gap: 6px; flex-shrink: 0; }
.ic { min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--raise); color: var(--body); font-size: 14px; }
.ic:hover { border-color: var(--dim); color: var(--text); }
.ic.del.arm { color: #FFB3AA; border-color: rgba(231,76,60,.5); font-size: 12.5px; }
.opts { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 6px; }
.sel { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 0 8px; height: 40px; font-size: 13.5px; max-width: 100%; }
.sel:focus { outline: none; border-color: var(--teal); }
.esets { display: grid; grid-template-columns: 36px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 38px; gap: 6px; align-items: center; }
.esets .sn { display: flex; align-items: center; justify-content: center; }
.esets .sel.num { height: 38px; text-align: center; }
.addrow { display: flex; gap: 8px; }
.addrow .tin { flex: 1; min-width: 0; }
@media (max-width: 440px) { .opts { grid-template-columns: 1fr 1fr; } .opts .tin { grid-column: 1 / -1; } h1 { font-size: 26px; } }
@media (max-width: 380px) { .sets { grid-template-columns: 32px minmax(0,1.1fr) minmax(0,1fr) minmax(0,.9fr) minmax(0,.8fr) 38px; gap: 4px; } .stats { display: none; } }
@media (prefers-reduced-motion: reduce) { .dot, .chk.on { animation: none; } .prog i, .ring .rf, .btn, .chk { transition: none; } }

/* exercise library sheet (opens over the routine builder) */
html.lock, html.lock body { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-end; padding-top: calc(env(safe-area-inset-top, 0px) + 28px); }
.panel { width: 100%; max-width: 520px; max-height: 100%; height: 100%; display: flex; flex-direction: column; border: 1px solid transparent; border-bottom: 0; border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #0E1620, #06090D) padding-box, var(--spectrum) border-box; box-shadow: 0 -24px 70px -24px rgba(128,86,217,.9); overflow: hidden; }
.phead { display: flex; flex-direction: column; gap: 12px; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--hairline); }
.ptop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ptitle { margin: 0; font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.psearch { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--bright); padding: 0 14px; font-size: 15px; }
.psearch:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--tint); }
.fchips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { --mc: var(--teal); flex-shrink: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: rgba(18,28,39,.8); color: var(--body); font-size: 13px; white-space: nowrap; }
.fchip.on { border-color: var(--mc); color: var(--bright); background: rgba(255,255,255,.06); box-shadow: 0 0 14px -4px var(--mc); }
.prow2 { display: flex; gap: 8px; align-items: center; }
.prow2 .sel { flex: 1; min-width: 0; }
.pcount { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding: 10px max(16px, env(safe-area-inset-right, 0px)) 4px max(16px, env(safe-area-inset-left, 0px)); }
.plist { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px max(10px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 2px; }
.prow { display: flex; align-items: center; gap: 8px; border-radius: 14px; }
.prow:hover { background: rgba(255,255,255,.03); }
.pmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; text-align: left; padding: 8px 6px; border-radius: 14px; }
.av { --mc: var(--dim); flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--text);
  border: 1.5px solid var(--mc); background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.10), rgba(255,255,255,0) 60%), var(--raise); box-shadow: 0 0 14px -3px var(--mc); }
.ptxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ptxt .nm { font-weight: 600; color: var(--bright); font-size: 14.5px; }
.ptxt .sub { font-size: 12px; color: var(--dim); }
.badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); border: 1px solid rgba(38,198,186,.45); vertical-align: 2px; }
.plus { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--teal); color: var(--teal-ink); font-size: 20px; font-weight: 600; line-height: 1; box-shadow: 0 0 16px -4px rgba(38,198,186,.9); }
.prow.added .plus { background: linear-gradient(135deg, #2EDC86, #26C6BA); animation: pop .22s ease; }
.pedit { flex-shrink: 0; margin-right: 6px; background: var(--raise); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; font-size: 12.5px; color: var(--text); }
.pbody { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 6px; }
.pbody .sel { width: 100%; height: 44px; }
.hint { font-size: 12.5px; color: var(--dim); }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.addbtn { border-style: dashed; color: var(--teal); border-color: rgba(38,198,186,.5); }
@media (prefers-reduced-motion: reduce) { .prow.added .plus { animation: none; } }

/* --- v8: library docks to the side; spectrum kept to the brand rule, progress bar and one hairline --- */
body { background: radial-gradient(520px 260px at 100% -40px, rgba(38,198,186,.08), transparent 70%), var(--bg); background-repeat: no-repeat; }
.brand .rule { box-shadow: none; }
h1, .ptitle { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--bright); }
.next, .livecard, .sumhead { border: 1px solid var(--border); background: linear-gradient(180deg, #0E1620, #080D13); box-shadow: none; overflow: hidden; }
.next::before, .livecard::before, .sumhead::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--spectrum); }
.sumhead { position: relative; }
.rt::before { background: var(--teal); box-shadow: none; opacity: .75; width: 3px; }
.mrow .t i { background: var(--teal); }
.prog i { box-shadow: none; }
.av { box-shadow: none; }
.fchip.on { box-shadow: none; }
.ex.done { box-shadow: none; }
.rest { box-shadow: none; }
.sheet { inset: 0; padding-top: 0; align-items: stretch; justify-content: flex-end; background: rgba(0,0,0,.6); animation: slidein .2s ease; }
@keyframes slidein { from { transform: translateX(36px); opacity: 0; } }
.panel { width: min(420px, 92vw); max-width: none; height: 100%; border: 0; border-left: 1px solid var(--border); border-radius: 20px 0 0 20px; background: #0A1017; box-shadow: -30px 0 60px -30px rgba(0,0,0,.9); padding-top: env(safe-area-inset-top, 0px); }
@media (min-width: 900px) {
  /* room for both: the builder stays usable on the left while the library sits on the right */
  .sheet { left: auto; width: 420px; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .panel { width: 100%; border-radius: 0; box-shadow: none; }
  html.lock, html.lock body { overflow: visible; }
  html.lock body { padding-right: 420px; }
  html.lock .rest { right: 420px; }
}
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

/* lift cadence: eccentric | pause | concentric */
.tempo { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.tempo label { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-align: center; }
.tempo .num { text-transform: uppercase; }
.tline { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px; }
.tline span { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; background: var(--panel); }
.tline b { color: var(--bright); font-weight: 600; font-size: 13px; margin-left: 6px; }

/* builder: set rows like the workout card (Set | LB | Rep range | Target RPE), and an expandable muscle summary in the header */
.esets { grid-template-columns: 36px minmax(0,1fr) minmax(0,1.7fr) minmax(0,1.1fr) 38px; }
.rr { display: flex; align-items: center; gap: 4px; min-width: 0; }
.rr .num { min-width: 0; }
.rr i { color: var(--dim); font-style: normal; }
.sumbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.sumbar:hover { border-color: #2A4059; }
.sumbar .sl { display: flex; flex-direction: column; min-width: 0; }
.sumbar .sl b { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.sumbar .sl span { font-size: 13px; color: var(--bright); white-space: nowrap; }
.sumbar .sr { display: flex; align-items: center; gap: 6px; min-width: 0; justify-content: flex-end; flex-wrap: nowrap; overflow: hidden; }
.mtag { --mc: var(--teal); display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); white-space: nowrap; }
.mtag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mc); }
.mtag b { font-family: var(--mono); font-weight: 600; color: var(--bright); }
.chev { color: var(--dim); font-size: 14px; flex-shrink: 0; transition: transform .15s ease; }
.sumbar[aria-expanded="true"] .chev { transform: rotate(180deg); }
.sumpanel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.sumpanel .mrow { grid-template-columns: 92px minmax(0,1fr) 40px; }
.sumpanel .mrow .t i { background: var(--mc, var(--teal)); }
.sumkv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.sumkv div { font-size: 12.5px; color: var(--dim); }
.sumkv b { display: block; font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--bright); margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
.sumbar .sl { flex-shrink: 0; }
.sumbar .sr { flex: 1 1 0; flex-wrap: wrap; height: 18px; row-gap: 20px; column-gap: 10px; }
.esets .hd { white-space: nowrap; }
[hidden] { display: none !important; }
/* v11: body map, live muscle summary, RPE pad */
.body { display: flex; justify-content: center; gap: 28px; padding: 6px 0 2px; }
.bfig { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bfig svg { height: 176px; width: auto; display: block; }
.bfig span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.bb { fill: #141F2B; }
.bl { stroke: #141F2B; stroke-linecap: round; fill: none; }
.mf { fill: #1D2C3C; }
.ml { stroke: #1D2C3C; stroke-linecap: round; fill: none; }
.mf.on { fill: var(--mc); }
.ml.on { stroke: var(--mc); }
.mrow .t { position: relative; }
.sumpanel .mrow .t i.plan { opacity: .28; }
.sumpanel .mrow .t i.dn { position: absolute; left: 0; top: 0; }
.sumpanel .mrow { grid-template-columns: 92px minmax(0,1fr) auto; }
.sumpanel .mrow .n { min-width: 34px; }
.rpeb { cursor: pointer; padding: 0; font-weight: 600; }
.rpeb.ph { color: #5E758C; font-weight: 400; }
.rpepad { position: fixed; inset: 0; z-index: 35; display: flex; align-items: flex-end; justify-content: center; }
.rbd { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.rpn { --rc: var(--teal); position: relative; width: 100%; max-width: 520px; display: grid; grid-template-columns: minmax(0,1fr) 68px; gap: 8px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(7,11,17,.96); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--border); border-bottom: 0; border-radius: 18px 18px 0 0; animation: padup .18s ease; }
@keyframes padup { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.rmain { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px 12px; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.rtop { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rtt { display: flex; flex-direction: column; min-width: 0; }
.rtt b { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .14em; color: var(--dim); }
.rtt span { font-size: 12.5px; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rclear { flex-shrink: 0; background: none; border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; color: var(--body); }
.rbig { font-family: var(--display); font-size: 52px; line-height: 1.1; color: var(--rc); margin-top: 4px; font-variant-numeric: tabular-nums; text-shadow: 0 0 28px color-mix(in srgb, var(--rc) 45%, transparent); }
.rlab { font-size: 17px; font-weight: 600; color: var(--bright); }
.rdesc { font-size: 13.5px; color: var(--body); min-height: 20px; text-align: center; }
.rrange { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 14px 0 0; border-radius: 12px; background: linear-gradient(90deg, #26C6BA 0%, #397FE8 25%, #8056D9 50%, #C34DAE 75%, #E74C3C 100%); cursor: pointer; }
.rrange:focus-visible { outline: 2px solid var(--bright); outline-offset: 3px; }
.rrange::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 34px; height: 34px; border-radius: 50%; background: var(--rc); border: 4px solid #05080C; box-shadow: 0 0 0 2px var(--rc), 0 0 16px var(--rc); }
.rrange::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--rc); border: 4px solid #05080C; box-shadow: 0 0 0 2px var(--rc), 0 0 16px var(--rc); }
.rrange::-moz-range-track { background: none; }
.rticks { width: 100%; display: flex; justify-content: space-between; padding: 6px 12px 0; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.rticks span { width: 20px; text-align: center; margin-inline: -10px; }
.rside { display: flex; flex-direction: column; gap: 8px; }
.rb { flex: 1; min-height: 52px; border-radius: 14px; border: 1px solid var(--border); background: var(--raise); color: var(--bright); font-size: 24px; line-height: 1; }
.rb:disabled { color: #3D5166; }
.rb.go { background: var(--teal); border-color: var(--teal); color: #03110F; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .rpn { animation: none; } }
.bfig svg { height: 200px; }
.sets .num::placeholder { font-size: 12px; letter-spacing: -.02em; }
.num::-webkit-inner-spin-button, .num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input.num[type=number] { -moz-appearance: textfield; appearance: textfield; padding: 0 2px; }
.sets { grid-template-columns: 34px minmax(0,1.25fr) minmax(0,1fr) minmax(0,1.05fr) minmax(0,.85fr) 40px; }
/* v12: rest timer switch */
.rtoggle { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; }
.rtoggle .rtx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rtoggle .rtx b { font-size: 14px; font-weight: 600; color: var(--bright); }
.rtoggle .rtx span { font-size: 12.5px; color: var(--dim); }
.rtoggle .swt { order: 2; width: 24px; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.rtoggle.on .swt { color: var(--teal); }
.rtoggle .sw { order: 3; position: relative; flex-shrink: 0; width: 44px; height: 26px; border-radius: 13px; background: var(--raise); border: 1px solid var(--border); transition: background .15s ease; }
.rtoggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #5E758C; transition: transform .15s ease; }
.rtoggle.on .sw { background: rgba(38,198,186,.22); border-color: var(--teal); }
.rtoggle.on .sw::after { transform: translateX(18px); background: var(--teal); }
.rtoggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .rtoggle .sw, .rtoggle .sw::after { transition: none; } }
/* v13: coach mode, athlete picker, assignment */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.seg button { background: none; border: 0; border-radius: 9px; padding: 9px 0; font-size: 14px; font-weight: 600; color: var(--body); }
.seg button.on { background: var(--tint); color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.aths { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.ath { flex-shrink: 0; display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px 8px 8px; text-align: left; }
.ath.on { border-color: var(--teal); background: var(--tint); }
.ath .av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--raise); border: 1px solid var(--border); font-family: var(--mono); font-size: 12px; color: var(--text); }
.ath.on .av { border-color: var(--teal); color: var(--teal); }
.ath .atx { display: flex; flex-direction: column; white-space: nowrap; }
.ath .atx b { font-size: 13.5px; font-weight: 600; color: var(--bright); }
.ath .atx span { font-size: 12px; color: var(--dim); }
.ath.add { padding: 8px 14px; color: var(--body); font-size: 13.5px; border-style: dashed; }
.ath.add:disabled { opacity: .5; }
.addath { display: flex; gap: 8px; align-items: center; }
.addath .tin { flex: 1; min-width: 0; }
.rt.asg { opacity: .78; }
.rt.asg.on { opacity: 1; }
.rt.asg:not(.on)::before { background: #2A3B4D; }
.asw { display: flex; align-items: center; gap: 8px; flex-shrink: 0; cursor: pointer; }
.asw .swt { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.asw .sw { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--raise); border: 1px solid var(--border); }
.asw .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #5E758C; transition: transform .15s ease; }
.rt.asg.on .asw .swt { color: var(--teal); }
.rt.asg.on .asw .sw { background: rgba(38,198,186,.22); border-color: var(--teal); }
.rt.asg.on .asw .sw::after { transform: translateX(16px); background: var(--teal); }
.rtmain:focus-visible, .ath:focus-visible, .seg button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (max-width: 420px) { .asw .swt { display: none; } }
@media (prefers-reduced-motion: reduce) { .asw .sw::after { transition: none; } }
.sechead .btn { white-space: nowrap; flex-shrink: 0; }
/* v15: roster for many athletes, programs, week grid, anatomy models */
.ctabs { display: flex; gap: 6px; border-bottom: 1px solid var(--hairline); }
.ctab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 10px 9px; font-size: 14px; font-weight: 600; color: var(--body); display: flex; align-items: center; gap: 7px; margin-bottom: -1px; }
.ctab.on { color: var(--teal); border-bottom-color: var(--teal); }
.ctab .ct { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--dim); background: var(--raise); border-radius: 999px; padding: 1px 7px; }
.search { padding-left: 12px; }
.roster { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; background: rgba(11,17,24,.85); max-height: min(62vh, 560px); overflow-y: auto; }
.roster.short { max-height: 260px; }
.arow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--hairline); padding: 9px 12px; }
.arow:last-child { border-bottom: 0; }
.arow:hover { background: rgba(18,28,39,.6); }
.arow.on { background: var(--tint); }
.arow:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.arow .av { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--raise); border: 1px solid var(--border); font-family: var(--mono); font-size: 12px; color: var(--text); }
.arow.on .av { border-color: var(--teal); color: var(--teal); }
.arow .atx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.arow .atx b { font-size: 14px; font-weight: 600; color: var(--bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arow .atx span { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arow .atx span.warn { color: var(--amber); }
.arow .chev { color: var(--dim); }
.arow .box { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--teal-ink); }
.arow.chk2.on .box { background: var(--teal); border-color: var(--teal); }
.adet { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: rgba(7,11,17,.9); border-bottom: 1px solid var(--hairline); }
.agrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.afield { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.afield:first-child { grid-column: 1 / -1; }
.afield span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.afield .sel { width: 100%; }
.afield.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.afield.row .sel { width: auto; }
.addath .sel { flex-shrink: 0; }
.viewas { display: flex; align-items: center; gap: 10px; }
.viewas span { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.viewas .sel { flex: 1; min-width: 0; }
.pcard { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.ptx { display: flex; flex-direction: column; min-width: 0; }
.ptx .lab { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ptx b { font-size: 16px; font-weight: 600; color: var(--bright); }
.wstep { display: flex; align-items: center; gap: 8px; }
.wstep .wl { display: flex; flex-direction: column; align-items: center; min-width: 96px; }
.wstep .wl b { font-size: 14.5px; font-weight: 600; color: var(--bright); font-variant-numeric: tabular-nums; }
.wstep .wl span { font-size: 12px; color: var(--teal); }
.wstep .ic:disabled { opacity: .35; }
.wgridwrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: rgba(11,17,24,.85); }
.wgrid { border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 100%; }
.wgrid th, .wgrid td { padding: 5px 4px; border-bottom: 1px solid var(--hairline); text-align: center; white-space: nowrap; }
.wgrid tr:last-child th, .wgrid tr:last-child td { border-bottom: 0; }
.wgrid tr:first-child th { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 8px 6px; }
.wgrid th.wx { position: sticky; left: 0; z-index: 1; background: #0B1118; text-align: left; font-weight: 500; color: var(--text); white-space: normal; min-width: 118px; max-width: 150px; padding-left: 12px; border-right: 1px solid var(--hairline); }
.wc { display: inline-block; min-width: 84px; padding: 7px 6px; border-radius: 8px; border: 1px solid transparent; background: none; font-family: var(--mono); font-size: 12px; color: var(--dim); }
button.wc { border-color: var(--border); background: var(--panel); }
button.wc:hover { border-color: #2A4059; }
.wc.base { color: var(--text); }
.wc.own { color: var(--teal); border-color: var(--teal); background: var(--tint); }
.wlegend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wlegend i { width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--panel); margin-left: 6px; }
.wlegend i.own { border-color: var(--teal); background: var(--tint); margin-left: 0; }
.rpn.cell .rmain { align-items: stretch; }
.cgrid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.cf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cf span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.cf .wstep { gap: 4px; } .cf .wstep .wl { min-width: 24px; } .cf .wstep .ic { min-width: 32px; height: 38px; padding: 0; }
.cf .sel { width: 100%; height: 38px; }
.rpn.cell .rdesc { margin-top: 10px; text-align: left; font-size: 12.5px; color: var(--dim); }
@media (max-width: 420px) { .cgrid { grid-template-columns: 1fr 1fr; } .cf:last-child { grid-column: 1 / -1; } }
.bfig svg { height: 230px; }
.bsil { fill: #0F1721; stroke: #223345; stroke-width: 1.2; }
.bhead { fill: #131C27; stroke: #2A3D51; stroke-width: 1.3; }
.bbone { fill: #18222E; stroke: #223141; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.bm { fill: #1B2836; stroke: #34485D; stroke-width: 1; stroke-linejoin: round; }
.bm.on { fill: var(--mc); stroke: #05080C; }
.bfig svg { height: 290px; }
.body { gap: 18px; }
/* v16: saved workouts drawer rows */
.prow.sv { padding: 9px 6px 9px 12px; border-bottom: 1px solid var(--hairline); border-radius: 0; }
.plus.on { background: var(--tint); color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
/* v17: rendered anatomy with tinted muscle regions */
.body { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 2px; }
.anat { position: relative; width: min(100%, 360px); }
.anat img, .anat svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.anat svg { mix-blend-mode: color; }
.alab { width: min(100%, 360px); display: grid; grid-template-columns: 1fr 1fr; text-align: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.sumpanel { max-height: 70vh; }
/* v19: exercise video link and how-to popup */
.exlinks { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 2px; }
.exlink { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--teal); background: var(--tint); color: var(--teal); font-size: 13px; font-weight: 600; text-decoration: none; }
.exlink:hover { background: var(--tint-hi); color: var(--bright); }
a.exlink:focus-visible, a.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.infobtn { align-self: flex-start; background: none; border: 1px dashed var(--border); border-radius: 9px; padding: 7px 11px; font-size: 12.5px; color: var(--body); text-align: left; }
.infobtn.on { border-style: solid; border-color: rgba(38,198,186,.5); color: var(--teal); }
.infobtn:disabled { opacity: .5; }
.rpn.how { grid-template-columns: minmax(0,1fr); max-height: 82vh; }
.rpn.how .rmain { align-items: stretch; gap: 8px; overflow-y: auto; }
.howtx { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; color: var(--text); margin-top: 4px; }
.hownote { font-size: 13px; color: var(--body); }
.hownote b { color: var(--dim); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; margin-right: 4px; }
a.btn { text-decoration: none; text-align: center; display: block; }
/* v20: one teal-to-red scale for muscle volume */
.heatkey { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.heatkey i { display: block; width: 110px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgb(38,198,186), rgb(57,127,232), rgb(128,86,217), rgb(195,77,174), rgb(231,76,60)); }
/* v21: coach portal (wide screens), overview dashboard, invite link, inline video, sign-in */
.dgrid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.dcard { display: flex; flex-direction: column; gap: 10px; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.dcard:hover { border-color: #2A4059; }
.dcard .dl { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.dcard .dr { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dcard .dr b { font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--bright); line-height: 1; }
.davs { display: flex; align-items: center; }
.davs .av, .drow .av { width: 30px; height: 30px; font-size: 10.5px; box-shadow: none; border: 1px solid var(--border); --mc: var(--border); }
.davs .av + .av { margin-left: -8px; }
.davs .more { margin-left: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.dcols { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 12px; align-items: start; }
.dpanel { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.drow { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: none; border: 0; border-top: 1px solid var(--hairline); padding: 10px 0 0; width: 100%; }
.dpanel h2 + .drow { border-top: 0; padding-top: 2px; }
.drow .av { flex-shrink: 0; width: 36px; height: 36px; }
.drow .dtx { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--body); min-width: 0; }
.drow .dtx b { color: var(--bright); font-weight: 600; }
.drow .dtx b.wk { color: var(--teal); }
.drow .dd { font-size: 12px; color: var(--dim); }
.dbars { display: grid; grid-template-columns: repeat(10, minmax(0,1fr)); gap: 6px; align-items: end; height: 190px; }
.dbar { display: grid; grid-template-rows: 16px minmax(0,1fr) 16px; gap: 4px; height: 100%; text-align: center; min-width: 0; }
.dbar b { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--text); }
.dbar .t { display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--border); }
.dbar .t i { display: block; width: 70%; max-width: 30px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--teal); }
.dbar .t i.z { background: var(--raise); }
.dbar span { font-family: var(--mono); font-size: 10px; color: var(--dim); white-space: nowrap; overflow: visible; }
.invite { display: flex; gap: 8px; align-items: center; }
.invite .tin { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; }
.howvid { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--border); }
.howvid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.plus.edit { background: var(--raise); color: var(--text); box-shadow: none; font-size: 15px; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--dim); border-top: 1px solid var(--hairline); padding-top: 14px; }
.foot .linkbtn { align-self: auto; }
.gate { max-width: 420px; margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 16px; }
.gate .form { gap: 10px; }
.gate .btn { width: 100%; }
.gate p { margin: 0; color: var(--body); font-size: 14px; }
@media (max-width: 760px) { .dgrid { grid-template-columns: 1fr; } .dcols { grid-template-columns: 1fr; } }
@media (min-width: 1000px) {
  .app.mid { max-width: 760px; }
  .app.wide { max-width: none; margin: 0 0 0 248px; padding: 28px 40px 132px; }
  .app.wide > * { max-width: 1080px; }
  .app.wide .seg { max-width: 320px; }
  .app.wide .ctabs { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; max-width: none; flex-direction: column; gap: 4px; border-bottom: 0; border-right: 1px solid var(--border); background: #070B11; padding: 74px 12px 20px; z-index: 6; }
  .app.wide .ctabs::before { content: "UNLOCK TRAIN"; position: absolute; top: 26px; left: 22px; font-family: var(--display); font-size: 14px; letter-spacing: .1em; color: var(--bright); }
  .app.wide .ctabs::after { content: ""; position: absolute; top: 54px; left: 22px; width: 56px; height: 3px; border-radius: 2px; background: var(--spectrum); }
  .app.wide .ctab { justify-content: space-between; border-bottom: 0; border-radius: 10px; padding: 10px 12px; margin: 0; }
  .app.wide .ctab.on { background: var(--tint); border-bottom-color: transparent; }
  .app.wide .roster { max-height: none; }
  .app.wide .list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .app.wide .rest { left: 248px; }
}
.ctabs { overflow-x: auto; scrollbar-width: none; }
.ctabs::-webkit-scrollbar { display: none; }
.ctab { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 480px) { .ctab { padding: 8px 8px 9px; font-size: 13.5px; } }
/* v22: portal branding (one brand mark in the sidebar, a plain page title), exercise library page */
.sbrand, .pgtitle { display: none; }
.xbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.xbar .search { flex: 1 1 220px; min-width: 0; width: auto; }
.xbar .sel { flex: 0 1 auto; }
.xlib { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; align-items: start; }
.xtabwrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: rgba(11,17,24,.85); }
.xtab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.xtab th { text-align: left; padding: 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #0B1118; z-index: 1; }
.xth { width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.xth.on { color: var(--teal); }
.xtab td { padding: 8px 12px; border-bottom: 1px solid var(--hairline); color: var(--body); vertical-align: middle; }
.xtab tr:last-child td { border-bottom: 0; }
.xtab tr { cursor: pointer; }
.xtab tr:hover td { background: rgba(18,28,39,.6); }
.xtab tr.on td { background: var(--tint); }
.xname { background: none; border: 0; padding: 0; text-align: left; font-weight: 600; color: var(--bright); font-size: 14px; }
.xtab .badge { margin-left: 8px; }
.mchip { --mc: var(--teal); display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.mchip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mc); }
.xtab .c-cr { font-size: 12.5px; }
.xtab .c-vid, .xtab .c-how, .xtab .c-used { text-align: center; font-family: var(--mono); color: #4A6078; }
.xtab .c-vid.yes, .xtab .c-how.yes { color: var(--teal); }
.xtab .c-used { color: var(--text); }
.xtab th.c-vid .xth, .xtab th.c-how .xth, .xtab th.c-used .xth { text-align: center; }
.xside { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; min-width: 0; }
.xhd { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.xhd h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--bright); }
.xcr { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 10px; }
.xcf { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--dim); }
.xcf.on { color: var(--bright); }
.xcf .sel { height: 32px; width: 76px; flex-shrink: 0; }
.xmap .body { padding: 0; }
.xmap .anat, .xmap .alab { width: min(100%, 250px); }
.xtwo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xtwo .afield:first-child { grid-column: auto; }
.xsaved { font-size: 13px; color: var(--green); min-height: 18px; }
@media (max-width: 999px) { .xlib.open .xside { order: -1; } .xtab .c-cr, .xtab .c-eq, .xtab .c-used { display: none; } }
@media (min-width: 1000px) {
  .app.wide .top { display: none; }
  .app.wide .ctabs { padding-top: 22px; }
  .app.wide .ctabs::before, .app.wide .ctabs::after { content: none; }
  .sbrand { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 18px; }
  .sbrand i { width: 44px; height: 3px; border-radius: 2px; background: var(--spectrum); }
  .sbrand b { font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: .08em; color: var(--bright); line-height: 1.2; }
  .sbrand span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
  .app.wide .pgtitle { display: block; font-size: 24px; font-weight: 600; color: var(--bright); letter-spacing: .01em; }
  .app.wide .seg { position: fixed; left: 12px; bottom: 16px; width: 224px; max-width: none; z-index: 7; }
  .app.wide .ctabs { padding-bottom: 76px; }
  .app.wide > .xlib, .app.wide > .xbar { max-width: 1500px; }
  .xlib.open { grid-template-columns: minmax(0,1fr) 380px; }
  .xlib.open .xtab .c-cr, .xlib.open .xtab .c-eq { display: none; }
  .xside { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
  .xtabwrap { max-height: calc(100vh - 210px); overflow-y: auto; }
}
.xside > * { flex-shrink: 0; }
/* v23: conditioning intervals */
.esets.car { grid-template-columns: 36px minmax(0,1fr) minmax(0,1fr) minmax(0,1.7fr) 38px; }
.esets.car .ctg { text-align: left; padding: 0 8px; font-family: var(--sans); font-size: 13px; }
.sets.car { grid-template-columns: 34px minmax(0,1.5fr) minmax(0,1fr) minmax(0,.9fr) minmax(0,.75fr) 40px; }
.sets.car .prev { white-space: normal; line-height: 1.25; font-size: 11.5px; }

.sets.car { align-items: center; }
.sets.car .sn { align-self: center; }
.sets.car .sn { display: flex; align-items: center; justify-content: center; }

/* v24: watts */
.esets.car { grid-template-columns: 34px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.5fr) 38px; }
.sets.car { grid-template-columns: 34px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,.8fr) 40px; }
.sets.car .ctarget { grid-column: 1 / -1; font-size: 11.5px; color: var(--dim); margin: -2px 0 4px 2px; }

/* v25: drag to reorder, supersets */
.ic.grip { touch-action: none; cursor: grab; font-size: 18px; line-height: 1; color: var(--dim); }
.ic.grip:active { cursor: grabbing; }
.dragging { position: relative; z-index: 30; opacity: .92; box-shadow: 0 14px 34px rgba(0,0,0,.6); border-color: var(--teal) !important; transition: none !important; }
.dropb { box-shadow: 0 -3px 0 0 var(--teal); }
.dropa { box-shadow: 0 3px 0 0 var(--teal); }
.sslink { display: block; width: 100%; margin: -4px 0 8px; padding: 6px 10px; background: transparent; border: 1px dashed var(--border); border-radius: 10px; font-size: 12.5px; color: var(--dim); text-align: center; }
.sslink:hover { color: var(--text); border-color: var(--dim); }
.sslink.on { border-style: solid; border-color: rgba(38,198,186,.55); color: var(--teal); background: rgba(38,198,186,.07); margin: -10px 0 2px; border-radius: 0 0 10px 10px; }
.ex.edit.ss { border-color: rgba(38,198,186,.4); }
.ssgroup { border-left: 3px solid var(--teal); padding-left: 10px; margin: 0 0 14px; }
.ssgroup .ex:last-child { margin-bottom: 0; }
.sshead { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin: 2px 0 8px; }

/* v25: rules, copy week, week labels */
.rulebox { margin-top: 12px; }
.rulebox .fl:first-child { margin-top: 0; }
.rgrid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin: 8px 0; }
.rgrid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.rgrid .cf.wide { grid-column: 1 / -1; }
.rgrid .tin { height: 38px; }
@media (max-width: 560px) { .rgrid { grid-template-columns: 1fr 1fr; } .rgrid.c3 { grid-template-columns: 1fr 1fr; } .rgrid.c3 .cf:last-child { grid-column: 1 / -1; } }
.rulebox .btn { margin-top: 6px; }
.rulebox .muted { margin-top: 6px; }
.okmsg { margin-top: 8px; color: var(--green, #2EDC86); font-size: 13px; }
.wlab { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--teal); margin-right: 6px; }
.rpn.cell.car { max-width: 560px; }
.rpn.cell.car .esets { margin-top: 10px; }
.rt .ic.grip { flex: none; }

/* v25: compliance, pdf */
.dpanel.comp { margin: 12px 0; gap: 0; }
.comphd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cflag { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.cflag.on { color: #FFB3AA; border-color: rgba(231,76,60,.5); background: rgba(231,76,60,.1); }
.crow { display: grid; grid-template-columns: 36px minmax(0,1.6fr) 92px 96px 84px; gap: 12px; align-items: center; text-align: left; background: none; border: 0; border-top: 1px solid var(--hairline); padding: 9px 0; width: 100%; color: var(--body); }
.crow:hover .ctx b { color: var(--teal); }
.crow .av { width: 34px; height: 34px; font-size: 10.5px; box-shadow: none; border: 1px solid var(--border); --mc: var(--border); }
.crow.flag .av { border-color: rgba(231,76,60,.6); }
.ctx { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; color: var(--dim); }
.ctx b { color: var(--bright); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccount { display: flex; flex-direction: column; gap: 5px; }
.ccount b { font-family: var(--mono); font-size: 13px; color: var(--text); font-weight: 500; }
.ccount > i { display: block; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.ccount > i > i { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.clast { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--dim); }
.clast b { font-size: 13px; color: var(--text); font-weight: 500; }
.cbadge { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #FFB3AA; text-align: right; }
.dpanel.comp .muted { margin-top: 8px; }
@media (max-width: 640px) { .crow { grid-template-columns: 34px minmax(0,1fr) 64px; row-gap: 2px; } .crow .clast { grid-column: 2; flex-direction: row; gap: 6px; align-items: baseline; } .crow .cbadge { grid-column: 3; } .crow .cbadge:empty { display: none; } }
.pdfwrap { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.pdfwrap .linkbtn { align-self: flex-start; }
.pdfst { font-size: 12.5px; color: var(--dim); }
.pdfst:empty { display: none; }
@media (max-width: 520px) { .rt .rtedit[aria-label^="Edit "] { display: none; } }
.rpn.cell.car { grid-template-columns: minmax(0,1fr); max-height: 86vh; overflow-y: auto; }
.rpn.cell.car .rside { display: block; }
.rpn.cell.car .rside .rb { width: 100%; height: 50px; min-height: 0; }
.rpn.cell.car .esets.car { grid-template-columns: 30px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.3fr) 34px; gap: 5px; }
.rpn.cell.car .num { font-size: 13.5px; padding: 0 3px; min-width: 0; }
.rpn.cell.car .sn { height: 38px; }

/* v26: how-to bullets, superset rest switch */
.howtx { white-space: normal; }
.howul { margin: 4px 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.howul li { line-height: 1.45; }
.howul li::marker { color: var(--teal); }
.howh { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 10px 0 2px; }
.howp { margin: 4px 0; }
.ssrow { display: flex; gap: 0; margin: -10px 0 2px; }
.ssrow .sslink.on { margin: 0; flex: 1; border-radius: 0 0 0 10px; }
.ssrow .sslink.ssrest { flex: 0 0 auto; border-left: 0; border-radius: 0 0 10px 0; white-space: nowrap; }
@media (max-width: 480px) { .ssrow { flex-direction: column; } .ssrow .sslink.on { border-radius: 0; } .ssrow .sslink.ssrest { border-left: 1px solid rgba(38,198,186,.55); border-top: 0; border-radius: 0 0 10px 10px; } }

/* v27: one coach home, roster rows link to each athlete's performance dashboard */
.arowwrap { display: flex; align-items: center; gap: 0; }
.arowwrap > .arow { flex: 1; min-width: 0; }
.adash { flex: none; margin: 0 12px 0 4px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: var(--teal); text-decoration: none; white-space: nowrap; background: var(--raise); }
.adash:hover { border-color: var(--teal); }
.afield.wide { grid-column: 1 / -1; }
.afield .tin { width: 100%; }
.arowwrap { border-bottom: 1px solid var(--hairline); }
.arowwrap > .arow { border-bottom: 0; }
.arowwrap.on { background: var(--tint); }
