/* PediaRx — shared styles for the calculator app and content pages.
   Tokens first; every colour used by components comes from a token so the
   dark theme only has to redefine tokens. */

@font-face {
  font-family: 'Geist';
  src: url('/assets/geist.ed5ed9a1d5.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2030-203A, U+2070-209F, U+20B9, U+2150-215F, U+2190-2199, U+2212, U+2248, U+2260, U+2264-2265;
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/assets/geist-mono.838412f649.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2030-203A, U+2070-209F, U+20B9, U+2150-215F, U+2190-2199, U+2212, U+2248, U+2260, U+2264-2265;
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #fff;
  --surface2: #eef1f8;
  --surface3: #e6eaf4;
  --border: #dde2ee;
  --border2: #c5cde0;
  --text: #0b0f1a;
  --text2: #3a4158;
  --text3: #5b6680;
  --text4: #7d89a3;
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --blue-lt: #eff6ff;
  --blue-mid: #dbeafe;
  --green: #15803d;
  --green-lt: #f0fdf4;
  --green-mid: #bbf7d0;
  --lime: #4d7c0f;
  --lime-lt: #f7fee7;
  --lime-mid: #d9f99d;
  --amber: #b45309;
  --amber-lt: #fffbeb;
  --amber-mid: #fde68a;
  --orange: #c2410c;
  --orange-lt: #fff7ed;
  --orange-mid: #fed7aa;
  --red: #b91c1c;
  --red-lt: #fef2f2;
  --red-mid: #fecaca;
  --purple: #6d28d9;
  --purple-lt: #f5f3ff;
  --purple-mid: #ddd6fe;
  --sky: #0369a1;
  --sky-lt: #f0f9ff;
  --sky-mid: #bae6fd;
  --on-accent: #fff;
  --hdr-bg: rgba(255, 255, 255, .94);
  --focus: 0 0 0 3px rgba(37, 99, 235, .35);
  --r: 14px;
  --rs: 10px;
  --sh: 0 1px 3px rgba(0, 0, 0, .05), 0 0 0 1px rgba(0, 0, 0, .03);
  --sh2: 0 8px 28px rgba(15, 23, 42, .08);
  --hdr: 56px;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1020;
    --surface: #121a2b;
    --surface2: #19233a;
    --surface3: #212c45;
    --border: #26324d;
    --border2: #34425f;
    --text: #e8ecf5;
    --text2: #c3cadb;
    --text3: #9aa5bd;
    --text4: #7b87a1;
    --blue: #6ea0ff;
    --blue-strong: #8fb4ff;
    --blue-lt: rgba(59, 130, 246, .14);
    --blue-mid: rgba(59, 130, 246, .32);
    --green: #4ade80;
    --green-lt: rgba(34, 197, 94, .12);
    --green-mid: rgba(34, 197, 94, .3);
    --lime: #a3e635;
    --lime-lt: rgba(132, 204, 22, .12);
    --lime-mid: rgba(132, 204, 22, .3);
    --amber: #fbbf24;
    --amber-lt: rgba(245, 158, 11, .12);
    --amber-mid: rgba(245, 158, 11, .32);
    --orange: #fb923c;
    --orange-lt: rgba(249, 115, 22, .12);
    --orange-mid: rgba(249, 115, 22, .32);
    --red: #f87171;
    --red-lt: rgba(239, 68, 68, .12);
    --red-mid: rgba(239, 68, 68, .34);
    --purple: #a78bfa;
    --purple-lt: rgba(139, 92, 246, .14);
    --purple-mid: rgba(139, 92, 246, .32);
    --sky: #38bdf8;
    --sky-lt: rgba(14, 165, 233, .12);
    --sky-mid: rgba(14, 165, 233, .3);
    --hdr-bg: rgba(18, 26, 43, .92);
    --focus: 0 0 0 3px rgba(110, 160, 255, .45);
    --sh: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .02);
    --sh2: 0 10px 30px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020; --surface: #121a2b; --surface2: #19233a; --surface3: #212c45;
  --border: #26324d; --border2: #34425f; --text: #e8ecf5; --text2: #c3cadb; --text3: #9aa5bd; --text4: #7b87a1;
  --blue: #6ea0ff; --blue-strong: #8fb4ff; --blue-lt: rgba(59,130,246,.14); --blue-mid: rgba(59,130,246,.32);
  --green: #4ade80; --green-lt: rgba(34,197,94,.12); --green-mid: rgba(34,197,94,.3);
  --lime: #a3e635; --lime-lt: rgba(132,204,22,.12); --lime-mid: rgba(132,204,22,.3);
  --amber: #fbbf24; --amber-lt: rgba(245,158,11,.12); --amber-mid: rgba(245,158,11,.32);
  --orange: #fb923c; --orange-lt: rgba(249,115,22,.12); --orange-mid: rgba(249,115,22,.32);
  --red: #f87171; --red-lt: rgba(239,68,68,.12); --red-mid: rgba(239,68,68,.34);
  --purple: #a78bfa; --purple-lt: rgba(139,92,246,.14); --purple-mid: rgba(139,92,246,.32);
  --sky: #38bdf8; --sky-lt: rgba(14,165,233,.12); --sky-mid: rgba(14,165,233,.3);
  --hdr-bg: rgba(18,26,43,.92); --focus: 0 0 0 3px rgba(110,160,255,.45);
  --sh: 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.02); --sh2: 0 10px 30px rgba(0,0,0,.45);
}

