/* NODAL Lift - on top of Nodal Lab's app.css (same look: Linear wireframe panels, Anduril type).
   Compare colours validated with the dataviz palette checker in both themes. */
:root { --cmp-a: #f05252; --cmp-b: #3d8bfd; --com: #ff4d4d; }   /* A red, B blue; the centre of mass red */
[data-theme="light"] { --cmp-a: #d42f2f; --cmp-b: #1e6fe0; --com: #d42020; }
.page { --cmp-a: #d42f2f; --cmp-b: #1e6fe0; }

/* sidebar: lifts with their sets */
.side .lift { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--ink); padding: 14px 18px 4px; text-transform: none; letter-spacing: -0.01em; display: flex; justify-content: space-between; align-items: baseline; }
.side .lift .lab { font-size: 10px; }
.side .mv { padding: 6px 18px 6px 26px; font-size: 13.5px; }
.side .mv .pct { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-left: 4px; }
.side .cmpnav { margin: 10px 12px 4px; width: calc(100% - 24px); display: flex; align-items: center; gap: 10px; border: 1px solid var(--sep-2); background: none; padding: 9px 12px; cursor: pointer; font-size: 14px; color: var(--ink); }
.side .cmpnav:hover, .side .cmpnav[aria-current="true"] { background: var(--fill-2); border-color: var(--ink-3); }
.side .cmpnav .ab { display: inline-flex; gap: 3px; }
.side .cmpnav .ab i { width: 8px; height: 8px; display: block; }
.side .cmpnav .ab i:first-child { background: var(--cmp-a); border-radius: 50%; } .side .cmpnav .ab i:last-child { background: var(--cmp-b); }
.crumb #crumbSet { white-space: nowrap; }

/* home */
.mcard .sets { border-top: 1px solid var(--sep); margin-top: 10px; }
.mcard .setrow { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--sep); cursor: pointer; }
.mcard .setrow:last-child { border-bottom: 0; }
.mcard .setrow:hover { color: var(--ink); }
.mcard .setrow .v { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.mcard .fig { height: 220px; }

/* overview additions */
.hud .hudrow { display: flex; gap: 22px; justify-content: flex-end; margin-top: 10px; }
.hud .hudn { font-size: 22px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pathinset { width: 230px; height: 260px; }

/* bar path view */
.bp { max-width: 1560px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr); gap: 14px; align-items: start; }
.bp-plot { height: calc(100vh - 56px - 48px); min-height: 560px; }
.bp-plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.bp-tools { position: absolute; left: 16px; top: 12px; z-index: 3; display: flex; gap: 16px; }
.bp-tools .check { margin: 0; font-size: 13px; }
.bp-side { display: flex; flex-direction: column; gap: 12px; }
.bp-fig { height: 300px; overflow: hidden; background-image: linear-gradient(var(--sep) 1px, transparent 1px), linear-gradient(90deg, var(--sep) 1px, transparent 1px); background-size: 34px 34px; }
.bp-fig canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.bp-type { padding: 16px 18px; }
.bp-type h3 { font-size: 20px; margin: 8px 0 4px; }
.bp-type p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.pcard { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 13px 16px; border: 1px solid var(--sep); background: var(--card); margin-bottom: 8px; cursor: pointer; transition: background .2s; position: relative; }
.pcard:hover { background: var(--fill-2); }
.pcard .nm { font-size: 15px; font-weight: 500; }
.pcard .v { font-family: var(--mono); font-size: 14px; text-align: right; }
.pcard canvas { grid-column: 1 / -1; width: 100%; height: 22px; }

/* speed view */
.sp { max-width: 1560px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; }
.sp .card-head h3 { font-size: 17px; }
.sp-main { grid-column: 1 / -1; height: 400px; }
.sp-height { height: 330px; }
.sp-main canvas, .sp-height canvas, .sp-lv canvas { position: absolute; left: 0; right: 0; bottom: 0; top: 46px; width: 100%; height: calc(100% - 46px); }
.sp-lv { height: 330px; }
.sp-lv canvas { height: calc(100% - 46px - 54px); top: 46px; }
.sp-lv .lvp { position: absolute; left: 20px; right: 20px; bottom: 10px; margin: 0; }
.sp-stages { grid-column: 1 / -1; overflow: auto; }
.stages td.nm { text-align: left; font-weight: 500; }
.stages td .bar { display: inline-block; height: 6px; background: var(--accent); vertical-align: middle; margin-right: 8px; }
.stages td .ref { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; margin-left: 6px; }

/* compare */
.cmp { max-width: 1640px; margin: 0 auto; padding: 18px 24px 60px; }
.cmp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pick { display: flex; align-items: center; gap: 10px; border: 1px solid var(--sep-2); padding: 0 0 0 12px; background: var(--card); }
.pick .who { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; }
.pick .who i { width: 10px; height: 10px; display: block; }
.pick.a .who i { background: var(--cmp-a); border-radius: 50%; } .pick.b .who i { background: var(--cmp-b); }
.pick.a { box-shadow: inset 2px 0 0 var(--cmp-a); } .pick.b { box-shadow: inset 2px 0 0 var(--cmp-b); }
.pick select { font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--card); border: 0; border-left: 1px solid var(--sep); height: 36px; padding: 0 10px; min-width: 300px; cursor: pointer; }
.cmp-presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.cmp-presets button { border: 1px solid var(--sep-2); background: none; font-size: 13px; padding: 6px 11px; cursor: pointer; color: var(--ink-2); }
.cmp-presets button:hover { color: var(--ink); border-color: var(--ink-3); }
.cmp-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.cmp-figs { grid-row: span 2; display: grid; grid-template-columns: 1fr 1fr; min-height: 560px; overflow: hidden;
  background-image: linear-gradient(var(--sep) 1px, transparent 1px), linear-gradient(90deg, var(--sep) 1px, transparent 1px); background-size: 40px 40px; }
.cmp-fig { position: relative; border-right: 1px solid var(--sep); }
.cmp-fig:nth-child(2) { border-right: 0; }
.cmp-fig canvas { position: absolute; inset: 0 0 58px 0; width: 100%; height: calc(100% - 58px); }
.figtag { position: absolute; left: 14px; top: 12px; z-index: 2; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.figtag i { width: 10px; height: 10px; display: block; }
.figtag.a i { background: var(--cmp-a); border-radius: 50%; } .figtag.b i { background: var(--cmp-b); }
.figlive { position: absolute; right: 14px; top: 12px; z-index: 2; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.figlive b { color: var(--ink); font-weight: 400; font-size: 18px; font-family: var(--sans); }
.cmp-figs .transport { grid-column: 1 / -1; }
.cmp-path, .cmp-speed { height: 300px; }
.cmp-path canvas, .cmp-speed canvas { position: absolute; left: 0; right: 0; bottom: 0; top: 46px; width: 100%; height: calc(100% - 46px); }
.cmp-sum { grid-column: 1 / -1; padding-bottom: 8px; }
.cmp-sum .diff { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--sep); font-size: 15.5px; position: relative; z-index: 2; }
.cmp-sum .diff .d { font-family: var(--mono); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.cmp-table { grid-column: 1 / -1; overflow: auto; }
.ctable td.nm, .ctable th.nm { text-align: left; }
.ctable td.nm small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.ctable tr.grp td { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); text-align: left; background: var(--fill-2); cursor: default; }
.ctable .va { color: var(--ink); } .ctable .delta { font-family: var(--mono); font-size: 13px; }
.ctable .better { color: var(--green); } .ctable .worse { color: var(--red); } .ctable .same { color: var(--ink-3); }
.ctable th .dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 1px; }
.ctable th .dot.a { background: var(--cmp-a); border-radius: 50%; } .ctable th .dot.b { background: var(--cmp-b); }

@media (max-width: 1200px) {
  .bp, .sp, .cmp-grid { grid-template-columns: minmax(0, 1fr); }
  .cmp-figs { grid-row: auto; }
}

/* recorded lifts */
.scorebox .ovnote { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); margin-top: 12px; border-left: 2px solid var(--sep-2); padding-left: 10px; }

