/* Camera scanner overlay (js/scanner.js). Dark camera UI in both themes; accent comes from the app tokens. */
.scanx{ position:fixed; inset:0; z-index:100000; background:#000; color:#fff; display:flex; flex-direction:column; overflow:hidden; font-family:inherit; }
.scanx[hidden]{ display:none; }
body.scanx-open{ overflow:hidden; }
.scanx-video{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; background:#000; }
.scanx-top{ position:relative; z-index:2; display:flex; align-items:center; gap:12px; padding:calc(env(safe-area-inset-top, 0px) + 12px) 16px 24px; background:linear-gradient(#000c, #0000); }
.scanx-x{ flex:0 0 auto; width:44px; height:44px; border-radius:50%; border:0; background:#ffffff26; color:#fff; display:grid; place-items:center; cursor:pointer; -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.scanx-x svg, .scanx-tool svg{ width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.scanx-ttl{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:2px; }
.scanx-t{ font-size:17px; font-weight:700; line-height:1.2; }
.scanx-h{ font-size:13px; opacity:.8; line-height:1.3; }
.scanx-count{ flex:0 0 auto; min-width:34px; height:34px; padding:0 10px; border-radius:17px; display:grid; place-items:center; background:var(--gold, #d4af5f); color:#1a1408; font-weight:800; font-variant-numeric:tabular-nums; }
.scanx-count[hidden]{ display:none; }

.scanx-frame{ position:absolute; z-index:1; inset-inline:0; top:50%; margin-inline:auto; width:min(78vw, 340px); height:min(50vw, 220px); transform:translateY(-62%); border-radius:18px; box-shadow:0 0 0 100vmax #0000008c; pointer-events:none; }
.scanx-frame i{ position:absolute; width:30px; height:30px; border:4px solid #fff; transition:border-color .15s; }
.scanx-frame .tl{ top:-2px; inset-inline-start:-2px; border-width:4px 0 0 4px; border-top-left-radius:18px; }
.scanx-frame .tr{ top:-2px; inset-inline-end:-2px; border-width:4px 4px 0 0; border-top-right-radius:18px; }
.scanx-frame .bl{ bottom:-2px; inset-inline-start:-2px; border-width:0 0 4px 4px; border-bottom-left-radius:18px; }
.scanx-frame .br{ bottom:-2px; inset-inline-end:-2px; border-width:0 4px 4px 0; border-bottom-right-radius:18px; }
html[dir="rtl"] .scanx-frame .tl{ border-width:4px 4px 0 0; border-top-left-radius:0; border-top-right-radius:18px; }
html[dir="rtl"] .scanx-frame .tr{ border-width:4px 0 0 4px; border-top-right-radius:0; border-top-left-radius:18px; }
html[dir="rtl"] .scanx-frame .bl{ border-width:0 4px 4px 0; border-bottom-left-radius:0; border-bottom-right-radius:18px; }
html[dir="rtl"] .scanx-frame .br{ border-width:0 0 4px 4px; border-bottom-right-radius:0; border-bottom-left-radius:18px; }
.scanx-line{ position:absolute; inset-inline:12px; top:10%; height:2px; border-radius:2px; background:var(--gold, #d4af5f); box-shadow:0 0 12px var(--gold, #d4af5f); animation:scanx-sweep 1.8s ease-in-out infinite alternate; }
@keyframes scanx-sweep{ to{ top:90%; } }
.scanx-frame.ok i{ border-color:#3ddc84; }
.scanx-frame.bad i{ border-color:#ff5a5f; }
.scanx-frame.ok .scanx-line, .scanx-frame.bad .scanx-line{ animation-play-state:paused; }

.scanx-msg{ position:absolute; z-index:2; inset-inline:16px; top:calc(50% + min(25vw, 110px) + 16px); transform:translateY(-62%); margin:0 auto; max-width:420px; padding:10px 14px; border-radius:12px; background:#000000b3; text-align:center; font-size:14px; font-weight:600; line-height:1.35; word-break:break-word; }
.scanx-msg[hidden]{ display:none; }
.scanx-msg[data-tone="ok"]{ color:#7cf0a8; }
.scanx-msg[data-tone="bad"]{ color:#ff9a9d; }

.scanx-bot{ position:relative; z-index:2; margin-top:auto; display:flex; flex-direction:column; gap:12px; padding:24px 16px calc(env(safe-area-inset-bottom, 0px) + 16px); background:linear-gradient(#0000, #000d 40%); }
.scanx-tools{ display:flex; justify-content:center; gap:14px; }
.scanx-tool{ min-width:64px; min-height:56px; padding:6px 12px; border:0; border-radius:14px; background:#ffffff26; color:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; font:600 12px/1 inherit; cursor:pointer; -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.scanx-tool[hidden]{ display:none; }
.scanx-tool.on{ background:var(--gold, #d4af5f); color:#1a1408; }
.scanx-manual{ display:flex; gap:8px; }
.scanx-in{ flex:1 1 auto; min-width:0; height:48px; padding:0 14px; border-radius:12px; border:1px solid #ffffff40; background:#ffffff1f; color:#fff; font-size:16px; outline:0; }
.scanx-in::placeholder{ color:#ffffffa6; }
.scanx-in:focus{ border-color:var(--gold, #d4af5f); }
.scanx-go{ flex:0 0 auto; min-width:64px; height:48px; padding:0 16px; border:0; border-radius:12px; background:var(--gold, #d4af5f); color:#1a1408; font-weight:800; font-size:15px; cursor:pointer; }
.scanx-done{ height:52px; border:0; border-radius:14px; background:#fff; color:#111; font-weight:800; font-size:16px; cursor:pointer; }
.scanx-done[hidden]{ display:none; }
@media (prefers-reduced-motion:reduce){ .scanx-line{ animation:none; top:50%; } }
@media (min-width:821px){
  .scanx-frame{ width:360px; height:230px; }
}
