:root {
  --bg: #07090d;
  --card: #10141b;
  --ink: #eef1f6;
  --soft: rgba(238, 241, 246, 0.5);
  --line: rgba(238, 241, 246, 0.09);
  --accent: #ff6b6b;
  --ok: #58d6a0;
}

*, *::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 16px;
}

.bp {
  width: min(332px, 100%);
  padding: 14px 15px 12px;
  border-radius: 28px;
  background: linear-gradient(180deg, #161b24 0%, var(--card) 50%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 30px 60px -30px color-mix(in srgb, var(--accent) 36%, transparent);
}
.bp__head { display: flex; align-items: center; justify-content: space-between; height: 24px; }
.bp__title { font-size: 15px; font-weight: 680; font-stretch: 108%; letter-spacing: -0.008em; }
.bp__state { height: 22px; padding: 0 9px; border-radius: 11px; overflow: hidden; background: rgba(238, 241, 246, 0.07); font-size: 11.5px; line-height: 22px; font-weight: 620; color: var(--soft); }
.bp__state span { display: block; white-space: nowrap; }

.bp__body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; margin-top: 8px; }
.bp__col { height: clamp(118px, 36vh, 150px); width: auto; aspect-ratio: 64 / 150; overflow: visible; cursor: crosshair; }
.col__bed { fill: rgba(238, 241, 246, 0.08); }
.col__fill { fill: var(--accent); }
.col__tick { stroke: rgba(238, 241, 246, 0.22); stroke-width: 1; stroke-linecap: round; }
.col__mark { opacity: 0; }
.col__mark path { fill: none; stroke: var(--ink); stroke-width: 1.600; stroke-linecap: round; }
.col__mark text { font-family: inherit; font-size: 8.5px; font-weight: 700; letter-spacing: 0.04em; fill: var(--soft); }

.bp__read { min-width: 0; }
.bp__num { display: flex; align-items: baseline; height: clamp(44px, 13vh, 54px); font-size: clamp(38px, 11.500vh, 48px); line-height: clamp(44px, 13vh, 54px); letter-spacing: -0.035em; white-space: nowrap; }
.bp__num b { font-weight: 400; font-variation-settings: "wght" var(--w, 640), "wdth" 94; }
.bp__num i { font-style: normal; font-weight: 300; color: var(--soft); margin: 0 0.06em; opacity: 0; }
.bp__unit { font-size: 11.5px; font-weight: 560; color: var(--soft); margin-top: -2px; }
/* the trace: every beat felt by the cuff, largest halfway between the two values */
.bp__trace { display: block; width: 100%; height: auto; margin-top: clamp(4px, 1.500vh, 8px); overflow: visible; }
.trace__bed { fill: none; stroke: var(--line); stroke-width: 1; }
.trace__line { fill: none; stroke: var(--accent); stroke-width: 1.600; stroke-linecap: round; stroke-linejoin: round; }
.bp__pulse { display: flex; align-items: center; gap: 5px; height: 24px; margin-top: 4px; font-size: 12px; color: var(--soft); }
.bp__pulse svg { width: 16px; height: 16px; fill: var(--accent); overflow: visible; }
.bp__pulse b { font-size: 14px; font-weight: 680; color: var(--ink); }
.bp__class { margin-left: auto; height: 22px; padding: 0 9px; border-radius: 11px; overflow: hidden; background: color-mix(in srgb, var(--tone, var(--ok)) 16%, transparent); color: var(--tone, var(--ok)); font-size: 11.5px; line-height: 22px; font-weight: 660; opacity: 0; }
.bp__class span { display: block; white-space: nowrap; }

.bp__go {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 10px;
  border: 0;
  border-radius: 22px;
  background: var(--ink);
  color: #0b0e13;
  font: inherit;
  font-size: 14px;
  font-weight: 660;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity 0.3s ease;
}
.bp__go > span { display: block; height: 20px; overflow: hidden; line-height: 20px; }
.bp__go > span > span { display: block; }
.bp__go[aria-busy="true"] { opacity: 0.4; cursor: default; }
.bp__go:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #eef1f6;
  stroke: #000000;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

/* larger in a roomy window, so the preview is not a small card in a big page */
@media (min-width: 700px) and (min-height: 500px) { .bp { zoom: 1.45; } .ghost { width: 28px; height: 28px; } }
@media (min-width: 1100px) and (min-height: 760px) { .bp { zoom: 2.05; } .ghost { width: 34px; height: 34px; } }
