/* The page components (the follow-up screens, the patient window, the list pages, settings' parts): the shared parts
   from the tokens (tokens.css), then each page's own. */

/* ---------- User chip ---------- */
.user-chip { margin-left: auto; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 5px 12px; cursor: pointer; display: flex; align-items: center; gap: 7px; font-size: var(--fs-13); }
/* L1: the Providers page (public/analytics-providers.mjs). */
.pv-filters { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: end; padding: var(--sp-3); margin-bottom: var(--sp-4); }
.pv-filters label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-13); }
.pv-filters input, .pv-filters select { width: auto; min-width: 9em; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.pv-card { padding: var(--sp-3); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.pv-card:focus-visible { outline: 2px solid var(--accent); }
.pv-card.pv-hidden { opacity: .7; }
.pv-big { display: flex; flex-direction: column; }
.pv-line { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-13); }
.pv-detail { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.pv-detail .panel { padding: var(--sp-3); }
.pv-pick { font-size: var(--fs-13); }
@media (max-width: 600px) { .pv-filters input, .pv-filters select { min-width: 0; width: 100%; } .pv-filters label { flex: 1 1 45%; } }
/* L1: a list row's location under All locations (util.mjs locationTag). */
.loc-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: var(--fs-12); font-weight: 400; white-space: nowrap; }
/* L1: the location switcher beside the name, only at a practice with several locations (public/nav.mjs). */
.loc-chip { margin-left: auto; flex: none; }
.loc-chip:not([hidden]) + .user-chip { margin-left: 0; }
.loc-chip select { width: auto; min-height: 0; max-width: 40vw; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 5px 12px; font-size: var(--fs-13); cursor: pointer; }
.loc-chip select option { color: var(--ink, #1a1a1a); background: var(--card, #fff); }
/* R2: how current this page's data is, only on an adapter that isn't live (public/nav.mjs). */
.asof-chip { margin-left: auto; flex: none; color: #fff; opacity: .85; font-size: var(--fs-13); white-space: nowrap; text-decoration: none; }
.asof-chip[href]:hover { opacity: 1; text-decoration: underline; }
.asof-chip:not([hidden]) ~ .loc-chip { margin-left: 0; }
.asof-chip:not([hidden]) ~ .user-chip { margin-left: 0; }
/* R3-7: Refresh beside the as-of chip */
.asof-refresh { flex: none; margin-left: 6px; background: none; border: 1px solid rgba(255,255,255,.5); border-radius: 4px; color: #fff; font-size: var(--fs-13); padding: 1px 8px; cursor: pointer; }
.asof-refresh:hover:not(:disabled) { border-color: #fff; }
.asof-refresh:disabled { opacity: .6; cursor: default; }
.user-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd08e; }
.user-chip.unset { background: #f5b83d; color: #3a2b00; border-color: #f5b83d; font-weight: 600; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.user-pick { padding: 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 600; }
.user-pick:hover, .user-pick.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Shared ---------- */
.wide-page { max-width: 1500px; margin: 0 auto; }
.today-page { max-width: 960px; margin: 0 auto; }
.popover .lbl, .form-body .lbl { display: block; font-size: var(--fs-12); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #4b5563; margin: 0 0 6px; }
.sub { color: var(--muted); font-size: var(--fs-13); }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-align: left; }
.link:hover { text-decoration: underline; }
/* A status badge: one shape everywhere (a pill, 12 px semibold), grey by default; .green good, .amber due soon, .red
   overdue or wrong, .blue and .teal information. Its words always say it: never the colour alone. */
.badge { display: inline-block; padding: 1px var(--sp-2); border-radius: var(--r-pill); background: var(--neutral-soft); color: var(--neutral-ink); font-size: var(--fs-12); font-weight: 600; line-height: 1.5; white-space: nowrap; border: 1px solid color-mix(in srgb, var(--neutral) 22%, transparent); }
.badge.green { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); color: var(--good-ink); }
.badge.red { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad-ink); }
.badge.amber { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 70%, transparent); color: var(--warn-ink); }
.badge.small { font-size: var(--fs-11); padding: 0 6px; }
.date-chip { display: inline-block; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #f7f8fa; font-size: var(--fs-13); white-space: nowrap; }
.flag { color: #c77700; font-size: var(--fs-13); font-weight: 600; }
.flag-note { color: #c77700; margin-top: 2px; }
.none { color: #e5484d; }
.phones { white-space: nowrap; letter-spacing: -2px; }
.phones .plus { letter-spacing: 0; margin-left: 4px; background: #17a86f; color: #fff; border-radius: 999px; font-size: var(--fs-11); font-weight: 700; padding: 1px 6px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; background: #1d7a46; color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: 420px; }
.toast.error { background: var(--danger); }
.error-inline { color: var(--danger); font-size: var(--fs-12); margin-top: 4px; }

/* ---------- Unscheduled list ---------- */
.mode { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.mode .lbl { margin: 0; flex-basis: 100%; }
.mode label { font-size: var(--fs-15); display: flex; gap: 5px; align-items: center; }
.money-in { display: flex; }
.money-in span { border: 1px solid var(--line-strong); border-right: 0; border-radius: 6px 0 0 6px; padding: 8px 10px; background: #f7f8fa; }
.money-in input { border-radius: 0 6px 6px 0; }
.ms { position: relative; }
.ms summary { list-style: none; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 30px 8px 10px; background: #fff; cursor: pointer; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms summary::-webkit-details-marker { display: none; }
.ms summary::after { content: "\25BE"; position: absolute; right: 10px; top: 8px; color: var(--muted); }
.ms-pop { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; min-width: 240px; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px; }
.ms-list { max-height: 260px; overflow: auto; }
.ms-list label { display: flex; gap: 8px; padding: 5px 6px; border-radius: 5px; cursor: pointer; font-size: var(--fs-15); }
.ms-list label:hover { background: var(--accent-soft); }
.ms-search { margin-bottom: 6px; }
.list-summary { padding: 12px 16px; color: var(--muted); font-size: var(--fs-15); }
.list-summary.right { text-align: right; }
.list-cap { margin: 0; padding: 10px 16px; background: #fff7e6; border-bottom: 1px solid #f3dfb4; color: #6b4b00; font-size: var(--fs-15); }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
table.data th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-strong); background: #f9fafb; vertical-align: bottom; white-space: nowrap; }
table.data th .sub { font-weight: 400; font-size: var(--fs-11); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data td.r { text-align: right; }
table.data tbody tr:hover { background: #fafbfd; }
table.data.compact td, table.data.compact th { padding: 7px 10px; font-size: var(--fs-13); }
.sort { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.sort.on { color: var(--accent); }
.note-cell { max-width: 520px; white-space: pre-line; }
.popover { position: absolute; z-index: 60; width: 280px; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.16); padding: 14px; display: grid; gap: 10px; }
.popover .row { display: flex; gap: 8px; }
.popover .error-inline { margin: 0; }
@media screen and (max-width: 640px) { .popover { width: calc(100vw - 16px); max-width: 320px; } }

/* ---------- Today ---------- */
.today-card { padding: 20px 22px; }
.today-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.today-head h2 { font-size: var(--fs-22); font-weight: 400; margin: 0; }
.today-head .who { display: flex; gap: 8px; align-items: center; }
.others { background: #eceef1; border-radius: 999px; font-size: var(--fs-11); padding: 1px 7px; cursor: help; }
.progress-row { display: flex; justify-content: space-between; font-size: var(--fs-13); color: var(--muted); }
.progress { height: 6px; background: #e6e8eb; border-radius: 99px; margin: 6px 0 18px; overflow: hidden; }
.progress div { height: 100%; background: #19b48a; border-radius: 99px; transition: width .3s; }
table.data.today .chk { width: 36px; }
table.data.today tr.done { background: #fbfcfb; }

/* ---------- Modal / patient window ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(17, 24, 39, .45); display: flex; justify-content: center; align-items: flex-start; padding: 24px 16px; overflow-y: auto; }
.modal { background: var(--bg); border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
.modal:focus { outline: none; }
/* dialog.mjs: Diastema's own confirm, notice and prompt in place of the browser's */
.modal.dialog { max-width: 440px; margin-top: 10vh; }
/* The one place a danger button is filled red: the confirm window's OK on a removal. */
.modal.dialog .modal-foot .btn.danger { background: var(--bad-ink); border-color: var(--bad-ink); color: #fff; }
.modal.dialog .modal-foot .btn.danger:hover { background: color-mix(in srgb, var(--bad-ink) 88%, #000); }
.dialog-body p { margin: 0; line-height: 1.45; }
.dialog-input { width: 100%; box-sizing: border-box; }
#fe-nt-err:empty, #lib-ft-err:empty { display: none; }
.char-count { display: block; margin-top: 2px; text-align: right; font-size: var(--fs-12); color: var(--muted); }
.char-count.full { color: var(--danger); }
.char-count[hidden] { display: none; }
/* A patient search list must be able to hang past the bottom of the window, so round the ends instead of clipping. */
.modal:has(.pat-picker) { overflow: visible; }
.modal:has(.pat-picker) > .modal-head { border-radius: 12px 12px 0 0; }
.modal:has(.pat-picker) > .modal-foot { border-radius: 0 0 12px 12px; }
.modal.wide { max-width: 940px; }
.modal.wide:has(#ad-table) { max-width: 1240px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: var(--fs-17); }
.modal-head p { margin: 2px 0 0; font-size: var(--fs-13); opacity: .85; }
.icon-btn { background: rgba(255,255,255,.2); border: 0; color: inherit; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: var(--fs-15); }
.modal-head:not(.blue) .icon-btn { background: #eceef1; }
.modal-body { padding: 16px; display: grid; gap: 14px; }
/* The follow-up window (public/followup.mjs openPatientWindow): the app's tokens (public/styles.css :root) like every
   other dialog, a plain head and the accent's buttons (the to-do list, 2026-10-20: it had a blue head and green
   buttons of its own). Status badges keep their meaning colors. */
/* A card: white, 1 px line, 10 px radius, 16 px padding; a .card-head with its 17 px title, an optional one-line .sub,
   at most one action. */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-4); box-shadow: var(--shadow-card); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-2) var(--sp-3); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; font-size: var(--fs-17); }
.card-head .sub { margin: 2px 0 0; }
.pat-top { display: flex; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; font-size: var(--fs-26); flex: none; }
.pat-name { font-size: var(--fs-17); font-weight: 700; margin-bottom: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pill { background: var(--bg); border-radius: 999px; padding: 3px 10px; font-size: var(--fs-13); color: var(--ink); text-decoration: none; }
.pill:hover { background: var(--accent-soft); }
.kv { display: flex; justify-content: space-between; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: var(--fs-15); }
.count-pill { border: 1px solid var(--line-strong); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 12px; font-size: var(--fs-12); font-weight: 700; text-transform: uppercase; }
.fu-state { font-size: var(--fs-15); margin-bottom: 12px; }
.action-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.attempt-form { padding: 0; overflow: hidden; }
.form-head { display: flex; gap: 12px; align-items: center; padding: 14px 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
.form-head h3 { margin: 0; font-size: var(--fs-15); }
.form-head p { margin: 0; }
.form-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: var(--fs-17); }
.form-body { padding: 16px 18px; display: grid; gap: 8px; }
.form-body .lbl { margin-top: 6px; text-transform: none; font-size: var(--fs-13); letter-spacing: 0; }
.next-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.next-row input { max-width: 180px; }
.form-foot { display: flex; justify-content: center; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--bg); }
.tabs-card { padding: 0; overflow: hidden; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 10px 10px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: var(--fs-13); }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); background: var(--card); border-radius: 6px 6px 0 0; }
.tab .n { background: var(--accent); color: #fff; border-radius: 999px; font-size: var(--fs-11); padding: 0 6px; }
.tab .n.zero { background: var(--line-strong); color: var(--ink); }
.tab-body { padding: 8px 12px 12px; overflow-x: auto; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 10px; font-size: var(--fs-13); color: var(--muted); }

/* ---------- Settings: follow-ups ---------- */
.interval { display: inline-flex; gap: 6px; }
.interval input { width: 72px; }
.interval select { width: 110px; }
.interval-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.interval-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.interval-list .num { width: 24px; height: 24px; border-radius: 50%; background: #6d5bd0; color: #fff; display: grid; place-items: center; font-size: var(--fs-12); font-weight: 700; }
.status-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.status-table td { padding: 4px 6px 4px 0; }
.status-table td:last-child { width: 1%; }
.status-table .st-types { white-space: nowrap; }
.status-table .st-types .check { display: inline-flex; margin: 0 10px 0 0; }
@media print { .user-chip, .toast, .modal-backdrop { display: none !important; } }

/* ---------- Feature switches: a feature on for testing, and a page that isn't turned on ---------- */
.preview-tag { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; border: 1px solid currentColor; font-size: var(--fs-11);
  font-weight: 700; letter-spacing: .03em; text-transform: uppercase; vertical-align: 1px; opacity: .85; }
.empty-state { text-align: center; padding: 40px var(--sp-6); }
.empty-state h2 { margin: 0 0 8px; }

/* ---------- Settings: More settings, payment option cards, and the Office page's cards ---------- */
.more-settings { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 4px; }
.more-settings > summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--accent); }
.more-settings > .help { color: var(--muted); font-size: var(--fs-13); margin: 0 0 4px; }
.more-settings h3 { font-size: var(--fs-15); margin: 20px 0 0; }
.option-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 2px var(--sp-4); margin: 14px 0; box-shadow: var(--shadow-card); }
.option-card h3 { font-size: var(--fs-17); margin: var(--sp-3) 0 0; }
.office-card { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; background: var(--card); }
.office-card > summary { cursor: pointer; padding: 12px 16px; display: flex; gap: 6px 12px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.office-card > summary::-webkit-details-marker { display: none; }
.office-card > summary::after { content: '›'; margin-left: auto; color: var(--muted); font-size: var(--fs-17); line-height: 1; transition: transform .15s; }
.office-card[open] > summary::after { transform: rotate(90deg); }
.office-card .oc-title { font-weight: 600; }
.office-card .oc-line { color: var(--muted); font-size: var(--fs-13); }
.office-card .oc-body { border-top: 1px solid var(--line); padding-bottom: 8px; }
/* Office → Support: a long data folder path breaks anywhere rather than widening the page on a phone (UI patch) */
table.about td { overflow-wrap: anywhere; }
.office-card .settings-section h2 { font-size: var(--fs-15); }
.office-card .settings-section h3 { font-size: var(--fs-15); margin: 18px 0 6px; }
.office-card.no-title .settings-section > h2:first-child { display: none; }

/* ---------- Tasks ---------- */
/* A count of things waiting on you (Tasks', Texts'): red, on the rail item (styles.css places it). */
.nav-badge { background: var(--bad); color: #fff; border-radius: var(--r-pill); font-size: var(--fs-11); font-weight: 700; line-height: 1.45; padding: 0 6px; min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.tasks-page { max-width: 1000px; margin: 0 auto; }
/* The title row: the page's name and its context on the left, at most one primary button on the right; the same
   margins on every page. */
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.page-head h1.page { margin: 0; }
.page-head > .sub, .page-head > div > .sub { margin: 2px 0 0; }
/* A page's views (.seg) directly under its title, left-aligned, then its filter bar. */
.page-views { margin-bottom: var(--sp-3); }
/* The view switcher, one look on every page: a grey track, the chosen view a white pill. Whole names wrap to more rows
   where they don't fit on one, never past the edge; .wrap makes it a block (the Library's and Compliance's parts). */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; background: color-mix(in srgb, var(--line-strong) 45%, var(--bg)); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg.wrap { display: flex; flex-wrap: wrap; width: fit-content; }
.seg a, .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 14px; border: 0; border-radius: 8px; background: none; text-decoration: none; color: var(--muted); font: inherit; font-weight: 600; font-size: var(--fs-15); white-space: nowrap; cursor: pointer; }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg a.on, .seg a.active, .seg a[aria-current="page"], .seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-card); }
.seg .sub { font-weight: 400; }
/* On a phone the views wrap to rows, whole names only, every one in sight (the UI patch's rule, now the part's). */
@media screen and (max-width: 640px) {
  .seg { display: flex; flex-wrap: wrap; }
  .seg a, .seg button { flex: 1 1 auto; padding: var(--sp-2) 10px; }
}

/* A filter chip (Release 2 puts it to work): a rounded outline; filled while on; an x when it can be removed; a dashed
   "+ Filter" (.chip.add). */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--card); color: var(--ink); font: inherit; font-size: var(--fs-13); font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }
.chip .x { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: -6px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; font: inherit; line-height: 1; cursor: pointer; }
.chip .x:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.chip.add { border-style: dashed; color: var(--muted); background: transparent; }

/* The filter bar (UI release 2 B1, public/filterbar.mjs): [search] [chips] [+ Filter] … count, under the views. The
   full form opens in a popover under the bar; on a phone it is a sheet from the bottom over a scrim. No Apply button. */
.filter-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.filter-bar .fb-search { flex: 0 1 260px; min-width: 0; width: auto; }
.fb-chips { display: contents; }
.fb-chip { max-width: 100%; white-space: normal; text-align: left; }
.fb-count { margin-left: auto; min-width: 0; color: var(--muted); font-size: var(--fs-13); text-align: right; font-variant-numeric: tabular-nums; }
.fb-count strong { color: var(--ink); }
.fb-count .fb-stale { opacity: .6; }
.fb-sort { display: none; width: auto; min-height: 32px; padding: 4px 8px; font-size: var(--fs-13); }
.fb-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(560px, 100%); max-height: min(70vh, 640px); overflow: auto;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: 0 10px 30px rgba(16, 24, 40, .16); }
.fb-pop[hidden] { display: none; }
.fb-pop-head, .fb-pop-foot { position: sticky; z-index: 1; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); background: var(--card); }
.fb-pop-head { top: 0; justify-content: space-between; border-bottom: 1px solid var(--line); }
.fb-pop-foot { bottom: 0; border-top: 1px solid var(--line); }
.fb-pop-foot .spacer { flex: 1; }
.fb-pop .filter-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3) var(--sp-4); padding: var(--sp-4); margin: 0; }
.fb-pop .filter-panel .wide { grid-column: 1 / -1; }
.fb-pop .filter-panel .lbl { text-transform: none; letter-spacing: 0; font-size: var(--fs-13); font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.fb-pop .ms-pop { position: static; min-width: 0; margin-top: 4px; box-shadow: none; }
/* The phone's sheet (mountFilterBar adds .fb-sheet under SHEET_BELOW). */
.fb-pop.fb-sheet { position: fixed; z-index: 66; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 85vh; border: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-sheet); padding-bottom: env(safe-area-inset-bottom); animation: sheet-up .18s ease-out; }
.fb-pop.fb-sheet .filter-panel { grid-template-columns: minmax(0, 1fr); }
.fb-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(17, 24, 39, .45); }
@media (prefers-reduced-motion: reduce) { .fb-pop.fb-sheet { animation: none; } }
@media screen and (max-width: 640px) {
  .filter-bar .fb-search { flex: 1 1 100%; }
  .fb-count { flex-basis: 100%; margin-left: 0; white-space: normal; }
}
.task-panel { padding: 6px 16px 14px; }
h3.task-group { font-size: var(--fs-13); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 4px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task.high { box-shadow: inset 3px 0 0 #e5484d; padding-left: 10px; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-check input { width: 18px; height: 18px; margin-top: 2px; cursor: pointer; }
.task-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.task-title { font-weight: 600; color: var(--ink); }
.task-notes { flex-basis: 100%; }
.task-pats { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.pat-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); border: 1px solid #cfd9e8; border-radius: 999px; padding: 2px 10px; font-size: var(--fs-13); cursor: pointer; font-family: inherit; }
.pat-tag button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: var(--fs-11); }
.subtask-list { flex-basis: 100%; list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px; font-size: var(--fs-13); }
.subtask-list label { display: inline-flex; gap: 6px; align-items: baseline; cursor: pointer; overflow-wrap: anywhere; }
.subtask-list input { margin: 0; cursor: pointer; }
.subtask-list li.done span[dir] { text-decoration: line-through; color: var(--muted); }
.task-comments-inline { flex-basis: 100%; display: grid; gap: 6px; margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--line-strong); font-size: var(--fs-13); }
.task-comment-inline > div { white-space: pre-line; overflow-wrap: anywhere; unicode-bidi: isolate; }
.task-comments-inline .link { justify-self: start; }
.subtask-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.subtask-edit li { display: flex; gap: 6px; align-items: center; }
.subtask-edit input[type="text"] { flex: 1; min-width: 0; }
.subtask-add { display: flex; gap: 8px; }
.subtask-add input { flex: 1; min-width: 0; }
.task-side { text-align: right; flex: none; display: grid; gap: 3px; justify-items: end; }
.badge.prio { background: #fde8e8; border-color: #f5b5b5; color: #b42318; font-size: var(--fs-11); }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 12px 16px; background: #fff; border-top: 1px solid var(--line); }
.modal-foot .spacer { flex: 1; }
.task-form { display: grid; gap: 6px; }
.flbl { font-weight: 600; font-size: var(--fs-13); margin-top: 6px; }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tk-grid .flbl { display: block; margin-bottom: 4px; }
.pat-picker { position: relative; display: grid; gap: 6px; }
.pat-results { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow: auto; }
.pat-results button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; cursor: pointer; font: inherit; }
.pat-results button:hover { background: var(--accent-soft); }
.comments { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.comment-text { white-space: pre-line; margin-top: 2px; }
.comment-add { display: flex; gap: 8px; align-items: flex-end; }
/* Long unbroken text (a 300-character word, a pasted link) wraps instead of pushing the page wide, and text in a
   right-to-left language keeps to itself (dir="auto" on the element), QA T1, T9. */
.task-title, .task-notes, .comment-text, .note-cell, .dnf-note, .dnf-box, .pat-tag, .pat-name, .gs-item, .card-title .link {
  overflow-wrap: anywhere; unicode-bidi: isolate; }
.task-title { max-width: 100%; text-align: start; }
.pat-tag { max-width: 100%; }

/* ---------- Analytics ---------- */
.analytics-page { max-width: 1300px; margin: 0 auto; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filter-row label { display: grid; gap: 4px; }
.filter-row select, .filter-row input { width: auto; min-width: 150px; }
.range-note { margin-left: auto; padding-bottom: 8px; }
.a-body { transition: opacity .15s; }
.a-body.loading { opacity: .5; pointer-events: none; }
/* Number tiles (Analytics; GapCheck in Release 2): a label, the number, how it moved. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.tile { padding: 14px var(--sp-4); display: grid; gap: var(--sp-1); align-content: start; }
.tile-label { font-size: var(--fs-13); color: var(--muted); font-weight: 600; }
.tile-value { font-size: var(--fs-26); font-weight: 650; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
/* On a phone, two across and a little smaller (the part's own rule; it was mobile.css's Analytics fix). */
@media screen and (max-width: 640px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
  .tile { padding: 10px 12px; }
  .tile-value { font-size: var(--fs-22); }
  .tile .sub { font-size: var(--fs-12); }
}
.delta { font-size: var(--fs-13); font-weight: 600; color: var(--muted); }
.delta.up-good { color: var(--good-ink); }
.delta.down-bad { color: var(--bad-ink); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.chart-card { padding: 14px 16px; min-width: 0; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card.span2 { grid-column: span 2; }
/* Patients: bar chart and active-patient line side by side on wide screens */
@media (min-width: 1100px) {
  .chart-card.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 28px; align-items: start; }
  .chart-card.split .chart-head { grid-column: 1 / -1; }
  .chart-card.split .sub-chart { margin-top: 0; padding-top: 0; border-top: 0; padding-left: 24px; border-left: 1px solid var(--line); }
  .chart-card.split .sub-chart h3 { margin-bottom: 10px; }
  .chart-card.split:has(.sub-chart[hidden]) > .chart { grid-column: 1 / -1; } /* table view uses the full width */
}
@media (max-width: 900px) { .chart-card.span2 { grid-column: 1 / -1; } }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.chart-head h2 { font-size: var(--fs-17); margin: 0; }
.chart-head p { margin: 2px 0 0; }
.chart-legend { display: flex; gap: 16px; font-size: var(--fs-13); color: #52514e; margin: 4px 0 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-legend .key.line { height: 3px; width: 16px; border-radius: 2px; }
.chart-plot { position: relative; width: 100%; }
.chart-plot svg { display: block; overflow: visible; }
.chart-plot .grid { stroke: #e1e0d9; stroke-width: 1; }
.chart-plot .axis { stroke: #c3c2b7; stroke-width: 1; }
.chart-plot .tick { fill: #898781; font-size: var(--fs-11); font-variant-numeric: tabular-nums; }
.chart-plot .cross { fill: rgba(11, 11, 11, .05); }
.chart-plot .val { fill: #52514e; font-size: var(--fs-12); font-weight: 600; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: #fff; border: 1px solid rgba(11,11,11,.12); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 8px 10px; font-size: var(--fs-13); min-width: 150px; }
.tip-head { color: #52514e; font-weight: 600; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tip-row strong { color: #0b0b0b; }
.tip-row span:last-child { color: #52514e; }
.tip-key { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.tip-part { padding-left: 16px; color: #52514e; font-size: var(--fs-12); }
.tip-swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-legend .stack-key { display: inline-flex; gap: 8px; align-items: center; }
.chart-legend .stack-key strong { color: #0b0b0b; font-weight: 600; }
.chart-legend .stack-key > span { display: inline-flex; align-items: center; gap: 4px; }
.chart-card td.num { font-variant-numeric: tabular-nums; }
.footnote { margin-top: 16px; }
.sub-chart { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.sub-chart h3 { font-size: var(--fs-15); margin: 0 0 4px; }
.claims td, .claims th { white-space: nowrap; }
.head-btns { display: flex; gap: 6px; flex: none; }
.ad-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ad-tier { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.ad-tier.dim { opacity: .45; }
.fu-late { color: #b42318; font-weight: 600; }
.tier-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-12); font-weight: 600; border: 1px solid var(--line-strong); color: #3f4650; background: #f5f6f8; }
.tier-badge.t1 { background: #e8f0fb; border-color: #b7d3f6; color: #184f95; }
.tier-badge.t2 { background: #1c5cab; border-color: #1c5cab; color: #fff; }
table.data tfoot td { border-top: 2px solid var(--line-strong); border-bottom: 0; background: #fafbfc; }
@media (max-width: 700px) { .ad-summary { grid-template-columns: 1fr; } }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 6px 0; }
.donut-plot { width: 200px; flex: none; }
.donut-plot .slice { cursor: default; transition: opacity .12s; outline: none; }
.donut-plot .slice.dim { opacity: .45; }
.donut-plot .slice:focus-visible { stroke: #0b0b0b; }
.donut-value { font-size: var(--fs-22); font-weight: 650; fill: #0b0b0b; }
.donut-label { font-size: var(--fs-12); fill: #52514e; }
.donut-legend { display: grid; gap: 8px; flex: 1; min-width: 220px; }
.donut-row { display: grid; grid-template-columns: 12px 1fr auto 40px; column-gap: 8px; align-items: baseline; font-size: var(--fs-13); }
.donut-row .key { width: 12px; height: 12px; border-radius: 3px; align-self: center; }
.donut-row .name { color: #52514e; }
.donut-row strong { font-variant-numeric: tabular-nums; color: #0b0b0b; }
.donut-row .sub { text-align: right; }
.donut-row .detail { grid-column: 2 / -1; text-align: left; font-size: var(--fs-12); }
.claims-dd { margin-top: 4px; }
.claims-dd summary { cursor: pointer; font-weight: 600; font-size: var(--fs-15); padding: 6px 0; }
.claims-dd[open] summary { margin-bottom: 6px; }
#aging-list .link { margin-top: 8px; }
#aging-list.sub-chart { padding-top: 6px; }
.user-checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
@media (max-width: 700px) { .chart-grid { grid-template-columns: 1fr; } .range-note { margin-left: 0; } }

/* Follow-Up Plan dropdown button */
.plan-dd { background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; cursor: pointer; font: inherit; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.plan-dd:hover { border-color: var(--line-strong); background: #f7f8fa; }
.plan-dd.chip { border-color: var(--line-strong); background: #f7f8fa; color: var(--ink); font-size: var(--fs-13); padding: 4px 10px; }
.popover hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }

/* Sign-in */
body.signed-out main, body.signed-out .topbar, body.signed-out #main-nav, body.signed-out #bottom-nav { display: none; }
/* The skip link: out of sight until Tab reaches it (public/app.js focuses the page). */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 200; background: #fff; color: var(--ink); border: 2px solid var(--accent); border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.skip-link:focus { top: 8px; }
body.signed-out .skip-link { display: none; }
#app:focus, #app h1[tabindex="-1"]:focus, #app h2[tabindex="-1"]:focus { outline: none; }
.signin-screen { position: fixed; inset: 0; z-index: 100; background: #eef1f5; display: flex; justify-content: center; align-items: flex-start; padding: 24px 16px; overflow-y: auto; }
.signin, .signin * { box-sizing: border-box; }
.signin { width: 100%; max-width: 560px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(17,24,39,.12); padding: 28px; display: grid; gap: 14px; }
.signin-brand { font-weight: 700; color: #3b5170; letter-spacing: .02em; }
.signin h1 { margin: 0; font-size: var(--fs-22); }
.signin .back { justify-self: start; }
.signin form { display: grid; gap: 10px; max-width: 300px; width: 100%; justify-self: center; }
.signin .user-pick { display: grid; gap: 2px; font-size: var(--fs-15); padding: 16px 12px; }
.signin .user-pick:disabled, .signin .user-pick.no-pin { opacity: .6; cursor: default; }
.signin .user-pick .sub { font-weight: 400; font-size: var(--fs-12); }
.pin-input { font-size: var(--fs-26); letter-spacing: .4em; text-align: center; padding: 10px; }
/* The PIN pad (public/pinpad.mjs): the sign-in page and Present mode's Staff drawer. Keys at least 56px tall for a
   thumb, three across in at most 300px so the pad fits a phone. */
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; width: 100%; max-width: 300px; justify-self: center; }
.pinpad .pinpad-key { font: inherit; font-size: var(--fs-22); font-weight: 600; min-height: 56px; padding: 8px 0; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--card); color: var(--ink); cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.pinpad .pinpad-key:hover { background: var(--bg); }
.pinpad .pinpad-key:active { background: var(--accent-soft); }
.pinpad .pinpad-key:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pinpad .pinpad-word { font-size: var(--fs-15); color: var(--muted); }
.signin .error:empty { display: none; }
.user-chip .role { opacity: .75; font-size: var(--fs-12); }
/* The name chip never shrinks onto two lines (the role goes on a phone, mobile.css). */
.user-chip { flex: none; white-space: nowrap; }
/* The name menu sits inside the top bar (auth.mjs places it after the name), so it would take the bar's white text
   onto its own white card (buttons inherit their color: styles.css): it sets the page's ink itself. */
.user-menu { width: 200px; padding: 6px; gap: 2px; background: var(--card); color: var(--ink); }
.menu-item { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 6px; font: inherit; color: var(--ink); cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg); }
.pin-form { display: grid; gap: 8px; max-width: 320px; }
.pin-form .error:empty { display: none; }

/* S1: the sign-in page's name search (over twelve names) and Forgot your PIN? */
.signin-find { width: 100%; margin: 0 0 12px; }
#si-forgot { margin-top: 12px; }
.history-body { max-height: 70vh; overflow: auto; }

/* Settings → People */
/* S1: the people toolbar, its search and filters, the staff switches and the pickers' lists. */
.people-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.people-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.people-filters input[type="search"] { width: 180px; }
.check-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; margin-bottom: 8px; }
#ac-staff .check-field { display: flex; gap: 10px; align-items: flex-start; }
#ac-staff .check-field .help { display: block; }
.access-page h3 { margin: 22px 0 8px; font-size: var(--fs-15); }
.access-page table.data { margin-bottom: 6px; }
.access-page td.c, .access-page th.c { text-align: center; width: 110px; }
.access-page tr.muted td { color: var(--muted); }
.access-page td .btn.small + .btn.small { margin-left: 6px; }
@media (max-width: 640px) { .signin { padding: 20px; } .access-page td.c, .access-page th.c { width: auto; } }

/* Do not follow up */
.badge.dnf { background: #fdecec; color: #9b1c1c; border-color: #f5c2c2; }
.dnf-note { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.dnf-box { background: #fdf6f6; border: 1px solid #f5d5d5; border-radius: 8px; padding: 8px 10px; font-size: var(--fs-13); }
.dnf-box > div:not(.sub) { white-space: pre-wrap; margin-top: 2px; }
.resume-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.resume-row .lbl { margin: 0; }
.dnf-link { color: #9b1c1c; justify-self: start; }
.dnf-btn { color: #9b1c1c; }
.badge.teamio { background: #eef4ff; border-color: #cddcfb; color: #2c4f9e; font-size: var(--fs-11); }

/* First-run setup and Settings → Office → Open Dental */
.signin.setup { max-width: 640px; }
.setup-form { display: grid; gap: 8px; max-width: none !important; justify-self: stretch !important; }
.setup-form .lbl { margin-top: 6px; font-weight: 600; }
.setup-form .help { color: var(--muted); font-size: var(--fs-13); margin-top: -2px; }
/* R2: setup step 1's practice management system choice */
.pms-choice { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.pms-choice .lbl { font-weight: 600; padding: 0; }
.pms-choice .check.muted { color: var(--muted); }
.setup-form .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.settings-section .setup-form { max-width: 560px; }
.steps { display: flex; gap: 14px; font-size: var(--fs-13); color: var(--muted); flex-wrap: wrap; }
.steps .on { color: var(--ink); font-weight: 700; }
.steps .done { color: var(--ok); }
.checks { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.checks .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; font-size: var(--fs-13); }
.checks .pass .mark { background: #e3f5ec; color: #147a50; }
.checks .fail .mark { background: #fdecec; color: #b42318; }
.checks .warn .mark { background: #fff4de; color: #9a6200; }
.checks .info .mark { background: #eef1f5; color: #52514e; }
table.about th { width: 180px; text-align: left; vertical-align: top; }

/* Updates (Settings → Office → Updates) */
.release-notes { white-space: pre-wrap; background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: var(--fs-13); margin: 6px 0; }
.update-settings { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: var(--fs-13); }
.update-settings select { width: auto; }
#updates p { margin: 4px 0; }
/* Attention dots (public/attention.mjs): one look everywhere, amber = due soon or needs a look, red = overdue or
   wrong. On a top tab, a settings or Compliance menu item, an Office card's title, a card or a row inside a page. */
.att-dot::after { content: ''; display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.att-amber::after { background: var(--att-amber); }
.att-red::after { background: var(--att-red); }
/* A card or a section marked as a whole: the dot sits in its top corner instead of after its last line. */
.att-block.att-dot { position: relative; }
.att-block.att-dot::after { position: absolute; top: 10px; right: 10px; margin: 0; }
/* The exact setting a dot is about ([data-att-spot]): a box around it and its bar (the reason, Ignore) over it, so on a
   long settings page staff see which part the dot means. Ignored: a quiet dashed box, out of the menus (stable
   touch-ups, 2026-11-07). */
.att-spot { outline: 2px solid var(--att-amber); outline-offset: 4px; border-radius: 6px; background: color-mix(in srgb, var(--att-amber) 9%, transparent); }
.att-spot-red { outline-color: var(--att-red); background: color-mix(in srgb, var(--att-red) 7%, transparent); }
.att-spot-ignored { outline: 1px dashed var(--line-strong); background: transparent; }
.att-spot-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; font-size: var(--fs-13); line-height: 1.35; white-space: normal; }
.att-spot-why { font-weight: 700; color: color-mix(in srgb, var(--att-amber) 55%, var(--ink)); }
.att-spot-red .att-spot-why { color: color-mix(in srgb, var(--att-red) 70%, var(--ink)); }
.att-spot-ignored .att-spot-why { color: var(--muted); font-weight: 600; }
.att-spot-off { color: var(--muted); }
.att-spot-bar .att-ignore { font-size: var(--fs-13); color: var(--accent); text-decoration: underline; padding: 0; background: none; border: 0; cursor: pointer; }
td.att-spot, dd.att-spot { outline-offset: -2px; padding: 4px 6px; }

/* GapCheck (the X-ray check) */
.x-tiles .tile .sub { line-height: 1.35; }
.x-tile-bad .tile-value { color: var(--bad-ink); }
.xray-table tr.x-due td:first-child { box-shadow: inset 3px 0 0 #1d9e5b; }
.xray-table tr.x-notcovered td:first-child { box-shadow: inset 3px 0 0 #e5484d; }
.near-miss { color: #9a6200; font-weight: 600; }
.pa-ok { color: #147a50; font-weight: 600; }
.pa-over { color: #b42318; font-weight: 600; }
.pa-src { font-size: var(--fs-12); }
.xray-table td.x-fix { min-width: 150px; }
.xray-table td.x-fix .btn { white-space: nowrap; }
.x-roi { margin: 4px 0 12px; padding: 10px 14px; border: 1px solid var(--line-strong, #d9dde3); border-radius: 8px; background: #fff; }
.x-roi-nums { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 4px 0; }
.x-roi-nums strong { font-size: var(--fs-22); display: block; }
.x-tabs { margin: 0 0 12px; }
.x-removed { margin-bottom: 6px; font-size: var(--fs-13); }

/* Settings → Missed calls */
.calls-page h3 { margin: 22px 0 6px; font-size: var(--fs-17); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font-family: ui-monospace, monospace; font-size: var(--fs-13); }
pre.raw { background: #f6f7f9; border: 1px solid var(--line, #e3e6ea); border-radius: 6px; padding: 10px; max-height: 260px; overflow: auto; font-size: var(--fs-12); white-space: pre-wrap; word-break: break-all; }

/* ---------- Top bar patient search ---------- */
/* UI release 1: the top bar holds the brand, this box and the name, nothing else; on a phone the box is an icon
   (.gs-open) that opens it the full width of the bar (mobile.css). */
.gsearch { position: relative; flex: 0 1 420px; min-width: 140px; }
.gs-open { display: none; place-items: center; flex: none; width: var(--control-h); height: var(--control-h); padding: 0; border: 1px solid rgba(255,255,255,.25); border-radius: var(--r-sm); background: rgba(255,255,255,.14); color: var(--accent-ink); cursor: pointer; }
.gsearch input { width: 100%; box-sizing: border-box; padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.14); color: #fff; font: inherit; font-size: var(--fs-15); }
.gsearch input::placeholder { color: rgba(255,255,255,.75); }
.gsearch input:focus { outline: none; background: #fff; color: var(--ink); border-color: #fff; }
.gsearch input:focus::placeholder { color: var(--muted); }
.gs-results { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: min(420px, 92vw); max-height: 60vh; overflow: auto; background: #fff; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 4px; }
.gs-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 8px 10px; cursor: pointer; font: inherit; color: inherit; }
.gs-item.on, .gs-item:hover { background: var(--accent-soft); }
.gs-msg { padding: 10px 12px; color: var(--muted); font-size: var(--fs-15); }

/* ---------- Day schedule (home) ---------- */
.sched-head { flex-wrap: wrap; }
.sched-title { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; min-width: 0; }
.sched-head h1.page { margin: 0; }
.sched-nav { display: flex; align-items: center; gap: 6px; }
/* flex: none keeps each button as wide as its text (a min-width alone lets flex shrink it to that width) */
.sched-nav > * { flex: none; }
.sched-nav .btn.small { min-width: 38px; font-size: var(--fs-15); }
.sched-nav { flex-wrap: wrap; }
.sched-nav input[type=date] { padding: 5px 8px; width: auto; max-width: 170px; }
/* UI release 2: a chair hidden from the day reads struck through (the filter bar's chips, .fb-toggle). */
.schedule-page .fb-toggle:not(.on) { color: var(--muted); text-decoration: line-through; }
.sched-empty-ops { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; border: 0; }
.sched-empty-ops legend { flex-basis: 100%; padding: 0; }
.sched-table tbody tr.sched-row { cursor: pointer; }
.sched-table tbody tr.sched-row:hover td { background: var(--accent-soft); }
.sched-table tbody tr.sched-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sched-table tr.done td { opacity: .6; }
.sched-meta { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; margin-top: 2px; }
.sched-meta .badge { font-size: var(--fs-11); padding: 1px 7px; }
.proc { display: inline-block; background: #eef1f6; border-radius: 5px; padding: 1px 6px; margin: 1px 4px 1px 0; font-size: var(--fs-13); white-space: nowrap; }
.sched-note { max-width: 320px; white-space: pre-line; font-size: var(--fs-13); }

/* ---------- Patient page ---------- */
.patient-page h1.pat-name { margin: 0 0 2px; font-size: var(--fs-22); }
.pt-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.pt-col { display: grid; gap: 14px; }
.pt-fu { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.pt-appts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pt-appts li { border-left: 3px solid var(--accent); padding-left: 10px; }
.patient-page .plan-table tbody tr { cursor: pointer; }
/* Saved plans (to-do list 2026-10-20, "Shorter Treatment Plan rows"): less padding above and below, and a row's
   buttons on one line, so more plans fit; Newer / Older under the 10 shown (patient.mjs plansPage). UI release 2: the
   row is the link (a chevron), Present and the ⋯ menu stay on one line at every width (no stacked buttons). */
.patient-page .plan-table th { padding: 6px 8px; }
.patient-page .plan-table td { padding: 5px 8px; }
.patient-page .plan-table th:first-child, .patient-page .plan-table td:first-child { padding-left: 14px; }
.patient-page .plan-table th:last-child, .patient-page .plan-table td:last-child { padding-right: 14px; }
.patient-page .plan-table td.card-title .plan-line { margin-top: 0; }
.patient-page .plan-table td.card-action { width: 1%; white-space: nowrap; }
.patient-page .plan-table td.card-action .btn { margin: 0; }
/* A card narrower than its row (the two-column page on a small window): anything still too wide scrolls inside the
   card rather than push it into the next column; a narrow card drops the Saved date first (UI release 2) */
.patient-page #pt-plans { container-type: inline-size; overflow-x: auto; }
@media (min-width: 641px) {
  @container (max-width: 520px) {
    .patient-page .plan-table th.pri-2:not(.r), .patient-page .plan-table td.pri-2:not(.r) { display: none; }
  }
}
.plan-pager { padding-top: 8px; }
table.data.compact td { padding: 5px 8px; font-size: var(--fs-13); }
@media (max-width: 900px) { .pt-grid { grid-template-columns: minmax(0, 1fr); } }

/* Schedule notes: long ones start cut to 3 lines (2 on phones), with More / Less */
.note-text { white-space: pre-line; }
.note-text.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.note-more { font-size: var(--fs-13); padding: 2px 0; }

/* Schedule on phones: one compact card per appointment
   8:00 AM   Miller, Rickey (Rick)          OP-4
   to 8:30   72 · #3556 [Confirmed]   CE · Hyg KB
   PerEx  Pro  4BW
   Note, cut to 2 lines…  More                        */
@media (max-width: 640px) {
  /* table.cards.sched-table: outranks the general phone-card rules in mobile.css */
  table.cards.sched-table tbody tr.sched-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "time pat op" "time pat prov" "procs procs procs" "note note note";
    gap: 2px 10px; padding: 9px 12px;
  }
  table.cards.sched-table tbody td[data-label]::before { display: none; }
  table.cards.sched-table tbody td:nth-child(1) { grid-area: time; font-size: var(--fs-13); line-height: 1.25; }
  table.cards.sched-table tbody td:nth-child(1) .sub { font-size: var(--fs-12); }
  table.cards.sched-table tbody td.card-title { grid-area: pat; }
  table.cards.sched-table tbody td.card-title > strong { font-size: var(--fs-15); }
  table.cards.sched-table .sched-meta { font-size: var(--fs-12); margin-top: 1px; }
  /* Stage 5: the huddle badge stays inside the patient's cell: it wraps to its own line and cuts with … if need be */
  table.cards.sched-table .sched-meta .plan-tag { display: inline-block; max-width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  table.cards.sched-table tbody td:nth-child(3) { grid-area: op; text-align: right; font-size: var(--fs-12); font-weight: 600; color: var(--accent); }
  table.cards.sched-table tbody td:nth-child(4) { grid-area: prov; text-align: right; font-size: var(--fs-12); color: var(--muted); }
  table.cards.sched-table tbody td:nth-child(4) .sub { display: inline; margin-left: 4px; }
  table.cards.sched-table tbody td.sched-procs { grid-area: procs; margin-top: 3px; }
  table.cards.sched-table tbody td.sched-note { grid-area: note; max-width: none; font-size: var(--fs-13); color: var(--muted); }
  table.cards.sched-table tbody td.blank { display: none; }
  table.cards.sched-table .note-text.clamp { -webkit-line-clamp: 2; line-clamp: 2; }
  table.cards.sched-table .proc { font-size: var(--fs-12); padding: 0 5px; }
}

/* ---------- Visual schedule (one column per operatory; blocks as tall as the appointment) ---------- */
.sched-view-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.zoom-btns { display: inline-flex; gap: 4px; }
.zoom-btns .btn.small { min-width: 34px; font-size: var(--fs-15); padding: 2px 8px; }
.vs { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.vs-heads { display: flex; position: sticky; top: 0; z-index: 6; background: #f9fafb; border-bottom: 1px solid var(--line-strong); border-radius: 10px 10px 0 0; }
.vs-axis-head, .vs-axis { width: 48px; flex: none; }
.vs-head { flex: 1 1 0; min-width: 0; padding: 7px 2px; border-left: 1px solid var(--line); text-align: center; font-weight: 600; font-size: var(--fs-13); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-grid { display: flex; }
.vs-axis { position: relative; }
.vs-hour { position: absolute; right: 6px; margin-top: 2px; font-size: var(--fs-11); color: var(--muted); white-space: nowrap; }
.vs-cols { flex: 1; min-width: 0; display: flex; position: relative;
  background-image: repeating-linear-gradient(to bottom, var(--line-strong) 0 1px, transparent 1px calc(var(--vs-hour) / 2), #eef0f3 calc(var(--vs-hour) / 2) calc(var(--vs-hour) / 2 + 1px), transparent calc(var(--vs-hour) / 2 + 1px) var(--vs-hour)); }
.vs-col { flex: 1 1 0; min-width: 0; position: relative; border-left: 1px solid var(--line); }
/* Each column stacks its own blocks (isolation), under the now line and the sticky heads. --vs-shift: how far a block
   stacked on another is shifted over, leaving a strip of the one underneath (schedule-visual.mjs stackDepths). */
.vs-body { position: relative; isolation: isolate; }
.vs { --vs-shift: 14px; }
.vblock { position: absolute; box-sizing: border-box; margin: 0; border: 0; border-left: 4px solid var(--vb-strong); border-radius: 5px; padding: 2px 5px;
  background: var(--vb-bg); color: var(--ink); text-align: left; overflow: hidden; cursor: pointer; font: inherit; font-size: var(--fs-12); line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0,0,0,.08); container-type: size; }
/* Stacked blocks keep their level on hover (hovering only the strip raises the one underneath, .raised below) */
.vblock.stacked, .vs-blockout.stacked { box-shadow: -3px 0 4px -2px rgba(0,0,0,.3); }
.vblock:hover, .vblock:focus-visible { box-shadow: 0 0 0 2px var(--vb-strong); outline: none; }
.vblock:focus-visible { z-index: 50 !important; }
.vblock.raised, .vs-blockout.raised { z-index: 50 !important; box-shadow: 0 2px 8px rgba(0,0,0,.28); }
.k-hyg { --vb-bg: #dcf3ed; --vb-strong: #1b9e84; }
.k-tx { --vb-bg: #e1ebfb; --vb-strong: #3b6fd4; }
.k-np { --vb-bg: #fdf0d6; --vb-strong: #d99a16; }
.k-emerg { --vb-bg: #fde3e4; --vb-strong: #d9485f; }
.k-none { --vb-bg: #eef0f3; --vb-strong: #9aa3ae; }
.vblock.custom { --vb-strong: var(--vb); --vb-bg: color-mix(in srgb, var(--vb) 22%, white); }
/* Completed: faded, but on a solid background so a block underneath never shows through */
.vblock.done { background: color-mix(in srgb, var(--vb-bg) 45%, white); border-left-color: color-mix(in srgb, var(--vb-strong) 45%, white); }
.vblock.done > span { opacity: .55; }
.vb-full { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vb-time { font-size: var(--fs-11); color: var(--muted); white-space: nowrap; }
.vb-name { font-size: var(--fs-13); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb-procs, .vb-prov { font-size: var(--fs-11); color: #3c4450; overflow: hidden; text-overflow: ellipsis; }
.vb-prov { color: var(--muted); white-space: nowrap; }
.vb-mini { display: none; font-weight: 700; font-size: var(--fs-11); letter-spacing: .02em; }
/* Not enough room for details: shrink to initials (tap for details) */
@container (max-width: 78px) { .vb-full { display: none; } .vb-mini { display: block; } }
@container (max-height: 34px) { .vb-time, .vb-procs, .vb-prov { display: none; } }
/* Open Dental's blockouts, under the appointments, in the blockout type's color (grey when it has none), with their
   title and note. Place and level come inline (left, width, z-index). */
.vs-blockout { --bo: #9aa3ae; position: absolute; box-sizing: border-box; pointer-events: auto;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bo) 20%, white) 0 6px, color-mix(in srgb, var(--bo) 11%, white) 6px 12px);
  border-top: 2px solid color-mix(in srgb, var(--bo) 70%, white); overflow: hidden; }
.vs-bo-title { display: block; padding: 1px 5px; font-size: var(--fs-11); font-weight: 600; line-height: 1.25; color: color-mix(in srgb, var(--bo) 55%, black);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-bo-note { display: block; padding: 0 5px 2px; font-size: var(--fs-11); line-height: 1.25; color: color-mix(in srgb, var(--bo) 40%, black);
  white-space: pre-line; overflow-wrap: anywhere; overflow: hidden; }
.vs-legend i.bo-swatch { border-left: 0; border-top: 2px solid #b8bfc8; background: repeating-linear-gradient(135deg, #e6e9ed 0 3px, #f3f4f6 3px 6px); }
.vs-now { position: absolute; left: -4px; right: 0; height: 2px; background: #e5484d; z-index: 5; pointer-events: none; }
.vs-now::before { content: ''; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; }
.vs-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: var(--fs-12); color: var(--muted); }
.vs-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; border-left: 3px solid var(--vb-strong); background: var(--vb-bg); }
.vs-legend i.done-swatch { background: #eef0f3; border-left-color: #c3c9d1; opacity: .6; }
@media (max-width: 640px) {
  .vs-axis-head, .vs-axis { width: 36px; }
  .vs-hour { font-size: var(--fs-11); right: 3px; }
  .vs-head { font-size: var(--fs-12); padding: 6px 1px; }
  .vblock { padding: 1px 3px; border-left-width: 3px; }
  .vs { --vs-shift: 10px; }
  .sched-view-tools { margin-left: 0; }
}

/* Analytics: comparison with earlier periods */
.compare-card { margin: 14px 0; padding: 14px 16px; }
.compare-card h2 { margin: 0; font-size: var(--fs-17); }
.compare-table th:first-child { text-align: left; font-weight: 600; white-space: nowrap; }
.compare-table td.cur, .compare-table th.cur { background: #f3f6fb; font-weight: 700; }
.compare-table td, .compare-table th { white-space: nowrap; }
.compare-table .delta { font-size: var(--fs-13); }
.compare-card { padding: 0; }
.compare-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; }
.compare-card > summary::-webkit-details-marker { display: none; }
.compare-card .compare-title { font-weight: 600; font-size: var(--fs-15); }
.compare-card .compare-toggle::after { content: 'Show the numbers ▾'; }
.compare-card[open] .compare-toggle::after { content: 'Hide ▴'; }
.compare-card[open] > summary { border-bottom: 1px solid var(--line); }
.compare-card > .table-scroll, .compare-card > .footnote { margin: 0 16px; }
.compare-card > .footnote { margin-bottom: 12px; }

/* Mini column charts in the tiles: earlier periods in gray, this period in the accent color */
.spark { margin: 6px 0 2px; }
.spark svg { display: block; width: 100%; height: 34px; }
.spark rect { fill: #c9d0da; }
.spark rect.cur { fill: var(--accent); }
.spark-cap { display: flex; justify-content: space-between; font-size: var(--fs-11); color: var(--muted); margin-top: 2px; }

/* Backup & restore */
.backup-page h3 { margin: 22px 0 6px; font-size: var(--fs-17); }
.backup-summary { border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; margin: 10px 0; background: #f9fafb; }
.warn-box { background: #fff7e6; border: 1px solid #f3d19c; border-radius: 8px; padding: 10px 12px; font-size: var(--fs-13); }
.restore-form input[type=file] { padding: 6px 0; }

/* About: going back to an earlier version */
.revert-line { margin-top: 10px; }
.revert-box { margin-top: 12px; padding: 12px 14px; border: 1px solid #f3d19c; background: #fffaf0; border-radius: 8px; }
.revert-box h4 { margin: 0 0 6px; font-size: var(--fs-15); }
.revert-box select { max-width: 100%; }
/* iPads and phones in the office (Settings → Office → Devices and secure address): the staff address with its QR code. */
.tunnel-loc { display: flex; gap: 16px; align-items: flex-start; margin: 12px 0; padding: 12px 14px; border: 1px solid #d9dee3; border-radius: 8px; }
.tunnel-loc .qr { flex: none; width: 140px; height: 140px; background: #fff; padding: 6px; border-radius: 6px; }
.tunnel-loc .qr img { width: 100%; height: 100%; display: block; }
.tunnel-loc p { margin: 0 0 6px; overflow-wrap: anywhere; }
@media (max-width: 520px) { .tunnel-loc { flex-direction: column; } }

/* Settings → Office → Open Dental: the Open Dental button */
.od-steps { margin-top: 6px; }
.od-steps summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.od-steps #ob-base { width: 100%; max-width: 420px; font-family: ui-monospace, monospace; font-size: var(--fs-13); }
.od-step-list { padding-left: 20px; margin: 10px 0; }
.od-step-list li { margin: 6px 0; }
.od-fields { margin-top: 6px; max-width: 640px; }
.od-fields th { width: 12em; white-space: normal; }
.od-fields .copy-row input { min-width: 0; }
@media (max-width: 640px) {
  .od-fields tr, .od-fields th, .od-fields td { display: block; width: auto; }
  .od-fields th { border-bottom: 0; padding-bottom: 2px; }
}

/* ---------- Automatic backups (Settings → Office → Backups) ---------- */
.backup-alert { background: #fdf1ef; border-bottom: 1px solid #e6b4ae; color: var(--danger); padding: 10px 20px; font-size: var(--fs-15); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.backup-alert[hidden] { display: none; }
.backup-alert a { font-weight: 600; }
.ab-card { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px 14px; margin: 12px 0 8px; background: var(--card); }
.ab-card h3 { margin-top: 12px; }
.ab-card h4 { font-size: var(--fs-15); margin: 16px 0 4px; }
.ab-card code { word-break: break-all; }
.ab-status { border-left: 4px solid var(--line-strong); padding: 6px 12px; margin: 8px 0; display: grid; gap: 2px; }
.ab-status.good { border-left-color: var(--ok); }
.ab-status.bad { border-left-color: var(--danger); }
.ab-status .error { margin: 4px 0 0; }
.ab-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ab-actions .btn { text-decoration: none; }
.ab-offsite { margin: 10px 0; display: grid; gap: 2px; }
.ab-offsite .help { color: var(--muted); font-size: var(--fs-13); margin: 0 0 4px 26px; }
.ab-offsite > div:not(.help), .ab-offsite > p { margin-left: 26px; }
.ab-offsite .check.disabled { cursor: not-allowed; color: var(--muted); }
.or-list { display: grid; gap: 2px; margin: 6px 0 10px; }
#or-progress progress { width: 100%; height: 14px; }
.ab-files { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.ab-files li span:first-child { word-break: break-all; color: var(--ink); }
#ab-form select { max-width: 220px; }
#ab-login-fields { display: grid; gap: 8px; }
#ab-login-fields[hidden] { display: none; }
@media (max-width: 800px) {
  .ab-card { padding: 4px 12px 12px; }
  .ab-actions .btn { flex: 1 1 calc(50% - 8px); text-align: center; }
  #ab-form select { max-width: none; }
}

/* Settings → Office → Open Dental alerts (public/od-alerts.mjs): the Backups card's status box, the setup form and
   Settings' switches */
.od-alerts-page .oa-status { margin: 10px 0; }
.od-alerts-page .oa-status .sub { margin: 4px 0 0; }
.od-alerts-page #oa-port { max-width: 120px; }
.od-alerts-page .oa-pw-state { font-weight: 400; font-size: var(--fs-12); color: var(--muted); margin-left: 6px; }
.od-alerts-page .oa-pw-state.set { color: var(--ok); }
.od-alerts-page #oa-result:empty { display: none; }
.od-alerts-page #oa-result p { margin: 2px 0 0; }
.od-alerts-page #oa-switches { max-width: 760px; }
.od-alerts-page .switch input:disabled + span { opacity: .45; cursor: not-allowed; }

/* Settings → Office → Diastema connection */
#edge-connection .lbl { display: block; font-weight: 600; margin: 10px 0 4px; }
#edge-connection .code-input { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-15); letter-spacing: .04em; width: 21em; max-width: 100%; text-transform: uppercase; }

/* ---------- Devices: the pairing page, Settings → Office → Devices and secure address, and the approval banner ---------- */
.signin.pairing h1 { font-size: var(--fs-22); }
.signin.pairing h2 { font-size: var(--fs-15); margin: 10px 0 0; }
.signin.pairing p { margin: 0; line-height: 1.45; }
.signin.pairing .pair-practice { font-weight: 600; color: var(--muted); }
.signin.pairing form.pair-form { max-width: none; justify-self: stretch; gap: 6px; }
.pair-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pair-row input { flex: 1 1 12em; min-width: 0; width: auto; }
.pair-row .btn { flex: none; }
.code-input { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-17); letter-spacing: .08em; text-transform: uppercase; }
.big-code { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-26); font-weight: 700; letter-spacing: .12em; margin: 4px 0; color: var(--ink); }
.match-code { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-17); font-weight: 700; letter-spacing: .08em; }
.pair-code { display: flex; gap: 18px; align-items: flex-start; }
.pair-code p { margin: 0 0 8px; }
.pair-code .qr { flex: none; width: 180px; height: 180px; background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.pair-code .qr svg { width: 100%; height: 100%; display: block; }
@media (max-width: 560px) { .pair-code { flex-direction: column; } .pair-code .qr { align-self: center; } }
#dv-err:empty { display: none; }
.devices-page .notice, .packet-page .notice { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; }
/* Settings → Office → Post-install packet */
.packet-page h3 { margin: 14px 0 0; }
.packet-page .check { padding: 2px 0; }
.packet-page #pk-computers { max-width: 120px; }
.packet-page #pk-status:empty { display: none; }
.devices-page td .btn.small + .btn.small { margin-left: 6px; }
.device-requests { background: #eef4ff; border-bottom: 1px solid #bcd0f5; padding: 10px 20px; font-size: var(--fs-15); display: grid; gap: 8px; }
.device-requests[hidden] { display: none; }
.device-requests .req { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; }

/* Stopped, suspended or ended (lib/access.mjs): why, above the sign-in and the records page. */
.access-banner { background: #fdf6e3; border-bottom: 1px solid #e3cf95; color: #5c4a12; padding: 10px 20px; font-size: var(--fs-15); }
.access-notice { border-left: 4px solid #c89b2c; }
/* Only the records page is open, so no menu to the others (the nav's display: flex would beat [hidden]). */
body.access-limited #main-nav, body.access-limited #bottom-nav, body.access-limited #gsearch { display: none; }
.records-page .records-list td:last-child { text-align: right; }

/* ---------- Patient forms (forms.mjs, forms-settings.mjs) ---------- */
/* The patient page's banner, under the name card while forms are due */
.forms-banner { display: flex; gap: 10px 14px; align-items: flex-start; flex-wrap: wrap; background: #fff8e6; border: 1px solid #f0d58a; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: var(--fs-15); }
.forms-banner .fb-icon { font-size: var(--fs-17); line-height: 1.2; }
.forms-banner .fb-text { flex: 1 1 320px; min-width: 0; }
.forms-banner .fb-lock { margin-top: 4px; color: var(--danger); }
/* Stage 3: the email line ("Welcome letter sent Oct 9, 2 of 3 done"; red for a bounce), and the banner when it's all
   there is to say (nothing due): quiet grey, or red for a bounce */
.forms-banner .fb-email { margin-top: 4px; }
.forms-banner .fb-email:first-child { margin-top: 0; }
.forms-banner .fb-email.bad { color: var(--danger); font-weight: 600; }
.forms-banner.calm { background: #f7f8fa; border-color: var(--line); }
.forms-banner.bad { background: #fdecec; border-color: #f3b8b8; }
.forms-banner .fb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* The Forms card */
.forms-card h4 { margin: 14px 0 6px; font-size: var(--fs-13); color: var(--muted); }
.forms-card .fc-open { display: grid; gap: 6px; }
.forms-card .fc-forms { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: var(--fs-13); }
.forms-card .fc-forms li span[aria-hidden] { display: inline-block; width: 14px; color: var(--faint); }
.forms-card .fc-forms li.fc-signed span[aria-hidden] { color: var(--ok); font-weight: 700; }
.forms-card .fc-forms li.fc-started span[aria-hidden] { color: #9a6200; }
.forms-card .fc-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.forms-card .fc-family { margin: 10px 0 0; font-size: var(--fs-13); }
.forms-card .fc-subs { list-style: none; margin: 0; padding: 0; display: grid; }
.forms-card .fc-subs li { display: flex; gap: 6px 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.forms-card .fc-subs li:first-child { border-top: 0; padding-top: 2px; }
.forms-card .fc-sub-main { flex: 1 1 180px; min-width: 0; }
.forms-card .fc-sub-side { display: flex; gap: 6px; flex: none; }
.forms-card .fc-error { color: var(--danger); overflow-wrap: anywhere; }
.forms-card .fc-changes tr.fc-undone td { text-decoration: line-through; color: var(--muted); }
.forms-card .fc-needs { margin: 0; padding-left: 18px; }
.forms-card .fc-earlier { margin-top: 10px; font-size: var(--fs-13); }
.forms-card .fc-earlier ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
/* Stage 3: the patient's automatic messages (Automatic, Email, No automatic messages) */
.forms-card .fc-channel { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.forms-card .fc-channel select { width: auto; }
/* Send forms */
.fs-choices { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; }
.fs-choices legend { padding: 0; margin-bottom: 4px; }
.fs-choices[hidden] { display: none; }
/* Send forms on the forms due (owner's list, 2026-10-20): what's due at the top, Send other forms under the ways */
.fs-due[hidden] { display: none; }
.fs-due-list { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.fs-other { margin: 10px 0 0; }
.fs-pick { padding-left: 24px; display: grid; gap: 0; }
.fs-pick[hidden] { display: none; }
/* Send forms → Consent: the consent, the dentist, a tooth chart (upper over lower), quadrants and arches */
.fs-consent { padding-left: 24px; display: grid; gap: 4px; }
.fs-consent[hidden] { display: none; }
.fs-consent select { max-width: 100%; }
.fs-teeth { display: grid; gap: 2px; }
.fs-teeth > div { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; }
.fs-primary, .fs-primary .fs-teeth { width: 100%; }
.fs-primary .fs-teeth > div { grid-template-columns: repeat(10, minmax(0, 1fr)); width: 62.5%; margin: 0 auto; }
.fs-tooth { min-width: 0; position: relative; }
.fs-tooth input { position: absolute; opacity: 0; pointer-events: none; }
.fs-tooth span { display: grid; place-items: center; width: 100%; height: 28px; border: 1px solid var(--line-strong); border-radius: 5px; font-size: var(--fs-12); cursor: pointer; background: #fff; }
.fs-tooth input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.fs-tooth input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.fs-teeth > div:first-child { border-bottom: 1px dashed var(--line-strong); padding-bottom: 2px; }
.fs-areas { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.fs-primary summary { cursor: pointer; font-size: var(--fs-13); color: var(--muted); }
/* Send forms → Consent, several at once: Add consent, then a row each for the consents added, with Remove */
.fs-c-add { margin: 2px 0 4px; }
.fs-c-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.fs-c-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 10px; }
.fs-c-row + .fs-c-row { border-top: 1px solid var(--line); }
.fs-c-row > span { min-width: 0; overflow-wrap: anywhere; }
.fs-c-row .link { color: var(--danger); white-space: nowrap; }
.fs-how { margin-top: 10px; }
#fs-err:empty { display: none; }
.forms-share .notice, .modal-body > .notice { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; }
.forms-share .copy-row { margin-bottom: 6px; }
/* The schedule's clipboard badge while forms are due, and its mark in visual blocks */
.badge.forms-badge { cursor: help; }
.vb-forms { display: inline-block; margin-right: 3px; font-size: var(--fs-11); line-height: 1; padding: 1px 2px; border-radius: 3px; background: #eceef1; filter: grayscale(1); vertical-align: 1px; }
.vs-legend .vb-forms { margin-right: 4px; }
/* The admins' banner when signed forms couldn't be filed (styled like the backup banner) */
.forms-alert a + a { margin-left: 4px; }
/* Settings → Patient forms */
.forms-settings .notice { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; }
.forms-settings .pf-wording { margin: 8px 0; padding-left: 18px; font-size: var(--fs-15); }
.forms-settings .pf-wording li { margin: 3px 0; }
/* Stage 3, Follow-ups → New patient paperwork and Confirmations (forms-followups.mjs) */
.today-seg { margin: 0 0 14px; }
.fu-list .fu-note { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; font-size: var(--fs-15); }
.fu-list .fu-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.fu-list td.card-action { width: 1%; white-space: nowrap; }
/* Stage 3, Settings → Patient email (forms-email-settings.mjs) */
.email-settings .pe-modes .pe-mode { padding: 8px 0; }
.email-settings .pe-times { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.email-settings .pe-times input[type=time] { width: auto; }
.email-settings .pe-checks { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 6px; }
.email-settings .pe-preview-btns { text-align: right; }
.pe-frame { width: 100%; height: 60vh; min-height: 320px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pe-text { margin-top: 10px; font-size: var(--fs-13); }
.pe-text pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f7f8fa; border-radius: 6px; padding: 8px 10px; }

/* ---------- Send forms: the ways it goes (public/forms.mjs, the owner, 2026-10-14) ----------
   Which forms, then Email, Text, Open on this device and Copy link in one row; what Text or Copy link made shows
   under it to copy by hand. No QR code. */
.fs-ways { margin-top: 12px; display: grid; gap: 6px; }
.fs-way-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fs-way-row .btn { flex: 1 1 auto; }
.fs-ways .fs-why { margin: 0; }
.fs-out { margin-top: 12px; display: grid; gap: 6px; }
.fs-out[hidden] { display: none; }
.fs-out .notice { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; margin: 0; }
.fs-out .copy-row { align-items: flex-start; }
.fs-out .copy-row input, .fs-out .copy-row textarea { flex: 1; min-width: 0; }
.fs-out textarea { font: inherit; font-size: var(--fs-13); resize: vertical; }

/* ---------- Settings → Patient email: the appointment timeline as step tabs (public/forms-email-settings.mjs, the
   owner, 2026-10-14) ----------
   A vertical list of labeled step tabs on the left, the chosen step's settings rows on the right; nothing scrolls
   sideways. Under 900px the tabs stack above the settings (public/mobile.css). */
.email-settings .pe-steps { display: grid; grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); gap: 14px; align-items: start; margin: 10px 0 12px; }
.email-settings .pe-tabs { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.email-settings .pe-tab { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-left: 3px solid transparent; border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.email-settings .pe-tab:hover { border-color: var(--line-strong); }
.email-settings .pe-tab[aria-selected=true] { background: var(--accent-soft); border-color: var(--accent-soft); border-left-color: var(--accent); }
.email-settings .pe-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.email-settings .pe-tab-num { grid-row: span 2; align-self: start; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--line); font-size: var(--fs-12); font-weight: 700; }
.email-settings .pe-tab[aria-selected=true] .pe-tab-num { background: var(--accent); color: #fff; }
.email-settings .pe-tab-label { font-weight: 600; font-size: var(--fs-15); overflow-wrap: anywhere; }
.email-settings .pe-tab-when { grid-column: 2 / -1; color: var(--muted); font-size: var(--fs-13); overflow-wrap: anywhere; }
.email-settings .pe-chip { font-size: var(--fs-12); font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #eef0f3; color: var(--muted); white-space: nowrap; }
.email-settings .pe-chip.on { background: #e3f3ea; color: var(--ok); }
.email-settings .pe-tab.pe-later .pe-tab-label, .email-settings .pe-tab.pe-later .pe-chip { opacity: .7; }
/* The panel's rows: the label takes the room, the control its own width; a narrow panel puts the control under it. */
.email-settings .pe-panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 2px 16px 6px; background: var(--card); container-type: inline-size; }
.email-settings .pe-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.email-settings .pe-panel h4 { font-size: var(--fs-15); margin: 12px 0 2px; }
.email-settings .pe-panel .field { grid-template-columns: minmax(0, 1fr) auto; }
.email-settings .pe-panel .field.wide { grid-template-columns: minmax(0, 1fr); }
.email-settings .pe-panel .field.wide .ctl input { width: 100%; }
.email-settings .pe-panel input[type=number] { width: 96px; }
.email-settings .pe-panel input[type=time] { width: auto; }
@container (max-width: 400px) {
  .email-settings .pe-panel .field { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .email-settings .pe-panel .field .ctl.toggle { justify-self: start; }
}
.email-settings .pe-panel.pe-later { background: #fafbfc; }
.email-settings .pe-panel.pe-later .field { opacity: .7; }
.email-settings .pe-from p { margin: 10px 0; }

/* ---------- Stage 4: the editors' shared pieces (Settings → Patient forms → Forms) ----------
   The Forms card on Settings → Patient forms (each document, its packet ticks and buttons); the editors' page: a top
   bar, the yellow "Fill in the blanks" panel, panes side by side with the patient app's preview in a frame (under
   1100px tabs show one at a time: public/mobile.css), the outline the letter editor keeps. Empty Spanish boxes are
   yellow; marks are red (fix before publishing) or amber (a warning). The form canvas has its own block below. */
.pf-forms-table td { vertical-align: top; }
.pf-forms-table .pf-tick { width: 1%; text-align: center; white-space: nowrap; }
.pf-forms-table .pf-tick input { width: 18px; height: 18px; }
.pf-forms-table .pf-acts { width: 1%; white-space: nowrap; text-align: right; }
.pf-forms-table .pf-acts .btn, .pf-forms-table .pf-acts .link { margin: 2px 0 2px 4px; }
.pf-forms .pf-blanks { margin-top: 4px; font-size: var(--fs-13); }
.pf-forms .pf-blanks span { color: var(--muted); }
.pf-forms-new { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.pf-forms .badge.blue { background: #2f6fde; border-color: #2f6fde; color: #fff; border-radius: 999px; }
.pf-forms .pf-newer { margin-top: 4px; font-size: var(--fs-13); }
.pf-forms .pf-stage5 { margin-top: 4px; font-size: var(--fs-13); color: #6b4a00; }
.pf-forms .pf-stage5 span { color: var(--muted); }
.pf-forms-table .pf-tick input:disabled { opacity: .4; cursor: not-allowed; }

.fe-page { display: grid; gap: 12px; }
.fe-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 6px 0; }
.fe-back { white-space: nowrap; }
.fe-title { min-width: 0; flex: 1 1 260px; }
.fe-title h2 { margin: 0; font-size: var(--fs-17); overflow-wrap: anywhere; display: inline; }
.fe-status { color: var(--muted); font-size: var(--fs-13); white-space: nowrap; }
.fe-status.bad { color: var(--danger); font-weight: 600; white-space: normal; }
.fe-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fe-actions .fe-nochange { align-self: center; font-size: var(--fs-13); }
.fe-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: #fff; color: var(--danger); font-size: var(--fs-12); font-weight: 700; }
.fe-note { margin: 0; background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; font-size: var(--fs-15); }
.fe-blanks { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 10px; padding: 10px 14px; }
.fe-blanks h3 { margin: 0 0 4px; font-size: var(--fs-17); }
.fe-blanks.done { background: #e9f6ee; border-color: #b5dfc5; }
.fe-blanks.done p, .fe-blanks-done { margin: 0; color: var(--ok); font-weight: 600; }
.fe-blank-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.fe-blank-list li { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.fe-blank-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fe-blank-row input { flex: 1 1 200px; min-width: 0; }
mark.fe-blank { background: #ffe58a; border-radius: 3px; padding: 0 3px; font-weight: 600; }
.fe-tabs { display: none; }
.fe-panes { display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr) 432px; gap: 14px; align-items: start; }
.fe-pane { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.fe-pane-outline, .fe-pane-preview { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
.fe-pane-edit { padding: 4px 16px 16px; }

/* The outline */
.fe-outline { padding: 8px; display: grid; gap: 6px; font-size: var(--fs-15); }
.fe-outline button.fe-o-doc, .fe-outline button.fe-o-sec, .fe-outline .fe-o-pick { background: none; border: 0; padding: 4px 6px; border-radius: 6px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; width: 100%; overflow-wrap: anywhere; }
.fe-outline .fe-o-doc { font-weight: 700; }
.fe-outline .fe-o-sec { font-size: var(--fs-12); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #4b5563; }
.fe-outline button.on { background: var(--accent-soft); }
.fe-o-blocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.fe-o-row { display: flex; align-items: flex-start; gap: 4px; }
.fe-o-row .fe-o-pick { flex: 1 1 auto; min-width: 0; }
.fe-o-tools { display: none; gap: 4px; align-items: center; flex: none; font-size: var(--fs-13); }
.fe-o-block:hover .fe-o-tools, .fe-o-block.on .fe-o-tools, .fe-o-tools:focus-within { display: inline-flex; }
.icon-btn.small { width: 24px; height: 24px; font-size: var(--fs-12); border-radius: 6px; background: #eceef1; }
.icon-btn.small:disabled { opacity: .35; cursor: default; }
.fe-o-blocks { margin: 2px 0 6px 12px; }
.fe-o-block { display: flex; align-items: flex-start; gap: 4px; border-radius: 6px; }
.fe-o-block .fe-o-pick { font-size: var(--fs-13); }
.fe-o-block.on .fe-o-pick { background: var(--accent-soft); }
.fe-o-type { font-size: var(--fs-11); color: var(--muted); font-weight: 600; }
.fe-add { margin: 2px 0 8px 12px; }
.fe-add select { width: auto; max-width: 100%; font-size: var(--fs-13); }
.fe-mark { font-size: var(--fs-11); vertical-align: 1px; }
.fe-mark.err { color: var(--danger); }
.fe-mark.warn { color: #c77700; }
.fe-dot { color: #d49b00; font-size: var(--fs-11); vertical-align: 1px; }
.fe-tray { border-top: 1px solid var(--line); margin-top: 6px; padding: 6px 6px 2px; }
.fe-tray h4 { margin: 4px 0; font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .03em; color: #4b5563; }
.fe-tray ul { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; font-size: var(--fs-13); }
.fe-tray li { display: flex; justify-content: space-between; gap: 8px; }

/* What's selected */
.fe-set h3 { font-size: var(--fs-17); margin: 12px 0 8px; }
.fe-sub { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 4px; }
.fe-sub h4 { margin: 8px 0 4px; font-size: var(--fs-15); }
.fe-text { margin: 10px 0; }
.fe-text-lbl { font-size: var(--fs-13); font-weight: 700; margin-bottom: 4px; }
.fe-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.fe-pair > div { min-width: 0; }
.fe-lang { display: block; font-size: var(--fs-11); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.fe-box { width: 100%; }
textarea.fe-box { resize: vertical; font: inherit; }
.fe-box.fe-missing { background: #fffbea; border-color: #f0d58a; }
.fe-es-note { display: none; font-size: var(--fs-12); color: #8a5a00; }
.fe-missing + .fe-es-note { display: block; }
.fe-you { margin-top: 4px; font-size: var(--fs-13); }
.fe-you summary { color: var(--accent); cursor: pointer; }
.fe-you .fe-pair { margin-top: 4px; }
.fe-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 8px 0; border-top: 1px solid #f0f1f3; }
.fe-row .help { font-size: var(--fs-13); }
.fe-ctl { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fe-ctl select, .fe-ctl input[type=text] { width: auto; max-width: 280px; }
.fe-ctl input[type=number] { width: 96px; }
.fe-inline { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-13); }
.fe-uses { margin: 10px 0; }
.fe-uses code { font-size: var(--fs-13); background: #f3f4f6; border-radius: 4px; padding: 0 4px; }
.fe-uses-list { background: #f3f6fa; border: 1px solid var(--accent-soft); border-radius: 8px; padding: 6px 10px; margin-top: 4px; font-size: var(--fs-13); }
.fe-uses-list ul { margin: 4px 0; padding-left: 18px; }
.fe-uses-list .help { margin: 0; }
.fe-list-item { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 6px 0; }
.fe-list-item .fe-text { margin: 4px 0; }
.fe-full-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.fe-full-head .fe-o-tools { display: inline-flex; }
.fe-problems { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-13); }
.fe-problems li { padding: 6px 10px; border-radius: 6px; }
.fe-problems li.err { background: #fdecec; color: var(--danger); }
.fe-problems li.warn { background: #fff8e6; color: #6b4a00; }
.fe-cond { display: grid; gap: 6px; margin: 6px 0; }
.fe-cond-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fe-rule { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; }
.fe-rule select, .fe-cond-head select { width: auto; max-width: 100%; }
.fe-rule input[type=number] { width: 80px; }
.fe-rule input[type=text] { width: 160px; }
.fe-in { display: inline-flex; gap: 4px 12px; flex-wrap: wrap; font-size: var(--fs-13); }
.fe-cond-json { width: 100%; font-family: ui-monospace, monospace; font-size: var(--fs-13); }
.fe-resign { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
/* Beta 2: a risk list's risks and steps (each a card with up, down, Remove), a picture, the signature's words, fill-ins */
.fe-item { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 6px 0; }
.fe-item .fe-text { margin: 4px 0; }
.fe-item .fe-full-head .fe-o-tools { display: inline-flex; }
.fe-item code { font-size: var(--fs-13); background: #f3f4f6; border-radius: 4px; padding: 0 4px; }
.fe-pic { margin: 10px 0; }
.fe-pic-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.fe-pic-pick { display: grid; gap: 4px; width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; text-align: center; font: inherit; }
.fe-pic-pick:hover, .fe-pic-pick:focus-visible { border-color: var(--accent); }
.fe-pic-pick img { width: 100%; height: 100px; object-fit: contain; }
.fe-fillins { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; font-size: var(--fs-13); }
.fe-fillins summary { cursor: pointer; color: var(--accent); }
.fe-fillins h4 { margin: 8px 0 2px; font-size: var(--fs-13); }
.fe-fillins ul { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 2px; }
.fe-fillins button.link { font-family: ui-monospace, monospace; font-size: var(--fs-13); }

/* The preview */
.fe-pv-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.fe-pv-bar select { width: auto; font-size: var(--fs-13); }
.fe-seg { display: inline-flex; background: #e6e9ee; border-radius: 8px; padding: 2px; }
.fe-seg button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font: inherit; font-size: var(--fs-13); color: var(--muted); font-weight: 600; cursor: pointer; }
.fe-seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.fe-pv-close { display: none; }
.fe-pv-problem { margin: 8px; background: #fdecec; color: var(--danger); border-radius: 8px; padding: 8px 10px; font-size: var(--fs-13); }
.fe-pv-stage { padding: 10px; background: #eef0f3; display: flex; justify-content: center; overflow: auto; }
.fe-pv-frame { border: 1px solid var(--line-strong); border-radius: 18px; background: #fff; flex: none; }
.fe-pv-frame.phone { width: 390px; height: 780px; }
.fe-pv-frame.ipad { width: 820px; height: 1000px; border-radius: 12px; }
/* Preview, full screen over the editor (the top bar's Preview; Escape or Close the preview) */
.fe-full .fe-pane-preview { position: fixed; inset: 0; z-index: 60; max-height: none; border-radius: 0; border: 0; }
.fe-full .fe-pv-close { display: inline-block; }
.fe-full .fe-pv-stage { min-height: calc(100vh - 60px); }
body.fe-noscroll { overflow: hidden; }

/* History and Compare */
.fe-history { list-style: none; margin: 0; padding: 0; display: grid; }
.fe-h-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.fe-h-row:first-child { border-top: 0; }
.fe-h-note { font-size: var(--fs-13); margin-top: 2px; }
.fe-h-acts { display: flex; gap: 6px; flex: none; }
.fe-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fe-ch { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.fe-ch-where { font-size: var(--fs-13); color: var(--muted); }
.fe-ch-words { margin-top: 4px; overflow-wrap: anywhere; }
.fe-ch-words ins { background: #dcf3e4; text-decoration: none; }
.fe-ch-words del { background: #fbe2e2; }
/* A newer starter side by side: Yours | Diastema's new starter, the same wording folded away until asked for */
.fe-sbs-head, .fe-sbs-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.fe-sbs-head { position: sticky; top: 0; background: var(--card); padding: 6px 0; border-bottom: 1px solid var(--line); z-index: 1; }
.fe-sbs-toggle { margin: 8px 0; }
.fe-sbs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fe-sbs-row { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fff; }
.fe-sbs-row.same { display: none; }
.fe-sbs.all .fe-sbs-row.same { display: block; color: var(--muted); }
.fe-sbs-place { font-size: var(--fs-13); color: var(--muted); margin-bottom: 4px; }
.fe-sbs-cols + .fe-sbs-cols { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); }
.fe-sbs-cols > div { min-width: 0; overflow-wrap: anywhere; }
.fe-sbs-cols ins { background: #dcf3e4; text-decoration: none; }
.fe-sbs-cols del { background: #fbe2e2; }
.fe-sbs-diff { margin-top: 12px; }
.fe-sbs-diff summary { cursor: pointer; color: var(--accent); margin-bottom: 6px; }
.fe-st-help { margin: 0; max-width: 460px; }

/* ---------- The letter editor (public/forms-letter-editor.mjs): the form editor's look in a narrower letter mode, the
   email beside it tall enough to read; a shared section's place in the outline with its lock; the Show panel's flags
   (Always / Only when / Only when not); pieces of a sentence as cards ---------- */
.fe-page[data-mode="letter"] .fe-panes { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr) minmax(360px, 560px); }
.lt-o-list { margin: 0; }
.lt-o-slot { border-left: 3px solid #d9dde3; border-radius: 6px; background: #fafbfc; margin: 2px 0; }
.lt-o-slot.reworded { border-left-color: var(--accent); }
.lt-o-slot.on { border-left-color: var(--accent); }
.lt-o-slot.on > .fe-o-row .fe-o-pick { background: var(--accent-soft); }
.lt-o-slot:hover > .fe-o-row .fe-o-tools, .lt-o-slot.on > .fe-o-row .fe-o-tools { display: inline-flex; }
.lt-o-slot .fe-o-pick { font-size: var(--fs-13); }
.lt-lock { font-size: var(--fs-11); }
.lt-o-group { margin: 4px 0; }
.lt-shared { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.lt-shared li { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fafbfc; font-size: var(--fs-13); overflow-wrap: anywhere; }
.lt-shared-en { margin-top: 2px; }
.lt-slot-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.lt-subject-fills button.link { font-family: ui-monospace, monospace; font-size: var(--fs-13); }
.lt-show { margin: 6px 0; font-size: var(--fs-13); }
.lt-show summary { cursor: pointer; color: var(--accent); }
.lt-show summary span { color: var(--ink); }
.lt-flag { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; padding: 4px 0; border-top: 1px solid #f0f1f3; }
.lt-flag-name { min-width: 0; flex: 1 1 180px; }
.lt-flag .fe-seg button { padding: 3px 8px; font-size: var(--fs-12); }
.lt-pieces { display: grid; gap: 2px; }
.lt-piece .fe-inline { margin: 2px 0; }
.lt-pv-subject { margin: 8px 10px 0; font-size: var(--fs-15); overflow-wrap: anywhere; }
.lt-pv-stage { padding: 10px; }
.lt-frame { display: block; width: 100%; height: 70vh; min-height: 520px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.lt-test { border-top: 1px solid var(--line); padding: 8px 10px 10px; }
.lt-test .copy-row input { flex: 1 1 auto; min-width: 0; }
.lt-test .help { font-size: var(--fs-13); margin: 4px 0 0; }

/* The editors' title line: a space between the title and the kind words after it (Stage 4 beta 3). */
.fe-title h2 + .sub { margin-left: 8px; }

/* ---------- The form canvas (public/forms-canvas.mjs, the intake editor revamp): the form as one list (a Part heading
   tinted, a Step bar outlined, each question drawn as the patient sees it with where its answer goes on the right),
   the card opened in place under its row, the palette, and the patient app beside them. Under 1280px the preview is a
   tab; on a phone the palette goes under the canvas. ---------- */
.cv-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.cv-bar-ctl { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-13); color: var(--muted); }
.cv-bar-ctl select { width: auto; font-size: var(--fs-13); }
.cv-miss { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: #f0d58a; color: #6b4a00; font-size: var(--fs-11); font-weight: 700; }
.cv-tabs { padding: 0; background: none; }
.cv-panes { display: grid; grid-template-columns: minmax(0, 1fr) 200px 412px; gap: 14px; align-items: start; }
.cv-page:not([data-tab="form"]) .cv-panes { grid-template-columns: minmax(0, 1fr) 412px; }
.cv-pal-pane[hidden] { display: none; }
.cv-preview { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
.cv-pal-pane { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
.cv-page .cv-only-narrow, .cv-page .fe-pv-close { display: none; }
.cv-canvas { display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; }
.cv-docbar { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 10px; border-radius: 8px; cursor: pointer; border: 1px dashed var(--line-strong); }
.cv-doc-name { font-weight: 700; font-size: var(--fs-17); }
.cv-doc-sig { font-size: var(--fs-13); color: var(--muted); overflow-wrap: anywhere; }
.cv-part { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-top: 10px; padding: 7px 10px; border-radius: 6px; background: #eef1f6; cursor: pointer; }
.cv-part-name { font-weight: 700; }
.cv-part-note, .cv-step-note { font-size: var(--fs-12); color: var(--muted); }
.cv-step { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 6px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: grab; }
.cv-step-name { font-weight: 600; }
.cv-step-note { margin-left: auto; display: inline-flex; gap: 8px; }
.cv-np { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: var(--fs-11); }
.cv-empty { color: #8a5a00; }
.cv-empty-step { font-size: var(--fs-13); color: var(--muted); padding: 6px 10px 6px 22px; }
.cv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 7px 10px 7px 22px; border-radius: 6px; cursor: grab; }
.cv-row:hover, .cv-step:hover, .cv-part:hover, .cv-docbar:hover { background: #f6f8fb; }
.cv-row.on, .cv-step.on, .cv-part.on, .cv-docbar.on { background: var(--accent-soft); }
.cv-row.off, .cv-step.off { opacity: .55; background: repeating-linear-gradient(135deg, transparent 0 8px, #f3f4f6 8px 16px); }
.cv-offband { font-size: var(--fs-11); font-weight: 600; color: #6b7280; background: #e5e7eb; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.cv-step .cv-offband { margin-left: 6px; }
.cv-off-note { margin: 0 0 10px; padding: 6px 10px; border-radius: 6px; background: #f3f4f6; color: #374151; font-size: var(--fs-13); }
.cv-viewas-help { flex-basis: 100%; margin: 0; font-size: var(--fs-13); color: var(--muted); max-width: 900px; }
.cv-del { color: var(--danger); }
/* R8: alignment on the canvas and in the text editor's typing box. */
.cv-look .al-c { text-align: center; }
.cv-look .al-r { text-align: right; }
.pf-update-note { max-width: 560px; margin-top: 2px; }
.cv-cat-grid { display: grid; grid-template-columns: max-content minmax(0, 320px); gap: 6px 12px; align-items: center; margin: 8px 0; }
.cv-cat-removed ul { margin: 6px 0 0; padding-left: 18px; }
.cv-ref-list { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 4px; }
.cv-ref { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; background: #fff; }
.cv-ref:not(.on) { background: #f9fafb; }
.cv-ref label { flex: 1; display: flex; gap: 8px; align-items: center; }
.cv-ref .fe-o-tools { margin-left: auto; }
.cv-grip { cursor: grab; color: var(--muted); }
@media (max-width: 700px) { .cv-cat-grid { grid-template-columns: 1fr; } }
.cv-row.follow { margin-left: 18px; border-left: 2px solid var(--line); }
.cv-row.dragging, .cv-step.dragging { opacity: .4; }
.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.cv-row:focus-visible, .cv-step:focus-visible, .cv-part:focus-visible, .cv-docbar:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cv-look { min-width: 0; }
.cv-q { font-size: var(--fs-15); overflow-wrap: anywhere; }
.cv-q-sub, .cv-hint-line { font-size: var(--fs-13); color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.cv-req { color: var(--danger); font-weight: 700; }
.cv-ans { display: flex; gap: 6px; margin-top: 4px; }
.cv-ans.wrap { flex-wrap: wrap; }
.cv-pill { display: inline-block; padding: 3px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: var(--fs-13); background: #fff; }
.cv-pill.tick::before { content: ''; display: inline-block; width: 10px; height: 10px; border: 1px solid var(--line-strong); border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.cv-pill.sq { min-width: 30px; text-align: center; padding: 3px 6px; }
.cv-pill.wide { padding: 3px 18px; }
.cv-box-look { display: inline-block; width: min(320px, 100%); min-height: 26px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fbfbfc; font-size: var(--fs-13); color: #9aa1aa; }
.cv-box-look.half { width: min(170px, 100%); }
.cv-box-look.small { width: 80px; }
.cv-box-look.tall { min-height: 44px; }
.cv-tickbox { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line-strong); border-radius: 3px; vertical-align: -2px; }
.cv-c-h { font-weight: 700; }
.cv-c-p { font-size: var(--fs-15); color: #3f4650; }
.cv-c-notice { font-size: var(--fs-15); background: #fff8e6; border-radius: 6px; padding: 4px 8px; }
.cv-c-list { margin: 0; padding-left: 18px; font-size: var(--fs-15); }
.cv-when { font-size: var(--fs-12); color: var(--accent); margin-top: 3px; }
.cv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; max-width: 220px; }
.cv-tag { font-size: var(--fs-11); color: var(--muted); background: #f3f4f6; border-radius: 4px; padding: 1px 6px; text-align: right; overflow-wrap: anywhere; }
.cv-chip { display: inline-block; font-size: var(--fs-11); font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #e9f6ee; color: #1f6b3a; }
.cv-chip.upd { background: #e8f0fb; color: #1d4f91; }
.cv-chip.cond { background: #f3f4f6; color: var(--muted); }
.cv-dot { color: #d49b00; font-size: var(--fs-11); }
.cv-type { font-size: var(--fs-11); color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.cv-lock { font-size: var(--fs-11); font-weight: 600; color: var(--accent); }
.cv-plus { position: relative; height: 10px; margin: 0 0 0 22px; }
.cv-plus-btn { position: absolute; left: -16px; top: -7px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--muted); font-weight: 700; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .1s; }
.cv-canvas:hover .cv-plus-btn, .cv-plus-btn:focus-visible, .cv-plus.on .cv-plus-btn { opacity: 1; }
.cv-plus.on { height: 24px; border-top: 2px solid var(--accent); }
.cv-plus.on .cv-plus-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.cv-plus-on { position: absolute; left: 12px; top: 2px; font-size: var(--fs-12); color: var(--accent); font-weight: 600; }
.cv-long { font-size: var(--fs-13); color: #8a5a00; padding: 2px 10px 2px 22px; }
.cv-card { margin: 2px 0 8px 22px; padding: 10px 14px; border: 2px solid var(--accent); border-radius: 10px; background: #fff; display: grid; gap: 4px; }
.cv-card-head { display: flex; gap: 8px; align-items: baseline; }
.cv-card-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.cv-words { margin: 6px 0; }
.cv-box { width: 100%; }
.cv-en-ref { font-size: var(--fs-13); color: var(--muted); margin-bottom: 3px; overflow-wrap: anywhere; }
.cv-other { margin-top: 3px; font-size: var(--fs-13); }
.cv-other summary { color: var(--accent); cursor: pointer; }
.cv-other-row { margin-top: 4px; }
.cv-other-lbl { display: block; font-size: var(--fs-11); color: var(--muted); font-weight: 600; }
.cv-addyou { font-size: var(--fs-13); }
.cv-opt { border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; margin: 6px 0; }
.cv-opt .cv-words { margin: 2px 0 4px; }
.cv-opt-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.cv-opt-head .fe-o-tools { display: inline-flex; gap: 6px; }
.cv-show { border-top: 1px solid #f0f1f3; padding-top: 6px; margin-top: 4px; }
.cv-show-line { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.cv-show-words { font-size: var(--fs-15); }
.cv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.cv-chip-btn { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 2px 10px; font: inherit; font-size: var(--fs-13); cursor: pointer; }
.cv-chip-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cv-acts { margin: 6px 0 0; font-size: var(--fs-13); }
.cv-more { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 4px; }
.cv-more > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.cv-tray { margin-top: 10px; }
.cv-palette { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; }
.cv-palette h4 { margin: 8px 0 2px; font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .03em; color: #4b5563; }
.cv-pal-at { margin: 0; font-size: var(--fs-13); color: var(--muted); }
.cv-pal-list { display: grid; gap: 2px; }
.cv-pal-btn { text-align: left; border: 0; background: none; font: inherit; font-size: var(--fs-13); padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.cv-pal-btn:hover:not([disabled]), .cv-pal-btn:focus-visible { background: var(--accent-soft); }
.cv-pal-btn[disabled] { color: var(--muted); cursor: default; }
.cv-pal-more summary { cursor: pointer; font-size: var(--fs-13); color: var(--accent); }
.cv-tr, .cv-conditions, .cv-lists { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.cv-tr-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 6px; }
.cv-tr-table td { vertical-align: top; }
.cv-tr-table td:first-child { width: 28%; font-size: var(--fs-13); }
.cv-tr-table td:nth-child(2) { width: 34%; overflow-wrap: anywhere; }
.cv-cond-card h3 .sub { font-weight: 400; margin-left: 6px; }
.cv-cond-boxes { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.cv-cond-box { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; border-top: 1px solid #f0f1f3; padding-top: 6px; }
.cv-cond-box .cv-words { margin: 0; }
.cv-cond-sw { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: flex-end; }
@media screen and (max-width: 1280px) {
  .cv-panes, .cv-page:not([data-tab="form"]) .cv-panes { grid-template-columns: minmax(0, 1fr) 190px; }
  .cv-page:not([data-tab="form"]) .cv-panes { grid-template-columns: minmax(0, 1fr); }
  .cv-preview { display: none; }
  .cv-page[data-pane="preview"] .cv-preview { display: block; position: fixed; inset: 0; z-index: 60; max-height: none; border-radius: 0; }
  .cv-page[data-pane="preview"] .fe-pv-close, .cv-page .cv-only-narrow { display: inline-block; }
}
@media screen and (max-width: 760px) {
  .cv-panes { grid-template-columns: minmax(0, 1fr); }
  .cv-pal-pane { position: static; max-height: none; order: 2; }
  .cv-row { grid-template-columns: minmax(0, 1fr); }
  .cv-side { align-items: flex-start; }
  .cv-cond-box { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- The text editor (public/forms-text-editor.mjs): a policy written like a document, beside the patient
   app's preview. The language tabs (a language missing boxes says how many), the formatting bar over the typing box
   (sticky while the text scrolls), the boxes and the practice's facts drawn as chips that can't be typed in, the
   settings under the text. The Forms card's Policies group: its rows dragged or moved up and down. ---------- */
.fe-page[data-mode="text"] .fe-panes { grid-template-columns: minmax(0, 1fr) 432px; }
.fe-page[data-mode="text"] .fe-pane-edit { padding: 8px 16px 16px; }
.tx-checks { margin: 0 0 8px; font-size: var(--fs-13); }
.tx-checks summary { cursor: pointer; color: #6b4a00; font-weight: 600; }
.tx-checks.bad summary { color: var(--danger); }
.tx-checks .fe-problems { margin: 6px 0; }
.tx-langs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tx-lang { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 6px 12px; border-bottom: 2px solid transparent; cursor: pointer; }
.tx-lang.on { color: var(--ink); border-bottom-color: var(--accent); }
.tx-toplace { color: #8a5a00; font-weight: 600; }
.tx-missing { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; font-size: var(--fs-13); }
.tx-missing p { margin: 0 0 6px; }
.tx-missing ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tx-missing li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.tx-missing-text { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.tx-missing-acts { display: inline-flex; gap: 8px; align-items: center; }
.tx-sheet { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tx-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: 52px; z-index: 5; border-radius: 8px 8px 0 0; }
.tx-tool, .tx-pop button { border: 0; background: none; font: inherit; font-size: var(--fs-13); color: var(--ink); padding: 4px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.tx-tool:hover, .tx-tool:focus-visible, .tx-pop button:hover, .tx-pop button:focus-visible { background: var(--accent-soft); }
.tx-sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; }
.tx-menu { position: relative; display: inline-block; }
.tx-pop { position: absolute; top: 100%; left: 0; z-index: 30; display: grid; min-width: 170px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.tx-pop[hidden] { display: none; }
.tx-pop button { text-align: left; }
.tx-pop-sep { height: 1px; background: var(--line); margin: 4px 0; }
.tx-pop .tx-size-small { font-size: var(--fs-12); }
.tx-pop .tx-size-large { font-size: var(--fs-17); }
/* The typing box: the policy's own sizes (normal 16px, small 13px, large 19px; the browser's Size command writes
   <font size>, read back as small, normal or large). */
.tx-doc { min-height: 320px; padding: 14px 18px; font-size: var(--fs-15); line-height: 1.5; outline: none; overflow-wrap: anywhere; }
.tx-doc:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.tx-doc[hidden] { display: none; }
.tx-doc h2 { font-size: var(--fs-22); margin: 14px 0 6px; }
.tx-doc h3 { font-size: var(--fs-17); margin: 12px 0 4px; }
.tx-doc p { margin: 0 0 10px; }
.tx-doc ul, .tx-doc ol { margin: 0 0 10px; padding-left: 26px; }
.tx-doc li > ul, .tx-doc li > ol { margin: 2px 0 0; }
.tx-doc li.tx-wrap { list-style: none; }
.tx-doc a { color: var(--accent); text-decoration: underline; }
.tx-doc .r-sm, .tx-doc font[size="1"], .tx-doc font[size="2"] { font-size: var(--fs-13); }
.tx-doc .r-lg, .tx-doc font[size="5"], .tx-doc font[size="6"], .tx-doc font[size="7"] { font-size: var(--fs-17); }
.tx-doc font[size="3"], .tx-doc font[size="4"] { font-size: var(--fs-15); }
.tx-doc.tx-small { min-height: 90px; padding: 8px 10px; font-size: var(--fs-15); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tx-chip { display: inline-block; padding: 0 6px; margin: 0 1px; border-radius: 999px; background: #e7f0fe; color: #1d4ed8; font-size: .9em; line-height: 1.5; user-select: all; white-space: nowrap; }
.tx-box { display: inline-block; margin-right: 6px; padding: 0 6px; border: 1.5px solid #6b7280; border-radius: 4px; background: #fff; color: #374151; font-size: var(--fs-13); line-height: 1.5; user-select: none; vertical-align: 1px; }
.tx-box.tx-check { font-size: var(--fs-15); padding: 0 4px; }
.tx-box.tx-init { font-weight: 600; letter-spacing: .02em; }
.tx-flash { animation: tx-flash 1.8s ease-out; }
@keyframes tx-flash { 0% { background: #ffe58a; } 100% { background: transparent; } }
.tx-settings { margin-top: 10px; }
.tx-summary, .tx-refuse { border-left: 3px solid var(--accent-soft); padding: 2px 0 6px 12px; margin: 0 0 6px; display: grid; gap: 6px; }
/* Intake editor revamp (beta 2): a risk's initials box, a step's and a Call us if line's mark at the start of their
   paragraph (a step's says how long it takes; click it to change that), and a picture that can't be typed in (click
   it to change what it shows and its caption). */
.tx-box.tx-risk { border-style: dashed; }
.tx-mark { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; font-size: var(--fs-13); font-weight: 600; line-height: 1.6; user-select: none; vertical-align: 1px; cursor: pointer; }
.tx-mark.tx-step { background: #eef3fb; color: #24467a; }
/* The shared sections editor (0.23, public/forms-shared-editor.mjs): the text editor's sheet and bar, the four sections
   one under another, each block typed in place with its Show and tools above it. The office's color (--sh-color, set
   on the page from Settings → Practice; teal without one) shows on the Color button and on words marked with it. */
.sh-pickers { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 8px; }
.sh-pickers .tx-langs { border-bottom: 0; margin: 0; }
.sh-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--sh-color, #1f6f78); vertical-align: -1px; }
.sh-cond-bar { margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: var(--fs-13); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.sh-cond-bar[hidden] { display: none; }
.sh-cond-bar .lt-show { margin: 0; flex: 1 1 260px; }
.sh-doc { padding: 6px 18px 14px; }
.sh-sec { padding: 8px 0 4px; border-top: 1px solid var(--line); }
.sh-sec:first-child { border-top: 0; }
.sh-sec-name { margin: 6px 0 2px; font-size: var(--fs-13); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sh-sec > .help { margin: 0 0 4px; font-size: var(--fs-13); }
.sh-block { margin: 6px 0; padding: 4px 8px 6px; border-left: 3px solid transparent; border-radius: 6px; }
.sh-block:hover, .sh-block:focus-within { border-left-color: var(--accent-soft); background: #fafbfc; }
.sh-gutter { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: var(--fs-13); }
.sh-gutter .lt-show { margin: 0; font-size: var(--fs-13); }
.sh-notes { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.sh-tools { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; visibility: hidden; }
.sh-block:hover .sh-tools, .sh-block:focus-within .sh-tools { visibility: visible; }
.sh-text { margin: 2px 0 0; padding: 4px 6px; font-size: var(--fs-15); line-height: 1.55; outline: none; overflow-wrap: anywhere; border-radius: 4px; min-height: 1.6em; }
.sh-text:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.sh-heading { font-size: var(--fs-17); font-weight: 700; }
ul.sh-text { padding-left: 28px; }
.sh-text a { color: var(--sh-color, #1f6f78); text-decoration: underline; }
.sh-chip { display: inline-block; padding: 0 6px; margin: 0 1px; border-radius: 999px; background: #e7f0fe; color: #1d4ed8; font-size: .9em; line-height: 1.5; user-select: all; white-space: nowrap; }
.sh-cond { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: pointer; }
.sh-button { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 4px; }
.sh-btn-face { display: inline-block; min-width: 4em; padding: 8px 18px; border: 2px solid var(--sh-color, #1f6f78); border-radius: 8px; font-weight: 600; outline: none; }
.sh-btn-face:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.sh-add { margin: 4px 0 2px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-13); }
.sh-draft { margin: 10px 0 0; font-size: var(--fs-13); }
.tx-mark.tx-call { background: #fdecea; color: #8a1c12; cursor: default; }
.tx-pic { margin: 0 0 10px; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; cursor: pointer; user-select: none; }
.tx-pic img { display: block; max-width: 100%; max-height: 240px; margin: 0 auto; border-radius: 6px; }
.tx-pic figcaption { margin-top: 6px; font-size: var(--fs-13); text-align: center; }
.tx-pic-alt, .tx-pic-cap { display: block; }
.tx-pic-alt { color: var(--muted); }

/* The Forms card's Policies group */
.pf-forms-table .pf-group-head th { padding-top: 14px; text-align: left; font-size: var(--fs-15); white-space: normal; } /* UI patch P1.3: its help line wraps instead of widening the table */
.pf-forms-table .pf-group-head .sub { font-weight: 400; }
.pf-forms-table tr.pf-pol td:first-child { padding-left: 18px; }
.pf-forms-table tr.pf-pol[draggable="true"] { cursor: grab; }
.pf-forms-table tr.pf-pol.dragging { opacity: .5; }
.pf-forms-table tr.pf-pol.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.pf-forms-table tr.pf-pol.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
.pf-forms-table .pf-pol-move { display: inline-flex; gap: 2px; margin-right: 6px; vertical-align: middle; }
.pf-forms-table tr.pf-out td { color: var(--muted); }
.pf-forms-table tr.pf-out strong { color: var(--ink); }
.pf-forms-table .pf-group-foot td { padding-bottom: 12px; }

/* ---------- Stage 5: procedure forms (forms.mjs, schedule.mjs, schedule-visual.mjs, forms-followups.mjs) ---------- */
/* The consent badge: grey Consent sent / needed, amber the day before and the day of, red once the visit started. On
   the schedule it's a button (it opens the visit's consents), drawn like the other badges. */
.badge.consent-badge { font-family: inherit; line-height: inherit; }
button.badge.consent-badge { cursor: pointer; }
button.badge.consent-badge:hover { filter: brightness(.95); }
.sched-meta .badge.consent-badge { font-size: var(--fs-11); padding: 1px 7px; }
/* Its pen inside a visual block, and in the legend */
.vb-consent { display: inline-block; margin-right: 3px; font-size: var(--fs-11); line-height: 1; padding: 1px 3px; border-radius: 3px; background: #eceef1; color: #3f4650; vertical-align: 1px; font-style: normal; }
.vb-consent.amber { background: #f7c04a; color: #3a2b00; }
.vb-consent.red { background: #e5484d; color: #fff; }
.vs-legend .vb-consent { width: auto; height: auto; border: 0; margin-right: 4px; vertical-align: 0; }
/* A visit's consents with their words (the Forms card's This visit, the consents' card, Consents needed today) */
.fc-consents { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: var(--fs-13); }
.fc-consents .fc-c-icon { display: inline-block; width: 14px; color: var(--faint); }
.fc-consents .fc-c-signed .fc-c-icon { color: var(--ok); font-weight: 700; }
.fc-consents .fc-c-title { font-weight: 600; }
.fc-consents .fc-c-state { color: var(--muted); }
.fc-consents .fc-c-needed .fc-c-state { color: #9a6200; }
.fc-consents .fc-c-draft { color: var(--muted); font-style: italic; }
.fc-consents .fc-c-changed .fc-c-icon, .fc-consents .fc-c-changed .fc-c-state { color: #c62828; font-weight: 600; }
.forms-card .fc-visits { display: grid; gap: 8px; margin-bottom: 6px; }
.forms-card .fc-visits h4 { margin-top: 2px; }
.forms-card .fc-visit { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.forms-card .fc-visit-head { display: flex; gap: 6px 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.forms-card .fc-visit-line { font-size: var(--fs-15); min-width: 0; overflow-wrap: anywhere; }
.fc-consent-card { display: grid; gap: 10px; justify-items: start; }
.fc-visit-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#vs-err:empty { display: none; }
/* The patient page's Forms card never widens its column (beta 2's fix: "Changes from forms" made the page 481 px wide on
   a 375 px phone): the grid item may shrink, and the table's columns wrap inside the card. */
#pt-forms { min-width: 0; container-type: inline-size; }
.forms-card .fc-changes { table-layout: fixed; width: 100%; }
.forms-card .fc-changes td { overflow-wrap: anywhere; }
.forms-card .fc-changes td:first-child { width: 6.2em; }
.forms-card .fc-changes td:last-child { width: 8em; }
/* In a narrow card (a phone, or the side column at about 1000 px), each change is a small block of lines. */
@container (max-width: 560px) {
  .forms-card .fc-changes, .forms-card .fc-changes tbody, .forms-card .fc-changes tr, .forms-card .fc-changes td { display: block; width: auto; }
  .forms-card .fc-changes tr { padding: 6px 0; border-bottom: 1px solid var(--line); }
  .forms-card .fc-changes td { border: 0; padding: 1px 0; }
  .forms-card .fc-changes td:first-child, .forms-card .fc-changes td:last-child { width: auto; }
  .forms-card .fc-changes td.nowrap { white-space: normal; }
}
/* Stage 5 beta 2: the dentist's co-sign (forms-cosign.mjs) */
.fc-consents [data-fv="cosign"] { margin-left: 6px; padding: 1px 8px; font-size: var(--fs-12); }
.cosign-body { display: grid; gap: 10px; }
.cosign-tabs { display: flex; gap: 6px; }
.cosign-pad { width: 100%; max-width: 600px; height: auto; aspect-ratio: 10 / 3; border: 1px solid var(--line); border-radius: 8px; background: #fff; touch-action: none; }
.cosign-row { display: flex; justify-content: space-between; align-items: center; }
#cs-err:empty { display: none; }
/* Print and Signed on paper (forms.mjs) */
.fc-print { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
/* The patient page's Photo (patient-photo.mjs) */
.pat-top > div:nth-child(2) { flex: 1; min-width: 0; }
.pat-acts { flex: none; align-self: flex-start; }
.photo-body { display: grid; gap: 10px; }
.ph-modes { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ph-modes label { display: inline-flex; gap: 6px; align-items: baseline; cursor: pointer; font-weight: 600; }
.ph-modes .sub { font-weight: 400; }
.ph-camera { display: grid; gap: 8px; justify-items: center; background: #111418; border-radius: 8px; padding: 8px; }
.ph-camera video { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 6px; background: #000; }
.ph-camera .sub { color: #c9ced6; }
.ph-cam-acts { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
.ph-cam-acts .link { color: #c9d8ff; cursor: pointer; }
.ph-shots { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.ph-shots figure { margin: 0; flex: none; display: grid; gap: 2px; justify-items: center; font-size: var(--fs-13); }
.ph-shots img { height: 120px; max-width: 200px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.ph-save { display: grid; gap: 4px; }
.ph-save .help { margin: 0; }
#ph-err:empty { display: none; }
.paper-body { display: grid; gap: 6px; }
/* Signed on paper's photo (consents and treatment plans, patient-photo.mjs sheetPhotoHtml): Take a photo and Choose a
   file side by side (wrapping on a narrow screen), the picture under them; the plan's folder choice once there's one */
.sheet-photo { display: grid; gap: 6px; min-width: 0; }
.sheet-photo-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-photo-preview { max-width: 100%; max-height: 260px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; justify-self: start; }
.paper-photo { display: grid; gap: 8px; margin-top: 14px; }
.paper-photo-folder { display: grid; gap: 4px; }
.paper-photo-folder[hidden] { display: none; }
.paper-photo-folder .help { margin: 0; }
#pp-err:empty { display: none; }
/* Follow-ups → New patient paperwork: the procedure forms emails under it (beta 2) */
.fu-procedure-mail { margin-top: 14px; }
.fu-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
/* Follow-ups → Consents needed today */
.fu-list .fu-day { flex: none; }
.fu-list .fu-consents td { vertical-align: top; }
.fu-list .fu-consents .fc-consents { font-size: var(--fs-13); }
/* Settings → Patient forms → Procedure forms (procedure-forms-settings.mjs): the groups on the left, the picked one on
   the right (owner's list, 2026-10-19: the one wide table didn't fit); stacked on a narrow screen */
.procedure-forms .notice { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; }
.pr-panes { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.pr-list { border-right: 1px solid var(--line); background: #f8f9fb; display: flex; flex-direction: column; max-height: 720px; }
.pr-groups { display: flex; flex-direction: column; overflow-y: auto; min-height: 0; flex: 1; }
.pr-item { display: grid; gap: 1px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.pr-item:hover { background: var(--accent-soft); }
.pr-item.on { background: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.pr-item.off .pr-item-name { color: var(--muted); }
.pr-item-name { font-weight: 600; font-size: var(--fs-15); overflow-wrap: anywhere; }
.pr-item .sub { font-size: var(--fs-12); }
.pr-list-acts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pr-item.pr-sets { border-bottom: 0; }
.pr-none { padding: 10px 12px; margin: 0; }
.pr-right { min-width: 0; padding: 12px 16px; }
.pr-detail-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pr-detail-head h3 { margin: 0; overflow-wrap: anywhere; }
.pr-detail-head .spacer { flex: 1; }
.pr-on-switch { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: var(--fs-13); margin-left: 8px; cursor: pointer; }
.pr-fields { display: grid; gap: 4px; }
.pr-fields .lbl { margin-top: 8px; }
.pr-fields select, .pr-fields input[type=text] { width: 100%; min-width: 0; }
.pr-names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#pr-codes, .pr-sets-table [data-s-f="codes"] { font-family: ui-monospace, monospace; font-size: var(--fs-13); }
.pr-sets-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.pr-sets-pick label { display: flex; gap: 6px; align-items: baseline; cursor: pointer; font-size: var(--fs-13); }
.pr-sets-pick .sub { font-size: var(--fs-12); font-family: ui-monospace, monospace; }
.pr-sets-table { width: 100%; }
.pr-sets-table input[type=text] { width: 100%; min-width: 0; padding: 6px 8px; font-size: var(--fs-13); }
.pr-sets-table td:first-child { width: 40%; }
.pr-sets-table td:last-child { width: 1%; white-space: nowrap; }
@media (max-width: 760px) {
  .pr-panes { grid-template-columns: 1fr; }
  .pr-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 260px; }
  .pr-names { grid-template-columns: 1fr; }
}
.pr-table-acts { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 10px 0 12px; }
.pr-flex-pick { cursor: pointer; }
.pr-flex-result { border-top: 1px solid var(--line); padding: 4px 0 10px; font-size: var(--fs-13); }
.pr-flex-result p { margin: 8px 0 4px; }
.pr-flex-list { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.pr-flex-result details { margin-top: 6px; }
#pr-err { margin: 0 auto 0 0; }
#pr-err:empty { display: none; }
/* The editor's Forms card: which groups send a consent or a page */
.pf-forms .pf-sent-for { margin-top: 4px; font-size: var(--fs-13); }

/* ---------- Present mode (treatment presentation Stage 1, public/present.mjs) ----------
   The staff app's page a patient holds: full screen (no menu, no search, no banners), large type for an iPad held
   across a chair, and nothing that runs off a 640 px screen sideways. The printout's own styles are not used. */
body.presenting { background: var(--card); }
body.presenting .topbar, body.presenting #main-nav, body.presenting #bottom-nav, body.presenting .nav-scrim, body.presenting #backup-alert, body.presenting #forms-alert, body.presenting #plans-alert, body.presenting #compliance-alert, body.presenting #device-requests { display: none !important; }
body.presenting main { padding: 0; max-width: none; }
/* The plan page's Present button, a link shaped like Print under it */
.controls a.btn#present { display: block; box-sizing: border-box; text-align: center; text-decoration: none; }
.pm { font-size: clamp(18px, 1rem + 0.6vw, 24px); line-height: 1.45; max-width: 60rem; margin: 0 auto; padding: 24px 16px 96px; overflow-x: hidden; color: var(--ink); }
.pm *, .pm *::before, .pm *::after { box-sizing: border-box; }
.pm .pm-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 18px; }
.pm .pm-logo { max-width: min(100%, 22rem); max-height: 6rem; object-fit: contain; }
.pm .pm-contact { color: var(--muted); font-size: .8em; overflow-wrap: anywhere; }
.pm .pm-title { font-size: 1.6em; line-height: 1.2; margin: 0 0 4px; overflow-wrap: anywhere; color: var(--office-text, inherit); }
/* 0.23: the office's colors (present-view.mjs lookAttr) set --accent, --accent-soft and --office-* on .pm; unset, the staff app's. */
.pm .pm-sub { margin: 0 0 18px; color: var(--muted); }
.pm table { width: 100%; border-collapse: collapse; word-break: break-word; }
.pm .pm-procs th { text-align: left; font-size: .75em; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line-strong); }
.pm .pm-procs td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pm .pm-tooth { width: 5.5em; }
.pm .pm-code { color: var(--muted); font-size: .8em; margin-right: 4px; }
.pm .pm-totals { margin: 18px 0 8px auto; max-width: 30rem; }
.pm .pm-totals td { padding: 6px 10px; }
.pm .pm-totals td:last-child { text-align: right; white-space: nowrap; }
.pm .pm-totals .pm-patient td { font-weight: 700; font-size: 1.15em; border-top: 2px solid var(--ink); padding-top: 10px; }
.pm .pm-totals .pm-chosen-row td { color: var(--accent); font-weight: 600; }
/* To-do list 2026-10-20: Pay in advance's chosen row also says the saving, so it may wrap rather than squeeze the labels. */
.pm .pm-totals .pm-chosen-row td:last-child { white-space: normal; }
.pm .pm-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 16px; margin: 24px 0 8px; }
.pm .pm-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 48px; padding: 18px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.pm .pm-card.on { border: 2px solid var(--accent); background: var(--accent-soft); }
.pm .pm-card-title { font-weight: 700; font-size: 1.1em; overflow-wrap: anywhere; }
.pm .pm-card-text { color: var(--muted); font-size: .85em; overflow-wrap: anywhere; }
.pm .pm-amt { font-weight: 600; overflow-wrap: anywhere; }
/* To-do list 2026-10-20: Pay in advance's saving in dollars, under its amount. */
.pm .pm-save { color: var(--ok); font-weight: 600; overflow-wrap: anywhere; }
.pm .pm-qr img { width: 9rem; max-width: 100%; height: auto; display: block; background: #fff; }
.pm .pm-choose { margin-top: auto; min-height: 48px; font-size: 1em; width: 100%; border-radius: 10px; }
.pm .pm-chosen-tag { font-weight: 700; color: var(--ok); }
.pm .pm-change { font-size: .85em; min-height: 44px; }
.pm .pm-err { color: var(--danger); margin: 8px 0; font-weight: 600; }
.pm .pm-err:empty { display: none; }
.pm .pm-err.ok { color: var(--ok); }
.pm .pm-note, .pm .pm-disclaimer { margin: 20px 0; color: var(--muted); font-size: .85em; overflow-wrap: anywhere; }
.pm .pm-note h2 { font-size: 1em; margin: 0 0 4px; color: var(--ink); }
.pm .pm-note p { margin: 0; white-space: pre-line; }
.pm .pm-sign { margin-top: 28px; padding: 20px; border: 1px solid var(--line-strong); border-radius: 14px; display: grid; gap: 14px; min-width: 0; }
.pm .pm-sign h2, .pm .pm-done h2 { font-size: 1.2em; margin: 0; }
.pm .pm-who { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.pm .pm-who legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.pm .pm-radio, .pm .pm-check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.pm .pm-radio input, .pm .pm-check input { width: 24px; height: 24px; margin: 3px 0 0; flex: none; }
.pm .pm-radio:has(input:disabled) { color: var(--faint); cursor: default; }
.pm .pm-hint { color: var(--muted); font-size: .8em; margin: 0; }
/* Decisions round (D2): where the pad would be while a payment card is offered and none is chosen. */
.pm .pm-choose-first { margin: 28px 0 0; font-size: 1em; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.pm .pm-field { display: grid; gap: 6px; min-width: 0; }
.pm .pm-field label { font-weight: 600; }
.pm .pm-field input, .pm .pm-field select { font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; width: 100%; max-width: 30rem; min-width: 0; background: #fff; }
.pm .pm-field input[hidden] { display: none; }
.pm .pm-pad-box { position: relative; }
.pm .pm-pad { display: block; touch-action: none; width: 100%; height: min(12rem, 42vh); background: #fff; border: 2px dashed var(--line-strong); border-radius: 10px; }
.pm .pm-pad-hint { position: absolute; left: 14px; bottom: 10px; color: var(--faint); font-size: .75em; pointer-events: none; }
.pm .pm-pad-acts { display: flex; gap: 24px; flex-wrap: wrap; }
.pm .pm-pad-acts .link { min-height: 44px; }
.pm .pm-typed-sig { font-family: "Segoe Script", "Brush Script MT", "Snell Roundhand", cursive; font-size: 2em; min-height: 1.6em; padding: 4px 12px; border-bottom: 2px solid var(--ink); overflow-wrap: anywhere; }
.pm #pm-sign { min-height: 52px; font-size: 1em; justify-self: start; padding: 10px 28px; border-radius: 10px; }
.pm .pm-done { margin-top: 28px; padding: 22px; border-radius: 14px; background: #ecf8f1; border: 1px solid #b9e3cb; display: grid; gap: 6px; }
.pm .pm-done p { margin: 0; }
.pm .pm-card.pm-card-off { opacity: .45; box-shadow: none; }
.pm .pm-off-tag { color: var(--muted); font-size: .9em; }
.pm .pm-accepted { margin-top: 28px; padding: 20px; border: 1px solid var(--line-strong); border-radius: 14px; display: grid; gap: 8px; min-width: 0; }
.pm .pm-accepted h2 { font-size: 1.2em; margin: 0; }
.pm .pm-sig-box { min-height: 90px; display: flex; align-items: flex-end; padding: 6px 12px; border-bottom: 2px solid var(--ink); }
.pm .pm-sig-img { max-width: min(420px, 100%); max-height: 140px; }
.pm .pm-sig-box .pm-typed-sig { border-bottom: 0; padding: 0; }
.pm .pm-sig-paper { margin: 0; color: var(--muted); }
.pm .pm-accepted-by { margin: 0; color: var(--muted); font-size: .9em; }
/* 0.26: the staff plan page's accepted view (the signed plan as the patient saw it) and its tools */
.accepted-view .pm { padding: 0; font-size: var(--fs-15); max-width: none; }
.accepted-box { display: grid; gap: 8px; }
.accepted-box .btn { width: 100%; text-align: center; text-decoration: none; }
/* Settings → Payment plans: a saved plan's buttons */
.saved-plan-acts { display: flex; gap: 6px; flex-wrap: wrap; }
/* Treatment plan edits (2026-11-01): each saved plan folds (a <details>, public/settings-payplans.mjs): its summary the
   tap target (the title, On treatment plans and a one-line summary), the arrow as the Staff drawer's folds; ↑ ↓ Remove
   at the top of its options. */
.saved-plan > summary { cursor: pointer; list-style: none; min-height: 44px; padding: 10px 0 10px 1.4em; position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; overflow-wrap: anywhere; }
.saved-plan > summary::-webkit-details-marker { display: none; }
.saved-plan > summary::before { content: '\25B8'; color: var(--muted); position: absolute; left: 0; top: 12px; }
.saved-plan[open] > summary::before { content: '\25BE'; }
.saved-plan-name { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.saved-plan-name strong { font-size: var(--fs-15); }
.saved-plan-name .badge { font-weight: 400; }
.saved-plan-line { color: var(--muted); font-size: var(--fs-13); }
.saved-plan[open] > summary { border-bottom: 1px solid var(--line); }
.saved-plan-body { padding-bottom: 8px; }
.saved-plan-body > .saved-plan-acts { justify-content: flex-end; padding-top: 10px; }
.pm .pm-staff { position: fixed; right: 16px; bottom: 16px; z-index: 65; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); background: var(--bg); color: var(--faint); opacity: .7; cursor: pointer; }
.pm .pm-staff:hover, .pm .pm-staff:focus-visible { opacity: 1; color: var(--accent); }
.pm .pm-drawer { position: fixed; right: 0; top: 0; bottom: 0; z-index: 70; width: min(26rem, 100vw); overflow-y: auto; overflow-x: hidden;
  background: var(--card); border-left: 1px solid var(--line-strong); box-shadow: -12px 0 32px rgba(0,0,0,.18); padding: 16px 18px 32px; font-size: var(--fs-15); display: grid; gap: 12px; align-content: start; }
.pm .pm-drawer[hidden] { display: none; }
.pm .pm-drawer-head { display: flex; justify-content: space-between; align-items: center; }
.pm .pm-drawer-head h2 { margin: 0; font-size: var(--fs-17); }
.pm .pm-drawer h3 { margin: 8px 0 0; font-size: var(--fs-15); }
.pm .pm-drawer .pm-hint { font-size: var(--fs-13); }
.pm .pm-drawer .pm-field input, .pm .pm-drawer .pm-field select { font-size: var(--fs-input); padding: 8px 10px; }
.pm .pm-drawer .icon-btn { background: #eceef1; }
.pm .pm-unlock, .pm .pm-ov { display: grid; gap: 12px; min-width: 0; }
.pm .pm-ov-sec { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.pm .pm-ov-sec legend { font-weight: 700; padding: 0 4px; }
.pm .pm-switch { display: flex; gap: 10px; align-items: center; min-height: 36px; cursor: pointer; }
.pm .pm-switch input { width: 20px; height: 20px; flex: none; }
/* A card the plan's rules hide (Presenting → Staff can show hidden payment options): why, under its name. */
.pm .pm-switch-why { display: block; font-size: var(--fs-13); color: var(--muted); }
.pm .pm-switch-hidden input { align-self: flex-start; margin-top: 3px; }
.pm .pm-ov-row { display: grid; gap: 4px; min-width: 0; }
.pm .pm-ov-row label { font-size: var(--fs-13); font-weight: 600; }
.pm .pm-ov-row select { width: 100%; }
.pm .pm-stepper { display: flex; align-items: center; gap: 6px; }
.pm .pm-stepper .btn { min-width: 44px; min-height: 40px; padding: 4px 0; font-size: var(--fs-22); line-height: 1; }
.pm .pm-stepper input { width: 6em; min-width: 0; text-align: right; }
.pm .pm-unit { color: var(--muted); }
.pm .pm-drawer-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pm .pm-drawer #pm-drawer-err { margin: 0; }
/* To-do list 2026-10-20: the discount and payment plan terms start collapsed (a <details>, present-view.mjs termsHtml),
   their summary the tap target with what they say now. The staff plan page's toolbox (.pm-tools, app.js renderPlan)
   draws the same builders, so it gets the same rules. */
.pm .pm-ov-fold, .pm-tools .pm-ov-fold { display: block; padding: 0; }
.pm .pm-ov-fold > summary, .pm-tools .pm-ov-fold > summary { cursor: pointer; min-height: 44px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; font-weight: 700; overflow-wrap: anywhere; }
.pm-ov-fold > summary { list-style: none; }
.pm-ov-fold > summary::-webkit-details-marker { display: none; }
.pm-ov-fold > summary::before { content: '\25B8'; color: var(--muted); width: 1em; flex: none; }
.pm-ov-fold[open] > summary::before { content: '\25BE'; }
.pm-ov-sum { font-weight: 400; font-size: var(--fs-13); color: var(--muted); }
.pm .pm-ov-body, .pm-tools .pm-ov-body { display: grid; gap: 8px; padding: 0 12px 12px; min-width: 0; }
.pm-tools { display: grid; gap: 8px; margin: 8px 0 12px; min-width: 0; }
.pm-tools .pm-ov-sec { border: 1px solid var(--line); border-radius: 10px; margin: 0; min-width: 0; }
.pm-tools .pm-ov-row { display: grid; gap: 4px; min-width: 0; }
.pm-tools .pm-ov-row label { font-size: var(--fs-13); font-weight: 600; }
.pm-tools .pm-ov-row select { width: 100%; }
.pm-tools .pm-stepper { display: flex; align-items: center; gap: 6px; }
.pm-tools .pm-stepper .btn { width: auto; margin-top: 0; min-width: 40px; min-height: 36px; padding: 4px 0; font-size: var(--fs-17); line-height: 1; }
.pm-tools .pm-stepper input { width: 6em; min-width: 0; text-align: right; }
.pm-tools .pm-unit { color: var(--muted); }
.pm-tools #terms-err { margin: 0; }
.pm-tools #terms-err:empty { display: none; }
/* The plan page's controls stay in view beside the paper; with the toolbox opened they scroll inside themselves. */
@media (min-width: 901px) { .controls { max-height: calc(100vh - 32px); overflow-y: auto; } }
/* Choose this: the question in words, large enough to read across a chair */
.modal-body.pm-confirm p { margin: 0; font-size: var(--fs-22); line-height: 1.4; }
/* Treatment presentation Stage 2. A window opened from the staff drawer (Add a picture, Take a photo, a confirm) sits
   above the drawer (70) and below the toasts (100). */
body.presenting .modal-backdrop { z-index: 75; }
/* The pictures strip above the procedures: two large side by side (one alone takes the width), scrolling sideways
   inside itself so the page never does; ‹ › and "k of N" under it when there are more than fit. */
.pm .pm-pics { margin: 0 0 20px; min-width: 0; }
.pm-pics-track { display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; max-width:100%; overscroll-behavior-x: contain; scrollbar-width: none; }
.pm-pics-track::-webkit-scrollbar { display: none; }
.pm-pic { flex:0 0 calc(50% - 6px); margin:0; scroll-snap-align:start; min-width:0; }
.pm-pics-one .pm-pic { flex-basis:100%; }
.pm-pic img { display:block; width:100%; height:auto; max-height:60vh; object-fit:contain; background:#111; border-radius:8px; }
.pm-pic figcaption { margin-top: 6px; font-size: .85em; color: var(--muted); overflow-wrap: anywhere; }
.pm-pics-nav { display:flex; justify-content:center; align-items:center; gap:1rem; margin-top: 8px; }
.pm-pics-two .pm-pics-nav { display: none; }
.pm-pics-nav button { min-width: 44px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--card); color: var(--ink);
  font-size: 1.4em; line-height: 1; cursor: pointer; padding: 0; }
.pm-pics-nav button:disabled { opacity: .35; cursor: default; }
.pm-pics-count { color: var(--muted); font-size: .85em; min-width: 4.5em; text-align: center; }
/* Each procedure's patient name beside Open Dental's description, What is this? and the explanation under the row */
.pm-name { font-weight:600; }
.pm-desc { color: var(--muted); }
.pm .pm-what { min-height: 44px; padding: 0 2px; font-size: .85em; white-space: nowrap; }
.pm .pm-explain td { background: var(--accent-soft); padding: 4px 14px 14px; }
.pm .pm-explain[hidden] { display: none; }
.pm-explain-body { font-size: .92em; overflow-wrap: anywhere; }
.pm-explain-body p { margin: .5rem 0; }
.pm-explain-body h3 { font-size: 1.05em; margin: .75rem 0 .25rem; }
.pm-explain-body h4 { margin:.75rem 0 .25rem; }
.pm-explain-body ul, .pm-explain-body ol { margin: .4rem 0; padding-left: 1.4em; }
/* Phases: a heading row per priority in the same table, its "when" and a small patient portion */
.pm .pm-procs .pm-phase th { padding-top: 1rem; text-transform: none; letter-spacing: 0; font-size: 1em; color: var(--ink); border-bottom: 1px solid var(--line-strong); }
.pm-phase th { text-align:left; padding-top:1rem; }
.pm-phase-when { font-weight: 400; color: var(--muted); }
.pm-phase-portion { display:block; font-size:.8em; font-weight:400; color: var(--muted); }
/* The drawer's What the patient sees */
.pm .pm-show { display: grid; gap: 12px; min-width: 0; }
.pm .pm-show-sec { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.pm .pm-show-label { margin: 0; font-weight: 700; font-size: var(--fs-15); }
.pm .pm-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.pm .pm-seg .btn { min-height: 40px; flex: 1 1 auto; }
.pm .pm-seg .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pm .pm-show input[type=text] { font: inherit; font-size: var(--fs-input); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; width: 100%; min-width: 0; background: #fff; }
.pm .pm-pic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pm .pm-pic-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 10px; align-items: center; }
.pm .pm-pic-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #111; grid-row: span 2; }
.pm .pm-pic-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pm .pm-pic-acts .btn { min-width: 40px; min-height: 36px; padding: 2px 0; }
.pm .pm-pic-acts .link { min-height: 36px; margin-left: auto; }
.pm .pm-warn { color: #8a5a00; font-weight: 600; }
.pm #pm-show-err { margin: 0; }
/* Add a picture: the patient's Open Dental Images as thumbnails, by category */
.pk-cat { font-size: var(--fs-15); margin: 14px 0 6px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pk-item { position: relative; display: grid; gap: 4px; align-content: start; padding: 6px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-width: 0; font-size: var(--fs-13); }
.pk-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pk-item:has(input:disabled:not(:checked)) { opacity: .55; cursor: default; }
.pk-item input { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; margin: 0; }
.pk-item img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; background: #111; }
.pk-item .pk-line { overflow-wrap: anywhere; }
.pk-no { cursor: default; background: #f7f8fa; }
.pk-no .pk-type { display: grid; place-items: center; height: 120px; border-radius: 6px; background: #eceef1; color: var(--muted); font-weight: 700; text-align: center; padding: 6px; }
.pk-no .pk-why { color: var(--muted); font-style: italic; }
.pk-count { margin: 12px 0 0; }
.pk-progress { color: var(--muted); font-size: var(--fs-15); }
.pk-fails { margin: 6px 0 0; padding-left: 1.2em; overflow-wrap: anywhere; }
@media print { body.presenting .pm .pm-staff, body.presenting .pm .pm-drawer { display: none !important; } }
/* Plan edits (2026-11-01): Present mode's toolbar (present-view.mjs quickBarHtml), at the top while the plan is open:
   Text, Email and Print as small buttons on the right, a button's reason under them when it can't send, and the last
   press's result. Itemize fees: a Fee column. Print: the printout's sheet (.pm-print-sheet, plan-paper.mjs) is in the
   page only for the print dialog, and only it prints (body.pm-printing), as the plan page's paper does. */
.pm .pm-quick { display: grid; justify-items: end; gap: 4px; margin: 0 0 12px; min-width: 0; }
.pm .pm-quick-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pm .pm-quick-btn { min-height: 44px; min-width: 5.5rem; font-size: var(--fs-15); }
.pm .pm-quick-why { margin: 0; color: var(--muted); font-size: var(--fs-15); text-align: right; overflow-wrap: anywhere; }
.pm .pm-quick-result { margin: 0; font-size: var(--fs-15); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.pm .pm-quick-result:empty { display: none; }
.pm .pm-procs .pm-fee { width: 7em; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pm-print-sheet { display: none; }
@media print {
  body.presenting .pm .pm-quick { display: none !important; }
  body.pm-printing > :not(.pm-print-sheet) { display: none !important; }
  body.pm-printing > .pm-print-sheet { display: block; }
}

/* ---------- The plan page after a presentation (treatment presentation Stage 1, app.js drawPlanStatus) ----------
   Above the paper and never printed: the status line, the banner for this plan's own payment options, and the
   Outcome panel staff fill in once the device is back. The patient card's line under a plan's name is .plan-line. */
#plan-status { display: grid; gap: 10px; margin-bottom: 14px; min-width: 0; }
#plan-status:empty { display: none; }
.plan-status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.plan-status-line .plan-line { color: var(--muted); font-size: var(--fs-15); overflow-wrap: anywhere; }
.plan-status-line .link { font-weight: 600; text-decoration: none; }
.plan-line { overflow-wrap: anywhere; }
td.card-title .plan-line { margin-top: 2px; font-weight: 400; }
/* Present and Open: side by side when there's room, one under the other in a narrow column (never wider than it) */
.plan-table td.card-action .btn { margin: 2px 0; }
.override-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px;
  background: #fff6dc; border: 1px solid #f0d48a; border-radius: 8px; color: #5c4300; font-size: var(--fs-15); overflow-wrap: anywhere; }
.override-banner > span { flex: 1 1 16rem; min-width: 0; }
.outcome-panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  display: grid; gap: 12px; min-width: 0; }
.outcome-panel h2 { margin: 0; font-size: var(--fs-17); }
.outcome-panel > .sub { margin: -6px 0 0; font-size: var(--fs-13); overflow-wrap: anywhere; }
.outcome-panel .hint { margin: -4px 0 0; }
.outcome-panel .lbl { display: block; font-weight: 600; font-size: var(--fs-15); margin-bottom: 6px; }
.oc-radios { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
/* Radios as large tap targets: the whole pill is the label */
.oc-radio { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: #fff; cursor: pointer; font-weight: 600; font-size: var(--fs-15); overflow-wrap: anywhere; }
.oc-radio input { width: 18px; height: 18px; margin: 0; flex: none; }
.oc-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.oc-radio:has(input:disabled) { color: var(--faint); cursor: default; background: #f7f8fa; }
.oc-radios .field-error { flex-basis: 100%; margin: 0; }
.outcome-panel .oc-note input { width: 100%; max-width: 32rem; box-sizing: border-box; }
.outcome-panel .outcome-err { margin: 0; }
.oc-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.oc-paper { border: 0; margin: 0; padding: 0; min-width: 0; }
.oc-paper legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.oc-paper .oc-radios { flex-direction: column; align-items: stretch; }
.oc-paper .oc-radio { border-radius: 8px; }

/* ---------- A plan sent to the patient (treatment presentation Stage 3: app.js drawPlanStatus, public/plan-send.mjs) ----------
   Sent and Viewed badges; the plan page's Send, Resend and Copy link; the banner when Open Dental's plan changed since
   it was sent; the Send dialog and the link with its QR code; the follow-up window's Treatment plans card. */
/* Sent (blue) and Viewed (teal) are both information: one tone, their words tell them apart. */
.badge.blue { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info-ink); }
.badge.teal { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info-ink); }
.plan-send-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.changed-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px;
  background: #eef4ff; border: 1px solid #c4d5f7; border-radius: 8px; color: #213f7a; font-size: var(--fs-15); overflow-wrap: anywhere; }
.changed-banner > span { flex: 1 1 16rem; min-width: 0; }
.option-card .card-note { color: var(--muted); font-size: var(--fs-13); margin: 8px 0; overflow-wrap: anywhere; }
.option-card .card-note:last-child { margin-bottom: 14px; }
.plan-send-dialog { max-height: calc(100vh - 220px); overflow-y: auto; min-width: 0; }
.plan-send-dialog .lbl { font-weight: 600; font-size: var(--fs-15); }
.plan-send-dialog .ps-to { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.plan-send-dialog .ps-to .hint { margin: 0; }
.plan-send-dialog .ps-addr { color: var(--muted); }
.plan-send-dialog .ps-text-no { color: #8a5a00; }
.plan-send-dialog .ps-warn { margin: 0; padding: 10px 12px; background: #fff6dc; border: 1px solid #f0d48a; border-radius: 8px; color: #5c4300; font-size: var(--fs-15); overflow-wrap: anywhere; }
.plan-send-dialog .ps-preview { margin: 0; padding: 8px 12px; background: #eef1f5; border-radius: 8px; color: #3f4650; font-size: var(--fs-15); font-weight: 600; }
.plan-send-dialog .ps-field { display: grid; gap: 6px; min-width: 0; }
.plan-send-dialog .ps-field .help { margin: 0; color: var(--muted); font-size: var(--fs-13); }
.plan-send-dialog textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.plan-send-dialog select { max-width: 100%; }
.plan-send-dialog .ps-cards { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 4px; }
.plan-send-dialog .ps-cards legend { font-weight: 600; font-size: var(--fs-15); margin-bottom: 6px; padding: 0; }
.plan-send-dialog .check.disabled { color: var(--muted); }
.plan-send-dialog .ps-opts { display: grid; gap: 4px; }
.plan-send-dialog .ps-err { margin: 0; }
.plan-send-dialog .ps-err:empty { display: none; }
.plan-link .sub { margin: 0; overflow-wrap: anywhere; }
.plan-link .pl-copy { display: flex; gap: 8px; min-width: 0; }
.plan-link .pl-copy input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--fs-13); }
.plan-link .ps-qr { width: 200px; max-width: 100%; justify-self: center; background: #fff; padding: 8px; border-radius: 8px; }
.plan-link .ps-qr svg { display: block; width: 100%; height: auto; }
.fu-plans .fu-plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fu-plan { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; min-width: 0; }
.fu-plan-main { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
.fu-plan .plan-line, .fu-plan-changed { font-size: var(--fs-13); }
.fu-plan-changed { color: #213f7a; }
/* Stage 5: the Plan block's buttons (Present again, Resend plan or Send) side by side at the block's end, wrapping
   rather than widening the window */
.fu-plan-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: 0 1 auto; min-width: 0; }
/* Stage 5: the attempt form's Treatment plan part (which plan, what they said, the reason) */
.attempt-form .af-plan { display: grid; gap: 6px; min-width: 0; margin: 6px 0 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: 8px; }
.attempt-form .af-plan legend { padding: 0 4px; font-weight: 600; font-size: var(--fs-13); }
.attempt-form .af-plan select { max-width: 100%; }
.attempt-form .af-plan .af-plan-name { margin: 0; overflow-wrap: anywhere; }
/* Stage 5: the Unscheduled Tx list's Plan column (its "Presented since" filter is a chip in the filter bar now) */
.unsched-table .plan-col { white-space: nowrap; }
/* The patient card's "Changed in Open Dental since sent" under the plan's line (its Resend is in the row's buttons). */
td.card-title .plan-changed { margin-top: 2px; font-weight: 400; color: #213f7a; overflow-wrap: anywhere; }
/* Treatment plan checks (public/plan-checks.mjs): a plan with something to fix gets a warning line on the patient page
   and in the plan page's side panel; the pop-up (Open and Present) groups what to fix. */
td.card-title .plan-check, .controls .plan-check { margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: #fff4de; color: #6b4a00; font-size: var(--fs-13); font-weight: 400; overflow-wrap: anywhere; }
.controls .plan-check { margin: 8px 0; padding: 8px 10px; font-size: var(--fs-13); }
.plan-check-dialog .plan-check-group h3 { margin: 14px 0 4px; font-size: var(--fs-15); color: #6b4a00; }
.plan-check-dialog ul { margin: 0 0 6px; padding-left: 20px; }
.plan-check-dialog li { margin: 3px 0; }
/* Stage 5: Today's "Treatment plans this week" card (four numbers in a row, the first two and the % links) and the
   Analytics page's plan cards (the funnel, its side lines and the breakdown tables) */
/* UI release 2 B2: one line that opens to the four numbers. */
#plans-week .plans-week { margin-bottom: 12px; }
.plans-week > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 10px 16px; list-style: none; cursor: pointer; }
.plans-week > summary::-webkit-details-marker { display: none; }
.plans-week .pw-title { font-weight: 600; }
.plans-week .pw-sum { color: var(--muted); font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.plans-week .pw-chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.plans-week[open] .pw-chev { transform: rotate(90deg); }
.plans-week[open] > summary { border-bottom: 1px solid var(--line); }
.plans-week > .today-head { padding: 10px 16px 0; margin-bottom: 8px; }
.plans-week > .pw-grid, .plans-week > .pw-note { margin-left: 16px; margin-right: 16px; }
.plans-week > .pw-grid { margin-bottom: 14px; }
.plans-week .pw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.plans-week .pw-num { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.plans-week a.pw-num:hover { border-color: var(--line-strong); background: #f7f8fa; }
.plans-week .pw-num strong { font-size: var(--fs-22); font-weight: 600; font-variant-numeric: tabular-nums; }
.plans-week .pw-note { margin: 10px 0 0; }
.plans-head { font-size: var(--fs-22); font-weight: 400; margin: 24px 0 12px; }
.plan-table { min-width: 0; }
.plan-table table.data { width: 100%; }
.plan-side, .plan-od-note { margin: 8px 0 0; }

/* Plan edits (2026-11-01): Settings → Treatment plans → Layman's terms (public/layman-terms.mjs): the back link, the bar
   (the Blank-only filter, Download and Add to Open Dental), the result line and the list */
.lt-back { margin: 0 0 4px; font-size: var(--fs-13); }
.lt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 4px; }
.lt-bar .spacer { flex: 1 1 auto; }
.lt-result { min-height: 1.4em; margin: 4px 0 8px; font-size: var(--fs-15); }
.lt-table td { overflow-wrap: anywhere; }
.lt-table .chk { width: 36px; }
.lt-table tr.lt-has td { color: var(--muted); }

/* UI release 2 B2: patient page, Library, Compliance, sign-in */
/* The patient page's header (public/patient.mjs .pt-head): sticky at the top of the window at every width, the name
   and contact line on the left, the patient's actions on the right, and the jump bar (.pt-jump) along its foot. The
   cards scroll in under it: --pt-head-h is its height, set by the page. */
.patient-page .pt-head { position: sticky; top: 0; z-index: 20; margin: 0 0 14px; padding: 12px 16px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-card); }
.patient-page .pt-head:not(:has(.pt-jump)) { padding-bottom: 12px; }
.pt-head-top { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 16px; }
.pt-head-who { flex: 1 1 280px; min-width: 0; }
.pt-head .pat-name { overflow-wrap: anywhere; }
.pt-head-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font-size: var(--fs-13); }
.pt-head-line .pt-facts { white-space: nowrap; }
.pt-contact-link { color: var(--ink); text-decoration: none; white-space: nowrap; }
.pt-contact-link:hover, .pt-contact-link:focus-visible { color: var(--accent); text-decoration: underline; }
.pt-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: 0 1 auto; max-width: 100%; }
.pt-jump { display: flex; gap: 2px; margin: 10px -16px 0; padding: 4px 10px; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.pt-jump-link { flex: none; min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); font: inherit; font-size: var(--fs-13); font-weight: 600; white-space: nowrap; cursor: pointer; }
.pt-jump-link:hover, .pt-jump-link:focus-visible { background: var(--accent-soft); color: var(--accent); }
.patient-page .pt-col > *, .patient-page #pt-forms-banner { scroll-margin-top: calc(var(--pt-head-h, 140px) + 12px); }
@media (max-width: 640px) {
  .patient-page .pt-head { margin-bottom: 10px; padding: 10px 12px 0; }
  .patient-page .pt-head:not(:has(.pt-jump)) { padding-bottom: 10px; }
  .patient-page .pt-head h1.pat-name { font-size: var(--fs-17); }
  /* On a phone the actions are one line scrolling across inside the header rather than growing it; the contact line
     wraps, so the email is never cut off */
  .pt-acts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pt-head-line { gap: 0 10px; }
  .pt-contact-link { white-space: normal; overflow-wrap: anywhere; }
  .pt-acts { flex: 1 1 100%; justify-content: flex-start; }
  .pt-acts .btn { flex: none; }
  .pt-jump { margin: 8px -12px 0; padding: 2px 6px; }
}
/* A card for a feature that isn't set up yet: one muted line */
.card.pt-card-off { padding-top: 10px; padding-bottom: 10px; color: var(--muted); }
.pt-card-off .pt-off-title { font-weight: 600; }
/* A visually hidden heading (the plan table's last column) */
.pt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Saved plans: the plan's name is the row's link, a chevron at the end shows the row opens; Present, then ⋯ (Send or
   Resend) as a small menu under it; the last row's menu opens upward so it stays inside the card */
.patient-page .plan-table td.card-title a.plan-name { color: inherit; text-decoration: none; }
.patient-page .plan-table tbody tr:hover a.plan-name, .patient-page .plan-table a.plan-name:focus-visible { color: var(--accent); }
.plan-acts { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; vertical-align: middle; }
.plan-chev { color: var(--faint); font-size: var(--fs-22); line-height: 1; }
.plan-more { position: relative; display: inline-block; }
.plan-more > summary { list-style: none; min-width: var(--control-h-sm); padding: 0 8px; font-size: var(--fs-17); }
.plan-more > summary::-webkit-details-marker { display: none; }
.plan-more[open] > summary { background: var(--accent-soft); }
.plan-more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: grid; min-width: 140px; padding: 4px; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: 0 10px 30px rgba(16, 24, 40, .16); text-align: left; }
.plan-table tbody tr:last-child .plan-more-menu { top: auto; bottom: calc(100% + 4px); }
.plan-more-menu .menu-item { white-space: nowrap; }

/* Library: the ticked rows' toolbar (Print 2 selected, Clear) */
.lib-picked .btn.quiet { margin-left: auto; }

/* Compliance: My items for someone not on the people list, one line */
.comp-me-none { margin: 4px 2px 12px; color: var(--muted); }
.comp-me-none strong { color: var(--ink); margin-right: 6px; }

/* Sign-in: the card in the middle of the screen (auto margins keep a tall card reachable from its top), the practice's
   name under Diastema, and a name with no PIN that says who to ask once tapped */
.signin-screen > .signin { margin-block: auto; }
.signin-practice { margin-top: -10px; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.signin .user-pick.no-pin:hover { border-color: var(--line-strong); background: var(--card); }
.signin .user-pick.no-pin.asked { opacity: 1; border-color: var(--warn); background: var(--warn-soft); }
.signin .user-pick.no-pin.asked .sub { color: var(--warn-ink); }
