:root{--navy:#122e43;--teal:#087f82;--mint:#e8f4f1;--ink:#203444;--muted:#637888;--border:#dce5e9;--bg:#f3f6f8;--white:#fff;--amber:#986515;--rose:#b13b4b;--radius:14px;font-family:Aptos,Carlito,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--bg);font-size:14px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:3px}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.48}button,.btn{border:1px solid var(--border);border-radius:8px;padding:10px 15px;background:#fff;color:var(--ink);text-decoration:none;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:8px}.primary{background:var(--teal);color:#fff;border-color:var(--teal)}.danger{color:var(--rose)}.quiet{background:transparent;border-color:transparent}.small{padding:6px 10px;font-size:12px}h1,h2,h3,p{margin-top:0}h1{font-size:29px;letter-spacing:-.9px;margin-bottom:8px}h2{font-size:19px;letter-spacing:-.3px}h3{font-size:15px}p{line-height:1.6}a{color:var(--teal)}.muted{color:var(--muted)}.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:1.5px;font-weight:750;color:var(--teal);margin-bottom:10px}.layout{display:grid;grid-template-columns:230px 1fr;min-height:100vh}.sidebar{background:var(--navy);color:#e9f0f3;padding:25px 17px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;gap:12px;align-items:center;margin:4px 9px 36px}.brand-mark{font-size:21px;border:1px solid #476174;width:41px;height:41px;display:grid;place-items:center;border-radius:12px;color:#a4e7dd}.brand b{display:block;font-size:17px;letter-spacing:.2px}.brand small{font-size:11px;color:#b5c8d4}.nav-label{font-size:10px;letter-spacing:1.6px;color:#91a9b7;margin:15px 13px 10px}.sidebar nav{display:grid;gap:7px}.sidebar nav button{color:#bdced9;background:none;border:0;text-align:left;justify-content:flex-start;padding:12px 15px;font-weight:500}.sidebar nav button.active{background:#24485b;color:#fff;box-shadow:inset 3px 0 #57c7b6}.nav-icon{font-size:18px;width:22px;color:#9fc5cb}.sidebar-foot{margin-top:auto;padding:18px 10px 0;border-top:1px solid #355366;color:#a8bfcc;font-size:11px;line-height:1.65}.topbar{padding:17px 30px;background:#fff;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;gap:12px}.topbar-title{font-size:12px;color:var(--muted)}.profile{display:flex;gap:10px;align-items:center}.avatar{width:35px;height:35px;border-radius:50%;background:var(--mint);color:var(--teal);display:grid;place-items:center;font-weight:700}.profile small{display:block;color:var(--muted);font-size:10px}.main{padding:30px;max-width:1700px;margin:auto}.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:23px}.page-header p{margin-bottom:0}.pill,.badge{display:inline-block;border-radius:30px;padding:5px 9px;font-size:11px;font-weight:650;background:#edf2f5;color:#547083;white-space:nowrap}.badge.released,.badge.approved{background:#e3f3ed;color:#26795d}.badge.verified{background:#e6eefb;color:#456aa5}.badge.submitted{background:#fff0d7;color:#936420}.badge.draft{background:#edf1f3;color:#657887}.demo-banner{padding:10px 30px;background:#fff2da;color:#79591f;font-size:12px;display:flex;justify-content:space-between;gap:10px}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:25px}.stat{padding:22px;background:#fff;border:1px solid var(--border);border-radius:var(--radius)}.stat strong{font-size:31px;display:block;margin:13px 0 5px;letter-spacing:-1px}.stat label{font-size:12px;color:var(--muted)}.stat .tag{font-size:11px;color:var(--teal)}.card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:22px;margin-bottom:20px}.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}.card-head h2,.card-head h3{margin:0}.split{display:grid;grid-template-columns:1.5fr 1fr;gap:20px}.workflow{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.workflow div{padding:15px;border:1px solid var(--border);border-radius:10px}.workflow span{display:block;color:var(--teal);font-weight:700;font-size:11px;margin-bottom:8px}.workflow p{color:var(--muted);font-size:12px;margin-bottom:0}.table-wrap{overflow-x:auto}table.app-table{border-collapse:collapse;width:100%;text-align:left;font-size:12px}.app-table th{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.8px;background:#f8fafb;padding:12px 10px;border-bottom:1px solid var(--border);font-weight:600}.app-table td{padding:14px 10px;border-bottom:1px solid #edf1f3;vertical-align:middle}.app-table tr:last-child td{border:0}.app-table .patient{font-weight:650}.app-table small{display:block;color:var(--muted);margin-top:4px}.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px;align-items:center}.toolbar input{max-width:370px;flex:1}.toolbar select{width:auto;min-width:130px}.empty{padding:40px 18px;text-align:center;color:var(--muted);line-height:1.8}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.field{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:650;color:#546b7a}.field.full{grid-column:1/-1}.field input,.field select,.field textarea,input.search{border:1px solid #cfdbdf;background:#fff;border-radius:7px;padding:10px 11px;color:var(--ink);width:100%;min-height:40px;font-size:13px;font-weight:400}.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--teal);outline:2px solid #d6eeeb}.field textarea{min-height:75px;resize:vertical}.field small{font-weight:400;line-height:1.5;color:var(--muted)}.check{display:flex;align-items:flex-start;gap:9px;font-size:12px;line-height:1.5;font-weight:400;color:var(--ink)}.check input{width:15px;height:15px;margin-top:2px;accent-color:var(--teal)}.editor{display:grid;grid-template-columns:minmax(370px,.95fr) minmax(410px,1.15fr);gap:22px;align-items:start}.editor-section{padding:20px;border:1px solid var(--border);border-radius:var(--radius);background:#fff;margin-bottom:16px}.section-title{display:flex;gap:10px;align-items:center;margin:0 0 17px}.section-number{border-radius:50%;background:var(--mint);color:var(--teal);width:24px;height:24px;display:grid;place-items:center;font-size:11px}.preview{position:sticky;top:12px;background:#e5ebee;border:1px solid #d4dee4;border-radius:var(--radius);padding:17px;overflow:auto}.preview-tools{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px;font-size:12px}.paper{background:#fff;color:#111;padding:18mm 16mm;max-width:210mm;margin:0 auto;min-height:270mm;box-shadow:0 3px 16px #1a344514;font-family:Aptos,Carlito,"Segoe UI",Arial,sans-serif;font-size:11pt;line-height:1.3}.print-frame{width:100%;border-collapse:collapse}.print-frame>thead>tr>td,.print-frame>tbody>tr>td{padding:0;border:0}.letterhead{text-align:center;border-bottom:1.2px solid #111;margin-bottom:12px;padding-bottom:9px}.letterhead h2{font-family:Aptos,Carlito,"Segoe UI",Arial,sans-serif;font-size:14pt;letter-spacing:0;margin:0 0 5px;font-weight:bold}.letterhead p{font-size:10pt;line-height:1.4;margin:0}.patient-table{border-collapse:collapse;width:100%;font-size:10pt;margin:13px 0 20px}.patient-table td{border:.6px solid #222;padding:5px 7px;vertical-align:top}.report-title{font-size:12pt;text-align:center;text-decoration:underline;margin:20px 0 20px;font-family:Aptos,Carlito,"Segoe UI",Arial,sans-serif}.report-body p{font-size:11pt;line-height:1.4;margin:0 0 11px;overflow-wrap:anywhere}.result-table{border-collapse:collapse;width:100%;margin:13px 0;font-size:10.5pt}.result-table td,.result-table th{border:.6px solid #333;text-align:left;padding:5px 8px}.result-table th{font-weight:bold;background:#f5f5f5}.result-table tr{break-inside:avoid}.legend{font-size:9.5pt!important}.end-report{text-align:center;font-weight:bold;font-size:10pt;margin:22px 0}.signatures{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;font-size:9pt;break-inside:avoid;margin-top:35px;padding-top:12px;border-top:.6px solid #bbb}.signatures small{font-size:8pt}.version-line{text-align:right;font-size:8pt;color:#555;margin-top:16px}.print-status{text-align:center;font-size:8pt;border:1px solid #777;margin:12px 0;padding:5px;color:#555}.ast-table{font-size:11px;table-layout:fixed}.ast-table th:nth-child(1){width:34%}.ast-table th:nth-child(2){width:19%}.ast-table th:nth-child(3){width:24%}.ast-table th:nth-child(4){width:14%}.ast-table select{padding:6px 3px;max-width:100%;border:1px solid var(--border);border-radius:5px;background:#fff;font-size:11px}.ast-table td{padding:9px 5px;vertical-align:top}.ast-table input[type=checkbox]{accent-color:var(--teal)}.tier{font-size:9px;padding:2px 5px;background:var(--mint);border-radius:3px;margin-right:5px;white-space:nowrap}.ast-note{font-size:10px;color:var(--amber);line-height:1.4}.callout{border-left:3px solid var(--teal);background:#edf8f5;padding:12px 14px;font-size:12px;line-height:1.65;color:#3a6666;margin:12px 0}.callout.warning{border-color:#d4a142;background:#fff8e9;color:#816127}.errors{border:1px solid #e4bac1;border-radius:8px;padding:12px 16px;background:#fff4f5;color:#96394b;line-height:1.6;font-size:12px;margin-bottom:16px}.errors ul{margin:5px 0;padding-left:18px}.action-bar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:15px 0}.template-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.template-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:12px}.template-card h3{font-size:14px;line-height:1.5;margin:0}.template-card small{color:var(--muted);font-size:11px}.template-card .actions{margin-top:auto;display:flex;justify-content:space-between;align-items:center}.auth-page{min-height:100vh;display:grid;grid-template-columns:1.15fr 1fr;background:#fff}.auth-intro{background:var(--navy);color:#fff;padding:10vh 8vw;display:flex;flex-direction:column;justify-content:center}.auth-intro h1{font-size:44px;line-height:1.15;letter-spacing:-1.6px;max-width:540px;margin:30px 0 20px}.auth-intro p{color:#b6cad5;max-width:420px;line-height:1.8}.auth-intro .eyebrow{color:#7bd1c1}.auth-form{max-width:450px;margin:auto;padding:35px;width:100%}.auth-form h2{font-size:25px}.auth-form .field{margin-bottom:18px}.auth-divider{border-top:1px solid var(--border);margin:25px 0;padding-top:22px}.steps{display:flex;align-items:center;gap:6px;margin-top:18px;flex-wrap:wrap}.steps span{border:1px solid var(--border);border-radius:6px;padding:8px 10px;font-size:11px;background:#fff}.steps .done{background:var(--mint);border-color:#b8d9d0;color:var(--teal)}dialog{border:0;border-radius:16px;box-shadow:0 20px 80px #08203033;max-width:750px;width:calc(100% - 32px);max-height:86vh;padding:27px;color:var(--ink)}dialog::backdrop{background:#0e293c77}.modal-head{display:flex;justify-content:space-between;gap:15px;margin-bottom:16px}.modal-head h2{margin:0}.mono{font-family:ui-monospace,SFMono-Regular,monospace;font-size:11px;overflow-wrap:anywhere}.code{background:#f1f5f7;padding:15px;border-radius:8px;font-family:ui-monospace,monospace;white-space:pre-wrap;font-size:11px}.login-demo-roles{display:flex;gap:8px;flex-wrap:wrap}.loading{padding:40px;text-align:center;color:var(--muted)}#toast{position:fixed;bottom:25px;right:25px;background:var(--navy);color:#fff;padding:13px 18px;border-radius:9px;max-width:420px;z-index:100;opacity:0;pointer-events:none;transition:opacity .2s}#toast.show{opacity:1}#print-root{display:none}.patient-page{max-width:900px;margin:35px auto;padding:0 20px}.settings-text{min-height:230px!important}.sticky-actions{position:sticky;bottom:0;border-top:1px solid var(--border);background:#fffffff5;padding:12px 0;backdrop-filter:blur(8px)}@media(min-width:1600px){.editor{grid-template-columns:540px 1fr}}@media(max-width:1150px){.layout{grid-template-columns:190px 1fr}.sidebar{padding:20px 10px}.main{padding:22px}.topbar{padding:16px 22px}.editor{grid-template-columns:1fr}.preview{position:static}.template-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.layout{display:block}.sidebar{position:static;height:auto;padding:15px}.brand{margin:0 0 12px}.sidebar nav{display:flex;overflow:auto;gap:4px}.sidebar nav button{white-space:nowrap;padding:9px}.nav-label,.sidebar-foot{display:none}.topbar{padding:13px 16px}.topbar-title{display:none}.main{padding:20px 14px}h1{font-size:25px}.cards{grid-template-columns:1fr 1fr;gap:10px}.stat{padding:16px}.split{grid-template-columns:1fr}.template-grid{grid-template-columns:1fr}.editor{display:block}.grid3{grid-template-columns:1fr 1fr}.page-header{flex-direction:column;gap:12px}.paper{padding:12mm 8mm;min-width:520px}.preview{padding:12px}.auth-page{display:block}.auth-intro{padding:35px 25px}.auth-intro h1{font-size:30px;margin:20px 0}.auth-intro p{margin-bottom:0}.auth-form{padding:30px 25px}.demo-banner{padding:10px 16px}.workflow{grid-template-columns:1fr}.card{padding:17px}.profile select{max-width:120px}}@page{size:A4;margin:17mm 16mm 15mm}@media print{body{background:#fff}#app,#modal,#toast{display:none!important}#print-root{display:block}.paper{padding:0;box-shadow:none;max-width:none;min-height:0;font-size:11pt}.print-frame>thead{display:table-header-group}.print-frame>tbody{display:table-row-group}.paper .letterhead{padding-top:0}.patient-table,.signatures,.end-report{break-inside:avoid}.report-title{break-after:avoid}.report-body p{orphans:3;widows:3}.result-table thead{display:table-header-group}.print-status{color:#333}*{-webkit-print-color-adjust:exact;print-color-adjust:exact}}

.letterhead .continuation-id{font-size:8pt;margin-top:5px;color:#555}.report-ending{break-inside:avoid}
@media print{html,body{background:#fff!important}.patient-table{font-size:9.5pt;margin:10px 0 14px}.patient-table td{padding:4px 6px}.report-title{margin:15px 0}.report-body p{font-size:10.5pt;line-height:1.3;margin-bottom:7px}.result-table{font-size:10pt;margin:10px 0}.result-table td,.result-table th{padding:4px 7px}.end-report{margin:16px 0}.signatures{display:table;width:100%;table-layout:fixed;font-size:8.5pt;margin-top:18px;padding-top:8px}.signatures>div{display:table-cell;padding-right:10px;vertical-align:top}.version-line{margin-top:10px}.legend{font-size:9pt!important}.letterhead{margin-bottom:9px}.print-status{margin:9px 0;padding:4px}}
/* Six-requirement review update. Fonts and emblem are served from this folder. */
@font-face{font-family:Carlito;src:url('assets/fonts/Carlito-Regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:Carlito;src:url('assets/fonts/Carlito-Bold.ttf') format('truetype');font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:Carlito;src:url('assets/fonts/Carlito-Italic.ttf') format('truetype');font-weight:400;font-style:italic;font-display:swap}
@font-face{font-family:Carlito;src:url('assets/fonts/Carlito-BoldItalic.ttf') format('truetype');font-weight:700;font-style:italic;font-display:swap}
.college-logo{object-fit:contain;flex-shrink:0;background:white;border-radius:6px;padding:3px}.auth-intro>.college-logo{width:110px;height:110px}.auth-intro .college-name{font-size:34px;line-height:1.25;letter-spacing:-.3px;margin:24px 0 12px}.auth-intro .department-name{font-size:24px;margin:0 0 20px;color:#b3e8df}.auth-intro .system-name{font-size:19px;font-weight:700}.auth-intro .steps span{background:transparent;color:#dcecef;border-color:#536c7c}.brand{align-items:center;gap:10px}.brand>.college-logo{width:54px;height:54px}.brand b{font-size:13px;line-height:1.4}.brand small{font-size:10px;line-height:1.4;text-transform:none;letter-spacing:0}.topbar{align-items:center;gap:20px;flex-wrap:wrap;min-height:100px}.institution-heading{max-width:580px}.institution-heading b{display:block;font-size:17px;line-height:1.3}.institution-heading strong{display:block;font-size:16px;margin-top:4px}.institution-heading small{display:block;font-size:12px;color:var(--muted);margin-top:4px}.profile{flex-wrap:wrap}.role-options{display:flex;gap:14px;flex-wrap:wrap}.isolate-card{border:1px solid var(--border);border-radius:10px;padding:16px;margin-bottom:20px}.credential-card{background:var(--bg);padding:20px;border-radius:9px}.credential-card dt{font-size:12px;color:var(--muted)}.credential-card dd{font-family:ui-monospace,monospace;font-size:20px;overflow-wrap:anywhere;margin:8px 0 20px}.paper,.paper h2,.paper h3,.paper h4,.paper p,.paper table{font-family:Aptos,Carlito,"Segoe UI",Arial,sans-serif}.paper{font-size:10.5pt;padding:15mm 14mm;line-height:1.4;color:#182b3a}.paper .letterhead{display:flex;gap:14px;align-items:center;text-align:left;border-bottom:2px solid #254b5a;padding:0 0 12px;margin:0 0 12px}.letterhead>.college-logo{width:70px;height:70px;object-fit:contain;border-radius:0;padding:0}.paper .letterhead h2{font-size:13.5pt;line-height:1.3;margin:0;font-weight:700}.paper .letterhead p{margin:3px 0;font-size:9pt;line-height:1.3}.paper .letterhead .letterhead-department{font-size:12pt;font-weight:700;color:#244957}.paper .letterhead .letterhead-contact{font-size:8pt;color:#52616c}.paper .letterhead .continuation-id{font-size:8pt;margin-top:5px;color:#52616c}.paper .report-title{font-size:12pt;text-align:center;text-decoration:none;letter-spacing:.5px;margin:15px 0}.patient-table{width:100%;border-collapse:collapse;font-size:9.5pt;table-layout:fixed;margin:0 0 17px}.patient-table td{border:1px solid #d4dee3;padding:6px 8px;overflow-wrap:anywhere}.patient-table td:nth-child(odd){background:#f3f6f7}.report-body p{font-size:10.5pt;line-height:1.45;margin:9px 0}.report-section-title,.notes-title{font-size:10.5pt;font-weight:700;margin:14px 0 5px;padding-bottom:3px;border-bottom:1px solid #d4dee3}.report-notes{padding-left:19px;margin:7px 0 13px;list-style-type:disc;font-size:10pt;line-height:1.45}.report-notes li{margin:4px 0;overflow-wrap:anywhere}.isolate-title{font-size:11pt;padding:8px 10px;background:#eef4f5;border-left:3px solid #557987;margin:15px 0 9px;break-after:avoid}.result-table{width:100%;border-collapse:collapse;font-size:10pt}.result-table th{background:#eff4f6;color:#213944;text-align:left}.result-table td,.result-table th{border:1px solid #c9d5dc;padding:6px 8px;overflow-wrap:anywhere}.result-table tr{break-inside:avoid}.legend{font-size:9pt}.signatures{border-top:1px solid #8597a2;padding-top:12px;margin-top:20px;font-size:9pt;text-align:left;gap:14px}.signatures .staff-name{font-weight:700}.signatures small{font-size:8pt}.end-report{font-size:9pt;color:#52616c;margin:16px 0 8px;text-align:center}.version-line{font-size:8pt;color:#52616c;margin:14px 0 0}.report-ending{break-inside:avoid}.ast-method{font-size:9.5pt!important}.report-comments{margin-top:12px}
@media(max-width:760px){.topbar{gap:12px;padding:15px}.institution-heading b{font-size:16px}.institution-heading strong{font-size:15px}.auth-intro .college-name{font-size:28px}.auth-intro .department-name{font-size:22px}.paper{padding:10mm 8mm}.grid2{grid-template-columns:1fr}.profile .avatar{display:none}.brand b{font-size:14px}.brand>.college-logo{width:48px;height:48px}}
@page{size:A4;margin:14mm 14mm 15mm}
@media print{.paper{padding:0;min-width:0;min-height:0;font-size:10.5pt}.paper .letterhead{padding:0 0 9px;margin:0 0 10px}.paper .letterhead h2{font-size:13pt}.patient-table{font-size:9pt}.patient-table td{padding:4px 6px}.report-body p{font-size:10pt;line-height:1.4;margin:7px 0}.report-notes{font-size:9.5pt;line-height:1.4}.result-table td,.result-table th{padding:5px 7px}.signatures{display:table;width:100%;table-layout:fixed;margin-top:17px;font-size:9pt}.signatures>div{display:table-cell;vertical-align:top;padding-right:12px}.notes-title,.report-section-title,.isolate-title{break-after:avoid}.report-notes li{orphans:2;widows:2}.letterhead>.college-logo{width:64px;height:64px}.print-frame>thead{display:table-header-group}.paper .print-status{font-size:8pt;margin:8px 0}.report-body{overflow:visible}.report-comments{break-inside:auto}}
/* Keep the usual short culture report on one A4 sheet without splitting authorization. */
@media print{.paper .letterhead{gap:12px;padding-bottom:7px;margin-bottom:7px}.letterhead>.college-logo{width:56px;height:56px}.paper .letterhead h2{font-size:12.5pt}.paper .letterhead .letterhead-department{font-size:11.5pt}.paper .report-title{margin:8px 0 10px}.paper .patient-table{margin-bottom:10px;font-size:9pt}.patient-table td{padding:3px 6px}.report-section-title,.notes-title{margin:10px 0 4px}.report-body p{margin:5px 0;line-height:1.35}.report-notes{margin:5px 0 9px;line-height:1.35}.report-notes li{margin:3px 0}.isolate-result{break-inside:avoid}.isolate-title{margin:10px 0 6px;padding:5px 8px}.result-table{margin:8px 0}.result-table td,.result-table th{padding:4px 7px}.paper .end-report{margin:10px 0 5px}.paper .signatures{margin-top:8px;padding-top:8px}.paper .version-line{margin-top:8px}.report-body .legend{margin-bottom:7px}.paper .print-status{margin:7px 0;padding:3px}}
/* Second-round review: original transparent emblem, independent screen/print hierarchy. */
.college-logo{background:transparent;border:0;border-radius:0;padding:0;object-fit:contain}
.password-control{position:relative;display:block}.password-control input{padding-right:49px;width:100%}.password-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);height:36px;width:38px;padding:6px;background:transparent;border:0;color:#426577}.password-toggle:focus-visible{outline:2px solid var(--teal)}
.workflow-tracker{display:flex;justify-content:center;align-items:stretch;gap:12px;padding:0;margin:20px auto 25px;list-style:none;max-width:1000px}.workflow-tracker li{flex:1;display:flex;align-items:center;justify-content:center;gap:10px;border:1px solid #d9e1e8;background:#f4f6f8;color:#6b7a85;border-radius:10px;padding:13px 10px;font-size:15px}.workflow-tracker .stage-icon{display:grid;place-items:center;border-radius:50%;width:29px;height:29px;flex-shrink:0;background:#e3e8ed;font-weight:700}.workflow-tracker b{display:block;font-weight:600}.workflow-tracker small{display:block;font-size:12px;margin-top:3px}.workflow-tracker .complete{background:#edf8f0;color:#226240;border-color:#b8dac3}.workflow-tracker .complete .stage-icon{background:#2e7c4c;color:white}.workflow-tracker .current{background:#eaf2ff;color:#164778;border:2px solid #3775bd}.workflow-tracker .current .stage-icon{background:#2767b0;color:white}
.paper .letterhead h2.letterhead-department{font-size:15pt;line-height:1.2;font-weight:700;color:#203b49;margin:0}.paper .letterhead p.letterhead-college{font-size:11.5pt;line-height:1.25;font-weight:600;margin:4px 0}.paper .letterhead .letterhead-contact{font-size:8.5pt}.paper .letterhead>.college-logo{width:92px;height:92px}.paper .findings-heading{font-weight:700;text-decoration:underline;text-underline-offset:3px;border-bottom:0}.paper .notes-title{border-bottom:0;padding-bottom:0}
@media screen{:root{font-size:15px}h1{font-size:24px;letter-spacing:-.4px}h2{font-size:20px}h3{font-size:18px}button,.btn{font-size:15px}.sidebar nav button{font-size:15px}.field{font-size:15px;line-height:1.4}.field input,.field select,.field textarea,input.search{font-size:15px;min-height:43px}.field small,.muted,.app-table small{font-size:13px}.app-table{font-size:14px!important}.app-table th{font-size:12px;text-transform:none;letter-spacing:0}.app-table td{padding:13px 10px}.pill,.badge{font-size:13px}.brand small,.sidebar-foot,.nav-label{font-size:12px}.brand b{font-size:14px}.profile small{font-size:13px}.profile select{font-size:14px}.profile{gap:9px}.main{padding:25px}.section-title{font-size:19px;font-weight:600}.section-number{font-size:13px;width:27px;height:27px}.stat label,.stat .tag{font-size:14px}.stat strong{font-size:29px}.callout,.errors,.check{font-size:14px}.ast-table{font-size:13px!important}.ast-table select{font-size:13px}.ast-note{font-size:12px}.tier{font-size:11px}.auth-form{max-width:520px;padding:35px}.login-title{font-size:25px;line-height:1.3;color:#183949;margin-bottom:20px}.auth-form h2{font-size:21px}.auth-intro .steps span{font-size:13px}.template-card h3{font-size:16px}.template-card small{font-size:13px}.workflow p{font-size:14px}.preview-tools{font-size:13px}.topbar{gap:15px}.institution-heading{max-width:530px}.institution-heading b{font-size:18px}.institution-heading strong{font-size:17px}.institution-heading small{font-size:13px}.brand>.college-logo{width:64px;height:64px}.card{padding:22px}.editor-section{padding:20px}.page-header h1{font-size:24px}}
@media(max-width:950px){.workflow-tracker{gap:8px}.workflow-tracker li{font-size:14px;padding:11px 8px}.topbar .institution-heading{max-width:none}.topbar{align-items:flex-start}.profile{max-width:100%}}
@media(max-width:760px){.workflow-tracker{display:grid;grid-template-columns:1fr 1fr;max-width:600px;margin:18px auto}.workflow-tracker li{justify-content:flex-start}.workflow-tracker small{font-size:12px}.main{padding:20px 14px}.auth-form{padding:28px 23px}.login-title{font-size:23px}.institution-heading b{font-size:17px}.institution-heading strong{font-size:16px}.section-title{font-size:18px}.profile select{max-width:170px}.auth-intro .college-name{font-size:26px}.page-header h1{font-size:23px}}
@media print{.paper .letterhead h2.letterhead-department{font-size:14.5pt}.paper .letterhead p.letterhead-college{font-size:11pt}.paper .letterhead .letterhead-contact{font-size:8pt}.paper .letterhead>.college-logo{width:86px;height:86px}.paper .notes-title{border-bottom:0}.paper .findings-heading{font-size:10pt}.workflow-tracker,.password-control{display:none!important}}
/* Round 3 archive, credentials and responsive interface; report print sizes stay separate. */
.editor-header h1{font-size:20px;font-weight:600;line-height:1.3}
.archive-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;align-items:start}
.archive-filters .field{min-width:0}.archive-filters input,.archive-filters select{width:100%;min-width:0}
.filter-search{grid-column:span 2}.archive-filter-actions{display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap;margin-top:20px}
.archive-counts{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:18px 0}
.archive-counts>div{background:#f1f6f5;border:1px solid #e0e9e6;border-radius:10px;padding:14px;display:grid;gap:8px}
.archive-counts span{font-size:13px;color:#475f58}.archive-counts b{font-size:24px;color:#143f34}
.organism-distribution{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}
.organism-distribution>div{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #e0e9e6;padding:8px;overflow-wrap:anywhere}
.archive-pagination{display:flex;justify-content:center;align-items:center;gap:20px;padding:20px 0}
.archive-table td{max-width:210px;overflow-wrap:anywhere}.archive-table small{display:block;margin-top:5px}
.password-gate .college-logo{width:90px;height:90px}.password-gate{max-width:640px}.password-gate h1{font-size:24px}
@media screen and (max-width:1200px){.archive-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.archive-counts{grid-template-columns:repeat(3,minmax(0,1fr))}.topbar{gap:12px}.profile{flex-wrap:wrap;justify-content:flex-end}}
@media screen and (max-width:760px){.archive-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.archive-counts{grid-template-columns:repeat(2,minmax(0,1fr))}.organism-distribution{grid-template-columns:1fr}.archive-pagination{gap:10px;flex-wrap:wrap}.main{min-width:0}.preview{min-width:0}.topbar{align-items:flex-start}.profile{justify-content:flex-start}.institution-heading{min-width:0}.layout>div{min-width:0}.archive-filter-actions>.action-bar{width:100%}}
@media screen and (max-width:440px){.archive-filters{grid-template-columns:minmax(0,1fr)}.filter-search{grid-column:auto}.archive-counts>div{padding:12px}.workflow-tracker{gap:12px}.workflow-tracker li{padding:10px}.workflow-tracker li b{font-size:14px}}
@page{size:A4;margin:14mm 16mm 13mm}
@media screen{.sidebar-foot,.brand small,.nav-label{font-size:13px}}
@media screen{.layout>div,.main,.card,.editor>div{min-width:0}.table-wrap{max-width:100%}.brand>div{min-width:0}}
@media screen and (min-width:761px) and (max-width:1150px){.brand{margin-left:4px;margin-right:4px;gap:8px}.brand>.college-logo{width:52px;height:52px}}
/* Five follow-up corrections: shared actions, centred headings and full names. */
.editor-header{display:block;text-align:center}.editor-header>.page-heading{max-width:850px;margin:0 auto}.editor-header>.action-bar{justify-content:center;margin-top:12px}.editor-header .eyebrow{margin-bottom:8px}.editor-header h1{margin-bottom:9px}.editor-header .selected-report-title{font-size:19px;font-weight:700;line-height:1.4;color:var(--ink);margin:0;overflow-wrap:anywhere}
.report-actions-bottom{margin-top:8px;padding:16px 0 4px;border-top:1px solid var(--border);gap:12px;flex-wrap:wrap}.report-actions-bottom button{min-height:43px}
.paper .findings-heading{text-decoration:none}.paper .findings-heading u{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.paper .letterhead>div{flex:1;min-width:0}.paper .letterhead p.letterhead-college{white-space:nowrap;font-size:11pt;letter-spacing:-.1px}
@media screen{.topbar .institution-heading{flex:1 1 650px;max-width:none;min-width:0}.topbar .institution-heading b{font-size:18px;letter-spacing:-.15px}.topbar .profile{flex:0 1 auto;max-width:100%}.preview .paper{width:210mm;min-width:210mm;max-width:none;box-sizing:border-box}}
@media screen and (min-width:1200px){.topbar .institution-heading b{white-space:nowrap}}
@media screen and (max-width:760px){.editor-header .selected-report-title{font-size:18px}.report-actions-top,.report-actions-bottom{gap:10px}.report-actions-bottom button{flex:1 1 150px}.topbar .institution-heading b{font-size:17px;letter-spacing:0;white-space:normal}.preview .paper{padding:15mm 14mm}}
@media print{.paper .letterhead p.letterhead-college{font-size:11pt;white-space:nowrap;letter-spacing:-.1px}.report-actions-top,.report-actions-bottom{display:none!important}}

.report-view{max-width:100%;min-width:0;overflow:auto}
@media screen{.report-view .paper{width:210mm;min-width:210mm;max-width:none;padding:15mm 14mm;box-sizing:border-box}}

/* Third-round correction: underline the actual reported observations, never their headings.
   The inline span also survives browser printing and print-to-PDF. */
.report-observed-finding .finding-value-underline{text-decoration-line:underline;text-decoration-thickness:from-font;text-underline-offset:2px;text-decoration-skip-ink:auto}

/* Collapsible navigation rail: logo + recognizable menu icons remain available. */
@media screen{
 .layout{grid-template-columns:230px minmax(0,1fr);transition:grid-template-columns .18s ease}
 .layout-content{min-width:0}
 .sidebar-toggle{align-self:flex-end;margin:0 5px 12px auto;width:36px;height:36px;min-height:36px;padding:6px;border:1px solid #577187;border-radius:9px;background:rgba(255,255,255,.07);color:#e9f0f3;display:grid;place-items:center;cursor:pointer}
 .sidebar-toggle:hover,.sidebar-toggle:focus-visible{background:#28506a;outline-offset:3px}
 .sidebar-toggle svg{display:block}
 .sidebar nav button{display:flex;align-items:center;gap:10px}
 .sidebar nav button .nav-icon{flex:0 0 22px;text-align:center}
 .sidebar-collapsed{grid-template-columns:72px minmax(0,1fr)}
 .sidebar-collapsed .sidebar{padding:16px 6px}
 .sidebar-collapsed .sidebar-toggle{align-self:center;margin:0 auto 16px}
 .sidebar-collapsed .sidebar-toggle-chevron{transform:rotate(180deg);transform-origin:14.5px 12px}
 .sidebar-collapsed .brand{justify-content:center;margin:0 auto 22px;gap:0}
 .sidebar-collapsed .brand>.college-logo{width:48px;height:48px;max-width:48px;object-fit:contain;padding:0;background:transparent;border-radius:0}
 .sidebar-collapsed .brand>div,.sidebar-collapsed .sidebar-foot,.sidebar-collapsed .nav-label,.sidebar-collapsed .nav-text{display:none!important}
 .sidebar-collapsed .sidebar nav{display:grid;gap:6px;overflow:visible}
 .sidebar-collapsed .sidebar nav button{justify-content:center;min-width:0;width:100%;min-height:46px;padding:10px 5px;border-radius:10px}
 .sidebar-collapsed .sidebar nav button .nav-icon{font-size:23px;flex:0 0 auto;width:auto;color:#d0e3e9}
 .sidebar-collapsed .sidebar nav button.active{box-shadow:inset 3px 0 #57c7b6}
}
@media screen and (min-width:761px) and (max-width:1150px){.layout:not(.sidebar-collapsed){grid-template-columns:190px minmax(0,1fr)}.layout.sidebar-collapsed{grid-template-columns:72px minmax(0,1fr)}}
@media screen and (max-width:760px){
 .sidebar-toggle{margin:0 0 9px auto}
 .layout.sidebar-collapsed{display:grid;grid-template-columns:62px minmax(0,1fr);align-items:stretch}
 .sidebar-collapsed .sidebar{position:sticky;top:0;height:100vh;padding:12px 4px}
 .sidebar-collapsed .sidebar .college-logo{width:42px;height:42px}
 .sidebar-collapsed .sidebar nav{display:grid;overflow:visible;gap:8px}
 .sidebar-collapsed .sidebar nav button{padding:10px 3px;min-height:43px;white-space:normal}
 .sidebar-collapsed .sidebar nav button .nav-icon{font-size:20px}
 .sidebar-collapsed .layout-content{width:100%;min-width:0}
 .sidebar-collapsed .topbar{padding:12px 10px}
 .sidebar-collapsed .main{padding:15px 10px}
}
@media (prefers-reduced-motion:reduce){.layout{transition:none}}

@media screen{.sidebar .brand .college-logo{background:transparent;padding:0;border-radius:0}.sidebar nav .nav-icon svg{display:block;width:22px;height:22px}.sidebar-collapsed .sidebar nav .nav-icon svg{width:24px;height:24px}}

/* Fourth round: independently resizable A4 preview. Print geometry never changes. */
@media screen and (min-width:981px){
 .editor.resizable-editor{display:grid!important;grid-template-columns:minmax(0, var(--entry-width,60%)) 10px minmax(0,1fr);gap:0;align-items:start}
 .resizable-editor .report-entry-column{min-width:0;padding-right:8px}
 .resizable-editor .preview{min-width:0;padding-left:8px}
 .editor-resize-handle{height:70vh;min-height:390px;position:sticky;top:14px;background:#edf3f6;border:1px solid #ccd9e0;border-radius:8px;cursor:col-resize;display:flex;justify-content:center;align-items:center;color:#517384;user-select:none;touch-action:none}
 .editor-resize-handle span{font-size:24px}
 .resizable-editor.preview-expanded{grid-template-columns:0 0 minmax(0,1fr)}
 .resizable-editor.preview-expanded .report-entry-column,.resizable-editor.preview-expanded .editor-resize-handle{display:none}
 .resizable-editor.preview-expanded .preview{padding-left:0}
}
.preview-toolbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
.preview-toolbar-actions button{white-space:nowrap}
.preview-toolbar-actions #preview-zoom-label{font-size:12px;min-width:42px;text-align:center}
.preview-scroll{overflow:auto;max-width:100%;min-width:0}
@media screen and (max-width:980px){.editor-resize-handle{display:none}.editor.resizable-editor{display:block}.resizable-editor.preview-expanded .report-entry-column{display:none}}
@media print{.editor-resize-handle,.preview-toolbar-actions{display:none!important}#live-preview{zoom:1!important}.resizable-editor.preview-expanded .report-entry-column{display:none!important}}
.report-admin-actions{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px}.report-admin-actions button{font-size:12px;padding:5px 7px}


/* Layout polish: proportionate report details, full-screen preview, persistent header.
   Screen styles never alter the A4 print scale/typography. */
.patient-table{table-layout:fixed}
.patient-table td{overflow-wrap:normal;word-break:normal}
.patient-table .reporting-lab-value{white-space:normal;overflow-wrap:anywhere;font-size:9.25pt;letter-spacing:-.08px}
@media screen{
 .layout-content{min-width:0}
 .layout-content .topbar{position:sticky;top:0;z-index:80;background:#fff;box-shadow:0 3px 12px rgba(13,42,60,.07)}
 .layout-content{scroll-padding-top:calc(var(--rms-header-height, 130px) + 14px)}
 .layout-content .main .field,.layout-content .main .editor-section{scroll-margin-top:calc(var(--rms-header-height, 130px) + 20px)}
 .editor.resizable-editor .report-entry-column{min-width:0}
 .editor.resizable-editor .report-entry-column .grid2{grid-template-columns:repeat(2,minmax(0,1fr))}
 .editor.resizable-editor .report-entry-column .grid2>.field{min-width:0}
 .editor.resizable-editor .report-entry-column .field input,.editor.resizable-editor .report-entry-column .field select{min-width:0}
 .editor.resizable-editor .preview:not(.preview-fullscreen){top:calc(var(--rms-header-height, 130px) + 12px);max-height:calc(100dvh - var(--rms-header-height, 130px) - 24px);display:flex;flex-direction:column;overflow:hidden}
 .editor.resizable-editor .preview:not(.preview-fullscreen) .preview-tools{flex:none;flex-wrap:wrap}
 .editor.resizable-editor .preview:not(.preview-fullscreen) .preview-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
 .editor.resizable-editor .editor-resize-handle{top:calc(var(--rms-header-height, 130px) + 12px);max-height:calc(100dvh - var(--rms-header-height, 130px) - 24px)}
 body.rms-preview-modal-open{overflow:hidden}
 body.rms-preview-modal-open::before{content:"";position:fixed;inset:0;z-index:1090;background:rgba(8,28,42,.72)}
 .editor.resizable-editor .preview.preview-fullscreen{position:fixed!important;z-index:1100!important;inset:clamp(8px,2vw,22px)!important;width:auto!important;height:auto!important;max-height:none!important;top:clamp(8px,2vw,22px)!important;left:clamp(8px,2vw,22px)!important;right:clamp(8px,2vw,22px)!important;bottom:clamp(8px,2vw,22px)!important;display:flex!important;flex-direction:column;padding:clamp(12px,2vw,22px)!important;background:#edf2f5;border:1px solid #d6e0e6;border-radius:14px;box-shadow:0 18px 65px rgba(8,27,38,.35);overflow:hidden!important}
 .preview.preview-fullscreen .preview-tools{flex:0 0 auto;flex-wrap:wrap;gap:12px;background:#edf2f5}
 .preview.preview-fullscreen .preview-scroll{flex:1 1 auto;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;text-align:center}
 .preview.preview-fullscreen #live-preview{display:inline-block;text-align:left;transform-origin:top center;min-width:0}
 .preview.preview-fullscreen .paper{margin:0 auto;box-shadow:0 3px 15px rgba(12,38,52,.18)}
}
@media screen and (max-width:980px){
 .editor.resizable-editor .report-entry-column .grid2{grid-template-columns:repeat(2,minmax(0,1fr))}
 .editor.resizable-editor .preview:not(.preview-fullscreen){position:relative;top:auto;max-height:none;overflow:visible;display:block}
 .editor.resizable-editor .preview:not(.preview-fullscreen) .preview-scroll{max-height:75vh;overflow:auto}
}
@media screen and (max-width:570px){
 .editor.resizable-editor .report-entry-column .grid2{grid-template-columns:minmax(0,1fr)}
 .editor.resizable-editor .preview.preview-fullscreen{inset:5px!important;top:5px!important;left:5px!important;right:5px!important;bottom:5px!important;padding:8px!important}
 .preview.preview-fullscreen .preview-toolbar-actions{justify-content:flex-start}
}
@media print{
 .patient-table{table-layout:fixed}
 .patient-table .reporting-lab-value{white-space:normal;overflow-wrap:anywhere;font-size:9pt}
 body.rms-preview-modal-open{overflow:visible!important}
 body.rms-preview-modal-open::before{display:none!important}
 .editor.resizable-editor .preview.preview-fullscreen{position:static!important;inset:auto!important;z-index:auto!important;box-shadow:none!important}
 .layout-content .topbar{position:static!important}
}

/* Sixth round: predictable report patient-detail columns; no text may overlap adjacent fields. */
.patient-table{table-layout:fixed;width:100%;}
.patient-table col:nth-child(1){width:19%;}
.patient-table col:nth-child(2){width:41%;}
.patient-table col:nth-child(3){width:18%;}
.patient-table col:nth-child(4){width:22%;}
.patient-table td{max-width:0;overflow-wrap:anywhere;word-break:normal;}
.patient-table .reporting-lab-value{white-space:normal;overflow-wrap:anywhere;}

/* Phase 7: sample reconciliation, manual testing and independent per-test access */
.rms-module-view{display:grid;gap:18px;max-width:100%;min-width:0}
.rms-module-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.rms-module-form{display:grid;gap:16px}
.rms-module-form .field{min-width:0}
.rms-module-tests{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;border:1px solid #d8e4ec;border-radius:10px;padding:15px}
.rms-module-tests legend{padding:0 6px;font-weight:700}
.rms-module-tabs,.rms-permission-list{display:flex;gap:10px;flex-wrap:wrap}
.rms-permission-list{padding:12px 0}
.rms-module-check{display:inline-flex;align-items:center;gap:8px;padding:7px;border:1px solid #e4e9ec;border-radius:8px}
.rms-module-overdue{font-weight:700;color:#a1152b;background:#fff0f0;padding:4px 8px;border-radius:7px}
.rms-module-done{font-weight:700;color:#14643d;background:#e6f6ed;padding:4px 8px;border-radius:7px}
.rms-module-pending{color:#324962;background:#eef3f7;padding:4px 8px;border-radius:7px}
.rms-tat-input{max-width:115px}
.rms-module-view .table-wrap{overflow:auto}
@media(max-width:730px){.rms-module-grid,.rms-module-tests{grid-template-columns:minmax(0,1fr)}}
@media print{.rms-module-tabs,.rms-module-form{display:none!important}}

/* Phase 8: independent sidebar navigation scroll; brand and controls stay fixed. */
@media screen and (min-width:761px){
 .layout .sidebar{display:flex;flex-direction:column;height:100dvh;max-height:100dvh;min-height:0;overflow:hidden}
 .layout .sidebar .sidebar-toggle,.layout .sidebar .brand,.layout .sidebar .nav-label,.layout .sidebar .sidebar-foot{flex-shrink:0}
 .layout .sidebar nav,.layout.sidebar-collapsed .sidebar nav{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#64899c transparent;gap:6px}
 .layout .sidebar nav::-webkit-scrollbar{width:6px}
 .layout .sidebar nav::-webkit-scrollbar-thumb{background:#64899c;border-radius:10px}
 .layout.sidebar-collapsed .sidebar nav button{flex:0 0 auto}
 .layout .sidebar-foot{margin-top:auto}
}
/* Phase 8: daily receipt/release/TAT indicator cards. */
/* Fix 10: Five equal daily tracking cards in one desktop row.
   On narrow desktop content widths the row scrolls horizontally rather than
   squeezing the text or stacking the fifth card beneath the others.
   This is CSS-only: existing data loading and click handlers remain intact. */
.rms-daily-grid{display:grid;grid-template-columns:repeat(5,minmax(178px,1fr));gap:12px;margin:0 0 20px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:thin;padding:4px 4px 8px}
.rms-daily-tile{border-radius:13px;padding:17px 18px;border:1px solid;min-height:118px;text-align:left;width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:7px;box-shadow:none;transition:transform .15s,box-shadow .15s}
.rms-daily-tile:focus-visible,.rms-daily-tile:hover{transform:translateY(-1px);box-shadow:0 4px 12px #00000013}
.rms-daily-tile strong{font-size:31px;font-variant-numeric:tabular-nums;line-height:1.1}
.rms-daily-tile span{font-size:14px;font-weight:650}
.rms-daily-tile small{font-size:12px;font-weight:400;line-height:1.35}
.rms-daily-received{background:#eaf2ff;border-color:#bcd4fb;color:#1d4ed8}
.rms-daily-reported{background:#eaf8ef;border-color:#b9e4c7;color:#18703b}
.rms-daily-pending{background:#fff0f1;border-color:#f4c5cb;color:#b42337}
.rms-daily-note{font-size:13px;color:var(--muted);margin:-5px 0 22px}
.rms-daily-tile[aria-pressed="true"]{outline:3px solid currentColor;outline-offset:1px}
.rms-access-denied{max-width:690px;margin:25px auto;padding:38px 24px;text-align:center;border:1px solid #ead0d4;border-radius:16px;background:#fff}
.rms-access-denied h2{color:#a12636;margin:6px 0 10px}
.rms-access-denied p{color:var(--muted)}
@media(max-width:760px){.rms-daily-grid{grid-template-columns:minmax(0,1fr);overflow-x:visible;padding:4px}.rms-daily-tile{min-height:85px}}

/* Phase 9: one testing date, editable department/OPD-IPD batch rows and running totals. */
.rms-aggregate-controls{max-width:340px}
.rms-aggregate-table{width:100%;min-width:620px}
.rms-aggregate-table th,.rms-aggregate-table td{vertical-align:middle}
.rms-aggregate-table th{white-space:nowrap;font-size:12px}
.rms-aggregate-table td input,.rms-aggregate-table td select{min-width:0;width:100%;box-sizing:border-box;font-size:13px}
.rms-aggregate-table td:first-child{min-width:170px}
.rms-aggregate-table td:nth-child(2){min-width:105px}
.rms-aggregate-table td:last-child{width:85px}
.rms-aggregate-table td:last-child button{white-space:nowrap}
.rms-aggregate-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:2px}
.rms-aggregate-summary{font-weight:650;padding:10px 13px;background:#eaf4f3;color:#1e5655;border:1px solid #c8e4e0;border-radius:9px;font-variant-numeric:tabular-nums}
.rms-aggregate-table input:invalid,.rms-aggregate-table select:invalid{outline-offset:0}
@media (max-width:760px){.rms-aggregate-controls{max-width:none}.rms-aggregate-footer{align-items:stretch;flex-direction:column}.rms-aggregate-footer button{align-self:flex-start}}

/* Phase 10: vertical centered branding and concise pinned college footer. */
@media screen and (min-width:761px){
 .layout:not(.sidebar-collapsed) .sidebar .brand{flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:11px;margin:8px 3px 17px}
 .layout:not(.sidebar-collapsed) .sidebar .brand>.college-logo{width:83px;height:83px;max-width:83px;object-fit:contain}
 .layout:not(.sidebar-collapsed) .sidebar .brand .brand-copy{width:100%;min-width:0}
 .layout:not(.sidebar-collapsed) .sidebar .brand b{font-size:15px;line-height:1.22}
 .layout:not(.sidebar-collapsed) .sidebar .brand small{display:block;font-size:11px;margin-top:6px;line-height:1.25}
 .layout .sidebar .sidebar-foot{text-align:center;padding-top:12px;line-height:1.4}
 .layout .sidebar .sidebar-foot strong{display:block;color:#ecf6f5;font-size:12px;letter-spacing:.2px}
 .layout .sidebar .sidebar-foot small{display:block;color:#a8bfcc;font-size:10px;margin-top:4px}
 .layout.sidebar-collapsed .sidebar .sidebar-foot{display:none}
}
@media screen and (max-width:760px){
 .layout .sidebar .brand{flex-direction:column;gap:6px;align-items:center;text-align:center}
 .layout .sidebar .brand>.college-logo{height:60px;width:60px;max-width:60px}
}
/* Phase 10: native datalist popups cannot match input width; use an aligned custom listbox. */
.rms-module-grid .field{min-width:0}
.rms-module-grid .rms-specimen-combo{position:relative;width:100%;max-width:100%;min-width:0}
.rms-specimen-control{display:flex;position:relative;width:100%;min-width:0}
.rms-specimen-control input{min-width:0;width:100%;padding-right:47px}
.rms-specimen-toggle{position:absolute;right:2px;top:2px;bottom:2px;width:42px;padding:0;background:transparent;border:0;border-left:1px solid #dce5e9;border-radius:0 7px 7px 0;color:#345469;font-size:21px;cursor:pointer}
.rms-specimen-toggle:hover,.rms-specimen-toggle:focus-visible{background:#eef5f8}
.rms-specimen-options{position:absolute;z-index:130;top:calc(100% + 2px);left:0;right:0;width:100%;max-height:245px;overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid #b9cfd9;border-radius:8px;box-shadow:0 9px 25px #14354724;padding:5px 0;box-sizing:border-box}
.rms-specimen-options[hidden],.rms-specimen-options button[hidden]{display:none!important}
.rms-specimen-options button{display:block;width:100%;border:0;border-radius:0;background:#fff;text-align:left;font-size:14px;line-height:1.3;color:#233847;font-weight:500;padding:10px 13px;white-space:normal;justify-content:flex-start}
.rms-specimen-options button:hover,.rms-specimen-options button:focus-visible,.rms-specimen-options button[aria-selected=true]{background:#e9f3f6;color:#124968}
/* Make a separate result column readable, with sideways scrolling at narrow widths. */
.rms-aggregate-table{min-width:800px}
.rms-aggregate-table td:first-child{min-width:165px}
.rms-aggregate-table th,.rms-aggregate-table td{font-variant-numeric:tabular-nums}

/* Phase 11: spacious, clearly labelled Manual Test Register entry cards.
   Only the presentation changes: payloads, permissions, validation and RPCs stay as in Phase 10. */
.rms-aggregate-rows{display:grid;gap:15px;counter-reset:rms-batch-entry}
.rms-agg-entry{counter-increment:rms-batch-entry;border:1px solid #cddde6;border-radius:13px;background:#f9fbfd;padding:16px 18px;min-width:0}
.rms-agg-entry-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;border-bottom:1px solid #e2e9ef;padding-bottom:10px}
.rms-agg-entry-count::before{content:"Department / OPD–IPD entry " counter(rms-batch-entry);font-size:14px;font-weight:700;color:#234760}
.rms-agg-entry-head button{min-height:35px;padding:6px 11px;font-size:13px;white-space:nowrap}
.rms-agg-fields{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:15px;row-gap:16px;align-items:end}
.rms-agg-cell{min-width:0;display:flex;flex-direction:column;gap:7px;font-size:14px;line-height:1.35;font-weight:650;color:#263e50}
.rms-agg-cell input,.rms-agg-cell select{min-width:0;width:100%;height:47px;min-height:47px;box-sizing:border-box;padding:10px 12px;border:1px solid #b9cbd7;border-radius:9px;background:#fff;color:#183345;font-size:16px;font-weight:450;box-shadow:0 1px 2px #102c400a}
.rms-agg-cell input:focus-visible,.rms-agg-cell select:focus-visible{outline:2px solid #087f82;outline-offset:2px;border-color:#087f82}
.rms-agg-cell--department{grid-column:span 6}
.rms-agg-cell--care,.rms-agg-cell--tested{grid-column:span 3}
.rms-agg-cell--positive,.rms-agg-cell--rif,.rms-agg-cell--invalid{grid-column:span 4}
.rms-agg-hiv .rms-agg-cell--department{grid-column:span 5}
.rms-agg-hiv .rms-agg-cell--care,.rms-agg-hiv .rms-agg-cell--tested{grid-column:span 2}
.rms-agg-hiv .rms-agg-cell--positive{grid-column:span 3}
.rms-aggregate-controls{max-width:390px}
.rms-module-form .rms-module-grid .field input,.rms-module-form .rms-module-grid .field select{width:100%;min-width:0;min-height:45px}
@media screen and (max-width:900px){
 .rms-agg-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
 .rms-agg-entry .rms-agg-cell{grid-column:span 1}
 .rms-agg-entry .rms-agg-cell--department{grid-column:1/-1}
}
@media screen and (max-width:440px){
 .rms-agg-entry{padding:13px}
 .rms-agg-fields{grid-template-columns:minmax(0,1fr)}
 .rms-agg-entry .rms-agg-cell{grid-column:1/-1}
}

/* Consolidated RMS usability update — responsive containers; print styling unchanged */
@media screen{
 .rms-overview-cards{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
 .rms-overview-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;cursor:pointer;max-width:100%;font:inherit}
 .rms-overview-card.rms-active{border:2px solid #2563eb;background:#eaf3ff}
 .rms-overview-card:hover{border-color:#6c9dca}
 .rms-registered-picker,.rms-report-queue{margin:16px 0}
 .rms-picker-line{display:flex;gap:10px;align-items:center}
 .rms-picker-line input{flex:1;min-width:0}
 .rms-result{width:100%;display:flex;align-items:center;gap:15px;text-align:left;justify-content:space-between;background:#f8fbfd;border:1px solid #e2e8ee;padding:12px;border-radius:9px;margin:5px 0}
 .rms-result:hover{background:#eaf3ff}
 .rms-status-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:9px;margin-bottom:16px}
 .rms-status-counter{border:1px solid #d9e5ef;padding:10px 12px;border-radius:9px;display:flex;flex-direction:column;background:#f7fafc}
 .rms-status-counter strong{font-size:22px;color:#213c50}
 .rms-status-counter span{font-size:12px;color:#50677c}
 .rms-stage{display:inline-block;border:1px solid #d5dfe7;border-radius:7px;padding:5px 9px;color:#425c6f;background:#f4f7f9;font-size:12px}
 .rms-stage-validated{color:#1654ad;background:#e6f0ff;border-color:#b8d3ff}
 button.rms-print-ready,.rms-print-ready{background:#167545!important;color:white!important;border:1px solid #167545!important}
 button.rms-print-ready:hover{background:#12623b!important}
 .rms-urine-field{border:1px solid #d9e1e8;border-radius:9px;padding:10px;display:grid;gap:7px;min-width:0}
 .rms-urine-field select,.rms-urine-field input{min-width:0;width:100%}
 .rms-urine-numbers{display:flex;gap:10px}
 .rms-urine-numbers input{flex:1}
 .rms-notifications{padding:14px;border:1px solid #d7e5ed;border-radius:10px;background:#fafcfd;margin-top:16px}
 .rms-notifications summary{cursor:pointer;font-weight:600}
 .rms-notifications fieldset{border:none;min-width:0;margin-top:12px}
 .rms-specimen-options[hidden],.rms-other-dept[hidden]{display:none!important}
 .rms-sample-mobile{display:none}
 .rms-sample-actions{display:flex;flex-wrap:wrap;gap:5px}
 .rms-daily-history{border:1px solid #dce5ef;border-radius:9px;margin:12px 0;overflow:hidden}
 .rms-daily-history>summary{padding:12px 14px;cursor:pointer;font-weight:600;background:#f5f9fc}
 .rms-daily-history .table-wrap{margin:10px;max-width:calc(100% - 20px)}
 .rms-daily-total{background:#e9f1f8;font-weight:700}
 .rms-module-form .field select,.rms-agg-cell select{min-width:0;width:100%;box-sizing:border-box}
 .report-actions-bottom{display:flex!important;flex-wrap:wrap;gap:8px}
 .rms-report-queue .table-wrap{max-width:100%;overflow-x:auto}
 .layout,.layout-content,.main,.editor,.card,.rms-module-view,.rms-module-form{min-width:0;max-width:100%}
}
@media screen and (max-width:980px){
 .editor.resizable-editor .preview:not(.preview-fullscreen){height:auto;max-height:none!important;overscroll-behavior:auto!important;position:static!important}
 .editor.resizable-editor .preview:not(.preview-fullscreen) .preview-scroll{max-height:none!important;overflow-x:auto!important;overflow-y:visible!important;overscroll-behavior:auto!important;touch-action:pan-x pan-y}
 .editor.resizable-editor .preview:not(.preview-fullscreen) #live-preview{width:max-content;max-width:none}
 .report-view{overflow-x:auto;overscroll-behavior-x:contain;overscroll-behavior-y:auto}
 .rms-sample-desktop{display:none!important}
 .rms-sample-mobile{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));gap:12px}
 .rms-sample-card{border:1px solid #dce4ec;border-radius:10px;padding:14px;display:grid;gap:8px;overflow-wrap:anywhere}
 .rms-sample-card small{display:block;color:#546878}
 .rms-sample-card p{margin:3px 0}
 .rms-sample-card .rms-sample-actions button{flex:1 1 auto}
}
@media screen and (max-width:570px){
 .rms-picker-line{flex-wrap:wrap}
 .rms-picker-line button{width:100%}
 .rms-result{flex-wrap:wrap}
 .rms-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .rms-module-form input,.rms-module-form select{max-width:100%}
}
@media print{.rms-registered-picker,.rms-report-queue,.rms-overview-cards,.rms-report-queue button{display:none!important}}

.rms-provisional-overdue{display:inline-block;color:#8b5200;background:#fff2d9;border-radius:7px;padding:4px 8px;font-size:12px;font-weight:600}

/* Follow-up: unfinished investigation work queue, report issuance and aligned identifiers. */
@media screen{
 .rms-registered-picker{border-radius:14px;overflow:hidden;border:1px solid #d9e4ed;box-shadow:0 1px 3px rgba(20,48,73,.04)}
 .rms-registered-picker .card-head{gap:15px;align-items:flex-start;flex-wrap:wrap}
 .rms-registered-picker .card-head p{margin:6px 0 0}
 .rms-pending-search{flex:1 1 240px;min-width:0}
 .rms-pending-search input{width:100%;border-radius:10px}
 .rms-picker-line{align-items:end}
 .rms-match-list{border:1px solid #e1e9f0;border-radius:12px;margin-top:14px;background:#fff;overflow:hidden}
 .rms-pending-results{max-height:425px;overflow-y:auto;overscroll-behavior:contain;padding:3px 8px}
 .rms-pending-row{display:grid;grid-template-columns:minmax(120px,1.15fr) minmax(150px,1.2fr) minmax(155px,1.4fr) auto;gap:12px;align-items:center;max-width:100%;margin:4px 0;padding:13px 12px;border-radius:9px}
 .rms-pending-row>span{display:grid;gap:5px;min-width:0;overflow-wrap:anywhere}
 .rms-pending-row b{font-size:13px;font-weight:650;color:#284356}
 .rms-pending-row small{font-size:12px;color:#5c7080;line-height:1.35}
 .rms-pending-action{justify-self:end;color:#165b78;font-size:13px;white-space:nowrap;font-weight:650}
 .rms-pending-summary,.rms-pending-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;flex-wrap:wrap}
 .rms-pending-summary{background:#f5f9fc;border-bottom:1px solid #e0e8ee;font-size:13px}
 .rms-pending-summary small{color:#607484}
 .rms-pending-pagination{border-top:1px solid #e0e8ee;background:#fbfdff;font-size:13px}
 .rms-pending-state{padding:16px;margin:0}
 .rms-report-status-table td:first-child{min-width:140px}
 .rms-report-status-table td:first-child small{display:block;margin-top:5px;white-space:normal;overflow-wrap:anywhere}
 .rms-report-date-column{min-width:135px;vertical-align:top}
 .rms-report-date-column time{display:block;white-space:nowrap}
 .rms-report-date-column small{display:block;margin-top:5px;white-space:nowrap;color:#607484}
 .rms-report-date-sort{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;text-align:left;white-space:nowrap;border-radius:3px}
 .rms-report-date-sort:hover{background:transparent;color:#165b78}
 .rms-report-date-sort:focus-visible{outline:2px solid #165b78;outline-offset:4px}
 .rms-report-row-actions{flex-wrap:wrap;align-items:center}
 .rms-issue-action{border-color:#a8c1d4;background:#f0f6fb;color:#26516c;font-weight:600}
 .rms-issue-action:hover{background:#e6f0f8}
 .rms-issued-done{display:inline-flex;align-items:center;padding:6px 9px;border:1px solid #bfd4ce;border-radius:7px;font-size:12px;color:#246b4c;background:#f3faf6}
}
@media screen and (max-width:920px){
 .rms-pending-row{grid-template-columns:repeat(2,minmax(0,1fr))}
 .rms-pending-action{justify-self:start}
}
@media screen and (max-width:520px){
 .rms-pending-row{grid-template-columns:minmax(0,1fr);gap:8px}
 .rms-pending-results{max-height:440px}
 .rms-registered-picker{padding:14px}
}

/* Post-consolidation compact autocomplete and non-blocking activity indicators. */
.rms-picker-combo{position:relative;isolation:isolate;max-width:100%}
.rms-picker-combo .rms-pending-search{display:block;min-width:0;max-width:none;width:100%}
.rms-picker-combo .rms-pending-search input{width:100%;max-width:100%;border-radius:10px;min-height:44px;padding-right:15px}
.rms-pending-dropdown{position:absolute;z-index:35;top:calc(100% + 5px);left:0;right:0;min-width:0;max-width:100%;border:1px solid #cbdce7;border-radius:12px;background:#fff;box-shadow:0 12px 34px rgba(25,52,75,.16);overflow:hidden}
.rms-pending-dropdown[hidden]{display:none!important}
.rms-pending-dropdown .rms-pending-results{max-height:370px;overflow-y:auto;overscroll-behavior:contain;padding:4px 7px}
.rms-pending-dropdown .rms-pending-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;width:100%;max-width:none;border:0;border-bottom:1px solid #e9eef2;border-radius:7px;text-align:left;background:#fff;padding:11px 12px;font:inherit;cursor:pointer}
.rms-pending-dropdown .rms-pending-row:last-child{border-bottom:0}
.rms-pending-dropdown .rms-pending-row:hover,.rms-pending-dropdown .rms-pending-row:focus-visible{background:#f1f8fc;outline:2px solid #a5cee0;outline-offset:-2px}
.rms-pending-facts{display:flex;flex-wrap:wrap;gap:4px 14px;min-width:0;flex:1;color:#30495a;font-size:12px;line-height:1.45;overflow-wrap:anywhere}
.rms-pending-facts>span{display:inline-block;min-width:0}
.rms-pending-facts>span:first-child{font-weight:650;color:#193e54}
.rms-pending-facts b{font-weight:650;color:#526d7f}
.rms-pending-dropdown .rms-pending-action{flex:none;color:#17617f;justify-self:end;font-size:12px}
.rms-pending-dropdown .rms-pending-pagination,.rms-pending-dropdown .rms-pending-summary{padding:9px 12px}
.rms-mini-spinner{display:inline-block;vertical-align:middle;width:14px;height:14px;border:2px solid #d8e7ef;border-top-color:#167b8a;border-radius:50%;animation:rms-spin .8s linear infinite}
.rms-session-restore{min-height:100dvh;display:flex;align-items:center;justify-content:center;background:#f5f8fa}
.rms-loader-circle{display:block;width:27px;height:27px;border-radius:50%;border:3px solid #dce8ef;border-top-color:#197a85;animation:rms-spin .85s linear infinite}
#rms-activity-indicator{position:fixed;top:76px;right:24px;z-index:140;background:rgba(255,255,255,.96);border:1px solid #d6e4e9;box-shadow:0 3px 18px rgba(21,44,61,.14);border-radius:100px;display:grid;place-items:center;width:44px;height:44px;pointer-events:none}
#rms-activity-indicator[hidden]{display:none!important}
#rms-activity-indicator .rms-loader-circle{width:23px;height:23px;border-width:3px}
.rms-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes rms-spin{to{transform:rotate(360deg)}}
@media(max-width:620px){.rms-pending-dropdown .rms-pending-row{align-items:flex-start;flex-direction:column;gap:6px}.rms-pending-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 9px;width:100%}.rms-pending-facts>span:first-child,.rms-pending-facts>span:last-child{grid-column:1/-1}#rms-activity-indicator{top:70px;right:15px}}
@media(prefers-reduced-motion:reduce){.rms-loader-circle,.rms-mini-spinner{animation-duration:2s}}
@media print{#rms-activity-indicator{display:none!important}}
/* Keep the autocomplete menu outside the selector card, above the editor below. */
@media screen{.rms-registered-picker{position:relative;z-index:25;overflow:visible}}


/* Single-line pending investigation choices: patient | age | sex | official Lab ID | Tracking ID | specimen | test.
   Keep each result on exactly one row. Small screens scroll *inside* the dropdown horizontally. */
.rms-pending-dropdown .rms-pending-results{overflow-x:auto;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.rms-pending-dropdown .rms-pending-row{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:12px;min-width:100%;width:max-content;max-width:none;white-space:nowrap}
.rms-pending-dropdown .rms-pending-row .rms-pending-facts{display:inline-flex;flex-direction:row;flex-wrap:nowrap;align-items:center;flex:none;min-width:max-content;width:max-content;gap:8px;white-space:nowrap;overflow-wrap:normal}
.rms-pending-dropdown .rms-pending-facts>span{display:inline;flex:none;min-width:0;grid-column:auto;white-space:nowrap;overflow-wrap:normal}
.rms-pending-dropdown .rms-pending-facts .rms-pending-separator{color:#9dafba;font-weight:400}
.rms-pending-dropdown .rms-pending-row .rms-pending-action{flex:none;margin-left:auto;color:#17617f;font-size:18px;line-height:1}
@media(max-width:620px){.rms-pending-dropdown .rms-pending-row{flex-direction:row;align-items:center;gap:10px}.rms-pending-dropdown .rms-pending-facts{display:inline-flex;flex-direction:row;flex-wrap:nowrap;width:max-content}}

/* 22 October RMS follow-up: center the delayed action spinner on every viewport.
   Overrides all earlier upper-right and phone-specific positioning rules. */
@media screen{
 #rms-activity-indicator{position:fixed;top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);width:46px;height:46px;z-index:180;pointer-events:none;}
}

/* Preview workspace widening (23 Oct follow-up): give A4 preview the larger
   share of unused desktop space. PDF and @media print rules are unaffected. */
@media screen and (min-width:981px){
 .editor.resizable-editor{grid-template-columns:minmax(0,var(--entry-width,43%)) 10px minmax(0,1fr)}
 .editor.resizable-editor .preview:not(.preview-fullscreen){min-width:0}
 .editor.resizable-editor .preview:not(.preview-fullscreen) .preview-scroll{width:100%;max-width:100%;min-width:0}
}
@media screen{
 .preview-toolbar-actions [data-action="preview-fit"][aria-pressed="true"]{background:#e4f2f3;border-color:#a4cfd1;color:#145d68}
}
/* On narrow laptops use full-width stacked panels instead of two cramped columns. */
@media screen and (min-width:981px) and (max-width:1199px){
 .editor.resizable-editor{display:block!important}
 .editor.resizable-editor .report-entry-column{padding-right:0}
 .editor.resizable-editor .editor-resize-handle{display:none}
 .editor.resizable-editor .preview:not(.preview-fullscreen){position:static!important;top:auto!important;max-height:none!important;display:block!important;overflow:visible!important;padding-left:17px}
 .editor.resizable-editor .preview:not(.preview-fullscreen) .preview-scroll{max-height:75vh;overflow:auto;overscroll-behavior:auto}
}

.rms-morphology-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:10px;border:1px solid #dce5e9;border-radius:8px;padding:12px}.rms-culture-review{margin-top:16px;border:1px solid #b8dce5;border-left:4px solid #087f82;padding:12px 14px;border-radius:7px;background:#f7fbfd}.rms-culture-review p{margin:6px 0 0}.rms-urine-field{min-width:0}

.hiv-module-card{margin-top:22px;border-top:3px solid #286090}.hiv-privacy-heading{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:16px}.hiv-privacy-heading h2{margin:0 0 6px}.hiv-privacy-heading span{font-size:11px;color:#8e3949;font-weight:700}.hiv-access{border:1px solid #c4dce6;background:#f7fbfd;padding:16px;border-radius:10px;margin-bottom:18px}.hiv-role-permissions{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin:14px 0}.hiv-confidential-form{margin-top:22px;padding:17px;border:1px solid #a9c4d1;border-radius:10px}.hiv-form-heading{text-align:center;border-bottom:1px solid #b6ccd6;padding-bottom:10px;margin-bottom:12px}.hiv-form-heading span{display:block;font-size:12px}.hiv-confidential-form fieldset{border:0;padding:0}.hiv-confidential-form .hiv-interp{border:1px solid #dce5e9;padding:12px;margin-bottom:14px}.hiv-confidential-form .hiv-interp .check{margin:8px 0}.hiv-tests input,.hiv-tests select{width:100%;min-width:115px;padding:8px;border:1px solid #d0dfe5;border-radius:5px}.hiv-report-list{margin-top:20px}.hiv-confidential-form .grid3{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}@media(max-width:700px){.hiv-privacy-heading{flex-direction:column;align-items:flex-start}}

/* Round 12 print-only refinement (22 October 2026): do not shift an entire
   positive culture + AST block to the next page. Allow page breaks between
   table rows, never within one result row or the authorization block. */
.ast-compact-tables{display:none}
@media print{
  .paper .isolate-result{break-inside:auto!important;page-break-inside:auto!important}
  .paper .isolate-result>.report-observed-finding{break-after:avoid;page-break-after:avoid}
  .paper .isolate-result>.report-section-title{break-after:avoid}
  .paper .ast-method{break-after:avoid;page-break-after:avoid}
  .paper .ast-print-layout:not(.is-compact)>.ast-single-table{display:table}
  .paper .ast-print-layout.is-compact>.ast-single-table{display:none!important}
  .paper .ast-print-layout.is-compact>.ast-compact-tables{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:8px;width:100%;break-inside:avoid}
  .paper .ast-half-table{font-size:8.1pt!important;line-height:1.12;table-layout:fixed;margin:5px 0!important;width:100%}
  .paper .ast-half-table th,.paper .ast-half-table td{padding:3px 3px!important;overflow-wrap:anywhere;hyphens:auto;vertical-align:top}
  .paper .ast-half-table th:first-child,.paper .ast-half-table td:first-child{width:11%}
  .paper .ast-half-table th:nth-child(2),.paper .ast-half-table td:nth-child(2){width:48%}
  .paper .ast-half-table th:nth-child(3),.paper .ast-half-table td:nth-child(3){width:41%}
}

/* Shared screen-preview and print A4 layout for single-isolate culture AST.
   Uses identical compact structure in both media; only screen paper framing differs. */
.paper.rms-single-isolate-a4 .letterhead{margin-bottom:6px!important;padding-bottom:6px!important}
.paper.rms-single-isolate-a4 .patient-table{margin-top:7px!important;margin-bottom:7px!important;font-size:9pt!important}
.paper.rms-single-isolate-a4 .patient-table td{padding:3px 5px!important}
.paper.rms-single-isolate-a4 .report-title{margin:7px 0 8px!important}
.paper.rms-single-isolate-a4 .report-section-title{margin:6px 0 3px!important}
.paper.rms-single-isolate-a4 .report-body p{font-size:10pt!important;line-height:1.24!important;margin:3px 0!important}
.paper.rms-single-isolate-a4 .report-notes{font-size:8.4pt!important;line-height:1.25!important;margin:4px 0!important}
.paper.rms-single-isolate-a4 .report-notes li{margin:2px 0!important}
.paper.rms-single-isolate-a4 .result-table{margin:5px 0!important;font-size:9pt!important}
.paper.rms-single-isolate-a4 .result-table td,.paper.rms-single-isolate-a4 .result-table th{padding:3px 5px!important;line-height:1.15!important}
.paper.rms-single-isolate-a4 .signatures{margin-top:10px!important;padding-top:7px!important}
.paper.rms-single-isolate-a4 .version-line{margin-top:6px!important}
.paper.rms-single-isolate-a4 .ast-compact-tables{display:none}
.paper.rms-single-isolate-a4 .ast-print-layout.is-compact>.ast-single-table{display:none!important}
.paper.rms-single-isolate-a4 .ast-print-layout.is-compact>.ast-compact-tables{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;align-items:start}
.paper.rms-single-isolate-a4 .ast-half-table{width:100%;table-layout:fixed;font-size:8.1pt!important;margin:4px 0!important}
.paper.rms-single-isolate-a4 .ast-half-table td,.paper.rms-single-isolate-a4 .ast-half-table th{padding:3px!important;overflow-wrap:anywhere;hyphens:auto}
.paper.rms-single-isolate-a4 .ast-half-table th:first-child,.paper.rms-single-isolate-a4 .ast-half-table td:first-child{width:11%}
.paper.rms-single-isolate-a4 .ast-half-table th:nth-child(2),.paper.rms-single-isolate-a4 .ast-half-table td:nth-child(2){width:49%}
.paper.rms-single-isolate-a4 .ast-half-table th:nth-child(3),.paper.rms-single-isolate-a4 .ast-half-table td:nth-child(3){width:40%}
@media screen{#live-preview .paper.rms-single-isolate-a4{padding:14mm 14mm;min-height:297mm;max-width:210mm}}
@media print{#print-root .paper.rms-single-isolate-a4{padding:0!important;min-height:0!important;max-width:none!important}}

/* ===================================================================
   Round 12 A4 stability fix: the SAME sheet for editor / expanded / print.
   Applies ONLY to single-isolate culture reports with AST. Do not change
   other laboratory formats or confidential HIV output.
   =================================================================== */
@page{size:A4;margin:14mm 16mm 13mm}
@media screen{
  #live-preview .paper.rms-ast-a4,
  .report-view .paper.rms-ast-a4,
  .preview .paper.rms-ast-a4{
    width:210mm!important;min-width:210mm!important;max-width:210mm!important;
    padding:14mm 16mm 13mm!important;min-height:297mm!important;
    box-sizing:border-box!important;
  }
}
@media print{
  #print-root .paper.rms-ast-a4{
    width:100%!important;max-width:none!important;min-width:0!important;
    min-height:0!important;padding:0!important;margin:0!important;
    box-shadow:none!important;overflow:visible!important;
  }
  #print-root .paper.rms-ast-a4 .report-ending{break-inside:auto!important;page-break-inside:auto!important}
  #print-root .paper.rms-ast-a4 .signatures{break-inside:avoid!important;page-break-inside:avoid!important}
}
/* The visible A4 sheet and the printed A4 content have identical 178mm text
   width and use the same inner typography/vertical spacing. */
.paper.rms-ast-a4{font-size:10pt!important;line-height:1.24!important}
.paper.rms-ast-a4 .letterhead{gap:12px!important;margin:0 0 6px!important;padding:0 0 6px!important}
.paper.rms-ast-a4 .letterhead>.college-logo{width:60px!important;height:60px!important}
.paper.rms-ast-a4 .letterhead .letterhead-department{font-size:13.5pt!important;line-height:1.12!important}
.paper.rms-ast-a4 .letterhead .letterhead-college{font-size:10.5pt!important;line-height:1.18!important;white-space:normal!important}
.paper.rms-ast-a4 .letterhead .letterhead-contact{font-size:8pt!important;line-height:1.15!important}
.paper.rms-ast-a4 .letterhead .continuation-id{font-size:8pt!important;line-height:1.15!important;margin:3px 0 0!important}
.paper.rms-ast-a4 .report-title{font-size:12pt!important;margin:8px 0!important}
.paper.rms-ast-a4 .patient-table{width:100%!important;font-size:9pt!important;margin:0 0 8px!important}
.paper.rms-ast-a4 .patient-table td{padding:3px 5px!important}
.paper.rms-ast-a4 .report-section-title,.paper.rms-ast-a4 .notes-title{font-size:10pt!important;margin:8px 0 3px!important;padding-bottom:2px!important}
.paper.rms-ast-a4 .report-body p{font-size:10pt!important;line-height:1.26!important;margin:4px 0!important}
.paper.rms-ast-a4 .result-table{font-size:9pt!important;margin:5px 0!important}
.paper.rms-ast-a4 .result-table td,.paper.rms-ast-a4 .result-table th{padding:3px 5px!important;line-height:1.18!important}
.paper.rms-ast-a4 .ast-method{font-size:8.8pt!important;line-height:1.22!important}
.paper.rms-ast-a4 .report-notes{font-size:8.7pt!important;line-height:1.25!important;margin:4px 0 7px!important}
.paper.rms-ast-a4 .report-notes li{margin:2px 0!important}
.paper.rms-ast-a4 .end-report{font-size:9pt!important;margin:8px 0 5px!important}
.paper.rms-ast-a4 .signatures{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:9px!important;break-inside:avoid!important;width:100%!important;
  font-size:8.3pt!important;margin:10px 0 0!important;padding:8px 0 0!important;
  border-top:1px solid #8597a2!important;
}
.paper.rms-ast-a4 .signatures>div{display:block!important;padding:0!important;min-width:0;overflow-wrap:anywhere}
.paper.rms-ast-a4 .signatures .staff-name{font-weight:700!important}
.paper.rms-ast-a4 .signatures small{font-size:7.7pt!important}
.paper.rms-ast-a4 .version-line{font-size:7.8pt!important;margin:8px 0 0!important}
/* Default: one full-width susceptibility table. */
.paper.rms-ast-a4 .ast-compact-tables{display:none!important}
.paper.rms-ast-a4 .ast-print-layout:not(.is-compact)>.ast-single-table{display:table!important}
/* Two columns ONLY when a fixed-A4 height check selects this mode. */
.paper.rms-ast-a4 .ast-print-layout.is-compact>.ast-single-table{display:none!important}
.paper.rms-ast-a4 .ast-print-layout.is-compact>.ast-compact-tables{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:start!important;gap:8px!important;break-inside:auto!important;
}
.paper.rms-ast-a4 .ast-half-table{width:100%!important;table-layout:fixed!important;font-size:8.0pt!important;margin:3px 0!important}
.paper.rms-ast-a4 .ast-half-table th,.paper.rms-ast-a4 .ast-half-table td{padding:3px!important;overflow-wrap:anywhere;hyphens:auto}
.paper.rms-ast-a4 .ast-half-table th:first-child,.paper.rms-ast-a4 .ast-half-table td:first-child{width:11%}
.paper.rms-ast-a4 .ast-half-table th:nth-child(2),.paper.rms-ast-a4 .ast-half-table td:nth-child(2){width:49%}
.paper.rms-ast-a4 .ast-half-table th:nth-child(3),.paper.rms-ast-a4 .ast-half-table td:nth-child(3){width:40%}
/* Increasingly economical modes; values match in preview and print. */
.paper.rms-ast-a4.rms-ast-tight .report-title{margin:5px 0!important}
.paper.rms-ast-a4.rms-ast-tight .report-section-title{margin:5px 0 2px!important}
.paper.rms-ast-a4.rms-ast-tight .patient-table{margin-bottom:5px!important}
.paper.rms-ast-a4.rms-ast-tight .report-body p{margin:2px 0!important}
.paper.rms-ast-a4.rms-ast-two-col-tight .report-body p,
.paper.rms-ast-a4.rms-ast-two-col-dense .report-body p{margin:2px 0!important;line-height:1.18!important}
.paper.rms-ast-a4.rms-ast-two-col-tight .report-section-title,
.paper.rms-ast-a4.rms-ast-two-col-dense .report-section-title{margin:5px 0 2px!important}
.paper.rms-ast-a4.rms-ast-two-col-tight .patient-table,
.paper.rms-ast-a4.rms-ast-two-col-dense .patient-table{margin-bottom:5px!important}
.paper.rms-ast-a4.rms-ast-two-col-dense .ast-half-table{font-size:7.5pt!important}
.paper.rms-ast-a4.rms-ast-two-col-dense .ast-half-table th,
.paper.rms-ast-a4.rms-ast-two-col-dense .ast-half-table td{padding:2px!important}
/* Fixed printable-width measurement: NEVER uses the editor panel width. */
.rms-a4-measure{
  position:fixed!important;left:-20000px!important;top:0!important;
  width:178mm!important;visibility:hidden!important;pointer-events:none!important;
  z-index:-1!important;
}
.rms-a4-measure>.paper.rms-ast-a4{
  width:178mm!important;min-width:0!important;max-width:none!important;
  margin:0!important;padding:0!important;min-height:0!important;
  box-shadow:none!important;overflow:visible!important;
}
/* Multi-isolate AST: allow natural continuation pages. Never trap the
   signatures inside an unsplittable table cell at print time. */
@media print{
  #print-root .paper.rms-ast-flow .report-ending{break-inside:auto!important;page-break-inside:auto!important}
  #print-root .paper.rms-ast-flow .signatures{break-inside:avoid!important;page-break-inside:avoid!important}
}


/* Lab RMS Round 12 - culture/AST pagination correction, 22 Oct 2026.
   Only modern culture reports use this class. Older templates, confidential
   HIV material, report forms and unrelated site modules are unchanged. */
.paper.rms-culture-flow .report-culture-medium {
  margin:3px 0 4px!important;
  line-height:1.24!important;
  overflow-wrap:anywhere;
}
@media print {
  /* Modern culture reports are no longer trapped in a single table-cell.
     All culture narratives and individual AST rows may break naturally. */
  #print-root .paper.rms-culture-flow,
  #print-root .paper.rms-culture-flow .report-body,
  #print-root .paper.rms-culture-flow .isolate-result,
  #print-root .paper.rms-culture-flow .report-ending {
    break-inside:auto!important;
    page-break-inside:auto!important;
  }
  #print-root .paper.rms-culture-flow .report-culture-medium {
    break-before:auto!important;
    page-break-before:auto!important;
    break-inside:auto!important;
    page-break-inside:auto!important;
    break-after:auto!important;
    page-break-after:auto!important;
    orphans:2;
    widows:2;
    margin:2px 0 3px!important;
  }
  #print-root .paper.rms-culture-flow .report-section-title,
  #print-root .paper.rms-culture-flow .notes-title {
    break-after:avoid!important;
    page-break-after:avoid!important;
  }
  #print-root .paper.rms-culture-flow .result-table thead {
    display:table-header-group;
  }
  #print-root .paper.rms-culture-flow .result-table tr {
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  #print-root .paper.rms-culture-flow .signatures {
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
}

/* Report-consistent two-column choice for multiple isolates, only when fixed
   A4 measurement shows an avoidable continuation page. Isolate tables remain
   distinct and their original row data are retained verbatim. */
.paper.rms-ast-flow .ast-print-layout:not(.is-compact)>.ast-single-table{display:table!important}
.paper.rms-ast-flow .ast-print-layout.is-compact>.ast-single-table{display:none!important}
.paper.rms-ast-flow .ast-print-layout.is-compact>.ast-compact-tables{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  width:100%!important;gap:8px!important;align-items:start!important;
  break-inside:auto!important;page-break-inside:auto!important;
}
.paper.rms-ast-flow .ast-half-table{width:100%!important;table-layout:fixed!important;font-size:8.0pt!important}
.paper.rms-ast-flow .ast-half-table td,.paper.rms-ast-flow .ast-half-table th{padding:3px!important;overflow-wrap:anywhere}
.paper.rms-ast-flow .ast-half-table th:first-child,.paper.rms-ast-flow .ast-half-table td:first-child{width:11%}
.paper.rms-ast-flow .ast-half-table th:nth-child(2),.paper.rms-ast-flow .ast-half-table td:nth-child(2){width:49%}
.paper.rms-ast-flow .ast-half-table th:nth-child(3),.paper.rms-ast-flow .ast-half-table td:nth-child(3){width:40%}
.rms-a4-measure>.paper.rms-ast-flow{
  width:178mm!important;min-width:0!important;max-width:none!important;
  margin:0!important;padding:0!important;min-height:0!important;
  box-shadow:none!important;overflow:visible!important;
}

/* Round12 v5 print parity for modern culture reports only. The combined
   culture introductory statement + first observed growth is the only element
   kept together; the isolate's susceptibility table may flow to other pages. */
.paper.rms-culture-flow .report-culture-opening {
  display:block!important;
  break-inside:avoid!important;page-break-inside:avoid!important;
  margin:0 0 3px!important;
}
.paper.rms-culture-flow .report-culture-opening p{
  margin:2px 0!important;line-height:1.24!important;
}
.paper.rms-culture-flow .report-culture-opening .report-observed-finding{
  break-after:auto!important;page-break-after:auto!important;
}
.paper.rms-culture-flow .isolate-result,
.paper.rms-culture-flow .report-body,
.paper.rms-culture-flow .report-ending{
  break-inside:auto!important;page-break-inside:auto!important;
}
.paper.rms-culture-flow .ast-print-layout:not(.is-compact)>.ast-single-table {display:table!important}
.paper.rms-culture-flow .ast-print-layout:not(.is-compact)>.ast-compact-tables {display:none!important}
.paper.rms-culture-flow .ast-print-layout.is-compact>.ast-single-table{display:none!important}
.paper.rms-culture-flow .ast-print-layout.is-compact>.ast-compact-tables{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:7px!important;align-items:start!important;break-inside:auto!important;
  page-break-inside:auto!important;
}
/* Use one typography and block spacing system for both onscreen previews and
   actual print media, specifically for modern culture reports. */
.paper.rms-culture-flow{font-size:10pt!important;line-height:1.22!important}
.paper.rms-culture-flow .letterhead{margin:0 0 6px!important;padding:0 0 6px!important;gap:12px!important}
.paper.rms-culture-flow .letterhead>.college-logo{width:60px!important;height:60px!important}
.paper.rms-culture-flow .letterhead-department{font-size:13.5pt!important;line-height:1.12!important}
.paper.rms-culture-flow .letterhead-college{font-size:10.5pt!important;line-height:1.18!important}
.paper.rms-culture-flow .letterhead-contact,.paper.rms-culture-flow .continuation-id{font-size:8pt!important;line-height:1.15!important}
.paper.rms-culture-flow .report-title{font-size:12pt!important;margin:8px 0!important}
.paper.rms-culture-flow .patient-table{width:100%!important;font-size:9pt!important;margin:0 0 7px!important}
.paper.rms-culture-flow .patient-table td{padding:3px 5px!important}
.paper.rms-culture-flow .report-section-title,.paper.rms-culture-flow .notes-title{font-size:10pt!important;margin:6px 0 3px!important;padding-bottom:2px!important}
.paper.rms-culture-flow .report-body p{font-size:10pt!important;line-height:1.24!important;margin:3px 0!important}
.paper.rms-culture-flow .report-notes{font-size:8.7pt!important;line-height:1.24!important;margin:4px 0 6px!important}
.paper.rms-culture-flow .report-notes li{margin:2px 0!important}
.paper.rms-culture-flow .ast-method{font-size:8.7pt!important;line-height:1.2!important}
.paper.rms-culture-flow .result-table{font-size:9pt!important;margin:5px 0!important}
.paper.rms-culture-flow .result-table td,.paper.rms-culture-flow .result-table th{padding:3px 5px!important;line-height:1.16!important}
.paper.rms-culture-flow .ast-half-table{font-size:8.05pt!important;margin:3px 0!important;table-layout:fixed!important;width:100%!important}
.paper.rms-culture-flow .ast-half-table td,.paper.rms-culture-flow .ast-half-table th{padding:3px!important;hyphens:auto;overflow-wrap:anywhere}
.paper.rms-culture-flow .end-report{font-size:9pt!important;margin:8px 0 5px!important}
.paper.rms-culture-flow .signatures{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:9px!important;break-inside:avoid!important;page-break-inside:avoid!important;width:100%!important;font-size:8.3pt!important;margin:9px 0 0!important;padding:7px 0 0!important}
.paper.rms-culture-flow .signatures>div{display:block!important;min-width:0;padding:0!important;overflow-wrap:anywhere}
.paper.rms-culture-flow .signatures small{font-size:7.7pt!important}
.paper.rms-culture-flow .version-line{font-size:7.8pt!important;margin:7px 0 0!important}
.paper.rms-culture-flow.rms-ast-tight .report-body p{margin:2px 0!important}
.paper.rms-culture-flow.rms-ast-tight .report-title{margin:5px 0!important}
.paper.rms-culture-flow.rms-ast-two-col-tight .report-body p,
.paper.rms-culture-flow.rms-ast-two-col-dense .report-body p{margin:2px 0!important;line-height:1.18!important}
.paper.rms-culture-flow.rms-ast-two-col-tight .report-section-title,
.paper.rms-culture-flow.rms-ast-two-col-dense .report-section-title{margin:5px 0 2px!important}
.paper.rms-culture-flow.rms-ast-two-col-dense .ast-half-table{font-size:7.7pt!important}
.paper.rms-culture-flow.rms-ast-two-col-dense .ast-half-table th,
.paper.rms-culture-flow.rms-ast-two-col-dense .ast-half-table td{padding:2px!important}
@media screen{
  #live-preview .paper.rms-culture-flow,.preview .paper.rms-culture-flow,
  .report-view .paper.rms-culture-flow{
    width:210mm!important;min-width:210mm!important;max-width:210mm!important;
    box-sizing:border-box!important;padding:14mm 16mm 13mm!important;
    min-height:297mm!important;
  }
  /* The DOM preview is intentionally continuous. Explicitly indicate when
     its content needs additional A4 sheets instead of mislabeling it one page. */
  .paper.rms-culture-flow[data-a4-pages]:not([data-a4-pages="1"])::after{
    content:"Print preview note: report extends beyond one physical A4 page.";
    display:block;margin-top:12px;padding:5px 0;color:#9a5b0b;
    font-size:9pt;font-weight:bold;border-top:1px dashed #a48d60;
  }
}
@media print{
  #print-root .paper.rms-culture-flow{
    width:178mm!important;max-width:178mm!important;min-width:178mm!important;
    min-height:0!important;padding:0!important;margin:0 auto!important;
    box-shadow:none!important;overflow:visible!important;
  }
  #print-root .paper.rms-culture-flow .report-culture-opening{
    break-inside:avoid!important;page-break-inside:avoid!important;
  }
  #print-root .paper.rms-culture-flow .ast-print-layout.is-compact>.ast-compact-tables{
    break-inside:auto!important;page-break-inside:auto!important;
  }
}
/* Height measurement equals the inner content of a printed A4 page. */
.rms-a4-measure{
  position:fixed!important;left:-20000px!important;top:0!important;
  width:178mm!important;visibility:hidden!important;pointer-events:none!important;
  z-index:-1!important;
}
.rms-a4-measure>.paper.rms-culture-flow{
  width:178mm!important;min-width:178mm!important;max-width:178mm!important;
  padding:0!important;min-height:0!important;margin:0!important;
  overflow:visible!important;box-shadow:none!important;
}

/* Round 13 — confidential HIV reporting only; no changes to general A4 culture/AST print. */
.hiv-row-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0 17px}
.hiv-row-tools .muted{font-size:11px}
.hiv-tests{min-width:800px}
.hiv-tests th,.hiv-tests td{vertical-align:middle!important}
.hiv-tests th:first-child{min-width:70px}
.hiv-signature-card,.hiv-admin-tools{padding:16px;border:1px solid #bfd6df;background:#f7fbfd;border-radius:10px;margin:18px 0}
.hiv-signature-card h3{margin-bottom:7px}
.hiv-signature-card p,.hiv-admin-tools p{font-size:12px;line-height:1.5}
.hiv-signature-card input[type=file]{max-width:280px;border:1px solid #c7d8df;border-radius:7px;padding:7px;background:#fff}
.hiv-preview{margin-top:24px;background:#e9eff3;border:1px solid #c7d5dd;border-radius:12px;padding:14px}
.hiv-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.hiv-preview-heading p{font-size:12px;margin:4px 0 0}
.hiv-preview iframe{display:block;width:100%;height:min(1100px,125vh);background:#fff;border:1px solid #d9e2e8;border-radius:8px}
.hiv-preview iframe.hiv-pdf-expanded{height:1550px;max-height:none}
#hiv-pdf-alert{font-size:11px;margin-bottom:8px}
@media(max-width:700px){.hiv-preview-heading{align-items:start;flex-direction:column}.hiv-preview iframe{height:620px}.hiv-row-tools{align-items:start}}

/* Round 13.1: prevent progress indicator strobing between successive RPCs.
   backend.js manages visibility with an idle grace period and minimum dwell. */
@media screen{
 #rms-activity-indicator{contain:layout paint;isolation:isolate;backface-visibility:hidden}
 #rms-activity-indicator .rms-loader-circle{
   animation:rms-spin 1.15s linear infinite;
   will-change:transform;transform:translateZ(0);
   backface-visibility:hidden;
 }
 .hiv-list-actions{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
 .hiv-delete-list-btn{border-color:#b94b53!important;color:#9d2530!important;background:#fff6f6!important}
 .hiv-delete-list-btn:hover{background:#ffe5e7!important}
 .hiv-admin-ready{color:#176149;background:#edfaf4;padding:9px 12px;border-radius:7px}
 .hiv-admin-warning{color:#765624;background:#fff7e8;padding:9px 12px;border-radius:7px}
}
@media(prefers-reduced-motion:reduce){#rms-activity-indicator .rms-loader-circle{animation-duration:2s}}

/* Round 13.2: stable, text-only loading state requested by the department.
   Existing request debouncing is preserved; there is no animation or spinning wheel. */
@media screen{
  #rms-activity-indicator{
    width:auto;min-width:122px;height:auto;min-height:44px;
    padding:10px 22px; border-radius:10px;
    display:flex;align-items:center;justify-content:center;
    background:#fff;box-shadow:0 5px 20px rgba(21,44,61,.16);
    transform:translate(-50%,-50%);
    animation:none;
  }
  #rms-activity-indicator .rms-wait-text,
  .rms-session-restore .rms-wait-text{
    font-size:16px;font-weight:650;letter-spacing:.15px;
    line-height:1.4;color:#173d55;white-space:nowrap;
    animation:none;transform:none;
  }
  #rms-activity-indicator .rms-loader-circle,
  .rms-session-restore .rms-loader-circle{display:none!important;}
  .rms-session-restore .rms-wait-text{
    background:#fff;border:1px solid #d6e4e9;
    border-radius:10px;padding:13px 23px;box-shadow:0 5px 20px rgba(21,44,61,.10);
  }
}
@media print{#rms-activity-indicator,.rms-session-restore{display:none!important}}

/* Round 14 - loading indicator keeps seven fixed-width places; avoids any text reflow. */
@media screen {#rms-activity-indicator .rms-dots{display:inline-block;white-space:pre;font-weight:750;letter-spacing:1px;color:#24637d;animation:rms-dots-soft 1.35s ease-in-out infinite;}#rms-activity-indicator .rms-wait-text{margin-left:2px}}
@keyframes rms-dots-soft{0%,100%{opacity:.28}45%,70%{opacity:1}}
@media(prefers-reduced-motion:reduce){#rms-activity-indicator .rms-dots{animation:none;opacity:1}}
.rms-correction-alert{border:2px solid #d39747;background:#fff8eb;padding:16px 18px;border-radius:12px;margin:12px 0 20px;line-height:1.55}.rms-correction-alert h3{margin:0 0 8px;color:#79490a}.rms-correction-alert blockquote{white-space:pre-wrap;margin:5px 0;padding:8px 12px;border-left:3px solid #b88239}.rms-queue-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:13px 0}.rms-queue-tabs button[aria-selected=true]{background:#183f59;color:white}.rms-prep-count{font-size:24px;font-weight:750;margin:10px 0}.rms-overview-awaiting{border:2px solid #9ebbc9}.hiv-progress-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin:15px 0}.hiv-progress-grid .stat{padding:13px}.hiv-progress-grid strong{display:block;font-size:23px}.hiv-print-btn{background:#175a73;color:white}.hiv-progress-overview{margin:16px 0}.hiv-print-rows{margin:14px 0}

/* Round 15 — Independent TB reporting: compact responsive editor and A4 report. */
.tb-module{display:grid;gap:1rem}.tb-module .rms-module-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.tb-module .field{display:flex;flex-direction:column;gap:5px;min-width:0}.tb-module .field input,.tb-module .field select{width:100%;min-height:38px}
.tb-module [hidden]{display:none!important}.tb-module .tb-stats{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:10px;margin:12px 0}
.tb-module .tb-stats>.stat{min-width:0}.tb-module .tb-workspace{display:grid;gap:12px}.tb-module .tb-two-pane{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,.8fr);gap:16px;align-items:start}
.tb-module .tb-entry-wrap{min-width:0}.tb-module .tb-entry-form{display:grid;gap:12px}.tb-module .tb-entry-form .card{padding:16px}.tb-module .tb-sample{padding:12px;border:1px solid var(--border,#d1d5db);border-radius:10px;margin-top:12px}
.tb-module .tb-preview-wrap{position:sticky;top:8px;max-height:85vh;overflow:auto;min-width:0}.tb-module .tb-toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.tb-module .tb-paper{background:white;color:#161c27;font-family:Arial,sans-serif;padding:12mm 10mm;width:210mm;min-height:297mm;max-width:100%;box-sizing:border-box;box-shadow:0 2px 15px #0002;margin:8px auto;font-size:9pt}
.tb-paper-header{display:grid;grid-template-columns:65px 1fr;gap:12px;align-items:center;border-bottom:2px solid #17335b;padding-bottom:8px;text-align:center}
.tb-paper-header img{height:64px;max-width:65px;object-fit:contain}.tb-paper-header strong,.tb-paper-header b{display:block;font-size:12pt}.tb-paper-header small{font-size:9pt}
.tb-paper-title{text-align:center;font-weight:700;font-size:12pt;letter-spacing:.3px;margin:10px 0}.tb-paper h4{margin:10px 0 5px;background:#eaf0f7;color:#162d4b;padding:5px 7px;break-after:avoid}
.tb-print-grid{display:grid;grid-template-columns:1fr 1fr;gap:0;border-top:1px solid #d7dee9;border-left:1px solid #d7dee9}.tb-print-cell{display:flex;gap:5px;align-items:flex-start;border-bottom:1px solid #d7dee9;border-right:1px solid #d7dee9;padding:5px 7px;min-height:16px;overflow-wrap:anywhere}
.tb-print-cell b{font-weight:600;min-width:35%}.tb-print-cell span{flex:1}.tb-requested{border:1px solid #d7dee9;padding:7px}
.tb-paper-attributions{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;text-align:center;margin-top:15px;border-top:1px solid #95a5b8;padding-top:12px}.tb-paper-attributions span{display:block}.tb-paper-attributions b{display:block}.tb-print-foot{text-align:center;margin-top:12px;font-size:8pt;color:#333}
.tb-draft-mark{color:#9b2630;text-align:center;font-weight:700;padding:5px}.tb-module .tb-paper .tb-draft-mark{opacity:.8}
@media(max-width:1050px){.tb-module .tb-two-pane{grid-template-columns:1fr}.tb-module .tb-preview-wrap{position:static;max-height:none}.tb-module .tb-stats{grid-template-columns:repeat(2,minmax(130px,1fr))}}
@media print{
 body.tb-rms-printing{background:#fff!important}
 body.tb-rms-printing #app,body.tb-rms-printing #toast,body.tb-rms-printing #modal,body.tb-rms-printing #rms-activity-indicator{display:none!important}
 body.tb-rms-printing .tb-module .tb-preview-wrap{display:block!important;position:static!important;max-height:none!important;overflow:visible!important}
 body.tb-rms-printing .tb-paper{position:static;width:100%;max-width:178mm;min-height:0;box-shadow:none;margin:0;padding:0;font-size:9pt;print-color-adjust:exact;-webkit-print-color-adjust:exact}
 body.tb-rms-printing .tb-paper-header img{height:64px}
 body.tb-rms-printing .tb-paper h4{background:#eaf0f7}
}

@media print{body.tb-rms-printing #app{display:none!important}body.tb-rms-printing #print-root{display:block!important;position:absolute!important;inset:0!important;visibility:visible!important}body.tb-rms-printing #print-root .tb-paper{display:block!important}}

/* Round 16 TB editing experience: reuse the ordinary RMS editor geometry.
   Print rules for all other report types remain untouched. */
@media screen {
.tb-module .tb-editor{display:grid;grid-template-columns:minmax(0,var(--tb-form-share,44%)) 8px minmax(0,1fr);gap:9px;align-items:start;width:100%;min-width:0}
.tb-module .tb-entry-wrap{min-width:0}
.tb-module .tb-entry-form{display:block}
.tb-module .tb-entry-form .editor-section{border:1px solid var(--border);padding:18px;margin:0 0 14px;border-radius:14px;background:white;min-width:0}
.tb-module .tb-entry-form .section-title{font-size:14px;font-weight:700;margin:0 0 13px}
.tb-module .tb-preview-wrap{position:sticky;top:12px;max-height:88vh;min-width:0;overflow:hidden;padding:14px;background:#e5ebee;border:1px solid #d4dee4}
.tb-module .tb-preview-scroll{overflow:auto;max-height:calc(88vh - 77px);padding:5px 3px;background:#e5ebee}
.tb-module .tb-preview-scroll .tb-paper{max-width:none;width:210mm;min-width:210mm;margin:0 auto;box-shadow:0 3px 13px #0002}
.tb-module .tb-preview-wrap .preview-tools{flex-wrap:wrap}
.tb-module .tb-editor .editor-resize-handle{cursor:col-resize;min-height:360px;align-self:stretch;display:flex;justify-content:center;align-items:center;color:#6b8391;border:1px solid #d4dee4;border-radius:7px;background:#e2e9ec;user-select:none}
.tb-module .tb-editor.tb-expanded{grid-template-columns:minmax(0,1fr)}
.tb-module .tb-editor.tb-expanded .tb-entry-wrap,.tb-module .tb-editor.tb-expanded .editor-resize-handle{display:none}
.tb-module .tb-editor.tb-expanded .tb-preview-wrap{position:relative;max-height:none}
.tb-module .tb-editor.tb-expanded .tb-preview-scroll{max-height:85vh}
}
@media screen and (max-width:1070px){.tb-module .tb-editor{grid-template-columns:minmax(0,1fr)!important}.tb-module .tb-editor .editor-resize-handle{display:none}.tb-module .tb-preview-wrap{position:relative;max-height:none}.tb-module .tb-preview-scroll{max-height:76vh}}

/* Round 16.1: TB reporting adopts the main RMS editor/navigation workflow. */
@media screen {
 .tb-module .tb-main-heading{text-align:center;margin:2px 0 7px}
 .tb-module .tb-main-heading h1{font-size:24px;margin:4px 0 7px}
 .tb-module .tb-report-heading{text-align:center;margin:5px 0 2px}
 .tb-module .tb-report-heading h2{font-size:20px;margin:4px 0 6px}
 .tb-module .tb-page-tabs{display:flex;flex-wrap:wrap;gap:8px;padding:5px 0 8px;justify-content:center}
 .tb-module .tb-page-tabs button{border-radius:10px;min-height:38px}
 .tb-module .tb-page-tools{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin-bottom:2px}
 .tb-module .tb-actions-top{display:flex;justify-content:center;margin:2px 0 5px}
 .tb-module .tb-actions-bottom{margin:18px 0 10px}
 .tb-module .tb-workflow-tracker{margin:11px auto 13px;width:100%}
 .tb-module .tb-toolbar{justify-content:center;width:100%}
 .tb-module .tb-report-list{min-width:0}
 .tb-module .tb-editor .tb-entry-wrap{padding-right:8px}
 .tb-module .tb-editor .tb-preview-wrap{min-width:0;max-width:100%;display:flex;flex-direction:column;gap:0}
 .tb-module .tb-editor .tb-preview-wrap .preview-tools{flex:0 0 auto}
 .tb-module .tb-editor .tb-preview-wrap .tb-preview-scroll{flex:1 1 auto;min-height:0}
 body.tb-preview-open{overflow:hidden!important}
 body.tb-preview-open::before{content:"";position:fixed;inset:0;background:rgba(6,29,42,.73);z-index:1190}
 .tb-module .tb-editor.tb-expanded .tb-preview-wrap.tb-preview-fullscreen{
   position:fixed!important;z-index:1200!important;inset:clamp(8px,2vw,22px)!important;
   width:auto!important;height:auto!important;max-height:none!important;min-height:0!important;
   margin:0!important;padding:clamp(10px,2vw,20px)!important;background:#edf2f5;
   border:1px solid #c8d7e0;border-radius:12px;box-shadow:0 24px 72px rgba(2,20,34,.45);
   display:flex!important;flex-direction:column!important;overflow:hidden!important;
 }
 .tb-module .tb-editor.tb-expanded .tb-preview-fullscreen .preview-tools{display:flex;flex:0 0 auto;position:relative!important;background:#edf2f5}
 .tb-module .tb-editor.tb-expanded .tb-preview-fullscreen .tb-preview-scroll{flex:1 1 auto;max-height:none!important;overflow:auto!important;overscroll-behavior:contain;text-align:center}
 .tb-module .tb-editor.tb-expanded .tb-preview-fullscreen #tb-live-preview{display:inline-block;text-align:left;min-width:0;transform-origin:top center}
 .tb-module .tb-editor .tb-preview-fullscreen [data-tb-action="expand"]{background:#087f82;color:#fff;border-color:#087f82;font-weight:700}
}
@media screen and (max-width:1070px){
 .tb-module .tb-editor .tb-entry-wrap{padding-right:0}
 .tb-module .tb-workflow-tracker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .tb-module .tb-editor.tb-expanded .tb-preview-wrap.tb-preview-fullscreen{position:fixed!important;inset:8px!important;z-index:1200!important;max-height:none!important}
}
@media print {body.tb-rms-printing::before{display:none!important}}

/* Round 16.2: HIV confidential reporting uses the same workspace as TB / ordinary RMS.
   This is screen-only; HIV A4 PDF is still generated by the restricted HIV PDF module. */
@media screen {
 .hiv-module{display:grid;gap:14px;min-width:0}
 .hiv-module .hiv-page-tabs{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
 .hiv-module .hiv-page-tabs button[aria-current="page"]{background:#12384c;border-color:#12384c;color:#fff}
 .hiv-module .hiv-page-tools{margin:0}
 .hiv-module .hiv-confidential-form{margin:0;padding:0;border:0;background:transparent}
 .hiv-module .hiv-report-heading{text-align:center;margin:10px auto 14px}
 .hiv-module .hiv-report-heading h2{font-size:20px;margin:4px 0}
 .hiv-module .hiv-workflow-tracker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0 16px}
 .hiv-module .hiv-workflow-step{display:flex;gap:9px;padding:12px 10px;background:#f8fafb;border:1px solid #dae4eb;border-radius:10px;align-items:center;min-width:0}
 .hiv-module .hiv-workflow-step.current{background:#eaf2ff;border:2px solid #3671ac;color:#154879}
 .hiv-module .hiv-workflow-step.complete{background:#eaf8f2;border-color:#b2dbc6;color:#245e42}
 .hiv-module .hiv-workflow-step .hiv-step-dot{flex:0 0 25px;height:25px;border-radius:50%;display:grid;place-items:center;background:#e4eaf0;font-weight:700}
 .hiv-module .hiv-workflow-step.current .hiv-step-dot{background:#2767b0;color:white}
 .hiv-module .hiv-workflow-step.complete .hiv-step-dot{background:#277b53;color:white}
 .hiv-module .hiv-workflow-step small{display:block;font-size:11px;color:#657887}
 .hiv-module .hiv-workflow-step b{display:block;font-size:13px}
 .hiv-module .hiv-actions-top,.hiv-module .hiv-actions-bottom{margin:10px 0 16px}
 .hiv-module .hiv-editor-actions{flex-wrap:wrap;gap:9px;align-items:center}
 .hiv-module .hiv-report-editor{display:grid;grid-template-columns:minmax(0,var(--hiv-form-share,44%)) 8px minmax(0,1fr);gap:9px;min-width:0;align-items:start}
 .hiv-module .hiv-entry-column{min-width:0}
 .hiv-module .hiv-entry-column .editor-section{border:1px solid var(--border);background:white;border-radius:14px;margin:0 0 14px;padding:18px;min-width:0}
 .hiv-module .hiv-entry-column .editor-section .section-title{font-size:14px;font-weight:700;margin:0 0 13px}
 .hiv-module .hiv-entry-column .grid3{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
 .hiv-module .hiv-entry-column .grid3>.field{min-width:0}
 .hiv-module .hiv-entry-column .hiv-interp{margin-top:10px;margin-bottom:0}
 .hiv-module .hiv-preview{position:sticky;top:12px;min-width:0;max-height:88vh;overflow:hidden;background:#e5ebee;border:1px solid #d4dee4;border-radius:14px;padding:14px;margin:0}
 .hiv-module .hiv-preview .preview-tools{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:10px}
 .hiv-module .hiv-preview .preview-toolbar-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
 .hiv-module #hiv-zoom-label{min-width:58px;text-align:center;font-size:12px}
 .hiv-module .hiv-preview-scroll{overflow:auto;max-height:calc(88vh - 113px);min-width:0;padding:5px 3px;background:#e5ebee}
 .hiv-module #hiv-pdf-frame{display:block;width:794px;min-width:794px;height:1123px;max-height:none;border:1px solid #d4dee4;background:#fff;border-radius:3px;box-sizing:border-box;transform-origin:top left}
 .hiv-module .hiv-report-editor>.editor-resize-handle{cursor:col-resize;min-height:360px;align-self:stretch;display:flex;align-items:center;justify-content:center;background:#e2e9ec;border:1px solid #d4dee4;border-radius:7px;user-select:none;color:#60798a}
 .hiv-module .hiv-report-editor.hiv-expanded{grid-template-columns:minmax(0,1fr)!important}
 .hiv-module .hiv-report-editor.hiv-expanded>.hiv-entry-column,.hiv-module .hiv-report-editor.hiv-expanded>.editor-resize-handle{display:none!important}
 body.hiv-preview-open{overflow:hidden}
 body.hiv-preview-open::after{position:fixed;content:"";inset:0;background:rgba(7,21,31,.66);z-index:1250;pointer-events:none}
 .hiv-module .hiv-preview.hiv-preview-fullscreen{position:fixed!important;z-index:1260!important;inset:12px!important;max-height:none!important;display:flex;flex-direction:column;padding:16px;box-shadow:0 12px 70px rgba(0,0,0,.4)}
 .hiv-module .hiv-preview.hiv-preview-fullscreen .hiv-preview-scroll{max-height:none!important;flex:1 1 auto;min-height:0}
 .hiv-module .hiv-preview.hiv-preview-fullscreen .preview-tools{flex:0 0 auto}
 .hiv-module .hiv-access,.hiv-module .hiv-signature-card{margin:0}
}
@media screen and (max-width:1080px){
 .hiv-module .hiv-report-editor{grid-template-columns:minmax(0,1fr)!important}
 .hiv-module .hiv-report-editor>.editor-resize-handle{display:none}
 .hiv-module .hiv-preview{position:relative;max-height:none}
 .hiv-module .hiv-preview-scroll{max-height:75vh}
}
@media screen and (max-width:650px){
 .hiv-module .hiv-workflow-tracker{grid-template-columns:repeat(2,minmax(0,1fr))}
 .hiv-module .hiv-entry-column .grid3{grid-template-columns:1fr}
}
@media print {.hiv-module{display:none!important}}


/* Round 16.3.7 — HIV REPORT EDITOR ONLY.
   Restore entry ABOVE preview. Routine RMS and TB rules retain the exact
   original Round 16.3 behaviour. No PDF/print format changes. */
@media screen {
  .hiv-module #hiv-report-editor.hiv-report-editor,
  .hiv-module #hiv-report-editor.hiv-report-editor.hiv-expanded {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 18px !important;
    overflow: visible !important;
  }
  .hiv-module #hiv-report-editor > .hiv-entry-column,
  .hiv-module #hiv-report-editor.hiv-expanded > .hiv-entry-column {
    display: block !important;
    order: 0 !important;
    flex: 0 0 auto !important;
    position: static !important;
    visibility: visible !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  /* HIV has no resizable or expanded split view. */
  .hiv-module #hiv-report-editor > #hiv-resize-handle,
  .hiv-module #hiv-report-editor [data-hiv-action="expand"],
  .hiv-module #hiv-report-editor [data-hiv-action="reset-layout"] {
    display: none !important;
  }
  .hiv-module #hiv-report-editor > #hiv-preview-panel.hiv-preview,
  .hiv-module #hiv-report-editor > #hiv-preview-panel.hiv-preview.hiv-preview-fullscreen {
    display: block !important;
    order: 1 !important;
    flex: 0 0 auto !important;
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    box-shadow: none !important;
  }
  .hiv-module #hiv-report-editor > #hiv-preview-panel .hiv-preview-scroll {
    display: block;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: none !important;
    overflow-x: auto;
    overflow-y: auto;
  }
}

/* Round 16.3.8 — approved routine report typography and signing area.
   These rules affect ordinary laboratory reports only, not TB or HIV PDFs. */
/* Keep patient names bold but exactly the same size as surrounding values. */
.paper .patient-table .patient-name-value{font-weight:800!important;font-size:inherit!important;color:#172b3a}
/* Retain the handwritten signature space for short and long reports alike. */
.paper .signatures .signature-blank{display:block;height:9mm;min-height:9mm}
.paper.rms-ast-a4 .signatures .signature-blank,
.paper.rms-ast-flow .signatures .signature-blank{height:7mm;min-height:7mm}
.paper.rms-no-growth-report .signatures .signature-blank{height:12mm;min-height:12mm}
/* No-growth reports intentionally inherit the SAME modern-culture font sizes as
   growth/AST reports: 10pt findings, 9pt patient table, 10pt section labels,
   8.7pt notes. Empty paper space is not used to inflate the type. */
/* Normalize older/non-culture routine report typography as well. Keep the
   single-isolate compact A4 styles and modern A4 AST adaptations intact.
   Confidential HIV and TB PDFs do not use .paper and are not affected. */
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4){font-size:10pt!important;line-height:1.22!important}
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4) .letterhead h2.letterhead-department{font-size:13.5pt!important}
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4) .letterhead p.letterhead-college{font-size:10.5pt!important}
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4) .report-title{font-size:12pt!important}
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4) .patient-table{font-size:9pt!important}
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4) .report-body p{font-size:10pt!important}
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4) .report-section-title,
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4) .notes-title{font-size:10pt!important}
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4) .report-notes{font-size:8.7pt!important}
.paper:not(.rms-culture-flow):not(.rms-single-isolate-a4) .result-table{font-size:9pt!important}
/* The supplementary antibiotic badge is not a CLSI table tier. */
.ast-table .tier{white-space:nowrap}

/* Round 16.4.3 supplemental antibiotic entry; screen editor only. */
@media screen{.rms-extra-agent{margin-top:14px;padding:14px;border:1px solid #d5e2eb;border-radius:8px;background:#f7fafc;display:flex;flex-wrap:wrap;align-items:end;gap:10px}.rms-extra-agent>.field{flex:1 1 260px;min-width:0}.rms-extra-agent>small{flex-basis:100%;color:#607484}}

/* Round 16.4.6 TB/HIV entry and report clarity */
.hiv-name-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:8px 0 14px}.hiv-name-row input{min-width:0;width:100%}.hiv-age-row{display:grid;grid-template-columns:minmax(65px,1fr) minmax(95px,1fr);gap:8px}.tb-detected-value{font-weight:700}.tb-positive-row>td{background:#fff1f2;color:#a41625}.tb-positive-label{display:block;font-weight:700;color:#a41625}.tb-paper-attributions small{display:block;margin-top:3px;font-size:8pt}

/* Handwritten TB signatures: reserve space between role and printed name. */
.tb-paper-attributions{break-inside:avoid;page-break-inside:avoid}
.tb-paper-attributions > span > b{margin-top:12mm}

/* Round 16.4.8 — administrator-only TB amendments and archived version review */
.tb-amendment-history { margin-top: 1rem; }
.tb-amendment-history .table-wrap { overflow-x: auto; }
.tb-archive-view { margin-top: 1.2rem; border-top: 1px solid var(--border, #d8e1e8); padding-top: 1rem; }
.tb-archive-paper { max-height: 650px; overflow: auto; background: #e8edf3; padding: 1rem; border-radius: 8px; }
.tb-archive-paper .tb-paper { margin: 0 auto; min-width: 720px; }
.tb-amendment-mark { text-align: center; font-weight: 700; font-size: 10px; padding: 4px 0; letter-spacing: .035em; }
@media print { .tb-amendment-history { display: none !important; } }

/* Round 16.4.9 — fixed HIV PID and visible test eligibility; TB report emphasis. */
.hiv-pid-field{grid-column:1 / -1;min-width:0}
.hiv-pid-input{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hiv-pid-prefix{font-weight:700;letter-spacing:.02em;overflow-wrap:anywhere}
.hiv-pid-input input{width:105px;min-width:60px;flex:0 1 130px}
.hiv-strategy-field{grid-column:1 / -1}
.hiv-next-test-help{display:block;flex:1 1 260px;line-height:1.5}
.tb-paper .tb-detected-value{font-weight:700;font-size:10.5pt;line-height:1.25}
@media print{body.tb-rms-printing .tb-paper .tb-detected-value{font-weight:700;font-size:10.5pt}}

/* Round 16.4.12 — same-screen recovery for already saved confidential HIV Lab IDs. */
#hiv-lab-recovery-top:not(:empty){margin:12px 0 17px}
.hiv-recovery-panel{border:2px solid #c99d4b;background:#fff9eb;border-radius:12px;padding:17px 19px;box-shadow:0 3px 12px #513c1320;overflow-wrap:anywhere}
.hiv-recovery-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:13px;color:#533e1b}
.hiv-recovery-title b{font-size:16px}
.hiv-recovery-details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}
.hiv-recovery-details>div{border:1px solid #eedbbb;background:white;border-radius:8px;padding:9px 11px;min-width:0}
.hiv-recovery-details small{display:block;color:#6f624d;font-size:12px;margin-bottom:5px}
.hiv-recovery-details strong{font-size:14px;word-break:break-word}
.hiv-recovery-advice{font-size:13px;margin:0 0 12px;line-height:1.5;color:#544b3a}
#hiv-lab-lookup-result:empty{display:none}
#hiv-lab-lookup-result .hiv-recovery-panel{margin:10px 0}
@media (max-width:820px){.hiv-recovery-details{grid-template-columns:1fr}}

/* Round 16.4.13 — clinician readability, mobile draft saving, and TB referring doctor. */
.tb-module .tb-paper{font-size:10pt}
.tb-module .tb-paper .tb-paper-title{font-size:13pt}
.tb-module .tb-paper h4{font-size:10.4pt;padding:5px 7px;margin:8px 0 4px}
.tb-module .tb-paper .tb-print-cell{padding:4px 6px;line-height:1.28;min-width:0}
.tb-module .tb-paper .tb-print-cell b{min-width:31%}
.tb-module .tb-paper .tb-detected-value{font-size:11.3pt;font-weight:700}
.tb-doctor-picker,.tb-doctor-manual{min-width:0}
.tb-doctor-picker select{width:100%;max-width:100%}
.tb-module .tb-entry-wrap .tb-actions-bottom{margin-top:12px}
@media(max-width:760px){
 .tb-module .tb-entry-wrap .tb-actions-bottom{position:sticky;bottom:0;background:#f8fbfd;z-index:7;box-shadow:0 -4px 14px #20374824;padding:12px 6px 8px;border-top:1px solid #c7d5df}
 .tb-module .tb-entry-wrap .tb-actions-bottom button[data-tb-action="save"]{min-height:46px;min-width:132px;font-size:15px}
 .tb-module .tb-entry-wrap .tb-actions-bottom button[data-tb-action="submit"]{min-height:44px}
}
@media print{
 body.tb-rms-printing .tb-paper{font-size:10pt!important}
 body.tb-rms-printing .tb-paper h4{font-size:10.4pt!important}
 body.tb-rms-printing .tb-paper .tb-detected-value{font-size:11.3pt!important}
}
/* Fit the complete two-test TB report on A4 without reducing the improved type below 9.7pt. */
.tb-module .tb-paper{font-size:9.8pt}
.tb-module .tb-paper h4{font-size:10.2pt;margin:5px 0 3px;padding:3px 6px}
.tb-module .tb-paper .tb-print-cell{padding:2.5px 5px;line-height:1.15}
.tb-module .tb-paper .tb-paper-title{margin:7px 0}
.tb-module .tb-paper .tb-paper-attributions{margin-top:10px;padding-top:8px}
.tb-module .tb-paper .tb-paper-attributions > span > b{margin-top:5mm}
@media print{
 body.tb-rms-printing .tb-paper{font-size:9.8pt!important}
 body.tb-rms-printing .tb-paper h4{font-size:10.2pt!important;margin:5px 0 3px!important;padding:3px 6px!important}
 body.tb-rms-printing .tb-paper .tb-print-cell{padding:2.5px 5px!important;line-height:1.15!important}
 body.tb-rms-printing .tb-paper .tb-paper-title{margin:7px 0!important}
 body.tb-rms-printing .tb-paper .tb-paper-attributions{margin-top:10px!important;padding-top:8px!important}
 body.tb-rms-printing .tb-paper .tb-paper-attributions > span > b{margin-top:5mm!important}
}

/* Round 16.4.14: consistent 12-hour time control across OS/browser locales. */
.rms-12hour-controls{display:flex;align-items:stretch;flex-wrap:wrap;gap:6px;margin-top:5px;max-width:100%}
.rms-12hour-controls>*{box-sizing:border-box;min-height:38px}
.rms-12hour-controls input[type=date]{flex:1 1 150px;min-width:130px;width:auto;max-width:100%}
.rms-12hour-controls select{flex:0 1 72px;min-width:62px;width:auto;max-width:100%;padding-left:7px;padding-right:6px}
.rms-12hour-controls .rms-period{flex-basis:82px;min-width:78px;font-weight:650}
.rms-12hour-help{font-size:11px;line-height:1.25;color:var(--muted,#586572);display:block;margin-top:4px}
/* Bacteriology signatories: maintain three columns, center content inside each. */
.paper .signatures,.paper .signatures>div{text-align:center!important}
.paper .signatures>div{min-width:0;overflow-wrap:anywhere}
@media print{#print-root .paper .signatures,#print-root .paper .signatures>div{text-align:center!important}}

/* Round 16.4.15: clarify independently recorded HIV clinical workflow instants. */
.hiv-event-times{margin:10px 0 14px;padding:12px 14px;border:1px solid #cbdde5;border-radius:9px;background:#f4f8fa;color:#203b4a}
.hiv-event-times>b{display:block;margin-bottom:8px;font-size:.9rem}
.hiv-event-times-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 16px}
.hiv-event-times-grid>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.hiv-event-times-grid span{font-size:.8rem;color:#536977}
.hiv-event-times-grid strong{font-size:.86rem;overflow-wrap:anywhere}
.hiv-event-times>small{display:block;margin-top:8px;line-height:1.4;color:#536977}
@media(max-width:650px){.hiv-event-times-grid{grid-template-columns:1fr}}

/* Round 16.4.16 — legible TB sign-off area, reserved handwritten signature space,
   and server-recorded event timestamps below each staff designation. */
.tb-module .tb-paper .tb-paper-attributions,
body.tb-rms-printing .tb-paper .tb-paper-attributions{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;
  gap:10px;margin-top:12px;padding-top:8px;text-align:center;
  border-top:1px solid #95a5b8;break-inside:avoid;page-break-inside:avoid;
}
.tb-paper-attributions .tb-signatory{display:flex;flex-direction:column;align-items:stretch;min-width:0;text-align:center}
.tb-paper-attributions .tb-signatory-label{font-size:9.5pt}
.tb-paper-attributions .tb-signature-space{
  display:block;height:20mm;min-height:20mm;border-bottom:1px solid #c4ccd4;
  margin:0 7mm 3mm;
}
.tb-module .tb-paper .tb-paper-attributions .tb-signatory>b,
body.tb-rms-printing .tb-paper .tb-paper-attributions .tb-signatory>b{
  margin-top:0!important;font-size:9.2pt;overflow-wrap:anywhere;
}
.tb-paper-attributions .tb-signatory small{font-size:8.2pt;line-height:1.25;margin-top:2px}
.tb-paper-attributions .tb-signatory .tb-event-time{
  font-size:8pt;font-weight:600;color:#253e50;white-space:normal;
  overflow-wrap:anywhere;margin-top:4px;font-variant-numeric:tabular-nums;
}
@media print{
  body.tb-rms-printing .tb-paper-attributions .tb-signature-space{
    height:20mm!important;min-height:20mm!important;
  }
}

/* Round 16.4.17 — selectable institutional HIV PID prefix (PDF geometry unchanged). */
.hiv-pid-field .hiv-pid-input select[data-hiv-pid-prefix]{min-width:0;flex:2 1 205px;max-width:100%;font-weight:600;font-size:13px;padding:9px 5px}
.hiv-pid-field .hiv-pid-input input[data-hiv-pid]{min-width:55px;flex:1 1 78px}
.hiv-stage-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0 16px}
.hiv-stage-stats .stat{border:1px solid #d9e1e7;border-radius:11px;padding:12px 14px;background:#f8fafc}
.hiv-stage-stats .stat span{display:block;font-size:12px;color:#41596a}
.hiv-stage-stats .stat strong{display:block;font-size:25px;margin-top:5px;color:#1d3545;font-variant-numeric:tabular-nums}
.hiv-list-filters{display:grid;grid-template-columns:minmax(210px,1.3fr) minmax(190px,1fr) auto;gap:12px;align-items:end;margin-bottom:8px}
.hiv-list-filters input,.hiv-list-filters select{width:100%;min-width:0}
.hiv-list-search-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:end;padding-bottom:2px}
.hiv-list-sorting{font-size:12px;margin:8px 0 11px}
.hiv-list-pagination{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding-top:14px;font-size:13px;font-variant-numeric:tabular-nums}
.hiv-report-list .table-wrap{overflow-x:auto}
@media(max-width:850px){.hiv-stage-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.hiv-list-filters{grid-template-columns:1fr}.hiv-list-search-actions{justify-content:flex-start}}
@media(max-width:380px){.hiv-pid-field .hiv-pid-input select[data-hiv-pid-prefix]{flex-basis:100%}.hiv-stage-stats .stat{padding:10px}.hiv-stage-stats .stat strong{font-size:22px}}

/* Round 16.4.17 — ease TB vertical density while retaining the existing 20 mm signature spaces.
   Apply equally to on-screen print preview and final A4 print. */
.tb-module .tb-paper .tb-print-cell{padding:3.4px 6px;line-height:1.24}
.tb-module .tb-paper h4{margin:7px 0 4px;padding:4px 7px}
.tb-module .tb-paper .tb-paper-title{margin:8px 0 9px}
@media print{
 body.tb-rms-printing .tb-paper .tb-print-cell{padding:3.4px 6px!important;line-height:1.24!important}
 body.tb-rms-printing .tb-paper h4{margin:7px 0 4px!important;padding:4px 7px!important}
 body.tb-rms-printing .tb-paper .tb-paper-title{margin:8px 0 9px!important}
}


/* Round 16.4.18 — TB print-only table alignment and consistent spacing.
   Fixed label widths make every entered value start at exactly the same position
   in its left or right report column, regardless of the label's text length.
   Older CSS used min-width on flex labels; these grid rules intentionally override it.
   No changes to HIV, culture, TB input forms, or 20 mm signature blocks. */
.tb-module .tb-paper .tb-print-grid,
body.tb-rms-printing .tb-paper .tb-print-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.tb-module .tb-paper .tb-print-cell,
body.tb-rms-printing .tb-paper .tb-print-cell{
  display:grid!important;
  grid-template-columns:minmax(0,46%) minmax(0,1fr);
  column-gap:6px;
  align-items:start;
  box-sizing:border-box;
  min-width:0;
  padding:3.5px 6px!important;
  line-height:1.28!important;
}
.tb-module .tb-paper .tb-print-cell>b,
body.tb-rms-printing .tb-paper .tb-print-cell>b{
  min-width:0!important;width:auto;max-width:100%;overflow-wrap:break-word;
}
.tb-module .tb-paper .tb-print-cell>span,
body.tb-rms-printing .tb-paper .tb-print-cell>span{
  display:block;min-width:0;width:auto;overflow-wrap:anywhere;
}
.tb-module .tb-paper .tb-print-grid,
body.tb-rms-printing .tb-paper .tb-print-grid{
  font-variant-numeric:tabular-nums;
}

/* Round 16.4.19 — bacterial-load exponent and distribution status.
   Print preview and A4 use the same safe superscript markup. */
.tb-module .tb-paper .tb-print-cell sup,
body.tb-rms-printing .tb-paper .tb-print-cell sup{
  vertical-align:super;
  font-size:0.72em;
  line-height:0;
}
.tb-module .tb-issued-done{
  display:inline-flex;align-items:center;gap:4px;
  color:#176342;font-weight:700;font-size:13px;
  padding:5px 8px;border:1px solid #b6dcca;border-radius:6px;background:#f0faf4;
}
.tb-module .tb-issued-at{display:block;margin-top:4px;color:#435969;font-size:11px;font-variant-numeric:tabular-nums}
.tb-module .badge.issued{background:#e4f6eb;color:#16613c;border:1px solid #b6dcc8}

/* Round 16.4.21: form-specific stool identification and validator snapshots */
.rms-stool-fields{grid-column:1/-1;display:flex;flex-direction:column;gap:12px}
.rms-stool-finding{border:1px solid var(--border,#d8e1e5);border-radius:9px;padding:11px;margin:5px 0}
.rms-stool-finding .grid2{margin-top:8px}
.rms-signature-enroll{margin:12px 0;padding:16px!important}
.rms-signature-enroll input[type=file]{max-width:100%}
.paper .signatures .rms-registered-signature{display:flex;align-items:center;justify-content:center;overflow:hidden}
.paper .signatures .rms-registered-signature img{display:block;max-height:100%;max-width:96%;object-fit:contain}
.tb-paper .tb-paper-attributions .tb-validator-signature{display:block;max-width:96%;max-height:100%;height:auto;width:auto;object-fit:contain;margin:auto}
@media print{.paper .signatures .rms-registered-signature img{max-height:9mm}.tb-paper .tb-paper-attributions .tb-validator-signature{max-height:15mm}}

/* Round 16.4.24 Fix 4: consistent TB-inspired sign-off for GENERAL reports only.
   TB and HIV render outside .paper and are deliberately untouched.
   The three columns reserve equal signature zones even when only a validator
   PNG exists. CSS-only rendering: no timers, observers or database reads. */
.paper .signatures{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:start!important;
  gap:9px!important;
  width:100%!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
.paper .signatures>div.rms-signatory{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  min-width:0!important;
  padding:0!important;
  text-align:center!important;
  overflow-wrap:anywhere;
}
.paper .signatures .rms-signatory-role{
  display:block;
  min-height:1.45em;
  margin:0!important;
  font-weight:600;
}
.paper .signatures>div.rms-signatory .signature-blank{
  width:96%!important;
  height:20mm!important;
  min-height:20mm!important;
  max-height:20mm!important;
  box-sizing:border-box!important;
  border-bottom:1px solid #87949b;
  margin:0 auto 2mm!important;
  display:flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
.paper .signatures>div.rms-signatory .rms-registered-signature img{
  display:block!important;
  max-height:16mm!important;
  max-width:98%!important;
  width:auto!important;
  height:auto!important;
  object-fit:contain!important;
}
.paper .signatures .staff-name{
  display:block!important;
  font-weight:700!important;
  min-height:1.45em;
  line-height:1.3;
}
.paper .signatures .rms-staff-designation{
  display:block!important;
  min-height:1.4em;
  line-height:1.3;
}
.paper .signatures .rms-staff-timestamp{
  display:block!important;
  min-height:1.35em;
  line-height:1.2;
  margin-top:2px;
  font-variant-numeric:tabular-nums;
}
.paper .version-line{text-align:center!important;margin-left:auto!important;margin-right:auto!important}
/* Modern Chromium uses subgrid to share the five vertical tracks among
   all three signatories. Long names/designations then grow EVERY matching
   row equally, preserving cross-column alignment without measuring in JS. */
@supports (grid-template-rows:subgrid){
  .paper .signatures{grid-template-rows:repeat(5,auto)!important;row-gap:0!important}
  .paper .signatures>div.rms-signatory{
    display:grid!important;grid-row:span 5!important;
    grid-template-rows:subgrid!important;
    /* Each signatory must fill the full column width. Without this,
       the subgrid creates a narrow auto-sized inner column left-aligned
       within its allocated third, visibly shifting the whole sign-off. */
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;box-sizing:border-box!important;
    justify-self:stretch!important;
    row-gap:0!important;
    align-items:start!important;justify-items:center!important;
  }
}
/* Culture needs an adaptive, but still legible, signing area. 17 mm normally;
   a shorter 12 mm variant is selected only by a bounded A4 fit check.
   Multiple isolates are allowed to continue naturally onto further pages. */
.paper.rms-culture-flow .signatures>div.rms-signatory .signature-blank{
  height:17mm!important;min-height:17mm!important;max-height:17mm!important;
}
.paper.rms-culture-flow .signatures>div.rms-signatory .rms-registered-signature img{
  max-height:15mm!important;
}
.paper.rms-culture-flow.rms-signature-compact .signatures>div.rms-signatory .signature-blank{
  height:12mm!important;min-height:12mm!important;max-height:12mm!important;
}
.paper.rms-culture-flow.rms-signature-compact .signatures>div.rms-signatory .rms-registered-signature img{
  max-height:11mm!important;
}
/* Keep all signatures together on the final page of a multi-isolate report. */
@media print{
  #print-root .paper .signatures>div.rms-signatory .signature-blank{
    height:20mm!important;min-height:20mm!important;max-height:20mm!important;
  }
  #print-root .paper .signatures>div.rms-signatory .rms-registered-signature img{
    max-height:16mm!important;
  }
  #print-root .paper.rms-culture-flow .signatures>div.rms-signatory .signature-blank{
    height:17mm!important;min-height:17mm!important;max-height:17mm!important;
  }
  #print-root .paper.rms-culture-flow .signatures>div.rms-signatory .rms-registered-signature img{
    max-height:15mm!important;
  }
  #print-root .paper.rms-culture-flow.rms-signature-compact .signatures>div.rms-signatory .signature-blank{
    height:12mm!important;min-height:12mm!important;max-height:12mm!important;
  }
  #print-root .paper.rms-culture-flow.rms-signature-compact .signatures>div.rms-signatory .rms-registered-signature img{
    max-height:11mm!important;
  }
}
.rms-viral-interpretation{font-weight:600;margin:3mm 0 4mm;line-height:1.4;}

/* Dense AST mode is an A4-fit option, not a smaller text tier. Compress
   only whitespace around already readable findings when it saves a page. */
.paper.rms-culture-flow.rms-ast-two-col-dense .report-notes li{margin:0!important}
.paper.rms-culture-flow.rms-ast-two-col-dense .end-report{margin:4px 0 2px!important}
.paper.rms-culture-flow.rms-ast-two-col-dense .report-section-title{margin:3px 0 1px!important}
.paper.rms-culture-flow.rms-ast-two-col-dense .report-notes{margin:2px 0 3px!important}

/* Round 16.4.24 — compact, user-triggered aggregate dashboards and stage buttons. */
.rms-progress-stage{display:flex!important;flex-direction:column;align-items:flex-start;justify-content:space-between;text-align:left;cursor:pointer;font:inherit;color:inherit;min-width:0}
.rms-progress-stage:hover{border-color:#588db8!important;background:#f0f7ff!important}
.rms-progress-stage:focus-visible{outline:3px solid #356e9f;outline-offset:2px}
.rms-analytics-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:18px 0}
.rms-analytics-cards .stat{display:flex;flex-direction:column;gap:7px;border:1px solid #ccd8e6;border-radius:10px;padding:12px;background:#f8fafc}
.rms-analytics-cards .stat span{font-size:.82rem;color:#4b6277}
.rms-analytics-cards .stat strong{font-size:1.35rem;color:#153c60}
.rms-analytics-trend{display:flex;flex-direction:column;gap:8px;margin:10px 0 20px;max-width:760px}
.rms-trend-row{display:grid;grid-template-columns:90px minmax(60px,1fr) 90px;align-items:center;gap:10px;font-size:.87rem}
.rms-trend-track{background:#e6edf4;height:16px;border-radius:5px;overflow:hidden}
.rms-trend-track>div{height:100%;background:#366e9f;border-radius:5px}
.rms-analytics .table-wrap{max-height:440px;overflow:auto}
.rms-analytics h4{margin-top:18px}
.rms-sample-pagination{justify-content:flex-end;margin-top:14px}
@media(max-width:550px){.rms-trend-row{grid-template-columns:62px minmax(40px,1fr) 65px;gap:5px;font-size:.78rem}}


/* 16.4.24 archive-inspired analytics filters: fixed grid, no observers or animations. */
.rms-analytics{display:flex;flex-direction:column;gap:16px;min-width:0}
.rms-analytics>.rms-archive-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.rms-archive-heading h3{margin:0 0 5px;font-size:1.28rem}
.rms-archive-heading p{margin:0}
.rms-analytics-archive-filter{background:#fff;border:1px solid #d9e0e5;border-radius:16px;padding:20px 22px 20px;box-shadow:0 1px 3px rgba(20,40,65,.03)}
.rms-analytics-archive-filter>h4{margin:0 0 7px;font-size:1.06rem;color:#17354d}
.rms-analytics-archive-filter>p{margin:0 0 18px}
.rms-archive-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));column-gap:18px;row-gap:19px}
.rms-archive-field{display:flex;flex-direction:column;gap:7px;min-width:0;margin:0;font-size:.91rem;color:#526579;font-weight:650}
.rms-archive-field>span{display:block;line-height:1.25}
.rms-archive-field input,.rms-archive-field select{box-sizing:border-box;display:block;min-width:0;width:100%;height:43px;background:#fff;border:1px solid #cfd8dc;border-radius:7px;color:#28323a;font:400 .92rem system-ui, sans-serif;padding:8px 11px}
.rms-archive-field input:focus-visible,.rms-archive-field select:focus-visible{outline:2px solid #078e90;outline-offset:1px}
.rms-archive-disabled input:disabled{background:#f6f7f8;color:#76818a;cursor:not-allowed}
.rms-archive-search{grid-column:span 2}
.rms-archive-footer{display:flex;gap:16px;align-items:center;justify-content:space-between;margin-top:24px;flex-wrap:wrap}
.rms-archive-history{display:flex;gap:9px;align-items:center;font-size:.87rem;color:#697783}
.rms-archive-history input{width:17px;height:17px}
.rms-archive-actions{display:flex;gap:9px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.rms-archive-actions button{min-height:42px;padding:9px 15px;border-radius:7px}
.rms-archive-output{background:#fff;border:1px solid #d9e0e5;border-radius:16px;padding:20px 22px}
.rms-archive-output-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
.rms-archive-output-heading h4{margin:0 0 5px}
.rms-archive-output-heading p{margin:0}
@media(max-width:1050px){.rms-archive-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){.rms-archive-grid{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px;row-gap:14px}.rms-analytics-archive-filter,.rms-archive-output{padding:15px}.rms-archive-search{grid-column:span 2}}
@media(max-width:460px){.rms-archive-grid{grid-template-columns:1fr}.rms-archive-search{grid-column:span 1}.rms-archive-footer{align-items:stretch}.rms-archive-actions{justify-content:stretch}.rms-archive-actions button{flex:1}}
@media print{.rms-analytics-archive-filter{display:none!important}.rms-archive-actions{display:none!important}.rms-archive-output{border:0!important;padding:0!important}}

.rms-archive-note{margin:16px 0 0;font-size:.83rem}

/* Round 16.4.24 TB workflow-stage cards: accessible navigation, no extra RPCs. */
.tb-module .tb-stage-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;justify-content:space-between;gap:7px;width:100%;min-height:112px;cursor:pointer;color:inherit;background:var(--surface,#fff);font:inherit;box-shadow:none}
.tb-module .tb-stage-card span{font-size:inherit}
.tb-module .tb-stage-card strong{display:block;font-variant-numeric:tabular-nums}
.tb-module .tb-stage-card-hint{font-size:11px;color:#476677}
.tb-module .tb-stage-card:hover{border-color:#078a8b;background:#f0faf9}
.tb-module .tb-stage-card[aria-pressed="true"]{border-color:#087f83;background:#e8f5f5;outline:2px solid #087f83;outline-offset:-2px}
.tb-module .tb-stage-card:focus-visible{outline:3px solid #095a80;outline-offset:2px}
.tb-module .tb-queue-results{font-size:14px;font-weight:600;color:#1a4051;padding:7px 0;scroll-margin-top:20px}
.tb-module .tb-queue-results:focus{outline:none}

/* Round 16.4.24 Fix 5: visible clarification only when validator signature image exists. */
.paper .rms-esign-clarification,.tb-paper .rms-tb-esign-clarification{
  color:#555f68;text-align:center;font-size:7.3pt;line-height:1.22;
  margin:3px auto 0;max-width:100%;font-weight:400;
  break-inside:avoid;page-break-inside:avoid;
}
@media print{
  #print-root .paper .rms-esign-clarification,
  body.tb-rms-printing .tb-paper .rms-tb-esign-clarification{
    font-size:7pt;margin-top:2px;line-height:1.15;
  }
}
/* Save modest whitespace in a long single-isolate culture report before
   sacrificing readable clinical text or moving signatures to a second page. */
.paper.rms-culture-flow.rms-ast-two-col-dense .signatures{
  margin-top:6px!important;padding-top:4px!important;
}
.paper.rms-culture-flow.rms-ast-two-col-dense .version-line{margin-top:3px!important}
.paper.rms-culture-flow.rms-ast-two-col-dense .rms-esign-clarification{
  margin-top:0!important;font-size:7pt!important;line-height:1.1!important;
}


/* Round 16.4.24 Fix 9 — readable boxed TB/HIV navigation. Visual only;
   does not create timers, fetches, or additional event handlers. */
@media screen {
 .tb-module .tb-page-tabs,
 .hiv-module .hiv-page-tabs {
   display:flex;flex-wrap:nowrap;gap:7px;width:100%;max-width:100%;
   align-items:stretch;justify-content:stretch;padding:5px 0 10px;
   overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;
 }
 .tb-module .tb-page-tabs>button,
 .hiv-module .hiv-page-tabs>button,
 .hiv-module .hiv-page-tabs>button.quiet {
   display:flex;flex:1 1 0;min-width:0;min-height:56px;
   border:1px solid #bed0d8;border-radius:9px;
   padding:10px 8px;background:#fff;color:#244052;
   font-size:15px;line-height:1.25;font-weight:700;text-align:center;
   white-space:normal;box-shadow:none;
 }
 .tb-module .tb-page-tabs>button[aria-current="page"],
 .hiv-module .hiv-page-tabs>button[aria-current="page"]{
   background:#087f82;border-color:#087f82;color:white;
 }
 .tb-module .tb-page-tabs>button:not([aria-current="page"]):hover,
 .hiv-module .hiv-page-tabs>button:not([aria-current="page"]):hover{
   border-color:#087f82;background:#effaf9;color:#174c52;
 }
 .tb-module .tb-page-tabs>button:focus-visible,
 .hiv-module .hiv-page-tabs>button:focus-visible{
   outline:3px solid #376aa0;outline-offset:2px;
 }
 .tb-module .tb-stats{grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}
 .tb-module .tb-stage-card{min-width:0;min-height:112px;padding:14px 12px}
 .tb-module .tb-stage-card span{line-height:1.3}
 .tb-module .tb-progress-overview .tb-stats{margin-bottom:0}
}
@media screen and (max-width:1060px){
 .tb-module .tb-page-tabs>button,
 .hiv-module .hiv-page-tabs>button,
 .hiv-module .hiv-page-tabs>button.quiet{
   flex:0 0 155px;min-width:155px;
 }
}
@media screen and (max-width:899px){
 .tb-module .tb-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
}
@media screen and (max-width:430px){
 .tb-module .tb-stage-card{min-height:105px;padding:11px}
 .tb-module .tb-stage-card span{font-size:12px}
}

/* Round 16.4.24 Fix 11: bounded, editable commensal-flora selections. */
.rms-commensal-editor{display:grid;gap:10px;margin:10px 0 14px;}
.rms-commensal-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end;}
.rms-commensal-row .field{margin:0;min-width:0;}
.rms-commensal-row .small{min-height:40px;}
@media(max-width:580px){.rms-commensal-row{grid-template-columns:minmax(0,1fr);}}

/* Fix 18: Keep each physical signature line a sensible length, centered
   in its full-width signatory column in browser preview and A4 print.
   General reports only; TB and HIV print layouts are untouched. */
.paper .signatures>div.rms-signatory .signature-blank{
  max-width:33mm!important;
  justify-self:center!important;
}


/* Round 16.4.24 Fix 19: final authorization block for GENERAL .paper reports.
   Does not select .tb-paper or the separate HIV PDF. Fix18 centered subgrid is
   retained. Keep signatories, version, authorization note, and final marker
   together on the last sheet, especially for multi-isolate culture reports. */
.paper .rms-final-signoff{
  width:100%;min-width:0;
  break-inside:avoid!important;page-break-inside:avoid!important;
}
/* Preserve the three equal columns and the shared vertical tracks, while
   removing only the excessive whitespace above the signature lines. */
.paper .rms-final-signoff .signatures{
  margin-top:9px!important;padding-top:7px!important;
  gap:9px!important;
}
.paper.rms-culture-flow .rms-final-signoff .signatures{
  margin-top:7px!important;padding-top:6px!important;
}
.paper .rms-final-signoff .signatures>div.rms-signatory .signature-blank{
  height:17mm!important;min-height:17mm!important;max-height:17mm!important;
  margin-bottom:1.4mm!important;
}
.paper.rms-culture-flow .rms-final-signoff .signatures>div.rms-signatory .signature-blank{
  height:14mm!important;min-height:14mm!important;max-height:14mm!important;
}
.paper.rms-culture-flow.rms-signature-compact .rms-final-signoff .signatures>div.rms-signatory .signature-blank{
  height:11mm!important;min-height:11mm!important;max-height:11mm!important;
}
/* Transparent PNG is bottom-aligned just above the line, not floating halfway
   up the blank reserved area. The image is never stretched or cropped. */
.paper .rms-final-signoff .signatures>div.rms-signatory .rms-registered-signature{
  align-items:flex-end!important;justify-content:center!important;
  padding-bottom:.7mm!important;
}
.paper .rms-final-signoff .signatures>div.rms-signatory .rms-registered-signature img{
  max-height:14.5mm!important;max-width:98%!important;
  width:auto!important;height:auto!important;object-fit:contain!important;
}
.paper.rms-culture-flow .rms-final-signoff .signatures>div.rms-signatory .rms-registered-signature img{
  max-height:12mm!important;
}
.paper.rms-culture-flow.rms-signature-compact .rms-final-signoff .signatures>div.rms-signatory .rms-registered-signature img{
  max-height:9mm!important;
}
.paper .rms-final-signoff .version-line{
  margin-top:5px!important;margin-bottom:0!important;
  text-align:center!important;
}
.paper .rms-final-signoff .rms-esign-clarification{
  margin-top:2px!important;margin-bottom:0!important;
}
.paper .rms-final-signoff .end-report{
  margin:8px 0 0!important;
  padding:0!important;text-align:center!important;
  font-size:8.5pt!important;line-height:1.2!important;
  font-weight:700!important;color:#52616c;
  break-inside:avoid!important;
}
.paper.rms-culture-flow.rms-ast-two-col-dense .rms-final-signoff .signatures{
  margin-top:5px!important;padding-top:4px!important;
}
/* Print must have precisely the same zone heights as the preview. These
   scoped overrides supersede earlier print-only 20/17/12 mm declarations. */
@media print{
  #print-root .paper .rms-final-signoff .signatures>div.rms-signatory .signature-blank{
    height:17mm!important;min-height:17mm!important;max-height:17mm!important;
  }
  #print-root .paper.rms-culture-flow .rms-final-signoff .signatures>div.rms-signatory .signature-blank{
    height:14mm!important;min-height:14mm!important;max-height:14mm!important;
  }
  #print-root .paper.rms-culture-flow.rms-signature-compact .rms-final-signoff .signatures>div.rms-signatory .signature-blank{
    height:11mm!important;min-height:11mm!important;max-height:11mm!important;
  }
  #print-root .paper .rms-final-signoff .signatures>div.rms-signatory .rms-registered-signature img{
    max-height:14.5mm!important;
  }
  #print-root .paper.rms-culture-flow .rms-final-signoff .signatures>div.rms-signatory .rms-registered-signature img{
    max-height:12mm!important;
  }
  #print-root .paper.rms-culture-flow.rms-signature-compact .rms-final-signoff .signatures>div.rms-signatory .rms-registered-signature img{
    max-height:9mm!important;
  }
}
