/* B1 -> PDH vs LDH model at the top of /thiamine/ (markup tools/thiamine_b1model.py, script assets/b1pdh.js). Scoped to .b1m. */
.b1m { --b1:#FFD84D; --atp:#7CE38B; --lac:#FF5FA2; --mut:#9C93A0; --line:#26222b; --ink:#ECE7EE;
  position: relative; width: min(1100px, calc(100vw - 48px)); left: 50%; transform: translateX(-50%);
  margin: 6px 0 30px; color: var(--ink); font-family: Geist, system-ui, sans-serif; }
.b1m * { box-sizing: border-box; }
.b1m__k { margin: 0; font: 12px "Geist Mono", ui-monospace, monospace; letter-spacing: 2px; color: var(--mut); text-transform: uppercase; }
.b1m__title { font-family: Anton, Impact, sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: .5px;
  font-size: clamp(24px, 4.4vw, 40px); line-height: 1.05; margin: 4px 0 8px; color: #fff; }
.b1m__lede { color: #cfc8d2; font-size: 16px; line-height: 1.55; margin: 0 0 14px; max-width: 760px; }
/* counters bar across the top; stays under the site header while the flow scrolls */
.b1m__top { position: sticky; top: 58px; z-index: 4; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 12px;
  background: #0b0a0d; border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px; margin-bottom: 12px; }
.b1m__top div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.b1m__top b { font-family: Anton, Impact, sans-serif; font-weight: 400; font-size: 28px; line-height: 1.05; color: #fff;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.b1m__top .b1m__atp { color: var(--atp); }
.b1m__top .b1m__lac { color: var(--lac); }
.b1m__main { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 12px; align-items: start; }
.b1m__stage { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #000; }
.b1m canvas { display: block; width: 100%; aspect-ratio: 900 / 1090; touch-action: pan-y; }
.b1m__etc { width: 100%; aspect-ratio: 1200 / 560; overflow: hidden; position: relative; }
.b1m__etc svg { display: block; width: 100%; height: 100%; }
.b1m__load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mut); font: 13px "Geist Mono", monospace; }
/* three vertical bars on the right: B1 (the control), ATP, lactate */
.b1m__bars { position: sticky; top: 150px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: #0b0a0d; border: 1px solid var(--line); border-radius: 16px; padding: 14px 10px 12px; }
.b1m__vb { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.b1m__vv { font-family: Anton, Impact, sans-serif; font-size: 18px; line-height: 1; color: #fff; white-space: nowrap; height: 18px; }
.b1m__b1c { color: var(--b1); }
.b1m__vl { font: 11px "Geist Mono", monospace; letter-spacing: 1px; color: var(--mut); text-transform: uppercase; }
.b1m__tube { position: relative; width: 34px; height: 340px; border-radius: 999px; background: #1b1820; overflow: hidden;
  border: 1px solid #2f2a35; }
.b1m__tube > i { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; border-radius: 999px; background: var(--atp);
  transition: height .2s, background-color .3s; }
.b1m__tube--b1 { cursor: ns-resize; overflow: visible; touch-action: none; outline: none; }
.b1m__tube--b1 > i { background: linear-gradient(0deg, #b8901a, var(--b1)); transition: none; box-shadow: 0 0 16px rgba(255,216,77,.35); }
.b1m__tube--b1:focus-visible { box-shadow: 0 0 0 3px rgba(255,216,77,.5); }
.b1m__grip { position: absolute; left: -7px; right: -7px; height: 12px; border-radius: 6px; background: #fff; transform: translateY(50%);
  box-shadow: 0 0 10px rgba(255,255,255,.6); pointer-events: none; }
.b1m__tick { position: absolute; left: -6px; right: -6px; bottom: 66.7%; height: 0; border-top: 2px dashed rgba(255,255,255,.55);
  font: normal 9px "Geist Mono", monospace; color: transparent; pointer-events: none; }
.b1m__hint { grid-column: 1 / -1; margin: 2px 0 0; text-align: center; font: 11px "Geist Mono", monospace; letter-spacing: 1px; color: var(--mut); }
.b1m__panel { margin-top: 12px; display: grid; gap: 12px; }
.b1m__card { background: #0b0a0d; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.b1m__card p { margin: 0; }
.b1m__presets { display: flex; flex-wrap: wrap; gap: 8px; }
.b1m__presets button { background: #151319; color: var(--ink); border: 1px solid #2f2a35; border-radius: 999px; padding: 8px 14px; font: 600 13px Geist, sans-serif; cursor: pointer; }
.b1m__presets button.on { background: var(--b1); color: #1a1400; border-color: var(--b1); }
.b1m__status { font-size: 16px; line-height: 1.5; }
.b1m__status b { color: #fff; }
.b1m__legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: #cfc8d2; }
.b1m__legend svg { margin-right: 4px; vertical-align: -1px; }
.b1m .b1m__note { color: var(--mut); font-size: 13px; line-height: 1.6; margin-top: 10px; }
.b1m__note strong { color: #cfc8d2; }
/* phones and narrow tablets: bars move above the flow, side by side, shorter */
@media (max-width: 760px) {
  .b1m__top { gap: 2px 8px; padding: 7px 10px; border-radius: 12px; }
  .b1m__top .b1m__k { font-size: 8.5px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .b1m__top b { font-size: 18px; }
  .b1m__main { grid-template-columns: 1fr; }
  .b1m__bars { position: static; order: -1; padding: 12px 18px; }
  .b1m__tube { height: 150px; }
}
/* from 1100px the 300px side nav takes part of the row: fit the column, no sideways scroll */
@media (min-width: 1100px) { .b1m { width: min(1100px, calc(min(100vw, 1320px) - 348px)); } }
