/* ============================================================================
   Eyeonic theme: the override layer on top of Bootstrap 4.6.1.

   Linked last in main/layout.html, after bootstrap.min.css and every vendor
   stylesheet, so a rule here wins on load order alone when it matches the
   selector Bootstrap uses. Bootstrap is compiled CSS with no Sass build: its
   own --primary variables are printed in :root but none of its components
   read them, so setting those does nothing. Every colour Bootstrap bakes in
   is overridden below by a rule that reads one of our tokens instead.

   Ground rules:
     - Restyle Bootstrap's classes, do not add parallel ones. .btn stays .btn.
     - No raw hex outside the token block, except inside SVG data URIs.
     - !important only where Bootstrap itself uses it (its utilities), with
       the reason next to it.

   Sections, in order: design tokens, base, type, links and utilities,
   buttons, form controls, cards, alerts, tables, dropdowns, modals, badges,
   shell (app bar and footer, main/partials/navbar.html and footer.html).
   ============================================================================ */

/* typefaces, self-hosted so no page calls out to a font service. Both are
   SIL OFL 1.1 (static/fonts/OFL-*.txt), Latin and Latin Extended only; the
   unicode-range makes the browser fetch a subset only when a page needs it.
   IBM Plex Sans is one variable file covering 400 to 700. */
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/atkinson-hyperlegible-400-italic-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/atkinson-hyperlegible-400-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/atkinson-hyperlegible-400-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/atkinson-hyperlegible-400-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/atkinson-hyperlegible-700-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/atkinson-hyperlegible-700-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* design tokens */
:root {
    --ink: #0F1E28;
    --slate: #1E3A47;
    --canvas: #EDF3F6;
    --page: #F5F9FB;
    --surface: #FFFFFF;
    --on-dark: #FFFFFF;            /* text on brand and slate fills */
    --surface-soft: #F7FAFC;
    --line: #D3DEE5;
    --line-soft: #E6EDF1;
    --line-control: #B4C6D0;
    --muted: #55707F;
    --label: #3C5B69;
    --brand: #0089C7;
    --brand-700: #056A99;
    --brand-800: #044F73;
    --brand-tint: #E7F3FA;
    --brand-line: #B4CDDA;
    --info-line: #BCDDEF;
    --info-ink: #0E3E56;
    --ok: #1F7A5C;
    --ok-tint: #E4F3EC;
    --ok-line: #BFE0D2;
    --ok-ink: #114A36;
    --alert: #A32017;
    --alert-tint: #FBEBE9;
    --alert-line: #F0C6C1;
    --amber-tint: #FDF1DC;
    --amber-line: #EFD6AC;
    --amber-ink: #7E4A05;
    --star: #E5202A;
    --disabled-bg: #EEF2F5;
    --disabled-ink: #8698A3;
    --disabled-line: #E0E8ED;
    --hover-soft: #F1F6F9;
    --th-bg: #F4F8FA;
    --th-ink: #4E6674;
    --text: var(--ink);
    --text-2: #4A6472;
    --text-3: #7B95A3;
    --page-max: 1180px;   /* .appmain: the width every page and the footer share */
    --radius-card: 12px;
    --radius-control: 10px;
    --radius-pill: 20px;
    --shadow: 0 1px 2px rgba(15, 30, 40, .06), 0 6px 18px rgba(15, 30, 40, .06);
    --shadow-menu: 0 14px 34px rgba(15, 30, 40, .22);
    --shadow-modal: 0 24px 60px rgba(11, 23, 31, .4);
    --focus-ring: 3px solid var(--brand);
    --font-ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-legible: 'Atkinson Hyperlegible', Verdana, system-ui, sans-serif;
    --s1: 8px;
    --s2: 16px;
    --s3: 24px;
    --s4: 32px;
    --bar-ink: #DCEAF1;
    --bar-hover: rgba(255, 255, 255, .13);
    --bar-on: rgba(255, 255, 255, .16);
    --bar-tag: rgba(255, 255, 255, .12);  /* .tag: the test balance */
    --foot-ink: #C6DCE6;
    --foot-head: #8FB3C4;
    --foot-underline: rgba(255, 255, 255, .55);
    --bar-divider: rgba(255, 255, 255, .28);  /* .practice */
    --bar-practice: #EAF4F9;
    --alert-ink: #8E2A1F;          /* .msg */
    --invalid-bg: #FDF0EE;         /* .showerr .fld .inp */
    --invalid-line: #E3A9A2;
    --line-hover: #9FB6C4;         /* .regionpick:hover, .method:hover */
    --toggle-track: #F2F7F9;       /* .seg */
    --seg-ink: #5A7180;            /* .seg-btn, .pwrules li */
    --rule-bg: #F4F8FB;            /* .pwrules */
    --rule-ink: #33505E;
    --rule-mark: #A9BECB;          /* .pwrules .rule-m */
    --body-2: #2C4652;             /* .regprac-lead, .acc-a p, .plancard li */
    --plan-ink: #41606F;           /* .plancard > p */
    --sub-ink: #3E5C6B;            /* .p-sub */
    --chip-line: #B7DCEF;          /* .limitchip */
    --row-hover: #F8FBFC;          /* table.tbl tbody tr:hover td */
    --foot-bg: #FAFCFD;            /* .modal-foot */
    --field-disabled-bg: #F0F4F7;  /* input.inp:disabled */
    --field-disabled-line: #DFE7EC;
    --video-bg: #22323A;           /* .video */
    --video-line: #1A2830;
    --overlay: #0B171F;            /* .overlay, at .55 */
    --shadow-auth: 0 1px 3px rgba(15, 30, 40, .07);  /* .authcard */
    --alert-body: #7A2A22;         /* .statusbox.off p */
    --ok-body: #255C48;            /* .statusbox.on p */
    --rec: #1AA6C7;                /* .pill-rec */
    --code-ink: #C2185B;           /* .secretkey code */
    --scrim: rgba(11, 23, 31, .55); /* .overlay */
    --plans-line: rgba(15, 30, 40, .10);
    --plans-line-strong: rgba(15, 30, 40, .18);
    --positive: #1D6E4E;           /* .tier__save, the feature ticks */
}

/* base. Not on the test screens: their stimulus and calibration were set
   against main.css's white page, which they keep. */
body:not(.test-screen) {
    background: var(--page);
    color: var(--ink);
    font-family: var(--font-ui);
}

/* One focus treatment for everything reachable by keyboard. Bootstrap draws
   focus as a box-shadow on mouse focus too; the rules below drop that in
   favour of this ring, which only shows for keyboard focus. */
:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.custom-select:focus-visible,
.page-link:focus-visible,
.dropdown-item:focus-visible {
    /* The class selectors match Bootstrap's own `:focus { outline: 0 }`
       rules, which would otherwise outrank the bare :focus-visible. */
    outline: var(--focus-ring);
    outline-offset: 2px;
}

/* Bare, as in the prototype: theme.css's own control radii, declared below,
   outrank it; a single-class Bootstrap radius (a pill badge, a list group
   item) takes this 6px while focused. */
:focus-visible {
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    /* Transitions only: the acuity test's countdown and Bootstrap's spinners
       are animations and must keep moving. */
    * {
        transition: none !important;
    }
}

/* type: the patient side reads in Atkinson Hyperlegible at a larger scale.
   The class is set on <body> in main/layout.html. */
/* Page titles and the patient side only, as in the prototype (h1.page-title,
   .hero h1, .modal-head h2, .plancard h3 ...): other headings keep the UI face. */
.theme-patient h1, .theme-patient h2, .theme-patient h3,
.modal-title, .home-title, .auth-title, .reg-title, .practice-h, .plan-card h3,
.faq-page-title, .contact-title, .label-title, .profile-head h1, .sect > h2 {
    font-family: var(--font-legible);
}

h1, h2, h3, .modal-title {
    color: var(--ink);
}

/* Bootstrap sets headings to 500; the prototype keeps the browser's bold. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
}

h4, h5, h6 {
    color: var(--ink);
}

.theme-patient #main-body {
    font-family: var(--font-legible);
    font-size: 19px;
}

.theme-patient #main-body small,
.theme-patient #main-body .small {
    font-size: 15.5px;
}

/* links and utilities: Bootstrap's blue, retinted. Its utilities carry
   !important, so these have to as well to win. */
a {
    color: var(--brand-700);
}

a:hover {
    color: var(--brand-800);
}

.text-primary {
    color: var(--brand-700) !important;
}

.bg-primary {
    background-color: var(--brand-700) !important;
}

.border-primary {
    border-color: var(--brand-700) !important;
}

.text-muted {
    color: var(--muted) !important;
}

.text-danger {
    color: var(--alert) !important;
}

.page-link {
    color: var(--brand-700);
    border-color: var(--line);
}

.page-link:hover {
    color: var(--brand-800);
    background-color: var(--brand-tint);
}

.page-item.active .page-link {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
}

.page-link:focus {
    box-shadow: none;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--brand-700);
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
}

.progress-bar {
    background-color: var(--brand-700);
}

/* buttons. Primary is the expected next step, one per screen; everything
   else is outlined. Selectors match Bootstrap's, including the :active ones,
   or its colours come back on click. */
.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
    border-radius: var(--radius-control);
    padding: 13px 22px;
    border-width: 1.5px;
    transition: background-color .12s, border-color .12s, color .12s;
}

.btn:focus,
.btn.focus,
.btn:not(:disabled):not(.disabled):active:focus,
.btn:not(:disabled):not(.disabled).active:focus {
    box-shadow: none;
}

.btn-sm {
    padding: 9px 15px;
    font-size: 14.5px;
    border-radius: 8px;
}

.btn-lg {
    padding: 16px 26px;
    font-size: 18px;
}

.btn-primary,
.btn-primary:focus,
.btn-primary.focus {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
    color: var(--on-dark);
}

.btn-primary:hover,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
    background-color: var(--brand-800);
    border-color: var(--brand-800);
    color: var(--on-dark);
}

/* Bootstrap's filled grey and its outlined blues all become the secondary
   style: white, brand ink, light brand border. */
.btn-secondary,
.btn-secondary:focus,
.btn-secondary.focus,
.btn-info,
.btn-info:focus,
.btn-info.focus,
.btn-outline-primary,
.btn-outline-info {
    background-color: var(--surface);
    border-color: var(--brand-line);
    color: var(--brand-800);
}

.btn-secondary:hover,
.btn-secondary:not(:disabled):not(.disabled):active,
.btn-secondary:not(:disabled):not(.disabled).active,
.show > .btn-secondary.dropdown-toggle,
.btn-info:hover,
.btn-info:not(:disabled):not(.disabled):active,
.btn-info:not(:disabled):not(.disabled).active,
.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.show > .btn-outline-primary.dropdown-toggle,
.btn-outline-info:hover,
.btn-outline-info:not(:disabled):not(.disabled):active,
.btn-outline-info:not(:disabled):not(.disabled).active {
    background-color: var(--brand-tint);
    border-color: var(--brand);
    color: var(--brand-800);
}

/* Ghost: the quiet action, such as Cancel or Back. Bootstrap has no ghost,
   so .btn-ghost is new; .btn-outline-secondary already plays that role. */
