/* VOICE   everyday health tool, calm and exact, like a good pharmacy app
   IDEA    the pharmacy vial label: every peptide wears its own cap colour, numbers read like a printed label
   PICTURE today's dose ring and a live U-100 syringe in the calculator, filled to the units to draw
   COLOUR  white or night ink ground, cobalt #2141e8 leads, coral #ff5233 marks what is due, cap colours per vial
   TYPE    system UI sans (SF on iPhone) heavy for figures, regular for text, tabular numbers in columns
   LAYOUT  phone: content column + bottom tab bar; laptop: left rail + 760px column */

:root{color-scheme:light;
--bg:#ffffff;--ink:#10131a;--muted:#5d6472;--line:#e3e6ee;--panel:#f3f5fb;--panel2:#e9edf8;
--brand:#2141e8;--brand-ink:#ffffff;--brand-soft:#e6ebff;--hot:#f2401f;--hot-soft:#ffe9e4;--warn:#b87500;--warn-soft:#fff3dc;
--font:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
--tabh:64px;
--safe-b:env(safe-area-inset-bottom,0px);
--safe-t:env(safe-area-inset-top,0px)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;
--bg:#0b0d14;--ink:#eef0f6;--muted:#9aa1b2;--line:#262b3c;--panel:#131726;--panel2:#1c2133;
--brand:#7088ff;--brand-ink:#0b0d14;--brand-soft:#1b2244;--hot:#ff6a4d;--hot-soft:#3a1a14;--warn:#f0b43c;--warn-soft:#33270f}}
:root[data-theme=dark]{color-scheme:dark;
--bg:#0b0d14;--ink:#eef0f6;--muted:#9aa1b2;--line:#262b3c;--panel:#131726;--panel2:#1c2133;
--brand:#7088ff;--brand-ink:#0b0d14;--brand-soft:#1b2244;--hot:#ff6a4d;--hot-soft:#3a1a14;--warn:#f0b43c;--warn-soft:#33270f}
*{box-sizing:border-box;min-width:0}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 var(--font);overflow-x:clip;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
img{max-width:100%}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--brand)}
svg{display:block}
h1,h2,h3{margin:0;line-height:1.08;letter-spacing:-.02em;text-wrap:balance}
h1{font-size:clamp(32px,7vw,40px);font-weight:800}
h2{font-size:21px;font-weight:750}
h3{font-size:17px;font-weight:700}
p{margin:0}
.muted{color:var(--muted)}
.num{font-variant-numeric:tabular-nums}
.nw{white-space:nowrap}

/* shell */
.shell{min-height:100%}
main{max-width:760px;margin:0 auto;padding:calc(var(--safe-t) + 20px) max(18px,env(safe-area-inset-right,0px)) calc(var(--tabh) + var(--safe-b) + 28px) max(18px,env(safe-area-inset-left,0px));outline:none}
.boot{color:var(--muted);padding:40px 0}
.tabs{position:fixed;z-index:20;left:0;right:0;bottom:0;display:flex;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:saturate(1.6) blur(18px);-webkit-backdrop-filter:saturate(1.6) blur(18px);border-top:1px solid var(--line);padding:0 6px var(--safe-b)}
.tabs .brand{display:none}
.tabs a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:var(--tabh);color:var(--muted);text-decoration:none;font-size:11px;font-weight:600}
.tabs a svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tabs a.on{color:var(--brand)}
@media(min-width:900px){
.tabs{top:0;right:auto;width:220px;flex-direction:column;gap:4px;padding:28px 14px;border-top:0;border-right:1px solid var(--line)}
.tabs .brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:20px;letter-spacing:-.02em;padding:0 10px 22px}
.tabs .brand img{width:34px;height:34px;border-radius:9px}
.tabs a{flex:none;flex-direction:row;justify-content:flex-start;gap:12px;height:46px;padding:0 12px;border-radius:12px;font-size:15px}
.tabs a.on{background:var(--brand-soft)}
main{margin-left:max(220px,calc(50% - 380px + 110px));padding-bottom:48px}
}

