:root {
  --ink: #211b18;
  --ink-soft: #665a54;
  --muted: #8b7d75;
  --line: #e8ddd6;
  --line-soft: #f3ece8;
  --canvas: #f8f5f2;
  --surface: #ffffff;
  --brand: #db4f03;
  --brand-dark: #a83a00;
  --brand-deep: #2a1a12;
  --brand-soft: #fff0e7;
  --teal-950: #2a1a12;
  --teal-800: #b64000;
  --teal-700: #db4f03;
  --teal-100: #fff0e7;
  --blue: #336fad;
  --blue-soft: #e7f0fa;
  --green: #19875a;
  --green-soft: #e4f5ec;
  --amber: #b87618;
  --amber-soft: #fff1da;
  --red: #b44345;
  --red-soft: #fbe9e9;
  --shadow: 0 1px 2px rgba(49, 30, 20, .04), 0 12px 30px rgba(49, 30, 20, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Avenir Next", "Century Gothic", Inter, "Segoe UI", ui-sans-serif, sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(219, 79, 3, .24); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; display: flex; flex-direction: column; padding: 24px 18px 18px; color: var(--ink-soft); border-right: 1px solid var(--line); background: linear-gradient(180deg, #fff 0%, #fffaf7 100%); box-shadow: 8px 0 30px rgba(48, 29, 19, .035); z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.sidebar .brand { color: var(--ink); padding: 0 8px 25px; }
.brand-logo { display: block; width: 174px; max-width: 100%; height: auto; object-fit: contain; }
.sidebar-brand { align-items: flex-start; flex-direction: column; gap: 7px; }
.brand-product { padding-left: 2px; }
.brand-product strong, .brand-product small { display: block; }
.brand-product strong { color: var(--ink); font-size: 13px; letter-spacing: .01em; }
.brand-product small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { font-size: 17px; letter-spacing: -.2px; }
.brand small { margin-top: 3px; font-size: 11px; color: #a9c5c8; letter-spacing: .08em; text-transform: uppercase; }
.nav-list { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #6f625b; text-decoration: none; font-weight: 700; }
.nav-link:hover { color: var(--brand-dark); background: var(--brand-soft); }
.nav-link.active { color: var(--brand-dark); background: var(--brand-soft); box-shadow: inset 3px 0 var(--brand); }
.nav-icon { width: 20px; color: var(--brand); font-size: 17px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip > span:nth-child(2) { min-width: 0; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { color: var(--ink); font-size: 13px; }
.user-chip small { color: var(--muted); font-size: 11px; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: white; background: linear-gradient(145deg, #ee6a22, var(--brand)); font-weight: 800; }
.sidebar .text-button { margin: 12px 0 0 44px; color: var(--brand-dark); }
.text-button { padding: 0; border: 0; color: var(--teal-700); background: transparent; cursor: pointer; font-weight: 700; }
.text-button:hover { text-decoration: underline; }

.main-content { min-height: 100vh; margin-left: 244px; padding: 38px clamp(28px, 4vw, 58px) 60px; }
.mobile-bar { display: none; }
.main-content:has(> .compact-dashboard) { padding-top: 20px; }
.compact-dashboard .page-header { margin-bottom: 14px; gap: 16px; }
.compact-dashboard .page-header h1 { font-size: clamp(24px, 2.3vw, 30px); }
.compact-dashboard .page-header p { font-size: 12px; }
.compact-dashboard > .readiness-banner { margin: 0 0 12px; }
.compact-dashboard > .surface > .surface-head { padding: 12px 16px; }
.dashboard-status-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.dashboard-status-row > .readiness-banner,
.dashboard-status-row > .ai-status-strip,
.dashboard-status-row > .run-strip { min-width: 0; min-height: 58px; margin: 0; padding: 8px 10px; gap: 8px; font-size: 11px; line-height: 1.35; }
.dashboard-status-row .readiness-banner { flex-wrap: wrap; }
.dashboard-status-row .readiness-banner > span:nth-child(2) { flex-basis: 70%; }
.dashboard-status-row .readiness-banner > small { margin-left: 34px; }
.dashboard-status-row .readiness-icon,
.dashboard-status-row .ai-status-mark { flex: 0 0 26px; width: 26px; height: 26px; }
.dashboard-status-row .run-strip { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; }
.dashboard-status-row .run-strip .muted { grid-column: 2; margin-left: 0; font-size: 10px; }
.dashboard-status-row .run-strip .strip-arrow { grid-column: 3; grid-row: 1 / 3; }
.dashboard-status-row > :only-child { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .dashboard-status-row { grid-template-columns: 1fr; gap: 6px; }
}
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-header h1, .patient-hero h1, .document-header h1 { margin: 3px 0 4px; color: var(--ink); font-size: clamp(26px, 3vw, 36px); line-height: 1.16; letter-spacing: -.04em; }
.page-header p, .patient-hero p, .document-header p { margin: 0; color: var(--ink-soft); }
.eyebrow { color: var(--teal-700); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow.light { color: var(--brand); }
.date-control { display: grid; gap: 5px; }
.date-control label, label { color: #594b44; font-size: 12px; font-weight: 700; }
.date-stepper { display: grid; grid-template-columns: 38px 172px 38px; gap: 6px; align-items: center; }
.date-arrow { display: grid; place-items: center; width: 38px; height: 42px; padding: 0; border: 1px solid #d9c9c0; border-radius: 9px; color: var(--brand-dark); background: white; cursor: pointer; font-size: 16px; line-height: 1; transition: border .15s, background .15s, transform .15s; }
.date-arrow:hover { border-color: #c6a894; background: var(--brand-soft); }
.date-arrow:active { transform: translateY(1px); }
input, select, textarea { width: 100%; border: 1px solid #d9c9c0; border-radius: 9px; color: var(--ink); background: white; transition: border .15s, box-shadow .15s; }
input, select { height: 42px; padding: 0 12px; }
textarea { padding: 14px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #c6a894; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(219,79,3,.11); outline: 0; }
.date-control input { width: 172px; }
.date-input-wrap { position: relative; display: block; min-width: 0; }
.date-input-wrap > input[data-date-input] { padding-right: 36px; }
.date-picker-button { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 34px; padding: 0; border: 0; border-radius: 0 8px 8px 0; color: var(--brand-dark); background: transparent; cursor: pointer; }
.date-picker-button:hover { background: var(--brand-soft); }
.date-input-wrap > .date-picker-control { position: absolute; bottom: 0; right: 0; width: 1px; height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.security-banner, .desktop-note { padding: 12px 15px; border: 1px solid #ead4a5; border-radius: 10px; color: #755317; background: #fff8e9; font-size: 12px; }
.security-banner { margin: -8px 0 20px; }
.readiness-banner { display: flex; align-items: center; gap: 11px; min-height: 52px; margin: -8px 0 20px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.readiness-banner > span:nth-child(2) { flex: 1; }
.readiness-banner strong { display: block; }
.readiness-banner small { color: var(--muted); white-space: nowrap; }
.readiness-banner a { color: inherit; font-weight: 800; }
.readiness-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; font-weight: 900; }
.readiness-banner.ready { color: #256448; border-color: #b9dfca; background: #f0faf5; }
.readiness-banner.ready .readiness-icon { color: white; background: var(--green); }
.readiness-banner.working { color: #285f8d; border-color: #c2d9ee; background: #f1f7fc; }
.readiness-banner.working .readiness-icon { color: white; background: var(--blue); animation: pulse 1.8s infinite; }
.readiness-banner.waiting { color: #76561d; border-color: #ead4a5; background: #fff8e9; }
.readiness-banner.waiting .readiness-icon { color: white; background: var(--amber); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.metric-card { position: relative; display: flex; align-items: center; gap: 14px; min-height: 112px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.metric-card.accent { color: white; border: 0; background: linear-gradient(135deg, #31231c, #171210); }
.metric-card.accent::after { content: ""; position: absolute; width: 110px; height: 110px; right: -35px; top: -42px; border: 18px solid rgba(255,255,255,.055); border-radius: 50%; }
.metric-icon { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--teal-800); background: var(--teal-100); font-size: 21px; font-weight: 700; }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.metric-card strong { margin: 0; font-size: 27px; line-height: 1.15; letter-spacing: -.03em; }
.metric-card small { color: var(--muted); font-size: 10px; }
.metric-card.accent span, .metric-card.accent small { color: #eadbd2; }
.compact-summary { gap: 10px; margin-bottom: 12px; }
.compact-summary .metric-card { min-height: 82px; gap: 10px; padding: 12px; }
.compact-summary .metric-icon { width: 32px; height: 32px; font-size: 17px; }
.compact-summary .metric-card strong { font-size: 24px; }

.run-strip { display: flex; align-items: center; gap: 10px; min-height: 47px; margin-bottom: 20px; padding: 0 15px; border: 1px solid #efd4c4; border-radius: 11px; color: #6b3a21; background: #fff7f2; text-decoration: none; }
.run-strip:hover { border-color: #e5ae8d; }
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.run-dot.running { background: #28a66c; box-shadow: 0 0 0 4px rgba(40,166,108,.13); animation: pulse 1.8s infinite; }
.run-dot.failed { background: var(--red); }
.run-strip .muted { margin-left: auto; }
.strip-arrow { font-size: 19px; }
.muted { color: var(--muted); }

.surface { margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.surface-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px 17px; border-bottom: 1px solid var(--line-soft); }
.surface-head.standalone { border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: white; }
.surface-head h2, .document-meta h2 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.surface-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.filter-box { display: flex; align-items: center; width: min(270px, 40vw); height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fffaf7; }
.filter-box span { color: var(--muted); font-size: 18px; }
.filter-box input { height: 34px; border: 0; box-shadow: none; background: transparent; }
.schedule-filter-controls { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 10px; min-width: 0; }
.review-filter { display: grid; gap: 3px; }
.review-filter > span { margin: 0; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.review-filter select { width: 200px; height: 38px; border-color: #d9c9c0; font-size: 11px; font-weight: 600; }
.visit-type-filter select { width: 155px; }
.review-filter select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(219,79,3,.11); }
.schedule-search { width: min(290px, 40vw); height: 38px; }
.schedule-search .input-group-text { padding-inline: 11px; border-color: #d9c9c0; color: var(--brand-dark); background: var(--brand-soft); }
.schedule-search .form-control { height: 38px; border-color: #d9c9c0; border-left: 0; box-shadow: none; font-size: 11px; }
.schedule-search:focus-within .input-group-text, .schedule-search:focus-within .form-control { border-color: var(--brand); }
.table-wrap { max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 43px; padding: 0 14px; border-bottom: 1px solid var(--line); color: #817168; background: #fdf9f7; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 59px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fffaf7; }
.time-cell { color: var(--brand-dark); font-weight: 800; white-space: nowrap; }
.patient-link { display: block; color: #6a2a08; font-weight: 800; text-decoration: none; white-space: nowrap; }
.patient-link:hover { color: var(--teal-700); text-decoration: underline; }
.data-table td small { display: block; color: var(--muted); font-size: 10px; }
.details-cell { max-width: 210px; color: #5e5049; }
.notes-cell { min-width: 180px; max-width: 300px; color: #7a6c64; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.clinical-status { display: inline-flex; padding: 4px 8px; border-radius: 99px; color: #675b55; background: #f1ece9; font-size: 10px; font-weight: 700; white-space: nowrap; }
.clinical-status.checked-in { color: #27649c; background: #e8f1fb; }
.clinical-status.seen-by-physician { color: #287455; background: #e8f5ee; }
.record-state { display: inline-flex; align-items: center; gap: 6px; color: #665a54; font-size: 10px; font-weight: 800; text-transform: capitalize; white-space: nowrap; }
.record-state i { width: 7px; height: 7px; border-radius: 50%; background: #9badb1; }
.record-state.completed i, .record-state.approved i, .record-state.uploaded i { background: #2c9e68; }
.record-state.in_progress i, .record-state.running i, .record-state.ready_for_review i, .record-state.note_review i, .record-state.transcript_review i { background: #3c82be; box-shadow: 0 0 0 3px rgba(60,130,190,.12); }
.record-state.pending i, .record-state.draft i, .record-state.queued_for_cerner i, .record-state.pending_download i, .record-state.pending_upload i, .record-state.signed i { background: #d3912a; }
.record-state.failed i, .record-state.not_found i, .record-state.export_failed i { background: #c45556; }
.record-state.needs_configuration i { background: #9b6eb2; }
.review-stage-cell { width: 76px; text-align: center; }
.review-stage-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 8px; font-size: 16px; font-weight: 900; }
.review-stage-icon .bi { line-height: 1; }
.review-stage-icon.review { color: #27649c; border-color: #bdd5eb; background: #e8f1fb; }
.review-stage-icon.completed { color: #287455; border-color: #b9dfca; background: #e8f5ee; }
.review-stage-icon.not-started { color: #8b7d75; border-color: #ddd2cc; background: #f3efec; }
.row-actions { display: flex; gap: 5px; white-space: nowrap; }
.appointment-action { display: inline-flex; align-items: center; gap: 5px; min-height: 31px; border-radius: 7px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.appointment-action.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); }
.appointment-action.btn-outline-primary { --bs-btn-color: var(--brand-dark); --bs-btn-border-color: #d9b39e; --bs-btn-hover-bg: var(--brand-soft); --bs-btn-hover-border-color: #c99070; --bs-btn-hover-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-soft); --bs-btn-active-border-color: #c99070; --bs-btn-active-color: var(--brand-dark); }
.patient-schedule-table-wrap { overflow: visible; }
.patient-schedule-table { --schedule-actions-width: 128px; --schedule-arrival-width: 36px; width: 100%; min-width: 0; table-layout: fixed; }
.patient-schedule-table .col-time { width: 7%; }
.patient-schedule-table .col-patient { width: 15%; }
.patient-schedule-table .col-duration { width: 7%; }
.patient-schedule-table .col-details { width: auto; }
.patient-schedule-table .col-status { width: 9%; }
.patient-schedule-table .col-notes { width: auto; }
.patient-schedule-table .col-transcript, .patient-schedule-table .col-visit-note { width: 4%; }
.patient-schedule-table .col-record { width: 9%; }
/* Reserve three 32px buttons, two 5px gaps, and cell padding. */
.patient-schedule-table .col-actions { width: var(--schedule-actions-width); }
.patient-schedule-table th, .patient-schedule-table td { padding-inline: 7px; overflow: hidden; }
.patient-schedule-table td { height: 54px; }
.patient-schedule-table .patient-link, .patient-schedule-table .clinical-status, .patient-schedule-table .record-state { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.patient-schedule-table .details-cell { display: -webkit-box; max-width: none; overflow: hidden; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.patient-schedule-table .notes-cell { display: -webkit-box; min-width: 0; max-width: none; overflow: hidden; line-height: 1.35; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.patient-schedule-table .review-stage-heading { padding-inline: 3px; text-align: center; }
.patient-schedule-table .review-stage-cell { width: auto; padding-inline: 3px; }
.patient-schedule-table .row-actions { align-items: center; justify-content: center; min-width: 0; }
.patient-schedule-table .appointment-delete-form { display: inline-flex; margin: 0; }
.patient-schedule-table .appointment-action { flex: 0 0 32px; justify-content: center; width: 32px; min-width: 32px; padding: 0; font-size: 14px; }
.patient-schedule-table tr[hidden] { display: none; }
.icon-button { display: inline-flex; align-items: center; height: 30px; padding: 0 9px; border-radius: 7px; color: white; background: var(--teal-700); font-size: 10px; font-weight: 800; text-decoration: none; }
.icon-button.secondary { color: var(--teal-800); background: var(--teal-100); }
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state.compact { padding: 42px 20px; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: white; }
.empty-state h3 { margin: 8px 0 3px; font-size: 17px; }
.empty-state p { max-width: 480px; margin: 0 auto 17px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: auto; border-radius: 15px; color: var(--teal-700); background: var(--teal-100); font-size: 23px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 800; text-decoration: none; transition: transform .12s, background .12s, border .12s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .46; }
.button.primary { color: white; background: linear-gradient(135deg, #ed631a, var(--brand)); box-shadow: 0 6px 14px rgba(219,79,3,.2); }
.button.ghost { border-color: #dbc8bd; color: #5e4031; background: white; }
.button.success { color: white; background: var(--green); }
.button.danger-soft { border-color: #f0cbcb; color: var(--red); background: var(--red-soft); }
.button.record { color: white; background: #c74a4c; }
.button.wide { width: 100%; }
.button.small { min-height: 34px; padding: 0 11px; }
.flash { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.flash.error { color: #8f3538; border-color: #efc5c6; background: #fff3f3; }
.flash.success { color: #1c704c; border-color: #bde3cf; background: #f0faf5; }

.ai-status-strip { display: flex; align-items: center; gap: 12px; min-height: 56px; margin-bottom: 20px; padding: 9px 15px; border: 1px solid #c8d9ed; border-radius: 11px; color: #285f8d; background: #f1f7fc; text-decoration: none; }
.ai-status-strip > span:nth-child(2) { flex: 1; }
.ai-status-strip strong, .ai-status-strip small { display: block; }
.ai-status-strip small { color: inherit; opacity: .75; font-size: 10px; }
.ai-status-strip.active { color: #256448; border-color: #b9dfca; background: #f0faf5; }
.ai-status-strip.attention { color: #76561d; border-color: #ead4a5; background: #fff8e9; }
.ai-status-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: linear-gradient(135deg, #427fb6, #285f8d); font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.ai-status-strip.active .ai-status-mark { background: linear-gradient(135deg, #2ca06d, #17744d); }
.ai-status-strip.attention .ai-status-mark { background: linear-gradient(135deg, #cc8b2a, #9f6614); }
.report-filter-form { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)) auto; gap: 12px; align-items: end; padding: 18px 20px; }
.report-filter-form label { display: grid; gap: 5px; }
.report-filter-actions { display: flex; gap: 7px; }
.report-table .error-text { max-width: 220px; overflow: hidden; color: var(--red); text-overflow: ellipsis; white-space: nowrap; }
.queue-list > a { display: grid; grid-template-columns: minmax(180px, 1fr) auto 18px; gap: 15px; align-items: center; min-height: 58px; padding: 9px 20px; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.queue-list > a:last-child { border-bottom: 0; }
.queue-list > a:hover { background: #fffaf7; }
.queue-list strong, .queue-list small { display: block; }
.queue-list small { color: var(--muted); font-size: 10px; }
.mobile-actions { display: flex; gap: 7px; }

.login-page { min-height: 100vh; background: #fbf8f6; }
.login-layout { display: grid; grid-template-columns: minmax(420px, .95fr) minmax(500px, 1.05fr); min-height: 100vh; }
.login-intro { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(36px, 6vw, 76px); color: var(--ink); background: radial-gradient(circle at 78% 18%, rgba(219,79,3,.16), transparent 28%), linear-gradient(145deg, #fff8f3, #f7e8df); }
.login-intro::before { content: ""; position: absolute; width: 420px; height: 420px; right: -240px; bottom: -160px; border: 55px solid rgba(219,79,3,.07); border-radius: 50%; }
.login-brand { position: relative; z-index: 1; display: grid; gap: 8px; width: min(310px, 75%); }
.login-brand .brand-logo { width: 100%; }
.login-brand span { color: #674331; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.login-intro h1 { margin: 12px 0 18px; font-size: clamp(42px, 5.6vw, 76px); line-height: .98; letter-spacing: -.065em; }
.login-intro p { max-width: 510px; margin: 0; color: #725e53; font-size: 17px; }
.privacy-note { display: flex; align-items: center; gap: 9px; color: #806b60; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 32px; background: #fbf8f6; }
.login-card { display: grid; gap: 19px; width: min(435px, 100%); padding: clamp(28px, 4vw, 42px); border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 22px 60px rgba(54,32,20,.09); }
.login-card-logo { display: none; width: 176px; height: auto; }
.login-card h2 { margin: 5px 0 2px; font-size: 29px; letter-spacing: -.04em; }
.login-card p { margin: 0; color: var(--muted); }
.login-card label, .form-grid label, .recorder-panel > label { display: grid; gap: 6px; }
.form-help { color: var(--muted) !important; font-size: 11px; text-align: center; }

.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--muted); font-size: 11px; }
.breadcrumb a { color: var(--teal-700); text-decoration: none; }
.patient-hero { display: flex; align-items: center; gap: 17px; margin-bottom: 23px; padding: 23px 25px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(110deg, #fff, #fff5ef); box-shadow: var(--shadow); }
.patient-hero .button { margin-left: auto; }
.patient-avatar { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 17px; color: white; background: linear-gradient(145deg, #ee6a22, var(--brand)); font-size: 23px; font-weight: 800; }
.patient-hero h1 { font-size: 27px; }
.record-tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.record-tabs button { padding: 11px 15px; border: 0; border-bottom: 2px solid transparent; color: #807169; background: transparent; cursor: pointer; font-weight: 700; white-space: nowrap; }
.record-tabs button.active { border-bottom-color: var(--teal-700); color: var(--teal-800); }
.record-tabs span { margin-left: 5px; padding: 2px 6px; border-radius: 99px; background: var(--brand-soft); font-size: 9px; }
.tab-panel { display: none; margin-bottom: 20px; }
.tab-panel.active { display: block; }
.record-list { overflow: hidden; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: white; box-shadow: var(--shadow); }
.record-row { display: flex; align-items: center; gap: 13px; min-height: 66px; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.record-row:last-child { border-bottom: 0; }
.record-row:hover { background: #fffaf7; }
.record-type-icon, .future-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; color: var(--teal-800); background: var(--teal-100); font-weight: 900; }
.record-type-icon.scribe { color: #765091; background: #f0e8f5; }
.record-main { flex: 1; }
.record-main strong, .record-main small { display: block; }
.record-main small { color: var(--muted); font-size: 10px; }
.record-source { padding: 3px 8px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 800; }
.future-panel { display: grid; place-items: center; min-height: 260px; padding: 35px; border: 1px dashed #d8bbaa; border-radius: var(--radius); text-align: center; background: rgba(255,255,255,.7); }
.future-panel h2 { margin: 12px 0 4px; font-size: 18px; }
.future-panel p { max-width: 550px; margin: 0; color: var(--muted); }
.appointments-history { margin-top: 27px; }

.document-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.document-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.document-meta, .clinical-document { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.document-meta { padding: 20px; }
.document-meta h2 { margin-bottom: 15px; }
.document-meta dl { margin: 0; }
.document-meta dt { margin-top: 12px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.document-meta dd { margin: 2px 0 0; color: #594a43; font-size: 12px; }
.clinical-document { overflow: hidden; }
.document-waterline { display: flex; justify-content: space-between; padding: 12px 22px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fafcfc; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.captured-demographics { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px 18px; margin: 0; padding: 18px 28px; border-bottom: 3px solid #7f8b8e; background: #fcfdfd; }
.captured-demographics div { min-width: 0; }
.captured-demographics dt { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.captured-demographics dd { margin: 2px 0 0; overflow-wrap: anywhere; color: #20383e; font: 600 12px/1.35 Georgia, "Times New Roman", serif; }
.clinical-note-columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .85fr); gap: 32px; min-height: 570px; padding: 28px clamp(24px, 4vw, 50px); color: #182e34; font: 13px/1.48 Georgia, "Times New Roman", serif; }
.clinical-note-columns.single-column { grid-template-columns: minmax(0, 1fr); }
.clinical-note-main, .clinical-note-sidebar { min-width: 0; }
.clinical-note-sidebar { padding-left: 26px; border-left: 1px solid #d7e0e1; }
.clinical-section { margin: 0 0 19px; break-inside: avoid; }
.clinical-section h2 { margin: 0 0 5px; color: #142d33; font: 700 13px/1.25 Georgia, "Times New Roman", serif; text-decoration: underline; text-underline-offset: 2px; }
.note-paragraph, .note-bullet p, .note-dated p { margin: 0 0 5px; overflow-wrap: anywhere; }
.note-bullet { display: grid; grid-template-columns: 11px minmax(0, 1fr); gap: 2px; }
.note-bullet > span { font-weight: 900; }
.note-key-value { display: grid; grid-template-columns: minmax(100px, .35fr) minmax(0, 1fr); gap: 8px; margin-bottom: 5px; }
.note-key-value strong::after { content: ":"; }
.note-key-value span { overflow-wrap: anywhere; }
.note-dated { margin: 8px 0; }
.note-dated time { display: block; margin-bottom: 2px; font-weight: 800; }
.original-note { border-top: 1px solid var(--line); background: #fafcfc; }
.original-note summary { padding: 13px 22px; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.original-note pre { max-height: 520px; min-height: 0; margin: 0; padding: 22px 28px; overflow: auto; border-top: 1px solid var(--line-soft); color: #29454b; background: white; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

.scribe-head { align-items: center; }
.workflow-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: -7px 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.workflow-rail span { padding: 10px 8px; color: #71858a; background: #fafcfc; font-size: 10px; font-weight: 800; text-align: center; }
.workflow-rail span.active { color: #76561d; background: #fff8e9; }
.workflow-rail span.complete { color: #256448; background: #f0faf5; }
.scribe-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(420px, 1.2fr); gap: 18px; }
.scribe-layout .surface { margin: 0; }
.recorder-panel, .transcript-panel, .note-panel { overflow: hidden; }
.capture-mode { display:flex; flex-wrap:wrap; gap:12px 20px; margin:0 0 10px; padding:12px 14px; border:1px solid var(--line, #d8e1e8); border-radius:10px; }
.capture-mode legend { padding:0 6px; font-weight:700; }
.capture-mode label { display:flex; align-items:center; gap:7px; margin:0; }
.transcript-panel { display: flex; flex-direction: column; align-self: stretch; }
.transcript-panel .surface-head, .transcript-panel .editor-foot { flex: 0 0 auto; }
.recorder-panel > label { margin: 18px 22px 0; }
.recorder-panel .microphone-help { margin: 8px 22px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.recording-clock { font: 800 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--teal-800); }
.wave-stage { position: relative; display: grid; place-items: center; min-height: 230px; margin: 16px 22px; overflow: hidden; border-radius: 12px; background: linear-gradient(160deg, #fff3eb, #fffbf8); }
.mic-orb { position: absolute; top: 35px; display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid #efc8b1; border-radius: 50%; background: white; box-shadow: 0 7px 24px rgba(219,79,3,.09); }
.mic-orb span { width: 15px; height: 24px; border: 3px solid var(--teal-700); border-radius: 9px; }
.mic-orb span::after { content: ""; display: block; width: 22px; height: 12px; margin: 15px 0 0 -7px; border: 2px solid var(--teal-700); border-top: 0; border-radius: 0 0 12px 12px; }
.wave-bars { display: flex; align-items: center; gap: 3px; height: 42px; margin-top: 70px; }
.wave-bars i { width: 3px; height: 8px; border-radius: 3px; background: #e69a70; }
.wave-stage.recording .wave-bars i { animation: bars .8s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -37ms); }
.wave-stage.recording .mic-orb { box-shadow: 0 0 0 10px rgba(199,74,76,.08), 0 7px 24px rgba(11,92,107,.08); }
.wave-stage p { position: absolute; bottom: 19px; margin: 0; color: var(--muted); font-size: 11px; }
.record-controls { display: flex; justify-content: center; gap: 8px; padding: 0 22px 17px; }
.recorder-panel .form-help { padding: 0 25px 17px; }
.audio-file-import { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; width: calc(100% - 44px); max-width: calc(100% - 44px); margin: 0 22px 20px; padding: 14px; overflow: hidden; border: 1px solid #c8d9ed; border-radius: 11px; background: #f3f8fc; }
.audio-file-import strong, .audio-file-import small { display: block; }
.audio-file-import small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.audio-file-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.audio-file-picker { min-width: 0; overflow: hidden; }
.audio-file-picker input { max-width: 100%; min-width: 0; height: auto; margin-top: 5px; padding: 7px; overflow: hidden; font-size: 10px; background: white; }
.audio-file-controls .button { width: 100%; max-width: 100%; min-height: 42px; padding-inline: 13px; white-space: normal; }
.audio-transcription-progress { display: grid; gap: 7px; min-width: 0; padding-top: 2px; }
.audio-transcription-progress[hidden] { display: none; }
.audio-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #285f8d; font-size: 11px; }
.audio-progress-head strong { min-width: 0; overflow-wrap: anywhere; }
.audio-progress-head span { flex: 0 0 auto; font-weight: 800; }
.audio-progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #d9e6f2; }
.audio-progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #4c91c9); transition: width .35s ease; }
.audio-transcription-progress.success .audio-progress-head { color: var(--green); }
.audio-transcription-progress.success .audio-progress-track > span { background: var(--green); }
.audio-transcription-progress.failed .audio-progress-head { color: var(--red); }
.audio-transcription-progress.failed .audio-progress-track > span { background: var(--red); }
.scribe-editor { min-height: 430px; border: 0; border-radius: 0; box-shadow: none; line-height: 1.65; resize: none; }
.transcript-panel .scribe-editor { flex: 1 1 auto; height: auto; }
.note-editor { min-height: 350px; border: 0; border-radius: 0; box-shadow: none; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.65; resize: vertical; }
.editor-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.transcript-actions { justify-content: space-between; margin-top: auto; }
.transcript-actions > div { display: flex; flex-wrap: wrap; gap: 7px; }
.editor-foot > span { margin-right: auto; }
.transcript-actions > span, .integration-actions > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.transcript-actions > div, .integration-actions > div { flex-shrink: 0; max-width: 100%; }
.full-span { grid-column: 1 / -1; }
.review-pill, .admin-lock { padding: 5px 10px; border-radius: 99px; color: #7d5a1d; background: var(--amber-soft); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.integration-actions > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.suggestion-list { padding: 4px 22px 18px; }
.suggestion-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line-soft); }
.suggestion-card:last-child { border-bottom: 0; }
.suggestion-card h3 { margin: 4px 0; font-size: 13px; }
.suggestion-card p, .suggestion-card blockquote { margin: 5px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.suggestion-card blockquote { padding: 7px 10px; border-left: 3px solid #b8d2d4; background: #f7fafa; }
.suggestion-kind { color: var(--teal-700); font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.suggestion-review { display: flex; align-items: center; gap: 6px; }

.admin-lock { color: #65467a; background: #f1e9f5; }
.background-setup { overflow: hidden; }
.background-form { grid-template-columns: repeat(3, 1fr); }
.background-explainer { grid-column: 1 / -1; padding: 12px 14px; border: 1px solid #edd4c5; border-radius: 9px; color: #6b4b3a; background: #fff7f2; font-size: 11px; }
.clinical-settings-form { padding: 20px 22px; }
.clinical-settings-form fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.clinical-settings-form legend { padding: 0 7px; color: var(--teal-800); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.clinical-settings-form .wide { grid-column: 1 / -1; }
.clinical-settings-form textarea { min-height: 70px; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
.clinical-safety { padding: 12px 14px; border: 1px solid #ead4a5; border-radius: 9px; color: #755317; background: #fff8e9; font-size: 11px; }
.credential-state { align-self: center; color: var(--muted); font-size: 10px; font-weight: 800; }
.credential-state.ready { color: var(--green); }
.credential-state.missing { color: var(--amber); }
.admin-grid { display: grid; grid-template-columns: minmax(400px, .9fr) minmax(420px, 1.1fr); gap: 18px; margin-bottom: 20px; }
.admin-grid .surface { margin: 0; }
.admin-grid.lower { align-items: start; }
.rpa-command-center { grid-template-columns: minmax(430px, 1fr) minmax(470px, 1.08fr); align-items: stretch; }
.rpa-command-center .surface { min-height: 100%; }
.rpa-command-center .launch-panel, .rpa-command-center .live-panel { display: flex; flex-direction: column; }
.rpa-command-center .launch-panel .desktop-note, .rpa-command-center .live-panel .event-log { margin-top: auto; }
.section-kicker { display: block; margin-bottom: 3px; color: var(--brand); font-size: 9px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 19px 22px; }
.checkbox-row { grid-column: 1 / -1; display: flex !important; align-items: center; gap: 8px !important; }
.checkbox-row input { width: 17px; height: 17px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.desktop-note { margin: 0 22px 21px; }
.rpa-credential-help { grid-column: 1 / -1; margin: -3px 0 0; padding: 10px 12px; border: 1px solid #ead4a5; border-radius: 8px; color: #755317; background: #fff8e9; font-size: 10px; line-height: 1.45; }
.rpa-command-center input[readonly] { cursor: text; background: #fff; }
.rpa-form-actions { align-items: center; flex-wrap: wrap; }
.rpa-form-actions .credential-state { margin-left: auto; }
.rpa-action-status { margin: 0 22px 14px; padding: 10px 12px; border: 1px solid #c2d9ee; border-radius: 8px; color: #285f8d; background: #f1f7fc; font-size: 11px; font-weight: 750; }
.rpa-action-status.success { color: #256448; border-color: #b9dfca; background: #f0faf5; }
.rpa-action-status.error { color: #8f3538; border-color: #efc5c6; background: #fff3f3; }
.mock-result { margin: 0 22px 20px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; }
.mock-result.working { color: #285f8d; border-color: #c2d9ee; background: #f1f7fc; }
.mock-result.passed { color: #256448; border-color: #b9dfca; background: #f0faf5; }
.mock-result.failed { color: #8f3538; border-color: #efc5c6; background: #fff3f3; }
.live-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.live-indicator i { width: 8px; height: 8px; border-radius: 50%; background: #9badb1; }
.live-indicator.active { color: var(--green); }
.live-indicator.active i { background: var(--green); animation: pulse 1.8s infinite; }
.progress-numbers { display: grid; grid-template-columns: repeat(4, 1fr); padding: 20px 22px 14px; }
.progress-numbers div { border-right: 1px solid var(--line-soft); text-align: center; }
.progress-numbers div:last-child { border: 0; }
.progress-numbers strong, .progress-numbers span { display: block; }
.progress-numbers strong { font-size: 22px; }
.progress-numbers span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.progress-track { height: 6px; margin: 0 22px 13px; overflow: hidden; border-radius: 8px; background: #e8eeee; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #f19a40); transition: width .4s; }
.current-patient { margin: 0 22px 12px; padding: 10px 12px; border-radius: 8px; color: #6b4b3a; background: #fff5ef; font-size: 11px; }
.event-log { height: 170px; margin: 0 22px 20px; padding: 10px 12px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfc; font: 10px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.event-log p { display: flex; gap: 8px; margin: 0 0 6px; }
.event-log time { color: var(--muted); }
.event-log .error { color: var(--red); }
.event-log .warning { color: var(--amber); }
.user-list { padding: 10px 20px; }
.user-list > div { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.user-list > div > span:nth-child(2) { flex: 1; }
.user-list strong, .user-list small { display: block; }
.user-list small { color: var(--muted); font-size: 10px; }
.user-form { padding-top: 12px; border-top: 1px solid var(--line); }
.user-form .button { grid-column: 1 / -1; }
.integration-list { padding: 12px 20px; }
.integration-list > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.integration-list > div:last-child { border: 0; }
.integration-list small { grid-column: 1 / -1; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.integration-type { font-weight: 800; }
.cerner-bulk-panel { overflow: hidden; }
.cerner-bulk-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line-soft); background: #fbfcfc; }
.cerner-bulk-actions > div { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-select-all { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 11px; font-weight: 800; }
.bulk-select-all input, .cerner-note-select { width: 17px; height: 17px; }
.cerner-upload-table td { vertical-align: middle; }
.cerner-upload-table td strong, .cerner-upload-table td small { display: block; }
.cerner-upload-table td small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.cerner-upload-table .upload-row-error { max-width: 300px; overflow: hidden; color: var(--red); text-overflow: ellipsis; white-space: nowrap; }
.cerner-bulk-panel > .rpa-action-status { margin-top: 14px; }

@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(44,158,104,0); } }
@keyframes bars { to { height: calc(10px + (var(--i) % 7) * 4px); background: var(--brand); } }

@media (max-width: 1200px) {
  .patient-schedule-table-wrap { overflow: visible; }
  .patient-schedule-table, .patient-schedule-table tbody { display: block; width: 100%; }
  .patient-schedule-table colgroup, .patient-schedule-table thead { display: none; }
  .patient-schedule-table tbody { padding: 10px; }
  .patient-schedule-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
  .patient-schedule-table tbody tr:last-child { margin-bottom: 0; }
  .patient-schedule-table tbody tr[hidden] { display: none; }
  .patient-schedule-table td { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; width: auto; height: auto; min-height: 35px; padding: 5px 0; overflow: visible; border: 0; }
  .patient-schedule-table td::before { content: attr(data-label); color: #817168; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .patient-schedule-table td[data-label="Patient"], .patient-schedule-table td[data-label="Details"], .patient-schedule-table td[data-label="Notes"], .patient-schedule-table td[data-label="Actions"] { grid-column: 1 / -1; }
  .patient-schedule-table .details-cell { -webkit-line-clamp: 2; }
  .patient-schedule-table .notes-cell { display: -webkit-box; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .patient-schedule-table .review-stage-cell { text-align: left; }
  .patient-schedule-table .row-actions { justify-content: flex-start; }
}

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .admin-grid, .scribe-layout { grid-template-columns: 1fr; }
  .rpa-command-center .surface { min-height: auto; }
  .full-span { grid-column: auto; }
  .report-filter-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .main-content { margin: 0; padding: 78px 16px 40px; }
  .main-content:has(> .compact-dashboard) { padding-top: 78px; }
  .mobile-bar { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 62px; padding: 0 16px; border-bottom: 1px solid var(--line); background: rgba(255,252,250,.96); backdrop-filter: blur(10px); }
  .brand.compact .brand-logo { width: 122px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .date-control, .date-stepper, .date-control input { width: 100%; }
  .date-stepper { grid-template-columns: 42px minmax(0, 1fr) 42px; }
  .date-arrow { width: 42px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 100px; padding: 15px; }
  .rpa-form-actions .credential-state { width: 100%; margin-left: 0; }
  .metric-icon { width: 35px; height: 35px; }
  .surface-head { align-items: flex-start; flex-direction: column; }
  .filter-box { width: 100%; }
  .schedule-filter-controls { align-items: stretch; flex-direction: column; width: 100%; }
  .review-filter, .review-filter select, .schedule-search { width: 100%; }
  .run-strip { flex-wrap: wrap; padding-block: 10px; }
  .run-strip .muted { margin-left: 0; }
  .strip-arrow { margin-left: auto; }
  .patient-hero { align-items: flex-start; flex-wrap: wrap; }
  .patient-hero .button { width: 100%; margin: 0; }
  .document-layout { grid-template-columns: 1fr; }
  .document-meta dl { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 15px; }
  .clinical-note-columns { grid-template-columns: 1fr; }
  .clinical-note-sidebar { padding: 20px 0 0; border-top: 1px solid #d7e0e1; border-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .background-form { grid-template-columns: 1fr; }
  .form-grid > *, .checkbox-row, .form-actions, .user-form .button { grid-column: auto; }
  .integration-actions { align-items: stretch; flex-direction: column; }
  .integration-actions > div, .integration-actions .button { width: 100%; }
  .workflow-rail { grid-template-columns: 1fr; }
  .transcript-actions, .transcript-actions > div, .suggestion-card, .suggestion-review { align-items: stretch; flex-direction: column; }
  .transcript-actions .button, .suggestion-review .button { width: 100%; }
  .scribe-editor { min-height: 360px; }
  .suggestion-card { grid-template-columns: 1fr; }
  .clinical-settings-form fieldset { grid-template-columns: 1fr; }
  .record-controls { flex-wrap: wrap; }
  .report-filter-form { grid-template-columns: 1fr; }
  .report-filter-actions, .report-filter-actions .button { width: 100%; }
  .cerner-bulk-actions { align-items: stretch; flex-direction: column; }
  .cerner-bulk-actions > div, .cerner-bulk-actions .button { width: 100%; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { display: none; }
  .login-panel { min-height: 100vh; padding: 20px; }
  .login-card-logo { display: block; }
}

@media (max-width: 450px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 86px; }
  .progress-numbers { grid-template-columns: 1fr 1fr; gap: 16px 0; }
  .progress-numbers div:nth-child(2) { border-right: 0; }
}

@media print {
  .sidebar, .mobile-bar, .breadcrumb, .document-header .button { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .document-layout { display: block; }
  .document-meta { margin-bottom: 15px; box-shadow: none; }
  .clinical-document { border: 0; box-shadow: none; }
  .clinical-note-columns { display: grid; grid-template-columns: 1.55fr .85fr; padding: 0; }
  .original-note { display: none; }
}
.button.action-working { position: relative; }
.button.action-working::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 5px;
  height: 5px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  flex-shrink: 0;
  animation: action-spin .8s linear infinite;
}
@keyframes action-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .button.action-working::before { animation: none; }
}
.coding-review-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; }
.coding-source-panel { min-width:0; padding:18px; border:1px solid #d8e1e8; border-radius:12px; background:#f8fafc; position:sticky; top:16px; }
.coding-navigation { display:flex; gap:8px; align-items:center; justify-content:space-between; margin:12px 0; }
.coding-navigation span { font-size:.8rem; }
.coding-source-view { white-space:pre-wrap; overflow-wrap:anywhere; font:15px/1.8 system-ui,sans-serif; max-height:65vh; overflow:auto; padding:12px; background:white; }
.coding-results-panel { min-width:0; max-height:82vh; overflow:auto; padding:4px 8px; }
.coding-source-mark { display:inline; white-space:pre-wrap; font:inherit; color:inherit; background:#fff1bd; border:0; border-bottom:2px solid #c58b00; border-radius:2px; padding:0; text-align:left; cursor:pointer; }
.coding-source-mark.evidence-selected { background:#ffd17a; outline:2px solid #bd5700; }
.suggestion-card.evidence-selected { outline:2px solid #d95f12; background:#fff8ef; }
.coding-source-mark:focus-visible,.suggestion-card:focus-visible { outline:3px solid #176eab; }
@media(max-width:900px) { .coding-review-layout { grid-template-columns:1fr; } .coding-source-panel { position:static; } .coding-source-view { max-height:40vh; } .coding-results-panel { max-height:65vh; } }
.coding-results-panel .suggestion-card { grid-template-columns:minmax(0,1fr); padding:16px 10px; }
.coding-results-panel .suggestion-review { flex-wrap:wrap; }
.suggestion-card .coding-code { display:block; font-size:26px; font-weight:800; line-height:1.25; margin:8px 0; color:#14532d; }
.suggestion-card .coding-code-icd { color:#075985; }
.suggestion-card .coding-code-cpt { color:#6b21a8; }
.suggestion-card .coding-description { display:block; font-size:14px; line-height:1.5; }
.coding-results-panel .coding-item-panel { margin:12px 2px; padding:18px; border:1px solid #cbd5e1; border-radius:12px; background:#fff; box-shadow:0 2px 7px #0f172a0a; }
.coding-item-panel[data-evidence-start] { cursor:pointer; }
.coding-results-panel .coding-item-panel.evidence-selected { border:2px solid #bd5700; background:#fff7e8; box-shadow:0 0 0 2px #ffd17a; }
.coding-source-mark.evidence-selected { background:#ffce66; color:#3b2300; outline:2px solid #a64b00; }

/* Manual walk-in entry and the visit-type column. */
.patient-schedule-table .col-arrival { width: var(--schedule-arrival-width); }
.patient-schedule-table .arrival-cell { padding-inline: 4px; text-align: center; }
.arrival-icon { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 28px; color: #817168; font-size: 15px; }
.arrival-icon.walkin { color: #9a3a08; background: #fff0e5; border-radius: 7px; }
.walkin-form { padding: 22px; border-block: 1px solid var(--line); background: #fffcfa; }
.walkin-form-heading h3 { font-size: 18px; margin: 0 0 5px; }
.walkin-form-heading p, .walkin-form .form-text { color: var(--muted); font-size: 12px; }
.walkin-form fieldset { margin: 20px 0; min-width: 0; }
.walkin-form legend { font-size: 14px; font-weight: 800; margin-bottom: 12px; }
.walkin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.walkin-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; }
.walkin-field .form-text { font-weight: 400; }
.walkin-wide { grid-column: 1 / -1; }
.walkin-form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.walkin-field input, .walkin-field select, .walkin-field textarea { min-width: 0; }
@media (max-width: 1200px) {
  .patient-schedule-table .arrival-cell { grid-column: 1 / -1; padding-inline: 0; text-align: left; }
  .walkin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .walkin-grid { grid-template-columns: minmax(0, 1fr); }
  .walkin-form { padding: 16px; }
}

#final-review { padding:24px; }
#final-review > label { display:block; margin:20px 0 10px; max-width:760px; }
#final-review > label > textarea, #final-review > label > select { display:block; width:100%; margin-top:8px; }
#final-review #review-attestation { width:18px; height:18px; padding:0; margin:0 8px 0 0; vertical-align:middle; }
#final-review > .button { margin:6px 8px 12px 0; }
#final-review .coding-review-layout { margin-top:20px; }
#final-review .clinical-safety:empty { display:none; }

.button.review-saving::before { content:''; display:inline-block; width:14px; height:14px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:action-spin .8s linear infinite; margin-right:8px; }

.recording-summary { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.recording-indicator { display:inline-flex; gap:6px; align-items:center; font-size:12px; font-weight:700; color:#16803a; }
.recording-indicator i { width:9px; height:9px; border-radius:50%; background:currentColor; }
#microphone-toggle { color:#16803a; background:#ecfdf3; border-color:#16803a; cursor:pointer; }
#microphone-toggle span, #microphone-toggle span::after { border-color:currentColor; }
#microphone-toggle:focus-visible { outline:3px solid #0b6dce; outline-offset:4px; }
#microphone-toggle[data-state="recording"] { color:#b91c1c; background:#fee2e2; border-color:#b91c1c; }
.recording-indicator[data-state="recording"] { color:#b91c1c; }
#microphone-toggle[data-state="paused"], .recording-indicator[data-state="paused"] { color:#a16207; }
#microphone-toggle:disabled { cursor:wait; opacity:.7; }
.call-audio-levels { display:flex; flex-wrap:wrap; gap:12px; margin:8px 22px; font-size:12px; }
.call-audio-levels span { padding:5px 8px; border-radius:6px; background:#f1f5f9; }
.call-audio-levels span[data-signal="true"] { color:#166534; background:#dcfce7; }
.call-audio-levels[hidden], #telemedicine-help[hidden] { display:none; }
.wave-stage p { max-width:90%; text-align:center; }

.recorder-panel .record-controls { flex-wrap:wrap; }

#microphone-toggle[hidden], .recording-icon-actions[hidden] { display:none; }
.recording-icon-actions { position:absolute; top:35px; display:flex; align-items:center; gap:16px; }
.recorder-icon-button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; width:64px; height:64px; padding:5px; border:1px solid currentColor; border-radius:50%; cursor:pointer; }
.recorder-icon-button svg { width:24px; height:24px; fill:currentColor; }
.recorder-icon-button span { font-size:10px; font-weight:700; }
#pause-recording-icon { color:#a16207; background:#fef3c7; }
#pause-recording-icon[data-resume="true"] { color:#16803a; background:#ecfdf3; }
#stop-recording-icon { color:#b91c1c; background:#fee2e2; }
#pause-recording-icon .resume-symbol, #pause-recording-icon[data-resume="true"] .pause-symbol { display:none; }
#pause-recording-icon[data-resume="true"] .resume-symbol { display:block; }
.recorder-icon-button:disabled { cursor:wait; opacity:.5; }
.recorder-icon-button:focus-visible { outline:3px solid #0b6dce; outline-offset:4px; }

.warning-review { padding:12px; border:1px solid #eac15c; border-radius:8px; background:#fffbeb; }
.warning-review label { display:block; margin-top:8px; }
.warning-review .warning-review-ack { width:17px; height:17px; padding:0; margin:0 7px 0 0; vertical-align:middle; }
.warning-review .warning-review-note { display:block; width:100%; margin-top:4px; }
.warning-review-saved { color:#785211; }
.audio-review { display:grid; gap:6px; padding:12px 20px; }
.audio-review[hidden], .transcription-review-warning[hidden] { display:none; }
.audio-review audio { width:100%; }
.audio-review small, .transcription-review-warning { color:#75501c; }
.transcription-review-warning { padding:0 20px; }
