/* ═══════════ ShotBank Treatment Studio — v24 (عوالم المخرجين: زخارف وتكوين وألوان متناغمة) ═══════════ */

/* ── الصفحة الأم ── */
.tst-wrap { max-width: 1180px; margin: 0 auto; padding: 26px 26px 110px; }
.tst-new { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; margin-bottom: 30px; }
.tst-new h2 { margin: 0 0 6px; font-size: 22px; }
.tst-new .hint { color: var(--dim); font-size: 13px; margin-bottom: 16px; }
#ideaBox { width: 100%; min-height: 110px; resize: vertical; background: var(--bg); color: var(--text);
  border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; font-size: 14px; line-height: 1.7; font-family: inherit; }
#ideaBox:focus { outline: none; border-color: var(--amber); }

.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.style-card { cursor: pointer; border: 1px solid var(--line); border-radius: 10px; padding: 14px 12px 10px; text-align: center;
  background: var(--panel2); transition: transform .15s, border-color .15s; position: relative; overflow: hidden; }
.style-card:hover { transform: translateY(-2px); }
.style-card.on { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.style-card .aa { font-size: 30px; line-height: 1.15; display: block; margin-bottom: 8px; min-height: 38px; }
.style-card .nm { font-family: ui-monospace, Menlo, monospace; font-size: 10px; letter-spacing: 2px; color: var(--dim); text-transform: uppercase; }
.style-card.on .nm { color: var(--amber); }

.tst-go { display: flex; align-items: center; gap: 14px; }
.tst-cost { color: var(--dim); font-size: 11.5px; }

.tst-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tst-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; cursor: pointer; position: relative; }
.tst-item:hover { border-color: rgba(255,178,36,0.5); }
.tst-item h3 { margin: 0 0 4px; font-size: 16px; }
.tst-item .meta { color: var(--dim); font-size: 11.5px; font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; }
.tst-item .del { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--dim); cursor: pointer; font-size: 14px; }
.tst-item .del:hover { color: var(--red); }
.st-chip { display: inline-block; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--dim); margin-top: 10px; font-family: ui-monospace, Menlo, monospace; }
.st-chip.ready { color: #8fd8a0; border-color: rgba(111,208,134,0.4); }
.st-chip.working, .st-chip.pending { color: var(--amber); border-color: rgba(255,178,36,0.4); }
.st-chip.error { color: var(--red); border-color: rgba(229,72,77,0.4); }

/* شاشة الانتظار */
.tst-wait { text-align: center; padding: 110px 20px; }
.tst-wait .spin { width: 46px; height: 46px; border: 2px solid var(--line); border-top-color: var(--amber);
  border-radius: 50%; margin: 0 auto 22px; animation: tspin 0.9s linear infinite; }
@keyframes tspin { to { transform: rotate(360deg); } }
.tst-wait h2 { font-size: 22px; margin: 0 0 8px; }
.tst-wait p { color: var(--dim); font-size: 13px; }

.savestate { font-size: 11px; color: var(--dim); font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; min-width: 64px; text-align: center; }

/* ═══════════ محرر زي كي نوت — تريتمنت فول سكرين + إنسبكتور ═══════════ */
/* لما الصفحة فيها المحرر، خلّي الماين ياخد الشاشة كلها من غير حدود العرض */
.tst-wrap:has(.kn-editor) { max-width: none; margin: 0; padding: 0; }
.kn-top { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: rgba(20,19,16,0.96); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.kn-top .grow { flex: 1; }
.kn-title { font-size: 14px; font-weight: 600; letter-spacing: .3px; color: var(--text); max-width: 40vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kn-top .tst-back { padding: 6px 12px; }

/* 3 أعمدة: شريط سلايدات · الاستيدج · الإنسبكتور — بيملى ارتفاع الشاشة تحت الهيدر */
.kn-editor { display: grid; grid-template-columns: 200px 1fr 288px; height: calc(100vh - 52px - 55px); min-height: 480px; }

/* شريط السلايدات (يسار) */
.kn-nav { overflow-y: auto; border-right: 1px solid var(--line); background: var(--panel); padding: 12px 10px; }
.kn-nav::-webkit-scrollbar { width: 6px; } .kn-nav::-webkit-scrollbar-thumb { background: rgba(127,127,127,0.3); border-radius: 3px; }
.kn-nav-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  font-size: 12px; color: var(--dim); transition: background .12s, color .12s; }
.kn-nav-item:hover { background: var(--panel2); color: var(--text); }
.kn-nav-item.on { background: rgba(255,178,36,0.12); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(255,178,36,0.35); }
.kn-nav-item.hid { opacity: 0.42; }
.kn-nav-n { font-family: ui-monospace, Menlo, monospace; font-size: 10px; min-width: 20px; letter-spacing: 1px; }
.kn-nav-lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* الاستيدج — السلايد الحالي كبير في النص */
.kn-stage { display: flex; align-items: safe center; justify-content: center; overflow: auto; padding: 26px; background: var(--bg);
  background-image: radial-gradient(circle at 50% 0, rgba(255,255,255,0.03), transparent 60%); }
.kn-canvas { display: block; width: min(100%, calc((100vh - 175px) * 16 / 9)); }
.kn-canvas .slide { display: none !important; }
.kn-canvas .slide.kn-current { display: flex !important; }
/* المحرر بنفس مقاس Present بالظبط (16:9) — اللي تشوفه = اللي يطلع (WYSIWYG).
   لو الكلام مايكفيش، تصغّره أو توسّع البوكس من اليمين — بدل ما يبان في المحرر ويتقص في العرض. */
/* تحرير النص جوه السلايد + اختيار الخلفية */
.ed-text { white-space: pre-wrap; }
.ed-text.editing { cursor: text; outline: 2px solid var(--amber); outline-offset: 4px; background: rgba(0,0,0,0.14); }
.slide-bg.ed-sel { outline: 3px solid var(--amber); outline-offset: -3px; }
/* نقط تحجيم البوكس (زي كي نوت) */
.ed-h { position: absolute; width: 11px; height: 11px; background: #fff; border: 1.5px solid var(--amber);
  border-radius: 2px; z-index: 30; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.ed-h-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.ed-h-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.ed-h-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.ed-h-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.ed-h-n { top: -6px; left: 50%; margin-left: -5.5px; cursor: ns-resize; }
.ed-h-s { bottom: -6px; left: 50%; margin-left: -5.5px; cursor: ns-resize; }
.ed-h-e { right: -6px; top: 50%; margin-top: -5.5px; cursor: ew-resize; }
.ed-h-w { left: -6px; top: 50%; margin-top: -5.5px; cursor: ew-resize; }
/* أزرار الستايل (B I U S / المحاذاة / الحجم) — شكل كي نوت */
.ins-fontrow { margin-top: 8px; gap: 8px; align-items: center; }
.ins-bius { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ins-bius .ins-tg { border: none; border-right: 1px solid var(--line); border-radius: 0; min-width: 34px; }
.ins-bius .ins-tg:last-child { border-right: none; }
.ins-align { display: flex; }
.ins-align .ins-tg { flex: 1; }
.ins-tg { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: 13px; cursor: pointer; transition: background .12s, color .12s; }
.ins-tg:hover { border-color: var(--amber); }
.ins-tg.on { background: var(--amber); color: #1a1408; border-color: var(--amber); font-weight: 700; }
.ins-stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-left: auto; }
.ins-stepper .ins-tg { border: none; border-radius: 0; }
.ins-sz { font-size: 11px; color: var(--dim); min-width: 40px; text-align: center; font-family: ui-monospace, Menlo, monospace; }

/* الإنسبكتور (يمين) */
.kn-inspector { overflow-y: auto; border-left: 1px solid var(--line); background: var(--panel); padding: 4px 0 40px; }
.kn-inspector::-webkit-scrollbar { width: 6px; } .kn-inspector::-webkit-scrollbar-thumb { background: rgba(127,127,127,0.3); border-radius: 3px; }
.ins-sec { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ins-sec.ins-dim { opacity: 0.55; }
.ins-h { font-family: ui-monospace, Menlo, monospace; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--dim); margin-bottom: 10px; }
/* بانلات بتتقفل وتتفتح بسهم */
.ins-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; gap: 8px; }
.ins-head:hover { color: var(--text); }
.ins-caret { transition: transform .15s; font-size: 11px; }
.ins-sec.collapsed .ins-caret { transform: rotate(-90deg); }
.ins-sec.collapsed .ins-body { display: none; }
.ins-sec.collapsed .ins-h { margin-bottom: 0; }
.ins-color { width: 46px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); cursor: pointer; }
/* أزرار الأيقونات الصغيرة فوق (تراجع/إعادة) */
.knico { min-width: 34px; padding: 6px 9px; font-size: 15px; }
.knico:disabled { opacity: 0.35; cursor: default; }
.ins-lbl { font-size: 11px; color: var(--dim); margin: 12px 0 5px; }
.ins-lbl b { color: var(--text); font-weight: 600; }
.ins-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ins-field { width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 9px; font-size: 12px; }
.ins-btn { flex: 1; min-width: 54px; background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 9px; font-size: 12px; cursor: pointer; transition: border-color .12s, background .12s; }
.ins-btn:hover { border-color: var(--amber); }
.ins-btn.ins-wide { width: 100%; flex: none; margin-top: 8px; }
.ins-btn.ins-del { color: var(--red); border-color: rgba(229,72,77,0.35); }
.ins-btn.ins-del:hover { background: rgba(229,72,77,0.1); border-color: var(--red); }
.ins-range { width: 100%; accent-color: var(--amber); }
/* سواتش الثيمات */
.ins-themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ins-th { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; color: var(--dim);
  font-size: 9.5px; letter-spacing: .5px; text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; transition: border-color .12s; }
.ins-th:hover { border-color: rgba(255,178,36,0.5); }
.ins-th.on { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); color: var(--text); }
/* تايلز العوالم الستة — معاينة حيّة عشان تختار الديزاين بالعين */
.ins-worlds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.ins-w { display: flex; flex-direction: column; gap: 5px; padding: 5px; cursor: pointer; overflow: hidden;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; transition: border-color .12s, box-shadow .12s; }
.ins-w:hover { border-color: rgba(255,178,36,0.5); transform: translateY(-1px); }
.ins-w.on { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.ins-w .w-prev { border-radius: 5px; }
.ins-w-nm { font-size: 10px; font-weight: 600; color: var(--text); text-align: center; }
.ins-w.on .ins-w-nm { color: var(--amber); }
/* شبكة اختيار الخلفية */
.ins-bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; max-height: 210px; overflow-y: auto; }
.ins-bg-grid img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; cursor: pointer;
  border: 2px solid transparent; }
