h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

:root {
    --app-ink: #1B2F4E;
    --app-muted: #5F7391;
    --app-surface: rgba(255, 255, 255, 0.9);
    --app-surface-strong: rgba(255, 255, 255, 0.97);
    --app-border: rgba(27, 47, 78, 0.1);
    --app-shadow: 0 24px 64px rgba(20, 52, 84, 0.12);
    --app-accent: #2A6BB0;
    --app-accent-light: #8DBBE8;
    /* Orange pop (docs/guides/brand-colors.md): fills with dark text; the stronger orange is for thin lines only. */
    --app-pop: #FFB259;
    --app-pop-ink: #0D1522;
    --app-pop-line: #F7A13C;
    --app-pop-soft: #FFF1E0;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(141, 187, 232, 0.35), transparent 35%),
        radial-gradient(circle at top right, rgba(42, 107, 176, 0.12), transparent 28%),
        linear-gradient(180deg, #eaf3fc 0%, #f7fafe 100%);
    color: var(--app-ink);
}

body {
    font-family: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
}

a {
    color: inherit;
}

.page-stack {
    gap: 1.25rem;
}

.hero-panel {
    padding: 1.6rem;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.93) 0%, rgba(237, 244, 251, 0.88) 100%);
    border: 1px solid rgba(27, 47, 78, 0.08);
    box-shadow: var(--app-shadow);
}

.hero-kicker {
    display: block;
    margin-bottom: 0.45rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--app-accent);
}

.hero-copy {
    max-width: 52rem;
    color: var(--app-muted);
}

.surface-card {
    padding: 1.35rem;
    border-radius: 26px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
}

.metric-card {
    padding: 1.15rem;
    border-radius: 24px;
    background: var(--app-surface-strong);
    border: 1px solid rgba(27, 47, 78, 0.08);
    box-shadow: 0 18px 42px rgba(20, 52, 84, 0.08);
    min-height: 100%;
}

.metric-label {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--app-muted);
}

.metric-caption {
    margin-top: 1rem;
    color: var(--app-muted);
}

.metric-icon {
    box-shadow: 0 10px 24px rgba(42, 107, 176, 0.22);
}

.section-header {
    margin-bottom: 1rem;
}

.search-box {
    min-width: min(26rem, 100%);
}

.patient-name {
    font-weight: 600;
}

/* The legal texts in dialogs (LegalTexts: HTML generated from docs/legal). */
.legal-text {
    font-size: 0.875rem;
    line-height: 1.55;
}

.legal-text h1 {
    font-size: 1.25rem;
    margin: 0 0 8px;
}

.legal-text h2 {
    font-size: 1rem;
    margin: 18px 0 6px;
}

.legal-text ul,
.legal-text ol {
    padding-left: 1.3em;
    margin: 4px 0 10px;
}

.legal-text code {
    font-size: 0.85em;
}

.legal-text hr {
    border: 0;
    border-top: 1px solid var(--mud-palette-lines-default);
    margin: 18px 0;
}

/* Settings > Patient documents: a printable notice and consent form. */
.patient-document {
    max-width: 800px;
    line-height: 1.55;
}

.patient-document p {
    margin: 0 0 10px;
}

.patient-document h2 {
    font-size: 1.3rem;
    margin: 16px 0 12px;
}

.patient-document-clinic {
    font-size: 0.9rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.consent-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.consent-box {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 4px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.signature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 32px;
    margin-top: 36px;
    font-size: 0.85rem;
}

.signature-line {
    display: block;
    border-bottom: 1px solid currentColor;
    height: 28px;
    margin-bottom: 4px;
}

.patient-filters {
    padding: 4px 0 12px;
}

.patient-count {
    display: block;
    color: var(--mud-palette-text-secondary);
    margin: 0 0 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.info-pair {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(27, 47, 78, 0.08);
}

.info-pair:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--app-muted);
}