.btn-ghost,
.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--line);
    color: var(--text-2);
}

.btn-ghost:hover,
.btn-outline-secondary:hover,
.btn-outline-secondary:not(:disabled):not(.disabled):active,
.btn-outline-secondary:not(:disabled):not(.disabled).active,
.show > .btn-outline-secondary.dropdown-toggle {
    background-color: var(--hover-soft);
    border-color: var(--line);
    color: var(--ink);
}

/* Red is reserved for destructive actions, and even those are outlined. */
.btn-danger,
.btn-danger:focus,
.btn-danger.focus,
.btn-outline-danger {
    background-color: var(--surface);
    border-color: var(--alert-line);
    color: var(--alert);
}

.btn-danger:hover,
.btn-danger:not(:disabled):not(.disabled):active,
.btn-danger:not(:disabled):not(.disabled).active,
.btn-outline-danger:hover,
.btn-outline-danger:not(:disabled):not(.disabled):active,
.btn-outline-danger:not(:disabled):not(.disabled).active {
    background-color: var(--alert-tint);
    border-color: var(--alert-line);
    color: var(--alert);
}

.btn-link {
    color: var(--brand-700);
    font-weight: 600;
}

.btn-link:hover {
    color: var(--brand-800);
}

.btn:disabled,
.btn.disabled,
.btn[aria-disabled="true"] {
    background-color: var(--disabled-bg);
    border-color: var(--disabled-line);
    color: var(--disabled-ink);
    opacity: 1;
    cursor: not-allowed;
}

.btn-link:disabled,
.btn-link.disabled {
    background-color: transparent;
    border-color: transparent;
}

/* form controls. Bootstrap fixes .form-control to one line height; the
   minimum here is the 48px target, and the -sm variants keep their compact
   size for the dense admin tables. */
label,
.form-control-label {
    font-weight: 600;
    font-size: 14.5px;
    line-height: normal;
    color: var(--label);
    margin-bottom: 7px;
}

.custom-control-label,
.form-check-label,
input[type="checkbox"] + label,
input[type="radio"] + label {
    font-weight: 400;
    font-size: inherit;
    color: inherit;
}

.form-control,
.custom-select {
    height: auto;
    min-height: 48px;
    font-family: inherit;
    font-size: 16px;
    color: var(--ink);
    background-color: var(--surface);
    border: 1.5px solid var(--line-control);
    border-radius: var(--radius-control);
    padding: 12px 14px;
}

/* One drawn arrow, inset from the border, for both kinds of single-line select.
   Most of the app's selects are select.form-control, whose native arrow sits
   against the border. A list box (multiple or size) keeps its native look. */
.custom-select,
select.form-control:not([multiple]):not([size]),
.theme-admin select.form-control-sm:not([multiple]):not([size]) {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M3 6l5 5 5-5' fill='none' stroke='%23335A6B' stroke-width='2' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

/* Bootstrap moves an invalid select's background to make room for its icon. */
select.form-control.is-invalid,
.was-validated select.form-control:invalid {
    background-position: right 14px center;
}

.form-control-sm,
.custom-select-sm {
    min-height: 36px;
    font-size: 14.5px;
    padding: 6px 10px;
    border-radius: 8px;
}

.form-control:focus,
.custom-select:focus {
    border-color: var(--line-control);
    box-shadow: none;
    color: var(--ink);
}

.form-control::placeholder {
    color: var(--text-3);
}

.form-control:disabled,
.form-control[readonly],
.custom-select:disabled {
    background-color: var(--field-disabled-bg);
    border-color: var(--field-disabled-line);
    color: var(--disabled-ink);
}

/* Bare for the admin notice form's checkboxes, which carry the class alone. */
.is-invalid {
    /* --alert, not --invalid-line: on a bare control (a checkbox, the photo
       input) this border is the only cue, so it needs 3:1 against white. */
    border-color: var(--alert);
}

.form-control.is-invalid,
.was-validated .form-control:invalid,
.custom-select.is-invalid {
    border-color: var(--invalid-line);
    background-color: var(--invalid-bg);
}

.form-control.is-invalid:focus,
.was-validated .form-control:invalid:focus {
    border-color: var(--invalid-line);
    box-shadow: none;
}

.invalid-feedback {
    margin-top: 6px;
    color: var(--alert);
    font-size: 13.5px;
    line-height: 1.4;
}

.form-text,
.form-text.text-muted {
    font-size: 14.5px;
    line-height: 1.6;
}

.input-group-text {
    font-size: 15px;
    background-color: var(--surface-soft);
    border: 1.5px solid var(--line-control);
    border-radius: var(--radius-control);
    color: var(--label);
}

.custom-file-label {
    height: auto;
    min-height: 48px;
    padding: 12px 14px;
    border: 1.5px solid var(--line-control);
    border-radius: var(--radius-control);
}

.custom-file-label::after {
    height: auto;
    padding: 12px 14px;
    line-height: inherit;
}

.custom-file {
    height: auto;
    min-height: 48px;
}

/* cards */
.card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.card-header {
    background-color: var(--surface-soft);
    border-bottom: 1px solid var(--line-soft);
}

.card-header:first-child {
    border-radius: calc(var(--radius-card) - 1px) calc(var(--radius-card) - 1px) 0 0;
}

.card-footer {
    background-color: var(--surface-soft);
    border-top: 1px solid var(--line-soft);
}

.card-footer:last-child {
    border-radius: 0 0 calc(var(--radius-card) - 1px) calc(var(--radius-card) - 1px);
}

.card-title {
    color: var(--ink);
}

/* alerts. Tinted panel with a coloured left rule; status lives in the tint,
   never in a filled block. */
.alert {
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.5;
}

.alert-success {
    background-color: var(--ok-tint);
    border-color: var(--ok-line);
    border-left: 4px solid var(--ok);
    color: var(--ok-ink);
    font-weight: 500;
}

.alert-info,
.alert-primary {
    background-color: var(--brand-tint);
    border-color: var(--info-line);
    color: var(--info-ink);
    font-size: 15.5px;
    line-height: 1.6;
}

.alert-warning {
    background-color: var(--amber-tint);
    border-color: var(--amber-line);
    color: var(--amber-ink);
    padding: 14px 16px;
    font-size: 15px;
}

.alert-danger {
    background-color: var(--alert-tint);
    border-color: var(--alert-line);
    color: var(--alert-ink);
}

.alert-secondary,
.alert-light {
    background-color: var(--surface-soft);
    border-color: var(--line-soft);
    color: var(--text-2);
}

.alert .alert-link {
    color: inherit;
}

/* Not in the prototype, which draws alerts without one: the close button,
   in the alert's own colour, sized like the dialogue close. */
.alert-dismissible {
    padding-right: 60px;
}

.alert-dismissible .close {
    top: 9px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    color: inherit;
    font-size: 22px;
    font-weight: 400;
    text-shadow: none;
    opacity: .7;
}

.alert-dismissible .close:hover,
.alert-dismissible .close:focus-visible {
    background-color: var(--surface);
    opacity: 1;
}

/* tables. One treatment for every list: quiet uppercase header, roomy rows,
   hover. The rounded frame is skipped on .table-bordered, which draws its
   own cell grid. */
.table {
    color: var(--ink);
}

.table th,
.table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-top: 0;
    border-bottom: 1px solid var(--line-soft);
}

.table thead th {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--th-ink);
    background-color: var(--th-bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table-sm th,
.table-sm td {
    padding: 8px 10px;
}

.table:not(.table-bordered) {
    border-collapse: separate;
    border-spacing: 0;
}

.table:not(.table-bordered) thead th:first-child {
    border-left: 1px solid var(--line);
    border-top-left-radius: var(--radius-control);
}

.table:not(.table-bordered) thead th:last-child {
    border-right: 1px solid var(--line);
    border-top-right-radius: var(--radius-control);
}

.table:not(.table-bordered) tbody td:first-child {
    border-left: 1px solid var(--line);
}

.table:not(.table-bordered) tbody td:last-child {
    border-right: 1px solid var(--line);
}

.table:not(.table-bordered) tbody tr:last-child td {
    border-bottom: 1px solid var(--line);
}

.table:not(.table-bordered) tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-control);
}

.table:not(.table-bordered) tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-control);
}

.table-bordered,
.table-bordered th,
.table-bordered td {
    border: 1px solid var(--line);
}

.table tbody tr:hover td {
    background-color: var(--row-hover);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--surface-soft);
}

/* dropdowns */
.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-menu);
    padding: 8px;
    font-size: 16px;
}

.dropdown-item {
    color: var(--ink);
    font-weight: 500;
    padding: 11px 13px;
    border-radius: 8px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--brand-tint);
    color: var(--brand-800);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--brand-700);
    color: var(--on-dark);
}

.dropdown-divider {
    border-top-color: var(--line-soft);
    margin: 6px 8px;
}

/* modals */
.modal-backdrop {
    background-color: var(--overlay);
}

.modal-backdrop.show {
    opacity: .55;
}

@media (min-width: 576px) {
    .modal-dialog:not(.modal-lg):not(.modal-xl):not(.modal-sm) {
        max-width: 560px;
    }
}

.modal-content {
    border: 0;
    border-radius: 14px;
    box-shadow: var(--shadow-modal);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line-soft);
    align-items: center;
}

.modal-title {
    font-size: 21px;
}

.modal-body {
    padding: 22px 24px;
}

.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--line-soft);
    background-color: var(--foot-bg);
    gap: 10px;
    /* Rounded here, not by overflow: hidden on .modal-content, which would
       clip a phone country list or dropdown opened inside the modal. */
    border-radius: 0 0 14px 14px;
}

/* .modal-foot { gap: 10px }: the gap spaces the buttons, not Bootstrap's margins */
.modal-footer > * {
    margin: 0;
}

.modal-footer .foot-left {
    margin-right: auto;
}

.modal-header .close {
    width: 38px;
    height: 38px;
    margin: -4px -4px -4px auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text-2);
    text-shadow: none;
    opacity: 1;
}

.modal-header .close:hover {
    background-color: var(--hover-soft);
}

/* badges: status is a small pill, never a filled cell */
.badge {
    font-weight: 700;
    padding: 5px 10px;
}

.badge-pill {
    padding: 6px 14px;
    font-size: 14.5px;
}

.badge-primary,
.badge-info {
    background-color: var(--brand-tint);
    color: var(--brand-800);
}

.badge-success {
    background-color: var(--ok-tint);
    color: var(--ok);
}

.badge-warning {
    background-color: var(--amber-tint);
    color: var(--amber-ink);
}

.badge-danger {
    background-color: var(--alert-tint);
    color: var(--alert);
}

.badge-secondary,
.badge-light {
    background-color: var(--line-soft);
    color: var(--text-2);
}

/* icons from main/partials/icons.html */
.icon {
    width: 22px;
    height: 22px;
    flex: none;
}

/* shell: the app bar. Matches Bootstrap's .navbar-dark .navbar-nav .nav-link
   so these win on load order. */
.site-header .navbar {
    background-color: var(--slate);
    min-height: 62px;
    padding: 0;
    font-family: var(--font-ui);
}

