/* Human Body Explorer */
.hb-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .8rem; }
.hb-tabs button { display: flex; align-items: center; gap: .45rem; border: 2px solid var(--pmcq-line, #d7e2e8); background: #fff; color: var(--bs-primary); border-radius: 12px; padding: .45rem .8rem; font-weight: 700; cursor: pointer; }
.hb-tabs button.on { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }

.hb-main { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 1rem; align-items: start; }
.hb-stagebox { position: relative; background: #fff; border: 1px solid var(--pmcq-line, #d7e2e8); border-radius: 14px; overflow: hidden; }
.hb-svg { display: block; width: 100%; height: auto; background: radial-gradient(circle at 50% 35%, #fff, #f4f8fb); }
.hb-svg text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; fill: #0f172a; pointer-events: none; }
.hb-svg .lbl { font-weight: 600; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 3.2px; stroke-linejoin: round; transition: opacity .2s; }
.hb-svg .lbl.big { font-size: 18px; font-weight: 700; }
.hb-svg .lbl.sm { font-size: 12.5px; }
.hb-svg .hd { font-size: 17px; font-weight: 700; fill: #0b3d5c; }
.hb-svg .key text { font-size: 14px; }
.hb-svg.no-labels .lbl { opacity: 0; }
.hb-svg .part { cursor: pointer; transition: opacity .25s, filter .25s; }
.hb-svg.has-hi .part:not(.hi) { opacity: .38; }
.hb-svg .part.hi { filter: drop-shadow(0 0 5px rgba(234, 179, 8, .95)); }
.hb-svg .part:hover { filter: drop-shadow(0 0 4px rgba(15, 23, 42, .55)); }
.hb-svg .part.sel { filter: drop-shadow(0 0 6px rgba(37, 99, 235, .95)); }
.hb-svg .part.good { filter: drop-shadow(0 0 7px rgba(22, 163, 74, 1)); opacity: 1 !important; }
.hb-svg .part.bad { filter: drop-shadow(0 0 7px rgba(220, 38, 38, 1)); opacity: 1 !important; }
.hb-svg .lbl.hi { fill: #7c2d12; }
.hb-svg.quizzing .part { opacity: 1 !important; }
.hb-particle { pointer-events: none; }
.hb-controls { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; padding: .5rem .8rem; border-top: 1px solid var(--pmcq-line, #d7e2e8); background: #f8fbfc; }
.hb-speed { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: #475569; }
.hb-speed select { width: auto; }
.hb-quizbar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: .6rem; background: #0b3d5c; color: #fff; padding: .5rem .8rem; font-size: .95rem; z-index: 2; }
.hb-quizbar[hidden] { display: none; }

.hb-side { padding: .9rem; }
.hb-scene-title h2 { font-size: 1.15rem; color: var(--bs-primary); margin: 0 0 .2rem; }
.hb-steps { list-style: none; margin: 0 0 .7rem; padding: 0; display: grid; gap: .2rem; max-height: 260px; overflow-y: auto; }
.hb-steps button { width: 100%; text-align: left; display: flex; align-items: center; gap: .5rem; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: .3rem .45rem; color: #475569; font-size: .9rem; cursor: pointer; }
.hb-steps button:hover { background: #f1f6f8; }
.hb-steps button.on { background: #e6f0f5; border-color: var(--bs-primary); color: var(--bs-primary); font-weight: 700; }
.hb-num { flex: 0 0 1.6rem; height: 1.6rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #e2e8f0; font-size: .78rem; font-weight: 700; }
.hb-steps button.on .hb-num { background: var(--bs-primary); color: #fff; }
.hb-steps button.done .hb-num { background: #16a34a; color: #fff; }
.hb-nav { display: flex; gap: .4rem; margin-bottom: .7rem; }
.hb-nav .btn { flex: 1; padding-left: .4rem; padding-right: .4rem; }
.hb-caption h3 { font-size: 1.02rem; color: var(--bs-primary); margin-bottom: .35rem; }
.hb-caption p { font-size: .92rem; margin-bottom: .45rem; }
.hb-fact { background: #fff7e0; border-left: 3px solid #e0a526; border-radius: 6px; padding: .35rem .6rem; font-size: .86rem !important; }
.hb-part { margin-top: .6rem; padding: .7rem .85rem; border-left: 4px solid #2563eb; background: #f3f8ff; }
.hb-part[hidden] { display: none; }
.hb-part h3 { font-size: 1rem; color: #1e3a8a; margin-bottom: .25rem; }
.hb-part p { font-size: .9rem; }

@media (max-width: 991px) {
  .hb-main { grid-template-columns: 1fr; }
  /* on phones the diagram stays in view while the steps and text below are read */
  .hb-stagebox { position: sticky; top: 0; z-index: 6; box-shadow: 0 4px 12px rgba(15, 23, 42, .14); }
  .hb-controls { padding: .35rem .6rem; gap: .3rem .9rem; }
  .hb-steps { max-height: none; }
}