/* page header */
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:18px;flex-wrap:wrap}
.head p{margin-top:6px}
.seg{display:flex;background:var(--panel);border-radius:12px;padding:3px;gap:2px;margin-bottom:18px;overflow-x:auto}
.seg a,.seg button{flex:1;text-align:center;padding:8px 12px;border-radius:9px;border:0;background:none;color:var(--muted);font-weight:650;font-size:14px;text-decoration:none;white-space:nowrap;cursor:pointer}
.seg .on{background:var(--bg);color:var(--ink);box-shadow:0 1px 3px rgb(0 0 0/.12)}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 18px;border-radius:12px;border:0;background:var(--brand);color:var(--brand-ink);font-weight:700;font-size:15px;cursor:pointer;text-decoration:none;transition:transform .12s,background .15s}
.btn:active{transform:scale(.96)}
.btn.ghost{background:var(--panel);color:var(--ink)}
.card .btn.ghost{background:var(--bg)}
.card .seg{background:var(--panel2)}
.btn.line{background:none;border:1.5px solid var(--line);color:var(--ink)}
.btn.danger{background:var(--hot-soft);color:var(--hot)}
.btn.sm{min-height:36px;padding:0 12px;font-size:14px;border-radius:10px}
.btn.wide{width:100%}
.btn:focus-visible,.tabs a:focus-visible,.icon-btn:focus-visible,.chip:focus-visible,.row:focus-visible{outline:3px solid color-mix(in srgb,var(--brand) 55%,transparent);outline-offset:2px}
.icon-btn{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;border:0;background:var(--panel);color:var(--ink);cursor:pointer;flex:none}
.icon-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.btns{display:flex;gap:10px;flex-wrap:wrap}
.btns>*{flex:1 1 auto}

/* cards & rows */
.card{background:var(--panel);border-radius:18px;padding:16px}
.card+.card,.stackgap>*+*{margin-top:12px}
.section{margin-top:28px}
.section>h2{margin-bottom:12px}
.sec-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.list{display:flex;flex-direction:column;gap:8px}
.row{display:flex;align-items:center;gap:12px;background:var(--panel);border-radius:16px;padding:12px 14px;min-height:64px;border:0;width:100%;text-align:left;cursor:pointer;color:inherit;text-decoration:none}
.row .main{flex:1}
.row .t{font-weight:700;line-height:1.25}
.row .s{color:var(--muted);font-size:14px;line-height:1.35;margin-top:2px}
.row .end{text-align:right;flex:none}
.cap{width:14px;height:40px;border-radius:5px 5px 4px 4px;background:var(--c,var(--brand));flex:none;position:relative}
.cap::after{content:"";position:absolute;left:2px;right:2px;bottom:3px;height:45%;border-radius:2px;background:rgb(255 255 255/.45)}
.time{font-weight:800;font-size:19px;letter-spacing:-.02em;width:58px;flex:none;font-variant-numeric:tabular-nums}
.check{width:44px;height:44px;border-radius:50%;border:2px solid var(--line);background:var(--bg);display:grid;place-items:center;flex:none;cursor:pointer;color:var(--brand-ink);transition:transform .12s}
.check:active{transform:scale(.92)}
.check svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;opacity:0}
.check.done{background:var(--brand);border-color:var(--brand)}
.check.done svg{opacity:1}
.row.done .t{text-decoration:line-through;text-decoration-thickness:1.5px;color:var(--muted)}
.tag{display:inline-block;font-size:12px;font-weight:700;padding:2px 8px;border-radius:99px;background:var(--brand-soft);color:var(--brand);white-space:nowrap}
.tag.hot{background:var(--hot-soft);color:var(--hot)}
.tag.warn{background:var(--warn-soft);color:var(--warn)}
.tag.off{background:var(--panel2);color:var(--muted)}
.empty{border:1.5px dashed var(--line);border-radius:16px;padding:22px;text-align:center;color:var(--muted)}
.empty .btn{margin-top:12px}
.note{font-size:13px;color:var(--muted);margin-top:10px}
.sample{display:flex;gap:10px;align-items:center;justify-content:space-between;background:var(--warn-soft);color:var(--ink);border-radius:12px;padding:8px 8px 8px 14px;font-size:14px;margin-bottom:16px;flex-wrap:wrap}

