/* Scan page redesign v2 (Nov 25) — additive, load LAST on scan.html.
   Light, refined scanner app: airy layout, quiet typography, light stage with
   Comb-accent guide corners, soft result card, gradient primary action.
   No IDs, markup structure or JS touched. */

:root{color-scheme:light}
html,body{background:#f7f7f9 !important}
body{font-family:Poppins,system-ui,sans-serif}
main{max-width:560px;margin:0 auto;padding:18px 18px 44px;color:#1d1d1f;background:transparent}

/* ---------- header ---------- */
main>header{margin:2px 0 6px;display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
main>header h1{font-size:24px;font-weight:700;letter-spacing:-.02em;color:#141416;position:relative;padding-bottom:8px}
main>header h1::after{content:"";position:absolute;left:1px;bottom:0;width:44px;height:3px;border-radius:2px;
  background:linear-gradient(90deg,#D7263D,#F77F00,#F5C518,#2DB35A,#00B8D9,#2E5BFF,#B5179E)}
main>header h1 small{font:600 10px Poppins,system-ui;letter-spacing:.12em;color:#6e6e73;border:1px solid #e3e3e8;background:#fff;padding:4px 9px;border-radius:999px;vertical-align:middle;margin-left:10px}
main>header a{font-size:13px;color:#2E5BFF;text-decoration:none;white-space:nowrap;margin-left:auto}
main>.intro{font-size:14px;line-height:1.5;color:#6e6e73;margin:0 0 16px;max-width:44ch}

/* ---------- stage: light rounded viewport ---------- */
main .stage{aspect-ratio:4/5;max-height:60vh;width:100%;border-radius:24px;border:1px solid #e9e9ee;
  background:#ffffff;box-shadow:0 10px 34px rgba(20,20,30,.08);overflow:visible}
main .guide{border:0;border-radius:18px;filter:none;opacity:.95;background:none;box-shadow:none;outline:none}
main .guide .gc{position:absolute;width:24px;height:24px;border:0 solid;pointer-events:none}
main .guide .c0{left:0;top:0;border-left:4.5px solid #2E5BFF;border-top:4.5px solid #00B8D9;border-top-left-radius:9px}
main .guide .c1{right:0;top:0;border-right:4.5px solid #F77F00;border-top:4.5px solid #F5C518;border-top-right-radius:9px}
main .guide .c2{right:0;bottom:0;border-right:4.5px solid #B5179E;border-bottom:4.5px solid #D7263D;border-bottom-right-radius:9px}
main .guide .c3{left:0;bottom:0;border-left:4.5px solid #2DB35A;border-bottom:4.5px solid #00B8D9;border-bottom-left-radius:9px}
main .guide::after{content:none}
main .guide::before{content:none}
#locatorAnimation{display:none !important}

/* empty state: light, centered, quiet */
main #empty{color:#8a8a90;padding:20px}
main #empty>div{max-width:240px}
main #empty strong{font-family:Poppins,system-ui,sans-serif;font-size:18px;font-weight:600;color:#3a3a3f;letter-spacing:-.01em;margin:12px 0 6px}
main #empty::before{width:56px;height:56px;border-radius:16px;background:#f3f4f8 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M4 8V6a2 2 0 0 1 2-2h2" stroke="%232E5BFF"/><path d="M16 4h2a2 2 0 0 1 2 2v2" stroke="%23F77F00"/><path d="M20 16v2a2 2 0 0 1-2 2h-2" stroke="%23B5179E"/><path d="M8 20H6a2 2 0 0 1-2-2v-2" stroke="%232DB35A"/><rect x="8.4" y="8.4" width="7.2" height="7.2" rx="1.4" stroke="%2300B8D9"/></svg>') center/30px 30px no-repeat}

/* video fills the viewport when live */
main .stage video{height:100% !important;width:100% !important;object-fit:cover;border-radius:23px}
main .stage #empty{border-radius:23px;overflow:hidden}

/* ---------- result card ---------- */
main .result{border:1px solid rgba(20,20,30,.06);border-radius:20px;background:#fff;padding:20px;margin:16px 0 4px;
  box-shadow:0 8px 28px rgba(20,20,30,.07)}
main .result:not([hidden]){animation:prism-pop .14s ease-out}
main .result:not([hidden])>small,main .result:not([hidden])>p{animation:prism-row .12s ease-out}
main .result:not([hidden])>#openLink{animation:prism-row .12s ease-out .05s backwards}
main .result:not([hidden])>.controls{animation:prism-row .12s ease-out .09s backwards}
@keyframes prism-pop{from{opacity:.4;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes prism-row{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){main .result:not([hidden]),main .result:not([hidden])>*{animation:none}}
main .result small#verifiedLabel{display:inline-flex;align-items:center;gap:6px;background:#e9f9f0;color:#1f9d4d;
  border-radius:999px;padding:5px 12px;font:600 11px/1 Poppins,system-ui;letter-spacing:.06em}
main .result small#verifiedLabel::before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%231f9d4d" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg>')}
main .result p{font-size:16.5px;font-weight:500;color:#141416;margin:12px 0 14px;overflow-wrap:anywhere}
main .result a#openLink{background:linear-gradient(135deg,#2E5BFF,#2250ec);min-height:50px;border-radius:14px;
  box-shadow:0 8px 20px rgba(46,91,255,.25);font-weight:600}
main .result .controls button{min-height:42px;padding:0 18px;font-size:14px;background:#f7f7f9;border:1px solid #e6e6eb;color:#3a3a3f;border-radius:12px}

/* ---------- main actions ---------- */
main>.controls{flex-wrap:nowrap;gap:10px;margin:16px 0 6px}
main>.controls button{flex:1;min-width:0;min-height:56px;border-radius:16px;border:1px solid #e6e6eb;
  font:600 16px Poppins,system-ui;background:#fff;color:#1d1d1f;box-shadow:0 2px 8px rgba(20,20,30,.04)}
main>.controls button.primary{flex:2;background:linear-gradient(135deg,#2E5BFF,#2250ec);border-color:transparent;color:#fff;
  box-shadow:0 10px 24px rgba(46,91,255,.28)}
main>.controls button.primary:hover:not(:disabled){filter:brightness(1.05)}
main>.controls button:disabled{display:none}
main>.controls button:not(:disabled):active{transform:scale(.97)}

/* ---------- status + meta ---------- */
main .status{font-size:12.5px;color:#8a8a90;text-align:center;padding:0 6px;min-height:20px}
main .status.error{color:#9B1226;background:#FDE8EB;border:1px solid #F2C4CD}
main .status.error::before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23b3541e" stroke-width="2" stroke-linecap="round"><path d="M12 8v5"/><circle cx="12" cy="16.6" r=".6" fill="%23b3541e"/><path d="M10.3 3.9 2.6 17.2A2 2 0 0 0 4.3 20.2h15.4a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"/></svg>')}
main .meta{border-top:none;color:#6e6e73;font-size:11px;justify-content:center;gap:12px;padding-top:10px}

/* ---------- options ---------- */
main .options{justify-content:center;gap:8px;color:#6e6e73;font-size:12px;margin:12px 0 0;flex-wrap:nowrap}
main .options>span{display:none}
main .options label{flex:1;justify-content:center;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  min-height:38px;padding:0 14px;border:1px solid #e6e6eb;border-radius:999px;background:#fff;color:#48484d;font-weight:500}
main .options input[type=checkbox]{position:absolute;opacity:0;width:1px;height:1px;margin:0}
main .options label{position:relative;cursor:pointer}
main .options label:has(input:checked){background:#2E5BFF;border-color:#2E5BFF;color:#fff}
main .options label:focus-within{filter:brightness(.93)}
main .options label:has(input:disabled){opacity:.45}
main .options .photo{border:1px solid #e6e6eb}

/* ---------- tracking chip over video ---------- */
main .chip{background:rgba(255,255,255,.92);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,.7);border-radius:16px;color:#1d1d1f;
  box-shadow:0 12px 32px rgba(20,20,30,.20),0 2px 6px rgba(20,20,30,.08)}
main .chip small{color:#1f9d4d;font-weight:600;letter-spacing:.05em}
main .chip .value{color:#141416}
main .chip a{color:#2E5BFF}
main .chip:not([hidden]){animation:prism-chip-in .16s cubic-bezier(.2,.9,.3,1.2)}
@keyframes prism-chip-in{from{opacity:0;transform:translateX(-50%) translateY(6px) scale(.94)}to{opacity:1;transform:translateX(-50%) translateY(0) scale(1)}}
@media (prefers-reduced-motion:reduce){main .chip:not([hidden]){animation:none}}

/* ---------- about ---------- */
main details{border-top:1px solid #ececf0;color:#8a8a90;margin-top:20px}
main summary{color:#6e6e73;font-size:13px}

/* ---------- phones ---------- */
@media(max-width:600px){
  main{padding:14px 14px 38px}
  main .stage{aspect-ratio:4/5;max-height:56vh;border-radius:22px}
  main>.controls{position:static;background:none;border:none;padding:0;box-shadow:none;margin:14px 0 4px}
  main>.controls button{min-height:56px;font-size:15px;padding:0 6px}
  main .options{flex-wrap:wrap}
  main .options label{flex:1 1 40%}
}
@media(max-width:360px){
  main>header h1{font-size:21px}
  main>.controls button{font-size:14px}
}
@media(min-width:601px){
  main .stage{aspect-ratio:4/3;max-height:58vh}
}

/* mobile: header link gets a full-height tap target */
main>header a{display:inline-flex;align-items:center;min-height:44px}