/* .appbar runs edge to edge with 22px either side. main.css fixes every
   .container-fluid at 1200px above 1400px, which boxed the bar in; only the
   bar is released, the page body keeps that width. 100%, not auto: the bar is
   a flex container, so auto shrinks the row to its content and Bootstrap's
   margin: 0 auto then centres it. */
.site-header .navbar > .container-fluid {
    width: 100%;
    max-width: none;
    padding: 0 22px;
}

/* .mark */
.site-header .brand-mark {
    width: 36px;
    height: 36px;
    display: block;
}

.site-header .navbar-brand {
    margin-left: 10px;
    padding: 0;
    font-family: var(--font-legible);
    font-weight: 700;
    font-size: 20px;
    color: var(--on-dark);
    /* .appbar { gap:14px } after the name. Collapsed, Bootstrap spreads the
       logo, the name and the toggler across the bar with space-between, so the
       name takes the slack and pushes the toggler to the far side. */
    margin-right: 14px;
}

@media (max-width: 991.98px) {
    .site-header .navbar-brand {
        margin-right: auto;
    }

    /* The bar has no vertical padding of its own, so the open menu brings its
       own room below the last link, matching the 12px the links are inset by. */
    .site-header .navbar-collapse {
        padding-bottom: 12px;
    }

    /* The toggler is the tallest item in the top row, so its margin sets the
       row: 40px + 11px each side keeps the bar's 62px, everything centred. */
    .site-header .navbar-toggler {
        margin: 11px 0;
    }
}

/* .practice: the practice a clinician is signed in under, beside the name.
   Filled by layout.html's script; empty for everyone else, and then it takes
   no room at all. */
.site-header #user-name {
    margin-right: 14px;
    padding-left: 16px;
    border-left: 1px solid var(--bar-divider);
    font-size: 16px;
    font-weight: 600;
    color: var(--bar-practice);
}

.site-header #user-name:empty {
    display: none;
}

/* Each link draws its own rounded hover background; the gap keeps
   neighbouring ones from touching. Works stacked in the collapsed menu too. */
.site-header .navbar-nav {
    gap: 4px;
}

.site-header .navbar-dark .navbar-nav .nav-link,
.site-header .navbar-nav .nav-link {
    color: var(--bar-ink);
    font-size: 15px;
    font-weight: 500;
    padding: 9px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

/* .navlink.tag: the test balance as a pill. Hidden in the markup until
   layout.html's script fills it in. */
.site-header .navbar-dark .navbar-nav .nav-link.tag {
    /* Stacked in the collapsed menu: on the left, as the links are. */
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 999px;
    background-color: var(--bar-tag);
    font-variant-numeric: tabular-nums;
}

/* In the bar (navbar-expand-lg): level with the links' middle. */
@media (min-width: 992px) {
    .site-header .navbar-dark .navbar-nav .nav-link.tag {
        align-self: center;
    }
}

.site-header .navbar-dark .navbar-nav .nav-link:hover,
.site-header .navbar-dark .navbar-nav .nav-link:focus {
    background-color: var(--bar-hover);
    color: var(--on-dark);
}

.site-header .navbar-dark .navbar-nav .nav-link.active,
.site-header .navbar-dark .navbar-nav .show > .nav-link,
.site-header .navbar-dark .navbar-nav .nav-link[aria-expanded="true"] {
    background-color: var(--bar-on);
    color: var(--on-dark);
    font-weight: 600;
}

/* Register: the one call to action in the signed-out bar. */
.site-header .navbar-dark .navbar-nav .nav-link.nav-cta,
.site-header .navbar-dark .navbar-nav .nav-link.nav-cta.active {
    background-color: var(--brand-700);
    color: var(--on-dark);
    font-weight: 600;
}

.site-header .navbar-dark .navbar-nav .nav-link.nav-cta:hover {
    background-color: var(--brand-800);
}

.site-header .dropdown-menu {
    min-width: 274px;
}

/* accountMenu(): style="min-width:200px" */
.site-header [aria-labelledby="user_nav_dropdown"] {
    min-width: 200px;
}

.site-header .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-item .mi {
    color: var(--brand-700);
}

/* Pressed, the item fills with --brand-700, the icon's own colour: the icon
   takes the item's white text instead. */
.dropdown-item.active .mi,
.dropdown-item:active .mi {
    color: inherit;
}

/* shell: the footer, four labelled columns */
.site-footer {
    background-color: var(--slate);
    color: var(--foot-ink);
    font-family: var(--font-ui);
}

.site-footer-cols {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 28px 26px 26px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

@media (max-width: 900px) {
    .site-footer-cols {
        grid-template-columns: 1fr 1fr;
    }
}

.foot-col h2 {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--foot-head);
    margin: 0 0 12px;
}

.foot-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 9px;
}

.foot-col a {
    color: var(--foot-ink);
    font-size: 15px;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.foot-col a:hover {
    color: var(--on-dark);
    border-bottom-color: var(--foot-underline);
}

.foot-col .extico {
    width: 13px;
    height: 13px;
    stroke-width: 2;
    margin-left: 5px;
    vertical-align: -1px;
    opacity: .7;
}

.site-footer-notices {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 26px 20px;
}

/* before login: the login card (users/login_v2.html) */
.auth-box {
    max-width: 440px;
    margin: 40px auto;
}

.auth-card {
    background-color: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-card);
    padding: 34px 36px 30px;
    box-shadow: var(--shadow-auth);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 26px 20px 22px;
    }
}

.auth-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.auth-title {
    font-family: var(--font-ui);
    font-size: 27px;
    font-weight: 700;
    margin: 0;
}

.auth-card .form-group {
    margin-bottom: 18px;
}

/* Forgot password reuses the card. With no region pill beside it the heading
   stands alone, so its line takes .auth-head's 26px below on its own. */
.auth-title-solo {
    margin-bottom: 10px;
}

/* .hint */
.auth-lead {
    margin: 0 0 22px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--muted);
}

/* .fld margin: the widget sits one field-gap above Continue */
.auth-captcha {
    margin-bottom: 18px;
}

/* The sign in message sits between the password and Continue, next to the
   fields it is about, rather than at the top of the page. */
.auth-msg {
    margin: 0 0 18px;
    padding: 11px 14px;
    border: 1px solid var(--alert-line);
    border-radius: var(--radius-control);
    background-color: var(--alert-tint);
    color: var(--alert-ink);
    font-size: 14.5px;
    line-height: 1.5;
}

.auth-rule {
    border-top: 1px solid var(--line-soft);
    margin: 24px 0 18px;
}

.auth-links {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--slate);
}

.auth-links:last-child {
    margin-bottom: 0;
}

.auth-links a {
    color: var(--brand-800);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-links a:hover {
    color: var(--brand-700);
}

.auth-sub {
    color: var(--muted);
}

/* Region selector: a pill on the heading line, not a form field. It decides
   which address gets the credentials, so it does not queue with them.
   Doubled class to beat the .custom-select restyle above. */
.custom-select.regionpick {
    flex: none;
    width: auto;
    max-width: 150px;
    min-height: 40px;
    padding: 9px 34px 9px 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--slate);
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background-position: right 12px center;
    cursor: pointer;
}

.custom-select.regionpick:hover {
    border-color: var(--line-hover);
}

/* form details shared by registration, reset password and the profile */
.required-asterisk {
    color: var(--alert);
    font-weight: 700;
}

/* The show/hide toggle sits inside the right edge of a password field. */
.eye-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-2);
    cursor: pointer;
}

.photo-input_border {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1.5px solid var(--line-control);
    border-radius: var(--radius-control);
    background-color: var(--surface);
    font-size: 16px;
}

.photo-input_border.is-invalid {
    border-color: var(--invalid-line);
    background-color: var(--invalid-bg);
}

/* Password rules: a marker column that is always there, so a rule does not
   shift sideways when the page's own script marks it met or unmet as the
   person types. The script toggles .password-valid / .password-invalid. */
#password-requirements {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background-color: var(--rule-bg);
    font-size: 14px;
    color: var(--rule-ink);
}

#password-requirements p {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 9px;
    margin: 0 0 5px;
    font-size: 14px;
    color: var(--seg-ink);
}

#password-requirements p:last-child {
    margin-bottom: 0;
}

#password-requirements .password-heading {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--ink);
}

#password-requirements p:not(.password-heading)::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 400;
    content: "\f111";
    color: var(--rule-mark);
}

#password-requirements p.password-valid,
#password-requirements p.password-valid::before {
    color: var(--ok);
}

#password-requirements p.password-valid::before {
    content: "\f058";
}

#password-requirements p.password-invalid,
#password-requirements p.password-invalid::before {
    color: var(--alert);
}

#password-requirements p.password-invalid::before {
    content: "\f057";
}

/* Parsley's client-side errors read like the server's. */
.form-control.parsley-error,
.custom-select.parsley-error {
    border-color: var(--alert);
    background-color: var(--alert-tint);
    color: var(--ink);
}

.parsley-errors-list {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--alert);
}

/* before login: Join Today (users/initial_register.html) and the clinician
   and practice forms that extend it */
.reg-container {
    padding: 0;
}

/* #reg-card */
.reg-card {
    max-width: 960px;
    padding: 26px 28px;
    margin: 8px auto 24px;
}

/* .regform { gap: 6px 22px }: 22px between the two columns, not Bootstrap's 30px */
.reg-card .row {
    margin-left: -11px;
    margin-right: -11px;
}

.reg-card .row > [class*="col"] {
    padding-left: 11px;
    padding-right: 11px;
}

@media (max-width: 576px) {
    .reg-card {
        padding: 20px 16px;
    }
}

.reg-title {
    font-size: 30px;
    margin: 0 0 18px;
}

.reg-pick {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 26px;
    font-size: 16px;
    color: var(--label);
}

/* Clinician / Practice: a segmented switch. Links, since each is its own page. */
.seg {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background-color: var(--toggle-track);
}

.seg-btn {
    padding: 9px 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--seg-ink);
    text-decoration: none;
}

.seg-btn:hover {
    color: var(--ink);
    text-decoration: none;
}

.seg-btn.active,
.seg-btn.active:hover {
    background-color: var(--brand-700);
    color: var(--on-dark);
}

/* Every field keeps room for one line of error below it (.fld .err: 6px, then
   20px), then the 6px row gap, so validation does not push the form down. shortcut: an error longer than one line
   still overlaps the field below; give it a wrapper with a min-height if a
   longer message ever ships. */
.reg-card .form-group {
    position: relative;
    margin-bottom: 0;
    padding-bottom: 32px;
}

.reg-card .form-group > .invalid-feedback,
.reg-card .form-group > .form-control + .parsley-errors-list,
.reg-card .form-group > .custom-select + .parsley-errors-list,
.reg-card #phone-error-container > *,
.reg-card #admin-error-container > *,
.reg-card #phone-number-error-msg,
.reg-card #phone-admin-error-msg {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 26px);
    margin: 0;
}

/* The server's message is stale once Parsley has its own to show in the same spot. */
.reg-card .parsley-errors-list.filled ~ .invalid-feedback {
    display: none;
}

.reg-card .invalid-feedback {
    display: block;
}