/* A device id is one long word: break it on a phone instead of widening the card. */
.device-id {
    word-break: break-all;
}

/* Settings overview: one card per section, the whole card is the link. */
.settings-section-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    height: 100%;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s ease;
}

.settings-section-card:hover,
.settings-section-card:focus-visible {
    box-shadow: 0 4px 18px rgba(27, 47, 78, 0.14);
}

/* Settings that cannot be undone (deleting the account). */
.danger-card {
    border: 1px solid rgba(var(--mud-palette-error-rgb), 0.4);
}

.empty-state {
    color: var(--app-muted);
}

/* The password rule, ticked off while typing (PasswordRulesChecklist). */
.password-rules {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.15rem;
    font-size: 0.85rem;
    color: var(--app-muted);
}

.password-rule {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.password-rule.met {
    color: var(--mud-palette-success-darken, var(--mud-palette-success));
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* A clinic's tabs: label, then a faint arrow on to the next tab. */
.clinic-tab-header {
    display: inline-flex;
    align-items: center;
}

.clinic-tab-arrow {
    opacity: 0.45;
}

/* Patient notes: the list shows the first two lines of a note; the window and the printout keep its line breaks. */
.patient-note-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.patient-note-print {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Wizard Stepper Styling */
.wizard-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--app-surface-strong);
    padding: 0.75rem 1.25rem;
    border-radius: 20px;
    border: 1px solid var(--app-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    gap: 0.5rem;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: nowrap;
}

.wizard-step:hover {
    background: rgba(22, 59, 61, 0.05);
}

.wizard-step.active {
    background: rgba(42, 107, 176, 0.1);
    color: var(--app-accent);
    font-weight: 600;
}

.wizard-step-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #E3ECF6;
    color: var(--app-muted);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.wizard-step.active .wizard-step-circle {
    background: var(--app-accent);
    color: white;
}

.wizard-step.completed .wizard-step-circle {
    background: #26b050;
    color: white;
}

.wizard-connector {
    flex-grow: 1;
    height: 2px;
    background: #E3ECF6;
    margin: 0 0.5rem;
    min-width: 15px;
}

.wizard-connector.completed {
    background: #26b050;
}

/* Compact OD/OS test tables (binocular vision, anterior segment, fundus) */
.bv-table table { width: 100%; }
.bv-table .bv-label { font-weight: 500; white-space: nowrap; }
.bv-table .mud-input-control { margin: 4px 0; }

/* Printable prescription */
.print-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
@media (max-width: 700px) { .print-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.print-rx { border-collapse: collapse; width: 100%; max-width: 640px; }
.print-rx th, .print-rx td { border: 1px solid var(--app-border); padding: 8px 12px; text-align: center; }
.print-rx thead th { background: #EDF4FB; }
.print-signature { border-top: 1px solid #333; width: 260px; padding-top: 4px; font-size: 0.85rem; }

/* The patient's spectacle prescription (Components/PrescriptionSheet): a white sheet on screen, the page itself on paper. */
.prescription-sheet { max-width: 800px; background: #fff; color: var(--app-ink); border: 1px solid var(--app-border); border-radius: 8px; padding: 32px 36px; line-height: 1.5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.prescription-sheet .rx-letterhead { display: flex; align-items: center; gap: 18px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 2px solid var(--app-accent); }
.prescription-sheet .rx-logo { max-height: 64px; max-width: 180px; object-fit: contain; }
.prescription-sheet .rx-clinic { font-size: 0.9rem; color: var(--app-muted); }
.prescription-sheet .rx-clinic-name { font-size: 1.25rem; font-weight: 600; color: var(--app-accent); }
.prescription-sheet .rx-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.prescription-sheet .rx-title { font-size: 1.5rem; font-weight: 600; margin: 0; }
.prescription-sheet .rx-patient { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 20px; margin-bottom: 20px; }
.prescription-sheet .rx-patient > div { display: flex; flex-direction: column; }
.prescription-sheet .rx-label { font-size: 0.78rem; color: var(--app-muted); }
.prescription-sheet .rx-section { font-size: 1rem; font-weight: 600; margin: 18px 0 6px; }
.prescription-sheet .rx-table { border-collapse: collapse; width: 100%; }
.prescription-sheet .rx-table th, .prescription-sheet .rx-table td { border: 1px solid #C9D7E8; padding: 8px 10px; text-align: center; }
.prescription-sheet .rx-table thead th { background: #E8F1FB; font-weight: 600; }
.prescription-sheet .rx-table tbody th { width: 64px; font-weight: 600; }
.prescription-sheet .rx-pd { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 8px; }
.prescription-sheet .rx-line { display: flex; flex-direction: column; margin-top: 16px; }
.prescription-sheet .rx-multiline { white-space: pre-line; }
.prescription-sheet .rx-empty { margin: 8px 0 0; }
.prescription-sheet .rx-signature { margin-top: 48px; width: 280px; max-width: 100%; }
.prescription-sheet .rx-signature-line { border-bottom: 1px solid var(--app-ink); height: 40px; margin-bottom: 4px; }
.prescription-sheet .rx-signer { font-weight: 600; }
/* The printed examination (Components/ExaminationSheet) builds on the prescription sheet: label/value lines and OD/OS tables per section. */
.exam-sheet .exam-sheet-fields { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 2px 16px; margin: 0 0 8px; }
.exam-sheet .exam-sheet-fields dt { font-size: 0.85rem; color: var(--app-muted); }
.exam-sheet .exam-sheet-fields dd { margin: 0; overflow-wrap: anywhere; }
/* Patient and visit: three details a row, the label small above its value. */
.exam-sheet .exam-sheet-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 20px; margin: 0 0 8px; }
.exam-sheet .exam-sheet-facts dt { font-size: 0.75rem; color: var(--app-muted); line-height: 1.3; }
.exam-sheet .exam-sheet-facts dd { margin: 0; line-height: 1.35; overflow-wrap: anywhere; }
@media (max-width: 599px) { .exam-sheet .exam-sheet-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.exam-sheet .exam-sheet-section { break-inside: avoid; }
.exam-sheet .exam-sheet-section > .rx-section { padding-bottom: 2px; border-bottom: 1px solid #C9D7E8; }
.exam-sheet .exam-sheet-table-title { font-size: 0.85rem; font-weight: 600; color: var(--app-muted); margin: 10px 0 4px; }
.exam-sheet .exam-sheet-table { margin-bottom: 8px; }
.exam-sheet .exam-sheet-table th, .exam-sheet .exam-sheet-table td { padding: 4px 8px; }
.exam-sheet .exam-sheet-table tbody th { width: auto; text-align: left; white-space: nowrap; }
.prescription-preview { background: #F4F9FE; }
.prescription-preview .prescription-sheet { margin: 0 auto; }
/* The printed invoice (POS package, InvoiceSheet) builds on the prescription sheet's letterhead and table. */
.invoice-sheet .invoice-lines td, .invoice-sheet .invoice-lines th { padding: 6px 8px; }
.invoice-sheet .invoice-totals { margin: 16px 0 0 auto; border-collapse: collapse; min-width: 280px; }
.invoice-sheet .invoice-totals td { padding: 4px 8px; text-align: right; }
.invoice-sheet .invoice-totals td:first-child { text-align: left; color: var(--app-muted); }
.invoice-sheet .invoice-totals .invoice-total td { font-weight: 700; color: var(--app-ink); border-top: 1px solid #C9D7E8; }
.invoice-sheet .invoice-footer { margin-top: 24px; font-size: 0.85rem; color: var(--app-muted); }

/* The job order printout: laid out like the optical's paper form (labels on underlined lines, the number in red). */
.job-order-sheet { max-width: 680px; }
.job-order-sheet .jo-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 14px 0 10px; }
.job-order-sheet .jo-title { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.04em; }
.job-order-sheet .jo-no { font-size: 1.15rem; font-weight: 700; white-space: nowrap; }
.job-order-sheet .jo-number { margin-left: 6px; color: #C62828; font-size: 1.5rem; letter-spacing: 0.06em; }
.job-order-sheet .jo-row { display: flex; gap: 18px; margin-top: 8px; }
.job-order-sheet .jo-field { display: flex; align-items: baseline; gap: 6px; flex: 1 1 0; min-width: 0; }
.job-order-sheet .jo-field.jo-narrow { flex: 0 0 30%; }
.job-order-sheet .jo-label { white-space: nowrap; }
.job-order-sheet .jo-value { flex: 1; min-height: 1.5em; padding: 0 4px; border-bottom: 1px solid #5B6B80; overflow-wrap: anywhere; }
.job-order-sheet .jo-multiline .jo-value { white-space: pre-line; min-height: 3em; }
.job-order-sheet .jo-rx { width: 100%; margin-top: 12px; border-collapse: collapse; }
.job-order-sheet .jo-rx th { padding: 2px 6px; font-weight: 600; text-align: left; }
.job-order-sheet .jo-rx td { height: 1.7em; padding: 2px 6px; border-bottom: 1px solid #5B6B80; }
.job-order-sheet .jo-rx td.jo-eye { width: 3.5em; border-bottom: none; font-weight: 600; }
.job-order-label { margin-right: 4px; font-size: 0.78rem; color: var(--app-muted); }
/* The job order dialog's Rx: a row per eye (label, Sph, Cyl, Axis, Add), then P.D.; two fields a row on a phone. */
.job-order-rx-grid { display: grid; grid-template-columns: 4.5em repeat(4, minmax(0, 1fr)); gap: 8px; align-items: center; }
.job-order-rx-label { grid-column: 1; }
@media (max-width: 599px) { .job-order-rx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .job-order-rx-label { grid-column: 1 / -1; } }
@media (max-width: 599px) {
    .prescription-sheet { padding: 20px 16px; }
    .prescription-sheet .rx-table th, .prescription-sheet .rx-table td { padding: 6px 4px; font-size: 0.85rem; }
    .prescription-preview-dialog, .document-preview-dialog { margin: 0 !important; width: 100% !important; max-width: 100% !important; height: 100% !important; max-height: 100% !important; border-radius: 0 !important; }
}

/* Android's print dialog adds no margin of its own, so the page would print to the paper's edge. */
@page { margin: 12mm; }

@media print {
    .mud-appbar, .mud-drawer, .no-print, #blazor-error-ui, .mud-snackbar-provider { display: none !important; }
    .mud-layout .mud-main-content { padding: 0 !important; margin: 0 !important; }
    .shell-content { padding: 0 !important; max-width: 100% !important; }
    html, body, #app, .mud-layout, .mud-main-content, .shell-content { background: #fff !important; }
    .print-sheet { box-shadow: none !important; border: none !important; }
    .prescription-sheet { max-width: none; border: none; border-radius: 0; padding: 0; font-size: 11pt; break-inside: avoid; }
    /* An exam can be longer than a page: it breaks between sections, not inside the whole sheet. */
    .prescription-sheet.exam-sheet { font-size: 10pt; break-inside: auto; }

    /* Printing from the prescription or invoice window: only the sheet goes on paper, without the app behind it or the window's frame. */
    body:has(.prescription-preview-dialog) .mud-layout,
    body:has(.document-preview-dialog) .mud-layout,
    .mud-dialog-container:has(.prescription-preview-dialog) .mud-overlay,
    .mud-dialog-container:has(.document-preview-dialog) .mud-overlay,
    .prescription-preview-dialog .mud-dialog-title,
    .prescription-preview-dialog .mud-dialog-actions,
    .document-preview-dialog .mud-dialog-title,
    .document-preview-dialog .mud-dialog-actions { display: none !important; }
    .mud-dialog-container:has(.prescription-preview-dialog),
    .mud-dialog-container:has(.document-preview-dialog),
    .prescription-preview-dialog,
    .document-preview-dialog,
    .prescription-preview-dialog .mud-dialog-content,
    .document-preview-dialog .mud-dialog-content {
        position: static !important; display: block !important; inset: auto !important; transform: none !important;
        width: 100% !important; max-width: none !important; height: auto !important; max-height: none !important;
        margin: 0 !important; padding: 0 !important; overflow: visible !important;
        box-shadow: none !important; border-radius: 0 !important; background: #fff !important;
    }
}

/* Exam images */
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.attachment-card { display: flex; flex-direction: column; gap: 4px; }
.attachment-tile { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 1px solid var(--app-border); border-radius: 10px; overflow: hidden; background: #EDF4FB; cursor: pointer; }
.attachment-tile:focus-visible { outline: 3px solid var(--app-accent); outline-offset: 2px; }
.attachment-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.attachment-caption { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; gap: 4px; }
.attachment-missing { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 80px; color: #7A8CA6; }
.attachment-viewer .attachment-missing { display: flex !important; flex-direction: column; gap: 8px; padding: 32px 16px; text-align: center; color: #C9D7E8; }
.attachment-missing-text { font-size: 0.9rem; line-height: 1.4; }
.attachment-viewer { max-height: 62vh; overflow: auto; background: #0F1B2E; border-radius: 10px; }
.attachment-viewer-image { width: 100%; height: auto; display: block; }
@media print { .attachment-grid, .attachment-viewer { display: none; } }

.user-name { max-width: 240px; color: inherit; }
.user-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 599px) { .user-name { display: none; } }

/* Printable full patient record (Pages/PatientRecordPrint.razor). */
.record-exam { break-inside: avoid-page; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--app-border); }
.record-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; margin: 6px 0; }
.record-field { font-size: 0.9rem; }
.record-section { margin-top: 8px; }
.record-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.record-thumb { width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--app-border); border-radius: 4px; }
.record-table td, .record-table th { text-align: left; }
@media print { .record-images { display: flex !important; } .record-thumb { display: block !important; } }

/* Superadmin console (MobclyCodex.Web.Client/Pages/SuperAdmin): plain CSS charts, no chart library. */
.sa-bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 18px; }
.sa-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.sa-bar { width: 100%; max-width: 44px; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg, #8DBBE8 0%, #2A6BB0 100%); transition: height .3s ease; }
.sa-bar-value { font-size: 0.75rem; font-weight: 600; color: var(--app-ink); margin-bottom: 3px; min-height: 1em; }
.sa-bar-label { font-size: 0.68rem; color: var(--app-muted); margin-top: 6px; white-space: nowrap; }
.sa-hbar-row { display: grid; grid-template-columns: 8.5rem 1fr 2.5rem; align-items: center; gap: 12px; margin-bottom: 10px; }
.sa-hbar-label { font-size: 0.9rem; color: var(--app-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-hbar-track { background: #E3ECF6; border-radius: 999px; height: 12px; overflow: hidden; }
.sa-hbar-fill { height: 100%; border-radius: 999px; background: var(--app-accent); }
.sa-hbar-alt { background: #8DBBE8; }
.sa-hbar-count { text-align: right; font-weight: 600; font-size: 0.9rem; }
.sa-kv { display: grid; grid-template-columns: 9rem 1fr; gap: 6px 12px; font-size: 0.92rem; }
.sa-kv dt { color: var(--app-muted); }
.sa-kv dd { margin: 0; }
.sa-days { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }

/* Phones (under 600 px): the top bar has room for the menu, the brand, the sync chip and one icon. MudBlazor's own flex rules beat a plain
   `.user-name { display: none }`, hence the stronger selectors. Logout moves to an icon here and to the side menu. */
.top-bar .logout-icon, .drawer-logout { display: none; }
@media (max-width: 599px) {
  .top-bar .user-name, .top-bar .logout-btn { display: none !important; }
  .top-bar .logout-icon { display: inline-flex !important; }
  .drawer-logout { display: flex !important; }
}
.sync-chip-short { display: none; }
@media (max-width: 599px) {
  .sync-chip-full { display: none; }
  .sync-chip-short { display: inline; }
}

/* Settings > Booking widget */
.widget-snippet {
    white-space: pre-wrap;
    word-break: break-all;
    background: #F4F9FE;
    border: 1px solid #D9E4F0;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
    margin: 0 0 12px;
}

.widget-link {
    word-break: break-all;
}

.widget-qr {
    width: 180px;
    height: 180px;
    image-rendering: pixelated;
    border: 1px solid #D9E4F0;
    border-radius: 8px;
}

.widget-preview {
    width: 100%;
    min-height: 640px;
    border: 1px solid #D9E4F0;
    border-radius: 12px;
    background: #fff;
}

/* The simple examination form (docs/planning/simple-exam-form.md). One row per eye: the eye, its typed prescription line, then the
   small fields beside it (aided and unaided acuity). On a phone the small fields wrap under the line. */
.simple-exam .surface-card { padding: 1rem 1.15rem; border-radius: 20px; }
.simple-exam-new-rx { border: 2px solid var(--mud-palette-primary); }
.examrx-row { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) 9.75rem 9.75rem; gap: 0.5rem; align-items: start; margin-bottom: 0.5rem; }
.examrx-row-plain { grid-template-columns: 2.25rem minmax(0, 1fr); }
.examrx-eye { font-weight: 600; padding-top: 0.85rem; }
@media (max-width: 599px) {
    .examrx-row { grid-template-columns: 2.25rem minmax(0, 1fr) minmax(0, 1fr); }
    .examrx-row .examrx-line { grid-column: 2 / -1; }
    .examrx-row .examrx-va { grid-column: auto; }
    .examrx-row .examrx-line + .examrx-va { grid-column: 2; }
    .examrx-row-plain { grid-template-columns: 2.25rem minmax(0, 1fr); }
}

/* The advanced exam: one line per eye, the eye's name in front of its fields (OD above OS). */
.exam-eye-row { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.5rem; align-items: start; }
.exam-eye { font-weight: 600; padding-top: 1.1rem; }

/* A save bar that stays at the bottom of the screen on a long form, so saving never needs scrolling to the end. */
.form-save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; border-radius: 18px; background: var(--app-surface-strong, #fff); border: 1px solid var(--app-border); box-shadow: 0 -6px 24px rgba(20, 52, 84, 0.10); }
.form-save-bar-space { flex: 1 1 auto; }
@media (max-width: 599px) { .form-save-bar { padding: 0.4rem 0.5rem; gap: 0.25rem; justify-content: flex-end; } .form-save-bar .mud-button-root { padding-left: 0.6rem; padding-right: 0.6rem; } .form-save-bar .mud-button-icon-start { display: none; } }
@media print { .form-save-bar { display: none; } }
.prescription-sheet .rx-table td.rx-typed { text-align: left; }

/* A practitioner's colour in the diary (PractitionerColors, docs/planning/practitioners.md). */
.practitioner-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }

/* My Appointments (MyAppointmentsCard): one weekday per row, the day, from, to and the clinic's own hours; wraps on a phone. */
.my-hours-row { display: grid; grid-template-columns: minmax(130px, 160px) repeat(2, minmax(110px, 150px)) 1fr; align-items: center; gap: 8px; }
@media (max-width: 599px) { .my-hours-row { grid-template-columns: 1fr 1fr; } }
