:root{--navy:#1a365d;--navy-600:#2c5282;--navy-50:#ebf2fa;--bg:#f4f6f9;--surface:#fff;--surface-2:#f8fafc;--border:#e2e8f0;--border-strong:#cbd5e1;--text:#1e293b;--muted:#64748b;--amber-bg:#fef3c7;--amber-border:#f59e0b;--amber-text:#92400e;--green-bg:#dcfce7;--green-border:#16a34a;--green-text:#166534;--blue-bg:#e0ecff;--blue-border:#3b82f6;--red-text:#b91c1c;--radius:8px;color:var(--text);background:var(--bg);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;-webkit-font-smoothing:antialiased;font-family:Segoe UI,Leelawadee UI,Noto Sans Thai,Tahoma,system-ui,sans-serif;font-size:15px;line-height:1.5}*,:before,:after{box-sizing:border-box}body{background:var(--bg);min-width:320px;margin:0}button,input,select{font:inherit;color:inherit}kbd{border:1px solid var(--border-strong);background:var(--surface);border-bottom-width:2px;border-radius:4px;padding:1px 5px;font-family:inherit;font-size:12px}.app{max-width:1440px;margin:0 auto;padding:16px}.muted{color:var(--muted)}.small{font-size:13px}.center{text-align:center}.spacer{flex:1}.error-text{color:var(--red-text);margin:8px 0}.topbar{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px;display:flex}.brand{align-items:center;gap:12px;display:flex}.logo{background:var(--navy);color:#fff;border-radius:10px;place-items:center;width:40px;height:40px;font-weight:700;display:grid}.brand-name{font-size:17px;font-weight:600}.steps{flex-wrap:wrap;gap:18px;margin:0;padding:0;list-style:none;display:flex}.steps li{color:var(--muted);align-items:center;gap:6px;font-size:14px;display:flex}.steps b{background:var(--border);width:24px;height:24px;color:var(--muted);border-radius:50%;place-items:center;font-size:12px;display:inline-grid}.steps li.on{color:var(--text);font-weight:600}.steps li.on b{background:var(--navy);color:#fff}.steps li.done b{background:var(--green-bg);color:var(--green-text)}.btn{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);cursor:pointer;white-space:nowrap;justify-content:center;align-items:center;gap:6px;height:36px;padding:0 14px;display:inline-flex}.btn:hover:not(:disabled){background:var(--surface-2);border-color:var(--muted)}.btn:disabled{opacity:.5;cursor:default}.btn.primary{background:var(--navy);border-color:var(--navy);color:#fff}.btn.primary:hover:not(:disabled){background:var(--navy-600)}.btn.icon{width:32px;height:32px;padding:0;font-size:18px}.link-btn{cursor:pointer;color:var(--navy-600);text-underline-offset:3px;background:0 0;border:0;padding:4px 0;text-decoration:underline}:focus-visible{outline:2px solid var(--blue-border);outline-offset:2px}.upload{max-width:720px;margin:48px auto}.dropzone{border:2px dashed var(--border-strong);background:var(--surface);text-align:center;cursor:pointer;border-radius:16px;padding:48px 24px;transition:border-color .15s,background .15s}.dropzone:hover,.dropzone.dragging{border-color:var(--navy-600);background:var(--navy-50)}.dropzone-icon{fill:none;width:56px;height:56px;stroke:var(--navy);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.dropzone-title{margin:12px 0 4px;font-size:19px;font-weight:600}.dropzone .btn{margin-top:16px}.upload-notes{margin-top:20px;font-size:14px}.model-state{align-items:center;gap:8px;font-weight:500;display:flex}.model-state .dot{background:var(--amber-border);border-radius:50%;width:10px;height:10px}.model-state.loading .dot{animation:1s infinite alternate pulse}.model-state.ready .dot{background:var(--green-border)}.model-state.error{color:var(--red-text)}.model-state.error .dot{background:var(--red-text)}@keyframes pulse{to{opacity:.3}}.review-head{background:var(--surface);border:1px solid var(--border);border-radius:12px;flex-wrap:wrap;align-items:center;gap:16px;margin-bottom:12px;padding:12px 16px;display:flex}.file{flex-direction:column;min-width:160px;display:flex}.file strong{word-break:break-all}.metrics{flex-wrap:wrap;flex:1;gap:8px;display:flex}.metric{background:var(--surface-2);border-radius:var(--radius);min-width:96px;padding:6px 14px}.metric span{color:var(--muted);font-size:12px;display:block}.metric b{font-size:20px;font-weight:600}.metric.warn b{color:var(--amber-text)}.metric.ok b{color:var(--green-text)}.actions{align-items:center;gap:8px;display:flex}.toggle{border:1px solid var(--border-strong);border-radius:var(--radius);display:inline-flex;overflow:hidden}.toggle button{background:var(--surface);cursor:pointer;border:0;height:34px;padding:0 14px}.toggle button[aria-selected=true]{background:var(--navy-50);color:var(--navy);font-weight:600}.progress{margin-bottom:12px}.progress-text{color:var(--muted);margin-bottom:4px;font-size:13px}.bar{background:var(--border);border-radius:3px;height:6px;overflow:hidden}.bar div{background:var(--navy-600);height:100%;transition:width .3s}.split{grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);align-items:start;gap:12px;display:grid}.panel{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:12px}.panel-bar{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:10px;font-size:14px;display:flex}.page-panel{position:sticky;top:12px}.page-stage{background:var(--surface-2);border-radius:var(--radius);padding:8px}.page-frame{width:100%;max-height:calc(100vh - 220px);margin:0 auto;position:relative}.page-frame img{-webkit-user-select:none;user-select:none;border:1px solid var(--border);width:100%;height:100%;display:block}.page-placeholder{height:420px;color:var(--muted);place-items:center;display:grid}.slot{cursor:pointer;text-align:left;background:0 0;border:2px solid #0000;border-radius:6px;padding:0;position:absolute}.slot .slot-tag{background:var(--surface);border:1px solid var(--border-strong);border-radius:4px;padding:1px 6px;font-size:11px;font-weight:600;position:absolute;top:4px;right:4px}.slot.unchecked{border-color:var(--blue-border);background:#3b82f60f}.slot.missing{border-color:var(--amber-border);background:#f59e0b24}.slot.missing .slot-tag{background:var(--amber-bg);color:var(--amber-text);border-color:var(--amber-border)}.slot.confirmed{border-color:var(--green-border);background:#16a34a0f}.slot.confirmed .slot-tag{background:var(--green-bg);color:var(--green-text);border-color:var(--green-border)}.slot.selected{border-width:3px;border-color:var(--navy);box-shadow:0 0 0 3px #1a365d40}.slot.pending{cursor:default;background:#f1f5f9bf}.slot.scanning{border:2px dashed var(--navy-600);cursor:default;background:#2c528214;animation:.8s infinite alternate pulse}.slot.empty{border:1px dashed var(--border-strong);cursor:default}.slot.empty .slot-tag{color:var(--muted)}.slot:hover:not(.pending,.scanning,.empty){background:#1a365d1a}.legend{color:var(--muted);gap:14px;margin-top:8px;font-size:12px;display:flex}.legend span{align-items:center;gap:5px;display:flex}.sw{border:2px solid;border-radius:3px;width:12px;height:12px;display:inline-block}.sw.missing{border-color:var(--amber-border);background:var(--amber-bg)}.sw.unchecked{border-color:var(--blue-border);background:var(--blue-bg)}.sw.confirmed{border-color:var(--green-border);background:var(--green-bg)}.empty-editor{min-height:300px;color:var(--muted);text-align:center;place-items:center;display:grid}.badge{border:1px solid;border-radius:999px;margin-left:auto;padding:2px 10px;font-size:12px;font-weight:600}.badge.missing{background:var(--amber-bg);color:var(--amber-text);border-color:var(--amber-border)}.badge.unchecked{background:var(--blue-bg);color:var(--navy);border-color:var(--blue-border)}.badge.confirmed{background:var(--green-bg);color:var(--green-text);border-color:var(--green-border)}.badge.as-link{cursor:pointer;white-space:nowrap;margin:0}.card-image{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2);cursor:zoom-in;width:100%;max-height:190px;margin-bottom:12px;padding:0;display:block;position:relative;overflow:hidden}.card-image img{object-fit:cover;object-position:top;width:100%;max-height:190px;display:block}.card-image.zoomed{cursor:zoom-out;max-height:none}.card-image.zoomed img{max-height:none}.card-image .hint{color:#fff;background:#0f172ab3;border-radius:4px;padding:2px 8px;font-size:11px;position:absolute;bottom:6px;right:6px}.fields{flex-direction:column;gap:6px;display:flex}.field{grid-template-columns:130px minmax(0,1fr);align-items:center;gap:10px;display:grid}.field label{color:var(--muted);font-size:13px}.field .req{color:var(--amber-text);margin-left:2px}.field input,.field select{border:1px solid var(--border-strong);background:var(--surface);border-radius:6px;width:100%;height:34px;padding:0 10px}.field input:focus,.field select:focus{border-color:var(--navy-600);outline:2px solid #2c528233}.field.low input,.field.low select{background:var(--amber-bg);border-color:var(--amber-border)}.fields .link-btn{align-self:flex-start;margin:2px 0 0 140px;font-size:13px}.raw{background:var(--surface-2);border-radius:var(--radius);margin-top:12px;padding:8px 12px;font-size:13px}.raw-head{color:var(--muted);margin:4px 0;font-weight:600}.raw ol{margin:0;padding-left:22px}.raw ol.dropped{color:var(--muted);text-decoration:line-through}.editor-actions{flex-wrap:wrap;gap:8px;margin-top:14px;display:flex}.check{cursor:pointer;align-items:center;gap:6px;display:flex}.table-scroll{border:1px solid var(--border);border-radius:var(--radius);max-height:calc(100vh - 260px);overflow:auto}.sheet{border-collapse:collapse;min-width:100%;font-size:13px}.sheet th{z-index:1;background:var(--navy);color:#fff;white-space:nowrap;text-align:center;padding:8px;font-weight:600;position:sticky;top:0}.sheet td{border:1px solid var(--border);white-space:nowrap;padding:2px}.sheet tbody tr:nth-child(odd) td{background:var(--surface-2)}.sheet tbody tr.selected td{background:var(--navy-50)}.sheet td.num{text-align:center;padding:2px 8px}.sheet td.low,.sheet tbody tr td.low{background:var(--amber-bg)}.sheet input{background:0 0;border:1px solid #0000;border-radius:4px;padding:4px 6px}.sheet input:hover{border-color:var(--border-strong)}.sheet input:focus{border-color:var(--navy-600);background:var(--surface);outline:none}.shortcuts{margin-top:10px}@media (width<=900px){.split{grid-template-columns:1fr}.page-panel{position:static}.field{grid-template-columns:1fr;gap:2px}.fields .link-btn{margin-left:0}.steps{display:none}}.dash{flex-direction:column;gap:12px;display:flex}.dash-filters{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.dash-select{align-items:center;gap:8px;font-size:14px;display:flex}.dash select,.dash-select select{border:1px solid var(--border-strong);background:var(--surface);border-radius:6px;height:34px;padding:0 8px}.toggle button:disabled{opacity:.45;cursor:default}.dash-kpis{flex-wrap:wrap;gap:8px;display:flex}.dash-kpis .metric{background:var(--surface);border:1px solid var(--border)}.dash-note{color:var(--amber-text);background:var(--amber-bg);border-radius:var(--radius);margin:0;padding:6px 12px;font-size:13px}.dash-status{border-radius:var(--radius);flex-wrap:wrap;align-items:center;gap:12px;padding:8px 12px;font-size:13px;display:flex}.dash-status.warn{background:var(--amber-bg);color:var(--amber-text)}.dash-status.ok{background:var(--green-bg);color:var(--green-text)}.dash-status .btn{height:30px;font-size:13px}.dash-progress{background:#ffffffb3;border-radius:4px;flex:1;min-width:80px;height:8px;overflow:hidden}.dash-progress span{background:currentColor;border-radius:4px;height:100%;display:block}.dash-tiles{grid-template-columns:repeat(auto-fill,minmax(min(150px,100%),1fr));gap:10px;display:grid}.dash-tile{background:var(--surface-2);border:1px solid var(--border);border-radius:10px;flex-direction:column;gap:2px;padding:12px 14px;display:flex}.dash-tile>span{font-size:14px}.dash-tile>span small{font-size:12px;display:block}.dash-tile b{font-variant-numeric:tabular-nums;font-size:34px;font-weight:700;line-height:1.1}.dash-tile b small{font-size:15px;font-weight:500}.dash-tile>small{font-size:12px}.dash-tile.total{background:var(--navy);border-color:var(--navy);color:#fff}.dash-extras{flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px;font-size:13px;display:flex}.dash-extras>.muted{min-width:96px}.dash-count{background:var(--surface-2);border:1px solid var(--border);border-radius:999px;padding:2px 10px}.dash-count b{margin-left:4px}.dash>*{min-width:0}.dash-filters .toggle{max-width:100%;overflow-x:auto}.dash-filters .toggle button{white-space:nowrap}.dash-cgrid{grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr));gap:10px;display:grid}.dash-cgroup{border:1px solid var(--border);border-top:4px solid var(--tone);background:var(--surface);border-radius:0 0 10px 10px;padding:10px 12px}.dash-cgroup-head{justify-content:space-between;align-items:baseline;margin-bottom:8px;font-size:14px;font-weight:600;display:flex}.dash-cgroup-head b{color:var(--tone-text);font-size:20px}.dash-cgroup-note{color:var(--tone-text);margin:-4px 0 8px;font-size:12px}.dash-cchips{flex-wrap:wrap;gap:6px;display:flex}.dash-cchip{border:1px solid var(--tone-border);background:var(--tone-bg);max-width:100%;color:var(--tone-text);text-align:left;cursor:pointer;border-radius:8px;flex-direction:column;align-items:flex-start;gap:1px;padding:4px 10px;font-size:13px;display:flex}.dash-cchip:hover{border-color:var(--tone)}.dash-cchip-id{white-space:nowrap;font-weight:600}.dash-cchip-id .muted{font-weight:400}.dash-cchip-note{opacity:.9;text-overflow:ellipsis;white-space:nowrap;max-width:240px;font-size:12px;overflow:hidden}.dash-cchip .dot{background:var(--blue-border);vertical-align:2px;border-radius:50%;width:7px;height:7px;margin-right:5px;display:inline-block}.tone-red{--tone:#dc2626;--tone-bg:#fef2f2;--tone-border:#fecaca;--tone-text:#991b1b}.tone-amber{--tone:var(--amber-border);--tone-bg:#fffbeb;--tone-border:#fde68a;--tone-text:var(--amber-text)}.tone-teal{--tone:#0d9488;--tone-bg:#f0fdfa;--tone-border:#99f6e4;--tone-text:#115e59}.tone-violet{--tone:#7c3aed;--tone-bg:#f5f3ff;--tone-border:#ddd6fe;--tone-text:#5b21b6}.tone-gray{--tone:#64748b;--tone-bg:var(--surface-2);--tone-border:var(--border-strong);--tone-text:var(--text)}.dash-more>summary{cursor:pointer;padding:2px 0;font-size:14px}.dash-more[open]>summary{margin-bottom:12px}.dash-groupbar{gap:10px}.dash-presets{flex-wrap:wrap;gap:6px;margin-bottom:12px;display:flex}.chip{border:1px solid var(--border-strong);background:var(--surface);cursor:pointer;border-radius:999px;padding:3px 12px;font-size:13px}.chip:hover{border-color:var(--navy-600)}.chip.on{background:var(--navy);border-color:var(--navy);color:#fff}.dash-groups{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.dash-row{border:0;border-top:1px solid var(--border);background:var(--surface);text-align:left;grid-template-columns:minmax(0,1.4fr) 70px 56px minmax(80px,1fr);align-items:center;gap:12px;width:100%;padding:7px 12px;display:grid}button.dash-row{cursor:pointer}button.dash-row:hover{background:var(--navy-50)}.dash-row .num{text-align:right;font-variant-numeric:tabular-nums}.dash-head{background:var(--navy);color:#fff;border-top:0;font-size:13px;font-weight:600}.dash-parent{background:var(--surface-2);font-weight:600}.dash-child{padding-left:36px;font-size:14px}.dash-total{background:var(--surface-2);font-weight:700}.caret{width:1em;color:var(--muted);display:inline-block}.dash-bar{background:var(--border);border-radius:5px;height:10px;display:block;overflow:hidden}.dash-bar span{background:var(--navy-600);border-radius:5px;height:100%;display:block}.dash-child .dash-bar span{background:var(--blue-border)}.dash-patients{background:var(--surface);border-top:1px dashed var(--border);margin:0;padding:4px 12px 8px 48px;list-style:none}.dash-patients li{flex-wrap:wrap;align-items:center;gap:10px;padding:3px 0;font-size:14px;display:flex}.dash-patients .badge{margin-left:0}.dash-caution{color:var(--red-text);font-size:13px}section>.dash-patients{border-top:0;padding-left:4px}.dash-matrix th[scope=row]{background:var(--surface-2);color:var(--text);text-align:left;position:static}.dash-matrix td.num{font-variant-numeric:tabular-nums;min-width:56px;padding:6px 12px}.dash-matrix tbody tr td{background:0 0}.dash-matrix td.total{background:var(--surface-2);font-weight:700}.dash-matrix tfoot th,.dash-matrix tfoot td{border-top:2px solid var(--border-strong);position:static}@media (width<=640px){.dash-row{grid-template-columns:minmax(0,1fr) 48px 44px}.dash-row>:last-child{display:none}.dash-child{padding-left:24px}.dash-patients{padding-left:16px}}
