:root{--bg:#000;--fg:#fff;--mut:#a8a8a8;--sheet:#f4f3ef;--sfg:#1b1b1a;--line:#dedcd5;--card:#fff;--acc:#1d5bd8;--ok:#1f7a3a;--err:#c0322a;--pend:#7a7a7a}
[hidden]{display:none!important}
@media (prefers-color-scheme:dark){:root{--sheet:#141414;--sfg:#ecebe8;--line:#2c2c2b;--card:#1f1f1e;--acc:#6b9bff;--ok:#5cc27a;--err:#ff7b72;--pend:#9a9893}}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:var(--bg);color:var(--fg);font:16px/1.35 -apple-system,BlinkMacSystemFont,"Helvetica Neue",sans-serif;-webkit-user-select:none;user-select:none;overscroll-behavior:none}
button{font:inherit;color:inherit;cursor:pointer}
svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#video{position:fixed;inset:0;width:100%;height:100%;object-fit:cover;background:#000}
#flash{position:fixed;inset:0;background:#fff;opacity:0;pointer-events:none;transition:opacity .25s}
#flash.on{opacity:.7;transition:none}
.camerr{position:fixed;left:16px;right:16px;top:40%;text-align:center;color:var(--mut)}
.top{position:fixed;top:0;left:0;right:0;padding:calc(env(safe-area-inset-top) + 10px) 12px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;background:linear-gradient(rgba(0,0,0,.55),transparent)}
.pill{min-width:52px;height:52px;padding:0 14px;border:0;border-radius:26px;background:rgba(0,0,0,.45);display:inline-flex;align-items:center;justify-content:center;gap:6px;font-weight:600;font-size:17px;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
#queueCount:empty{display:none}
#micBtn.rec{color:#ff5a4f}
#micBtn.muted{color:var(--mut)}
.counter{font-weight:700;font-size:18px;text-shadow:0 1px 3px rgba(0,0,0,.6)}
.bottom{position:fixed;left:0;right:0;bottom:0;padding:24px 16px calc(env(safe-area-inset-bottom) + 16px);display:flex;flex-direction:column;gap:16px;background:linear-gradient(transparent,rgba(0,0,0,.6) 35%)}
.done{height:62px;border:0;border-radius:18px;background:var(--acc);color:#fff;font-size:19px;font-weight:700}
.done:disabled{opacity:0;pointer-events:none}
.row{display:grid;grid-template-columns:1fr auto 1fr;align-items:center}
.thumb{justify-self:start;width:62px;height:80px;border-radius:10px;border:2px solid #fff;background:#222 center/cover no-repeat;padding:0}
.thumb:disabled{opacity:0}
.shutter{width:92px;height:92px;border-radius:50%;border:5px solid #fff;background:transparent;padding:6px}
.shutter i{display:block;width:100%;height:100%;border-radius:50%;background:#fff;transition:transform .08s}
.shutter:active i{transform:scale(.88)}
.side{justify-self:end;display:flex;flex-direction:column;gap:10px}
.sheet{position:fixed;inset:0;background:var(--sheet);color:var(--sfg);padding:calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px);display:flex;flex-direction:column;gap:14px;overflow-y:auto;-webkit-user-select:text;user-select:text}
.sheet.dark{background:#000;color:#fff}
.sheet h2{margin:0;font-size:22px}
.sheethead{display:flex;align-items:center;justify-content:space-between}
#previewImg{flex:1;min-height:0;width:100%;object-fit:contain}
.actions{display:flex;gap:12px}
.btn{flex:1;min-height:56px;padding:0 18px;border:1px solid var(--line);border-radius:16px;background:var(--card);color:var(--sfg);font-weight:600;font-size:17px}
.sheethead .btn{flex:0 0 auto}
.dark .btn{background:#222;color:#fff;border-color:#333}
.btn.primary{background:var(--acc);border-color:var(--acc);color:#fff}
.btn.danger{background:var(--err);border-color:var(--err);color:#fff}
textarea,#keyIn{width:100%;font:inherit;font-size:17px;color:var(--sfg);background:var(--card);border:1px solid var(--line);border-radius:14px;padding:12px}
.alldone{margin:0;padding:14px;border-radius:14px;background:var(--card);color:var(--ok);font-weight:700;text-align:center}
#histList{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
#histList li{background:var(--card);border:1px solid var(--line);border-left:6px solid var(--pend);border-radius:14px;padding:12px 14px;display:flex;align-items:center;gap:12px}
#histList li.filed{border-left-color:var(--ok)}
#histList li.uploaded,#histList li.uploading{border-left-color:var(--acc)}
#histList li.failed{border-left-color:var(--err)}
#histList .meta{flex:1;min-width:0}
#histList .t{font-weight:600;overflow-wrap:anywhere}
#histList .s{font-size:14px;color:var(--pend)}
#histList li.failed .s{color:var(--err)}
#histList li.filed .s{color:var(--ok)}
#histList a{color:var(--acc);font-weight:600;text-decoration:none}
#histList .btn{flex:0 0 auto;min-height:48px}
