:root {
  --navy: #102e42;
  --teal: #087c73;
  --muted: #62727e;
  --border: #dce5e9;
  --danger: #ab2638;
}

html { font-size: 16px; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--navy);
  background: #f4f7f9;
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
a { color: var(--teal); }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #087c73; outline-offset: 4px; }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 10; padding: .8rem 1rem; background: #fff; }
.skip-link:focus { top: 1rem; }

.login-shell {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  overflow: hidden;
  max-width: 1160px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 18px 65px #102e420b;
}

.welcome-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 4vw, 3.5rem);
  overflow: hidden;
  color: #fff;
  background: radial-gradient(ellipse at 100% 0, #205960 0, transparent 65%), #102e42;
}

.eyebrow, .section-label { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .17em; }
.eyebrow { color: #9cddd3; margin-bottom: 1.5rem; }
.welcome-panel h1 { margin: 0 0 1.25rem; font-size: clamp(1.9rem, 2.7vw, 2.5rem); font-weight: 650; line-height: 1.23; letter-spacing: -.04em; }
.welcome-panel h1 span { color: #9cddd3; }
.welcome-description { max-width: 24rem; margin: 0; color: #c7d7e1; font-size: .95rem; line-height: 1.8; }
.workspace-illustration { margin: 2.25rem 0; padding: 1.15rem 1.3rem; border: 1px solid #ffffff24; border-radius: 1rem; background: #ffffff07; transform: rotate(-2deg); }
.illustration-top { display: flex; align-items: center; gap: .6rem; color: #c7d7e1; font-size: .55rem; font-weight: 650; letter-spacing: .13em; }
.illustration-dot { width: .45rem; height: .45rem; border-radius: 50%; background: #89dacc; }
.illustration-dots { margin-left: auto; font-size: 1.2rem; line-height: .5; }
.illustration-body { display: flex; align-items: center; gap: 1.75rem; padding-top: 1.1rem; }
.illustration-compass { flex: 0 0 39%; }
.illustration-compass svg { width: 100%; max-height: 124px; stroke: #8dd9ce; stroke-width: 1.4; }
.illustration-compass svg circle { stroke: #ffffff30; }
.illustration-lines { flex: 1; }
.illustration-lines > span { display: block; height: .3rem; width: 75%; margin-bottom: .6rem; border-radius: 1rem; background: #ffffff20; }
.illustration-lines > span:nth-child(2) { width: 50%; }
.illustration-lines > span:nth-child(3) { width: 62%; }
.illustration-bars { display: flex; align-items: flex-end; gap: .4rem; height: 3rem; margin-top: 1rem; }
.illustration-bars i { flex: 1; height: 30%; border-radius: .15rem .15rem 0 0; background: #8dd9ce80; }
.illustration-bars i:nth-child(2) { height: 45%; }
.illustration-bars i:nth-child(3) { height: 38%; }
.illustration-bars i:nth-child(4) { height: 65%; }
.illustration-bars i:nth-child(5) { height: 55%; }
.illustration-bars i:nth-child(6) { height: 80%; }
.illustration-bars i:nth-child(7) { height: 100%; background: #8dd9ce; }
.feature-list { display: grid; gap: 1.4rem; padding: 0; margin: 0; list-style: none; }
.feature-list li { display: flex; align-items: flex-start; gap: .9rem; }
.feature-icon { display: grid; place-items: center; flex: 0 0 2.2rem; height: 2.2rem; border: 1px solid #ffffff24; border-radius: .65rem; color: #9cddd3; font-size: .65rem; font-weight: 600; }
.feature-list h2 { margin: 0 0 .3rem; font-size: .88rem; font-weight: 600; }
.feature-list p { margin: 0; color: #c7d7e1; font-size: .78rem; line-height: 1.6; }
.welcome-caption { display: block; margin-top: 3rem; color: #acc5d3; font-size: .56rem; letter-spacing: .12em; }

.signin-panel { padding: clamp(2rem, 4vw, 3.5rem); }
.section-label { margin-bottom: .85rem; color: var(--teal); }
.signin-heading h2 { margin: 0 0 .65rem; font-size: 2rem; font-weight: 700; letter-spacing: -.04em; }
.signin-heading p { color: var(--muted); font-size: .9rem; margin: 0; }
.signin-form { margin-top: 2rem; }
.form-field { margin-bottom: 1.35rem; }
.affidavit-request-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.affidavit-certification { display: flex; align-items: flex-start; gap: .75rem; margin: 1.25rem 0; }
.affidavit-certification input { flex: 0 0 auto; margin-top: .25rem; }
.affidavit-correction-preview { min-height: 650px; width: 100%; }
.form-field textarea { width: 100%; box-sizing: border-box; padding: .75rem; font: inherit; border: 1px solid #cbd5e1; border-radius: .5rem; resize: vertical; }
.form-field label { display: block; margin-bottom: .5rem; font-size: .82rem; font-weight: 650; }
.portal-input { width: 100%; min-height: 3.1rem; padding: .8rem .95rem; border: 1px solid #c7d3db; border-radius: .55rem; color: var(--navy); background: #fff; font-size: .88rem; transition: border-color .15s, box-shadow .15s; }
.portal-input::placeholder { color: #73818c; opacity: 1; }
.portal-input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px #087c731c; }
.password-field { position: relative; }
.password-field input { padding-right: 4.5rem; }
.password-toggle { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); padding: .4rem; border: 0; border-radius: .25rem; color: var(--teal); background: transparent; font-size: .75rem; font-weight: 650; }
.password-toggle:hover { background: #edf6f5; }
.field-help { display: block; margin-top: .5rem; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.field-error { display: block; color: var(--danger); font-size: .76rem; line-height: 1.5; }
.field-validation-error { margin-top: .4rem; }
.input-validation-error { border-color: var(--danger); }
.form-alert { margin-bottom: 1.5rem; padding: .9rem 1rem; border: 1px solid #edc2c8; border-radius: .55rem; color: #8c2030; background: #fff4f5; font-size: .82rem; line-height: 1.6; }
.form-alert ul { padding: 0; margin: 0; list-style: none; }
.validation-summary-valid { display: none; }
.signin-button { display: flex; align-items: center; justify-content: center; gap: .85rem; width: 100%; min-height: 3.15rem; margin-top: 1.75rem; padding: .8rem 1rem; border: 1px solid var(--teal); border-radius: .55rem; color: #fff; background: var(--teal); font-size: .9rem; font-weight: 650; transition: background .15s; }
.signin-button:hover { background: #07665f; }
.signin-button:disabled { opacity: .7; cursor: wait; }
.signin-notice { margin: .9rem 0 0; color: var(--muted); font-size: .7rem; line-height: 1.6; text-align: center; }
.signin-help { display: flex; align-items: flex-start; gap: .8rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.help-icon { display: grid; place-items: center; flex: 0 0 1.3rem; height: 1.3rem; border: 1px solid #9aadb8; border-radius: 50%; color: var(--muted); font-size: .75rem; }
.signin-help h3 { margin: .1rem 0 .4rem; font-size: .8rem; font-weight: 650; }
.signin-help p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.7; }

.dashboard-heading { margin-bottom: 2rem; }
.support-workspace { display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(0, 2fr); gap: 1.5rem; }
.support-workspace h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
.support-inbox { margin: 1rem 0; padding: 0; list-style: none; }
.support-inbox li { padding: .8rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.support-inbox small { display: block; color: var(--muted); }
.support-inbox [aria-current="page"] { font-weight: 700; }
.support-unread { display: inline-block; margin-left: .4rem; color: var(--teal); font-size: .8rem; }
.support-message { margin: 1rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: .55rem; background: #f8fafb; }
.support-service-message { border-left: 4px solid var(--teal); }
.support-message h3 { font-size: .95rem; overflow-wrap: anywhere; }
.support-message time { font-size: .8rem; color: var(--muted); }
.support-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: .75rem 0 0; }
.support-compose { margin-top: 1.5rem; }
@media (max-width: 760px) { .support-workspace { grid-template-columns: minmax(0, 1fr); } }
.dashboard-heading h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 650; letter-spacing: -.04em; overflow-wrap: anywhere; }
.dashboard-heading p { color: var(--muted); overflow-wrap: anywhere; }
.dashboard-empty { padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--border); border-radius: 1rem; background: #fff; }
.dashboard-empty h2 { font-size: 1.4rem; }
.dashboard-empty p { max-width: 40rem; margin-bottom: 0; color: var(--muted); line-height: 1.8; }

.results-overview { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--border); border-radius: 1rem; background: #fff; }
.overview-heading h2 { margin: 0 0 .6rem; font-size: 1.4rem; font-weight: 650; }
.overview-heading > p { color: var(--muted); font-size: .85rem; line-height: 1.7; }
.results-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 1rem; align-items: start; margin: 1.5rem 0 2rem; }
.results-filter .form-field { margin: 0; }
.results-filter .filter-button { width: auto; min-height: 3.1rem; margin-top: 1.75rem; white-space: nowrap; }
.results-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.stat-card { padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid var(--border); border-top: 3px solid var(--navy); border-radius: .75rem; background: #f8fafb; }
.stat-card-viewed { border-top-color: var(--teal); background: #f3faf8; }
.stat-card-unviewed { border-top-color: #a76b13; background: #fffaf1; }
.stat-card h3 { margin: 0; font-size: .85rem; line-height: 1.6; font-weight: 650; }
.stat-card .stat-value { margin: .75rem 0 .5rem; color: var(--navy); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-card > p:last-child { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.6; }
.results-empty { margin: 1.5rem 0 0; color: var(--muted); font-size: .85rem; line-height: 1.7; }

.dashboard-actions { margin-top: 2rem; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.action-card { display: flex; align-items: center; gap: .9rem; min-height: 7rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: .85rem; color: var(--navy); background: #fff; text-decoration: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.action-card:hover { border-color: var(--teal); color: var(--navy); background: #f3faf8; box-shadow: 0 6px 20px #102e420b; }
.action-icon { display: grid; place-items: center; flex: 0 0 2.75rem; height: 2.75rem; border-radius: .75rem; color: var(--teal); background: #edf6f5; }
.action-icon svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.action-copy { flex: 1; min-width: 0; }
.action-title { display: block; font-size: .9rem; font-weight: 650; line-height: 1.5; }
.action-count { display: block; margin-top: .35rem; color: var(--navy); font-size: 1.75rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.action-description { display: block; margin-top: .3rem; color: var(--muted); font-size: .75rem; line-height: 1.6; }
.action-card [role="alert"] { color: var(--danger); }
.action-arrow { flex-shrink: 0; color: var(--teal); font-size: 1.15rem; }
.workspace-back { display: inline-block; margin-top: 1.5rem; font-size: .85rem; font-weight: 600; text-decoration: none; }
.workspace-back:hover { text-decoration: underline; }

.payment-notice, .payment-review { margin-bottom: 1.5rem; padding: 1.15rem 1.25rem; border: 1px solid #e8d2a7; border-radius: .75rem; background: #fffaf1; font-size: .85rem; line-height: 1.7; }
.payment-notice strong { display: block; }
.payment-review { border-color: var(--border); background: #fff; }
.payment-review h2 { font-size: 1.15rem; }
.payment-review p { margin: .5rem 0 0; overflow-wrap: anywhere; }
.payment-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.payment-fields .form-field { min-width: 0; margin: 0; }
.payment-field-wide { grid-column: 1 / -1; }
.payment-fields select { font: inherit; font-size: .88rem; }
.payment-details-group { min-width: 0; margin-top: 2rem; padding-top: 1.5rem; border: 0; border-top: 1px solid var(--border); }
.payment-details-group legend { float: none; width: auto; margin-bottom: .75rem; font-size: 1.1rem; font-weight: 650; }
[data-square-card] { max-width: 42rem; margin-top: 1rem; min-height: 100px; }
[data-square-status][role="alert"] { color: var(--danger); }
.payment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.5rem; }
.payment-actions .signin-button { width: auto; margin: 0; }
.payment-actions button:disabled { cursor: not-allowed; }
.supply-item-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, 12rem) auto; align-items: start; gap: 1rem; margin-top: 1.5rem; }
.supply-item-editor .form-field { min-width: 0; margin: 0; }
.supply-item-editor .results-refresh { margin-top: 1.75rem; }
.supply-item-editor select { font: inherit; font-size: .88rem; }
[data-supply-status][role="alert"], [data-supply-submit-status][role="alert"] { color: var(--danger); }
.supply-history-table td { vertical-align: top; }
.patient-results-table.supply-history-table td:nth-child(4) { min-width: 17rem; white-space: normal; }
.supply-history-items summary { color: var(--teal); cursor: pointer; }
.supply-history-items ul { margin: .65rem 0 0; padding-left: 1.15rem; }
.supply-history-items li + li { margin-top: .5rem; }
.supply-shipment { margin: .65rem 0 0; padding-top: .65rem; border-top: 1px solid var(--border); }
.supply-shipment > div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: .5rem; }
.supply-shipment dt { color: var(--muted); font-weight: 400; }
.supply-shipment dd { min-width: 0; margin-bottom: .35rem; overflow-wrap: anywhere; }

.patient-results-panel { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--border); border-radius: 1rem; background: #fff; }
.patient-lookup-panel { margin-bottom: 1.5rem; }
.patient-lookup-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-top: 1.25rem; }
.patient-lookup-form .form-field { flex: 1 1 15rem; min-width: 0; margin: 0; }
.patient-lookup-form .form-field[hidden] { display: none; }
.patient-lookup-form select { font: inherit; font-size: .88rem; }
.patient-lookup-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.patient-lookup-actions .signin-button { width: auto; min-height: 3.1rem; margin: 0; }
.patient-lookup-actions button:disabled, .patient-lookup-form select:disabled { opacity: .55; cursor: not-allowed; }
.patient-results-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.patient-results-toolbar .overview-heading > p { max-width: 40rem; }
.results-refresh, .report-close { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .65rem 1rem; border: 1px solid var(--border); border-radius: .55rem; color: var(--teal); background: #fff; font-size: .8rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.results-refresh:hover, .report-close:hover { color: var(--teal); background: #edf6f5; }
.patient-results-count { margin: 1rem 0 .75rem; color: var(--muted); font-size: .8rem; }
.results-grid-filter-summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.results-grid-filter-summary button:disabled { opacity: .55; cursor: not-allowed; }
.patient-results-table .result-column-filter { display: block; width: 100%; min-width: 8rem; margin-top: .5rem; padding: .4rem .5rem; font-size: .8rem; font-weight: 400; }
.patient-results-table .result-column-filter[hidden], [data-result-filter-help][hidden] { display: none; }
.report-selection-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: .65rem; background: #f8fafb; }
.report-selection-toolbar p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.report-selection-toolbar .report-selection-status { margin-top: .25rem; color: var(--navy); font-weight: 600; }
.report-selection-toolbar [data-report-download-status][role="alert"] { color: var(--danger); }
.report-selection-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.report-selection-actions button:disabled { opacity: .55; cursor: not-allowed; }
.patient-results-table .report-checkbox-cell { width: 4rem; text-align: center; }
.report-checkbox-cell input { width: 1.15rem; height: 1.15rem; vertical-align: middle; accent-color: var(--teal); cursor: pointer; }
.report-checkbox-cell input:disabled { cursor: not-allowed; }
.patient-table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: .65rem; }
.patient-results-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .85rem; }
.patient-results-table tr[hidden] { display: none; }
.patient-results-table.affidavit-results-table { min-width: 520px; }
.patient-alerts-panel { border-top: 3px solid #b7791f; }
.patient-alerts-table .patient-alert-notes { min-width: 18rem; white-space: pre-wrap; }
.patient-results-table.patient-alerts-table td:nth-child(5) { white-space: normal; }
.affidavit-results-table button:disabled { opacity: .55; cursor: wait; }
.affidavit-completion-status { margin: 1rem 0; padding: .9rem 1rem; border: 1px solid #b5dcd5; border-radius: .55rem; color: var(--teal); background: #edf6f5; font-size: .82rem; line-height: 1.6; }
.patient-results-table th { padding: 1rem; color: var(--muted); background: #f4f7f9; font-size: .75rem; font-weight: 650; text-align: left; }
.patient-results-table td { padding: .85rem 1rem; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.patient-results-table th:nth-child(4), .patient-results-table th:nth-child(5), .patient-results-table td:nth-child(4), .patient-results-table td:nth-child(5) { white-space: nowrap; }
.result-row-selectable { cursor: pointer; }
.result-row-selectable:hover, .result-row-selectable:focus-within, .result-row-selectable.is-selected { background: #edf6f5; }
.patient-results-table .result-viewed { background: #edf3fd; }
.patient-results-table .result-viewed td:first-child { box-shadow: inset 3px 0 #4067a5; }
.patient-results-table .result-viewed:hover, .patient-results-table .result-viewed:focus-within, .patient-results-table .result-viewed.is-selected { background: #e0eafb; }
.raw-results-button { margin-left: .5rem; font-size: .75rem; white-space: nowrap; }
.raw-results-page { display: block; min-height: 100vh; background: #fff; }
.raw-results-content { min-width: 0; padding: 1rem; }
.raw-results-content h1 { margin: 0 0 .75rem; font-size: 1.25rem; }
.raw-results-table { min-width: 980px; }
.raw-results-table th, .raw-results-table td { vertical-align: top; }
.raw-results-table th[scope="row"] { color: var(--navy); background: transparent; font-size: inherit; }
.raw-results-table td:nth-child(4), .raw-results-table td:nth-child(5) { white-space: normal; }
.raw-observation-value { min-width: 8rem; white-space: pre-wrap; }
.raw-source-details { margin: 0; min-width: 10rem; }
.raw-source-details dt { margin-top: .5rem; color: var(--muted); font-size: .75rem; }
.raw-source-details dd { margin: .25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.raw-results-table summary { color: var(--teal); cursor: pointer; white-space: nowrap; }
.result-view-status { display: block; margin-top: .25rem; color: var(--muted); font-size: .7rem; }
.result-viewed .result-view-status { color: #35598f; font-weight: 650; }
.specimen-button { padding: .4rem .2rem; border: 0; border-radius: .2rem; color: var(--teal); background: transparent; font-size: inherit; font-weight: 650; text-align: left; text-decoration: underline; text-underline-offset: .2em; }
.report-dialog { width: min(1100px, 94vw); max-width: none; max-height: 92vh; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--border); border-radius: 1rem; color: var(--navy); background: #fff; box-shadow: 0 24px 80px #102e4233; }
.report-dialog::backdrop { background: #102e42b3; }
.report-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.report-dialog-header h2 { margin: 0; font-size: 1.5rem; font-weight: 650; }
.report-patient-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: .65rem; background: #f4f7f9; }
.report-patient-summary[hidden] { display: none; }
.affidavit-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report-patient-summary dt { margin-bottom: .35rem; color: var(--muted); font-size: .7rem; font-weight: 600; }
.report-patient-summary dd { margin: 0; font-size: .85rem; overflow-wrap: anywhere; }
.report-loading { color: var(--muted); font-size: .85rem; }
.report-frame { display: block; width: 100%; height: 65vh; min-height: 320px; border: 1px solid var(--border); border-radius: .65rem; background: #f8fafb; }
.report-viewer-page { display: block; width: 100%; height: 100vh; min-height: 0; overflow: hidden; background: #fff; }
.patient-report-viewer-page { display: flex; flex-direction: column; }
.patient-report-viewer-page .pdfjs-frame { flex: 1; min-height: 0; }
.patient-report-viewer-page .report-error { overflow-y: auto; }
.pgx-report-notice { flex: none; max-height: 45vh; overflow-y: auto; margin: 0; padding: .85rem 1rem; border-bottom: 1px solid var(--border); color: var(--navy); background: #eef7f6; font-size: .85rem; }
.pgx-report-notice h2 { margin: 0 0 .35rem; font-size: 1rem; }
.pgx-report-notice p { margin: .35rem 0; }
.pdfjs-frame { display: block; width: 100%; height: 100%; border: 0; }
.report-viewer-message { position: absolute; z-index: 10000; left: 1rem; right: 1rem; bottom: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: .5rem; color: var(--navy); background: #fff; font-size: .85rem; }
.report-error { max-width: 40rem; padding: clamp(1.25rem, 4vw, 3rem); color: var(--navy); }
.report-error h1 { font-size: 1.25rem; }
.report-error p { color: var(--muted); font-size: .9rem; line-height: 1.7; }

body .site-main:has(.patient-results-workspace) { padding-top: .75rem; }
.patient-results-workspace .dashboard-heading { margin-bottom: .85rem; }
.patient-results-workspace .dashboard-heading h1 { margin-bottom: .25rem; font-size: 1.65rem; }
.patient-results-workspace .dashboard-heading p { margin-bottom: 0; font-size: .85rem; }
.patient-results-workspace .patient-results-panel { padding: 1rem; }
.patient-results-workspace .results-search-panel { margin-bottom: .65rem; padding: .65rem 1rem; }
.results-search-panel .compact-date-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .65rem; margin: 0; }
.compact-date-filter .form-field { flex: 0 1 11rem; }
.results-search-panel .compact-date-filter .filter-button { width: auto; min-height: 2.75rem; margin: 0; padding: .65rem 1rem; }
.compact-date-filter .portal-input { min-height: 2.75rem; padding: .5rem .65rem; }
.compact-date-filter .form-field label { margin-bottom: .25rem; }
.results-search-panel .field-help { margin: .35rem 0 0; }
.results-lookup-details { margin-bottom: .85rem; border: 1px solid var(--border); border-radius: .65rem; background: #fff; }
.results-lookup-details > summary { padding: .5rem 1rem; color: var(--teal); font-size: .85rem; font-weight: 650; cursor: pointer; }
.results-lookup-details > summary span { color: var(--muted); font-weight: 400; }
.results-lookup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: 0 .75rem .75rem; }
.results-lookup-grid .patient-lookup-panel { min-width: 0; margin: 0; border-radius: .5rem; }
.results-lookup-grid .overview-heading h2 { font-size: 1rem; }
.results-lookup-grid .overview-heading p { margin-bottom: .5rem; }
.results-lookup-grid .patient-lookup-form { gap: .65rem; margin-top: .5rem; }
.results-lookup-grid .field-help { margin: .5rem 0 0; }
.results-grid-panel .overview-heading h2 { font-size: 1.05rem; margin-bottom: .25rem; }
.results-grid-panel .overview-heading p { margin-bottom: 0; }
.results-grid-panel .section-label { margin-bottom: .25rem; }
.results-grid-panel .patient-results-count { margin: .65rem 0; }
.results-grid-panel .results-refresh { min-height: 2.25rem; padding: .4rem .75rem; }
.results-grid-panel .report-selection-toolbar { gap: .5rem; margin-bottom: .6rem; padding: .6rem .75rem; }
.results-grid-panel .result-column-filter { min-height: 2.25rem; }
.results-grid-panel .patient-results-table th { padding: .65rem .75rem; }
.results-grid-panel .patient-results-table td { padding: .65rem .75rem; }
.results-grid-panel .field-help { margin: .5rem 0 0; }

@media (max-width: 700px) {
  .results-lookup-grid { grid-template-columns: 1fr; }
  .results-grid-filter-summary { flex-wrap: wrap; }
  .compact-date-filter .form-field { flex: 1 1 9rem; }
}

@media (max-width: 1000px) {
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .supply-item-editor { grid-template-columns: 1fr; }
  .supply-item-editor .results-refresh { margin-top: 0; }
  .payment-fields { grid-template-columns: 1fr; }
  .results-stats, .results-filter, .action-grid { grid-template-columns: 1fr; }
  .results-filter .filter-button { width: 100%; margin-top: 0; }
  .patient-results-toolbar { flex-direction: column; gap: .5rem; }
  .report-patient-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-dialog-header { flex-wrap: wrap; }
}

@media (min-width: 1600px) {
  .login-shell { margin-top: 2vh; }
}

@media (max-width: 850px) {
  .login-shell { grid-template-columns: 1fr; max-width: 560px; }
  .welcome-panel { padding: 2rem; }
  .welcome-panel h1 { font-size: 1.85rem; }
  .workspace-illustration, .feature-list, .welcome-caption { display: none; }
  .welcome-description { max-width: none; font-size: .85rem; }
  .eyebrow { margin-bottom: 1rem; }
}

@media (max-width: 420px) {
  .signin-panel, .welcome-panel { padding: 1.5rem; }
  .welcome-panel h1 { font-size: 1.6rem; }
  .signin-heading h2 { font-size: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
