/* The patient forms app (public-forms/app.mjs), served as /f/app.css on the office's patient address. Phone first: one
   short screen at a time, text from 18 px (22 px with Larger text, html.large), every button and box at least 48 px tall,
   Back and Next held at the bottom. From 768 px wide (an iPad, a computer) a page of screens shows at once, up to 880 px,
   with short fields side by side on a 12-column grid (sz-half, sz-s, sz-xs from app.mjs fieldSize). The look follows the
   staff app: white cards on soft grey, slate blue (#3b5170) for actions, green ticks for what's done. The page's CSP
   allows only this file's styles: nothing in the HTML is styled inline. Contrast of every text colour on its background
   is at least 4.5:1.
   The office's colors (Settings → Practice → Office colors) arrive with the practice and are set on the root by app.mjs
   (applyLook, style.setProperty): --accent and its shades, --on-accent (text on a button), --link (the main color dark
   enough to read as text), --band and --on-band (the top bar), --stripe (a highlighted box's edge). Unset, each falls
   back to the colours below, so an office that picked none sees exactly this. */

:root {
  --ink: #1f2430;
  --muted: #4f5866;
  --line: #d6dbe1;
  --line-strong: #9aa4b0;
  --bg: #eef1f5;
  --card: #ffffff;
  --accent: #3b5170;
  --accent-dark: #2c3e57;
  --accent-soft: #e8edf4;
  --ok: #1d7a46;
  --ok-soft: #e9f5ee;
  --danger: #b42318;
  --danger-ink: #7a1a12;
  --danger-soft: #fdf1f0;
  --notice-bg: #fff6dc;
  --notice-line: #d9a400;
  --notice-ink: #4a3600;
  --focus: #1f2430;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tick-accent: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%233b5170' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  font-size: 18px;
  scroll-padding-top: 1rem;
  scroll-padding-bottom: 10rem;
}
html.large { font-size: 22px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 1rem;
}
body.noscroll { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--link, var(--accent)); }
p { margin: 0 0 1rem; }
h1, h2, h3 { line-height: 1.25; }
h1:focus, h2:focus, .main:focus { outline: none; }

/* Visually hidden, still read aloud. */
.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- before the app starts (index.html) ---------- */
.boot { max-width: 30rem; margin: 18vh auto 0; padding: 1rem; text-align: center; color: var(--muted); }
.boot-slow { opacity: 0; animation: boot-reveal .4s ease 10s forwards; }
@keyframes boot-reveal { to { opacity: 1; } }

/* ---------- page frame ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .5rem;
  padding: .45rem .75rem; padding-top: max(.45rem, env(safe-area-inset-top)); background: var(--band, var(--accent)); color: var(--on-band, #fff);
}
.brand { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tools { display: flex; gap: .4rem; flex: 0 0 auto; }
.tool {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; min-width: 48px; padding: 0 .7rem;
  border: 1px solid rgba(255, 255, 255, .7); border-radius: 10px; background: transparent; color: var(--on-band, #fff); font-size: 1rem; cursor: pointer;
}
.tool[aria-pressed="true"] { background: #fff; color: var(--link, var(--accent)); }
.tool:focus-visible { outline: 3px solid var(--on-band, #fff); outline-offset: 2px; }
.aa { font-weight: 700; letter-spacing: .02em; }
.aa span { font-size: 1.3em; }
@media (max-width: 479px) {
  .tool-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* The narrowest phones (and Larger text): the practice's name gets a row of its own, the buttons the row under it. */
@media (max-width: 400px) {
  .brand { flex: 1 1 100%; white-space: normal; }
  .tools { margin-left: auto; }
}

.main { flex: 1 0 auto; width: 100%; max-width: 40rem; margin: 0 auto; padding: .75rem .75rem 1.25rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem .9rem 1.25rem;
  box-shadow: 0 1px 3px rgba(17, 24, 39, .06);
}
.help-line { text-align: center; color: var(--muted); margin: 1.25rem .5rem 0; }
.help-line a { font-weight: 700; white-space: nowrap; }
.loading { color: var(--muted); margin: 0; }