/* ===================================================== measurement workspace (no judgements)
   collapsible nav and rails, an orbitable stage, the footage window */
.labroot { transition: grid-template-columns .3s cubic-bezier(.16,1,.3,1); }
.labroot.navc { grid-template-columns: 0 minmax(0, 1fr); }
.labroot.navc .side { overflow: hidden; border-right: 0; }
.crumb .navbtn { width: 30px; height: 30px; font-size: 14px; margin-right: 4px; }
.ovl { --lw: 300px; --rw: 340px; height: 100%; min-height: 620px; display: grid; grid-template-columns: var(--lw) minmax(0, 1fr) var(--rw);
  transition: grid-template-columns .3s cubic-bezier(.16,1,.3,1); }
.ovl.lc { --lw: 40px; } .ovl.rc { --rw: 40px; }
.ovl > .panel { border-top: 0; border-bottom: 0; }
.orail { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.orail.left { border-left: 0; } .orail.right { border-right: 0; }
.orail .ph { flex: none; }
.orail .fold { width: 26px; height: 26px; font-size: 15px; line-height: 1; }
.orail .obody { overflow-y: auto; flex: 1; min-height: 0; }
.orail .ofold { display: none; writing-mode: vertical-rl; padding: 14px 0; align-self: center; cursor: pointer; }
.ovl.lc .orail.left .ph, .ovl.lc .orail.left .obody, .ovl.rc .orail.right .ph, .ovl.rc .orail.right .obody { display: none; }
.ovl.lc .orail.left .ofold, .ovl.rc .orail.right .ofold { display: block; }
.ovl.lc .orail.left, .ovl.rc .orail.right { cursor: pointer; }
.ovl.lc .orail.left:hover, .ovl.rc .orail.right:hover { background: var(--fill-2); }

/* measurements: plain values, no status */
.mgroup { border-bottom: 1px solid var(--sep); padding: 14px 18px 10px; }
.mgroup h4 { margin: 0 0 8px; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.mhero { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 10px; }
.mhero .n { font-size: 44px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.mhero .u { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-transform: uppercase; }
.mhero .c { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: auto; text-transform: uppercase; }
.mrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: baseline; width: 100%; border: 0; background: none; text-align: left;
  padding: 6px 6px; margin: 0 -6px; cursor: pointer; font-size: 14px; color: var(--ink); transition: background .15s; }
.mrow:hover { background: var(--fill-2); }
.mrow .v { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mrow .v small { color: var(--ink-3); font-size: 11px; margin-left: 6px; }
.mrow .nm small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-top: 1px; }
.mrow[aria-current="true"] { background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* the stage: orbit */
#cvHero { cursor: grab; touch-action: none; }
#cvHero.dragging { cursor: grabbing; }
.stage .vignette { display: none; }
.orbit-hint { position: absolute; left: 18px; bottom: 70px; z-index: 3; pointer-events: none; font-size: 10.5px; }
.stage .hud { pointer-events: none; }

/* footage */
.footage { position: absolute; left: 16px; top: 16px; z-index: 4; width: 320px; background: #000; border: 1px solid var(--sep-2);
  transition: width .3s cubic-bezier(.16,1,.3,1); }
.footage.big { width: min(640px, 55%); }
.footage video, .footage img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.footage .fcap { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; background: color-mix(in srgb, var(--card) 92%, transparent); border-top: 1px solid var(--sep); }
.footage .fcap .iconbtn { width: 24px; height: 24px; font-size: 12px; }

/* right rail: the bar at a glance */
.minicard { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--sep); background: none; padding: 12px 14px 8px; text-align: left; cursor: pointer; transition: background .2s; }
.minicard:hover { background: var(--fill-2); }
.minicard canvas { display: block; width: 100%; margin-top: 6px; }
#cvMiniPath { height: 360px; } #cvMiniSpeed { height: 200px; }

/* compare: neutral differences */
.ctable .delta { color: var(--ink-2); }
.cmp-fig canvas { cursor: grab; touch-action: none; }
.cmp-figs .transport .seg { margin-left: auto; }
.obody .ovnote { font-size: 12px; line-height: 1.45; color: var(--ink-3); margin: 14px 18px 18px; border-left: 2px solid var(--sep-2); padding-left: 10px; }
.ic.neutral { background: var(--fill); color: var(--ink-2); }
.sq.rec { background: var(--accent); } .side .mv .sq:not(.rec) { background: var(--ink-3); }
.mcard .setrow.head { cursor: default; padding-top: 8px; }

/* ---------------------------------------------------------------- sessions in the list */
.side .opensess { margin-top: 4px; }
.side .opensess .plus { width: 19px; text-align: center; font-family: var(--mono); color: var(--accent); }
.side .sesshd { gap: 6px; align-items: center; }
.side .sesshd .sessname { flex: 1; min-width: 0; border: 0; background: none; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .sesshd .car { display: inline-block; font-style: normal; width: 14px; color: var(--ink-3); transition: transform .15s; }
.side .sess.shut .car { transform: rotate(-90deg); }
.side .sess.shut .sessbody { display: none; }
.side .sessx { width: 20px; height: 20px; font-size: 14px; line-height: 1; color: var(--ink-3); }
.side .trialhd { display: flex; gap: 8px; align-items: baseline; padding: 8px 18px 2px 26px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.side .trialhd span:first-child { flex: 1; }
.side .trialhd .rough, .mgroup .rough { color: var(--warn, #c98a2b); }
.side .trialhd .rough { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
.side .mv.rep { padding-left: 34px; }
.side .mv .rn { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-right: 7px; }
.side .mv .unsure { font-family: var(--mono); font-size: 10px; color: var(--warn, #c98a2b); margin-left: 5px; }
.side .mv.off { cursor: default; color: var(--ink-3); }
.side .mv.off:hover { background: none; color: var(--ink-3); }
.side .mv.off .why { font-size: 12px; line-height: 1.35; }
.side .demohd { border-top: 1px solid var(--sep); margin-top: 14px; }
.setrow.more { cursor: default; }

/* ---------------------------------------------------------------- the movement card */
.mgroup.movement .mvhead { display: flex; align-items: baseline; gap: 10px; padding: 2px 0 2px; }
.mgroup.movement .mvhead b { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.mgroup.movement .conf { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: auto; }
.mgroup.movement .conf.low { color: var(--warn, #c98a2b); }
.mgroup.movement .mvtags { font-size: 12.5px; color: var(--ink-2); }
.mgroup.movement details.why { margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.mgroup.movement details.why summary { cursor: pointer; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.mgroup.movement details.why ul { margin: 6px 0 0; padding-left: 16px; line-height: 1.45; }
.mgroup.movement details.why p { margin: 6px 0 0; }
.mgroup.movement p.rough { font-size: 12px; margin: 8px 0 0; }
.mgroup.movement .replab { margin-top: 10px; font-size: 10px; }
.mgroup.movement .repnav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.mgroup.movement .repbtn { min-width: 28px; height: 26px; border: 1px solid var(--sep-2); background: none; color: var(--ink-2); font-family: var(--mono); font-size: 12px; cursor: pointer; }
.mgroup.movement .repbtn:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); }
.mgroup.movement .repbtn.on { background: var(--ink); color: var(--card); border-color: var(--ink); cursor: default; }
.mgroup.movement .repbtn.off { opacity: .4; cursor: not-allowed; }

/* ---------------------------------------------------------------- trials fold in the list */
.side .trialhd { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; display: flex; gap: 6px; align-items: baseline; padding: 6px 18px 6px 22px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.side .trialhd:hover { background: var(--fill-2); color: var(--ink); }
.side .trialhd .car { font-style: normal; width: 12px; flex: none; color: var(--ink-3); transition: transform .15s; }
.side .trial.open > .trialhd .car { transform: rotate(90deg); }
.side .trialhd .tn { flex: none; }
.side .trialhd .tsum { flex: 1; min-width: 0; text-align: right; font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .trial.cur > .trialhd { color: var(--ink); }
.side .trial > .trialreps { display: none; padding-bottom: 4px; }
.side .trial.open > .trialreps { display: block; }

/* ---------------------------------------------------------------- the whole trial on the scrub bar */
.scrub.whole { height: 34px; }
.scrub.whole .track { top: 24px; }
.scrub.whole .head { top: 2px; height: 30px; }
.scrub.whole .bands i.ev { top: 18px; height: 12px; }
.scrub .repband { position: absolute; top: 2px; height: 30px; border: 0; padding: 0; margin: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); border-top: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); cursor: pointer; display: flex; align-items: flex-start; gap: 4px; overflow: hidden; text-align: left; }
.scrub .repband span { font-family: var(--mono); font-size: 10px; color: var(--ink-2); padding: 2px 0 0 4px; }
.scrub .repband em { font-style: normal; font-size: 10.5px; color: var(--ink-3); padding-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scrub .repband:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.scrub .repband.on { background: color-mix(in srgb, var(--accent) 26%, transparent); border-top-color: var(--accent); }
.scrub .repband.on span, .scrub .repband.on em { color: var(--ink); }
.scrub .repband.off { background: color-mix(in srgb, var(--ink-3) 10%, transparent); border-top-color: var(--sep-2); }
#modeSeg[hidden] { display: none; }
.stage .transport { flex-wrap: wrap; row-gap: 8px; }
.stage .transport .scrub { order: -1; flex: 1 0 100%; }
.stage .transport #viewSeg { margin-left: auto; }

/* ---------------------------------------------------------------- the folder browser */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal .mbox { width: min(860px, 100%); height: min(620px, 100%); background: var(--card); border: 1px solid var(--sep-2); display: grid; grid-template-rows: auto 1fr auto; box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.modal .mhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--sep); }
.modal .mhead h3 { margin: 0; font-size: 16px; font-weight: 500; }
.modal .mbody { display: grid; grid-template-columns: 150px 1fr; min-height: 0; }
.modal .places { border-right: 1px solid var(--sep); padding: 10px 0; overflow-y: auto; }
.modal .places button { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 7px 16px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.modal .places button:hover, .modal .places button.on { background: var(--fill-2); color: var(--ink); }
.modal .pane { display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.modal .pathbar { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--sep); }
.modal .pathbar input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--sep-2); color: var(--ink); font-family: var(--mono); font-size: 12px; padding: 6px 9px; }
.modal .dirs { overflow-y: auto; padding: 6px 0; }
.modal .dir { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 14px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.modal .dir:hover { background: var(--fill-2); color: var(--ink); }
.modal .dir .fi { color: var(--ink-3); font-size: 11px; text-align: center; }
.modal .dir.hit { color: var(--ink); }
.modal .dir.hit .fi { color: var(--accent); }
.modal .dir .dk { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.modal .btn.sm { padding: 3px 10px; font-size: 12px; }
.modal .mfoot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--sep); }
.modal .mfoot .lab { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12.5px; color: var(--ink-2); }
.modal.busy .mbody, .modal.busy .mfoot .btn { opacity: .45; pointer-events: none; }
.modal .btn:disabled { opacity: .4; cursor: not-allowed; }
.home .empty { padding: 26px 28px; margin: 18px 0 8px; max-width: 640px; }
.home .empty h3 { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.home .empty p { margin: 0 0 16px; line-height: 1.5; }

/* ---------------------------------------------------------------- picking sessions */
.modal .mbox { grid-template-rows: auto 1fr auto auto; }
.modal .dir { grid-template-columns: 18px 1fr auto; }
.modal .dir .pick { margin: 0; accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.modal .dir.sel { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
.modal .dir .dn small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.modal .dirhd { padding: 12px 14px 4px; font-size: 10px; }
.modal .prog { height: 3px; background: var(--sep); }
.modal .prog i { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); transition: width .3s; }

/* ---------------------------------------------------------------- Compare: overlay (both lifters on one platform) */
.cmp-figs.overlay .cmp-fig:first-child { grid-column: 1 / -1; border-right: 0; }
.cmp-figs.overlay .cmp-fig:nth-child(2) { display: none; }
.cmp-figs .ovtags { display: none; }
.cmp-figs .ovtags .figtag { position: static; }
.cmp-figs.overlay .ovtags { display: flex; flex-direction: column; gap: 6px; position: absolute; left: 14px; top: 12px; z-index: 2; }
.cmp-figs.overlay .cmp-fig:first-child > .figtag, .cmp-figs.overlay .cmp-fig:first-child > .figlive { display: none; }
.cmp-figs.overlay .ovlive { display: flex; }
.cmp-figs .ovlive { display: none; position: absolute; right: 14px; top: 12px; z-index: 2; gap: 22px; }
.cmp-figs .ovlive > div { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.cmp-figs .ovlive > div b { color: var(--ink); font-weight: 400; font-size: 18px; font-family: var(--sans); }
.cmp-figs .ovlive .a { border-top: 2px solid var(--cmp-a); padding-top: 4px; } .cmp-figs .ovlive .b { border-top: 2px solid var(--cmp-b); padding-top: 4px; }
.cmp-figs .transport { flex-wrap: wrap; row-gap: 8px; }
.cmp-figs .transport .scrub { order: -1; flex: 1 0 calc(100% - 90px); }
.cmp-figs .transport #cClock { order: -1; }
.cmp-fig canvas { inset: 0 0 100px 0; height: calc(100% - 100px); }
.seg button { white-space: nowrap; }

/* ---------------------------------------------------------------- smaller windows
   the panels scale a little with the window and fold automatically below 1440 / 1180 / 900 px (app.js applyLayout),
   so the 3-D view keeps room for its controls; the top bar never overlaps */
.labroot { grid-template-columns: clamp(200px, 17vw, 250px) minmax(0, 1fr); }
.labroot.navc { grid-template-columns: 0 minmax(0, 1fr); }
.ovl { --lw: clamp(240px, 21vw, 300px); --rw: clamp(260px, 22vw, 340px); min-height: 480px; }
.ovl.lc { --lw: 40px; } .ovl.rc { --rw: 40px; }
.mtop { grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; padding: 0 16px; }
.mtop .tabs { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.mtop .tabs::-webkit-scrollbar { display: none; }
.mtop .tabs button { white-space: nowrap; }
.mtop .actions .btn { white-space: nowrap; }
.crumb { overflow: hidden; }
#crumbSet { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 1280px) {
  .crumb > .lab:not(.dim), #crumbSet { display: none; }
  .mtop .tabs button { padding: 8px 10px; }
  .stage .transport { gap: 8px; padding: 10px 12px; }
  .stage .transport .seg button { padding: 6px 8px; }
}
@media (max-width: 1000px) {
  .crumb .lab.dim { display: none; }
  .mtop .actions .btn { padding-left: 10px; padding-right: 10px; }
}
.stage .transport { overflow-x: auto; scrollbar-width: thin; }
/* Compare: the lifters and their controls fit the window's height; names never run into the live read-outs */
.cmp-figs { min-height: 0; height: clamp(420px, calc(100vh - 210px), 760px); }
.figtag { max-width: calc(100% - 170px); }
.figtag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.figtag i { flex: none; }
@media (max-width: 1280px) { .figtag { font-size: 13px; } .figlive b { font-size: 15px; } }
/* the session browser always fits the window: header and Analyse button stay in view, only the folder list scrolls */
.modal { display: flex; padding: 16px; overflow: auto; }
.modal .mbox { margin: auto; width: min(860px, 100%); height: min(620px, calc(100vh - 32px)); height: min(620px, calc(100dvh - 32px));
  min-height: 300px; max-height: none; }
.modal .mbody, .modal .pane, .modal .dirs, .modal .places { min-height: 0; }
.modal .mfoot { flex-wrap: wrap; row-gap: 8px; }
.modal .mfoot .lab { flex: 1 1 220px; min-width: 0; }
.modal .mfoot .btn { white-space: nowrap; }
@media (max-width: 720px) {
  .modal .mbody { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .modal .places { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--sep); padding: 6px 8px; }
  .modal .places button { width: auto; white-space: nowrap; padding: 6px 10px; }
}

/* overview right rail: stage-timing donut and the squad norms */
.ovcard { padding: 12px 14px; border-bottom: 1px solid var(--sep); }
.ovcard .ovhd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#cvDonut { display: block; width: 100%; height: 240px; margin-top: 4px; }
.dleg { display: grid; gap: 1px; margin-top: 6px; }
.dlrow { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 86px; align-items: center; gap: 8px; width: 100%; border: 0; background: none;
  color: var(--ink); padding: 5px 4px; text-align: left; cursor: pointer; font: 13px var(--sans); border-radius: 0; }
.dlrow:hover, .dlrow[aria-current="true"] { background: var(--fill-2); }
.dlrow > i { width: 12px; height: 12px; display: block; }
.dlrow > i.tick { width: 2px; height: 14px; margin-left: 5px; background: var(--ink); }
.dlrow .nm { min-width: 0; }
.dlrow .v { font: 13px var(--mono); text-align: right; white-space: nowrap; }
/* traffic lights (colour + icon + word, as app.css's .status), compact for the rail */
.dlrow .status, .sqrow .status { font-size: 9.5px; padding: 1px 6px 1px 2px; gap: 5px; justify-self: end; }
.dlrow .status i, .sqrow .status i { width: 12px; height: 12px; font-size: 8px; }
.sqhead { font: 11px var(--mono); color: var(--ink-2); margin: 6px 0 4px; line-height: 1.5; text-transform: uppercase; letter-spacing: .04em; }
.sqnone code { font: 11px var(--mono); }
.sqrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 86px; grid-template-areas: "nm v st" "bar bar bar"; align-items: center; gap: 4px 8px; width: 100%;
  border: 0; background: none; color: var(--ink); padding: 6px 4px 7px; text-align: left; cursor: pointer; border-radius: 0; font: 12.5px var(--sans); }
.sqrow:hover, .sqrow[aria-current="true"] { background: var(--fill-2); }
.sqrow .nm { grid-area: nm; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sqrow .v { grid-area: v; font: 12.5px var(--mono); white-space: nowrap; }
.sqrow .v small { color: var(--ink-2); margin-left: 3px; font-size: 10px; }
.sqrow .status { grid-area: st; }
.sqbar { grid-area: bar; position: relative; height: 12px; display: block; }
.sqbar i { position: absolute; display: block; }
.sqbar .z { top: 4px; height: 4px; opacity: .55; }
.sqbar .z.green { background: var(--green); } .sqbar .z.yellow { background: var(--yellow); } .sqbar .z.red { background: var(--red); }
.sqbar .you { width: 10px; height: 10px; top: 1px; margin-left: -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card); }
.sqbar .you.green { background: var(--green); } .sqbar .you.yellow { background: var(--yellow); } .sqbar .you.red { background: var(--red); }
.mrow .v small.rel { color: var(--ink-2); margin-left: 6px; font-size: 10.5px; }
.check .comsw { display: inline-block; width: 14px; height: 3px; background: var(--com); vertical-align: middle; margin-right: 6px; border-radius: 1px; }
/* clean & jerk: the jerk under the clean in the menu, its band on the trial's timeline, the clean | jerk switch */
.side .mv.sub { padding-left: 22px; }
.side .mv.sub .rn { color: var(--ink-3); }
.scrub .repband.jerkband { top: 12px; height: 20px; background: color-mix(in srgb, var(--accent) 22%, transparent); border-top-style: dashed; }
.mgroup.movement .partsw { margin: 8px 0 2px; }

/* the left rail: key numbers, the velocity at the peak, takeaways */
.mgroup.keys .kload { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 10px; }
.mgroup.keys .kload .n { font: 300 34px var(--sans); letter-spacing: -.02em; }
.mgroup.keys .kload .u { font: 12px var(--mono); color: var(--ink-2); }
.mgroup.keys .kload .c { margin-left: auto; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.kgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--sep); border: 1px solid var(--sep); }
.kcell { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; border: 0; background: var(--card); color: var(--ink); padding: 9px 10px; cursor: pointer; border-left: 3px solid transparent; }
.kcell:hover, .kcell[aria-current="true"] { background: var(--fill-2); }
.kcell.green { border-left-color: var(--green); } .kcell.yellow { border-left-color: var(--yellow); } .kcell.red { border-left-color: var(--red); }
.kcell .lab { font-size: 9.5px; line-height: 1.3; }
.kcell .v { font: 300 22px var(--sans); letter-spacing: -.01em; }
.kcell .v small { font: 11px var(--mono); color: var(--ink-2); margin-left: 3px; }
.kcell .sub { font: 10.5px var(--mono); color: var(--ink-3); }
.vecard { display: block; width: 100%; margin-top: 10px; border: 1px solid var(--sep); background: none; color: var(--ink); padding: 8px 10px; text-align: left; cursor: pointer; }
.vecard:hover { background: var(--fill-2); }
.vecsvg { display: block; width: 100%; height: auto; margin: 4px 0; }
.vecsvg .vax { stroke: var(--sep-2); stroke-width: 1; }
.vecsvg line.vy { stroke: var(--accent); stroke-width: 2.4; } .vecsvg .vyh { fill: var(--accent); }
.vecsvg line.vz { stroke: var(--ink-2); stroke-width: 2.4; } .vecsvg .vzh { fill: var(--ink-2); }
.vecsvg line.vr { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 3 2; } .vecsvg .vrh { fill: var(--ink); }
.vecsvg .vtx { font: 7px var(--mono); fill: var(--ink-3); }
.vrows { display: grid; gap: 2px; font: 11.5px var(--mono); color: var(--ink-2); }
.vrows b { color: var(--ink); font-weight: 400; }
.vrows .sw { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; }
.vrows .sw.vy { background: var(--accent); } .vrows .sw.vz { background: var(--ink-2); } .vrows .sw.vr { border-top: 2px dashed var(--ink); height: 0; }
.mgroup.takeaways .tk { display: grid; grid-template-columns: 16px 1fr; gap: 8px; width: 100%; border: 0; background: none; color: var(--ink); text-align: left;
  padding: 7px 4px; font: 13px/1.45 var(--sans); cursor: pointer; border-top: 1px solid var(--sep); }
.mgroup.takeaways .tk:first-of-type { border-top: 0; }
.mgroup.takeaways .tk:hover { background: var(--fill-2); }
.mgroup.takeaways .tk i { width: 16px; height: 16px; display: grid; place-items: center; font: 700 10px var(--sans); font-style: normal; color: var(--bg); margin-top: 2px; }
.tk.green i { background: var(--green); } .tk.yellow i { background: var(--yellow); } .tk.red i { background: var(--red); }
.allmetrics { width: calc(100% - 28px); margin: 6px 14px 14px; }
/* the Metrics tab */
.mt { max-width: 1180px; margin: 0 auto; padding: 20px 24px 40px; }
.mthead { margin-bottom: 12px; }
.mcard { padding: 0; margin-bottom: 14px; overflow-x: auto; }
.mtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.mtable caption { text-align: left; padding: 12px 14px 8px; caption-side: top; }
.mtable caption b { font: 500 15px var(--sans); margin-right: 10px; } .mtable caption span { color: var(--ink-2); font-size: 12px; }
.mtable th { text-align: left; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 6px 14px; border-bottom: 1px solid var(--sep); }
.mtable td { padding: 8px 14px; border-bottom: 1px solid var(--sep); vertical-align: top; }
.mtable td small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; max-width: 520px; }
.mtable td.num { font: 12.5px var(--mono); white-space: nowrap; }
.mtable .mlink { border: 0; background: none; color: var(--ink); padding: 0; font: 13px var(--sans); cursor: pointer; text-align: left; }
.mtable .mlink:hover { text-decoration: underline; }
.mtable .status { font-size: 9.5px; padding: 1px 6px 1px 2px; } .mtable .status i { width: 12px; height: 12px; font-size: 8px; }
.mtable .pcl { font: 11px var(--mono); color: var(--ink-2); }
@media (max-width: 720px) { .mt { padding: 12px 16px 32px; } .mtable td small { display: none; } }

/* the five principles: score, pentagon, one bar each (unfold for the measurements behind it) */
.mgroup.five .fhead { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.ftot { display: flex; flex-direction: column; align-items: flex-start; padding-left: 10px; border-left: 3px solid var(--ink-3); }
.ftot.green { border-left-color: var(--green); } .ftot.yellow { border-left-color: var(--yellow); } .ftot.red { border-left-color: var(--red); }
.ftot .n { font: 300 46px/1 var(--sans); letter-spacing: -.03em; } .ftot .u { font: 11px var(--mono); color: var(--ink-2); margin-top: 4px; }
.fivesvg { width: 100%; max-width: 190px; justify-self: end; height: auto; }
.fivesvg .fgrid { fill: none; stroke: var(--sep-2); stroke-width: .8; }
.fivesvg .fmed { fill: none; stroke: var(--ink-3); stroke-width: .8; stroke-dasharray: 2 2; }
.fivesvg .fyou { stroke-width: 1.4; fill-opacity: .25; }
.fivesvg .fyou.green { fill: var(--green); stroke: var(--green); } .fivesvg .fyou.yellow { fill: var(--yellow); stroke: var(--yellow); } .fivesvg .fyou.red { fill: var(--red); stroke: var(--red); }
.fivesvg .ftx { font: 7.5px var(--mono); fill: var(--ink-2); letter-spacing: .04em; }
.frow { border-top: 1px solid var(--sep); }
.frow summary { display: grid; grid-template-columns: minmax(62px, max-content) 1fr 30px; align-items: center; gap: 10px; padding: 7px 4px; cursor: pointer; list-style: none; }
.frow summary::-webkit-details-marker { display: none; }
.frow summary:hover { background: var(--fill-2); }
.frow .nm { font: 13px var(--sans); } .frow .v { font: 13px var(--mono); text-align: right; }
.fbar { position: relative; height: 6px; background: var(--fill); display: block; }
.fbar i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.fbar i.green { background: var(--green); } .fbar i.yellow { background: var(--yellow); } .fbar i.red { background: var(--red); }
.fbar em { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--ink-3); }
.frow .fab { margin: 0 4px 4px; font-size: 12px; color: var(--ink-2); }
.fpart { display: grid; grid-template-columns: 1fr auto 28px; gap: 8px; width: 100%; border: 0; background: none; color: var(--ink); padding: 4px 4px 4px 14px; font: 12px var(--sans); text-align: left; cursor: pointer; }
.fpart:hover { background: var(--fill-2); }
.fpart .num { font: 11.5px var(--mono); text-align: right; } .fpart .dim { color: var(--ink-3); }
.fnote { font-size: 11px; color: var(--ink-3); margin: 8px 4px 0; line-height: 1.45; }
/* the session list, by athlete */
.side .ath { border-top: 1px solid var(--sep); }
.side .athhd { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 6px; width: 100%; border: 0; background: none; color: var(--ink);
  padding: 7px 12px 5px 14px; text-align: left; cursor: pointer; }
.side .athhd:hover { background: var(--fill-2); }
.side .athhd .an { font: 500 13px var(--sans); }
.side .athhd .car { font-style: normal; color: var(--ink-3); font-size: 10px; transition: transform .15s; }
.side .ath.shut .athhd .car { transform: rotate(-90deg); }
.side .ath.shut .athbody { display: none; }
.side .athbody .trialhd { padding-left: 24px; }
.side .trialhd .att { color: var(--ink-3); font-size: 10px; }
/* the Metrics tab: every row in its traffic light, with the normal range drawn */
.mtable tr.lt-green td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.mtable tr.lt-yellow td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
.mtable tr.lt-red td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.mtable td.rngc { width: 180px; min-width: 120px; vertical-align: middle; }
.mtable td.rngc .sqbar { display: block; }
.mtable td.num small { display: block; color: var(--ink-3); font-size: 10.5px; }
.mtable td.dim { color: var(--ink-2); }
@media (max-width: 720px) { .mtable td.rngc { min-width: 90px; } }

/* the timeline: press anywhere on it to scrub (the rep bands are labels, not buttons) */
.scrub { cursor: ew-resize; touch-action: none; }
.scrub .repband { cursor: ew-resize; }

/* the Metrics tab: areas (score rings) on the left, the area / measurement on the lifter on the right */
.mt { max-width: 1320px; }
.mv2 { display: grid; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mvsecs { display: grid; gap: 10px; }
.mvsec { padding: 0; }
.mvhead { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto 14px; align-items: center; gap: 12px; width: 100%; border: 0; background: none;
  color: var(--ink); padding: 12px 14px; text-align: left; cursor: pointer; }
.mvhead:hover, .mvhead[aria-current="true"] { background: var(--fill-2); }
.mvhead .ring { width: 46px; height: 46px; display: block; }
.mvhead .tt b { display: block; font: 500 15px var(--sans); } .mvhead .tt small { font: 11px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.mvhead .chev { color: var(--ink-3); transition: transform .2s; } .mvsec.open .mvhead .chev { transform: rotate(90deg); }
.mvhead .status { font-size: 9.5px; padding: 1px 6px 1px 2px; } .mvhead .status i { width: 12px; height: 12px; font-size: 8px; }
.mvbody { border-top: 1px solid var(--sep); }
.mvrow { display: grid; grid-template-columns: 18px minmax(0, 1fr) 120px auto; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--ink);
  padding: 8px 14px; text-align: left; cursor: pointer; border-top: 1px solid var(--sep); font: 13px var(--sans); }
.mvrow:first-child { border-top: 0; }
.mvrow:hover { background: var(--fill-2); } .mvrow.on { background: var(--fill); box-shadow: inset 3px 0 0 var(--ink); }
.mvrow .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvrow .v { font: 12.5px var(--mono); white-space: nowrap; text-align: right; }
.mvrow .ic, .say i { width: 18px; height: 18px; display: grid; place-items: center; font: 700 10px var(--sans); font-style: normal; color: var(--bg); background: var(--ink-3); }
.mvrow .ic.green, .say.green i { background: var(--green); } .mvrow .ic.yellow, .say.yellow i { background: var(--yellow); } .mvrow .ic.red, .say.red i { background: var(--red); }
.mvrow .sqbar { height: 12px; }
.mvdet { position: sticky; top: 12px; }
.mvcard { padding: 18px 20px 20px; }
.mvcard .eyebrow { font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.mvcard h2 { font: 400 26px var(--sans); letter-spacing: -.01em; margin: 6px 0 12px; }
.mvcard .lead { color: var(--ink-2); margin: 0 0 12px; }
.mvvals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--sep); border: 1px solid var(--sep); margin-bottom: 14px; }
.mvvals > div { background: var(--card); padding: 10px 12px; display: grid; gap: 4px; align-content: start; }
.mvvals .l { font: 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.mvvals .v { font: 300 24px var(--sans); } .mvvals .v.green { color: var(--green); } .mvvals .v.yellow { color: var(--yellow); } .mvvals .v.red { color: var(--red); }
.mvvals .status { justify-self: start; font-size: 9.5px; padding: 1px 6px 1px 2px; } .mvvals .status i { width: 12px; height: 12px; font-size: 8px; }
.mvfigwrap { border: 1px solid var(--sep); background: var(--fill-2); }
.mvfig { display: block; width: 100%; height: 340px; }
.mvfigwrap .cap { font: 11px var(--mono); color: var(--ink-3); padding: 6px 10px; border-top: 1px solid var(--sep); }
.mvswarm { margin-top: 16px; } .mvswarm h4, .mvcard .dprose h4 { font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 0 0 6px; }
.mvswarm canvas { display: block; width: 100%; height: 130px; cursor: crosshair; }
.mvcard .dprose { margin-top: 16px; } .mvcard .dprose p { margin: 0 0 10px; line-height: 1.5; }
.say { display: grid; grid-template-columns: 18px 1fr; gap: 9px; cursor: pointer; }
.say:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-3); }
.mvtable { margin-top: 16px; padding: 0; } .mvtable > summary { padding: 12px 16px; cursor: pointer; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
@media (max-width: 960px) { .mv2 { grid-template-columns: 1fr; } .mvdet { position: static; } .mvfig { height: 280px; } .mvrow { grid-template-columns: 18px minmax(0, 1fr) 80px auto; } }

/* the language menu */
.langsel { appearance: none; background: transparent; color: var(--ink-2); border: 1px solid var(--sep-2); font: 11px var(--mono); padding: 5px 22px 5px 8px; margin-right: 6px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 11px) 50%, calc(100% - 7px) 50%; background-size: 4px 4px; background-repeat: no-repeat; cursor: pointer; }
.langsel option { background: var(--card); color: var(--ink); }

.navbg { display: none; }
/* ================================================================ phones (and narrow tablets)
 * One column. The lift list becomes a drawer (☰), the header two rows (the lift / the tabs, swipeable), and the
 * Overview a scroll: the 3-D view and its controls, then this lift's score, numbers and takeaways, then the charts.
 * Touch targets are at least 36 px; nothing scrolls sideways except the tab strip and the transport. */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  .labroot, .labroot.navc { grid-template-columns: minmax(0, 1fr); height: 100dvh; }
  /* the lift list: a drawer over the page */
  .side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: min(330px, 86vw); transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .labroot:not(.navc) .side { transform: none; }
  .navbg { position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.45); }
  .labroot:not(.navc) .navbg { display: block; }
  .side .mv, .side .trialhd, .side .athhd { min-height: 38px; }
  /* the header: the lift + Compare, then the tabs as a strip */
  .mtop { height: auto; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "crumb act" "tabs tabs"; padding: 6px 10px 0; gap: 4px 8px; }
  .mtop .crumb { grid-area: crumb; } .mtop .actions { grid-area: act; } .mtop .tabs { grid-area: tabs; justify-self: stretch; }
  .mtop .tabs button { padding: 10px 12px; font-size: 14px; }
  .mtop .actions #exportBtn { display: none; }
  .mtop .actions .btn { padding: 7px 10px; font-size: 13px; }
  .crumb .mvname { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumb #crumbSet { display: inline; font-size: 10px; white-space: nowrap; }
  .navbtn { width: 36px; height: 36px; }
  /* Overview: a column, rails always open */
  .ovl, .ovl.lc, .ovl.rc { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .ovl > .panel { border-left: 0; border-right: 0; }
  .stage { order: 0; height: min(64svh, 600px); min-height: 380px; flex: none; }
  .orail.left { order: 1; } .orail.right { order: 2; }
  .orail, .ovl.lc .orail.left, .ovl.rc .orail.right { overflow: visible; cursor: default; }
  .orail .obody, .ovl.lc .orail.left .obody, .ovl.rc .orail.right .obody { display: block; overflow: visible; }
  .orail .ph, .ovl.lc .orail.left .ph, .ovl.rc .orail.right .ph { display: flex; }
  .orail .ph .fold, .orail .ofold, .ovl.lc .orail.left .ofold, .ovl.rc .orail.right .ofold { display: none; }
  .stage .hud { top: 10px; right: 12px; }
  .stage .hud .hudv { font-size: 22px; }
  .stage .hud .hudn { font-size: 18px; }
  .stage .hud .hudrow { gap: 14px; }
  .orbit-hint { display: none; }
  .footage { left: 8px; top: 8px; width: 42%; }
  .footage.big { width: calc(100% - 16px); }
  .footage .fcap { padding: 4px 6px; } .footage .fcap .lab { font-size: 9px; }
  .stage .transport { flex-wrap: wrap; gap: 6px; padding: 8px 10px; overflow: visible; }
  .stage .transport .scrub { flex: 1 0 100%; }
  .stage .transport .seg button { padding: 8px 9px; font-size: 10.5px; }
  .roundbtn { width: 40px; height: 40px; }
  #cvMiniPath { height: 260px; } #cvMiniSpeed { height: 170px; } #cvDonut { height: 230px; }
  .kgrid .kcell .v { font-size: 20px; }
  .mgroup.takeaways .tk { font-size: 14px; padding: 9px 4px; }
  .sqrow, .dlrow, .frow summary, .mvrow { min-height: 40px; }
  /* Metrics */
  .mt { padding: 10px 10px 40px; }
  .mthead { flex-wrap: wrap; gap: 4px; } .mthead .lab { font-size: 9.5px; }
  .mv2 { grid-template-columns: minmax(0, 1fr); }
  .mvdet { position: static; order: -1; }
  .mvcard { padding: 14px; } .mvcard h2 { font-size: 21px; }
  .mvvals { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mvvals > div { padding: 8px; } .mvvals .v { font-size: 18px; }
  .mvfig { height: 300px; }
  .mvrow { grid-template-columns: 18px minmax(0, 1fr) 70px auto; gap: 8px; padding: 8px 10px; font-size: 13px; }
  .mvhead { padding: 10px 12px; gap: 10px; }
  .mvtable { overflow-x: auto; }
  .mtable { min-width: 560px; }
  /* Bar path, Speed, Curves */
  .bp, .sp, .cv { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .bp-plot { height: min(70svh, 620px); min-height: 420px; }
  .bp-tools { flex-wrap: wrap; gap: 6px 12px; left: 10px; right: 10px; top: 8px; }
  .bp-fig { height: 260px; }
  .sp-main { height: 320px; } .sp-height { height: 260px; }
  .sp .sp-lv { display: none !important; }                   /* every set labelled: unreadable this narrow */
  .card-head { flex-wrap: wrap; row-gap: 2px; }
  .sp .card-head .lab { flex-basis: 100%; }
  .sp-main canvas, .sp-height canvas { top: 64px; height: calc(100% - 64px); }
  .cv-grid.auto { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 220px; }
  .cv-side { order: -1; } .cv-side .mini canvas { height: 220px; }
  /* Report: the A4 pages scaled to the screen (app.js sets --pz) */
  .pages { padding: 10px 0 60px; gap: 12px; }
  .pages .page { zoom: var(--pz, 1); }
  .report-bar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  /* Compare */
  .cmp { padding: 10px 10px 40px; }
  .cmp-grid { grid-template-columns: minmax(0, 1fr); }
  .cmp-figs { grid-row: auto; height: auto; min-height: 0; grid-template-columns: 1fr 1fr; }
  .cmp-fig { height: 46svh; min-height: 300px; }
  .cmp-path, .cmp-speed { height: 260px; }
  .cmp-sum .diff { padding: 10px 12px; font-size: 14px; }
  /* Home */
  .home { padding: 20px 14px 40px; }
  .home h1 { font-size: 44px; }
  .home .strip { flex-wrap: wrap; }
  .cards { grid-template-columns: minmax(0, 1fr) !important; }
  .tip { max-width: calc(100vw - 20px); }
}
@media (max-width: 760px) and (pointer: coarse) {
  #cvPath, .mvswarm canvas { touch-action: none; }          /* a finger on the path / the dots reads them, like a mouse */
}

.stage .transport .tpad { display: contents; }
/* zoom buttons over the 3-D view (pinch and the wheel zoom too) */
.zoompad { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 4; display: flex; flex-direction: column; gap: 6px; }
.zoompad .iconbtn { width: 34px; height: 34px; font-size: 18px; line-height: 1; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(8px); }

/* phones, the Overview: the 3-D view fills the screen in portrait, with the control pad at its foot; below it only this
 * lift's score, key numbers and takeaways, and the stage timing (the rest is in the other tabs) */
@media (max-width: 760px) {
  .stage { height: calc(100svh - 92px); min-height: 520px; max-height: none; }
  .stage .transport { display: block; padding: 0 0 max(8px, env(safe-area-inset-bottom)); overflow: visible; }
  .stage .transport .scrub { display: block; margin: 10px 12px 6px; }
  .stage .transport .tpad { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 2px 12px; }
  .stage .transport .tpad::-webkit-scrollbar { display: none; }
  .stage .transport .tpad > * { flex: none; }
  .stage .transport .seg button { padding: 9px 10px; font-size: 11px; }
  .zoompad { top: auto; bottom: 130px; right: 10px; }
  .orail.left .vecard, .orail.left .allmetrics { display: none; }
  .orail.right .ph, #miniPathCard, #miniSpeedCard, #squadCard { display: none; }
  #donutCard { border-top: 1px solid var(--sep); }
}
/* phones: the 3-D view keeps every gesture (one finger turns it any way, two zoom); the page scrolls from the control pad
 * and the header, and "Details" jumps to what is below. (pan-y here let the browser steal slightly diagonal drags.) */
.detailsbtn { display: none; }
@media (max-width: 760px) {
  .stage .transport { touch-action: pan-y; }
  .detailsbtn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--sep-2); background: none; color: var(--ink);
    font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 9px 10px; white-space: nowrap; }
}

/* ---------------------------------------------------------------- share as a video (story.js) */
.sharebtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: none; color: var(--ink);
  font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 0 10px; height: 34px; cursor: pointer; white-space: nowrap; }
.sharebtn svg { width: 14px; height: 14px; flex: none; }
.sharebtn:hover { background: var(--fill-2); }
.sharebtn:focus-visible, .stmake:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the clip is always dark: the tokens it draws with, whatever the page's theme */
.storydark { --bg: #08090a; --card: #0f1011; --fill: #1b1c1f; --fill-2: #121315; --ink: #f7f8f8; --ink-2: #8a8f98; --ink-3: #62666d;
  --sep: #23252a; --sep-2: #2e3036; --left: #2997ff; --right: #c46ac7; --green: #4cb782; --yellow: #f2c94c; --red: #eb5757; --accent: #5e6ad2;
  --cmp-a: #f05252; --cmp-b: #3d8bfd; --com: #ff4d4d; position: fixed; width: 0; height: 0; }
.storybg { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .4s cubic-bezier(.3,.75,.1,1); }
.storybg.on { opacity: 1; }
.storysheet { position: fixed; z-index: 81; left: 50%; top: 50%; width: min(760px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--sep-2);
  transform: translate(-50%, calc(-50% + 16px)); opacity: 0; transition: transform .45s cubic-bezier(.3,.75,.1,1), opacity .3s; padding: 18px 20px 20px; display: grid; gap: 14px; }
.storysheet.on { transform: translate(-50%, -50%); opacity: 1; }
.storysheet .sthandle { display: none; }
.storysheet .sthead { display: flex; align-items: center; justify-content: space-between; }
.storysheet .sttitle { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.storysheet .stbody { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; align-items: start; }
#storyCv { width: 270px; height: 480px; display: block; background: #08090a; border: 1px solid var(--sep-2); }
.storysheet .stopts { display: grid; gap: 16px; align-content: start; min-width: 0; }
.storysheet .stabout { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.storysheet .strow { display: grid; gap: 6px; }
.storysheet .strow .seg { flex-wrap: wrap; }
.storysheet .strow .seg button[aria-pressed="true"] { background: var(--fill); color: var(--ink); }
.storysheet .sttog { display: flex; justify-content: space-between; align-items: center; font-size: 14px; gap: 12px; }
.storysheet .sttog input { width: 18px; height: 18px; accent-color: var(--accent); }
.stmake { position: relative; overflow: hidden; height: 46px; border: 0; background: var(--accent); color: #fff; font: 600 15px var(--sans); cursor: pointer;
  display: grid; place-items: center; transition: transform .12s, background .2s; }
.stmake:active { transform: scale(.98); }
.stmake.busy { cursor: progress; }
.stmake .fill { position: absolute; inset: 0; background: rgba(255,255,255,.25); transform-origin: left; transform: scaleX(0); }
.stmake .lbl { position: relative; font-variant-numeric: tabular-nums; }
.stnote { font-size: 13px; color: var(--ink-2); min-height: 1.4em; }
@media (max-width: 760px) {
  .sharebtn { height: auto; padding: 9px 10px; }
  .storysheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; transform: translateY(102%); opacity: 1; border-width: 1px 0 0; border-radius: 18px 18px 0 0;
    padding: 8px max(16px, env(safe-area-inset-left, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));
    max-height: 92svh; overflow-y: auto; }
  .storysheet.on { transform: translateY(0); }
  .storysheet .sthandle { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--sep-2); justify-self: center; }
  .storysheet .stbody { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; }
  #storyCv { width: 112px; height: 199px; }
  .storysheet .stabout { font-size: 13px; }
  .storysheet .stopts { gap: 12px; }
  .storysheet .stmake { grid-column: 1 / -1; }
}
