:root{font-family:Arial,Helvetica,sans-serif;color:#21364b;background:#edf1f5;font-size:16px;--blue:#245985;--line:#d5dfe8;--muted:#5b6d7e}*{box-sizing:border-box}body{margin:0}.masthead{background:#173c60;color:white;padding:20px max(24px,calc((100vw - 1180px)/2));display:flex;justify-content:space-between;align-items:center}.masthead>div{display:flex;align-items:center;gap:22px;font-size:13px;letter-spacing:1.8px}.mark{font-size:26px;font-weight:bold;letter-spacing:-1px}.local{font-size:13px;color:#cfdeec}main{max-width:1180px;margin:30px auto;padding:0 24px}.topline{display:flex;justify-content:space-between;gap:20px;align-items:center}.eyebrow{font-size:12px;letter-spacing:1.5px;color:var(--muted);margin:0 0 7px}h1{font-size:28px;margin:0;font-weight:600}h2{font-size:19px;margin:0}h3{font-size:16px;margin:0 0 12px}p{line-height:1.5}.actions{display:flex;gap:8px;flex-wrap:wrap}button,select,input,textarea{font:inherit}button{border:1px solid #b9c9d8;background:white;color:#234a6e;padding:10px 14px;border-radius:4px;cursor:pointer;font-size:14px}button:hover{background:#e7eff7}button.primary{background:var(--blue);border-color:var(--blue);color:white}button:disabled{opacity:.5;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #4d9ae0;outline-offset:2px}.selectors{display:flex;gap:16px;align-items:end;margin:24px 0}.selectors label{min-width:230px}.selectors select{width:100%}label{display:block;font-size:14px;color:var(--muted)}input,select,textarea{width:100%;border:1px solid #c6d2dc;border-radius:3px;background:white;color:#243c53;padding:8px;margin-top:5px;min-height:36px}input[type=number]{appearance:textfield;-moz-appearance:textfield}input::-webkit-inner-spin-button{appearance:none}input:invalid{border-color:#a85b20}#save-status{font-size:13px;color:var(--muted);margin-left:auto;padding-bottom:10px}nav{display:flex;border-bottom:1px solid #b9cbdc;margin-bottom:22px;gap:4px}nav button{border:0;border-radius:0;background:transparent;padding:13px 25px;font-size:16px}nav button.active{color:#174e7f;border-bottom:3px solid #245985;font-weight:bold}#notice:not(:empty){padding:12px 16px;background:#fff3d8;border:1px solid #ecd29b;margin-bottom:16px;font-size:14px}.sheet{background:white;border:1px solid var(--line);padding:24px;box-shadow:0 3px 14px #12314e08}.sheet-head{border-bottom:2px solid #2c608e;padding-bottom:16px;margin-bottom:20px;display:flex;justify-content:space-between;gap:10px}.sheet-head small{display:block;color:var(--muted);font-size:13px;margin-top:6px}.sheet-id{font-size:13px;color:var(--muted);text-align:right}.fields{display:grid;grid-template-columns:repeat(4,1fr);gap:12px 16px}.fields .wide{grid-column:span 2}.postop{background:#edf4fa;padding:8px 10px;min-height:38px;margin-top:5px;color:#245985;font-weight:bold;font-size:14px}.section{margin-top:22px}.bar{display:flex;gap:10px;align-items:center;background:var(--blue);color:white;padding:9px 12px;font-size:14px;font-weight:bold;letter-spacing:.65px;margin:0 0 14px}.bar span{font-weight:normal;color:#c8dbee;font-size:12px}.two{display:grid;grid-template-columns:1fr 1fr;gap:22px}.block{min-width:0;margin-bottom:18px}table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px}th,td{padding:8px;border-bottom:1px solid var(--line);text-align:right;vertical-align:middle}th:first-child,td:first-child{text-align:left}thead th{font-size:12px;color:var(--muted);font-weight:600;background:#f2f6f9}td input{margin:0;text-align:right;padding:6px;width:100%;min-width:0}th:first-child{width:36%}.sidehead{color:#225783;font-size:14px}tr.result{background:#edf4fa;font-weight:bold}tr.result td{color:#174f80;padding-top:10px;padding-bottom:10px}.delta{margin-top:8px;text-align:right;font-size:14px;color:#244f74}.delta strong{font-weight:600}.muted{color:var(--muted);font-size:13px}.inline-field{max-width:260px;margin-bottom:14px}.trial-table th:first-child{width:30%}.trial-table th{padding:7px 5px}.trial-table td{padding:6px 5px}.trial-table td:first-child{font-size:13px}.trial-table tr.result td{font-size:14px}.warn{color:#915613;background:#fff3dc;padding:7px 10px;margin-top:8px;font-size:13px}.save-row{display:flex;align-items:center;justify-content:space-between;gap:15px;border-top:1px solid var(--line);padding-top:20px;margin-top:22px}textarea{min-height:94px;resize:vertical}.page-intro{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:22px}.page-intro p{margin:6px 0 0;font-size:14px;color:var(--muted)}.scroll{overflow-x:auto}.history-table{min-width:680px;table-layout:auto}.history-table th:first-child{width:210px;position:sticky;left:0;background:#f2f6f9}.history-table td:first-child{position:sticky;left:0;background:white;font-weight:bold}.history-table td{min-width:170px;vertical-align:top}.history-table td small{display:block;margin-top:6px;color:var(--muted);font-weight:normal}.pair{display:flex;justify-content:space-between;gap:8px}.pair b{color:#245985}.history-table .delta{text-align:left;font-size:12px}.history-group td{background:#245985!important;color:white!important;padding:8px 10px}.history-table th small{display:block;margin-top:6px}.empty{padding:45px 20px;text-align:center;border:1px dashed #c1ceda;color:var(--muted)}.pdf-actions{display:flex;gap:14px;align-items:center;margin-bottom:20px}.pdf-actions label{display:flex;align-items:center;gap:6px}.pdf-actions input{width:auto;min-height:auto;margin:0}.report-title{font-size:22px;margin-bottom:8px}.report-meta{line-height:1.7;font-size:14px;color:var(--muted)}.report-note{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}.report .section{break-inside:avoid}.report table{table-layout:auto}.report th:first-child{width:40%}footer{max-width:1132px;margin:25px auto 35px;padding:0 24px;font-size:12px;color:#667c8d;display:flex;justify-content:space-between}.report .history-table th:first-child,.report .history-table td:first-child{position:static}.required{color:#925925}.condition{font-size:12px;font-weight:normal;color:var(--muted)}
@media(max-width:800px){main{padding:0 12px;margin-top:20px}.topline{align-items:start;flex-direction:column}.selectors{flex-wrap:wrap}.selectors label{flex:1;min-width:160px}#save-status{margin:0}.sheet{padding:16px}.fields{grid-template-columns:repeat(2,1fr)}.two{grid-template-columns:1fr;gap:0}.masthead{padding:15px}.masthead>div{gap:12px;letter-spacing:1px}.local{display:none}.page-intro{align-items:start;flex-direction:column}.pdf-actions{flex-wrap:wrap}footer{gap:14px}.sheet-head{flex-wrap:wrap}}
@media print{@page{size:A4;margin:14mm}body{background:white;color:#172d42;font-size:11px}.masthead,.topline,.selectors,nav,#notice,footer,.pdf-actions,.page-intro,.no-print{display:none!important}main{max-width:none;margin:0;padding:0}.sheet{padding:0;border:0;box-shadow:none}.bar{background:#245985!important;color:white!important;print-color-adjust:exact;-webkit-print-color-adjust:exact;font-size:11px;padding:6px 9px;margin-bottom:7px}.report table{font-size:10px}.report th,.report td{padding:5px}.report .section{margin-top:12px}.report-meta,.report-note{font-size:11px}.report-title{font-size:20px}.two{gap:15px}.history-report{break-before:page}.history-table{min-width:0;width:100%;font-size:9px!important}.history-table td{min-width:0}.history-table th:first-child{width:25%}.history-table .pair{display:block}.history-table .pair span{display:block}.history-table .delta,.history-table .condition{font-size:9px}.scroll{overflow:visible}thead{display:table-header-group}tr{break-inside:avoid}.warn{font-size:10px}}
/* Compact test-sheet composition follows the supplied V2 reference. */
.fields{grid-template-columns:1.6fr 1fr 1fr 1.1fr .8fr}.three{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}.three th:first-child{width:48%}.three table{font-size:13px}.three h3,.subbar{background:#eaf1f7;padding:9px 10px;margin-bottom:0;font-size:14px}.three td{padding:6px}.three small{font-size:11px}.test-with-diff{display:flex;align-items:stretch;gap:8px}.test-with-diff table{flex:1;min-width:0}.diff-box{width:88px;flex-shrink:0;background:#edf3f9;border:1px solid #d0ddec;display:flex;flex-direction:column;justify-content:center;text-align:center;padding:8px;color:#245985;gap:10px;font-size:12px}.diff-box strong{font-size:16px;line-height:1.6}.calculated{background:#e6f2fc;color:#174f80;font-weight:bold}.trial-table th:first-child{width:12%}.trial-table th:last-child{width:23%}.trial-table{font-size:12px}.trial-table th{font-size:11px;padding:8px 2px}.trial-table td:first-child{font-weight:bold;font-size:12px}.trial-table input{padding:6px 2px;font-size:14px}.trial-note{font-size:11px;margin-top:6px}.bar-input{display:flex;align-items:center;gap:12px;color:white;font-weight:normal;margin-left:40px;font-size:13px;letter-spacing:0}.bar-input input{width:75px;min-height:27px;padding:4px;margin:0}.position{margin-bottom:10px}.position label{display:flex;align-items:center;gap:12px;font-size:13px}.position select{max-width:170px;margin:0;padding:4px;min-height:30px}.balance-layout{display:grid;grid-template-columns:1fr 2fr 110px;gap:20px}.balance-layout .two{gap:10px}.balance-layout .diff-box{width:auto}.subbar{margin-bottom:16px}.conditions{margin-top:14px;font-size:13px;color:var(--muted)}.conditions summary{cursor:pointer}.conditions>div{margin-top:10px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.report-subtitle{margin-top:15px}.history-chunk{margin-top:20px}.history-chunk+.history-chunk{break-before:page}.history-table td{overflow-wrap:anywhere}.history-table .pair{white-space:nowrap}.section .two>.block{margin-bottom:0}.section .two>div>.block:last-child{margin-bottom:0}
@media(min-width:1000px){.section:nth-of-type(2)>.two>div:first-child{padding-top:40px}}
@media(max-width:1000px){.three{grid-template-columns:1fr 1fr}.three>div:last-child{grid-column:span 2}.fields{grid-template-columns:repeat(3,1fr)}.test-with-diff{flex-wrap:wrap}.diff-box{width:100%;flex-direction:row;justify-content:space-between;align-items:center;padding:4px 10px;gap:4px}.diff-box strong{font-size:14px}.balance-layout{grid-template-columns:1fr 2fr}.balance-layout>.diff-box{grid-column:span 2}.trial-table th{font-size:12px}}
@media(max-width:800px){.fields{grid-template-columns:repeat(2,1fr)}.three{grid-template-columns:1fr}.three>div:last-child{grid-column:auto}.balance-layout{grid-template-columns:1fr}.balance-layout>.diff-box{grid-column:auto}.balance-layout .two{grid-template-columns:1fr 1fr}.bar-input{margin-left:auto}.test-with-diff{flex-wrap:nowrap}.test-with-diff .diff-box{width:85px;flex-direction:column;justify-content:center}.trial-table th{font-size:11px}}
@media(max-width:450px){.test-with-diff{flex-wrap:wrap}.test-with-diff .diff-box{width:100%;flex-direction:row}.fields{grid-template-columns:1fr 1fr}.fields>label:first-child{grid-column:span 2}.bar-input{margin-left:5px}.bar{font-size:12px}.actions button{padding:9px}.sheet{padding:12px}}
@media print{.history-table .pair{white-space:normal}.report .muted{font-size:10px}.report h3{font-size:11px}.report .history-table td small{font-size:9px}.report .history-table th small{font-size:9px}.history-report h2{font-size:17px}.report .history-table th,.report .history-table td{padding:5px}.history-chunk{break-inside:auto}}
/* One-page result report uses the same layout for preview and PDF export. */
.pdf-download{display:inline-block;padding:11px 16px;background:#245985;color:#fff;text-decoration:none;border-radius:4px;font-size:14px;font-weight:600}.pdf-download:hover{background:#173c60}.pdf-download.disabled{opacity:.5;pointer-events:none}.a4-preview{max-width:794px;margin:20px auto 30px;box-shadow:0 4px 20px #173c6020;background:white}.a4-preview img{display:block;width:100%;height:auto}.report-editor{max-width:794px;margin:15px auto;font-size:14px;color:#526575}.report-editor summary{cursor:pointer}.report-editor textarea{min-height:90px;margin-bottom:8px}#pdf-error:not(:empty){background:#fff3dc;color:#754516;padding:14px;max-width:794px;margin:15px auto;line-height:1.5}

[hidden]{display:none!important}.login-card{max-width:420px;margin:60px auto;padding:30px;background:white;border:1px solid #d6e1e8;border-radius:10px;box-shadow:0 10px 30px #173e6010}.login-card h1{font-size:25px}.login-card form{display:grid;gap:18px;margin-top:24px}.login-card label{display:grid;gap:7px}.login-card input{min-height:42px}.login-card p{line-height:1.5}.masthead #logout{margin-left:15px}

.delete-actions{display:flex;gap:10px;justify-content:flex-end;margin:12px 0}.delete-actions button{color:#983434}dialog{border:1px solid #cfdae5;border-radius:12px;padding:24px;max-width:480px;width:calc(100% - 32px);box-sizing:border-box;color:#17334b}dialog::backdrop{background:#102a4666}dialog h2{font-size:1.25rem;margin-top:0}dialog p{line-height:1.5}dialog label{display:grid;gap:8px}dialog input{width:100%;box-sizing:border-box}.dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:20px}button.danger{background:#9e3030;color:white;border-color:#9e3030}#delete-error{color:#9e3030}dialog [hidden]{display:none!important}

.diff-box[data-band="green"],.delta[data-band="green"]{background:#D5EEDF;border-color:#91BBA0;color:#203D50}.diff-box[data-band="yellow"],.delta[data-band="yellow"]{background:#FFF0B3;border-color:#D8C26A;color:#203D50}.diff-box[data-band="red"],.delta[data-band="red"]{background:#F6CDCD;border-color:#D49B9B;color:#203D50}.delta[data-band]:not([data-band=""]){padding:7px 9px;border-radius:3px}.diff-box[data-band],.delta[data-band]{print-color-adjust:exact;-webkit-print-color-adjust:exact}.difference-legend{font-size:12px;color:#425A6B;margin:10px 0 18px}.difference-legend span{display:inline-block;padding:4px 8px;margin:3px 5px 3px 0;border-radius:3px}.legend-green{background:#D5EEDF}.legend-yellow{background:#FFF0B3}.legend-red{background:#F6CDCD}

.app-footer{align-items:flex-end;gap:16px;flex-wrap:wrap}.app-footer .difference-legend{margin:0 0 6px}

/* Login has no clinical legend. History carries its own concise colour key. */
body:not(.signed-in) .app-footer,body.history-view .app-footer{display:none}
.history-chart{background:white;border:1px solid #d8e3eb;border-radius:6px;overflow:auto}
.history-chart svg{display:block;width:100%;min-width:780px;height:auto}
.history-details{margin-top:22px}.history-details summary{cursor:pointer;padding:12px 0}
@media print{@page{size:A4 landscape;margin:0}body.history-view{margin:0;background:white}body.history-view .masthead,body.history-view .topline,body.history-view .selectors,body.history-view .delete-actions,body.history-view nav,body.history-view #notice,body.history-view .pdf-actions,body.history-view .history-details{display:none}body.history-view #workspace,body.history-view #content{margin:0;padding:0;max-width:none}body.history-view .history-chart{border:0;overflow:visible}body.history-view .history-chart svg{width:297mm;min-width:0;height:210mm;print-color-adjust:exact;-webkit-print-color-adjust:exact}}
/* Four-point temperature map and additive joint ROM; old temperatures retain their provenance. */
.basis-layout{display:grid;grid-template-columns:1.25fr 1fr;gap:16px}.basis-layout h3{background:#eaf1f7;padding:9px 10px;margin:0;font-size:14px}.basis-layout h3 small{float:right;font-weight:normal;font-size:11px}.basis-right{min-width:0}.circumference-panel{margin-top:14px}.basis-layout table{font-size:13px}.basis-layout td{padding:5px}.basis-layout th:first-child{width:48%}.rom-tabs{display:flex;margin:5px 0}.rom-tabs button{flex:1;padding:7px 3px;border-radius:0}.rom-tabs button[aria-pressed=true]{background:var(--blue);color:white}.rom-subhead th{background:#eaf1f7;text-align:left;font-size:12px;padding:6px}.temperature-map{position:relative;width:100%;aspect-ratio:600/360;min-width:0}.temperature-map>img{position:absolute;left:35%;top:17%;width:30%;height:66%;object-fit:contain}.temperature-map>svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.temperature-card{position:absolute;width:34%;border:1px solid #b8ccdf;border-radius:5px;background:#f4f8fc;overflow:hidden;font-size:12px}.temp-above{left:33%;top:0}.temp-below{left:33%;bottom:0}.temp-lateral{left:0;top:40%}.temp-medial{right:0;top:40%}.temperature-inputs{display:flex;gap:6px;padding:5px}.temperature-inputs label{display:flex;align-items:center;gap:3px;min-width:0;color:#203d50;font-size:11px}.temperature-inputs input{margin:0;padding:4px 1px;text-align:center;min-width:0;min-height:30px;font-size:13px}.temperature-card output{display:block;border-top:1px solid #d8e3eb;text-align:center;padding:5px 1px;color:#203d50;font-size:11px;white-space:nowrap}.temperature-alert{background:#F6CDCD!important}.anatomy-label{position:absolute;top:58%;font-size:11px;color:#203d50}.anatomy-label.lateral{right:61%}.anatomy-label.medial{left:61%}.legacy-temperature{margin-top:12px}.legacy-temperature h4{font-size:12px;margin:6px 0}.legacy-temperature small{font-size:11px;color:var(--muted)}
@media(max-width:1050px){.basis-layout{grid-template-columns:1fr}.temperature-map{max-width:650px;margin:10px auto}.basis-right{display:grid;grid-template-columns:1fr 1fr;gap:14px}.circumference-panel{margin-top:0}}
@media(max-width:600px){.basis-right{display:block}.circumference-panel{margin-top:14px}.temperature-card{width:36%}.temp-above,.temp-below{left:32%}.temperature-inputs{gap:3px;padding:4px 2px}.temperature-inputs label{gap:2px;font-size:10px}.temperature-inputs input{font-size:12px}.temperature-card output{font-size:9px;padding:4px 0}.anatomy-label{font-size:9px}.temperature-map{min-height:240px}.temperature-map>img{left:35%;width:30%}}

:root{font-family:Avenir,"Avenir Next",Arial,Helvetica,sans-serif}
.basis-layout{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)}.temperature-panel{min-width:0}
@media(max-width:1050px){.basis-layout{grid-template-columns:minmax(0,1fr)}.basis-right{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
@media(max-width:600px){.anatomy-label{top:67%}.temperature-inputs input{min-height:29px}.basis-layout h3 small{float:none;display:block;margin-top:3px}}

/* Only visible during touch number entry; no scroll lock or permanent bar. */
.number-accessory{position:fixed;z-index:1000;height:44px;display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:2px 12px;background:#edf2f7;border-top:1px solid #bccbd9;box-sizing:border-box}
.number-accessory[hidden],.number-accessory button[hidden]{display:none!important}
.number-accessory button{min-height:40px;padding:5px 14px;border:0;background:transparent;color:#175b9b;font-size:16px;font-weight:600}
.number-accessory button:first-child{margin-right:auto}
.release-info{margin:16px auto 24px;padding:0 24px;max-width:1180px;color:#5b6d7e;font-size:12px;text-align:right}
@media(any-pointer:coarse){input[type=number][data-path]{font-size:16px!important;scroll-margin-block:60px}}
@media print{.number-accessory,.release-info{display:none!important}}

/* Compact status stays visible while entering measurements; never covers fields. */
.draft-bar{position:sticky;top:0;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;background:#edf5f7;border:1px solid #c8dbe3;border-radius:6px;font-size:13px;margin:8px 0}
.draft-bar>div{display:flex;gap:6px;flex-shrink:0}.draft-bar button{padding:5px 8px;font-size:12px}.draft-bar[data-state=error]{background:#fff0ee;border-color:#d8a39b}.draft-bar[data-state=pending]{background:#fff6df;border-color:#dac68d}
#draft-list,#conflict-dialog{max-width:min(760px,92vw);max-height:85vh;overflow:auto}#draft-list-body{display:grid;gap:8px;margin:16px 0}#draft-list-body button{text-align:left}#draft-list-body small{display:block;margin-top:5px}#conflict-values{overflow:auto;max-height:50vh}#conflict-values td{overflow-wrap:anywhere}
@media(max-width:600px){.draft-bar{font-size:12px;flex-wrap:wrap;position:static}.draft-bar>div{margin-left:auto}}
@media print{.draft-bar{display:none!important}}

/* Private dialogs must never cover the sign-in screen. */
body:not(.signed-in) dialog{display:none!important}