/* today */
.today{display:grid;grid-template-columns:minmax(0,1fr) 168px;gap:16px;align-items:center;margin-bottom:18px}
.ring{position:relative;width:168px;height:168px}
.ring svg{width:100%;height:100%}
.ring .in{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.ring b{font-size:40px;font-weight:800;letter-spacing:-.03em;line-height:1}
.ring small{color:var(--muted);font-size:13px;margin-top:4px}
.week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin-bottom:22px}
.day{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 0 10px;border-radius:14px;border:0;background:var(--panel);cursor:pointer;color:var(--ink)}
.day small{font-size:12px;color:var(--muted);font-weight:600}
.day b{font-size:18px;font-weight:750}
.day i{width:6px;height:6px;border-radius:50%;background:var(--line)}
.day i.full{background:var(--brand)}
.day i.part{background:var(--warn)}
.day i.miss{background:var(--hot)}
.day.on{background:var(--ink);color:var(--bg)}
.day.on small{color:inherit;opacity:.7}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(9.5em,1fr));gap:8px}
.stat{background:var(--panel);border-radius:16px;padding:12px 14px}
.stat b{display:block;font-size:22px;font-weight:800;letter-spacing:-.02em;font-variant-numeric:tabular-nums;line-height:1.15}
.stat span{font-size:13px;color:var(--muted)}
.meter{height:8px;background:var(--panel2);border-radius:9px;overflow:hidden;margin-top:8px}
.meter i{display:block;height:100%;background:var(--c,var(--brand));border-radius:9px}

/* calculator */
.calc{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.result{background:var(--brand);color:var(--brand-ink);border-radius:22px;padding:18px 18px 14px}
.result .big{font-size:clamp(52px,14vw,76px);font-weight:850;letter-spacing:-.04em;line-height:1;font-variant-numeric:tabular-nums}
.result .big small{font-size:22px;font-weight:700;letter-spacing:0;margin-left:6px}
.result .sub{display:flex;flex-wrap:wrap;gap:4px 18px;margin-top:8px;font-size:15px;opacity:.92}
.syringe{margin-top:14px;height:96px}
.syringe svg{width:100%;height:100%;overflow:visible}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.fields .full{grid-column:1/-1}
@media(min-width:700px){.calc{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);align-items:start}.calc .result{position:sticky;top:20px}}

