:root { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #17202a; background: #f4f7f6; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 28px; color: white; background: #0f5b4f; box-shadow: 0 2px 10px rgba(16,60,50,.10); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 750; font-size: 1.05rem; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.17); }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 56px; }
.container.wide-container { width: min(1540px, calc(100% - 32px)); }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1 { margin: 0 0 8px; font-size: clamp(1.55rem, 4vw, 2.25rem); }
h2 { margin: 0 0 10px; font-size: 1.25rem; }
p { line-height: 1.55; }
.muted { color: #64726f; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 16px; }
.card { border: 1px solid #dce6e2; border-radius: 18px; background: white; box-shadow: 0 8px 26px rgba(16,60,50,.06); }
.patient-card { padding: 20px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.patient-card-link { display: block; color: inherit; text-decoration: none; }
.patient-card-link:focus-visible { outline: 3px solid rgba(22,132,111,.35); outline-offset: 3px; }
.patient-card:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(16,60,50,.11); }
.patient-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.patient-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.patient-demographics { display: inline-flex; align-items: center; gap: 5px; color: #64726f; font-size: .52em; font-weight: 600; }
.profile-chip { display: inline-flex; padding: 4px 7px; border: 1px solid #d7e5e0; border-radius: 7px; color: #34554d; background: #f3f8f6; white-space: nowrap; }
.badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: .75rem; background: #e8f6f1; color: #0f5b4f; }
.status-archived { background: #edf0ef; color: #53615e; }
.last-doc { margin-top: 18px; padding-top: 15px; border-top: 1px solid #edf1ef; }
.doc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.btn { border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 700; background: #0f5b4f; color: white; }
.btn:hover { filter: brightness(.96); }
.btn.secondary { color: #0f5b4f; background: #e6f2ee; }
.btn.danger { color: #fff; background: #a82c2c; }
.btn.danger-outline { color: #9f2929; background: #fff4f3; border: 1px solid #e8b7b4; }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn.ghost { color: inherit; background: transparent; border: 1px solid rgba(255,255,255,.4); }
.btn.full { width: 100%; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top right, #d9f2e9, transparent 45%), #f4f7f6; }
.login-card { width: min(440px, 100%); padding: 30px; }
.login-logo { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; color: white; background: #0f5b4f; font-size: 1.5rem; }
.field { display: grid; gap: 7px; margin: 16px 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 10px 0; }
.checkbox-grid label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #dce6e2; border-radius: 10px; }
label { font-weight: 700; font-size: .91rem; }
input, select, textarea { width: 100%; padding: 12px 13px; border: 1px solid #cbd8d3; border-radius: 11px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(22,132,111,.15); border-color: #16846f; }
.notice { padding: 12px 14px; border-radius: 11px; background: #eef7f4; color: #34554d; font-size: .88rem; }
.privacy-summary { margin: 18px 0; padding: 14px; border: 1px solid #cfe2dc; border-radius: 12px; background: #f2f9f6; font-size: .88rem; }
.privacy-summary p { margin: 7px 0; }
.text-button { padding: 0; border: 0; color: #0f5b4f; background: transparent; font-weight: 750; text-decoration: underline; }
.privacy-controls { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; padding: 22px; }
.privacy-controls .eyebrow { margin-top: 0; }
.privacy-controls p:last-child { margin-bottom: 0; }
.privacy-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; line-height: 1.5; }
.consent-check input { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 2px; accent-color: #0f5b4f; }
.privacy-list { padding-left: 20px; line-height: 1.6; }
.breach-notice { margin: 20px 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.back { color: #0f5b4f; text-decoration: none; font-weight: 750; }
.card-link { display: inline-block; margin-top: 18px; color: #0f5b4f; font-weight: 750; font-size: .9rem; }
.patient-card-actions { display: flex; align-items: center; gap: 9px; margin-top: 18px; }
.patient-card-actions .btn { flex: 1; padding: 9px 12px; text-align: center; text-decoration: none; }
.documents { display: grid; gap: 10px; }
.document-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 15px 17px; }
.document-row.archived-document { border-color: #cfd6d3; background: #eef1f0; }
.archived-document .document-details { opacity: .58; filter: grayscale(.45); }
.row-actions, .danger-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 34px; padding: 22px; border-color: #ecc5c2; }
.danger-zone .eyebrow { margin: 0 0 6px; color: #a82c2c; }
.danger-zone p:last-child { margin-bottom: 0; }
.warning { margin: 16px 0; padding: 12px 14px; border-radius: 11px; color: #712020; background: #fff0ef; border: 1px solid #efcac7; }
.empty { padding: 36px; text-align: center; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(9,30,25,.48); }
.modal-card { width: min(500px, 100%); padding: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; max-width: 360px; padding: 13px 16px; border-radius: 12px; color: white; background: #26332f; box-shadow: 0 10px 28px rgba(0,0,0,.2); }
.spinner { width: 34px; height: 34px; border: 4px solid #d8e8e2; border-top-color: #0f5b4f; border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
.spinner.compact { margin: 34px auto; }
.loading-copy { margin-top: -44px; text-align: center; color: #64726f; }
.loading-copy.compact-copy { margin-top: -22px; }
.trend-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 320px); gap: 28px; align-items: end; margin-bottom: 24px; }
.eyebrow { margin: 24px 0 7px; color: #16846f; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.marker-picker { margin: 0; }
.trend-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.stat-card { display: grid; gap: 7px; padding: 18px 20px; }
.stat-card strong { font-size: clamp(1.35rem, 4vw, 1.85rem); color: #173d35; }
.stat-card strong small { font-size: .74rem; }
.stat-label { color: #64726f; font-size: .82rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.value-up { color: #9a4d16 !important; }
.value-down { color: #16624e !important; }
.chart-card { padding: 20px; overflow: hidden; }
.chart-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.chart-heading p { margin: 0; }
.category-label { display: block; margin-bottom: 5px; color: #16846f; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.range-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; color: #34554d; background: #eef7f4; font-size: .78rem; font-weight: 700; }
.chart-scroll { width: 100%; overflow-x: auto; }
.trend-chart { display: block; width: 100%; min-width: 620px; height: auto; }
.grid-line { stroke: #e7eeeb; stroke-width: 1; }
.axis-label { fill: #71807c; font-size: 11px; }
.chart-line { fill: none; stroke: #0f6d5d; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: #fff; stroke: #0f6d5d; stroke-width: 3; }
.results-card { margin-top: 14px; padding: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid #e8efec; text-align: left; white-space: nowrap; }
th { color: #64726f; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
td small { display: block; margin-top: 3px; color: #7d8986; }
.table-link { color: #0f5b4f; font-weight: 750; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.marker-table { max-height: min(55vh, 520px); }
.marker-review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.marker-review-toolbar p { margin: 0; }
.document-review-page { display: grid; gap: 16px; }
.document-review-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.document-review-nav .back { margin: 0; }
.review-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.review-heading > div { min-width: 0; }
.review-heading h1 { overflow-wrap: anywhere; }
.review-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.archived-review-copy { margin: 8px 0 0; color: #697672; }
.archived-review .review-controls, .archived-review .marker-editor-panel { background: #f4f6f5; }
.document-nav { display: flex; gap: 8px; }
.btn.disabled { pointer-events: none; cursor: not-allowed; opacity: .48; }
.review-controls { padding: 16px 18px; }
.review-controls-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.review-date-field { display: grid; grid-template-columns: auto minmax(170px, 220px); align-items: center; gap: 7px 12px; }
.review-date-field small { grid-column: 1 / -1; }
.review-control-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.review-completed-control { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 750; white-space: nowrap; }
.review-completed-control input { width: 18px; height: 18px; margin: 0; accent-color: #0f6d5d; }
.document-review-layout { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(620px, 1.2fr); gap: 16px; align-items: start; }
.document-preview-panel, .marker-editor-panel { min-width: 0; padding: 18px; }
.panel-heading p { margin: 0 0 12px; }
.document-preview { display: block; width: 100%; height: min(72vh, 900px); border: 1px solid #dce6e2; border-radius: 12px; background: #f7faf9; }
.marker-editor-panel { overflow: hidden; }
.marker-grid-wrap { max-height: min(65vh, 760px); border: 1px solid #e2ebe7; border-radius: 12px; }
.marker-grid { min-width: 1040px; }
.marker-grid th, .marker-grid td { padding: 8px; }
.marker-grid th { position: sticky; top: 0; z-index: 1; background: #f7faf9; }
.marker-grid input, .marker-grid select { min-width: 92px; padding: 9px 10px; border-radius: 8px; }
.marker-grid td:first-child select { min-width: 190px; }
.marker-grid td:nth-child(3) input, .marker-grid td:nth-child(7) input { min-width: 150px; }
.prescription-grid { min-width: 1120px; }
.prescription-grid th:first-child, .prescription-grid td:first-child { width: 22%; }
.prescription-grid input { width: 100%; min-width: 115px; }
.prescription-grid td:first-child input { min-width: 210px; }
.add-row-button { width: 100%; margin-top: 10px; padding: 11px; border: 1px dashed #9dbbb2; border-radius: 10px; color: #0f5b4f; background: #f4faf8; font-weight: 750; }
.add-row-button span { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 5px; border-radius: 50%; color: white; background: #0f5b4f; }
.marker-grid-note { margin: 10px 2px 0; font-size: .84rem; }
.abnormal-value { color: #9f2929; font-weight: 850; }
.compact-empty { padding: 22px 12px; }
.chart-disclaimer { margin: 14px 4px 0; color: #71807c; font-size: .82rem; }
.admin-hero { align-items: center; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.admin-section { margin-top: 18px; padding: 22px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading p { margin: 0; }
.bulk-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; white-space: nowrap; }
.selection-cell { width: 32px; min-width: 32px; padding-right: 4px; }
.selection-cell input { width: 18px; height: 18px; margin: 0; accent-color: #0f5b4f; }
.bulk-edit-field { display: grid; gap: 7px; margin: 15px 0; }
.bulk-field-toggle { display: flex; align-items: center; gap: 8px; }
.bulk-field-toggle input { width: 17px; height: 17px; margin: 0; accent-color: #0f5b4f; }
.bulk-edit-field > input:disabled, .bulk-edit-field > select:disabled, .bulk-edit-field > textarea:disabled { color: #84918d; background: #f1f4f3; }
.admin-table td { vertical-align: middle; }
.admin-table td:first-child { max-width: 260px; white-space: normal; }
.admin-document-name { width: 260px; max-width: 260px; }
.admin-document-link { display: block; max-width: 100%; color: #0f5b4f; font-weight: 750; white-space: normal; overflow-wrap: anywhere; word-break: break-word; text-decoration: none; }
.admin-document-link:hover { text-decoration: underline; }
.admin-table code { padding: 4px 7px; border-radius: 7px; color: #17483e; background: #edf5f2; }
.compact-btn { padding: 8px 11px; font-size: .82rem; text-decoration: none; }
.aliases-cell { min-width: 220px; max-width: 380px; white-space: normal; }
.alias-chip { display: inline-flex; margin: 2px 1px; padding: 3px 7px; border-radius: 999px; color: #405e56; background: #edf5f2; font-size: .76rem; }
.inactive-row { opacity: .62; background: #f7f8f8; }
.archived-row { background: #f7f8f8; }
.archived-copy { display: block; margin-top: 6px; color: #697672; }
.document-browser { overflow: hidden; }
.document-browser .documents { padding: 18px; background: #f8faf9; }
.document-browser .document-row { box-shadow: none; }
.profile-tabs { display: flex; gap: 2px; margin: 0; padding: 0 16px; overflow-x: auto; border-bottom: 1px solid #dce6e2; background: white; }
.profile-tab { flex: 0 0 auto; margin-bottom: -1px; padding: 14px 16px 12px; border: 0; border-bottom: 3px solid transparent; color: #587069; background: transparent; font-weight: 750; }
.profile-tab:hover { color: #0f5b4f; background: #f5f9f7; }
.profile-tab.active { color: #0f5b4f; border-bottom-color: #0f5b4f; background: white; }
.patient-profile-workspace { overflow: hidden; }
.profile-tab-panel { padding: 22px; }
.profile-tab-panel[hidden] { display: none; }
.patient-information-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0; }
.patient-information-grid > div { min-width: 0; padding: 16px; border: 1px solid #e3ebe8; border-radius: 12px; background: #f8fbfa; }
.patient-information-grid dt { margin-bottom: 6px; color: #64726f; font-size: .78rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.patient-information-grid dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.document-workspace { display: grid; grid-template-columns: minmax(500px, 1.08fr) minmax(340px, .92fr); gap: 16px; align-items: start; }
.patient-document-table { table-layout: fixed; min-width: 720px; }
.patient-document-table th:nth-child(1) { width: 128px; }
.patient-document-table th:nth-child(2) { width: 125px; }
.patient-document-table th:nth-child(4) { width: 125px; }
.patient-document-table th:nth-child(5) { width: 175px; }
.patient-document-table td { vertical-align: top; }
.patient-document-name { white-space: normal; }
.patient-document-name .table-link { display: block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.table-link.selected { text-decoration: underline; text-decoration-thickness: 2px; }
.profile-document-viewer { min-width: 0; padding: 12px; border: 1px solid #dce6e2; border-radius: 14px; background: #f7faf9; }
.profile-preview-heading { display: grid; gap: 3px; min-width: 0; margin: 0 2px 10px; }
.profile-preview-heading strong { overflow-wrap: anywhere; }
.profile-document-viewer iframe { display: block; width: 100%; height: min(65vh, 760px); border: 1px solid #dce6e2; border-radius: 10px; background: white; }
.prescription-preview-data { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #dce6e2; }
.prescription-preview-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 2px 2px 10px; }
.prescription-preview-heading h3 { margin: 0; font-size: 1rem; }
.prescription-preview-table { max-height: 300px; border: 1px solid #e3ebe8; border-radius: 10px; background: white; }
.prescription-preview-table table { min-width: 680px; }
.prescription-preview-table th, .prescription-preview-table td { padding: 9px 10px; font-size: .82rem; }
.prescription-preview-empty { padding: 14px; border: 1px solid #e3ebe8; border-radius: 10px; background: white; }
.prescription-preview-empty p { margin: 0; }
.profile-trends, .prescription-documents { margin-top: 28px; padding-top: 24px; border-top: 1px solid #e3ebe8; }
.profile-trends { scroll-margin-top: 92px; }
.profile-trends:focus { outline: none; }
.test-trends-link { flex: 0 0 auto; padding: 8px 0; white-space: nowrap; }
.profile-trends .section-heading { align-items: end; }
.profile-trends .marker-picker { min-width: 250px; }
.medication-table { min-width: 900px; }
.medication-table td { vertical-align: top; }
.medication-comment { min-width: 180px; max-width: 300px; white-space: normal; overflow-wrap: anywhere; }
.medication-review-warning { margin: 0 0 14px; padding: 13px 15px; border: 1px solid #e2a7a3; border-radius: 11px; color: #8d2424; background: #fff0ef; }
.medication-needs-confirmation { background: #fff7f6; }
.medication-confirm-copy { max-width: 240px; color: #a12d2d; white-space: normal; }
.medication-history { margin-top: 18px; padding: 14px 16px; border: 1px solid #dce6e2; border-radius: 12px; }
.medication-history summary { cursor: pointer; color: #0f5b4f; font-weight: 750; }
.medication-history[open] summary { margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .trend-hero { grid-template-columns: 1fr; gap: 16px; } .trend-stats, .admin-stats { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .document-review-layout, .document-workspace { grid-template-columns: 1fr; } .document-preview { height: 55vh; } .profile-document-viewer iframe { height: 55vh; } }
@media (max-width: 640px) { .topbar { padding: 14px 16px; } .container, .container.wide-container { width: min(100% - 22px, 1120px); padding-top: 20px; } .hero, .danger-zone, .section-heading, .marker-review-toolbar, .review-heading, .review-controls-row, .document-review-nav { align-items: stretch; flex-direction: column; } .document-nav { display: grid; grid-template-columns: 1fr 1fr; } .document-nav .btn { text-align: center; } .hero-actions, .danger-actions, .bulk-actions, .review-control-actions { justify-content: stretch; } .hero-actions .btn, .danger-actions .btn, .bulk-actions .btn, .marker-review-toolbar .btn, .review-control-actions .btn { flex: 1; text-align: center; } .review-date-field { grid-template-columns: 1fr; } .review-date-field small { grid-column: auto; } .document-row { grid-template-columns: 1fr; } .document-row .btn, .row-actions .btn { flex: 1; text-align: center; } .chart-card, .results-card { padding: 16px; } .chart-heading { flex-direction: column; } .form-grid { grid-template-columns: 1fr; gap: 0; } }

/* Doctor workspace */
.doctor-hero { border-left: 4px solid #138579; padding-left: 20px; }
.doctor-roster { margin-top: 24px; }
.doctor-filters { display: flex; gap: 16px; margin: 20px 0; flex-wrap: wrap; }
.doctor-filters .field:first-child { flex: 1; min-width: 220px; }
.doctor-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.doctor-dialog { width: min(540px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; border: 0; padding: 28px; }
.doctor-dialog::backdrop { background: rgb(15 30 45 / 55%); }
.doctor-dialog textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid #ccd5df; border-radius: 8px; }
.doctor-dialog form { margin-top: 18px; }

.portal-invitation-action { margin-top: 16px; padding-top: 12px; border-top: 1px solid #dde5e9; }
.doctor-provided-information { margin-top: 24px; }
.doctor-provided-information > .card { margin: 16px 0; padding: 22px; }
.invitation-consent { margin-top: 24px; padding: 22px; }
.invitation-consent form { margin-top: 20px; }

#invite-message:empty { display: none; }

.processing-comparison { min-width: 0; padding: 18px; overflow-wrap: anywhere; }
.processing-comparison > .panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.processing-comparison > .panel-heading > .btn { flex-shrink: 0; }
.comparison-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 650px; }
.comparison-table th, .comparison-table td { padding: .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border, #ddd); overflow-wrap: anywhere; }
.comparison-table th:first-child { width: 24%; }
.processing-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (max-width: 650px) { .processing-choice-grid { grid-template-columns: 1fr; } .processing-comparison > .panel-heading { flex-direction: column; } }

.latest-report-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; margin-bottom: 32px; align-items: start; }
.latest-report-panel, .latest-report-layout .profile-trends { min-width: 0; }
.latest-report-layout .profile-trends { margin-top: 0; padding-top: 0; border-top: 0; }
.latest-report-table { width: 100%; }
.latest-report-table th, .latest-report-table td { padding: 12px 10px; text-align: left; overflow-wrap: anywhere; }
.latest-report-table tbody th { font-weight: 600; text-transform: none; }
.latest-result-abnormal { color: #a43c22; }
.latest-report-layout .marker-picker { min-width: 0; max-width: 100%; }
.latest-report-layout .section-heading { flex-wrap: wrap; }
@media (max-width: 900px) { .latest-report-layout { grid-template-columns: minmax(0, 1fr); } }

/* Compact patient portal */
.container { width: min(1200px, calc(100% - 48px)); }
h1 { font-size: 28px; } h2 { font-size: 19px; }
.card { border-radius: 12px; box-shadow: none; }
.hero { align-items: center; margin-bottom: 20px; }
.hero p { margin: 4px 0 0; }
.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.patient-card { padding: 16px; min-width: 0; }
.patient-head .badge:empty { display: none; }
.patient-card h2 { margin: 0; font-size: 19px; }
.patient-card p { margin: 8px 0; }
.patient-demographics { font-size: 13px; }
.last-doc { margin-top: 12px; padding-top: 12px; }
.last-doc .badge { margin-left: 8px; }
.patient-card-actions { margin-top: 12px; }
.patient-card-actions .btn { flex: none; background: transparent; padding: 0; min-height: auto; }
.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
:focus-visible { outline: 3px solid #16846f; outline-offset: 3px; }
.patient-information-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.patient-information-grid > div { padding: 12px 0; border: 0; border-bottom: 1px solid #e3ebe8; border-radius: 0; background: transparent; }
.patient-information-grid dt { text-transform: none; font-size: 13px; }
.profile-tab-panel { padding: 20px; }
.document-workspace { display: block; }
.patient-document-table { min-width: 0; }
.patient-document-table th:nth-child(5) { width: 170px; }
.patient-document-table th:nth-child(2) { width: 120px; }
.patient-document-name .table-link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latest-report-layout { display: flex; flex-direction: column-reverse; gap: 24px; margin: 24px 0 0; }
.latest-report-layout > section { width: 100%; }
.latest-report-panel .muted { overflow-wrap: anywhere; }
.trend-stats { gap: 12px; }
.stat-card { padding: 12px; }
.stat-card strong { font-size: 22px; }
.stat-label { text-transform: none; letter-spacing: 0; }
.trend-chart { min-width: 0; }
.compact-empty { padding: 16px; }
.compact-empty p { margin: 0; }
.action-menu { position: relative; }
.action-menu summary { cursor: pointer; list-style: none; }
.action-menu[open] > button { position: absolute; right: 0; top: 48px; z-index: 5; width: 170px; box-shadow: 0 4px 16px #173d3520; }
dialog.modal { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border: 0; color: inherit; overflow: auto; }
dialog.modal::backdrop { background: transparent; }
.modal-card { max-height: calc(100dvh - 40px); overflow-y: auto; }
.preview-drawer { justify-items: end; padding: 0; }
.preview-drawer .modal-card { width: min(760px, 100%); height: 100dvh; max-height: none; border-radius: 0; }
.preview-drawer h2, .preview-drawer p { overflow-wrap: anywhere; }
.upload-file { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin: 8px 0; }
.upload-file > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file > small:last-child { grid-column: 1 / -1; }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .container, .container.wide-container { width: calc(100% - 32px); }
  .grid, .patient-information-grid { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 24px; }
  .btn, .profile-tab { min-height: 44px; }
  input, select, textarea { font-size: 16px; }
  .profile-tabs { padding: 0 4px; } .profile-tab { padding: 12px; }
  .profile-tab-panel { padding: 16px; }
  .profile-trends .marker-picker { min-width: 0; width: 100%; }
  .patient-document-table, .patient-document-table tbody { display: block; width: 100%; }
  .patient-document-table thead { display: none; }
  .patient-document-table tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px 0; border-bottom: 1px solid #dce6e2; }
  .patient-document-table td { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; padding: 4px 0; border: 0; white-space: normal; min-width: 0; }
  .patient-document-table td::before { content: attr(data-label); color: #64726f; font-size: 13px; }
  .patient-document-table .row-actions { justify-content: start; }
  .trend-stats { grid-template-columns: minmax(0, 1fr); }
  .modal { padding: 16px; } .modal-card { padding: 20px; }
  .preview-drawer { padding: 0; }
  .privacy-controls { flex-direction: column; align-items: stretch; padding: 16px; gap: 12px; }
  .topbar { flex-wrap: wrap; }
}
.single-measurement .trend-stats { grid-template-columns: 1fr; margin-bottom: 8px; }
.single-measurement .stat-card { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; border: 0; padding: 0; }
.single-measurement .stat-card:not(:first-child), .single-measurement .chart-heading { display: none; }
.single-measurement .chart-card { border: 0; padding: 0; }
.single-measurement .chart-card .notice { margin: 8px 0; }
.patient-document-table th:nth-child(5) { width: 190px; }
.latest-report-panel .section-heading .muted { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest-report-panel .section-heading > div { min-width: 0; }
.patient-document-name::before { content: 'Document'; }
@media (min-width: 641px) { .patient-document-name::before { display: none; } }

.pending-patient-form { min-width: 0; overflow-wrap: anywhere; padding: 16px 0; border-bottom: 1px solid #dce6e2; margin-bottom: 16px; }
.pending-patient-form [hidden] { display: none !important; }
.pending-patient-form input[type="checkbox"] { width: auto; }

.tracked-marker-trends { margin-bottom: 28px; }
.tracked-markers-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.tracked-markers-heading h2 { margin: 0; }
.tracked-marker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tracked-marker-grid .chart-card { min-width: 0; padding: 14px; }
.tracked-marker-grid h3 { margin: 0 0 8px; overflow-wrap: anywhere; }
.tracked-marker-grid .muted, .tracked-marker-grid .notice { font-size: 13px; }
.tracked-marker-grid .trend-chart { min-width: 0; width: 100%; max-height: 180px; }
@media (max-width: 767px) {
  .tracked-marker-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Keep customer values readable in the marker table, including on small screens. */
.marker-edit-dialog { width: min(960px, 100%); }
.user-marker-table { width: 100%; min-width: 620px; table-layout: fixed; }
.user-marker-table th:first-child { width: 36%; }
.user-marker-table th:nth-child(2) { width: 28%; }
.user-marker-table th:nth-child(3) { width: 28%; }
.user-marker-table th:nth-child(4) { width: 8%; }
.user-marker-table th, .user-marker-table td { white-space: normal; overflow-wrap: anywhere; }
.user-marker-table td { vertical-align: top; }
.user-marker-table td:first-child small { display: block; margin-top: 4px; }
.user-marker-table .field { min-width: 0; margin: 12px 0; }
.user-marker-table input, .user-marker-table textarea { min-width: 0; font-size: 16px; color: #173d35; }
.user-marker-table textarea { display: block; line-height: 1.5; resize: vertical; overflow-wrap: anywhere; }
.user-marker-reference summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.user-marker-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.user-marker-save { position: sticky; bottom: 0; margin-top: 16px; padding: 12px 0; background: #fff; }

.modal-close-bar { position: sticky; top: -24px; z-index: 10; display: flex; justify-content: flex-end; padding: 8px 0; margin-top: -16px; background: #fff; }
.modal-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #cbd8d3; border-radius: 11px; background: #fff; color: #173d35; font-size: 30px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: #e6f2ee; }
.modal-close:focus-visible { outline: 3px solid #16846f; outline-offset: 2px; }
@media (max-width: 640px) { .modal-close-bar { top: -20px; } }

.tracked-marker-history { width: 100%; min-width: 0; margin-top: 12px; font-size: 13px; }
.tracked-marker-history th, .tracked-marker-history td { padding: 6px 8px; }
.tracked-marker-history th:last-child, .tracked-marker-history td:last-child { text-align: right; }

.chart-dot[data-trend-point] { cursor: pointer; pointer-events: all; }
.chart-dot[data-trend-point]:focus, .chart-dot[aria-pressed="true"] { fill: #0f6d5d; stroke: #fff; outline: none; filter: drop-shadow(0 0 2px #0f6d5d); }
.trend-point-tooltip { position: fixed; z-index: 1000; display: grid; gap: 2px; max-width: calc(100vw - 16px); padding: 6px 9px; border: 1px solid #d5e3dc; border-radius: 6px; background: #fff; color: #173d35; box-shadow: 0 2px 8px #173d3526; font-size: 12px; line-height: 1.3; pointer-events: none; }
.trend-point-tooltip span { color: #64726f; }

.test-results-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.compact-test-documents, .test-results-columns .latest-report-layout { min-width: 0; margin: 0; }
.compact-test-documents h3 { margin: 0 0 12px; }
.compact-doc-scroll { max-height: 540px; overflow: auto; border: 1px solid #e3ebe8; border-radius: 8px; }
.compact-doc-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 13px; }
.compact-doc-table thead { position: sticky; top: 0; z-index: 1; background: #f4f8f6; }
.compact-doc-table thead tr { height: 36px; }
.compact-doc-table tbody tr { height: 56px; }
.compact-doc-table th, .compact-doc-table td { padding: 8px; }
.compact-doc-table th:first-child { width: 100px; }
.compact-doc-table th:last-child { width: 112px; }
.compact-doc-table .table-link { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-doc-actions { display: flex; gap: 4px; }
.doc-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 30px; padding: 4px; border: 1px solid #dce6e2; border-radius: 5px; background: #fff; color: #34554d; cursor: pointer; }
.doc-icon:hover { background: #eef7f4; }
.doc-icon.danger-outline { color: #a33232; }
.test-results-columns .profile-trends { height: 574px; display: flex; flex-direction: column; }
.test-results-columns .profile-trends > .section-heading { margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
.test-results-columns .profile-trends h2 { font-size: 18px; }
.test-results-columns .profile-trends .section-heading p { display: none; }
.test-results-columns .profile-trends .marker-picker { min-width: 0; max-width: 100%; margin: 0; }
.test-results-columns #profile-trend-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.test-results-columns .trend-stats { display: none; }
.test-results-columns .chart-card { padding: 10px; flex: none; }
.test-results-columns .chart-heading { margin: 0; }
.test-results-columns .chart-heading .category-label, .test-results-columns .chart-heading p { display: none; }
.test-results-columns .chart-heading h2 { font-size: 16px; margin: 0; }
.test-results-columns .trend-chart { min-width: 0; max-height: 180px; }
.test-results-columns .results-card { padding: 10px; display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.test-results-columns .results-card h2 { font-size: 16px; margin: 0 0 6px; }
.test-results-columns .results-card .table-wrap { overflow: auto; flex: 1; min-height: 0; }
.test-results-columns .results-card table { min-width: 400px; font-size: 12px; }
.test-results-columns .results-card th, .test-results-columns .results-card td { padding: 8px; }
.test-results-columns .results-card thead { position: sticky; top: 0; background: #f4f8f6; }
.test-results-columns .chart-disclaimer { font-size: 11px; margin: 6px 0 0; }
#profile-panel-test-results > .latest-report-panel { margin-top: 24px; }
#profile-panel-test-results > .latest-report-panel > .table-wrap { max-height: 280px; overflow: auto; }
@media (max-width: 900px) { .test-results-columns { grid-template-columns: minmax(0, 1fr); } }

/* Only the table scrolls; marker controls and dialog actions remain in view. */
.marker-edit-dialog { display: flex; flex-direction: column; height: min(820px, calc(100dvh - 40px)); overflow: hidden; }
.marker-edit-dialog > .modal-close-bar { position: static; flex: none; }
.marker-edit-dialog > h2 { flex: none; margin: 0 0 12px; font-size: 20px; }
.marker-edit-dialog > #document-marker-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#user-marker-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.user-marker-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 0 12px; flex: none; }
.user-marker-toolbar select { flex: 1; min-width: 140px; width: auto; }
.user-marker-scroll { flex: 1; min-height: 0; overflow: auto; }
.user-marker-scroll thead { position: sticky; top: 0; z-index: 1; background: #fff; }
.marker-edit-dialog > .modal-actions { flex: none; padding-top: 12px; margin-top: 0; flex-wrap: wrap; border-top: 1px solid #dce6e2; }

.user-marker-toolbar #add-user-marker-value { flex: 1; min-width: 120px; width: auto; }
.user-marker-table th:first-child { width: 25%; }
.user-marker-table th:nth-child(2) { width: 38%; }
.user-marker-table th:nth-child(3) { width: 29%; }
.user-marker-table th:last-child { width: 8%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Compact latest results on home page patient cards. */
.patient-marker-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid #e3ebe8; }
.patient-marker-summary > div { min-width: 0; }
.patient-marker-summary dt { font-size: 11px; line-height: 1.3; color: #64746f; overflow-wrap: anywhere; }
.patient-marker-summary dd { margin: 3px 0 2px; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.patient-marker-summary dd strong { font-size: 14px; }
.patient-marker-summary .patient-marker-unit, .patient-marker-summary small { font-size: 10px; line-height: 1.3; }

.user-marker-table textarea[data-marker-value] { width: var(--value-width, 8ch); max-width: 100%; min-height: 42px; padding: 8px 10px; overflow-y: hidden; resize: vertical; }
.user-marker-table td:first-child strong { display: block; white-space: normal; overflow-wrap: anywhere; }
.user-marker-table summary { white-space: normal; }

.chart-line { stroke: #000; }
.chart-dot.chart-dot-abnormal { fill: #fff; stroke: #dc2626; }
.chart-dot.chart-dot-abnormal:focus, .chart-dot.chart-dot-abnormal[aria-pressed="true"] { fill: #fff; stroke: #dc2626; filter: drop-shadow(0 0 2px #dc2626); }
.test-results-columns .profile-trends .timeline-picker { min-width: 130px; margin: 0; }

.health-trend-filters { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.test-results-columns .health-trend-filters .marker-picker { flex: 1; min-width: 0; width: auto; }
.test-results-columns .health-trend-filters .timeline-picker { flex: 0 0 140px; min-width: 0; }
.health-trend-filters select { width: 100%; min-width: 0; }
@media (max-width: 400px) { .test-results-columns .health-trend-filters .timeline-picker { flex-basis: 125px; } }

.prescription-edit-dialog { width: min(1200px, 100%); }
.prescription-edit-dialog .prescription-grid { min-width: 900px; }
.prescription-edit-dialog .prescription-grid input { min-width: 80px; }
.prescription-edit-dialog .prescription-grid td:first-child input { min-width: 170px; }

/* Patient-grouped reminders share the portal's compact cards and green accents. */
.container.reminders-container { width: min(880px, calc(100% - 32px)); }
.reminders-container .hero { align-items: center; }
.reminders-container .hero .eyebrow { margin-top: 0; }
.reminders-container .hero p { margin-bottom: 0; }
.reminder-filters { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 14px; }
.reminder-filters .field { margin: 0; }
.reminder-groups { display: grid; gap: 18px; }
.reminder-patient { overflow: hidden; }
.reminder-patient-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: #f8fbfa; border-bottom: 1px solid #e3ebe8; }
.reminder-patient-heading a { font-size: 1.05rem; font-weight: 750; color: #0f5b4f; text-decoration: none; overflow-wrap: anywhere; }
.reminder-patient-heading p { margin: 4px 0 0; font-size: .875rem; }
.reminder-patient-heading .btn { flex-shrink: 0; }
.reminder-item { padding: 16px 20px; min-width: 0; overflow-wrap: anywhere; }
.reminder-item + .reminder-item { border-top: 1px solid #e3ebe8; }
.reminder-item-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.reminder-item h3 { margin: 0; font-size: 1rem; }
.reminder-item .badge { text-transform: capitalize; flex-shrink: 0; }
.reminder-overdue { background: #fff0e6; color: #9a4812; }
.reminder-meta { font-size: .875rem; color: #64726f; margin: 7px 0; }
.reminder-phone { color: #34554d; white-space: nowrap; }
.reminder-deliveries { font-size: .875rem; margin-top: 10px; }
.reminder-deliveries summary { cursor: pointer; color: #34554d; }
.reminder-deliveries ul { padding: 0; list-style: none; }
.reminder-deliveries li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #edf1ef; }
.reminder-deliveries li span:last-child { text-transform: capitalize; }
.reminder-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.reminder-actions .text-button { font-size: .875rem; }
.reminder-empty { padding: 0 20px; font-size: .875rem; }
.reminder-footnote { margin-top: 22px; font-size: .875rem; }
#patient-reminders { max-width: 840px; }
.reminder-list { border: 1px solid #e3ebe8; border-radius: 12px; }
#reminder-form .notice { margin-bottom: 0; }
.toolbar a[aria-current="page"] { background: rgba(255,255,255,.16); }
@media (max-width: 560px) {
  .reminder-filters { grid-template-columns: minmax(0, 1fr); }
  .reminders-container .hero { align-items: flex-start; flex-direction: column; gap: 14px; }
  .reminder-patient-heading, .reminder-item { padding: 14px; }
  .reminder-patient-heading { flex-wrap: wrap; }
}

.archive-patient-groups { display: grid; gap: 20px; }
.archive-patient-group { min-width: 0; border: 1px solid #e3ebe8; border-radius: 12px; overflow: hidden; }
.archive-patient-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; background: #f7faf9; }
.archive-patient-heading .eyebrow { margin: 0 0 4px; font-size: 10px; }
.archive-patient-heading h3 { margin: 0; font-size: 17px; }
.archive-patient-heading .badge { white-space: nowrap; }
.archive-patient-group .compact-doc-scroll { border: 0; border-top: 1px solid #e3ebe8; border-radius: 0; }
.archive-doc-table th, .archive-doc-table td { padding: 12px 16px; }
.archive-doc-table th:first-child { width: 120px; }
.archive-doc-table th:nth-child(3) { width: 108px; }
.archive-doc-table tbody tr:last-child td { border-bottom: 0; }
.archive-doc-table tbody tr:hover { background: #f7faf9; }
.archive-document-type { display: block; margin-top: 4px; color: #64726f; font-size: 12px; overflow-wrap: anywhere; }
.archive-doc-table .compact-doc-actions { justify-content: flex-end; gap: 6px; }
.archive-doc-table th:nth-child(3) { text-align: right; }
.archive-doc-table .doc-icon { width: 32px; height: 32px; border-radius: 7px; }
.doc-icon:focus-visible { outline: 3px solid #16846f; outline-offset: 2px; }
.doc-icon:disabled { opacity: .5; cursor: wait; }
.archive-empty > svg { width: 32px; height: 32px; color: #64726f; margin-bottom: 12px; }
@media (max-width: 640px) {
  .archive-patient-heading { padding: 14px; }
  .archive-doc-table th, .archive-doc-table td { padding: 10px 8px; }
  .archive-doc-table th:first-child { width: 86px; }
  .archive-doc-table th:nth-child(3) { width: 84px; }
  .archive-doc-table .table-link { white-space: normal; overflow-wrap: anywhere; }
}

.sharing-panel { padding: 24px; margin-bottom: 20px; }
.sharing-request { padding: 16px 0; border-bottom: 1px solid var(--border, #ddd); }
.sharing-request:last-child { border-bottom: 0; }
.sharing-request .btn { margin: 4px 8px 4px 0; }

.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.plan-card { padding: 28px; }
.plan-card ul { padding-left: 20px; line-height: 2; }
.current-plan { border: 2px solid var(--primary, #26705a); }
@media (max-width: 640px) { .plan-grid { grid-template-columns: 1fr; gap: 16px; } }

.chart-dot.chart-dot-in-range { fill: #fff; stroke: #0f6d5d; }
.chart-dot.chart-dot-no-reference { fill: #fff; stroke: #000; }
.chart-dot.chart-dot-in-range:focus, .chart-dot.chart-dot-in-range[aria-pressed="true"] { fill: #fff; stroke: #0f6d5d; filter: drop-shadow(0 0 2px #0f6d5d); }
.chart-dot.chart-dot-no-reference:focus, .chart-dot.chart-dot-no-reference[aria-pressed="true"] { fill: #fff; stroke: #000; filter: drop-shadow(0 0 2px #000); }

.pending-patient-documents { padding:24px; margin-bottom:24px; }
.assignment-heading,.assignment-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.assignment-heading .eyebrow { margin:0 0 8px; }
.assignment-heading h2 { margin:0; }
.assignment-list .pending-patient-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,320px); gap:12px 24px; padding:18px 0; margin:0; }
.assignment-document h3 { margin:0 0 6px; font-size:1rem; }
.assignment-document p { margin:0; font-size:.875rem; }
.assignment-suggestion { display:inline-block; margin-top:8px; font-size:.78rem; color:#127565; }
.assignment-new-patient,[data-assignment-error] { grid-column:1/-1; }
[data-assignment-error]:empty { display:none; }
.assignment-footer { padding-top:18px; }
@media(max-width:640px) { .assignment-list .pending-patient-form { grid-template-columns:1fr; } .assignment-footer { align-items:stretch; flex-direction:column; } }

/* Keep primary navigation visible; group account actions beneath the user icon. */
.primary-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.primary-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 15px; border-radius: 10px; color: #e1eee9; text-decoration: none; font-size: .9rem; font-weight: 600; white-space: nowrap; transition: background .15s ease; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: white; background: rgba(255,255,255,.13); }
.account-menu { position: relative; flex: none; }
.account-menu summary { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 60px; min-height: 44px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; cursor: pointer; list-style: none; background: rgba(255,255,255,.06); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { background: rgba(255,255,255,.15); }
.account-menu[open] .account-chevron { transform: rotate(180deg); }
.primary-nav a:focus-visible, .account-menu summary:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.account-dropdown { position: absolute; top: calc(100% + 12px); right: 0; width: 248px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid #dce6e2; border-radius: 16px; color: #17202a; background: white; box-shadow: 0 16px 48px rgba(16,60,50,.18); }
.account-menu-identity { display: grid; gap: 4px; margin-bottom: 5px; padding: 12px; border-bottom: 1px solid #edf1ef; overflow-wrap: anywhere; }
.account-menu-identity strong { font-size: .95rem; }
.account-menu-identity span { color: #64726f; font-size: .875rem; }
.account-menu-item { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 8px; color: #26463f; background: transparent; text-align: left; text-decoration: none; font-size: .9rem; font-weight: 550; }
.account-menu-item:hover, .account-menu-item[aria-current="page"] { background: #eef7f4; }
.account-menu-item:focus-visible { outline: 2px solid #16846f; outline-offset: -2px; }
.account-menu-divider { height: 1px; margin: 6px 4px; background: #edf1ef; }
.account-signout { color: #9f2929; }
.account-signout:hover { background: #fff4f3; }
@media (max-width: 640px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 12px 16px 10px; }
  .topbar .brand { font-size: 1rem; gap: 8px; }
  .account-menu { grid-column: 2; grid-row: 1; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; margin: 0; gap: 6px; }
  .primary-nav a { justify-content: center; flex: 1; padding: 10px 12px; }
}

/* Keep ten account rows visible while the rest scroll beneath the header. */
.admin-accounts { margin: 0 0 18px; }
.admin-accounts-scroll { max-height: 524px; overflow: auto; }
.admin-accounts-table { table-layout: fixed; min-width: 520px; }
.admin-accounts-table thead { position: sticky; top: 0; z-index: 1; background: #fff; }
.admin-accounts-table thead tr { height: 44px; }
.admin-accounts-table tbody tr { height: 48px; }
.admin-accounts-table th, .admin-accounts-table td { padding: 6px 12px; }
.admin-accounts-table td:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-accounts-table th:last-child { width: 96px; }
.admin-accounts-table .doc-icon { width: 32px; height: 32px; }
.admin-accounts-table .doc-icon:disabled { opacity: .55; cursor: default; }
#load-more-accounts { margin-top: 12px; }
#load-more-accounts[hidden] { display: none; }
@media (max-width: 640px) {
  .admin-accounts { padding: 18px 14px; }
  .admin-accounts-table { min-width: 0; font-size: .78rem; }
  .admin-accounts-table th, .admin-accounts-table td { padding: 6px 4px; }
  .admin-accounts-table th { font-size: .62rem; letter-spacing: 0; }
  .admin-accounts-table th:first-child { width: 23%; }
  .admin-accounts-table th:nth-child(2) { width: 33%; }
  .admin-accounts-table th:nth-child(3) { width: 20%; }
  .admin-accounts-table th:last-child { width: 24%; }
  .admin-accounts-table td:nth-child(2) { font-size: .72rem; }
  .admin-accounts-table .badge { padding: 4px 6px; font-size: .65rem; }
}

.admin-account-actions { display: flex; align-items: center; gap: 4px; }

.vitals-report-heading { border-bottom: 1px solid var(--line, #dce4e1); padding: 12px 0 20px; margin-bottom: 24px; }
.vitals-report-heading h2 { margin: 8px 0; }
.vitals-top-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.vitals-top-card { background: #f0f8f5; border: 1px solid #cde5dc; border-radius: 12px; padding: 20px; overflow-wrap: anywhere; }
.vitals-top-card h3 { margin: 0 0 16px; font-size: 1rem; }
.vitals-top-value { font-size: 1.45rem; margin: 0 0 12px; }
.vitals-value { font-weight: 400; font-size: calc(1em + 1px); }
.vitals-top-value .muted { font-size: .9rem; }
.vitals-reference { margin: 6px 0 10px; font-size: .85rem; }
.vitals-group .vitals-reference { margin-bottom: 0; font-size: inherit; }
.vitals-all { margin-top: 32px; }
.vitals-group { margin: 24px 0; }
.vitals-group h3 { color: #266955; padding: 12px 16px; background: #f0f8f5; border-radius: 8px; margin-bottom: 0; }
.vitals-group table { width: 100%; min-width: 0; table-layout: fixed; }
.vitals-group th, .vitals-group td { overflow-wrap: anywhere; white-space: normal; }
.vitals-group tbody th { font-weight: 500; text-transform: none; letter-spacing: normal; }
.vitals-report a { text-decoration: underline; text-underline-offset: 3px; }
#vitals-print { display: none; }
@media (max-width: 640px) {
  .vitals-top-grid { grid-template-columns: 1fr; gap: 10px; }
  .vitals-top-card { padding: 16px; }
  .vitals-top-card h3 { margin-bottom: 8px; }
  .vitals-group th, .vitals-group td { padding: 10px 6px; font-size: .8rem; }
}
@media print {
  @page { size: A4; margin: 16mm; }
  body.printing-vitals { background: white; color: #172d26; }
  body.printing-vitals > :not(#vitals-print) { display: none !important; }
  body.printing-vitals #vitals-print { display: block; font-size: 10pt; }
  #vitals-print .vitals-top-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #vitals-print .vitals-top-card { break-inside: avoid; padding: 12px; }
  #vitals-print .vitals-group h3 { break-after: avoid; }
  #vitals-print .table-wrap { overflow: visible; }
  #vitals-print thead { display: table-header-group; }
  #vitals-print tr { break-inside: avoid; }
  #vitals-print th, #vitals-print td { padding: 9px 6px; }
  #vitals-print a { color: #175944; }
  #vitals-print .chart-disclaimer { margin-top: 24px; }
}

.admin-tabs { border: 1px solid #dce6e2; border-radius: 14px; }
.admin-tab-panel[hidden] { display: none; }
.admin-tab-panel { min-width: 0; }
.feature-flag-card { padding: 18px 0; border-top: 1px solid #dce6e2; }
.feature-flag-card h3 { margin: 0; }
.feature-flag-audience { display: grid; gap: 12px; margin: 18px 0; }
.feature-flag-audience > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
.feature-flag-audience dt { font-weight: 700; }
.feature-flag-audience dd { margin: 0; color: #52655f; }
.feature-flag-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 18px; }
.feature-flag-toggle { display: inline-flex; align-items: center; gap: 10px; }
.feature-flag-toggle input[type="checkbox"] { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; padding: 0; accent-color: #0f5b4f; }
.feature-flag-card [data-flag-status]:empty { display: none; }
@media (max-width: 600px) {
  .feature-flag-audience > div { grid-template-columns: 1fr; gap: 4px; }
  .feature-flag-controls { align-items: flex-start; }
}
.feature-flag-customers { display: grid; gap: 12px; max-height: 280px; overflow-y: auto; padding: 12px; border: 1px solid #dce6e2; border-radius: 11px; }
.feature-flag-customers small { display: block; font-weight: 400; }
.feature-flag-customers span { overflow-wrap: anywhere; }

.concise-reminder-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.concise-reminder-form .field { min-width: 0; margin: 0; gap: 5px; }
.concise-reminder-form label { font-size: .875rem; }
.concise-reminder-form input, .concise-reminder-form select { min-width: 0; padding: 9px 10px; }
.concise-reminder-form .reminder-recipient-line { padding-top: 8px; }
.concise-reminder-form .reminder-full-field { grid-column: 1 / -1; }
.concise-reminder-form .reminder-recipient-line { margin: 0 0 10px; font-size: .875rem; }
.concise-reminder-form .reminder-message-preview { font-size: .875rem; }
.concise-reminder-form .reminder-message-preview summary { cursor: pointer; color: #34554d; }
.concise-reminder-form .reminder-message-preview .field { margin-top: 12px; }
.concise-reminder-form .consent-check { margin-top: 14px; font-size: .875rem; }
.concise-reminder-form .modal-actions { margin-top: 12px; }
.concise-reminder-form #reminder-error:empty { display: none; }
.feature-flag-card .section-heading { display: flex; flex-direction: row; align-items: center; }
.feature-flag-card .section-heading .badge { flex: 0 0 auto; }

.status-under_review { background: #fff2cc; color: #785600; }