/* The bottom bar: step count and saving state, Next, and Back under it. */
.bar {
  position: sticky; bottom: 0; z-index: 4; background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(17, 24, 39, .07); padding: .55rem .75rem; padding-bottom: max(.55rem, env(safe-area-inset-bottom));
}
.bar-in { max-width: 40rem; margin: 0 auto; }
/* A short screen (a phone on its side, a keyboard up): the bar scrolls with the page instead of covering it (QA E23). */
@media (max-height: 500px) { .bar { position: static; } }
.bar-meta { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .25rem .75rem; margin: 0 0 .4rem; color: var(--muted); }
.stepno { font-weight: 600; }
.save.s-saved::before { content: "✓ "; color: var(--ok); }
.save.s-local { color: #7a5000; }
.save.s-error { color: var(--danger); }
.bar-btns { display: grid; gap: .2rem; }
/* An aftercare page's Call the office row, above Next and Back in the same bar so it never covers them; the bar grows,
   so the room kept under a focused box and the toast grow with it. */
.call-bar { max-width: 40rem; margin: 0 auto .4rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); display: flex; gap: .4rem; }
.call-bar .btn { flex: 1 1 0; min-height: 2.75rem; padding-block: .35rem; font-size: .95rem; }
.btn.call-office { flex-grow: 1.4; background: var(--ok); border-color: var(--ok); }
.btn.call-office:hover { background: #165f37; border-color: #165f37; }
.call-after .ca-long { display: none; }
:root:has(.call-bar) { scroll-padding-bottom: 12.5rem; }
body:has(.call-bar) .toast { bottom: 13rem; }

/* ---------- headings and text ---------- */
h1, .scr-title { font-size: 1.45rem; margin: 0 0 .75rem; }
h2.scr-title { font-size: 1.25rem; margin: 2rem 0 .75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.sub-h { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.kicker { color: var(--muted); font-weight: 600; margin: 0 0 .3rem; }
.scr-help, .signing, .empty { color: var(--muted); }
/* The sign step's statement, what the signature says ("The information above is correct to the best of my knowledge."):
   in a box of its own under the title, since the forms no longer end with a "This information is correct." tick. */
.statement {
  font-weight: 600; font-size: 1.1rem; background: var(--accent-soft); border-left: 6px solid var(--stripe, var(--accent));
  padding: .85rem 1rem; border-radius: 10px; margin: 0 0 1rem;
}
.blk-h { font-size: 1.15rem; margin: .75rem 0 .5rem; }
.blk-ul { padding-left: 1.3rem; margin: 0 0 1rem; }
.blk-ul li { margin-bottom: .45rem; }
/* Web addresses in an agreement's text (app.mjs linkify): long ones wrap on a narrow phone rather than run off it. */
.blk a { overflow-wrap: anywhere; word-break: break-word; text-underline-offset: 2px; }
.notice {
  background: var(--notice-bg); border: 1px solid #e8c45c; border-left: 6px solid var(--notice-line); color: var(--notice-ink);
  padding: .85rem 1rem; border-radius: 10px; margin: 0 0 1rem;
}
/* "Call us if": a warning box, its title and lines. */
.call-us {
  background: var(--danger-soft); border: 1px solid #f0c2bc; border-left: 6px solid var(--danger); color: var(--danger-ink);
  padding: .85rem 1rem .4rem; border-radius: 10px; margin: 0 0 1.25rem;
}
.call-us-t { font-weight: 700; font-size: 1.1rem; margin: 0 0 .4rem; }
.call-us .blk-ul { margin: 0 0 .5rem; }
/* Steps: numbered cards (what happens, how long it takes). */
.steps { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .6rem; counter-reset: step; }
.step-card {
  position: relative; counter-increment: step; padding: .8rem 1rem .8rem 3.4rem; background: #fbfcfd;
  border: 1px solid var(--line); border-radius: 12px;
}
.step-card::before {
  content: counter(step); position: absolute; left: .85rem; top: .75rem; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--accent); color: var(--on-accent, #fff); font-weight: 700; text-align: center; line-height: 1.8rem;
}
.step-title { font-weight: 700; margin: 0; }
.step-time { color: var(--muted); font-size: .9rem; margin: .1rem 0 0; }
.step-time::before { content: "⏱ "; }
.step-text { margin: .35rem 0 0; }
/* A picture, its caption under it. */
.pic { margin: 0 0 1.25rem; }
.pic img { display: block; max-width: 100%; height: auto; max-height: 70vh; margin: 0 auto; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.pic figcaption { color: var(--muted); text-align: center; margin: .45rem 0 0; }
/* A risk list: its heading close to the risks, the list (initials off) in a box. */
.risk-h { margin-bottom: .35rem; }
.risk-hint { color: var(--muted); margin-bottom: .6rem; }
.blk-ul.risks { background: #fbfcfd; border: 1px solid var(--line); border-radius: 12px; padding: .75rem 1rem .3rem 2.2rem; }
.note { background: var(--accent-soft); border-left: 6px solid var(--stripe, var(--accent)); padding: .8rem 1rem; border-radius: 10px; }
.err-box, .err-sum {
  background: var(--danger-soft); border: 1px solid #f0c2bc; border-left: 6px solid var(--danger); color: var(--danger-ink);
  padding: .85rem 1rem; border-radius: 10px; font-weight: 600;
}
.ok { color: var(--ok); font-weight: 600; }
.ok::before { content: "✓ "; }
.busy { color: var(--muted); }
.sub { font-weight: 600; margin: 1rem 0 .4rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 3rem; padding: .55rem 1.2rem;
  font-size: 1rem; font-weight: 600; line-height: 1.3; color: var(--on-accent, #fff); background: var(--accent); border: 2px solid var(--accent);
  border-radius: 12px; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.secondary { background: #fff; color: var(--link, var(--accent)); border-color: var(--link, var(--accent)); }
.btn.secondary:hover { background: var(--accent-soft); }
.btn:disabled { opacity: .65; cursor: default; }
.btn.primary { width: 100%; min-height: 3.2rem; font-size: 1.05rem; }
.btn.back { width: 100%; min-height: 2.75rem; background: transparent; border-color: transparent; color: var(--link, var(--accent)); }
.btn.back:hover { background: var(--accent-soft); }
.link {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .3rem 0; background: none; border: 0;
  color: var(--link, var(--accent)); font-weight: 600; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; text-align: left;
}
.link.danger { color: var(--danger); }
.back-link { margin: -.4rem 0 .4rem; }
.btn:focus-visible, .opt:focus-visible, .link:focus-visible, .person:focus-visible, .frm:focus-visible, .in:focus-visible,
.row:focus-within, .file:focus-visible + label {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.row-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
.staff { margin-top: 1.5rem; }

/* ---------- questions ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: .75rem; align-items: start; }
.grid > * { grid-column: 1 / -1; min-width: 0; }
.grid > .t-state, .grid > .t-zip { grid-column: span 1; }   /* on a phone only State and ZIP share a row */
.fld { margin: 0 0 1.35rem; padding: 0; border: 0; min-width: 0; }
fieldset.fld { margin-inline: 0; }
.lbl { display: block; font-weight: 600; margin: 0 0 .35rem; padding: 0; }
legend.lbl { display: table; max-width: 100%; white-space: normal; }
/* The e-signature consent at the end of "Who is filling out these forms?": a group of its own under a line. Its legend
   floats so it sits inside the group, below the line, rather than on it. */
.esign-sec { margin: 2rem 0 0; padding: 1.25rem 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.esign-sec > legend { float: left; width: 100%; padding: 0; }
.esign-sec > legend + * { clear: both; }
.esign-sec .sub-h { margin: 0 0 .5rem; }
.opt-tag { font-weight: 400; color: var(--muted); }
.opt-tag::before { content: "("; }
.opt-tag::after { content: ")"; }
.hint { color: var(--muted); margin: -.1rem 0 .55rem; }
.count { color: var(--muted); font-size: .9em; margin: .25rem 0 0; text-align: right; }
.count.over { color: var(--danger); font-weight: 700; }
.err { color: var(--danger); font-weight: 700; margin: 0 0 .5rem; }
.has-err { border-left: 4px solid var(--danger); padding-left: .75rem; }
.in {
  display: block; width: 100%; min-height: 3rem; padding: .55rem .75rem; font-size: 1rem; color: var(--ink); background: #fff;
  border: 2px solid var(--line-strong); border-radius: 10px; -webkit-appearance: none; appearance: none;
}
.in:focus { border-color: var(--accent); outline: 3px solid var(--accent); outline-offset: 1px; }
.in[aria-invalid="true"] { border-color: var(--danger); }
textarea.in { min-height: 7rem; resize: vertical; }
.in::placeholder { color: #6b7380; }

/* Dates: month, day and year boxes (number keypad). */
.dt { display: flex; gap: .6rem; }
.dt-p { flex: 1 1 0; min-width: 0; max-width: 5rem; }
.dt-p.dt-y { flex: 1.5 1 0; max-width: 7rem; }
.dt-l { display: block; color: var(--muted); margin: 0 0 .2rem; }
.part { text-align: center; padding-inline: .3rem; }

/* Yes/no and choices: big buttons, the chosen one filled. */
.opts { display: grid; gap: .55rem; max-width: 40rem; }
.opts.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.opt {
  display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 3.2rem; padding: .65rem 1rem; text-align: left;
  font-size: 1rem; color: var(--ink); background: #fff; border: 2px solid var(--line-strong); border-radius: 12px; cursor: pointer;
}
.opt:hover { border-color: var(--accent); }
.opts.two .opt { justify-content: center; }
.opt[aria-pressed]::before {
  content: ""; flex: 0 0 1.35rem; height: 1.35rem; border: 2px solid var(--line-strong); border-radius: 50%; background: #fff;
}
.opt[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); font-weight: 700; }
.opt[aria-pressed="true"]::before { border-color: #fff; background: #fff var(--tick-accent) center / 85% no-repeat; }
.opt.match, .opt.typed { background: #fff; }
.opt.typed { border-style: dashed; }
.via { color: var(--muted); font-weight: 400; }

/* Lists to tick, and the one big tick of a "check" question. */
.rows { display: grid; gap: .5rem; max-width: 40rem; }
.row {
  display: flex; align-items: flex-start; gap: .75rem; min-height: 3.2rem; padding: .7rem 1rem; background: #fff;
  border: 2px solid var(--line-strong); border-radius: 12px; cursor: pointer;
}
.row input[type="checkbox"] { flex: 0 0 auto; width: 1.55rem; height: 1.55rem; margin: .05rem 0 0; accent-color: var(--accent); cursor: pointer; }
.row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.row.tick { font-weight: 600; }
.other { margin-top: .75rem; }

/* Initials beside each point of a policy. */
.t-initials { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.t-initials.has-err { border-bottom-color: var(--line); }
.init-row { display: flex; gap: 1rem; align-items: flex-start; }
.init-text { flex: 1; min-width: 0; }
.init-name { font-weight: 700; margin: 0 0 .2rem; }
.init-point { margin: 0; }
.init-box { flex: 0 0 5.2rem; }
.init { text-align: center; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
/* A risk list with initials beside each risk (app.mjs: .risk): its rows held together in one box. */
.t-initials.risk { margin: 0; padding: .75rem .6rem; border: 1px solid var(--line); border-top: 0; background: #fbfcfd; }
.t-initials.risk .init-row { gap: .6rem; }
:not(.risk) + .t-initials.risk, .t-initials.risk:first-child { border-top: 1px solid var(--line); border-top-left-radius: 12px; border-top-right-radius: 12px; }
.t-initials.risk:last-child, .t-initials.risk:has(+ :not(.risk)) { margin-bottom: 1.35rem; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.t-initials.risk.has-err { border-left: 4px solid var(--danger); }

/* Photos. */
.photo-btns { position: relative; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.thumb-wrap { margin: 0 0 .75rem; }
.thumb { display: block; max-width: 100%; max-height: 14rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.thumb-wrap .ok { margin: .4rem 0 0; }

/* Repeats: one card per person, Remove on each. */
.rep-item { border: 2px solid var(--line); border-radius: 12px; padding: 1rem .9rem .25rem; margin: 0 0 .75rem; background: #fbfcfd; }
.rep-item > .link { margin-bottom: .5rem; }

/* Medicines and allergies. */
.onfile { margin: 0 0 1rem; }
.onfile .q { font-weight: 600; }
.added { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .45rem; }
.added li {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .2rem .9rem;
  border: 1px solid #c9d3df; border-radius: 10px; background: var(--accent-soft);
}
.added li span { font-weight: 600; overflow-wrap: anywhere; }
.search { margin-top: .75rem; padding: .9rem; border: 2px solid var(--line); border-radius: 12px; background: #f8f9fb; }
.matches { display: grid; gap: .5rem; margin-top: .6rem; }
.matches .hint { margin: .2rem 0; }

/* Agreements: the plain summary, then the full text in an overlay. */
.summary { margin: 0 0 1.25rem; }
.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(17, 24, 39, .55);
}
.ov-box {
  display: flex; flex-direction: column; width: 100%; max-width: 46rem; max-height: 92vh; max-height: 92dvh;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(17, 24, 39, .25);
}
.ov-body { overflow-y: auto; padding: 1.25rem 1rem .5rem; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ov-body h2 { font-size: 1.3rem; margin: 0 0 .75rem; }
.ov-foot { padding: .65rem 1rem; padding-bottom: max(.65rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.ov-foot .btn { width: 100%; }

/* Shared answers in a family, and notes. */
.same {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; background: var(--accent-soft);
  padding: .8rem 1rem; border-radius: 12px; margin: 0 0 1.25rem;
}
.same p { margin: 0; font-weight: 600; flex: 1 1 10rem; }

/* ---------- lists of people and forms ---------- */
.people, .forms, .copies { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.person, .frm {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 3.5rem; padding: .75rem 1rem; text-align: left;
  font-size: 1rem; color: var(--ink); background: #fff; border: 2px solid var(--line-strong); border-radius: 12px; cursor: pointer;
}
.person:hover, .frm:hover:not(:disabled) { border-color: var(--accent); }
.person { flex-wrap: wrap; }
.pname { flex: 1 1 auto; font-weight: 700; }
.pmeta { color: var(--muted); }
.person.done { background: var(--ok-soft); border-color: #a9d3bb; }
.frm .fname { flex: 1; min-width: 0; font-weight: 600; }
.frm .fstat { color: var(--muted); }
.frm:disabled { cursor: default; background: var(--ok-soft); border-color: #a9d3bb; color: var(--ink); opacity: 1; }
.frm.st-signed .fstat { color: var(--ok); font-weight: 700; }
.frm.st-started .fstat { color: var(--link, var(--accent)); font-weight: 600; }
.tick-mark { flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--ok) var(--tick) center / 72% no-repeat; }
.tick-mark.off { background: #fff; border: 2px solid var(--line-strong); }
.copies li { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.copies .fname { flex: 1 1 10rem; font-weight: 600; }
/* Stage 5 beta 2: an aftercare page's Save as PDF under it in a visit's list */
.forms .pdf-row { display: flex; justify-content: flex-end; margin-top: -.3rem; }
.done-mark { width: 4rem; height: 4rem; border-radius: 50%; margin: .25rem 0 1rem; background: var(--ok) var(--tick) center / 62% no-repeat; }
.done-mark.off { background: var(--accent); }

/* ---------- the confirm page (/c) ---------- */
/* The appointment's day and time, big enough to read at a glance; the office's phone as a button to tap and call. */
.appts { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.appt-when {
  font-weight: 700; font-size: 1.15rem; background: var(--accent-soft); border-left: 6px solid var(--stripe, var(--accent));
  padding: .75rem 1rem; border-radius: 10px;
}
.btn.call { margin-top: .25rem; }

/* Policies (an agreement in the text shape, app.mjs textScreenHtml): one page to read, its headings, paragraphs and
   lists in a reading column, its boxes in their place in the text; a short summary first when it has one. Bold,
   italic and underline are <strong>, <em> and <u>; a run's size is a class (r-sm, r-lg), never an inline style. */
.tx-body, .tx-summary, .tx-boxes, .tx-after { max-width: 42rem; }
.tx-body:focus { outline: none; }
.tx-h1 { font-size: 1.25rem; margin: 1.5rem 0 .6rem; }
.tx-h2 { font-size: 1.1rem; margin: 1.15rem 0 .5rem; }
.tx-body > .tx-h1:first-child, .tx-summary > .tx-h1:first-child { margin-top: .25rem; }
.tx-p { margin: 0 0 .85rem; }
/* R8: a heading's, paragraph's, list item's or notice's alignment (left the default). */
.al-c { text-align: center; }
.al-r { text-align: right; }
.tx-list { padding-left: 1.4rem; margin: 0 0 1rem; }
.tx-list li { margin-bottom: .4rem; }
.tx-list .tx-list { margin: .4rem 0 0; }
.tx-l1 { padding-left: 2.8rem; }
.r-sm { font-size: .85em; }
.r-lg { font-size: 1.2em; }
.tx a { overflow-wrap: anywhere; word-break: break-word; text-underline-offset: 2px; }
.tx .fld { margin: .75rem 0 1.25rem; }
.tx-summary { margin: 0 0 1rem; }
.tx-more { margin: 0 0 1.5rem; }
.tx-less { margin: 0 0 .75rem; }
.tx-boxes { padding-top: .25rem; }
.tx-after { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
/* The text shape's steps, Call us if box and pictures (app.mjs textNodesHtml) are the block shape's (.steps, .call-us,
   .pic); a step's words are its whole card, and the box ends with the practice's phone. */
.tx-steps .step-text { margin: 0; }
.tx-call, .tx-pic { margin-top: .25rem; }
.call-us-phone { margin: 0 0 .5rem; }
.call-us-phone a { color: inherit; }
/* The forms list's Policies heading, its forms under it. */
.forms-h { margin-top: 1.25rem; }

/* ---------- the signature ---------- */
.pad-wrap { margin: 0 0 .75rem; }
.pad-box { position: relative; }
.pad {
  display: block; width: 100%; height: 12rem; height: min(12rem, 42vh); background: #fff; border: 2px dashed var(--line-strong);
  border-radius: 12px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: crosshair;
}
.pad-box::after { content: ""; position: absolute; left: 2.6rem; right: 1rem; bottom: 2.4rem; border-bottom: 2px solid #c3c9d1; pointer-events: none; }
.pad-x { position: absolute; left: 1rem; bottom: 2.25rem; font-size: 1.5rem; line-height: 1; color: var(--muted); pointer-events: none; }
.pad-btns { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; }
.typed-sig {
  font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive; font-size: 2.2rem; line-height: 1.3; color: #141a2b;
  min-height: 3.6rem; padding: .4rem .75rem; margin: 0 0 1rem; border-bottom: 2px solid #c3c9d1; overflow-wrap: anywhere;
}
.sig-img { display: block; max-width: 100%; max-height: 8rem; margin: 0 0 .5rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.reused { margin: 0 0 1rem; }
/* "Sign with the same signature": the signature made for the form before, shown above the one-tap button. */
.same-sig .sig-img, .same-sig .typed-sig { margin-top: .5rem; }
.signer-line { color: var(--muted); font-weight: 600; margin: .5rem 0 1rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 10.5rem; z-index: 30; max-width: calc(100% - 2rem); padding: .7rem 1.1rem;
  background: #1f2430; color: #fff; border-radius: 12px; box-shadow: 0 6px 20px rgba(17, 24, 39, .25);
  opacity: 0; pointer-events: none; transform: translate(-50%, .75rem); transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- the form editor's preview (preview.html in the editor's frame, or /f#p.<code> on a phone) ---------- */
/* A slim band above everything saying nothing is saved or sent; the starter's bracketed blanks ("[Practice name]")
   marked yellow, as the editor marks them, so the office sees what's left to fill in. */
.pv-ribbon {
  position: sticky; top: 0; z-index: 5; margin: 0; padding: .3rem .75rem; text-align: center; font-size: .8rem;
  font-weight: 600; background: var(--notice-bg); color: var(--notice-ink); border-bottom: 1px solid var(--notice-line);
}
mark.blank { background: #ffe58a; color: var(--notice-ink); border-radius: 3px; padding: 0 .1em; box-shadow: 0 0 0 1px var(--notice-line); }

/* ---------- iPad and computer ---------- */
@media (min-width: 768px) {
  .main { max-width: 880px; padding: 1.75rem 1.5rem 2rem; }
  .card { padding: 1.75rem 2rem 2rem; }
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1rem; }
  .grid > .sz-half { grid-column: span 6; }
  .grid > .sz-s { grid-column: span 3; }
  .grid > .sz-xs { grid-column: span 2; }
  .grid > .sz-full, .grid > .blk { grid-column: 1 / -1; }
  .bar { padding-inline: 1.5rem; }
  .bar-in { max-width: 880px; display: flex; align-items: center; gap: 1rem; }
  .bar-meta { flex: 1; margin: 0; }
  .bar-btns { display: flex; flex-direction: row-reverse; gap: .75rem; }
  .btn.primary { width: auto; min-width: 11rem; }
  .call-bar { max-width: 880px; align-items: center; gap: .5rem 1rem; }
  .call-bar .btn { flex: 0 0 auto; }
  .btn.call-office { width: auto; min-width: 13rem; }
  .call-after .ca-short { display: none; }
  .call-after .ca-long { display: inline; }
  body:has(.call-bar) .toast { bottom: 10rem; }
  .btn.back { width: auto; min-width: 7rem; background: #fff; border-color: var(--accent); }
  .overlay { align-items: center; padding: 2rem; }
  .ov-box { border-radius: 16px; max-height: 85vh; }
  .toast { bottom: 6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .boot-slow { transition: none; animation-duration: .01s; }
}

/* ---------- a treatment plan sent to the patient (Stage 3: /f#t.<send>.<code>, public-forms/plan.mjs) ----------
   Phone first, inside the card: nothing may run off the page sideways (every grid child may shrink, long words wrap,
   the tables are fixed to the card's width and read as stacked rows under 480 px, the cards are one column up to
   640 px, the picture strip scrolls inside itself, the pad is the card's full width). The financing QR code is for paper:
   on a screen its link is tapped instead, and the code shows only when the page is printed. */
.pl-page { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.pl-page > * { min-width: 0; max-width: 100%; }
.pl-head { display: flex; align-items: center; gap: .75rem; margin: 0 0 .75rem; min-width: 0; }
.pl-logo { display: block; max-width: min(16rem, 100%); max-height: 4.5rem; width: auto; height: auto; object-fit: contain; }
.pl-practice { font-weight: 700; color: var(--muted); margin: 0; }
.pl-title { font-size: 1.5rem; margin: 0 0 .35rem; }
.pl-sub { color: var(--muted); margin: 0 0 1.25rem; }
.pl-h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.pl-hint { color: var(--muted); margin: .25rem 0 .75rem; }
.pl-err { color: var(--danger); font-weight: 700; background: var(--danger-soft); border-left: 6px solid var(--danger); padding: .7rem .9rem; border-radius: 10px; margin: 0 0 1rem; }
.pl-vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The pictures: one at a time, with the arrows and "k of N" under it. */
.pl-pics { margin: 0 0 1.25rem; min-width: 0; }
.pl-pics-track { overflow-x: auto; overscroll-behavior-x: contain; max-width: 100%; border-radius: 12px; background: #f4f6f9; }
.pl-pic { display: none; margin: 0; padding: .5rem; text-align: center; }
.pl-pic-on { display: block; }
.pl-pic img { display: block; margin: 0 auto; max-width: 100%; height: auto; max-height: 60vh; object-fit: contain; border-radius: 8px; }
.pl-pic figcaption { color: var(--muted); margin: .4rem 0 0; }
.pl-pics-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .5rem 0 0; }
.pl-pics-btn {
  min-width: 3rem; min-height: 3rem; font-size: 1.5rem; line-height: 1; color: var(--link, var(--accent)); background: #fff;
  border: 2px solid var(--accent); border-radius: 12px; cursor: pointer;
}
.pl-pics-btn:disabled { opacity: .4; cursor: default; }
.pl-pics-count { color: var(--muted); font-weight: 600; }

/* The procedures and the totals. */
.pl-procs, .pl-totals { width: 100%; max-width: 100%; table-layout: fixed; border-collapse: collapse; margin: 0 0 1.25rem; }
.pl-procs th, .pl-procs td, .pl-totals td { padding: .55rem .4rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.pl-procs thead th { color: var(--muted); font-size: .9rem; font-weight: 600; }
.pl-tooth { width: 4.5rem; font-weight: 600; }
/* Plan edits (2026-11-01): a plan sent with Itemize fees, each procedure's fee in its own column. */
.pl-procs .pl-fee { width: 7rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-code { color: var(--muted); font-size: .9em; }
.pl-name { display: block; font-weight: 700; }
.pl-desc { color: var(--ink); }
.pl-what {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .2rem 0; background: none; border: 0; color: var(--link, var(--accent));
  font-weight: 600; text-decoration: underline; text-underline-offset: .15em; cursor: pointer;
}
.pl-explain td { background: var(--accent-soft); }
.pl-explain-body { padding: .25rem .25rem 0; min-width: 0; }
.pl-explain-body img { max-width: 100%; height: auto; }
.pl-phase-group { border-top: 2px solid var(--line-strong); }
.pl-phase th { background: #f4f6f9; padding-top: .8rem; }
.pl-phase-name { font-weight: 700; }
.pl-phase-when { color: var(--muted); font-weight: 400; }
.pl-phase-portion { display: block; color: var(--muted); font-weight: 600; font-size: .9rem; }
.pl-totals td:last-child { text-align: right; white-space: nowrap; width: 9rem; }
.pl-portion td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--ink); border-bottom: 0; }
.pl-chosen-row td { color: var(--muted); border-bottom: 0; }
/* The chosen card's rows (a financing name, "As low as … / month*", "$2,660.00 (5% Discount)") are words, not one
   amount: they wrap inside the amounts' column rather than run off the page sideways. */
.pl-totals .pl-chosen-row td:last-child { white-space: normal; }
/* Stage 4: Existing balance (or Existing family balance) and Amount due today end the totals when the plan was sent
   with them: the amounts stay right-aligned on one line in the amounts' column, the words wrap (375 px too), and the
   amount due today is bold. */
.pl-due td { border-bottom: 0; }
.pl-totals .pl-due:not(.pl-due-today) td { border-top: 1px solid var(--line); }
.pl-due-today td { font-weight: 700; }

/* The payment cards: Choose this, and the confirmation in words. */
.pl-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; margin: 0 0 1.25rem; min-width: 0; }
.pl-options > * { min-width: 0; }
.pl-card { border: 2px solid var(--line-strong); border-radius: 14px; padding: .9rem 1rem 1rem; background: #fff; display: flex; flex-direction: column; gap: .4rem; }
.pl-card.pl-on { border-color: var(--ok); background: var(--ok-soft); }
.pl-card-title { font-size: 1.15rem; margin: 0; }
.pl-card-text { color: var(--muted); margin: 0; }
.pl-amt { font-weight: 700; margin: 0; }
/* To-do list 2026-10-20: Pay in advance's saving in dollars, under its amount. */
.pl-save { color: var(--ok); font-weight: 700; margin: 0; }
.pl-apply { font-weight: 700; }
.pl-qr { display: none; width: 8rem; height: 8rem; margin: .25rem 0; }
@media print { .pl-qr { display: block; } }
.pl-chosen-tag { color: var(--ok); font-weight: 700; margin: 0; }
.pl-confirm { grid-column: 1 / -1; background: var(--accent-soft); border-left: 6px solid var(--stripe, var(--accent)); border-radius: 12px; padding: 1rem; }
.pl-confirm-q { font-weight: 700; font-size: 1.1rem; }
.pl-confirm-acts { display: flex; flex-wrap: wrap; gap: .6rem; }
.pl-confirm-acts > * { flex: 1 1 12rem; min-width: 0; }
.pl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 3rem; padding: .55rem 1.2rem; max-width: 100%;
  font-size: 1rem; font-weight: 600; line-height: 1.3; color: var(--on-accent, #fff); background: var(--accent); border: 2px solid var(--accent);
  border-radius: 12px; cursor: pointer; text-decoration: none; text-align: center;
}
.pl-btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.pl-btn:disabled { opacity: .65; cursor: default; }
.pl-btn.pl-secondary { background: #fff; color: var(--link, var(--accent)); border-color: var(--link, var(--accent)); }
.pl-choose { margin-top: auto; width: 100%; }
.pl-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .3rem 0; background: none; border: 0;
  color: var(--link, var(--accent)); font-weight: 600; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; text-align: left;
}
.pl-change { align-self: flex-start; }
.pl-tel { font-weight: 700; white-space: nowrap; }

/* The notes after the cards. */
.pl-note { background: #fbfcfd; border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem .2rem; margin: 0 0 1rem; }
.pl-plan-note { margin: 0 0 .75rem; }
.pl-disclaimer { color: var(--muted); font-size: .9rem; }
.pl-choose-first { font-weight: 600; }

/* The signing: who signs, the e-signature tick, the pad or the typed name, Sign and accept (as the forms' sign step). */
.pl-sign { margin: 1.5rem 0 0; padding: 1.25rem 0 0; border-top: 1px solid var(--line); min-width: 0; }
.pl-who { margin: 0 0 1.25rem; padding: 0; border: 0; min-width: 0; display: grid; gap: .5rem; }
.pl-label { display: block; font-weight: 600; margin: 0 0 .35rem; padding: 0; }
legend.pl-label { display: table; max-width: 100%; white-space: normal; }
.pl-radio, .pl-tick {
  display: flex; align-items: flex-start; gap: .75rem; min-height: 3.2rem; padding: .7rem 1rem; background: #fff;
  border: 2px solid var(--line-strong); border-radius: 12px; cursor: pointer; min-width: 0;
}
.pl-radio input, .pl-tick input { flex: 0 0 auto; width: 1.55rem; height: 1.55rem; margin: .05rem 0 0; accent-color: var(--accent); cursor: pointer; }
.pl-radio:has(input:checked), .pl-tick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pl-radio:has(input:disabled) { opacity: .6; cursor: default; }
.pl-tick { font-weight: 600; margin: 0 0 1rem; }
.pl-esign { font-weight: 600; }
.pl-field { margin: 0 0 1rem; min-width: 0; }
.pl-in {
  display: block; width: 100%; min-height: 3rem; padding: .55rem .75rem; font-size: 1rem; color: var(--ink); background: #fff;
  border: 2px solid var(--line-strong); border-radius: 10px; -webkit-appearance: none; appearance: none;
}
.pl-in:focus { border-color: var(--accent); outline: 3px solid var(--accent); outline-offset: 1px; }
.pl-pad-wrap { margin: 0 0 .75rem; min-width: 0; }
.pl-pad-box { position: relative; width: 100%; }
.pl-pad {
  display: block; width: 100%; height: 12rem; height: min(12rem, 42vh); background: #fff; border: 2px dashed var(--line-strong);
  border-radius: 12px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: crosshair;
}
.pl-pad-box::after { content: ""; position: absolute; left: 1.5rem; right: 1rem; bottom: 2.4rem; border-bottom: 2px solid #c3c9d1; pointer-events: none; }
.pl-pad-btns { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; }
.pl-typed-sig {
  font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive; font-size: 2.2rem; line-height: 1.3; color: #141a2b;
  min-height: 3.6rem; padding: .4rem .75rem; margin: 0 0 1rem; border-bottom: 2px solid #c3c9d1; overflow-wrap: anywhere;
}
.pl-sign-btn { width: 100%; min-height: 3.2rem; font-size: 1.05rem; margin-top: .5rem; }
.pl-btn:focus-visible, .pl-link:focus-visible, .pl-what:focus-visible, .pl-pics-btn:focus-visible, .pl-radio:focus-within, .pl-tick:focus-within {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

/* Signed: the plan read-only, who signed and when; saved: Save a copy; expired: the office's phone. */
.pl-signed-tag { display: inline-block; color: var(--ok); background: var(--ok-soft); font-weight: 700; padding: .3rem .75rem; border-radius: 999px; margin: 0 0 .5rem; }
.pl-signed-by { color: var(--muted); font-weight: 600; }
.pl-save { width: 100%; }
.pl-signed .pl-options { grid-template-columns: minmax(0, 1fr); }
.pl-done .pl-title, .pl-expired .pl-title { margin-bottom: .75rem; }

/* Card payments release 2: Pay now after signing (the amount, Poynt's card form in its frame, Pay and Not now, the result). */
.pl-pay { margin: 1.25rem 0; padding: 1rem; border: 2px solid var(--line-strong); border-radius: 14px; background: #fff; min-width: 0; }
.pl-pay-ok { border-color: var(--ok); background: var(--ok-soft); }
.pl-pay-bad { border-color: var(--danger); }
.pl-pay-wait { border-color: var(--accent); background: var(--accent-soft); }
.pl-pay-intro, .pl-pay-note { color: var(--muted); margin: 0 0 .75rem; }
.pl-pay-due { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem; margin: 0 0 .75rem; font-weight: 600; }
.pl-pay-amt { font-size: 1.35rem; }
.pl-card-host { min-height: 4rem; margin: 0 0 .75rem; min-width: 0; }
.pl-card-host iframe { display: block; width: 100%; max-width: 100%; border: 0; }
.pl-pay-acts { display: flex; flex-wrap: wrap; gap: .6rem; }
.pl-pay-acts > * { flex: 1 1 12rem; min-width: 0; }
.pl-pay-btn { min-height: 3.2rem; font-size: 1.05rem; }
.pl-pay-paid { font-weight: 700; font-size: 1.1rem; margin: 0 0 .5rem; }
.pl-pay-receipt { color: var(--muted); margin: 0; }
.pl-pay-why { margin: 0 0 .75rem; }

@media (max-width: 640px) {
  .pl-options { grid-template-columns: minmax(0, 1fr); }
}
/* A phone: each procedure reads as a stacked row (the tooth over the words); the column heads are read aloud only. */
@media (max-width: 479px) {
  .pl-procs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pl-procs, .pl-procs tbody, .pl-procs tr, .pl-procs th, .pl-procs td { display: block; width: 100%; }
  .pl-procs tr { border-bottom: 1px solid var(--line); padding: .45rem 0; }
  .pl-procs th, .pl-procs td { border-bottom: 0; padding: .15rem .25rem; }
  .pl-procs td.pl-tooth { width: auto; color: var(--muted); font-size: .9rem; }
  .pl-procs td.pl-tooth:empty { display: none; }
  .pl-procs td.pl-fee { width: auto; text-align: left; font-weight: 600; }
  .pl-totals td:last-child { width: 7.5rem; }
}
@media (min-width: 768px) {
  .pl-save, .pl-sign-btn { width: auto; min-width: 14rem; }
}

/* ---------- a statement and its pay link (card payments release 4, public-forms/statement.mjs) ----------
   Phone first: one column, the amount due large, View statement's table two columns (the item with the family
   member's first name over it, and the amount) so nothing runs sideways at 375 or 640 px; the choices are the plan
   page's big tick boxes; Poynt's frame fills the width. Printed: only the statement (its lines unfolded), no buttons. */
.st-page { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.st-page > * { min-width: 0; max-width: 100%; }
.st-head { margin: 0 0 .5rem; min-width: 0; }
.st-practice { font-weight: 700; color: var(--muted); margin: 0 0 .25rem; }
.st-title { font-size: 1.5rem; margin: 0 0 .35rem; }
.st-sub { color: var(--muted); margin: 0 0 .75rem; }
.st-h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.st-due {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem; margin: .5rem 0 1rem;
  padding: .8rem 1rem; background: var(--accent-soft); border-radius: 12px; font-weight: 600;
}
.st-due-amt { font-size: 1.5rem; }
.st-tel { font-weight: 700; white-space: nowrap; }
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 3rem; padding: .55rem 1.2rem; max-width: 100%;
  font-size: 1rem; font-weight: 600; line-height: 1.3; color: var(--on-accent, #fff); background: var(--accent); border: 2px solid var(--accent);
  border-radius: 12px; cursor: pointer; text-decoration: none; text-align: center;
}
.st-btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.st-btn:disabled { opacity: .65; cursor: default; }
.st-btn.st-secondary { background: #fff; color: var(--link, var(--accent)); border-color: var(--link, var(--accent)); }
.st-btn.st-secondary:hover { background: var(--accent-soft); }
.st-btn:focus-visible, .st-radio:focus-within, .st-tick:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

/* View statement: each visit a small table, its balance at the foot; the Earlier visits line alone. */
.st-view { margin: 0 0 1.25rem; min-width: 0; }
.st-toggle { width: 100%; }
.st-lines { margin: 1rem 0 0; min-width: 0; }
.st-group { margin: 0 0 1rem; min-width: 0; }
.st-table { width: 100%; max-width: 100%; table-layout: fixed; border-collapse: collapse; }
.st-group-h { caption-side: top; text-align: left; font-weight: 700; padding: .4rem 0; border-bottom: 2px solid var(--line-strong); }
.st-table th, .st-table td { padding: .45rem .25rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; min-width: 0; }
.st-table thead th { color: var(--muted); font-size: .9rem; font-weight: 600; }
.st-table .st-num { text-align: right; white-space: nowrap; width: 7.5rem; }
.st-what { overflow-wrap: anywhere; }
.st-who { display: block; color: var(--muted); font-size: .9rem; font-weight: 600; }
.st-charge { font-weight: 600; }
.st-credit { color: var(--ok); font-weight: 600; }
.st-ins th, .st-ins td { color: var(--muted); border-bottom: 0; }
.st-bal th, .st-bal td { font-weight: 700; border-bottom: 0; }
.st-earlier .st-group-h { border-bottom-width: 1px; }
.st-none { color: var(--muted); }
.st-print-row { margin: .5rem 0 0; }

/* Pay online: the amount, the cards, the plan's authorization and tick, Pay now; then the result. */
.st-pay { margin: 1.25rem 0 0; padding: 1rem; border: 2px solid var(--line-strong); border-radius: 14px; background: #fff; min-width: 0; }
.st-pay-ok { border-color: var(--ok); background: var(--ok-soft); }
.st-pay-bad { border-color: var(--danger); }
.st-pay-wait { border-color: var(--accent); background: var(--accent-soft); }
.st-note, .st-off { color: var(--muted); margin: 0 0 .75rem; }
.st-choices { margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; display: grid; gap: .5rem; }
.st-label { display: block; font-weight: 600; margin: 0 0 .35rem; padding: 0; }
legend.st-label { display: table; max-width: 100%; white-space: normal; }
.st-radio, .st-tick {
  display: flex; align-items: flex-start; gap: .75rem; min-height: 3.2rem; padding: .7rem 1rem; background: #fff;
  border: 2px solid var(--line-strong); border-radius: 12px; cursor: pointer; min-width: 0;
}
.st-radio input, .st-tick input { flex: 0 0 auto; width: 1.55rem; height: 1.55rem; margin: .05rem 0 0; accent-color: var(--accent); cursor: pointer; }
.st-radio:has(input:checked), .st-tick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.st-tick { font-weight: 600; margin: 0 0 1rem; }
.st-exp { color: var(--muted); white-space: nowrap; }
.st-other { margin: .25rem 0 0; min-width: 0; }
.st-money { display: flex; align-items: center; gap: .4rem; max-width: 14rem; }
.st-dollar { font-weight: 700; font-size: 1.1rem; }
.st-in {
  display: block; width: 100%; min-height: 3rem; padding: .55rem .75rem; font-size: 1rem; color: var(--ink); background: #fff;
  border: 2px solid var(--line-strong); border-radius: 10px; -webkit-appearance: none; appearance: none;
}
.st-in:focus { border-color: var(--accent); outline: 3px solid var(--accent); outline-offset: 1px; }
.st-hint { color: var(--muted); margin: .35rem 0 0; }
.st-card-host { min-height: 4rem; margin: 0 0 1rem; min-width: 0; }
.st-card-host iframe { display: block; width: 100%; max-width: 100%; border: 0; }
.st-auth { background: #fbfcfd; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin: 0 0 .75rem; }
.st-auth-h { font-weight: 600; margin: 0 0 .4rem; }
.st-auth-text { font-size: .95rem; margin: 0; white-space: pre-line; }
.st-err { color: var(--danger); font-weight: 700; background: var(--danger-soft); border-left: 6px solid var(--danger); padding: .7rem .9rem; border-radius: 10px; margin: 0 0 1rem; }
.st-pay-btn { width: 100%; min-height: 3.2rem; font-size: 1.05rem; }
.st-paid { font-weight: 700; font-size: 1.1rem; margin: 0 0 .5rem; }
.st-receipt, .st-replaced { color: var(--muted); margin: 0 0 .5rem; }
.st-not-replaced { font-weight: 600; margin: .5rem 0 0; }
.st-why { margin: 0 0 .75rem; }
.st-done .st-title { margin-bottom: .75rem; }

@media (min-width: 768px) {
  .st-toggle, .st-pay-btn { width: auto; min-width: 14rem; }
}

/* Printed (Print under View statement, or the browser's own): the statement and its lines, nothing to tap. */
@media print {
  .top, .bar, .help-line, .toast, .overlay, .st-pay, .st-toggle, .st-print-row { display: none !important; }
  .st-lines[hidden] { display: block !important; }
  body, .main { background: #fff; }
  .main { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .st-due { background: none; padding: .25rem 0; border-bottom: 2px solid #000; border-radius: 0; }
  .st-group { break-inside: avoid; }
  .st-credit, .st-who, .st-practice, .st-sub { color: #000; }
}

/* ---------- Online scheduling: the booking page (public-forms/book.mjs, /book) ----------
   Phone first; the pop-up on the office's website is 560 px wide, so it stays on the phone layout. One look per kind of
   choice: tiles for a visit, pills for a time or a provider, the week strip for a day; amber only for money and test
   mode (.notice), the office's soft colour for everything neutral (.info, .bk-sum, .bk-appt). */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.logo { height: 32px; width: auto; max-width: 120px; border-radius: 6px; background: #fff; padding: 2px; }
/* With a logo the name stays beside it on the narrowest phones, wrapping if it must. */
.logo:not([hidden]) + .brand { flex: 1 1 0; white-space: normal; }
.info {
  background: var(--accent-soft); border-left: 5px solid var(--stripe, var(--accent)); border-radius: 10px;
  padding: .7rem .9rem; margin: 0 0 1rem; color: var(--ink);
}
.btn.danger-outline { width: 100%; background: #fff; color: var(--danger-ink); border-color: var(--danger); }
.btn.danger-outline:hover { background: var(--danger-soft); border-color: var(--danger); }

/* The step header and the summary strip. */
.bk-steps { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: .85rem; color: var(--muted); }
.bk-back {
  min-height: 2.75rem; padding: 0 .5rem 0 0; background: none; border: 0; color: var(--link, var(--accent)); font-size: inherit;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.bk-back, .bk-back-none { min-width: 3.6em; }
.bk-back-none { min-height: 2.75rem; }
.bk-segs { flex: 1; display: flex; gap: 4px; }
.bk-segs span { height: 5px; flex: 1; border-radius: 3px; background: var(--line); }
.bk-segs span.on { background: var(--accent); }
.bk-count { white-space: nowrap; }
.bk-sum { display: grid; gap: .25rem; background: var(--accent-soft); border-radius: 10px; padding: .55rem .75rem; margin: 0 0 .9rem; font-size: .92rem; }
.bk-sum-line { display: flex; align-items: center; gap: .5rem; }
.bk-sum-text { flex: 1; min-width: 0; }
.bk-ch { flex: none; margin-left: auto; min-height: 2rem; padding: 0; font-size: inherit; }
.bk-dot, .bk-hold { color: var(--muted); }
.bk-hold, .bk-nb { white-space: nowrap; }
.bk-card > .err-box { margin-bottom: 1rem; }
.bk-welcome { color: var(--muted); font-size: 1rem; margin: -.25rem 0 1rem; }

/* A visit's tile (release S draws the same tile in Settings: keep these rules whole). */
.bk-type { display: grid; grid-template-columns: 40px 1fr 16px; gap: .7rem; align-items: center; text-align: left; padding: .75rem .8rem; }
.bk-type-main { display: block; min-width: 0; }
.bk-type strong { display: block; }
.bk-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--link, var(--accent)); display: grid; place-items: center; }
.bk-ico svg { width: 22px; height: 22px; }
.bk-ico-letter { font-weight: 800; }
.bk-meta { display: flex; flex-wrap: wrap; gap: .3rem .5rem; color: var(--muted); font-size: .9rem; font-weight: 400; margin-top: .1rem; }
.bk-tag { background: var(--bg); border-radius: 999px; padding: 0 .5rem; font-weight: 600; }
.bk-desc { display: block; font-weight: 400; font-size: .95rem; margin-top: .2rem; }
.bk-chev { width: 16px; height: 16px; color: var(--line-strong); }
.bk-else { margin: .9rem 0 0; }

/* The time step: providers, Soonest, the week, the day's times. */
.bk-sub { color: var(--muted); font-size: .95rem; font-weight: 400; }
h2.bk-sub { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: .9rem 0 .4rem; }
h2.bk-sub:empty { display: none; }
.bk-provs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .9rem; }
.bk-prov {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 3rem; padding: 0 .8rem 0 .35rem; font-size: 1rem;
  border: 2px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; cursor: pointer;
}
.bk-prov[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.bk-init {
  flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent-soft); color: var(--link, var(--accent));
  font-size: .75rem; font-weight: 800; display: grid; place-items: center;
}
.bk-prov[aria-pressed="true"] .bk-init { background: var(--accent); color: var(--on-accent, #fff); }
/* A provider's photo, cropped to a circle; once it shows, the initials beside it go. */
.bk-photo { flex: none; width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; }
.bk-photo:not([hidden]) + .bk-init { display: none; }
/* Whose times these are; Almost done's offer of the patient's own provider. */
.bk-own { margin: 0 0 .75rem; }
.bk-usual { display: block; margin-top: .2rem; color: var(--muted); font-size: .88rem; font-weight: 400; }
.bk-soon { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .55rem .4rem; margin: 0 0 .25rem; }
.bk-soon-chip { flex-direction: column; gap: .05rem; padding: .45rem .4rem; text-align: center; border-color: var(--accent); border-radius: 10px; }
.bk-soon-chip .bk-sub { font-size: .8rem; }
.bk-soon-chip strong { font-size: .95rem; }
.bk-more { justify-content: center; border-style: dashed; color: var(--link, var(--accent)); font-weight: 700; }
.bk-weekhead { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .9rem 0 .4rem; }
.bk-nav { min-width: 3rem; min-height: 3rem; border: 0; background: none; color: var(--link, var(--accent)); font-size: 1.4rem; font-weight: 700; cursor: pointer; border-radius: 10px; }
.bk-nav:disabled { color: var(--line-strong); cursor: default; }
.bk-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.bk-wday {
  display: grid; justify-items: center; align-content: start; gap: .05rem; min-height: 3.4rem; padding: .35rem 0 .3rem; border: 0; border-radius: 10px;
  background: none; color: var(--line-strong); font-size: .75rem; cursor: default;
}
.bk-wday b { font-size: 1.1rem; font-weight: 700; }
.bk-wday.open { background: var(--bg); color: var(--muted); cursor: pointer; }
.bk-wday.open b { color: var(--ink); }
.bk-dotmark { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.bk-wday.on { background: var(--accent); color: var(--on-accent, #fff); }
.bk-wday.on b { color: var(--on-accent, #fff); }
.bk-wday.on .bk-dotmark { background: var(--on-accent, #fff); }
.bk-wday.today b { text-decoration: underline; text-underline-offset: 3px; }
.bk-part { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: .8rem 0 .4rem; }
.bk-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem .4rem; }
.bk-chip { justify-content: center; gap: .25rem; min-height: 3rem; padding: .4rem .15rem; white-space: nowrap; border-radius: 999px; border-color: var(--accent); color: var(--link, var(--accent)); font-weight: 700; font-size: .95rem; }
/* Who "First available" lands on: a badge on the chip's corner, so the time stays on one line at 375 px. */
.bk-chip, .bk-soon-chip { position: relative; }
.bk-chip .bk-init, .bk-soon-chip .bk-init { position: absolute; top: -.6rem; right: -.3rem; width: 1.2rem; height: 1.2rem; font-size: .58rem; box-shadow: 0 0 0 2px #fff; }
/* Larger text on a phone: two times to a row, so each stays on one line. */
@media (max-width: 767px) { html.large .bk-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bk-skel { background: var(--bg); border-color: var(--line); color: transparent; animation: bk-pulse 1.2s ease-in-out infinite; }
.bk-wday.bk-skel { background: var(--bg); }
@keyframes bk-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .bk-skel { animation: none; } }
.err-box ~ * .bk-skel, .err-box ~ .bk-skel { animation: none; }
.bk-none-left { margin: .8rem 0 .5rem; }
.bk-nextopen { width: 100%; }
.bk-monthline { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; margin: .5rem 0 0; }

/* The month, one tap behind the strip. */
.bk-month { margin: .75rem 0 .25rem; }
.bk-month-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .25rem; }
.bk-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; }
.bk-dow { text-align: center; color: var(--muted); font-size: .85rem; font-weight: 600; }
.bk-day { display: flex; align-items: center; justify-content: center; min-height: 2.75rem; border-radius: 10px; color: var(--line-strong); font-size: 1rem; }
.bk-day.bk-none { visibility: hidden; }
button.bk-day { border: 0; background: var(--accent-soft); color: var(--ink); font-weight: 700; position: relative; cursor: pointer; }
button.bk-day::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
button.bk-day.bk-picked { background: var(--accent); color: var(--on-accent, #fff); }
button.bk-day.bk-picked::after { background: var(--on-accent, #fff); }
.bk-day.bk-today { text-decoration: underline; text-underline-offset: 3px; }

/* About you, the code, the card. */
.bk-two { display: grid; }
@media (min-width: 480px) { .bk-two { grid-template-columns: 1fr 1fr; gap: .75rem; } }
.bk-ferr { margin: .3rem 0 0; font-size: .95rem; }
.bk-code { font-size: 1.6rem; letter-spacing: .3em; max-width: 12rem; text-align: center; }
.bk-card-host { margin: 0 0 1rem; }
.bk-card-acts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 1rem; }
.bk-card-acts > :only-child { grid-column: 1 / -1; }
/* The field people never see: a person leaves it empty, a script that fills every box doesn't. */
.bk-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* The review card (Almost done, and the side card on a computer). */
.bk-review { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .92rem; }
.bk-review > div { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem .8rem; border-bottom: 1px solid var(--line); }
.bk-review > div:last-child { border-bottom: 0; }
.bk-review dt { color: var(--muted); margin: 0; }
.bk-review dd { margin: 0; font-weight: 600; text-align: right; }
.bk-review .bk-ch { margin-left: .5rem; font-size: .85rem; }

/* The appointment as a card, and the end screens. */
.bk-appt {
  display: grid; grid-template-columns: 64px 1fr; gap: .75rem; align-items: center; background: var(--accent-soft);
  border-left: 6px solid var(--stripe, var(--accent)); border-radius: 10px; padding: .7rem .8rem; margin: .8rem 0; text-align: left;
}
.bk-date { background: #fff; border-radius: 8px; text-align: center; padding: .3rem 0; line-height: 1.1; }
.bk-date small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.bk-date b { display: block; font-size: 1.5rem; }
.bk-when { font-weight: 700; font-size: 1.1rem; }
.bk-what { color: var(--muted); font-size: .92rem; }
.bk-with { display: flex; align-items: center; gap: .5rem; margin-top: .15rem; }
.bk-done { text-align: center; }
.bk-done .done-mark { margin: .25rem auto .75rem; }
.bk-done .done-mark.off { background: var(--line-strong); }
.bk-place, .bk-done .bk-sub { text-align: left; }
.bk-place p { margin: 0 0 .75rem; }
.bk-map { padding-left: .25rem; }
.bk-acts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 1rem; }
.bk-acts .btn { padding-inline: .4rem; font-size: .95rem; }
.bk-acts > :only-child { grid-column: 1 / -1; }
.bk-cal { display: grid; gap: .4rem; margin: 0 0 1rem; }
.bk-next { text-align: left; margin: 0; padding-left: 1.2rem; }
.bk-next li { margin-bottom: .2rem; }
.bk-close { margin-top: 1rem; }
.bk-site { text-align: center; margin: 1rem 0 0; }
.bk-gate { margin-top: 1.25rem; padding-top: .25rem; border-top: 1px solid var(--line); }
.bk-gate .sub-h { margin-top: .75rem; }

/* iPad and computer: the step, and "Your visit" beside it. The 560 px pop-up is under the breakpoint. */
.bk-layout { display: block; }
.bk-side { display: none; }
.bk-side-h { font-size: 1.1rem; margin: 0 0 .6rem; }
.bk-side .bk-review { margin: 0; }
.bk-side .bk-review > div { display: block; }
.bk-side .bk-review dt { font-size: .85rem; }
.bk-side .bk-review dd { text-align: left; overflow-wrap: anywhere; }
.bk-side-addr { display: block; color: var(--muted); font-weight: 400; font-size: .9rem; }
.bk-unset { color: var(--muted); font-weight: 400; }
@media (min-width: 768px) {
  .bk-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, .8fr); gap: 1.25rem; align-items: start; }
  .bk-side { display: block; position: sticky; top: 1rem; padding: 1.25rem 1.25rem 1.4rem; }
  .bk-chips { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
  .bk-done .btn.primary { width: 100%; }
  .bk-bar { justify-content: flex-end; }
}
