/* Fitnahit - light, precise and sporty: the calm of a clinic with the energy of a race number.
   Archivo (wide, heavy, italic for the big statements) for headings and numbers, Inter for text, JetBrains Mono
   only where it is a technical readout (the processing screen, logs, measured values).
   The brand green #16DB65 is a highlight - the main action, selected states, good news - on deep pine ink and
   cool paper; it is never the colour of everything. Text on light backgrounds uses the deep green (WCAG AA). */
:root {
  --green: #16DB65; --green-600: #0FBF55; --green-deep: #0A6B36; --green-ink: #04301A;
  --mint: #ECF9F1; --mint-2: #D5F4E1;
  --bg: #F3F6F4; --surface: #FFFFFF; --sunk: #EEF2F0; --ink: #0C1A16; --ink-2: #2C3B35; --muted: #5F6E68; --faint: #93A19B;
  --line: #E1E7E4; --line-2: #CCD6D1;
  --warn: #9A4D08; --warn-bg: #FFF5E6; --orange: #F08A00; --bad: #B42323; --bad-bg: #FDF0F0;
  --next: #5B4BC4; --try: #1872B5;
  --dark: #0A1F18; --dark-2: #10291F; --dark-line: #1F3B2E; --neon: #16DB65; --amber: #FFB020;
  --r: 18px; --r-sm: 11px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --display: "Archivo", "Inter", ui-sans-serif, system-ui, sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --shadow: 0 1px 2px rgba(12, 26, 22, .04), 0 8px 24px -18px rgba(12, 26, 22, .18);
  --shadow-pop: 0 18px 44px -16px rgba(12, 26, 22, .3);
  /* The edge of a ruler: the measuring motif used under headings and on dark panels. */
  --ticks: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 8px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--display); font-stretch: 108%; }
h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.08; margin: 0 0 var(--s2); letter-spacing: -.025em; font-weight: 800; font-style: italic; font-stretch: 116%; }
h2 { font-size: 1.14rem; margin: 0 0 var(--s4); display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.012em; }
h3 { font-size: 1rem; margin: 0 0 var(--s3); font-weight: 700; letter-spacing: -.008em; }
.muted { color: var(--muted); font-weight: 400; } .small { font-size: .82rem; }
.error { color: var(--bad); font-weight: 500; }
button, select, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--green-deep); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
/* Small section labels: sentence case would be too quiet, mono caps too loud. */
.label { font: 600 .72rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------ top bar */
.topbar { background: rgba(255, 255, 255, .9); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px var(--s5); display: flex; align-items: center; gap: var(--s4); min-height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.logo { width: 28px; height: 28px; color: var(--ink); }
.wordmark { font: italic 800 1.2rem var(--display); font-stretch: 118%; letter-spacing: -.03em; }
.wordmark b { color: var(--green-600); font-weight: 800; }
.spacer { flex: 1; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 2px; background: var(--sunk); }
.lang button { border: 0; background: none; padding: 3px 10px; border-radius: 99px; font-weight: 600; font-size: .76rem; color: var(--muted); }
.lang button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 26, 21, .12); }
.linkish { white-space: nowrap; background: none; border: 0; color: var(--muted); font-size: .78rem; padding: 4px 2px; }
.linkish:hover { color: var(--ink); }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 12px 3px 3px;
  font: 500 .8rem var(--sans); color: var(--ink-2); max-width: 210px; }
.acct-btn:hover { border-color: var(--line-2); background: var(--sunk); }
.acct-btn .av { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--green);
  font: 800 .78rem var(--display); text-transform: uppercase; }
.acct-btn .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .acct-btn { padding: 3px; } .acct-btn .who { display: none; } }

main { max-width: 1180px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }

/* ------------------------------------------------ cards & forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow); }
.intake-grid { display: grid; grid-template-columns: 1.08fr 1fr; gap: var(--s5); align-items: start; }
.col { display: grid; gap: var(--s5); }
@media (max-width: 900px) { .intake-grid { grid-template-columns: 1fr; } }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: var(--green);
  font: italic 800 .84rem var(--display); flex: none; }

.drop { display: grid; place-items: center; min-height: 230px; border: 1.5px dashed var(--line-2); border-radius: 14px;
  background: var(--sunk) radial-gradient(rgba(12, 26, 22, .07) 1px, transparent 1.3px) 0 0 / 18px 18px;
  cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--green-600); background-color: var(--mint); }
.drop video { width: 100%; max-height: 340px; object-fit: contain; background: #000; display: block; }
.drop-hint { display: grid; justify-items: center; gap: 6px; color: var(--muted); text-align: center; padding: var(--s5); font-size: .88rem; }
.drop-hint svg { width: 52px; height: 52px; padding: 13px; border-radius: 50%; background: var(--ink); color: var(--green); margin-bottom: 8px;
  box-shadow: 0 0 0 6px rgba(22, 219, 101, .14); transition: transform .2s ease; }
.drop:hover .drop-hint svg, .drop.over .drop-hint svg { transform: translateY(-3px); }
.drop-hint strong { color: var(--ink); font: 700 1.05rem var(--display); font-stretch: 108%; letter-spacing: -.01em; }
#fileMeta:empty { display: none; }
#fileMeta { margin: var(--s3) 0 0; }

/* ------------------------------------------------ filming guide */
.cam-title { margin-bottom: var(--s2); }
.cam-title b { font-weight: 700; }
.alert-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff; font: 700 .85rem var(--display); flex: none; }
.cam-rule { margin: 0 0 var(--s5); color: var(--ink-2); }
.cam-rule b { color: var(--ink); }
.cam-fig { margin: 0 0 var(--s5); }
.cam-fig figcaption { display: grid; gap: 2px; margin-bottom: var(--s3); font-size: .86rem; color: var(--muted); }
.cam-fig figcaption strong { font: 600 .95rem var(--display); color: var(--ink); letter-spacing: -.01em; }
.cam-fig svg { display: block; width: 100%; height: auto; }
.cam-place { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s4); align-items: center;
  background: var(--sunk); border-radius: 12px; padding: var(--s3) var(--s4) var(--s3) var(--s2); }