/* ...except once a script clears the field it belongs to. */
.reg-card .form-control:not(.is-invalid) ~ .invalid-feedback {
    display: none;
}

/* A section rule sits midway: the field above already ends in 32px of error
   room, so the rule adds none above and the same 32px below. */
.reg-card hr {
    border-top-color: var(--line-soft);
    margin: 0 0 32px;
}

.reg-card input::-ms-reveal,
.reg-card input::-ms-clear {
    display: none;
}

.reg-card input::-webkit-outer-spin-button,
.reg-card input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.reg-card input[type=number] {
    -moz-appearance: textfield;
}

/* Drop Bootstrap's error icon on text fields; selects keep their arrow. */
.reg-card input.form-control.is-invalid,
.reg-card textarea.form-control.is-invalid,
.reg-card .was-validated input.form-control:invalid,
.reg-card .was-validated textarea.form-control:invalid {
    background-image: none;
    padding-right: 14px;
}

.reg-card .input-group-text {
    min-width: 45px;
}

/* .ackrow: the terms acknowledgement */
.reg-card .ack-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15.5px;
    line-height: 1.55;
}

.reg-card .ack-row input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex: none;
}

/* The row's 1.55 line height, not the labels' normal: the 20px box, 2px down,
   centres on a 24px first line. */
.reg-card .ack-row label {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
}

/* Parsley puts a checkbox's error after its parent, so outside the row's
   padding; hand the padding to the error while it shows. */
.reg-card .ack-row:has(+ .parsley-errors-list.filled) {
    padding-bottom: 0;
}

.reg-card .ack-row + .parsley-errors-list.filled {
    margin: 6px 0 32px;
}

#billingValidationMessage,
#adminValidationMessage,
#validation-msg,
#practiceValidationMessage {
    color: var(--alert);
    font-size: 13.5px;
    line-height: 1.4;
}

/* photo ID preview */
/* Takes no room until a photo is chosen. */
#photo-preview-container:empty {
    display: none;
}

#photo-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 140px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--line-soft);
}

.reg-card .img-fluid {
    width: 100px;
    margin: 10px;
    border-radius: 4px;
}

.reg-card .css-account-img,
.reg-card .css-pdf-image {
    width: 120px;
    height: 120px;
    margin: 10px;
    object-fit: cover;
    border: none;
    border-radius: 4px;
}

/* repeated practice addresses (users/clinician/address_macro.html) */
/* .addr-block: Name of Practice and Full Address side by side. The hidden
   inputs take no cell; the remove button and the rule span both. */
.reg-card .subform {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 22px;
}

.reg-card .subform > div:not(.form-group),
.reg-card .subform > hr {
    grid-column: 1 / -1;
}

@media (max-width: 575.98px) {
    .reg-card .subform {
        grid-template-columns: 1fr;
    }
}

/* Remove Address: destructive, so outlined red (.btn-danger), on every page
   that repeats addresses. Its old inline margin moves here. */
/* Flex, because js/clinician_address.html shows the button with an inline
   display: inline, which drops its width and lets its padding spill over the
   Add button. A flex item is laid out as a block whatever its display says;
   display: none still hides it. */
.addr-remove {
    display: flex;
    margin: 15px 5px 15px 0;
}

/* Remove Address: full width under the pair, below the fields' usual error
   room; the rule between addresses has 24px either side, so each block reads
   as one unit rather than the button floating off its fields. */
.reg-card .subform .addr-remove {
    margin: 0;
}

.reg-card .subform .addr-remove .remove {
    flex: 1;
}

.reg-card .subform hr.addr-rule {
    margin: 24px 0;
}

/* The rule separates addresses, so the last one has none above the Add button. */
.reg-card #subforms-container > .subform:last-child hr.addr-rule {
    display: none;
}

/* ...so its Remove button carries the 24px the rule would have given before
   the Add button. On the button, not the block: with one address the button is
   hidden and the fields' own error room is space enough. */
.reg-card #subforms-container > .subform:last-child .addr-remove .remove {
    margin-bottom: 24px;
}

/* At five addresses js/clinician_address.html hides the Add button with an
   inline display: none, and then there is nothing below to space from. */
.reg-card .form-group:has(> #add[style*="none"]) #subforms-container > .subform:last-child .addr-remove .remove {
    margin-bottom: 0;
}

/* practice forms: the limit chip beside the heading */
.limit-border {
    display: inline-block;
    padding: 5px 13px;
    border: 1px solid var(--chip-line);
    border-radius: 999px;
    background-color: var(--brand-tint);
    color: var(--brand-800);
    font-size: 13.5px;
    font-weight: 600;
}

.detail-text {
    color: var(--muted);
    font-size: 14.5px;
}

/* before login: the Practice tab (users/practice/practice_registration.html)
   Read, then choose a limit, then fill in its form. */
.practice-h {
    font-size: 24px;
    margin: 26px 0 12px;
    text-align: center;
}

.practice-tab > .practice-h:first-child {
    margin-top: 0;
}

.practice-lead {
    max-width: 78ch;
    margin: 0 auto 8px;
    font-size: 16.5px;
    line-height: 1.7;
    color: var(--body-2);
    text-align: center;
}

.reg-card hr.practice-rule {
    margin: 30px 0;
}

/* FAQ accordion: Bootstrap's collapse, drawn as the prototype's +/- list */
.faq {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.faq-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    overflow: hidden;
    background-color: var(--surface);
}

.faq-h {
    margin: 0;
    font-family: var(--font-ui);
}

.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 0;
    background-color: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.faq-q:hover,
.faq-q[aria-expanded="true"] {
    background-color: var(--brand-tint);
    color: var(--brand-800);
}

.faq-sign {
    position: relative;
    width: 22px;
    height: 22px;
    flex: none;
}

.faq-sign::before,
.faq-sign::after {
    content: "";
    position: absolute;
    border-radius: 2px;
    background-color: var(--brand-700);
}

.faq-sign::before {
    left: 0;
    right: 0;
    top: 10px;
    height: 2.5px;
}

.faq-sign::after {
    top: 0;
    bottom: 0;
    left: 10px;
    width: 2.5px;
    transition: transform .15s;
}

.faq-q[aria-expanded="true"] .faq-sign::after {
    transform: scaleY(0);
}

.faq-a {
    padding: 2px 18px 18px;
    border-top: 1px solid var(--line-soft);
    font-size: 16px;
    line-height: 1.7;
    color: var(--body-2);
}

.faq-a p,
.faq-a ul {
    margin: 14px 0 0;
    max-width: 82ch;
}

/* the two limits (users/practice/plan_cards.html) */
.plan-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 26px;
}

@media (max-width: 820px) {
    .plan-pair {
        grid-template-columns: 1fr;
    }
}

.plan-card {
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background-color: var(--surface);
}

.plan-card.on {
    border-color: var(--brand-700);
    box-shadow: 0 0 0 1px var(--brand-700);
}

.plan-card h3 {
    font-size: 21px;
    margin: 0 0 10px;
}

.plan-card > p {
    margin: 0 0 16px;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--plan-ink);
}

.plan-features {
    display: grid;
    gap: 11px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.plan-features li {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 11px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--body-2);
}

.plan-features li::before {
    content: "\f058";
    font-family: "Font Awesome 5 Free";
    font-weight: 400;
    font-size: 20px;
    line-height: 22px;
    color: var(--brand-700);
}

.plan-card .btn {
    margin-top: auto;
}

/* The one panel a card opens. A full width panel under two cards belongs to
   neither by default, so it is tied to its card twice: the card is marked,
   and the panel points back at it. Stacked, the pointer would lie, so it goes. */
.plan-panel {
    position: relative;
    margin-top: 26px;
    padding: 28px 28px 24px;
    border: 1.5px solid var(--brand-700);
    border-radius: var(--radius-card);
    background-color: var(--surface);
    scroll-margin-top: 70px;
}

.plan-panel::before {
    content: "";
    position: absolute;
    top: -9px;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    border-left: 1.5px solid var(--brand-700);
    border-top: 1.5px solid var(--brand-700);
    background-color: var(--surface);
    transform: rotate(45deg);
}

.plan-panel.from-standard::before {
    left: 25%;
}

.plan-panel.from-custom::before {
    left: 75%;
}

@media (max-width: 820px) {
    .plan-panel::before {
        display: none;
    }
}

@media (max-width: 576px) {
    .plan-panel {
        padding: 20px 16px;
    }
}

/* .regsect-h: the heading with its limit chip beside it */
.practice-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line-soft);
}

.practice-header h4 {
    margin: 0;
    font-family: var(--font-legible);
    font-size: 22px;
}

/* the home page (main/home.html): the public home and the signed-in one.
   Ids stay on the elements js/code/home_moon_UI.html reaches for. */
/* .home, Results and Your clinicians share the page frame */
.home,
.results-page,
.clinicians-page {
    max-width: var(--page-max);
    margin: 8px auto 32px;
}

.home {
    font-family: var(--font-legible);
}

/* The hero sits straight on the page: heading and line on the left, the video
   on the right. */
.home-hero {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: stretch;
    padding: 16px 0 0;
    margin-bottom: 26px;
}

/* .setup-left */
.home-hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .home-hero {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-top: 8px;
    }
}

.home-title {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.005em;
    margin: 0;
}

.home-sub {
    margin: 8px 0 0;
    font-size: 18.5px;
    line-height: 1.5;
    color: var(--sub-ink);
}

/* #home-hr is an invisible spacer from the old jumbotron; the grid gap does its job now. */
.home-hero-text hr {
    margin: 0;
}

.home-hero-video video {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--video-line);
    border-radius: var(--radius-card);
    background-color: var(--video-bg);
}

/* .qgrid / .begin-row: 14px between buttons, not Bootstrap's 30px gutter */
.home-grid {
    row-gap: 14px;
    margin-left: -7px;
    margin-right: -7px;
}

.home-grid > [class*="col-"] {
    padding-left: 7px;
    padding-right: 7px;
}

.home-grid .lead {
    margin: 0;
    height: 100%;
}

.home-grid .btn {
    height: 100%;
    font-family: var(--font-legible);
    font-size: 17.5px;
    line-height: 1.3;
    padding: 16px 12px;
}

/* The four questions read as plain choices; the one whose answer is open is filled. */
.home-grid .btn.home-q {
    font-weight: 400;
}

.home-grid .btn.home-q[aria-expanded="true"],
.home-grid .btn.home-q[aria-expanded="true"]:hover {
    background-color: var(--brand-700);
    border-color: var(--brand-800);
    color: var(--on-dark);
}

/* One answer at a time, under the buttons. A panel, not a dialogue, so there
   is nothing to find and dismiss. */
.home-qpanel {
    max-width: 900px;
    margin-top: 16px;
    padding: 24px 28px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--brand-700);
    border-radius: var(--radius-card);
    background-color: var(--surface);
    font-size: 19.5px;
    line-height: 1.55;
}

.home-qpanel h2 {
    font-size: 24px;
    margin: 0 0 14px;
}

.home-qpanel .text-danger {
    font-weight: 700;
}

.home-qpanel .btn.home-qclose {
    height: auto;
    margin-top: 20px;
    padding: 9px 15px;
    font-family: var(--font-ui);
    font-size: 14.5px;
}

