/* Human body explorer (body page only) */
.bd { --bd-ink: #0B2B36; --bd-ink2: #06202A; --bd-line: #5EEAD4; display: grid; gap: 14px; margin-top: 14px; }
.bd-side { min-width: 0; }
.bd-main { min-width: 0; display: grid; gap: 12px; align-content: start; }

/* stage: dark "scanner" */
.bd-stage { position: relative; display: flex; flex-direction: column; align-items: center; padding: 14px 10px 10px; border-radius: 26px; overflow: hidden; color: #CFE6EC;
  background: radial-gradient(240px 200px at 50% 38%, rgba(94,234,212,.16), transparent 70%), linear-gradient(180deg, var(--bd-ink), var(--bd-ink2)); box-shadow: 0 12px 30px -16px rgba(6,32,42,.8); }
.bd-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(94,234,212,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(94,234,212,.07) 1px, transparent 1px); background-size: 24px 24px; -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent); mask-image: radial-gradient(closest-side, #000 55%, transparent); pointer-events: none; }
.bd-scan { position: absolute; left: 0; right: 0; top: 0; height: 60px; background: linear-gradient(180deg, transparent, rgba(94,234,212,.22), transparent); transform: translateY(-80px); animation: bdScan 3.4s ease-in-out 1 .4s; pointer-events: none; }
@keyframes bdScan { to { transform: translateY(420px); } }
.bd-svg { position: relative; width: auto; height: min(46vh, 340px); max-width: 100%; overflow: visible; }
.bd-tag { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(94,234,212,.4); color: #fff; font-weight: 800; font-size: .86rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bd-tag:empty { display: none; }

/* body outline + organs */
.bd-body .b-line { fill: none; stroke: var(--bd-line); stroke-opacity: .6; stroke-width: 3; stroke-linejoin: round; }
.bd-body .b-fill { fill: url(#bdskin); stroke: none; }
.bd-fat ellipse { fill: #fbbf24; fill-opacity: .3; stroke: #f59e0b; stroke-width: 1.2; transform-box: fill-box; transform-origin: center; transform: scale(var(--fs, 1)); transition: transform .8s ease; cursor: pointer; }
.bd-fat .in { fill-opacity: .22; }
.bd-muscle path { fill: #f87171; fill-opacity: .3; stroke: #fca5a5; stroke-width: 1; cursor: pointer; }
.bd-o { cursor: pointer; }
.bd-o ellipse, .bd-o path, .bd-o rect { stroke: rgba(255,255,255,.55); stroke-width: .8; transition: filter .3s; }
.bd-o .ln { fill: none; stroke: rgba(0,0,0,.28); stroke-width: 1; }
.o-brain ellipse { fill: url(#g-brain); } .o-lungs ellipse { fill: url(#g-lung); fill-opacity: .92; } .o-heart path { fill: url(#g-heart); }
.o-liver path { fill: url(#g-liver); } .o-stomach path { fill: url(#g-stomach); } .o-pancreas ellipse { fill: url(#g-pancreas); } .o-kidney ellipse { fill: url(#g-kidney); }
.o-gut .hit { fill: transparent; stroke: none; } .o-gut .coil { fill: none; stroke: #FDBA74; stroke-width: 7; stroke-linecap: round; stroke-opacity: .95; }
.bd-svg [data-o]:focus-visible { outline: 0; filter: drop-shadow(0 0 4px #fff); }
.bd-svg .is-hi { filter: drop-shadow(0 0 6px #5EEAD4) drop-shadow(0 0 2px #fff); animation: bdPulse 1.6s ease-in-out infinite; }
.bd-fat.is-hi ellipse, .bd-muscle.is-hi path { stroke: #5EEAD4; stroke-width: 2.2; }
@keyframes bdPulse { 50% { opacity: .78; } }
.beat { transform-box: fill-box; transform-origin: center; animation: bdBeat 1.1s infinite; }
.lung { transform-box: fill-box; transform-origin: center; animation: bdBreath 4s ease-in-out infinite; }
@keyframes bdBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.16); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
@keyframes bdBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.bd-svg[data-sc="walk"] .beat { animation-duration: .6s; } .bd-svg[data-sc="walk"] .lung { animation-duration: 2s; }
.bd-svg[data-sc="stress"] .beat { animation-duration: .7s; }
.bd-flow .dot { fill: #5EEAD4; opacity: 0; transform: translate(var(--fx, 120px), var(--fy, 160px)); }
.bd-svg.is-live .bd-flow .dot { animation: bdDot 2s infinite; }
.bd-flow .d2 { animation-delay: .6s !important; } .bd-flow .d3 { animation-delay: 1.2s !important; }
@keyframes bdDot { 0% { opacity: 0; transform: translate(var(--fx, 120px), var(--fy, 160px)) scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--fx, 120px), calc(var(--fy, 160px) - 26px)) scale(1.6); } }
.bd-legend { position: relative; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: .76rem; color: #9CC3CD; padding: 8px 4px 0; }
.bd-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.lg-heart { background: #fb7185; } .lg-fat { background: #fbbf24; } .lg-glu { background: #5EEAD4; }

/* organ chips: one swipeable strip */
.bd-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
.bd-chips::-webkit-scrollbar { display: none; }
.bd-chip { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; }
.bd-chip span { font-size: 1.1rem; }
.bd-chip.is-on { background: var(--bd-ink); color: #fff; border-color: var(--bd-ink); }

/* tabs */
.bd-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 18px; background: var(--surface-2); }
.bd-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border: 0; border-radius: 14px; background: transparent; color: var(--text-2); font: inherit; font-weight: 700; font-size: .74rem; line-height: 1.2; text-align: center; cursor: pointer; }
.bd-tabs button span { font-size: 1.15rem; }
.bd-tabs button.is-on { background: var(--bd-ink); color: #fff; box-shadow: 0 4px 12px -6px rgba(6,32,42,.7); }
.bd-pane[hidden] { display: none; }
.bd-hint { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }

/* organ card */
.bd-card { padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.bd-h { display: flex; gap: 12px; align-items: center; }
.bd-h .ex-emo { width: 52px; height: 52px; flex: none; display: grid; place-items: center; font-size: 1.7rem; border-radius: 16px; background: var(--bd-ink); }
.bd-h h2 { margin: 0; font-size: 1.3rem; line-height: 1.2; } .bd-h small { display: block; margin-top: 2px; }
.bd-facts { display: grid; gap: 8px; margin: 14px 0 4px; padding: 0; list-style: none; }
.bd-facts li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, #5EEAD4 14%, var(--surface)); font-size: .92rem; font-weight: 600; line-height: 1.45; }
.bd-facts li::before { content: "✦"; color: var(--brand-600); flex: none; }
.bd-rows { display: grid; gap: 12px; margin: 14px 0 0; }
.bd-row { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.bd-row i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-style: normal; font-size: 1rem; }
.bd-row h3 { margin: 0 0 2px; font-size: .86rem; color: var(--brand-700); } .bd-row p { margin: 0; font-size: .95rem; }
.bd-see { display: flex; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 14px; background: #FEF3C7; color: #78350F; font-size: .88rem; line-height: 1.5; }
:root[data-theme="dark"] .bd-see { background: #3A2E0E; color: #FDE68A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bd-see { background: #3A2E0E; color: #FDE68A; } }
.bd-pn { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.bd-pn button { flex: 1; min-height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }

/* scenarios */
.bd-scen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.bd-sc { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; min-height: 56px; }
.bd-sc span { font-size: 1.5rem; flex: none; } .bd-sc b { font-size: .82rem; line-height: 1.3; }
.bd-sc.is-on { border-color: var(--bd-ink); background: color-mix(in srgb, #5EEAD4 16%, var(--surface)); box-shadow: inset 0 0 0 1px var(--bd-ink); }
.bd-live { display: grid; gap: 12px; }
.bd-meters { display: grid; gap: 9px; padding: 14px; border-radius: 18px; background: var(--surface-2); }
.bd-m { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; }
.bd-m div { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bd-m i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .9s ease; }
.bd-m em { font-style: normal; font-size: .72rem; color: var(--muted); text-align: right; }
.m0 { background: #38bdf8; } .m1 { background: #a78bfa; } .m2 { background: #22c55e; } .m3 { background: #f59e0b; } .m4 { background: #ef4444; }
.bd-cell { display: flex; align-items: center; gap: 10px; padding-top: 4px; } .bd-cell svg { width: 52px; height: 52px; flex: none; }
#bd-cell { fill: #fde68a; stroke: #f59e0b; stroke-width: 2; transition: r .9s ease; } .bd-cell .nuc { fill: #f59e0b; } .bd-cell small { font-weight: 700; }
.bd-stepcard { padding: 14px; border-radius: 20px; background: var(--bd-ink); color: #E6F1F4; }
.bd-stephead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bd-stephead small { font-weight: 800; color: #5EEAD4; }
.bd-dots { display: flex; gap: 5px; } .bd-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.22); } .bd-dots i.on { background: #FBBF24; } .bd-dots i.done { background: #5EEAD4; }
.bd-stepcard p { margin: 10px 0 12px; font-size: 1.06rem; line-height: 1.55; min-height: 3.4em; color: #fff; }
.bd-ctl { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; align-items: center; }
.bd-nav { height: 46px; border-radius: 14px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.bd-note { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--leaf-50); font-size: .9rem; }
.bd-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: .88rem; }
.bd-steps li { padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.bd-steps li.is-now { border-color: var(--bd-ink); background: color-mix(in srgb, #5EEAD4 14%, var(--surface)); }

/* numbers */
.bd-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.bd-n { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.bd-n .ex-emo { font-size: 1.5rem; } .bd-n strong { font-size: 1.2rem; line-height: 1.2; color: var(--brand-700); } .bd-n small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.bd-acc { display: grid; gap: 10px; } .bd-acc p { margin: 0 0 12px; }
.bd-after { margin-top: 24px; }

/* wide screens: stage left (sticky), content right */
@media (min-width: 900px) {
  .bd { grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
  .bd-side { position: sticky; top: calc(var(--header-h) + 14px); }
  .bd-svg { height: min(68vh, 520px); }
  .bd-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .bd-tabs button { flex-direction: row; gap: 6px; font-size: .9rem; min-height: 46px; }
  .bd-scen { grid-template-columns: repeat(4, 1fr); }
  .bd-sc { flex-direction: column; align-items: flex-start; }
}
/* phones: keep the body on screen while stepping through a scenario */
@media (max-width: 899px) {
  .bd[data-tab="scen"] .bd-side { position: sticky; top: var(--header-h); z-index: 5; margin: 0 -16px; }
  .bd[data-tab="scen"] .bd-stage { border-radius: 0 0 22px 22px; padding-top: 8px; }
  .bd[data-tab="scen"] .bd-svg { height: 30vh; }
  .bd[data-tab="scen"] .bd-legend { display: none; }
}
@media (prefers-reduced-motion: reduce) { .beat, .lung, .bd-scan, .bd-svg .is-hi, .bd-svg.is-live .bd-flow .dot { animation: none; } }
.bd-all { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 12px; }
.bd-all summary { min-height: 46px; display: flex; align-items: center; font-weight: 700; font-size: .9rem; cursor: pointer; }
.bd-all[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.bd-all .bd-steps { padding-bottom: 12px; }
