*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;margin:0;padding:0}
html,body{height:100%;background:#000;color:#fff;font-family:-apple-system,"SF Pro Text","Segoe UI",Roboto,"Noto Sans Arabic","Noto Naskh Arabic",Tahoma,sans-serif;overflow:hidden;overscroll-behavior:none;touch-action:manipulation;user-select:none;-webkit-user-select:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hide{display:none!important}
#app{position:fixed;inset:0;display:flex;flex-direction:column;background:#000;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
#topbar{display:flex;justify-content:space-around;align-items:center;height:56px;flex:none;padding:0 6px}
.tbtn{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:54px;height:48px;justify-content:center;color:#fff;border-radius:12px;font-size:15px}
.tbtn i{font-style:normal;font-size:10px;opacity:.7;line-height:1}
.tbtn b{font-size:14px;line-height:22px;height:22px}
.tbtn.on{color:#ffd60a}.tbtn.on i{opacity:1}
#stage{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#000}
#vf{position:relative;overflow:hidden;background:#111;border-radius:14px;width:100%;aspect-ratio:3/4;max-height:100%;max-width:100%;touch-action:none}
#video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transform-origin:center;background:#000}
#video.mirror{transform:scaleX(-1)}
#vfOverlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#grid{position:absolute;inset:0;pointer-events:none;display:none}
#grid.on{display:block}
#grid i{position:absolute;background:rgba(255,255,255,.45)}
#grid i:nth-child(1){left:33.33%;top:0;bottom:0;width:1px}
#grid i:nth-child(2){left:66.66%;top:0;bottom:0;width:1px}
#grid i:nth-child(3){top:33.33%;left:0;right:0;height:1px}
#grid i:nth-child(4){top:66.66%;left:0;right:0;height:1px}
#level{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:120px;height:2px;pointer-events:none;display:none;align-items:center;justify-content:space-between}
#level.on{display:flex}
#level span{display:block;height:2px;background:#fff;opacity:.8}
#levelL,#levelR{width:30px}#levelM{width:44px;transition:background .15s}
#level.flat span{background:#ffd60a}
#focusBox{position:absolute;width:74px;height:74px;border:1.5px solid #ffd60a;border-radius:4px;pointer-events:none;opacity:0;transform:translate(-50%,-50%) scale(1.4);transition:transform .25s,opacity .25s}
#focusBox.show{opacity:1;transform:translate(-50%,-50%) scale(1)}
#focusBox.fade{opacity:.5}
#focusSun{position:absolute;right:-26px;top:4px;color:#ffd60a;font-size:18px;transition:top .1s}
#rec{position:absolute;top:12px;left:50%;transform:translateX(-50%);background:rgba(255,59,48,.9);padding:4px 12px;border-radius:14px;display:flex;align-items:center;gap:8px;font-variant-numeric:tabular-nums}
#rec .dot{width:9px;height:9px;border-radius:50%;background:#fff;animation:blink 1s infinite}
@keyframes blink{50%{opacity:.2}}
#countdown{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:120px;font-weight:200;color:#fff;text-shadow:0 2px 20px rgba(0,0,0,.5);pointer-events:none}
#flashScreen{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none;transition:opacity .15s}
#flashScreen.on{opacity:1}
#shotFlash{position:absolute;inset:0;background:#000;opacity:0;pointer-events:none}
#shotFlash.go{animation:shot .22s}
@keyframes shot{0%{opacity:.9}100%{opacity:0}}
#toast{position:absolute;bottom:14px;left:50%;transform:translateX(-50%);background:rgba(30,30,30,.85);backdrop-filter:blur(8px);padding:7px 14px;border-radius:16px;font-size:13px;opacity:0;pointer-events:none;transition:opacity .25s;white-space:nowrap;max-width:92%;overflow:hidden;text-overflow:ellipsis}
#toast.show{opacity:1}
#busy{position:absolute;inset:0;background:rgba(0,0,0,.5);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;font-size:15px}
.spin{width:34px;height:34px;border-radius:50%;border:3px solid rgba(255,255,255,.25);border-top-color:#fff;animation:sp .8s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
#perm{position:absolute;inset:0;background:#000;display:flex;align-items:center;justify-content:center;padding:24px;z-index:5}
.permCard{text-align:center;max-width:320px}
.permCard svg{width:54px;height:54px;margin-bottom:14px;opacity:.9}
.permCard h2{font-size:20px;margin-bottom:8px}
.permCard p{opacity:.7;font-size:14px;line-height:1.6;margin-bottom:18px}
.primary{background:#ffd60a;color:#000;font-weight:700;padding:12px 28px;border-radius:24px;font-size:16px}
#zoomRow{flex:none;display:flex;justify-content:center;height:44px;align-items:center;margin-top:-52px;position:relative;z-index:3;pointer-events:none}
#zoomChips{display:flex;gap:6px;background:rgba(0,0,0,.35);backdrop-filter:blur(10px);padding:4px;border-radius:24px;pointer-events:auto}
.zc{min-width:36px;height:36px;border-radius:50%;font-size:13px;font-weight:600;color:#fff;display:flex;align-items:center;justify-content:center;background:rgba(40,40,40,.6)}
.zc.on{color:#ffd60a;background:rgba(60,60,60,.9);min-width:44px;height:44px;border-radius:50%;margin:-4px 0}
#expRow{flex:none;display:flex;align-items:center;gap:8px;padding:6px 20px}
#expRow input{flex:1;accent-color:#ffd60a}
#expRow b{min-width:34px;text-align:center;color:#ffd60a;font-size:13px}
#proPanel{flex:none;padding:6px 14px;display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;max-height:120px;overflow:auto;font-size:12px}
#proPanel label{display:flex;flex-direction:column;gap:2px}
#proPanel label span{display:flex;justify-content:space-between;opacity:.85}
#proPanel input{width:100%;accent-color:#ffd60a}
#modes{flex:none;height:42px;overflow:hidden;position:relative;margin-top:2px}
#modeStrip{display:flex;gap:4px;align-items:center;height:100%;overflow-x:auto;scrollbar-width:none;padding:0 50%;scroll-snap-type:x mandatory}
#modeStrip::-webkit-scrollbar{display:none}
.md{flex:none;scroll-snap-align:center;padding:8px 12px;font-size:13px;font-weight:600;letter-spacing:.3px;color:rgba(255,255,255,.75)}
.md.on{color:#ffd60a}
#bottom{flex:none;height:104px;display:flex;align-items:center;justify-content:space-around;padding:0 18px}
#thumb{width:52px;height:52px;border-radius:12px;background:#222;border:1.5px solid #555;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:20px}
#thumb img{width:100%;height:100%;object-fit:cover;display:none}
#thumb.has img{display:block}#thumb.has #thumbEmpty{display:none}
#flip{width:52px;height:52px;border-radius:50%;background:rgba(60,60,60,.7);display:flex;align-items:center;justify-content:center}
#flip svg{width:26px;height:26px}
#shutter{width:78px;height:78px;border-radius:50%;border:4px solid #fff;display:flex;align-items:center;justify-content:center;transition:transform .12s}
#shutter span{display:block;width:62px;height:62px;border-radius:50%;background:#fff;transition:all .18s}
#shutter:active{transform:scale(.92)}
#shutter.video span{background:#ff3b30}
#shutter.recording span{width:32px;height:32px;border-radius:8px;background:#ff3b30}
.sheet{position:absolute;left:0;right:0;bottom:0;z-index:6}
.sheetBody{background:rgba(20,20,20,.92);backdrop-filter:blur(16px);padding:12px 8px calc(env(safe-area-inset-bottom) + 12px);border-radius:18px 18px 0 0}
#filterList{display:flex;gap:10px;overflow-x:auto;padding:4px 8px;scrollbar-width:none}
.fl{flex:none;width:66px;text-align:center;font-size:11px}
.fl canvas{width:66px;height:66px;border-radius:10px;display:block;margin-bottom:4px;border:2px solid transparent;background:#333}
.fl.on canvas{border-color:#ffd60a}.fl.on{color:#ffd60a}
.overlay{position:fixed;inset:0;background:#000;z-index:20;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top)}
.panel{display:flex;flex-direction:column;height:100%;background:#0b0b0d}
.panelHead{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #222;flex-direction:row-reverse}
.panelHead h2{font-size:19px}
.close{width:36px;height:36px;border-radius:50%;background:#222;font-size:16px}
.panelBody{flex:1;overflow:auto;padding:12px 14px calc(env(safe-area-inset-bottom) + 20px)}
.sg{background:#1a1a1d;border-radius:14px;margin-bottom:14px;overflow:hidden}
.sg h3{font-size:12px;opacity:.55;padding:10px 14px 0;font-weight:500}
.sr{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-top:1px solid #26262a;font-size:15px}
.sg h3+.sr{border-top:0}
.sr small{display:block;opacity:.5;font-size:11px;margin-top:2px}
.sr select{background:#2a2a2e;color:#fff;border:0;border-radius:8px;padding:7px 8px;font-size:14px;max-width:48%}
.sr input[type=range]{width:46%;accent-color:#ffd60a}
.sw{position:relative;width:48px;height:28px;flex:none}
.sw input{opacity:0;position:absolute;inset:0;width:100%;height:100%;z-index:2;cursor:pointer}
.sw i{position:absolute;inset:0;background:#3a3a3e;border-radius:14px;transition:.2s}
.sw i:after{content:"";position:absolute;top:2px;left:2px;width:24px;height:24px;border-radius:50%;background:#fff;transition:.2s}
.sw input:checked+i{background:#30d158}.sw input:checked+i:after{transform:translateX(20px)}
.muted{opacity:.55;text-align:center;padding:30px 0;font-size:14px}
#galGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:3px}
#galGrid .gi{position:relative;aspect-ratio:1;background:#1a1a1d;overflow:hidden}
#galGrid .gi img{width:100%;height:100%;object-fit:cover}
#galGrid .gi span{position:absolute;bottom:3px;right:5px;font-size:11px;text-shadow:0 1px 3px #000}
#viewer{z-index:30}
.viewTop{display:flex;align-items:center;gap:10px;padding:12px;color:#ddd;font-size:12px}
#viewMedia{flex:1;min-height:0;display:flex;align-items:center;justify-content:center}
#viewMedia img,#viewMedia video{max-width:100%;max-height:100%;object-fit:contain}
.viewBar{display:flex;justify-content:space-around;padding:14px 10px calc(env(safe-area-inset-bottom) + 14px)}
.viewBar button{background:#222;padding:11px 22px;border-radius:22px;font-size:15px}
.viewBar .danger{color:#ff453a}
#btnFilters{position:absolute;right:10px;top:10px;background:rgba(0,0,0,.4);backdrop-filter:blur(8px);padding:6px 12px;border-radius:16px;font-size:12px;z-index:3}