/* ── base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: clip; width: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 500; background: var(--text); color: var(--bg);
  padding: 8px 12px; border-radius: 8px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 8px; }
.mono { font-family: var(--mono); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── header ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200; height: var(--hdr); padding: 0 16px;
  display: flex; align-items: center; background: var(--hdr-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.hrow { width: 100%; max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 10px; position: relative; }
.logo { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); text-decoration: none; }
.logo-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; font-size: 15px;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed); box-shadow: 0 2px 8px rgba(124, 58, 237, .28);
}
.logo-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.05; min-width: 0; }
.logo-name { font-size: 17px; font-weight: 700; letter-spacing: -.4px; }
.logo-name span { color: var(--blue); }
.logo-tag { font-size: 9px; font-weight: 600; color: var(--text3); letter-spacing: .02em; margin-top: 1px; }
.offline-dot {
  display: none; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; color: var(--amber);
  background: var(--amber-lt); border: 1px solid var(--amber-mid); border-radius: 4px; padding: 2px 7px;
}
.offline-dot.show { display: inline-flex; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text2);
  font-size: 12px; font-weight: 600; flex-shrink: 0; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.share-btn:hover { background: var(--surface2); color: var(--text); }
.share-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.share-btn .share-label { display: none; }
@media (min-width: 480px) { .share-btn .share-label { display: inline; } }
.mode-switch {
  margin-left: auto; display: inline-flex; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; flex-shrink: 0;
}
.mode-btn {
  border: none; background: none; font-size: 12px; font-weight: 600; padding: 7px 12px; color: var(--text3);
  text-decoration: none; display: inline-flex; align-items: center;
}
.mode-btn[aria-pressed="true"], .mode-btn.on { background: var(--text); color: var(--bg); }
a.mode-btn:hover { color: var(--text); }
@media (max-width: 420px) { .mode-btn { padding: 7px 8px; font-size: 11px; } }
.hnav { display: none; gap: 14px; margin-left: 12px; flex-shrink: 0; }
.hnav a { font-size: 13px; font-weight: 500; color: var(--text3); text-decoration: none; }
.hnav a:hover, .hnav a[aria-current="page"] { color: var(--text); }
@media (min-width: 760px) { .hnav { display: flex; } }
.theme-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text3); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.theme-btn svg { width: 16px; height: 16px; }

/* ── app layout ───────────────────────────────────────────────────── */
.app { max-width: 1240px; margin: 0 auto; padding-bottom: 32px; width: 100%; }
.left-col { min-width: 0; }
.right-col { display: none; }
@media (min-width: 960px) {
  .app { padding: 0 20px 32px; }
  .app-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 20px; align-items: start; }
  .left-col {
    max-height: calc(100vh - var(--hdr) - 8px); overflow-x: hidden; overflow-y: auto;
    padding-right: 4px; scrollbar-width: thin;
  }
  .patient, .notice, .search-wrap, .section, .list-hdr, .custom-card { margin-left: 0 !important; margin-right: 0 !important; }
  .search-wrap { position: static; padding-top: 12px; padding-left: 0; padding-right: 0; }
  .section, .list-hdr, .drug-list { padding-left: 0; padding-right: 0; }
  .right-col {
    display: block; position: sticky; top: calc(var(--hdr) + 12px); padding: 12px 0 24px;
    max-height: calc(100vh - var(--hdr) - 24px); overflow: auto; min-width: 0;
  }
  .right-empty {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 32px 20px;
    text-align: center; color: var(--text4); font-size: 13px; line-height: 1.55; box-shadow: var(--sh);
  }
  .right-empty strong { display: block; color: var(--text3); font-size: 14px; margin-bottom: 6px; font-weight: 700; }
  #rightPanel:not(:empty) { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh2); overflow: hidden; }
  .dcard .cpanel { display: none !important; }
  .dcard.open { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue-mid); }
  .drow:hover { background: var(--surface2); }
  .hero-val { font-size: 42px; }
}
@media (min-width: 1200px) { .app-shell { grid-template-columns: minmax(0, 700px) 440px; justify-content: center; } }