/* forms */
label.f{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:650;color:var(--muted)}
.f input,.f select,.f textarea{width:100%;min-height:48px;padding:10px 14px;border-radius:12px;border:1.5px solid var(--line);background:var(--bg);font-size:16px;color:var(--ink);font-weight:500}
.f textarea{min-height:80px;resize:vertical}
.f input:focus,.f select:focus,.f textarea:focus{outline:none;border-color:var(--brand)}
.unit{position:relative}
.unit input{padding-right:56px}
.unit em{position:absolute;right:14px;top:50%;transform:translateY(-50%);font-style:normal;color:var(--muted);font-weight:600;pointer-events:none}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{min-height:38px;padding:0 14px;border-radius:99px;border:1.5px solid var(--line);background:var(--bg);cursor:pointer;font-weight:600;font-size:14px;color:var(--ink)}
.chip.on{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.form{display:flex;flex-direction:column;gap:14px}
.stepper{display:flex;align-items:center;gap:8px}
.stepper input{text-align:center}
.scale{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.scale .chip{padding:0}
.colors{display:flex;gap:10px;flex-wrap:wrap}
.colors button{width:36px;height:36px;border-radius:50%;border:3px solid var(--bg);background:var(--c);box-shadow:0 0 0 1.5px var(--line);cursor:pointer}
.colors button.on{box-shadow:0 0 0 2.5px var(--ink)}
fieldset{border:0;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
legend{font-size:14px;font-weight:650;color:var(--muted);margin-bottom:6px;padding:0}

/* sheet */
.sheet-wrap{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-end;justify-content:center}
.sheet-wrap[hidden]{display:none}
.scrim{position:absolute;inset:0;background:rgb(5 8 20/.45);animation:fade .2s}
.sheet{position:relative;width:100%;max-width:560px;max-height:92svh;overflow-y:auto;background:var(--bg);border-radius:22px 22px 0 0;padding:8px 18px calc(22px + var(--safe-b));animation:up .26s cubic-bezier(.2,.8,.2,1);overscroll-behavior:contain}
.grip{width:40px;height:5px;border-radius:9px;background:var(--line);margin:4px auto 14px}
.sheet h2{margin-bottom:14px}
.sheet .bar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}
.sheet .bar h2{margin:0}
@media(min-width:700px){.sheet-wrap{align-items:center}.sheet{border-radius:22px;padding-bottom:22px}}
@keyframes up{from{transform:translateY(40px);opacity:0}}
@keyframes fade{from{opacity:0}}
@media(prefers-reduced-motion:reduce){.sheet,.scrim{animation:none}.ring circle{transition:none!important}}

.toast{position:fixed;z-index:60;left:16px;right:16px;margin:0 auto;width:fit-content;bottom:calc(var(--tabh) + var(--safe-b) + 14px);background:var(--ink);color:var(--bg);padding:10px 10px 10px 16px;border-radius:14px;display:flex;align-items:center;gap:12px;font-weight:600;font-size:15px;box-shadow:0 8px 30px rgb(0 0 0/.25)}
.toast[hidden]{display:none}
.toast button{background:none;border:0;color:inherit;font-weight:800;text-decoration:underline;cursor:pointer;min-height:36px;padding:0 6px;white-space:nowrap;flex:none}
@media(min-width:900px){.toast{bottom:24px}}
.update{position:fixed;z-index:70;top:calc(var(--safe-t) + 10px);left:16px;right:16px;margin:0 auto;width:fit-content;max-width:520px;display:flex;align-items:center;gap:14px;background:var(--ink);color:var(--bg);padding:12px 12px 12px 16px;border-radius:16px;font-size:15px;line-height:1.35;box-shadow:0 10px 34px rgb(0 0 0/.28);animation:drop .3s cubic-bezier(.2,.8,.2,1)}
.update[hidden]{display:none}
.update .btn{flex:none;background:var(--brand);color:var(--brand-ink)}
.update .btn:disabled{opacity:.6}
@keyframes drop{from{transform:translateY(-20px);opacity:0}}
@media(prefers-reduced-motion:reduce){.update{animation:none}}

/* body map */
.bodymap{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;background:var(--panel);border-radius:18px;padding:12px 8px 4px}
.bodymap figure{margin:0;text-align:center}
.bodymap figcaption{font-size:12px;color:var(--muted);font-weight:600;padding-bottom:6px}
.bodymap svg{width:100%;max-width:200px;margin:0 auto;height:auto}
.silh{fill:var(--panel2);stroke:var(--line);stroke-width:1.5}
.site{cursor:pointer}
.site circle{stroke:var(--bg);stroke-width:3;transition:r .15s}
.site.sel circle{stroke:var(--ink);stroke-width:3.5}
.site text{font-size:11px;font-weight:800;fill:#fff;pointer-events:none}
.legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:13px;color:var(--muted);margin-top:10px}
.legend i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:-1px}

/* charts */
.fig{position:relative;height:200px}
.fig>svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.fig text{font-size:12px;fill:var(--muted);font-variant-numeric:tabular-nums}
.heat{display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:repeat(7,auto);grid-auto-flow:column;gap:4px;max-width:460px}
.heat i{aspect-ratio:1;border-radius:4px;background:var(--panel2)}
.heat i.l1{background:color-mix(in srgb,var(--brand) 30%,var(--panel2))}
.heat i.l2{background:color-mix(in srgb,var(--brand) 60%,var(--panel2))}
.heat i.l3{background:var(--brand)}
.heat i.miss{background:color-mix(in srgb,var(--hot) 45%,var(--panel2))}
.heat i.fut{background:none;border:1px dashed var(--line)}

/* photos */
.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px}
.photos button{position:relative;aspect-ratio:3/4;border-radius:14px;overflow:hidden;border:0;padding:0;background:var(--panel2);cursor:pointer}
.photos img{width:100%;height:100%;object-fit:cover}
.photos span{position:absolute;left:6px;bottom:6px;background:rgb(0 0 0/.55);color:#fff;font-size:12px;font-weight:700;padding:2px 7px;border-radius:8px}
.compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.compare figure{margin:0}
.compare img{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:14px;background:var(--panel2)}
.compare figcaption{font-size:13px;color:var(--muted);margin-top:4px;font-weight:600}

/* table */
.scroll{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:15px}
th{text-align:left;font-size:13px;color:var(--muted);font-weight:650;padding:6px 8px;border-bottom:1px solid var(--line)}
td{padding:10px 8px;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
td.r,th.r{text-align:right}

/* library */
.search{position:relative;margin-bottom:12px}
.search input{width:100%;min-height:48px;border-radius:14px;border:0;background:var(--panel);padding:0 16px 0 44px;font-size:16px}
.search svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:20px;height:20px;fill:none;stroke:var(--muted);stroke-width:2}
.disclaimer{font-size:13px;color:var(--muted);border-top:1px solid var(--line);padding-top:14px;margin-top:28px}
.kv{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 16px;font-size:15px}
.kv dt{color:var(--muted)}
.kv dd{margin:0;font-weight:600}

@media(max-width:600px){
.today{grid-template-columns:minmax(0,1fr) 132px;gap:12px}
.ring{width:132px;height:132px}
.ring b{font-size:32px}
.time{width:50px;font-size:17px}
.row{padding:10px 12px;gap:10px}
.fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
}
@media(max-width:340px){.today{grid-template-columns:minmax(0,1fr)}.ring{margin:0 auto}}
