/* DrugAlt Pro (docs/PRO.md): the pricing page, sign-in, the dashboard, and the two printouts. Same tokens as
   site.css (ink on white, hairlines, one radius family). The printouts are sized in points for paper and read in
   black and white; on screen they sit on a sheet at their printed size, shrunk to fit (web/js/pro.js). */

.pro-textbtn { min-height: 3rem; padding: 0; border: 0; background: none; color: var(--ink); font: 700 1rem/1.3 var(--sans); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
/* The site's one outline button (site.css .plan-go.quiet): a gray ring, ink on hover, so it never reads as the main one. */
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
@media (hover: hover) { .btn-quiet:hover { background: transparent; color: var(--ink); opacity: 1; box-shadow: inset 0 0 0 1.5px var(--ink); } }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- the pricing page ----------
   What it is in one sentence, then the two plans on the first screen, then a real handout you can read in place. */
.pro-intro h1 { max-width: 44rem; }
.pro-intro .lede { max-width: 36rem; }
.pro-trust { margin: 0.75rem 0 0; font: 700 1rem/1.4 var(--sans); color: var(--ink); }
body[data-pro="home"] main { padding-top: 1.5rem; }
body[data-pro="home"] main details { max-width: 44rem; }
#pricing-sec .note { max-width: 44rem; }

.pro-plans { display: grid; gap: 1rem; max-width: 52rem; }
@media (min-width: 40rem) { .pro-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pro-plan { display: flex; flex-direction: column; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
@media (min-width: 40rem) { .pro-plan { padding: 1.5rem; } }
.pro-plan h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.625rem; margin: 0; font: 800 1.5rem/1.2 var(--display); }
.pro-plan-who { margin: 0.375rem 0 1rem; color: var(--muted); }
.pro-price { display: flex; align-items: baseline; gap: 0.5rem; margin: 0; }
.pro-amount { font: 800 2.75rem/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.pro-per { color: var(--muted); }
.pro-plan-alt { margin: 0.375rem 0 1.25rem; font-size: 1rem; color: var(--muted); }
.pro-plan .btn, .pro-plan-other { box-sizing: border-box; width: 100%; min-height: 3.5rem; margin-top: auto; }
.pro-plan-other { display: flex; align-items: center; margin-bottom: 0; font-size: 1rem; color: var(--muted); }
.pro-plan-other a { font-weight: 700; }
/* A member's own plan (web/js/pro.js). */
.pro-plan.is-mine { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pro-mine { display: inline-flex; align-items: center; height: 1.5rem; padding: 0 0.5rem; border-radius: 0.375rem; background: var(--ink); color: var(--bg); font: 700 0.875rem/1 var(--sans); }
/* A member's buttons wait until their plan is known (3s at most), so a "Choose" button never flashes for them. */
.pro-checking .pro-go { visibility: hidden; animation: pro-show 0s 3s forwards; }
@keyframes pro-show { to { visibility: visible; } }

/* The sample: at nearly its printed size on a computer, so it reads in place; reflowed to the screen on a phone. It
   shows its first part, cut off plainly at the frame's edge, with "See the whole page" under it. Its pickers and search
   line up with it. */
.pro-sample { max-width: 52rem; min-width: 0; margin: 1.5rem 0; }
#sample-for, .sample-search { max-width: 52rem; }
.pro-sample .paper-frame { max-height: 36rem; }
@media (max-width: 40rem) { .pro-sample .paper-frame { max-height: 30rem; } }
.paper-frame.is-reflow > .paper { width: auto; min-height: 0; padding: 1.25rem 1rem 1.5rem; border-radius: 6px; }
.pro-more { max-width: 44rem; margin-top: 1rem; }
.pro-more p { margin: 0; color: var(--muted); }
.pro-more .pro-textbtn[disabled] { opacity: 0.5; cursor: progress; }

/* After you subscribe: three numbered steps in a row on a computer, stacked on a phone. */
main.wide > section > .pro-steps { max-width: 52rem; }
.pro-steps { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
@media (min-width: 48rem) { .pro-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }
.pro-steps li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0 0.875rem; align-items: start; align-content: start; counter-increment: step; }   /* rows don't stretch, so every step's words start level */
.pro-steps li::before { content: counter(step); grid-row: span 2; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--ink); color: var(--bg); font: 800 1.0625rem/1 var(--display); }
.pro-steps b { padding-top: 0.375rem; color: var(--ink); }
.pro-steps span { color: var(--muted); }

/* After the questions, one way back to the plans; the referral's free account is a plain link, so it never reads as the
   page's main button. */
.pro-close { margin: 1.5rem 0 0; }
.pro-link { display: inline-flex; align-items: center; min-height: 3rem; font-weight: 700; }   /* a 48px tap */

/* ---------- subscribe: one plan, then sign in, then Stripe ---------- */
.pro-back { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 3rem; margin: -0.75rem 0 0.25rem -0.25rem; color: var(--ink); font: 700 1rem/1 var(--sans); text-decoration: none; }
@media (hover: hover) { .pro-back:hover { text-decoration: underline; } }
.pro-back svg { width: 1.125rem; height: 1.125rem; }
body[data-pro="subscribe"] main { padding-top: 1rem; }
.pro-sub { display: flex; flex-direction: column; gap: 1.25rem; max-width: 30rem; }   /* a hidden part leaves no gap */
.pro-notice { margin: 0; padding: 0.875rem 1rem; border-radius: var(--r); background: var(--soft); line-height: 1.5; }
#ref-note { max-width: 44rem; margin-bottom: 1rem; }
.pro-sub-plan { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.pro-sub-billed { margin: 0.5rem 0 0; font-size: 1rem; color: var(--muted); }
/* Monthly / Yearly: two links that look like the dashboard's switch. */
.pro-seg { display: flex; width: 100%; box-sizing: border-box; margin-bottom: 0.75rem; }
.seg a { display: inline-flex; flex: 1; align-items: center; justify-content: center; min-height: 3rem; border-radius: 999px; color: var(--muted); font: 700 1rem/1 var(--sans); text-decoration: none; }
@media (hover: hover) { .seg a:hover { color: var(--ink); } }
.seg a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--line); }
.seg a:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.pro-sub-step h2 { margin: 0 0 0.75rem; font-size: 1.25rem; }
.pro-sub-step > p { margin: 0; }
.pro-sub-step.is-later { color: var(--muted); }
.pro-sub-step > .pro-msg:not(:empty) { margin-top: 0.75rem; }
.pro-sub #clerk-sign-in { min-height: 24rem; }
.pro-sub-hint { margin: 0 0 1rem !important; color: var(--muted); }
.pro-sub-who { display: flex; align-items: flex-start; gap: 0.5rem; overflow-wrap: anywhere; }
.pro-sub-who svg { flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; color: var(--ink); }
.pro-pay { box-sizing: border-box; width: 100%; min-height: 3.5rem; }
.pro-sub-step > .pro-sub-pay { margin-top: 0.75rem; }
.pro-sub-step.is-later > .pro-sub-pay { margin-top: 0; }
.pro-sub .note { margin-top: 1rem; }
.pro-sub .pro-card h2 { margin-bottom: 0.5rem; }
.pro-sub .pro-card p { margin: 0 0 1rem; }
.pro-sub .pro-card p:last-child { margin-bottom: 0; }
/* The sign-in and subscribe pages have the form on the page, so the header's "Sign in" link would be a second one. */
body[data-pro="login"] .acct-slot > .header-link, body[data-pro="subscribe"] .acct-slot > .header-link { display: none; }

/* ---------- sign in ---------- */
.pro-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
@media (min-width: 40rem) { .pro-card { padding: 1.5rem; } }
.pro-card h2 { margin: 0 0 1rem; font-size: 1.375rem; }
.pro-login { max-width: 32rem; }
.pro-field > span { display: block; margin: 0 0 0.375rem; font: 700 1rem/1.3 var(--sans); }
.pro-field input { box-sizing: border-box; width: 100%; min-height: 3rem; padding: 0 0.875rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--card); color: var(--ink); font: 400 1.0625rem var(--sans); }
.pro-field input:focus-visible, .pro-search input:focus-visible { outline: 3px solid color-mix(in srgb, var(--ink) 35%, transparent); outline-offset: 1px; border-color: var(--ink); }
.pro-msg { min-height: 1.5rem; margin: 0.75rem 0 0; font-size: 1rem; line-height: 1.5; }
.pro-msg:empty { min-height: 0; margin: 0; }
.pro-msg.bad { color: var(--warn); font-weight: 700; }
.pro-msg a { font-weight: 700; }

/* ---------- the dashboard ----------
   Medicines on the left, the live printout on the right (it stays in view while you pick), clinic details under the
   list. On a phone: medicines, printout, details. */
.dash-head h1 { overflow-wrap: anywhere; }
.dash-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin: 0.75rem 0 0; }
.dash-chip { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2rem; padding: 0 0.75rem; border-radius: 999px; background: var(--soft);
  color: var(--ink); font: 700 0.9375rem/1 var(--sans); }