.home-actions .btn {
    font-size: 19px;
    padding: 18px 14px;
}

/* A clinician's home (clinicianBar + pg-home): hero and actions in one card,
   the interface face except for the heading. */
.home-clinician {
    font-family: var(--font-ui);
}

/* .hero: the headline block and the video share top and bottom edges */
.home-card .home-hero {
    grid-template-columns: 1fr 340px;
    gap: 32px;
    margin: 0;
    padding: 34px;
}

.home-card .home-hero-text {
    gap: 12px;
}

.home-card .home-title {
    font-size: 38px;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.home-card .home-sub {
    max-width: 44ch;
    margin: 0;
    font-family: var(--font-ui);
    font-size: 18px;
    line-height: 1.55;
}

.home-card .home-hero-video,
.home-card .home-hero-video > div,
.home-card .home-hero-video video {
    height: 100%;
}

.home-card .home-hero-video video {
    min-height: 170px;
    object-fit: cover;
}

/* The signed-out card's four questions, between the hero and the actions */
.home-card .home-card-qns {
    padding: 0 34px 26px;
}

/* .actions */
.home-card-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 26px 34px 34px;
    border-top: 1px solid var(--line-soft);
}

.home-card-actions .btn {
    padding: 17px 14px;
    font-size: 16.5px;
    text-align: center;
}

@media (max-width: 1080px) {
    .home-card .home-hero {
        grid-template-columns: 1fr;
    }

    .home-card-actions {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .home-card .home-hero {
        padding: 22px 18px;
    }

    .home-card .home-title {
        font-size: 30px;
    }

    .home-card-actions {
        grid-template-columns: 1fr;
        padding: 20px 18px 22px;
    }

    .home-card .home-card-qns {
        padding: 0 18px 20px;
    }
}

/* Only the visible divider: #home-hr inside the hero is a hidden spacer. */
.home > hr {
    border-top: 2px solid var(--line-soft);
    margin: 26px 0;
}

/* "Time zone is not set", for a signed-in user who never chose one */
/* As wide as the home under it (.home), not the whole window. */
.timezone-banner-dashboard-pin {
    max-width: var(--page-max);
    margin: 8px auto 1rem;
    padding: 14px 18px;
    border: 1px solid var(--alert-line);
    border-radius: var(--radius-control);
    background-color: var(--alert-tint);
    color: var(--alert-ink);
}

/* foot of a registration form (render_form_foot in users/partials/form_field.html):
   reCAPTCHA left, submit right, centred on one line; stacked when there is no room */
.form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
}

.reg-card .form-foot .btn {
    padding: 14px 34px;
}


/* A field's standing instruction, under its label: always shown, so a phone
   user reads it before choosing the file. */
.field-help {
    display: block;
    margin: 0 0 8px;
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.5;
}

/* the FAQ page (main/faqs.html): one card, the accordion from main/partials/faq.html */
.faq-page {
    padding: 26px 28px;
    margin: 8px 0 24px;
}

@media (max-width: 576px) {
    .faq-page {
        padding: 20px 16px;
    }
}

/* h1.page-title */
.faq-page-title {
    font-size: 30px;
    letter-spacing: .005em;
    margin: 0 0 6px;
}

/* .app-patient .acc-q / .acc-a p: the patient side reads larger */
.theme-patient .faq-q {
    font-size: 19px;
}

.theme-patient .faq-a,
.theme-patient .faq-a p {
    font-size: 18px;
}

/* Contact Us (main/contact.html): .card.card-pad held to 820px */
.contact-page {
    max-width: 820px;
    margin: 8px auto 24px;
    padding: 26px 28px;
}

/* h1.page-title { margin-bottom: 22px } */
.contact-title {
    font-size: 30px;
    letter-spacing: .005em;
    margin: 0 0 22px;
}

/* .form-grid: two columns, 18px between rows and 22px between columns */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 22px;
}

.form-grid > .full {
    grid-column: 1 / -1;
}

.form-grid .form-group {
    margin-bottom: 0;
}

@media (max-width: 576px) {
    .contact-page {
        padding: 20px 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* product label (main/labels.html): .card.card-pad held to 860px, the label
   in flow instead of on a fixed canvas */
.label-page {
    max-width: 860px;
    margin: 8px auto 12px;
    padding: 26px 28px;
}

@media (max-width: 576px) {
    .label-page {
        padding: 16px;
    }
}

.label-box {
    padding: 26px 28px;
    border: 1.5px solid var(--ink);
    border-radius: 6px;
    background-color: var(--surface);
    color: var(--ink);
}

.label-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.label-title {
    font-size: 29px;
    margin: 0 0 4px;
}

.label-ver {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
}

.label-lots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    font-size: 14.5px;
    font-weight: 600;
}

.lot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* The official symbols, drawn at the height the old label used. */
.label-sym {
    height: 40px;
    width: auto;
    flex: none;
}

.label-marks {
    display: grid;
    gap: 8px;
    justify-items: center;
    flex: none;
}

.label-mark {
    height: 36px;
    width: auto;
}

.label-mfr {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    font-size: 14.5px;
    line-height: 1.4;
}

.label-changes,
.label-notice {
    margin: 0 0 8px;
    font-size: 15.5px;
    color: var(--sub-ink);
}

.label-notice {
    line-height: 1.55;
}

.label-sub {
    margin: 12px 0 6px;
    font-size: 15.5px;
    font-weight: 700;
}

.label-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 20px;
    font-size: 15.5px;
    color: var(--body-2);
}

.label-warning {
    display: block;
    height: 40px;
    margin-top: 16px;
}

.label-form {
    margin: 24px 0 0;
    text-align: right;
    font-size: 13px;
    color: var(--muted);
}

.label-build {
    max-width: 860px;
    margin: 0 auto 24px;
    font-size: 12px;
    color: var(--text-3);
}


/* profile (users/account.html), and the Login PIN and MFA dialogues opened
   from it (users/partials/security_pin_modals.html, users/auth/mfa_settings.html) */
.profile-card {
    max-width: calc(var(--page-max) - 52px);   /* .appmain less its 26px padding */
    padding: 26px 28px;
    margin: 8px auto 24px;
}

.profile-head {
    display: flex;
    gap: 22px;
    align-items: center;
}

.profile-head .account-img,
.profile-head .pdf-image {
    width: 88px;
    height: 88px;
    margin: 0;
    border: 3px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--line);
    object-fit: cover;
}

/* A clinician's avatar is their Photo ID: a camera over it uploads a new one. */
.profile-image-wrapper {
    position: relative;
    flex: none;
}

.profile-head .image-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    border-radius: 50%;
    background-color: var(--scrim);
    color: var(--on-dark);
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .3s;
}

.profile-image-wrapper:hover .image-label,
.profile-image-wrapper:focus-within .image-label {
    opacity: 1;
}

/* A touch screen has no hover, so the camera would never appear: there it is
   a small badge on the avatar's corner, and the photo stays clear. The whole
   avatar is still the tap target. */
@media (hover: none) {
    .profile-head .image-label {
        opacity: 1;
        background-color: transparent;
    }

    .profile-head .image-label .fa-camera {
        position: absolute;
        right: -2px;
        bottom: -2px;
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
        border: 2px solid var(--surface);
        border-radius: 50%;
        background-color: var(--brand-700);
        color: var(--on-dark);
        font-size: 14px;
    }
}

/* Hidden but focusable, so the keyboard reaches it and shows the camera. */
.profile-head .image-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.profile-image-wrapper:focus-within {
    border-radius: 50%;
    outline: var(--focus-ring);
    outline-offset: 2px;
}

.profile-head h1 {
    font-size: 31px;
    margin: 0 0 4px;
    word-wrap: break-word;
}

/* The name and email: free to shrink, so a long email wraps inside the card
   instead of running past its edge on a phone. */
.profile-head > div:last-child {
    min-width: 0;
}

.profile-head span {
    color: var(--muted);
    font-size: 16px;
    overflow-wrap: anywhere;
}

.sect {
    margin-top: 34px;
}

.sect > h2 {
    font-size: 21px;
    margin: 0 0 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-soft);
}

.sect .sect-body {
    padding-top: 20px;
}

/* Under its heading, with the inline 18px and 15px the prototype gives it here. */
.sect .italic-note {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 15px;
    font-style: italic;
    line-height: 1.5;
}

.hint {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.6;
}

.hint b {
    color: var(--ink);
}

a.lnk {
    color: var(--brand-700);
    font-weight: 600;
}

/* The last row of Account Details' grid; the grid gap spaces it. */
.billing-note {
    margin: 0;
}

/* A clinician's country cannot change: shown as select.sel:disabled. */
.form-control.readonly-select {
    pointer-events: none;
    background-color: var(--field-disabled-bg);
    border-color: var(--field-disabled-line);
    color: var(--disabled-ink);
}

/* Email with its verified tick, or the Verify button, beside it. */
.with-suffix {
    display: flex;
    gap: 10px;
    align-items: center;
}

.verified {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border: 1.5px solid var(--ok-line);
    border-radius: 10px;
    background-color: var(--ok-tint);
    color: var(--ok);
}

.verified svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.4;
}

/* Not in the prototype, which only draws a verified address: the same box,
   in amber, while the verification email is out. */
.email-pending {
    display: inline-grid;
    place-items: center;
    min-height: 44px;
    padding: 0 12px;
    flex: none;
    border: 1.5px solid var(--amber-line);
    border-radius: 10px;
    background-color: var(--amber-tint);
    color: var(--amber-ink);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
}

.account-email-verify-btn {
    flex: none;
}

/* Login PIN, set */
.pin-row,
.statusbox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    border-radius: 10px;
}

.pin-row {
    padding: 18px 20px;
    border: 1px solid var(--line-soft);
    background-color: var(--surface-soft);
}

.pin-row b,
.statusbox b {
    display: block;
    font-size: 16.5px;
    margin-bottom: 4px;
}

.pin-row b {
    color: var(--ink);
}

.pin-row p {
    margin: 0;
    max-width: 60ch;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.55;
}

/* MFA status, and a Login PIN that is not set */
.statusbox {
    padding: 16px 20px;
}

.statusbox p {
    margin: 0;
    max-width: 64ch;
    font-size: 14.5px;
    line-height: 1.5;
}

.statusbox.off {
    border: 1px solid var(--alert-line);
    background-color: var(--alert-tint);
    color: var(--alert);
}

.statusbox.off p {
    color: var(--alert-body);
}

.statusbox.on {
    border: 1px solid var(--ok-line);
    background-color: var(--ok-tint);
    color: var(--ok);
}

.statusbox.on p {
    color: var(--ok-body);
}

.profile-card .form-foot {
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
}

/* Alone (patients, admins), Update keeps to the right. */
.profile-card .form-foot .btn {
    margin-left: auto;
}

.profile-facts {
    margin: 0;
    line-height: 1.8;
}

/* dialogues: .modal-body { display: grid; gap: 16px } */
.modal-stack {
    display: grid;
    gap: 16px;
}

.modal-stack p,
.modal-stack .form-group,
.modal-stack form {
    margin: 0;
}

