/* Shared visual standards: clear hierarchy, readable secondary text and resilient layout. */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #1b3040;
  --muted: #5f7382;
  --line: #dfe6eb;
  --blue: #176d78;
  --nav: #e7f3f4;
  --gp-muted: #5f7382;
  color-scheme: light;
}
/* Patient reporting uses the existing clinic type, surface and control tokens. */
.report-workspace { display:grid;grid-template-columns:minmax(0,1.25fr) minmax(260px,.75fr);gap:24px;align-items:start; }
.report-compose,.report-reader { padding:28px;min-width:0; }
.report-heading { margin-bottom:24px; }
.report-heading h2 { font-size:1.5rem;letter-spacing:-.025em;margin:6px 0 8px; }
.report-heading p { color:var(--muted);margin:6px 0; }
.report-presets { display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px; }
.report-compose fieldset { border:0;margin:0;padding:0;min-width:0; }
.report-compose textarea { min-height:150px;resize:vertical; }
.report-options { margin-block:20px; }
.report-options summary,.report-evidence summary { cursor:pointer;min-height:44px;padding-block:10px;font-weight:600;font-size:.875rem; }
.report-source-note { border-left:3px solid var(--blue);padding:0 0 0 16px;margin:24px 0;font-size:.875rem; }
.report-source-note p { color:var(--muted);margin:6px 0 0; }
.report-history-row { display:flex;gap:16px;align-items:center;justify-content:space-between;padding:20px 24px;border-top:1px solid var(--line); }
.report-history-row > div { min-width:0; }
.report-history-row b { display:block;font-size:.9375rem;overflow-wrap:anywhere; }
.report-history-row small { display:block;color:var(--muted);margin-top:6px; }
.report-history-row .btn { flex-shrink:0; }
.report-reader-top { display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:24px; }
.report-reader-top > div { display:flex;align-items:center;gap:12px;flex-wrap:wrap; }
.report-status { padding:16px 20px;border-radius:12px;background:#eaf3f4;color:#285a63;font-size:.875rem; }
.report-text { white-space:pre-wrap;overflow-wrap:anywhere;font-size:1rem;line-height:1.85;max-width:80ch;margin:28px auto 36px; }
.report-structured { white-space:normal; }
.report-structured section + section { margin-top:28px;padding-top:24px;border-top:1px solid var(--line); }
.report-structured h3 { margin:0 0 16px;font-size:1.125rem;letter-spacing:-.015em; }
.report-structured p { margin:12px 0 8px; }
.report-structured li { margin-block:10px; }
.report-citations { display:flex;flex-wrap:wrap;gap:6px 12px;font-size:.75rem;color:#526c7a;margin-bottom:16px; }
.report-citations .report-citation { min-height:32px;padding:6px 10px;background:#eef5f6;border:1px solid #d5e6e8;border-radius:8px;color:#285b65;font-size:.75rem; }
@media(pointer:coarse){.report-citations .report-citation{min-height:44px}}
.report-reader textarea { line-height:1.75;min-height:480px;resize:vertical; }
.report-reader .form-field { margin-top:24px; }
.report-evidence { border-top:1px solid var(--line);padding:12px 0; }
.report-evidence h3 { margin-top:24px;font-size:1rem; }
.report-evidence p { font-size:.9375rem; }
.report-quote { margin:16px 0 24px;padding:16px 20px;background:#f4f7f8;border-radius:12px;border-left:3px solid #76a4ad; }
.report-quote blockquote { white-space:pre-wrap;margin:0 0 12px;overflow-wrap:anywhere;font-size:.9375rem; }
.report-quote figcaption { color:var(--muted);font-size:.8125rem;overflow-wrap:anywhere; }
.report-source-text { white-space:pre-wrap;overflow-wrap:anywhere;max-height:420px;overflow-y:auto;padding:12px 0; }
.report-review { padding-top:20px;margin-top:12px;border-top:1px solid var(--line); }
@media(max-width:1100px){.report-workspace{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){.report-compose,.report-reader{padding:20px 16px}.report-heading h2{font-size:1.25rem}.report-history-row{padding:16px}.report-reader-top>div{width:100%}.report-reader-top .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.report-quote{padding:14px}.report-status{padding:14px}.report-text{font-size:.9375rem}}
body { line-height: 1.5; }
button, input, select, textarea { font-family: inherit; }
h1 { font-size: 1.875rem; line-height: 1.2; letter-spacing: -.035em; }
h2 { line-height: 1.35; }
h3 { line-height: 1.45; }
p, small, dd, h1, h2, h3, label, .badge, .lg-tag { overflow-wrap: anywhere; }
:is(.panel, .lg-card, .workspace, .right-stack, .form-layout, .overview-grid, .lg-chart-grid, .visit-workspace) > * { min-width: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #147d90; outline-offset: 3px; }
button:disabled { box-shadow: none; }
.btn, .lg-open-record { min-height: 44px; font-size: .875rem; line-height: 1.35; padding: 10px 14px; white-space: normal; text-align: center; }
.btn.text { min-height: 44px; padding: 8px 10px; }
.btn.primary { box-shadow: none; }
.btn.soft { background: #e7f3f4; color: #155d67; }
.icon-btn { width: 44px; height: 44px; min-width: 44px; flex-shrink: 0; }
.button-wrap, .actions { gap: 10px; flex-wrap: wrap; }
.button-wrap > *, .actions > * { max-width: 100%; }
.badge, .lg-tag { font-size: .75rem; line-height: 1.45; }
.badge { color: #536879; }
.badge.blue { color: #245968; background: #eaf3f6; }
.badge.green { color: #236c54; }
.badge.orange { color: #8d562d; }
.badge.purple { color: #6c4d9e; }
.lg-tag.amber { color: #7b5014; }
.lg-tag.rose { color: #993c39; }
.small, small { line-height: 1.6; }
.empty-state { padding: 32px 24px; }
.empty-state p, .lg-empty { color: var(--muted); font-size: .875rem; }
.notice { font-size: .875rem; color: #4d6275; }
.page-head, .lg-page-head { margin: 0 0 24px; align-items: flex-start; }
.page-head > div:first-child, .lg-page-head > div:first-child { min-width: 0; }
.page-head h1, .lg-page-head h1 { font-size: 1.875rem; line-height: 1.22; letter-spacing: -.035em; margin-top: 6px; }
.page-head p, .lg-page-head p { font-size: .9375rem; line-height: 1.6; }
.eyebrow, .lg-eyebrow { font-size: .75rem; letter-spacing: .09em; color: #5f7483; }
.page-footer { color: #657886; font-size: .75rem; line-height: 1.7; }
.topbar { min-height: 72px; height: auto; padding-block: 16px; }
.crumb { min-width: 0; font-size: .8125rem; color: #5e7381; }
.crumb strong { color: #435e70; overflow-wrap: anywhere; }
.top-actions { flex-shrink: 0; gap: 14px; }
.today-date { font-size: .8125rem; color: #5f7382; }
.demo-pill { font-size: .6875rem; color: #526978; }
.gp-workspace-label { font-size: .8125rem; padding: 8px 12px; }

/* The sidebar is independently scrollable in short windows. */
.sidebar { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-top: 28px; }
.sidebar .brand { padding: 0 0 26px; gap: 12px; }
.brand-symbol:has(img) { width: 50px; min-width: 50px; flex: 0 0 50px; height: 44px; padding: 7px 10px; box-shadow: none; }
.brand-symbol img { width: 30px; height: 30px; }
.sidebar .wordmark { font-size: 1.5rem; letter-spacing: -.04em; }
.sidebar .brand small { font-size: .625rem; letter-spacing: .13em; line-height: 1.45; margin-top: 2px; }
.sidebar .nav-label { font-size: .6875rem; letter-spacing: .1em; margin-inline: 12px; }
.sidebar .nav button { min-height: 44px; padding: 11px 12px; font-size: .875rem; }
.sidebar .nav button span { min-width: 0; }
.sidebar-bottom { padding-top: 24px; }
.profile { padding-inline: 0; }
.profile > div:last-child { min-width: 0; }
.profile b { font-size: .8125rem; overflow-wrap: anywhere; }
.profile small { font-size: .75rem; }
.login-art .wordmark { display: block; }
.login-art .brand small { display: block; font-size: .75rem; margin-top: 4px; }
.login-art .brand { flex-wrap: nowrap; }
.login-card h1 { line-height: 1.2; }
.login-disclaimer { font-size: .8125rem; color: #536c7e; }

/* Forms and modal sheets use the same spacing and type scale. */
.form-grid { gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-field { gap: 8px; }
.form-field > span { font-size: .875rem; line-height: 1.45; margin-bottom: 0; color: #435d70; }
.form-field input, .form-field select, .form-field textarea { font-size: 1rem; line-height: 1.5; color: var(--ink); background: #fff; min-height: 46px; border-color: #cbd7df; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #627787; opacity: 1; }
.form-field :is(input, select, textarea):focus { border-color: #176d78; outline: 2px solid #176d78; box-shadow: 0 0 0 4px #176d7810; }
.form-field input[readonly] { background: #f4f7f9; color: #546b7b; }
.form-field select { padding-right: 28px; }
.form-section-head { align-items: flex-start; }
.form-section-head h2 { font-size: 1.125rem; }
.form-section-head p { font-size: .875rem; }
.section-no { font-size: .75rem; flex-shrink: 0; }
.check-label { min-height: 44px; align-items: flex-start; padding-block: 10px; margin-block: 4px; font-size: .875rem; color: var(--ink); }
.check-label input { width: 20px; height: 20px; margin: 1px 0 0; }
.form-bottom { flex-wrap: wrap; gap: 16px; padding-top: 20px; margin-top: 24px; }
.form-bottom .small { font-size: .8125rem; }
.form-bottom > .btn, .form-bottom > button[type=submit] { margin-left: auto; }
.form-bottom > .btn:first-child { margin-left: 0; }
.nm-overlay { padding: 24px; background: #102a3c66; backdrop-filter: blur(4px); }
.nm-dialog { max-height: calc(100dvh - 48px); border-radius: 18px; }
.nm-dialog > header { flex: 0 0 auto; gap: 16px; padding: 18px 24px; }
.nm-dialog > header h2 { font-size: 1.125rem; min-width: 0; }
.dialog-content { min-height: 0; padding: 24px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.dialog-content > :first-child { margin-top: 0; }
.dialog-content .form-bottom { position: sticky; bottom: -24px; z-index: 2; background: #fff; padding: 16px 0 20px; margin-bottom: -24px; }
body.modal-open { overflow: hidden; }
.nm-dialog .print-table { table-layout: fixed; }
.nm-dialog .print-table :is(th, td) { overflow-wrap: anywhere; padding: 12px 8px; }
.read-note p, .lg-note-section p { font-size: 1rem; line-height: 1.75; }
.read-note h3, .lg-note-section h3 { font-size: .875rem; color: #365a6b; }
.lg-modal-patient { flex-wrap: wrap; }

/* Less decorative framing leaves more room for clinical information. */
.lg-register-stats { padding-block: 18px; margin-bottom: 24px; }
.lg-register-stats b { font-size: 1.75rem; }
.lg-register-labels { font-size: .75rem; color: #536b7b; }
.lg-register-row, .lg-register-labels { gap: 18px; }
.lg-register-row > *, .lg-person > div { min-width: 0; }
.lg-register-row b { font-size: .9375rem; line-height: 1.5; }
.lg-register-row small { font-size: .8125rem; color: #5b7180; }
.lg-condition-cell { font-size: .875rem; }
.lg-open-record { color: #125d68; }
.lg-search { min-width: 0; }
.lg-search:focus-within { outline: 2px solid #176d78; outline-offset: 2px; }
.lg-search input { font-size: 1rem; min-width: 0; }
.lg-filter-row button { min-height: 44px; font-size: .875rem; line-height: 1.4; color: #4f6878; }
.lg-patient-heading { gap: 20px; }
.lg-name-row { min-width: 0; flex-wrap: wrap; }
.lg-patient-heading h1 { font-size: 1.75rem; line-height: 1.25; }
.lg-patient-heading p { font-size: .875rem; color: #536d7d; line-height: 1.6; }
.lg-patient-provider { min-width: 0; }
.lg-safety-strip { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.lg-safety-strip small { font-size: .75rem; color: #546f7c; }
.lg-safety-strip strong { font-size: .875rem; line-height: 1.6; }
.lg-record-tabs { gap: 0; }
.lg-record-picker, .patient-section-picker { display: none; }
.lg-record-tabs button, .patient-tabs > button { min-height: 46px; font-size: .875rem; padding: 12px; }
.lg-record-tabs button span { font-size: .75rem; }
.lg-card > header, .panel-heading { flex-wrap: wrap; }
.lg-card h2, .panel-heading h2, .side-pad h2 { font-size: 1.0625rem; }
.lg-card .btn.text { font-size: .875rem; padding: 8px; }
.lg-card-caption, .lg-card .lg-card-caption { font-size: .8125rem !important; color: #526c7d !important; }
.lg-activity-date, .lg-consult-row small { color: #5b7383; font-size: .8125rem; }
.lg-activity-date small, .lg-med-mini p, .lg-med-grid small, .lg-document-grid small { color: #59717f; font-size: .8125rem; }
.lg-activity p { color: #526c7d; font-size: .875rem; }
.lg-consult-row p { font-size: .9375rem; }
.lg-consult-row .btn, .lg-document-grid .btn, .lg-record-actions .btn { font-size: .875rem; }
.lg-vital-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lg-vital-grid small, .lg-vital-grid span { color: #556e7d; font-size: .8125rem; }
.lg-vital-grid b { font-size: 1.5rem; overflow-wrap: anywhere; }
.lg-data-fields dt, .lg-compact-dl dt, dt { color: #546e7d; font-size: .8125rem; line-height: 1.6; margin-top: 0; }
.lg-data-fields dd, .lg-compact-dl dd, dd { font-size: .9375rem; }
.lg-section-search input, .lg-section-search select { min-width: 0; width: 100%; flex: 1 1 220px; font-size: 1rem; }
.lg-section-search .lg-filter-row { flex: 1 1 100%; }
.lg-imaging-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.lg-history-section > summary { gap: 16px; }
.lg-history-section > summary > span { min-width: 0; }
.lg-line, .payment-entry { gap: 16px; flex-wrap: wrap; }
.lg-line > span { min-width: 0; flex: 1 1 200px; }
.lg-result-hero strong { font-size: clamp(1.5rem, 5vw, 2.625rem); overflow-wrap: anywhere; }
.lg-result-hero > small, .lg-result-hero p, .lg-source-notice { color: #526d7d; font-size: .875rem; }
.lg-table-wrap th { font-size: .8125rem; color: #526b7c; }
.lg-table-wrap td { font-size: .875rem; }
.lg-table-wrap td small { font-size: .8125rem; color: #5b7180; }
.lg-med-grid article > div { align-items: flex-start; flex-wrap: wrap; }
.lg-document-grid h3 { font-size: 1rem; }
.lg-document-grid p { font-size: .875rem; }
.lg-document-grid article { min-width: 0; }
.lg-document-grid article .btn { max-width: 100%; }

/* Consultation and staff tools */
.template-select { grid-template-columns: minmax(0, 1fr); }
.template-select select { font-size: 1rem; }
.mode-tabs button { min-height: 44px; white-space: normal; font-size: .875rem; line-height: 1.35; }
.mode-tabs button.active { color: #135d68; }
.mode-tabs button[aria-pressed=true] { font-weight: 600; }
.note-footer { gap: 16px; flex-wrap: wrap; }
.note-footer small { max-width: none; font-size: .8125rem; }
.note-section { margin-top: 22px; }
.note-section textarea { min-height: 104px; }
.scribe-workspace { background: #f0f6f7; border-color: #d5e5e8; }
.scribe-heading { align-items: flex-start; }
.scribe-heading > svg { color: #176d78; }
.scribe-heading h3 { font-size: 1rem; }
.scribe-heading p, #record-status { font-size: .875rem; color: #526b7d; }
.scribe-workspace .button-wrap .btn { font-size: .875rem; min-height: 44px; }
.scribe-workspace > .small { font-size: .8125rem; }
.test-option > label { min-height: 44px; padding: 4px; min-width: 0; }
.test-option input { flex: 0 0 20px; width: 20px; height: 20px; }
.test-option small { font-size: .8125rem; color: #5b7381; }
.pin-btn { min-width: 44px; min-height: 44px; }
.search-box { min-width: 0; max-width: 100%; }
.search-box input { min-height: 28px; font-size: 1rem; }
.search-box:focus-within { outline: 2px solid #176d78; outline-offset: 2px; }
.template-card, .doctor-card { display: flex; flex-direction: column; }
.template-card > .button-wrap, .doctor-card > .btn { margin-top: auto; padding-top: 16px; }
.doctor-card > .btn { margin-top: 22px; padding-top: 10px; align-self: flex-start; }
.doctor-card h2 { font-size: 1.25rem; line-height: 1.4; }
.doctor-meta { margin-bottom: 8px; }
.doctor-meta p, .template-card > p { font-size: .875rem; }
.catalogue-row { font-size: .9375rem; }
.catalogue-row > div { min-width: 0; }
.catalogue-row .btn { flex-shrink: 0; }
.catalogue-row small { font-size: .8125rem; }
.visit-progress { gap: 12px; }
.visit-progress li { min-width: 0; }
.visit-progress b { font-size: .875rem; }
.visit-progress .current { color: #125f69; }
.visit-progress .current > span { background: #176d78; }
.visit-ticket { min-height: 44px; }
.visit-ticket b { font-size: .9375rem; }
.visit-ticket span, .visit-ticket small { font-size: .8125rem; }
.visit-toolbar > .form-field { min-width: 0; flex: 1 1 200px; }
.side-pad > p { font-size: .875rem; }
.side-pad > .btn { margin-top: 12px; }
.checkout-card { background: #f0f7f7; border-color: #c6dddf; }
.fc { --fc-button-bg-color: #176d78; --fc-button-border-color: #176d78; --fc-button-hover-bg-color: #115b65; --fc-button-active-bg-color: #104f58; }
.fc .fc-toolbar { gap: 16px; flex-wrap: wrap; }
.fc .fc-toolbar-title { font-size: 1.125rem; line-height: 1.5; }
.fc .fc-button { min-height: 44px; min-width: 44px; font-size: .875rem; padding: 8px 12px; }
.fc .fc-col-header-cell-cushion { color: #415e70; font-size: .8125rem; }
.fc .fc-timegrid-slot-label-cushion { font-size: .75rem; color: #536e7f; }
.calendar-panel .form-field { min-width: 0; width: min(100%, 320px); }
.calendar-panel .calendar-hint { font-size: .8125rem; color: #536c7d; }
#toast { display: none; }
#toast.show { display: block; font-size: .875rem; line-height: 1.6; width: max-content; max-width: calc(100vw - 32px); overflow-wrap: anywhere; }

@media (max-width: 1150px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .right-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-grid, .doctor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 940px) {
  .sidebar { width: 72px; padding: 20px 8px; }
  .sidebar .brand { width: 100%; padding: 0 0 24px; justify-content: center; gap: 0; }
  .sidebar .brand > div:last-child { display: none; }
  .sidebar .brand-symbol { margin: 0; }
  .sidebar .nav { width: 100%; }
  .sidebar .nav button { width: 100%; min-height: 48px; padding: 12px; justify-content: center; }
  .sidebar-bottom { display: block; margin-top: auto; padding-top: 20px; }
  .sidebar .profile { display: none; }
  .main { width: calc(100% - 72px); margin-left: 72px; }
  .lg-patient-heading .lg-person { align-items: flex-start; }
}
@media (max-width: 700px) {
  .content { padding: 24px 16px; }
  .page-head h1, .lg-page-head h1 { font-size: 1.625rem; }
  .lg-page-head { gap: 18px; margin-bottom: 22px; }
  .lg-page-head > .actions { width: 100%; }
  .topbar { min-height: 64px; padding: 14px 16px; }
  .top-actions { gap: 8px; }
  .crumb { font-size: .8125rem; gap: 8px; flex-wrap: wrap; }
  .lg-register-stats { padding: 18px 4px; gap: 18px; }
  .lg-register-stats span { font-size: .8125rem; }
  .lg-register-stats b { font-size: 1.5rem; }
  .lg-register-row { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 14px; }
  .lg-register-row > div, .lg-register-row > div:nth-child(2), .lg-register-row > div:nth-child(4), .lg-register-row > div:last-child { grid-column: 1; grid-row: auto; }
  .lg-register-row > div:last-child { justify-self: start; }
  .lg-register-row .lg-person { align-items: flex-start; }
  .lg-directory-tools { padding: 18px; }
  .lg-filter-row { padding-inline: 18px; gap: 8px; }
  .lg-search { padding-inline: 12px; gap: 8px; }
  .lg-search input { font-size: 1rem; }
  .lg-filter-row button { font-size: .8125rem; }
  .lg-patient-heading { padding: 20px 18px; }
  .lg-patient-heading h1 { font-size: 1.375rem; }
  .lg-patient-heading .lg-avatar { width: 40px; height: 40px; min-width: 40px; font-size: 1rem; }
  .lg-safety-strip { grid-template-columns: minmax(0, 1fr); }
  .lg-record-actions > div { flex-wrap: wrap; gap: 10px; }
  .lg-record-tabs { display: none; }
  .lg-record-picker { display: flex; margin: 20px 0; }
  .lg-record-tabs button { flex: 1 1 40%; justify-content: center; padding: 10px 8px; }
  .patient-tabs { display: none; }
  .patient-section-picker { display: flex; margin: 20px 0; }
  .chart-context-strip { grid-template-columns: minmax(0, 1fr); }
  .patient-tabs > button { flex: 1 1 40%; white-space: normal; padding: 10px 8px; }
  .lg-card > header { align-items: flex-start; gap: 10px; }
  .lg-card > header .btn { margin-left: 0; }
  .lg-activity { grid-template-columns: minmax(0, 1fr); }
  .lg-activity-date { grid-column: 1; }
  .lg-activity .btn { justify-self: start; }
  .lg-vital-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-consult-row .btn { margin-left: 0; }
  .lg-compact-dl { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .lg-compact-dl dd { margin-bottom: 14px; }
  .lg-aside-column, .right-stack, .template-grid, .doctor-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-panel, .side-pad, .template-card, .doctor-card { padding: 20px; }
  .mode-tabs { margin-inline: 16px; flex-wrap: wrap; }
  .mode-tabs button { flex: 1 1 75px; font-size: .8125rem; }
  .mode-tabs svg { display: none; }
  .note-content { padding-inline: 16px; }
  .note-footer { padding: 16px; }
  .note-footer small { flex: 1 1 100%; }
  .template-select { padding-inline: 16px; }
  .scribe-workspace { padding: 16px; }
  .scribe-workspace .button-wrap { gap: 8px; }
  .nm-overlay { padding: 12px; }
  .nm-dialog { max-height: calc(100dvh - 24px); border-radius: 16px; }
  .nm-dialog > header { padding: 16px 20px; }
  .dialog-content { padding: 20px; scrollbar-gutter: auto; }
  .dialog-content .form-bottom { bottom: -20px; margin-bottom: -20px; padding-bottom: 16px; }
  .calendar-panel { padding-inline: 12px; }
  .calendar-panel .table-toolbar { padding-block: 18px; }
  .fc .fc-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .fc .fc-toolbar-chunk:nth-child(2) { grid-row: 1; }
  .fc .fc-toolbar-chunk { min-width: 0; }
  .fc .fc-button { padding: 8px 10px; }
  .fc .fc-col-header-cell-cushion { font-size: .75rem; padding-inline: 1px; }
  .fc .fc-timegrid-axis-cushion { padding-inline: 2px; }
}
@media (max-width: 360px) {
  .content { padding-inline: 12px; }
  .page-head .actions, .lg-page-head .actions { align-items: stretch; flex-direction: column; }
  .lg-filter-row button { flex: 1 1 100%; }
  .form-bottom > .btn, .form-bottom > button { width: 100%; margin-left: 0; }
}
@media (prefers-reduced-transparency: reduce) { .nm-overlay { backdrop-filter: none; background: #142f3ce6; } }
@media (prefers-contrast: more) { :root { --muted: #354e60; --line: #9dafbc; --gp-line: #9dafbc; } .form-field :is(input, textarea, select) { border-color: #526f80; } }
@media print { .sidebar, .page-footer, #toast { display: none !important; } .nm-dialog { max-height: none; } }

/* Readable context, native file controls, and consistent calendar states. */
.chart-context-strip small, .patient-sub { font-size: .8125rem; color: #536c7d; }
.chart-context-strip b { font-size: .875rem; line-height: 1.6; }
.context-patient, .invoice-preview { background: #eef5f6; }
.mode-tabs { background: #f0f4f6; }
.pin-btn { color: #687e8c; }
.form-field input[type=file] { padding: 6px; font-size: .875rem; }
input[type=file]::file-selector-button { font: inherit; min-height: 40px; padding: 8px 12px; margin-right: 12px; border: 1px solid #cbd7df; border-radius: 7px; background: #f4f8fa; color: #304f60; cursor: pointer; }
.dialog-content p + .form-field { margin-top: 18px; }
.fc { --fc-today-bg-color: #f0f8f8; --fc-button-hover-border-color: #115b65; --fc-button-active-border-color: #104f58; }
.fc .fc-event-main { font-size: .75rem; }
.fc .fc-button-active { background: #104f58 !important; border-color: #104f58 !important; }
.avatar.peach { color: #825940; }
.avatar.purple { color: #665186; }
.page-footer { color: #566d7d; }
.lg-tag { color: #4c6374; }
.lg-patient-provider small, .lg-problem-list small, .lg-details summary small { color: #536c7d; }
.lg-record-tabs button { color: #526b7b; }
.lg-record-tabs span { color: #486372; }
.lg-attention > header { color: #79521c; }
.lg-attention small { color: #786343; }
.lg-med-mini b span, .lg-med-grid h3 span { color: #566f7e; }
.lg-abnormal { color: #95601e; }
.lg-history-section > summary > span:last-child:not(:first-child) { color: #506878; }
/* Source transcription stays readable beside the original at every width. */
.import-option{padding:16px;border:1px solid #cbdedf;border-radius:14px;background:#f1f8f8;margin:18px 0}.import-option p{font-size:13px;line-height:1.5;margin:8px 0 0 28px;color:#526373}.import-patient{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px;background:#eef6f7;border-radius:12px;margin-bottom:18px}.import-patient>div{display:grid;gap:5px;min-width:0}.import-patient small{font-size:10px;letter-spacing:.1em;color:#4c6570}.import-patient strong{font-size:20px;overflow-wrap:anywhere}.import-patient span{font-size:13px}.import-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:22px}.import-columns section{min-width:0}.import-columns h3{margin:0 0 12px}.import-source iframe{width:100%;height:560px;border:1px solid #d7e0e6;border-radius:10px;background:#f8fafb}.import-source img{width:100%;max-height:650px;object-fit:contain;background:#f8fafb;border:1px solid #d7e0e6;border-radius:10px}.import-notes textarea.import-editor{min-height:430px;line-height:1.6;font-size:14px;resize:vertical}.import-warning{background:#fff8e9;color:#725315;border:1px solid #e8d4aa;border-radius:12px;padding:14px 16px;margin-bottom:16px;font-size:13px;line-height:1.5}.import-warning ul{margin:8px 0;padding-left:20px}.import-warning li+li{margin-top:6px}.import-warning p{margin-bottom:0}.import-confirm{display:grid;gap:14px;padding:18px 0;border-top:1px solid #e2e8ed;margin-top:20px}.import-confirm .check-label{align-items:flex-start;line-height:1.55}.import-confirm input{flex-shrink:0;margin-top:3px}.digitised-note pre{font-family:inherit;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;font-size:14px;padding:18px;background:#f8fafb;border-radius:12px}.role-switch{display:flex;align-items:center;gap:8px;font-size:12px;color:#526373}.role-switch select{min-height:40px;min-width:100px;border:1px solid #cfdde2;border-radius:10px;background:white;color:#173b46;padding:8px 28px 8px 10px;font:inherit;font-weight:650}.role-preview-caption{font-size:11px;color:#596b78;line-height:1.5;margin-top:8px}
@media(max-width:760px){.import-columns{grid-template-columns:minmax(0,1fr)}.import-source iframe{height:350px}.import-source img{max-height:380px}.import-notes textarea.import-editor{min-height:300px}.import-patient{align-items:flex-start;flex-wrap:wrap}.import-patient strong{font-size:18px}.role-switch>span{display:none}.role-switch select{min-width:92px;min-height:40px}}
.role-switch{position:relative;flex-shrink:0}.role-trigger.btn{min-height:40px;gap:9px;padding:8px 14px;border-radius:10px;background:#fff;border:1px solid var(--line,#dce5e8);box-shadow:none;font-size:13px;line-height:1.4;color:#173b46}.role-trigger>span{color:#627480;font-weight:450}.role-trigger>b{font:inherit;font-weight:600}.role-trigger[aria-expanded="true"]{background:#f1f7f7;border-color:#9cbdc1}.role-menu{position:absolute;right:0;top:calc(100% + 8px);width:164px;padding:6px;border-radius:14px;background:#fff;border:1px solid #dfe7eb;box-shadow:0 8px 30px rgba(21,48,62,.12);z-index:90}.role-menu[hidden]{display:none}.role-menu button{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:42px;border:0;border-radius:9px;background:transparent;padding:10px 12px;font:inherit;font-size:13px;font-weight:500;text-align:left;color:#213f4b;cursor:pointer}.role-menu button:hover,.role-menu button:focus-visible{background:#f0f5f6;outline:2px solid #277887;outline-offset:-2px}.role-menu button[aria-checked="true"]{color:#176d78;background:#eaf4f4}.role-menu button+button{margin-top:2px}@media(max-width:760px){.role-trigger.btn{padding:8px 11px}.role-trigger>span{display:none}.role-menu{width:154px}.role-menu button{min-height:44px}}
.pdf-preview{border:1px solid #dce5e8;border-radius:12px;overflow:hidden;background:#f5f7f9}.pdf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px;border-bottom:1px solid #dce5e8;background:white}.pdf-toolbar .btn{min-height:38px;padding:7px 9px;font-size:12px}.pdf-page{font-size:12px;white-space:nowrap;color:#516674}.pdf-canvas-wrap{max-height:550px;overflow:auto}.pdf-canvas-wrap canvas{display:block}.import-notes .form-grid{grid-template-columns:minmax(0,1fr)}.import-notes .form-field{margin-bottom:14px}.import-source .pdf-preview{min-height:240px}@media(max-width:760px){.pdf-canvas-wrap{max-height:350px}}
.nm-dialog:has(#digitise-review-form){width:min(1120px,calc(100vw - 48px));max-width:none}.digitised-note>.import-patient{margin-bottom:12px}@media(max-width:760px){.nm-dialog:has(#digitise-review-form){width:calc(100vw - 24px)}}

/* Account actions share the primary navigation typography and mobile icon layout. */
.sidebar-actions { margin-top: 4px; }
.sidebar-bottom .profile { margin-bottom: 8px; }
