:root {
  --bg: #ffffff;
  --card: #f5f5f3;
  --ink: #17181c;
  --soft: rgba(23, 24, 28, 0.55);
  --quiet: rgba(23, 24, 28, 0.06);
  --under: #5aa9f0;
  --healthy: #27ae76;
  --over: #f0a23a;
  --obese: #ec6a5c;
  --now: #27ae76;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 10px;
}

.bm { position: relative; width: min(320px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); padding: 16px 16px 14px; border-radius: 28px; background: linear-gradient(180deg, #fbfbfa, var(--card)); box-shadow: inset 0 0 0 1px rgba(23, 24, 28, 0.07), inset 0 1px 0 #ffffff, 0 1px 2px rgba(23, 24, 28, 0.05), 0 26px 44px -30px rgba(23, 24, 28, 0.4); }
.bm__roll { display: block; overflow: hidden; }
.bm__roll > span { display: block; white-space: nowrap; }

.bm__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bm__title { font-size: 15px; font-weight: 720; font-stretch: 104%; letter-spacing: -0.005em; white-space: nowrap; }
.bm__units { position: relative; display: flex; height: 28px; padding: 2px; border-radius: 14px; background: var(--quiet); }
.bm__units button { position: relative; z-index: 1; height: 24px; padding: 0 9px; border: 0; border-radius: 12px; background: none; color: var(--soft); font: inherit; font-size: 11.500px; font-weight: 660; cursor: pointer; outline: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; transition: color 0.25s; }
.bm__units button[aria-checked="true"] { color: var(--ink); }
.bm__units button:focus-visible { box-shadow: 0 0 0 2px #fbfbfa, 0 0 0 4px var(--ink); }
.bm__thumb { position: absolute; left: 0; top: 2px; width: 50px; height: 24px; border-radius: 12px; background: #ffffff; box-shadow: 0 1px 2px rgba(23, 24, 28, 0.12), 0 4px 10px -4px rgba(23, 24, 28, 0.2); }

/* the gauge: four zones on an arc, a needle, and the number sitting under its hub */
.bm__gauge { position: relative; margin-top: 4px; }
.bm__gauge svg { display: block; width: 100%; max-width: 250px; height: auto; margin: 0 auto; overflow: visible; fill: none; }
.bm__arc { stroke-width: 11; opacity: 0.3; transition: opacity 0.35s; }
.bm__arc.is-on { opacity: 1; }
.bm__marks text { fill: rgba(23, 24, 28, 0.42); font-size: 8.500px; font-weight: 640; text-anchor: middle; }
.bm__needle { stroke: var(--ink); stroke-width: 4.500; stroke-linecap: round; }
.bm__read { position: absolute; left: 0; right: 0; bottom: 18px; display: grid; justify-items: center; pointer-events: none; }
.bm__value { display: block; font-size: 34px; line-height: 36px; font-weight: 780; font-stretch: 96%; letter-spacing: -0.02em; color: var(--now); }
.bm__zone { position: absolute; top: 100%; height: 16px; line-height: 16px; font-size: 11.500px; font-weight: 700; color: var(--now); }

.bm__field { display: grid; grid-template-columns: 1fr auto; align-items: baseline; margin-top: 8px; }
.bm__name { font-size: 12.500px; font-weight: 640; color: var(--soft); }
.bm__num { font-size: 13.500px; font-weight: 740; white-space: nowrap; }
.bm__field input { grid-column: 1 / -1; display: block; width: 100%; height: 24px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: grab; outline: none; touch-action: none; }
.bm__field input:active { cursor: grabbing; }
.bm__field input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--done, 50%), rgba(23, 24, 28, 0.12) var(--done, 50%)); }
.bm__field input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--done, 50%), rgba(23, 24, 28, 0.12) var(--done, 50%)); }
.bm__field input::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border: 0; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 1px rgba(23, 24, 28, 0.14), 0 2px 6px rgba(23, 24, 28, 0.22); }
.bm__field input::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 1px rgba(23, 24, 28, 0.14), 0 2px 6px rgba(23, 24, 28, 0.22); }
.bm__field input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
.bm__field input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }

.bm__range { margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(23, 24, 28, 0.08); font-size: 12px; line-height: 16px; font-weight: 540; color: var(--soft); white-space: nowrap; }
.bm__range b { font-weight: 720; color: var(--ink); }

@media (hover: hover) { .bm__units button:hover { color: var(--ink); } }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; pointer-events: none; opacity: 0; fill: var(--ink); stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(23, 24, 28, 0.3)); z-index: 5; }
