:root {
  color-scheme: light;
  --brand: #006b47;
  --brand-strong: #005238;
  --brand-deep: #073c2e;
  --brand-pale: #eaf5ef;
  --accent: #e53843;
  --accent-pale: #fff0f1;
  --ink: #163329;
  --muted: #687a73;
  --soft: #f4f6f3;
  --paper: #ffffff;
  --line: #dce5df;
  --line-strong: #cbd8d0;
  --danger: #a82f38;
  --warning: #845a16;
  --blue: #236d82;
  --blue-pale: #ecf5f7;
  --low: #1f69a8;
  --low-pale: #eef6fd;
  --high: #bd303c;
  --high-pale: #fff1f2;
  --shadow: 0 24px 70px rgba(20, 57, 44, .11);
  --shadow-soft: 0 10px 32px rgba(20, 57, 44, .065);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #eef1ed; }
body { margin: 0; min-width: 320px; background: #eef1ed; color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
.app-frame { width: min(100%, 1220px); min-height: 100vh; margin: 0 auto; background: #f7f8f6; box-shadow: 0 0 70px rgba(20,57,44,.075); }
.loading-shell { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-header { position: relative; z-index: 5; background: rgba(255,255,255,.94); border-top: 4px solid var(--brand); border-bottom: 1px solid var(--line); }
.header-inner { width: min(100%, 1100px); min-height: 78px; margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-identity { display: flex; align-items: center; gap: 15px; }
.brand-identity > div:last-child { display: grid; gap: 3px; }
.brand-identity strong { color: var(--brand-deep); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.brand-identity span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.brand-mark { position: relative; width: 68px; height: 42px; display: flex; align-items: center; color: var(--brand); }
.brand-mark span { position: relative; z-index: 1; color: var(--brand); font-size: 25px; font-weight: 950; letter-spacing: -.09em; }
.brand-mark i { position: absolute; top: 3px; right: 6px; width: 6px; height: 18px; background: var(--accent); border-radius: 1px; }
.brand-mark i::after { content: ''; position: absolute; top: 6px; left: -6px; width: 18px; height: 6px; background: var(--accent); border-radius: 1px; }
.trust-pill { min-height: 34px; display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.trust-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-pale); }
.trust-pill.is-verified { color: var(--brand); background: var(--brand-pale); border-color: #c5ded0; }

.page-content { width: min(100%, 1100px); margin: 0 auto; padding: 42px 22px 62px; }
.kicker { display: block; color: #7b8a84; font-size: 10px; line-height: 1.3; font-weight: 900; letter-spacing: .16em; }
.kicker-accent { color: #a9d7c5; }
.kicker-light { color: #b9ddd0; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { color: var(--brand-deep); letter-spacing: -.03em; }

.auth-page { min-height: calc(100vh - 188px); display: grid; align-items: center; }
.auth-layout { min-height: 570px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); }
.auth-intro { position: relative; overflow: hidden; padding: 58px; display: flex; flex-direction: column; justify-content: center; background: var(--brand-deep); color: #fff; }
.auth-intro::before { content: ''; position: absolute; right: -112px; top: -92px; width: 290px; height: 290px; border: 42px solid rgba(255,255,255,.045); border-radius: 50%; }
.auth-intro::after { content: ''; position: absolute; left: -90px; bottom: -150px; width: 270px; height: 270px; border: 34px solid rgba(255,255,255,.035); border-radius: 50%; }
.auth-intro > * { position: relative; z-index: 1; }
.auth-intro h1 { max-width: 500px; margin: 16px 0 18px; color: #fff; font-size: clamp(40px, 4.5vw, 57px); line-height: 1.04; font-weight: 750; }
.intro-copy { max-width: 520px; margin: 0; color: #c9dcd5; font-size: 15px; line-height: 1.7; }
.auth-steps { max-width: 530px; margin: 38px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; list-style: none; }
.auth-step { min-width: 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.16); }
.step-number { display: block; margin-bottom: 10px; color: #8fd0b8; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.auth-step strong { display: block; margin-bottom: 5px; color: #fff; font-size: 12px; }
.auth-step p { margin: 0; color: #a9c2b9; font-size: 10px; line-height: 1.55; }
.auth-card { padding: clamp(36px, 4vw, 58px); display: flex; flex-direction: column; justify-content: center; border: 0; background: #fff; }
.auth-card-heading h2 { margin: 9px 0 8px; font-size: 28px; }
.auth-card-heading p { margin: 0 0 26px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.phone-panel { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 16px; border: 1px solid #cce0d4; border-radius: 12px; background: #f1f7f3; }
.phone-symbol { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; background: #fff; color: var(--brand); font-weight: 950; letter-spacing: .05em; box-shadow: 0 3px 10px rgba(20,57,44,.07); }
.phone-panel > div { display: grid; gap: 3px; }
.phone-panel div span { color: var(--muted); font-size: 10px; }
.phone-panel strong { color: var(--brand-deep); font-size: 21px; letter-spacing: .04em; }
.privacy-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; padding: 12px 18px; font-weight: 800; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, .tab:focus-visible, .otp-input:focus-visible { outline: 3px solid rgba(0,107,71,.2); outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-primary { width: 100%; background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(0,107,71,.18); }
.button-primary:hover:not(:disabled) { background: var(--brand-strong); box-shadow: 0 10px 22px rgba(0,107,71,.23); }
.button-secondary { border: 1px solid var(--line-strong); background: #fff; color: var(--brand-deep); }
.button-quiet { width: 100%; min-height: 40px; margin-top: 3px; background: transparent; color: var(--brand); font-size: 12px; }
.button-compact { width: auto; min-height: 38px; padding: 8px 13px; border-radius: 8px; font-size: 11px; white-space: nowrap; }
.otp-field { margin-bottom: 14px; }
.otp-field label { display: block; margin-bottom: 8px; color: var(--brand-deep); font-size: 12px; font-weight: 800; }
.otp-input { width: 100%; height: 62px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--brand-deep); text-align: center; font-size: 26px; font-weight: 800; letter-spacing: .25em; }
.otp-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-pale); outline: 0; }
.otp-input::placeholder { color: #bbc8c1; font-size: 17px; letter-spacing: .13em; }
.field-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.notice { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; padding: 12px 13px; border-radius: 9px; font-size: 12px; line-height: 1.5; }
.notice-symbol { flex: 0 0 auto; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 900; }
.notice-info { border: 1px solid #bfdccf; background: var(--brand-pale); color: var(--brand); }
.notice-warning { border: 1px solid #e8d5a7; background: #fff9eb; color: var(--warning); }
.notice-error { border: 1px solid #e6c1c4; background: var(--accent-pale); color: var(--danger); }

.results-page { padding-top: 34px; }
.result-hero { min-height: 170px; margin-bottom: 18px; padding: 34px 38px; display: flex; align-items: center; justify-content: space-between; gap: 28px; overflow: hidden; position: relative; border-radius: 18px; background: var(--brand-deep); box-shadow: 0 16px 38px rgba(7,60,46,.14); }
.result-hero::before { content: ''; position: absolute; right: 22px; top: -86px; width: 220px; height: 220px; border: 30px solid rgba(255,255,255,.045); border-radius: 50%; }
.result-hero::after { content: '+'; position: absolute; right: 210px; bottom: -36px; color: rgba(255,255,255,.04); font-size: 170px; font-weight: 200; line-height: 1; }
.result-hero > * { position: relative; z-index: 1; }
.result-hero h1 { margin: 8px 0 7px; color: #fff; font-size: clamp(32px, 4vw, 43px); line-height: 1.08; font-weight: 720; }
.result-hero p { margin: 0; color: #c8dbd4; font-size: 12px; }
.verified-badge { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.17); border-radius: 9px; background: rgba(255,255,255,.075); color: #fff; }
.verified-badge > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--brand); font-weight: 900; }
.verified-badge div { display: grid; gap: 2px; }
.verified-badge strong { font-size: 11px; }
.verified-badge small { color: #b8d2c9; font-size: 9px; }
.surface { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-soft); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 16px; margin-bottom: 16px; }
.patient-card, .result-summary { padding: 22px 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.section-heading h2 { margin: 6px 0 0; font-size: 25px; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.section-heading.compact { align-items: center; }
.section-heading.compact h2 { font-size: 18px; }
.patient-grid { margin-top: 19px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px 27px; }
.patient-field { min-width: 0; display: grid; gap: 4px; }
.patient-field span { color: var(--muted); font-size: 10px; }
.patient-field strong { color: var(--brand-deep); font-size: 12px; overflow-wrap: anywhere; }
.result-summary { background: #f1f6f2; }
.result-summary h2 { margin: 6px 0 17px; font-size: 18px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid #d6e3db; border-radius: 9px; background: #d6e3db; }
.metric { min-width: 0; padding: 13px; background: #fff; }
.metric strong { display: block; margin-bottom: 3px; color: var(--brand); font-size: 24px; line-height: 1; }
.metric span { color: var(--muted); font-size: 9px; line-height: 1.3; }
.metric-blue strong { color: var(--blue); }
.metric-danger strong { color: var(--high); }
.generated-time { margin: 13px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.results-surface { overflow: hidden; }
.result-heading-main { padding: 24px 26px 19px; border-bottom: 1px solid #edf1ee; }
.tabs { display: flex; gap: 0; padding: 0 26px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tab { min-height: 49px; display: inline-flex; align-items: center; gap: 9px; border: 0; border-bottom: 2px solid transparent; padding: 11px 13px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }
.tab b { min-width: 21px; height: 21px; display: grid; place-items: center; padding: 0 5px; border-radius: 5px; background: #edf1ee; color: #708079; font-size: 9px; }
.tab.active { border-bottom-color: var(--brand); color: var(--brand); }
.tab.active b { background: var(--brand-pale); color: var(--brand); }
.tab-panel { padding: 22px 26px 27px; }
.lab-results, .lab-groups, .report-list { display: grid; gap: 14px; }
.lab-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; color: var(--muted); font-size: 9px; }
.lab-legend strong { margin-right: 2px; color: var(--ink); }
.lab-legend span, .lab-status { display: inline-flex; align-items: center; border-radius: 999px; font-weight: 850; white-space: nowrap; }
.lab-legend span { padding: 4px 7px; }
.legend-low, .lab-status-low { background: var(--low-pale); color: var(--low); }
.legend-high, .lab-status-high { background: var(--high-pale); color: var(--high); }
.legend-abnormal, .lab-status-abnormal { background: #fff5e7; color: #9b5b10; }
.lab-group { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.lab-group-heading { min-height: 61px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #f7f9f7; }
.lab-group-heading h3 { margin: 0 0 3px; font-size: 13px; line-height: 1.35; letter-spacing: -.01em; }
.lab-group-heading span { color: var(--muted); font-size: 9px; }
.count-badge { flex: 0 0 auto; min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: #fff; color: var(--brand) !important; font-weight: 900; border: 1px solid var(--line); }
.count-badge.has-alert { border-color: #edbdc1; background: var(--high-pale); color: var(--high) !important; }
.lab-wrap { overflow-x: auto; }
.lab-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lab-table th, .lab-table td { padding: 13px 15px; border-top: 1px solid #edf1ee; text-align: left; vertical-align: middle; }
.lab-table thead th { border-top: 0; background: #fff; color: #7d8c85; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.lab-table th:first-child, .lab-table td:first-child { width: 54%; }
.lab-table th:nth-child(2), .lab-table td:nth-child(2) { width: 23%; }
.lab-table th:nth-child(3), .lab-table td:nth-child(3) { width: 23%; }
.lab-table tbody tr:nth-child(even) { background: #fafbfa; }
.lab-table tbody tr:hover { background: #f4f8f5; }
.lab-table tbody tr.result-low { background: var(--low-pale); box-shadow: inset 4px 0 0 var(--low); }
.lab-table tbody tr.result-high { background: var(--high-pale); box-shadow: inset 4px 0 0 var(--high); }
.lab-table tbody tr.result-abnormal { background: #fff8ed; box-shadow: inset 4px 0 0 #b46a15; }
.analyte-name { color: var(--brand-deep); font-size: 12px; font-weight: 650; line-height: 1.4; }
.lab-value { color: #075f4b; font-size: 13px; font-weight: 900; }
.lab-value-number { display: block; font: inherit; }
.lab-status { width: fit-content; margin-top: 5px; padding: 3px 7px; font-size: 8px; line-height: 1.2; }
.result-low .lab-value-number { color: var(--low); }
.result-high .lab-value-number { color: var(--high); }
.result-abnormal .lab-value-number { color: #9b5b10; }
.reference-value { color: var(--muted); font-size: 11px; line-height: 1.4; }
.report-card { position: relative; padding: 22px 22px 20px 27px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.report-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 10px 0 0 10px; background: var(--brand); }
.report-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 19px; }
.report-index { flex: 0 0 auto; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-pale); color: var(--blue); font-size: 10px; font-weight: 950; }
.report-type { color: var(--blue); font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.report-heading h3 { margin: 5px 0 4px; font-size: 17px; line-height: 1.35; }
.report-heading time { color: var(--muted); font-size: 10px; }
.report-block { margin-top: 15px; }
.report-block > span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.report-block p { margin: 5px 0 0; color: var(--ink); font-size: 12px; line-height: 1.68; white-space: pre-wrap; }
.report-block-emphasis { margin: 0 0 18px; padding: 14px 15px; border: 1px solid #c9dfd2; border-radius: 8px; background: var(--brand-pale); }
.report-block-emphasis > span { color: var(--brand); }
.report-block-emphasis p { color: var(--brand-deep); font-size: 13px; font-weight: 750; }
.viewer-panel { margin-top: 19px; padding-top: 15px; display: flex; align-items: center; gap: 11px; border-top: 1px solid var(--line); }
.viewer-status { flex: 0 0 auto; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #f0f3f1; color: var(--muted); font-size: 10px; font-weight: 900; }
.viewer-status.available { background: var(--brand-pale); color: var(--brand); }
.viewer-status.pending { background: #fff5e7; color: #9b5b10; }
.viewer-panel > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
.viewer-panel strong { color: var(--brand-deep); font-size: 11px; }
.viewer-panel div span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.viewer-unavailable { flex: 0 0 auto; padding: 7px 10px; border-radius: 6px; background: #f0f2f0; color: var(--muted); font-size: 9px; font-weight: 750; white-space: nowrap; }
.viewer-unavailable.pending { background: #fff5e7; color: #9b5b10; }
.empty-state { padding: 45px 20px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); text-align: center; font-size: 12px; }
.medical-guidance { margin-top: 16px; padding: 17px 19px; display: flex; align-items: flex-start; gap: 13px; border-left: 3px solid var(--blue); background: var(--blue-pale); }
.guidance-symbol { flex: 0 0 auto; width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #7eabb7; border-radius: 50%; color: var(--blue); font-size: 10px; font-weight: 900; }
.medical-guidance strong { display: block; margin-bottom: 3px; color: var(--blue); font-size: 12px; }
.medical-guidance p { margin: 0; color: #55747c; font-size: 11px; line-height: 1.6; }

.site-footer { min-height: 106px; padding: 24px 22px; display: grid; justify-items: center; gap: 4px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); text-align: center; }
.site-footer strong { color: var(--brand-deep); font-size: 11px; }
.site-footer span { font-size: 9px; line-height: 1.5; }
.site-footer small { margin-top: 7px; color: #8c9993; font-size: 8px; }
.error-page { min-height: calc(100vh - 188px); padding: 30px 20px; display: grid; place-items: center; }
.error-card { width: min(100%, 450px); padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.error-symbol { width: 48px; height: 48px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-pale); color: var(--danger); font-size: 18px; font-weight: 900; }
.error-card h1 { margin: 8px 0 9px; font-size: 26px; }
.error-card p { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-intro { padding: 45px; }
  .auth-card { padding: 42px 45px; }
  .overview-grid { grid-template-columns: 1fr; }
  .patient-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-summary { display: grid; grid-template-columns: 1fr 1.15fr; gap: 8px 20px; align-items: center; }
  .result-summary .kicker, .result-summary h2 { grid-column: 1; }
  .result-summary h2 { margin-bottom: 0; }
  .result-summary .metrics { grid-column: 2; grid-row: 1 / span 2; }
  .generated-time { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .app-frame { box-shadow: none; }
  .site-header { border-top-width: 3px; }
  .header-inner { min-height: 66px; padding: 9px 16px; }
  .brand-mark { width: 56px; height: 36px; }
  .brand-mark span { font-size: 21px; }
  .brand-mark i { right: 4px; width: 5px; height: 15px; }
  .brand-mark i::after { top: 5px; left: -5px; width: 15px; height: 5px; }
  .brand-identity { gap: 10px; }
  .brand-identity strong { font-size: 9px; }
  .brand-identity span { font-size: 8px; }
  .trust-pill { min-height: 29px; padding: 6px 8px; }
  .trust-pill span:last-child { display: none; }
  .page-content { padding: 20px 14px 44px; }
  .auth-page { display: block; }
  .auth-layout { min-height: 0; border-radius: 18px; }
  .auth-intro { padding: 32px 24px; }
  .auth-intro h1 { margin: 12px 0; font-size: 34px; }
  .intro-copy { font-size: 13px; }
  .auth-steps { grid-template-columns: 1fr; gap: 0; margin-top: 22px; }
  .auth-step { padding: 10px 0; display: grid; grid-template-columns: 34px 1fr; gap: 6px; border-top: 1px solid rgba(255,255,255,.14); }
  .step-number { margin: 1px 0 0; }
  .auth-step p { display: none; }
  .auth-card { padding: 27px 23px; }
  .auth-card-heading h2 { font-size: 23px; }
  .results-page { padding-top: 15px; }
  .result-hero { min-height: 200px; margin-bottom: 12px; padding: 25px 22px; flex-direction: column; align-items: flex-start; justify-content: flex-end; border-radius: 13px; }
  .result-hero h1 { font-size: 34px; }
  .verified-badge { padding: 8px 10px; }
  .verified-badge > span { width: 24px; height: 24px; }
  .overview-grid { gap: 12px; margin-bottom: 12px; }
  .patient-card, .result-summary { padding: 19px; }
  .patient-grid { grid-template-columns: 1fr 1fr; gap: 15px 13px; }
  .patient-field:last-child { grid-column: 1 / -1; }
  .result-summary { display: block; }
  .result-summary h2 { margin-bottom: 15px; }
  .generated-time { margin-top: 12px; }
  .result-heading-main { padding: 20px 18px 15px; align-items: flex-start; }
  .section-heading h2 { font-size: 22px; }
  .result-heading-main .print-button { display: none; }
  .tabs { padding: 0 10px; }
  .tab-panel { padding: 16px 11px 19px; }
  .lab-group-heading { padding: 12px 13px; }
  .lab-table, .lab-table tbody, .lab-table tr, .lab-table td { display: block; width: 100% !important; }
  .lab-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .lab-table tr { padding: 12px 13px; border-top: 1px solid var(--line); }
  .lab-table tr.result-low, .lab-table tr.result-high, .lab-table tr.result-abnormal { padding-left: 16px; box-shadow: none; border-left: 4px solid; }
  .lab-table tr.result-low { border-left-color: var(--low); }
  .lab-table tr.result-high { border-left-color: var(--high); }
  .lab-table tr.result-abnormal { border-left-color: #b46a15; }
  .lab-table tbody tr:first-child { border-top: 0; }
  .lab-table td { min-height: 26px; padding: 4px 0; display: grid; grid-template-columns: minmax(78px, .7fr) minmax(0, 1.3fr); gap: 11px; border: 0; text-align: right; }
  .lab-table td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 750; text-align: left; }
  .analyte-name { font-size: 11px; }
  .lab-value { font-size: 12px; }
  .lab-value .lab-status { margin: 4px 0 0 auto; }
  .report-card { padding: 17px 16px 17px 20px; }
  .report-heading h3 { font-size: 15px; }
  .viewer-panel { align-items: flex-start; flex-wrap: wrap; }
  .viewer-panel > div { width: calc(100% - 42px); flex: none; }
  .viewer-panel .button, .viewer-unavailable { margin-left: 40px; }
  .medical-guidance { padding: 15px; }
}

@media (max-width: 390px) {
  .auth-intro h1 { font-size: 31px; }
  .patient-grid { grid-template-columns: 1fr; }
  .patient-field:last-child { grid-column: auto; }
  .metric { padding: 11px; }
  .metric strong { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  body, .app-frame { background: #fff; box-shadow: none; }
  .app-frame { width: 100%; }
  .site-header, .site-footer, .verified-badge, .tabs, .print-button, .medical-guidance, .viewer-panel { display: none !important; }
  .page-content { width: 100%; padding: 0; }
  .result-hero { min-height: 0; padding: 17px; border-radius: 0; box-shadow: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .surface { break-inside: avoid; box-shadow: none; }
  .tab-panel { padding: 0 15px 15px; }
}