.modal-stack > p {
    font-size: 16px;
    line-height: 1.6;
}

.modal-stack > .modal-step-title,
.modal-stack .method-title {
    font-weight: 700;
}

.modal-stack > .modal-step-title {
    font-size: 16.5px;
}

.modal-stack .method-title {
    margin-bottom: 9px;
    color: var(--label);
    font-size: 14.5px;
}

.modal-stack .alert {
    margin: 0;
}

.modal-stack .sent-note {
    margin-top: 8px;
}

.modal-steps {
    margin: 0;
    padding-left: 20px;
    font-size: 15.5px;
    line-height: 1.75;
}

/* A form between .modal-content and .modal-body would stop
   .modal-dialog-scrollable from scrolling the body. */
.modal-dialog-scrollable .modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* .pw .inp: room for the show/hide toggle */
.pw {
    position: relative;
}

.pw .form-control {
    padding-right: 48px;
}

.methods {
    display: grid;
    gap: 10px;
}

.method {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    font-weight: 400;
    cursor: pointer;
}

.method:hover {
    border-color: var(--line-hover);
}

.method input {
    width: 19px;
    height: 19px;
    margin-top: 2px;
    flex: none;
}

.method b {
    display: block;
    margin-bottom: 3px;
    font-size: 15.5px;
}

.method p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Not in the prototype: email codes need a verified address. */
.method:has(input:disabled) {
    color: var(--disabled-ink);
    cursor: not-allowed;
}

.method:has(input:disabled):hover {
    border-color: var(--line);
}

.pill-rec {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 4px;
    background-color: var(--rec);
    color: var(--on-dark);
    font-size: 11.5px;
    font-weight: 700;
}

.qrwrap {
    display: grid;
    place-items: center;
    gap: 9px;
}

.qrwrap img,
.qrwrap canvas {
    border: 1px solid var(--line);
    background-color: var(--surface);
}

.secretkey {
    color: var(--muted);
    font-size: 13.5px;
    word-break: break-all;
}

.secretkey code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--code-ink);
}

@media (max-width: 576px) {
    .profile-card {
        padding: 20px 16px;
    }

    .profile-head {
        gap: 16px;
    }
}


/* subscription (payment/clinician/manage_subscription.html and the two
   distributor pages; parts in _subscription_macros.html) */
.plans {
    max-width: 960px;
    margin: 8px auto 24px;
}

.plans .page-title {
    font-family: var(--font-legible);
    font-size: 30px;
    letter-spacing: .005em;
    margin: 0 0 18px;
}

.plans-lead {
    margin: 0 0 16px;
    color: var(--text-2);
    font-size: 15.5px;
    line-height: 1.6;
}

.plans .card {
    padding: var(--s2) 20px;
    border: 1px solid var(--plans-line);
    border-radius: var(--radius-card);
    box-shadow: none;
}

.plans .acct {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
    padding: 11px 18px;
}

.acct form {
    margin: 0;
}

.acct-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 34px;
    font-size: 15.5px;
    line-height: 34px;
}

.acct-line .k {
    color: var(--text-2);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.acct-line .v {
    font-weight: 600;
}

.acct-line .d {
    color: var(--text-2);
    font-size: 14px;
}

/* .pbtn--outline .pbtn--sm: Manage billing and Apply */
.plans .btn-secondary {
    border-color: var(--plans-line-strong);
    color: var(--ink);
    font-size: 13.5px;
}

.plans .btn-secondary:hover {
    background-color: var(--th-bg);
    border-color: var(--brand);
    color: var(--ink);
}

/* Downgrade scheduled: the message, and Cancel Downgrade beside it */
.plans-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.toggle__track {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background-color: var(--toggle-track);
}

.toggle__seg {
    padding: 9px 22px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--text-3);
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

.toggle__seg[aria-pressed="true"] {
    background-color: var(--brand-700);
    color: var(--on-dark);
}

.plans-loading {
    padding: 24px 0;
    text-align: center;
}

.grid {
    display: grid;
    gap: 14px;
    align-items: stretch;
}

.grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* .card.tier, not .tier: the admin tier price table has a td.tier its script reads. */
.card.tier {
    display: flex;
    flex-direction: column;
}

.tier__head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 27px;
}

.tier__name {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.2px;
}

.tier__price {
    margin: 12px 0 2px;
}

.tier__amount {
    font-size: 27px;
    font-weight: 500;
    letter-spacing: -.4px;
    font-variant-numeric: tabular-nums;
}

.tier__unit {
    color: var(--text-2);
    font-size: 14px;
}

.tier__note {
    min-height: 19px;
    color: var(--text-2);
    font-size: 13px;
    white-space: nowrap;
}

.tier__save {
    margin-left: 10px;
    color: var(--positive);
    font-weight: 700;
}

.tier__rule {
    height: 1px;
    margin: 14px 0;
    border: 0;
    background-color: var(--plans-line);
}

.tier__features {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.tier__features li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.9;
}

.tier__features svg {
    flex: none;
    margin-top: 7px;
    color: var(--positive);
}

.tier form {
    margin-top: auto;
}

/* .pbtn .pbtn--block */
.tier .btn {
    padding: 12px 16px;
    font-size: 14.5px;
}

/* .pbtn--state: the current or upcoming plan, not a control */
.tier .btn-state,
.tier .btn-state:disabled {
    border-color: var(--line);
    background-color: var(--toggle-track);
    color: var(--text-3);
    cursor: default;
}

.footer__rule {
    height: 1px;
    margin: 18px 0 14px;
    border: 0;
    background-color: var(--plans-line);
}

.voucher {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.voucher__label {
    margin: 0;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 400;
}

.voucher .voucher__input {
    width: 160px;
    min-height: auto;
    padding: 10px 12px;
    border-color: var(--plans-line-strong);
    font-size: 14px;
}

.modal-message {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

/* distributor pages */
.dist-list {
    display: grid;
    gap: 14px;
}

.dist-card__title {
    margin: 0 0 12px;
    font-size: 19px;
}

.dist-card__rows {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 22px;
    margin: 0;
    font-size: 15.5px;
}

.dist-card__rows dt {
    color: var(--text-2);
    font-weight: 600;
}

.dist-card__rows dd {
    margin: 0;
}

.plans-actions {
    margin-top: 14px;
}

.plans-support {
    margin: 14px 0 0;
}

@media (max-width: 640px) {
    .grid--3,
    .grid--2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .toggle__track {
        display: flex;
        width: 100%;
    }

    .toggle__seg {
        flex: 1;
        padding: 9px 0;
    }

    .dist-card__rows {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .dist-card__rows dd {
        margin-bottom: 8px;
    }
}


/* "Please wait" (main/partials/wait.html): the message over a spinner, on a
   card, in place of the hidden form. Not in the prototype, which has no
   loading state: its card, tokens and type. */
.wait-panel {
    max-width: 560px;
    margin: 24px auto;
    padding: 34px 28px;
    /* .card is a flex column; jQuery's .show() makes it a block. Centred either way. */
    align-items: center;
    text-align: center;
}

.wait-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--brand-tint);
    border-top-color: var(--brand-700);
    border-radius: 50%;
    animation: wait-spin .8s linear infinite;
}

.wait-msg {
    margin: 16px 0 0;
    font-family: var(--font-legible);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink);
}

@keyframes wait-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Still turning, slower: a frozen spinner reads as a hung page. */
@media (prefers-reduced-motion: reduce) {
    .wait-spinner {
        animation-duration: 2.4s;
    }
}


/* .card.card-pad: a page's one card (the patient pages) */
.card-pad {
    padding: 26px 28px;
}

/* the patient list (users/clinician/patient_list.html, pg-patients) */
.patients-page {
    max-width: calc(var(--page-max) - 52px);   /* .appmain less its 26px padding */
    margin: 8px auto 24px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.toolbar .grp {
    display: flex;
    gap: 10px;
}

.page-title {
    font-family: var(--font-legible);
    font-size: 30px;
    letter-spacing: .005em;
    margin: 0;
}

.search {
    position: relative;
    margin-bottom: 26px;
}

.search .icon {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    color: var(--muted);
    stroke-width: 2;
    pointer-events: none;
}

.search .form-control {
    min-height: 52px;
    padding-left: 48px;
    font-size: 16.5px;
}

/* ~, not +: the hidden row template sits between the two sections */
.patients-sect ~ .patients-sect {
    margin-top: 28px;
}

.patients-h {
    font-size: 21px;
    margin: 0 0 12px;
}

.legend {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 18px;
    padding: 12px 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-control);
    background-color: var(--page);
    color: var(--plan-ink);
    font-size: 14.5px;
    line-height: 1.6;
}

/* the New Tests dot */
.dot {
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    border-radius: 50%;
    background-color: var(--star);
}

.dot-inline {
    width: 15px;
    height: 15px;
    margin: 0 2px -3px;
}

.dot.is-off {
    visibility: hidden;
}

.patients-table {
    margin: 0;
    font-size: 16px;
}

.patients-table th.c,
.patients-table td.c {
    text-align: center;
}

.patients-table td.c .dot {
    width: 20px;
    height: 20px;
    margin: 0 auto;
    vertical-align: middle;
}

/* At least the prototype's 76px row, around the 52px photo */
.patients-table td {
    height: 76px;
}

.patients-table .col-new { width: 88px; }
.patients-table .col-photo { width: 76px; }

/* The other columns take their content's width, and the headings may wrap,
   so the table fits the card instead of scrolling past its rounded edge. */
.patients-table thead th {
    white-space: normal;
}

.patients-table td.act {
    text-align: right;
    white-space: nowrap;
}

.patients-table td.act .btn {
    white-space: nowrap;
}

.patients-table tr.is-highlight td {
    background-color: var(--amber-tint);
}

.avatar {
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--line-soft);
}

.name-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand-700);
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.name-link:hover {
    color: var(--brand-800);
    text-decoration: underline;
}

.name-cell {
    font-size: 17px;
    font-weight: 600;
    /* One line: the table scrolls sideways (.table-responsive) when narrow. */
    white-space: nowrap;
}

.num {
    font-variant-numeric: tabular-nums;
}

.empty {
    color: var(--text-3);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 700;
    white-space: nowrap;
}

.pill-never {
    border: 1px solid var(--alert-line);
    background-color: var(--alert-tint);
    color: var(--alert);
}

.pill-never::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--alert);
}

.patients-empty {
    margin: 14px 0 0;
    color: var(--text-2);
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--plan-ink);
    font-size: 15px;
}

.pager .btn-sm {
    min-width: 74px;
}

.pager .pos {
    padding: 0 10px;
    font-variant-numeric: tabular-nums;
}

/* .infobox: a note, with its info icon */
.infobox {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 18px;
    border: 1px solid var(--info-line);
    border-radius: var(--radius-control);
    background-color: var(--brand-tint);
    color: var(--info-ink);
    font-size: 15.5px;
    line-height: 1.6;
}

.infobox .icon {
    flex: none;
    width: 19px;
    height: 19px;
    margin-top: 3px;
    color: var(--brand-700);
    stroke-width: 2;
}

@media (max-width: 576px) {
    .card-pad {
        padding: 20px 16px;
    }
}


