.history-dialog{width:min(560px,calc(100% - 24px))}.history-dialog h2{font-size:20px;line-height:1.3}.history-dialog dt{font-weight:700;margin-top:12px}.history-dialog dd{margin:4px 0 12px}.history-actions{display:flex;flex-wrap:wrap;gap:8px}.history-actions button,.source-association button{height:auto;min-height:44px;white-space:normal}.history-actions button{flex:1 1 180px}.source-association{border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:14px}.source-association input{width:100%}.source-association button{margin-top:12px}.source-association p:empty,#source-identity-message:empty{display:none}
.case-patient-actions{display:flex;align-items:center;justify-content:center;margin:0}
.case-header{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 18px;padding:12px 0}
.case-eye-heading{border-left:5px solid var(--accent);padding:4px 14px}.case-eye-heading small{display:block;color:var(--ink-2);font-size:12px}.case-eye-heading strong{display:block;font-size:24px;color:var(--accent);line-height:1.3}
.case-eyes{display:flex;gap:8px}.case-eyes button{display:grid;text-align:left;height:auto;min-width:170px;padding:10px 14px;gap:3px}.case-eyes strong{font-size:16px}.case-eyes span,.case-eyes small{font-size:12px;font-weight:400}
.case-notices{grid-column:1/-1}.case-notices .msg{margin:6px 0}.card-bio h2{color:var(--accent);font-weight:600}
.field-source{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:6px}.field-source select{height:auto;min-height:30px;min-width:80px;max-width:100%;width:auto;flex:1;font-size:12px;padding:4px}.field-source button{font-size:12px;height:auto;min-height:30px;padding:4px 8px}
.source-linked{display:block;font-size:11px;color:var(--ink-2);margin-top:8px}.omitted-value{opacity:.6;text-decoration:line-through}
.cornea-auto>.seg{display:none}.cornea-auto{grid-column:1/-1!important}.cornea-auto .field-source select{flex:none;max-width:260px}
.form>.card-scan{grid-column:1/-1;grid-area:auto;margin:18px 0 0}.card-scan{padding-bottom:80px}.multiple-source{font-size:13px;display:flex;align-items:center;gap:6px}.multiple-source input{width:16px;height:16px}
.source-tray{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px;margin-top:12px}.source-tray article{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:12px}.source-tray span,.source-tray small{display:block;font-size:12px;margin:6px 0;overflow-wrap:anywhere}.source-tray button{font-size:12px;height:auto;padding:7px 10px}.source-tray .source-conflict{border:2px solid var(--warn)}.source-error{font-size:13px;color:var(--warn)}
.calculate-anchor{height:48px;width:260px;max-width:100%;flex:none}#go{width:100%;max-width:none;height:48px}#go.calculate-floating,.result-calculate{position:fixed;right:24px;bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:40;width:260px;height:48px;box-shadow:0 4px 16px #0003;border:2px solid var(--surface)}.show-results #go{display:none}.result-calculate{font-size:16px}
.case-stale{width:fit-content;max-width:100%;box-sizing:border-box;background:color-mix(in srgb,var(--note) 12%,var(--surface));color:var(--note);border:1px solid var(--note);font-weight:700;padding:10px;border-radius:8px;font-size:13px;--pulse:var(--note);animation:eye-pulse2 3.2s ease-in-out infinite}
.case-result-inputs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding-bottom:16px;margin-bottom:16px;border-bottom:1px solid var(--line)}.result-field{min-width:0}.result-field>strong{font-size:13px}.result-values{display:flex;flex-wrap:wrap;gap:5px}.result-values label{flex:1;min-width:70px;font-size:11px;color:var(--ink-2)}.result-values input{width:100%;font-size:14px}.result-field:has([data-pick=k]),.result-field:has([data-pick=cornea]){grid-column:1/-1}
.source-dialog{width:min(980px,calc(100% - 24px));max-height:90dvh;border:1px solid var(--line);border-radius:12px;padding:16px;color:var(--ink);background:var(--surface)}.source-dialog::backdrop{background:#0009}.source-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px;position:sticky;top:-16px;background:var(--surface);padding:8px 0;z-index:1}.source-dialog-head button{height:40px;padding:0 12px}.source-dialog img{display:block;max-width:100%;max-height:65dvh;object-fit:contain;margin:auto}.source-details{font-size:13px;overflow-wrap:anywhere}.source-details label{display:block;margin-top:10px}.source-details input,.source-details select{max-width:100%}.source-details button{height:auto;min-height:40px;white-space:normal}
@media(min-width:1280px){.form{grid-template-areas:"eyeheader eyeheader eyeheader" "notices notices notices" "pt pt pt" "left bio right" "actions actions actions" "uploads uploads uploads"}.form>.case-header{grid-area:eyeheader}.form>.case-notices{grid-area:notices}.form>.card-scan{grid-area:uploads}.form>.actions{position:static}}
@media(max-width:600px){.case-header{display:block}.case-eyes{margin-top:12px;display:grid;grid-template-columns:1fr 1fr}.case-eyes button{min-width:0;padding:8px}.case-eyes strong{font-size:15px}.case-eyes small{font-size:11px}.case-result-inputs{grid-template-columns:1fr 1fr}.result-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.result-values label:only-child{grid-column:1/-1}.result-values input{padding:8px;font-size:16px}.field-source select{font-size:16px}.field-source button{min-height:40px}.card-bio .fields>.half{grid-column:1/-1}#go.calculate-floating,.result-calculate{left:22px;right:22px;width:calc(100% - 44px)}.source-tray{grid-template-columns:1fr}}
@media print{.case-header,.case-notices,.case-review,.case-result-inputs,.case-stale,.result-calculate,.source-dialog,.field-source{display:none!important}body.case-export-blocked #results>*{display:none!important}body.case-export-blocked #results::before{content:'Inputs changed. Calculate the selected eye before printing.';display:block}}
.scan-progress-wrap{margin:12px 0;width:100%}.scan-progress-wrap[hidden]{display:none}.scan-progress-wrap label{display:block;font-size:13px;margin-bottom:6px;overflow-wrap:anywhere}.scan-progress-wrap progress{display:block;width:100%;height:14px;accent-color:var(--accent,#2563eb)}
@keyframes eye-pulse{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 55%,transparent)}50%{box-shadow:0 0 0 9px color-mix(in srgb,var(--accent) 0%,transparent)}}
.case-eyes [data-eye="OD"]{--pulse:var(--eye-od)}.case-eyes [data-eye="OS"]{--pulse:var(--eye-os)}
.form.no-eye .case-eyes button,.case-eyes button.primary{animation:eye-pulse2 3.2s ease-in-out infinite}
.case-eyes button[data-eye="OD"].primary{background:var(--eye-od);border-color:var(--eye-od);color:var(--eye-od-ink)}
.case-eyes button[data-eye="OS"].primary{background:var(--eye-os);border-color:var(--eye-os);color:var(--eye-ink)}
.form.no-eye>.case-header{position:sticky;top:0;z-index:60;background:var(--bg);box-shadow:0 6px 14px rgba(0,0,0,.15);padding:10px 12px;border-radius:0 0 12px 12px}
.no-eye-hint{display:none;margin:8px 0 0;font-weight:600;color:var(--ink-2);flex-basis:100%}.form.no-eye .no-eye-hint{display:block}
.form.no-eye [inert]{opacity:.45;filter:grayscale(.4)}
.case-review{margin:0 0 14px;border:1px solid var(--line);border-radius:10px;padding:8px 12px}.case-review>summary{cursor:pointer;font-weight:600;font-size:14px;color:var(--ink-2);list-style-position:inside}.case-review[open]>summary{margin-bottom:10px}.case-review .case-result-inputs{margin-bottom:0;border-bottom:0;padding-bottom:4px}
body[data-eye="OD"] #case-eye-title{color:var(--eye-od)}body[data-eye="OS"] #case-eye-title{color:var(--eye-os)}
.source-focus{position:sticky;top:4.5rem;z-index:2;background:var(--surface);color:var(--ink);padding:.5rem;font-weight:700}
.source-image-viewport{max-height:60vh;overflow:auto;overscroll-behavior:contain}
.source-image-viewport img{max-width:none;max-height:none;height:auto;object-fit:initial;display:block;width:100%;cursor:zoom-in}
.source-image-viewport img[aria-pressed=true]{cursor:zoom-out}
#source-review-summary{display:block;font-weight:400;line-height:1.5;margin-top:.35rem}
.retry-review,.unassigned-source{padding:.7rem;border:2px solid #b7791f;border-radius:.6rem}
.unassigned-source button{margin:.25rem}
.source-dialog-head{position:sticky;top:0;z-index:3;background:var(--surface);padding-bottom:.5rem}
.source-dialog>.source-association{font-size:14px;line-height:1.4;margin:8px 0 12px;padding:12px;border:1px solid var(--warn);border-radius:8px;background:var(--surface)}
.source-association h3{font-size:16px;margin:0 0 6px}.source-association p{margin:6px 0}.source-association button{margin-top:6px}
.source-read-identity{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 12px;margin:8px 0}.source-read-identity dt{color:var(--ink-2)}.source-read-identity dd{margin:0;font-weight:600;overflow-wrap:anywhere}.source-current-patient{overflow-wrap:anywhere}
.source-details input,.source-details select{display:block;width:100%;background:var(--field);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;padding:.65rem;font:inherit}
.source-details label{display:block;margin:.7rem 0}
@media screen{
 .layout:not(.show-results){max-width:1680px}
 .form.entry-four{display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:none;gap:16px;align-items:start}
 .entry-four>.col{display:contents}
 .entry-four>.case-header,.entry-four>.case-notices,.entry-four>.pt-strip,.entry-four>.actions,.entry-four>.card-scan,.entry-four>.other-situations{grid-area:auto;grid-column:1/-1;margin:0}
 .entry-four .card-patient,.entry-four .card-bio,.entry-four .card-cornea,.entry-four .card-lens{grid-area:auto;min-width:0;margin:0;padding:18px;border-top:3px solid var(--accent)}
 .entry-four .card-patient>.fields,.entry-four .card-lens>.fields,.entry-four .card-bio>.fields{grid-template-columns:minmax(0,1fr);gap:14px}
 .entry-four .card-bio>.fields>.field{grid-column:auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(92px,110px);gap:4px 10px;align-items:center}
 .entry-four .card-bio .field>.lbl{margin:0}
 .entry-four .card-bio .field>.in{min-width:0;width:100%}
 .entry-four .card-bio .field-source{grid-column:1/-1;margin-top:0}
 .entry-four .field-source select{min-width:0;max-width:100%}
 .entry-four .card-cornea>.fields{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:14px 10px}
 .entry-four .card-cornea .fields>.half{grid-column:span 1}
 .entry-four .card-cornea #opt-cornea,.entry-four .card-cornea #cornea-help,.entry-four .card-cornea .fields>:has(>#k_index){grid-column:1/-1}
 .entry-four .card-cornea .pair{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
 .entry-four .card-cornea .pair>.at{display:none}
 .entry-four .card-cornea .pair>.in{min-width:0;width:100%}
 .entry-four .card-cornea .cornea-pair .pair,.entry-four .pair-labels{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:6px}
 .entry-four .cornea-pair .in>i{display:none}
 .entry-four .cornea-pair input{padding:9px 6px;width:100%;min-width:0}
 .entry-four .pair-labels .lbl{font-size:13px;white-space:nowrap}
 .entry-four .card-cornea .field:has(#k1),.entry-four .card-cornea .field:has(#k2){align-self:start}
 .entry-four .biometer-internal{display:none!important}
 .cornea-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
 .cornea-card-header h2{flex:1;min-width:0;margin:0}
 .cornea-card-header .k-index-control{display:flex;flex-direction:row;align-items:center;gap:6px;flex:0 0 auto;min-width:0}
 .k-index-control .lbl{font-size:11px;margin:0;white-space:nowrap}
 .k-index-control select{font-size:13px;height:34px;padding:4px 5px;width:78px}
 .field-source select[hidden]{display:none}
 .entry-four #tk-opt small{display:block;font-size:11px;line-height:1.3;font-weight:400}
 .entry-four #tk-opt span{flex-direction:column;padding:4px 8px}
 .entry-four .patient-context{margin-top:18px}
 .entry-four .patient-context>.field{margin-top:16px}
 .entry-four .patient-context>.field:first-child{margin-top:0}
 .entry-four .patient-context .opt .fields{padding:4px 0}
 .entry-four #opt-postref{border:0;padding:0;margin:10px 0}
 .entry-four #opt-postref>.summary,.entry-four #opt-postref>summary{display:none}
 .entry-four #opt-postref>.fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .entry-four .post-refractive-status .segbtn-mount .segbtn{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .entry-four .post-refractive-status .segbtn-mount button{min-height:44px;font-size:13px;border:1px solid var(--line)}
 .entry-four .card-patient .segbtn button{min-height:44px}
 .entry-four .other-situations{margin-top:18px}
 .entry-four .other-situations>.opt{margin:10px 0}
 .entry-four .other-situations .fields{padding-left:0}
 .future-situations button{height:auto;min-height:44px;width:100%;white-space:normal;text-align:left;margin:8px 0}
 .future-situations small{display:block;font-size:12px}
 .case-header{gap:8px;padding:0}
 .case-eye-heading{display:none}
 .case-eyes{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:24px;margin:0;align-items:center}
 .case-patient-actions{display:block;text-align:center;min-width:0}
 #new-patient-hint{display:block;color:var(--ink-2);font-size:12px;line-height:1.3;margin-top:2px}
 .case-eyes button{min-width:0;width:100%;max-width:none;padding:10px 14px}
 .case-patient-actions #clear{border:0;background:transparent;padding:8px 4px;font-size:13px;white-space:nowrap;height:auto}
 .entry-four>.actions{position:static;display:flex;justify-content:flex-end}
 .entry-four .card-scan{margin-top:2px}
 .ip-compact .ip-summary{display:none}
 .ip-adjust>summary{color:var(--accent);font-size:14px;padding:8px 0;cursor:pointer}
 .ip-compact .ip-modes button,.ip-compact .ip-strategy button{font-size:13px}
}
@media screen and (min-width:900px){.form.entry-four{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media screen and (min-width:1440px){.form.entry-four{grid-template-columns:minmax(0,1fr) minmax(210px,.72fr) minmax(0,1.3fr) minmax(0,1.16fr)}}
@media screen and (max-width:600px){.case-eyes{gap:12px}#new-patient-hint{font-size:10px}.case-eyes button{padding:9px 7px}.case-eyes small{font-size:11px}.case-patient-actions #clear{font-size:12px}.entry-four .card-patient,.entry-four .card-bio,.entry-four .card-cornea,.entry-four .card-lens{padding:16px}.entry-four .card-bio>.fields>.field{grid-template-columns:minmax(0,1fr) 120px}.entry-four .card-cornea .field-source{gap:4px}.entry-four .card-cornea .field-source button{font-size:12px}}