/* ── patient card ─────────────────────────────────────────────────── */
.patient {
  margin: 12px 14px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--sh2); overflow: hidden; max-width: 100%;
}
.pat-label {
  padding: 10px 14px 0; font-size: 10px; font-weight: 700; color: var(--text4); text-transform: uppercase;
  letter-spacing: 1px; display: flex; align-items: center; gap: 6px;
}
.pat-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.pat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.pat-cell { padding: 6px 12px 12px; border-right: 1px solid var(--border); min-width: 0; }
.pat-cell:last-child { border-right: none; }
.pat-cell > label, .pat-cell .lbl {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 10px; font-weight: 600;
  color: var(--text4); margin-bottom: 3px; letter-spacing: .4px; text-transform: uppercase;
}
.pat-cell input, .pat-cell select {
  width: 100%; border: none; outline: none; background: none; font-family: var(--mono); font-size: 26px;
  font-weight: 700; color: var(--text); appearance: none; -moz-appearance: textfield; line-height: 1.1;
  border-radius: 6px;
}
.pat-cell input::-webkit-outer-spin-button, .pat-cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pat-cell input:focus-visible, .pat-cell select:focus-visible { box-shadow: var(--focus); }
.wt-input { color: var(--blue) !important; font-size: 30px !important; }
.age-input { color: var(--lime) !important; }
.ulab { font-size: 11px; color: var(--text4); margin-top: 2px; font-weight: 500; }
.ulab.est { color: var(--amber); font-weight: 700; }
.age-unit-toggle { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.age-unit-btn { font-size: 10px; font-weight: 700; padding: 2px 6px; border: none; background: none; color: var(--text4); }
.age-unit-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.flags-bar {
  display: none; border-top: 1px solid var(--border); padding: 10px 14px; gap: 14px; flex-wrap: wrap;
  align-items: center; background: var(--purple-lt);
}
.flags-bar.show { display: flex; }
.flag { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text2); cursor: pointer; user-select: none; }
.flag input { width: 16px; height: 16px; accent-color: var(--purple); }
.flags-hint { font-size: 12px; color: var(--text3); }
.est-bar {
  display: none; padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--amber);
  background: var(--amber-lt); border-top: 1px solid var(--amber-mid); gap: 6px; align-items: center;
}
.est-bar.show { display: flex; }
.notice {
  display: none; margin: 10px 14px 0; padding: 10px 12px; border-radius: var(--rs); font-size: 13px; font-weight: 600;
  background: var(--amber-lt); border: 1px solid var(--amber-mid); color: var(--amber);
}
.notice.show { display: block; }
.notice.ok { background: var(--green-lt); border-color: var(--green-mid); color: var(--green); }
.notice button { margin-left: 8px; border: 1px solid currentColor; background: none; color: inherit; border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: 12px; }

