.n07-scan-modal{position:fixed;inset:0;z-index:9999;background:#000b;display:grid;place-items:center;padding:12px}
.n07-scan-modal.hidden{display:none}
.n07-scan-card{width:min(620px,100%);max-height:95vh;overflow:hidden;background:#fff;border-radius:14px;padding:12px;display:flex;flex-direction:column;box-shadow:0 18px 60px #0007}
.n07-scan-head,.n07-scan-toolbar{display:flex;gap:8px;align-items:center;justify-content:space-between;flex:0 0 auto}
.n07-scan-head{min-height:42px}
.n07-scan-title{font-size:18px}
.n07-scan-close{border:1px solid #efb7c1;background:#fff;color:#a4001c;border-radius:10px;padding:9px 13px;font-weight:800}
.n07-scan-camera{position:relative;margin:8px 0;background:#111;border-radius:12px;overflow:hidden;min-height:280px;flex:1 1 auto}
.n07-scan-camera video{display:block;width:100%;height:100%;min-height:280px;aspect-ratio:4/3;max-height:68vh;object-fit:cover;background:#111;visibility:visible;opacity:1}
.n07-scan-target{position:absolute;left:17%;top:25%;width:66%;height:50%;border:3px solid #fff;border-radius:14px;pointer-events:none;box-shadow:0 0 0 1px #0004 inset}
.n07-scan-feedback{position:absolute;left:50%;top:12px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);background:#087b36;color:#fff;border-radius:14px;padding:11px 15px;font-size:clamp(16px,4vw,21px);font-weight:900;line-height:1.25;text-align:center;box-shadow:0 8px 28px #0008;opacity:0;pointer-events:none;transition:opacity .12s ease;white-space:normal}
.n07-scan-feedback.show{opacity:1}
.n07-scan-feedback.bad{background:#b00020}
.n07-scan-feedback.dup{background:#a94d00}
.n07-scan-toolbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:2px}
.n07-scan-toolbar button,.n07-scan-file{min-height:44px;border:1px solid #d7dce4;border-radius:10px;background:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;text-align:center;padding:8px 10px}
.n07-scan-file input{display:none}
.n07-scan-status{min-height:28px;margin-top:7px;text-align:center;font-weight:700;line-height:1.3;flex:0 0 auto}
.n07-scan-status.bad{color:#b00020;font-weight:800}
.n07-scan-error-gate{margin-top:8px;padding:10px;border:1px solid #d9a;border-radius:10px;background:#fff7f7;flex:0 0 auto}
.n07-scan-error-gate.hidden{display:none}
.n07-scan-error-gate button{margin-top:8px}
.n07-scan-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.n07-scan-modal.image-mode .n07-scan-camera{display:none}
.n07-scan-modal.image-mode #n07-scan-switch,.n07-scan-modal.image-mode #n07-scan-torch{display:none}
.n07-scan-modal.image-mode .n07-scan-card{width:min(460px,100%);height:auto;min-height:0}
.n07-scan-modal.image-mode .n07-scan-toolbar{grid-template-columns:1fr}
@media(max-width:760px){
  .n07-scan-modal{padding:0;place-items:stretch;background:#000}
  .n07-scan-card{width:100%;height:100dvh;max-height:none;border-radius:0;padding:10px;box-shadow:none;overflow:hidden}
  .n07-scan-head{position:relative;z-index:2;background:#fff;padding:2px 0 6px}
  .n07-scan-camera{flex:1 1 auto;min-height:0;margin:2px 0 8px;border-radius:10px}
  .n07-scan-camera video{height:100%;min-height:0;max-height:none;aspect-ratio:auto;object-fit:cover}
  .n07-scan-target{left:12%;top:26%;width:76%;height:48%;border-width:3px}
  .n07-scan-feedback{top:10px;max-width:calc(100% - 20px);font-size:18px;padding:10px 13px}
  .n07-scan-toolbar{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .n07-scan-toolbar button,.n07-scan-file{min-height:46px;font-size:14px;padding:7px 6px}
  .n07-scan-status{min-height:30px;margin-top:6px;font-size:14px}
  .n07-scan-modal.image-mode{place-items:center;padding:14px;background:#0009}
  .n07-scan-modal.image-mode .n07-scan-card{height:auto;max-height:80dvh;border-radius:14px;padding:12px}
}
