:root{--blue:#0b3d91;--green:#0a8f3c;--red:#c4161c;--yellow:#e8a400;--ink:#14213d;--muted:#5b6475;--bg:#f3f6fb;--card:#fff}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font:17px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-text-size-adjust:100%}
.top{background:var(--blue);color:#fff;padding:calc(14px + env(safe-area-inset-top)) 18px 12px}
.brand{font-size:26px;font-weight:800;letter-spacing:.3px}
.shield{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:9px;background:#fff;color:var(--blue);font-weight:900;margin-right:6px}
.tag{opacity:.85;font-size:14px;margin-top:2px}
.proto{background:#fff6d6;border-bottom:1px solid #f0d98a;padding:10px 18px;font-size:14px}
main{max-width:560px;margin:0 auto;padding:14px 16px 30px}
.screen{display:none}.screen.active{display:block}
h1{font-size:20px;margin:18px 0 10px}
label{display:block;font-weight:600;margin:10px 0}
.req{color:var(--red)}.opt{color:var(--muted);font-weight:400;font-size:14px}
input{display:block;width:100%;margin-top:6px;font-size:19px;padding:14px;border:2px solid #cfd6e4;border-radius:12px;background:#fff}
input:focus{outline:none;border-color:var(--blue)}
.btn{display:block;width:100%;border:0;border-radius:14px;font-size:19px;font-weight:700;padding:16px;margin:10px 0;cursor:pointer;text-align:center;-webkit-tap-highlight-color:transparent}
.btn.big{min-height:60px}
.btn.primary{background:var(--blue);color:#fff}
.btn.secondary{background:#fff;color:var(--blue);border:2px solid var(--blue)}
.btn.go{background:var(--green);color:#fff;font-size:22px}
.btn:disabled{opacity:.4}
.btn.link{background:none;color:var(--blue);font-weight:600;padding:10px}
.btn.danger{color:var(--red)}
.file-btn{margin:0}
.photo-row{display:flex;gap:10px}.photo-row>*{flex:1}
.preview-wrap{margin-top:12px;background:#fff;border-radius:12px;padding:6px;text-align:center}
.preview-wrap img{max-width:100%;max-height:260px;border-radius:8px}
.hidden{display:none}
.tip{color:var(--muted);font-size:14px}
.spinner{width:64px;height:64px;border:7px solid #d6deec;border-top-color:var(--blue);border-radius:50%;margin:50px auto 10px;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
#screen-work{text-align:center}
.bar{height:12px;background:#d6deec;border-radius:6px;overflow:hidden}
#bar-fill{height:100%;width:0;background:var(--blue);transition:width .2s}
.verdict{border-radius:18px;color:#fff;text-align:center;padding:22px 14px;margin-top:6px}
.verdict .icon{font-size:56px;line-height:1}
.verdict .word{font-size:40px;font-weight:900;letter-spacing:1px}
.verdict .sub{font-size:16px;opacity:.95}
.verdict.match{background:var(--green)}.verdict.mismatch{background:var(--red)}.verdict.unread{background:var(--yellow);color:#1d1600}
.checks{list-style:none;padding:0;margin:14px 0}
.checks li{background:#fff;border-radius:12px;padding:12px 14px;margin:8px 0;border-left:8px solid #ccc}
.checks li.match{border-color:var(--green)}.checks li.mismatch{border-color:var(--red)}.checks li.unread{border-color:var(--yellow)}
.checks b{display:block}
.order-box{background:#fff;border-radius:12px;padding:12px 14px;font-size:15px}
.result-img{display:block;max-width:100%;max-height:300px;margin:12px auto;border-radius:10px}
.ocr summary{color:var(--blue);font-weight:600;padding:6px 0}
.ocr pre{white-space:pre-wrap;background:#fff;padding:10px;border-radius:10px;font-size:13px}
.saved{color:var(--green);font-weight:600;text-align:center}
.hist{list-style:none;padding:0}
.hist li{display:flex;gap:10px;background:#fff;border-radius:12px;padding:10px;margin:8px 0;align-items:center;border-left:8px solid #ccc}
.hist li.match{border-color:var(--green)}.hist li.mismatch{border-color:var(--red)}.hist li.unread{border-color:var(--yellow)}
.hist img{width:64px;height:64px;object-fit:cover;border-radius:8px;flex:none}
.hist .meta{flex:1;font-size:15px}.hist .meta b{font-size:16px}
.hist .del{background:none;border:0;color:var(--muted);font-size:22px;padding:6px}
.pill{display:inline-block;font-size:12px;font-weight:800;border-radius:6px;padding:2px 6px;color:#fff}
.pill.match{background:var(--green)}.pill.mismatch{background:var(--red)}.pill.unread{background:var(--yellow);color:#1d1600}
.foot{text-align:center;color:var(--muted);font-size:12px;padding:0 0 calc(20px + env(safe-area-inset-bottom))}
.report{display:none}
@media print{
  body{background:#fff}
  .top,.proto,main,.foot{display:none!important}
  .report{display:block;font-size:12pt;color:#000}
  .report h2{margin:0 0 4pt}
  .report .r{display:flex;gap:10pt;border:1px solid #999;padding:8pt;margin:6pt 0;page-break-inside:avoid}
  .report img{width:110pt;height:110pt;object-fit:contain}
}
[hidden]{display:none!important}

.cam-modal{position:fixed;inset:0;background:rgba(0,0,0,.88);z-index:1000;display:flex;align-items:center;justify-content:center;padding:12px}
.cam-modal.hidden{display:none}
.cam-box{width:100%;max-width:640px}
.cam-box video{width:100%;max-height:70vh;background:#000;border-radius:12px;display:block;object-fit:contain}
.cam-hint{color:#fff;text-align:center;margin:8px 0}
.cam-msg{color:#8a5a00;background:#fff6dd;border-radius:10px;padding:8px 10px}

.af-status{border-radius:10px;padding:10px 12px;margin:8px 0;background:#eef3fb;color:#0b3d91;font-weight:600}
.af-status.ok{background:#e7f6ec;color:#0a6b30}
.af-status.warn{background:#fff6dd;color:#8a5a00}
input.auto{background:#eef8f0;border-color:#0a8f3c}
.more{margin:8px 0 4px}
.more summary{cursor:pointer;font-weight:700;color:var(--blue);padding:8px 0}
input.auto.check{background:#fff6dd;border-color:#e8a400}
.dose-note{color:#8a5a00;background:#fff6dd;border-radius:10px;padding:8px 10px;margin:-4px 0 8px;font-weight:600}

.result-legal{background:#fff;border:2px solid #cfd6e4;border-radius:12px;padding:8px 12px;margin:10px 0;font-size:15px;color:#1b2333}
.result-legal p{margin:6px 0}
.terms-modal{position:fixed;inset:0;background:rgba(10,20,40,.75);z-index:1100;display:flex;align-items:flex-start;justify-content:center;padding:12px;overflow:auto}
.terms-modal.hidden,.doc-modal.hidden{display:none}
.terms-box{background:#fff;border-radius:14px;max-width:560px;width:100%;padding:16px 18px;margin:auto;font-size:15px;line-height:1.45;color:#1b2333}
.terms-box h2{margin:4px 0 8px;color:var(--blue)}
.terms-box ul{padding-left:20px}
label.chk{display:flex;gap:10px;align-items:flex-start;font-weight:600;margin:12px 0}
label.chk input{width:24px;height:24px;flex:0 0 24px;margin:2px 0 0}
.terms-msg{color:var(--red);font-weight:700}
.doc-modal{position:fixed;inset:0;background:#fff;z-index:1200;display:flex;flex-direction:column}
.doc-bar{padding:6px 10px;border-bottom:1px solid #cfd6e4}
.doc-bar .btn{width:auto;display:inline-block;margin:0;padding:8px 14px;font-size:16px}
.doc-modal iframe{flex:1;border:0;width:100%}
.foot a{color:inherit}
.confirm-btn{display:inline-block;margin:6px 0 2px;padding:8px 14px;border-radius:10px;border:2px solid #0a8f3c;background:#fff;color:#0a6b30;font-weight:700;font-size:16px;cursor:pointer}
.confirm-btn.done{background:#0a8f3c;color:#fff}
.confirm-btn.hidden{display:none}
input.auto.confirmed{background:#e7f6ec}
.confirm-hint{background:#eef3fb;color:#0b3d91;border-radius:10px;padding:8px 10px;font-weight:600}

.top{position:relative}
.acct-btn{position:absolute;right:12px;top:12px;background:rgba(255,255,255,.15);color:#fff;border:1px solid rgba(255,255,255,.4);border-radius:20px;padding:6px 12px;font-weight:700;cursor:pointer}
.who{margin:6px 0 4px}.who-label{font-weight:700;display:block;margin:6px 0}
.people{display:flex;flex-wrap:wrap;gap:8px}
.person{display:flex;align-items:center;gap:6px;border:2px solid #cfd6e4;background:#fff;border-radius:24px;padding:4px 12px 4px 4px;font-weight:700;font-size:16px;cursor:pointer}
.person.sel{border-color:var(--blue);background:#eef3fb}
.person .edit{font-size:13px;color:var(--blue);margin-left:4px}
.av{width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:20px;overflow:hidden;flex:0 0 34px}
.av img{width:100%;height:100%;object-fit:cover}
.av.big{width:56px;height:56px;font-size:32px;flex-basis:56px}
.avatars{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}
.avatars button{border:3px solid transparent;background:none;padding:0;border-radius:50%;cursor:pointer}
.avatars button.sel{border-color:var(--blue)}
.qc{background:#fff6dd;border:2px solid #e8a400;border-radius:12px;padding:8px 12px;margin:8px 0;color:#5c3d00;font-weight:600}
.angles{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0}
.angles img{width:64px;height:64px;object-fit:cover;border-radius:8px;border:2px solid #cfd6e4}
.dc{background:#fff;border:2px solid #cfd6e4;border-radius:12px;padding:6px 12px;margin:10px 0}
.dc h2{font-size:18px;margin:6px 0;color:var(--blue)}
.dc ul{list-style:none;padding:0;margin:0}
.dc li{padding:7px 0;border-top:1px solid #e6eaf2;font-size:15px}
.dc li:first-child{border-top:0}
.dc li b{display:inline-block;min-width:1.4em}
.dc li.pass b{color:#0a8f3c}.dc li.warn b{color:#b07400}.dc li.note b{color:#b07400}.dc li.skip b{color:#7a8599}
.dc .ack{display:inline-block;margin-top:4px;padding:5px 10px;border-radius:8px;border:2px solid #e8a400;background:#fff;color:#5c3d00;font-weight:700;cursor:pointer}
.dc .ack.done{background:#e8a400;color:#fff}
.sugg{list-style:none;margin:-6px 0 8px;padding:0;border:2px solid #cfd6e4;border-radius:12px;background:#fff;max-height:260px;overflow:auto}
.sugg li{padding:8px 12px;border-top:1px solid #e6eaf2;cursor:pointer}
.sugg li:first-child{border-top:0}
.sugg li small{display:block;color:#5a6478}
.sugg.hidden{display:none}
.hist .who-tag{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:700}
.hist .who-tag .av{width:22px;height:22px;font-size:13px;flex-basis:22px}
