/* ===== polish: motion, splash, desktop ===== */
:root{--ease:cubic-bezier(.22,1,.36,1)}
html{scroll-behavior:smooth}
body{overflow-x:hidden}
#app{overflow-x:hidden}
/* splash */
#splash{position:fixed;inset:0;z-index:100;background:linear-gradient(160deg,#ece8ff,#ffe9f1 60%,#e1ebff);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px;transition:opacity .5s var(--ease),visibility .5s}
#splash.out{opacity:0;visibility:hidden}
#splash .lg{width:86px;height:86px;border-radius:28px;background:linear-gradient(135deg,#6b63ff,#b08cff);display:grid;place-items:center;color:#fff;box-shadow:0 20px 50px #6b63ff66;animation:breathe 1.6s ease-in-out infinite}
#splash .lg svg{width:42px;height:42px}
#splash h1{font-size:26px;font-weight:700;color:#1b2340}
#splash .dots{display:flex;gap:8px}#splash .dots i{width:10px;height:10px;border-radius:50%;background:#6b63ff;animation:bounce 1s ease-in-out infinite}#splash .dots i:nth-child(2){animation-delay:.15s;background:#b08cff}#splash .dots i:nth-child(3){animation-delay:.3s;background:#ff9a4d}
#splash .sk{width:220px;display:grid;gap:9px}#splash .sk u{height:10px;border-radius:6px;background:linear-gradient(90deg,#ffffff80 25%,#ffffffe6 50%,#ffffff80 75%);background-size:200% 100%;animation:shim 1.4s linear infinite}
@keyframes breathe{50%{transform:scale(1.08)}}@keyframes bounce{50%{transform:translateY(-9px)}}@keyframes shim{to{background-position:-200% 0}}
/* page + card entrance (transform/opacity only = smooth on phones) */
main>*{animation:rise .55s var(--ease) both;animation-delay:calc(var(--i,0)*50ms)}
@keyframes rise{from{opacity:0;transform:translate3d(0,14px,0)}}
.task,.tile,.card,.hero2,.strip2{will-change:transform;transition:transform .25s var(--ease),box-shadow .25s}
.task:active,.tile:active,.hero2:active,.row:active,.node:active,.conn:active{transform:scale(.975)}
@media(hover:hover){.task:hover,.tile:hover{transform:translateY(-2px);box-shadow:0 14px 34px #6b63ff22}}
.hero2 .pb u{animation:grow 1s .3s var(--ease) both;transform-origin:right}@keyframes grow{from{transform:scaleX(0)}}
.hero2::after{animation:float 7s ease-in-out infinite}@keyframes float{50%{transform:translate3d(14px,-10px,0)}}
.avw svg{transition:transform .3s var(--ease)}.task:hover .avw svg,.row:hover .avw svg{transform:scale(1.06)}
nav a{transition:color .25s,transform .25s var(--ease);position:relative}
nav a svg{transition:transform .35s var(--ease)}
nav a.on svg{animation:pop .45s var(--ease)}nav a.on{transform:translateY(-2px)}
nav a.on::after{content:"";position:absolute;bottom:-4px;left:50%;width:5px;height:5px;margin-left:-2.5px;border-radius:50%;background:var(--ac);animation:pop .4s var(--ease)}
@keyframes pop{0%{transform:scale(.6)}60%{transform:scale(1.2)}100%{transform:scale(1)}}
nav .fab{transition:transform .3s var(--ease)}nav .fab:active{transform:scale(.9) rotate(90deg)}nav .fab{animation:fabp 3s ease-in-out infinite}@keyframes fabp{50%{box-shadow:0 12px 34px #6b63ffaa}}
.modal{display:flex;visibility:hidden;opacity:0;transition:opacity .3s,visibility .3s}.modal.show{visibility:visible;opacity:1}
.sheet{transform:translate3d(0,100%,0);transition:transform .45s var(--ease)}.modal.show .sheet{transform:none}
#chatv{display:flex;visibility:hidden;opacity:0;transform:translate3d(-24px,0,0);transition:transform .4s var(--ease),opacity .3s,visibility .3s}#chatv.show{visibility:visible;opacity:1;transform:none}
.b{animation:bpop .35s var(--ease) both}@keyframes bpop{from{opacity:0;transform:translate3d(0,8px,0) scale(.96)}}
.orb{display:flex;visibility:hidden;opacity:0;transition:opacity .4s,visibility .4s}.orb.show{visibility:visible;opacity:1}
.sw::after{transition:right .25s var(--ease),background .2s}.sw{transition:background .25s}
.chip{transition:background .2s,color .2s,transform .2s}.chip:active{transform:scale(.94)}
button{transition:transform .2s var(--ease),box-shadow .2s}button:active{transform:scale(.96)}
.toast{transition:opacity .3s,transform .4s var(--ease);transform:translate(-50%,16px)}.toast.show{transform:translate(-50%,0)}
.ck2{transition:all .25s var(--ease);cursor:pointer}.ck2:active{transform:scale(.8)}
/* r5 closer: tinted tiles, photo */
.tile.t1{background:linear-gradient(160deg,#ece9ff,#f6f4ff)}.tile.t2{background:linear-gradient(160deg,#e4f0ff,#f3f8ff)}.tile.t3{background:linear-gradient(160deg,#ffefe2,#fff8f1)}
.tile b{font-size:26px;font-weight:700}
.top .me{padding:3px;overflow:hidden}.top .me img,.top .me svg{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block;background:#fff}
.hero2{border-radius:30px;padding:22px}.hero2 h3{font-size:24px;font-weight:700}
.pf{width:104px;height:104px;border-radius:50%;margin:0 auto 12px;padding:4px;background:linear-gradient(135deg,#ffb4c9,#b8b0ff);box-shadow:0 12px 28px #6b63ff40}.pf img,.pf svg{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block;background:#fff}
/* desktop */
#side{display:none}
.blobs{position:fixed;inset:0;overflow:hidden;z-index:-1;display:none}.blobs i{position:absolute;border-radius:50%;filter:blur(70px);opacity:.7;animation:drift 18s ease-in-out infinite alternate}
.blobs i:nth-child(1){width:420px;height:420px;background:#c9c2ff;top:-80px;right:-60px}.blobs i:nth-child(2){width:360px;height:360px;background:#ffd0e0;bottom:-90px;left:8%;animation-delay:-6s}.blobs i:nth-child(3){width:300px;height:300px;background:#bcd6ff;top:35%;left:42%;animation-delay:-11s}
@keyframes drift{to{transform:translate3d(60px,40px,0)}}
/* glass */
.task,.tile,.card,.row,.conn,.node,.strip2,.sheet .card,.b,.ch,.cf,input,textarea,select{background:#ffffff8c!important;backdrop-filter:blur(18px) saturate(1.5);-webkit-backdrop-filter:blur(18px) saturate(1.5);border:1px solid #ffffffd9;box-shadow:0 10px 30px #6b63ff14,inset 0 1px 0 #fff}
.sheet{background:#f5f3ffcc!important;backdrop-filter:blur(26px) saturate(1.6);-webkit-backdrop-filter:blur(26px) saturate(1.6);border:1px solid #fff}
.modal{backdrop-filter:blur(6px)}
nav{background:#ffffff99!important;backdrop-filter:blur(24px) saturate(1.6)!important;-webkit-backdrop-filter:blur(24px) saturate(1.6)!important}
.hero2{box-shadow:0 24px 50px #6b63ff55,inset 0 1px 0 #ffffff66}
.sheen{position:relative;overflow:hidden}
#app::before{content:"";position:fixed;inset:0;z-index:-1;background:radial-gradient(40% 35% at 15% 10%,#c9c2ff 0,transparent 70%),radial-gradient(35% 35% at 90% 30%,#ffd0e0 0,transparent 70%),radial-gradient(40% 40% at 50% 100%,#bcd6ff 0,transparent 70%)}
@media(min-width:900px){
 body{display:block;background:#f3f0fb}
 .blobs{display:block}
 #side{display:none!important}
 #app{max-width:none!important;width:100%;padding:28px 300px 40px 44px;min-height:100vh}
 main{max-width:1280px;margin:0 auto;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(380px,1fr));gap:20px;align-items:start}
 main>*{margin:0!important;min-width:0}
 main>*:first-child,main>.top,main>.tiles,main>.hero2{grid-column:1/-1}
 .top .tx h2{font-size:38px}.top .me{width:64px;height:64px}
 .hero2{padding:34px}.hero2 h3{font-size:32px}
 .tiles{gap:20px}.tile{padding:22px}.tile b{font-size:38px}
 nav{position:fixed!important;top:22px;bottom:22px;left:auto!important;right:22px;transform:none!important;width:240px!important;max-width:none!important;height:auto;flex-direction:column;justify-content:flex-start;gap:6px;padding:26px 14px!important;border-radius:32px!important;align-items:stretch!important}
 nav a{flex:none!important;display:flex!important;align-items:center;gap:14px;font-size:16px!important;padding:13px 18px!important;border-radius:18px;text-align:right;transition:background .25s,transform .25s var(--ease)}
 nav a svg{margin:0!important}nav a:hover{background:#6b63ff14;transform:translateX(-4px)}nav a.on{background:linear-gradient(135deg,#6b63ff,#b08cff)!important;color:#fff!important;box-shadow:0 10px 22px #6b63ff55!important}nav a.on::after{display:none}nav a.on svg{filter:none!important}
 nav::before{content:"منصة شغلنا";display:block;font-size:22px;font-weight:700;color:#1b2340;padding:4px 18px 20px}
 nav .fab{order:9;display:flex!important;align-items:center;justify-content:center;flex:none!important;flex-direction:row;margin:14px 0 0!important;width:auto!important;height:54px!important;border-radius:18px!important;border:0!important;gap:10px;animation:none}nav .fab::after{content:"أمر جديد";font-weight:600;font-size:15px}
 .sheet{max-width:620px!important;margin:auto!important;border-radius:32px!important;transform:translate3d(0,40px,0) scale(.97)}.modal{align-items:center!important}.modal.show .sheet{transform:none}
 #chatv .cw{max-width:1000px;width:100%;margin:22px auto;height:calc(100vh - 44px);border-radius:34px;overflow:hidden;box-shadow:0 30px 80px #3c508244}
 #chatv{backdrop-filter:blur(14px)}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
.card .row,.card .conn,.card .node{background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:none!important;border:0!important;border-bottom:1px solid #6b63ff14!important;border-radius:0!important}
.card .row:last-child,.card .conn:last-child{border-bottom:0!important}
.card .node{border-bottom:0!important;border-radius:16px!important}

.top .ta{display:flex;align-items:center;gap:10px}.ib{position:relative;width:44px;height:44px;border-radius:50%;border:1px solid #fff;background:#ffffffa6;backdrop-filter:blur(14px);color:#1b2340;display:grid;place-items:center;padding:0;box-shadow:0 8px 20px #6b63ff1f}.ib svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.ib .dot{position:absolute;top:9px;right:11px;width:9px;height:9px;border-radius:50%;background:#6b63ff;border:2px solid #fff}
.top .me{width:78px;height:78px;border-radius:50%;padding:4px;background:linear-gradient(135deg,#c9c2ff,#8fb2ff);box-shadow:0 12px 30px #6b63ff40}
.row>div b,.row>div small{display:block}.row>div:not(.avw){min-width:0}
.sheet{box-sizing:border-box;scrollbar-width:none;overflow-x:hidden}.sheet::-webkit-scrollbar{display:none}
.sheet .row{background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:none!important;border:0!important;border-bottom:1px solid #6b63ff1a!important;border-radius:0!important;padding:12px 4px}
.sheet .row:last-child{border-bottom:0!important}
.sheet input{box-sizing:border-box;width:100%;outline:0;border:1px solid #fff!important;box-shadow:0 0 0 2px #6b63ff66!important;border-radius:16px;padding:13px 16px}
*{scrollbar-width:none;-ms-overflow-style:none}*::-webkit-scrollbar{display:none;width:0;height:0}
html,body{scrollbar-width:none}html::-webkit-scrollbar,body::-webkit-scrollbar{display:none}

.avw img.a3d{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block;box-shadow:0 0 0 1.5px #ffffffaa,0 2px 8px #6b63ff33;transition:transform .3s var(--ease)}.task:hover .avw img,.row:hover .avw img{transform:scale(1.06)}
.av-pick .avw.on img{box-shadow:0 0 0 3px #6b63ff}.av-pick .avw{width:56px;height:56px}
/* auth */
#auth{position:fixed;inset:0;z-index:90;display:flex;align-items:center;justify-content:center;padding:20px;overflow:auto;background:linear-gradient(160deg,#ece8ff,#ffe9f1 60%,#e1ebff);opacity:0;visibility:hidden;transition:opacity .35s var(--ease),visibility .35s}
#auth.show{opacity:1;visibility:visible}
#auth .acard{width:100%;max-width:400px;margin:auto;padding:26px 22px;border-radius:28px;background:#ffffffb8;backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);border:1px solid #fff;box-shadow:0 20px 60px #6b63ff26;display:flex;flex-direction:column;gap:10px;transform:translateY(14px);transition:transform .45s var(--ease)}
#auth.show .acard{transform:none}
#auth .alg{width:54px;height:54px;border-radius:18px;background:linear-gradient(135deg,#6b63ff,#b794ff);color:#fff;display:flex;align-items:center;justify-content:center;margin:0 auto}
#auth h1{text-align:center;font-size:22px;margin:4px 0 0}#auth .asub{text-align:center;color:var(--mu);font-size:13px;margin-bottom:4px}
#auth .aerr{display:none;background:#f0616d1a;color:#d23b4a;padding:9px 12px;border-radius:12px;font-size:13px}#auth .aerr.on{display:block}
#auth .alink,#auth .aswitch a{color:#6b63ff;cursor:pointer;font-weight:600}#auth .alink{font-size:13px;align-self:flex-start}
#auth .aswitch{text-align:center;font-size:13px;color:var(--mu)}
#auth .sep{display:flex;align-items:center;gap:10px;color:var(--mu);font-size:12px}#auth .sep:before,#auth .sep:after{content:"";flex:1;height:1px;background:#1b234018}
#auth .soc{display:flex;align-items:center;justify-content:center;gap:10px;background:#fff;color:var(--tx);border:1px solid #1b23401a;box-shadow:none;font-weight:600}
#auth .soc:disabled{opacity:.5}#auth .soc em{font-style:normal;font-size:11px;background:#6b63ff1c;color:#6b63ff;padding:2px 8px;border-radius:99px}
#auth .anote{text-align:center;color:var(--mu);font-size:11px}
.minit{width:100%;height:100%;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#6b63ff,#b794ff);color:#fff;font-weight:800;font-size:34px}.top .me .minit{font-size:22px}
#auth .astore{background:#6b63ff12;border-radius:12px;padding:9px 12px;font-size:12px;color:var(--tx)}#auth .aok{display:flex;gap:8px;align-items:flex-start;font-size:13px}#auth .aok input{width:18px;height:18px;margin-top:2px;flex:none}.aok{display:flex;gap:8px;align-items:flex-start;font-size:13px;line-height:1.5}
.aok input[type=checkbox]{width:18px;height:18px;margin-top:2px;flex:0 0 18px;accent-color:#6b63ff}
.sendbox{max-height:200px;overflow:auto;background:var(--card2);border-radius:12px;padding:10px;font-size:13px;white-space:pre-wrap;word-break:break-word;margin-bottom:10px}

/* dark theme */
html[data-theme=dark]{--bg:#0e1124;--card:#181d37;--card2:#222849;--tx:#eef0ff;--mu:#9aa3c7;--line:#ffffff1a;--ac:#8b84ff;--ac2:#b3acff;--sh:0 10px 30px #00000066;color-scheme:dark}
html[data-theme=dark] body{background:#0e1124!important;color:var(--tx)}
html[data-theme=dark] .task,html[data-theme=dark] .tile,html[data-theme=dark] .card,html[data-theme=dark] .row,html[data-theme=dark] .conn,html[data-theme=dark] .node,html[data-theme=dark] .strip2,html[data-theme=dark] .sheet .card,html[data-theme=dark] .b,html[data-theme=dark] .ch,html[data-theme=dark] .cf,html[data-theme=dark] input,html[data-theme=dark] textarea,html[data-theme=dark] select{background:#ffffff0f!important;color:var(--tx)!important;border-color:#ffffff1a!important}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#8a93b8}
html[data-theme=dark] .sheet{background:#161a33f2!important;border-color:#ffffff1a}
html[data-theme=dark] nav{background:#161a33d9!important}
html[data-theme=dark] #app::before{background:radial-gradient(40% 35% at 15% 10%,#3b2f8a77 0,transparent 70%),radial-gradient(35% 35% at 90% 30%,#6a2f5277 0,transparent 70%),radial-gradient(40% 40% at 50% 100%,#1f3f7a66 0,transparent 70%),#0e1124}
html[data-theme=dark] .blobs i{opacity:.2}
html[data-theme=dark] .tile.t1,html[data-theme=dark] .tile.t2,html[data-theme=dark] .tile.t3{background:#ffffff10!important}
html[data-theme=dark] .ib{background:#ffffff14;border-color:#ffffff22;color:var(--tx)}
html[data-theme=dark] button.g,html[data-theme=dark] .sm2.g,html[data-theme=dark] .chip{background:#ffffff14;color:var(--tx)}
html[data-theme=dark] #splash,html[data-theme=dark] #auth{background:linear-gradient(160deg,#141735,#2a1a3d 60%,#12213f)}
html[data-theme=dark] #auth .acard{background:#181d37d9;border-color:#ffffff1a}
html[data-theme=dark] #auth .soc{background:#ffffff10;color:var(--tx);border-color:#ffffff1a}
html[data-theme=dark] .sendbox{background:#ffffff10}
html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] p,html[data-theme=dark] b{color:inherit}
.themeseg{display:flex;gap:8px;margin-top:10px}.themeseg button{flex:1;background:var(--card2);color:var(--tx);box-shadow:none}.themeseg button.on{background:linear-gradient(135deg,#6b63ff,#b08cff);color:#fff}
.aerr2{display:none;background:#f0616d1a;color:#d23b4a;padding:9px 12px;border-radius:12px;font-size:13px;margin-bottom:8px}.aerr2.on{display:block}
html[data-theme=dark] .blobs{display:none!important}
html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3,html[data-theme=dark] .side *,html[data-theme=dark] nav *{color:var(--tx)}
html[data-theme=dark] nav a.on,html[data-theme=dark] nav a.on *,html[data-theme=dark] header h1{color:#fff}
html[data-theme=dark] .acard h1{color:var(--tx)}
html[data-theme=dark] body,html[data-theme=dark]{background-image:none!important;background-color:#0e1124!important}
html[data-theme=dark] .live{background:#1fbf8a22!important;box-shadow:none!important}
html[data-theme=dark] .logo,html[data-theme=dark] .logo b,html[data-theme=dark] aside h2,html[data-theme=dark] aside .logo *{color:#eef0ff!important}
html[data-theme=dark] .tag,html[data-theme=dark] .bdg,html[data-theme=dark] [class*=st-]{background:#ffffff18!important;color:#c9cdea!important}
html[data-theme=dark] .blobs,html[data-theme=dark] .blobs i{display:none!important}
html[data-theme=dark] #app::before{background:radial-gradient(40% 35% at 15% 10%,#3b2f8a55 0,transparent 70%),radial-gradient(35% 35% at 90% 30%,#6a2f5233 0,transparent 70%)!important}
html[data-theme=dark] nav::before{color:#eef0ff!important}
html[data-theme=dark] #app{background:var(--bg)!important}
html[data-theme=dark] #chatv,html[data-theme=dark] .cw{background:var(--bg)!important}

/* phone hardening: dynamic viewport, safe areas, no iOS zoom on focus */
@supports (height:100dvh){#app{min-height:100dvh}.cw{height:100dvh}}
input,textarea,select{font-size:16px}
nav{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
#app{padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))}
@media (prefers-reduced-motion:reduce){*{animation-duration:.001s!important;transition-duration:.001s!important}}
/* profile photos */
.pgal{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.ppick{padding:0;border:2px solid transparent;border-radius:14px;overflow:hidden;background:none;cursor:pointer;aspect-ratio:1}
.ppick img{width:100%;height:100%;object-fit:cover;display:block}
.ppick.on{border-color:#6b63ff}
.cropw{display:flex;justify-content:center}
#crc{width:260px;height:260px;max-width:100%;border-radius:18px;background:transparent;touch-action:none}
#crz{accent-color:#6b63ff;height:28px}
/* touch targets: 44px minimum everywhere it is tapped */
#nav a{min-height:46px;display:flex;flex-direction:column;justify-content:center;padding:6px 0}
#v button,#ms button,#v .task,.ppick{min-height:44px}
/* tablet and phone-landscape: use the width instead of a 430px strip */
@media(min-width:700px) and (max-width:899px){
 body{display:block;background:#f3f0fb}
 #app{max-width:none;width:100%;padding:20px 26px 104px}
 main{max-width:760px;margin:0 auto}
 nav{max-width:760px;left:50%;transform:translateX(-50%)}
}
/* short viewports (phone landscape): keep the bar at the very bottom instead of floating over content */
@media(max-height:520px){
 nav{bottom:0!important;left:0!important;right:0!important;width:100%!important;max-width:100%!important;transform:none!important;border-radius:20px 20px 0 0!important;padding-bottom:calc(6px + env(safe-area-inset-bottom,0px))!important}
 #app{padding-bottom:96px}
 .top .tx h2{font-size:22px}
}
/* very small phones (360 and below): keep the header row on screen */
@media(max-width:380px){
 .top{gap:8px;padding-bottom:12px}
 .top .me{width:48px;height:48px;min-width:48px;font-size:20px}
 .top .tx h2{font-size:19px;line-height:1.35;overflow-wrap:anywhere}
 .top .tx small{font-size:10px}
 .tiles .tile b{font-size:26px}
}