/* Create patient account (users/clinician/add_patient.html, pg-add-patient) */
/* « Back, above the card */
.back-link {
    margin-bottom: 16px;
}

.add-patient-title {
    margin-bottom: 24px;
}

/* .fielderr: the date of birth message under its field */
.fielderr {
    margin: 6px 0 0;
    color: var(--alert);
    font-size: 13.5px;
    line-height: 1.4;
}

.fielderr:empty {
    display: none;
}

.consentrow {
    padding: 13px 16px;
    border: 1px solid var(--amber-line);
    border-radius: var(--radius-control);
    background-color: var(--amber-tint);
}

.ackrow {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
    color: var(--ink);
    font-size: 15.5px;
    font-weight: 400;
    line-height: 1.55;
    cursor: pointer;
}

.ackrow input {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}


/* the patient record (results/clinician_user_tests.html, pg-patient) */
.record-page {
    max-width: calc(var(--page-max) - 52px);   /* .appmain less its 26px padding */
    margin: 8px auto 24px;
}

.detail {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    overflow: hidden;
}

.detail-left,
.detail-right {
    padding: 30px 32px;
}

.detail-right {
    border-left: 1px solid var(--line-soft);
    background-color: var(--surface-soft);
}

.identity {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

.identity img {
    flex: none;
    width: 92px;
    height: 92px;
    border: 3px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--line);
    object-fit: cover;
}

.identity-body {
    flex: 1;
    min-width: 0;
}

.identity h1 {
    font-family: var(--font-legible);
    font-size: 31px;
    line-height: 1.1;
    margin: 0 0 14px;
}

dl.facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 14px;
    align-items: baseline;
    margin: 0;
    font-size: 16px;
}

dl.facts dt {
    color: var(--muted);
    font-weight: 400;
}

dl.facts dd {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.edit {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background-color: var(--surface);
    color: var(--brand-700);
    cursor: pointer;
}

.edit .icon {
    width: 15px;
    height: 15px;
    stroke-width: 1.9;
}

.edit:hover {
    border-color: var(--brand);
    background-color: var(--brand-tint);
}

.edit:disabled {
    color: var(--disabled-ink);
    background-color: var(--disabled-bg);
}

/* no email: remote testing unavailable */
.notice {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid var(--amber-line);
    border-radius: var(--radius-control);
    background-color: var(--amber-tint);
    color: var(--amber-ink);
    font-size: 15px;
    line-height: 1.5;
}

.notice .icon {
    width: 19px;
    height: 19px;
    margin-top: 2px;
    stroke-width: 2;
}

.notice-text {
    flex: 1;
    min-width: 220px;
}

/* remaining tests, next test due, then Grant */
.pbox {
    margin-top: 20px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-control);
    background-color: var(--surface-soft);
    overflow: hidden;
}

.pbox-row {
    padding: 14px 18px;
}

.pbox-row + .pbox-row {
    border-top: 1px solid var(--line-soft);
}

.pbox-row.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 0;
}

.pcell {
    display: grid;
    gap: 2px;
    padding: 14px 18px;
}

.pcell + .pcell {
    border-left: 1px solid var(--line-soft);
}

.pcell span {
    color: var(--muted);
    font-size: 14.5px;
}

.pcell b {
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.grant-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.grant-inputs label {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 400;
}

.grant-inputs .form-control {
    width: 84px;
    min-height: 44px;
    text-align: center;
}

.grant-inputs .btn {
    min-height: 44px;
}

.pbox .italic-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-style: italic;
    line-height: 1.5;
}

.grp-block {
    display: grid;
    gap: 12px;
    padding: 22px 0;
}

.grp-block:first-child {
    padding-top: 0;
}

.grp-block:last-child {
    padding-bottom: 0;
}

/* The one rule between the two groups */
.grp-sep {
    padding-top: 22px;
    border-top: 3px solid var(--line);
}

.fieldrow {
    display: grid;
    gap: 7px;
}

.fieldrow .form-control-label {
    margin: 0;
}

.current-setting {
    margin: 0;
}

.detail-right .btn {
    width: 100%;
}

/* .btn-ico: a leading icon, so the actions do not read as identical blocks */
.btn-ico {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    text-align: left;
}

.btn-ico .bico {
    width: 24px;
    height: 24px;
}

.detail-foot {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 32px;
    border-top: 1px solid var(--line-soft);
    background-color: var(--surface);
}

/* the Test type listbox: a native select cannot show the field pattern */
.lb-store {
    display: none;
}

.lb {
    position: relative;
    min-width: 230px;
}

.lb-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 8px 44px 8px 12px;
    border: 1.5px solid var(--line-control);
    border-radius: var(--radius-control);
    background-color: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
}

.lb-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 15px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--rule-ink);
    border-bottom: 2px solid var(--rule-ink);
    transform: translateY(-70%) rotate(45deg);
}

.lb-btn:hover {
    border-color: var(--brand);
}

.lb-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 70;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background-color: var(--surface);
    box-shadow: var(--shadow-menu);
    list-style: none;
}

.lb-menu:focus {
    outline: none;
}

.lb-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--ink);
    font-size: 16px;
    cursor: pointer;
}

.lb-opt:hover,
.lb-opt.is-active {
    background-color: var(--brand-tint);
}

/* The keyboard's place in the list, which the menu's own focus does not show */
.lb-menu:focus-visible .lb-opt.is-active {
    outline: var(--focus-ring);
    outline-offset: -3px;
}

.lb-opt[aria-selected="true"] {
    background-color: var(--brand-tint);
    color: var(--brand-800);
    font-weight: 700;
    box-shadow: inset 0 0 0 1.5px var(--chip-line);
}

.fi {
    display: block;
    flex: none;
    width: 30px;
    height: 30px;
}

.fi-bg {
    fill: var(--brand-tint);
    stroke: var(--chip-line);
}

.fi-dot {
    fill: var(--brand-700);
}

.fi-bolt {
    fill: none;
    stroke: var(--star);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .9;
}

/* patient results (results/user_tests.html, pg-results): .page-title with the
   page's style="margin-bottom:20px", then the lists straight on the page */
.results-title {
    margin-bottom: 20px;
}

/* result lists (results/partials/result_list.html) */
.results-card {
    margin-top: 20px;
}

.resgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px 30px;
    align-items: start;
}

.resgrid > .full {
    grid-column: 1 / -1;
}

.resh {
    margin: 0 0 12px;
    font-size: 20px;
}

.resgrid > .resh.full {
    margin: 6px 0 -14px;
}

.reslist {
    display: grid;
    gap: 8px;
}

.rescard {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background-color: var(--surface);
    color: inherit;
}

.rescard:hover {
    border-color: var(--brand);
    background-color: var(--brand-tint);
    text-decoration: none;
}

/* unviewed: red edge, tint and dot, dark text */
.rescard.isnew {
    border-color: var(--alert-line);
    background-color: var(--alert-tint);
    box-shadow: inset 4px 0 0 var(--alert);
}

.rescard.isnew::after {
    content: "";
    flex: none;
    width: 11px;
    height: 11px;
    margin-left: auto;
    border-radius: 50%;
    background-color: var(--alert);
}

.ti {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
}

.rest {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.resd {
    color: var(--muted);
    font-size: 13px;
}

.resn {
    color: var(--brand-700);
    font-size: 16.5px;
    font-weight: 600;
}

.rescard.isnew .resn {
    color: var(--alert);
}

.respager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.respager .btn-sm {
    min-width: 44px;
}

.respager-gap {
    color: var(--muted);
}

@media (max-width: 1080px) {
    .detail {
        grid-template-columns: 1fr;
    }

    .detail-right {
        border-top: 1px solid var(--line-soft);
        border-left: 0;
    }
}

@media (max-width: 768px) {
    .resgrid {
        grid-template-columns: 1fr;
    }

    /* One column: an empty cell holds no place, only a gap. */
    .rescol.empty {
        display: none;
    }

    .pbox-row.two {
        grid-template-columns: 1fr;
    }

    .pcell + .pcell {
        border-top: 1px solid var(--line-soft);
        border-left: 0;
    }
}

@media (max-width: 576px) {
    .detail-left,
    .detail-right {
        padding: 22px 18px;
    }

    .detail-foot {
        padding: 16px 18px;
    }

    .identity {
        flex-direction: column;
        gap: 14px;
    }
}


/* Testing Computers (users/clinician/view_computers.html, pg-testing-computers) */
.computers-title {
    margin-bottom: 22px;
}

.computers-list-h {
    margin-top: 28px;
}

.computers-table {
    margin: 0;
    font-size: 16px;
}

.computers-table .col-name {
    width: 50%;
}

.computers-table .col-act {
    width: 130px;
}

.computers-table td.act {
    text-align: right;
}

.computers-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 14px 18px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-control);
    background-color: var(--surface-soft);
    color: var(--text-2);
}

.computers-loading {
    padding: 14px 0;
    text-align: center;
}

.computers-loading .wait-spinner {
    width: 28px;
    height: 28px;
    border-width: 3px;
}


/* Register This Device (users/clinician/add_computer.html) */
.add-computer-page {
    max-width: 640px;
}

/* Invite a clinician (users/patient/invite_clinician.html): the title, then
   the line on who emails whom */
.invite-title {
    margin-bottom: 10px;
}

.invite-lead {
    margin: 0 0 22px;
    color: var(--sub-ink);
}

/* Which clinician/practice (users/patient/clinic_select_clinician.html): the
   question is the title and the select's label */
.owner-title {
    margin-bottom: 18px;
}

.owner-title label {
    margin: 0;
    font: inherit;
    color: inherit;
}

.add-computer-foot {
    display: flex;
    align-items: center;
    gap: 14px;
}

.add-computer-spinner {
    width: 28px;
    height: 28px;
    border-width: 3px;
}


/* Practice details (users/clinician/view_addresses.html, pg-practice-details) */
.practice-title {
    margin-bottom: 20px;
}

.practice-table {
    margin: 0;
    font-size: 16px;
}

.practice-table .col-name {
    width: 320px;
}

.practice-table .col-act {
    width: 130px;
}

/* Your Practices (users/clinician/manage_practices.html) shares this table */
.practice-table .col-date {
    width: 200px;
}

.practice-table th.col-act,
.practice-table td.act {
    text-align: right;
}

.practice-add {
    margin-top: 18px;
}


/* Your clinicians (users/patient/select_clinicians.html, pg-p-your-clinician) */
/* style="font-size:30px;margin-bottom:18px" */
.clinicians-title {
    margin-bottom: 18px;
}

/* .cs-h, and the headings the prototype does not show (secondary and
   available clinicians, practices) at its size */
.cs-h,
.clinicians-sub {
    font-size: 23px;
}

.clinicians-sub {
    margin: 28px 0 14px;
}

.clinicians-sub.is-first {
    margin-top: 0;
}

.clinicians-table {
    margin: 0;
    font-size: 16px;
}

/* <th style="width:90px"> and <th style="width:190px"> */
.clinicians-table .col-pic {
    width: 90px;
}

.clinicians-table .col-act {
    width: 190px;
}

