:root {
  /* groomed snow, spruce ink, glacier blue (heelside), goggle-lens amber (toeside) */
  --bg: #F3F6F9; --panel: #FFFFFF; --panel2: #E9EEF3; --line: #D5DEE6;
  --text: #12302E; --muted: #4A5F63; --accent: #2B63D9; --ink: #12302E; --night: #0E2426;
  --good: #1F7A4D; --usable: #D9A23A; --bad: #B42318; --none: #C3CDD6;
  --left: #ff9600; --right: #0096ff; --center: #5ad85a;
  --heel: rgba(43, 99, 217, .16); --toe: rgba(242, 155, 48, .22); --unknown: rgba(18, 48, 46, .07);
  --heel-solid: #2B63D9; --toe-solid: #F29B30; --straight: #9FB0BF; --moment: #12302E; --warn: #B76E00;
  --display: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--display); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
textarea { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; resize: vertical; }
textarea:focus { outline: none; border-color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

header { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { font-weight: 800; font-stretch: 80%; font-size: 19px; letter-spacing: 0; display: flex; align-items: center; gap: 8px; }
.logo { display: inline-block; width: 22px; height: 22px; }

.wrap { padding: 20px; max-width: 1500px; margin: 0 auto; }
@media (max-width: 900px) { .wrap { padding: 12px 16px; } header { padding: 12px 16px; } }

/* ---------- upload ---------- */
#uploadView { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 320px; border: 1.5px dashed var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; text-align: center; padding: 24px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--panel2); }
.drop-icon { font-size: 30px; color: var(--accent); }
.drop-title { font: 800 30px/1 var(--display); font-stretch: 75%; }

.bar { width: 100%; max-width: 420px; height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.progress .bar { max-width: none; }
.bar.indeterminate > div { width: 35%; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
h1 { font-size: 20px; margin: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
h1.big { font: 800 34px/1 var(--display); font-stretch: 75%; white-space: normal; }
h2 { font-size: 15px; color: var(--text); margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); letter-spacing: .3px; white-space: nowrap; }
.pill.done { color: var(--good); border-color: #A9D3BC; }
.pill.running, .pill.queued, .pill.prechecking { color: var(--accent); }
.pill.error { color: var(--bad); }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel); text-align: left; min-height: 36px; }
.pills button:hover { border-color: #9FB0BF; }
.pills button.on { border-color: var(--ink); background: var(--ink); color: #F3F6F9; }
.pills.small button { padding: 3px 10px; font-size: 12px; }
.pills button:disabled { opacity: .5; cursor: default; }
.primary { align-self: flex-start; background: var(--ink); color: #F3F6F9; border: 0; border-radius: 99px; padding: 11px 22px; font-weight: 600; }
.primary:hover:not(:disabled) { background: #1E4A47; }
.primary:disabled { opacity: .45; cursor: default; }
.big-btn { padding: 14px 28px; font-size: 16px; }
.ghost { background: transparent; border: 1.5px solid var(--line); border-radius: 99px; padding: 7px 16px; color: var(--text); font-weight: 600; }
.ghost:hover { border-color: #9FB0BF; }
.ghost.small { padding: 3px 8px; font-size: 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
.link-btn:hover { color: var(--text); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.center-card { max-width: 560px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 20px; }
.center-card p { margin: 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--panel2); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { background: #FFF4DE; border: 1px solid #F0D29A; color: #5A3A00; padding: 10px 14px; border-radius: 10px; }
.error { background: #FDECEA; border: 1px solid #F3B8B1; color: #7A1A12; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.error .link-btn { margin-left: 6px; }

/* ---------- confirm ---------- */
.confirm { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.confirm .title-row { margin-bottom: 0; }
.row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-head h3 { margin: 0; }
#riderHint { margin: 4px 0 10px; }
.check-tag { font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 99px; color: #4A2D00; background: #FBD28A; white-space: nowrap; }
.needs-check { border-color: #E3B45C; }

.rider-stage { display: flex; justify-content: center; background: var(--night); border-radius: 10px; overflow: hidden; }
.rider-frame { position: relative; width: 100%; max-width: 100%; }
.rider-frame img { display: block; width: 100%; height: 100%; object-fit: fill; }
.boxes { position: absolute; inset: 0; }
.pbox { position: absolute; border: 2px dashed rgba(255,255,255,.75); border-radius: 3px; background: transparent; padding: 0; min-width: 14px; min-height: 14px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.pbox:hover, .pbox:focus-visible { border-color: #F29B30; border-style: solid; outline: none; background: rgba(242,155,48,.12); }
.pbox .num { position: absolute; left: -2px; top: -20px; font-size: 11px; line-height: 16px; padding: 0 5px; border-radius: 4px; background: rgba(0,0,0,.75); color: #fff; white-space: nowrap; pointer-events: none; }
.pbox.top .num { top: 2px; left: 2px; }
.pbox.sel { border: 3px solid #F29B30; background: rgba(242,155,48,.12); box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 18px rgba(242,155,48,.5); }
.pbox.sel .num { background: #F29B30; color: var(--ink); font-weight: 700; }
.pbox.guess:not(.sel) { border-color: #FBD28A; }
.no-people { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.7); padding: 6px 12px; border-radius: 8px; font-size: 13px; text-align: center; }

.thumbs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.thumb { position: relative; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.thumb:hover img, .thumb.on img { opacity: 1; }
.thumb.on { border-color: var(--accent); }
.thumb .tcount { position: absolute; right: 3px; bottom: 2px; font-size: 10px; background: rgba(0,0,0,.7); padding: 0 4px; border-radius: 3px; }
.thumb .tpick { position: absolute; left: 3px; top: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #000; }
.rider-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }

.statements { display: flex; flex-direction: column; gap: 8px; }
.stmt { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel2); }
.stmt.needs-check { border-color: var(--warn); }
.stmt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stmt-text { font-weight: 600; font-size: 15px; }
.stmt-sub { color: var(--muted); font-size: 12px; }
.stmt .spacer { flex: 1; }
.stmt .options { margin-top: 8px; }
.stmt .options button .guess { color: var(--muted); font-size: 11px; margin-left: 4px; }

.support { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; }
.support .lvl { font-weight: 650; margin-bottom: 4px; }
.support .lvl.full { color: var(--good); } .support .lvl.partial { color: var(--warn); } .support .lvl.none { color: var(--bad); }
.support ul { margin: 2px 0 6px; padding-left: 18px; }
.support li { margin: 1px 0; }
.support .tip { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; }
.confirm-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 24px; }

/* ---------- progress ---------- */
.progress { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; gap: 10px; }
.steps { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); }
.steps .on { color: var(--accent); } .steps .done { color: var(--good); }

/* ---------- results ---------- */
.results { display: flex; flex-direction: column; gap: 22px; }
.video-col { min-width: 0; display: flex; flex-direction: column; grid-area: video; }
.feedback-col { min-width: 0; grid-area: panel; }

/* stepper: the debrief is a real sequence, so the steps are numbered */
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stepper button { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 0 0 4px; color: var(--muted); font-size: 15px; }
.stepper button::before { content: ""; display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--line); }
.stepper button.done::before { background: #9FB0BF; }
.stepper button[aria-current="step"] { color: var(--text); font-weight: 700; }
.stepper button[aria-current="step"]::before { background: var(--ink); }
.stepper .n { font-variant-numeric: tabular-nums; margin-right: 4px; }

.res-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(340px, 420px); grid-template-areas: "line video panel"; gap: 24px; align-items: start; }
.results.no-feedback .res-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "video"; }
@media (max-width: 1180px) { .res-grid { grid-template-columns: 190px minmax(0, 1fr); grid-template-areas: "panel panel" "line video"; } }
@media (max-width: 760px) { .res-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "panel" "video" "line"; } .stepper button { font-size: 13px; } .stepper .lbl { display: none; } .stepper button[aria-current="step"] .lbl { display: inline; } }

/* the line you rode */
.line-col { grid-area: line; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.line-col h2 { margin: 0; font: 800 22px/1 var(--display); font-stretch: 75%; }
.runline-box { position: relative; height: min(64vh, 600px); min-height: 360px; }
.rl-strip { position: absolute; left: 58%; top: 0; bottom: 0; width: 34px; margin-left: -17px; border-radius: 17px; background: #EEF2F6; overflow: hidden; }
.rl-band { position: absolute; left: 0; right: 0; }
.rl-band.heel { background: var(--heel-solid); }
.rl-band.toe { background: var(--toe-solid); }
.rl-band.unknown { background: #6E8A92; }
.rl-band.straight { background: #D5DEE6; }
/* skidding: a scraped look, diagonal streaks across the band */
.rl-band.skid { background-image: repeating-linear-gradient(-35deg, rgba(255,255,255,.55) 0 3px, transparent 3px 9px); }
.rl-tick { position: absolute; left: 0; transform: translateY(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rl-tick::after { content: ""; position: absolute; left: calc(100% + 6px); top: 50%; width: 16px; border-top: 1px solid var(--line); }
.rl-pin { position: absolute; left: 58%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--bg); padding: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }
.rl-pin::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.rl-pin:hover { transform: scale(1.12); }
.rl-pin.good::after { background: var(--good); }
.rl-pin.fall { border-radius: 6px; }
.rl-pin.fall::after { content: "\2715"; width: auto; height: auto; background: none; font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1; }
.rl-head { position: absolute; left: 58%; width: 56px; height: 4px; margin: -2px 0 0 -28px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--bg); pointer-events: none; transition: top .08s linear; }
.rl-legend { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.rl-legend span { display: flex; align-items: center; gap: 8px; }
.rl-legend i { display: inline-block; width: 18px; height: 5px; border-radius: 3px; }
.rl-legend i.heel { background: var(--heel-solid); } .rl-legend i.toe { background: var(--toe-solid); }
.rl-legend i.straight { background: #D5DEE6; }
.rl-legend i.skid { background-color: #9FB0BF; background-image: repeating-linear-gradient(-35deg, rgba(255,255,255,.7) 0 2px, transparent 2px 6px); height: 10px; }
@media (max-width: 760px) { .runline-box { height: 420px; } }

/* the step panel */
.debrief { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-height: 420px; transition: opacity .2s; }
.debrief.busy { opacity: .5; pointer-events: none; }
.debrief .kicker { margin: 0; font-size: 14px; color: var(--muted); }
.debrief .title { margin: 0; font: 800 38px/0.98 var(--display); font-stretch: 72%; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.debrief p { margin: 0; line-height: 1.5; }
.debrief .lead { font-size: 17px; }
.debrief .cue-big { margin: 0; font: 800 30px/1.02 var(--display); font-stretch: 75%; }
.debrief .drill { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.debrief .drill h3 { margin: 0 0 4px; font: 800 21px/1.1 var(--display); font-stretch: 82%; }
.debrief .moments { display: flex; flex-wrap: wrap; gap: 8px; }
.debrief .moments button { display: inline-flex; gap: 8px; align-items: center; border: 1.5px solid var(--line); background: var(--panel); border-radius: 99px; padding: 6px 12px 6px 6px; font-size: 14px; text-align: left; }
.debrief .moments button:hover { border-color: var(--ink); }
.debrief .moments .t { background: var(--ink); color: #F3F6F9; border-radius: 99px; padding: 2px 8px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.debrief .nav { margin-top: auto; display: flex; gap: 10px; justify-content: space-between; align-items: center; padding-top: 6px; }
.debrief .goal-row { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.debrief .goal-row .pills button { padding: 4px 11px; min-height: 30px; font-size: 13px; }
.debrief .goal-err { color: var(--bad); font-size: 13px; }
.debrief .stat-line { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.debrief .tip { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--muted); }

/* next session */
.plan { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
@media (max-width: 860px) { .plan { grid-template-columns: minmax(0, 1fr); padding: 20px; } }
.plan h2 { margin: 0 0 4px; font: 800 30px/1 var(--display); font-stretch: 75%; }
.plan .sub { margin: 0 0 14px; color: var(--muted); }
.plan ol { margin: 0; padding: 0; list-style: none; }
.plan li { border-top: 1px solid var(--line); padding: 12px 0; }
.plan li:last-child { border-bottom: 1px solid var(--line); }
.plan label { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.plan input[type=checkbox] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.plan .it { font-weight: 700; }
.plan .how { color: var(--muted); font-size: 14px; }
.plan table { width: 100%; border-collapse: collapse; font-size: 15px; }
.plan caption { text-align: left; font: 800 22px/1 var(--display); font-stretch: 78%; padding-bottom: 10px; }
.plan th, .plan td { padding: 11px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: top; }
.plan thead th { color: var(--muted); font-size: 13px; border-top: 0; padding-top: 0; }
.plan td.v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.plan td.aim { text-align: right; color: var(--muted); white-space: nowrap; padding-left: 12px; }

/* details */
.details { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.details > summary { cursor: pointer; padding: 16px 22px; font-weight: 700; list-style-position: inside; }
.details[open] > summary { border-bottom: 1px solid var(--line); }
.details-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 22px; }
.details-body h3 { font-size: 16px; margin: 0 0 8px; }
.details .timeline-wrap, .details .measurements { border: 0; padding: 0; margin: 0; background: none; }

.feedback { display: flex; flex-direction: column; gap: 14px; transition: opacity .2s; }
.feedback.busy { opacity: .5; pointer-events: none; }
.feedback .goal-row { display: flex; flex-direction: column; gap: 6px; }
.feedback .headline { font-size: 21px; line-height: 1.25; font-weight: 700; margin: 0; text-transform: none; letter-spacing: 0; color: var(--text); }
.feedback p { margin: 0; }
.feedback .sec h4 { margin: 0 0 3px; font-size: 14px; color: var(--muted); font-weight: 600; }
.feedback .cue { border-left: 3px solid var(--accent); background: var(--panel2); padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 16px; font-weight: 600; }
.feedback .drill { background: var(--panel2); border-radius: 8px; padding: 10px 12px; }
.feedback .drill b { display: block; margin-bottom: 2px; }
.feedback .good-box { display: flex; gap: 8px; }
.feedback .good-box .ic { color: var(--good); font-weight: 700; }
.feedback .tip-box { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; }
.feedback .tip-box.lead { border-color: var(--accent); }
.feedback ul.na { margin: 4px 0 0; padding-left: 18px; }
.feedback ul.na li { margin: 2px 0; }
.feedback .moments { display: flex; flex-direction: column; gap: 4px; }
.feedback .moments button { display: flex; gap: 8px; align-items: baseline; text-align: left; background: none; border: 0; padding: 2px 0; color: var(--text); }
.feedback .moments button:hover .t { text-decoration: underline; }
.feedback .moments .t { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; }
.feedback .fine { color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.feedback .goal-err { color: var(--bad); font-size: 12px; }
.tlink { color: var(--accent); background: none; border: 0; padding: 0; font: inherit; font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.tlink:hover { text-decoration-style: solid; }
.empty-card p { margin: 0 0 12px; }

.stage-wrap { display: flex; justify-content: center; background: var(--night); border-radius: 14px; overflow: hidden; }
.stage { position: relative; max-width: 100%; max-height: 68vh; }
.stage video { display: block; max-width: 100%; max-height: 68vh; transition: filter .2s; }
.stage.dim video { filter: brightness(.35) saturate(.4); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.badge { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.65); padding: 3px 9px; border-radius: 6px; font-size: 12px; display: flex; gap: 6px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.controls { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.spacer { flex: 1; }
.icon { width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--panel); border: 0; padding: 5px 10px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { color: var(--text); background: var(--panel2); }

.timeline-wrap { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
#timeline { width: 100%; height: 130px; display: block; cursor: pointer; }
.tl-tip { position: absolute; top: 4px; transform: translateX(-50%); background: var(--ink); color: #F3F6F9; border: 1px solid var(--ink); padding: 2px 8px; border-radius: 6px; font-size: 12px; pointer-events: none; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.legend-group { display: contents; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.sw.good { background: var(--good); } .sw.usable { background: var(--usable); } .sw.bad { background: var(--bad); } .sw.none { background: var(--none); }
.sw.heel { background: var(--heel-solid); opacity: .6; } .sw.toe { background: var(--toe-solid); opacity: .7; } .sw.unknown { background: rgba(18,48,46,.2); }
.mk { display: inline-block; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid var(--moment); margin-right: 5px; vertical-align: 0; }
.ln { display: inline-block; width: 14px; height: 2px; margin-right: 5px; vertical-align: 3px; }
.ln.L { background: var(--left); } .ln.R { background: var(--right); }
.sep { width: 1px; height: 12px; background: var(--line); }

.measurements { margin-top: 12px; padding: 0; }
.measurements summary { cursor: pointer; padding: 12px 14px; font-weight: 600; color: var(--muted); list-style-position: inside; }
.measurements[open] summary { border-bottom: 1px solid var(--line); }
.meas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; padding: 14px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; }
.stats dt { color: var(--muted); font-size: 12px; }
.stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.quality { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: var(--panel2); color: var(--muted); }
.tag.tier { font-weight: 700; color: var(--ink); }


/* "Was that on purpose?" question on the feedback card */
.feedback .ask-box { border: 1px solid var(--accent); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.feedback .ask-box p { margin: 0; }
.feedback .ask-box .row { display: flex; gap: 8px; flex-wrap: wrap; }
.feedback .ask-box .row button { padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 600; }
.feedback .ask-box .row button:hover { border-color: var(--accent); }
.feedback .answered { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* delete button in the clip list */
.feedback .moments.parts { max-height: 260px; overflow-y: auto; }
.warn-note { color: var(--warn); margin: 6px 0 0; flex-basis: 100%; }

.debrief .goal-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }

/* seek bar under the video */
.scrub-wrap { position: relative; padding-top: 16px; margin-top: 10px; }
.scrub { position: relative; height: 26px; cursor: pointer; touch-action: none; }
.scrub::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 6px; border-radius: 3px; background: var(--panel2); }
.scrub-bands { position: absolute; left: 0; right: 0; top: 10px; height: 6px; border-radius: 3px; overflow: hidden; }
.scrub-bands span { position: absolute; top: 0; bottom: 0; opacity: .55; }
.scrub-bands span.heel { background: var(--heel-solid); } .scrub-bands span.toe { background: var(--toe-solid); }
.scrub-fill { position: absolute; left: 0; top: 10px; height: 6px; width: 0; border-radius: 3px; background: rgba(18,48,46,.55); pointer-events: none; }
.scrub-knob { position: absolute; top: 13px; left: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--bg); pointer-events: none; }
.scrub:hover::before, .scrub:hover .scrub-bands { top: 9px; height: 8px; }
.scrub:hover .scrub-fill { top: 9px; height: 8px; }
.scrub:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.scrub-marks { position: absolute; left: 0; right: 0; top: 0; height: 16px; }
.scrub-marks button { position: absolute; top: 0; width: 22px; height: 22px; margin-left: -11px; padding: 0; border: 0; background: none; display: flex; align-items: flex-start; justify-content: center; }
.scrub-marks button::after { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--bg); box-sizing: border-box; }
.scrub-marks button.good::after { background: var(--good); border-color: var(--good); }
.scrub-marks button.fall::after { content: "\2715"; width: auto; height: auto; border: 0; background: none; font-size: 11px; font-weight: 800; line-height: 1; color: var(--ink); }
.scrub-marks button:hover::after { transform: scale(1.3); }
.scrub-tip { position: absolute; top: -14px; transform: translateX(-50%); background: var(--ink); color: #F3F6F9; font-size: 12px; padding: 2px 8px; border-radius: 6px; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.time-label { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- coach-first results ---------- */
.run-head { max-width: 720px; margin: 8px auto 18px; display: flex; flex-direction: column; gap: 4px; }
.run-title { font: 800 44px/1 var(--display); font-stretch: 72%; white-space: normal; overflow: visible; }
.run-sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.run-sub .pill.done { display: none; }
.coach-col { max-width: 720px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.coach { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px 36px; display: flex; flex-direction: column; gap: 18px; font-size: 18px; line-height: 1.6; transition: opacity .2s; }
.coach.busy { opacity: .5; pointer-events: none; }
.coach p { margin: 0; }
.coach .opener { font-size: 21px; line-height: 1.5; }
.coach .lead-in { font-weight: 800; }
.coach .good .lead-in { color: var(--good); }
.coach .actions { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.coach .ask-box { border: 1.5px solid var(--accent); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.coach .ask-box .row { display: flex; gap: 8px; flex-wrap: wrap; }
.coach .ask-box .row button { padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 600; }
.coach .answered { font-size: 14px; color: var(--muted); }
@media (max-width: 760px) { .coach { padding: 22px 20px; font-size: 17px; } .coach .opener { font-size: 19px; } .run-title { font-size: 36px; } }

.plan-lite { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px 28px; }
.plan-lite h2 { margin: 0 0 10px; font: 800 24px/1 var(--display); font-stretch: 78%; }
.plan-lite ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.plan-lite .small { margin-top: 12px; }

.moments-sec { max-width: 1200px; width: 100%; margin: 22px auto 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; scroll-margin-top: 16px; }
@media (max-width: 960px) { .moments-sec { grid-template-columns: minmax(0, 1fr); } }
.moment-list { display: flex; flex-direction: column; gap: 18px; }
.moment-list h3 { margin: 0 0 8px; font: 800 20px/1.1 var(--display); font-stretch: 80%; }
.moment-list .chips { display: flex; flex-direction: column; gap: 8px; }
.moment-list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px 14px; font-size: 16px; min-height: 48px; }
.moment-list button:hover, .moment-list button.on { border-color: var(--ink); }
.moment-list .when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.controls .play { width: 44px; height: 40px; border-radius: 20px; background: var(--ink); color: #F3F6F9; border: 0; }
.vopts { position: relative; }
.vopts > summary { cursor: pointer; list-style: none; font-size: 14px; color: var(--muted); padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 99px; }
.vopts > summary::-webkit-details-marker { display: none; }
.vopts[open] > summary { color: var(--text); border-color: #9FB0BF; }
.vopts-body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; width: max-content; max-width: 90vw; box-shadow: 0 8px 24px rgba(18,48,46,.12); }

.results > .details { max-width: 720px; width: 100%; margin: 22px auto 0; }
.detail-feedback { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.detail-feedback h3 { margin: 6px 0 0; }
.detail-feedback p { margin: 0; }
.detail-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }
.plan-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.plan-table caption { text-align: left; font-weight: 700; padding-bottom: 8px; }
.plan-table th, .plan-table td { padding: 10px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 400; }
.plan-table thead th { color: var(--muted); font-size: 13px; border-top: 0; }
.plan-table td.v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: 12px; }
.plan-table td.aim { text-align: right; color: var(--muted); padding-left: 12px; }
.goal-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
/* the coach layout places these in normal grid flow (the old named areas no longer exist) */
.moments-sec .video-col, .detail-grid .line-col { grid-area: auto; }

/* ---------- note clips: each coaching note shows its own moment ---------- */
.run-head, .coach-col, .results > .details { max-width: 880px; }
.coach .note { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; padding: 18px 0; border-top: 1px solid var(--line); }
.coach .note + .note { border-top: 1px solid var(--line); }
.coach .note .note-text p { margin: 0; }
.coach > p.try { padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .coach .note { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.clip { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.clip-stage { position: relative; border-radius: 14px; overflow: hidden; background: var(--night); cursor: pointer; }
.clip-stage video { display: block; width: 100%; max-height: 380px; object-fit: contain; }
.clip-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.clip-badge { position: absolute; left: 10px; top: 10px; background: #F29B30; color: var(--ink); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.clip figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 1.35; }
.clip[data-kind="good"] figcaption b { color: var(--good); }
.clip .clip-label { color: var(--muted); }
.clip-nav { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.clip-nav button { width: 36px; height: 36px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--panel); font-size: 18px; line-height: 1; }
.clip-nav button:hover { border-color: var(--ink); }
.clip-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.clip-cam { position: relative; transform-origin: 0 0; will-change: transform; }

/* ---------- "You -> Try this" 3D stance ---------- */
.three-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0 18px; }
.coach .three { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: start; padding: 18px 0; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .coach .three { grid-template-columns: minmax(0, 1fr); } }
.three-wrap { position: relative; }
.three-view { height: 420px; border-radius: 14px; background: linear-gradient(#E8EEF3, #F7F9FB); overflow: hidden; touch-action: none; }
.three-view canvas { display: block; cursor: grab; }
.three-wait { margin: 0; padding: 20px; color: var(--muted); font-size: 15px; }
.three-tag { position: absolute; z-index: 1; left: 12px; top: 12px; background: #F29B30; color: var(--ink); font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 6px; }
.three-tag.try { background: var(--good); color: #F3F6F9; }
.three-side { display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.three-side p { margin: 0; }
.three-title b.try { color: var(--good); }
.three-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.three-btns button { padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel); font-size: 14px; min-height: 36px; }
.three-btns button.on { background: var(--ink); color: #F3F6F9; border-color: var(--ink); }

.three-view { position: relative; }

.coach .stance-line { margin: 12px 0 0; }
.coach .stance-line .link-btn { margin-left: 4px; }

/* "worth a look": less certain findings, with their moments */
.coach .worth-detail { margin: 8px 0 0; color: var(--muted); }
.coach .worth { padding: 18px 0 4px; border-top: 1px solid var(--line); }
.coach .worth h3 { margin: 0 0 8px; font-size: 16px; }
.coach .worth-item p { margin: 0 0 6px; }
.coach .worth-moments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.coach .worth-moments button { border: 1.5px solid var(--line); background: var(--panel); border-radius: 99px; padding: 3px 10px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.coach .worth-moments button:hover, .coach .worth-moments button:focus-visible { border-color: var(--ink); }
.coach .watch { margin: 6px 0 0; display: flex; flex-direction: column; gap: 2px; }
.coach .watch a { font-weight: 700; color: var(--accent); }

/* ---------- clip library (home): thumbnails or a list ---------- */
.drop.compact { min-height: 0; flex-direction: row; gap: 14px; padding: 18px 22px; justify-content: flex-start; text-align: left; }
.drop.compact .drop-icon { font-size: 24px; }
.drop.compact .drop-title { font-size: 22px; }
.drop.compact .bar { flex: 1; }
.clips { margin-top: 28px; }
.clips-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.clips-head h2 { margin: 0; margin-right: auto; font: 800 26px/1 var(--display); font-stretch: 78%; }
.clips-head .count { color: var(--muted); font-weight: 600; font-stretch: 100%; font-size: 16px; margin-left: 4px; }
#clipSearch { font: inherit; font-size: 14px; padding: 7px 11px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); width: 200px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 6px 10px; color: var(--muted); display: grid; place-items: center; }
.seg button svg { fill: currentColor; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #F3F6F9; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.jobs { list-style: none; margin: 0; padding: 0; }
.jobs .empty { padding: 18px 4px; }
.jobs.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.clip { position: relative; cursor: pointer; min-width: 0; }
.clip .thumb { position: relative; aspect-ratio: 16 / 9; border: 0; padding: 0; margin: 0; border-radius: 12px; overflow: hidden; background: var(--night); }
.clip .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; }
.clip .thumb .bg { object-fit: cover; filter: blur(12px) brightness(.8); transform: scale(1.6); }   /* fills the sides of vertical clips */
.clip .thumb .fg { object-fit: contain; }
.clip .no-thumb { position: absolute; inset: 0; display: grid; place-items: center; color: #B9C7CC; font-size: 13px; }
.clip .badge { position: absolute; left: 8px; bottom: 8px; top: auto; right: auto; height: auto; line-height: 1.4; display: block; max-width: calc(100% - 64px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.92); color: var(--ink); }
.clip .badge.good { background: var(--good); color: #fff; }
.clip .badge.busy { background: #F29B30; color: var(--ink); }
.clip .badge.bad { background: var(--bad); color: #fff; }
.clip .dur { position: absolute; right: 8px; bottom: 8px; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: rgba(14,36,38,.82); color: #fff; font-variant-numeric: tabular-nums; }
.clip .info { min-width: 0; padding: 8px 2px 0; }
.clip .name { display: block; font-weight: 700; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip .meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip .acts { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.clip:hover .acts, .clip:focus-within .acts { opacity: 1; }
@media (hover: none) { .clip .acts { opacity: 1; } }
.clip .acts button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(255,255,255,.94); color: var(--ink); display: grid; place-items: center; font-size: 18px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.clip .acts .del:hover:not(:disabled) { background: #FDECEA; color: var(--bad); }
.clip .acts .del:disabled { opacity: .35; cursor: default; }
.jobs.grid .clip:hover .thumb, .jobs.grid .clip.on .thumb { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.name-input { font: inherit; font-weight: 700; width: 100%; padding: 3px 6px; margin: -4px -7px; border: 1.5px solid var(--accent); border-radius: 6px; background: var(--panel); color: var(--text); }
.run-title + .name-input { font: 800 inherit; font-size: 34px; margin: 0; }

.jobs.list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.jobs.list .clip { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.jobs.list .clip:first-child { border-top: 0; }
.jobs.list .clip:hover, .jobs.list .clip.on { background: var(--panel2); }
.jobs.list .thumb { border-radius: 8px; }
.jobs.list .badge { position: static; display: inline-block; }
.jobs.list .thumb .badge { display: none; }
.jobs.list .dur { right: 4px; bottom: 4px; font-size: 11px; }
.jobs.list .info { padding: 0; }
.jobs.list .acts { position: static; opacity: 1; }
.jobs.list .acts button { box-shadow: none; background: transparent; color: var(--muted); }
.jobs.list .acts button:hover { background: var(--panel); color: var(--ink); }
.clip .info .st { display: none; }
.jobs.list .info { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
.jobs.list .info .name { grid-column: 1; } .jobs.list .info .meta { grid-column: 1; }
.jobs.list .info .st { display: block; grid-column: 2; grid-row: 1 / span 2; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--panel2); white-space: nowrap; }
.jobs.list .info .st.good { background: rgba(31,122,77,.12); color: var(--good); }
.jobs.list .info .st.busy { background: rgba(242,155,48,.2); color: #7A4A0E; }
.jobs.list .info .st.bad { background: #FDECEA; color: var(--bad); }
.rename-btn { border: 0; background: none; color: var(--muted); padding: 2px 4px; border-radius: 5px; vertical-align: middle; }
.rename-btn:hover { color: var(--ink); background: var(--panel2); }
@media (max-width: 560px) { #clipSearch { width: 100%; order: 3; } .jobs.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .drop.compact .muted { display: none; } }

/* ---------- going deeper: chapters after the debrief ---------- */
.go-deeper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.go-deeper span { color: var(--muted); font-size: 14px; margin-right: 4px; }
.go-deeper a { font-size: 14px; font-weight: 650; color: var(--ink); text-decoration: none; border: 1.5px solid var(--line); border-radius: 99px; padding: 5px 12px; background: var(--panel); }
.go-deeper a:hover, .go-deeper a:focus-visible { border-color: var(--ink); }
.deep { width: 100%; max-width: 1040px; margin: 34px auto 0; display: flex; flex-direction: column; gap: 56px; }
.chapter { width: 100%; max-width: 720px; margin: 0 auto; scroll-margin-top: 20px; }
.chapter.wide { max-width: 1040px; }
.ch-title { font: 850 38px/1 var(--display); font-stretch: 72%; letter-spacing: -.005em; margin: 0 0 8px; color: var(--ink); }
.ch-sub { color: var(--muted); margin: 0 0 18px; max-width: 72ch; }
.chapter > p { max-width: 68ch; }
.chapter h3 { font-size: 16px; margin: 0 0 8px; }

/* the run as a ribbon of parts: heel blue, toe amber, skids scraped like a skid mark in the snow */
.ribbon { margin-top: 6px; }
.ribbon-track { position: relative; height: 70px; border-bottom: 2px solid var(--ink); }
.rb { position: absolute; bottom: 0; padding: 0; border: 0; border-left: 2px solid var(--bg); border-right: 2px solid var(--bg); border-radius: 6px 6px 0 0;
  background-color: #7C8E92; cursor: pointer; transition: height .15s ease, filter .15s ease; }
.rb.rb-turn { height: 46px; } .rb.rb-traverse { height: 30px; } .rb.rb-straight_or_slow { height: 12px; } .rb.rb-down { height: 8px; background-color: var(--ink); }
.rb.edge-heel { background-color: var(--heel-solid); } .rb.edge-toe { background-color: var(--toe-solid); }
.rb.v-skid { background-image: repeating-linear-gradient(135deg, rgba(14, 36, 38, .5) 0 3px, transparent 3px 8px); }
.rb.v-grip::after { content: ""; position: absolute; left: 50%; top: 6px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--good); }
.rb.unseen { filter: saturate(.35) opacity(.55); }
.rb:hover { filter: none; height: 52px; } .rb.rb-traverse:hover { height: 34px; }
.rb[aria-selected="true"] { filter: none; box-shadow: 0 0 0 2.5px var(--ink); z-index: 1; }
.rb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; z-index: 2; }
.rb .cite { position: absolute; left: 50%; top: -13px; margin-left: -6px; width: 0; height: 0; border: 6px solid transparent; border-top: 8px solid var(--ink); }
.ribbon-axis { position: relative; height: 20px; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ribbon-axis span { position: absolute; transform: translateX(-50%); }
.ribbon-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin: 6px 0 18px; }
.ribbon-key i.k { display: inline-block; width: 16px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ribbon-key i.heel { background: var(--heel-solid); } .ribbon-key i.toe { background: var(--toe-solid); }
.ribbon-key i.skid { background: #7C8E92 repeating-linear-gradient(135deg, rgba(14, 36, 38, .55) 0 2px, transparent 2px 5px); }
.ribbon-key i.grip { width: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--good); }
.ribbon-key i.cite { width: 0; height: 0; border-radius: 0; border: 5px solid transparent; border-top: 7px solid var(--ink); vertical-align: -4px; }
.ribbon-key i.unseen { background: #7C8E92; opacity: .45; }

.turn-panel { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 26px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.turn-panel .clip-stage video { max-height: 340px; }
.turn-notes h3 { font: 800 24px/1.1 var(--display); font-stretch: 80%; margin: 4px 0 10px; }
.cite-note { font-weight: 650; margin: 0 0 10px; }
.seen-list { list-style: none; margin: 0 0 8px; padding: 0; }
.seen-list li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 7px 0 7px 16px; border-top: 1px solid var(--line); position: relative; }
.seen-list li:first-child { border-top: 0; }
.seen-list li::before { content: ""; position: absolute; left: 0; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.seen-list li.good::before { background: var(--good); } .seen-list li.bad::before { background: var(--warn); }
.seen-list .rk { color: var(--muted); font-size: 14px; }
.turn-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.turn-nav button:not(.link-btn) { border: 1.5px solid var(--line); background: var(--panel); border-radius: 99px; padding: 5px 14px; font-weight: 650; }
.turn-nav button:not(.link-btn):hover:not(:disabled) { border-color: var(--ink); }
.turn-nav button:disabled { opacity: .4; cursor: default; }

/* the drill, in full */
.chapter .cue { font: 750 23px/1.25 var(--display); font-stretch: 85%; color: var(--ink); margin: 20px 0; max-width: 34ch; }
.steps { list-style: none; counter-reset: step; margin: 0 0 18px; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 10px 0 10px 44px; border-top: 1px solid var(--line); max-width: 64ch; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #F3F6F9; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.working { border-left: 4px solid var(--good); padding: 4px 0 4px 14px; margin: 0 0 20px; }
.drill-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-bottom: 14px; }
.drill-more ul { margin: 0; padding-left: 18px; } .drill-more p { margin: 0 0 12px; }

/* what this clip showed us */
.checked-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin: 18px 0 26px; }
.checked, .unchecked { list-style: none; margin: 0; padding: 0; }
.checked li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.checked li:first-child, .unchecked li:first-child { border-top: 0; }
.checked .st { flex: none; line-height: 1.5; font-size: 13px; font-weight: 700; white-space: nowrap; padding: 1px 9px; border-radius: 99px; background: rgba(31, 122, 77, .12); color: var(--good); }
.checked .found .st { background: rgba(183, 110, 0, .14); color: var(--warn); }
.checked .worth .st { background: var(--panel2); color: var(--ink); }
.unchecked li { padding: 8px 0; border-top: 1px solid var(--line); }
.chapter .tip { margin-top: 14px; font-size: 14px; }

@media (max-width: 760px) {
  .ch-title { font-size: 31px; }
  .deep { gap: 44px; }
  .turn-panel, .checked-cols, .drill-more { grid-template-columns: minmax(0, 1fr); }
  .ribbon-track { height: 62px; }
}
@media (prefers-reduced-motion: reduce) { .rb { transition: none; } }

/* ================= results, redesigned: desktop = debrief hero + tabs, phone = stepped lesson ================= */
.run-note { margin: 2px 0 0; font-size: 13px; color: var(--muted); max-width: 70ch; }
.edit-btn { align-self: flex-start; margin-top: 8px; border: 1.5px solid var(--line); background: var(--panel); border-radius: 99px; padding: 6px 14px; font-weight: 650; color: var(--ink); }
.edit-btn:hover, .edit-btn[aria-expanded="true"] { border-color: var(--ink); }
.edit-panel { max-width: 720px; margin: 0 auto 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.ep-row { display: flex; flex-direction: column; gap: 6px; }
.ep-row label, .ep-label { font-weight: 650; font-size: 14px; }
.ep-name { display: flex; gap: 8px; } .ep-name input { flex: 1; font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; }
.ep-name button { border: 0; background: var(--ink); color: #F3F6F9; border-radius: 8px; padding: 0 14px; font-weight: 700; }
.ep-row:last-child { flex-direction: row; justify-content: space-between; }

.coach-col.r-wide { max-width: 1180px; }
.coach.r-card { padding: 0; background: none; border: 0; box-shadow: none; }
.r-card h2 { font-size: 17px; margin: 0 0 4px; }
.r-card p { margin: 0; }
.r-card .tlink { font-weight: 650; }

/* hero: one player beside the three-part debrief */
.r-hero { display: flex; flex-wrap: wrap; gap: 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.r-player { flex: 0 1 380px; min-width: 250px; display: flex; flex-direction: column; gap: 12px; }
.r-clip { margin: 0; }
.r-clip .clip-stage { aspect-ratio: 9 / 14; border-radius: 16px; background: var(--panel2); }
.r-clip .clip-cam { width: 100%; height: 100%; }   /* the follow-cam maths assumes the video fills the stage */
.r-clip .clip-stage video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.r-cap { position: absolute; left: 12px; bottom: 12px; background: rgba(14, 36, 38, .82); color: #fff; font-size: 13px; font-weight: 650; padding: 3px 9px; border-radius: 6px; max-width: calc(100% - 24px); }
.r-cap:empty { display: none; }
.r-3d { position: absolute; right: 12px; top: 10px; z-index: 2; border: 0; background: #F29B30; color: var(--ink); border-radius: 99px; padding: 8px 16px; font-weight: 800; font-size: 14px; box-shadow: 0 2px 10px rgba(18, 48, 46, .25); }
.r-3d[aria-pressed="true"] { background: rgba(255, 255, 255, .94); }
.r-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.r-chips button { border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 99px; padding: 6px 13px; font-size: 14px; font-weight: 650; }
.r-chips button:hover { border-color: var(--ink); }
.r-chips button[aria-pressed="true"] { background: var(--ink); color: #F3F6F9; border-color: var(--ink); }
.r-text { flex: 999 1 400px; min-width: 0; max-width: 640px; display: flex; flex-direction: column; gap: 18px; }
.r-opener { font-size: 20px; line-height: 1.45; }
.r-block.good h2 { color: var(--good); }
.r-times { margin-left: 4px; }
.r-try { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.r-cue { font: 800 25px/1.2 var(--display); font-stretch: 85%; color: var(--ink); max-width: 30ch; }
.r-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.r-actions .primary { border-radius: 99px; padding: 12px 22px; font-weight: 750; }
.r-watch { font-weight: 650; }
.r-also { border-top: 1px solid var(--line); padding-top: 14px; }
.r-also p + p { margin-top: 6px; }
.coach.r-card .three { margin-top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }

/* go deeper: one chapter at a time */
.r-deeper { margin-top: 34px; display: flex; flex-direction: column; gap: 20px; }
.r-tabs { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.r-tabs h2 { margin: 0 8px 0 0; align-self: center; font: 850 32px/1 var(--display); font-stretch: 72%; }
.r-tabs button { text-align: left; border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 14px; padding: 10px 16px; min-width: 180px; display: flex; flex-direction: column; }
.r-tabs button span { font-size: 13px; color: var(--muted); }
.r-tabs button:hover { border-color: var(--ink); }
.r-tabs button[aria-selected="true"] { background: var(--ink); color: #F3F6F9; border-color: var(--ink); }
.r-tabs button[aria-selected="true"] span { color: #B9C7CC; }
.r-tabpanel { display: flex; flex-direction: column; gap: 16px; }
.r-tabpanel > .muted:first-child { max-width: 72ch; }
.r-drill, .r-checked { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.r-drill-name { font: 850 36px/1 var(--display); font-stretch: 72%; margin: 0; }
.r-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.r-cards > div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.r-cards h4 { margin: 0 0 2px; font-size: 15px; }
.r-fold { border-top: 1px solid var(--line); padding-top: 10px; }
.r-fold summary { cursor: pointer; min-height: 28px; }
.r-fold ul { margin: 8px 0 0; padding-left: 18px; } .r-fold p { margin-top: 6px; }
.r-plan { max-width: 760px; background: var(--ink); color: #F3F6F9; border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.r-plan h3 { margin: 0; font: 800 21px/1.1 var(--display); font-stretch: 85%; }
.r-plan ol { margin: 0; padding-left: 20px; }
.r-plan-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.r-plan-actions button { border: 0; background: #F3F6F9; color: var(--ink); border-radius: 99px; padding: 8px 16px; font-weight: 750; }
.r-plan .on-dark { color: #F3F6F9; }
.r-list { list-style: none; margin: 0; padding: 0; }
.r-list li { padding: 9px 0; border-top: 1px solid var(--line); }
.r-st { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(183, 110, 0, .14); color: var(--warn); margin-right: 4px; white-space: nowrap; }
.r-checked h3 { font-size: 16px; margin: 0 0 4px; }
.r-tip { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.r-tip svg { flex: none; margin-top: 1px; color: var(--ink); }
.r-table { max-width: 760px; overflow-x: auto; }
.r-table table { width: 100%; border-collapse: collapse; min-width: 380px; }
.r-table caption { text-align: left; font-weight: 750; padding-bottom: 6px; }
.r-table th, .r-table td { padding: 9px 0; border-bottom: 1px solid var(--line); text-align: right; }
.r-table th[scope="row"], .r-table thead th:first-child { text-align: left; font-weight: 500; }
.r-table thead th { color: var(--muted); font-weight: 600; }
.r-table .v { font-weight: 750; }
.r-raw { align-self: flex-start; }
.turn-notes .seen-list li { display: block; padding: 7px 0; }
.turn-notes .seen-list li::before { display: none; }

/* phone: a four-step lesson, then the review */
.r-phone { display: flex; flex-direction: column; gap: 14px; }
.r-progress { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.r-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.r-bars i { height: 4px; border-radius: 2px; background: var(--line); }
.r-bars i.on { background: var(--ink); }
.r-step { display: flex; flex-direction: column; gap: 12px; }
.r-phone .r-clip .clip-stage { aspect-ratio: auto; height: min(56vh, 460px); }
.r-phone .r-clip.landscape .clip-stage { height: auto; aspect-ratio: 4 / 3; }   /* no empty bands above and below a landscape clip */
.r-step-title { font: 850 34px/1 var(--display); font-stretch: 72%; margin: 6px 0 0; }
.r-step-title.good { color: var(--good); }
.r-big { font-size: 18px; }
.r-phone .r-opener { font-size: 16px; color: var(--muted); }
.r-nav { display: flex; gap: 10px; position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.r-nav .primary { flex: 1; min-height: 48px; border-radius: 99px; font-weight: 750; }
.r-nav .ghost { min-height: 48px; border-radius: 99px; padding: 0 16px; }
.r-watch-card { display: block; background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; }
.r-compare h3 { font-size: 16px; margin: 0 0 4px; }
.r-cmp { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.r-review { text-align: left; border: 1.5px solid var(--ink); background: var(--panel); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.r-review span { font-size: 14px; color: var(--muted); }
.r-back { align-self: flex-start; }
.r-switch { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.r-switch button { min-height: 44px; border: 1.5px solid var(--line); background: var(--panel); border-radius: 12px; font-weight: 650; color: var(--ink); }
.r-switch button[aria-selected="true"] { background: var(--ink); color: #F3F6F9; border-color: var(--ink); }
.r-phone .r-plan { padding: 16px; }
.r-phone .r-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r-phone .turn-panel { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) {
  .edit-panel { margin: 0 0 14px; }
  .r-cards { grid-template-columns: minmax(0, 1fr); }
}
/* results header: as wide as the results, edit button on the right */
.run-head { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 2px; align-items: end; }
.run-head > * { grid-column: 1; }
.run-head .edit-btn { grid-column: 2; grid-row: 1 / span 2; align-self: end; margin: 0 0 4px; }
.edit-panel { max-width: 1180px; }
@media (max-width: 760px) { .run-head .edit-btn { grid-row: 1; align-self: center; margin: 0; } }
.r-drill .steps li { max-width: none; }
@media (max-width: 760px) {
  .run-head .run-note { display: none; }
  .run-head .run-title { font-size: 34px; }
  .run-head .edit-btn { padding: 5px 11px; font-size: 14px; }
  .run-head .run-sub { font-size: 13px; }
}
.r-eyebrow { font-weight: 650; color: var(--muted); margin: 4px 0 -6px; }
.r-hero.landscape .r-player { flex-basis: 520px; }
.r-hero.landscape .r-clip .clip-stage { aspect-ratio: 4 / 3; }
.r-hero.landscape .r-text { flex-basis: 360px; }

/* ---- 3D: a button you can't miss, and controls inside the frame ---- */
.three-cta-btn { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 12px; padding: 14px 16px; border: 0; border-radius: 16px;
  background: var(--ink); color: #F3F6F9; text-align: left; cursor: pointer; }
.three-cta-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #F29B30; color: var(--ink); }
.three-cta-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.three-cta-text b { font-size: 17px; }
.three-cta-text span { font-size: 14px; color: #B9C7CC; }
.three-cta-go { font-size: 26px; line-height: 1; color: #B9C7CC; }
.three-cta-btn:focus-visible { outline: 3px solid #F29B30; outline-offset: 2px; }
.three-toggle { position: absolute; z-index: 2; left: 10px; top: 10px; display: flex; padding: 3px; border-radius: 99px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 1px 6px rgba(18, 48, 46, .15); }
.three-toggle button { border: 0; background: none; color: var(--ink); font-weight: 750; font-size: 14px; padding: 7px 13px; min-height: 36px; border-radius: 99px;
  transition: background .25s, color .25s; cursor: pointer; }
.three-toggle button[aria-pressed="true"]#threeYou { background: #F29B30; }
.three-toggle button[aria-pressed="true"]#threeTry { background: var(--good); color: #F3F6F9; }
.three-play { position: absolute; z-index: 2; right: 10px; top: 10px; width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 1px 6px rgba(18, 48, 46, .15); cursor: pointer; }
.three-toggle button:focus-visible, .three-play:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.three-hint { position: absolute; z-index: 2; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: none; font-size: 13px; font-weight: 700; color: var(--ink); }
.three-hint > span:last-child { background: rgba(255, 255, 255, .92); padding: 4px 10px; border-radius: 99px; }
.three-hint[hidden] { display: none; }
.three-hand { display: block; filter: drop-shadow(0 2px 3px rgba(18, 48, 46, .3)); animation: three-drag 2.6s ease-in-out .7s 2; }
@keyframes three-drag { 0%, 100% { transform: translateX(0) } 25% { transform: translateX(34px) rotate(8deg) } 75% { transform: translateX(-34px) rotate(-8deg) } }
@media (prefers-reduced-motion: reduce) { .three-hand { animation: none; } }
.three-tag { display: none; }

/* inside the iPhone app: the app has its own navigation and branding */
body.embed > header, body.embed [data-act="home"], body.embed .r-nav [data-act="home"] { display: none !important; }

/* the rider's own question, answered first */
.r-answer { border-left: 4px solid #F29B30; background: var(--panel); border-radius: 0 14px 14px 0; padding: 12px 14px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.r-answer .r-q { margin: 0; color: var(--muted); font-size: 14px; }
.r-answer .r-a { margin: 0; font-size: 17px; line-height: 1.45; }
.r-answer-watch { align-self: flex-start; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1.5px solid var(--ink); background: none; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }

.r-asked { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.4; }