.dash-chip::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--line-strong); }
.dash-chip.is-on::before { background: var(--ink); }
.dash-status .pro-textbtn { margin-block: -0.5rem; }   /* a 3rem tap on a 2rem line */

.pro-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; margin: 0 0 1.5rem; padding: 1rem 1.25rem;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); }
.pro-banner p { margin: 0; max-width: 36rem; }
.pro-banner-plans { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pro-banner-plans .btn { min-height: 3rem; }

.dash-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) {
  .dash-grid { grid-template-columns: minmax(19rem, 23rem) minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 1.5rem 2rem; align-items: start; }
  .dash-meds { grid-column: 1; grid-row: 1; }
  .dash-details { grid-column: 1; grid-row: 2; }
  .dash-refer { grid-column: 1; grid-row: 3; }
  .dash-main { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: calc(var(--head-h) + 1rem); }   /* under the header */
}
@media (max-width: 59.99rem) { .needs-name .dash-details { order: -1; } }   /* a phone's first visit: the name first (web/js/pro.js) */
.dash-panel { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.dash-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3rem; margin: -0.5rem 0 0.5rem; }
.dash-panel-head h2 { margin: 0; font-size: 1.25rem; }
.dash-count { min-width: 1.75rem; padding: 0.25rem 0.5rem; border-radius: 999px; background: var(--soft); font: 700 0.875rem/1 var(--sans); text-align: center; font-variant-numeric: tabular-nums; }
.dash-count:empty { display: none; }
.dash-sub { margin: -0.5rem 0 0.875rem; font-size: 1rem; color: var(--muted); }