/* Make primary and Remove: as wide as the two buttons need (the cell does not
   wrap), so neither runs into the cell's padding. */
.clinicians-table .col-act.two {
    width: 1%;
}

.clinicians-table .name-cell {
    font-weight: 600;
}

.clinicians-table td.act {
    text-align: right;
    white-space: nowrap;
}

/* .btn resets white-space to normal, so the cell's nowrap does not reach the
   labels: without this the column is sized as if they could wrap, and the
   buttons spill past it. Practice table's Remove practice too. */
.clinicians-page td.act .btn {
    white-space: nowrap;
}

.clinicians-table td.act .btn + .btn {
    margin-left: 8px;
}

.clinicians-table .n {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* .clinsearch: search on the left, the two tests on the right */
.clinsearch {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 14px 32px;
    align-items: start;
    margin-top: 28px;
}

.clinsearch.is-first {
    margin-top: 0;
}

.cs-h {
    align-self: end;
    margin: 0;
}

.cs-h-right {
    font-size: 21px;
    text-align: center;
}

.cs-fields {
    display: grid;
    gap: 12px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.inline-form .sel-inline {
    width: auto;
    min-width: 140px;
}

.cs-actions {
    display: grid;
    gap: 10px;
    /* Two 50px fields and their 12px gap stand 8px taller than the two
       buttons and theirs: this drops the buttons so both bottoms line up. */
    margin-top: 8px;
}

.cs-actions .btn {
    width: 100%;
}

.cs-note {
    margin: 0;
    text-align: center;
}

.clinicians-more {
    margin: 16px 0 0;
}

.clinicians-note,
.clinicians-practices {
    margin-top: 18px;
}

/* The practice table's own action column is sized for "Delete". */
.clinicians-practices .practice-table .col-act {
    width: 190px;
}

.clinicians-practices .practice-table td.act {
    white-space: nowrap;
}

/* skipping the clinician: the question and Yes / No, over the page */
.skip-confirm {
    margin-bottom: 18px;
    text-align: center;
}

.skip-confirm p {
    margin: 0 0 16px;
}

.skip-confirm-acts {
    display: flex;
    justify-content: center;
    gap: 12px;
}

@media (max-width: 900px) {
    .clinsearch {
        grid-template-columns: 1fr;
    }

    /* One column: each heading over its own half, not both headings first. */
    .cs-h-right {
        order: 3;
        margin-top: 14px;
        text-align: left;
    }

    .cs-actions {
        order: 4;
        margin-top: 0;
    }

    /* The fixed widths are for two columns of room; here the content decides. */
    .clinicians-table .col-pic,
    .clinicians-table .col-act,
    .clinicians-practices .practice-table .col-act {
        width: auto;
    }

    .cs-note {
        text-align: left;
    }
}

/* Test Logs (results/token_log.html, pg-test-logs) */
.logs-title {
    margin-bottom: 18px;
}

/* .logbar: search and year on one row */
.logbar {
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.logbar .search {
    margin: 0;
}

.logbar .custom-select {
    min-height: 52px;
}

.logs-table {
    margin: 0;
    font-size: 16px;
}

.logs-table td.num {
    white-space: nowrap;
}

/* Seven columns: the headings wrap so the dates can stay on one line. Every
heading and cell starts on the left and sits mid-row, so one-line and
two-line headings line up. */
.logs-table thead th {
    white-space: normal;
    vertical-align: middle;
}

.logs-table th,
.logs-table td {
    text-align: left;
}

.logs-table td.n {
    font-variant-numeric: tabular-nums;
}

.logs-table td.act {
    white-space: nowrap;
}

.logs-status {
    color: var(--text-2);
    text-align: center;
}

.logs-spinner {
    width: 18px;
    height: 18px;
    border-width: 2px;
    margin-right: 8px;
    vertical-align: middle;
}

.note-italic {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 18px 0 0;
    color: var(--label);
    font-size: 15px;
    font-style: italic;
    line-height: 1.6;
}

.note-italic .icon {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    color: var(--muted);
    stroke-width: 2;
}

@media (max-width: 576px) {
    .logbar {
        grid-template-columns: 1fr;
    }
}


/* Invitations (users/clinician/practice_invitation_list.html, pg-invitations) */
.invites-table {
    margin: 0;
    font-size: 16px;
}

.invites-table .col-date {
    width: 190px;
}

.invites-table .col-act {
    width: 140px;
}

.invite-cell {
    cursor: pointer;
}

.invites-table td.act {
    white-space: nowrap;
}

/* .emptyrow: a table's empty state, centred and muted, whatever the
   table's own alignment */
.table td.emptyrow {
    padding: 38px 16px !important;
    color: var(--muted);
    font-size: 16px;
    text-align: center;
}

/* Accept and Decline as square icon buttons, named for screen readers */
.btn-icon {
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    padding: 8px;
}

.btn-icon .icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

.status-text {
    color: var(--text-2);
    text-transform: capitalize;
}

.invite-help p {
    font-size: 16.5px;
    line-height: 1.65;
}

.invite-facts dd {
    font-weight: 400;
}


/* the practice picker (users/clinician/associate_clinicians.html, pg-choose) */
.choose {
    max-width: 620px;
    margin: 8px auto 24px;
}

.choose-title {
    font-size: 24px;
    margin-bottom: 20px;
}

.choose-title label {
    margin: 0;
    color: inherit;
    font: inherit;
}

/* select and Continue on one line, bottom-aligned */
.choose-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
}

.choose-row > div {
    flex: 1;
    min-width: 0;
}

.choose-row .btn {
    min-height: 48px;
}

.choose-note {
    margin: 16px 0 0;
}

.choose-note:empty {
    display: none;
}

@media (max-width: 576px) {
    .choose-row {
        flex-direction: column;
        align-items: stretch;
    }
}


/* Access Restricted (users/clinician/access_denied.html): an expired practice */
.restricted {
    max-width: 560px;
    margin: 24px auto;
    text-align: center;
}

.restricted-mark {
    /* .card is a flex column */
    align-self: center;
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border: 1px solid var(--alert-line);
    border-radius: 50%;
    background-color: var(--alert-tint);
    color: var(--alert);
}

.restricted-mark .icon {
    width: 30px;
    height: 30px;
    stroke-width: 1.8;
}

.restricted-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.restricted-lead {
    max-width: 44ch;
    margin: 0 auto;
    color: var(--text-2);
    font-size: 16.5px;
    line-height: 1.55;
}

.restricted-steps {
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-control);
    background-color: var(--surface-soft);
    text-align: left;
}

.restricted-steps h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.restricted-steps ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
    font-size: 15.5px;
    line-height: 1.55;
}


/* error pages (errors/_error_page.html): the Access Restricted card. A missing
   page is not the visitor's fault, so its mark is the brand tint, not red. */
.restricted-mark.is-info {
    border-color: var(--info-line);
    background-color: var(--brand-tint);
    color: var(--brand-700);
}

.error-acts {
    margin-top: 24px;
}


/* A patient's test request (users/clinician/manage_token_requests.html) */
.request-page {
    max-width: 640px;
    margin: 8px auto 24px;
}

.request-title {
    font-size: 26px;
    margin-bottom: 18px;
}

.request-page .grant-inputs .form-control {
    width: 110px;
}

.request-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}



/* admin pages (templates/admin, templates/users/superuser): the admin and
   superuser dashboards have no prototype. main/layout.html puts .theme-admin on
   <body> under /admin and /superuser, and these rules lay out the markup those
   pages share as the rest of the app: each page's .content-section is the
   page card, its <h1> a .page-title, its tables the shared .table. */
.theme-admin .content-section {
    max-width: calc(var(--page-max) - 52px);   /* .appmain less its 26px padding */
    margin: 8px auto 24px;
    padding: 26px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background-color: var(--surface);
    box-shadow: var(--shadow);
}

.theme-admin .content-section > .page-title {
    margin-bottom: 18px;
}

/* A page's sections, as the profile's .sect > h2 */
.theme-admin .content-section h2 {
    margin: 28px 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--font-legible);
    font-size: 21px;
}

.theme-admin .content-section h3,
.theme-admin .content-section h4 {
    margin: 20px 0 10px;
    font-size: 18px;
}

/* The detail pages' "Label: value" lines: a little air between them. */
.theme-admin .content-section p {
    line-height: 1.75;
}

/* The old dividers between sections; the h2 rule draws one now. */
.theme-admin .content-section > hr,
.theme-admin .content-section > div > hr {
    border-top-color: var(--line-soft);
}

.theme-admin .table-responsive {
    margin: 4px 0 16px;
}

/* A row that opens its record: the whole row is the link. */
.theme-admin .table-row-link,
.theme-admin .table-row-link .link-col {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.theme-admin .table tbody tr.table-row-link:hover td {
    background-color: var(--brand-tint);
}

/* The bare .form-control-sm fields these pages use without .form-control:
   the shared field at a compact size, and a single line wide. */
.theme-admin input.form-control-sm:not(.form-control):not([type="checkbox"]):not([type="radio"]),
.theme-admin select.form-control-sm:not(.form-control),
.theme-admin textarea.form-control-sm:not(.form-control) {
    min-width: 260px;
    max-width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    vertical-align: middle;
    background-color: var(--surface);
    border: 1.5px solid var(--line-control);
    border-radius: var(--radius-control);
}

/* The admin and superuser dashboards (admin/home.html, users/superuser/home.html):
   a panel of links per area, three across */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.dash-panel {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-control);
    background-color: var(--surface-soft);
}

.theme-admin .content-section .dash-panel h2 {
    margin: 0 0 4px;
    padding: 0;
    border: 0;
    font-size: 18px;
}

.dash-panel .btn {
    width: 100%;
    text-align: left;
}

.dash-build {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* A clinician's token log (admin/user_details/clinician_token_log.html):
   the title and year on one row, the table scrolling inside the card. */
.token-log-bar {
    margin-bottom: 18px;
}

.token-log-bar .custom-select {
    width: auto;
    min-width: 160px;
}

.theme-admin .table-container {
    max-height: 68vh;
    overflow-y: auto;
}

/* An expired grant: the alert tint, not a solid red cell. */
.theme-admin .table td.is-expired {
    background-color: var(--alert-tint);
    color: var(--alert-ink);
}

.theme-admin .reclaim-section {
    color: var(--muted);
}

/* Bootstrap's .thead-light grey: the table's own heading colour instead. */
.table .thead-light th {
    color: var(--th-ink);
    background-color: var(--th-bg);
    border-color: var(--line);
}

/* A checkbox after its label (the notice forms' "Visible to ..." rows): centred
   on the label's letters (2px under the baseline), not sitting above it. The bottom margin matches the label's 7px
   so the two share one line box. */
.theme-admin .form-control-label + input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0 0 7px 8px;
    vertical-align: -2px;
}

.theme-admin .content-section .back-link {
    margin-bottom: 12px;
}

@media (max-width: 576px) {
    .theme-admin .content-section {
        padding: 20px 16px;
    }

    .theme-admin input.form-control-sm:not(.form-control):not([type="checkbox"]):not([type="radio"]),
    .theme-admin select.form-control-sm:not(.form-control) {
        min-width: 0;
        width: 100%;
    }
}
