@import url("./bike.css");

/*
 * Dry Spin app styles. Dark only on purpose: white on black, yellow
 * primary, blue secondary. The drawing classes at the bottom match render.js.
 *
 * Fonts are self-hosted from public/fonts (SIL Open Font License, licence
 * files next to them), never loaded from Google, which would send visitors'
 * IP addresses to a third party (GDPR).
 */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #080808;
  --panel-2: #0e0e0e;
  --raised: #161616;
  --line: #262626;
  --line-soft: #1b1b1b;
  --text: #ffffff;
  --text-dim: #a6a6a6;
  --text-faint: #6e6e6e;
  --accent: #ffd21e;
  --accent-soft: #ffe273;
  --accent-wash: rgba(255, 210, 30, 0.10);
  --blue: #4da3ff;
  --blue-soft: #9ecbff;
  --blue-wash: rgba(77, 163, 255, 0.12);
  --red: #ff5f5f;
  --red-wash: rgba(255, 95, 95, 0.12);
  --good: #4da3ff;
  --warn: #ffd21e;
  --bad: #ff5f5f;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-inline: 16px;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.app { max-width: 1440px; margin: 0 auto; padding-block: 14px 20px; display: grid; gap: 12px; }
.plain { margin: 0; color: var(--text-dim); }

