/* عدسة النهار — التصميم | جميع الحقوق محفوظة © 2026 وطن النهار */
@font-face { font-family: 'Cairo'; src: url('../assets/fonts/Cairo.ttf') format('truetype'); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: 'ElMessiri'; src: url('../assets/fonts/ElMessiri.ttf') format('truetype'); font-weight: 400 700; font-display: swap; }
:root {
  --bg: #08080a; --bg2: #0e0e11; --panel: #131317; --panel2: #1a1a20; --line: rgba(255, 255, 255, .07); --line2: rgba(255, 255, 255, .12);
  --txt: #f1ebdf; --muted: #9a958b; --gold: #e7b453; --gold2: #f6d58f; --gold-d: #a8762a; --danger: #e05757; --ok: #5fc48a;
  --r: 14px; --r-sm: 9px; --top: 58px; --rail: 86px; --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .8); --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; font-size: 15px; line-height: 1.6; }
body { overflow: hidden; background: radial-gradient(1200px 600px at 85% -10%, rgba(231, 180, 83, .09), transparent 60%), radial-gradient(900px 500px at 0% 110%, rgba(60, 90, 140, .08), transparent 60%), var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.big { width: 44px; height: 44px; stroke-width: 1.3; color: var(--gold); }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .gold-txt { color: var(--gold); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
::selection { background: rgba(231, 180, 83, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #2a2a31; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-track { background: transparent; }

/* حبيبات الفيلم */
.grain { position: fixed; inset: -50%; pointer-events: none; z-index: 9999; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0) } 20% { transform: translate(-3%, 2%) } 40% { transform: translate(2%, -3%) } 60% { transform: translate(-2%, -1%) } 80% { transform: translate(3%, 3%) } 100% { transform: translate(0, 0) } }
@media (prefers-reduced-motion: reduce) { .grain { animation: none } * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* شاشة البداية */
#splash { position: fixed; inset: 0; z-index: 10000; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--bg); transition: opacity .6s var(--ease), visibility .6s; }
#splash img { width: 92px; height: 92px; animation: spin-in 1.2s var(--ease) both; }
#splash .splash-name { font-family: 'ElMessiri'; font-size: 26px; font-weight: 700; color: var(--gold2); letter-spacing: .5px; animation: fade-up .9s .2s var(--ease) both; }
#splash.gone { opacity: 0; visibility: hidden; }
@keyframes spin-in { from { transform: rotate(-120deg) scale(.6); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes fade-up { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }

/* الهيكل */
#app { height: 100%; display: grid; grid-template-rows: var(--top) 1fr; grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
body.in-project #app { grid-template-columns: var(--rail) 1fr; grid-template-areas: "top top" "rail main"; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 18px; padding-top: env(safe-area-inset-top, 0); border-bottom: 1px solid var(--line); background: rgba(10, 10, 12, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { width: 34px; height: 34px; transition: transform .6s var(--ease); }
.brand:hover .brand-logo { transform: rotate(60deg); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt b { font-family: 'ElMessiri'; font-size: 18px; color: var(--gold2); }
.brand-txt small { font-size: 8.5px; letter-spacing: 2.4px; color: var(--muted); direction: ltr; text-align: right; }
.proj-title { flex: 1; text-align: center; font-weight: 700; font-size: 15px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.save-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-inline-end: 6px; min-width: 70px; justify-content: flex-end; transition: color .3s; }
.save-state .ic { width: 15px; height: 15px; color: var(--ok); }
.save-state.saving i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: pulse 1s infinite; }
.save-state.error { color: var(--danger); }
@keyframes pulse { 50% { opacity: .25 } }
.rail { grid-area: rail; display: flex; flex-direction: column; gap: 6px; padding: 14px 10px; border-inline-end: 1px solid var(--line); background: rgba(12, 12, 14, .7); z-index: 15; }
.rail:empty { display: none; }
.rail-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; position: relative; transition: color .25s, background .25s; }
.rail-item .ic { width: 23px; height: 23px; transition: transform .35s var(--ease); }
@media (hover: hover) { .rail-item:hover { color: var(--txt); background: rgba(255, 255, 255, .04); } .rail-item:hover .ic { transform: translateY(-2px); } }
.rail-item.on { color: var(--gold2); background: linear-gradient(180deg, rgba(231, 180, 83, .16), rgba(231, 180, 83, .05)); }
.rail-item.on::before { content: ''; position: absolute; inset-inline-start: -10px; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.rail-item.home { margin-bottom: 10px; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; padding-bottom: 14px; }
#view { grid-area: main; overflow: auto; position: relative; outline: none; -webkit-overflow-scrolling: touch; }
#view.enter > * { animation: view-in .5s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* أزرار وحقول */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line2); background: var(--panel2); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; transition: transform .2s var(--ease), background .25s, border-color .25s, box-shadow .25s; user-select: none; }
.btn:hover { background: #22222a; border-color: rgba(255, 255, 255, .2); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; } .btn.sm .ic { width: 17px; height: 17px; }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn.gold { background: linear-gradient(135deg, #f6d58f, #e7b453 45%, #b9822f); color: #1a1205; border-color: transparent; box-shadow: 0 8px 26px -10px rgba(231, 180, 83, .7), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn.gold:hover { box-shadow: 0 10px 32px -8px rgba(231, 180, 83, .85), inset 0 1px 0 rgba(255, 255, 255, .5); filter: brightness(1.05); }
.btn.danger { background: rgba(224, 87, 87, .15); border-color: rgba(224, 87, 87, .4); color: #ffb3b3; }
.btn.ghost { background: transparent; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--txt); cursor: pointer; transition: background .2s, transform .2s, color .2s; }
.icon-btn:hover { background: rgba(255, 255, 255, .07); }
.icon-btn:active { transform: scale(.9); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.icon-btn.sm { width: 32px; height: 32px; } .icon-btn.sm .ic { width: 17px; height: 17px; }
.icon-btn.danger:hover { color: var(--danger); background: rgba(224, 87, 87, .12); }
.icon-btn.on { color: var(--gold); background: rgba(231, 180, 83, .12); }
.select, .input, .form input, .form select, .form textarea, .fld textarea { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: #0f0f13; color: var(--txt); outline: none; transition: border-color .2s, box-shadow .2s; }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 16px 50%, 11px 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 30px; }
.select.sm { height: 34px; width: auto; font-size: 13px; }
textarea.input, .form textarea, .fld textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.select:focus, .input:focus, .form input:focus, .form select:focus, .form textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231, 180, 83, .18); }
.form { display: grid; gap: 14px; }
.form label, .fld { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shake { animation: shake .4s; border-color: var(--danger) !important; }
@keyframes shake { 25% { transform: translateX(6px) } 50% { transform: translateX(-6px) } 75% { transform: translateX(3px) } }
.chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; font-size: 13px; }
.chip:hover { border-color: var(--gold); color: var(--gold2); }

/* نوافذ */
.modal-back { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.modal-back.in { opacity: 1; }
.modal { width: min(460px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: linear-gradient(180deg, #18181d, #121216); border: 1px solid var(--line2); border-radius: 20px; box-shadow: var(--shadow), 0 0 0 1px rgba(231, 180, 83, .05); transform: translateY(18px) scale(.97); transition: transform .35s var(--ease); }
.modal.wide { width: min(720px, 100%); }
.modal-back.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.modal-head h3 { font-size: 18px; font-family: 'ElMessiri'; color: var(--gold2); }
.modal-body { padding: 8px 20px 12px; overflow: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; }
.modal-actions .btn.danger { margin-inline-end: auto; }
#toasts { position: fixed; z-index: 1000; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
body.in-project #toasts { bottom: calc(90px + var(--safe-b)); }
.toast { padding: 10px 18px; border-radius: 12px; background: rgba(28, 28, 34, .96); border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(12px) scale(.96); transition: all .35s var(--ease); white-space: nowrap; }
.toast.in { opacity: 1; transform: none; }
.toast.err { border-color: rgba(224, 87, 87, .5); color: #ffc0c0; }

/* الرئيسية */
.home { max-width: 1240px; margin: 0 auto; padding: 22px 18px 120px; }
.hero { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 20px; padding: 40px 36px; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(120deg, rgba(231, 180, 83, .1), rgba(20, 20, 24, .6) 45%), #0f0f12; box-shadow: var(--shadow); }
.hero::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 46px, rgba(255, 255, 255, .018) 46px 47px); pointer-events: none; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--gold); padding: 4px 12px; border-radius: 99px; background: rgba(231, 180, 83, .1); border: 1px solid rgba(231, 180, 83, .25); }
.eyebrow .ic { width: 15px; height: 15px; }
.hero h1 { font-family: 'ElMessiri'; font-size: clamp(30px, 4.4vw, 52px); margin: 14px 0 10px; line-height: 1.25; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--gold2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #bdb6a8; margin: 0 0 22px; font-size: 16px; max-width: 520px; }
.hero-art { position: relative; height: 240px; display: grid; place-items: center; }
.hero-art img { width: 170px; height: 170px; filter: drop-shadow(0 20px 40px rgba(231, 180, 83, .35)); animation: float 6s ease-in-out infinite; z-index: 1; }
.hero-art .ring { position: absolute; border-radius: 50%; border: 1px solid rgba(231, 180, 83, .2); }
.hero-art .r1 { width: 230px; height: 230px; animation: spin 30s linear infinite; border-style: dashed; }
.hero-art .r2 { width: 300px; height: 300px; border-color: rgba(231, 180, 83, .08); }
@keyframes float { 50% { transform: translateY(-10px) rotate(8deg) } }
@keyframes spin { to { transform: rotate(360deg) } }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 30px 2px 14px; }
.sec-head h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; padding: 1px 9px; border-radius: 99px; background: var(--panel2); color: var(--gold); border: 1px solid var(--line2); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.proj-card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform .4s var(--ease), border-color .3s, box-shadow .4s; animation: card-in .6s calc(var(--i) * 60ms) var(--ease) both; }
.proj-card:hover { transform: translateY(-5px); border-color: rgba(231, 180, 83, .35); box-shadow: 0 24px 50px -24px rgba(231, 180, 83, .35); }
.proj-card.leaving { transform: scale(.9); opacity: 0; transition: all .3s; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.98) } to { opacity: 1; transform: none } }
.poster { position: relative; aspect-ratio: 16/10; display: block; overflow: hidden; background: linear-gradient(160deg, var(--c1), var(--c2)); }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.proj-card:hover .poster img, .proj-card:hover .poster-auto { transform: scale(1.06); }
.poster-auto { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; transition: transform .8s var(--ease); background: radial-gradient(circle at 50% 120%, rgba(231, 180, 83, .35), transparent 60%); }
.poster-auto span { font-family: 'ElMessiri'; font-size: 26px; font-weight: 700; color: var(--gold2); text-shadow: 0 4px 20px rgba(0, 0, 0, .6); }
.poster::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 10, 12, .7), transparent 50%); }
.genre-chip { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 1; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .15); backdrop-filter: blur(6px); }
.pc-body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pc-body h3 { font-size: 17px; }
.logline { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 41px; }
.pc-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pc-meta span { display: inline-flex; align-items: center; gap: 4px; } .pc-meta .ic { width: 14px; height: 14px; color: var(--gold-d); }
.pc-meta .date { margin-inline-start: auto; }
.pc-actions { display: flex; gap: 4px; align-items: center; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.pc-actions .btn { margin-inline-end: auto; }
.empty { grid-column: 1/-1; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 50px 20px; border: 1px dashed var(--line2); border-radius: 20px; background: rgba(255, 255, 255, .015); }
.empty h3 { font-size: 18px; } .empty p { color: var(--muted); margin: 0 0 8px; }
.poster-pick { aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; border: 1px dashed var(--line2); cursor: pointer; display: grid; place-items: center; background: #0f0f13; transition: border-color .2s; }
.poster-pick:hover { border-color: var(--gold); }
.poster-pick img { width: 100%; height: 100%; object-fit: cover; }
.pp-empty { display: grid; justify-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.modal .form:has(.poster-pick) { grid-template-columns: 170px 1fr; align-items: start; }
.form-col { display: grid; gap: 14px; }

/* السيناريو */
.script-wrap { display: grid; grid-template-columns: 250px 1fr; height: 100%; }
.scene-nav { border-inline-end: 1px solid var(--line); padding: 16px 12px; overflow: auto; background: rgba(12, 12, 14, .5); }
.nav-head { display: flex; align-items: center; gap: 8px; color: var(--gold2); margin-bottom: 10px; padding: 0 6px; }
.scene-nav-list { display: grid; gap: 4px; }
.scene-nav-list button { display: flex; gap: 10px; align-items: flex-start; text-align: start; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; font-size: 13px; color: #cfc8ba; transition: background .2s; }
.scene-nav-list button:hover { background: rgba(255, 255, 255, .05); }
.scene-nav-list b { color: var(--gold); min-width: 18px; }
.scene-nav-list span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.script-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.script-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(14, 14, 17, .8); flex-wrap: wrap; }
.type-btns { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #0d0d10; border: 1px solid var(--line); overflow-x: auto; max-width: 100%; }
.type-btn { height: 32px; padding: 0 13px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--muted); white-space: nowrap; transition: all .2s; }
.type-btn:hover { color: var(--txt); }
.type-btn.on { background: linear-gradient(135deg, #f6d58f, #e7b453); color: #1a1205; box-shadow: 0 4px 14px -6px rgba(231, 180, 83, .8); }
.tb-end { display: flex; gap: 6px; }
.char-chips { display: none; gap: 6px; padding: 8px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.char-chips.show:not(:empty) { display: flex; }
.paper-scroll { flex: 1; overflow: auto; padding: 26px 16px 60px; }
.paper { max-width: 760px; margin: 0 auto; min-height: 80%; padding: 50px 64px 80px; border-radius: 6px; background: linear-gradient(180deg, #f4efe4, #ece5d6); color: #1b1712; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04); font-size: 16px; cursor: text; }
.paper-title { text-align: center; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid rgba(0, 0, 0, .12); }
.paper-title h2 { font-family: 'ElMessiri'; font-size: 28px; }
.paper-title p { color: #6b6255; margin: 6px 0 0; font-size: 14px; }
.sl { outline: none; min-height: 1.7em; padding: 1px 6px; border-radius: 4px; transition: background .15s; white-space: pre-wrap; word-break: break-word; position: relative; }
.sl:focus { background: rgba(231, 180, 83, .16); }
.sl:empty::before { content: attr(data-ph); color: rgba(0, 0, 0, .3); pointer-events: none; }
.sl-scene { font-weight: 800; margin-top: 22px; letter-spacing: .2px; background: rgba(0, 0, 0, .045); padding: 4px 10px; }
.sl-scene::after { content: attr(data-num); position: absolute; inset-inline-start: -44px; top: 4px; font-weight: 800; color: #a8762a; min-width: 30px; text-align: center; }
.sl-scene:empty::after { content: attr(data-num); }
.sl-scene:empty::before { content: attr(data-ph); }
.sl-action { margin-top: 10px; }
.sl-character { font-weight: 800; text-align: center; margin: 16px 28% 0; }
.sl-paren { text-align: center; margin: 0 30%; font-style: italic; color: #4c443a; font-size: 14.5px; }
.sl-dialogue { margin: 0 18%; text-align: center; }
.sl-transition { text-align: left; font-weight: 800; margin-top: 14px; }
.script-help { text-align: center; margin: 14px 0 0; }
.script-stats { display: flex; gap: 18px; justify-content: center; padding: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: rgba(14, 14, 17, .8); }

/* عناوين الصفحات */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-family: 'ElMessiri'; font-size: 26px; color: var(--gold2); }
.page-head p { margin: 2px 0 0; font-size: 13.5px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ph-actions .select { width: auto; max-width: 240px; }

/* لوحة القصة */
.board, .shots, .about { max-width: 1320px; margin: 0 auto; padding: 22px 18px 120px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.sb-card { border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: transform .35s var(--ease), border-color .3s, box-shadow .35s; animation: card-in .5s calc(var(--i) * 45ms) var(--ease) both; }
.sb-card:hover { transform: translateY(-3px); border-color: rgba(231, 180, 83, .35); box-shadow: 0 18px 40px -22px rgba(231, 180, 83, .4); }
.sb-frame { position: relative; aspect-ratio: 16/9; background: #0b0b0e; display: grid; place-items: center; overflow: hidden; }
.sb-frame img { width: 100%; height: 100%; object-fit: cover; }
.sb-frame::before { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), inset 0 -40px 40px -30px rgba(0, 0, 0, .8); z-index: 1; pointer-events: none; }
.sb-empty { display: flex; gap: 8px; }
.sb-num { position: absolute; bottom: 8px; inset-inline-start: 10px; z-index: 2; font-weight: 800; font-size: 13px; color: var(--gold2); text-shadow: 0 2px 8px #000; }
.sb-handle { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 0; color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); cursor: grab; touch-action: none; }
.sb-done { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #062; }
.sb-done .ic { width: 16px; height: 16px; stroke-width: 3; }
.sb-info { padding: 12px 14px 14px; display: grid; gap: 8px; }
.sb-scene { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-tags span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: #1d1d23; border: 1px solid var(--line); }
.sb-tags .ic { width: 13px; height: 13px; color: var(--gold); }
.sb-notes { margin: 0; font-size: 13px; color: #c6bfb1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.drag-ghost { position: fixed; z-index: 2000; pointer-events: none; opacity: .92; transform: rotate(2deg) scale(1.03); box-shadow: 0 30px 60px -20px #000; border-color: var(--gold) !important; animation: none !important; }
.drag-src { opacity: .25; }
.shot-form { grid-template-columns: 1fr; }
.sf-img { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #0f0f13; border: 1px dashed var(--line2); display: grid; place-items: center; }
.sf-img img { width: 100%; height: 100%; object-fit: cover; }
.sf-img-btns { position: absolute; bottom: 10px; inset-inline-start: 10px; display: flex; gap: 6px; }
.draw-modal { width: min(980px, 100%) !important; }
.draw-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); background: var(--c); cursor: pointer; transition: transform .2s; }
.swatch.on { border-color: var(--gold); transform: scale(1.15); box-shadow: 0 0 0 2px #000 inset; }
.size { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; }
.size i { display: block; border-radius: 50%; background: var(--txt); }
.size.on { border-color: var(--gold); }
.sep { width: 1px; height: 24px; background: var(--line2); margin: 0 4px; }
.draw-stage { position: relative; border-radius: 10px; overflow: hidden; }
.draw-stage canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.thirds { position: absolute; inset: 0; pointer-events: none; display: none; background: linear-gradient(90deg, transparent 33.1%, rgba(0, 0, 0, .25) 33.3% 33.5%, transparent 33.7% 66.3%, rgba(0, 0, 0, .25) 66.5% 66.7%, transparent 66.9%), linear-gradient(0deg, transparent 33.1%, rgba(0, 0, 0, .25) 33.3% 33.5%, transparent 33.7% 66.3%, rgba(0, 0, 0, .25) 66.5% 66.7%, transparent 66.9%); }
.thirds.on { display: block; }

/* جدول التصوير */
.progress-card { padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 16px; }
.pc-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.bar { height: 8px; border-radius: 9px; background: #222229; overflow: hidden; }
.bar.big { height: 12px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--gold-d), var(--gold), var(--gold2)); box-shadow: 0 0 16px rgba(231, 180, 83, .6); transition: width .5s var(--ease); }
.days { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.day-card { position: relative; flex: none; width: 210px; display: grid; gap: 3px; text-align: start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: all .3s var(--ease); animation: card-in .5s calc(var(--i) * 50ms) var(--ease) both; }
.day-card:hover { border-color: rgba(231, 180, 83, .4); transform: translateY(-2px); }
.day-card.on { border-color: var(--gold); background: linear-gradient(160deg, rgba(231, 180, 83, .14), var(--panel)); }
.day-card .ic { width: 13px; height: 13px; vertical-align: -2px; }
.day-n { font-size: 12px; font-weight: 800; color: var(--gold); }
.day-prog { font-size: 12px; color: var(--muted); }
.day-edit { position: absolute; top: 10px; inset-inline-end: 10px; opacity: .5; }
.day-edit:hover { opacity: 1; color: var(--gold); }
.day-card.add { place-items: center; place-content: center; color: var(--muted); border-style: dashed; min-height: 110px; animation: none; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-tabs button { height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2); background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); transition: all .2s; }
.filter-tabs button.on { background: var(--gold); color: #1a1205; border-color: var(--gold); }
.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.shot-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.shot-table th { text-align: start; padding: 11px 10px; font-size: 12px; color: var(--muted); font-weight: 700; background: #17171c; position: sticky; top: 0; white-space: nowrap; }
.shot-table td { padding: 8px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
.shot-table tr { transition: background .2s, opacity .3s; }
.shot-table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.shot-table tr.is-done td:not(:first-child) { opacity: .5; }
.shot-table td.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.shot-table input, .shot-table select { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #0f0f13; padding: 0 8px; min-width: 110px; width: 100%; outline: none; }
.shot-table input:focus, .shot-table select:focus { border-color: var(--gold); }
.check { display: inline-grid; cursor: pointer; position: relative; }
.check input, .shot-table .check input { position: absolute; opacity: 0; width: 1px; height: 1px; min-width: 0; padding: 0; border: 0; }
.check i { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line2); display: grid; place-items: center; transition: all .25s var(--ease); }
.check i .ic { width: 16px; height: 16px; stroke-width: 3; opacity: 0; transform: scale(.4); transition: all .25s var(--ease); color: #1a1205; }
.check input:checked + i { background: var(--gold); border-color: var(--gold); }
.check input:checked + i .ic { opacity: 1; transform: none; }

/* المونتاج */
.view-edit { overflow: hidden !important; }
.editor { display: grid; height: 100%; grid-template-columns: 250px minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "bin preview insp" "tl tl tl"; }
.ed-preview { grid-area: preview; display: flex; flex-direction: column; min-height: 0; padding: 12px 12px 0; }
.stage-wrap { flex: 1; min-height: 0; display: grid; place-items: center; }
.stage { position: relative; background: #000; border-radius: 6px; overflow: hidden; box-shadow: 0 30px 60px -30px #000, 0 0 0 1px rgba(255, 255, 255, .06); }
.stage canvas { width: 100%; height: 100%; display: block; }
.stage-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); text-align: center; padding: 20px; background: radial-gradient(circle, rgba(231, 180, 83, .07), transparent 70%); }
.stage-empty p { margin: 0; font-size: 14px; }
.transport { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 10px 2px; }
.tp-main { display: flex; align-items: center; gap: 10px; }
.tp-side { display: flex; align-items: center; gap: 8px; }
.tp-side.end { justify-content: flex-end; }
.play-btn { width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #1a1205; background: linear-gradient(135deg, #f6d58f, #e7b453 50%, #b9822f); box-shadow: 0 8px 26px -8px rgba(231, 180, 83, .8); transition: transform .2s var(--ease), box-shadow .3s; }
.play-btn:hover { transform: scale(1.06); } .play-btn:active { transform: scale(.92); }
.play-btn.on { box-shadow: 0 0 0 6px rgba(231, 180, 83, .15), 0 8px 26px -8px rgba(231, 180, 83, .8); }
.play-btn .ic { width: 22px; height: 22px; }
.tc .tot { color: var(--muted); }
.tc { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; color: var(--gold2); direction: ltr; background: #0d0d10; border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.panel { background: rgba(14, 14, 17, .85); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ed-bin { grid-area: bin; border-inline-end: 1px solid var(--line); }
.ed-insp { grid-area: insp; border-inline-start: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); min-height: 56px; }
.panel-head b { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.panel-head b .ic { color: var(--gold); width: 18px; height: 18px; }
.bin-list { flex: 1; overflow: auto; padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.ed-bin.busy .bin-list { opacity: .5; pointer-events: none; }
.bin-item { position: relative; border-radius: 10px; overflow: hidden; background: #0d0d10; border: 1px solid var(--line); cursor: grab; transition: transform .25s var(--ease), border-color .2s; animation: card-in .4s var(--ease) both; }
.bin-item:hover { border-color: rgba(231, 180, 83, .45); transform: translateY(-2px); }
.bi-thumb { aspect-ratio: 16/10; display: grid; place-items: center; background: #15151a; position: relative; color: var(--muted); }
.bi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bi-dur { position: absolute; bottom: 4px; left: 4px; font-size: 10.5px; padding: 0 5px; border-radius: 5px; background: rgba(0, 0, 0, .7); direction: ltr; }
.bi-kind { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: rgba(0, 0, 0, .6); }
.bi-kind .ic { width: 13px; height: 13px; }
.k-audio .bi-thumb { background: linear-gradient(135deg, #12382c, #0d1f19); color: #7fe0b5; }
.bi-name { font-size: 11.5px; padding: 4px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #cfc8ba; }
.bi-add { position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 8px; border: 0; display: grid; place-items: center; background: var(--gold); color: #1a1205; cursor: pointer; transition: transform .2s; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.bi-add:hover { transform: scale(1.12); } .bi-add .ic { width: 17px; height: 17px; stroke-width: 2.4; }
.bin-empty { grid-column: 1/-1; display: grid; justify-items: center; gap: 6px; padding: 28px 14px; border-radius: 14px; border: 1.5px dashed rgba(231, 180, 83, .35); background: rgba(231, 180, 83, .04); cursor: pointer; text-align: center; color: var(--txt); transition: background .2s; }
.bin-empty:hover { background: rgba(231, 180, 83, .08); }
.bin-empty span { font-size: 12px; color: var(--muted); }
.bin-quick { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bin-quick .btn { flex: 1; padding: 0 8px; }
.insp-tabs { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.insp-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 12.5px; cursor: pointer; transition: all .2s; }
.insp-tabs button .ic { width: 16px; height: 16px; }
.insp-tabs button.on { background: rgba(231, 180, 83, .14); color: var(--gold2); }
.insp-body { flex: 1; overflow: auto; padding: 12px 14px 20px; display: grid; gap: 12px; align-content: start; }
.kv { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 8px; font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: #0d0d10; border: 1px solid var(--line); }
.kv span { color: var(--muted); } .kv b { direction: ltr; text-align: right; font-weight: 700; color: var(--gold2); }
.sld { display: grid; gap: 2px; }
.sld-top { display: flex; justify-content: space-between; font-size: 12.5px; color: #cfc8ba; font-weight: 600; }
.sld-top em { font-style: normal; color: var(--gold); font-size: 11px; }
.sld output { color: var(--gold2); font-variant-numeric: tabular-nums; direction: ltr; font-size: 12px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; cursor: pointer; direction: ltr; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold-d), #3a3a44); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: #3a3a44; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--gold2); border: 3px solid #1a1205; box-shadow: 0 0 0 1px var(--gold), 0 3px 10px rgba(0, 0, 0, .6); transition: transform .15s; }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.25); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold2); border: 3px solid #1a1205; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; }
.toggle { position: relative; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle i { flex: none; width: 40px; height: 23px; border-radius: 99px; background: #2a2a32; position: relative; transition: background .25s; }
.toggle i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); }
.toggle input:checked + i { background: var(--gold); }
.toggle input:checked + i::after { transform: translateX(-17px); }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset { display: grid; gap: 4px; padding: 4px; border-radius: 10px; border: 1.5px solid transparent; background: #0d0d10; cursor: pointer; font-size: 11px; font-weight: 700; color: #cfc8ba; transition: all .2s var(--ease); }
.preset:hover { transform: translateY(-2px); }
.preset.on { border-color: var(--gold); color: var(--gold2); box-shadow: 0 6px 18px -10px rgba(231, 180, 83, .8); }
.pv-thumb { aspect-ratio: 16/9; border-radius: 7px; background: #1d1d23 center/cover; display: block; }
.sub-h { font-size: 13px; color: var(--gold2); display: flex; align-items: center; gap: 6px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.sub-h .ic { width: 14px; height: 14px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.kf-row { display: flex; align-items: flex-end; gap: 6px; }
.kf-row .sld { flex: 1; }
.kf-btn, .kf-clr { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line2); background: transparent; cursor: pointer; color: var(--muted); transition: all .2s; }
.kf-btn .ic, .kf-clr .ic { width: 14px; height: 14px; }
.kf-btn.on { color: #1a1205; background: var(--gold); border-color: var(--gold); }
.kf-btn:hover { color: var(--gold); border-color: var(--gold); }
.swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatches input[type=color] { width: 34px; height: 30px; border: 0; background: transparent; padding: 0; cursor: pointer; }
.tip { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(231, 180, 83, .06); border: 1px solid rgba(231, 180, 83, .15); font-size: 13px; color: #cfc8ba; }
.tip p { margin: 0; } .tip .ic { color: var(--gold); width: 18px; height: 18px; margin-top: 2px; }
.file-name { display: flex; align-items: center; gap: 6px; word-break: break-all; } .file-name .ic { width: 14px; height: 14px; }
.ed-mtabs { display: none; }

/* الخط الزمني */
.ed-timeline { grid-area: tl; display: flex; flex-direction: column; border-top: 1px solid var(--line); background: #0b0b0d; min-height: 0; }
.tl-tools { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tl-tools::-webkit-scrollbar { display: none; }
.tool { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 11px; border-radius: 9px; border: 0; background: transparent; color: #cfc8ba; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: all .2s; }
.tool:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.tool:active { transform: scale(.94); }
.tool.on { color: var(--gold2); background: rgba(231, 180, 83, .13); }
.tool .ic { width: 18px; height: 18px; }
.grow { flex: 1; }
.tl-body { display: flex; min-height: 0; flex: 1; }
.tl-heads { width: 104px; flex: none; border-right: 1px solid var(--line); overflow: hidden; background: #0e0e11; }
.tl-ruler-pad { height: 26px; border-bottom: 1px solid var(--line); font-size: 10.5px; color: var(--muted); display: grid; place-items: center; font-family: ui-monospace, Menlo, monospace; }
.tl-head { display: flex; align-items: center; gap: 5px; padding: 0 6px 0 8px; border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: #cfc8ba; direction: rtl; }
.th-ic .ic { width: 15px; height: 15px; color: var(--gold-d); }
.t-audio .th-ic .ic { color: #5fc4a0; } .t-text .th-ic .ic { color: var(--gold); }
.th-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-btn { width: 24px; height: 24px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.th-btn .ic { width: 14px; height: 14px; } .th-btn.on { color: var(--danger); }
.tl-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; position: relative; }
.tl-content { position: relative; min-height: 100%; touch-action: pan-x; user-select: none; -webkit-user-select: none; }
.tl-ruler { touch-action: none; height: 26px; position: relative; border-bottom: 1px solid var(--line); background: #0e0e11; cursor: ew-resize; background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .08) 0 1px, transparent 1px 16px); background-size: 100% 6px; background-repeat: repeat-x; background-position: bottom; }
.tick { position: absolute; top: 0; height: 26px; padding-left: 4px; border-left: 1px solid rgba(255, 255, 255, .22); font-size: 10px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; line-height: 18px; }
.lane { position: relative; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(90deg, transparent 0 59px, rgba(255, 255, 255, .015) 59px 60px); }
.lane.is-hidden { opacity: .35; }
.clip { position: absolute; top: 4px; bottom: 4px; border-radius: 7px; overflow: hidden; cursor: grab; touch-action: pan-x; background-color: #2b3c57; background-size: auto 100%; background-repeat: repeat-x; border: 1.5px solid rgba(255, 255, 255, .12); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .7); transition: box-shadow .2s, border-color .2s, filter .2s; }
.clip::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 55%); pointer-events: none; }
.clip:hover { filter: brightness(1.12); }
.clip.sel { touch-action: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px -2px rgba(231, 180, 83, .5); z-index: 3; }
.clip.dragging { opacity: .88; cursor: grabbing; z-index: 5; box-shadow: 0 12px 30px -8px #000, 0 0 0 1px var(--gold); }
.clip.k-image { background-color: #3d2e5a; }
.clip.k-text { background: linear-gradient(135deg, #7a5a1e, #4d3812); }
.clip.k-audio { background-color: #143a2d; background-size: 100% 100%; background-repeat: no-repeat; }
.clip.missing { background: repeating-linear-gradient(45deg, #3a1515 0 8px, #2a1010 8px 16px); }
.clip-label { position: absolute; top: 2px; left: 8px; right: 30px; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000; direction: rtl; text-align: left; display: flex; align-items: center; gap: 4px; pointer-events: none; }
.clip-label .ic { width: 13px; height: 13px; }
.clip-badges { position: absolute; bottom: 3px; left: 8px; display: flex; gap: 3px; pointer-events: none; }
.cb { font-size: 9.5px; font-weight: 800; padding: 0 5px; border-radius: 4px; background: rgba(0, 0, 0, .65); line-height: 15px; display: inline-flex; align-items: center; }
.cb.gold { color: var(--gold); } .cb .ic { width: 10px; height: 10px; }
.kf { position: absolute; bottom: 4px; width: 9px; height: 9px; margin-left: -4.5px; background: var(--gold2); transform: rotate(45deg); box-shadow: 0 0 0 1.5px #1a1205; pointer-events: none; }
.trans { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, rgba(231, 180, 83, .55), transparent); pointer-events: none; }
.trans::after { content: '⧓'; position: absolute; top: 50%; left: 4px; transform: translateY(-50%); font-size: 11px; color: #fff; }
.fade-in, .fade-out { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.fade-in { left: 0; background: linear-gradient(to top right, rgba(0, 0, 0, .55) 50%, transparent 50%); }
.fade-out { right: 0; background: linear-gradient(to top left, rgba(0, 0, 0, .55) 50%, transparent 50%); }
.hdl { position: absolute; top: 0; bottom: 0; width: 12px; z-index: 2; cursor: ew-resize; }
.hdl.l { left: 0; } .hdl.r { right: 0; }
.clip.sel .hdl { background: var(--gold); }
.clip.sel .hdl::after { content: ''; position: absolute; top: 35%; bottom: 35%; left: 5px; width: 2px; border-radius: 2px; background: #1a1205; }
.playhead { position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--gold); z-index: 8; pointer-events: none; box-shadow: 0 0 10px rgba(231, 180, 83, .8); will-change: transform; }
.playhead i { position: absolute; top: 0; left: -6px; width: 14px; height: 16px; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }

/* التصدير */
.export { display: grid; gap: 14px; }
.ex-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ex-info div { display: grid; padding: 10px 12px; border-radius: 12px; background: #0d0d10; border: 1px solid var(--line); font-size: 12px; }
.ex-info b { font-size: 15px; color: var(--gold2); }
.seg { display: flex; padding: 4px; border-radius: 12px; background: #0d0d10; border: 1px solid var(--line); gap: 4px; }
.seg button { flex: 1; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; transition: all .2s; }
.seg button.on { background: linear-gradient(135deg, #f6d58f, #e7b453); color: #1a1205; }
.seg.disabled { opacity: .5; pointer-events: none; }
.ex-progress { display: grid; gap: 10px; }
.ex-canvas canvas { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: #000; display: block; }
.ex-stat { display: flex; justify-content: space-between; font-weight: 700; } .ex-stat .pct { color: var(--gold2); font-size: 18px; }
.ex-result { display: grid; gap: 12px; } .ex-result video { width: 100%; max-height: 300px; border-radius: 10px; background: #000; }

/* حول */
.about-hero { text-align: center; padding: 30px 10px 26px; }
.about-logo { width: 110px; height: 110px; filter: drop-shadow(0 16px 30px rgba(231, 180, 83, .35)); animation: float 6s ease-in-out infinite; }
.about-hero h1 { font-family: 'ElMessiri'; font-size: 40px; color: var(--gold2); margin-top: 10px; }
.about-hero .sub { letter-spacing: 4px; font-size: 11px; color: var(--muted); margin: 4px 0 14px; }
.about-hero .lead { max-width: 640px; margin: 0 auto; color: #c9c2b4; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 14px; }
.card { padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 14px; }
.about-grid .card { margin: 0; } .card > .ic { color: var(--gold); width: 26px; height: 26px; }
.card h3 { font-size: 16px; margin: 8px 0 4px; display: flex; align-items: center; gap: 8px; } .card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.kbd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.kbd-grid div { display: flex; gap: 10px; align-items: center; font-size: 13px; }
kbd { min-width: 30px; text-align: center; padding: 2px 8px; border-radius: 7px; background: #202027; border: 1px solid var(--line2); border-bottom-width: 3px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--gold2); direction: ltr; }
.copyright { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; padding: 22px; border-top: 1px solid var(--line); text-align: center; }
.copyright img { width: 42px; height: 42px; }
.copyright b { color: var(--gold2); }

/* ======== الجوال ======== */
@media (max-width: 899px) {
  :root { --top: 54px; }
  body.in-project #app { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .rail { position: fixed; bottom: 0; left: 0; right: 0; flex-direction: row; justify-content: space-around; gap: 0; padding: 6px 4px calc(6px + var(--safe-b)); border: 0; border-top: 1px solid var(--line); background: rgba(10, 10, 12, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .rail-item { flex: 1; padding: 6px 2px; font-size: 10.5px; }
  .rail-item.home { margin: 0; border: 0; padding: 6px 2px; border-radius: 12px; }
  .rail-item.on::before { inset-inline-start: 25%; right: 25%; left: 25%; top: -6px; bottom: auto; width: auto; height: 3px; }
  body.in-project #view { padding-bottom: calc(66px + var(--safe-b)); }
  .topbar { padding: 0 10px; gap: 8px; }
  .brand-txt small { display: none; }
  body.in-project .brand-txt { display: none; }
  .save-state { min-width: 0; font-size: 0; margin: 0; }
  .save-state .ic, .save-state i { font-size: 12px; }
  .icon-btn { width: 36px; height: 36px; }
  .hero { grid-template-columns: 1fr; padding: 26px 20px; text-align: center; }
  .hero-art { display: none; }
  .hero p { margin-inline: auto; }
  .home, .board, .shots, .about { padding: 16px 12px 40px; }
  .proj-grid { grid-template-columns: 1fr; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { width: 100% !important; border-radius: 22px 22px 0 0; max-height: 92dvh; padding-bottom: var(--safe-b); transform: translateY(40px); }
  .modal .form:has(.poster-pick) { grid-template-columns: 110px 1fr; }
  .row2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  /* السيناريو */
  .script-wrap { grid-template-columns: 1fr; height: auto; }
  .scene-nav { display: none; }
  .script-toolbar { padding: 8px 10px; gap: 8px; position: sticky; top: 0; z-index: 3; }
  .type-btns { width: 100%; }
  .type-btn { flex: 1; padding: 0 6px; font-size: 13px; }
  .tb-end { width: 100%; } .tb-end .btn { flex: 1; }
  .paper-scroll { padding: 14px 8px 30px; }
  .paper { padding: 26px 22px 50px 18px; font-size: 15px; }
  .sl-scene::after { inset-inline-start: auto; inset-inline-end: 4px; font-size: 12px; }
  .sl-character { margin: 14px 18% 0; } .sl-dialogue { margin: 0 8%; } .sl-paren { margin: 0 16%; }
  .script-main { overflow: visible; } .view-script { overflow: auto; }
  .script-stats { gap: 10px; flex-wrap: wrap; }
  .page-head h2 { font-size: 22px; }
  .ph-actions { width: 100%; } .ph-actions .select { flex: 1; max-width: none; }
  .sb-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sb-info { padding: 8px 10px 10px; gap: 5px; }
  .sb-tags span:nth-child(n+3) { display: none; }
  .sb-scene { font-size: 11.5px; }
  .sb-handle { width: 30px; height: 30px; }
  .sb-empty { flex-direction: column; gap: 4px; } .sb-empty .btn { height: 28px; font-size: 12px; }
  /* جدول التصوير كبطاقات */
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .shot-table thead { display: none; }
  .shot-table, .shot-table tbody { display: block; width: 100%; }
  .shot-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; margin-bottom: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
  .shot-table td { border: 0; padding: 0; white-space: normal; font-size: 12.5px; flex: none; min-width: 0; }
  .shot-table td.ellipsis { max-width: none; white-space: normal; flex: 1 1 50%; color: var(--muted); }
  .shot-table td[data-l="اللقطة"] b { font-size: 15px; }
  .shot-table td[data-l="الحجم"], .shot-table td[data-l="الحركة"], .shot-table td[data-l="العدسة"], .shot-table td[data-l="المدة"] { padding: 2px 9px; border-radius: 99px; background: #1d1d23; border: 1px solid var(--line); color: #cfc8ba; }
  .shot-table td[data-l="الحجم"] { margin-inline-start: 32px; }
  .shot-table td[data-l="الموقع"], .shot-table td[data-l="الممثلون"], .shot-table td[data-l="اليوم"] { flex: 1 1 100%; }
  .shot-table td[data-l="الموقع"]::before, .shot-table td[data-l="الممثلون"]::before, .shot-table td[data-l="اليوم"]::before { content: attr(data-l); font-size: 11px; color: var(--muted); display: block; margin-bottom: 2px; }
  .shot-table input, .shot-table select { min-width: 0; height: 38px; }
  .day-card { width: 180px; }
  /* المونتاج */
  .view-edit { overflow: auto !important; }
  .editor { display: flex; flex-direction: column; height: auto; min-height: 100%; }
  .ed-preview { order: 1; padding: 8px 8px 0; position: sticky; top: 0; z-index: 6; background: rgba(8, 8, 10, .97); border-bottom: 1px solid var(--line); }
  .stage-wrap { height: min(57vw, 42vh); flex: none; }
  .transport { grid-template-columns: auto 1fr auto; padding: 6px 2px; gap: 6px; }
  .tp-main { justify-content: center; gap: 4px; }
  .play-btn { width: 46px; height: 46px; }
  .tc { font-size: 11.5px; padding: 3px 7px; }
  .tc .tot { display: none; }
  .tp-side .select.sm { width: 76px; }
  .tp-side .select.sm { padding-left: 24px; padding-right: 8px; font-size: 12px; }
  .tp-side .btn span { display: none; }
  .tp-side .btn { width: 38px; padding: 0; }
  .ed-timeline { order: 2; }
  .tl-heads { width: 54px; }
  .th-name { display: none; }
  .tl-head { justify-content: space-between; padding: 0 4px; }
  .tl-ruler-pad { font-size: 9px; }
  .tool span { display: none; } .tool { padding: 0 10px; }
  .tool .ic { width: 20px; height: 20px; }
  .ed-mtabs { order: 3; display: flex; gap: 6px; padding: 8px; z-index: 4; background: rgba(8, 8, 10, .95); border-top: 1px solid var(--line); }
  .ed-mtabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 11px; border: 1px solid var(--line2); background: var(--panel2); font-weight: 700; color: var(--muted); }
  .ed-mtabs button.on { color: #1a1205; background: linear-gradient(135deg, #f6d58f, #e7b453); border-color: transparent; }
  .ed-bin, .ed-insp { order: 4; border: 0; overflow: visible; min-height: 320px; }
  .editor[data-mpanel="media"] .ed-insp, .editor[data-mpanel="insp"] .ed-bin { display: none; }
  .bin-list { grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .insp-body, .bin-list { overflow: visible; }
  .presets { grid-template-columns: repeat(4, 1fr); }
  .panel-head { min-height: 50px; }
  #toasts { bottom: calc(80px + var(--safe-b)); }
}
@media (min-width: 900px) and (max-width: 1180px) { .editor { grid-template-columns: 210px minmax(0, 1fr) 290px; } .bin-list { grid-template-columns: 1fr; } }
@media (min-width: 900px) { .ed-timeline { height: 328px; } }
@media (min-width: 1500px) { .editor { grid-template-columns: 290px minmax(0, 1fr) 350px; } .ed-timeline { height: 340px; } }

/* الطباعة */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 22mm 20mm; }
  body { background: #fff !important; color: #000; overflow: visible; height: auto; }
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block; font-family: 'Cairo', sans-serif; color: #000; font-size: 12pt; }
  .pr-title { height: 240mm; display: flex; flex-direction: column; justify-content: space-between; text-align: center; page-break-after: always; }
  .pr-title h1 { font-family: 'ElMessiri'; font-size: 34pt; margin-top: 70mm; }
  .pr-genre { font-size: 13pt; color: #555; } .pr-log { font-size: 12pt; max-width: 120mm; margin: 10mm auto; color: #333; }
  .pr-copy { font-size: 10pt; color: #444; text-align: center; }
  .pl { margin: 0; line-height: 1.7; }
  .pl-scene { font-weight: 800; margin-top: 16pt; background: #eee; padding: 2pt 6pt; page-break-after: avoid; }
  .pn { display: inline-block; min-width: 22pt; font-weight: 800; }
  .pl-action { margin-top: 8pt; }
  .pl-character { text-align: center; font-weight: 800; margin-top: 12pt; page-break-after: avoid; }
  .pl-paren { text-align: center; font-style: italic; }
  .pl-dialogue { margin: 0 22%; text-align: center; }
  .pl-transition { text-align: left; font-weight: 800; margin-top: 10pt; }
  .sheet h1 { font-size: 18pt; margin-bottom: 8pt; } .sheet h2 { font-size: 13pt; margin: 14pt 0 6pt; background: #eee; padding: 4pt 6pt; }
  .sheet table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .sheet th, .sheet td { border: 1px solid #999; padding: 3pt 5pt; text-align: right; }
  .sheet th { background: #f0f0f0; }
}
