/* Krypton84 Scanner — mobile web app */
:root { --navy: #0b1322; --navy2: #15203a; --blue: #1d8cf8; --cyan: #22d3ee; --ink: #0f172a; --ink2: #334155; --mute: #64748b; --line: #e2e8f0; --bg: #f3f6fb; --card: #fff; --green: #16a34a; --red: #e11d48; --amber: #d97706;
  --top: env(safe-area-inset-top, 0px); --bot: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); overscroll-behavior: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }
.small { font-size: 13px; color: var(--mute); }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }
.btn { border: 0; border-radius: 14px; background: var(--blue); color: #fff; font: 700 16px inherit; font-family: inherit; padding: 14px 18px; cursor: pointer; }
.btn.big { width: 100%; padding: 16px; font-size: 17px; } .btn.sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.btn.ghost { background: #eef2f7; color: var(--ink); } .btn.green { background: var(--green); } .btn:active { transform: scale(.98); }
.link { background: none; border: 0; color: var(--blue); font: 600 13px inherit; font-family: inherit; }
input { font: inherit; font-size: 16px; color: var(--ink); width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fff; outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,140,248,.15); }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--mute); }
.err { background: #ffe4e6; color: var(--red); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.flag { width: 24px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(15,23,42,.15); stroke: none; fill: none; }
.mark { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--blue), var(--cyan)); display: grid; place-items: center; color: #fff; box-shadow: 0 10px 30px rgba(29,140,248,.35); }
.mark svg { width: 34px; height: 34px; stroke-width: 2.2; } .mark.sm { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; } .mark.sm svg { width: 18px; height: 18px; }

