:root{font-family:Segoe UI,Arial,sans-serif;color:#1e3444;background:#edf2f5}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{cursor:pointer;border:1px solid #adc2cf;background:#fff;color:#1d4057;border-radius:7px;padding:8px 12px;font-weight:650}button:hover{background:#eff6f9}button:disabled{opacity:.55;cursor:wait}.primary{background:#086f76;color:white;border-color:#086f76}.primary:hover{background:#095e64}.warn{background:#fff6e5;border-color:#e9c783;color:#86530b}header{height:66px;background:#102f42;color:white;display:flex;align-items:center;justify-content:space-between;padding:0 22px}.brand{font-size:20px;font-weight:800;letter-spacing:.03em}.brand span{color:#72dad6}.brand small{display:block;font-size:10px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:#b8d2dd;margin-top:-2px}.header-right{display:flex;align-items:center;gap:14px;font-size:13px}.header-right button{background:#294b5d;color:white;border-color:#486778}#notice{position:fixed;z-index:40;left:50%;top:76px;transform:translateX(-50%);padding:10px 15px;background:#0e716c;color:white;border-radius:7px;box-shadow:0 5px 18px #17354c40;display:none;max-width:min(90vw,650px)}#notice.error{background:#ae333e}.auth-card{max-width:430px;margin:10vh auto;background:white;border:1px solid #d6e0e7;border-radius:12px;padding:30px;box-shadow:0 12px 35px #183a5020}.auth-card h1{margin:0 0 7px;font-size:25px}.auth-card p{color:#617783;margin:0 0 22px}.auth-card form{display:grid;gap:16px}.auth-card label{display:grid;gap:6px;font-weight:650;font-size:13px}.auth-card input{border:1px solid #b9cad3;border-radius:7px;padding:10px;font-size:16px}.auth-card button{padding:11px}main[hidden],div[hidden],button[hidden]{display:none!important}#employee-view,#admin-view{max-width:1650px;margin:auto;padding:16px}.work-head,.admin-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:14px}.eyebrow{text-transform:uppercase;color:#087880;letter-spacing:.12em;font-weight:800;font-size:11px}.work-head h1,.admin-heading h1{font-size:22px;margin:3px 0}.work-head p{margin:0;color:#637984;font-size:13px}.work-meta{display:flex;gap:9px;align-items:center;flex-wrap:wrap;justify-content:flex-end;font-size:12px;color:#536b78}.work-meta strong{color:#075f63;background:#daf0eb;padding:8px;border-radius:6px}.work-grid{height:calc(100vh - 165px);min-height:560px;display:grid;grid-template-columns:minmax(480px,1.4fr) minmax(360px,1fr);gap:14px}.panel{background:white;border:1px solid #d6e2e8;border-radius:10px;box-shadow:0 3px 12px #25445a10;min-height:0;overflow:hidden}.panel-title{padding:12px 15px;border-bottom:1px solid #e2e9ed;display:flex;justify-content:space-between;align-items:center;gap:10px}.panel-title h2{font-size:15px;margin:0}.panel-title span{font-size:12px;color:#637983}.image-panel,.field-panel{display:flex;flex-direction:column}.crop-wrap{flex:1;min-height:0;overflow:auto;background:#253037;display:flex;align-items:flex-start;justify-content:center}.crop-wrap img{max-width:none;min-width:100%;width:100%;height:auto;object-fit:contain}.row-nav{padding:11px 15px;border-top:1px solid #e2e9ed;font-size:12px;font-weight:700;color:#59717e}.row-nav>div{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px;max-height:86px;overflow:auto}.row-nav button{min-width:38px;padding:5px 7px;font-size:12px}.row-nav button.selected{background:#086f76;border-color:#086f76;color:white}.field-panel{overflow:auto}.field-panel .panel-title{position:sticky;top:0;background:white;z-index:1}#field-list{padding:10px 16px}.field{padding:12px 0;border-bottom:1px solid #e8edf0}.field-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px;font-weight:750}.badge{font-size:11px;padding:4px 7px;border-radius:5px}.badge.match{background:#e0f4ea;color:#176b45}.badge.check{background:#fff0d8;color:#966317}.values{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;margin-top:9px}.value small,.edit-label small{display:block;color:#738894;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;margin-bottom:3px}.value div{min-height:31px;background:#f3f7f9;border-radius:5px;padding:6px 8px;font-size:14px;overflow-wrap:anywhere}.edit-label{display:block;grid-column:1/-1}.edit-label input{width:100%;border:1px solid #b9cad3;border-radius:6px;padding:8px 9px;font-size:15px}.edit-label input:focus{outline:2px solid #88b7ba}.keyboard-tip{padding:13px 16px;color:#526d7a;font-size:12px;line-height:1.5;background:#f4f8fa}kbd{font-family:inherit;font-size:11px;background:#e8eef1;border:1px solid #cfdce2;border-radius:4px;padding:2px 4px;color:#36546a}.modal{position:fixed;inset:0;background:#16232aea;z-index:30;display:flex;flex-direction:column}.modal-bar{display:flex;justify-content:space-between;align-items:center;color:white;padding:9px 16px}.modal-image{overflow:auto;flex:1;text-align:center}.modal-image img{max-width:none;max-height:none}.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.admin-body{padding:14px;max-height:440px;overflow:auto;font-size:13px}.admin-body table{border-collapse:collapse;width:100%}.admin-body th,.admin-body td{padding:8px 5px;border-bottom:1px solid #e4eaee;text-align:left}.admin-body th{font-size:11px;text-transform:uppercase;color:#667c89}.admin-body button{font-size:11px;padding:5px 7px}.inline-form{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:12px}.inline-form input{min-width:130px;flex:1;padding:7px;border:1px solid #b9cad3;border-radius:6px}.secret-once{background:#fff8dd;padding:10px;border-radius:6px;margin-bottom:10px;overflow-wrap:anywhere}.metric-row{display:flex;gap:12px;flex-wrap:wrap}.metric{background:#edf5f7;padding:11px 13px;border-radius:7px}.metric strong{display:block;font-size:20px;color:#176b72}.muted{color:#6b7e8a}@media(max-width:900px){.work-grid,.admin-grid{grid-template-columns:1fr;height:auto}.work-grid{min-height:0}.image-panel{height:48vh}.field-panel{min-height:360px}.work-head{align-items:flex-start;flex-direction:column}.work-meta{justify-content:flex-start}}
.modal-image #full-canvas{position:relative;display:inline-block;line-height:0}
.suggestion{grid-column:1/-1;background:#edf7f5;border:1px solid #c6e3dd;border-radius:6px;padding:8px 10px;font-size:14px}.suggestion small{display:block;color:#426f69;font-size:11px;font-weight:700;text-transform:uppercase}.suggestion span{font-weight:700;margin-right:12px}.suggestion button{padding:4px 8px;font-size:12px}.suggestion p{margin:4px 0 0;color:#4b6a66;font-size:12px}
.row-nav button.record-completed{background:#e5f4ee;border-color:#9ac9ae;color:#245b39}.row-nav button.record-senior{background:#fff2dc;border-color:#e8c078;color:#79500b}.row-nav button.record-pending{background:#fff}.row-nav button.selected{background:#0e7577;color:white;border-color:#0e7577}
.reviewed-badge{margin-right:auto;background:#e5f4ee;color:#245b39;border-radius:5px;padding:4px 7px;font-size:11px;font-weight:700}.ai-actions{display:flex;gap:5px;margin-top:5px}.ai-actions button{padding:3px 7px;font-size:11px}.ai-selected{display:block;margin-top:5px;color:#075f63;font-size:11px;font-weight:700}

/* NAME review: the source stays in view while the field list scrolls. */
.work-grid{align-items:start;min-height:0}
.image-panel{align-self:start;position:sticky;top:12px;max-height:calc(100vh - 170px)}
.crop-wrap{display:block;flex:none;min-height:0;max-height:calc(100vh - 310px);overflow:auto;background:#f2f5f5;line-height:0}
.crop-wrap img{display:block;width:100%;min-width:0;height:auto;object-fit:contain}
.field-panel{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain}
#field-list{padding:6px 12px}
.field{padding:5px 0 6px}
.field-head{min-height:26px;gap:6px}
.field-tools{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.values{grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:4px 9px;margin-top:3px}
.value,.ai-column{min-width:0}
.value div{min-height:28px;padding:5px 7px;line-height:1.3}
.value small,.edit-label small,.ai-result-head small{margin-bottom:2px}
.ai-column{display:grid;align-content:start;gap:3px}
.ai-result{min-width:0;border:1px solid #dce5e9;background:#f7fafb;border-radius:5px;padding:2px 6px}
.ai-result-head{display:flex;justify-content:space-between;align-items:baseline;gap:6px;font-size:10px;color:#4f6974}
.ai-result-head small{font-size:10px;font-weight:750;letter-spacing:.04em;text-transform:uppercase}
.ai-result-line{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}
.ai-reading{min-width:0;overflow-wrap:anywhere;font-size:14px;line-height:1.3}
.ai-actions{display:inline-flex;align-items:center;gap:3px;flex:none;margin:0}
.ai-actions button{padding:2px 5px;min-width:25px;line-height:1.35;font-size:11px}
.ai-actions button:disabled{cursor:not-allowed}
.edit-label{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;gap:4px 7px}
.edit-label small{margin:0}
.edit-label input{padding:5px 7px}
.edit-label .ai-selected{grid-column:2}
.ai-selected[hidden]{display:none!important}
.dictionary-hint{margin:3px 0 0;font-size:11px;line-height:1.3;font-weight:650;overflow-wrap:anywhere}
.dictionary-hint.support{color:#176b45}
.dictionary-hint.placement{color:#8b5a10}
.dictionary-hint.ambiguous{color:#526d7a}
#agent-status[data-state="reconnecting"]{color:#74550f;background:#fff5dc;padding:4px 7px;border-radius:5px}
#agent-status[data-state="offline"]{color:#88440d;background:#fff0df;padding:4px 7px;border-radius:5px}
@media(max-width:900px){.work-grid{height:auto}.image-panel{position:relative;top:auto;max-height:none;height:auto}.crop-wrap{max-height:45vh}.field-panel{height:auto;max-height:none;overflow:visible}}
.report-panel{margin-bottom:14px}.report-panel>.admin-body{max-height:none}.report-controls{display:flex;align-items:end;gap:9px;flex-wrap:wrap;margin-bottom:12px}.report-controls label{display:grid;gap:3px;font-size:12px;font-weight:700}.report-controls input,.report-controls select{padding:7px;border:1px solid #b9cad3;border-radius:6px}.report-panel .metric-row{margin:12px 0}.report-scroll{overflow-x:auto}.report-scroll table{min-width:1200px}.report-panel #report-detail{border-top:1px solid #d6e2e8;margin-top:14px;padding:8px}.report-panel #report-detail .panel-title{padding:6px 0}.report-panel #report-detail h3{margin:0}.report-panel #report-detail table{max-width:620px}
.senior-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(300px,1fr);gap:1rem}
.senior-grid .panel{padding:1rem}
.senior-crop{display:block;max-width:100%;max-height:55vh;object-fit:contain;background:#f8f4eb;border:1px solid #c4beb0}
.senior-grid label{display:block;margin:.8rem 0}
.senior-grid input,.senior-grid select{display:block;width:100%;max-width:500px}
@media(max-width:850px){.senior-grid{grid-template-columns:1fr}}

/* Employee NAME workspace: fill the viewport and keep each pane within its grid track. */
*,*::before,*::after{box-sizing:border-box}
html,body{width:100%;min-height:100%;margin:0}
#employee-view{
  --workspace-gutter:clamp(12px,1.25vw,24px);
  --workspace-gap:clamp(10px,1vw,18px);
  width:100%;max-width:none;margin:0;
  height:calc(100vh - 66px);height:calc(100dvh - 66px);
  padding:var(--workspace-gutter);
  display:flex;flex-direction:column;min-width:0;
}
#employee-view .work-head{flex:none;min-width:0;flex-wrap:wrap;align-items:flex-start}
#employee-view .work-head>div:first-child{flex:1 1 260px;min-width:0}
#employee-view .work-head h1{overflow-wrap:anywhere}
#employee-view .work-meta{min-width:0}
#employee-view .work-grid{
  flex:1 1 auto;width:100%;height:auto;min-height:0;min-width:0;
  grid-template-columns:minmax(0,1.12fr) minmax(0,1fr);
  gap:var(--workspace-gap);
}
#employee-view .image-panel,#employee-view .field-panel{min-width:0}
#employee-view .image-panel{top:var(--workspace-gutter);max-height:100%}
#employee-view .crop-wrap{max-height:min(52dvh,calc(100dvh - 250px))}
#employee-view .field-panel{height:100%;min-height:0;overflow-y:auto}
#employee-view .panel-title{min-width:0}
#employee-view .panel-title span{overflow-wrap:anywhere;text-align:right}
#employee-view .field-head{min-width:0}
#employee-view .field-head>span:first-child{min-width:0;overflow-wrap:anywhere}
#employee-view .values{min-width:0}
@media(max-width:1200px){
  #employee-view .work-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
}
@media(max-width:900px){
  #employee-view{height:auto;min-height:calc(100dvh - 66px)}
  #employee-view .work-grid{flex:none;grid-template-columns:minmax(0,1fr);height:auto}
  #employee-view .image-panel{position:static;max-height:none}
  #employee-view .crop-wrap{max-height:45dvh}
  #employee-view .field-panel{height:min(66dvh,700px);min-height:300px;overflow-y:auto}
}

.calibration-area{margin-top:1rem;border-top:1px solid #c4beb0;padding-top:1rem}
.calibration-source{width:min(100%,1200px);max-height:70vh;overflow:auto;background:#f8f4eb}
.calibration-canvas{position:relative;width:100%}
.calibration-source img{display:block;width:100%;height:auto}
#calibration-overlays{position:absolute;inset:0;pointer-events:none}
.calibration-box{position:absolute;border:2px solid #d14a28;background:rgba(230,117,43,.14)}
.calibration-box span{position:absolute;left:0;top:0;background:#d14a28;color:white;padding:1px 4px;font-size:.75rem}
#calibration-records{max-height:36vh;overflow:auto}
#calibration-records input{width:7rem}