.cam-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.cam-legend li { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start; font-size: .8rem; line-height: 1.4; color: var(--muted); }
.cam-legend svg { width: 38px; height: 24px; }
.cam-legend b { display: block; color: var(--ink); font: 600 .85rem var(--display); }
@media (max-width: 560px) { .cam-place { grid-template-columns: 1fr; padding: var(--s3); } .cam-legend { grid-template-columns: 1fr 1fr; } }
/* top view */
.t-fov { fill: var(--green); fill-opacity: .1; }
.t-fov-edge { fill: none; stroke: var(--green-600); stroke-width: 1.2; stroke-dasharray: 5 4; }
.t-tyre { fill: var(--ink); }
.t-frame { stroke: #4A5650; stroke-width: 3.5; stroke-linecap: round; }
.t-bar { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.t-hood { fill: #4A5650; }
.t-saddle { fill: var(--ink); }
.t-thigh { stroke: #1D2622; stroke-width: 11; stroke-linecap: round; }
.t-shoe { fill: #fff; stroke: var(--ink); stroke-width: 1.4; }
.t-skin { stroke: #E2AE8C; stroke-width: 6; stroke-linecap: round; }
.t-sleeve { stroke: var(--green-600); stroke-width: 8; stroke-linecap: round; }
.t-torso { fill: var(--green); }
.t-helmet { fill: #fff; stroke: var(--ink); stroke-width: 1.6; }
.t-vents { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.t-hub { fill: #fff; stroke: var(--ink); stroke-width: 1.6; }
.t-dim { fill: none; stroke: var(--faint); stroke-width: 1.2; }
.t-axis { stroke: var(--green-deep); stroke-width: 1.2; stroke-dasharray: 3 4; }
.t-arrow { fill: none; stroke: var(--green-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.t-label { font: 600 12px var(--display); fill: var(--green-deep); }
.t-label.big { font-size: 20px; letter-spacing: -.02em; }
.t-shadow { fill: rgba(17, 26, 21, .08); }
.t-tripod { fill: none; stroke: #4A5650; stroke-width: 2.2; stroke-linecap: round; }
.t-phone { fill: var(--ink); }
.t-lens { fill: var(--green); }
/* phone view */
.cam-phone { max-width: 520px; margin: 0 auto; }
.p-body { fill: #1B2420; }
.p-cam { fill: #3A4741; }
.p-level { stroke: var(--green-deep); stroke-width: 1.4; stroke-dasharray: 6 4; }
.p-corners { fill: none; stroke: var(--green-600); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.p-rec { fill: #E5484D; }
.p-tiny { font: 600 10px var(--sans); fill: var(--ink-2); letter-spacing: .04em; }
.p-label { font: 600 10.5px var(--sans); fill: var(--green-deep); }
.p-pointer { fill: none; stroke: var(--green-deep); stroke-width: 1.3; stroke-linecap: round; }
.p-chip { fill: rgba(17, 26, 21, .72); }
.p-chip-t { font: 600 10px var(--sans); fill: #fff; text-anchor: middle; }
/* avoid */
.cam-avoid { border-top: 1px solid var(--line); padding-top: var(--s5); margin-bottom: var(--s5); }
.cam-avoid h3 { display: flex; align-items: center; gap: 10px; }
.avoid-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bad); color: #fff; font: 700 .8rem var(--display); }
.cam-avoid ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.cam-avoid li { display: grid; align-content: start; gap: 3px; font-size: .78rem; line-height: 1.4; color: var(--muted); }
.cam-avoid li svg { width: 100%; height: auto; display: block; margin-bottom: 6px; }
.cam-avoid li b { color: var(--ink); font: 600 .86rem var(--display); display: flex; align-items: center; gap: 6px; }
.cam-avoid li b::before { content: "✕"; color: var(--bad); font: 700 .8rem var(--sans); }
@media (max-width: 560px) { .cam-avoid ul { grid-template-columns: 1fr; gap: var(--s4); }
  .cam-avoid li { grid-template-columns: 130px 1fr; column-gap: var(--s3); align-items: start; }
  .cam-avoid li svg { grid-row: span 2; margin: 0; } }
.a-bg { fill: var(--sunk); }
.a-ground { stroke: var(--line-2); stroke-width: 1.2; }
.a-ray { fill: none; stroke: var(--bad); stroke-width: 1.3; stroke-dasharray: 4 3; }
.a-tripod { fill: none; stroke: #4A5650; stroke-width: 1.8; stroke-linecap: round; }
.a-phone { fill: var(--ink); }
.a-pbody { fill: #1B2420; }
.a-warp { fill: none; stroke: #C9D4CE; stroke-width: 1.2; }
.a-chip-t { font: 600 8.5px var(--sans); fill: #fff; text-anchor: middle; }
.a-x circle { fill: var(--bad); }
.a-x path { stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
/* checklist */
.cam-check { border-top: 1px solid var(--line); padding-top: var(--s5); }
.checklist { list-style: none; margin: 0; padding: 0; font-size: .87rem; color: var(--ink-2); display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 30px; line-height: 1.5; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--mint-2)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.3l2.7 2.7L14 7.6' fill='none' stroke='%230B6E35' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }
.checklist b { color: var(--ink); font-weight: 600; }

.field { display: grid; gap: 6px; font-size: .84rem; font-weight: 500; color: var(--ink-2); margin-bottom: var(--s4); align-content: start; }
.field input, .field select { font-weight: 400; font-size: .94rem; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); width: 100%; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s; }
.field input:hover, .field select:hover { border-color: #B9C3BE; }
.field input::placeholder { color: #A8B2AD; }
.field input:focus, .field select:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(22, 219, 101, .18); }
.input-unit { position: relative; display: block; }
.input-unit em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--faint); font-weight: 500; font-size: .85rem; pointer-events: none; }
.hint { font-weight: 400; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.seg { display: flex; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 6px; border-radius: 7px; font-size: .84rem; font-weight: 500; color: var(--muted); transition: color .15s, background .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(17, 26, 21, .1), 0 0 0 1px rgba(17, 26, 21, .04); }
/* Typed numbers only: the browser's spinner arrows sat on top of the unit label. */
.field input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.field input[type=number]::-webkit-inner-spin-button, .field input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-unit input { padding-right: 40px; }
.req { color: var(--orange); }
.field.invalid input { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 138, 0, .18); }
.hint.warn { color: var(--warn); font-weight: 500; }
.more { border-top: 1px solid var(--line); padding-top: var(--s4); margin-top: var(--s1); }
.more-title { font: 600 .92rem var(--display); color: var(--ink); margin: 0 0 var(--s3); }
.more-title .muted { font: 400 .84rem var(--sans); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip-group { width: 100%; font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: var(--s3); }
.chip-group:first-child { margin-top: 0; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 6px 13px; font-size: .84rem; font-weight: 500; color: var(--ink-2); transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips:not(.small) .chip.on::before { content: "\2713"; color: var(--green); font-weight: 700; margin-right: 6px; }

.primary { width: 100%; padding: 16px; border: 0; border-radius: 99px; background: var(--green); color: var(--green-ink); font: italic 800 1.06rem var(--display); font-stretch: 112%; letter-spacing: -.005em;
  transition: background .15s, transform .08s, box-shadow .2s; box-shadow: inset 0 -2px 0 rgba(4, 48, 26, .14), 0 10px 24px -12px rgba(22, 219, 101, .7); }
.primary:hover { background: #2BE476; box-shadow: inset 0 -2px 0 rgba(4, 48, 26, .14), 0 14px 28px -12px rgba(22, 219, 101, .85); } .primary:active { transform: translateY(1px); }
.primary:disabled { background: #D3EBDC; color: #7A9A88; cursor: not-allowed; box-shadow: none; }
.ghost { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 9px 17px; font-weight: 600; font-size: .9rem; color: var(--ink); transition: border-color .15s, background .15s; }
.ghost:hover { border-color: var(--ink-2); background: var(--sunk); }
.btn { display: inline-block; text-decoration: none; border-radius: 99px; font-weight: 700; }
.primary-sm { background: var(--green); color: var(--green-ink); padding: 10px 18px; border: 0; font-family: var(--display); font-stretch: 108%; box-shadow: inset 0 -2px 0 rgba(4, 48, 26, .14); }
.primary-sm:hover { background: #2BE476; }
.danger-sm { background: var(--bad); color: #fff; padding: 10px 18px; border: 0; }
.danger-sm:hover { filter: brightness(.9); }
.danger-sm:disabled { opacity: .6; }
.del-link { color: var(--muted); }
.del-link:hover { color: var(--bad); }

.label-row { display: inline-flex; align-items: center; gap: 6px; }
.info { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.4px solid var(--faint);
  color: var(--faint); cursor: help; }
.info > svg { width: 8px; height: 8px; fill: currentColor; display: block; }
.info:hover, .info:focus, .info.open { border-color: var(--green-deep); color: var(--green-deep); outline: none; }
.info .tip { display: none; position: absolute; z-index: 30; left: 50%; top: calc(100% + 10px); transform: translateX(-50%); width: min(310px, 80vw);
  background: var(--ink); color: #E8EEEA; font: 400 .8rem/1.55 var(--sans); padding: var(--s3) var(--s4); border-radius: 12px; box-shadow: var(--shadow-pop); text-align: left; }
.info .tip b { color: #fff; font-weight: 600; }
.info .tip::before { content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
.info.open .tip { display: block; }
@media (hover: hover) { .info:hover .tip { display: block; } }   /* touch screens: tap to open, tap again to close */
.info .tip.end { left: auto; right: -12px; transform: none; }
.info .tip.end::before { left: auto; right: 14px; transform: none; }
/* Phones: the bubble sits at the bottom of the screen, full width, with a close mark (any tap closes it). */
@media (max-width: 600px) {
  .info .tip, .info .tip.end { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; transform: none;
    z-index: 60; padding-right: 40px; font-size: .88rem; max-height: 60vh; overflow-y: auto; }
  .info .tip::before { display: none; }
  .info .tip::after { content: "×"; position: absolute; top: 6px; right: 14px; font-size: 1.3rem; line-height: 1; color: #fff; opacity: .8; }
}

/* ------------------------------------------------ processing (dark, technical, mono) */
.proc-box { background: var(--dark) radial-gradient(120% 90% at 20% 0%, #12352A 0%, transparent 60%); color: #CFE3D7; border-radius: 26px; padding: var(--s6) var(--s5) var(--s5); font-family: var(--mono);
  position: relative; overflow: hidden; }
.proc-box::before { content: ""; position: absolute; left: var(--s5); right: var(--s5); top: 12px; height: 7px; color: rgba(255, 255, 255, .16); background: var(--ticks); }
.proc-box h2 { color: #fff; font-family: var(--mono); font-size: 1rem; font-weight: 600; }
.proc-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--s5); }
@media (max-width: 960px) { .proc-grid { grid-template-columns: 1fr; } }
.viewport { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 70vh; margin: 0 auto; border: 1px solid var(--dark-line); }
.viewport video, .viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.viewport canvas { pointer-events: none; }
.viewport.small { max-height: 62vh; border: 0; }
.viewport.small video { opacity: .92; cursor: pointer; }

/* loader: a close-up of a turning crankset */
.stage-view { display: grid; place-items: center; min-height: 420px; }
.loader { display: grid; justify-items: center; text-align: center; gap: 6px; width: 100%; max-width: 520px; }
.loader-svg { width: 100%; max-width: 500px; height: auto; display: block; }
/* crank scene */
.chain-base { fill: none; stroke: #16241D; stroke-width: 8; }
.chain-plates { fill: none; stroke: #5F7A6C; stroke-width: 5.5; stroke-dasharray: 6.5 2.5; }
.chain-pins { fill: none; stroke: #CBD8D1; stroke-width: 2.6; stroke-dasharray: 1.4 7.6; stroke-linecap: round; }
.teeth { fill: #3B5547; stroke: #4F6E5E; stroke-width: .6; }
.ring-body { fill: url(#ringGrad); stroke: var(--neon); stroke-width: 1.6; }
.ring-inner { fill: none; stroke: #2D453A; stroke-width: 1.2; }
.spider-arm { stroke: #5D7B6B; stroke-width: 5; stroke-linecap: round; }
.bolt { fill: #9FB0A7; }
.crank-arm { stroke: url(#armGrad); stroke-width: 10; stroke-linecap: round; }
.bb-cap { fill: #0E1612; stroke: #9FB0A7; stroke-width: 2.5; }
.skin { fill: #D7A07C; stroke: #D7A07C; stroke-width: 2; stroke-linejoin: round; }
.kneecap { fill: #E2AE8C; }
.shorts { fill: #0B0E0D; stroke: #0B0E0D; stroke-width: 2; stroke-linejoin: round; }
.stripe { fill: var(--neon); }
.sock { fill: #F1F5F3; stroke: #F1F5F3; stroke-width: 1.5; stroke-linejoin: round; }
.shoe .pedal-body { fill: #2B3531; stroke: #47574F; stroke-width: 1; }
.shoe .pedal-cage { stroke: #5F7068; stroke-width: 1.1; }
.shoe .pedal-axle { fill: #A9B7AF; }
.shoe .cleat { fill: #E24C3B; }
.shoe .sole { fill: #151A18; }
.shoe .upper { fill: #F4F7F5; stroke: #C9D3CE; stroke-width: 1; stroke-linejoin: round; }
.shoe .heel { fill: #1E2622; }
.shoe .strap { stroke: #AEBBB4; stroke-width: 2.4; stroke-linecap: round; }
.shoe .dial { fill: var(--neon); stroke: #0B6E35; stroke-width: 1; }
.shoe .toe-accent { fill: var(--neon); }
/* far side: same parts, pushed back */
.far .skin, .shoe.far .upper { fill: #7E5D49; stroke: #7E5D49; }
.far .shorts { fill: #050706; stroke: #050706; }
.far .sock { fill: #8C9590; stroke: #8C9590; }
.far .crank-arm { stroke: #4B5D54; }
.shoe.far .pedal-body, .shoe.far .sole, .shoe.far .heel { fill: #1A211E; stroke: none; }
.shoe.far .strap, .shoe.far .pedal-cage { stroke: #5C6762; }
.shoe.far .dial, .shoe.far .toe-accent { fill: #0F7A3D; }
.shoe.far .cleat { fill: #7B2E25; }
.loader-pct { font: 700 2.7rem/1 var(--mono); color: #fff; letter-spacing: -.03em; margin-top: var(--s1); font-variant-numeric: tabular-nums; }
.loader-stage { font: 500 .9rem var(--mono); color: var(--neon); min-height: 1.4em; }
.loader-eta { font-size: .8rem; color: #7A9787; min-height: 1.2em; }
.loader-tip { font: 400 .88rem/1.55 var(--sans); color: #A5C4B3; max-width: 380px; min-height: 3em; margin: var(--s3) 0 0; }
.loader.stopped .loader-stage { color: var(--amber); }

.stages { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: 8px; font-size: .84rem; }
.stages li { position: relative; padding-left: 26px; color: #5E7B6B; }
.stages li::before { content: ""; position: absolute; left: 0; top: 3px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #2D4A3A; }
.stages li.active { color: #fff; } .stages li.active::before { border-color: var(--neon); border-top-color: transparent; animation: spin .8s linear infinite; }
.stages li.done { color: #A5C4B3; } .stages li.done::before { background: var(--neon); border-color: var(--neon); }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 6px; background: var(--dark-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--dark-line); }
.bar div { height: 100%; width: 0; background: var(--neon); transition: width .4s ease; }
.proc-note { color: #FFC978; font-size: .82rem; line-height: 1.5; margin: var(--s3) 0 0; }
.bar-meta { display: flex; justify-content: space-between; font-size: .76rem; color: #7A9787; margin-top: 6px; }
.log { font: .73rem/1.6 var(--mono); background: #040A07; border: 1px solid var(--dark-line); border-radius: 10px; padding: var(--s3);
  height: 270px; overflow: auto; white-space: pre-wrap; color: #9FEABF; margin: var(--s4) 0 0; }
.log .t { color: #4D6E5C; }
.dark-ghost { margin-top: var(--s3); background: transparent; color: #fff; border-color: #2D4A3A; }
.dark-ghost:hover { background: #12241B; border-color: #3E6450; }

/* ------------------------------------------------ results */
.summary { display: flex; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; align-items: flex-start; margin-bottom: var(--s5); padding: var(--s6) var(--s6) var(--s5); }
.summary-main { flex: 1 1 420px; }
.summary h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.summary { position: relative; overflow: hidden; }
.summary::after { content: ""; position: absolute; left: var(--s6); right: var(--s6); bottom: 0; height: 6px; color: var(--line-2); background: var(--ticks); }
.eyebrow { margin: 0 0 var(--s3); font: 500 .8rem var(--sans); color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.summary-text { margin: var(--s3) 0 0; font-size: 1.05rem; color: var(--ink-2); max-width: 640px; }
.summary-side { display: grid; gap: var(--s3); justify-items: end; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.badge { font: 600 .74rem var(--sans); padding: 4px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.good { color: var(--green-deep); background: var(--mint); }
.badge.fair { color: var(--warn); background: var(--warn-bg); }
.badge.poor { color: var(--bad); background: var(--bad-bg); }
.rider-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (max-width: 920px) { .rider-grid { grid-template-columns: minmax(0, 1fr); } }
.aside { display: grid; gap: var(--s4); }
.section-title { font: 600 .72rem var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: var(--s6) 0 var(--s3);
  display: flex; align-items: center; gap: var(--s3); }
.section-title:first-child { margin-top: 0; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.warn-box { background: var(--warn-bg); border: 1px solid #F6E2C4; border-radius: var(--r-sm); padding: var(--s3) var(--s4); font-size: .85rem; color: #6E3A08; margin-bottom: var(--s4); }
.warn-box ul { margin: 0; padding-left: 1.1rem; }
.rec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); margin-bottom: var(--s3); box-shadow: var(--shadow); position: relative; }
.rec::before { content: ""; position: absolute; left: -1px; top: 20px; height: 28px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line-2); }
.rec.now::before { background: var(--green); } .rec.next::before { background: var(--next); } .rec.try::before { background: var(--try); }
.rec.ok { padding: var(--s3) var(--s4); box-shadow: none; font-size: .88rem; color: var(--muted); } .rec.ok::before { background: var(--green); top: 12px; height: calc(100% - 24px); }
.rec.ok b, .rec.ok strong { color: var(--ink); font-weight: 600; }
.rec-head { display: flex; gap: var(--s3); align-items: flex-start; }
.step { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--green); color: var(--green-ink); display: grid; place-items: center; font: italic 800 1rem var(--display); }
.rec.next .step { background: var(--next); color: #fff; }
.rec h4 { margin: 2px 0 0; font-size: 1.14rem; font-weight: 700; letter-spacing: -.012em; line-height: 1.3; }
.rec .comp { font: 500 .76rem var(--sans); color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s3); }
.pill { font: 500 .74rem var(--sans); padding: 3px 9px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); }
.pill.amount { background: var(--ink); color: #fff; border-color: var(--ink); font: 600 .74rem var(--mono); }
.pill.conf-high { background: var(--mint); color: var(--green-deep); border-color: transparent; }
.pill.conf-medium { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.conf-low { background: var(--sunk); color: var(--muted); }
.why { margin: var(--s4) 0 0; font-size: .92rem; color: var(--ink-2); }
.why b, .why strong { color: var(--ink); font-weight: 600; }
.rec ul.ev { margin: var(--s2) 0 0; padding-left: 1.1rem; font-size: .86rem; color: var(--muted); }
.rec ul.ev li { margin: 2px 0; }
.rec .how { margin-top: var(--s3); font-size: .88rem; color: var(--ink-2); background: var(--sunk); border-radius: var(--r-sm); padding: var(--s3) var(--s4); }
.rec .how b { font: 600 .72rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: block; margin-bottom: 3px; }
.conf-note { margin-top: var(--s3); font-size: .76rem; color: var(--faint); }
.oklist { display: grid; gap: var(--s2); }
/* Cards stay short: headline, one line, the amount. Instructions and reasons fold out. */
.rec-main { min-width: 0; flex: 1; }
.rec .brief { margin: 6px 0 0; font-size: .93rem; color: var(--ink-2); line-height: 1.45; }
.rec.gear::before { background: var(--amber); }
.pill.stage-after { background: var(--sunk); color: var(--ink-2); }
.pill.stage-now { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.rec-more { margin: var(--s4) calc(-1 * var(--s5)) calc(-1 * var(--s5)); border-top: 1px solid var(--line); }
.rec-more details + details { border-top: 1px solid var(--line); }
.rec-more summary, .checks summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: 12px var(--s5); font: 600 .86rem var(--sans); color: var(--ink); user-select: none; }
.rec-more summary::-webkit-details-marker, .checks summary::-webkit-details-marker { display: none; }
.rec-more summary::after, .checks summary::after { content: ""; flex: none; width: 7px; height: 7px; margin-right: 3px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.rec-more details[open] > summary::after, .checks details[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.rec-more summary:hover, .checks summary:hover { background: var(--sunk); }
.rec-more details:last-child:not([open]) > summary { border-radius: 0 0 var(--r) var(--r); }
.rec-more summary:focus-visible, .checks summary:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.fold-body { padding: 0 var(--s5) var(--s4); font-size: .9rem; color: var(--ink-2); line-height: 1.55; }
.fold-body p { margin: 0 0 var(--s3); } .fold-body > :last-child { margin-bottom: 0; }
.fold-body h5 { margin: var(--s3) 0 4px; font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.fold-body .then b { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-right: 6px; }
.fold-body ul.ev { margin: 0 0 var(--s3); }
.fold-body ul.look { margin: 0; padding-left: 1.15rem; display: grid; gap: 7px; } .fold-body ul.look li::marker { color: var(--green-600); }
.fold-body .conf-note { margin-top: 0; }
.fold-body .research { font-size: .78rem; color: var(--muted); } .fold-body .research b { font-weight: 600; } .fold-body .research a { color: var(--green-deep); text-decoration: none; }
.tier-lead { margin: calc(-1 * var(--s1)) 0 var(--s3); font-size: .88rem; color: var(--muted); }
.tier-note { margin: var(--s2) 0 0; font-size: .82rem; color: var(--muted); }
.checks { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.checks details + details { border-top: 1px solid var(--line); }
.checks summary { font-weight: 500; }
.okchips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.okchips li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px; border-radius: 99px; background: var(--mint); color: var(--green-deep); font: 500 .84rem var(--sans); }
.okchips li::before { content: ""; width: 12px; height: 7px; border-left: 2px solid var(--green-600); border-bottom: 2px solid var(--green-600); transform: rotate(-45deg) translateY(-2px); }
.empty-state { padding: var(--s5); text-align: center; background: var(--mint); border: 1px solid var(--mint-2); border-radius: var(--r); }
.disclaimer { color: var(--faint); font-size: .8rem; margin-top: var(--s5); max-width: 760px; }
.end-actions { display: flex; gap: var(--s2); margin-top: var(--s5); flex-wrap: wrap; }
.qlist { list-style: none; margin: 0; padding: 0; font-size: .85rem; display: grid; gap: 6px; color: var(--ink-2); }
.qlist li { position: relative; padding-left: 22px; }
.qlist li::before { content: "✓"; position: absolute; left: 0; color: var(--green-600); font-weight: 700; }
.qlist li.bad::before { content: "!"; color: var(--warn); left: 4px; }
.plots { margin-top: var(--s5); padding: var(--s6); }
.plots > h2 { font-size: 1.3rem; margin-bottom: var(--s4); }
.plots h3 { margin: 0 0 2px; }
.plots-2 p { margin: 0 0 var(--s3); }
.plots-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s5); margin-top: var(--s6); padding-top: var(--s6); border-top: 1px solid var(--line); }
@media (max-width: 860px) { .plots-2 { grid-template-columns: 1fr; } .plots { padding: var(--s5); } }

/* angle explorer: one joint, one stroke or the whole video, gliding crosshair */
.ax { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s5) var(--s3); background: var(--surface); }
.ax-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.ax-joints, .ax-range { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line); flex-wrap: wrap; }
.ax-joints button, .ax-range button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font: 500 .8rem var(--sans); color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.ax-joints button:hover:not(:disabled), .ax-range button:hover:not(:disabled) { color: var(--ink); }
.ax-joints button[aria-pressed=true], .ax-range button[aria-pressed=true] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(17, 26, 21, .1), 0 0 0 1px rgba(17, 26, 21, .04); }
.ax-joints button:disabled, .ax-range button:disabled { opacity: .35; cursor: not-allowed; }
.ax-readout { margin: var(--s4) 0 var(--s2); min-height: 92px; }
.ax-kicker { font-size: .8rem; color: var(--muted); font-weight: 500; }
.ax-big { font: italic 800 clamp(2.2rem, 4.8vw, 3.1rem)/1.1 var(--display); font-stretch: 116%; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ax-sub { font-size: .84rem; color: var(--muted); font-weight: 500; }
.ax-sub.ok { color: var(--green-deep); } .ax-sub.off { color: var(--warn); }
.ax-legend { display: flex; gap: 4px var(--s4); flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: var(--s2); }
.ax-legend span, .ax-tip span { display: inline-flex; align-items: center; gap: 6px; }
.lg-line, .lg-spread, .lg-band { display: inline-block; width: 14px; flex: none; }
.lg-line { height: 2.5px; border-radius: 2px; background: #0B8A43; }
.lg-spread { height: 9px; border-radius: 3px; background: rgba(11, 138, 67, .14); }
.lg-band { height: 9px; border-radius: 2px; background: rgba(22, 219, 101, .16); border-top: 1.5px dashed #10B652; border-bottom: 1.5px dashed #10B652; box-sizing: border-box; }
.ax-plot { position: relative; }
.ax-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; cursor: crosshair; outline: none; border-radius: 8px; }
.ax-svg:focus-visible { box-shadow: 0 0 0 2px var(--green); }
.ax-gl { stroke: #EEF1EF; } .ax-vl { stroke: #F3F5F4; } .ax-base { stroke: var(--line-2); }
.ax-yl, .ax-xl { font: 500 10.5px var(--sans); fill: var(--faint); font-variant-numeric: tabular-nums; }
.ax-fade { animation: axFade .35s ease-out; }
@keyframes axFade { from { opacity: 0; } }
.ax-band { fill: rgba(22, 219, 101, .09); }
.ax-band-edge { stroke: #10B652; stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.ax-spread { fill: rgba(11, 138, 67, .1); transition: opacity .3s; }
.ax-area { transition: opacity .3s; } .ax-whole .ax-area { opacity: .45; }
.ax-line { fill: none; stroke: #0B8A43; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ax-cross { transition: opacity .15s; pointer-events: none; }
.ax-cross-line { stroke: var(--ink); stroke-width: 1; opacity: .3; }
.ax-cross-line, .ax-dot { transition: transform .11s cubic-bezier(.2, .7, .3, 1); }
.ax-cross.instant .ax-cross-line, .ax-cross.instant .ax-dot { transition: none; }
.ax-halo { fill: rgba(22, 219, 101, .22); } .ax-pt { fill: #fff; stroke: #0B8A43; stroke-width: 2.4; }
.ax-tip { position: absolute; z-index: 2; pointer-events: none; display: grid; gap: 3px; min-width: 150px; padding: 8px 10px; border-radius: 10px;
  background: rgba(17, 26, 21, .94); color: #fff; font-size: .78rem; box-shadow: var(--shadow-pop); transition: left .11s, top .11s; }
.ax-tip b { font-weight: 500; color: #B9C7BF; font-size: .74rem; }
.ax-tip em { font-style: normal; font-weight: 600; margin-left: auto; padding-left: var(--s3); font-variant-numeric: tabular-nums; }
.ax-tip .lg-line { background: var(--green); } .ax-tip .lg-spread { background: rgba(22, 219, 101, .3); }
.ax-hint { margin: var(--s2) 0 0; font-size: .76rem; }
.ax-range { flex-wrap: nowrap; }
@media (max-width: 560px) { .ax { padding: var(--s3); } .ax-range { width: 100%; } .ax-range button { flex: 1; padding: 6px 8px; } }
.path svg { width: 100%; height: auto; display: block; }

/* replay controls */
.replay-bar { display: flex; align-items: center; gap: 6px; margin-top: var(--s3); }
.rb { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; width: 34px; height: 30px; font-size: .74rem; color: var(--ink); flex: none; }
.rb:hover { border-color: var(--ink-2); background: var(--sunk); }
#rbSeek { flex: 1; min-width: 40px; accent-color: var(--green-600); }
.speed { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--sunk); flex: none; }
.speed button { border: 0; background: none; padding: 3px 7px; border-radius: 6px; font: 500 .74rem var(--sans); color: var(--muted); }
.speed button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(17, 26, 21, .12); }
.replay-meta { font-family: var(--mono); margin: 6px 0 0; font-size: .72rem; }

/* fit numbering & progress */
.fit-chip { display: inline-block; background: var(--ink); color: var(--green); border-radius: 99px; padding: 2px 11px; margin-right: 6px; font: italic 800 .76rem var(--display); }
.progress-card { margin-bottom: var(--s4); }
.progress-head p { margin: -6px 0 var(--s3); }
.changed-note { background: var(--sunk); border-radius: var(--r-sm); padding: var(--s2) var(--s3); margin: 0 0 var(--s3); }
.ptable td:first-child { white-space: normal; }
.verdict { font: 600 .72rem var(--sans); padding: 2px 8px; border-radius: 99px; background: var(--sunk); color: var(--muted); }
.verdict.improved { background: var(--mint); color: var(--green-deep); }
.verdict.worse { background: var(--bad-bg); color: var(--bad); }
.pgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.pgroup { background: var(--sunk); border-radius: var(--r-sm); padding: var(--s3) var(--s4); }
.pgroup.good { background: var(--mint); }
.pgroup h4 { margin: 0 0 4px; font: 600 .72rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pgroup.good h4 { color: var(--green-deep); }
.pgroup ul { margin: 0; padding-left: 1.05rem; font-size: .86rem; }
.end-card { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s5); }
.end-card h3 { margin-bottom: 2px; font-size: 1.1rem; }
.end-card p { margin: 0; max-width: 520px; }
.end-card .end-actions { margin-top: 0; }
.strong { font-weight: 600; }
.ghost.strong { border-color: var(--ink); background: var(--ink); color: #fff; }
.ghost.strong:hover { background: var(--ink-2); border-color: var(--ink-2); }

/* next fit banner (intake) */
.next-fit { margin-bottom: var(--s5); }
.next-fit-head { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.next-fit-head h2 { margin: 0; }
.next-fit-head p { margin: 2px 0 0; }
.grow { flex: 1; min-width: 200px; }
.fit-badge { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--ink); color: var(--green); font: italic 800 1.25rem var(--display); }
.changed-list { margin-top: var(--s4); display: grid; gap: var(--s2); }
.changed-list:empty { display: none; }
.changed-q { margin: 0 0 var(--s1); font-weight: 600; font-size: .9rem; }
.changed { display: flex; align-items: center; gap: var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s2) var(--s3); cursor: pointer; transition: border-color .15s, background .15s; }
.changed:has(input:checked) { border-color: var(--green-600); background: var(--mint); }
.changed input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green-600); flex: none; }
.changed-text { flex: 1; display: grid; }
.changed .amount { display: flex; align-items: center; gap: 6px; flex: none; transition: opacity .15s, filter .15s; }
.changed .amount input { width: 64px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 7px; font-weight: 500; background: #fff; }
.changed .amount em { position: static; transform: none; white-space: nowrap; min-width: 6.5em; }
.changed .amount[data-off] { opacity: .4; filter: blur(.6px) grayscale(1); }
.changed .amount input:disabled { background: var(--sunk); cursor: not-allowed; }

/* header credits */
.credits-pill { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 4px 12px; font: 500 .76rem var(--sans);
  display: inline-flex; align-items: center; gap: 7px; }
.credits-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.credits-pill.empty { background: var(--warn-bg); color: var(--warn); border-color: #F6E2C4; }
.credits-pill.empty::before { background: var(--orange); }
.credits-pill:hover { border-color: var(--line-2); background: var(--sunk); }
.linkish.strong { color: var(--ink-2); font-weight: 500; font-size: .86rem; }
.linkish.strong:hover { color: var(--ink); }
@media (max-width: 600px) { .topbar-inner { gap: var(--s2); padding: 10px var(--s4); } main { padding: var(--s5) var(--s4) var(--s7); } }
@media (max-width: 440px) { .wordmark { display: none; } .topbar-inner { padding: 10px; gap: 6px; } .topbar .linkish.strong { white-space: nowrap; } .lang button { padding: 3px 7px; } .credits-pill { padding: 3px 8px; } }

/* history */
.hist-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.hist-head p { margin: 0; }
.hist-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (max-width: 920px) { .hist-grid { grid-template-columns: 1fr; } }
.series { margin-bottom: var(--s4); }
.series-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.series-head h2 { margin: 0; }
.hist-chart { margin: var(--s3) 0; }
.hist-chart h4 { margin: 0 0 4px; font: 600 .72rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hist-chart svg { width: 100%; height: auto; display: block; }
.fit-list { display: grid; gap: var(--s2); margin-top: var(--s3); }
.fit-card { display: flex; gap: var(--s3); align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s2); }
.fit-card.error { opacity: .65; }
.thumb { width: 64px; height: 64px; flex: none; border-radius: 8px; overflow: hidden; background: var(--sunk); display: grid; place-items: center; font: 600 1rem var(--display); color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.fit-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fit-top { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.fit-actions { display: grid; gap: 4px; justify-items: end; }
.small-btn { padding: 5px 11px; font-size: .8rem; }
.big-num { font: italic 800 2.4rem/1.1 var(--display); font-stretch: 116%; letter-spacing: -.03em; margin: 0 0 var(--s3); }
.big-num .muted { font: 400 .82rem var(--sans); font-stretch: 100%; letter-spacing: 0; }
.ok-box { background: var(--mint); border: 1px solid var(--mint-2); color: var(--green-ink); border-radius: var(--r-sm); padding: var(--s3) var(--s4); margin-bottom: var(--s4); font-weight: 500; }

/* dialogs */
.modal { border: 0; border-radius: 24px; padding: var(--s6) var(--s5) var(--s5); width: min(480px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(8, 18, 13, .45); color: var(--ink); }
.modal::backdrop { background: rgba(8, 18, 13, .5); backdrop-filter: blur(3px); }
.modal h2 { font-size: 1.45rem; font-weight: 800; font-style: italic; font-stretch: 114%; letter-spacing: -.02em; }
.modal-x { position: absolute; top: 12px; right: 14px; margin: 0; }
.modal-x button { border: 0; background: var(--sunk); width: 30px; height: 30px; border-radius: 50%; font-size: 1.2rem; line-height: 1; color: var(--muted); }
.modal-x button:hover { color: var(--ink); }
.mock-note { background: var(--warn-bg); color: #6E3A08; border-radius: var(--r-sm); padding: var(--s2) var(--s3); font-size: .82rem; font-weight: 500; margin: var(--s3) 0; }
.checkout-summary { font-weight: 600; }
.check { display: flex; gap: var(--s2); align-items: center; font-weight: 500; font-size: .9rem; margin: var(--s4) 0; }
.check input { width: 18px; height: 18px; accent-color: var(--green-600); }
.fixed-bar { margin-top: var(--s2); }
.fixed-bar .check { margin: 0; font-weight: 400; color: var(--ink-2); }
.small-tabs { margin-bottom: var(--s3); }

/* ------------------------------------------------ tables and key positions */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table td.nc { font-family: var(--mono); font-size: .78rem; text-align: right; }
.keyframes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.keyframes figure { margin: 0; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px; }
.keyframes figcaption { font: 500 .74rem var(--sans); color: var(--muted); text-align: center; padding: 2px 0 4px; }
svg text { font-family: var(--sans); }
#riderKeyframes { grid-template-columns: 1fr 1fr; gap: var(--s3); }
#riderKeyframes figure { padding: var(--s2); }
@media (max-width: 560px) { #riderKeyframes { grid-template-columns: 1fr; } }

/* ------------------------------------------------ references */
.refs-intro { max-width: 640px; }
.refs { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); counter-reset: ref; }
.ref { counter-increment: ref; position: relative; padding-left: 60px; }
.ref::before { content: counter(ref); position: absolute; left: var(--s5); top: var(--s5); font: 600 .8rem var(--display); color: var(--faint); }
.ref-cite { font-size: .95rem; line-height: 1.55; color: var(--ink-2); }
.ref-who { font-weight: 600; color: var(--ink); }
.ref-cite a { color: var(--ink); text-decoration-color: var(--green); text-underline-offset: 3px; }
.ref-cite a:hover { color: var(--green-deep); }
.ref-used { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: var(--s3); }
.ref-used .chip { font-size: .74rem; padding: 3px 10px; cursor: default; background: var(--sunk); border-color: transparent; }
.ref-used .chip:hover { border-color: transparent; }
.ref-label { font: 500 .76rem var(--sans); color: var(--muted); margin-right: 2px; }
.refs-note { margin-top: var(--s5); max-width: 640px; }
@media (max-width: 520px) { .ref { padding-left: var(--s5); } .ref::before { position: static; display: block; margin-bottom: var(--s2); } }

/* ------------------------------------------------ the pass and codes */
.modal h3 { font-size: .95rem; margin: 0 0 var(--s2); }
.offer { border: 1px solid var(--line-2); border-radius: var(--r); padding: var(--s5); margin: var(--s4) 0 var(--s3); background: var(--surface); }
.offer-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.offer-name { font: 600 1.05rem var(--display); }
.offer-price { font: italic 800 2rem/1 var(--display); font-stretch: 116%; letter-spacing: -.03em; color: var(--ink); }
.offer-points { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: 6px; font-size: .88rem; color: var(--ink-2); }
.offer-points li::before { content: "✓"; color: var(--green-600); font-weight: 700; margin-right: 10px; }
.offer .primary { margin-top: var(--s4); }
.offer #buyNote { margin: var(--s2) 0 0; text-align: center; }
.code-fold { border-top: 1px solid var(--line); padding-top: var(--s3); }
.code-fold summary { cursor: pointer; font-weight: 500; font-size: .9rem; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
.code-fold summary:hover { color: var(--ink); }
.code-fold summary::-webkit-details-marker { display: none; }
.code-fold summary::before { content: "▸"; transition: transform .15s; display: inline-block; color: var(--faint); }
.code-fold[open] summary::before { transform: rotate(90deg); }
.code-fold .redeem-row { margin-top: var(--s3); }
.redeem-row { display: flex; gap: var(--s2); }
.redeem-row input { flex: 1; min-width: 0; font: 500 .95rem var(--sans); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--ink); }
.redeem-row input::placeholder { color: #A8B2AD; }
.redeem-row input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(22, 219, 101, .18); }
.ok-line { color: var(--green-deep); font-weight: 600; font-size: .88rem; margin: var(--s2) 0 0; }
.code-fold .error { margin: var(--s2) 0 0; }
.acct-email { margin: -4px 0 var(--s3); word-break: break-all; }
.pass-line { background: var(--mint); border: 1px solid var(--mint-2); color: var(--green-ink); border-radius: var(--r-sm); padding: var(--s2) var(--s3); font-size: .86rem; font-weight: 500; }
.credits-pill.pass { background: var(--ink); color: #fff; border-color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 12px; font-weight: 500; font-size: .9rem; box-shadow: var(--shadow-pop); max-width: calc(100vw - 32px); transition: opacity .5s; }
.toast.out { opacity: 0; }

/* ------------------------------------------------ account */
body:not(.ready) main { visibility: hidden; }
.boot-error { max-width: 520px; margin: var(--s7) auto; text-align: center; }
/* Two panels: what you get (pine, with the measured rider) and the form. */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); max-width: 980px; margin: var(--s5) auto var(--s6); border-radius: 28px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 70px -40px rgba(12, 26, 22, .35); }
.auth-side { position: relative; overflow: hidden; padding: var(--s7) var(--s6) var(--s6); color: #fff; display: flex; flex-direction: column;
  background: var(--dark) radial-gradient(110% 70% at 85% 105%, rgba(22, 219, 101, .34) 0%, transparent 62%); }
.auth-side::before { content: ""; position: absolute; left: var(--s6); right: var(--s6); top: 20px; height: 7px; color: rgba(255, 255, 255, .2); background: var(--ticks); }
.kicker { margin: 0 0 var(--s3); font: 600 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.auth-side h1 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); margin-bottom: var(--s4); }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .95rem; color: #CFE0D7; }
.auth-points li { position: relative; padding-left: 28px; line-height: 1.45; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--green)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.6 10.4l2.9 2.9L14.4 7.4' fill='none' stroke='%2304301A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }
.auth-scan { display: block; width: 100%; max-width: 420px; height: auto; margin: auto auto 0; padding-top: var(--s5); }
.scan-skel path { fill: none; stroke: var(--green); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.scan-pts circle { fill: #fff; stroke: var(--green); stroke-width: 1.6; }
.scan-tag rect { fill: rgba(4, 16, 12, .86); }
.scan-tag text { font: 700 9px var(--mono); fill: var(--amber); text-anchor: middle; }
@media (prefers-reduced-motion: no-preference) {
  .scan-pts circle { animation: scanPulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .scan-pts circle:nth-child(2n) { animation-delay: .5s; } .scan-pts circle:nth-child(3n) { animation-delay: 1s; }
}
@keyframes scanPulse { 50% { transform: scale(1.35); } }
.auth-box { border: 0; border-radius: 0; box-shadow: none; padding: var(--s7) var(--s6) var(--s6); align-self: center; }
.auth-h { font-size: 1.5rem; font-weight: 800; font-style: italic; font-stretch: 114%; margin: 0 0 var(--s2); }
.auth-lead { margin: 0 0 var(--s5); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px; border: 1px solid var(--line-2); border-radius: 99px;
  background: #fff; color: #1F1F1F; font: 600 .95rem var(--sans); text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.google-btn:hover { background: var(--sunk); border-color: var(--ink-2); }
.auth-or { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0; color: var(--faint); font: 500 .76rem var(--sans); text-transform: uppercase; letter-spacing: .08em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-tabs { margin-bottom: var(--s4); }
.auth-tabs button { flex: 1; }
.auth-box .field { margin-bottom: var(--s4); }
.auth-box .primary { margin-top: var(--s2); }
.auth-box .error { margin: var(--s3) 0 0; }
.auth-box a:not(.google-btn) { color: var(--green-deep); }
.auth-private { display: flex; gap: 10px; align-items: flex-start; background: var(--sunk); border-radius: var(--r-sm); padding: var(--s3); color: var(--ink-2); font-weight: 400; margin: var(--s5) 0 var(--s2); line-height: 1.5; }
.auth-private svg { flex: none; margin-top: 2px; color: var(--green-deep); }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; margin-top: 0; border-radius: 22px; }
  .auth-side { padding: var(--s6) var(--s5) var(--s5); }
  .auth-scan { display: none; }
  .auth-box { padding: var(--s5); }
}

/* ------------------------------------------------ replay of a video kept on the device */
.replay-load { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.replay-load p { margin: 0; }
.replay-local { display: grid; gap: var(--s2); justify-items: start; }
.replay-local p { margin: 0; }
.replay-local label { cursor: pointer; }
.warn-line { color: var(--warn); }

/* ------------------------------------------------ consents */
.check.consent { align-items: flex-start; font-weight: 400; font-size: .84rem; line-height: 1.45; margin: var(--s3) 0 0; color: var(--ink-2); }
.check.consent input { flex: none; margin-top: 2px; }
.check.consent a { color: var(--green-deep); }
.check.consent.invalid { color: var(--warn); }
.check.consent.invalid input { outline: 2px solid var(--orange); outline-offset: 2px; }
.legal-note { margin: var(--s3) 0 0; text-align: center; color: var(--faint); }
.legal-note a { color: inherit; }
.modal-actions { justify-content: flex-end; margin-top: var(--s4); }

/* ------------------------------------------------ account card */
.acct-how { display: inline-flex; align-items: center; gap: 6px; font: 500 .76rem var(--sans); color: var(--muted); background: var(--sunk); border-radius: 99px; padding: 3px 10px; margin: 0 0 var(--s3); }
.purchases { list-style: none; margin: var(--s4) 0 0; padding: var(--s3) 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: .82rem; color: var(--ink-2); }
.purchases li { display: flex; justify-content: space-between; gap: var(--s3); }
.purchases .refunded { color: var(--faint); text-decoration: line-through; }
.purchases h4 { margin: 0 0 2px; font: 600 .72rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.acct-links { display: flex; gap: var(--s4); margin-top: var(--s4); }
.acct-free { margin: 0 0 var(--s3); color: var(--ink-2, inherit); }