/* login */
#login { background: radial-gradient(500px 300px at 80% 0, rgba(34,211,238,.25), transparent), var(--navy); color: #fff; padding: calc(var(--top) + 40px) 22px calc(var(--bot) + 20px); overflow-y: auto; }
.lg-top { text-align: center; display: grid; justify-items: center; gap: 10px; margin: 20px 0 28px; }
.lg-top h1 { margin: 6px 0 0; font-size: 26px; } .lg-top h1 span { color: var(--cyan); } .lg-top p { margin: 0; color: #9fb0c8; max-width: 300px; }
.lg-card { background: #fff; color: var(--ink); border-radius: 22px; padding: 22px; display: grid; gap: 14px; }
.lg-card .small { text-align: center; margin: 0; }

/* home */
.hd { display: flex; align-items: center; gap: 10px; padding: calc(var(--top) + 12px) 16px 12px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 9px; flex: 1; font-size: 19px; } .brand span { color: var(--cyan); }
.mp { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 99px; padding: 7px 12px 7px 9px; font: 700 14px inherit; font-family: inherit; }
.mp svg.chev { width: 16px; height: 16px; }
.body { flex: 1; overflow-y: auto; padding: 18px 16px calc(var(--bot) + 90px); }
.scan-hero { width: 100%; border: 0; border-radius: 24px; padding: 30px 20px 26px; display: grid; justify-items: center; gap: 6px; color: #fff; font-family: inherit; cursor: pointer;
  background: radial-gradient(300px 160px at 85% 0, rgba(34,211,238,.45), transparent), linear-gradient(135deg, var(--navy2), #1b4f9a); box-shadow: 0 16px 34px rgba(11,19,34,.28); }
.scan-hero b { font-size: 21px; margin-top: 8px; } .scan-hero small { color: #c7d6ec; font-size: 14px; }
.ring { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); position: relative; }
.ring::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(34,211,238,.6); animation: ping 2s infinite; }
.ring svg { width: 46px; height: 46px; }
@keyframes ping { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
.manual { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 12px; margin: 14px 0; }
.manual svg { color: var(--mute); width: 20px; } .manual input { border: 0; padding: 10px 4px; box-shadow: none !important; }
.install { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.install img { width: 40px; height: 40px; border-radius: 10px; } .install div { flex: 1; } .install b { display: block; }
.sec-h { display: flex; justify-content: space-between; align-items: center; margin: 8px 2px 10px; }
.recent { display: grid; gap: 10px; }
.rc { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 12px; border: 1px solid var(--line); cursor: pointer; }
.rc img { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid #eef2f7; flex: none; }
.rc .t { flex: 1; min-width: 0; } .rc .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.rc .t small { color: var(--mute); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.rc .p { text-align: right; font-weight: 800; } .rc .p small { display: block; font-weight: 600; font-size: 11.5px; color: var(--mute); }
.empty { text-align: center; color: var(--mute); padding: 28px 10px; font-size: 14px; }
.tab { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 0 calc(var(--bot) + 6px); }
.tab > * { flex: 1; display: grid; justify-items: center; gap: 2px; font: 600 11px inherit; font-family: inherit; color: var(--mute); background: none; border: 0; padding: 4px; }
.tab .on { color: var(--blue); }

/* camera */
.cam { background: #000; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shade { position: absolute; inset: 0; display: grid; place-items: center; }
.frame { width: min(78vw, 340px); height: min(46vw, 200px); position: relative; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); }
.frame .c { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; } .tl { left: -2px; top: -2px; border-right: 0 !important; border-bottom: 0 !important; border-radius: 16px 0 0 0; }
.tr { right: -2px; top: -2px; border-left: 0 !important; border-bottom: 0 !important; border-radius: 0 16px 0 0; } .bl { left: -2px; bottom: -2px; border-right: 0 !important; border-top: 0 !important; border-radius: 0 0 0 16px; }
.br { right: -2px; bottom: -2px; border-left: 0 !important; border-top: 0 !important; border-radius: 0 0 16px 0; }
.laser { position: absolute; left: 8%; right: 8%; height: 2px; top: 50%; background: #ff4d4d; box-shadow: 0 0 12px 2px rgba(255,77,77,.8); animation: laser 1.8s ease-in-out infinite; }
@keyframes laser { 0%, 100% { top: 15%; } 50% { top: 85%; } }
.frame.hit { box-shadow: 0 0 0 9999px rgba(0,0,0,.55), 0 0 0 4px #22c55e inset; } .frame.hit .laser { display: none; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 10px; align-items: center; padding: calc(var(--top) + 14px) 14px 14px; }
.cam-top .sp { flex: 1; }
.cb { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.cb.on { background: #facc15; color: #000; }
.cam-mp { display: flex; align-items: center; gap: 6px; color: #fff; background: rgba(0,0,0,.45); padding: 7px 12px; border-radius: 99px; font-weight: 700; font-size: 14px; }
.cam-msg { position: absolute; left: 16px; right: 16px; bottom: calc(var(--bot) + 40px); text-align: center; color: #fff; font-weight: 600; background: rgba(0,0,0,.5); padding: 12px; border-radius: 14px; }

/* bottom sheets */
.sheet-bg { position: fixed; inset: 0; background: rgba(8,13,26,.55); z-index: 40; display: flex; align-items: flex-end; animation: fade .2s; }
.sheet { width: 100%; background: #fff; border-radius: 24px 24px 0 0; padding: 10px 18px calc(var(--bot) + 18px); max-height: 88vh; overflow-y: auto; animation: up .25s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(100%); } } @keyframes fade { from { opacity: 0; } }
.grab { width: 42px; height: 5px; border-radius: 99px; background: #cbd5e1; margin: 0 auto 12px; }
.sheet-h { display: block; font-size: 18px; margin-bottom: 12px; }
.pr { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; } .pr img { width: 84px; height: 84px; object-fit: contain; border-radius: 14px; border: 1px solid #eef2f7; background: #fff; flex: none; }
.pr b { display: block; font-size: 15.5px; line-height: 1.35; } .pr small { color: var(--mute); }
.kv3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.kv3 div { background: #f5f8fc; border-radius: 12px; padding: 10px; } .kv3 small { display: block; color: var(--mute); font-size: 11.5px; font-weight: 600; } .kv3 b { font-size: 16px; }
.buy { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; } .buy .cur { font-size: 22px; font-weight: 800; color: var(--mute); }
.buy input { font-size: 22px; font-weight: 800; padding: 12px 14px; }
.est { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; background: #f5f8fc; }
.est small { display: block; color: var(--mute); font-size: 11.5px; font-weight: 600; } .est b { font-size: 18px; }
.est.good { background: #dcfce7; } .est.ok { background: #fef3c7; } .est.bad { background: #ffe4e6; }
.pick { display: grid; gap: 8px; } .pick .rc { border-color: #eef2f7; }
.row2 { display: flex; gap: 10px; } .row2 > * { flex: 1; }
.mp-list { display: grid; gap: 6px; } .mp-list button { display: flex; align-items: center; gap: 12px; background: #f5f8fc; border: 2px solid transparent; border-radius: 14px; padding: 13px 14px; font: 600 15px inherit; font-family: inherit; color: var(--ink); }
.mp-list button.on { border-color: var(--blue); background: #eef6ff; } .mp-list small { margin-left: auto; color: var(--mute); }

/* analysis */
#ana { background: var(--bg); } #ana .hd { padding-left: 8px; } .ana-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.ib { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; }
#anaFrame { flex: 1; width: 100%; border: 0; background: #fff; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bot) + 86px); background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 600; z-index: 60; max-width: 90vw; text-align: center; }
.spin { width: 30px; height: 30px; border: 3px solid #e2e8f0; border-top-color: var(--blue); border-radius: 50%; animation: sp 1s linear infinite; margin: 26px auto; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Krypton84 brand */
.kr-mark{background:none!important;box-shadow:none!important;padding:0!important;overflow:hidden;display:inline-grid;place-items:center}.kr-mark img{width:100%;height:100%;display:block;border-radius:inherit}.logo span,.logo b span,.ds-logo span{color:#1d8cf8}
.lg-top h1 span,.brand b span{color:#38bdf8}
