/* ===== اتجاه A «عمق سينمائي أحمر»: شاشة أول فتح + حالة أول فتح في المحرر ===== */
#bg-pulses{display:none!important}
.cine-bg{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden;
  background:
   radial-gradient(120% 70% at 80% -10%, rgba(240,32,44,.26), transparent 62%),
   radial-gradient(90% 60% at 15% 5%, rgba(255,120,80,.10), transparent 66%),
   radial-gradient(80% 55% at 50% 112%, rgba(150,20,30,.26), transparent 72%),
   linear-gradient(180deg,#0b0708 0%,#120a0c 46%,#0a0607 100%)}
.cine-halo{position:absolute;width:620px;height:620px;border-radius:50%;top:6%;left:-220px;filter:blur(90px);opacity:.8;
  background:radial-gradient(circle,rgba(240,32,44,.26),transparent 68%);animation:cineDrift 26s ease-in-out infinite alternate}
@keyframes cineDrift{from{transform:translate3d(0,0,0) scale(1)}to{transform:translate3d(64px,46px,0) scale(1.07)}}
.cine-grain{position:absolute;inset:0;opacity:.05;mix-blend-mode:overlay;background-size:180px 180px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.55'/></svg>")}
@media (prefers-reduced-motion:reduce){.cine-halo{animation:none}}

#entry-cine{position:relative;z-index:2;max-width:640px;margin:0 auto;padding:.2rem 0 0}

/* البرومو */
.promo-slot{position:relative;border-radius:18px;overflow:hidden;margin:.3rem 0 1.15rem;border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 50px rgba(0,0,0,.55);aspect-ratio:16/9;max-height:44vh;background:#120a0c}
.promo-slot.vertical{aspect-ratio:9/16;max-height:64vh;width:min(100%,340px);margin-inline:auto}
.promo-video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#000;display:none}
.promo-slot.playing .promo-video{display:block}
.promo-slot.playing .promo-cover{display:none}
.promo-cover{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:flex-end;gap:.1rem;padding:14px;
  background:radial-gradient(80% 120% at 18% 0%,rgba(255,90,70,.30),transparent 62%),linear-gradient(120deg,#2a0b10,#14080b 55%,#25100c)}
.promo-tag{position:absolute;top:12px;inset-inline-start:14px;font-size:.66rem;letter-spacing:.16em;color:#ffb3a6;opacity:.85}
.promo-title{font-size:.98rem;font-weight:800}
.promo-sub{font-size:.72rem;color:#cbb6b1;font-weight:400}
.promo-play{position:absolute;bottom:12px;inset-inline-end:12px;width:44px;height:44px;border-radius:50%;color:#fff;font-size:.9rem;
  background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.22);display:grid;place-items:center;backdrop-filter:blur(6px)}
.promo-skip{position:absolute;top:9px;inset-inline-end:11px;font-size:.7rem;color:#e8d6d2;opacity:.8;
  border-bottom:1px solid rgba(255,255,255,.28);padding-bottom:1px}

/* العنوان */
.cine-eyebrow{position:relative;z-index:2;font-size:.68rem;letter-spacing:.22em;color:#ff8a78;font-weight:800;margin:.9rem .15rem .55rem;text-shadow:0 1px 2px rgba(0,0,0,.6);opacity:1}
.cine-title{font-size:1.72rem;line-height:1.34;font-weight:900;letter-spacing:-.4px}
.cine-title .l1{background:linear-gradient(90deg,#e0574a,#ff2f3f 62%);-webkit-background-clip:text;background-clip:text;color:transparent}
.cine-title .l2{color:#f6f1ee}
.cine-sub{margin-top:.6rem;font-size:.86rem;line-height:1.9;color:#b9a9a5;font-weight:400;max-width:36ch}

/* المدخلان */
.device-entries{display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin-top:1.05rem}
.device-card{position:relative;border-radius:16px;padding:1rem .85rem;text-align:start;min-height:120px;color:inherit;
  background:linear-gradient(160deg,rgba(255,255,255,.07),rgba(255,255,255,.02));border:1px solid rgba(255,255,255,.10);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);transition:transform .08s}
.device-card:active{transform:scale(.985)}
.device-card svg{width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:1.6}
.device-card b{display:block;margin-top:.5rem;font-size:.98rem;font-weight:800}
.device-card span{display:block;margin-top:.15rem;font-size:.7rem;line-height:1.6;opacity:.72;font-weight:400}

/* الخطوات */
.cine-steps{list-style:none;display:grid;gap:.4rem;margin-top:1.05rem}
.cine-steps li{display:flex;gap:.55rem;align-items:baseline;font-size:.78rem;color:#cfc0bc;font-weight:400}
.cine-steps i{font-style:normal;font-size:.62rem;letter-spacing:.12em;color:#e2604f;font-weight:800;min-width:16px}
.cine-links{display:flex;gap:.5rem;margin-top:1rem;flex-wrap:wrap}
.cine-link{font-size:.76rem;color:#e8d6d2;padding:.5rem .85rem;border-radius:999px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.03)}
.cine-note{margin-top:.85rem;font-size:.68rem;color:#8d7d7a;letter-spacing:.02em}
#entry-cine .hero-stats{margin-top:.7rem;font-size:.72rem;color:#9c8c89}

/* الشريط العلوي على الجوال: لا قص ولا تجاوز */
@media (max-width:560px){
  #topbar{flex-wrap:wrap;row-gap:.3rem;max-width:100%}
  .top-actions{flex:1 1 auto;min-width:0;flex-wrap:wrap;justify-content:flex-end;gap:.28rem}
  .brand{flex:0 0 auto}
  #btn-theme{padding:0 .5rem;font-size:.8rem}
  #topbar .btn{padding:.42rem .7rem;font-size:.84rem}
  .cine-title{font-size:1.5rem}
  .cine-sub{font-size:.82rem}
}
@media (max-width:380px){
  .device-card{padding:.85rem .7rem;min-height:112px}
  .device-card span{font-size:.66rem}
  .cine-title{font-size:1.4rem}
}

/* حالة أول فتح في المحرر */
#preview-wrap{position:relative}
.stage-empty{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:safe center;overflow-y:auto;gap:.5rem;padding:1rem;border-radius:18px;
  background:radial-gradient(120% 90% at 50% 0%,rgba(240,32,44,.10),transparent 60%),linear-gradient(180deg,#140a0c,#0b0607)}
.drop-zone{width:min(100%,340px);min-height:132px;border:1.5px dashed rgba(255,255,255,.22);border-radius:14px;padding:.9rem;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.35rem;color:#f6f1ee;background:rgba(255,255,255,.02)}
.drop-zone.over{border-color:var(--primary);background:rgba(240,32,44,.10)}
.drop-zone svg{width:28px;height:28px;stroke:currentColor;fill:none;stroke-width:1.5;opacity:.85}
.drop-zone b{font-size:.95rem}
.drop-zone span{font-size:.7rem;color:#b9a9a5}
.empty-steps{list-style:none;display:grid;gap:.22rem;text-align:center;margin-top:.15rem}
.empty-steps li{font-size:.72rem;color:#cfc0bc}
.empty-export{display:flex;align-items:center;gap:.45rem;margin-top:.3rem;font-size:.66rem;color:#8d7d7a}
.empty-export .btn{opacity:.45;padding:.4rem .9rem;font-size:.76rem}
@media (max-width:420px){
  .stage-empty{padding:.7rem;gap:.4rem}
  .drop-zone{min-height:112px}
  .empty-steps li{font-size:.68rem}
}

/* ===== الخطوط: Tajawal للعربية وIBM Plex Sans للإنكليزية، أرقام ثابتة العرض ===== */
:root{--font-ar:'Tajawal','IBM Plex Sans Arabic',system-ui,sans-serif;--font-en:'IBM Plex Sans','Tajawal',system-ui,sans-serif}
body{font-family:var(--font-ar)}
html[lang="en"] body{font-family:var(--font-en)}
html[lang="en"] .cine-title{letter-spacing:-.2px}
#time-current,#time-total,.tl-clip,.num-inputs input,output,.hero-stats,.empty-export .btn{font-variant-numeric:tabular-nums}

/* لا نص واجهة أصغر من 14px على الجوال */
@media (max-width:560px){
  .cine-eyebrow,.promo-tag,.promo-sub,.cine-note,.cine-steps li,.cine-steps i,.device-card span,.device-card .dev-default{font-size:14px}
  .promo-title,.device-card b,.cine-link,.drop-zone span,.empty-steps li,.empty-export{font-size:15px}
  .cine-sub,.drop-zone b{font-size:16px}
  .cine-title{font-size:1.6rem}
  .hint,.layer-item,.preset-chip,.tab,.panel .hint{font-size:max(14px,1em)}
}

@media (max-width:420px){
  #btn-theme span[data-i18n]{display:none}
  #btn-theme{max-width:120px;overflow:hidden;white-space:nowrap}
}

@media (max-width:560px){
  #topbar{flex-wrap:wrap}
  .top-actions{flex:1 1 auto;min-width:0;flex-wrap:wrap;justify-content:flex-end}
  .top-actions > *{flex:0 0 auto}
}
@media (max-width:420px){
  #btn-theme .theme-sep{display:none}
  #btn-install{display:none!important}
}
@media (max-width:380px){
  #topbar{padding:.4rem .3rem;gap:.22rem}
  .lang-switch .lang-opt{padding:.32rem .45rem;font-size:.78rem}
  #btn-theme{padding:0 .3rem;font-size:.78rem}
}

/* زر التصدير المعطّل */
#btn-export-top.is-disabled{opacity:.45;filter:grayscale(.25)}
@media (max-width:420px){#btn-theme::after{content:'▾';margin-inline-start:.22rem;opacity:.7}}

/* سطح المكتب: تكوين عمودين */
@media (min-width:900px){
  #entry-cine{max-width:1000px;display:grid;grid-template-columns:1.12fr .88fr;column-gap:2.2rem;row-gap:.2rem;align-items:center;padding-top:.8rem}
  .promo-slot{grid-column:1;grid-row:1 / span 8;margin:0;aspect-ratio:16/9;max-height:none;align-self:center}
  .cine-eyebrow,.cine-title,.cine-sub,.device-entries,.cine-steps,.cine-links,.cine-note,#entry-cine .hero-stats{grid-column:2}
  .cine-title{font-size:2.15rem}
  .cine-sub{font-size:.95rem;max-width:34ch}
  .device-card{min-height:112px}
}

/* وضع «كمبيوتر» على شاشة ضيقة: واجهة سطح المكتب داخل تمرير أفقي داخلي، بلا تجاوز للصفحة */
body[data-device="desktop"] #screen-editor{overflow-x:auto}
body[data-device="desktop"] .editor-layout{grid-template-columns:minmax(430px,1fr) 360px;min-width:880px}
body[data-device="desktop"] #preview-wrap{max-height:none}
body[data-device="desktop"] #preview{max-height:52vh}

/* شريط التبويبات على الجوال: سطران بلا قص */
@media (max-width:560px){
  #tools-tabs{flex-wrap:wrap;overflow:visible;row-gap:.25rem}
  #tools-tabs .tab{flex:0 0 auto;font-size:.82rem;padding:.45rem .6rem}
}
/* سبب تعطيل التصدير في سطر مستقل */
.empty-export{flex-direction:column;align-items:flex-start;gap:.3rem;text-align:start}
.empty-why{display:block;line-height:1.6;max-width:34ch}
/* توازن الصف الأول على سطح المكتب */
@media (min-width:900px){
  #entry-cine{max-width:1080px;grid-template-columns:1fr 1fr;column-gap:2.6rem}
  .cine-title{font-size:2.35rem;line-height:1.3}
  .cine-sub{max-width:42ch}
  .cine-eyebrow{margin-bottom:.7rem}
}
.theme-caret{opacity:.65;margin-inline-start:.3rem;font-size:.75em}

/* ===== مبدّل اللغة: ثلاث لغات + أيقونة المزيد ===== */
.lang-switch{position:relative;display:flex;align-items:center;gap:.18rem}
.lang-switch .lang-opt{padding:.38rem .55rem;font-size:.78rem;border-radius:999px;font-family:"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;letter-spacing:0}
.lang-more{width:30px;height:30px;border-radius:50%;border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.04);display:grid;place-items:center;font-size:.8rem;line-height:1;color:#e8d6d2}
.lang-more[aria-expanded="true"]{background:rgba(240,32,44,.18);border-color:rgba(240,32,44,.5)}
.more-langs{position:absolute;top:calc(100% + 8px);inset-inline-end:0;z-index:90;min-width:170px;
  background:#1b1315;border:1px solid rgba(255,255,255,.14);border-radius:12px;padding:.5rem .55rem;
  box-shadow:0 18px 40px rgba(0,0,0,.55)}
.more-langs-empty{font-size:.8rem;color:#b9a9a5;line-height:1.6}
@media (max-width:420px){
  .lang-switch .lang-opt{padding:.32rem .42rem;font-size:.72rem}
  .lang-more{width:26px;height:26px;font-size:.72rem}
}

/* خانة فارغة في الخط الزمني: واضحة أنها خانة لا مقطع رمادي */
.tl-clip.empty{border:1.5px dashed rgba(240,32,44,.55)!important;background:rgba(240,32,44,.06)!important}
.tl-clip.empty .ph{display:flex;align-items:center;justify-content:center;gap:.2rem;min-width:0;overflow:hidden}
.tl-clip.empty .ph-plus{font-weight:800;color:#e2604f;font-size:.95rem;line-height:1}
.tl-clip.empty .ph span:last-child{font-size:.62rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ===== الشريط العلوي: لا قصّ للأزرار على 1280 (الفرنسية أطول) ===== */
#topbar{flex-wrap:wrap;row-gap:.35rem}
#topbar .top-actions{flex:0 1 auto;min-width:0;flex-wrap:wrap;justify-content:flex-end;row-gap:.3rem}
#topbar .top-actions > *{flex:0 0 auto}
#topbar .btn,#topbar .icon-btn,#topbar .brand{white-space:nowrap}
/* زر التثبيت يحمل نصا لا أيقونة: عرض تلقائي بدل 38px */
#btn-install{width:auto;min-width:38px;padding:0 .62rem;font-size:.85rem;font-weight:700;white-space:nowrap}
@media (min-width:561px) and (max-width:1440px){
  #topbar{padding:.5rem .7rem;gap:.45rem}
  #topbar .top-actions{gap:.32rem}
  .lang-switch .lang-opt{padding:.3rem .44rem;font-size:.75rem}
  #btn-more-langs{width:28px;height:28px}
  #btn-theme{max-width:152px;font-size:.78rem;padding:0 .6rem}
  #topbar .btn{padding:.42rem .65rem;font-size:.82rem}
  #btn-install{height:32px;min-width:32px;font-size:.78rem;padding:0 .5rem}
}
html{overflow-x:hidden}

/* ===== شريط التبويبات: التفاف بدل قصّ (من 561px وما فوق) ===== */
@media (min-width:561px){
  #tools-tabs{flex-wrap:wrap;overflow:visible;row-gap:.25rem}
  #tools-tabs .tab{flex:1 1 auto;white-space:nowrap}
}

/* ===== الجوال: لا نص واجهة أصغر من 14px ===== */
@media (max-width:560px){
  #topbar .brand b{font-size:.9rem}
  .lang-switch .lang-opt{font-size:.9rem;padding:.34rem .44rem}
  #btn-more-langs{font-size:.9rem;width:28px;height:28px}
  #theme-label{font-size:.9rem}
  .theme-caret{font-size:.7rem}
  #btn-export-top{font-size:.9rem!important;padding:.42rem .55rem}
  #time-current,#time-total{font-size:.9rem}
  #tools-tabs .tab{font-size:.9rem;padding:.4rem .5rem}
  #screen-editor .btn{font-size:.9rem}
  #screen-editor .panel-title,#screen-editor .field-label,#screen-editor small{font-size:.9rem}
}
@media (max-width:400px){
  .lang-switch .lang-opt{font-size:.9rem;padding:.3rem .36rem}
  #theme-label{font-size:.9rem}
  #tools-tabs .tab{font-size:.9rem;padding:.38rem .42rem}
}

/* ===== شريط أدوات واحد أسفلي: خمسة عناصر في صف واحد دائما ===== */
#tools-tabs{flex-wrap:nowrap!important;overflow:visible!important;gap:.15rem;padding:.15rem}
#tools-tabs .tab{flex:1 1 0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;padding:.5rem .25rem;font-size:.82rem}
#tools-tabs .tab-more-item{display:none!important}
#more-menu{position:fixed;inset-inline:8px;bottom:calc(env(safe-area-inset-bottom,0px) + 8px);z-index:9000;background:var(--card,#200d11);border:1px solid var(--line,#3a3a41);border-radius:14px;padding:.4rem;display:grid;gap:.25rem;box-shadow:0 18px 40px rgba(0,0,0,.55)}
#more-menu.hidden{display:none!important}
#more-menu .more-item{padding:.75rem .85rem;border-radius:10px;text-align:center;font-size:.95rem;font-weight:700;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08)}
#more-menu .more-item:active{transform:scale(.98)}

/* لوحة الاستوديو التلقائي */
.studio-grid{display:grid;gap:.45rem;margin-top:.2rem}
.studio-card{display:grid;gap:.15rem;text-align:right;padding:.75rem .85rem;border-radius:12px;border:1px solid rgba(255,255,255,.12);background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.02));color:inherit}
.studio-card b{font-size:.98rem;font-weight:800}
.studio-card span{font-size:.8rem;color:var(--muted,#a79ea2)}
.studio-card:active{transform:scale(.985)}

/* زر التشغيل لا يغطي منتصف الكادر ولا يحجب النص */
#preview-wrap .play-btn{width:46px;height:46px;font-size:1rem;inset:auto auto 10px 10px;margin:0;opacity:.85}
#preview-wrap .play-btn:hover{opacity:1}

/* إطار تحديد العنصر على المعاينة ومقابض الزوايا */
#preview-wrap{overflow:hidden}
#sel-box{position:absolute;border:1.5px solid #e8452c;border-radius:10px;pointer-events:none;z-index:6;box-shadow:0 0 0 1px rgba(255,255,255,.4) inset,0 0 14px rgba(232,69,44,.35)}
#sel-box.hidden{display:none}
.sel-h{position:absolute;width:22px;height:22px;border-radius:50%;background:#fff;border:2px solid #e8452c;pointer-events:auto;touch-action:none;box-shadow:0 2px 8px rgba(0,0,0,.35)}
.sel-h.tl{left:-11px;top:-11px}.sel-h.tr{right:-11px;top:-11px}.sel-h.bl{left:-11px;bottom:-11px}.sel-h.br{right:-11px;bottom:-11px}

/* مسار النصوص أسفل الخط الزمني */
#tl-texts{position:relative;height:30px;margin-top:6px;border-radius:8px;background:rgba(255,255,255,.05)}
#tl-texts.hidden{display:none}
.tl-txt{position:absolute;top:3px;height:24px;border-radius:6px;background:rgba(232,69,44,.22);border:1px solid rgba(232,69,44,.65);color:#fff;font-size:11px;display:flex;align-items:center;padding:0 10px;overflow:hidden;touch-action:none}
.tl-txt.active{background:rgba(232,69,44,.45);border-color:#fff}
.tt-lbl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.tt-h{position:absolute;top:0;bottom:0;width:12px;background:rgba(255,255,255,.75);border-radius:4px;touch-action:none;cursor:ew-resize}
.tt-in{left:-2px}.tt-out{right:-2px}

/* عدّاد الزمن: اتجاه ثابت (الحالي يسارا، الكلي يمينا) ليطابق اتجاه شريط التنقل */
.time-row{direction:ltr}

/* الشريط الزمني: طبقة المؤشر وأزرار سريعة */
#tl-wrap{position:relative}
#tl-head{position:absolute;top:-2px;bottom:-2px;width:2px;background:#e8452c;box-shadow:0 0 8px rgba(232,69,44,.8);pointer-events:none;z-index:5;border-radius:2px}
#tl-head::before{content:'';position:absolute;top:-4px;left:-4px;width:10px;height:10px;border-radius:50%;background:#e8452c}
#tl-actions{display:flex;align-items:center;gap:10px;margin-top:10px}
#tl-actions .btn{flex:0 0 auto;padding:.55rem 1rem;font-size:.85rem}
#tl-actions .tl-hint{font-size:.72rem;opacity:.6}

/* الجوال: لا خروج أفقي، وشريط زمني يقبل السحب بالإصبع */
html,body{max-width:100%;overflow-x:hidden}
@media (max-width:900px){
  .editor-layout{grid-template-columns:minmax(0,1fr)}
  .preview-col{max-width:100vw;overflow:hidden}
  #preview-wrap{width:100%;max-width:100%}
  #tl-actions{gap:6px}
  #tl-actions .tl-hint{display:none}
  #timeline{touch-action:pan-y}
  #tl-texts{touch-action:pan-y}
}

/* الجوال: لا يُترك تخطيط المكتب (880px) عندما يكون العرض ضيقا حتى لو كانت سمة الجهاز desktop */
@media (max-width:900px){
  body[data-device="desktop"] .editor-layout{grid-template-columns:minmax(0,1fr);min-width:0}
  body[data-device="desktop"] #preview-wrap{max-height:46vh}
  body[data-device="desktop"] #preview{max-height:46vh}
  .editor-layout,.preview-col,.panel-col{min-width:0;max-width:100%}
  .panel-col{width:100%}
}

/* الهالة الزخرفية لا تتجاوز عرض الشاشة على الجوال */
@media (max-width:900px){
  .cine-halo{left:0;right:auto;width:100vw;max-width:100vw}
}

/* السلوغان: Tajawal ثقيل، أكبر، تباين عالٍ */
.cine-title{font-family:'Tajawal','Cairo',system-ui,sans-serif;font-weight:800;font-size:2.2rem;line-height:1.22;letter-spacing:0}
.cine-title .l1{background:none;-webkit-background-clip:border-box;-webkit-text-fill-color:#F8F4F1;color:#F8F4F1;font-weight:800}
.cine-title .l2{color:#FF6A5E;-webkit-text-fill-color:#FF6A5E;font-weight:800}
@media (max-width:560px){.cine-title{font-size:1.98rem}}
@media (max-width:380px){.cine-title{font-size:1.74rem}}

/* مقابض قص بهدف لمس 32px مع بقاء الشريط المرئي 10px */
.trim-h{width:min(32px,30%);background:transparent;opacity:1}
.trim-h::before{content:'';position:absolute;top:0;bottom:0;width:10px;background:rgba(14,165,233,.55);opacity:.75;border-radius:4px}
.trim-h-in{inset-inline-start:0;border-inline-end:0}
.trim-h-in::before{inset-inline-start:0;border-inline-end:2px solid #fff}
.trim-h-out{inset-inline-end:0;border-inline-start:0}
.trim-h-out::before{inset-inline-end:0;border-inline-start:2px solid #fff}
.trim-h:hover::before,.trim-h:active::before{opacity:1;background:rgba(14,165,233,.95)}

/* تكبير الشريط الزمني بالقرص */
#timeline{--tlzoom:1}
.tl-clip{width:calc(76px * var(--tlzoom,1))}
.tl-add{width:calc(56px * var(--tlzoom,1))}

/* المسار الثاني: طبقات الفيديو/الصورة فوق المقطع الأساسي */
#tl-track2{position:relative;height:30px;margin:6px 16px 0;border-radius:8px;
  background:rgba(20,184,166,.07);border:1px dashed rgba(20,184,166,.35);touch-action:pan-y;overflow:hidden}
#tl-track2.hidden{display:none}
.ov-chip{position:absolute;top:3px;height:24px;border-radius:6px;background:rgba(20,184,166,.3);
  border:1px solid rgba(20,184,166,.8);color:#fff;font-size:11px;display:flex;align-items:center;
  padding:0 14px;overflow:hidden;touch-action:none;box-sizing:border-box}
.ov-chip.active{background:rgba(20,184,166,.6);border-color:#fff;box-shadow:0 0 0 1px rgba(255,255,255,.4)}
.ov-lbl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.ov-h{position:absolute;top:0;bottom:0;width:16px;background:rgba(255,255,255,.82);border-radius:4px;touch-action:none;cursor:ew-resize;z-index:2}
.ov-h-in{inset-inline-start:0}
.ov-h-out{inset-inline-end:0}
@media (max-width:900px){#tl-track2{margin:6px 12px 0}}

/* مواضع وأحجام جاهزة لطبقة المسار الثاني */
.ov-presets{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;margin:.45rem 0 .2rem}
.ov-presets button{padding:.5rem .3rem;border-radius:8px;font-size:12px;line-height:1.2;
  background:rgba(20,184,166,.16);border:1px solid rgba(20,184,166,.5);color:#fff;min-height:40px}
.ov-presets button:active{background:rgba(20,184,166,.45)}
body[data-theme="classic"] .ov-presets button{color:#123;background:#eefaf7;border-color:#bfe6df}

/* شاشة التصدير: شبكة ترسم نفسها بلون الواجهة الحالية */
#export-stage{position:relative;border-radius:14px;overflow:hidden;margin:0 0 .7rem;
  background:radial-gradient(120% 90% at 50% 0%,rgba(232,69,44,.16),rgba(10,10,14,.9) 70%);}
#export-grid{display:block;width:100%;height:auto}
#export-pct{position:absolute;inset-inline-start:0;inset-inline-end:0;top:50%;transform:translateY(-50%);
  text-align:center;font-weight:800;font-size:2.1rem;letter-spacing:.5px;color:#fff;
  text-shadow:0 2px 14px rgba(0,0,0,.6)}
body[data-theme="classic"] #export-stage{background:radial-gradient(120% 90% at 50% 0%,rgba(20,120,90,.12),#fffdf7 72%)}
body[data-theme="classic"] #export-pct{color:#123}

/* الشاشة الفارغة على الجوال: لا يُقص العنكبوت من الأعلى حين يضيق الكادر */
@media (max-height:780px){.mascot-empty{width:74px;margin-bottom:.3rem}.stage-empty{gap:.4rem;padding:.7rem}}
@media (max-height:660px){.mascot-empty{width:56px;margin-bottom:.2rem}.stage-empty{gap:.3rem;padding:.5rem}}

/* خيارات صغيرة سريعة تحت الفيديو الترويجي بدل بطاقتي جوال/كمبيوتر */
.quick-entries{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;margin-top:1rem}
.q-entry{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.35rem;
  padding:.7rem .4rem;border-radius:14px;border:1px solid var(--line);background:var(--card);color:inherit;
  font-family:inherit;cursor:pointer;transition:transform .12s ease,border-color .12s ease}
.q-entry:active{transform:scale(.97);border-color:var(--primary)}
.q-entry svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.q-entry b{font-size:.8rem;font-weight:800}
@media (max-height:700px){.q-entry{padding:.55rem .3rem}.q-entry b{font-size:.75rem}.q-entry svg{width:19px;height:19px}}

/* العنكبوت لا يتداخل مع شريط «لديك مشروع محفوظ» */

/* عرض شرائح الرئيسية: خفيف بالكامل (CSS فقط، بلا صور ولا فيديو ولا طلبات شبكة) */
.hero-slides{position:relative;height:150px;margin:.2rem 0 1rem;border-radius:18px;overflow:hidden;
  border:1px solid var(--line);background:#0b0507;isolation:isolate}
.hs-slide{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.55rem;
  padding:1rem;border:0;background:transparent;color:#fff;font-family:inherit;cursor:pointer;opacity:0;
  animation:hsCycle 20s infinite;animation-delay:var(--d,0s)}
.hs-slide:nth-of-type(1){--d:0s}
.hs-slide:nth-of-type(2){--d:4s}
.hs-slide:nth-of-type(3){--d:8s}
.hs-slide:nth-of-type(4){--d:12s}
.hs-slide:nth-of-type(5){--d:16s}
.hs-slide::before{content:'';position:absolute;inset:0;z-index:-1;
  background-image:
    radial-gradient(78% 92% at 50% 54%,rgba(8,3,5,.58) 0%,rgba(14,4,7,.42) 48%,rgba(26,5,9,.18) 78%,rgba(34,6,10,.04) 100%),
    linear-gradient(165deg,rgba(122,10,16,.30),rgba(9,3,5,.22)),
    var(--img,none);
  background-size:cover,cover,cover;background-position:center;
  filter:saturate(.9) brightness(.97)}
.hs-slide::after{content:'';position:absolute;left:0;right:0;top:50%;height:118px;margin-top:-59px;z-index:-1;pointer-events:none;
  background:radial-gradient(86% 100% at 50% 50%,rgba(5,2,3,.965) 0%,rgba(5,2,3,.93) 38%,rgba(6,2,4,.62) 66%,rgba(6,2,4,.18) 86%,rgba(6,2,4,0) 100%)}
.hs-slide:nth-of-type(1){--img:url('../img/hero/hs1.jpg')}
.hs-slide:nth-of-type(2){--img:url('../img/hero/hs2.jpg')}
.hs-slide:nth-of-type(3){--img:url('../img/hero/hs3.jpg')}
.hs-slide:nth-of-type(3){justify-content:flex-end;padding-bottom:12px;gap:.3rem}
.hs-slide:nth-of-type(3)::after{top:auto;bottom:0;height:66px;margin-top:0;background:linear-gradient(to top,rgba(5,2,3,.96) 0%,rgba(5,2,3,.88) 55%,rgba(6,2,4,0) 100%)}

.hs-slide:nth-of-type(4){--img:url('../img/hero/hs4.jpg')}
.hs-slide:nth-of-type(5){--img:url('../img/hero/hs5.jpg')}
.hs-ico{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;
  background:rgba(0,0,0,.28);border:1px solid rgba(255,255,255,.14)}
.hs-ico svg{width:22px;height:22px;stroke:#fff;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.hs-txt{font-size:.95rem;font-weight:800;text-align:center;line-height:1.5;max-width:16rem;text-shadow:0 1px 3px rgba(0,0,0,.55)}
.hs-dots{position:absolute;bottom:9px;left:0;right:0;display:flex;justify-content:center;gap:5px}
.hs-dots i{width:5px;height:5px;border-radius:50%;background:rgba(255,255,255,.28)}
@keyframes hsCycle{
  0%{opacity:0}
  5%{opacity:1}
  18%{opacity:1}
  22%{opacity:0}
  100%{opacity:0}
}
@keyframes hsDrift{from{transform:translate3d(-3%,-2%,0) scale(1)}to{transform:translate3d(3%,2%,0) scale(1.08)}}
@media (prefers-reduced-motion: reduce){
  .hs-slide{animation:none;opacity:0}
  .hs-slide:nth-of-type(1){opacity:1}
  .hs-slide::before{animation:none}
}
@media (max-height:700px){.hero-slides{height:132px}.hs-txt{font-size:.9rem}}

/* ===== خلفية الواجهة: صور مموّهة تتبدّل بنعومة + نبض خافت + عروق شبكية ===== */
.hero-bg{position:absolute;inset:-10% -8% -22%;z-index:-1;overflow:hidden;pointer-events:none;border-radius:24px;
  -webkit-mask-image:linear-gradient(180deg,transparent 0%,#000 12%,#000 68%,rgba(0,0,0,.45) 88%,transparent 100%);
  mask-image:linear-gradient(180deg,transparent 0%,#000 12%,#000 68%,rgba(0,0,0,.45) 88%,transparent 100%)}
.hero-bg .hb{position:absolute;inset:-16%;background-size:cover;background-position:center;opacity:0;
  filter:blur(34px) saturate(.5) brightness(.5);will-change:opacity;
  animation:hbCycle 32s ease-in-out infinite}
.hero-bg .l1{background-image:url('../img/hero/hs2.jpg')}
.hero-bg .l2{background-image:url('../img/hero/hs5.jpg');animation-delay:8s}
.hero-bg .l3{background-image:url('../img/hero/hs1.jpg');animation-delay:16s}
.hero-bg .l4{background-image:url('../img/hero/hs3.jpg');animation-delay:24s}
@keyframes hbCycle{0%{opacity:0}10%{opacity:.9}25%{opacity:.9}35%{opacity:0}100%{opacity:0}}

.hero-bg::after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(10,5,6,.52),rgba(12,4,6,.70));pointer-events:none;z-index:1}
.hero-bg .hb-pulse{position:absolute;inset:-10%;z-index:1;background:radial-gradient(60% 55% at 50% 42%,rgba(194,14,23,.28),rgba(107,4,8,.10) 45%,transparent 72%);
  animation:hbPulse 7.5s ease-in-out infinite}
@keyframes hbPulse{0%,100%{opacity:.45}50%{opacity:.85}}
.hero-bg .hb-veins{display:none}

@media (prefers-reduced-motion: reduce){
  .hero-bg .hb{animation:none;opacity:.35}.hero-bg .hb.l2,.hero-bg .hb.l3,.hero-bg .hb.l4{opacity:0}
  .hero-bg .hb-pulse{animation:none}.hero-bg .hb-veins{animation:none;stroke-dasharray:none}
}
body.calm .hero-bg .hb{filter:blur(30px) saturate(.6) brightness(.30)}
body.calm .hero-bg .hb-pulse{opacity:.25!important}
@media (max-width:759px){
  .hero-bg .hb{filter:blur(28px) saturate(.62) brightness(.86)}
  .hero-bg::after{background:linear-gradient(180deg,rgba(10,5,6,.40),rgba(12,4,6,.58))}
}
