*{box-sizing:border-box}
html,body{margin:0;height:100%;background:#000;color:#fff;font:18px/1.3 system-ui,sans-serif}
body{display:flex;flex-direction:column;height:calc(var(--vh,1vh)*100);padding-top:env(safe-area-inset-top)}
header{display:flex;justify-content:space-between;align-items:center;padding:6px 10px;background:#222;font-size:15px}
header i{display:inline-block;width:12px;height:12px;border-radius:50%;background:#666;margin:0 4px 0 10px}
header i.ok{background:#2ecc40}header i.bad{background:#ff4136}
#scan{position:absolute;opacity:0;width:1px;height:1px;left:0;top:0}
main{flex:1;overflow:auto;padding:8px;display:flex;flex-direction:column;gap:8px}
button,input,select{font:inherit;color:#fff;background:#333;border:2px solid #666;border-radius:8px;padding:10px;min-height:56px}
button:active{background:#555}
.ctx{display:block;width:100%;text-align:left;background:#123;border-color:#37a;min-height:56px;padding:10px}
.ctx b{font-size:22px}
#res{flex:1;min-height:150px;border-radius:8px;padding:12px;background:#222;border:2px solid #444;overflow:auto}
#res h1{margin:0 0 6px;font-size:26px;word-break:break-word}#res p{margin:0 0 10px;font-size:20px;word-break:break-word}
#res.ok{background:#064e1f;border-color:#2ecc40}#res.warn{background:#7a5b00;border-color:#ffc107}#res.err{background:#7f1010;border-color:#ff4136}
.acts{display:flex;gap:8px;flex-wrap:wrap}.acts button{flex:1;background:#000}
.row{display:flex;gap:8px}.row input{flex:1;min-width:0}
.list{display:flex;flex-direction:column;gap:6px}.list button{text-align:left;min-height:60px}
label{display:block;font-size:14px;color:#aaa}
nav{display:flex;padding-bottom:env(safe-area-inset-bottom);background:#111}
nav button{flex:1;border-radius:0;border:0;border-top:3px solid #333;min-height:64px;padding:4px;font-weight:700;font-size:16px;background:#111}
nav button.on{background:#37a;border-top-color:#fff}
#res img{display:block;width:100%;height:calc(var(--vh,1vh)*38);object-fit:contain;background:#000;margin:0 0 8px;border-radius:6px}
#res{animation:f .35s}@keyframes f{from{filter:brightness(2.4)}to{filter:none}}
#res.out{background:#0b3d6e;border-color:#3b9cff}#res.info{background:#0b4f55;border-color:#2ee6d6}
#res.light{background:#4b2a7a;border-color:#c08bff}#res.create{background:#0a6b2a;border-color:#7dff9b}
.pk{padding:12px;border:2px solid #444;border-radius:8px;min-height:56px;font-size:20px}.pk.dn{opacity:.5;text-decoration:line-through}
nav button{font-size:13px}
nav button{font-size:12px;padding:2px}
#vid{width:100%;max-height:calc(var(--vh,1vh)*58);background:#000;border-radius:8px}
.thumb{max-height:90px;object-fit:contain;align-self:flex-start;border-radius:6px}
input[type=range]{width:100%;padding:0;accent-color:#2ee6d6}
small{color:#ccc}
details{border:2px solid #444;border-radius:8px;background:#161616}
summary{min-height:56px;display:flex;align-items:center;padding:0 12px;font-weight:700;font-size:19px;cursor:pointer}
details[open]>summary{background:#222;border-bottom:2px solid #444;border-radius:6px 6px 0 0}
.sec{display:flex;flex-direction:column;gap:8px;padding:10px}
canvas#qrc{align-self:center;max-width:100%;image-rendering:pixelated;background:#fff;border-radius:6px}
.hint{margin:0;color:#ffc107;font-size:15px}
.kv{display:flex;justify-content:space-between;gap:8px;border-bottom:1px solid #333;padding:4px 0;font-size:15px;word-break:break-all}
.pkhead{position:sticky;top:-8px;z-index:3;background:#000;padding:8px 0 4px;display:flex;flex-direction:column;gap:6px}
.pkfoot{position:sticky;bottom:-8px;background:#000;padding:6px 0 8px;z-index:3}
button.go{width:100%;background:#0a6b2a;border-color:#7dff9b;font-weight:800;font-size:19px}
.row.f button{flex:1}.row.f button.on{background:#37a;border-color:#fff}
.row>button{flex:1}
.pstat{min-height:46px;padding:10px;border-radius:8px;background:#222;border:2px solid #444;font-size:18px;word-break:break-word}
.pstat.ok{background:#064e1f;border-color:#2ecc40}.pstat.warn{background:#7a5b00;border-color:#ffc107}.pstat.err{background:#7f1010;border-color:#ff4136}
.pstat.out{background:#0b3d6e}.pstat.info{background:#0b4f55;border-color:#2ee6d6}.pstat.light{background:#4b2a7a;border-color:#c08bff}
.hint2{color:#aaa;font-size:14px;padding:2px 2px 6px}
.pr{display:flex;align-items:center;gap:10px;padding:10px;border:2px solid #444;border-radius:8px;min-height:64px;margin-bottom:6px;background:#111}
.pr.on{background:#0a3d1c;border-color:#2ecc40}.pr.flashrow{outline:3px solid #fff}
.pr .cb{font-size:30px;line-height:1}.pr b{display:block;font-size:19px;word-break:break-word}.pr small{display:block}
.pr img{width:64px;height:64px;object-fit:cover;border-radius:6px;background:#000;flex:none}.pr img[hidden]{display:none}
.grp{border:2px solid #444;border-radius:8px;padding:8px;margin-bottom:10px;background:#161616;display:flex;flex-direction:column;gap:6px}
.grp.lit{border-color:#c08bff;box-shadow:0 0 0 3px #4b2a7a}.grp.done{opacity:.65;border-color:#2ecc40}
.gh{text-align:left;font-size:21px;font-weight:700;background:#222;min-height:60px}.gh small{font-weight:400;color:#ccc}
.grp>button.sm{min-height:44px;font-size:15px}
.bar{height:12px;background:#333;border-radius:6px;overflow:hidden}.bar i{display:block;height:100%;background:#2ecc40;width:0}

html,body{height:100vh;height:calc(var(--vh,1vh)*100)}
body{font-size:17px;font-size:clamp(16px,4.4vw,22px)}
#res{display:flex;flex-direction:column}
#res img{flex:1 1 auto;width:100%;height:auto;min-height:120px;max-height:55vh;max-height:calc(var(--vh,1vh)*55);object-fit:contain}
.pr img{width:64px;height:64px;width:clamp(56px,17vw,110px);height:clamp(56px,17vw,110px)}
.thumb{max-height:100px;max-height:clamp(70px,14vh,160px)}
#vid{max-height:58vh;max-height:calc(var(--vh,1vh)*58)}
#err{position:fixed;top:0;left:0;right:0;z-index:99;background:#7f1010;color:#fff;font:12px/1.3 monospace;margin:0;padding:6px;white-space:pre-wrap;max-height:40vh;overflow:auto;display:none}
canvas#strip{width:100%;height:30px;border-radius:4px;background:#222}
.mono{font-family:monospace;font-size:1.1em}code{background:#333;padding:1px 4px;border-radius:3px}
.chips{display:flex;flex-wrap:wrap;gap:6px}.chip{min-height:48px;padding:6px 14px;border-radius:24px;font-weight:700}.chip.on{background:#0b4f55;border-color:#2ee6d6}
.sec2{display:flex;flex-direction:column;gap:6px;border:2px solid #444;border-radius:8px;padding:8px}
.step{display:flex;gap:6px;align-items:center}.step span{width:3.4em;color:#aaa}.step button{flex:1;padding:4px;min-width:0}
.step input{flex:2;min-width:0;text-align:center;font-weight:700}