.pro-search { position: relative; }
/* The pricing page's sample: the visitor's own medicines (web/js/pro.js). */
.sample-search { margin-top: 1rem; }
.sample-meds { margin-top: 0.625rem; }
.sample-meds[hidden] { display: none; }
.pro-search-icon { position: absolute; left: 0.875rem; top: 50%; width: 1.125rem; height: 1.125rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pro-search input { box-sizing: border-box; width: 100%; min-height: 3rem; padding: 0 1rem 0 2.625rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--card); color: var(--ink); font: 400 1.0625rem var(--sans); }
.pro-search input::-webkit-search-cancel-button { display: none; }
.pro-search input:placeholder-shown { text-overflow: ellipsis; }   /* a hint too long for a narrow phone ends in "…", not mid-letter */
.pro-search input::placeholder, .pro-field input::placeholder { color: var(--muted); opacity: 1; }
/* The suggestions float on their own surface, like the site's menus (in dark mode a step lighter than the cards under
   them), with one highlight that the arrow keys and the mouse both move (web/js/pro.js medSearch). */
.pro-suggest { --card: var(--pop-bg); position: absolute; z-index: 10; top: calc(100% + 0.375rem); left: 0; right: 0; margin: 0; padding: 0.25rem; list-style: none; border: 1px solid var(--pop-line); border-radius: var(--r-sm); background: var(--card);
  box-shadow: var(--pop-shadow); }
