/* Reference preview and capture-quality feedback. */
.quality-grid{position:relative;z-index:4;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem;margin-bottom:.8rem;pointer-events:none}
.quality-grid span{display:flex;align-items:center;gap:.4rem;min-width:0;padding:.55rem .65rem;border:1px solid #eee1e7;border-radius:12px;background:#fff;color:#876c7a;font-size:.875rem;transition:background .2s}
.quality-grid i{display:grid;place-items:center;flex:0 0 18px;height:18px;border:1px solid currentColor;border-radius:50%;font-style:normal;font-size:.75rem}
.quality-grid b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.quality-grid .pass{border-color:#e7bdd2;background:#f9ebf2;color:#85435f}
.quality-grid .pass i{background:#a34e71;color:#fff;border-color:#a34e71}
.quality-grid .fail{border-color:#e4c99a;background:#fff8eb;color:#79591f}
.reference-preview{display:flex;align-items:center;gap:1rem;width:100%;margin-top:1.5rem;padding:1rem;border:1px solid #ecdae3;border-radius:18px;background:#faedf4;text-align:left}
.reference-thumbs{display:flex;flex:0 0 auto;gap:4px}
.reference-thumbs img{width:60px;height:80px;object-fit:cover;object-position:50%;border-radius:10px}
.reference-preview b{display:block;font-size:.95rem;color:#84445f}
.reference-preview p{margin:.25rem 0 0;font-size:.875rem;line-height:1.5;color:#846877}
.resolution-badge{display:inline-flex;align-items:center;align-self:center;margin-left:auto;padding:.45rem .7rem;border:1px solid #e9d9e1;border-radius:999px;background:#fcf1f6;color:#b24574;font-size:.875rem;font-weight:700}
.scan-result-head{flex-wrap:wrap}
.scan-compare{min-height:0;aspect-ratio:4/3;background:#f5e9ef}
.scan-compare img{image-rendering:auto}
.camera-wrap{max-height:none;max-width:100%;margin-inline:auto}
.camera-wrap video{object-fit:contain}
.scan-status{max-width:92%;min-width:0;width:430px;bottom:1rem;font-size:.875rem}
.scan-status small{font-size:.875rem;line-height:1.4}
.scan-status small:empty{display:none}
.native-note{margin:1rem 0 0;text-align:center;color:#89717d;font-size:.875rem}
.scan-result-footer small,.scan-disclaimer,.scan-intro>small,.scan-steps span,.process-list span,.scan-controls label{font-size:.875rem;line-height:1.5}
.scan-controls button{min-height:44px;cursor:pointer}
.scan-controls label{flex-wrap:wrap}
.scan-controls input{min-height:44px;accent-color:#b24574}
.scan-compare:focus-within{outline:3px solid #b24574;outline-offset:4px}
.scan-error{width:100%;font-size:.95rem;line-height:1.5}
.processing-face canvas{object-fit:contain;filter:none}
.scan-upload:focus-within{outline:3px solid #b24574;outline-offset:3px}
.scan-upload{position:relative}
.scan-upload input{display:block;position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.scan-export{margin:1rem 0 1.25rem;padding:1rem;border:1px solid #e9d9e1;border-radius:18px;background:#fcf1f6}
.scan-export-actions{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:.65rem}
.scan-export .btn{display:flex;align-items:center;justify-content:center;gap:.6rem;min-height:48px;padding:.9rem .8rem;font-size:.95rem;line-height:1.35}
.scan-export .btn svg{width:21px;height:21px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.scan-export .scan-share{color:#8b4564;background:#fff;border:1px solid #e1cbd6;box-shadow:none}
.scan-export .btn:disabled{cursor:wait;transform:none;opacity:.45}
.scan-export .btn:focus-visible,.scan-export a:focus-visible{outline:3px solid #b24574;outline-offset:3px}
.scan-export p{margin:.7rem 0 0;color:#806473;font-size:.82rem;line-height:1.5;text-align:center}
.scan-export #scanExportStatus{font-weight:600}
.scan-export a{display:block;margin-top:.6rem;padding:.5rem;color:#8b4564;font-size:.875rem;text-align:center;text-underline-offset:3px}
.scan-export [hidden]{display:none!important}
@media(max-width:380px){.scan-export-actions{grid-template-columns:1fr}.scan-export{padding:.8rem}}
@media(max-width:600px){
  .quality-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem}
  .quality-grid span{padding:.45rem .5rem}
  .resolution-badge{width:100%;margin:0;justify-content:center}
  .reference-preview{align-items:flex-start;gap:.75rem;padding:.8rem}
  .reference-thumbs img{width:42px;height:64px}
  .scan-compare{min-height:0}
  .scan-status{bottom:.6rem;padding:.65rem .8rem}
  .scan-status small{font-size:.8rem}
}
@media(prefers-reduced-motion:reduce){
  .scan-orb>span,.processing-face:after,.scan-status.ready>span{animation:none}
  .quality-grid span,.stability i{transition:none}
}
