:root {
  /* PharmAid brand palette: amber gold #FFB000, aubergine #1E1625, rich plum #49234F, magenta #873D70, off-white #F5F0F7.
     Plum = structure and buttons, magenta = links, amber = highlights and the main call to action.
     Status colours (good / warn / bad / info) stay semantic. */
  --bg: #F5F0F7; --surface: #ffffff; --surface-2: #EFE7F1; --line: #E5DAE7;
  --text: #1E1625; --muted: #5B4E63; --faint: #8F8496;
  --accent: #49234F; --accent-soft: #F2E7F1; --accent-ink: #873D70;
  --saffron: #FFB000; --saffron-soft: #FFF2CC; --saffron-ink: #1E1625;
  --good: #15803d; --good-soft: #e5f5ea; --warn: #b45309; --warn-soft: #fdf1df;
  --bad: #b91c1c; --bad-soft: #fde8e8; --info-soft: #e8effd; --info: #1d4ed8;
  --r: 14px; --shadow: 0 1px 2px rgba(30,22,37,.05), 0 1px 3px rgba(30,22,37,.06);
  --shadow-lg: 0 12px 30px -12px rgba(73,35,79,.30), 0 2px 6px rgba(30,22,37,.06);
  --hero: linear-gradient(135deg, #1E1625 0%, #49234F 55%, #873D70 100%);
  --logo-a: #49234F;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1625; --surface: #271C2F; --surface-2: #312439; --line: #3E2F47;
    --text: #F5F0F7; --muted: #C3B5C9; --faint: #8F8098;
    --accent: #FFB000; --accent-soft: #3A2742; --accent-ink: #E7A9D3;
    --saffron: #FFB000; --saffron-soft: #3D2F0C; --saffron-ink: #1E1625;
    --good: #4ade80; --good-soft: #14321f; --warn: #fbbf24; --warn-soft: #3a2a0d;
    --bad: #f87171; --bad-soft: #3b1515; --info-soft: #172544; --info: #93b4fd;
    --shadow: none; --shadow-lg: 0 12px 30px -12px rgba(0,0,0,.7);
    --hero: linear-gradient(135deg, #160F1B 0%, #3B1C41 55%, #6A2F58 100%);
    --logo-a: #F5F0F7;
  }
}
:root[data-theme="dark"] {
    --bg: #1E1625; --surface: #271C2F; --surface-2: #312439; --line: #3E2F47;
    --text: #F5F0F7; --muted: #C3B5C9; --faint: #8F8098;
    --accent: #FFB000; --accent-soft: #3A2742; --accent-ink: #E7A9D3;
    --saffron: #FFB000; --saffron-soft: #3D2F0C; --saffron-ink: #1E1625;
    --good: #4ade80; --good-soft: #14321f; --warn: #fbbf24; --warn-soft: #3a2a0d;
    --bad: #f87171; --bad-soft: #3b1515; --info-soft: #172544; --info: #93b4fd;
    --shadow: none; --shadow-lg: 0 12px 30px -12px rgba(0,0,0,.7);
    --hero: linear-gradient(135deg, #160F1B 0%, #3B1C41 55%, #6A2F58 100%);
    --logo-a: #F5F0F7;
}
:root[data-theme="dark"] { color-scheme: dark; } :root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.top { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.top-in { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 9px; font-size: 18px; letter-spacing: -.02em; flex: none; }
.brand:hover { text-decoration: none; }
.brand small { color: var(--faint); font-weight: 500; font-size: 12px; }
.mark { background: var(--saffron); color: #3b1f4a; border-radius: 9px; padding: 3px 7px; font-size: 13px; font-weight: 800; }
nav { display: flex; gap: 2px; flex: 1; }
nav a { color: var(--muted); padding: 7px 12px; border-radius: 9px; white-space: nowrap; font-weight: 500; font-size: 14.5px; }
.header-cta { flex: none; background: var(--saffron); color: var(--saffron-ink); font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 10px; }
.header-cta:hover { text-decoration: none; filter: brightness(1.08); }
.theme-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.theme-btn:hover { background: var(--surface-2); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; } :root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; } :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; } }
nav a:hover { background: var(--surface-2); text-decoration: none; }
nav a.on { color: var(--accent-ink); background: var(--accent-soft); }

main { padding: 32px 16px 56px; min-height: 70vh; }
h1 { font-size: 32px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.025em; font-weight: 800; }
h2 { font-size: 17px; margin: 0 0 12px; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: 0 0 22px; max-width: 700px; font-size: 16px; }
main > p:first-child a, #app > p:first-child > a { font-size: 13.5px; font-weight: 500; }

.search { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
input[type=search], input[type=text], select {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; min-width: 0; }
input[type=search], input[type=text] { flex: 1 1 260px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
button { font: inherit; font-weight: 600; background: var(--accent); color: var(--surface); border: 0;
  border-radius: 10px; padding: 11px 18px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  color: var(--muted); font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
label.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 14px; }
.list { display: grid; gap: 8px; }
.item { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; color: var(--text); transition: border-color .12s, box-shadow .12s, transform .12s; }
a.item:hover, .item.click:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.item-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.item b { font-size: 15.5px; }
.sub { color: var(--muted); font-size: 13.5px; }
.faint { color: var(--faint); font-size: 13px; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13.5px; }
.facts dd { margin: 0; }
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; }
.din { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.lu { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 8px 12px; border-radius: 0 8px 8px 0;
  margin: 8px 0; }
.lu .code { font-weight: 700; color: var(--accent-ink); margin-right: 6px; }
.note { color: var(--muted); font-size: 13.5px; margin: 6px 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl { overflow-x: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.tile .n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: 13px; }

.ph-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#map, #dmapall { height: 520px; border-radius: var(--r); border: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin: -4px 0 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.ph-list { max-height: 520px; overflow-y: auto; }
.err { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 10px; }

label.fld { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
label.fld .faint { font-weight: 400; }
label.fld input, label.fld select { width: 100%; }
.card label.check { margin-bottom: 8px; }
.card ol, .card ul { padding-left: 22px; margin: 8px 0; }
.card li { margin: 4px 0; }
.card p { margin: 8px 0; }
.toc a { margin: 0 2px; }
.card[id] { scroll-margin-top: 80px; }

/* segmented controls */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: var(--surface); }
.seg input:checked + span { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.small { padding: 6px 12px; font-size: 14px; }
button.btn.ghost { border: 1px solid var(--line); }

/* OAT log */
.oat-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--text); padding-bottom: 10px; margin-bottom: 8px; }
.oat-head h2 { margin: 0; font-size: 20px; }
.oat-meta { text-align: right; font-size: 14px; }
.pins { font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; }
.pins span { white-space: nowrap; }
.oat-table td, .oat-table th { border: 1px solid var(--line); }
.oat-table td.sign { min-width: 90px; }
.oat-table tr.blank td { height: 38px; }
.oat-table .line { display: inline-block; width: 70px; border-bottom: 1px solid var(--muted); height: 14px; }
.oat-foot { margin-top: 8px; }

@media print {
  .top, .foot, .no-print, .notice-strip { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .oat-log.card { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .oat-table { font-size: 11px; }
  .oat-table th, .oat-table td { border: 1px solid #000; padding: 5px 6px; color: #000; }
  .oat-table tr { page-break-inside: avoid; }
  .faint, .pins { color: #333 !important; }
  @page { size: landscape; margin: 12mm; }
}

.notice { background: var(--warn-soft); color: var(--text); padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; }
button.copy { font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; font-size: 13.5px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; margin: 1px 2px 1px 0; cursor: copy; }
button.copy:hover { border-color: var(--accent); }
button.copy.done { background: var(--good-soft); color: var(--good); border-color: var(--good); }
button.copy.done::after { content: " ✓"; }
.warnnote { background: var(--warn-soft); padding: 8px 12px; border-radius: 8px; }
/* featured pharmacy in the finder */
.item.featured { border: 2px solid var(--saffron); background: linear-gradient(0deg, var(--surface), var(--surface)) padding-box; }
.pill.feat { background: var(--saffron-soft); color: #7a4a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.feat { background: #3d2f0c; color: #f7c948; } }
:root[data-theme="dark"] .pill.feat { background: #3d2f0c; color: #f7c948; }

/* virtual clinic call-to-action on drug pages */
.clinic-cta { display: flex; align-items: center; gap: 14px; background: var(--hero); color: #fff; border-radius: var(--r);
  padding: 14px 18px; margin: 0 0 14px; box-shadow: var(--shadow); }
.clinic-cta:hover { text-decoration: none; filter: brightness(1.07); }
.clinic-cta b { display: block; font-size: 16px; color: #fff; }
.clinic-sub { display: block; font-size: 13px; opacity: .9; margin-top: 2px; }
.clinic-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--saffron); color: #3b1f4a; display: grid; place-items: center;
  font-size: 22px; font-weight: 700; line-height: 1; }
.clinic-go { margin-left: auto; font-size: 20px; }


/* popular medications grid (BC coverage) */
.pop-h { margin: 6px 0 10px; }
.pop-group { margin-bottom: 16px; }
.pop-g { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.pop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pop-card { font: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.pop-card:hover { border-color: var(--accent); }
.pop-card b { font-size: 15.5px; }
.pop-card .sub { font-size: 13px; }
.pop-card .pills { justify-content: flex-start; margin-top: 2px; }
.pop-card .faint { font-size: 12px; }
.card.headline.warn-line { border-left-color: var(--bad); }

.card.headline { border-left: 4px solid var(--accent); font-size: 16px; }
.item.click { cursor: pointer; }
.item.click:hover, a.bc-card:hover { border-color: var(--accent); }
a.pill.link:hover { text-decoration: none; filter: brightness(.95); outline: 1px solid currentColor; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.item .more, .card .more { color: var(--accent-ink); font-size: 13px; font-weight: 600; margin-top: 4px; }
a.bc-card { display: block; color: var(--text); }
a.bc-card:hover { text-decoration: none; }
a.bc-card h2 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 16px; }
.btn { display: inline-block; background: var(--accent); color: var(--surface); border-radius: 10px; padding: 9px 16px; font-weight: 600; }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn.ghost { background: var(--surface); color: var(--accent-ink); border: 1px solid var(--line); }
.mme-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#out .card:first-child, #out .tiles:first-child { margin-top: 0; }
#out .tiles { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

.foot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 24px; }
.foot-in { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; padding-top: 36px; padding-bottom: 24px; }
.foot-brand p { color: var(--muted); font-size: 14px; margin: 10px 0 14px; max-width: 340px; }
.foot h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 4px 0 10px; }
.foot-in > div:not(.foot-brand) a { display: block; color: var(--text); font-size: 14px; padding: 4px 0; }
.foot-legal { color: var(--faint); font-size: 12.5px; padding-top: 16px; padding-bottom: 30px; border-top: 1px solid var(--line); }

/* home hero */
.hero-band { background: var(--hero); color: #fff; border-radius: 22px; padding: 44px 40px 36px; margin: 0 0 26px; position: relative; overflow: hidden; }
.hero-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242,169,0,.30), transparent 65%); pointer-events: none; }
.hero-band h1 em { font-style: normal; color: var(--saffron); }
.hero-band .eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #3b1f4a; background: var(--saffron); padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.hero-band h1 { color: #fff; font-size: 40px; max-width: 720px; }
.hero-band .lead { color: rgba(255,255,255,.86); max-width: 640px; }
.hero-search { position: relative; max-width: 720px; }
.hero-search input[type=search] { width: 100%; font-size: 17px; padding: 16px 18px 16px 50px; border-radius: 14px; border: 2px solid transparent;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.35); color: #0f1d24; background: #fff; }
.hero-search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: #8e3b6e; pointer-events: none; }
.hero-search input[type=search]:focus { outline: none; border-color: var(--saffron); }
.hero-eg { margin-top: 12px; font-size: 13.5px; color: rgba(255,255,255,.8); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hero-eg button { font: inherit; font-size: 13px; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px; padding: 3px 11px; cursor: pointer; }
.hero-eg button:hover { background: rgba(255,255,255,.24); }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 30px; }
.quick a { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; color: var(--text); transition: border-color .12s, box-shadow .12s, transform .12s; }
.quick a:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.quick .ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--saffron-soft); color: var(--accent); }
.quick b { display: block; font-size: 15.5px; margin-bottom: 2px; }
.quick span.sub { display: block; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.section-h h2 { font-size: 20px; margin: 0; }

/* tools hub */
.tool-cat { margin: 26px 0 10px; }
.tool-cat h2 { font-size: 18px; margin: 0 0 2px; }
.tool-cat p { color: var(--muted); font-size: 14px; margin: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tool-grid a.item b { display: block; font-size: 15.5px; margin-bottom: 3px; }
.tool-grid .tag { float: right; font-size: 11.5px; font-weight: 700; color: #6b4300; background: var(--saffron-soft); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }

@media (max-width: 960px) {
  .top .menu-btn { display: inline-flex; order: 3; }
  .theme-btn { margin-left: auto; order: 2; width: 36px; height: 36px; }
  .header-cta { order: 2; padding: 7px 12px; font-size: 13.5px; }
  .top-in { position: relative; }
  nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 2px; overflow: visible;
        background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 8px 18px rgba(0,0,0,.08); padding: 6px 12px 12px; }
  nav.open { display: flex; }
  nav a { padding: 11px 12px; font-size: 16px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .ph-layout { grid-template-columns: 1fr; }
  #map, #dmapall { height: 320px; }
  .ph-list { max-height: none; }
  .top-in { height: 58px; gap: 10px; }
  nav { top: 58px; }
  main { padding: 20px 16px 40px; }
  h1 { font-size: 26px; }
  .hero-band { padding: 26px 18px 22px; border-radius: 18px; margin: -4px 0 20px; }
  .hero-band h1 { font-size: 27px; }
  .hero-band .lead { font-size: 15px; }
  .hero-search input[type=search] { font-size: 16px; padding: 14px 14px 14px 44px; }
  .hero-search svg { left: 14px; }
  .quick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .quick a { flex-direction: column; gap: 8px; padding: 12px; }
  .quick .ic { width: 34px; height: 34px; border-radius: 9px; }
  .quick b { font-size: 14.5px; line-height: 1.25; }
  .quick span.sub { display: none; }
  .foot-in { grid-template-columns: 1fr 1fr; gap: 18px; padding-top: 26px; }
  .card { padding: 14px; }
  .tile { padding: 12px 14px; }
  .tile .n { font-size: 22px; overflow-wrap: anywhere; }
  .lead { margin-bottom: 16px; }
  .pop-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .pop-card .pill { white-space: normal; }
  .pop-card { padding: 10px 12px; }
  .pop-card b { font-size: 15px; }
  .pop-card .faint { display: none; }
}
.menu-btn { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 42px; height: 38px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.menu-btn span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .15s, opacity .15s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
html, body { overflow-x: clip; }
img, svg, video, canvas, iframe { max-width: 100%; }

.med-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.chips.az { gap: 4px; }
.chips.az .chip { min-width: 34px; text-align: center; padding: 6px 8px; }
.chip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.chip { font: inherit; font-size: 13px; }
.med-table td.din { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
@media (max-width: 760px) {
  /* Product tables become stacked cards: brand + coverage, strength · form, manufacturer, DIN. */
  .med-table tr:first-child { display: none; }
  .med-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .med-table td { border: 0; padding: 0; }
  .med-table td:nth-child(1) { order: 1; flex: 1 1 55%; font-weight: 600; }
  .med-table td:nth-child(6) { order: 2; flex: 0 0 auto; }
  .med-table td:nth-child(2) { order: 3; }
  .med-table td:nth-child(3) { order: 4; color: var(--muted); }
  .med-table td:nth-child(2)::after { content: " ·"; color: var(--muted); }
  .med-table td:nth-child(4) { order: 5; flex: 1 1 100%; color: var(--muted); font-size: 13.5px; }
  .med-table td:nth-child(5) { order: 6; flex: 1 1 100%; font-size: 13px; color: var(--muted); }
  .med-table td:nth-child(5)::before { content: "DIN "; font-family: inherit; }
}

.tile .n { line-height: 1.2; }
#out .tile .n { font-size: 22px; }
.card.headline { border-left-color: var(--saffron); }
nav a.on { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }

/* HealthLinkBC patient-information link */
.hl-link { display: flex; flex-direction: column; gap: 2px; background: var(--saffron-soft); border: 1px solid color-mix(in srgb, var(--saffron) 45%, transparent);
  border-radius: var(--r); padding: 12px 16px; margin: 0 0 14px; color: var(--text); }
.hl-link:hover { text-decoration: none; border-color: var(--saffron); }
.hl-link b { color: var(--accent); }
.hl-link span { color: var(--muted); font-size: 13.5px; }
.sec-gap { font-size: 20px; margin: 26px 0 12px; }
@media (max-width: 760px) {
  .med-table td:nth-child(7) { order: 7; flex: 1 1 100%; font-size: 13px; }
}

/* pharmacist-reviewed medication information */
.medinfo .mi-summary { font-size: 16.5px; }
.mi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 26px; }
.mi-sec h3 { font-size: 15px; margin: 14px 0 4px; color: var(--accent); }
.mi-sec ul { padding-left: 20px; margin: 4px 0; }
.mi-sec p { margin: 4px 0; }
.mi-sec.urgent { background: var(--bad-soft); border-radius: 10px; padding: 2px 14px 8px; }
.mi-sec.urgent h3 { color: var(--bad); }
.mi-review { font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }
.medinfo.draft .card { border: 2px dashed var(--warn); }
.draft-bar { background: var(--warn-soft); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; font-size: 14px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
@media (max-width: 760px) { .mi-grid { grid-template-columns: 1fr; } }

/* site-wide "reference only" notice and the disclaimer page */
.notice-strip { font-size: 13.5px; color: var(--muted); background: var(--saffron-soft); border: 1px solid color-mix(in srgb, var(--saffron) 40%, transparent);
  border-radius: 12px; padding: 10px 14px; margin-top: 8px; margin-bottom: 8px; max-width: calc(1080px - 32px); }
.notice-strip b { color: var(--text); }
.foot-legal a { color: var(--muted); text-decoration: underline; }
.card.legal h2 { font-size: 17px; margin: 20px 0 6px; }
.card.legal h2:first-child { margin-top: 0; }
.card.legal p { max-width: 760px; }

.doc-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin: 0 0 14px; }
.doc-links .hl-link { margin: 0; }
.hl-link.doc { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
td.docs a { white-space: nowrap; margin-right: 8px; font-size: 13.5px; }

.med-hint { margin: -4px 0 12px; }
.med-table a.brand-link { font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px; }
.med-table a.brand-link:hover { text-decoration-color: currentColor; }

/* OAT fax form (screen preview and print). Sized in inches for US Letter: the CPP form attached in the
   lower-right box is a quarter of a letter page (4.25 x 5.5 in). */
.fax-form { background: #fff; color: #111; font-size: 13px; line-height: 1.4; width: 100%; max-width: 8.5in; }
.fax-form p { margin: 5px 0; }
.fx-head { text-align: center; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 8px; }
.fx-kicker { font-size: 11px; color: #444; }
.fx-head h2 { font-size: 17px; margin: 4px 0 0; color: #111; }
.fx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 26px; margin: 10px 0; }
.fx-cell, .fx-sl { display: flex; gap: 8px; align-items: flex-end; }
.fx-cell span { white-space: nowrap; font-weight: 600; }
.fx-cell b { flex: 1; border-bottom: 1px solid #111; min-height: 20px; font-weight: 500; padding: 0 4px; }
.fx-statement { border: 1px solid #111; padding: 8px 12px; margin: 8px 0 12px !important; }
.fx-body { display: grid; grid-template-columns: minmax(0, 1fr) 4.25in; gap: 0.25in; align-items: end; }
.fx-left { display: flex; flex-direction: column; justify-content: space-between; min-height: 5.5in; }
.fx-line { border-bottom: 1px solid #111; height: 0.32in; }
.fx-typed { border-bottom: 1px solid #111; padding: 4px; min-height: 0.32in; }
.fx-sign { display: grid; gap: 0.12in; margin-top: 0.3in; }
.fx-sl { flex-direction: column; align-items: stretch; gap: 2px; }
.fx-sl span { font-weight: 600; font-size: 12px; }
.fx-sl b { border-bottom: 1px solid #111; min-height: 0.3in; font-weight: 500; padding: 0 4px; display: flex; align-items: flex-end; }
.fx-affix { width: 4.25in; height: 5.5in; box-sizing: border-box; border: 2px dashed #555; display: grid; place-items: center;
  text-align: center; font-weight: 600; color: #444; padding: 0.3in; }
.fx-foot { text-align: center; font-size: 10.5px; color: #555; border-top: 1px solid #999; margin-top: 10px; padding-top: 4px; }
@media (max-width: 900px) {
  .fx-grid, .fx-body { grid-template-columns: 1fr; }
  .fx-left { min-height: 0; }
  .fx-affix { width: 100%; height: auto; aspect-ratio: 4.25 / 5.5; }
}
@media print {
  /* Fit any browser and printer. Browsers pick their own margins and Safari scales print output (~7%), so sizes are
     proportions of the printable width, not inches: the CPP box is 57% of the width at the 4.25 x 5.5 shape, which is
     about 4.25 x 5.5 in on a Letter page (never smaller), and the top section is compact so it all fits on one page. */
  .fax-form.card { border: 0; box-shadow: none; padding: 0; margin: 0; width: 100%; max-width: none; font-size: 10.5px;
                   line-height: 1.32; break-inside: avoid; page-break-inside: avoid; }
  .fax-form p { margin: 3px 0; }
  .fx-head { padding-bottom: 4px; margin-bottom: 6px; }
  .fx-head h2 { font-size: 15px; margin-top: 2px; }
  .fx-grid { grid-template-columns: 1fr 1fr; gap: 3px 24px; margin: 6px 0; }
  .fx-cell b { min-height: 17px; }
  .fx-statement { margin: 6px 0 8px !important; padding: 6px 10px; }
  .fx-body { grid-template-columns: minmax(0, 1fr) max(57%, 4.25in); gap: 3%; align-items: stretch; }  /* never smaller than the CPP form */
  .fx-left { min-height: 0; }
  .fx-affix { width: 100%; height: auto; aspect-ratio: 4.25 / 5.5; }
  .fx-line, .fx-typed { height: auto; min-height: 0.27in; }
  .fx-sign { gap: 0.08in; margin-top: 0.15in; }
  .fx-sl b { min-height: 0.26in; }
  .fx-foot { margin-top: 6px; padding-top: 3px; }
  .fax-form { page: fax; }              /* portrait for this form only; the OAT log keeps landscape */
}
@page fax { size: letter portrait; margin: 0.5in; }

/* OAT fax form: From / To boxes */
.fx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 8px; }
.fx-box { border: 1px solid #111; padding: 6px 10px 8px; display: grid; gap: 4px; }
.fx-box-h { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #333; }
.fx-grid3 { grid-template-columns: 1.3fr 0.8fr 1.1fr; }
@media (max-width: 900px) { .fx-two, .fx-grid3 { grid-template-columns: 1fr; } }
@media print { .fx-two { grid-template-columns: 1fr 1fr; gap: 10px; } .fx-grid3 { grid-template-columns: 1.3fr 0.8fr 1.1fr; } .fx-box { gap: 2px; padding: 4px 8px 6px; } }

/* electronic signature */
.sig-pad { width: 100%; height: 130px; background: #fff; border: 1px dashed var(--line); border-radius: 10px; touch-action: none; cursor: crosshair; display: block; }
.sig-actions { display: flex; gap: 8px; margin: 8px 0; }
.sig-up { cursor: pointer; }
.fx-sig { min-height: 0.45in !important; }
.fx-sig img { max-height: 0.6in; max-width: 100%; display: block; }
.fx-esig { font-style: normal; font-size: 10px; color: #444; margin-top: 2px; }
@media print { .fx-sig img { max-height: 0.5in; } }

.check.remember { align-items: flex-start; margin-top: 10px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.check.remember input { margin-top: 3px; }
.check.remember b { color: var(--text); }
.check.remember .sub { display: block; font-size: 13px; }

/* autocomplete suggestions */
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% - 8px); z-index: 50; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; padding: 4px; }
.ac-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.ac-item .sub { font-size: 12.5px; }
.ac-item:hover, .ac-item.on { background: var(--accent-soft); }

/* brand savings cards */
.hl-link.card-link { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.hl-link.card-link b { color: var(--good); }
a.card-chip { display: inline-block; font-size: 12px; font-weight: 600; color: var(--good); background: var(--good-soft); border-radius: 999px;
  padding: 1px 8px; margin: 2px 4px 2px 0; white-space: nowrap; }
a.card-chip:hover { text-decoration: none; filter: brightness(.97); }
.cards-card .doc-links { margin-bottom: 0; }

/* PharmAid logo: traced mark + wordmark ("Aid" in amber gold) */
.brand { gap: 10px; }
.brand .logo-mark { width: 32px; height: 32px; color: var(--logo-a); flex: none; }
.wm { font-weight: 800; letter-spacing: -.025em; color: var(--text); font-size: 20px; line-height: 1; }
.wm span { color: var(--saffron); }
.foot-brand .logo-mark { width: 36px; height: 36px; }
.foot-brand .wm { font-size: 22px; }
@media (max-width: 760px) { .brand .logo-mark { width: 28px; height: 28px; } .wm { font-size: 18px; } }

/* Doctors | Clinics switch */
.subtabs { display: inline-flex; gap: 4px; padding: 4px; margin: 6px 0 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; max-width: 100%; overflow-x: auto; }
.subtabs a { padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.subtabs a:hover { text-decoration: none; color: var(--text); }
.subtabs a.on { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 2px 0 6px; cursor: pointer; }

/* pill counter */
#pcroot [hidden] { display: none !important; }
.pc-beta { display: inline-block; vertical-align: middle; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--warn); background: var(--saffron-soft); border: 1px solid var(--saffron); border-radius: 999px; padding: 2px 10px; margin-left: 6px; }
.pc-betanote { font-size: 14px; color: var(--muted); margin: -10px 0 12px; }
.pc-banner { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; }
.pc-banner b { color: inherit; }
.pc-aid { background: var(--info-soft); color: var(--text); border-radius: 12px; padding: 10px 14px; margin: 0 0 16px; font-size: 14px; }
.pc-src { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pc-src label.btn { cursor: pointer; }
.pc-cam { margin-top: 12px; }
.pc-cam video { width: 100%; max-height: 70vh; background: #000; border-radius: 12px; display: block; object-fit: contain; }
.pc-cam-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pc-cam-bar .btn.on { background: var(--saffron); color: var(--saffron-ink); border-color: var(--saffron); }
.pc-model { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.pc-model progress { width: 180px; height: 8px; accent-color: var(--accent); }
.pc-top { display: flex; gap: 16px; align-items: center; margin: 8px 0 10px; flex-wrap: wrap; }
.pc-badge { background: var(--accent); color: var(--surface); border-radius: 18px; padding: 10px 22px; display: flex; align-items: baseline; gap: 8px; box-shadow: var(--shadow-lg); }
.pc-badge b { font-size: 56px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.pc-badge span { font-size: 18px; font-weight: 600; opacity: .85; }
.pc-stats { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.pc-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.pc-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 8px; }
.pc-tools .seg { margin: 0; }
.pc-tools .seg span { padding: 4px 10px; font-size: 13px; }
.pc-tools label.check { margin: 0; }
.pc-range { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.pc-range input { width: 130px; accent-color: var(--accent); }
.pc-stage { position: relative; overflow: auto; max-width: 100%; max-height: 80vh; border-radius: 12px; background: var(--surface-2); margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.pc-stage canvas { display: block; margin: 0 auto; cursor: crosshair; touch-action: manipulation; }
.pc-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(30,22,37,.45); color: #fff; font-weight: 600; font-size: 16px; }
.pc-busy span { background: rgba(30,22,37,.8); padding: 10px 16px; border-radius: 10px; }
.pc-adv { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.pc-adv summary { cursor: pointer; font-weight: 600; }
.pc-adv .pc-range { margin-top: 8px; }
.pc-print { display: none; }
@media (max-width: 640px) {
  .pc-badge b { font-size: 44px; }
  .pc-src .btn { flex: 1 1 auto; text-align: center; }
}
@media print {
  #pcroot > .no-print { display: none !important; }
  .pc-print { display: block; color: #000; }
  .pc-print h2 { margin: 0 0 4px; }
  .pc-print img { width: 100%; max-height: 82vh; object-fit: contain; display: block; margin: 6px 0; }
}
