# Dose input with graduated syringe

> Enter the weight and the dose per kilo and a graduated syringe fills with the resulting millilitres, with a warning if they don't fit.

- Category: [Inputs](https://library.aimran.es/components/inputs)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-in-syringe-dose
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Two number inputs, body weight and dose in milligrams per kilo, feed a small calculation shown on a graduated 10 mL syringe drawn in CSS. The plunger pulls back and the liquid grows to the result through a registered custom property, so the movement is smooth, and the total in milligrams and millilitres updates live. Over the barrel's capacity it turns red.

Change the concentration and capacity constants in the script for your own case, and keep the note that it is only an example. It fits veterinary and clinical training tools, pharmacy demos and science classes, with the main color for the result and the second for the liquid.

## Code

### HTML

```html
<div class="uvq06-sy"><div class="rw"><label class="fd"><span>Weight</span><span class="ip"><input type="number" inputmode="decimal" min="1" max="150" step="0.5" data-k="w"><em>kg</em></span></label><label class="fd"><span>Dose</span><span class="ip"><input type="number" inputmode="decimal" min="0.5" max="50" step="0.5" data-k="d"><em>mg/kg</em></span></label></div><div class="sx" aria-hidden="true"><span class="nd"></span><span class="hb"></span><span class="br"><i class="lq"></i><i class="tk m" style="--k:0"><b>0</b></i><i class="tk" style="--k:1"></i><i class="tk m" style="--k:2"></i><i class="tk" style="--k:3"></i><i class="tk m" style="--k:4"><b>2</b></i><i class="tk" style="--k:5"></i><i class="tk m" style="--k:6"></i><i class="tk" style="--k:7"></i><i class="tk m" style="--k:8"><b>4</b></i><i class="tk" style="--k:9"></i><i class="tk m" style="--k:10"></i><i class="tk" style="--k:11"></i><i class="tk m" style="--k:12"><b>6</b></i><i class="tk" style="--k:13"></i><i class="tk m" style="--k:14"></i><i class="tk" style="--k:15"></i><i class="tk m" style="--k:16"><b>8</b></i><i class="tk" style="--k:17"></i><i class="tk m" style="--k:18"></i><i class="tk" style="--k:19"></i><i class="tk m" style="--k:20"><b>10</b></i><span class="rd"><i></i></span></span></div><p class="out" aria-live="polite"><b>0,0 mL</b><span class="mg">0 mg</span><span class="cn">at 20 mg/mL</span></p><p class="nt">Example calculation, not a substitute for medical advice</p></div>
```

### CSS

```css
.uvq06-sy {
  --c1: #0f766e;
  --c2: #f43f5e;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

@property --uvq06-sy {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.uvq06-sy {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 20em;
  --uvq06-sy: 0;
  transition: --uvq06-sy calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq06-sy .rw {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6em;
}

.uvq06-sy .fd {
  display: block;
}

.uvq06-sy .fd>span:first-child {
  display: block;
  margin: 0 0 .45em;
  font-size: .82em;
  font-weight: 650;
}

.uvq06-sy .ip {
  display: flex;
  align-items: baseline;
  gap: .3em;
  padding: 0 .8em;
  border-radius: .9em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 12%,transparent),0 14px 34px -24px rgba(0,0,0,.45);
  transition: box-shadow calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-sy .ip:focus-within {
  box-shadow: 0 0 0 2px var(--c1),0 0 0 6px color-mix(in srgb,var(--c1) 18%,transparent),0 14px 34px -24px rgba(0,0,0,.45);
}

.uvq06-sy input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  color: var(--fg);
  width: 0;
  height: 2.1em;
  font-size: 1.2em;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.uvq06-sy input::-webkit-inner-spin-button,.uvq06-sy input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.uvq06-sy em {
  font-size: .78em;
  font-style: normal;
  font-weight: 650;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq06-sy .sx {
  position: relative;
  display: flex;
  align-items: center;
  height: 3.6em;
  margin: 1.3em 0 .2em;
}

.uvq06-sy .nd {
  width: 2.2em;
  height: 2px;
  background: linear-gradient(90deg,#9ca3af,#e5e7eb);
}

.uvq06-sy .hb {
  width: .7em;
  height: .9em;
  border-radius: .15em 0 0 .15em;
  background: color-mix(in srgb,var(--c1) 55%,#fff);
}

.uvq06-sy .br {
  position: relative;
  width: 9.5em;
  height: 2.1em;
  border-radius: .25em;
  background: color-mix(in srgb,var(--fg) 4%,transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 30%,transparent),inset 0 .5em .4em -.3em rgba(255,255,255,.35);
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-sy .br::after {
  content: "";
  position: absolute;
  right: -.45em;
  top: -.45em;
  bottom: -.45em;
  width: .45em;
  border-radius: 0 .2em .2em 0;
  background: color-mix(in srgb,var(--fg) 35%,var(--bg));
}

.uvq06-sy .lq {
  position: absolute;
  left: 1.5px;
  top: 1.5px;
  bottom: 1.5px;
  width: calc(var(--uvq06-sy) * (100% - 3px));
  background: linear-gradient(color-mix(in srgb,var(--c2) 65%,#fff),var(--c2));
  opacity: .85;
}

.uvq06-sy .tk {
  position: absolute;
  left: calc(var(--k) * 5%);
  top: 0;
  width: 1px;
  height: .4em;
  background: color-mix(in srgb,var(--fg) 45%,transparent);
}

.uvq06-sy .tk.m {
  height: .75em;
}

.uvq06-sy .tk b {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .1em);
  font-size: .55em;
  font-weight: 700;
  font-style: normal;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  translate: -50% 0;
}

.uvq06-sy .rd {
  position: absolute;
  left: calc(var(--uvq06-sy) * 100%);
  top: 50%;
  display: flex;
  align-items: center;
  width: 5.6em;
  height: .45em;
  translate: 0 -50%;
  background: color-mix(in srgb,var(--fg) 28%,var(--bg));
}

.uvq06-sy .rd::before {
  content: "";
  width: .55em;
  height: 2.4em;
  flex: none;
  margin-left: -.1em;
  border-radius: .15em;
  background: #2b2f36;
}

.uvq06-sy .rd i {
  position: absolute;
  right: -.3em;
  width: .4em;
  height: 2.6em;
  border-radius: .2em;
  background: color-mix(in srgb,var(--fg) 40%,var(--bg));
}

.uvq06-sy .out {
  display: flex;
  align-items: baseline;
  gap: .6em;
  margin: .8em 0 0;
}

.uvq06-sy .out b {
  font-size: 1.6em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: color-mix(in srgb,var(--c1) 70%,var(--fg));
}

.uvq06-sy .mg {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.uvq06-sy .cn {
  margin-left: auto;
  font-size: .78em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq06-sy.over .br {
  box-shadow: inset 0 0 0 2px #e5484d;
}

.uvq06-sy.over .out b,.uvq06-sy.over .cn {
  color: #e5484d;
  font-weight: 700;
}

.uvq06-sy .nt {
  margin: .5em 0 0;
  font-size: .7em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}
```

### JavaScript

```js
document.querySelectorAll(".uvq06-sy").forEach(el => {
  const w=el.querySelector('[data-k="w"]'),d=el.querySelector('[data-k="d"]'),ob=el.querySelector(".out b"),mg=el.querySelector(".mg"),cn=el.querySelector(".cn"),base=cn.textContent;const C=20,MAX=10;
const fmt=n=>(Math.round(n*10)/10).toFixed(1).replace(".",",");
const u=()=>{const W=parseFloat(w.value)||0,D=parseFloat(d.value)||0,m=W*D,v=m/C,o=v>MAX;el.style.setProperty("--uvq06-sy",String(Math.min(1,v/MAX)));ob.textContent=fmt(v)+" mL";mg.textContent=Math.round(m)+" mg";el.classList.toggle("over",o);cn.textContent=o?"Doesn't fit in the 10 mL syringe":base};
[w,d].forEach(x=>x.addEventListener("input",u));w.value="24";d.value="7.5";u()
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
@property --uvq06-sy {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.uvq06-sy {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 20em;
  --uvq06-sy: 0;
  transition: --uvq06-sy calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq06-sy .rw {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6em;
}

.uvq06-sy .fd {
  display: block;
}

.uvq06-sy .fd>span:first-child {
  display: block;
  margin: 0 0 .45em;
  font-size: .82em;
  font-weight: 650;
}

.uvq06-sy .ip {
  display: flex;
  align-items: baseline;
  gap: .3em;
  padding: 0 .8em;
  border-radius: .9em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 12%,transparent),0 14px 34px -24px rgba(0,0,0,.45);
  transition: box-shadow calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-sy .ip:focus-within {
  box-shadow: 0 0 0 2px var(--c1),0 0 0 6px color-mix(in srgb,var(--c1) 18%,transparent),0 14px 34px -24px rgba(0,0,0,.45);
}

.uvq06-sy input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  color: var(--fg);
  width: 0;
  height: 2.1em;
  font-size: 1.2em;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.uvq06-sy input::-webkit-inner-spin-button,.uvq06-sy input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.uvq06-sy em {
  font-size: .78em;
  font-style: normal;
  font-weight: 650;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq06-sy .sx {
  position: relative;
  display: flex;
  align-items: center;
  height: 3.6em;
  margin: 1.3em 0 .2em;
}

.uvq06-sy .nd {
  width: 2.2em;
  height: 2px;
  background: linear-gradient(90deg,#9ca3af,#e5e7eb);
}

.uvq06-sy .hb {
  width: .7em;
  height: .9em;
  border-radius: .15em 0 0 .15em;
  background: color-mix(in srgb,var(--c1) 55%,#fff);
}

.uvq06-sy .br {
  position: relative;
  width: 9.5em;
  height: 2.1em;
  border-radius: .25em;
  background: color-mix(in srgb,var(--fg) 4%,transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 30%,transparent),inset 0 .5em .4em -.3em rgba(255,255,255,.35);
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-sy .br::after {
  content: "";
  position: absolute;
  right: -.45em;
  top: -.45em;
  bottom: -.45em;
  width: .45em;
  border-radius: 0 .2em .2em 0;
  background: color-mix(in srgb,var(--fg) 35%,var(--bg));
}

.uvq06-sy .lq {
  position: absolute;
  left: 1.5px;
  top: 1.5px;
  bottom: 1.5px;
  width: calc(var(--uvq06-sy) * (100% - 3px));
  background: linear-gradient(color-mix(in srgb,var(--c2) 65%,#fff),var(--c2));
  opacity: .85;
}

.uvq06-sy .tk {
  position: absolute;
  left: calc(var(--k) * 5%);
  top: 0;
  width: 1px;
  height: .4em;
  background: color-mix(in srgb,var(--fg) 45%,transparent);
}

.uvq06-sy .tk.m {
  height: .75em;
}

.uvq06-sy .tk b {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .1em);
  font-size: .55em;
  font-weight: 700;
  font-style: normal;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  translate: -50% 0;
}

.uvq06-sy .rd {
  position: absolute;
  left: calc(var(--uvq06-sy) * 100%);
  top: 50%;
  display: flex;
  align-items: center;
  width: 5.6em;
  height: .45em;
  translate: 0 -50%;
  background: color-mix(in srgb,var(--fg) 28%,var(--bg));
}

.uvq06-sy .rd::before {
  content: "";
  width: .55em;
  height: 2.4em;
  flex: none;
  margin-left: -.1em;
  border-radius: .15em;
  background: #2b2f36;
}

.uvq06-sy .rd i {
  position: absolute;
  right: -.3em;
  width: .4em;
  height: 2.6em;
  border-radius: .2em;
  background: color-mix(in srgb,var(--fg) 40%,var(--bg));
}

.uvq06-sy .out {
  display: flex;
  align-items: baseline;
  gap: .6em;
  margin: .8em 0 0;
}

.uvq06-sy .out b {
  font-size: 1.6em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: color-mix(in srgb,var(--c1) 70%,var(--fg));
}

.uvq06-sy .mg {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.uvq06-sy .cn {
  margin-left: auto;
  font-size: .78em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq06-sy.over .br {
  box-shadow: inset 0 0 0 2px #e5484d;
}

.uvq06-sy.over .out b,.uvq06-sy.over .cn {
  color: #e5484d;
  font-weight: 700;
}

.uvq06-sy .nt {
  margin: .5em 0 0;
  font-size: .7em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const w=el.querySelector('[data-k="w"]'),d=el.querySelector('[data-k="d"]'),ob=el.querySelector(".out b"),mg=el.querySelector(".mg"),cn=el.querySelector(".cn"),base=cn.textContent;const C=20,MAX=10;
const fmt=n=>(Math.round(n*10)/10).toFixed(1).replace(".",",");
const u=()=>{const W=parseFloat(w.value)||0,D=parseFloat(d.value)||0,m=W*D,v=m/C,o=v>MAX;el.style.setProperty("--uvq06-sy",String(Math.min(1,v/MAX)));ob.textContent=fmt(v)+" mL";mg.textContent=Math.round(m)+" mg";el.classList.toggle("over",o);cn.textContent=o?"Doesn't fit in the 10 mL syringe":base};
[w,d].forEach(x=>x.addEventListener("input",u));w.value="24";d.value="7.5";u()
}

export default function InSyringeDose() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#0f766e",
          "--c2": "#f43f5e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq06-sy"><div className="rw"><label className="fd"><span>Weight</span><span className="ip"><input type="number" inputMode="decimal" min="1" max="150" step="0.5" data-k="w" /><em>kg</em></span></label><label className="fd"><span>Dose</span><span className="ip"><input type="number" inputMode="decimal" min="0.5" max="50" step="0.5" data-k="d" /><em>mg/kg</em></span></label></div><div className="sx" aria-hidden="true"><span className="nd"></span><span className="hb"></span><span className="br"><i className="lq"></i><i className="tk m" style={{ "--k": "0" } as CSSProperties}><b>0</b></i><i className="tk" style={{ "--k": "1" } as CSSProperties}></i><i className="tk m" style={{ "--k": "2" } as CSSProperties}></i><i className="tk" style={{ "--k": "3" } as CSSProperties}></i><i className="tk m" style={{ "--k": "4" } as CSSProperties}><b>2</b></i><i className="tk" style={{ "--k": "5" } as CSSProperties}></i><i className="tk m" style={{ "--k": "6" } as CSSProperties}></i><i className="tk" style={{ "--k": "7" } as CSSProperties}></i><i className="tk m" style={{ "--k": "8" } as CSSProperties}><b>4</b></i><i className="tk" style={{ "--k": "9" } as CSSProperties}></i><i className="tk m" style={{ "--k": "10" } as CSSProperties}></i><i className="tk" style={{ "--k": "11" } as CSSProperties}></i><i className="tk m" style={{ "--k": "12" } as CSSProperties}><b>6</b></i><i className="tk" style={{ "--k": "13" } as CSSProperties}></i><i className="tk m" style={{ "--k": "14" } as CSSProperties}></i><i className="tk" style={{ "--k": "15" } as CSSProperties}></i><i className="tk m" style={{ "--k": "16" } as CSSProperties}><b>8</b></i><i className="tk" style={{ "--k": "17" } as CSSProperties}></i><i className="tk m" style={{ "--k": "18" } as CSSProperties}></i><i className="tk" style={{ "--k": "19" } as CSSProperties}></i><i className="tk m" style={{ "--k": "20" } as CSSProperties}><b>10</b></i><span className="rd"><i></i></span></span></div><p className="out" aria-live="polite"><b>0,0 mL</b><span className="mg">0 mg</span><span className="cn">at 20 mg/mL</span></p><p className="nt">Example calculation, not a substitute for medical advice</p></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Dose input with graduated syringe” block (Inputs) from AIMRAN Library to my project.

## What it is
Enter the weight and the dose per kilo and a graduated syringe fills with the resulting millilitres, with a warning if they don't fit.

## Chosen settings
- Main color: #0f766e
- Secondary color: #f43f5e
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Peso"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
@property --uvq06-sy {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.uvq06-sy {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 20em;
  --uvq06-sy: 0;
  transition: --uvq06-sy calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq06-sy .rw {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6em;
}

.uvq06-sy .fd {
  display: block;
}

.uvq06-sy .fd>span:first-child {
  display: block;
  margin: 0 0 .45em;
  font-size: .82em;
  font-weight: 650;
}

.uvq06-sy .ip {
  display: flex;
  align-items: baseline;
  gap: .3em;
  padding: 0 .8em;
  border-radius: .9em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 12%,transparent),0 14px 34px -24px rgba(0,0,0,.45);
  transition: box-shadow calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-sy .ip:focus-within {
  box-shadow: 0 0 0 2px var(--c1),0 0 0 6px color-mix(in srgb,var(--c1) 18%,transparent),0 14px 34px -24px rgba(0,0,0,.45);
}

.uvq06-sy input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  color: var(--fg);
  width: 0;
  height: 2.1em;
  font-size: 1.2em;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.uvq06-sy input::-webkit-inner-spin-button,.uvq06-sy input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.uvq06-sy em {
  font-size: .78em;
  font-style: normal;
  font-weight: 650;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq06-sy .sx {
  position: relative;
  display: flex;
  align-items: center;
  height: 3.6em;
  margin: 1.3em 0 .2em;
}

.uvq06-sy .nd {
  width: 2.2em;
  height: 2px;
  background: linear-gradient(90deg,#9ca3af,#e5e7eb);
}

.uvq06-sy .hb {
  width: .7em;
  height: .9em;
  border-radius: .15em 0 0 .15em;
  background: color-mix(in srgb,var(--c1) 55%,#fff);
}

.uvq06-sy .br {
  position: relative;
  width: 9.5em;
  height: 2.1em;
  border-radius: .25em;
  background: color-mix(in srgb,var(--fg) 4%,transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 30%,transparent),inset 0 .5em .4em -.3em rgba(255,255,255,.35);
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-sy .br::after {
  content: "";
  position: absolute;
  right: -.45em;
  top: -.45em;
  bottom: -.45em;
  width: .45em;
  border-radius: 0 .2em .2em 0;
  background: color-mix(in srgb,var(--fg) 35%,var(--bg));
}

.uvq06-sy .lq {
  position: absolute;
  left: 1.5px;
  top: 1.5px;
  bottom: 1.5px;
  width: calc(var(--uvq06-sy) * (100% - 3px));
  background: linear-gradient(color-mix(in srgb,var(--c2) 65%,#fff),var(--c2));
  opacity: .85;
}

.uvq06-sy .tk {
  position: absolute;
  left: calc(var(--k) * 5%);
  top: 0;
  width: 1px;
  height: .4em;
  background: color-mix(in srgb,var(--fg) 45%,transparent);
}

.uvq06-sy .tk.m {
  height: .75em;
}

.uvq06-sy .tk b {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .1em);
  font-size: .55em;
  font-weight: 700;
  font-style: normal;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  translate: -50% 0;
}

.uvq06-sy .rd {
  position: absolute;
  left: calc(var(--uvq06-sy) * 100%);
  top: 50%;
  display: flex;
  align-items: center;
  width: 5.6em;
  height: .45em;
  translate: 0 -50%;
  background: color-mix(in srgb,var(--fg) 28%,var(--bg));
}

.uvq06-sy .rd::before {
  content: "";
  width: .55em;
  height: 2.4em;
  flex: none;
  margin-left: -.1em;
  border-radius: .15em;
  background: #2b2f36;
}

.uvq06-sy .rd i {
  position: absolute;
  right: -.3em;
  width: .4em;
  height: 2.6em;
  border-radius: .2em;
  background: color-mix(in srgb,var(--fg) 40%,var(--bg));
}

.uvq06-sy .out {
  display: flex;
  align-items: baseline;
  gap: .6em;
  margin: .8em 0 0;
}

.uvq06-sy .out b {
  font-size: 1.6em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: color-mix(in srgb,var(--c1) 70%,var(--fg));
}

.uvq06-sy .mg {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.uvq06-sy .cn {
  margin-left: auto;
  font-size: .78em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq06-sy.over .br {
  box-shadow: inset 0 0 0 2px #e5484d;
}

.uvq06-sy.over .out b,.uvq06-sy.over .cn {
  color: #e5484d;
  font-weight: 700;
}

.uvq06-sy .nt {
  margin: .5em 0 0;
  font-size: .7em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const w=el.querySelector('[data-k="w"]'),d=el.querySelector('[data-k="d"]'),ob=el.querySelector(".out b"),mg=el.querySelector(".mg"),cn=el.querySelector(".cn"),base=cn.textContent;const C=20,MAX=10;
const fmt=n=>(Math.round(n*10)/10).toFixed(1).replace(".",",");
const u=()=>{const W=parseFloat(w.value)||0,D=parseFloat(d.value)||0,m=W*D,v=m/C,o=v>MAX;el.style.setProperty("--uvq06-sy",String(Math.min(1,v/MAX)));ob.textContent=fmt(v)+" mL";mg.textContent=Math.round(m)+" mg";el.classList.toggle("over",o);cn.textContent=o?"Doesn't fit in the 10 mL syringe":base};
[w,d].forEach(x=>x.addEventListener("input",u));w.value="24";d.value="7.5";u()
}

export default function InSyringeDose() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#0f766e",
          "--c2": "#f43f5e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq06-sy"><div className="rw"><label className="fd"><span>Weight</span><span className="ip"><input type="number" inputMode="decimal" min="1" max="150" step="0.5" data-k="w" /><em>kg</em></span></label><label className="fd"><span>Dose</span><span className="ip"><input type="number" inputMode="decimal" min="0.5" max="50" step="0.5" data-k="d" /><em>mg/kg</em></span></label></div><div className="sx" aria-hidden="true"><span className="nd"></span><span className="hb"></span><span className="br"><i className="lq"></i><i className="tk m" style={{ "--k": "0" } as CSSProperties}><b>0</b></i><i className="tk" style={{ "--k": "1" } as CSSProperties}></i><i className="tk m" style={{ "--k": "2" } as CSSProperties}></i><i className="tk" style={{ "--k": "3" } as CSSProperties}></i><i className="tk m" style={{ "--k": "4" } as CSSProperties}><b>2</b></i><i className="tk" style={{ "--k": "5" } as CSSProperties}></i><i className="tk m" style={{ "--k": "6" } as CSSProperties}></i><i className="tk" style={{ "--k": "7" } as CSSProperties}></i><i className="tk m" style={{ "--k": "8" } as CSSProperties}><b>4</b></i><i className="tk" style={{ "--k": "9" } as CSSProperties}></i><i className="tk m" style={{ "--k": "10" } as CSSProperties}></i><i className="tk" style={{ "--k": "11" } as CSSProperties}></i><i className="tk m" style={{ "--k": "12" } as CSSProperties}><b>6</b></i><i className="tk" style={{ "--k": "13" } as CSSProperties}></i><i className="tk m" style={{ "--k": "14" } as CSSProperties}></i><i className="tk" style={{ "--k": "15" } as CSSProperties}></i><i className="tk m" style={{ "--k": "16" } as CSSProperties}><b>8</b></i><i className="tk" style={{ "--k": "17" } as CSSProperties}></i><i className="tk m" style={{ "--k": "18" } as CSSProperties}></i><i className="tk" style={{ "--k": "19" } as CSSProperties}></i><i className="tk m" style={{ "--k": "20" } as CSSProperties}><b>10</b></i><span className="rd"><i></i></span></span></div><p className="out" aria-live="polite"><b>0,0 mL</b><span className="mg">0 mg</span><span className="cn">at 20 mg/mL</span></p><p className="nt">Example calculation, not a substitute for medical advice</p></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
