:root {
  --navy: #1f3a8f;
  --navy-2: #172d72;
  --navy-3: #2b4bb0;
  --accent: #ef4f64;
  --accent-soft: #fbb6c0;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #98a2b3;
  --line: #e4e7ec;
  --bg: #eef1f6;
  --card: #ffffff;
  --muscle: #ffffff;
  --stroke: #3b4565;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --rail: 92px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  --slab: var(--display);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: 0; text-transform: uppercase; line-height: .95; }
svg { flex: none; }

/* ---------- Rail ---------- */
.rail { position: fixed; inset: 0 auto 0 0; width: var(--rail); background: linear-gradient(180deg, #1c3180 0%, #142560 100%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 88px 10px 20px; z-index: 30; box-shadow: inset -1px 0 0 rgba(255,255,255,.06); }
.rail-item { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 10px; color: #aebbe6; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; transition: color .2s; }
.rail-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; transition: background .2s, color .2s, box-shadow .2s, transform .2s; }
.rail-ico svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.rail-item:hover { color: #fff; }
.rail-item:hover .rail-ico { background: rgba(255,255,255,.1); transform: translateY(-1px); }
.rail-item.on { color: #fff; }
.rail-item.on .rail-ico { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -8px rgba(239,79,100,.85); }
.rail-item.on::before { content: ''; position: absolute; left: -10px; top: 16px; width: 4px; height: 30px; border-radius: 0 4px 4px 0; background: #fff; }
.rail-item:focus-visible { outline: none; }
.rail-item:focus-visible .rail-ico { box-shadow: 0 0 0 2px #fff; }

.shell { margin-left: var(--rail); min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 25; height: 72px; display: flex; align-items: center; gap: 20px; padding: 0 32px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-style: italic; font-size: 24px; letter-spacing: -.02em; color: var(--navy); margin-right: auto; }
.brand b { color: var(--accent); font-weight: 800; }
.brand-mark { width: 34px; height: 34px; }
.brand-mark rect { fill: var(--navy); }
.brand-mark path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gender-switch { display: flex; padding: 4px; border-radius: 999px; background: #eef2fb; border: 1px solid #d9e1f5; }
.gender-switch button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.gender-switch button.on { background: var(--navy); color: #fff; box-shadow: 0 2px 6px rgba(31,58,143,.35); }
.search { display: flex; align-items: center; gap: 8px; height: 44px; width: min(320px, 32vw); padding: 0 14px; border: 1.5px solid var(--navy); border-radius: 10px; background: #fff; }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--navy); stroke-width: 2.2; stroke-linecap: round; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font: inherit; font-size: 15px; background: transparent; color: var(--ink); }

main { flex: 1; outline: none; }

/* ---------- Buttons / bits ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 24px; border-radius: 12px; font-weight: 700; font-size: 15px; border: 1.5px solid transparent; transition: transform .15s, box-shadow .15s, background .15s; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px rgba(239,79,100,.7); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(239,79,100,.8); }
.btn-ghost { background: #fff; color: var(--navy); border-color: #cfd8f0; }
.btn-ghost:hover { border-color: var(--navy); }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13px; padding: 0; }
.link-arrow { color: var(--navy); font-weight: 700; font-size: 14px; white-space: nowrap; }
.link-arrow:hover { color: var(--accent); }
.kicker { display: block; font-family: var(--display); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: 15px; color: var(--accent); margin-bottom: 6px; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Strip marquee ---------- */
.strip { background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; padding: 18px 0; }
.strip-track { display: flex; gap: 14px; width: max-content; animation: marquee 180s linear infinite; }
.strip:hover .strip-track { animation-play-state: paused; }
.strip-item { width: 190px; flex: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; transition: border-color .15s; }
.strip-item:hover { border-color: var(--navy); }
.strip-item img { width: 100%; aspect-ratio: 16/10; object-fit: contain; padding: 4px; }
.strip-item span { display: block; padding: 8px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Explorer ---------- */
.explorer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; padding: 56px; align-items: start; }
.explorer-stage { position: relative; overflow: hidden; border-radius: 28px; padding: 40px 32px 28px; text-align: center;
  background: radial-gradient(ellipse 60% 55% at 58% 50%, #ffffff 0%, #f4f6fa 55%, #e7ecf4 100%);
  border: 1px solid #e1e6ef; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 30px 60px -40px rgba(23,45,114,.35); }
.explorer-stage::before { content: ''; position: absolute; left: 58%; top: 54%; width: 640px; height: 640px; transform: translate(-50%, -50%); border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 78px, rgba(31,58,143,.05) 79px 80px); pointer-events: none; }
.explorer-stage > * { position: relative; }
.explorer-intro { max-width: 600px; margin: 0 auto 10px; }
.explorer-intro h2 { font-size: clamp(26px, 3vw, 38px); color: var(--navy-2); }
.explorer-intro p { color: var(--ink-2); margin: 8px 0 0; }

.stage { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 18px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.legend a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: background .2s, color .2s, transform .2s, box-shadow .2s; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: #c4ccdb; flex: none; transition: background .2s, box-shadow .2s; }
.legend-name { flex: 1; }
.legend-n { font-size: 12px; font-weight: 700; color: var(--ink-3); background: rgba(255,255,255,.7); border-radius: 99px; padding: 2px 8px; transition: background .2s, color .2s; }
.legend a:hover, .legend a.on { background: #fff; color: var(--ink); transform: translateX(4px); box-shadow: 0 6px 18px -10px rgba(23,45,114,.45); }
.legend a.on .legend-dot, .legend a:hover .legend-dot { background: #f0442c; box-shadow: 0 0 0 4px rgba(240,68,44,.18); }
.legend a.on .legend-n, .legend a:hover .legend-n { background: #fde8e4; color: #d23a1f; }

.explorer-extra { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.extra-label { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-right: 2px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px; background: #fff; font-weight: 700; font-size: 14px; color: var(--navy); border: 1.5px solid #e1e6ef; transition: border-color .15s, transform .15s; }
.pill span { font-size: 12px; background: #eef2fb; color: var(--ink-2); border-radius: 99px; padding: 2px 8px; }
.pill:hover { border-color: var(--accent); transform: translateY(-1px); }
.explorer-panel { position: sticky; top: 92px; }

/* Live preview inside the panel */
.preview { padding: 20px 22px; border-bottom: 1px solid var(--line); min-height: 250px; display: flex; flex-direction: column; justify-content: center; }
.preview-empty { display: flex; align-items: center; gap: 14px; text-align: left; color: var(--ink-2); }
.preview-empty svg { width: 40px; height: 40px; flex: none; fill: none; stroke: var(--navy); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.preview-empty b { display: block; color: var(--ink); font-size: 16px; }
.preview-empty span { font-size: 13px; }
.preview-on { animation: fadeUp .28s ease; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.preview-head h3 { font-size: 22px; color: var(--navy-2); }
.preview-head span { font-size: 12px; font-weight: 700; color: #d23a1f; background: #fde8e4; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.preview p { margin: 6px 0 14px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.preview-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preview-thumbs a { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; transition: border-color .15s, transform .15s; }
.preview-thumbs a:hover { border-color: var(--navy); transform: translateY(-2px); }
.preview-thumbs img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.preview-cta { width: 100%; justify-content: center; margin-top: 14px; height: 46px; font-size: 14px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Body map (real anatomy renders) ---------- */
.bodymap { --fig-h: clamp(300px, 40vw, 580px); display: flex; justify-content: center; align-items: flex-end; gap: 5%; padding: 4px 0; }
.bodymap-fig { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.bm-frame { position: relative; height: var(--fig-h); max-width: 100%; }
.bm-frame::before { content: ''; position: absolute; left: 12%; right: 12%; bottom: -8px; height: 22px;
  background: radial-gradient(closest-side, rgba(16,24,40,.16), transparent); }
.bm-frame img { position: relative; display: block; width: 100%; height: 100%; mix-blend-mode: multiply; user-select: none; -webkit-user-drag: none; }
.bm-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: multiply;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.bm-frame .muscle { fill: #e8432a; fill-opacity: 0; pointer-events: all; cursor: pointer; outline: none; transition: fill-opacity .28s ease; }
.bm-frame .muscle.hover, .bm-frame .muscle:focus-visible { fill-opacity: .72; }
.bm-frame .muscle.active { fill: #e2361c; fill-opacity: .8; }
.fig-label { display: inline-block; margin-top: 16px; padding: 3px 14px 2px; font-weight: 700; border-radius: 99px; background: #fff; border: 1px solid #e1e6ef;
  font-family: var(--display); letter-spacing: .14em; font-size: 15px; color: var(--ink-2); }
.bodymap-sm { --fig-h: 250px; gap: 6%; padding: 2px 0 0; }
.bodymap-sm .bm-frame::before { display: none; }


/* ---------- Control card (right panel) ---------- */
.control-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.control-top { background: var(--navy); padding: 18px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: rgba(255,255,255,.12); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; color: #dbe4ff; padding: 10px; border-radius: 9px; font-weight: 700; font-size: 15px; }
.seg button.on { background: #fff; color: var(--navy); }
.control-map { margin-top: 14px; background: #fff; border-radius: 12px; padding: 14px 8px; }
.equip { padding: 20px 16px 22px; }
.equip-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.equip-head h3 { font-size: 18px; }
.equip-toggle { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: inherit; cursor: default; text-align: left; }
.equip-badge, .equip-chev { display: none; }
.equip-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; }
.equip-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 6px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink-2); user-select: none; }
.equip-item:hover { background: #f4f6fb; }
.equip-item input { position: absolute; opacity: 0; pointer-events: none; }
.equip-item .box { width: 18px; height: 18px; border: 1.5px solid #c3cad8; border-radius: 5px; flex: none; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.equip-item input:checked + .box { background: var(--navy); border-color: var(--navy); }
.equip-item input:checked + .box::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.equip-item input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.equip-item .ico { color: var(--navy); width: 20px; height: 20px; }
.equip-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.equip-item .count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.equip-item.is-empty { opacity: .4; cursor: default; }
.equip-item input:checked ~ .equip-name { color: var(--ink); font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 24px 56px 56px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(24px, 2.6vw, 32px); color: var(--navy-2); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.mcard { position: relative; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.mcard:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(23,45,114,.45); }
.mcard-media { background: #fff; border-bottom: 1px solid var(--line); }
.mcard-media img { width: 100%; aspect-ratio: 16/10; object-fit: contain; padding: 8px; }
.mcard-body { padding: 14px 16px; }
.mcard-body h3 { font-size: 17px; }
.mcard-body p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; font-weight: 500; }
.mcard-go { position: absolute; right: 14px; bottom: 16px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #eef2fb; color: var(--navy); font-weight: 700; transition: background .2s, color .2s; }
.mcard:hover .mcard-go { background: var(--accent); color: #fff; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-step { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.how-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; margin-bottom: 14px; }
.how-step h3 { font-size: 18px; margin-bottom: 6px; }
.how-step p { margin: 0; color: var(--ink-2); line-height: 1.55; font-size: 15px; }

/* ---------- Pages ---------- */
.page { padding: 28px 40px 48px; }
.page-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.page-side { position: sticky; top: 92px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-3); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--navy); }
.crumbs b { color: var(--ink-2); font-weight: 600; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 42px); color: var(--navy-2); }
.page-head p { color: var(--ink-2); margin: 6px 0 0; font-size: 16px; }
.result-line { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.empty { background: #fff; border-radius: var(--radius); padding: 40px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { margin: 0 0 8px; color: var(--ink-2); }

/* Exercise list cards (MuscleWiki style) */
.xlist { display: flex; flex-direction: column; gap: 28px; }
.xcard { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); scroll-margin-top: 90px; }
.xcard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--navy); color: #fff; padding: 16px 24px; }
.xcard-head h2 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; text-transform: none; }
.xcard-head a:hover h2 { text-decoration: underline; text-underline-offset: 4px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.icon-btn:hover { background: rgba(255,255,255,.2); }
.icon-btn.ok { background: #12b76a; }
.xcard-media { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.pane { position: relative; margin: 0; background: #fff; display: flex; flex-direction: column; }
.pane video { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #fff; }
.pane-guide 
/* Movement guide: start -> end position */
.guide { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); align-items: center; gap: 4px; padding: 22px 14px 18px; }
.guide-hold { grid-template-columns: minmax(0, 1fr); max-width: 60%; margin: 0 auto; width: 100%; }
.guide-step { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.guide-img { width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.guide-img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.guide-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin: 6px 0 6px; background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; }
.guide-step b { font-size: 15px; color: var(--ink); }
.guide-step small { font-size: 13px; color: var(--ink-2); }
.guide-arrow { width: 56px; height: 28px; align-self: center; margin-top: -60px; fill: none; stroke: #4f8fe6; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.guide.big { padding: 28px 18px 24px; }
.guide.big .guide-step b { font-size: 17px; }
.pane figcaption { text-align: center; padding: 4px 12px 14px; font-family: var(--slab); font-size: 18px; color: #111; }
.pane figcaption b { font-weight: 800; font-size: 22px; margin-right: 4px; }
.xcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; background: #eef2fb; color: var(--navy); }
.tag .ico { width: 16px; height: 16px; }
.tag-muscle { background: #fde8eb; color: #c7344a; }
.tag-ghost { background: #f2f4f7; color: var(--ink-2); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 4px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 16px; font-size: 16px; color: var(--ink-2); line-height: 1.5; }
.steps li::before { content: counter(s); flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--navy-3), var(--navy-2)); color: #fff; font-weight: 700; box-shadow: 0 6px 14px -6px rgba(23,45,114,.6); }

/* Grid cards */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { padding: 8px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gcard { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.gcard:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(23,45,114,.45); }
.gcard-media { position: relative; aspect-ratio: 16/10; overflow: hidden; border-bottom: 1px solid var(--line); background: #fff; }
.gcard-media img, .gcard-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.gcard-media img { padding: 6px; }
.gcard-media video { object-fit: cover; }
.gcard-media video { opacity: 0; transition: opacity .2s; }
.gcard.playing .gcard-media video { opacity: 1; }
.gcard-play { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; transition: opacity .2s; }
.gcard-play svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }
.gcard.playing .gcard-play { opacity: 0; }
.gcard-body { padding: 12px 14px 14px; }
.gcard-body h3 { font-size: 15px; line-height: 1.3; letter-spacing: -.01em; }
.gcard-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.gcard-meta .ico { width: 15px; height: 15px; color: var(--navy); }
.page .section { padding: 32px 0 0; }
/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding: 14px 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.pager-info { font-size: 14px; color: var(--ink-2); }
.pager-info b { color: var(--ink); }
.pager-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pg { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 14px; color: var(--ink-2); transition: border-color .15s, color .15s, background .15s; }
.pg svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
a.pg:hover { border-color: var(--navy); color: var(--navy); }
.pg.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.pg.gap { border: 0; background: none; min-width: 20px; padding: 0; }
.pg.off { opacity: .4; }
@media (max-width: 760px) {
  .pager { justify-content: center; padding: 12px; }
  .pg { min-width: 36px; height: 36px; padding: 0 9px; }
  .pg-nav span { display: none; }
}
.more { display: flex; justify-content: center; margin-top: 24px; }

/* Detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.detail-title { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.detail-title h1 { font-size: clamp(30px, 3.6vw, 46px); color: var(--navy-2); }
.detail-media { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pane.big { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pane.big figcaption { padding: 6px 16px 18px; }
.pane.big .num { font-weight: 800; font-size: 34px; }
.pane.big .nm { font-size: 22px; }
.howto { background: #fff; border-radius: var(--radius); margin-top: 20px; box-shadow: var(--shadow); }
.howto h2 { font-size: 26px; padding: 22px 24px 14px; }
.detail-side { position: sticky; top: 92px; }
.info-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.facts { margin: 16px 0 0; display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--ink-3); font-weight: 500; }
.facts dd { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 6px; text-align: right; }
.facts dd a { color: var(--accent); }
.facts .ico { color: var(--navy); }
.blurb { margin: 8px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; line-height: 1.55; }

/* Footer */
.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px 40px; background: var(--navy); color: #c9d3f2; font-size: 14px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #fff; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .explorer { grid-template-columns: 1fr; padding: 32px; }
  .explorer-panel { position: static; }
  .stage { grid-template-columns: 1fr; }
  .bodymap { --fig-h: clamp(280px, 70vw, 520px); }
  .legend { flex-direction: row; flex-wrap: wrap; justify-content: center; order: 2; }
  .legend a:hover, .legend a.on { transform: none; }
  .preview { min-height: 0; }
  .page-split, .detail { grid-template-columns: minmax(0, 1fr); }
  .page-side, .detail-side { position: static; order: -1; }
  .page-split .control-map { display: none; }
  .section { padding: 16px 32px 40px; }
}
@media (max-width: 760px) {
  :root { --rail: 0px; }
  .rail { inset: auto 0 0 0; width: 100%; height: 64px; flex-direction: row; padding: 6px; justify-content: space-around; }
  .shell { padding-bottom: 64px; }
  .topbar { padding: 0 16px; gap: 10px; height: auto; flex-wrap: wrap; padding-block: 10px; }
  .brand { font-size: 20px; }
  .search { width: 100%; order: 3; }
  .gender-switch button { padding: 6px 12px; font-size: 13px; }
  html, body { overflow-x: hidden; }
  .rail-ico { width: 38px; height: 34px; border-radius: 10px; }
  .rail-item.on::before { display: none; }
  .rail-item { font-size: 9px; padding: 4px 0; gap: 2px; }
  .explorer { padding: 24px 16px; }
  .explorer-stage { padding: 24px 12px 20px; border-radius: 20px; }
  .explorer-stage::before { display: none; }
  .section { padding: 8px 16px 32px; }
  .how-grid { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 32px; }
  .xcard-media, .detail-media { grid-template-columns: 1fr; }
  .xcard-head { padding: 14px 16px; }
  .xcard-foot { padding: 14px 16px; }
  .steps { padding: 4px 16px 20px; }
  .steps li::before { width: 38px; height: 38px; }
  .equip-grid { grid-template-columns: 1fr 1fr; }
  .ggrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .footer { padding: 18px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ================= Phone layout (≤760px). Desktop is unaffected. ================= */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { gap: 8px; padding-block: 8px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .gender-switch button { padding: 5px 11px; font-size: 12px; }
  .search { height: 40px; }
  .search input { font-size: 14px; }

  /* strip */
  .strip { padding: 12px 0; }
  .strip-track { gap: 10px; }
  .strip-item { width: 136px; border-radius: 10px; }
  .strip-item span { font-size: 11px; padding: 6px 8px; }

  /* headings and copy */
  .kicker { font-size: 12px; letter-spacing: .16em; margin-bottom: 4px; }
  .explorer-intro h2 { font-size: 24px; }
  .explorer-intro p { font-size: 13px; }
  .section-head { margin-bottom: 14px; }
  .section-head h2 { font-size: 22px; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 26px; }
  .page-head p { font-size: 14px; }
  .result-line { font-size: 12px; margin-top: 6px; }
  .crumbs { font-size: 12px; margin-bottom: 10px; }
  .link-arrow { font-size: 13px; }

  /* explorer */
  .explorer { gap: 16px; }
  .legend a { font-size: 12px; padding: 6px 10px; gap: 6px; }
  .legend-n { font-size: 11px; padding: 1px 6px; }
  .fig-label { font-size: 12px; margin-top: 10px; }
  .pill { font-size: 12px; padding: 7px 12px; }
  .extra-label { width: 100%; text-align: center; font-size: 12px; }
  .preview { padding: 14px 16px; }
  .preview-head h3 { font-size: 18px; }
  .preview p { font-size: 12.5px; margin: 4px 0 10px; }
  .preview-cta { height: 42px; font-size: 13px; }
  .preview-empty b { font-size: 14px; }
  .preview-empty span { font-size: 12px; }

  /* side panel: top bar already has the Male/Female switch; equipment collapses */
  .control-top { display: none; }
  .equip { padding: 14px 16px; }
  .equip-head { margin-bottom: 0; }
  .equip-toggle { flex: 1; cursor: pointer; padding: 2px 0; }
  .equip-head h3 { font-size: 15px; }
  .equip-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
  .equip-chev { display: block; width: 20px; height: 20px; margin-left: auto; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; transition: transform .2s; }
  .equip.open .equip-chev { transform: rotate(180deg); }
  .equip:not(.open) .equip-grid { display: none; }
  .equip.open .equip-head { margin-bottom: 8px; }
  .equip-item { font-size: 12.5px; padding: 7px 4px; gap: 7px; }
  .equip-item .ico { width: 17px; height: 17px; }
  .equip-item .box { width: 16px; height: 16px; }
  .page-side { margin-bottom: 4px; }

  /* exercise list cards */
  .xlist { gap: 18px; }
  .xcard-head { padding: 12px 14px; }
  .xcard-head h2 { font-size: 19px; line-height: 1.1; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .xcard-foot { padding: 12px 14px; gap: 10px; }
  .tags { gap: 6px; }
  .tag { font-size: 11.5px; padding: 4px 8px; }
  .tag .ico { width: 14px; height: 14px; }
  .steps { padding: 2px 14px 16px; gap: 10px; }
  .steps li { font-size: 13.5px; gap: 12px; }
  .steps li::before { width: 30px; height: 30px; font-size: 13px; }

  /* movement guide */
  .guide { padding: 14px 10px 12px; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); }
  .guide-arrow { width: 40px; height: 20px; margin-top: -48px; }
  .guide-num { width: 24px; height: 24px; font-size: 12px; margin: 4px 0; }
  .guide-step b, .guide.big .guide-step b { font-size: 13px; }
  .guide-step small { font-size: 11.5px; }
  .guide-hold { max-width: 70%; }

  /* exercise page: exercise first, info card after it */
  .detail { gap: 16px; }
  .detail-side { order: 0; }
  .detail-title { gap: 8px; margin-bottom: 12px; }
  .detail-title h1 { font-size: 28px; }
  .detail-media { gap: 12px; }
  .howto { margin-top: 12px; }
  .howto h2 { font-size: 20px; padding: 16px 14px 10px; }
  .info-card { padding: 14px; }
  .facts div { font-size: 13px; padding: 10px 0; }
  .blurb { font-size: 13px; }

  /* grids */
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mcard-body { padding: 10px 12px; }
  .mcard-body h3 { font-size: 14px; }
  .mcard-body p { font-size: 11.5px; }
  .mcard-go { width: 26px; height: 26px; right: 10px; bottom: 12px; font-size: 13px; }
  .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gcard-body { padding: 10px 10px 12px; }
  .gcard-body h3 { font-size: 13px; }
  .gcard-meta { font-size: 11px; gap: 4px; }
  .gcard-meta .ico { width: 13px; height: 13px; }
  .gcard-play { width: 28px; height: 28px; right: 8px; bottom: 8px; }
  .chips { gap: 6px; margin-bottom: 14px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { font-size: 12.5px; padding: 6px 12px; white-space: nowrap; flex: none; }
  .how-step { padding: 16px; }
  .how-n { width: 34px; height: 34px; font-size: 14px; margin-bottom: 10px; }
  .how-step h3 { font-size: 16px; }
  .how-step p { font-size: 13px; }

  .btn { height: 44px; padding: 0 18px; font-size: 14px; }
  .empty { padding: 24px 16px; }
  .pager { margin-top: 18px; }
  .pager-info { font-size: 12px; width: 100%; text-align: center; }
  .footer { font-size: 12px; }
  .footer-links { gap: 14px; flex-wrap: wrap; }
}
