/* Locally served OFL font also embedded by document-print.js for the workstation printer. */
@font-face{font-family:"Noto Sans Thai Looped";font-style:normal;font-weight:100 900;font-display:swap;src:url("fonts/NotoSansThaiLooped.ttf") format("truetype")}

:root {
    --app-font-body: "Noto Sans Thai Looped", "Figtree", sans-serif;
    --app-font-heading: var(--app-font-body);
}

.clinic-brand { display:flex; align-items:center; gap:.6rem; color:var(--app-foreground); text-decoration:none; font-weight:700; line-height:1.15; }
.clinic-brand > svg { color:var(--app-accent); flex:0 0 auto; }
.clinic-brand small { display:block; margin-top:.25rem; font-size:.65rem; font-weight:500; color:var(--app-foreground-muted); }
.clinic-nav .nav-item { margin:0 0 .2rem; }
.clinic-footer { font-size:.72rem; }
.patient-account-details code { white-space:normal; overflow-wrap:anywhere; }
.clinic-shell .app-shell__navigation-preferences { grid-template-columns:1fr; gap:.7rem; }
.clinic-shell .section-navigation__desktop:has(.section-navigation__overflow[open]) { overflow:visible; }
.workspace { max-width:1800px; margin-inline:auto; padding-top:.25rem; color:var(--app-foreground); }
.workspace:has(.visit-shell) { max-width:none; }
/* Visit keeps its task editor near the patient context; other page headings retain their layout. */
.clinic-shell:has(.visit-shell) .app-shell__page-heading { padding-block:.5rem; }
.clinic-shell:has(.visit-shell) .page-heading__body { padding:.25rem 0; }
.clinic-shell:has(.visit-shell) .application-page-heading__breadcrumbs { padding-block:.25rem; }
.workspace a { color:var(--app-accent); text-underline-offset:3px; }
.workspace h1 { font-size:clamp(1.6rem,3vw,2.1rem); font-weight:600; letter-spacing:-.025em; margin:0 0 .5rem; }
.workspace h1:focus { outline:none; }
.workspace h2 { font-size:1.15rem; font-weight:600; margin:0 0 1rem; }
.workspace h3 { font-size:1.02rem; margin:.75rem 0; }
.workspace p { margin:.5rem 0 1rem; }
.workspace .lead { color:var(--app-foreground-muted); margin-bottom:1.8rem; font-size:1rem; }
.workspace .panel { padding:clamp(1rem,2vw,1.5rem); background:var(--app-surface); border:1px solid var(--app-border); border-radius:var(--app-radius-lg); box-shadow:var(--app-shadow-sm); margin-bottom:1.5rem; min-width:0; }
.workspace .two-columns { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:1.5rem; align-items:start; }
.registration-form { border:0; margin:0; padding:0; min-width:0; }
.registration-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.3rem 1.25rem; }
.registration-section-heading { display:flex; align-items:flex-start; gap:.9rem; margin-bottom:1rem; }
.registration-section-heading h2 { margin-bottom:.35rem; }
.registration-step { font-size:1.05rem; font-weight:700; color:var(--app-accent); background:var(--app-accent-soft); border-radius:var(--app-radius-md); padding:.55rem; }
.registration-field + .registration-field { border-top:1px solid var(--app-border); margin-top:1.4rem; padding-top:1rem; }
.registration-chips { display:flex; flex-wrap:wrap; gap:.5rem; margin:.65rem 0 1rem; }
.workspace button.registration-chip { background:var(--app-surface); color:var(--app-foreground); border:1px solid var(--app-border); border-radius:999px; font-weight:500; padding:.45rem .85rem; }
.workspace button.registration-chip.is-selected { color:var(--app-accent); background:var(--app-accent-soft); border-color:var(--app-accent); box-shadow:inset 0 0 0 1px var(--app-accent); }
.workspace .pain-scale button { min-width:44px; padding:.45rem; border-radius:var(--app-radius-md); }
.registration-submit { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:1rem; padding:.75rem 0 1.5rem; }
.photo-capture { display:flex; align-items:center; gap:1.25rem; margin:1rem 0; }
.patient-photo-preview { width:140px; min-height:140px; flex:0 0 140px; background:var(--app-surface-muted); border:1px dashed var(--app-border); border-radius:var(--app-radius-md); display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:.8rem; overflow:hidden; }
.patient-photo-preview img { width:140px; height:140px; object-fit:cover; }
.photo-placeholder { font-size:2.8rem; color:var(--app-foreground-muted); }
.photo-capture-controls { flex:1; min-width:0; }
.camera-view video { width:min(100%,480px); max-height:380px; background:#111; border-radius:var(--app-radius-md); }
.camera-view[hidden] { display:none; }
.intake-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr)); gap:.5rem 1rem; }
.intake-summary dt { margin:0; }
.intake-summary dd { margin:.4rem 0 .5rem; overflow-wrap:anywhere; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
@media(max-width:760px) { .registration-grid { grid-template-columns:1fr; } .photo-capture { align-items:flex-start; flex-direction:column; } .registration-submit button { width:100%; } }
.workspace :where(label:not(.app-form-control__label):not(.app-choice)) { display:block; font-size:.88rem; font-weight:600; margin-bottom:1rem; }
.workspace :where(:is(input:not([type=hidden]),select,textarea):not([class*="app-"])) { display:block; width:100%; padding:.65rem .75rem; margin-top:.35rem; background:var(--app-surface); border:1px solid var(--nexora-input-border,var(--app-border)); border-radius:var(--app-radius-md); color:var(--app-foreground); font:inherit; }
.workspace :where(textarea:not(.app-form-control__input)) { min-height:90px; }
.workspace :where(input[type=checkbox]:not([class*="app-"])) { display:inline-block; width:auto; margin:.5rem; accent-color:var(--app-accent); }
.workspace :where(:is(button,.btn):not([class*="app-"]):not(.app-grid *, .app-grid-paginator *)) { display:inline-block; cursor:pointer; background:var(--app-accent); color:var(--app-on-brand); border:1px solid var(--app-accent); border-radius:var(--app-radius-md); padding:.6rem 1rem; font-family:inherit; font-size:.9rem; font-weight:600; line-height:1.4; text-decoration:none; white-space:normal; min-height:44px; }
.workspace :where(:is(button.secondary,.btn-link):not(.app-button)) { background:var(--app-surface); color:var(--app-accent); }
.workspace :where(button:not([class*="app-"]):not(.app-grid *, .app-grid-paginator *)):disabled { opacity:.55; cursor:wait; }
.workspace :where(button:not([class*="app-"]):not(.app-grid *, .app-grid-paginator *)):hover:not(:disabled) { box-shadow:var(--app-shadow-sm); filter:brightness(.96); }
.workspace :focus-visible { outline:2px solid var(--app-focus-ring); outline-offset:3px; }
.workspace :is(.actions,.section-top) { display:flex; gap:.75rem; align-items:center; flex-wrap:wrap; }
.workspace .section-top { justify-content:space-between; margin-bottom:1rem; }
.workspace .actions input:not(.app-form-control__input) { width:auto; margin:0; }
.workspace .table-scroll { overflow-x:auto; }
.workspace :where(table:not(.quickgrid):not(.printed-receipt table)) { width:100%; border-collapse:collapse; font-size:.875rem; }
.workspace :where(table:not(.quickgrid):not(.printed-receipt table)) th { text-align:left; color:var(--app-foreground-muted); font-size:.8rem; font-weight:600; padding:.65rem; background:var(--app-surface-muted); }
.workspace :where(table:not(.quickgrid):not(.printed-receipt table)) td { padding:.7rem .65rem; border-bottom:1px solid var(--app-border); vertical-align:top; }
.workspace .status { font-size:.78rem; background:var(--app-accent-soft); color:var(--app-foreground); padding:.25rem .5rem; border-radius:var(--app-radius-sm); white-space:nowrap; }
.workspace .notice { padding:1rem; border-left:3px solid var(--app-accent); background:var(--app-accent-soft); border-radius:0 var(--app-radius-sm) var(--app-radius-sm) 0; margin:1rem 0; }
.workspace .result { border-top:1px solid var(--app-border); padding-top:1.25rem; margin-top:1.25rem; }
.workspace dt { font-weight:600; margin-top:.75rem; }
.workspace dd { margin:.25rem 0 1rem; white-space:pre-wrap; }
.workspace .preserve-lines { white-space:pre-wrap; }
.workspace summary { cursor:pointer; margin:1rem 0; font-weight:600; }
.workspace .workflow-links { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); gap:1rem; margin:1.8rem 0; }
.workspace .workflow-link { padding:1.4rem; border:1px solid var(--app-border); border-radius:var(--app-radius-lg); background:var(--app-surface); box-shadow:var(--app-shadow-sm); text-decoration:none; }
.workspace .workflow-link:hover { border-color:var(--app-accent-border); }
.workspace .workflow-link p { color:var(--app-foreground-muted); margin-bottom:0; }
.workspace .row { display:flex; flex-wrap:wrap; gap:2rem; }
.workspace :is(.col-lg-6,.col-md-6) { flex:1 1 420px; max-width:620px; }
.workspace :is(.col-lg-4,.col-lg-3) { flex:1 1 230px; }
.workspace .col-lg-9 { flex:3 1 600px; }
.workspace .mb-3 { margin-bottom:1rem; }
.workspace .mt-2 { margin-top:.5rem; }
.workspace :is(.text-danger,.validation-message) { color:var(--app-danger); }
.workspace .text-secondary { color:var(--app-foreground-muted); }
.workspace .w-100 { width:100%; }
.workspace .form-floating { display:flex; flex-direction:column-reverse; gap:.2rem; }
.workspace .form-floating label,.workspace .form-floating input { margin:0; }
.workspace .nav-item { margin:.7rem 0; }
.workspace hr { border:0; border-top:1px solid var(--app-border); margin:1.4rem 0; }
.workspace .valid.modified:not([type=checkbox]):not(.app-form-control__input) { outline:1px solid var(--app-success); }
.workspace .invalid:not(.app-form-control__input) { outline:2px solid var(--app-danger); }
.blazor-error-boundary { padding:1rem; color:var(--app-danger); background:var(--app-danger-soft); border:1px solid var(--app-danger-border); border-radius:var(--app-radius-md); }
.blazor-error-boundary::after { content:"The action could not complete. Reload and check its status before retrying."; }
@container app-shell (max-width:48rem) {
    /* Keep the closed package drawer out of the keyboard order and accessibility tree. */
    .clinic-shell .app-shell__navigation:not(.is-open) { visibility:hidden!important; }
    /* A retained desktop collapse state must not outrank the mobile open state. */
    .clinic-shell .app-shell__frame.is-desktop-collapsed .app-shell__navigation.is-open { transform:translateX(0); }
}
@media(max-width:760px) {
    .workspace .two-columns { grid-template-columns:1fr; }
    .workspace .row { gap:1.25rem; }
    .workspace .row > * { flex-basis:100%; min-width:0; }
    .clinic-brand small { display:none; }
}
@media print {
    .clinic-shell:has(.medical-certificate),.clinic-shell:has(.medical-certificate) .app-shell__frame { background:white!important; padding:0!important; height:auto!important; min-height:0!important; }
    :root { color-scheme:light!important; }
    .clinic-shell :is(.app-shell__header,.app-shell__navigation,.app-shell__scrim,.app-shell__page-heading),.app-shell__skip-link,#blazor-error-ui,.workspace button,.workspace .no-print { display:none!important; }
    .clinic-shell,.clinic-shell .app-shell__frame { display:block!important; min-height:0; background:white; }
    .clinic-shell .app-shell__content,.workspace { padding:0; max-width:none; }
    .workspace { color:black; }
    .workspace .panel { background:white; border:0; box-shadow:none; }
    .workspace a { color:black; }
    .workspace .table-scroll { overflow:visible; }
    body { background:white!important; }
    .clinic-shell:has(.basket-label-sheet),.clinic-shell:has(.basket-label-sheet) .app-shell__frame { min-height:0!important; background:white!important; }
    .clinic-shell:has(.basket-label-sheet) .app-shell__content { padding:0!important; min-height:0!important; }
}
.clinic-language-switcher,.clinic-language-switcher form{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap}
.clinic-language-switcher button{min-height:44px;padding:.45rem .8rem;border:1px solid var(--app-border);border-radius:var(--app-radius-sm);background:var(--app-surface);color:var(--app-foreground);font:inherit;cursor:pointer}
.clinic-language-switcher button[aria-pressed=true]{background:var(--app-accent-soft);border-color:var(--app-accent);font-weight:600}
.clinic-language-switcher button:focus-visible{outline:2px solid var(--app-accent);outline-offset:2px}
.clinic-language-switcher button:disabled{opacity:.6;cursor:wait}
.live-status{display:inline-flex;align-items:center;gap:.4rem}.live-status::before{content:"";flex-shrink:0;width:.45rem;height:.45rem;border-radius:50%;background:var(--app-success)}
.live-status.is-unavailable::before{background:var(--app-warning,#a86b12)}
.clinic-status-cards{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.5rem;margin:.75rem 0 1rem}
.workspace button.clinic-status-card{display:flex;flex-direction:row;align-items:center;justify-content:space-between;text-align:left;padding:.75rem;border:1px solid var(--app-border);background:var(--app-surface);color:var(--app-foreground);border-radius:var(--app-radius-md);gap:.5rem;min-width:0;font-size:.82rem}
.clinic-status-card strong{font-size:1.4rem;line-height:1.1}.clinic-status-card small{display:none}.workspace button.clinic-status-card.selected{border-color:var(--app-accent);box-shadow:0 0 0 1px var(--app-accent)}
@media(max-width:1000px){.clinic-status-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:560px){.clinic-status-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
.workspace .form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem 1rem; }
@media(max-width:760px) { .workspace .form-grid { grid-template-columns:1fr; } }

/* Package controls own their visual states; clinic rules supply layout and touch sizes. */
.workspace .app-form-control { min-width: 0; margin-bottom: .9rem; }
.workspace .app-form-control .app-form-control__label { margin-bottom: .35rem; }
.clinic-shell :is(.workspace,.clinic-language-switcher) :is(button,a).app-button { min-height: 44px; max-width: 100%; }
.clinic-shell .workspace .app-button .app-button__label { white-space: normal; overflow: visible; }
.workspace .app-form-control__input { min-width: 0; }
.workspace .actions .app-form-control { flex: 1 1 12rem; margin-bottom: 0; }
.clinic-status-card .app-button__label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; }
.clinic-sign-in { color:var(--app-accent); text-underline-offset:3px; }
.workspace .clinic-grid-shell { margin-block:0 1.25rem; }
.workspace .clinic-grid-shell :is(h2,h3,h4) { margin:0; }
.workspace .clinic-grid-shell .app-grid-shell__toolbar p { margin:.35rem 0 0; }
.workspace .app-grid-shell__commandbar .app-form-control { margin-bottom:0; }

/* Panels and disclosures supply the surface for their embedded tables. */
.clinic-shell .workspace :is(.panel,.experience-disclosure) .app-grid-shell { border:0; border-radius:0; background:transparent; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; }
.clinic-shell .workspace :is(.panel,.experience-disclosure) .app-grid-shell > :is(.app-grid-shell__commandbar,.app-grid-shell__toolbar,.app-grid-shell__footer) { padding-inline:0; background:transparent; }

html[data-clinic-connection="disconnected"] .live-status,
body:has(#components-reconnect-modal:is(.components-reconnect-show,.components-reconnect-retrying,.components-reconnect-failed,.components-reconnect-paused,.components-reconnect-resume-failed)) .live-status{visibility:hidden}