.pro-suggest li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; min-height: 3rem; padding: 0.75rem; box-sizing: border-box; border-radius: 6px; cursor: pointer; }
.pro-suggest li[aria-selected="true"] { background: color-mix(in srgb, var(--ink) 8%, var(--card)); }
.pro-med-name { font-weight: 700; }
.pro-med-gen { font-size: 1rem; color: var(--muted); }
.pro-med-have { margin-left: auto; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.pro-meds-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin: 0.5rem -0.5rem 0 0; }
.pro-meds-tools > * { white-space: nowrap; }   /* "4 of 4 selected", "Select all": never split; a 320px phone takes narrower taps (below) */
.pro-meds-tools[hidden] { display: none; }
.pro-meds-tools span { margin-right: auto; font-size: 1rem; color: var(--muted); }
.pro-meds-tools .pro-textbtn { padding-inline: 0.5rem; }   /* 48px wide taps, the words still 1rem apart */
@media (max-width: 22.5rem) { .pro-meds-tools .pro-textbtn { padding-inline: 0.25rem; } }
.pro-meds { margin: 0.25rem -0.5rem 0; padding: 0; list-style: none; }
.pro-meds li { display: flex; align-items: center; border-radius: var(--r-sm); }
.pro-meds label { display: flex; flex: 1; min-width: 0; align-items: center; gap: 0.75rem; min-height: 3rem; padding: 0.375rem 0.5rem; cursor: pointer; }
.pro-meds label > span:not(.pro-med-name):not(.pro-med-gen) { display: contents; }
.pro-meds .pro-med-gen { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pro-meds input[type="checkbox"] { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--ink); }
.pro-remove { flex: none; width: 3rem; height: 3rem; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
@media (hover: hover) { .pro-meds li:hover { background: var(--soft); } .pro-remove:hover { color: var(--ink); background: var(--card); } }
.dash-empty { margin-top: 1rem; }
.dash-empty p { margin: 0 0 0.875rem; color: var(--muted); }
.dash-empty b { color: var(--ink); }
.dash-quick { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dash-chip-btn { min-height: 3rem; padding: 0 1rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card); color: var(--ink); font: 700 1rem/1 var(--sans); cursor: pointer; }
@media (hover: hover) { .dash-chip-btn:hover { border-color: var(--ink); background: var(--soft); } }

.dash-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.dash-segs { display: flex; flex-wrap: wrap; gap: 0.5rem; }   /* which printout, and its language */
.seg { display: inline-flex; padding: 0.25rem; border-radius: 999px; background: var(--soft); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.125rem; border-radius: 999px; color: var(--muted); font: 700 1rem/1 var(--sans); cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
/* Dark: the picked segment is lifted, lighter than its track (darker, it read as a hole), as on a drug page's tabs. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.seg a[aria-current="page"], .seg input:checked + span) { background: color-mix(in srgb, var(--ink) 12%, var(--soft)); box-shadow: 0 0 0 1px var(--line-strong); } }
:root[data-theme="dark"] :is(.seg a[aria-current="page"], .seg input:checked + span) { background: color-mix(in srgb, var(--ink) 12%, var(--soft)); box-shadow: 0 0 0 1px var(--line-strong); }
.dash-print { gap: 0.625rem; min-height: 3rem; margin-top: 0.875rem; }   /* under the choices it prints with */
.dash-print span, .dash-fab .btn span { line-height: 1.2; text-align: center; text-wrap: balance; }   /* "Add your clinic’s name to print" on two even lines at 320px */
/* Who the patient handout is for: how they pay (each way's steps, scripts/plan.mjs) and the clinic's state (only
   pharmacies that serve it). Remembered on this device. */
.dash-for { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; margin-top: 0.875rem; }
.dash-for label { display: grid; gap: 0.375rem; flex: 1 1 12rem; min-width: 0; font: 700 1rem/1.3 var(--sans); }   /* a long option ("Insurance from a job…") fits a 320px phone */
/* The same pickers as a drug page's questions (site.css .ask-size select): the site's chevron, not the browser's. */
.dash-for select { min-width: 0; text-overflow: ellipsis; min-height: 3rem; padding: 0 2.25rem 0 0.875rem; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); color: var(--ink); font: 400 1rem/1.2 var(--sans);
  -webkit-appearance: none; appearance: none; cursor: pointer; background-color: var(--card);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.125rem) 52%, calc(100% - 0.75rem) 52%; background-size: 0.375rem 0.375rem; background-repeat: no-repeat; }