/* ── search + chips ───────────────────────────────────────────────── */
.search-wrap { padding: 12px 14px 0; position: sticky; top: var(--hdr); z-index: 150; background: var(--bg); }
.sbox {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rs); padding: 11px 13px; box-shadow: var(--sh);
}
.sbox:focus-within { border-color: var(--blue); box-shadow: var(--focus); }
.sbox input { border: none; outline: none; background: none; width: 100%; font-size: 15px; color: var(--text); }
.sbox input::placeholder { color: var(--text4); }
.sbox input:focus-visible { box-shadow: none; }
.s-ic { color: var(--text4); width: 16px; height: 16px; flex-shrink: 0; }
.s-clr {
  display: none; width: 22px; height: 22px; border: none; border-radius: 50%; background: var(--border);
  color: var(--text3); font-size: 11px; font-weight: 700; align-items: center; justify-content: center; flex-shrink: 0;
}
.s-clr.show { display: flex; }
.section { padding: 10px 14px 0; }
.sec-label { font-size: 10px; font-weight: 700; color: var(--text4); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.qchip, .cat {
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 12px; font-weight: 500;
  color: var(--text2); padding: 6px 12px; white-space: nowrap; box-shadow: var(--sh);
}
.qchip[aria-pressed="true"], .cat[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.cat-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cat-row::-webkit-scrollbar { display: none; }
.cat { border-radius: 5px; padding: 5px 11px; color: var(--text3); flex-shrink: 0; }
@media (min-width: 960px) { .cat-row { flex-wrap: wrap; overflow: visible; } }

/* ── drug list ────────────────────────────────────────────────────── */
.list-hdr { padding: 12px 14px 6px; font-size: 13px; font-weight: 600; color: var(--text3); }
.drug-list { padding: 0 14px 12px; }
.skel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rs); margin-bottom: 6px; height: 64px; overflow: hidden; position: relative; }
.skel::after {
  content: ''; position: absolute; inset: 0; animation: shim 1.2s infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
}
@keyframes shim { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rs); margin-bottom: 6px; overflow: hidden; box-shadow: var(--sh); }
.dcard.open { box-shadow: var(--sh2); }
.drow {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px; min-height: 64px; width: 100%;
  border: none; background: none; text-align: left;
}
.drow:active { background: var(--surface2); }
.drow[aria-disabled="true"] { opacity: .72; }
.dic { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; border: 1px solid var(--border); background: var(--surface2); }
.dinfo { flex: 1; min-width: 0; }
.dname { font-size: 14.5px; font-weight: 600; line-height: 1.2; color: var(--text); }
.dmeta { font-size: 11.5px; color: var(--text4); margin-top: 2px; }
.dformula { font-size: 11px; color: var(--blue); font-family: var(--mono); font-weight: 500; margin-top: 3px; line-height: 1.4; }
.dbadges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.pill { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; border: 1px solid transparent; }
.pill-preg-A { background: var(--green-lt); color: var(--green); border-color: var(--green-mid); }
.pill-preg-B { background: var(--blue-lt); color: var(--blue); border-color: var(--blue-mid); }
.pill-preg-C { background: var(--amber-lt); color: var(--amber); border-color: var(--amber-mid); }
.pill-preg-D { background: var(--orange-lt); color: var(--orange); border-color: var(--orange-mid); }
.pill-preg-X { background: var(--red-lt); color: var(--red); border-color: var(--red-mid); }
.pill-min, .pill-muted { background: var(--surface2); color: var(--text3); border-color: var(--border); }
.pill-hospital { background: var(--orange-lt); color: var(--orange); border-color: var(--orange-mid); }
.pill-emergency { background: var(--red-lt); color: var(--red); border-color: var(--red-mid); }
.pill-referral { background: var(--surface2); color: var(--text3); border-color: var(--border); }
.dchev { color: var(--border2); font-size: 18px; transition: .2s; flex-shrink: 0; }
.dcard.open .dchev { transform: rotate(90deg); color: var(--blue); }
.cpanel { display: none; border-top: 1px solid var(--border); background: var(--surface); }
.cpanel.open { display: block; animation: fd .15s ease; }
@keyframes fd { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.empty { text-align: center; padding: 40px 20px; color: var(--text4); }
.empty-ic { font-size: 36px; margin-bottom: 10px; }
.empty-tx { font-size: 15px; font-weight: 500; }
.btn-primary {
  margin-top: 14px; border: none; border-radius: var(--rs); padding: 11px 22px; background: var(--blue);
  color: #fff; font-size: 13.5px; font-weight: 700;
}

/* ── dose panel ───────────────────────────────────────────────────── */
.cinner { padding: 14px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; line-height: 1.25; }
.panel-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.panel-link { font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.nw { background: var(--amber-lt); border: 1px solid var(--amber-mid); border-radius: var(--rs); padding: 14px; text-align: center; font-size: 13px; font-weight: 600; color: var(--amber); }
.block-danger { background: var(--red-lt); border: 1px solid var(--red-mid); border-radius: var(--rs); padding: 12px 14px; color: var(--red); font-size: 13px; font-weight: 600; line-height: 1.5; margin-bottom: 10px; }
.block-danger small { display: block; font-weight: 500; color: var(--text2); margin-top: 4px; }
.block-refer { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--rs); padding: 12px 14px; color: var(--text2); font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
.block-refer strong { color: var(--text); }
.preg-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; padding: 10px 12px; border-radius: var(--rs); border: 1px solid; font-size: 12.5px; line-height: 1.45; }
.preg-A { background: var(--green-lt); border-color: var(--green-mid); color: var(--green); }
.preg-B { background: var(--blue-lt); border-color: var(--blue-mid); color: var(--blue); }
.preg-C, .preg-N { background: var(--amber-lt); border-color: var(--amber-mid); color: var(--amber); }
.preg-D { background: var(--orange-lt); border-color: var(--orange-mid); color: var(--orange); }
.preg-X { background: var(--red-lt); border-color: var(--red-mid); color: var(--red); }
.preg-banner .pcat { font-family: var(--mono); font-weight: 700; font-size: 16px; min-width: 22px; }
.preg-banner span { color: var(--text2); }
.ind-row, .strrow { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.ind-chip, .strbtn {
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 11px; font-size: 12.5px; font-weight: 500;
  background: var(--surface2); color: var(--text2); text-align: left; line-height: 1.3;
}
.ind-chip[aria-pressed="true"], .strbtn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.ind-chip[aria-disabled="true"] { opacity: .55; }
.ind-chip .why { display: block; font-size: 10.5px; font-weight: 600; color: var(--text4); }
.ind-chip[aria-pressed="true"] .why { color: inherit; opacity: .75; }
.ind-chip .tag { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; margin-left: 4px; }
.tag-hospital { color: var(--orange); }
.tag-emergency { color: var(--red); }
.tag-referral { color: var(--text4); }
.strbtn { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.strbtn.unsuitable { opacity: .55; }
.strl { font-size: 10px; font-weight: 700; color: var(--text4); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 7px; }
.rtabs { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--rs); padding: 3px; gap: 2px; margin-bottom: 12px; }
.rtab { flex: 1; border: none; background: none; border-radius: 8px; padding: 8px 4px; font-size: 12px; font-weight: 500; color: var(--text3); }
.rtab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh); font-weight: 700; }
.warn { background: var(--orange-lt); border: 1px solid var(--orange-mid); border-radius: var(--rs); padding: 9px 11px; font-size: 12.5px; font-weight: 600; color: var(--orange); margin-bottom: 10px; line-height: 1.45; }
.info { background: var(--sky-lt); border: 1px solid var(--sky-mid); border-radius: var(--rs); padding: 9px 11px; font-size: 12.5px; color: var(--sky); margin-bottom: 8px; line-height: 1.5; }
.scope-note { border-radius: var(--rs); padding: 8px 11px; font-size: 12px; font-weight: 600; margin-bottom: 10px; border: 1px solid; }
.scope-hospital { background: var(--orange-lt); border-color: var(--orange-mid); color: var(--orange); }
.scope-emergency { background: var(--red-lt); border-color: var(--red-mid); color: var(--red); }
.hero { border-radius: var(--rs); padding: 16px 18px; margin-bottom: 10px; position: relative; overflow: hidden; color: #fff; }
.hero-syr { background: linear-gradient(135deg, #15803d, #047857); }
.hero-tab { background: linear-gradient(135deg, #1d4ed8, #4338ca); }
.hero-iv { background: linear-gradient(135deg, #c2410c, #9a3412); }
.hero-neb { background: linear-gradient(135deg, #0369a1, #0e7490); }
.hero-note { background: linear-gradient(135deg, #0f172a, #1e293b); }
.hero-label { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .72); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; line-height: 1.35; }
.hero-num { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.hero-val { font-family: var(--mono); font-size: 46px; font-weight: 700; color: #fff; line-height: 1; letter-spacing: -1.5px; }
.hero-val.sm { font-size: 24px; letter-spacing: 0; }
.hero-unit { font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, .78); }
.hero-meta { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero-freq { background: rgba(255, 255, 255, .16); border-radius: 5px; padding: 4px 10px; font-size: 13px; font-weight: 700; color: #fff; }
.hero-perdose { font-size: 12.5px; color: rgba(255, 255, 255, .82); }
.hero-approx { display: inline-block; margin-top: 8px; font-size: 11.5px; font-weight: 700; background: rgba(0, 0, 0, .22); border-radius: 5px; padding: 3px 8px; }
.loading-box { border: 1px dashed var(--blue-mid); background: var(--blue-lt); border-radius: var(--rs); padding: 9px 12px; margin-bottom: 10px; font-size: 13px; color: var(--text2); }
.loading-box strong { color: var(--blue); font-family: var(--mono); }
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.sbox2 { border-radius: var(--rs); padding: 10px 12px; border: 1px solid; min-width: 0; }
.sbox2.dose-card { background: var(--lime-lt); border-color: var(--lime-mid); }
.sbox2.daily-card { background: var(--sky-lt); border-color: var(--sky-mid); }
.sbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; color: var(--text4); }
.sbox2.dose-card .sbl, .sbox2.dose-card .sval { color: var(--lime); }
.sbox2.daily-card .sbl, .sbox2.daily-card .sval { color: var(--sky); }
.sval { font-family: var(--mono); font-size: 21px; font-weight: 700; line-height: 1.05; color: var(--text2); overflow-wrap: anywhere; }
.ssub { font-size: 11px; color: var(--text3); margin-top: 3px; }
.dur { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 5px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; color: var(--text3); background: var(--surface2); margin: 0 6px 10px 0; }
.fline { border-top: 1px dashed var(--border); padding-top: 9px; margin-top: 4px; }
.ftxt { font-family: var(--mono); font-size: 11.5px; color: var(--text3); line-height: 1.7; }
.combo { font-size: 12px; color: var(--text2); margin: -2px 0 10px; }
.combo strong { font-family: var(--mono); }
.custom-strength { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; margin: -2px 0 10px; font-size: 12px; color: var(--text3); }
.custom-strength input { width: 100%; border: 1px solid var(--border); background: var(--surface2); border-radius: 8px; padding: 7px 9px; font-family: var(--mono); font-size: 13px; color: var(--text); }
.custom-out { grid-column: 1 / -1; font-family: var(--mono); font-weight: 700; color: var(--green); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.act-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text2); border-radius: 8px; padding: 7px 11px; font-size: 12px; font-weight: 600; text-decoration: none; }
.act-btn:hover { background: var(--surface2); color: var(--text); }
.act-btn svg { width: 14px; height: 14px; }
.dnote { border-left: 3px solid var(--lime-mid); background: var(--lime-lt); border-radius: 0 var(--rs) var(--rs) 0; padding: 8px 11px; margin-top: 10px; font-size: 12.5px; color: var(--text2); line-height: 1.55; }
.sources { margin-top: 10px; font-size: 12px; color: var(--text3); }
.sources summary { cursor: pointer; font-weight: 700; color: var(--text2); padding: 4px 0; }
.sources ol { padding-left: 18px; margin-top: 4px; line-height: 1.55; }
.sources a { word-break: break-word; }
.verify { margin-top: 10px; font-size: 11.5px; color: var(--text4); line-height: 1.5; border-top: 1px solid var(--border); padding-top: 10px; }

/* ── custom drug ──────────────────────────────────────────────────── */
.custom-card { margin: 4px 14px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh); }
.cust-hdr { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; width: 100%; border: none; text-align: left; background: linear-gradient(to right, var(--purple-lt), var(--surface)); }
.cust-left { display: flex; align-items: center; gap: 10px; }
.cust-ic { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--purple-lt); border: 1px solid var(--purple-mid); font-size: 17px; }
.cust-title { font-size: 14.5px; font-weight: 700; }
.cust-sub { font-size: 11.5px; color: var(--text4); margin-top: 1px; }
.cust-tog { color: var(--text4); transition: .2s; }
.cust-hdr[aria-expanded="true"] .cust-tog { transform: rotate(180deg); }
.cust-body { border-top: 1px solid var(--border); padding: 14px; }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.cgrid .full { grid-column: 1 / -1; }
.ifield label { display: block; font-size: 10px; font-weight: 700; color: var(--text4); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.ifield input { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--rs); padding: 10px 12px; font-family: var(--mono); font-size: 15px; color: var(--text); outline: none; }
.ifield input:focus { border-color: var(--blue); box-shadow: var(--focus); }
.calc-btn { width: 100%; margin-top: 12px; border: none; border-radius: var(--rs); padding: 13px; background: linear-gradient(135deg, #7c3aed, #4338ca); color: #fff; font-size: 14.5px; font-weight: 700; }
.cres { margin-top: 12px; }

/* ── content below the app (SEO) ──────────────────────────────────── */
.home-info { background: var(--surface); border-top: 1px solid var(--border); padding: 28px 16px 12px; }
.home-info-inner { max-width: 1100px; margin: 0 auto; }
.home-info h2 { font-size: 18px; letter-spacing: -.2px; margin-bottom: 8px; }
.home-info p { font-size: 14px; color: var(--text2); line-height: 1.65; margin-bottom: 12px; max-width: 76ch; }
.drug-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 20px; margin: 16px 0 20px; }
.drug-index h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text4); margin-bottom: 6px; }
.drug-index ul { list-style: none; }
.drug-index li { font-size: 13.5px; line-height: 1.9; }
.drug-index a { color: var(--text2); text-decoration: none; }
.drug-index a:hover { color: var(--blue); text-decoration: underline; }
.faq { margin: 8px 0 20px; }
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { font-weight: 600; cursor: pointer; font-size: 14px; }
.faq p { margin: 8px 0 0; }

/* ── footer ───────────────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 22px 16px 32px; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.fdisclaim { font-size: 11.5px; color: var(--text3); line-height: 1.75; }
.fdisclaim strong { color: var(--red); }
.fnav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; }
.fnav a { color: var(--text3); text-decoration: none; }
.fnav a:hover { color: var(--blue); }

/* ── toasts, install bar, update dialog ───────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px)); transform: translateX(-50%) translateY(8px);
  background: #09090b; color: #fff; font-size: 13px; font-weight: 600; padding: 10px 16px; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28); z-index: 400; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast button { margin-left: 10px; background: #fff; color: #0b0f1a; border: none; border-radius: 6px; padding: 4px 10px; font-weight: 700; font-size: 12px; }
.install-bar {
  display: none; position: fixed; left: 12px; right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 300;
  align-items: center; gap: 14px; padding: 14px 14px 14px 12px; color: #fff; max-width: 520px; margin: 0 auto;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px; box-shadow: 0 18px 48px rgba(15, 23, 42, .38);
}
.install-bar.show { display: flex; }
.install-bar img { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.install-copy { flex: 1; min-width: 0; }
.install-title { font-size: 15px; font-weight: 700; }
.install-sub { font-size: 12px; color: rgba(255, 255, 255, .75); margin-top: 3px; line-height: 1.35; }
.install-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.install-dismiss { border: none; background: transparent; color: rgba(255, 255, 255, .75); font-size: 12px; font-weight: 600; padding: 10px; border-radius: var(--rs); }
.install-go { border: none; background: #fff; color: #1d4ed8; font-size: 13px; font-weight: 800; padding: 10px 14px; border-radius: 10px; }
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) { .install-bar { display: none !important; } }

@media print {
  .site-header, .search-wrap, .section, .list-hdr, .drug-list, .custom-card, .home-info, .install-bar, .toast, .actions, .patient .flags-bar { display: none !important; }
  .right-col { display: block !important; position: static; max-height: none; }
  body { background: #fff; }
}
.fcopy { margin-top: 10px; }
.dname, .dmeta, .dformula { display: block; }
.drow .dinfo { display: block; }

/* Content pages: /dose/*, /fluids/, /about/, /disclaimer/, /privacy/.
   Loaded after site.css (tokens, header, calculator components). */

.page { max-width: 1160px; margin: 0 auto; padding: 22px 16px 48px; }
.crumbs { font-size: 12.5px; color: var(--text4); margin-bottom: 10px; }
.crumbs a { color: var(--text3); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.page h1 { font-size: clamp(1.45rem, 4vw, 2.05rem); letter-spacing: -.03em; line-height: 1.2; margin-bottom: 8px; }
.lead { color: var(--text2); font-size: 15.5px; line-height: 1.6; margin-bottom: 14px; max-width: 72ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { font-size: 11.5px; font-weight: 600; color: var(--text3); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; }
.chip strong { color: var(--text); }
.chip.warn-chip { color: var(--orange); border-color: var(--orange-mid); background: var(--orange-lt); }

.layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.layout-main { min-width: 0; order: 2; }
.layout-aside { min-width: 0; order: 1; }
@media (min-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; }
  .layout-main { order: 1; }
  .layout-aside { order: 2; position: sticky; top: calc(var(--hdr) + 12px); max-height: calc(100vh - var(--hdr) - 24px); overflow: auto; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 18px 16px; margin-bottom: 14px; box-shadow: var(--sh); }
.card h2 { font-size: 17px; letter-spacing: -.2px; margin-bottom: 10px; }
.card h3 { font-size: 14.5px; margin: 14px 0 6px; }
.card p, .card li { font-size: 14.5px; color: var(--text2); line-height: 1.65; }
.card p + p { margin-top: 8px; }
.card ul, .card ol { padding-left: 20px; margin-top: 6px; }
.card li + li { margin-top: 4px; }
.muted { color: var(--text3) !important; font-size: 13px !important; }

.regimen { border: 1px solid var(--border); border-radius: var(--rs); padding: 12px 14px; margin-top: 10px; background: var(--surface2); }
.regimen h3 { margin: 0 0 4px; font-size: 14.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.regimen .rx { font-family: var(--mono); font-size: 13px; color: var(--text); line-height: 1.6; }
.regimen .rx-meta { font-size: 12.5px; color: var(--text3); margin-top: 4px; }
.regimen + .regimen { margin-top: 8px; }

.table-wrap { overflow-x: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--rs); }
table.dose-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.dose-table caption { text-align: left; font-size: 12.5px; color: var(--text3); padding: 8px 10px; caption-side: bottom; }
table.dose-table th, table.dose-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.dose-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); background: var(--surface2); }
table.dose-table td.num { font-family: var(--mono); font-weight: 600; color: var(--text); }
table.dose-table tr:last-child td { border-bottom: none; }

.dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 14px; }
.dl dt { color: var(--text3); font-weight: 600; }
.dl dd { color: var(--text2); }
@media (max-width: 520px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: 6px; } }

.related { display: flex; flex-wrap: wrap; gap: 6px; }
.related a { font-size: 13px; border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; text-decoration: none; color: var(--text2); background: var(--surface); }
.related a:hover { border-color: var(--blue); color: var(--blue); }

.trust { background: var(--green-lt); border-color: var(--green-mid); }
.trust p, .trust li { color: var(--text2); }
.warn-page { font-size: 12.5px; color: var(--text3); line-height: 1.6; margin: 6px 0 14px; }
.cta { display: inline-block; margin-top: 4px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 11px 16px; border-radius: var(--rs); }
.cta:hover { background: var(--blue-strong); }

.faq-item { border-top: 1px solid var(--border); padding: 12px 0; }
.faq-item:first-of-type { border-top: none; padding-top: 0; }
.faq-item h3 { font-size: 14.5px; margin: 0 0 4px; }

/* calculator shell on dose pages */
.calc-shell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh2); overflow: hidden; }
.calc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface2); font-size: 13px; font-weight: 700; }
.db-pill { font-size: 10.5px; font-weight: 700; color: var(--text3); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.calc-shell .patient { margin: 0; border: none; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border); }
.calc-shell .pat-cell input, .calc-shell .pat-cell select { font-size: 22px; }
.calc-shell .wt-input { font-size: 24px !important; }
.calc-shell .mode-row { display: flex; gap: 6px; padding: 10px 14px 0; }
.calc-shell .mode-row .mode-btn { border: 1px solid var(--border); border-radius: 7px; padding: 5px 11px; }
.calc-shell .notice { margin: 10px 14px 0; }

/* hub tables */
.hub-list { list-style: none; padding: 0 !important; }
.hub-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.hub-list li:last-child { border-bottom: none; }
.hub-list a { font-weight: 600; text-decoration: none; }
.hub-list .hub-dose { font-family: var(--mono); font-size: 12.5px; color: var(--text3); text-align: right; }
@media (max-width: 560px) { .hub-list li { flex-direction: column; gap: 2px; } .hub-list .hub-dose { text-align: left; } }

/* fluids */
.seg { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--rs); padding: 3px; gap: 2px; margin: 12px 14px 0; }
.seg button { flex: 1; border: none; background: none; border-radius: 8px; padding: 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--text3); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh); }
.fl-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px 0; }
.fl-fields label { display: block; font-size: 10.5px; font-weight: 700; color: var(--text4); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.fl-fields input, .fl-fields select { width: 100%; border: 1px solid var(--border); background: var(--surface2); border-radius: var(--rs); padding: 9px 11px; font-family: var(--mono); font-size: 16px; color: var(--text); }
.fl-out { padding: 12px 14px 14px; display: grid; gap: 8px; }
.rbox { border: 1px solid var(--border); border-radius: var(--rs); padding: 10px 12px; background: var(--surface2); }
.rbox.primary { background: linear-gradient(145deg, #0f766e, #0e7490); border-color: transparent; color: #fff; }
.rbox .label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; opacity: .8; }
.rbox .val { font-family: var(--mono); font-size: 22px; font-weight: 700; margin-top: 2px; }
.rbox .sub { font-size: 12px; opacity: .8; margin-top: 2px; }