/* ---------- top bar ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.brand-mark { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.context { display: flex; flex-wrap: wrap; gap: 8px; }
.ctx { display: grid; padding: 5px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; }
.ctx small { font-size: 11px; color: var(--text-faint); }
.ctx b { font-weight: 500; font-size: 13px; }
.ctx-select { background: transparent; border: 0; padding: 0; margin: 0; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }
.ctx-select option, .opt select option, .opt select optgroup { background: #111111; color: #ffffff; }
button.ctx:hover { border-color: #3a3a3a; }
.spacer { flex: 1 1 auto; }
.guest { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.guest::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; color: var(--text-dim); font-size: 12.5px; }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); }

/* the imperial reaction */
.units-wrap { position: relative; }
.emote {
  position: absolute; top: calc(100% + 8px); right: 0; width: 110px; max-width: none; height: auto;
  border-radius: 10px; z-index: 20; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .6);
  animation: emote-pop .18s ease-out;
}
@keyframes emote-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- shared link banner ---------- */
.banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 10px 14px; border: 1px solid #1d4a7a; border-radius: 12px; background: var(--blue-wash);
}
.banner p { margin: 0; }
.banner-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- level tabs ---------- */
.levelbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.levels { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.levels button { border: 0; background: transparent; padding: 7px 16px; border-radius: 9px; color: var(--text-dim); font-weight: 500; }
.levels button[aria-selected="true"] { background: var(--accent); color: #0b0b0b; }
.levels button:not([aria-selected="true"]):hover { color: var(--text); }
.levelhint { color: var(--text-faint); font-size: 12.5px; }

/* ---------- workspace ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; align-items: start; }
@media (max-width: 960px) { .work { grid-template-columns: minmax(0, 1fr); } }

.stage-frame {
  position: relative; border: 1px solid var(--line); border-radius: 14px; background: #040404; overflow: hidden;
  height: clamp(420px, calc(100vh - 196px), 820px);
}
.stage-col { display: grid; gap: 8px; min-width: 0; align-content: start; }
@media (min-width: 961px) { .stage-col { position: sticky; top: 12px; } }
@media (max-width: 960px) {
  /* Phones and tablets: the drawing stays pinned at the top while the cards below scroll under it. */
  .stage-col { display: contents; }
  .stage-frame {
    position: sticky; top: 0; z-index: 5;
    display: flex; flex-direction: column;
    height: min(88vw, 46svh); max-width: 100%;
    box-shadow: 0 10px 18px -8px #000;
  }
}
.stage-frame::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.026) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 82% 74% at 50% 45%, #000 30%, transparent 100%);
}
.stage { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 960px) { .stage { position: relative; inset: auto; flex: 1; min-height: 0; } }
.legend { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 960px) {
  /* The legend becomes one row above the drawing, so it never covers the rider. */
  .legend { position: static; order: -1; flex: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px 10px 0; }
  .legend::-webkit-scrollbar { display: none; }
  .legend span { flex: none; white-space: nowrap; }
}
.legend span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.7); border: 1px solid var(--line); display: inline-flex; gap: 7px; align-items: center; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend i.ghost-leg { background: #6b5a14; }

/* ---------- pills: more marks on the drawing ---------- */
.pillbar { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 1px; }
.pillbar::-webkit-scrollbar { display: none; }
.pillbar-label { flex: none; margin-right: 2px; font-size: 12px; color: var(--text-faint); }
.pill { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--text-dim); border-radius: 999px; padding: 5px 13px; font-size: 13px; white-space: nowrap; }
.pill:hover { color: var(--text); border-color: #3a3a3a; }
.pill[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #0b0b0b; font-weight: 500; }

/* ---------- side panel ---------- */
.panel { display: grid; gap: 10px; min-width: 0; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px; display: grid; gap: 12px; min-width: 0; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-h h2 { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.card-h small { color: var(--text-faint); font-size: 12px; text-align: right; }
.card-actions { display: flex; gap: 6px; }

.btn { border: 1px solid var(--line); background: var(--raised); color: var(--text); padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.btn:hover { border-color: #3d3d3d; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b0b0b; font-weight: 500; }
.btn.ghost { background: transparent; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.linkbtn { border: 0; background: none; color: var(--blue); padding: 0; font-size: 12px; }

/* sizes and cockpit sizes */
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 6px; }
.size { border: 1px solid var(--line); background: var(--panel-2); border-radius: 9px; padding: 8px 4px; text-align: center; min-width: 0; overflow: hidden; }
.size.custom b { font-size: 13px; line-height: 20px; }
.size b { font-size: 15px; font-weight: 600; display: block; }
.size small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.size small.stock { color: var(--accent); }
.size[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }

.source { display: grid; gap: 4px; font-size: 11.5px; color: var(--text-faint); }
.source details summary { cursor: pointer; color: var(--blue); width: fit-content; }
.source details p { margin: 6px 0 0; color: var(--text-dim); line-height: 1.5; }

.cockpit { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.cockpit:first-child { padding-top: 0; border-top: 0; }
.ck-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ck-h span { font-weight: 500; }
.ck-h b { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ck-h b small { color: var(--accent); font-size: 11.5px; margin-left: 6px; }
.ck-sub { font-size: 11.5px; color: var(--text-faint); }

/* headline */
.headline { display: grid; gap: 4px; }
.headline strong { font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; text-wrap: balance; }
.headline span { color: var(--text-dim); font-size: 13px; }

/* readouts */
.readouts { display: grid; gap: 10px; }
.ro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: baseline; }
.ro .k { color: var(--text-dim); font-size: 13px; }
.ro .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 15px; white-space: nowrap; }
.ro .v small { color: var(--text-faint); font-size: 11px; }
.ro .v.warn { color: var(--warn); }
.ro .v.bad { color: var(--bad); }
.meter { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 3px; background: var(--line-soft); }
.meter .band { position: absolute; top: 0; bottom: 0; background: rgba(77,163,255,.28); border-radius: 3px; }
.meter .mark { position: absolute; top: -3px; width: 3px; height: 12px; border-radius: 2px; background: var(--text); transform: translateX(-1px); }

.warnings { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.warnings:empty { display: none; }
.warnings li { font-size: 12.5px; padding: 7px 10px; border-radius: 8px; background: var(--red-wash); color: #ffd0d0; border: 1px solid #4a1f1f; }
.warnings li[data-option]::before { content: "Option " attr(data-option) " · "; color: var(--text-faint); }
.warnings li.info { background: var(--panel-2); border-color: var(--line); color: var(--text-dim); }

/* disclosure cards */
details.card { padding: 0; gap: 0; }
details.card > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
details.card > summary .sum { font-size: 12px; color: var(--text-faint); text-align: right; margin-left: auto; }
details.card > summary::after { content: "+"; font-family: var(--mono); color: var(--text-faint); }
details.card[open] > summary::after { content: "–"; }
details.card > .body { padding: 0 14px 14px; display: grid; gap: 12px; }

/* fields */
.field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.field label { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.field .note, .note-line { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-faint); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field.changed label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.inputwrap { display: inline-flex; align-items: center; gap: 6px; }
.inputwrap input[type="number"], .inputwrap select {
  width: 84px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px;
  font-family: var(--mono); font-size: 13px; text-align: right;
}
.inputwrap input.narrow { width: 58px; }
.inputwrap select { width: 104px; text-align: left; }
.inputwrap .u { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); min-width: 20px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.rangewrap { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 10px; align-items: center; }
.rangewrap output { font-family: var(--mono); font-size: 13px; text-align: right; }
.badge { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-faint); }
.badge.measured { color: var(--blue-soft); border-color: #1d4a7a; background: var(--blue-wash); }
.hands { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.hands b { color: var(--text); font-weight: 500; }

/* compare */
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .options { grid-template-columns: minmax(0, 1fr); } }
.opt { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; background: var(--panel-2); align-content: start; }
.opt[data-active="true"] { border-color: #555; }
.opt-h { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.opt-h b { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.opt-h b i { width: 10px; height: 10px; border-radius: 50%; }
.opt select { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; }
.opt .chg { font-size: 11.5px; color: var(--text-faint); min-height: 1.4em; }
.diffs { width: 100%; border-collapse: collapse; font-size: 13px; }
.diffs td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.diffs tr:last-child td { border-bottom: 0; }
.diffs td:first-child { color: var(--text-dim); }
.diffs td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.diffs td.num.same { color: var(--text-faint); }
.diff-summary { margin: 0; font-size: 14px; }
.diffs td.num small { display: block; font-size: 11px; color: var(--text-faint); }
.pill-numbers { display: grid; gap: 12px; }
.pill-numbers:empty { display: none; }
.pill-group h3 { margin: 0 0 2px; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-soft); }
.pill-hint { margin: 0; font-size: 12px; color: var(--text-faint); }
.note-text { font-size: 12.5px; }
.mtable tr.group th { padding: 14px 0 4px; text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-soft); }
.mtable tr.group:first-child th { padding-top: 0; }

/* detail */
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle { border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; }
.toggle[aria-pressed="true"] { color: #0b0b0b; background: var(--blue); border-color: var(--blue); }
.mtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mtable td { padding: 5px 0; border-bottom: 1px solid var(--line-soft); vertical-align: baseline; }
.mtable tr:last-child td { border-bottom: 0; }
.mtable td:last-child { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mtable td small { color: var(--text-faint); display: block; font-size: 11px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.na { background: transparent; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 12px; color: var(--text-faint); padding-top: 4px; }

/* ---------- legal pages ---------- */
.doc { max-width: 720px; margin: 0 auto; padding-block: 20px 56px; display: grid; gap: 12px; line-height: 1.6; }
.doc-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.doc-top .brand { color: var(--text); text-decoration: none; }
.doc h1 { margin: 12px 0 4px; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.doc h2 { margin: 20px 0 0; font-size: 16px; font-weight: 600; }
.doc p, .doc ul, .doc address { margin: 0; max-width: 65ch; color: var(--text-dim); }
.doc address { font-style: normal; color: var(--text); }
.doc ul { padding-left: 20px; display: grid; gap: 6px; }
.doc .summary { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); }
.doc .updated { margin-top: 16px; font-size: 12px; color: var(--text-faint); }
.foot .support { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); text-decoration: none; padding-block: 4px; }
.foot .support:hover { color: var(--accent); }
.foot .support:hover span { text-decoration: underline; text-underline-offset: 3px; }
.support-cup { width: 16px; height: 16px; flex: none; color: var(--accent); }
/* On phones and tablets the support line comes first, right under the last card. */
@media (max-width: 960px) { .foot .support { order: -1; flex-basis: 100%; } }
.foot nav { display: flex; gap: 14px; }
.foot nav a { color: var(--text-dim); }

/* ---------- account ---------- */
.account-area { display: flex; align-items: center; gap: 10px; }
.guest[data-tone="synced"]::before { background: var(--blue); }
.guest[data-tone="failed"]::before { background: var(--red); }
.account-dialog {
  width: min(420px, calc(100% - 32px)); max-width: none; padding: 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text);
}
.account-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.dialog-inner { position: relative; padding: 20px; }
#account-body { display: grid; gap: 14px; }
#account-body h2 { margin: 0; padding-right: 32px; font-size: 18px; font-weight: 600; }
.dialog-close { position: absolute; top: 12px; right: 12px; border: 0; background: none; color: var(--text-dim); font-size: 22px; line-height: 1; padding: 4px 6px; }
.dialog-close:hover { color: var(--text); }
.account-form { display: grid; gap: 12px; }
label.stack { display: grid; gap: 5px; font-size: 13px; color: var(--text-dim); }
label.stack small { color: var(--text-faint); }
input.text { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.wide { width: 100%; }
.btn.danger { background: var(--red-wash); border-color: #4a1f1f; color: #ffd0d0; }
.fine { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-faint); }
.form-error, .form-ok { margin: 0; font-size: 13px; }
.form-error { color: #ffb3b3; }
.form-ok { color: var(--blue-soft); }
.form-error:empty, .form-ok:empty { display: none; }
.dialog-links { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; font-size: 13px; color: var(--text-dim); }
.dialog-links .linkbtn { font-size: 13px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.danger-zone summary { cursor: pointer; width: fit-content; font-size: 13px; color: var(--text-dim); }
.danger-zone p { margin: 10px 0; font-size: 13px; color: var(--text-dim); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--raised); border: 1px solid #3a3a3a;
  padding: 9px 14px; border-radius: 10px; font-size: 13px; max-width: calc(100% - 32px); z-index: 10;
}

/* ================= drawing, classes from render.js ================= */
.tyre { fill: none; stroke: #2e2e2e; }
.rim { fill: none; stroke: #505050; }
.rim-edge { fill: none; stroke: #7d7d7d; stroke-width: 3; }
.spoke { stroke: #383838; stroke-width: 2.6; }
.hub { fill: #6a6a6a; }
.tube { fill: #6e6e6e; stroke: none; }
.cockpit-strut { fill: none; stroke: #757575; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.bar-line { stroke: #8a8a8a; stroke-width: 12; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bar-line.riser { stroke-width: 9; }
.hood { fill: none; stroke: #9a9a9a; stroke-width: 22; stroke-linecap: round; }
.hood-body { fill: #9a9a9a; stroke: none; }
.lever { fill: none; stroke: #6e6e6e; stroke-width: 8; stroke-linecap: round; }
.grip { fill: #4f4f4f; stroke: #8a8a8a; stroke-width: 3; }
.seatpost { stroke: #616161; stroke-width: 11; stroke-linecap: round; }
.saddle { fill: none; stroke: #9a9a9a; stroke-width: 7; stroke-linecap: round; }
.saddle-body { fill: #3d3d3d; stroke: none; }
.ground-line { stroke: #3a3a3a; stroke-width: 3; stroke-dasharray: 16 14; }
.crank-circle { fill: none; stroke: #333333; stroke-width: 2.5; stroke-dasharray: 8 10; }
.crank-tick { stroke: #4d4d4d; stroke-width: 3.5; }
.crank-tick-label { fill: #565656; font-family: var(--mono); font-size: 26px; text-anchor: middle; }
.crank-arm { stroke: var(--blue); stroke-width: 12; stroke-linecap: round; }
.bb-dot { fill: #9a9a9a; }
.pedal-body { stroke: #d0d0d0; stroke-width: 14; stroke-linecap: round; fill: none; }
.drive.ghost .crank-arm { stroke: #1f3d5c; stroke-width: 9; }
.drive.ghost .pedal-body { stroke: #4a4a4a; stroke-width: 10; }
.drive.ghost .bb-dot { display: none; }
.rider .seg { fill: none; stroke: var(--accent); stroke-width: 25; stroke-linecap: round; stroke-linejoin: round; }
.rider .seg.spine { stroke-width: 30; }
.rider .seg.pelvis { stroke-width: 40; stroke: #e0b100; stroke-linecap: round; }
.rider .pelvis-body { fill: rgba(224,177,0,0.55); stroke: #ffe273; stroke-width: 7; stroke-linejoin: round; }
.rider .seg.neck { stroke-width: 20; }
.rider .seg.upper-arm, .rider .seg.forearm { stroke-width: 21; }
.rider .seg.hand { stroke-width: 14; stroke: var(--accent-soft); }
.rider .seg.foot { stroke-width: 15; stroke: var(--accent-soft); }
.rider .seg.strained { stroke: var(--red); }
.reach-gap { fill: none; stroke: var(--red); stroke-width: 6; stroke-dasharray: 16 12; }
.rider .head { fill: rgba(255,210,30,0.09); stroke: var(--accent); stroke-width: 13; }
.shoe { fill: rgba(255,210,30,0.07); stroke: #d8ab00; stroke-width: 5; stroke-linejoin: round; }
.sole { stroke: var(--accent-soft); stroke-width: 7; fill: none; stroke-linecap: round; }
.kin-chain { fill: none; stroke: #ffffff; stroke-width: 2.5; stroke-dasharray: 14 10; opacity: 0.42; }
.kin-axis { display: none; }
.joint { fill: #000; stroke: #ffffff; stroke-width: 6; }
.joint-sacrum, .joint-lumbar { stroke: var(--accent-soft); stroke-width: 5; }
.contact-dot { fill: var(--blue); stroke: #00121f; stroke-width: 4; }
.leg.ghost .seg { stroke: #6b5a14; stroke-width: 17; }
.leg.ghost .shoe { fill: none; stroke: #6b5a14; stroke-width: 4; }
.leg.ghost .sole { stroke: #6b5a14; stroke-width: 5; }
/* comparison option B: brighter than the classic view so two options read clearly */
.compare .seg { stroke: var(--blue); stroke-width: 18; opacity: 0.45; }
.compare .head, .compare .shoe { stroke: var(--blue); fill: none; opacity: 0.45; }
.compare .joint, .compare .sole { display: none; }
.compare .bar-line, .compare .cockpit-strut, .compare .seatpost, .compare .saddle { stroke: #2b5a8a; opacity: 0.75; }
.compare .tube { fill: #1d3247; opacity: 0.6; }
.compare .wheel, .compare .saddle-body, .compare .hood, .compare .hood-body, .compare .lever { display: none; }
.angle-mark .arc { fill: none; stroke: #ffffff; stroke-width: 4; opacity: 0.75; }
.angle-mark .arc-leg { stroke: #ffffff; stroke-width: 2.5; stroke-dasharray: 8 8; opacity: 0.28; }
.angle-label { fill: #ffffff; font-family: var(--mono); font-size: calc(40px * var(--label-scale, 1)); dominant-baseline: middle; paint-order: stroke; stroke: #000; stroke-width: 9; }
.angle-mark.knee .arc, .angle-mark.hip .arc { stroke: var(--accent); opacity: 1; }
.angle-label.knee, .angle-label.hip { fill: var(--accent); }
.angle-mark.torso .arc { stroke: var(--blue); stroke-dasharray: 12 9; opacity: 1; }
.angle-label.torso { fill: var(--blue-soft); }
.angle-mark.tilt .arc, .angle-mark.flex .arc, .angle-mark.hip-pelvis .arc { stroke: var(--blue); stroke-dasharray: 12 9; opacity: 1; }
.angle-label.tilt, .angle-label.flex, .angle-label.hip-pelvis { fill: var(--blue-soft); }
.ref-line { stroke: var(--blue); stroke-width: 2.5; stroke-dasharray: 12 10; opacity: 0.34; }
.pelvis-axis { stroke: var(--blue); stroke-width: 3.5; stroke-dasharray: 16 10; opacity: 0.62; }
.vertical-ref, .spine-ref { opacity: 0.30; }
.label-leader { stroke: #8a8a8a; stroke-width: 2; opacity: 0.5; }
.dim-line { stroke: var(--blue); stroke-width: 3; }
.dim-ext { stroke: var(--blue); stroke-width: 2; stroke-dasharray: 6 6; opacity: 0.4; }
.dim-arrow { fill: var(--blue); stroke: none; }
.dim-label { fill: var(--blue-soft); font-family: var(--mono); font-size: calc(32px * var(--label-scale, 1)); dominant-baseline: middle; paint-order: stroke; stroke: #000; stroke-width: 8; }
.lm-leader { stroke: var(--blue); stroke-width: 2.5; opacity: 0.55; }
.lm-dot { fill: var(--blue); }
.lm-label { fill: var(--blue-soft); font-family: var(--mono); font-size: calc(30px * var(--label-scale, 1)); dominant-baseline: middle; paint-order: stroke; stroke: #000; stroke-width: 8; }
/* Compare: everything drawn for option A is yellow, option B is blue. A's frame keeps its paint. */
.scene.comparing .drive.live .crank-arm { stroke: var(--accent); }
.scene.comparing .drive.ghost .crank-arm { stroke: #6b5a14; }
.scene.comparing .contact-dot { fill: var(--accent); stroke: #1f1800; }
.scene.comparing .angle-mark .arc { stroke: var(--accent); stroke-dasharray: none; opacity: 1; }
.scene.comparing .angle-mark .arc-leg { stroke: var(--accent); }
.scene.comparing .dim-line, .scene.comparing .dim-arrow, .scene.comparing .lm-dot { stroke: var(--accent); fill: var(--accent); }
.scene.comparing .dim-ext, .scene.comparing .lm-leader, .scene.comparing .ref-line, .scene.comparing .pelvis-axis { stroke: var(--accent); }
.scene.comparing .angle-label, .scene.comparing .dim-label, .scene.comparing .lm-label { fill: var(--accent); }
.lbl-a { fill: var(--accent); }
.lbl-arrow { fill: #8a8a8a; }
.lbl-b { fill: var(--blue); }
.scene.comparing .compare .seg, .scene.comparing .compare .head, .scene.comparing .compare .shoe { stroke: var(--blue); }
/* marks from the pills */
.dim-label.start { text-anchor: start; }
.dim-label.end { text-anchor: end; }
.dim-label.warn, .lm-label.warn { fill: var(--warn); }
.dim-label.bad, .lm-label.bad { fill: #ff8a8a; }
.angle-mark.hip-top .arc { stroke: var(--accent); stroke-dasharray: 12 9; opacity: 1; }
.angle-label.hip-top { fill: var(--accent-soft); }
.angle-mark.shoulder .arc { stroke: var(--blue); opacity: 1; }
.angle-label.shoulder { fill: var(--blue-soft); }
.saddle-level { opacity: 0.5; }
.crotch-line { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 14 10; opacity: 0.8; }
.steer-axis { stroke: var(--blue); stroke-width: 2.5; stroke-dasharray: 12 10; opacity: 0.5; }
.max-tick { stroke: var(--blue); stroke-width: 5; stroke-linecap: round; }
.shoe.toe-ghost { fill: none; stroke: #8a6d12; stroke-width: 4; stroke-dasharray: 10 8; }
.sole.toe-ghost { stroke: #8a6d12; stroke-width: 4; }
.toe-dot { fill: var(--blue); }
.toe-dot.warn { fill: var(--warn); }
.toe-dot.bad { fill: var(--red); }