.dash-for select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.dash-for[hidden] { display: none; }
/* The handout from a drug page: how the patient pays and the state, above the paper and scrolling with it, as wide as
   it is (web/js/pro-offer.js). */
.pro-offer-for { max-width: 8.5in; margin: 0 auto 0.75rem; }
.pro-offer-for label { flex: 1 1 8rem; min-width: 0; }
.pro-offer-for select { width: 100%; }
.dash-print svg { width: 1.25rem; height: 1.25rem; }
.dash-kind-note { margin: 0.75rem 0 0; font-size: 1rem; color: var(--muted); }
.dash-main .pro-msg { margin-top: 0.5rem; }
/* The preview shows the printout's top, cut off at the frame's edge as on /pro/, and "See the whole page" opens it: on a
   phone 30rem of it, on a computer what fits beside the list. */
.dash-paper { margin-top: 1rem; max-height: 30rem; }
@media (min-width: 60rem) { .dash-paper { max-height: max(20rem, calc(100vh - var(--head-h) - 23rem)); overflow: auto; } }   /* with the controls above it and "See the whole page" under it, all on screen */
.paper-frame:has(.paper-empty) + .paper-read { display: none; }   /* nothing to see yet */
/* Phones: Print floats at the bottom once the real one is off screen (web/js/pro.js). */
.dash-fab { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  padding: 0.75rem 1.25rem calc(0.875rem + env(safe-area-inset-bottom, 0px)); pointer-events: none;
  opacity: 0; transform: translateY(1.5rem); transition: opacity 0.2s, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.25s; visibility: hidden; }
.dash-fab.is-on { opacity: 1; transform: none; visibility: visible; }
.dash-fab .btn { gap: 0.625rem; min-height: 3.25rem; padding-inline: 1.5rem; pointer-events: auto; }   /* the site's one button shape (8px corners), no shadow */
.dash-fab svg { width: 1.25rem; height: 1.25rem; }
body:has(.dash-fab.is-on) .site-footer { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)); }   /* room to scroll the page's end out from under it */
@media (min-width: 60rem) { .dash-fab { display: none; } }
@media (max-width: 30rem) {
  .seg { display: flex; width: 100%; }
  .seg label { display: flex; flex: 1; }
  .seg span { flex: 1; justify-content: center; padding: 0 0.5rem; }   /* each half fills its side, short word or long */
  .dash-print { width: 100%; justify-content: center; }
}

.dash-summary p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.dash-summary .dash-sum-org { color: var(--ink); font-weight: 700; }
.dash-summary .dash-sum-note { margin-top: 0.375rem; }
.pro-field { display: block; margin: 0 0 0.875rem; }
.dash-form-actions { display: flex; align-items: center; gap: 1.25rem; margin-top: 0.25rem; }

/* ---------- a sheet of paper, on screen ---------- */
.paper-frame { overflow: hidden; padding: 1rem; border-radius: var(--r); background: var(--soft); }
/* On a phone a printout is shrunk past reading; "See the whole page" opens it full size (web/js/pro.js). It's a quiet
   button right under the frame, so it never covers the printout's words. */
