:root{--red:#e30613;--ink:#1d1d1f;--mute:#6e6e73;--line:#e5e5e7;--soft:#f5f5f7;--st:env(safe-area-inset-top);--sb:env(safe-area-inset-bottom)}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%;overflow:hidden;background:#fff;color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;overscroll-behavior:none;-webkit-user-select:none;user-select:none}
button{font:inherit;color:inherit;border:none;background:none;cursor:pointer}
svg{display:block}
.hidden{display:none!important}
.screen{position:fixed;inset:0;display:none;flex-direction:column}
.screen.on{display:flex}
.screen.light{background:#fff;color:var(--ink)}
.screen.dark{background:#000;color:#fff}

/* camera */
#video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#000}
#overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.flash{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none;transition:opacity .25s}
.flash.on{opacity:.75;transition:none}
.ctop{color:#fff;position:absolute;left:0;right:0;top:0;padding:calc(var(--st) + 12px) 16px 12px;display:flex;align-items:center;justify-content:center;gap:12px;background:linear-gradient(rgba(0,0,0,.45),transparent)}
.round{position:absolute;right:16px;color:#fff;top:calc(var(--st) + 10px);width:40px;height:40px;border-radius:50%;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center}
.round svg{width:20px;height:20px}
.round.on{background:#ffd60a;color:#000}
.seg{display:flex;border-radius:999px;padding:3px;background:rgba(255,255,255,.12);backdrop-filter:blur(20px)}
.seg button{padding:7px 16px;border-radius:999px;font-size:14px;font-weight:700;color:rgba(255,255,255,.8)}
.seg button.on{background:#fff;color:#000}
.hint{position:absolute;left:50%;top:calc(var(--st) + 70px);transform:translateX(-50%);background:rgba(0,0,0,.55);backdrop-filter:blur(16px);padding:9px 16px;border-radius:999px;font-size:14px;font-weight:600;white-space:nowrap;transition:background .2s}
.hint.ok{background:rgba(48,209,88,.9);color:#000}
.cbottom{position:absolute;left:0;right:0;bottom:0;padding:18px 26px calc(var(--sb) + 22px);display:flex;align-items:center;justify-content:space-between;background:linear-gradient(transparent,rgba(0,0,0,.55))}
.shutter{width:80px;height:80px;position:relative;display:flex;align-items:center;justify-content:center}
.shutter svg{position:absolute;inset:0;width:80px;height:80px;transform:rotate(-90deg)}
.shutter .ring{fill:none;stroke:#fff;stroke-width:5}
.shutter .prog{fill:none;stroke:#30d158;stroke-width:6;stroke-dasharray:289;stroke-dashoffset:289;stroke-linecap:round;transition:stroke-dashoffset .1s linear}
.shutter i{width:62px;height:62px;border-radius:50%;background:#fff;transition:transform .12s}
.shutter:active i{transform:scale(.88)}
.stack{width:56px;height:56px;border-radius:10px;overflow:hidden;position:relative;background:rgba(255,255,255,.12);border:2px solid rgba(255,255,255,.85)}
.stack img{width:100%;height:100%;object-fit:cover;display:block}
.stack span{position:absolute;right:-2px;top:-2px;background:var(--red);color:#fff;font-size:12px;font-weight:800;min-width:22px;height:22px;border-radius:11px;display:flex;align-items:center;justify-content:center;padding:0 6px}
.stack.empty{visibility:hidden}
.done{min-width:64px;height:44px;border-radius:22px;background:#fff;color:#000;font-weight:800;font-size:15px;padding:0 16px}
.done:disabled{opacity:.3}
.noCam{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;text-align:center;background:#000}
.noCam h2{font-size:22px;font-weight:800}
.noCam p{color:#a1a1a6;margin:10px 0 22px;line-height:1.45}
.noCam .big{width:100%;max-width:320px}

/* review */
.rtop{display:flex;align-items:center;justify-content:space-between;padding:calc(var(--st) + 10px) 14px 10px;min-height:54px}
.rtop b{font-size:16px;font-weight:800}
.txt{font-size:16px;font-weight:600;padding:6px;min-width:70px;text-align:left}
.txt.strong{font-weight:800;text-align:right;color:#ffd60a}
.txt.red{color:var(--red);text-align:right}
#grid{flex:1;overflow:auto;padding:8px 16px 24px;display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:14px;align-content:start}
.pg{position:relative;border-radius:10px;overflow:hidden;background:var(--soft);aspect-ratio:1/1.414;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 10px rgba(0,0,0,.1),0 0 0 1px rgba(0,0,0,.05)}
.pg img{max-width:100%;max-height:100%;display:block}
.pg span{position:absolute;left:8px;bottom:8px;background:rgba(29,29,31,.85);color:#fff;font-size:12px;font-weight:800;border-radius:999px;padding:3px 9px}
.pg.proc::after{content:"";position:absolute;inset:0;background:rgba(255,255,255,.6) url() center no-repeat}
.rbottom{padding:12px 16px calc(var(--sb) + 14px);border-top:1px solid var(--line)}
.big{display:block;width:100%;background:var(--ink);color:#fff;font-size:17px;font-weight:800;padding:16px;border-radius:14px}
.screen.dark .big,.noCam .big{background:#fff;color:#000}
.big.ghost{background:rgba(255,255,255,.14);color:#fff;margin-top:10px}

/* edit */
.stage{flex:1;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}
#editCanvas{max-width:100%;max-height:100%;display:block}
#editSvg{position:absolute;overflow:visible;touch-action:none}
#editSvg polygon{fill:rgba(227,6,19,.12);stroke:#ff453a;stroke-width:2.5;stroke-linejoin:round}
#editSvg circle.h{fill:#fff;stroke:#ff453a;stroke-width:3}
#editSvg circle.hit{fill:transparent}
.loupe{position:fixed;width:120px;height:120px;border-radius:50%;overflow:hidden;border:3px solid #fff;box-shadow:0 6px 20px rgba(0,0,0,.5);display:none;pointer-events:none;z-index:5}
.chips{display:flex;gap:10px;justify-content:center;padding:10px 12px 4px}
.chip{display:flex;flex-direction:column;align-items:center;gap:5px;font-size:11.5px;font-weight:700;color:#a1a1a6}
.chip canvas{width:56px;height:72px;border-radius:8px;object-fit:cover;box-shadow:0 0 0 1px rgba(255,255,255,.2)}
.chip.on{color:#fff}.chip.on canvas{box-shadow:0 0 0 2.5px #fff}
.etools{display:flex;justify-content:space-around;padding:10px 6px calc(var(--sb) + 12px)}
.etools button{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:11px;font-weight:700;min-width:54px}
.etools svg{width:23px;height:23px}
.etools .red{color:#ff453a}

/* sheet */
#sheetBg{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:20;display:flex;align-items:flex-end}
#sheet{width:100%;background:#fff;color:var(--ink);border-radius:22px 22px 0 0;padding:10px 22px calc(var(--sb) + 22px);animation:up .25s ease}
@keyframes up{from{transform:translateY(100%)}to{transform:none}}
.grab{width:40px;height:5px;border-radius:3px;background:#d1d1d6;margin:0 auto 14px}
#sheet h3{font-size:22px;font-weight:800;margin-bottom:6px}
#sheet label{display:block;font-size:12px;font-weight:800;color:var(--mute);margin:14px 0 6px;text-transform:uppercase;letter-spacing:.04em}
#sheet input{width:100%;font:inherit;font-size:16px;border:1px solid #d2d2d7;border-radius:12px;padding:12px 14px;outline:none;-webkit-user-select:text;user-select:text}
#sheet .seg{background:var(--soft)}
#sheet .seg button{flex:1;color:var(--mute);padding:9px}
#sheet .seg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12)}
#sheet .big{margin-top:18px}
.note{color:#a1a1a6;font-size:12.5px;text-align:center;margin-top:12px}

#busy{position:fixed;inset:0;background:rgba(0,0,0,.6);backdrop-filter:blur(6px);z-index:40;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;font-weight:700;color:#fff}
.spin{width:34px;height:34px;border-radius:50%;border:3.5px solid rgba(255,255,255,.3);border-top-color:#fff;animation:sp 1s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
#toast{position:fixed;left:50%;top:calc(var(--st) + 120px);transform:translateX(-50%) translateY(-8px);background:#fff;color:#000;padding:11px 18px;border-radius:12px;font-weight:700;font-size:14px;opacity:0;pointer-events:none;transition:.25s;z-index:50;max-width:86vw;text-align:center;box-shadow:0 8px 30px rgba(0,0,0,.3)}
#toast.show{opacity:1;transform:translateX(-50%)}

/* ===== Eagle Visas ===== */
#cam{background:#000;color:#fff}
.round.left{right:auto;left:16px}
.camTarget{position:absolute;left:16px;right:16px;top:calc(var(--st) + 112px);text-align:center;background:rgba(227,6,19,.92);color:#fff;font-weight:700;font-size:13px;padding:8px 12px;border-radius:12px}
#joinRow{margin-bottom:10px}
.seg.lightseg{background:var(--soft);backdrop-filter:none}
.seg.lightseg button{flex:1;color:var(--mute);font-size:13.5px;padding:9px 6px}
.seg.lightseg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12)}
input,select,textarea{-webkit-user-select:text;user-select:text}
.loginBox{margin:auto;width:100%;max-width:360px;padding:30px 24px calc(var(--sb) + 30px);text-align:center}
.loginBox .logo{width:72px;height:72px;border-radius:18px;margin-bottom:14px}
.loginBox h1{font-size:28px;font-weight:800;letter-spacing:-.02em}
.loginBox p{color:var(--mute);margin:10px 0 22px;line-height:1.45}
#pin{width:100%;font:inherit;font-size:30px;letter-spacing:.5em;text-align:center;border:1.5px solid #d2d2d7;border-radius:14px;padding:14px;margin-bottom:14px;outline:none}
#linkIn{width:100%;font:inherit;font-size:15px;border:1.5px solid #d2d2d7;border-radius:14px;padding:13px;margin-bottom:10px;outline:none}
#pin:focus{border-color:var(--ink)}
.note.err{color:var(--red);font-weight:700}
.atop{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;padding:calc(var(--st) + 14px) 16px 10px}
.atop small{display:block;color:var(--mute);font-size:13px;font-weight:600}
.atop b{font-size:24px;font-weight:800;letter-spacing:-.02em}
.atopR{display:flex;gap:8px;align-items:center}
.pill{background:var(--soft);border:none;border-radius:999px;padding:8px 14px;font:inherit;font-size:14px;font-weight:700;color:var(--ink);appearance:none;-webkit-appearance:none}
.pill.wide{flex:1;text-align:center}
.pill.dark{background:var(--ink);color:#fff}
.pill.redp{background:#fde8ea;color:var(--red)}
.viewing{margin:0 16px 8px;background:#fff7d6;border-radius:12px;padding:8px 12px;display:flex;justify-content:space-between;align-items:center;font-size:14px;font-weight:600}
.viewing button{font-weight:800;color:var(--red)}
.banner{margin:0 16px 8px;border-radius:12px;padding:10px 12px;font-size:14px;font-weight:600;line-height:1.35}
.banner.info{background:#e8f1ff;color:#0a58ca}
.banner.warn{background:#fde8ea;color:#a3000c}
.tabs{display:flex;gap:6px;padding:4px 16px 8px}
.tabs button{flex:1;padding:9px;border-radius:10px;font-weight:700;font-size:14px;color:var(--mute);background:var(--soft)}
.tabs button.on{background:var(--ink);color:#fff}
.abody{flex:1;overflow:auto;-webkit-overflow-scrolling:touch;padding:4px 16px 20px}
.afoot{padding:10px 16px calc(var(--sb) + 12px);border-top:1px solid var(--line);display:flex;gap:10px;align-items:center;background:#fff}
.afoot.adm{flex-direction:column;align-items:stretch}
.row2{display:flex;gap:8px}
.big.red{background:var(--red);color:#fff;display:flex;align-items:center;justify-content:center;gap:10px;flex:1}
.big.red svg{width:24px;height:24px}
.big:disabled{opacity:.4}
.attach{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;font-weight:700;color:var(--ink);min-width:62px}
.attach svg{width:24px;height:24px}
.sum{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:2px 0 12px}
.sum div{background:var(--soft);border-radius:12px;padding:10px;text-align:center}
.sum b{display:block;font-size:20px;font-weight:800}
.sum small{font-size:11.5px;color:var(--mute);font-weight:700}
.mv{display:flex;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid var(--line)}
.mv .d{width:44px;text-align:center;flex-shrink:0}
.mv .d b{display:block;font-size:18px;font-weight:800;line-height:1}
.mv .d small{font-size:11px;color:var(--mute);font-weight:700;text-transform:uppercase}
.mv .c{flex:1;min-width:0}
.mv .c div{font-weight:700;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mv .c small{font-size:12.5px;color:var(--mute)}
.mv .a{font-weight:800;font-size:15px;text-align:right;white-space:nowrap}
.mv .a.pos{color:#1a7f37}
.st{display:inline-block;font-size:11px;font-weight:800;border-radius:999px;padding:2px 8px;margin-top:3px}
.st.ok{background:#e3f6e8;color:#1a7f37}.st.pen{background:#fde8ea;color:var(--red)}.st.prop{background:#fff3cd;color:#8a6100}.st.neu{background:var(--soft);color:var(--mute)}
.mvBtn{flex-shrink:0;background:var(--red);color:#fff;border-radius:10px;padding:8px 10px;font-weight:800;font-size:13px;display:flex;align-items:center;gap:5px}
.mvBtn svg{width:16px;height:16px}
.mvBtn.sec{background:var(--soft);color:var(--ink)}
.empty{color:var(--mute);text-align:center;padding:40px 10px;line-height:1.5}
.tg{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.tk{border-radius:12px;overflow:hidden;background:var(--soft);box-shadow:0 0 0 1px rgba(0,0,0,.05)}
.tk .th{aspect-ratio:3/4;display:flex;align-items:center;justify-content:center;background:#eee;overflow:hidden}
.tk .th img{width:100%;height:100%;object-fit:cover}
.tk .th .pdf{font-weight:800;color:var(--red);font-size:22px}
.tk .in{padding:8px 10px;font-size:12.5px}
.tk .in b{display:block;font-size:13.5px}
.tk .in small{color:var(--mute)}
.tk.q{opacity:.6}
.sec h3{font-size:13px;color:var(--mute);text-transform:uppercase;letter-spacing:.05em;margin:16px 0 6px;font-weight:800}
.card{background:#fff;border-radius:14px;box-shadow:0 0 0 1px var(--line);padding:12px 14px;margin-bottom:10px}
.card .h{display:flex;justify-content:space-between;align-items:center;gap:8px}
.card .h b{font-size:16px}
.bar{height:8px;background:var(--soft);border-radius:4px;overflow:hidden;margin:10px 0 6px}
.bar i{display:block;height:100%;background:#30d158}
.card .m{display:flex;justify-content:space-between;font-size:13px;color:var(--mute);font-weight:600}
.card .acts{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.card .acts .pill{font-size:13px;padding:7px 12px}
#dlgBg{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:30;display:flex;align-items:flex-end}
#dlg{width:100%;max-height:92vh;overflow:auto;background:#fff;color:var(--ink);border-radius:22px 22px 0 0;padding:10px 20px calc(var(--sb) + 20px);animation:up .25s ease}
#dlg h3{font-size:20px;font-weight:800;margin-bottom:4px}
#dlg p{color:var(--mute);font-size:14px;line-height:1.45;margin:6px 0}
#dlg label{display:block;font-size:12px;font-weight:800;color:var(--mute);margin:12px 0 5px;text-transform:uppercase;letter-spacing:.04em}
#dlg input,#dlg select,#dlg textarea{width:100%;font:inherit;font-size:16px;border:1px solid #d2d2d7;border-radius:12px;padding:11px 13px;outline:none;background:#fff}
#dlg .big{margin-top:16px}
#dlg .big.ghost{background:var(--soft);color:var(--ink)}
#dlg table{width:100%;border-collapse:collapse;font-size:12.5px;margin-top:8px}
#dlg td,#dlg th{padding:5px 4px;border-bottom:1px solid var(--line);text-align:left}
#dlg td.n{text-align:right;font-weight:700;white-space:nowrap}
#dlg .prev{width:100%;max-height:55vh;object-fit:contain;border-radius:10px;background:var(--soft)}
.code{font-family:ui-monospace,Menlo,monospace;background:var(--soft);border-radius:10px;padding:10px;word-break:break-all;font-size:13px;-webkit-user-select:all;user-select:all}
.pinbig{font-size:34px;font-weight:800;letter-spacing:.3em;text-align:center;padding:8px}
@media (min-width:900px){.abody,.atop,.tabs,.afoot,.banner,.viewing{max-width:860px;width:100%;margin-left:auto;margin-right:auto}}
