:root{
  --bg:#f4f7f8;--card:#fff;--ink:#14232b;--muted:#5a6b73;--line:#d6e0e4;
  --brand:#0f5c6e;--brand-2:#1489a3;--brand-soft:#e3f2f6;
  --fill:#4fb3c9;--warn:#8a5a00;--warn-bg:#fff4d6;--danger:#9b1c1c;--danger-bg:#fde8e8;
  --radius:14px;--focus:0 0 0 3px #ffbf47;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font:17px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--ink)}
.wrap{max-width:760px;margin:0 auto;padding:0 16px}
.skip{position:absolute;left:-999px;top:0;background:#000;color:#fff;padding:8px 12px;z-index:9}
.skip:focus{left:8px}
h2{font-size:1.2rem;margin:0 0 .4rem}
h3{font-size:1.02rem;margin:0 0 .2rem}
p{margin:.3rem 0}
.muted{color:var(--muted)}
.hint{color:var(--muted);font-size:.92rem;margin:0 0 .5rem}
.opt{font-weight:400;color:var(--muted);font-size:.9rem}

.site-header{background:var(--brand);color:#fff;padding:14px 0}
.header-inner{display:flex;align-items:center;gap:12px}
.logo{width:40px;height:40px;color:#fff;flex:none}
.brand{font-size:1.45rem;font-weight:800;letter-spacing:-.01em;margin:0;line-height:1.1}
.tagline{margin:0;opacity:.85;font-size:.92rem}

.disclaimer{margin:14px 0 4px;background:var(--warn-bg);border:1px solid #f0d58a;border-radius:var(--radius);padding:12px 14px;font-size:.93rem}

.tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;background:#dde7ea;border-radius:var(--radius);padding:5px;margin:14px 0}
.tabs button{font:inherit;font-weight:700;border:0;background:transparent;color:var(--ink);padding:12px 8px;border-radius:10px;cursor:pointer;min-height:48px}
.tabs button[aria-selected="true"]{background:#fff;color:var(--brand);box-shadow:0 1px 3px rgba(0,0,0,.12)}

.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px 16px;margin:0 0 14px}
.lead{margin:0 0 12px}
.field{margin:0 0 18px;border:0;padding:0}
.field:last-child{margin-bottom:0}
.field > label,.field legend{display:block;font-weight:700;font-size:1.05rem;margin-bottom:2px;padding:0}
.field legend{margin-bottom:8px}
.input-row{display:flex;gap:8px;align-items:stretch}
input[type=number]{flex:1;min-width:0;font:inherit;font-size:1.35rem;font-weight:600;padding:10px 14px;min-height:56px;border:2px solid var(--line);border-radius:12px;background:#fff;color:var(--ink)}
input[type=number]:focus{outline:none;border-color:var(--brand-2);box-shadow:var(--focus)}
input[aria-invalid="true"]{border-color:var(--danger)}
.suffix{display:flex;align-items:center;padding:0 14px;font-weight:700;color:var(--muted);background:#eef3f5;border-radius:12px;min-width:76px;justify-content:center}

.seg{display:flex;background:#eef3f5;border-radius:12px;padding:4px;gap:4px}
.seg label{position:relative;display:flex}
.seg input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.seg span{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:58px;min-height:48px;padding:4px 12px;border-radius:9px;font-weight:700;color:var(--muted);line-height:1.15}
.seg small{font-weight:500;font-size:.78rem}
.seg input:checked + span{background:var(--brand);color:#fff}
.seg input:focus-visible + span{box-shadow:var(--focus)}
.seg-wide label{flex:1}.seg-wide span{width:100%}

.presets{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 8px}
.chip{font:inherit;font-weight:700;border:2px solid var(--line);background:#fff;color:var(--ink);border-radius:999px;padding:8px 16px;min-height:44px;cursor:pointer}
.chip[aria-pressed="true"]{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}
.chip:focus-visible,.tabs button:focus-visible{outline:none;box-shadow:var(--focus)}

.results{border-color:#9fd0dc;background:linear-gradient(#fff,#f7fcfd)}
.stats{display:grid;grid-template-columns:1fr;gap:10px;margin:8px 0 0}
.stats > div{background:var(--brand-soft);border-radius:12px;padding:10px 14px}
.stats dt{font-size:.85rem;color:var(--muted);font-weight:600}
.stats dd{margin:0;font-size:1.35rem;font-weight:800;color:var(--brand)}
.stats dd.sub{font-size:.9rem;font-weight:600;color:var(--muted)}

.draw-answer{text-align:center;margin:16px 0 6px}
.draw-lead{margin:0;color:var(--muted)}
.draw-big{font-size:3rem;font-weight:900;color:var(--brand);margin:0;line-height:1.05;text-align:center}
.draw-big .u{font-size:1.3rem;font-weight:700}
.draw-ml{font-size:1.2rem;font-weight:700;margin:2px 0 6px}
.draw-doses{font-size:.95rem;margin:0}
.syringe-wrap{margin:8px -4px 6px;overflow:hidden}
.syringe{width:100%;height:auto;display:block}
.syringe text{font:700 18px system-ui,sans-serif;fill:var(--muted)}
.syringe .major{font-size:19px;fill:var(--ink)}

.alert{border-radius:12px;padding:10px 14px;margin:10px 0 0;font-size:.95rem;border:1px solid}
.alert strong{display:block}
.alert.warn{background:var(--warn-bg);border-color:#f0d58a;color:#4d3500}
.alert.danger{background:var(--danger-bg);border-color:#f3b4b4;color:#5f1010}

.table-scroll{overflow-x:auto}
table.ref{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
.ref th,.ref td{padding:9px 10px;text-align:right;border-bottom:1px solid var(--line);white-space:nowrap}
.ref th:first-child,.ref td:first-child{text-align:left}
.ref thead th{font-size:.85rem;color:var(--muted);font-weight:700}
.ref tbody th{font-weight:700}
.ref tr.over td{color:#b0bcc1}
.ref tr.over td:last-child::after{content:" ⓘ";}
.ref tr.hl{background:var(--brand-soft)}
.grid td b{color:var(--brand)}

.steps{list-style:none;margin:10px 0 0;padding:0;counter-reset:s}
.steps > li{flex-wrap:wrap;display:flex;gap:14px;align-items:flex-start;padding:12px 0;border-top:1px solid var(--line);counter-increment:s}
.steps > li:first-child{border-top:0}
.steps > li > svg{width:64px;height:64px;flex:none;background:var(--brand-soft);border-radius:14px;padding:6px}
.steps h3::before{content:counter(s) ". ";color:var(--brand)}
.steps p{margin:0;font-size:.97rem}
.s-glass{fill:#fff;stroke:var(--brand);stroke-width:2.5}
.s-cap{fill:var(--brand)}
.s-swab{fill:#fff;stroke:var(--brand-2);stroke-width:2;stroke-dasharray:3 2}
.s-line,.s-arrow{stroke:var(--brand);stroke-width:2.5;fill:none;stroke-linecap:round;stroke-linejoin:round}
.s-needle{stroke:var(--muted);stroke-width:2}
.s-barrel{fill:#fff;stroke:var(--brand);stroke-width:2}
.s-drip{stroke:var(--fill);stroke-width:3;fill:none;stroke-linecap:round}
.s-fridge{fill:#fff;stroke:var(--brand);stroke-width:2.5}
.s-label{fill:var(--warn-bg);stroke:#c79a2b;stroke-width:1.5}
.s-dot{fill:#a3773a}
.s-x{stroke:var(--danger);stroke-width:3.5;stroke-linecap:round}

.how ul{padding-left:1.1rem;margin:.4rem 0}
.how li{margin:.2rem 0}

.site-footer{padding:10px 0 40px;font-size:.88rem;color:var(--muted)}

@media (min-width:700px){
  body{font-size:17.5px}
  .wrap{padding:0 24px}
  .card{padding:22px 24px}
  .stats{grid-template-columns:repeat(3,1fr)}
  #panel-rev .stats{grid-template-columns:repeat(2,1fr)}
  .draw-big{font-size:3.6rem}
}
@media (min-width:1100px){
  .wrap{max-width:1040px}
  #panel-fwd{display:grid;grid-template-columns:1fr 1fr;gap:0 16px;align-items:start}
  #panel-fwd[hidden]{display:none}
  #panel-fwd > .card:last-child{grid-column:1 / -1}
  #panel-fwd .stats{grid-template-columns:1fr}
  #panel-rev:not([hidden]){display:grid;grid-template-columns:1fr 1fr;gap:0 16px;align-items:start}
  #panel-rev .stats{grid-template-columns:1fr}
}
@media (prefers-reduced-motion:no-preference){.syringe .fill{transition:width .25s ease}}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.presets{display:grid;grid-template-columns:repeat(4,1fr)}
.presets .chip{padding:8px 4px}
#panel-rev .presets{grid-template-columns:repeat(5,1fr)}
.tip{display:flex;gap:10px;align-items:flex-start;margin:0 0 2px;background:var(--warn-bg);border:1px solid #f0d58a;border-left:5px solid #c79a2b;border-radius:12px;padding:10px 12px;font-size:.93rem}
.tip svg{width:32px;height:32px;flex:none;margin-top:2px}
.steps > li > div{flex:1;min-width:0}
.steps > li > .tip{flex-basis:100%}
.tip .tip-title{font-weight:800;margin:0 0 2px;color:#4d3500}
.tip p{font-size:.93rem}
.tip ul{margin:6px 0 0;padding-left:1.05rem;list-style:disc}
.tip li{margin:3px 0;display:list-item;padding:0;border:0}
.t-ring{fill:#fff;stroke:#c79a2b;stroke-width:2.5}
.t-arc{fill:none;stroke:#c79a2b;stroke-width:2;stroke-linecap:round;stroke-dasharray:2 2.5}
.t-needle{stroke:#9b1c1c;stroke-width:2.5;stroke-linecap:round}
.t-hub{fill:#4d3500}
.video .video-frame{display:flex;justify-content:center;margin-top:8px}
.video video{display:block;width:100%;background:#0b1e24;border-radius:12px;aspect-ratio:9/16;max-width:min(100%,calc(62vh * 9 / 16));height:auto}
.video video.is-wide{aspect-ratio:16/9;max-width:720px}
.video-fallback{margin-top:8px;text-align:center}

/* ===== compound picker ===== */
.picker{padding-bottom:16px;border-bottom:1px dashed var(--line)}
.combo{position:relative}
.combo-input,.other-input{width:100%;font:inherit;font-size:1.15rem;font-weight:600;padding:10px 88px 10px 14px;min-height:56px;border:2px solid var(--line);border-radius:12px;background:#fff;color:var(--ink)}
.other-input{padding-right:14px;margin-top:8px;font-weight:500}
.combo-input:focus,.other-input:focus{outline:none;border-color:var(--brand-2);box-shadow:var(--focus)}
.combo-input::placeholder,.other-input::placeholder{color:#8a9aa1;font-weight:500}
.combo-clear,.combo-toggle{position:absolute;top:6px;height:44px;width:40px;border:0;background:transparent;color:var(--muted);font:inherit;font-size:1.5rem;line-height:1;cursor:pointer;border-radius:10px}
.combo-toggle{right:6px}.combo-clear{right:46px}
.combo-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.combo-clear:focus-visible,.combo-toggle:focus-visible{outline:none;box-shadow:var(--focus)}
.combo-list{position:absolute;z-index:20;left:0;right:0;top:calc(100% + 4px);margin:0;padding:4px;list-style:none;background:#fff;border:2px solid var(--brand-2);border-radius:12px;max-height:min(340px,55vh);overflow-y:auto;box-shadow:0 8px 24px rgba(15,92,110,.18)}
.combo-opt{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 12px;min-height:44px;border-radius:8px;cursor:pointer;font-weight:600}
.combo-opt small{color:var(--muted);font-weight:500;font-size:.85rem;white-space:nowrap}
.combo-opt.is-active,.combo-opt:hover{background:var(--brand-soft)}
.combo-opt[aria-selected="true"]{color:var(--brand)}
.combo-opt span{flex:1}
.combo-opt[aria-selected="true"]::after{content:"✓";font-weight:800}
.combo-opt.is-other,.combo-opt.is-none{color:var(--muted);font-weight:500;font-style:italic}
.combo-opt.is-other{border-top:1px solid var(--line);margin-top:4px}
.combo-empty{padding:10px 12px;color:var(--muted)}
.vial-chips{margin-top:10px}
.vial-chips .hint{margin-bottom:6px}
.presets.vial-presets,#panel-rev .presets.vial-presets{grid-template-columns:repeat(auto-fill,minmax(84px,1fr))}
.picker-note{margin:10px 0 0;font-size:.82rem;color:var(--muted);line-height:1.35}

.result-head{margin:0 0 6px;font-weight:800;font-size:1.05rem;color:var(--ink);overflow-wrap:anywhere}
.result-head:empty{display:none}
.cheat-for{color:var(--brand)}

.btn-label,.btn-primary,.btn-secondary{display:inline-flex;align-items:center;justify-content:center;gap:8px;font:inherit;font-weight:700;min-height:48px;padding:10px 18px;border-radius:12px;cursor:pointer}
.btn-label{-webkit-tap-highlight-color:transparent;width:100%;margin-top:14px;border:2px solid var(--brand);background:#fff;color:var(--brand)}
.btn-label svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}
.btn-label:disabled{opacity:.45;cursor:not-allowed}
.btn-primary{border:0;background:var(--brand);color:#fff;flex:1}
.btn-secondary{border:2px solid var(--line);background:#fff;color:var(--ink);flex:1}
.btn-label:focus-visible,.btn-primary:focus-visible,.btn-secondary:focus-visible{outline:none;box-shadow:var(--focus)}

/* ===== vial label ===== */
.label-overlay{position:fixed;inset:0;z-index:50;background:rgba(10,30,36,.55);display:flex;align-items:flex-end;justify-content:center;padding:12px}
.label-overlay[hidden]{display:none}
.label-dialog{background:#fff;border-radius:16px;padding:18px 16px;width:100%;max-width:440px;max-height:calc(100vh - 24px);overflow:auto}
body.label-open{overflow:hidden}
.vial-label{border:2px dashed #14232b;border-radius:10px;padding:10px 12px;margin:10px 0 14px;background:#fff;color:#000;font-variant-numeric:tabular-nums}
.vl-name{margin:0 0 6px;font-size:1.3rem;font-weight:900;line-height:1.15;border-bottom:2px solid #000;padding-bottom:4px;overflow-wrap:anywhere}
.vl-name.is-blank{color:#999;font-weight:400}
.vl-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px 12px;margin:0}
.vl-grid dt{font-size:.72rem;text-transform:uppercase;letter-spacing:.03em;color:#444;font-weight:700}
.vl-grid dd{margin:0;font-weight:800;font-size:1rem}
.vl-date{grid-column:1 / -1}
.vl-date input{font:inherit;font-weight:700;padding:6px 8px;border:2px solid var(--line);border-radius:8px;min-height:40px}
.vl-foot{margin:8px 0 0;font-size:.72rem;font-weight:700;text-align:center;border-top:1px solid #000;padding-top:4px}
.print-only{display:none}
.label-actions{display:flex;gap:10px}
@media (min-width:700px){.label-overlay{align-items:center}}

@media print{
  body.label-open > *:not(#label-overlay){display:none !important}
  body.label-open{background:#fff}
  body.label-open .label-overlay{position:static;background:none;padding:0;display:block}
  body.label-open .label-dialog{padding:0;max-width:none;border-radius:0}
  .no-print{display:none !important}
  .print-only{display:inline !important}
  .vial-label{width:3.5in;margin:0;border-style:solid;break-inside:avoid}
}

/* ---------- dosing card ---------- */
.dosing{border-color:#c9b6e4;background:linear-gradient(#fff,#fbf8ff)}
.dz-for{font-weight:800;font-size:1.1rem;color:var(--brand);margin:0 0 6px}
.dz-switch{margin:4px 0 10px}
.dz-badge{display:inline-block;font-size:.8rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:3px 10px;margin:2px 0 4px}
.dz-badge.is-label{background:#e3f4e8;color:#1d6b35;border:1px solid #a9dbb8}
.dz-badge.is-trial{background:#fde8e8;color:#8a1c1c;border:1px solid #f3b4b4}
.dz-approval{font-weight:600;margin:0 0 10px}
.dz-facts{display:grid;grid-template-columns:1fr;gap:8px;margin:0 0 14px}
.dz-facts > div{background:#f3effa;border-radius:12px;padding:8px 12px}
.dz-facts dt{font-size:.82rem;color:var(--muted);font-weight:700}
.dz-facts dd{margin:0;font-weight:700}
.dz-steps{list-style:none;margin:8px 0 12px;padding:0}
.dz-steps > li{display:flex;gap:12px;position:relative;padding:0 0 14px}
.dz-steps > li:not(:last-child)::before{content:"";position:absolute;left:15px;top:32px;bottom:0;width:3px;background:#c9b6e4;border-radius:2px}
.dz-dot{flex:none;width:33px;height:33px;border-radius:50%;background:#6b4fa0;color:#fff;font-weight:800;display:flex;align-items:center;justify-content:center;font-size:.95rem}
.dz-steps.is-fixed .dz-dot{width:16px;height:16px;margin:8px 8px 0}
.dz-steps > li.is-max .dz-dot{background:var(--danger)}
.dz-body{flex:1;min-width:0}
.dz-dose{font-size:1.25rem;font-weight:900;margin:2px 0 0;line-height:1.2}
.dz-when{font-size:.9rem;font-weight:700;color:var(--muted);margin-left:4px}
.dz-hold{margin:2px 0 6px;font-size:.95rem}
.dz-act{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.dz-use{padding:6px 14px;min-height:40px;font-size:.92rem}
.dz-units{font-size:.9rem;font-weight:700;color:var(--brand)}
.dz-units.is-bad{color:var(--danger)}
.dz-units.is-warn{color:var(--warn)}
.dz-tip{background:var(--warn-bg);border:1px solid #f0d58a;border-radius:12px;padding:10px 14px;margin:4px 0 12px;color:#4d3500;font-size:.95rem}
.dz-tip ul,.dz-notes{margin:.3rem 0;padding-left:1.1rem}
.dz-tip li,.dz-notes li{margin:.2rem 0}
.dz-notes{font-size:.93rem}
.dz-source{font-size:.88rem;color:var(--muted);margin:8px 0 4px}
.dz-foot{font-size:.85rem;color:var(--muted);margin:0}
.dz-slow{margin:14px 0 10px;padding:12px 14px;border:2px dashed #8fb7d9;border-radius:14px;background:#f1f7fc}
.dz-slow h3{margin:0 0 4px}
.dz-badge.is-owner{background:#e4eef8;color:#1f4f7a;border:1px solid #a9c8e6}
.dz-slow-label{font-weight:700;margin:2px 0 6px}
.dz-steps-slow .dz-dot{width:16px;height:16px;margin:8px 8px 0;background:#3d7ab3}
.dz-steps-slow > li:not(:last-child)::before{left:15px;top:26px;background:#b6d0e8}
.dz-more{font-weight:700;color:var(--muted);margin:-6px 0 8px 36px}
.dz-slow-note{font-size:.95rem;margin:6px 0}
.dz-cite{color:var(--muted);font-size:.85rem}
.dz-slow-guide{background:#fff;border-radius:10px;padding:8px 12px;margin:8px 0}
.dz-empty{background:#f3effa;border-radius:12px;padding:10px 14px}
@media (min-width:700px){.dz-facts{grid-template-columns:repeat(3,1fr)}}
@media print{.dosing{display:none}}
@media (min-width:700px){
  #panel-fwd > #fwd-form{order:1}
  #panel-fwd > .results{order:2}
  #panel-fwd > #dosing-card{order:3;grid-column:1 / -1}
  #panel-fwd > .card:last-child{order:4}
  .dz-cols{display:grid;grid-template-columns:1fr 1fr;gap:0 20px;align-items:start}
  .dz-side{padding-top:28px}
}
/* "What it's been studied for" line + evidence pill */
.studied{margin:12px 0 4px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#f8fbfc}
.studied[hidden]{display:none}
.studied-h{margin:0;font-size:.8rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:var(--muted)}
.studied-line{margin:2px 0 8px;font-weight:600;line-height:1.35}
.ev-pill{display:inline-block;font-size:.82rem;font-weight:700;line-height:1.3;padding:4px 10px;border-radius:10px;border:1px solid}
.ev-approved{background:#e3f6e8;border-color:#9fd6ad;color:#14532d}
.ev-human{background:#e4effc;border-color:#a9c8ef;color:#1e3a8a}
.ev-small{background:#fff4d6;border-color:#f0d58a;color:#6b4300}
.ev-animal{background:#eceff1;border-color:#c5ced3;color:#37474f}