.paper-read { width: 100%; margin-top: 0.75rem; }
.paper-frame:has(+ .paper-read) .paper { cursor: zoom-in; }
.paper-viewer-body { flex: 1; min-height: 0; overflow: auto; padding: 0.75rem; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.paper-viewer-body .paper { margin: 0 auto; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
/* A phone: the printout reflows to the screen, so it reads top to bottom. */
.is-reflow .paper-viewer-body .paper { width: auto; min-height: 0; padding: 1.25rem 1rem 1.5rem; border-radius: 6px; }
.is-reflow .sheet-head { flex-wrap: wrap; gap: 6pt 12pt; }
.is-reflow .sheet-title { text-align: left; }
.is-reflow .sheet-blank { width: 7.5rem; }
/* One text column the screen's width, the QR codes in a row under it (on paper they're a column at the right). */
.is-reflow .ph-body { grid-template-columns: minmax(0, 1fr); gap: 10pt; }
.is-reflow .ph-qrs { grid-auto-flow: column; grid-auto-columns: minmax(0, 9rem); justify-content: start; gap: 16pt; }
.is-reflow .qr-fig .qr { width: 0.8in; }
.is-reflow .st, .is-reflow .st tbody, .is-reflow .st tr, .is-reflow .st th, .is-reflow .st td { display: block; width: auto; }
.is-reflow .st thead, .is-reflow .st colgroup { display: none; }
.is-reflow .st tbody tr { padding: 8pt 0; border-bottom: 0.75pt solid #bbb; }
.is-reflow .st tbody th, .is-reflow .st td { padding: 0; border: 0; }
.is-reflow .st td { margin-top: 6pt; }
.is-reflow .st td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2pt; font: 700 8pt/1.3 var(--sans); color: #555; }
.is-reflow .st .st-qr .qr { margin-left: 0; }
.paper { box-sizing: border-box; width: 8.5in; min-height: 5in; margin: 0 auto; padding: 0.45in; background: #fff; color: #111;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.08); }
.paper-wide { width: 11in; }
.paper-empty { margin: 1in 0; color: #555; font: 400 14pt var(--sans); text-align: center; }

/* ---------- on a drug page, without a plan (web/js/pro-offer.js) ----------
   The handout in the full-screen viewer, and under it, always in view, what Pro costs and the way to the plans. The
   viewer is always dark (site.css), so these are its colors, not the page's. */
.pro-offer-foot { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  padding: 0.875rem 1rem calc(0.875rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.pro-offer-foot p { margin: 0; max-width: 40rem; font-size: 1rem; line-height: 1.45; color: #c5cace; }
.pro-offer-foot .pro-offer-h { margin-bottom: 0.125rem; font: 800 1.125rem/1.25 var(--display); color: #f2f4f5; }
.pro-offer-go { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.5rem; border-radius: var(--r-sm);
  background: #f2f4f5; color: #0c0f12; font: 800 1.0625rem/1 var(--display); text-decoration: none; }
@media (hover: hover) { .pro-offer-go:hover { background: #fff; } }
.pro-offer-go:focus-visible { outline: 3px solid #f2f4f5; outline-offset: 2px; }
.pro-offer-go { border: 0; cursor: pointer; padding-block: 0.5rem; line-height: 1.2; text-align: center; text-wrap: balance; }   /* "Add your clinic’s name to print" on two even lines at 320px */
.pro-offer-foot a { color: #f2f4f5; font-weight: 700; }
@media (max-width: 40rem) { .pro-offer-go { width: 100%; } .pro-offer-foot { gap: 0.5rem; } }
/* The free handout's line saying what Pro adds (web/js/pro-sheets.js). */
.sheet-free { margin: 8pt 0 0; font-size: 8.5pt; color: #333; }

/* ---------- the printouts (screen preview and paper) ---------- */
.sheet { color: #111; font: 400 10.5pt/1.4 var(--sans); }
.sheet b { font-weight: 700; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.3in; padding-bottom: 8pt; border-bottom: 2pt solid #111; }
.sheet-org { margin: 0; font: 800 17pt/1.15 var(--display); }
.sheet-reach { margin: 3pt 0 0; font-size: 9.5pt; color: #333; }
.sheet-title { text-align: right; }
.sheet-doc { margin: 0; font: 800 12pt/1.2 var(--display); }
.sheet-date, .sheet-for { margin: 3pt 0 0; font-size: 9.5pt; color: #333; }
.sheet-blank { display: inline-block; width: 2.1in; border-bottom: 1pt solid #111; vertical-align: -2pt; }
.sheet-note { margin: 8pt 0 0; font-weight: 700; }
.sheet-foot { margin-top: 10pt; padding-top: 6pt; border-top: 0.75pt solid #999; font-size: 8pt; line-height: 1.4; color: #333; }
.sheet-foot p { margin: 0; }
.sheet-patient .sheet-foot { font-size: 10pt; }   /* the patient's "confirm with the pharmacy", readable; the dense staff sheet keeps 8pt */
.sheet .qr { display: block; }
.sheet .qr svg { display: block; width: 100%; height: auto; }
.sheet a { color: inherit; }   /* the paper's ink, in dark mode too */
.sheet a[href^="tel:"], .ph-tel { white-space: nowrap; }   /* a phone number is copied off paper whole */
/* A web address (web/js/pro-sheets.js dom): whole when it fits; one too long for its line breaks before a dot, never
   inside a name or at its hyphen. */
.ph-dom > span { white-space: nowrap; }

/* Patient handout: one block per medicine; the QR codes in a column on the right. Its words are 12pt, for patients
   reading at arm's length (the staff sheet stays dense). */
.sheet-patient { font-size: 12pt; }
/* With one way of paying, a medicine's block (about a third of a page) is kept whole on a page. With every way it may
   run on to the next page (kept whole, a tall one left page 1 blank) between its ways, each kept whole (.ph-way); its
   name heads its text column (web/js/pro-sheets.js) and stays with what follows it. The rule between medicines is
   above each one after the first, so a block ends at its last line (space or a rule at its foot spilled onto a page of
   its own when the block filled a page). */
.ph-drug { padding-top: 10pt; }
.ph-drug + .ph-drug { margin-top: 10pt; border-top: 0.75pt solid #999; }
.sheet-patient:not([data-pay="all"]) .ph-drug { break-inside: avoid; }
.ph-drug h2, .ph-drug h3 { break-after: avoid; }
.ph-way, .ph-lead, .ph-alt, .ph-steps li, .ph-say, .qr-fig { break-inside: avoid; }
.ph-say { break-before: avoid; }   /* never alone at the top of a page, away from its medicine: with the way above it */
.ph-drug h2 { margin: 0 0 4pt; font: 800 16pt/1.2 var(--display); }
.ph-drug h2 span { font: 400 12pt var(--sans); color: #333; }
.ph-body { display: grid; grid-template-columns: minmax(0, 1fr) 1.4in; gap: 0.15in; }   /* room for a QR code's web address on one line */
.ph-text h3 { margin: 7pt 0 1pt; font: 700 12pt/1.3 var(--sans); }
.ph-drug h2 + .ph-way > h3 { margin-top: 0; }
.ph-text p { margin: 1pt 0; font-size: 12pt; }
.ph-text ul { margin: 2pt 0 2pt 13pt; padding: 0; }
.ph-text li { margin: 1pt 0; }
.ph-say { margin-top: 7pt !important; padding: 5pt 7pt; border: 0.75pt solid #111; border-radius: 5pt; }
/* The plan (scripts/print.mjs planPrint): the answer, then numbered steps, then another way, black on white. */
.ph-lead { margin: 1pt 0 2pt !important; }
.ph-lead b { font: 800 20pt/1.1 var(--display); }   /* the answer: the biggest thing on the sheet, above the clinic's name and the drug's */
.ph-more, .ph-why { color: #333; font-size: 10.5pt !important; }
.ph-steps { margin: 2pt 0 2pt 15pt; padding: 0; }
.ph-steps li { margin: 1.5pt 0; font-size: 12pt; }
.ph-alt { font-size: 11pt !important; }
.ph-steps + .ph-alt { margin-top: 4pt !important; }   /* the other ways, apart from the steps */
.ph-cap { font: 700 10.5pt/1.2 var(--sans); color: #333; }   /* sentence case, like the plan card on screen */
.sheet-where { margin: 2pt 0 0; font: 700 9pt/1.3 var(--sans); }
.ph-qrs { display: grid; align-content: start; gap: 8pt; }
.qr-fig { margin: 0; text-align: center; }
.qr-fig .qr { width: 0.95in; margin: 0 auto; }
.qr-fig figcaption { margin-top: 2pt; font-size: 8pt; line-height: 1.25; color: #333; text-wrap: balance; }   /* no one-word last line */
.ph-url { white-space: nowrap; font-weight: 700; }

/* Staff reference: one row per medicine, landscape; the header row repeats on each page. */
.st { width: 100%; margin-top: 8pt; border-collapse: collapse; table-layout: fixed; font-size: 9pt; line-height: 1.35; }
.st-c1 { width: 15%; } .st-c2 { width: 33%; } .st-c3 { width: 27%; } .st-c4 { width: 17%; } .st-c5 { width: 8%; }
.st thead { display: table-header-group; }
.st thead th { padding: 0 6pt 4pt 0; border-bottom: 1pt solid #111; font: 700 8.5pt/1.25 var(--sans); text-align: left; vertical-align: bottom; }
.st tbody tr { break-inside: avoid; }
.st tbody th, .st td { padding: 6pt 6pt 6pt 0; border-bottom: 0.75pt solid #bbb; text-align: left; vertical-align: top; }
.st tbody th b { display: block; font: 800 11pt/1.2 var(--display); }
.st tbody th span { display: block; color: #333; }
.st tbody th em { display: block; margin-top: 3pt; font-size: 8pt; font-style: normal; color: #333; }
.st ul { margin: 0; padding: 0; list-style: none; }
.st li { margin: 0 0 2pt; }
.st li i, .st td i { font-style: normal; color: #444; }
.st .st-cards { margin-top: 3pt; color: #222; }
.st .st-none { color: #444; }
.st .ndc { font: 500 8.5pt var(--mono, monospace); white-space: nowrap; }
.st-ndc { margin-top: 2pt !important; }
.st .st-qr { padding-right: 0; }
.st .st-qr .qr { width: 0.62in; margin-left: auto; }

/* ---------- printing: only the printout, at its real size ---------- */
@media print {
  body.pro-app .topbar, body.pro-app .site-header, body.pro-app .site-footer, body.pro-app #pro-banner, body.pro-app .dash-meds, body.pro-app .dash-details, body.pro-app .dash-refer,
  body.pro-app .dash-toolbar, body.pro-app .dash-kind-note, body.pro-app .dash-main .pro-msg, body.pro-app #pro-out, body.pro-app .dash-fab,
  body.pro-app .dash-for, body.pro-app .dash-print, body.pro-app .paper-read { display: none !important; }   /* no screen controls on paper */
  body.pro-app main { max-width: none; padding: 0; margin: 0; }
  body.pro-app .dash-grid { display: block; }
  body.pro-app .dash-main { position: static; }
  body.pro-app .dash-paper { margin: 0; max-height: none; }
  body.pro-app .paper-frame { padding: 0; background: none; border-radius: 0; overflow: visible !important; }
  body.pro-app .paper { width: auto; min-height: 0; padding: 0; box-shadow: none; transform: none !important; margin: 0 !important; }
  .sheet { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- dashboard: refer a clinic (docs/REFERRALS.md) ---------- */
.refer-agree { display: flex; align-items: flex-start; gap: 0.75rem; margin: 0 0 1rem; font-size: 1rem; line-height: 1.45; cursor: pointer; }
.refer-agree input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.1rem 0 0; accent-color: var(--ink); }
.refer-agree a { font-weight: 700; }
.refer-code { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 0.75rem; }
.refer-code span { font-size: 1rem; color: var(--muted); }
.refer-code b { font: 800 1.5rem/1 var(--sans); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.refer-link { display: flex; gap: 0.5rem; }
.refer-link input { flex: 1 1 auto; min-width: 0; box-sizing: border-box; min-height: 3rem; padding: 0 0.75rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--soft); color: var(--ink); font: 400 1rem var(--sans); }   /* 16px: no zoom on an iPhone */
.refer-link .btn { flex: none; min-height: 3rem; }
.refer-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.75rem 0 0; }
.refer-totals div { padding: 0.625rem 0.75rem; border-radius: var(--r-sm); background: var(--soft); }
@media (max-width: 22.5rem) { .refer-totals { gap: 0.375rem; } .refer-totals div { padding-inline: 0.5rem; } }   /* "$1,000" fits a 320px phone */
.refer-totals dt { font-size: 1rem; color: var(--muted); }
.refer-totals dd { margin: 0.125rem 0 0; font: 700 1.125rem/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.refer-list { list-style: none; margin: 0.75rem 0 0; padding: 0; font-size: 1rem; }
.refer-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.refer-list li span:last-child { font-weight: 700; }
.refer-none, .refer-fine { margin: 0.75rem 0 0; font-size: 1rem; color: var(--muted); line-height: 1.45; }
.refer-fine a { color: var(--ink); font-weight: 700; }
