:root {
  --bg: #f4f1ea;
  --card: #fffdf9;
  --ink: #1d1b18;
  --soft: rgba(29, 27, 24, 0.55);
  --line: rgba(29, 27, 24, 0.12);
  --accent: #ef6a4c;
  --fill: 9%;
}

*, *::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 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.ds { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); width: min(332px, 100%); padding: 18px 18px 20px; border-radius: 28px; background: var(--card); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 #ffffff, 0 34px 50px -34px rgba(60, 40, 20, 0.45), 0 4px 10px -6px rgba(60, 40, 20, 0.2); }

.ds__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.ds__who { display: grid; gap: 2px; }
.ds__who strong { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.ds__who > span { font-size: 12px; color: var(--soft); white-space: nowrap; }
.ds__units { position: relative; display: grid; grid-template-columns: repeat(2, 36px); height: 32px; padding: 3px; border-radius: 11px; background: rgba(29, 27, 24, 0.06); }
.ds__units button { position: relative; z-index: 1; display: grid; place-items: center; border-radius: 8px; font-size: 12.5px; font-weight: 650; color: var(--soft); transition: color 0.2s; }
.ds__units button[aria-checked="true"] { color: var(--ink); }
.ds__units button:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.ds__thumb { position: absolute; left: 3px; top: 3px; bottom: 3px; width: 36px; border-radius: 8px; background: #ffffff; box-shadow: 0 0 0 1px var(--line), 0 4px 8px -4px rgba(29, 27, 24, 0.35); }

.ds__dose { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-top: clamp(8px, 3vh, 18px); }
.ds__num { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.ds__num b { font-size: clamp(44px, 14vh, 62px); line-height: 0.95; font-weight: 720; font-stretch: 86%; letter-spacing: -0.035em; }
.ds__num i { font-style: normal; font-size: 17px; font-weight: 640; color: var(--accent); }
.ds__mg { padding-bottom: 5px; font-size: 12px; line-height: 1.35; color: var(--soft); text-align: right; }
.ds__mg b { font-weight: 680; color: var(--ink); font-variant-numeric: tabular-nums; }

/* the syringe: the script moves the plunger, widens the liquid and writes the scale */
.ds__syringe { display: block; width: 100%; height: auto; margin-top: clamp(6px, 2.4vh, 14px); overflow: visible; }
.ds__barrel { fill: none; stroke: var(--ink); stroke-width: 1.600; stroke-linecap: round; stroke-linejoin: round; }
.ds__liquid { fill: var(--accent); opacity: 0.9; }
.ds__gloss { fill: #ffffff; opacity: 0.4; }
.ds__rod { fill: rgba(29, 27, 24, 0.16); }
.ds__handle { fill: var(--ink); }
.ds__stopper { fill: var(--ink); }
.ds__ribs { fill: none; stroke: rgba(255, 255, 255, 0.3); stroke-width: 0.800; }
.ds__ticks path { fill: none; stroke: var(--soft); stroke-width: 1; stroke-linecap: round; }
.ds__ticks text { fill: var(--soft); font-size: 10.500px; font-weight: 600; text-anchor: middle; font-variant-numeric: tabular-nums; }
.ds__mark { fill: var(--accent); }

.ds__weight { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; row-gap: 8px; margin-top: clamp(8px, 2.6vh, 16px); padding-top: clamp(10px, 2.6vh, 14px); border-top: 1px solid var(--line); }
.ds__label { font-size: 12.5px; font-weight: 600; color: var(--soft); }
.ds__value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--soft); }
.ds__value b { font-weight: 720; color: var(--ink); }
.ds__range { grid-column: 1 / -1; width: 100%; height: 28px; margin: 0; -webkit-appearance: none; appearance: none; background: none; cursor: pointer; outline: none; touch-action: pan-y; }
.ds__range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--ink) var(--fill), rgba(29, 27, 24, 0.12) var(--fill)); }
.ds__range::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--ink) var(--fill), rgba(29, 27, 24, 0.12) var(--fill)); }
.ds__range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 1.500px var(--ink), 0 5px 10px -4px rgba(29, 27, 24, 0.5); }
.ds__range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 1.500px var(--ink), 0 5px 10px -4px rgba(29, 27, 24, 0.5); }
.ds__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1.500px var(--ink), 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent); }
.ds__range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1.500px var(--ink), 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent); }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }

@media (prefers-reduced-motion: reduce) { .ds__units button { transition: none; } }