.ins-bg-grid img:hover { border-color: rgba(255,178,36,0.6); }
.ins-bg-grid img.on { border-color: var(--amber); }

/* الطباعة والعرض: رجّع الديك عمود كامل عشان الـPDF والبريزنت */
@media print {
  .kn-top, .kn-nav, .kn-inspector { display: none !important; }
  .kn-editor { display: block; height: auto; }
  .kn-stage { display: block; padding: 0; }
  .kn-canvas { width: 100%; }
  .kn-canvas .slide { display: flex !important; page-break-after: always; }
}

/* ═══════════ الديك — كل السلايدات مقاس سينما موحد 16:9 ═══════════ */
.deck { display: flex; flex-direction: column; gap: 26px; }
.slide { position: relative; border-radius: 6px; overflow: hidden; padding: 4% 5%;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  background: var(--t-bg); color: var(--t-ink); font-family: var(--t-body);
  display: flex; flex-direction: column; justify-content: center; box-shadow: 0 8px 30px rgba(0,0,0,0.35); }
.slide[hidden] { display: none; }
/* غلاف محتوى السلايد: لو المحتوى أكبر من الفريم بيصغّر نفسه أوتوماتيك (auto-fit) —
   فمفيش كلام يطير بره الـ16:9، كله يدخل جوه الفريم بالظبط (زي كي نوت) */
.slide-fit { width: 100%; display: flex; flex-direction: column;
  justify-content: inherit; align-items: inherit; transform-origin: center top; }

/* العنوان السينمائي الكبير لكل سلايد كلام */
.slide-head { font-family: var(--t-display); font-size: calc(5.6cqi * var(--fmul-t, 1)); line-height: 1.02;
  margin: 0 0 18px; font-weight: var(--t-dweight); text-transform: uppercase; letter-spacing: var(--t-tspacing);
  text-shadow: 0 2px 24px color-mix(in srgb, var(--t-bg) 65%, transparent); }
.s-kicker { font-family: var(--t-mono); font-size: max(8px, 1cqi); letter-spacing: 4px; text-transform: uppercase; color: var(--t-accent); margin-bottom: 16px; }
.s-title { font-family: var(--t-display); font-size: calc(3.4cqi * var(--fmul-t, 1)); line-height: 1.12; margin: 0 0 20px; font-weight: var(--t-dweight); text-transform: var(--t-ttransform); letter-spacing: var(--t-tspacing); }
.s-text { font-size: calc(1.62cqi * var(--fmul-b, 1)); line-height: 1.85; max-width: 52%; white-space: pre-wrap; }

/* الريفرنسات السياقية جوه سلايد الكلام — يمين تحت */
.srefs { position: absolute; right: 5%; top: 50%; transform: translateY(-50%); width: 38%; max-width: 460px; z-index: 2; }
.sref-lbl { font-family: var(--t-mono); font-size: 9.5px; letter-spacing: 3px; color: var(--t-accent);
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.sref-re { background: none; border: 1px solid var(--t-accent); color: var(--t-accent); border-radius: 50%;
  width: 22px; height: 22px; cursor: pointer; font-size: 11px; line-height: 1; }
.sref-row { display: flex; flex-direction: column; gap: 12px; }
.sref-clip { width: 100%; aspect-ratio: 16/9; border-radius: 11px; overflow: hidden; cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.5); }
.sref-clip video { width: 100%; height: 100%; object-fit: cover; display: block; filter: var(--t-imgfilter, none); }
.sref-film { display: block; border-radius: 12px; overflow: hidden; position: relative; text-decoration: none;
  color: inherit; box-shadow: 0 10px 28px rgba(0,0,0,0.5); }
.sref-film video { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; filter: var(--t-imgfilter, none); }
.sref-film-t { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85)); color: #fff; }
.sref-film-t b { display: block; font-size: 13px; }
.sref-film-t i { font-size: 10.5px; opacity: 0.8; font-style: normal; }
.sref-audio { display: flex; gap: 10px; background: color-mix(in srgb, var(--t-bg) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--t-accent) 35%, transparent); border-radius: 12px; padding: 10px;
  backdrop-filter: blur(6px); }
.sref-audio video { width: 92px; aspect-ratio: 16/9; object-fit: cover; border-radius: 7px; }
.sref-audio-i { flex: 1; min-width: 0; }
.sref-audio-i b { font-size: 12px; display: block; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sref-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.sref-tags span { font-family: var(--t-mono); font-size: 8.5px; letter-spacing: 1px; text-transform: uppercase;
  border: 1px solid var(--t-accent); color: var(--t-accent); border-radius: 999px; padding: 2px 7px; }
.sref-audio-i audio { width: 100%; height: 30px; }

/* صينية نتايج البحث جوه المشهد */
.stray { position: relative; z-index: 3; margin-top: 12px; background: color-mix(in srgb, var(--t-bg) 72%, transparent);
  border: 1px dashed var(--t-accent); border-radius: 12px; padding: 12px; backdrop-filter: blur(6px); }
.stray-head { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 10px; }
.stray-head .grow { flex: 1; }
.stray-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stray-it { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; }
.stray-it video { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-add { position: absolute; bottom: 5px; left: 5px; right: 5px; border: none; border-radius: 7px;
  background: rgba(10,10,10,0.75); color: #fff; font-size: 10.5px; padding: 4px; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.stray-it:hover .st-add { opacity: 1; }
.st-add:hover { background: var(--t-accent); color: var(--t-bg); }
.stray-empty { font-size: 12px; opacity: 0.7; grid-column: 1/-1; }
.ref.dragover { outline: 2px dashed var(--t-accent); outline-offset: 2px; }
.s-text:focus, [contenteditable]:focus { outline: 1px dashed var(--t-accent); outline-offset: 6px; }

/* أدوات السلايد (تحرير فقط — بتختفي في العرض والتصدير) */
.s-tools { position: absolute; top: 12px; right: 14px; display: flex; gap: 5px; opacity: 0; transition: opacity .15s; }
.slide:hover .s-tools { opacity: 1; }
.s-tools button { background: rgba(0,0,0,0.4); color: #fff; border: none; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: 12px; }
.deck.light-ink .s-tools button { background: rgba(0,0,0,0.55); }

/* اختيارات الصياغة A/B/C */
.opt-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.opt-tabs button { font-family: var(--t-mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
  background: transparent; color: var(--t-ink); opacity: 0.45; border: 1px solid currentColor; border-radius: 999px; padding: 5px 13px; }
.opt-tabs button.on { opacity: 1; color: var(--t-accent); }

/* خلفية السلايد = شوت من مكتبتك، متعتّم بتدرّج لون الثيم عشان الكلام يفضل واضح */
.slide-bg { position: absolute; inset: 0; z-index: 0; }
.slide-bg img, .slide-bg video { width: 100%; height: 100%; object-fit: cover; display: block; filter: var(--t-imgfilter, none); }
.slide-bg video { position: absolute; inset: 0; }
.slide-bg::after { content: ""; position: absolute; inset: 0; opacity: var(--bglum, 1);
  background: linear-gradient(90deg,
    var(--t-bg) 10%,
    color-mix(in srgb, var(--t-bg) 72%, transparent) 45%,
    color-mix(in srgb, var(--t-bg) 22%, transparent) 100%); }
/* خلفية المشهد: تعتيم كامل هادي — الريفرنسات هي البطلة */
.scene-bg::after { background: color-mix(in srgb, var(--t-bg) 88%, transparent); }
.slide > *:not(.slide-bg):not(.srefs):not(.s-tools):not(.bg-pop):not(.stray):not(.s-num) { position: relative; z-index: 1; }
.s-tools { z-index: 6; }

/* الغلاف — سينمائي: الشوت ظاهر بقوة والكلام فوقه */
.slide.cover { text-align: center; align-items: center; justify-content: center; }
.slide.cover .slide-bg::after {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--t-bg) 68%, transparent) 0%,
    color-mix(in srgb, var(--t-bg) 30%, transparent) 42%,
    color-mix(in srgb, var(--t-bg) 82%, transparent) 100%); }
.cover-kicker { font-family: var(--t-mono); font-size: max(8px, 1.05cqi); letter-spacing: 6px; color: var(--t-accent); text-transform: uppercase; margin-bottom: 18px; }
.cover-title { font-family: var(--t-display); font-size: calc(7.4cqi * var(--fmul-t, 1)); line-height: 1.02; margin: 0 0 14px;
  font-weight: var(--t-dweight); text-transform: uppercase; letter-spacing: var(--t-tspacing);
  text-shadow: 0 2px 30px color-mix(in srgb, var(--t-bg) 70%, transparent); }
.cover-tag { font-size: 1.6cqi; opacity: 0.92; font-style: var(--t-tagstyle, normal); }
.cover-strip { display: flex; gap: 0; margin-top: 40px; border-radius: 3px; overflow: hidden; }
.cover-strip i { width: 52px; height: 9px; display: block; }
.cover-by { position: absolute; bottom: 26px; left: 0; right: 0; font-family: var(--t-mono);
  font-size: 11px; letter-spacing: 4px; text-transform: uppercase; opacity: 0.95; }
.cover-by b { color: var(--t-accent); font-weight: 400; }
.cover-dir { letter-spacing: 4px; }

/* المشاهد */
.slide.scene { justify-content: flex-start; }
.scene-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.scene-num { font-family: var(--t-mono); font-size: 12px; letter-spacing: 3px; color: var(--t-accent); }
.scene-title { font-family: var(--t-display); font-size: calc(2.7cqi * var(--fmul-t, 1)); margin: 0; font-weight: var(--t-dweight); text-transform: var(--t-ttransform); letter-spacing: var(--t-tspacing); }
.scene-text { font-size: calc(1.45cqi * var(--fmul-b, 1)); line-height: 1.75; max-width: 780px; margin-bottom: 14px; white-space: pre-wrap; }
.look-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.look-chip { font-family: var(--t-mono); font-size: 10px; letter-spacing: 1.5px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--t-accent); color: var(--t-accent); text-transform: uppercase; }

/* شبكة الريفرنسات: تربيعات متساوية بترصّ وتدخل جوه الفريم من غير ما تتقص — كلها فيديو لووب حي */
.refs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; align-content: start; }
.ref { position: relative; border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 16/9; background: rgba(127,127,127,0.15);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
.ref img, .ref video { width: 100%; height: 100%; object-fit: cover; display: block; filter: var(--t-imgfilter, none); }
.ref .ref-print { display: none; position: absolute; inset: 0; }
.ref .match { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,0.72); color: #ffd479; font-family: var(--t-mono);
  font-size: 10px; padding: 3px 8px; border-radius: 999px; letter-spacing: 0.5px; }
