/* ===== responsive.css: موبايل + تابلت + لابتوب (يُحمَّل بعد باقي ملفات التنسيق) ===== */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overflow-x:clip}
img,video,canvas,svg,iframe{max-width:100%}
button,a,summary,label.drop{touch-action:manipulation}
#xbox,#gbox{min-height:100vh;min-height:100dvh}
.xdb,.xdb.xed{max-height:92vh;max-height:92dvh;overflow-y:auto}
.figs.wideg{grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr))}
.xgl{grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr))}
.rg{grid-template-columns:repeat(auto-fill,minmax(min(220px,100%),1fr))}
.grid{grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr))}
.lanes{grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr))}

/* شاشات كبيرة جدًا */
@media(min-width:1500px){main,.xd{max-width:1240px}}

/* لابتوب صغير وتابلت أفقي: قائمة جانبية أضيق ومساحة محتوى أكبر */
@media(min-width:901px) and (max-width:1180px){
 body{padding-right:224px}
 header:not(.wh){width:224px}
 nav button{padding:.6rem .6rem}
 main{padding-inline:1.2rem}
}

/* تابلت عمودي وموبايل: القائمة تنزلق وتغطي جزءًا من الشاشة */
@media(max-width:900px){
 header:not(.wh){width:min(86vw,300px);padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);transition:transform .25s ease,box-shadow .25s ease}
 body.open header:not(.wh){box-shadow:0 0 0 100vmax rgba(3,22,42,.5),-6px 0 24px rgba(0,0,0,.25)}
 #mb{top:calc(.7rem + env(safe-area-inset-top,0px));right:calc(.7rem + env(safe-area-inset-right,0px))}
 main{padding-inline:max(1rem,env(safe-area-inset-right,0px)) max(1rem,env(safe-area-inset-left,0px))}
 input,select,textarea{font-size:max(16px,1rem)}
 .xd{padding-inline:.8rem}
}

/* لمس الشاشة: أهداف ضغط مريحة وبدون حركة مفاجئة عند اللمس */
@media(pointer:coarse){
 nav button,.btn,.tabs button,.xgt button,.xd-print,.chip2,.rb{min-height:44px}
 .tabs button{padding:.45rem 1.1rem}
}
@media(hover:none){
 .pc:hover,.drop:hover,.tile:hover,.go:hover,.go.w:hover,#xauth.login .go.w:hover{transform:none}
}

/* موبايل */
@media(max-width:700px){
 table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
 h2{font-size:clamp(1.35rem,6vw,1.8rem)}
 .card{padding:1rem}
 .xr{grid-template-columns:1fr}
}
@media(max-width:480px){
 .gq{font-size:clamp(1.7rem,8vw,2.4rem)}
 .tile.big2 span{font-size:clamp(3rem,20vw,5.4rem)}
 .tl2{gap:.7rem}
 .grp .tl3{grid-template-columns:repeat(2,1fr)}
 .go{width:60px;height:60px;font-size:1.7rem}
 .xd-head{padding:1rem;gap:1rem}
 .xd-head h2{font-size:1.35rem}
 .xd-ring{width:96px;height:96px}
 .xd-ring b{width:74px;height:74px;font-size:1.3rem}
 .ring{width:110px;height:110px}.ring b{width:86px;height:86px;font-size:1.8rem}
 .av.big{width:96px;height:96px;font-size:2.2rem}
 .xd-hl{grid-template-columns:1fr}
 .xeff{grid-template-columns:1fr}
 .acts .btn,.sv .btn{flex:1 1 100%}
 .xgt button{max-width:none}
 .xcal{gap:3px}.xcal span{font-size:.8rem;padding:.35rem 0}
}
@media(max-width:340px){
 .hero h1{font-size:2rem}
 .xd-kpis{grid-template-columns:1fr}
}
@media(max-height:560px) and (orientation:landscape){
 #xauth.login .gs{padding:.4rem 0}
 #xauth.login .gs>.st{padding:.9rem 1.1rem}
}
@media(prefers-reduced-motion:reduce){
 html{scroll-behavior:auto!important}
 *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

/* زر القائمة: يتحول لعلامة إغلاق خارج القائمة المفتوحة بدل ما يغطي الشعار */
@media(max-width:900px){
 #mb{transition:right .25s ease}
 body.open #mb{right:calc(min(86vw,300px) + .6rem + env(safe-area-inset-right,0px));font-size:0}
 body.open #mb::after{content:"\2715";font-size:1.2rem}
}