.ref .pin { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.55); border: none; color: #fff; width: 24px; height: 24px;
  border-radius: 50%; cursor: pointer; font-size: 12px; opacity: 0; transition: opacity .15s; }
.ref:hover .pin { opacity: 1; }
.ref.pinned .pin { opacity: 1; color: #ffb224; }
.ref .why { position: absolute; inset: auto 0 0 0; background: linear-gradient(transparent, rgba(0,0,0,0.88)); color: #eee;
  font-size: 10px; line-height: 1.5; padding: 18px 8px 7px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.ref:hover .why { opacity: 1; }
.scene-ctl { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.scene-ctl button, .scene-ctl input { font-size: 11.5px; }
.scene-ctl input { flex: 1; min-width: 170px; background: rgba(127,127,127,0.12); border: 1px dashed var(--t-accent); color: var(--t-ink);
  border-radius: 8px; padding: 7px 12px; font-family: inherit; }
.scene-ctl input:focus { outline: none; }
.tbtn { background: transparent; border: 1px solid var(--t-accent); color: var(--t-accent); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; font-family: var(--t-mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
.tbtn:hover { background: var(--t-accent); color: var(--t-bg); }

/* الباليت */
.pal-row { display: flex; gap: 12px; margin: 8px 0 22px; }
.pal-sw { flex: 1; height: 130px; border-radius: 6px; cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(127,127,127,0.25); }
.pal-sw code { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-family: var(--t-mono); font-size: 10.5px;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7); letter-spacing: 1px; }
.pal-words { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════ عوالم المخرجين — كل ثيم عالم متكامل: ألوان + خطوط + زخرفة + تكوين ═══════════ */
.deck { --t-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace; --t-dweight: 700; --t-ttransform: none; --t-tspacing: 0;
  /* قيم افتراضية آمنة — أي ثيم لسه ملوش بلوك خاص (زي العوالم الجديدة) يفضل مقروء لحد ما نبنيه */
  --t-bg:#0d0e10; --t-ink:#ece6d8; --t-accent:#ffb224; --t-display:"Helvetica Neue",Helvetica,Arial,sans-serif; }

/* كيكر مؤطّر بخطوط جانبية — أناقة للثيمات المتناظرة */
.th-anderson .cover-kicker, .th-anderson .s-kicker, .th-luhrmann .cover-kicker, .th-luhrmann .s-kicker,
.th-jeunet .cover-kicker, .th-jeunet .s-kicker, .th-villeneuve .cover-kicker, .th-villeneuve .s-kicker,
.th-refn .cover-kicker, .th-refn .s-kicker {
  display: inline-flex; align-items: center; align-self: center; }
.th-anderson .cover-kicker::before, .th-anderson .cover-kicker::after, .th-anderson .s-kicker::before, .th-anderson .s-kicker::after,
.th-luhrmann .cover-kicker::before, .th-luhrmann .cover-kicker::after, .th-luhrmann .s-kicker::before, .th-luhrmann .s-kicker::after,
.th-jeunet .cover-kicker::before, .th-jeunet .cover-kicker::after, .th-jeunet .s-kicker::before, .th-jeunet .s-kicker::after,
.th-villeneuve .cover-kicker::before, .th-villeneuve .cover-kicker::after, .th-villeneuve .s-kicker::before, .th-villeneuve .s-kicker::after,
.th-refn .cover-kicker::before, .th-refn .cover-kicker::after, .th-refn .s-kicker::before, .th-refn .s-kicker::after {
  content: ""; width: 34px; height: 1px; background: currentColor; opacity: .55; margin: 0 14px; }

/* ─────────── FINCHER — ثريلر بارد: ليتربوكس + علامات ركن دقيقة ─────────── */
.th-fincher { --t-bg:#08090b; --t-ink:#e6ebeb; --t-accent:#6fa8a0; --t-display:"Helvetica Neue",Helvetica,sans-serif;
  --t-body:"Helvetica Neue",sans-serif; --t-dweight:300; --t-tspacing:-.5px; --t-imgfilter:saturate(.6) contrast(1.05) brightness(.96); }
.th-fincher .slide { justify-content:flex-end; }
.th-fincher .slide::before, .th-fincher .slide::after { content:""; position:absolute; left:0; right:0; height:6%; background:#000; z-index:3; pointer-events:none; }
.th-fincher .slide::before { top:0; } .th-fincher .slide::after { bottom:0; }
.th-fincher .slide-head, .th-fincher .cover-title { font-weight:300; text-transform:none; letter-spacing:-.01em; }
.th-fincher .cover-title { border-left:2px solid #6fa8a0; padding-left:3cqi; }
.th-fincher .s-text { max-width:46%; }
.th-fincher .srefs { top:auto; bottom:11%; transform:none; width:32%; }
.th-fincher .sref-row { flex-direction:row; }
.th-fincher .look-chip { border-radius:0; }

/* ─────────── VILLENEUVE — ملحمي: شمس عنبر ضخمة + عنوان أثري متباعد ─────────── */
.th-villeneuve { --t-bg:#0b0906; --t-ink:#ede4d6; --t-accent:#d98a3d; --t-display:"Futura","Arial Narrow",sans-serif;
  --t-body:"Helvetica Neue",sans-serif; --t-ttransform:uppercase; --t-tspacing:3px; --t-dweight:700; --t-imgfilter:saturate(.72) contrast(1.08) brightness(.95); }
.th-villeneuve .slide { align-items:center; text-align:center; justify-content:center; }
.th-villeneuve .slide-head, .th-villeneuve .cover-title { letter-spacing:.16em; }
.th-villeneuve .cover-title { font-size:calc(6cqi * var(--fmul-t,1)); }
.th-villeneuve .s-text { max-width:56%; margin:0 auto; }
.th-villeneuve .srefs { position:static; width:44%; margin:26px auto 0; transform:none; }
.th-villeneuve .sref-row { flex-direction:row; }
.th-villeneuve .slide-bg::after, .th-villeneuve .slide.cover .slide-bg::after {
  background:radial-gradient(48% 42% at 50% 66%, rgba(217,138,61,.28), transparent 60%),
             radial-gradient(120% 120% at 50% 50%, color-mix(in srgb,var(--t-bg) 30%,transparent), color-mix(in srgb,var(--t-bg) 90%,transparent)); }
.th-villeneuve .cover-strip { justify-content:center; }

/* ─────────── MALICK — شاعري: بلوم شمس + سيريف مايل هامس ─────────── */
.th-malick { --t-bg:#1a140c; --t-ink:#f6efe2; --t-accent:#e4b876; --t-display:"Baskerville","Hoefler Text",Georgia,serif;
  --t-body:"Baskerville",Georgia,serif; --t-tagstyle:italic; --t-dweight:400; --t-tspacing:.3px; --t-imgfilter:saturate(1.08) sepia(.14) brightness(1.05); }
.th-malick .slide { justify-content:flex-end; }
.th-malick .slide::after { content:""; position:absolute; top:-14%; right:-8%; width:52%; height:52%; z-index:1; pointer-events:none;
  background:radial-gradient(circle, rgba(240,205,130,.5), transparent 62%); }
.th-malick .slide-head, .th-malick .cover-title { font-style:italic; text-transform:none; line-height:1.14; }
.th-malick .s-text, .th-malick .scene-text { max-width:56%; line-height:1.95; }
.th-malick .srefs { top:auto; bottom:8%; right:5%; width:34%; transform:none; }
.th-malick .slide-bg::after, .th-malick .slide.cover .slide-bg::after {
  background:linear-gradient(180deg, color-mix(in srgb,var(--t-bg) 22%,transparent), color-mix(in srgb,var(--t-bg) 84%,transparent)); }
.th-malick .cover-tag { font-style:italic; }

/* ─────────── REFN — نيون: برواز متوهّج + ألوان كهربية ─────────── */
.th-refn { --t-bg:#0a0410; --t-ink:#f5e6ff; --t-accent:#ff2e88; --t-display:"Futura","Century Gothic",sans-serif;
  --t-body:"Helvetica Neue",sans-serif; --t-ttransform:uppercase; --t-tspacing:4px; --t-dweight:600; --t-imgfilter:saturate(1.3) contrast(1.06); }
.th-refn .slide { align-items:center; text-align:center; justify-content:center; }
.th-refn .slide::before { content:""; position:absolute; inset:14px; border:1px solid rgba(255,46,136,.5);
  box-shadow:inset 0 0 44px rgba(36,224,255,.14), 0 0 22px rgba(255,46,136,.2); z-index:2; pointer-events:none; }
.th-refn .slide-head, .th-refn .cover-title { text-shadow:0 0 20px rgba(255,46,136,.65); }
.th-refn .s-kicker, .th-refn .cover-kicker { color:#24e0ff; text-shadow:0 0 12px rgba(36,224,255,.6); }
.th-refn .s-text { max-width:58%; margin:0 auto; }
.th-refn .srefs { position:static; width:52%; margin:22px auto 0; transform:none; }
.th-refn .sref-row { flex-direction:row; }
.th-refn .sref-clip { box-shadow:0 0 26px rgba(255,46,136,.4); }
.th-refn .look-chip { box-shadow:0 0 10px rgba(255,46,136,.3); }

/* ─────────── WONG KAR-WAI — جواهر مشبّعة: توهّج قرمزي دافي + إطار رفيع ─────────── */
.th-wongkarwai { --t-bg:#0e1618; --t-ink:#f0e6d8; --t-accent:#e0563a; --t-display:"Optima","Helvetica Neue",sans-serif;
  --t-body:"Helvetica Neue",sans-serif; --t-dweight:500; --t-tspacing:1px; --t-imgfilter:saturate(1.5) contrast(1.08) brightness(.97); }
.th-wongkarwai .slide { justify-content:flex-end; }
.th-wongkarwai .slide::before { content:""; position:absolute; inset:16px; border:1px solid rgba(224,86,58,.4); z-index:2; pointer-events:none; }
.th-wongkarwai .slide-head, .th-wongkarwai .cover-title { text-transform:uppercase; }
.th-wongkarwai .s-kicker, .th-wongkarwai .cover-kicker { color:#2a8c86; }
.th-wongkarwai .s-text { max-width:48%; line-height:1.85; }
.th-wongkarwai .srefs { top:auto; bottom:9%; right:6%; width:34%; transform:none; }
.th-wongkarwai .slide-bg::after, .th-wongkarwai .slide.cover .slide-bg::after {
  background:linear-gradient(90deg, var(--t-bg) 8%, color-mix(in srgb,#2a8c86 16%,transparent) 55%, color-mix(in srgb,#e0563a 22%,transparent) 100%); }

/* ─────────── LUHRMANN — أوبرالي فخم: برواز ذهبي مزدوج + توهّج + سبكتاكل ─────────── */
.th-luhrmann { --t-bg:#1a0609; --t-ink:#f5e9d0; --t-accent:#e6b422; --t-display:"Playfair Display","Didot",Georgia,serif;
  --t-body:"Optima","Avenir Next",serif; --t-dweight:700; --t-tspacing:1px; --t-imgfilter:saturate(1.28) contrast(1.14) brightness(1.02); }
.th-luhrmann .slide { align-items:center; text-align:center; justify-content:center; }
.th-luhrmann .slide::before { content:""; position:absolute; inset:12px; border:2px solid rgba(230,180,34,.6); z-index:2; pointer-events:none; }
.th-luhrmann .slide::after { content:""; position:absolute; inset:18px; border:1px solid rgba(230,180,34,.32); z-index:2; pointer-events:none; }
.th-luhrmann .slide-head, .th-luhrmann .cover-title { text-shadow:0 2px 24px rgba(230,180,34,.5); }
.th-luhrmann .cover-title::after, .th-luhrmann .slide-head::after {
  content:"❖"; display:block; color:#e6b422; font-size:2.6cqi; margin-top:12px; }
.th-luhrmann .s-text { max-width:58%; margin:0 auto; }
.th-luhrmann .srefs { position:static; width:52%; margin:24px auto 0; transform:none; }
.th-luhrmann .sref-row { flex-direction:row; }
.th-luhrmann .sref-clip, .th-luhrmann .sref-film { box-shadow:0 0 0 1px rgba(230,180,34,.5), 0 12px 30px rgba(0,0,0,.5); }
.th-luhrmann .cover-strip { justify-content:center; gap:3px; }
.th-luhrmann .slide-bg::after, .th-luhrmann .slide.cover .slide-bg::after {
  background:radial-gradient(circle at 50% 40%, color-mix(in srgb,#4a0d14 45%,transparent), color-mix(in srgb,var(--t-bg) 88%,transparent)); }

/* ─────────── WES ANDERSON — عالم متكامل: باستيل مسطّح + برواز مزدوج بلونين + زخرفة ─────────── */
.th-anderson { --t-bg:#f3e9d8; --t-ink:#2b2622; --t-accent:#c24e3a; --t-display:"Futura","Century Gothic",sans-serif;
  --t-body:"Futura","Century Gothic",sans-serif; --t-dweight:500; --t-tspacing:1.5px; --t-imgfilter:saturate(.62) sepia(.22) brightness(1.06) contrast(.95); }
.th-anderson .slide { align-items:center; text-align:center; justify-content:center; background:#f3e9d8; }
.th-anderson .slide::before { content:""; position:absolute; inset:15px; border:1.6px solid #c24e3a; z-index:2; pointer-events:none; }
.th-anderson .slide::after { content:""; position:absolute; inset:21px; border:1px solid #3a6b5f; z-index:2; pointer-events:none; }
.th-anderson .slide-bg::after, .th-anderson .slide.cover .slide-bg::after { background:color-mix(in srgb,#f3e9d8 82%,transparent); }
.th-anderson .cover-kicker, .th-anderson .s-kicker { color:#c24e3a; }
.th-anderson .slide-head, .th-anderson .cover-title { text-transform:none; color:#2b2622; letter-spacing:.02em; }
.th-anderson .cover-title::after, .th-anderson .slide-head::after {
  content:"✦"; display:block; color:#3a6b5f; font-size:2.6cqi; margin-top:14px; letter-spacing:0; font-weight:400; }
.th-anderson .cover-tag { color:#3a6b5f; font-weight:500; letter-spacing:.14em; text-transform:uppercase; font-size:1.4cqi; }
.th-anderson .cover-strip { justify-content:center; gap:5px; margin-top:30px; }
.th-anderson .cover-strip i { height:8px; width:40px; border-radius:2px; box-shadow:0 0 0 1px rgba(43,38,34,.15); }
.th-anderson .cover-by { color:#3a6b5f; }
.th-anderson .cover-by b { color:#c24e3a; }
.th-anderson .look-chip { border-color:#3a6b5f; color:#3a6b5f; }
.th-anderson .look-chip:nth-child(even) { border-color:#c24e3a; color:#c24e3a; }
.th-anderson .s-text { max-width:60%; margin:0 auto; }
.th-anderson .srefs { position:static; width:54%; margin:24px auto 0; transform:none; }
.th-anderson .sref-row { flex-direction:row; }
.th-anderson .sref-clip, .th-anderson .sref-film { border-radius:3px; box-shadow:0 0 0 3px #f3e9d8, 0 0 0 4px #c24e3a; }

/* ─────────── JEUNET (Amélie) — حكاية دافية: فينيت أخضر + ذهب/أحمر + سيريف كلاسيكي ─────────── */
.th-jeunet { --t-bg:#17251c; --t-ink:#f3e9d0; --t-accent:#e0a52e; --t-display:"Cochin","Hoefler Text",Georgia,serif;
  --t-body:"Cochin",Georgia,serif; --t-tagstyle:italic; --t-dweight:600; --t-tspacing:.5px; --t-imgfilter:saturate(1.25) sepia(.2) brightness(1.02) contrast(1.02); }
.th-jeunet .slide { align-items:center; text-align:center; justify-content:center; }
.th-jeunet .slide::before { content:""; position:absolute; inset:15px; border:1.4px solid rgba(224,165,46,.6); z-index:2; pointer-events:none; }
.th-jeunet .slide-head, .th-jeunet .cover-title { text-transform:none; color:#e0a52e; text-shadow:0 2px 16px rgba(0,0,0,.4); }
.th-jeunet .cover-title::after, .th-jeunet .slide-head::after {
  content:"♥"; display:block; color:#c0392b; font-size:2.2cqi; margin-top:12px; }
.th-jeunet .cover-kicker, .th-jeunet .s-kicker { color:#c0392b; }
.th-jeunet .cover-tag { font-style:italic; color:#f3e9d0; }
.th-jeunet .look-chip { border-color:#c0392b; color:#c0392b; }
.th-jeunet .s-text { max-width:58%; margin:0 auto; }
.th-jeunet .srefs { position:static; width:52%; margin:24px auto 0; transform:none; }
.th-jeunet .sref-row { flex-direction:row; }
.th-jeunet .sref-clip { border:2px solid #e0a52e; }
.th-jeunet .slide-bg::after, .th-jeunet .slide.cover .slide-bg::after {
  background:radial-gradient(75% 75% at 50% 42%, color-mix(in srgb,var(--t-bg) 34%,transparent), color-mix(in srgb,var(--t-bg) 90%,transparent)); }

/* ─────────── GONDRY — فانكي مصنوع باليد: كرت ورقي + ظل أصفر + ألوان أساسية مايلة ─────────── */
.th-gondry { --t-bg:#f4efe2; --t-ink:#232019; --t-accent:#e64b35; --t-display:"Marker Felt","Chalkboard SE","Comic Sans MS",cursive;
  --t-body:"Chalkboard SE","Comic Sans MS",sans-serif; --t-dweight:400; }
.th-gondry .slide { background:var(--t-bg); border:2.5px solid #232019; border-radius:18px; box-shadow:7px 7px 0 #f4b400; }
.th-gondry .slide-bg { display:none; }
.th-gondry .cover-kicker, .th-gondry .s-kicker { background:#2f6db0; color:#fff; padding:5px 12px; border-radius:999px;
  display:inline-block; transform:rotate(-2deg); align-self:center; }
.th-gondry .slide-head, .th-gondry .cover-title { text-transform:none; transform:rotate(-1.5deg); display:inline-block; color:#e64b35; }
.th-gondry .cover-tag { color:#4a9e4a; transform:rotate(1deg); display:inline-block; }
.th-gondry .look-chip:nth-child(3n) { color:#2f6db0; border-color:#2f6db0; transform:rotate(-2deg); }
.th-gondry .look-chip:nth-child(3n+1) { color:#e64b35; border-color:#e64b35; transform:rotate(1.5deg); }
.th-gondry .look-chip:nth-child(3n+2) { color:#4a9e4a; border-color:#4a9e4a; transform:rotate(-.5deg); }
.th-gondry .cover-strip { justify-content:center; gap:4px; transform:rotate(-1deg); }
.th-gondry .cover-strip i { height:12px; width:34px; border-radius:3px; border:1.5px solid #232019; }
.th-gondry .s-text { max-width:58%; }
.th-gondry .srefs { top:30%; right:6%; width:40%; transform:rotate(-1.5deg); }
.th-gondry .sref-clip { border:2.5px solid #232019; box-shadow:4px 4px 0 #f4b400; border-radius:8px; }
.th-gondry .sref-clip:nth-child(even) { transform:rotate(2deg); box-shadow:-4px 4px 0 #2f6db0; }

/* ─────────── EDGAR WRIGHT — كوميدي كينيتيكي: كتل سوداء + أحمر صادم + خط تقيل ضخم ─────────── */
.th-wright { --t-bg:#f6efdb; --t-ink:#17130d; --t-accent:#ef4123; --t-display:"Futura","Century Gothic",sans-serif;
  --t-body:"Helvetica Neue",sans-serif; --t-ttransform:uppercase; --t-tspacing:-.5px; --t-dweight:800; }
.th-wright .slide { background:var(--t-bg); justify-content:center; }
.th-wright .slide-bg { display:none; }
.th-wright .cover-kicker, .th-wright .s-kicker { background:#17130d; color:#f6efdb; padding:6px 12px; display:inline-block;
  align-self:flex-start; letter-spacing:4px; }
.th-wright .slide-head, .th-wright .cover-title { color:#ef4123; line-height:.86; letter-spacing:-.02em;
  -webkit-text-stroke:0; text-shadow:4px 4px 0 #17130d; }
.th-wright .cover-tag { background:#ef4123; color:#f6efdb; padding:4px 12px; display:inline-block; font-weight:700; text-transform:uppercase; letter-spacing:2px; }
.th-wright .s-text { max-width:52%; font-weight:600; }
.th-wright .look-chip { background:#17130d; color:#f6efdb; border-color:#17130d; border-radius:0; }
.th-wright .cover-strip { gap:0; margin-top:26px; }
.th-wright .cover-strip i { height:14px; }
.th-wright .srefs { top:auto; bottom:8%; right:5%; width:40%; transform:none; }
.th-wright .sref-row { flex-direction:row; }
.th-wright .sref-clip { border:3px solid #17130d; border-radius:0; box-shadow:6px 6px 0 #ef4123; }

/* ═══════════════════════════════════════════════════════════════
   العوالم الستة الجديدة (من styles.pdf) — كل واحد ثيم ديك متكامل
   ملاحظة: مفيش border على .slide نفسه (يزحلق المواضع المحفوظة) — البراويز كلها ::before/::after
   ═══════════════════════════════════════════════════════════════ */

/* ─────────── 1 · AT HOPPER'S — داينر ريترو: كريم + جريد + برواز أحمر + شطرنج ─────────── */
.th-hoppers { --t-bg:#fee4cd; --t-ink:#c21016; --t-accent:#e4141a;
  --t-display:'Baloo 2','Baloo',cursive; --t-body:'Baloo 2',sans-serif; --t-dweight:800;
  --t-tspacing:.01em; --t-ttransform:uppercase; --t-imgfilter:saturate(1.06) contrast(1.02); }
.th-hoppers .slide { background:#fee4cd;
  background-image:linear-gradient(rgba(228,20,26,.13) 1px,transparent 1px),
                   linear-gradient(90deg,rgba(228,20,26,.13) 1px,transparent 1px);
  background-size:3.4cqi 3.4cqi; }
.th-hoppers .slide::before { content:""; position:absolute; inset:1.5cqi; border:.7cqi solid #e4141a;
  border-radius:.4cqi; z-index:2; pointer-events:none; }
.th-hoppers .slide::after { content:""; position:absolute; left:1.5cqi; right:1.5cqi; top:1.5cqi; height:1.4cqi; z-index:2; pointer-events:none;
  background-image:linear-gradient(45deg,#e4141a 25%,transparent 25%,transparent 75%,#e4141a 75%),
                   linear-gradient(45deg,#e4141a 25%,transparent 25%,transparent 75%,#e4141a 75%);
  background-size:1.4cqi 1.4cqi; background-position:0 0,.7cqi .7cqi; background-color:#fee4cd; }
.th-hoppers .slide-bg::after { background:color-mix(in srgb,#fee4cd 80%,transparent); }
.th-hoppers .slide.cover .slide-bg::after { background:linear-gradient(180deg,
  color-mix(in srgb,#fee4cd 28%,transparent), color-mix(in srgb,#fee4cd 10%,transparent) 45%, color-mix(in srgb,#fee4cd 52%,transparent)); }
.th-hoppers .cover-title { color:#f0b840; -webkit-text-stroke:.05cqi #c21016; text-shadow:.1cqi .28cqi 0 rgba(196,16,22,.28); }
.th-hoppers .slide-head, .th-hoppers .scene-title { color:#e4141a; text-shadow:none; }
.th-hoppers .cover-kicker, .th-hoppers .s-kicker { font-family:'Lobster',cursive; color:#e4141a;
  letter-spacing:.5px; text-transform:none; font-size:2.2cqi; }
.th-hoppers .cover-tag, .th-hoppers .s-text, .th-hoppers .scene-text { color:#a8121a; }
.th-hoppers .cover-by, .th-hoppers .cover-by b { color:#e4141a; }
.th-hoppers .cover-strip { border-radius:1cqi; box-shadow:0 0 0 .35cqi #e4141a; }
.th-hoppers .sref-clip, .th-hoppers .sref-film { border-radius:1.4cqi; box-shadow:0 0 0 .4cqi #e4141a, .2cqi .3cqi 0 rgba(196,16,22,.25); }
.th-hoppers .sref-lbl { color:#e4141a; }
.th-hoppers .look-chip { border-color:#e4141a; color:#e4141a; }

/* ═══════════ 2 · SIZZLE / GRITTY — بانك خام زي الزين: أحمر محبّب · ماركر · إطارات فيلم Kodak ═══════════ */
.th-sizzle { --t-bg:#0c0a08; --t-ink:#f8f3ea; --t-accent:#f4c518;
  --t-display:'Permanent Marker',cursive; --t-body:"Helvetica Neue",Helvetica,Arial,sans-serif; --t-dweight:400;
  --t-tspacing:0; --t-ttransform:none; --t-imgfilter:saturate(1.18) contrast(1.14) brightness(.95);
  --grit-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E"); }

/* الخلفية: أحمر محبّب على السلايدات النصّية (الصورة بتغطيه لو موجودة) */
.th-sizzle .slide { background: radial-gradient(135% 125% at 50% -12%, #ec4a34, #c92c20 72%); color:#fff; }
/* طبقة حبيبات فوق الخلفية وتحت الكلام */
.th-sizzle .slide::before { content:""; position:absolute; inset:0; z-index:1; pointer-events:none;
  background-image:var(--grit-grain); background-size:170px; opacity:.5; mix-blend-mode:overlay; }
/* فوتر ثابت زي المرجع */
.th-sizzle .slide::after { content:"Director  |  Production"; position:absolute; left:0; right:0; bottom:1.4cqi;
  z-index:6; text-align:center; font-family:var(--t-body); font-size:1cqi; letter-spacing:.05cqi;
  color:rgba(255,255,255,.82); pointer-events:none; }

/* صورة الخلفية: تعتيم دافئ من تحت (بدل الرمادي) */
.th-sizzle .slide-bg::after  { background: linear-gradient(180deg, rgba(8,3,2,.08) 25%, rgba(26,7,4,.82)); }
.th-sizzle .scene-bg::after  { background: linear-gradient(180deg, rgba(8,3,2,.3), rgba(20,6,3,.72)); }

/* رقم الصفحة — ماركر ضخم فوق يمين */
.th-sizzle .s-num { font-family:var(--t-display); font-size:3.1cqi; color:#f4c518; background:none;
  top:1cqi; right:3cqi; letter-spacing:0; z-index:6; text-shadow:.18cqi .28cqi 0 rgba(0,0,0,.7); }

/* العناوين — أمبر فرشاة مايل بظل أسود قوي (يشتغل على الأحمر والصورة) */
.th-sizzle .cover-title { color:#e8402c; transform:skewX(-5deg); font-weight:400;
  text-shadow:.3cqi .5cqi 0 rgba(0,0,0,.55); }
.th-sizzle .slide-head, .th-sizzle .scene-title { color:#f4c518; transform:skewX(-4deg); font-weight:400;
  text-transform:none; letter-spacing:0; text-shadow:.22cqi .38cqi 0 rgba(0,0,0,.65); }

/* الكيكر — بلوك أمبر (TREATMENT BY / اسم المشروع) */
.th-sizzle .cover-kicker, .th-sizzle .s-kicker { background:#f4c518; color:#141210; display:inline-block;
  align-self:flex-start; padding:.55cqi 1.2cqi; letter-spacing:.22cqi; font-family:var(--t-body);
  font-weight:800; text-transform:uppercase; border-radius:0; box-shadow:.25cqi .35cqi 0 rgba(0,0,0,.35); }
.th-sizzle .slide.cover .cover-kicker { align-self:center; }
.th-sizzle .cover-tag { color:#fff; }
.th-sizzle .scene-text, .th-sizzle .s-text, .th-sizzle .slide-fit p { color:#fff; }
.th-sizzle .scene-num { color:#f4c518; }

/* إطار فيلم Kodak Portra على الريفرنسات — بوردر أسود + سبروكِت + ميلان بسيط */
.th-sizzle .sref-film, .th-sizzle .sref-clip {
  border:0; background:#0a0a0a; padding:2.7cqi 1cqi; border-radius:0;
  box-shadow:.5cqi .7cqi 0 rgba(0,0,0,.5); transform:rotate(-1.6deg); position:relative; overflow:visible; }
.th-sizzle .sref-clip:nth-child(even) { transform:rotate(1.5deg); }
.th-sizzle .sref-film img, .th-sizzle .sref-film video,
.th-sizzle .sref-clip img, .th-sizzle .sref-clip video { border-radius:0; }
.th-sizzle .sref-film::before, .th-sizzle .sref-clip::before {
  content:"KODAK PORTRA 400          43          KODAK PORTRA 400"; position:absolute; top:.7cqi; left:.8cqi; right:.8cqi;
  font-family:var(--t-mono); font-size:.72cqi; letter-spacing:.06cqi; color:#e3ad3f; white-space:nowrap; overflow:hidden; }
.th-sizzle .sref-film::after, .th-sizzle .sref-clip::after {
  content:"▸ 2                                                      ▸"; position:absolute; bottom:.7cqi; left:.8cqi; right:.8cqi;
  font-family:var(--t-mono); font-size:.72cqi; color:#e3ad3f; white-space:nowrap; overflow:hidden; }

/* شيبس اللوك — حواف حادة أمبر */
.th-sizzle .look-chip { border-color:#f4c518; color:#f4c518; border-radius:0; }

/* ─────────── 3 · OUR SUMMER — إديتوريال نضيف: أصفر عنبري + Anton ضخم + ريلز جانبية ─────────── */
.th-summer { --t-bg:#101010; --t-ink:#f4f0e8; --t-accent:#ffbd16;
  --t-display:'Anton',sans-serif; --t-body:Helvetica,Arial,sans-serif; --t-dweight:400;
  --t-tspacing:.01em; --t-ttransform:uppercase; --t-imgfilter:saturate(1.05) contrast(1.03); }
.th-summer .slide { justify-content:flex-end; }
.th-summer .slide::before { content:""; position:absolute; left:2.6%; top:8%; bottom:8%; width:2px; background:rgba(255,189,22,.7); z-index:2; }
.th-summer .slide::after { content:""; position:absolute; right:2.6%; top:8%; bottom:8%; width:2px; background:rgba(255,189,22,.7); z-index:2; }
.th-summer .cover-title, .th-summer .slide-head, .th-summer .scene-title { color:#ffbd16; line-height:.88; }
.th-summer .cover-title { font-size:calc(9cqi * var(--fmul-t,1)); }
.th-summer .cover-kicker, .th-summer .s-kicker { color:#f4f0e8; letter-spacing:5px; }
.th-summer .cover-tag, .th-summer .s-text, .th-summer .scene-text { color:#f4f0e8; }
.th-summer .look-chip { border-color:#ffbd16; color:#ffbd16; }
.th-summer .sref-clip, .th-summer .sref-film { border-radius:2px; }
.th-summer .slide-bg::after { background:linear-gradient(90deg,
  color-mix(in srgb,var(--t-bg) 76%,transparent) 8%, color-mix(in srgb,var(--t-bg) 30%,transparent) 55%, transparent); }

/* ─────────── 4 · BRIGHT — سبعينيات: حروف مجوّفة صفرا + برواز رفيع + تدرّج دافي ─────────── */
.th-bright { --t-bg:#241a10; --t-ink:#f8e068; --t-accent:#f8e068;
  --t-display:'Baloo 2',cursive; --t-body:'Archivo Black',Arial,sans-serif; --t-dweight:800;
  --t-tspacing:.02em; --t-ttransform:uppercase; --t-imgfilter:saturate(1.3) contrast(1.05) sepia(.14) brightness(1.02); }
.th-bright .slide { align-items:center; text-align:center; justify-content:center; }
.th-bright .slide::before { content:""; position:absolute; inset:1.4cqi; border:.32cqi solid #f8e068; z-index:2; pointer-events:none; }
.th-bright .cover-title, .th-bright .slide-head, .th-bright .scene-title { color:transparent;
  -webkit-text-stroke:.3cqi #f8e068; text-shadow:.3cqi .5cqi 0 rgba(0,0,0,.28); }
.th-bright .cover-kicker, .th-bright .s-kicker { color:#f8e068; align-self:center; }
.th-bright .cover-tag { color:#f8e068; }
.th-bright .s-text { max-width:58%; margin:0 auto; color:#f8e068; }
.th-bright .srefs { position:static; width:52%; margin:22px auto 0; transform:none; }
.th-bright .sref-row { flex-direction:row; }
.th-bright .sref-clip, .th-bright .sref-film { border:.4cqi solid #f8e068; border-radius:1.4cqi; }
.th-bright .look-chip { border-color:#f8e068; color:#f8e068; }
.th-bright .cover-by, .th-bright .cover-by b { color:#f8e068; }
.th-bright .slide-bg::after, .th-bright .slide.cover .slide-bg::after { background:radial-gradient(72% 82% at 50% 45%,
  color-mix(in srgb,#b98a3c 30%,transparent), color-mix(in srgb,var(--t-bg) 84%,transparent)); }

/* ─────────── 5 · ENTER THE VIBE — Y2K نيون: أخضر نيون + خلفية مشبّعة + بروازات نيون ─────────── */
.th-vibe { --t-bg:#2a1250; --t-ink:#ffffff; --t-accent:#5ce23f;
  --t-display:'Anton',sans-serif; --t-body:Helvetica,Arial,sans-serif; --t-dweight:400;
  --t-tspacing:.01em; --t-ttransform:uppercase; --t-imgfilter:saturate(1.5) contrast(1.08); }
.th-vibe .slide { justify-content:flex-end; }
.th-vibe .cover-title, .th-vibe .slide-head, .th-vibe .scene-title { color:#5ce23f; text-shadow:.25cqi .3cqi 0 rgba(125,24,160,.6); }
.th-vibe .cover-kicker, .th-vibe .s-kicker { color:#22e0ff; letter-spacing:4px; }
.th-vibe .cover-tag { color:#fff; font-style:italic; }
.th-vibe .s-text, .th-vibe .scene-text { color:#fff; }
.th-vibe .look-chip { border-color:#5ce23f; color:#5ce23f; }
.th-vibe .sref-clip, .th-vibe .sref-film { border:.4cqi solid #5ce23f; border-radius:1.4cqi; box-shadow:0 0 2cqi rgba(92,226,63,.4); }
.th-vibe .sref-lbl { color:#5ce23f; }
.th-vibe .cover-by b { color:#5ce23f; }
.th-vibe .slide-bg::after { background:linear-gradient(120deg,
  color-mix(in srgb,#7b34c8 55%,transparent), color-mix(in srgb,#c81e8a 28%,transparent) 55%, color-mix(in srgb,#22c0e0 28%,transparent)); }
.th-vibe .slide.cover .slide-bg::after { background:linear-gradient(160deg,
  color-mix(in srgb,#2a1a6a 52%,transparent), color-mix(in srgb,#c81e8a 28%,transparent) 55%, color-mix(in srgb,#6a2ac8 52%,transparent)); }

/* ─────────── 6 · THE CHAMPION — رياضي سينمائي: أسود + حروف مجوّفة حمرا + تاج أحمر ─────────── */
.th-champion { --t-bg:#0e0f0d; --t-ink:#dcdcdc; --t-accent:#de3a1e;
  --t-display:'Anton',sans-serif; --t-body:Helvetica,Arial,sans-serif; --t-dweight:400;
  --t-tspacing:.01em; --t-ttransform:uppercase; --t-imgfilter:saturate(.9) contrast(1.12) brightness(.9); }
.th-champion .slide { justify-content:flex-end; }
.th-champion .cover-title, .th-champion .slide-head, .th-champion .scene-title { color:transparent;
  -webkit-text-stroke:.22cqi #de3a1e; text-shadow:none; }
.th-champion .cover-kicker, .th-champion .s-kicker { background:#de3a1e; color:#fff; display:inline-block;
  align-self:flex-start; padding:.4cqi 1cqi; letter-spacing:3px; font-weight:700; }
.th-champion .slide.cover .cover-kicker { align-self:center; }
.th-champion .cover-tag { color:#dcdcdc; }
.th-champion .s-text, .th-champion .scene-text { color:#dcdcdc; }
.th-champion .look-chip { border-color:#de3a1e; color:#de3a1e; border-radius:0; }
.th-champion .sref-clip, .th-champion .sref-film { border-radius:0; box-shadow:0 0 0 .25cqi #de3a1e; }
.th-champion .cover-by b { color:#de3a1e; }
/* تربيعات المشهد تتماشى مع طابع كل عالم */
.th-sizzle .ref, .th-champion .ref { border-radius:0; }
.th-hoppers .ref { border-radius:1cqi; box-shadow:0 0 0 .3cqi #e4141a; }
.th-vibe .ref { border-radius:1cqi; box-shadow:0 0 0 .25cqi #5ce23f; }

/* ═══════════ Director's Vision Reel — الأوفرلاي ═══════════ */
.reel-ov { position: fixed; inset: 0; z-index: 260; background: rgba(6,6,8,0.86); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.reel-box { position: relative; width: min(900px, 94vw); background: #16150f; border: 1px solid #37332a;
  border-radius: 18px; padding: 26px; box-shadow: 0 24px 80px rgba(0,0,0,0.6); color: #ece6d8;
  font-family: -apple-system, "Helvetica Neue", sans-serif; }
.reel-x { position: absolute; top: 14px; right: 16px; background: none; border: none; color: #9b937e; cursor: pointer; font-size: 16px; }
.reel-x:hover { color: #fff; }
.reel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 15px; }
.reel-video { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; display: block; }
.reel-actions { display: flex; gap: 10px; margin-top: 16px; }
.reel-intro { text-align: center; padding: 40px 32px; }
.reel-badge { width: 70px; height: 70px; margin: 0 auto 16px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; background: linear-gradient(150deg, rgba(255,178,36,0.22), rgba(255,178,36,0.06));
  border: 1px solid rgba(255,178,36,0.35); }
.reel-intro h2, .reel-wait h2 { font-size: 24px; margin: 0 0 10px; }
.reel-intro p { color: #b7ad97; font-size: 14px; line-height: 1.7; max-width: 520px; margin: 0 auto 22px; }
.reel-intro p b { color: #ece6d8; }
.reel-go { font-size: 15px; }
.reel-note { color: #9b937e; font-size: 12px; margin-top: 12px; }
.reel-wait { text-align: center; padding: 60px 32px; }
.reel-wait .spin { width: 46px; height: 46px; border: 2px solid #37332a; border-top-color: var(--amber);
  border-radius: 50%; margin: 0 auto 22px; animation: tspin 0.9s linear infinite; }
.reel-wait p { color: #b7ad97; font-size: 13px; }

/* ═══════════ وضع العرض (Presentation) ═══════════ */
.present { position: fixed; inset: 0; z-index: 200; background: var(--t-bg); display: flex; align-items: center; justify-content: center; }
.present .slide { width: min(94vw, 158vh); aspect-ratio: 16 / 9; box-shadow: none; animation: var(--t-anim, pFade) 0.55s ease both; }
.present .s-tools, .present .scene-ctl, .present .opt-tabs, .present .ref .pin,
.present .bg-pop, .present .dsg-pop { display: none !important; }
.present-x { position: fixed; top: 18px; right: 22px; z-index: 210; background: rgba(0,0,0,0.5); color: #fff; border: none;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 15px; }
.present-nav { position: fixed; bottom: 20px; left: 0; right: 0; text-align: center; z-index: 210;
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: rgba(127,127,127,0.9); letter-spacing: 2px; }
/* شريط تحكم العرض السينمائي */
.present-bar { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 220;
  display: flex; align-items: center; gap: 8px; width: min(620px, 90vw);
  background: rgba(12,12,14,0.72); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px; padding: 8px 14px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.present-bar .grow { flex: 1; }
.pb-btn { background: none; border: none; color: #fff; cursor: pointer; font-size: 16px; line-height: 1;
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0.85; }
.pb-btn:hover { background: rgba(255,255,255,0.14); opacity: 1; }
.pb-play { width: auto; padding: 0 14px; border-radius: 999px; font-size: 12px; letter-spacing: 1px;
  border: 1px solid rgba(255,255,255,0.25); }
.pb-play.on { background: #fff; color: #111; }
.pb-btn.on { color: #ffb224; }
.pb-count { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: rgba(255,255,255,0.75); letter-spacing: 1px; min-width: 56px; text-align: center; }

/* ─── Color Script (خط الفيلم اللوني) ─── */
.cscript { display: flex; gap: 8px; align-items: stretch; height: 62%; margin-top: 10px; overflow-x: auto; }
.cs-col { flex: 1; min-width: 90px; display: flex; flex-direction: column; gap: 6px; }
.cs-thumb { flex: 1; border-radius: 8px 8px 0 0; background-size: cover; background-position: center; min-height: 40%; filter: var(--t-imgfilter, none); }
.cs-bar { height: 12%; min-height: 14px; border-radius: 0 0 4px 4px; box-shadow: inset 0 0 0 1px rgba(127,127,127,0.2); }
.cs-num { font-family: var(--t-mono); font-size: max(8px, 0.95cqi); letter-spacing: 2px; color: var(--t-accent); }
.cs-title { font-size: max(9px, 1cqi); line-height: 1.25; opacity: 0.92; }
.cs-mood { font-family: var(--t-mono); font-size: max(7px, 0.8cqi); letter-spacing: 1px; text-transform: uppercase;
  color: var(--t-accent); border: 1px solid var(--t-accent); border-radius: 999px; padding: 2px 7px; align-self: flex-start; }
@keyframes pFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pScale { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes pUp { from { opacity: 0; transform: translateY(38px); } to { opacity: 1; transform: none; } }
@keyframes pTilt { from { opacity: 0; transform: rotate(-2deg) scale(0.94); } to { opacity: 1; transform: none; } }
.th-fincher, .th-wongkarwai { --t-anim: pScale; }
.th-villeneuve, .th-malick, .th-luhrmann { --t-anim: pUp; }
.th-refn, .th-gondry, .th-wright { --t-anim: pTilt; }
.th-anderson, .th-jeunet { --t-anim: pFade; }

/* ═══ بانلات التصميم والخلفية ═══ */
.pop-title { font-family: ui-monospace, Menlo, monospace; font-size: 10px; letter-spacing: 3px; color: var(--amber); margin-bottom: 10px; }
.pop-lbl { font-size: 11.5px; color: var(--dim); margin: 12px 0 6px; display: flex; justify-content: space-between; }
.pop-lbl b { color: var(--amber); font-weight: 500; }
.pop-range { width: 100%; accent-color: var(--amber); }

.dsg-pop { position: absolute; top: 100%; right: 0; margin-top: 8px; z-index: 80; width: 320px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  box-shadow: 0 14px 44px rgba(0,0,0,0.55); }
.dsg-fonts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.dsg-fonts button { display: flex; align-items: center; gap: 9px; background: var(--panel2); border: 1px solid var(--line);
  color: var(--text); border-radius: 9px; padding: 7px 10px; cursor: pointer; font-size: 11.5px; font-family: inherit; text-align: left; }
.dsg-fonts button span { font-size: 17px; width: 26px; }
.dsg-fonts button.on { border-color: var(--amber); color: var(--amber); }
.dsg-reset { margin-top: 14px; border-color: var(--line) !important; color: var(--dim) !important; }

.bg-pop { position: absolute; top: 48px; right: 14px; z-index: 80; width: 340px;
  background: rgba(18,17,14,0.97); border: 1px solid #37332a; border-radius: 14px; padding: 14px;
  box-shadow: 0 14px 44px rgba(0,0,0,0.6); color: #ece6d8; font-family: -apple-system, sans-serif; }
.bg-pop .pop-lbl { color: #9b937e; }
.bgp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 220px; overflow-y: auto; }
.bgp-grid img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; filter: none !important; }
.bgp-grid img:hover { border-color: rgba(255,178,36,0.5); }
.bgp-grid img.on { border-color: #ffb224; }
.bgp-none { margin-top: 12px; border-color: #37332a !important; color: #9b937e !important; }

/* خانات المشروع والمخرج في فورم البداية */
.tst-two { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tst-in { flex: 1; min-width: 220px; background: var(--bg); color: var(--text);
  border: 1px dashed var(--line); border-radius: 10px; padding: 12px 16px; font-size: 13.5px; font-family: inherit; }
.tst-in:focus { outline: none; border-color: var(--amber); }

/* ═══════════ الطباعة / PDF ═══════════ */
@media print {
  body { background: #fff !important; }
  .top, .deckbar, .s-tools, .scene-ctl, .opt-tabs, .ref .pin, .ref .why, .tst-back,
  .bg-pop, .dsg-pop { display: none !important; }
  .slide-bg video, .ref video { display: none !important; }  /* الطباعة بتاخد الصور الثابتة */
  .ref .ref-print { display: block !important; }
  .tst-wrap { max-width: none; padding: 0; }
  .deck { gap: 0; }
  .slide { break-after: page; border-radius: 0; box-shadow: none; aspect-ratio: auto; min-height: 96vh;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .s-text { max-height: none; overflow: visible; }
  .srefs { position: static; width: auto; max-width: none; margin-top: 16px; }
  .stray { display: none !important; }
}

@media (max-width: 700px) {
  .refs-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ✕ مسح ريفرنس من المشهد */
.ref-del { position: absolute; top: 6px; right: 34px; background: rgba(0,0,0,0.62); border: none; color: #fff;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 11px; opacity: 0.9; transition: opacity 0.15s; z-index: 4; }
.ref:hover .ref-del { opacity: 1; }
.ref-del:hover { background: #e5484d; }

/* رقم السلايد — لمسة الديك الاحترافي */
.s-num { position: absolute; bottom: 3.5%; right: 5%; z-index: 3; font-family: var(--t-mono);
  font-size: max(8px, 0.95cqi); letter-spacing: 2px; opacity: 0.5; }

/* محرر العناصر: أي كلام تدوس عليه يتحدد وتعدّله من البانل يمين (مفيش سحب) */
.layout-on .ed-el { outline: 1px dashed color-mix(in srgb, var(--t-accent) 45%, transparent); outline-offset: 5px; cursor: pointer; }
.layout-on .ed-el:hover { outline-color: var(--t-accent); }
.layout-on .ed-sel { outline: 2px solid var(--t-accent) !important; outline-offset: 5px; }
.el-toolbar { position: fixed; z-index: 320; display: flex; align-items: center; gap: 4px;
  background: #16150f; border: 1px solid #37332a; border-radius: 10px; padding: 5px 6px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.55); }
.el-toolbar select { background: #262319; color: #ece6d8; border: 1px solid #37332a; border-radius: 7px; font-size: 11.5px; padding: 4px 6px; max-width: 120px; }
.el-toolbar button { background: #262319; color: #ece6d8; border: 1px solid #37332a; border-radius: 7px;
  cursor: pointer; font-size: 12px; padding: 5px 9px; min-width: 30px; }
.el-toolbar button:hover { border-color: var(--amber); color: var(--amber); }
.el-toolbar .et-del:hover { border-color: var(--red); color: var(--red); }

/* ═══════════ صفحة البيلد الجديدة — بريف منظّم + ٦ عوالم ═══════════ */
.tst-new h2 { font-size: 20px; }
.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 6px; }
.brief-box { display: flex; flex-direction: column; gap: 6px; }
.brief-box.full { grid-column: 1 / -1; }
.bb-lab { font-size: 12.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; }
.bb-req, .bb-opt { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: 1px; padding: 1px 6px; border-radius: 999px; font-style: normal; }
.bb-req { color: #101010; background: var(--amber); }
.bb-opt { color: var(--dim); border: 1px solid var(--line); }
.brief-box textarea { width: 100%; min-height: 66px; resize: vertical; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13px; line-height: 1.5; }
.brief-box.full textarea { min-height: 96px; }
.brief-box textarea:focus { outline: none; border-color: var(--amber); }
.brief-box textarea::placeholder { color: var(--dim); opacity: .8; }

.dur-wrap { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
.dur-lab { font-size: 12.5px; font-weight: 600; }
.dur-row { display: flex; gap: 7px; }
.dur-chip { background: var(--bg); color: var(--dim); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 15px; font: inherit; font-size: 12.5px; cursor: pointer; }
.dur-chip:hover { color: var(--text); }
.dur-chip.on { color: #101010; background: var(--amber); border-color: var(--amber); font-weight: 600; }

.worlds-lab { font-size: 12.5px; font-weight: 600; margin: 20px 0 10px; }
.worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.w-card { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 9px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; text-align: center; transition: box-shadow .14s, border-color .14s; }
.w-card.on { border-color: #34d17a; box-shadow: 0 0 0 2px #34d17a, 0 0 22px rgba(52,209,122,.45); }
.w-prev { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; container-type: inline-size; overflow: hidden; }
.w-name { font-size: 19px; line-height: 1; font-weight: 700; margin-top: 9px; }
.w-tag { font-size: 9.5px; color: var(--dim); margin: 9px 0 9px; }
.w-card.on .w-name { color: #34d17a; }
.w-btns { display: flex; gap: 6px; padding: 0 9px; margin-top: auto; }
.w-btn { flex: 1; padding: 7px 4px; border-radius: 7px; font: inherit; font-size: 11.5px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); transition: border-color .12s, background .12s; }
.w-preview:hover { border-color: var(--amber); color: var(--amber); }
.w-select { background: var(--panel); }
.w-select:hover { border-color: #34d17a; color: #34d17a; }
.w-card.on .w-select { background: #34d17a; border-color: #34d17a; color: #06210f; font-weight: 700; }
.w-card.on .w-select::before { content: "✓ "; }

/* معاينات العوالم المصغّرة (وحدة cqw = 1% من عرض المعاينة) */
.w-prev b, .w-prev span { position: absolute; }
/* 1 — At Hopper's */
.w-hoppers { background: #fee4cd; }
.wp-frame { inset: 0; border: 2.2cqw solid #e4141a; }
.wp-t { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wp-script { position: static; font-family: 'Lobster', cursive; color: #e4141a; font-size: 15cqw; line-height: .7; transform: translate(-6cqw, 3cqw) rotate(-6deg); z-index: 2; }
.wp-round { position: static; font-family: 'Baloo 2', cursive; font-weight: 800; color: #f0b840; font-size: 16cqw; line-height: .8; letter-spacing: .3cqw; }
/* 2 — Sizzle */
.w-sizzle { background: radial-gradient(60% 70% at 42% 60%, #f7a12b, #c4471a 38%, #1a0a05 85%); }
.wp-bar { left: 0; right: 0; height: 20%; background: #0a0a0a; } .wp-bar.t { top: 0; } .wp-bar.b { bottom: 0; }
.wp-tag { top: 12%; left: 50%; transform: translateX(-50%); background: #f4c518; color: #111; font: 700 5.5cqw/1 Helvetica, sans-serif; padding: 1.5cqw 3cqw; white-space: nowrap; z-index: 2; }
.wp-brush { position: static; margin: auto; inset: 0; height: fit-content; font-family: 'Permanent Marker', cursive; color: #d83a29; font-size: 15cqw; transform: skewX(-6deg); text-shadow: .6cqw 1cqw 0 rgba(0,0,0,.5); z-index: 2; }
/* 3 — Our Summer */
.w-summer { background: linear-gradient(120deg, #8fb4cc, #a9c3d2 45%, #d8a86a); }
.wp-anton { left: 6cqw; bottom: 3cqw; position: absolute; font-family: 'Anton', sans-serif; color: #ffbd16; font-size: 20cqw; line-height: .82; text-align: left; }
/* 4 — Bright */
.w-bright { background: radial-gradient(60% 75% at 50% 45%, #efe0a8, #b98a3c 34%, #6e3f24 62%, #2f5a3a); }
.wp-thinframe { inset: 5%; border: 1cqw solid #f8e068; }
.wp-outline { position: static; margin: auto; inset: 0; height: fit-content; font-family: 'Baloo 2', cursive; font-weight: 800; color: transparent; -webkit-text-stroke: 1cqw #f8e068; font-size: 16cqw; text-shadow: 1cqw 1.4cqw 0 rgba(0,0,0,.25); }
/* 5 — Enter the Vibe */
.w-vibe { background: conic-gradient(from 210deg at 45% 55%, #2a1a6a, #c81e8a, #e08a2a, #1a6a8a, #6a2ac8, #2a1a6a); }
.wp-neon { position: static; margin: auto; inset: 0; height: fit-content; font-family: 'Anton', sans-serif; color: #5ce23f; font-size: 15cqw; }
.wp-logo { right: 4cqw; bottom: 3cqw; font-family: 'Anton', sans-serif; color: #5ce23f; font-size: 6cqw; line-height: .82; text-align: right; }
/* 6 — The Champion */
.w-champion { background: radial-gradient(70% 90% at 50% 40%, #26221e, #0e0f0d 60%, #000); }
.wp-the { left: 8cqw; top: 20%; position: absolute; font-family: 'Anton', sans-serif; font-style: italic; color: #de3a1e; font-size: 13cqw; transform: skewX(-8deg); }
.wp-champ { left: 3cqw; right: 3cqw; top: 40%; text-align: center; position: absolute; font-family: 'Anton', sans-serif; color: transparent; -webkit-text-stroke: .7cqw #9a9a9a; font-size: 20cqw; }
.wp-rtag { right: 6cqw; bottom: 14%; background: #de3a1e; color: #fff; font: 700 5cqw/1 Helvetica, sans-serif; padding: 1.5cqw 2.5cqw; z-index: 2; }

@media (max-width: 720px) {
  .brief-grid { grid-template-columns: 1fr; }
  .worlds { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════ بوب-أب معاينة الستايل (صفحات التريتمنت جنب بعض) ═══════════ */
.pv-modal { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.pv-box { width: min(1120px, 95vw); height: min(88vh, 940px); background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.pv-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.pv-bar b { font-size: 15px; }
.pv-bar span { color: var(--dim); font-size: 12px; }
.pv-select { margin-left: auto; background: #34d17a; color: #06210f; border: none; border-radius: 8px;
  padding: 8px 15px; font: inherit; font-weight: 700; cursor: pointer; }
.pv-select:hover { filter: brightness(1.08); }
.pv-close { background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 14px; }
.pv-close:hover { border-color: var(--red); color: var(--red); }
.pv-frame { flex: 1; width: 100%; border: none; background: var(--bg); }

/* ═══════════ Treatment Studio — لاندنج + شاشة المشاريع ═══════════ */
.tst-hub { text-align: center; max-width: 640px; margin: 7vh auto 0; padding: 24px 20px; }
.tst-hub h1 { font-size: 34px; margin: 14px 0 14px; letter-spacing: -0.5px; }
.tst-hub p { color: var(--dim); font-size: 15px; line-height: 1.7; margin: 0 auto 30px; max-width: 54ch; }
.hub-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hub-load { color: var(--dim); padding: 36px; }
.btn.big { font-size: 15px; padding: 13px 26px; border-radius: 10px; }
/* شريط علوي (البناء / المشاريع) */
.tst-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.tst-top .tst-h { flex: 1; margin: 0; font-size: 20px; }
.tst-top .brand-tag { margin-left: 2px; }
/* كروت المشاريع: تعديل + حذف */
.tst-item { cursor: default; }
.tst-item-acts { display: flex; gap: 8px; margin-top: 13px; }
.btn.sm { font-size: 12.5px; padding: 7px 13px; border-radius: 8px; text-decoration: none; display: inline-flex; align-items: center; }
.tst-item .del:hover { color: var(--red); border-color: rgba(229,72,77,0.5); }
.tst-empty { grid-column: 1 / -1; text-align: center; color: var(--dim); padding: 42px;
  display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* ═══════════ Treatment Studio — بوليش سينماتك ٢٠٢٦ ═══════════ */
/* كروت المشاريع — أغنى، حافة تضيء وتوهّج ناعم عند الهوفر */
.tst-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tst-item {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.12)), var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px 20px;
  position: relative; overflow: hidden;
  transition: transform .2s cubic-bezier(.2,.75,.25,1), border-color .2s, box-shadow .2s;
}
.tst-item::before {   /* شريط أمبر رفيع على الحافة العليا */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent); opacity: .5;
}
.tst-item:hover { transform: translateY(-3px); border-color: rgba(255,178,36,.5);
  box-shadow: 0 16px 40px -18px rgba(0,0,0,.8), 0 0 0 1px rgba(255,178,36,.15); }
.tst-item h3 { font-size: 19px; letter-spacing: -.3px; margin: 4px 0 6px; }
.tst-item .meta { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: 1px; color: var(--dim); }
.tst-item-acts { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.btn.sm { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; }
.btn.sm .ic svg { width: 16px; height: 16px; }
.tst-item .del { color: var(--dim); }
.tst-item .del:hover { color: var(--red); border-color: rgba(229,72,77,.5); box-shadow: 0 0 0 1px rgba(229,72,77,.3); background: rgba(229,72,77,.08); }

/* اللاندنج — عنوان أفخم وأزرار أكبر */
.tst-hub h1 { letter-spacing: -1px; font-weight: 800; }
.tst-hub .btn.big { padding: 15px 30px; font-size: 15px; display: inline-flex; align-items: center; gap: 9px; }
.tst-hub .btn.big .ic svg { width: 18px; height: 18px; }

/* ─── اختيار سلايدات التريتمنت — دواير سينمائية (ذهبي = داخل الديك) ─── */
.sec-pick { margin: 30px 0 8px; text-align: center; }
.sec-kick { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 3.5px; color: #d9a441; }
.sec-head2 { font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 27px; margin: 7px 0 5px; letter-spacing: -.01em; color: #f4f2ec; }
.sec-sub { color: #8e8c85; font-size: 13px; margin: 0 0 20px; }
.sec-sub b { color: #d9a441; font-weight: 600; }
.sec-circles { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; max-width: 780px; margin: 0 auto; }
.sec-c { width: 98px; height: 98px; border-radius: 50%; border: 1px solid #2c2c30; background: #161618;
  color: #8e8c85; font-size: 11.5px; line-height: 1.3; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px;
  transition: transform .15s, background .15s, color .15s, border-color .15s; }
.sec-c:hover { border-color: #d9a441; color: #f4f2ec; transform: translateY(-2px); }
.sec-c.on { background: #d9a441; border-color: #d9a441; color: #141210; font-weight: 700; transform: scale(1.05); }
@media (max-width: 640px) { .sec-c { width: 84px; height: 84px; font-size: 10.5px; } }
