/* ============ StudioMania — الشكل العام (مربعات زجاجية على خلفية فاتحة) ============ */
:root {
  --bg: #ECECEC; --page: #F6F6F4;
  --glass: rgba(255, 255, 255, .58); --glass-strong: rgba(255, 255, 255, .78); --glass-line: rgba(255, 255, 255, .85);
  --surface: rgba(255, 255, 255, .72); --surface-2: #F2F2F0; --line: rgba(20, 20, 20, .08);
  --text: #141414; --muted: #8C8C88; --accent: #E5613E; --accent-2: #F08A63; --accent-soft: #FBE4DA;
  --ink: #111111; --ok: #2EAF78; --danger: #DD4A3C; --warn: #E3A13A; --skip: #D6D6D2;
  --radius: 26px; --radius-sm: 16px;
  --shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 18px 40px -22px rgba(40, 20, 10, .28);
  --font: "Readex Pro", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --display: "Unbounded", "Readex Pro", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-weight: 350; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg use { pointer-events: none; }
:where(.rail-btn, .icon-btn, .tile, .btn, .flow) svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
#i-home path { fill: none; }
[dir="rtl"] svg.flip-rtl, [dir="rtl"] .btn.pill svg:not(.flip), [dir="ltr"] .btn.pill svg.flip { transform: scaleX(-1); }

/* ---------- الشريط الجانبي (المكتبات) ---------- */
.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; flex: none; width: 92px; padding: 18px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 5;
}
.rail .spacer { flex: 1; }
.rail-btn {
  width: 60px; min-height: 60px; border-radius: 22px; border: 1px solid var(--glass-line);
  background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: var(--shadow); transition: transform .2s, background .2s; padding: 8px 4px;
}
.rail-btn span { font-size: 9.5px; line-height: 1.2; color: var(--muted); text-align: center; }
.rail-btn:hover { transform: translateY(-2px); background: var(--glass-strong); }
.rail-btn.logo-btn { border-radius: 50%; padding: 0; width: 60px; height: 60px; background: none; border: none; box-shadow: none; }
.rail-btn .lang-code { font-family: var(--display); font-weight: 500; font-size: 10px; color: var(--accent); }
.top { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 14px; }
.top .spacer, .hero .spacer, .stage-head .spacer { flex: 1; }

.hero { display: flex; align-items: center; gap: 18px; margin: 34px 0 30px; flex-wrap: wrap; }

/* ---------- الأزرار ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 450;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover:not(:disabled) { border-color: rgba(229, 97, 62, .55); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 10px 24px -12px rgba(229, 97, 62, .8); }
.btn.primary:hover:not(:disabled) { background: #D8552F; }
.btn.ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.btn.cut { font-size: 15px; padding: 10px 20px; }
.btn.pill { padding: 14px 22px; font-size: 16px; gap: 22px; }
.btn.pill svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
label.btn { cursor: pointer; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(20,20,20,.1); background: var(--glass-strong);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); flex: none;
}
.icon-btn:hover { background: #fff; }

/* ---------- المربعات ---------- */
.glass {
  background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); box-shadow: var(--shadow);
}
.tile {
  position: relative; border-radius: 34px; padding: 22px 24px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 26px 50px -24px rgba(40,20,10,.35); }
.tile header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.tile h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.tile h3 { margin: 0; font-size: 17px; font-weight: 500; }
.avatars { display: flex; margin-inline-start: auto; }
.avatars img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; margin-inline-start: -12px; }
.bars { display: flex; align-items: center; gap: 4px; height: 40px; margin-inline-start: auto; }
.bars i { width: 4px; border-radius: 4px; background: var(--accent); opacity: .85; }
.bars i:nth-child(1) { height: 30%; } .bars i:nth-child(2) { height: 70%; } .bars i:nth-child(3) { height: 45%; } .bars i:nth-child(4) { height: 100%; }
.bars i:nth-child(5) { height: 55%; } .bars i:nth-child(6) { height: 80%; } .bars i:nth-child(7) { height: 35%; } .bars i:nth-child(8) { height: 60%; }
.bars.b2 i { background: #C9C9C4; }
.bars.b2 i:nth-child(odd) { background: var(--accent); }
/* شاشة عريضة (16:9 وأعرض): الرئيسية كلها في شاشة واحدة من غير سكرول، والخطوات الخمسة جنب بعض بالترتيب */
@media (min-width: 1100px) and (min-aspect-ratio: 4/3) and (min-height: 560px) {
  .home { height: 100vh; max-width: none; display: flex; flex-direction: column; padding: 16px 24px 18px; padding-inline-start: 4px; }
  .logo-mark { width: 48px; height: 48px; }
  .current-chip { padding: 9px 16px; }
  .hero { margin: 10px 0 16px; flex-wrap: nowrap; }
  .date-badge { width: clamp(64px, 9vh, 104px); height: clamp(64px, 9vh, 104px); font-size: clamp(24px, 3.4vh, 36px); }
  .date-text { font-size: 17px; }
  .btn.pill { padding: 12px 20px; }
  .greeting { min-width: 0; }
  .greeting h1 { font-size: clamp(24px, min(2.6vw, 4.6vh), 44px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .greeting p { font-size: clamp(14px, min(1.4vw, 2.6vh), 22px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bento {
    flex: 1; min-height: 0; gap: clamp(10px, 1.6vh, 18px);
    grid-template-columns: 1.45fr 1fr 1fr 1fr 1.25fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: 0;
  }
  .tile { padding: clamp(14px, 2vh, 22px) clamp(14px, 1.3vw, 24px); border-radius: 28px; min-height: 0; }
  .tile h2 { font-size: clamp(17px, min(1.4vw, 2.6vh), 22px); }
  .t-projects { grid-column: 1; grid-row: 1 / span 2; }
  .t-cut { grid-column: 2; grid-row: 1; }
  .t-gen { grid-column: 3; grid-row: 1; }
  .t-montage { grid-column: 4; grid-row: 1; }
  .t-publish { grid-column: 5; grid-row: 1; }
  .t-ring { grid-column: 2; grid-row: 2; }
  .t-carousel { grid-column: 3; grid-row: 2; }
  .t-libs { grid-column: 4 / span 2; grid-row: 2; }
  .t-libs .libs { gap: 8px; }
  .t-projects .proj-list { flex: 1; min-height: 0; overflow: auto; margin-top: 8px; }
  .proj-list li { padding: 10px 12px; }
  .steps5 i { width: 14px; }
  .tile-big { font-size: clamp(30px, 5vh, 46px); }
  .t-gen .dots { grid-template-columns: repeat(8, 12px); }
  .t-gen .dots i { width: 12px; height: 12px; }
  .t-montage .wave { height: clamp(30px, 6vh, 64px); }
  .post-list { overflow: hidden; }
  .lib-card { padding: 10px 12px; min-height: 0; overflow: hidden; }
}
@media (max-width: 640px) {
  .app { flex-direction: column; }
  .rail { position: static; height: auto; width: 100%; flex-direction: row; overflow-x: auto; padding: 10px 12px; }
  .rail .spacer { display: none; }
}

/* ---------- الشاشة الكبيرة اللي الخطوة بتفتح فيها ---------- */
.stage { position: fixed; inset: 0; z-index: 40; background: rgba(236,236,236,.55); padding: 14px; display: flex; }
.stage-card {
  flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: 34px; overflow: hidden; transform-origin: 0 0;
  background: rgba(248, 248, 246, .82); border: 1px solid var(--glass-line);
  backdrop-filter: blur(28px) saturate(140%); -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow: 0 40px 90px -40px rgba(40, 20, 10, .45);
}
.stage-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stage-title { display: flex; align-items: center; gap: 10px; }
.stage-title h2 { margin: 0; font-size: 21px; font-weight: 500; }
.stage-project { font-size: 13px; color: var(--muted); padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.7); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-head .btn.pill { padding: 11px 18px; font-size: 14px; gap: 14px; }
.flow { display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid var(--line); }
.flow button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 6px 12px 6px 8px; border-radius: 999px; color: var(--muted); font-size: 13px; }
.flow button i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #E9E9E5; font-family: var(--display); font-size: 11px; color: var(--text); }
.flow button.done i { background: var(--accent-soft); color: var(--accent); }
.flow button.active { background: var(--ink); color: #fff; }
.flow button.active i { background: var(--accent); color: #fff; }
.stage-body { flex: 1; min-height: 0; overflow: auto; padding: 18px; }
.stage-body > .view { max-width: 1500px; margin: 0 auto; }
body.stage-open { overflow: hidden; }
/* الشاشة الكبيرة مفتوحة: من غير بلور ومن غير رسم للرئيسية وراها (أخف بكتير على الجهاز) */
body.stage-settled .stage-card { backdrop-filter: none; -webkit-backdrop-filter: none; background: #F6F5F3; }
body.stage-settled .app { visibility: hidden; }
@media (max-width: 900px) { .flow span { display: none; } .stage { padding: 0; } .stage-card { border-radius: 0; } }

/* ---------- الصناديق جوه الخطوات ---------- */
.layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 18px; min-width: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 12px 30px -24px rgba(40,20,10,.3);
}
.panel-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.panel h2 { margin: 0; font-size: 17px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel h3 { font-size: 15px; margin: 22px 0 10px; }
.placeholder { display: flex; align-items: center; justify-content: center; min-height: 240px; color: var(--muted); }

.dropzone {
  border: 2px dashed var(--line); border-radius: 12px; padding: 16px;
  text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 10px;
}
.dropzone.over { border-color: var(--accent); color: var(--text); }

.upload-item { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.bar { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; }

.video-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.video-list li {
  padding: 10px 12px; border-radius: 10px; border: 1px solid transparent;
  background: var(--surface-2); cursor: pointer;
}
.video-list li:hover { border-color: var(--line); }
.video-list li.active { border-color: var(--accent); }
.video-list .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-list .meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 20px; background: var(--surface); }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.empty { color: var(--muted); font-size: 13px; text-align: center; }

.player { background: #000; border-radius: 10px; overflow: hidden; display: flex; justify-content: center; }
.player video { max-width: 100%; max-height: min(420px, 40vh); display: block; }

/* تايم لاين التقطيع: نفس شكل المونتاج */
.cut-tl { margin: 12px 0 8px; }
.cut-tl .tl-toolbar { flex-wrap: wrap; gap: 4px; }
.cut-tl .tc { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: #fff; padding: 0 8px; font-variant-numeric: tabular-nums; }
.cut-tl button.ic.cut { background: var(--accent); color: #fff; font-weight: 700; padding: 0 12px; }
.cut-tl button.ic.cut:hover { background: var(--accent-2); }
.cut-tl .tl-toolbar .spacer { flex: 1; }
.cut-tl .tl-canvas { cursor: pointer; touch-action: none; }
.ct-track { position: relative; height: 74px; border-bottom: 1px solid #1d2027; }
.ct-seg { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; overflow: hidden; background: #2a3140; box-sizing: border-box; border: 2px solid transparent; }
.ct-seg .strip { position: absolute; inset: 0; display: flex; overflow: hidden; pointer-events: none; }
.ct-seg .strip i { flex: none; height: 100%; background-image: var(--img); background-repeat: no-repeat; }
.ct-seg::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.ct-seg.ok::after { background: var(--ok); }
.ct-seg.long { border-color: var(--danger); }
.ct-seg.long::after { height: 6px; background: repeating-linear-gradient(45deg, var(--danger), var(--danger) 6px, #7a1d1d 6px, #7a1d1d 12px); }
.ct-seg.skipped .strip { opacity: .25; filter: grayscale(1); }
.ct-seg.skipped { background: repeating-linear-gradient(45deg, #1b1e25, #1b1e25 8px, #23262e 8px, #23262e 16px); }
.ct-seg.current { border-color: #fff; }
.ct-seg.long.current { border-color: #ff8a8a; }
.ct-seg .nm { position: absolute; top: 3px; left: 5px; max-width: calc(100% - 10px); font-size: 11px; color: #fff; background: rgba(0,0,0,.6); padding: 0 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; direction: rtl; }
.ct-cut { position: absolute; top: 0; bottom: 0; width: 11px; margin-left: -5px; cursor: ew-resize; z-index: 4; }
.ct-cut::before { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 3px; border-radius: 2px; background: #ffd24a; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.ct-cut::after { content: "✂"; position: absolute; top: -1px; left: -3px; width: 17px; height: 17px; border-radius: 50%; background: #ffd24a; color: #000; font-size: 11px; line-height: 17px; text-align: center; }
.ct-cut:hover::before { background: #fff; }
.cut-tl .tl-hover { top: 26px; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.controls .spacer { flex: 1; }
.time { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); direction: ltr; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
kbd { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font-size: 11px; }

.alert { border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 12px; }
.alert.warn {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent);
}

table.segments { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.segments th { text-align: start; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px; border-bottom: 1px solid var(--line); }
.segments td { padding: 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.segments tr.long td { color: var(--danger); }
.segments tr.skipped td { color: var(--muted); text-decoration: line-through; }
.segments tr.skipped td:last-child, .segments tr.skipped td:nth-child(5) { text-decoration: none; }
.segments td.actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.status { font-size: 12px; font-weight: 700; }
.status.ok { color: var(--ok); }
.status.long { color: var(--danger); }

.split-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }

.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.clip { background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.clip video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; display: block; }
.clip .info { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; font-size: 12px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); padding: 10px 16px;
  border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); z-index: 10;
}
.toast.error { border-color: var(--danger); }

/* ---------- الخطوة 2 و 4 ---------- */
.gen-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .gen-layout { grid-template-columns: 1fr; } }
.gap-top { margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.field input[type="text"], .field select, .field textarea {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 10px; border-radius: 10px; font: inherit; font-size: 14px; width: 100%;
}
.field textarea { resize: vertical; direction: ltr; text-align: left; font-size: 13px; }
.field input[type="file"] { font-size: 13px; color: var(--text); max-width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0 12px; }
.btn.wide { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.row { display: flex; gap: 8px; }
code { background: var(--surface-2); border-radius: 4px; padding: 0 4px; direction: ltr; display: inline-block; }
.hint a, .empty a { color: var(--accent); }

.clip-group { margin-bottom: 14px; }
.clip-group-head, .gen-group-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.clip-group-head .spacer, .gen-group-head .spacer { flex: 1; }
.gen-group-head { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.gen-group-head .muted { font-weight: 400; font-size: 12px; }
.gen-group + .gen-group { margin-top: 18px; }
.coach-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 3px; }
.coach-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.coach-chip.missing { color: var(--danger); padding: 3px 10px; }
.gen-results { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .gen-results { grid-template-columns: 1fr; } }
.archive-panel { position: sticky; top: 0; }
.archive-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.archive-list li { background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.archive-list li.active { border-color: var(--accent); }
.archive-list .nm { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-list .meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.archive-list .acts { display: flex; gap: 6px; }
.archive-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.archive-banner span { flex: 1; }
.clip-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.clip-pick { position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #000; cursor: pointer; }
.clip-pick video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; pointer-events: none; }
.clip-pick .tag { position: absolute; bottom: 0; inset-inline: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 6px; display: flex; justify-content: space-between; }
.clip-pick .tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.5); border: 2px solid #fff; color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.clip-pick.selected { border-color: var(--accent); }
.clip-pick.selected .tick { background: var(--accent); border-color: var(--accent); }
.clip-pick.too-short { opacity: .4; cursor: not-allowed; }

.gens { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gen { background: var(--surface-2); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.gen .media { position: relative; background: #000; aspect-ratio: 9 / 16; display: flex; align-items: center; justify-content: center; }
.gen .media video { width: 100%; height: 100%; object-fit: contain; }
.gen .media .wait { color: #fff; font-size: 13px; text-align: center; padding: 10px; }
.gen .body { padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.gen .who { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.gen .who img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.gen .err { color: var(--danger); word-break: break-word; }
.gen .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pill { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px; background: var(--surface); width: fit-content; }
.pill.completed { color: var(--ok); }
.pill.failed { color: var(--danger); }
.pill.active { color: var(--warn); }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

.coaches { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.coach { background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.coach img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface); }
.coach .body { padding: 8px 10px; }
.coach .name { font-weight: 700; }
.post-extra { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.5); }
.post-extra .extra-title { font-weight: 600; font-size: 14px; }
.post-extra .hint { margin: 0; }
.loc-row { margin: -4px 0 8px; }
.cover-pick { display: flex; gap: 10px; align-items: center; }
.cover-pick video { width: 96px; aspect-ratio: 9 / 16; object-fit: cover; background: #000; border-radius: 10px; flex: none; }
.cover-ctrl { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cover-ctrl input[type=range] { width: 100%; accent-color: var(--accent); }
.posts .tags { font-size: 12px; color: var(--muted); }
.coach .handles { display: flex; flex-direction: column; gap: 2px; font-size: 12px; margin: 2px 0; }
.coach .handles a { color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach .handles a:hover { color: var(--accent); }
.handles-wrap { max-height: 60vh; overflow: auto; }
.handles-table select { max-width: 200px; }
.coach .outro { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.coach .acts { display: flex; gap: 6px; margin-top: 6px; }
.coach-preview { width: 120px; aspect-ratio: 1; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
dialog.outro-dlg { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 14px; padding: 12px; max-width: min(420px, 92vw); }
dialog.outro-dlg video { width: 100%; max-height: 70vh; display: block; border-radius: 8px; background: #000; }
dialog::backdrop { background: rgba(0,0,0,.6); }

/* ---------- مكتبة البرومبتات ---------- */
.prompt-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-height: 360px; overflow-y: auto; }
.prompt-item {
  border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; background: var(--surface-2);
}
.prompt-item.selected { border-color: var(--accent); }
.prompt-item .top { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.prompt-item .top .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prompt-item .text {
  font-size: 12px; color: var(--muted); direction: ltr; text-align: left; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.prompt-item.selected .text { -webkit-line-clamp: unset; }
.prompt-item .acts { display: flex; gap: 4px; }
.prompt-form { border: 1px dashed var(--accent); border-radius: 10px; padding: 10px; margin-bottom: 12px; }
.fixed-settings { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fixed-settings .pill { font-size: 12px; padding: 3px 10px; color: var(--text); }

/* ---------- مكتبات الصوت ---------- */
.audio-tools { display: flex; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; }
.audio-tools input, .audio-tools select {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 10px; border-radius: 10px; font: inherit; font-size: 14px;
}
.audio-tools input { flex: 1; min-width: 180px; }
.audio-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.audio-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; padding: 8px 10px;
}
.audio-list li.playing { border-color: var(--accent); }
.audio-list li.none { color: var(--muted); justify-content: center; }
.audio-list .play { width: 34px; justify-content: center; }
.audio-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.audio-list .dur {
  font-variant-numeric: tabular-nums; direction: ltr; font-weight: 700; font-size: 14px;
  background: var(--surface); border-radius: 8px; padding: 2px 10px;
}
.audio-list .acts { display: flex; gap: 4px; }
.audio-list .progress { flex-basis: 100%; height: 6px; background: var(--surface); border-radius: 4px; overflow: hidden; cursor: pointer; }
.audio-list .progress i { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- المونتاج ---------- */
.project-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.project-bar select, .project-bar input {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 7px 10px; border-radius: 10px; font: inherit; font-size: 14px;
}
.project-bar input { min-width: 180px; }
.project-bar .spacer { flex: 1; }
/* ---------- محرر المونتاج (شبه كاب كات) ---------- */
.editor { display: flex; flex-direction: column; gap: 12px; }
.ed-top { display: grid; grid-template-columns: 220px 1fr 330px; gap: 12px; align-items: stretch; }
@media (max-width: 1100px) { .ed-top { grid-template-columns: 1fr 1fr; } .ed-player { grid-column: 1 / -1; order: -1; } }
@media (max-width: 700px) { .ed-top { grid-template-columns: 1fr; } }
.ed-media { display: flex; flex-direction: column; max-height: 560px; }
.ed-media .bin-grid { flex: 1; max-height: none; }
.ed-media .hint { margin: 8px 0 0; }
.bin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow-y: auto; align-content: start; }
.bin-item { position: relative; background: #000; border-radius: 8px; overflow: hidden; cursor: grab; }
.bin-item video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; pointer-events: none; }
.bin-item .tag { position: absolute; bottom: 0; inset-inline: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 2px 5px; }
.bin-item .add { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 18px; line-height: 1; }
.bin-item .del { position: absolute; top: 5px; left: 5px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 1; }
.bin-item .del:hover { background: var(--danger); }

.ed-player { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: #0b0c0f; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px 8px; }
.frame { position: relative; width: 252px; height: 448px; background: #000; border-radius: 6px; overflow: hidden; flex: none; touch-action: none; }
.ed-player .frame { cursor: grab; box-shadow: 0 0 0 1px #222; }
.ed-player .frame.panning { cursor: grabbing; }
.frame video { position: absolute; max-width: none; }
/* الفيديوهات المستخبية بتفضل مرسومة (شفافة) عشان المتصفح يفضل مجهّز صورتها */
.pv-stage video { opacity: 0; pointer-events: none; }
.pv-stage video.on { opacity: 1; z-index: 1; }
.frame .pv-logo, .frame .pv-cap { z-index: 2; }
.pv-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #777; font-size: 13px; }
.transport { display: flex; align-items: center; gap: 4px; width: 100%; max-width: 520px; color: #ddd; }
.transport .spacer, .tl-toolbar .spacer { flex: 1; }
.tc { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.tc.total { color: #888; margin-inline-start: 4px; }
button.ic { white-space: nowrap; background: transparent; border: 1px solid transparent; color: inherit; min-width: 32px; height: 30px; border-radius: 7px; font-size: 14px; padding: 0 6px; }
button.ic:hover:not(:disabled) { background: rgba(255,255,255,.08); }
button.ic.active { background: rgba(255,107,44,.18); border-color: var(--accent); color: #fff; }
button.ic:disabled { opacity: .35; cursor: default; }
button.ic.play { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #000; font-size: 16px; }
button.ic.play:hover { background: #e6e6e6; }

.ed-inspector { max-height: 560px; overflow-y: auto; padding-top: 10px; }
.tabs { display: flex; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-bottom: 12px; position: sticky; top: -10px; z-index: 2; }
.tabs button { flex: 1; border: none; background: none; color: var(--muted); font-size: 12px; padding: 6px 2px; border-radius: 8px; white-space: nowrap; }
.tabs button.active { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.pane-h { font-size: 14px; margin: 14px 0 8px; }
.pane-h:first-child { margin-top: 0; }
.pane > .switch { margin-bottom: 10px; font-size: 14px; color: var(--text); font-weight: 600; }
.clip-times { font-size: 12px; color: var(--muted); margin: -4px 0 6px; }
.ed-inspector .field { margin-bottom: 8px; }
.ed-inspector .alert { font-size: 13px; margin: 6px 0; }

/* التايم لاين */
.ed-timeline { background: #121419; color: #d8dbe2; border: 1px solid #262a33; border-radius: var(--radius); overflow: hidden; user-select: none; }
.tl-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid #262a33; }
.tl-toolbar .sep { width: 1px; height: 20px; background: #333845; margin: 0 6px; }
.tl-toolbar input[type=range] { width: 140px; accent-color: var(--accent); }
.tl-body { display: flex; }
.tl-heads { flex: none; width: 92px; border-inline-end: 1px solid #262a33; font-size: 12px; color: #9aa0ad; }
html[dir="rtl"] .tl-heads, html[dir="rtl"] .tl-empty-track { direction: rtl; }
.tl-heads > div { display: flex; align-items: center; padding: 0 8px; border-bottom: 1px solid #1d2027; }
.h-ruler, .tl-ruler { height: 26px; }
.h-video, .t-video { height: 66px; }
.h-voice, .t-voice, .h-music, .t-music { height: 44px; }
.h-caps, .t-caps { height: 28px; }
.tl-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; position: relative; }
.tl-canvas { position: relative; min-width: 100%; }
.tl-ruler { position: relative; border-bottom: 1px solid #262a33; cursor: text;
  background-image: linear-gradient(to right, #3a3f4b 1px, transparent 1px), linear-gradient(to right, #6a7080 1px, transparent 1px);
  background-size: var(--minor, 10px) 6px, var(--major, 100px) 12px; background-repeat: repeat-x; background-position: 0 100%, 0 100%; }
.tl-ruler span { position: absolute; top: 2px; font-size: 10px; color: #8a90a0; padding-left: 3px; font-family: ui-monospace, Menlo, Consolas, monospace; pointer-events: none; }
.tl-track { position: relative; border-bottom: 1px solid #1d2027; }
.tl-clip, .tl-audio { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; overflow: hidden; cursor: pointer; box-sizing: border-box; border: 2px solid transparent; }
.tl-clip { background: #2a3140; }
.tl-clip.outro { background: #3a2d55; cursor: default; }
.tl-clip.missing { background: #5a2a2a; }
.tl-clip.selected, .tl-audio.selected { border-color: #fff; z-index: 2; }
.tl-clip.dragging { opacity: .75; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.5); cursor: grabbing; }
.tl-clip .strip { position: absolute; inset: 0; display: flex; overflow: hidden; pointer-events: none; }
.tl-clip .strip i { flex: none; height: 100%; background-image: var(--img); background-repeat: no-repeat; }
.tl-clip .nm, .tl-audio .nm { position: absolute; top: 3px; left: 5px; max-width: calc(100% - 12px); font-size: 11px; color: #fff; background: rgba(0,0,0,.55); padding: 0 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tl-clip .du { position: absolute; bottom: 2px; right: 6px; font-size: 10px; color: #fff; background: rgba(0,0,0,.55); padding: 0 4px; border-radius: 4px; pointer-events: none; }
.tl-clip .h, .tl-audio .h { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; background: rgba(255,255,255,.0); z-index: 3; }
.tl-clip .h.l, .tl-audio .h.l { left: 0; }
.tl-clip .h.r, .tl-audio .h.r { right: 0; }
.tl-clip.selected .h, .tl-audio.selected .h, .tl-clip:hover .h, .tl-audio:hover .h { background: rgba(255,255,255,.85); }
.tl-clip.selected .h::after, .tl-audio.selected .h::after { content: ""; position: absolute; top: 50%; left: 3px; width: 3px; height: 14px; margin-top: -7px; border-radius: 2px; background: #333; }
.tl-audio.voice { background: #1f3558; }
.tl-audio.music { background: #173f37; }
.tl-audio canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tl-cap { position: absolute; top: 3px; bottom: 3px; background: #5a4520; color: #ffd98a; font-size: 10px; border-radius: 4px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; cursor: pointer; box-sizing: border-box; border-inline-start: 1px solid #0006; }
.tl-empty-track, .tl-drop-hint { position: sticky; left: 0; height: 100%; width: min(100%, 560px); display: flex; align-items: center; justify-content: flex-end;
  padding: 0 12px; font-size: 12px; color: #6b7180; pointer-events: none; box-sizing: border-box; }
.tl-drop-hint { justify-content: center; border: 1px dashed #3a3f4b; border-radius: 6px; margin: 4px; height: calc(100% - 8px); }
.tl-insert { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--accent); z-index: 6; }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; z-index: 8; pointer-events: none; }
.tl-playhead span { position: absolute; top: 0; left: -6px; width: 14px; height: 16px; background: #fff; clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); pointer-events: auto; cursor: ew-resize; }
.tl-hover { position: absolute; top: 26px; bottom: 0; width: 0; border-left: 1px dashed #ff5a5a; z-index: 7; pointer-events: none; }
.tl-canvas.blade .tl-clip[data-i] { cursor: crosshair; }
.tl-canvas.blade .tl-clip .h { display: none; }
.tl-clip canvas.cw { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; width: 100%; background: rgba(0,0,0,.55); pointer-events: none; }
.tl-clip .du { bottom: 18px; }
.tl-clip .snd { position: absolute; top: 2px; right: 4px; z-index: 4; border: none; border-radius: 5px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; padding: 1px 5px; line-height: 1.4; cursor: pointer; }
.tl-clip .snd:hover { background: rgba(0,0,0,.85); }
.tl-clip .snd.off { background: #b3262b; }
.tl-clip .nm { right: auto; max-width: calc(100% - 70px); }
.tl-heads .h-video { justify-content: space-between; }
.mute-all { font-size: 13px; min-width: 26px !important; height: 24px !important; }
.mute-all.off { background: #b3262b !important; color: #fff; }
.vline { position: absolute; left: 0; right: 0; height: 9px; margin-bottom: -4px; z-index: 3; cursor: ns-resize; }
.vline::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: rgba(255,255,255,.75); box-shadow: 0 0 2px #000; }
.vline:hover::before, .vol-drag .vline::before { height: 2px; top: 3px; background: #fff; }
.vline.zero::before { background: #ff5a5a; }
.vline em { display: none; position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 700; color: #000; background: #fff; padding: 0 6px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.vline:hover em, .vol-drag .vline em { display: block; }
.vline.zero em { bottom: 2px; }
.vline.hi em { bottom: auto; top: 6px; }
.tl-clip.trimming { z-index: 6; box-shadow: 0 0 0 1px #fff, 0 6px 16px rgba(0,0,0,.5); }
.tl-tip { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); background: #fff; color: #000; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; white-space: nowrap; pointer-events: none; z-index: 9; }
.tl-clip .h, .tl-audio .h { z-index: 5; width: 11px; }
.tl-marquee { position: absolute; z-index: 9; border: 1px solid #7fb2ff; background: rgba(127,178,255,.15); pointer-events: none; }
.tl-cap.selected { outline: 2px solid #fff; outline-offset: -2px; z-index: 2; }
.tl-keys { margin: 0; padding: 5px 10px; font-size: 11px; color: #7a8090; border-top: 1px solid #262a33; }
.sliders { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.sliders h3 { margin: 0 0 4px; font-size: 14px; }
.sliders label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.sliders label b, .slider-field b { color: var(--text); font-weight: 700; direction: ltr; display: inline-block; margin-inline-start: 6px; }
.sliders input[type=range], .slider-field input[type=range] { width: 100%; accent-color: var(--accent); }
.field input[type=number] { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 7px 10px; border-radius: 10px; font: inherit; }
#renderResult video { width: 100%; max-height: 420px; background: #000; border-radius: 10px; margin: 10px 0 6px; }
.err { color: var(--danger); font-size: 13px; word-break: break-word; }

/* ---------- النشر ---------- */
.ready-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ready { background: var(--surface-2); border-radius: 12px; overflow: hidden; border: 2px solid transparent; }
.ready.selected { border-color: var(--accent); }
.ready video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; display: block; }
.ready .body { padding: 6px 8px; font-size: 12px; }
.ready .name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ready .meta { color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ready .acts { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.post-video { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-weight: 700; font-size: 14px; }
.platforms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.platforms label {
  display: flex; align-items: center; gap: 5px; color: var(--text); font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; cursor: pointer;
}
.platforms label:has(input:checked) { border-color: var(--accent); }
.field input[type=datetime-local] { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 7px 10px; border-radius: 10px; font: inherit; }
.quick-times { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.posts li { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; flex-wrap: wrap; }
.posts video { width: 40px; height: 70px; object-fit: cover; border-radius: 6px; background: #000; flex: none; }
.posts .info { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.posts .when { font-weight: 700; font-size: 14px; }
.posts .cap { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.posts .acts { display: flex; gap: 4px; }
.pill.scheduled { color: var(--accent); }
.pill.published { color: var(--ok); }
#postFilter { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 6px 10px; border-radius: 10px; font: inherit; font-size: 13px; }
.alert.info { background: color-mix(in srgb, var(--ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 16px; line-height: 2; }
.alert a { color: var(--accent); }
.platforms label.off { opacity: .45; cursor: not-allowed; }
[data-view="7"] > .alert { margin: 0 0 16px; }

/* ---------- الدخول والإعدادات ---------- */
header.top .spacer { flex: 1; }
header.top .btn.active { border-color: var(--accent); }
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 400px; text-align: center; padding: 34px 30px 22px; border-radius: 36px; display: flex; flex-direction: column; align-items: center; }
.login .field { text-align: start; margin-top: 14px; width: 100%; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login .field input { padding: 13px 16px; font: inherit; font-size: 15px; }
.login .btn.wide { margin-top: 18px; padding: 14px; font-size: 16px; }
.lang-link { margin-top: 14px; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.login .err { margin-top: 10px; }
#keysForm .field input, #pwForm .field input { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 8px 10px; border-radius: 10px; font: inherit; direction: ltr; }
.ok-text { color: var(--ok); }

/* ---------- ربط الصوت بالفيديو ---------- */
.voice-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; margin-bottom: 12px; }
.voice-link select, .new-project select { background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 6px 8px; border-radius: 8px; font: inherit; font-size: 13px; max-width: 260px; }
.new-project { display: inline-flex; gap: 4px; align-items: center; }
.linked-video { font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 4px 10px; }

/* ---------- الكابشن واللوجو ---------- */
.switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.row.wrap { flex-wrap: wrap; margin-bottom: 10px; }
.cap-status { font-size: 13px; margin: 0 0 8px; color: var(--muted); }
.cap-status.ok { color: var(--ok); }
.cap-status.err { color: var(--danger); }
.templates { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.templates button {
  border: 2px solid var(--line); border-radius: 10px; background: #1b1f27; padding: 10px 4px; min-height: 52px;
  display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1.2;
}
.templates button.selected { border-color: var(--accent); }
.templates small { display: block; font-family: system-ui, sans-serif; font-size: 10px; color: #aaa; margin-top: 3px; -webkit-text-stroke: 0; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.colors label { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.colors input[type=color] { width: 44px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 0; }
.logo-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
#logoThumb { width: 52px; height: 52px; object-fit: contain; background: repeating-conic-gradient(#8884 0% 25%, transparent 0% 50%) 50% / 12px 12px; border-radius: 8px; border: 1px solid var(--line); }
.frame .pv-logo { position: absolute; pointer-events: none; }
.frame .pv-cap { position: absolute; left: 4%; right: 4%; text-align: center; transform: translateY(-50%); pointer-events: none; line-height: 1.25; direction: rtl; }
.frame .pv-cap span { display: inline; padding: 0 .12em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
dialog.tr-dlg { width: min(720px, 94vw); max-height: 86vh; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 14px; padding: 14px; }
.tr-list { display: flex; flex-direction: column; gap: 6px; max-height: 56vh; overflow-y: auto; }
.tr-row { display: flex; gap: 6px; align-items: center; }
.tr-row .t { font-size: 12px; color: var(--muted); direction: ltr; width: 92px; flex: none; font-variant-numeric: tabular-nums; }
.tr-row input { flex: 1; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 7px 10px; border-radius: 8px; font: inherit; font-size: 15px; }
.coach-mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ---------- الرفع الجماعي للمدربين ---------- */
dialog.bulk-dlg { width: min(900px, 96vw); max-height: 90vh; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 14px; padding: 14px; }
.bulk-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bulk-table-wrap { max-height: 50vh; overflow-y: auto; margin-top: 8px; }
.bulk-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bulk-table th { text-align: start; color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.bulk-table td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.bulk-table img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block; }
.bulk-table input, .bulk-table select { width: 100%; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 6px 8px; border-radius: 8px; font: inherit; font-size: 13px; }
.bulk-table select { max-width: 240px; }
.bulk-bar { margin-top: 10px; height: 6px; }
.unmatched { border: 2px dashed var(--warn); border-radius: 12px; padding: 10px; margin: 10px 0; }
.unmatched h3 { margin: 0 0 10px; font-size: 15px; }
.um-card { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.um-card:first-child { border-top: none; padding-top: 0; }
.um-video { width: 150px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.um-video video { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 8px; object-fit: contain; }
.um-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.um-coaches { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 330px; overflow-y: auto; }
.um-coach { border: 2px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 5px; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; }
.um-coach:hover { border-color: var(--accent); }
.um-coach img, .um-noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.um-coach span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-coach small { font-size: 10px; color: var(--muted); font-weight: 400; }
@media (max-width: 600px) { .um-card { flex-direction: column; } .um-video { width: 120px; } }

/* ---------- المشاريع ---------- */
.folders-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .folders-layout { grid-template-columns: 1fr; } }
.new-folder { display: flex; gap: 6px; margin-bottom: 8px; }
.new-folder input, .folder-search { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 8px 10px; border-radius: 10px; font: inherit; font-size: 14px; }
.folder-search { width: 100%; margin-bottom: 10px; }
.folder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.folder-list li { background: var(--surface-2); border: 2px solid transparent; border-radius: 10px; padding: 9px 11px; cursor: pointer; }
.folder-list li.active { border-color: var(--accent); }
.folder-list .fname { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fparts { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-top: 3px; }
.fparts .ok { color: var(--ok); }
.fparts .miss { color: var(--muted); opacity: .75; }
.fbadges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.folder-name { flex: 1; min-width: 0; font: inherit; font-size: 20px; font-weight: 800; background: transparent; border: 1px solid transparent; color: var(--text); padding: 4px 8px; border-radius: 8px; }
.folder-name:hover, .folder-name:focus { border-color: var(--line); background: var(--surface-2); outline: none; }
.folder-progress { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.folder-progress .ok { color: var(--ok); font-weight: 700; }
.elements { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1000px) { .elements { grid-template-columns: 1fr; } }
.element { background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.element h3 { margin: 0; font-size: 15px; }
.element video { width: 100%; max-height: 300px; background: #000; border-radius: 8px; }
.element audio { width: 100%; }
.element select { width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 7px 8px; border-radius: 8px; font: inherit; font-size: 13px; }
.el-script { grid-column: 1 / -1; }
.el-script textarea { width: 100%; min-height: 150px; resize: vertical; background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 10px 12px; border-radius: 10px; font: inherit; font-size: 15px; line-height: 1.8; }
.el-script .script-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.el-script .script-meta .dirty { color: var(--accent, #E5613E); font-weight: 600; }
.fup-script { font-size: 12px; color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-empty { border: 2px dashed var(--line); border-radius: 10px; padding: 22px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.el-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-coach { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; }
.el-bar { height: 6px; }
.warn-text { color: var(--warn); font-size: 13px; }
.element details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.folder-up { margin-bottom: 8px; border-style: dashed; }
.folder-up.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.fup-table td { font-size: 13px; word-break: break-word; }
.fup-table tr.done { opacity: .55; }
.fup-coach { min-width: 170px; }
.fup-coach img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; margin-bottom: 4px; }
.fup-coach input { margin-top: 4px; }
.slot { display: flex; gap: 4px; align-items: center; }
.slot select { flex: 1; min-width: 0; }
.slot-label { font-size: 11px; color: var(--muted); margin-top: 6px; }
.fup-table td { vertical-align: top; }
.fup-table td:nth-child(2), .fup-table td:nth-child(3) { min-width: 200px; }
.fup-table td:first-child { min-width: 140px; }
.fup-table select { direction: ltr; text-align: right; }
.fup-add { margin-bottom: 6px; }
#fupAddDrop.over { border-color: var(--accent); }
.clips-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 22px 0 10px; }
.clips-head h3 { margin: 0; }
.btn.pulse { animation: pulse 1s ease-in-out 4; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); } }

/* ---------- المساحة ---------- */
.storage .bar { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin: 4px 0; }
.storage .bar span { display: block; height: 100%; }
.storage ul { list-style: none; padding: 0; margin: 6px 0 10px; font-size: 13px; }
.storage li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.storage li b { direction: ltr; }
.render-log { max-height: 300px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 11px; white-space: pre-wrap; word-break: break-all; text-align: left; }

/* ---------- لمسات عامة: الحقول والنوافذ والرسايل ---------- */
:where(input[type=text], input[type=search], input[type=password], input[type=number], input[type=datetime-local], select, textarea) {
  border-radius: 14px !important; background: rgba(255, 255, 255, .88) !important; border: 1px solid var(--line) !important; color: var(--text) !important;
}
:where(input, select, textarea):focus { outline: 2px solid rgba(229, 97, 62, .35); outline-offset: 1px; }
input[type=range], input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
dialog {
  border: 1px solid var(--glass-line); border-radius: 30px; color: var(--text);
  background: rgba(250, 250, 248, .95); backdrop-filter: blur(24px); box-shadow: 0 40px 90px -40px rgba(40, 20, 10, .5);
}
dialog::backdrop { background: rgba(20, 20, 20, .28); backdrop-filter: blur(4px); }
.toast { border-radius: 999px !important; background: var(--ink) !important; color: #fff !important; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5); z-index: 100 !important; }
.toast.error { background: var(--danger) !important; }
.alert { border-radius: 18px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(20, 20, 20, .15); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.posts li.failed { box-shadow: inset 3px 0 0 var(--danger); background: color-mix(in srgb, var(--danger) 6%, transparent); }
[dir="rtl"] .posts li.failed { box-shadow: inset -3px 0 0 var(--danger); }
.orphans { margin: 0 0 12px; padding: 12px; border-radius: 20px; background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.orphans-title { margin: 0 0 8px; font-weight: 500; }
.orphan { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.orphan video { width: 46px; height: 82px; object-fit: cover; border-radius: 10px; background: #000; }
.orphan .info { flex: 1; min-width: 180px; display: flex; flex-direction: column; font-size: 13px; }
.orphan .when { font-weight: 500; }
.orphan .cap { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orphan .acts { display: flex; gap: 6px; }
.pl-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pl-link { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); text-decoration: none; }
a.pl-link:hover { background: color-mix(in srgb, var(--ok) 24%, transparent); }
.pl-link.nolink { background: var(--surface-2); color: var(--muted); }
.pl-link.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

.car-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .car-layout { grid-template-columns: 1fr; } }
.car-list-panel form { gap: 6px; margin-bottom: 10px; }
.car-list-panel form input { flex: 1; min-width: 0; }
.car-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow: auto; }
.car-list li { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; background: var(--surface-2); }
.car-list li.active { border-color: var(--accent); }
.car-list li img, .car-list li .ph { width: 36px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; background: var(--line); flex: none; }
.car-list .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-list li > div { min-width: 0; font-size: 12px; }
.car-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.car-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.car-head .folder-name { flex: 1; min-width: 180px; }
.car-steps { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.car-steps button { border: none; background: transparent; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.car-steps button i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.car-steps button.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px -4px rgba(0,0,0,.3); }
.car-steps button.active i { background: var(--accent); color: #fff; }
.car-steps button:disabled { opacity: .45; cursor: not-allowed; }

.car-chat { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; min-height: 200px; overflow: auto; padding: 4px; }
.car-chat .msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; line-height: 1.7; font-size: 14px; }
.car-chat .msg.user { align-self: flex-start; background: var(--accent); color: #fff; border-end-start-radius: 4px; }
.car-chat .msg.assistant { align-self: flex-end; background: var(--surface-2); border-end-end-radius: 4px; }
.car-chat .typing { display: flex; gap: 4px; }
.car-chat .typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: carDot 1s infinite; }
.car-chat .typing span:nth-child(2) { animation-delay: .15s; } .car-chat .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes carDot { 50% { opacity: .2; } }
.car-input { display: flex; gap: 8px; margin-top: 10px; }
.car-input textarea { flex: 1; resize: vertical; background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 10px 12px; border-radius: 12px; font: inherit; }
.car-quick { margin-top: 8px; gap: 6px; }
.car-plan-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.car-plan-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.car-plan-bar .btn { margin-inline-start: auto; }

.car-slides-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.car-slide-edit { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 10px; }
.car-slide-edit .num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.car-slide-edit .fields { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.car-slide-edit input, .car-slide-edit textarea { width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 8px 10px; border-radius: 8px; font: inherit; }
.car-slide-edit input { font-weight: 700; font-size: 15px; }
.car-slide-edit details summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.car-slide-edit .acts { display: flex; flex-direction: column; gap: 4px; }

.car-overview { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.car-overview img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--surface-2); }
.car-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 160px; color: var(--muted); font-size: 13px; background: var(--surface-2); border-radius: 12px; }
.car-wait.small { min-height: 0; padding: 8px; flex-direction: row; }
.car-wait .spin { border-color: rgba(0,0,0,.15); border-top-color: var(--accent); margin: 0; }
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.car-card { background: var(--surface-2); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; border: 2px solid transparent; }
.car-card.failed { border-color: var(--danger); }
.car-card.working { border-color: var(--accent); }
.car-card .img { position: relative; background: #fff; }
.car-card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-card .img .car-wait { position: absolute; inset: 0; min-height: 0; border-radius: 0; }
.car-card .img .car-wait.over { background: rgba(255,255,255,.6); }
.car-card .body { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; position: relative; }
.car-card .n { position: absolute; top: -14px; inset-inline-start: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.car-card .txt { line-height: 1.6; margin-top: 6px; }
.car-card .acts { display: flex; gap: 6px; }
.car-card .err { color: var(--danger); font-size: 12px; word-break: break-word; }

.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-height: 70vh; overflow: auto; }
@media (max-width: 800px) { .brand-grid { grid-template-columns: 1fr; } }
.brand-grid textarea, .brand-grid input[type=text], .brand-grid select { width: 100%; }
.brand-logo img { max-height: 64px; max-width: 200px; background: #eee; border-radius: 8px; padding: 6px; }
.brand-refs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.brand-refs .ref { position: relative; }
.brand-refs img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; display: block; }
.brand-refs .del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; }

/* أنواع الكاروسيل والمكتبة والـ CTA */
.car-setup { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.car-setup-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.car-setup-title select { font-weight: 400; }
.car-setup .lib-link { font-weight: 400; font-size: 12px; color: var(--accent); }
.car-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .car-kinds { grid-template-columns: 1fr; } }
.car-kinds button { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; text-align: start; display: flex; flex-direction: column; gap: 2px; color: var(--text); font: inherit; }
.car-kinds button small { color: var(--muted); font-size: 12px; }
.car-kinds button.active { border-color: var(--accent); background: var(--accent-soft); }
.car-pick { display: flex; flex-direction: column; gap: 6px; }
.car-assets { display: flex; gap: 8px; flex-wrap: wrap; }
.car-asset { position: relative; width: 92px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0; overflow: hidden; display: flex; flex-direction: column; font: inherit; color: var(--text); }
.car-asset img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.car-asset span { font-size: 11px; padding: 3px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-asset i { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-size: 12px; display: none; align-items: center; justify-content: center; }
.car-asset.selected { border-color: var(--accent); }
.car-asset.selected i { display: flex; }
.car-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.car-cta select, .car-cta input { flex: 1; min-width: 180px; }
.cta-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.cta-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 6px; }
.lib-dlg { width: min(1100px, 94vw); }
.lib-tabs { align-self: flex-start; margin-bottom: 6px; }
.lib-tools { justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.lib-tools .hint { margin: 0; flex: 1; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; max-height: 64vh; overflow: auto; padding: 2px; }
.lib-grid.detail { display: block; }
.lib-card2 { position: relative; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.lib-card2:hover { transform: translateY(-2px); border-color: var(--accent); }
.lib-card2 .lc-img { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.lib-card2 .lc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-card2 .lc-img em { position: absolute; bottom: 6px; left: 6px; background: rgba(0,0,0,.6); color: #fff; font-style: normal; font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.lib-card2 .lc-name { padding: 7px 9px; font-size: 13px; display: flex; flex-direction: column; overflow: hidden; }
.lib-card2 .lc-name small { color: var(--muted); font-size: 11px; }
.lib-card2 .lc-edit { position: absolute; top: 6px; left: 6px; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.2); font-size: 14px; cursor: pointer; }
.lib-card2 i { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; display: none; align-items: center; justify-content: center; }
.lib-card2.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lib-card2.selected i { display: flex; }
.lib-new-card { border-style: dashed; }
.lib-new-card .lc-img { font-size: 42px; color: var(--accent); }
.lib-detail { display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); border-radius: 14px; padding: 12px; }
.lib-detail .lib-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.lib-detail .lib-meta label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.lib-big { display: flex; gap: 10px; flex-wrap: wrap; }
.lib-big .ref { position: relative; }
.lib-big img { height: 220px; max-width: 360px; object-fit: contain; border-radius: 10px; background: #fff; display: block; }
.lib-big .del { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; }
.lib-big .lib-add { width: 150px; height: 220px; }
.lib-add { width: 72px; height: 90px; border: 2px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--muted); cursor: pointer; }
.lib-status { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
.lib-status.err { background: #fde2e2; color: var(--danger); }
[data-describe].busy, #libUploadBtn.busy { opacity: .6; pointer-events: none; }

/* ---------- نشر الكاروسيل ---------- */
.car-mix-hint { margin: 0 0 4px; }
.car-pub-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (max-width: 700px) { .car-pub-modes { grid-template-columns: 1fr; } }
.car-pub-modes button { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; text-align: start; display: flex; flex-direction: column; gap: 3px; color: var(--text); font: inherit; cursor: pointer; }
.car-pub-modes button small { color: var(--muted); font-size: 12px; }
.car-pub-modes button.active { border-color: var(--accent); background: var(--accent-soft); }
.car-pub-reel, .car-pub-tags, .car-pub-when { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; }
.car-pub-reel label, .car-pub-when label, #carPubSlideWrap { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.car-pub-tags .field { flex: 1; min-width: 240px; margin: 0; }
.car-pub-reel .check, .car-pub-tags .check { flex-direction: row; align-items: center; gap: 6px; }
.car-pub-done video { max-height: 360px; border-radius: 12px; background: #000; display: block; margin-top: 8px; }
.car-pub-done .ok { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); }
#carPubNow.busy, #carPubSchedule.busy { opacity: .6; pointer-events: none; }
.post-thumb { width: 72px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; flex: none; }

/* نسخ السلايدات والشكل العام */
.car-versions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.car-versions > .muted { font-size: 12px; flex-basis: 100%; }
.car-versions .ver { position: relative; width: 52px; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: #fff; }
.car-versions .ver img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.car-overview .car-versions .ver { width: 110px; }
.car-overview .car-versions .ver img { aspect-ratio: auto; }
.car-versions .ver em { position: absolute; bottom: 2px; left: 3px; font-style: normal; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 0 4px; border-radius: 4px; }
.car-versions .ver b { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 9px; font-weight: 400; display: none; align-items: center; justify-content: center; }
.car-versions .ver:hover b { display: flex; }
.car-versions .ver.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* ---------- المسلسلات ---------- */
.ser-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ser-list .ser-name { padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 500; }
.ser-list > li.open > .ser-name { background: var(--accent-soft); }
.ser-list ul { list-style: none; margin: 4px 0 0; padding: 0 12px 0 0; display: flex; flex-direction: column; gap: 2px; }
.ser-list ul li { padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.ser-list ul li.active { background: var(--ink); color: #fff; }
.ser-list ul li.ser-add { cursor: default; padding: 4px 0; }
.ser-list ul form { display: flex; gap: 6px; }
.ser-list ul form input { flex: 1; min-width: 0; }
.ser-title { margin: 0; font-size: 18px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ser-sec textarea { width: 100%; }
.ser-refs img { width: 90px; height: 120px; }
.ser-models .field { flex: 1; min-width: 220px; }
.ser-audio-head { margin-top: 14px; }
#serAudio { width: 100%; margin: 6px 0; }
.ser-lines-wrap { max-height: 55vh; overflow: auto; }
.ser-lines td.txt { max-width: 420px; }
.ser-lines input { width: 78px; }
.ser-lines tr.scene td { background: var(--surface-2); font-weight: 500; font-size: 13px; }
.ser-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ser-scene { grid-column: 1 / -1; font-weight: 500; padding: 6px 2px 0; border-bottom: 1px solid var(--line); }
.shot { background: var(--surface-2); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shot header { display: flex; align-items: center; gap: 8px; }
.shot header b { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.shot header .t { font-size: 12px; color: var(--muted); flex: 1; direction: ltr; text-align: end; }
.shot header .dur { font-weight: 600; color: var(--accent); }
.shot .said { font-size: 13px; line-height: 1.6; }
.shot .meta { font-size: 11px; color: var(--muted); }
.shot textarea { font-size: 12px; width: 100%; }
.shot .takes, .ser-pool-list { display: flex; gap: 6px; flex-wrap: wrap; }
.take { position: relative; width: 68px; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: #000; border: 2px solid transparent; cursor: pointer; }
.take video { width: 100%; height: 100%; object-fit: cover; display: block; }
.take .car-wait { height: 100%; font-size: 10px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2px; }
.take.failed { background: #5a1f1f; }
.take em { position: absolute; bottom: 2px; left: 3px; font-style: normal; font-size: 10px; background: rgba(0,0,0,.65); color: #fff; padding: 0 4px; border-radius: 4px; }
.take b { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; font-size: 9px; font-weight: 400; display: none; align-items: center; justify-content: center; }
.take:hover b { display: flex; }
.take.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.shot .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.shot .off { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.shot .off input { width: 60px; }
.shot .warn { font-size: 11px; color: var(--danger); }
.ser-pool { margin-top: 16px; }
.ser-pool h3 { font-size: 15px; font-weight: 500; margin: 0 0 8px; }
.pool-item { display: flex; flex-direction: column; gap: 4px; width: 120px; }
.pool-item .take { width: 100%; }
.ser-rendered video { max-height: 70vh; border-radius: 12px; background: #000; display: block; margin-top: 12px; }

.ser-steps { margin: 4px 0 10px; padding-inline-start: 20px; font-size: 13px; color: var(--muted); line-height: 1.8; }
.ser-bulk { margin-bottom: 12px; align-items: center; }
.ser-chat { max-height: 40vh; }
.ser-chat pre { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 6px 0 0; }
.ser-chat summary { cursor: pointer; font-weight: 500; }
.shot .frame { position: relative; aspect-ratio: 9 / 16; max-height: 360px; border-radius: 10px; overflow: hidden; background: var(--surface); }
.shot .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .frame .car-wait { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.shot .frame .car-wait.over { position: absolute; inset: 0; background: rgba(255,255,255,.6); }
.frame-vers { display: flex; gap: 4px; flex-wrap: wrap; }
.frame-vers img { width: 34px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 4px; border: 2px solid transparent; cursor: pointer; }
.frame-vers img.sel { border-color: var(--accent); }
.shot.approved { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.shot.ready { box-shadow: inset 0 0 0 2px #2F855A; }
.take.ok { border-color: #2F855A; }
.take-acts { padding-top: 2px; }
.take .retry { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); border: 0; border-radius: 999px; background: #fff; padding: 2px 10px; font-size: 14px; cursor: pointer; }
.ser-del-dlg { max-width: 520px; }
.ser-del-dlg h2 { margin: 0 0 6px; font-size: 18px; font-weight: 500; }
.shot header .danger { padding: 4px 8px; }

/* معرض فيديوهات الحلقة */
.ser-gal-dlg { width: min(1200px, 96vw); }
.ser-gal-dlg .panel-head h2 { margin: 0; font-size: 18px; font-weight: 500; }
.ser-gal-dlg .panel-head .muted { flex: 1; }
.ser-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 70vh; overflow-y: auto; padding: 4px; }
.gal-tile { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: #111; border: 2px solid transparent; cursor: pointer; padding: 0; color: #fff; }
.gal-tile:hover { border-color: var(--accent); }
.gal-tile video, .gal-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-tile.todo img { opacity: .45; }
.gal-tile.done { border-color: #2F855A; }
.gal-tile.review { border-color: #D69E2E; }
.gal-tile .n { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.7); border-radius: 6px; padding: 0 6px; font-size: 12px; }
.gal-tile .st { position: absolute; bottom: 4px; inset-inline: 4px; background: rgba(0,0,0,.7); border-radius: 6px; padding: 2px 4px; font-size: 11px; text-align: center; }
.gal-tile .spin { position: absolute; top: 50%; left: 50%; margin: -12px 0 0 -12px; }
.ser-gal-nav { align-items: center; gap: 8px; margin-bottom: 8px; }
.ser-gal-nav .spacer { flex: 1; }
.ser-gal-body { display: flex; gap: 14px; align-items: flex-start; }
.ser-gal-stage { flex: 0 0 auto; height: min(72vh, 760px); aspect-ratio: 9 / 16; background: #000; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; }
.ser-gal-stage video, .ser-gal-stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ser-gal-stage img { opacity: .5; }
.ser-gal-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ser-gal-side .take { width: 60px; }
.ser-gal-voice { display: flex; gap: 6px; align-items: center; font-size: 14px; }
@media (max-width: 760px) {
  .ser-gal-body { flex-direction: column; align-items: stretch; }
  .ser-gal-stage { height: 56vh; align-self: center; }
  .ser-gal-dlg .panel-head { flex-wrap: wrap; }
  .ser-gal-dlg .panel-head .muted { order: 3; flex-basis: 100%; font-size: 12px; }
}
.take .zoom { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; font-size: 10px; display: none; align-items: center; justify-content: center; }
.take:hover .zoom { display: flex; }
.ser-gal-stage { position: relative; }
.take.viewing { outline: 3px solid var(--accent); outline-offset: 1px; }
#serGalTabs [data-count]::after { content: " (" attr(data-count) ")"; opacity: .7; }
.ser-missing { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #FFF5E6; color: #7a4a00; border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 14px; }
.ser-missing b { font-weight: 500; }
.ser-missing .chip { border: 1px solid #D69E2E; background: #fff; color: #7a4a00; border-radius: 999px; padding: 1px 10px; cursor: pointer; font: inherit; }
.ser-missing .chip:hover { background: #D69E2E; color: #fff; }

/* كلام جديد على نفس الفيديوهات */
.ser-rewrite { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0 14px; }
.ser-rewrite h2 { font-size: 16px; }
.ser-rw-lines { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; margin: 8px 0; }
.rw-line { display: flex; gap: 8px; align-items: flex-start; }
.rw-line > b { min-width: 22px; text-align: center; padding-top: 6px; }
.rw-body { flex: 1; min-width: 0; }
.rw-line .old { font-size: 13px; color: var(--muted, #888); margin-bottom: 2px; }
.rw-line textarea { width: 100%; resize: vertical; font: inherit; }
.rw-line .wc { font-size: 12px; white-space: nowrap; padding-top: 6px; color: var(--muted, #888); }
.rw-line .wc.long { color: #C05621; }
.ser-banner { background: #EBF8FF; color: #1A4E7A; border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.ser-add-from { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; font-size: 14px; }
.ser-add-dlg textarea { width: 100%; }
.shot.flash { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }
.shot header .added { font-size: 12px; }
.rw-line.new textarea { border-color: var(--accent); }
.rw-line .new-tag { color: var(--accent); }
.rw-line .rw-tools { display: flex; gap: 2px; padding-top: 2px; }
.rw-line .rw-tools .btn { padding: 2px 6px; }
#serRwManual { margin-top: 6px; }
.ser-ep-row { align-items: flex-end; gap: 8px; }
.ser-ep-row .field { flex: 1; min-width: 200px; }
/* زراير الجملة قدام خانة الكتابة على نفس السطر */
.rw-edit { display: flex; gap: 6px; align-items: center; }
.rw-edit textarea { flex: 1; min-width: 0; }
.rw-edit .wc, .rw-edit .rw-tools { padding-top: 0; }
.rw-line > b { align-self: flex-end; padding: 0 0 8px; }
/* ترتيب اللقطات بالسحب */
.shot header .drag { cursor: grab; font-size: 18px; color: var(--muted); padding: 0 2px; user-select: none; touch-action: none; }
.shot header .mv { padding: 4px 7px; }
.shot.dragging { opacity: .45; }
.shot.drop-before { box-shadow: 4px 0 0 0 var(--accent); }
.shot.drop-after { box-shadow: -4px 0 0 0 var(--accent); }
/* الكلام الجديد على اللقطات */
.shot .new-said { color: #2F855A; font-weight: 500; }
.shot .old-said { color: var(--muted); font-size: 12px; }
.shot-ghost { border: 2px dashed var(--accent); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; justify-content: center; font-size: 14px; background: var(--surface); }
.shot-ghost b { font-size: 20px; }
.shot-ghost .muted { font-size: 12px; }
.shot .prompt-busy { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); }
.shot .prompt-busy .spin { width: 14px; height: 14px; }
.prompt-new { font-size: 12px; color: #2F855A; background: #F0FFF4; border-radius: 8px; padding: 4px 8px; }
.sel-up { display: flex; gap: 6px; align-items: center; }
.sel-up .field { flex: 1; min-width: 0; margin: 0; }

/* ---------- الإعلانات ---------- */
.ad-side { display: flex; flex-direction: column; gap: 10px; }
.ad-up { justify-content: center; }
.ad-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.ad-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.ad-list li:hover { background: var(--surface-2); }
.ad-list li.active { background: var(--accent-soft); }
.ad-list img, .ad-list .ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #111; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ad-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ad-title { font-size: 20px; font-weight: 600; border: 0; background: transparent; color: var(--text); padding: 4px 0; min-width: 0; flex: 1; }
.ad-status { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.ad-status.err { background: #FFF0F0; color: #9B2C2C; }
.ad-top { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 760px) { .ad-top { grid-template-columns: 1fr; } }
.ad-top video { width: 100%; max-height: 60vh; background: #000; border-radius: 12px; }
.ad-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ad-f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.ad-f textarea { font: inherit; font-size: 14px; color: var(--text); resize: vertical; width: 100%; }
.ad-scenes { display: flex; flex-direction: column; gap: 10px; }
.ad-scene { display: grid; grid-template-columns: 150px 1fr; gap: 12px; background: var(--surface-2); border-radius: 14px; padding: 10px; }
@media (max-width: 760px) { .ad-scene { grid-template-columns: 1fr; } }
.ad-scene-media { position: relative; display: flex; flex-direction: column; gap: 4px; }
.ad-scene-media img { width: 100%; border-radius: 10px; cursor: pointer; background: #000; }
.ad-scene-media b { position: absolute; top: 6px; right: 6px; background: var(--ink); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.ad-scene.adapt .ad-scene-media b { position: static; }
.ad-scene-media .t { font-size: 12px; color: var(--muted); direction: ltr; }
.ad-scene-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; align-items: start; }
.ad-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-chips span { background: var(--surface-2); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.ad-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.ad-card { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ad-tr { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ad-tr p { margin: 0; }
.ad-tr .t, .ad-card i { direction: ltr; display: inline-block; color: var(--accent); cursor: pointer; font-style: normal; font-size: 12px; min-width: 44px; }
.ad-adapt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ad-adapt-title { font-size: 18px; font-weight: 600; flex: 1; min-width: 200px; }
.ad-style-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-style-card { width: 110px; border: 2px solid transparent; border-radius: 12px; background: var(--surface-2); padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: inherit; color: var(--text); }
.ad-style-card img, .ad-style-card .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #ddd; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.ad-style-card b { font-size: 12px; font-weight: 500; }
.ad-style-card.sel { border-color: var(--accent); }
.ad-set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ad-model { margin-top: 14px; max-width: 420px; }
.ad-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.ad-style { background: var(--surface-2); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ad-style .imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ad-style .imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.ad-style textarea { font-size: 13px; width: 100%; }
.spin-inline { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: middle; }
/* محرر القص والكروب */
.ad-edit-dlg { width: min(1100px, 96vw); }
.ad-edit-dlg h2 { margin: 0; font-size: 18px; font-weight: 500; }
.ad-ed-body { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
@media (max-width: 800px) { .ad-ed-body { grid-template-columns: 1fr; } }
.ad-ed-stage { background: #111; border-radius: 12px; display: flex; align-items: center; justify-content: center; min-height: 240px; padding: 8px; }
.ad-ed-wrap { position: relative; display: inline-block; line-height: 0; touch-action: none; }
.ad-ed-wrap video { max-width: 100%; max-height: 66vh; display: block; }
.ad-ed-crop { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; }
.ad-ed-crop i { position: absolute; width: 22px; height: 22px; background: #fff; border-radius: 4px; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.ad-ed-crop i[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.ad-ed-crop i[data-h="ne"] { right: 0; top: 0; cursor: nesw-resize; }
.ad-ed-crop i[data-h="sw"] { left: 0; bottom: 0; cursor: nesw-resize; }
.ad-ed-crop i[data-h="se"] { right: 0; bottom: 0; cursor: nwse-resize; }
.ad-ed-wrap { overflow: hidden; border-radius: 6px; }
.ad-ed-side { display: flex; flex-direction: column; gap: 8px; }
.ad-ed-side input[type=range] { width: 100%; }
.ad-ed-times { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.ad-ed-times #adEdNowLbl { color: var(--text); font-weight: 600; }
#adEdRatios .btn.active { background: var(--ink); color: #fff; }
.ad-ed-acts { margin-top: auto; }
/* تنفيذ الإعلان */
.ad-prod-start { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ad-header { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.ad-header summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.ad-header-row { align-items: flex-end; gap: 10px; margin-top: 8px; }
.ad-pshots { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.ad-pshot { background: var(--surface-2); border-radius: 16px; padding: 12px; display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 14px; }
.ad-pshot > div { min-width: 0; }
.ad-pshot .frame { max-width: 220px; }
.ad-pshot .frame img { max-height: 400px; object-fit: contain; }
.ad-pshot.approved { box-shadow: 0 0 0 2px #2F855A inset; }
@media (max-width: 860px) { .ad-pshot { grid-template-columns: minmax(0, 1fr); } .ad-pshot .frame { max-width: 260px; } }
.ad-pshot .frame { position: relative; border-radius: 12px; overflow: hidden; background: #111; min-height: 160px; display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; }
.ad-pshot .frame img { width: 100%; display: block; }
.ad-pshot .ref { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.ad-pshot .ref img { width: 56px; border-radius: 6px; }
.ad-pshot .vers { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.ad-pshot .vers img { width: 40px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.ad-pshot .vers img.sel { border-color: var(--accent); }
.ad-pshot header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ad-pshot header b.n { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.ad-pshot .body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ad-comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ad-comp { background: var(--surface); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ad-comp.off { opacity: .5; }
.ad-comp .img { aspect-ratio: 1; border-radius: 8px; background: #eee; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #888; }
.ad-comp .img img { width: 100%; height: 100%; object-fit: contain; }
.ad-comp .kind { font-size: 11px; color: var(--muted); }
.ad-comp textarea, .ad-comp input[type=text] { font-size: 12px; width: 100%; }
.ad-comp .row { gap: 4px; }
.ad-takes { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-take { width: 120px; position: relative; border-radius: 10px; overflow: hidden; background: #000; border: 2px solid transparent; }
.ad-take.sel { border-color: var(--accent); }
.ad-take.ok { border-color: #2F855A; }
.ad-take video { width: 100%; display: block; }
.ad-take .wait { color: #fff; font-size: 12px; padding: 18px 6px; text-align: center; }
.ad-take .acts { display: flex; gap: 2px; flex-wrap: wrap; padding: 4px; background: var(--surface); }
.ad-take .acts .btn { padding: 2px 6px; font-size: 11px; }
.ad-scenes-head { align-items: center; gap: 10px; margin-top: 10px; }
.ad-mg { grid-column: 1 / -1; font-size: 13px; background: var(--surface); border-radius: 10px; padding: 6px 10px; }
.ad-scomps { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ad-scomp { background: var(--surface); border-radius: 10px; padding: 4px 8px; font-size: 12px; display: inline-flex; flex-direction: column; max-width: 240px; }
.ad-scomp small { color: var(--muted); font-size: 11px; }

/* الإعلانات: زرار «التالي» بين الخطوات، وتحذير الخطوة القديمة */
.ad-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px;
  padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line, #ddd); }
.ad-next .muted { font-size: 13px; }
.ad-stale { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 12px; padding: 10px 14px;
  border-radius: 12px; background: #FFF7E6; color: #7A4B00; font-size: 14px; }
.ad-stale .grow { flex: 1 1 220px; }
#adTabs .ad-side-tab { opacity: .85; font-style: italic; }
.ad-motion { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; padding: 8px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #E8613C) 8%, transparent); }
.ad-mg.orig { font-size: 13px; opacity: .85; }
.ad-comp .kind .up { color: var(--accent, #E8613C); font-weight: 600; }
/* شريط «بيعمل إيه دلوقتي» في الإعلانات */
.ad-activity { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0;
  padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.ad-activity.busy { background: #EAF6F4; color: #1F4D48; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.ad-activity .spin { width: 16px; height: 16px; }
.ad-activity .dot { width: 9px; height: 9px; border-radius: 50%; background: #9AA5A0; }
.ad-activity .ad-act { border: 0; border-radius: 999px; padding: 4px 10px; background: #fff; color: inherit; font: inherit; cursor: pointer; }
.ad-activity .ad-act:hover { background: #D6EFEB; }
/* عقل الإعلان */
.ad-brain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.ad-brain-item { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border-radius: 12px; padding: 8px; position: relative; min-width: 0; }
.ad-brain-item img { width: 100%; height: 200px; object-fit: contain; background: var(--surface); border-radius: 8px; }
.ad-brain-item textarea, .ad-brain-item input { width: 100%; font-size: 12px; }
.ad-brain-item [data-bdel] { position: absolute; top: 12px; inset-inline-start: 12px; }
#adBrain .row { align-items: flex-end; }
/* معاينة فيديوهات الإعلان */
.ad-take-play { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.ad-take-play i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 26px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.ad-take-play:hover i { font-size: 32px; }
.ad-gal-takes { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-gal-takes .take { position: relative; width: 64px; aspect-ratio: 9 / 16; padding: 0; border-radius: 8px; overflow: hidden; background: #111; color: #fff; border: 2px solid transparent; cursor: pointer; font-size: 10px; }
.ad-gal-takes .take video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-gal-takes .take.sel { border-color: var(--accent); }
.ad-gal-takes .take small { position: absolute; bottom: 2px; inset-inline: 2px; background: rgba(0,0,0,.7); border-radius: 4px; }
/* مقاسات ثابتة في التنفيذ: الصفحة متتهزش وهي بتتحدث أثناء التوليد */
.ad-pshot .frame { aspect-ratio: var(--ad-ar, 9 / 16); min-height: 0; width: 100%; }
.ad-pshot .frame img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.ad-take-play, .ad-take .wait { aspect-ratio: var(--ad-ar, 9 / 16); }
.ad-take .wait { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; box-sizing: border-box; }
.ad-take-play video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-pshot .vers img, .ad-pshot .ref img { aspect-ratio: var(--ad-ar, 9 / 16); object-fit: cover; }
.ad-comp .img { aspect-ratio: 1; }
.ad-take .acts { min-height: 30px; box-sizing: border-box; }
.ad-take-badge { position: absolute; top: 4px; inset-inline-start: 4px; z-index: 2; background: var(--accent); color: #fff; font-size: 10px; border-radius: 6px; padding: 1px 5px; }
.ad-note { font-size: 12px; margin: 4px 0 0; }
/* ✏️ نافذة التعديل */
.ad-fix-dlg { width: min(560px, 94vw); }
.ad-fix-dlg h2 { font-size: 18px; margin: 0 0 8px; }
.ad-fix-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 12px; }
.ad-fix-refs .muted { font-size: 12px; }
.ad-fix-thumbs { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; }
.ad-fix-thumbs .th { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: #eee; }
.ad-fix-thumbs .th img { width: 100%; height: 100%; object-fit: cover; }
.ad-fix-thumbs .th button { position: absolute; top: 2px; inset-inline-end: 2px; border: 0; border-radius: 50%; width: 20px; height: 20px; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; font-size: 11px; }
/* 🎭 الأبطال والمكونات المتكررة */
.ad-cast { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 8px 0 12px; background: var(--surface); }
.ad-cast-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ad-cast-head .pane-h { margin: 0; }
.ad-cast-head .muted { flex: 1 1 200px; font-size: 13px; }
.ad-cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 8px; }
.ad-cast-card { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border-radius: 12px; padding: 8px; min-width: 0; border: 2px solid transparent; }
.ad-cast-card.ok { border-color: #2F855A; }
.ad-cast-card .img { position: relative; aspect-ratio: 3 / 4; background: #eee; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #888; }
.ad-cast-card .img img { width: 100%; height: 100%; object-fit: contain; background: #f4f4f4; }
.ad-cast-card .vers { display: flex; gap: 4px; flex-wrap: wrap; }
.ad-cast-card .vers img { width: 34px; height: 44px; object-fit: cover; border-radius: 5px; cursor: pointer; border: 2px solid transparent; }
.ad-cast-card .vers img.sel { border-color: var(--accent); }
.ad-cast-card input, .ad-cast-card textarea, .ad-cast-card select { width: 100%; font-size: 12px; }
.ad-cast-card .okb { color: #2F855A; font-size: 12px; white-space: nowrap; }
/* ✍️ برومبت الستوري بورد بالمنشن */
.ad-sb { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.ad-ments { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-ments .ment { display: inline-flex; align-items: center; gap: 5px; background: #EAF6F4; color: #1F4D48; border-radius: 999px; padding: 2px 10px 2px 2px; font-size: 12px; font-weight: 600; }
.ad-ments .ment img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #fff; }
/* 🎙️ الصوت و👄 الكلام على الوش */
.ad-voices { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin: 0 0 12px; background: var(--surface); }
.ad-voices .row { align-items: flex-end; gap: 10px; }
.ad-voices .muted { font-size: 12px; flex: 1 1 220px; }
.ad-voice { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.ad-voice audio { width: 100%; height: 34px; }
.ad-voice .muted { font-size: 12px; }
.ad-lip { background: #EAF6F4; border-radius: 8px; padding: 6px; }
.ad-take-badge.alt { background: #2B6CB0; }
/* الإعلان كله بالصوت */
.ad-gal-full-row { margin-bottom: 10px; gap: 10px; align-items: center; }
.ad-gal-full-row .muted { font-size: 13px; flex: 1 1 240px; }
.ad-gal-full { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ad-gal-full .ser-gal-nav { align-self: stretch; }
.ad-gal-full audio { width: min(520px, 100%); }

/* 🎛️ التطبيق على البراند */
.ad-brandctl { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; }
.ad-brandctl > summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
.ad-brandctl .row { margin-top: 8px; gap: 8px; align-items: center; }
.ad-dir-chosen { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); }
.ad-dirs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.ad-dirs:empty { display: none; }
.ad-dir { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ad-dir h4 { margin: 0; }
.ad-dir p { margin: 0; }
.ad-dir dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0; font-size: .88em; }
.ad-dir dt { opacity: .75; white-space: nowrap; }
.ad-dir dd { margin: 0; }
.ad-dir button { margin-top: auto; align-self: flex-start; }

/* 💰 رصيد Atlas */
.money-btn b { font-size: 11px; font-weight: 700; color: var(--ok); direction: ltr; }
.money-dlg { max-width: 460px; }
.money-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.money-grid div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.money-grid span { font-size: 12px; color: var(--muted); }
.money-grid b { font-size: 20px; direction: ltr; text-align: start; }
.money-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.money-tbl td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.money-tbl td:last-child { text-align: end; font-weight: 700; }
@media (max-width: 520px) { .money-grid { grid-template-columns: 1fr; } }

/* 📁 مشاريع الإعلانات */
.ad-li-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ad-list .ad-li-body .nm { flex: none; }
.ad-stages { display: flex; flex-wrap: wrap; gap: 3px; }
.ad-stages i { font-style: normal; font-size: 10.5px; padding: 1px 5px; border-radius: 6px; background: var(--surface-2); opacity: .45; white-space: nowrap; }
.ad-stages i.on { opacity: 1; background: var(--accent-soft); }

/* 🔬 معمل التفكيك */
.lab-actions { gap: 6px; }
.lab-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.lab-st { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.lab-st.failed { background: #fde6e3; }
.lab-st.done { background: #e4f5ec; }
.lab-score { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; font-size: 13px; }
.lab-sc { padding: 4px 10px; border-radius: 10px; background: var(--accent-soft); }
.lab-sc small { opacity: .65; margin-inline-start: 4px; }
.lab-top { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 12px; align-items: start; margin-bottom: 12px; }
.lab-top video { width: 100%; max-height: 60vh; background: #000; border-radius: 12px; }
.lab-tl { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.lab-lane { display: flex; align-items: center; height: 26px; }
.lab-ll { width: 96px; flex: none; font-size: 12px; color: var(--muted); }
.lab-lt { position: relative; flex: 1; height: 100%; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.lab-lt .blk { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; cursor: pointer; font-style: normal; font-size: 11px; color: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lab-lt .blk.shot { background: #5b7083; }
.lab-lt .blk.shot.bad { background: var(--danger); }
.lab-lt .blk.sp { background: #4f8fd6; }
.lab-lt .blk.mu { background: #9c6ad6; opacity: .75; }
.lab-lt .tick { position: absolute; top: 2px; bottom: 2px; width: 3px; margin-right: -1px; background: var(--accent); border-radius: 2px; cursor: pointer; }
.lab-lt .tick.ok { background: var(--ok); }
.lab-lt .tick.bad { background: #222; }
.lab-head { position: absolute; top: 4px; bottom: 4px; width: 2px; background: #e53935; pointer-events: none; }
.lab-sec { margin-bottom: 12px; }
.lab-sec h4 { margin: 14px 0 6px; }
.lab-rows { display: flex; flex-direction: column; gap: 4px; }
.lab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.lab-row input[type=text] { min-width: 140px; flex: 0 1 220px; }
.lab-row input.sm { flex: 0 1 110px; min-width: 80px; }
.lab-row .grow { flex: 1 1 160px; }
.lab-time { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); direction: ltr; white-space: nowrap; }
.lab-rv { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: auto; }
.lab-rv button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 2px 6px; cursor: pointer; opacity: .45; font-size: 13px; }
.lab-rv button.on { opacity: 1; }
.lab-rv button.on.ok { background: #e4f5ec; border-color: var(--ok); }
.lab-rv button.on.bad { background: #fde6e3; border-color: var(--danger); }
.lab-note { width: 120px; font-size: 12px; }
.lab-shot { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.lab-shot > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lab-shot .chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.lab-strip { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.lab-strip img { height: 86px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; flex: none; }
.lab-strip img.sel { border-color: var(--accent); }
.lab-els { display: flex; flex-direction: column; gap: 8px; }
.lab-el { background: var(--surface-2); border-radius: 10px; padding: 6px 8px; }
.lab-act { padding-inline-start: 18px; border-bottom: none; }
@media (max-width: 760px) { .lab-top { grid-template-columns: 1fr; } .lab-top video { max-height: 45vh; } .lab-ll { width: 64px; } }
.lab-st.skipped { background: #f3efe2; }
.lab-stem-l { width: 110px; flex: none; }
.lab-row audio { height: 34px; flex: 1 1 220px; max-width: 420px; }
/* مربع عرض كل لقطة + اسمع حارة وحدة */
.lab-shot { display: grid; grid-template-columns: 210px 1fr; gap: 12px; align-items: start; }
.lab-shotplay { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.lab-shotplay video { width: 100%; max-height: 360px; background: #000; border-radius: 10px; object-fit: contain; }
.lab-shotbody { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lab-hear { border: none; background: none; cursor: pointer; padding: 0 2px; font-size: 14px; opacity: .55; }
.lab-hear.on { opacity: 1; }
.lab-ll { display: inline-flex; align-items: center; gap: 2px; }
.lab-hearnote { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.lab-hearnote.on { color: var(--warn); font-weight: 600; }
@media (max-width: 760px) { .lab-shot { grid-template-columns: 1fr; } .lab-shotplay { position: static; } .lab-shotplay video { max-height: 50vh; } .lab-ll { width: 78px; } }

/* ✏️ التعديل جوه المشهد */
.lab-vedit { border: 1px solid var(--accent); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--accent-soft); }
.lab-vedit textarea { width: 100%; }
.lab-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.lab-chips .chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 8px; font-size: 12px; cursor: pointer; }
.lab-speed summary { cursor: pointer; font-size: 13px; }
.lab-speed input[type=number] { width: 64px; }
.lab-vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.lab-ver { background: var(--surface); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.lab-ver video { width: 100%; max-height: 260px; background: #000; border-radius: 8px; }
.lab-ver-wait { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; }

/* 📚 مكتبة الأصول */
.lab-libbtn { width: 100%; margin-top: 10px; justify-content: center; }
.lab-libbtn.active { border-color: var(--accent); background: var(--accent-soft); }
.lab-asset { border: 1px dashed var(--line); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; gap: 6px; }
.lab-asset[open] { border-style: solid; border-color: var(--ok); }
.lab-asset summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.lab-asset .row { gap: 6px; margin-top: 4px; }
.lab-asset input[type=number] { width: 80px; }
.lab-asset input[data-af=name] { flex: 1 1 220px; }
.lab-chips .chip.on { border-color: var(--accent); background: var(--accent-soft); }
.as-filter { gap: 8px; margin-bottom: 10px; }
.as-filter input[type=search] { flex: 0 1 260px; }
.as-motion { max-height: 420px; overflow: auto; }
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.as-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.as-card:hover { border-color: var(--accent); }
.as-card video { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #000; border-radius: 8px; pointer-events: none; }
.as-tags { color: var(--accent); }
.as-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 12px; }
.as-top video { width: 100%; max-height: 60vh; background: #000; border-radius: var(--radius-sm); }
.as-meta { display: flex; flex-direction: column; gap: 8px; }
.as-meta label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
@media (max-width: 760px) { .as-top { grid-template-columns: 1fr; } }

/* 💡 الكومبوننتس المقترحة */
.lab-lt .blk.comp { background: #e3a33b; opacity: .85; }
.lab-lt .blk.comp.ok { background: var(--ok); opacity: 1; }
.lab-lt .blk.comp.bad { background: var(--danger); opacity: .45; }
.lab-comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 8px; }
.lab-comp { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); transition: box-shadow .3s; }
.lab-comp.ok { border-color: var(--ok); background: #f1faf5; }
.lab-comp.bad { opacity: .6; }
.lab-comp.flash { box-shadow: 0 0 0 3px var(--accent); }
.lab-comp video { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #000; border-radius: 8px; }
.lab-comp .lab-cname { font-weight: 600; width: 100%; }
.lab-comp input[type=number] { width: 72px; }
.lab-comp label { font-size: 12px; }
.lab-ctls { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; align-items: center; }
.lab-ctl { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 2px 8px; }
.lab-ctl i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; }
.lab-cact { gap: 6px; }
.lab-cact .lab-note { min-width: 120px; }
.btn.ok { border-color: var(--ok); color: var(--ok); }
#labAudio > details > summary { cursor: pointer; }
.as-ctls { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: var(--surface); border-radius: 10px; padding: 8px; }
.as-ctls > b, .as-ctls > small { flex-basis: 100%; }
.as-ctl { display: flex; flex-direction: column; gap: 3px; font-size: 12px; min-width: 140px; }
.as-ctl input[type=color] { width: 56px; height: 32px; padding: 0; }
.lab-lt .blk.shot.off { background: #c9ced3; color: #6b7280; text-decoration: line-through; }
.lab-gone { border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; margin-bottom: 10px; }
.lab-gone summary { cursor: pointer; }
.lab-gone-th { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; }

/* 👤 العملاء */
.rail-btn.client-btn { border-color: var(--accent); }
.client-av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex;
  align-items: center; justify-content: center; font-style: normal; font-weight: 700; font-size: 14px; overflow: hidden; flex: none; }
.client-av img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.rail-btn.client-btn span { max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.client-dlg { width: min(560px, 94vw); }
.client-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.client-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; text-align: start; font: inherit; color: inherit; }
.client-card:hover { border-color: var(--accent); }
.client-card.on { border-color: var(--accent); background: var(--accent-soft); }
.client-card .client-av { width: 40px; height: 40px; }
.client-card > span { display: flex; flex-direction: column; flex: 1; }
.client-now { color: var(--accent); font-weight: 600; }
.stage-client { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--text);
  border-radius: 999px; padding: 3px 10px 3px 4px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; max-width: 200px; }
.stage-client .client-av { width: 26px; height: 26px; font-size: 12px; }
.stage-client span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-lt .blk.shot.chg { background: #7d93a8; border-inline-end: 2px dashed #fff; }
.lab-fr { position: relative; flex: none; }
.lab-frcut { position: absolute; top: 3px; inset-inline-end: 3px; border: none; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 12px; padding: 1px 4px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.lab-fr:hover .lab-frcut, .lab-frcut:focus { opacity: 1; }
@media (hover: none) { .lab-frcut { opacity: .85; } }

/* 🔗 الكونيكتورز */
.lab-lt .blk.conn { background: #7b5cd6; opacity: .85; }
.lab-lt .blk.conn.ok { background: var(--ok); opacity: 1; }
.lab-lt .blk.conn.bad { background: var(--danger); opacity: .45; }
.lab-conns { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.lab-conn { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px; background: var(--surface); transition: box-shadow .3s; }
.lab-conn.ok { border-color: var(--ok); background: #f1faf5; }
.lab-conn.bad { opacity: .6; }
.lab-conn.flash { box-shadow: 0 0 0 3px var(--accent); }
.lab-conn-media video { width: 100%; max-height: 420px; background: #000; border-radius: 8px; }
.lab-conn-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.lab-conn-keys figure { margin: 0; }
.lab-conn-keys img { width: 100%; border-radius: 6px; cursor: pointer; display: block; }
.lab-conn-keys figcaption { font-size: 11px; color: var(--muted); text-align: center; }
.lab-conn-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lab-conn-body input[type=number] { width: 72px; }
.lab-conn-story { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.lab-conn-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: 13px; }
.lab-conn-dl dt { font-weight: 600; white-space: nowrap; }
.lab-conn-dl dd { margin: 0; }
.lab-conn-tr { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.lab-conn-recipe { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; }
.lab-conn-recipe textarea { width: 100%; font-weight: 400; }
@media (max-width: 760px) { .lab-conn { grid-template-columns: 1fr; } }
.as-conn .lab-conn-keys { max-width: 520px; }
.as-recipe { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 3px; }
.lab-conn-range { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 12px; }
.lab-conn-range .row { gap: 4px; align-items: center; }
.lab-conn-range b { width: 52px; }
.lab-xedit { display: flex; flex-direction: column; gap: 6px; border: 1px dashed var(--accent); border-radius: 10px; padding: 8px; }
.lab-xe { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; }
.lab-xe textarea { width: 100%; font-weight: 400; }
.lab-xe2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lab-xtr { display: flex; flex-direction: column; gap: 4px; }
.lab-xtr-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-weight: 400; }
.lab-xtr-row input[type=number] { width: 64px; }
.lab-xtr-row input[type=text] { flex: 1 1 110px; min-width: 0; }
.lab-conn-chat { display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 6px 8px; }
.lab-conn-chat .msg { font-size: 12px; }
.lab-conn-chat .msg.model { color: var(--accent); }
@media (max-width: 760px) { .lab-xe2 { grid-template-columns: 1fr; } }

/* 🧪 تجربة الكونيكتور */
.as-tmode { gap: 14px; }
.as-tsides { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.as-tside { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; }
.as-tthumb { width: 120px; border-radius: 8px; }
.as-tarrow { font-size: 18px; }
.as-trial { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.as-trial.done { border-color: var(--ok); }
.as-trial.failed { border-color: var(--danger); }
.as-trial > header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.as-tchain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.as-tchain figure { margin: 0; }
.as-tchain img { width: 110px; border-radius: 8px; display: block; }
.as-tchain figcaption { font-size: 11px; text-align: center; color: var(--muted); }
.as-tvids { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 720px; }
.as-tvids figure { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.as-tvids video { width: 100%; max-height: 60vh; background: #000; border-radius: 10px; }
.as-tplan summary { cursor: pointer; font-weight: 600; }
.as-tplan { display: flex; flex-direction: column; gap: 6px; }
.as-tadapt { white-space: pre-line; background: var(--surface-2); border-radius: 8px; padding: 6px 8px; }
.as-tplan input[type=number] { width: 70px; }
@media (max-width: 620px) { .as-tvids { grid-template-columns: 1fr; } }
.voice-sync { display: flex; flex-direction: column; gap: 6px; background: #fff4e0; border: 1px solid #f0b54a; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; }
.voice-sync .btn { align-self: flex-start; }
.btn.warn-btn { background: #fff4e0; border-color: #f0b54a; color: #7a4b00; font-weight: 600; }
/* 🎞️ فيديو بالكونيكتورز */
.fm-new { display: flex; flex-direction: column; gap: 10px; }
.fm-new textarea { width: 100%; }
.fm-conns { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 6px; }
.fm-conn { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; position: relative; opacity: .6; }
.fm-conn.on { border-color: var(--accent); background: var(--accent-soft); opacity: 1; }
.fm-conn input { position: absolute; top: 8px; inset-inline-start: 8px; }
.fm-conn video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: #000; }
.fm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.fm-card { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; background: var(--surface); }
.fm-card:hover { border-color: var(--accent); }
.fm-card img, .fm-card .ph { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-size: 32px; }
.fm-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.fm-final video { max-height: 70vh; max-width: 100%; display: block; margin: 0 auto; background: #000; border-radius: 10px; }
.fm-idea { white-space: pre-line; }
.fm-actions { gap: 8px; margin: 8px 0; }
.fm-board { display: flex; flex-direction: column; gap: 8px; }
.fm-scene, .fm-link { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.fm-link { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); margin-inline: 24px; }
.fm-scene > header, .fm-link > header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fm-scene > header input { flex: 1 1 200px; }
.fm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fm-frame { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.fm-frame img, .fm-frame video, .fm-ph { width: 140px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: #000; display: block; }
.fm-ph { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 12px; border: 1px dashed var(--line); }
.fm-frame figcaption { font-size: 11px; color: var(--muted); display: flex; gap: 4px; align-items: center; justify-content: center; }
.fm-arrow { color: var(--muted); }
.fm-note input { flex: 1; }
.fm-edit summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.fm-edit { display: flex; flex-direction: column; gap: 6px; }
.fm-edit label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.fm-edit textarea, .fm-edit input:not([type=number]) { width: 100%; }
.fm-edit input[type=number] { width: 70px; }
@media (max-width: 620px) { .fm-link { margin-inline: 0; } .fm-frame img, .fm-frame video, .fm-ph { width: 100px; } }
.fm-board.wide .fm-frame img, .fm-board.wide .fm-frame video, .fm-board.wide .fm-ph { width: 220px; aspect-ratio: 16 / 9; }
.fm-board.square .fm-frame img, .fm-board.square .fm-frame video, .fm-board.square .fm-ph { aspect-ratio: 1; }
.fm-fix { border: 1px dashed var(--line); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; gap: 6px; }
.fm-fix[open] { border-color: var(--accent); }
.fm-fix summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.fm-fix > input { width: 100%; }
.fm-refs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fm-ref { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 76px; padding: 4px; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--surface); }
.fm-ref.on { border-color: var(--accent); background: var(--accent-soft); }
.fm-ref img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: var(--surface-2); }
.fm-ref small { font-size: 10px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-ref button { position: absolute; top: -6px; inset-inline-end: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 11px; line-height: 1; padding: 0; cursor: pointer; }
.fm-queued { color: var(--accent); font-weight: 600; }
.fm-script > summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.fm-script { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.fm-slines { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.fm-sline { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface); }
.fm-sline.stale { border-color: #f0b54a; background: #fff8ea; }
.fm-snum { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.fm-sbody { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.fm-sbody label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.fm-sbody textarea, .fm-sbody input { width: 100%; }
.fm-smeta { gap: 8px; align-items: center; }
.fm-smeta audio { height: 30px; max-width: 220px; }
.fm-stale { display: none; color: #b7791f; font-weight: 600; }
.fm-sline.stale .fm-stale { display: inline; }
.fm-rewrite input { flex: 1 1 260px; }
.fm-voice { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.fm-voice audio { width: 100%; max-width: 420px; }
.fm-copy { gap: 6px; margin-top: 6px; }
.fm-done { color: var(--ok); font-size: 12px; font-weight: 600; }
.fm-todo { color: var(--muted); font-size: 12px; }
.fm-redo { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.fm-redo input { flex: 1 1 260px; }
.fm-redo small { flex-basis: 100%; }
.fm-views { gap: 6px; margin-bottom: 8px; justify-content: center; }
/* 🗺️ المخطط و📐 التيمبليتس */
.sch > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sch-sum { margin: 6px 0; }
.sch-glob summary { cursor: pointer; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.sch-glob label, .sch-beat label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.sch-glob textarea, .sch-beat textarea { width: 100%; font-size: 12px; }
.sch-beats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 8px; }
.sch-beat { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.sch-bhead { display: flex; gap: 8px; align-items: flex-start; }
.sch-bhead img { width: 64px; border-radius: 6px; cursor: pointer; }
.sch-save { gap: 8px; margin-top: 8px; }
.sch-save input { flex: 1 1 200px; }
.tp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tp-card { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.tp-strip { display: flex; gap: 3px; overflow: hidden; }
.tp-strip img { width: 36px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 4px; }
.tp-name { font-weight: 600; }
.tp-new { display: flex; flex-direction: column; gap: 8px; }
.tp-new textarea { width: 100%; }
.tv-opts { gap: 8px; margin: 8px 0; }
.tv-step { margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.tv-step > summary { cursor: pointer; font-weight: 700; }
.tv-beat { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-top: 8px; background: var(--surface); }
.tv-beat header { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.tv-brow { display: flex; gap: 10px; align-items: flex-start; }
.tv-bf { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.tv-bf label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.tv-bf textarea, .tv-bf input { width: 100%; }
.tv-brow .fm-frame img, .tv-brow .fm-ph { width: 110px; }
.tv-sheet { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.tv-sheet textarea { width: 100%; font-size: 12px; }
.tv-sheetimg { max-width: 360px; width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.tv-panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.tv-panel { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.tv-panel img, .tv-panel .fm-ph { width: 100%; aspect-ratio: 9 / 16; object-fit: contain; background: #111; border-radius: 8px; }
.tv-panel input { width: 100%; font-size: 12px; }
img.tv-cell { outline: 2px dashed #f0b54a; outline-offset: -2px; }
.tv-segs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 8px; }
.tv-seg { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; font-size: 12px; }
.tv-segimgs { display: flex; align-items: center; gap: 4px; }
.tv-segimgs img, .tv-segimgs .fm-ph { width: 70px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; }
.tv-seg video { width: 100%; border-radius: 8px; background: #000; max-height: 320px; }
@media (max-width: 620px) { .tv-brow { flex-direction: column; } }
.lab-pick { margin: 6px 0; } .lab-pickrow { gap: 10px; align-items: center; }
.tv-sheetwrap { position: relative; display: inline-block; max-width: 360px; width: 100%; }
.tv-sheetwrap .tv-sheetimg { display: block; max-width: 100%; }
.tv-box { position: absolute; border: 2px solid var(--accent); border-radius: 4px; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: flex-start; justify-content: flex-start; padding: 1px 4px; text-shadow: 0 0 3px #000; pointer-events: none; }
.tv-sheetwrap.editing { max-width: 560px; }
.tv-sheetwrap.editing .tv-box { pointer-events: auto; cursor: move; background: rgba(87, 184, 175, .18); touch-action: none; }
.tv-handle { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: nwse-resize; }
.tv-once { display: grid; gap: 8px; margin: 12px 0; } .tv-once .btn { justify-self: start; }
.coach-pick-dlg { width: min(560px, 94vw); }
.coach-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.coach-pick-item { display: grid; gap: 4px; justify-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.coach-pick-item:hover { border-color: var(--accent); }
.coach-pick-item img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }

/* ---------- 🔤 التايبوجرافي */
.ty-words { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); line-height: 1.8; margin: 0 0 10px; }
.ty-src { width: min(320px, 100%); border-radius: var(--radius-sm); display: block; margin-top: 10px; }
.ty-blocks { display: grid; gap: 8px; margin-top: 10px; }
.ty-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface); display: grid; gap: 6px; }
.ty-block header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ty-block header small { flex: 1; min-width: 120px; }
.ty-block label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.ty-block input[data-tbf="text"] { min-width: 160px; }
.ty-icons { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ty-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 999px; background: var(--surface-2); cursor: pointer; font-size: 12px; }
.ty-chip img { width: 28px; height: 28px; object-fit: contain; }
.ty-chip.miss { outline: 1px dashed var(--warn); }
.ty-miss { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 10px 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.ty-preview { display: grid; gap: 10px; }
.ty-screen { display: flex; justify-content: center; }
.ty-box { position: relative; overflow: hidden; border-radius: 8px; box-shadow: 0 8px 30px -12px rgba(0,0,0,.35); }
.ty-box > #tyStage { position: absolute; top: 0; left: 0; }
.ty-bg { position: absolute; inset: 0; overflow: hidden; }
.ty-bg img, .ty-bg video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ty-ctrl { display: flex; gap: 8px; align-items: center; }
.ty-ctrl input { flex: 1; }
.ty-final { width: min(360px, 100%); border-radius: var(--radius-sm); }
.ty-stk { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ty-concept { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.ty-concept input { min-width: 0; flex: 1; font-size: 12px; padding: 3px 6px; }
.ty-dict { margin-bottom: 12px; }
.ty-dict .row input { flex: 1; min-width: 140px; }
.ty-dict-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 320px; overflow: auto; margin-top: 8px; }
.ty-dict-list > div { display: grid; gap: 2px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.ty-dict-list small[dir] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-stk figure { margin: 0; min-width: 0; display: grid; gap: 4px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.ty-checker { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center;
  background: repeating-conic-gradient(#d9d9d6 0 25%, #f3f3f1 0 50%) 0 0 / 16px 16px; }
.ty-checker { overflow: hidden; }
.ty-checker img { width: 90%; height: 90%; object-fit: contain; }
.ty-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.ty-labstyle { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.ty-sw { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; font-weight: 700; border: 1px solid var(--line); }
.ty-sw i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ty-sw.sm { width: 14px; height: 14px; padding: 0; vertical-align: middle; }
.ty-rules { margin: 4px 0 8px; padding-inline-start: 20px; font-size: 13px; }
.ty-moments { display: grid; gap: 6px; }
.ty-moment { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.ty-anchors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.ty-anchor { margin: 0; display: grid; gap: 4px; padding: 6px; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.ty-anchor img { width: 100%; height: 90px; object-fit: contain; background: #111; border-radius: 6px; }
.ty-anchor figcaption { display: grid; gap: 2px; font-size: 12px; }
/* 🎚️ المعمل: الفيديو متقسم لـ ٤ */
.lab-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lab-part { background: var(--surface-2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.lab-part .row { display: flex; align-items: center; gap: 6px; }
.lab-part .row b { flex: 1; }
.lab-part video { width: 100%; border-radius: 6px; background: #000; max-height: 220px; }
.lab-part audio { width: 100%; }
.lab-part.main { grid-column: 1 / -1; background: var(--accent-soft, #fde9e2); }
.lab-part.main video { max-height: 360px; }
a.btn.disabled { opacity: .45; pointer-events: none; }
/* 🔊 الأصوات الرسمية */
.ty-sfx { margin: 10px 0; }
.ty-sfx h3 { margin: 6px 0; font-size: 15px; }
.ty-sfx-list { display: flex; flex-direction: column; gap: 4px; }
.ty-sfx-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--surface-2); border-radius: 8px; }
.ty-sfx-row span { flex: 1; font-family: monospace; font-size: 13px; }
.ty-wrap { position: relative; }
.ty-giz { position: absolute; left: -80px; top: -80px; overflow: visible; pointer-events: none; z-index: 3; }
.ty-giz * { pointer-events: auto; }
.ty-gbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 30px; }
.h-typo, .t-typo { height: 34px; }
.tl-typo { position: absolute; top: 3px; bottom: 3px; background: #33265c; color: #d9ccff; font-size: 10px; border-radius: 4px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-sizing: border-box; border-inline-start: 1px solid #0006; direction: rtl; display: flex; align-items: center; gap: 4px; }
.tl-typo.selected { outline: 2px solid #fff; outline-offset: -2px; z-index: 2; }
.tl-typo .tr { color: #ffd98a; }
.tl-typo .h { position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.tl-typo .h.l { left: 0; } .tl-typo .h.r { right: 0; }
.frame .pv-typo { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.frame .pv-typo > div { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#pvWrap { display: inline-block; }
.mt-gbar { justify-content: center; margin-top: 6px; }
.mt-typo-row { display: grid; gap: 6px; margin-bottom: 10px; }
.h-click, .t-click { height: 30px; }
.tl-audio.click { background: #3a2a14; }
.tl-audio.click.off { opacity: .45; }
/* 🎛️ أدوات التحكم في التايبوجرافي: شريط زجاجي غامق، كل وضع بيظهر أدواته بس */
.ty-gbar { flex-direction: column; align-items: center; gap: 6px; }
.gz-bar { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; direction: rtl;
  background: rgba(22, 23, 29, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.07); }
.gz-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 11px; background: rgba(255,255,255,.04); }
.gz-sep { width: 1px; height: 22px; margin: 0 4px; background: rgba(255,255,255,.1); }
.gz-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 0; border-radius: 9px; background: transparent;
  color: #b9bcc8; font: 500 12.5px/1 inherit; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s, transform .1s; }
.gz-btn svg { flex: none; opacity: .9; }
.gz-btn:hover:not(:disabled) { background: rgba(255,255,255,.07); color: #fff; }
.gz-btn:active:not(:disabled) { transform: scale(.96); }
.gz-btn:disabled { opacity: .35; cursor: not-allowed; }
.gz-seg .gz-btn.on { color: #fff; background: linear-gradient(180deg, #6a97ff, #3f6ff2); box-shadow: 0 6px 14px -6px rgba(63,111,242,.9), inset 0 1px 0 rgba(255,255,255,.25); }
.gz-bar > .gz-btn.on { color: #FFD45C; background: rgba(250,204,21,.13); box-shadow: inset 0 0 0 1px rgba(250,204,21,.35); }
.gz-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 560px; direction: rtl; }
.gz-hint { color: var(--muted, #8a8f9c); font-size: 11.5px; }
.gz-pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line, #d9dbe2);
  background: var(--surface, #fff); color: inherit; font: 500 11.5px/1 inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.gz-pill svg { width: 14px; height: 14px; }
.gz-pill:hover { border-color: #5B8CFF; }
.gz-pill.on { background: #FACC15; border-color: #FACC15; color: #1a1a1a; }
.gz-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: #c58b00; }
.gz-chip svg { width: 14px; height: 14px; }
.ty-giz text { user-select: none; }
.wd-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 6px 0; }
.wd-row .wd { width: auto; min-width: 2.2em; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line, #d9dbe2); background: var(--surface-2, #f4f5f8);
  font: 500 13px/1.2 inherit; text-align: center; transition: border-color .15s, box-shadow .15s, background .15s; }
.wd-row .wd:hover { border-color: #9db4ff; }
.wd-row .wd:focus { outline: none; border-color: #5B8CFF; background: var(--surface, #fff); box-shadow: 0 0 0 3px rgba(91,140,255,.18); }
.wd-more summary { cursor: pointer; font-size: 12px; color: var(--muted, #8a8f9c); margin: 4px 0; }
.h-fx, .t-fx { height: 40px; }
.h-fx { justify-content: space-between; }
.h-fx .ic { padding: 0 6px; height: 22px; border-radius: 6px; background: #2a2440; color: #e8dcff; border: 0; cursor: pointer; }
.tl-fx { position: absolute; background: linear-gradient(180deg, #4a2f7a, #3b2563); color: #eadcff; font-size: 10px; border-radius: 5px; padding: 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; box-sizing: border-box; display: flex; align-items: center; gap: 4px; direction: rtl;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.tl-fx.selected { outline: 2px solid #fff; outline-offset: -2px; z-index: 2; }
.tl-fx .tr { color: #ffd98a; }
.tl-fx .h { position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.tl-fx .h.l { left: 0; } .tl-fx .h.r { right: 0; }
.frame .pv-typo > #pvFxStage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.fx-box { border-top: 1px solid var(--line, #e3e5ea); padding-top: 10px; }
/* ◆ ترانزيشنز بين اللقطات */
.tl-trans { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; padding: 0; border: 0; background: transparent; z-index: 4; cursor: pointer; }
.tl-trans i { position: absolute; inset: 3px; transform: rotate(45deg); border-radius: 3px; background: #1d1f27; box-shadow: 0 0 0 1.5px rgba(255,255,255,.55), 0 2px 6px rgba(0,0,0,.5); transition: transform .15s, background .15s; }
.tl-trans:hover i { transform: rotate(45deg) scale(1.2); background: #2d3142; }
.tl-trans.on i { background: linear-gradient(135deg, #ffd45c, #ff8a3d); box-shadow: 0 0 0 1.5px #fff, 0 2px 8px rgba(255,138,61,.6); }
.tr-pop { position: fixed; z-index: 1000; width: 330px; padding: 12px; border-radius: 16px; direction: rtl;
  background: rgba(22,23,29,.96); color: #e9eaf0; backdrop-filter: blur(12px); box-shadow: 0 20px 50px -15px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.08); }
.tr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tr-x { border: 0; background: rgba(255,255,255,.08); color: #ccc; width: 24px; height: 24px; border-radius: 8px; cursor: pointer; }
.tr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tr-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border: 0; border-radius: 10px; background: rgba(255,255,255,.04);
  color: #c9cbd3; font: 500 10.5px/1.1 inherit; cursor: pointer; transition: background .15s, color .15s; }
.tr-opt:hover { background: rgba(255,255,255,.09); color: #fff; }
.tr-opt.on { background: linear-gradient(180deg, #6a97ff, #3f6ff2); color: #fff; box-shadow: 0 6px 14px -6px rgba(63,111,242,.9); }
.tr-ic { display: grid; place-items: center; width: 30px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.07); font-size: 14px; }
.tr-dur { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-size: 12px; }
.tr-dur input { flex: 1; }
.tr-pop .muted { color: #8a8f9c; font-size: 11px; line-height: 1.5; display: block; }
.frame .pv-trans { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
.pv-stage { transition: none; }

/* 🪄 المشهد: الخلفية الجديدة والحاجات اللي اتشالت (تحت الكلام)، واختيار الحاجة من المعاينة */
.frame .pv-scene > #pvSceneStage { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.frame .sc-pick { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; cursor: crosshair; pointer-events: auto; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.sc-chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s; }
.sc-chip.sm { padding: 3px 9px; font-size: 12px; }
.sc-chip:hover { border-color: var(--accent); }
.sc-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; box-shadow: 0 6px 14px -8px var(--accent); }
.sc-chip:disabled { opacity: .5; cursor: default; }
.sc-thumb { width: 54px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, #2a2f3a); }
#mtScenePane textarea { width: 100%; box-sizing: border-box; }
.sc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sc-item { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }

/* 🌍 الدبلجة */
.db-head { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
@media (max-width: 700px) { .db-head { grid-template-columns: 1fr; } }
.db-src video, .db-out video { width: 100%; max-height: 360px; border-radius: 14px; background: #000; }
.db-meta { display: flex; flex-direction: column; gap: 8px; }
.db-meta h2 { margin: 0; }
.db-meta input { width: 100%; box-sizing: border-box; font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; margin-top: 4px; }
.db-meta label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.db-meta #dbDel { align-self: flex-start; }
.db-dialect { display: flex; flex-direction: column; gap: 10px; }
.db-dh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-dh h3 { margin: 0; margin-inline-end: auto; }
.db-lines { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; padding-inline-end: 4px; }
.db-line { display: grid; grid-template-columns: 56px 1fr 1.3fr; gap: 10px; align-items: start; padding: 8px; border-radius: 12px; background: var(--surface-2); }
@media (max-width: 800px) { .db-line { grid-template-columns: 48px 1fr; } .db-line textarea { grid-column: 1 / -1; } }
.db-t { font-variant-numeric: tabular-nums; font-size: 13px; display: flex; flex-direction: column; color: var(--muted); }
.db-t small { font-size: 11px; }
.db-src-t { font-size: 13px; color: var(--muted); line-height: 1.6; }
.db-line textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; line-height: 1.6; border-radius: 10px; border: 1px solid var(--line); padding: 6px 8px; background: #fff; resize: vertical; }
.db-line textarea.over { border-color: var(--warn); box-shadow: 0 0 0 2px rgba(227, 161, 58, .2); }
.db-opts { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.db-out { display: flex; flex-direction: column; gap: 6px; max-width: 320px; }
.db-out .ok { color: var(--ok); margin: 0; }
.db-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.db-add select { min-width: 200px; }

/* 🎬 قسم القوالب */
.ts-wrap { display: flex; flex-direction: column; gap: 16px; }
#tsGallery { display: flex; flex-direction: column; gap: 16px; }
.ts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.ts-card { display: flex; flex-direction: column; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
.ts-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(0,0,0,.35); }
.ts-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ts-media { position: relative; aspect-ratio: 9 / 16; max-height: 340px; background: #111; display: flex; align-items: center; justify-content: center; }
.ts-media video, .ts-media img { width: 100%; height: 100%; object-fit: cover; }
.ts-ph { font-size: 56px; }
.ts-badge { position: absolute; inset-inline: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; padding: 6px 8px; border-radius: 10px; }
.ts-info { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.ts-new { display: flex; flex-direction: column; gap: 10px; }
.ts-new textarea { width: 100%; box-sizing: border-box; font: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; }
.ts-mode { display: flex; gap: 16px; flex-wrap: wrap; }
.ts-lines { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.ts-line { display: grid; grid-template-columns: 120px 1fr 220px; gap: 8px; align-items: center; }
@media (max-width: 800px) { .ts-line { grid-template-columns: 1fr; } }
.ts-line textarea { width: 100%; box-sizing: border-box; font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: #fff; }
.ts-line audio, .ts-vo { width: 100%; height: 34px; }
.ts-key { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ts-key img { width: 160px; border-radius: 12px; border: 1px solid var(--line); }
.ts-scenes { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.ts-scene { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--surface); }
.ts-scene header { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.ts-sbody { display: grid; grid-template-columns: 180px 1fr; gap: 12px; }
@media (max-width: 800px) { .ts-sbody { grid-template-columns: 1fr; } }
.ts-sbody video, .ts-sbody .fm-ph { width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; background: #111; object-fit: cover; }
.ts-sf { display: flex; flex-direction: column; gap: 6px; }
.ts-sf textarea, .ts-sf input { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: #fff; }

/* تأثيرات القطعة في المعاينة واللوحة */
.frame .pv-stage { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.pv-stage .pv-layer { position: absolute; inset: 0; pointer-events: none; }
.pv-stage #pvBlur { width: 100%; height: 100%; filter: blur(10px) brightness(.9); transform: scale(1.08); }
.pv-stage #pvVig { background: radial-gradient(ellipse at center, transparent 45%, #000 100%); opacity: 0; }
.pv-stage #pvFadeBlack { background: #000; opacity: 0; }
.clip-fx { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.clip-fx h4 { margin: 8px 0 0; font-size: 13px; }
.clip-fx h4 b { color: var(--accent); font-weight: 600; margin-inline-start: 4px; }
.clip-fx .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.clip-fx .chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.clip-fx .chip:hover { border-color: var(--accent); }
.clip-fx .chip.on, .clip-fx .btn.on { border-color: var(--accent); background: var(--accent-soft); }
.clip-fx label { display: flex; flex-direction: column; font-size: 12px; }
.clip-fx label.check { flex-direction: row; align-items: center; gap: 6px; }
.tl-clip .fxb { font-style: normal; font-size: 10px; opacity: .9; }
.pv-stage video.on { opacity: var(--a, 1); }
.pv-stage #pvFlash { background: #fff; opacity: 0; }
.pv-stage #pvGrain { width: 100%; height: 100%; mix-blend-mode: overlay; image-rendering: pixelated; }
.clip-fx .crop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.kf-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0 6px; }
.kf-bar #kfToggle.on { border-color: var(--accent); background: var(--accent-soft); }
.tl-clip .kfd { position: absolute; bottom: 2px; width: 7px; height: 7px; margin-inline-start: -3.5px; background: #ffd166; transform: rotate(45deg); border: 1px solid #0006; z-index: 3; pointer-events: none; }
.tl-clip.disabled { opacity: .45; filter: grayscale(1); }
.ed-player .pv-box { position: absolute; z-index: 5; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #0008; pointer-events: none; transform-origin: center; }
.ed-player .pv-box i { position: absolute; width: 10px; height: 10px; background: #fff; border: 1px solid #0009; border-radius: 2px; pointer-events: auto; }
.ed-player .pv-box i[data-bh="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.ed-player .pv-box i[data-bh="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.ed-player .pv-box i[data-bh="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ed-player .pv-box i[data-bh="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ed-player .pv-box b { position: absolute; left: 50%; top: -26px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; border: 1px solid #0009; pointer-events: auto; cursor: grab; }
.ed-player .pv-box b::after { content: ""; position: absolute; left: 6px; top: 14px; width: 1.5px; height: 12px; background: #fff; }
.ed-player { position: relative; overflow: hidden; }
.pane-h.flash { animation: paneFlash 1.2s ease; } @keyframes paneFlash { 0%,40% { color: var(--accent); } 100% { color: inherit; } }
.tl-heads .trk-flags { display: inline-flex; gap: 1px; margin-inline-start: auto; }
.tl-heads .trk-flags .tf { font-size: 11px; padding: 0 3px; min-width: 0; opacity: .55; }
.tl-heads .trk-flags .tf.on, .tl-heads .trk-flags .tf:hover { opacity: 1; }
.tl-track.locked { background-image: repeating-linear-gradient(135deg, #ffffff08 0 6px, transparent 6px 12px); }
.tl-track.locked > * { pointer-events: none; }
.tl-track.hidden-trk > * { opacity: .35; }
.bin-tools { display: flex; gap: 6px; margin-bottom: 6px; }
.bin-tools input[type=search] { flex: 1; min-width: 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; background: var(--surface); color: inherit; }
#binFavOnly.on { border-color: var(--accent); background: var(--accent-soft); }
.bin-item .fav { position: absolute; bottom: 22px; left: 5px; border: 0; background: #0008; color: #ffd166; border-radius: 6px; font-size: 13px; line-height: 1; padding: 3px 5px; cursor: pointer; opacity: 0; }
.bin-item:hover .fav, .bin-item .fav.on { opacity: 1; }
.replace-bar { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px; padding: 6px 8px; font-size: 13px; margin: 6px 0; }
.bin-grid.replacing .bin-item { outline: 2px dashed var(--accent); outline-offset: -2px; cursor: pointer; }
.tts-box { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
.tts-box summary { cursor: pointer; font-size: 13px; }
.tts-box textarea { width: 100%; box-sizing: border-box; margin: 6px 0; font: inherit; font-size: 13px; padding: 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: inherit; }
.tl-heads { width: 138px; }
.tl-heads > div { white-space: nowrap; gap: 4px; }
.tl-heads .trk-flags .tf { width: 20px; height: 20px; padding: 0; font-size: 11px; }
.tl-markers { position: absolute; left: 0; top: 0; height: 0; z-index: 6; }
.tl-mark { position: absolute; top: 0; width: 0; height: 22px; cursor: pointer; }
.tl-mark::before { content: ""; position: absolute; left: -5px; top: 2px; width: 10px; height: 12px; background: #ffb347; clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); }
.tl-mark em { position: absolute; left: 7px; top: 1px; font-style: normal; font-size: 10px; color: #ffb347; white-space: nowrap; pointer-events: none; }
.ctx-menu { position: fixed; z-index: 1000; min-width: 220px; background: #1b1e25; color: #e8eaef; border: 1px solid #2f3440; border-radius: 10px; padding: 5px; box-shadow: 0 10px 30px #0008; font-size: 13px; }
.ctx-menu button { display: flex; width: 100%; justify-content: space-between; gap: 16px; align-items: center; background: none; border: 0; color: inherit; font: inherit; padding: 6px 10px; border-radius: 6px; cursor: pointer; text-align: start; }
.ctx-menu button:hover:not(:disabled) { background: #2a2f3a; }
.ctx-menu button:disabled { opacity: .4; cursor: default; }
.ctx-menu kbd { font-family: ui-monospace, monospace; font-size: 11px; color: #9aa1ae; }
.ctx-menu hr { border: 0; border-top: 1px solid #2f3440; margin: 4px 0; }
#tpLoop.on { color: var(--accent); }
.ed-player.full { background: #000; justify-content: center; }
.ed-player.full .frame { transform-origin: center; }
.h-snd, .t-snd { height: 30px; }
.t-snd { position: relative; }
.tl-audio.snd { background: #4a2140; top: 2px; bottom: auto; }
.tl-audio.snd.off { opacity: .4; }
.tl-audio.snd .nm { font-size: 10px; }
.snd-tools { display: flex; flex-direction: column; gap: 6px; }
.snd-tools input[type=search] { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; background: var(--surface); color: inherit; }
.sfx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; max-height: 210px; overflow: auto; }
.sfx-item { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px; font-size: 12px; min-width: 0; }
.sfx-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfx-item button { border: 0; background: none; cursor: pointer; font-size: 12px; padding: 2px 4px; border-radius: 6px; color: inherit; }
.sfx-item button.add { background: var(--accent); color: #fff; }
#micRec.rec { background: #c0392b; color: #fff; border-color: #c0392b; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatches .sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.swatches .sw.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatches .sw.pick { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.swatches .sw.pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ex-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ex-grid select { width: 100%; }
/* 🔠 النصوص الحرة */
.frame .pv-text { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.frame .pv-tx { position: absolute; white-space: pre; line-height: 1.15; pointer-events: auto; cursor: move; user-select: none; transform-origin: center; text-align: center; }
.frame .pv-tx.sel { outline: 1px dashed #fff; outline-offset: 3px; }
.frame .pv-tx .tx-rot { position: absolute; left: 50%; top: -22px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; border: 1px solid #0009; cursor: grab; -webkit-text-stroke: 0; }
.frame .pv-tx .tx-sz { position: absolute; right: -9px; bottom: -9px; width: 10px; height: 10px; background: #fff; border: 1px solid #0009; border-radius: 2px; cursor: nwse-resize; }
.h-text, .t-text { height: 28px; }
.t-text { position: relative; }
.tl-text { position: absolute; background: #5b3d0e; border: 1px solid #a8741f; border-radius: 5px; overflow: hidden; cursor: grab; box-sizing: border-box; }
.tl-text.selected { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.tl-text .nm { position: absolute; top: 2px; left: 6px; right: 6px; font-size: 11px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tl-text .h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.tl-text .h.l { left: 0; } .tl-text .h.r { right: 0; }
.tl-text.selected .h, .tl-text:hover .h { background: rgba(255,255,255,.8); }
.tx-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tx-preset { border: 1px solid var(--line); background: #2b3140; border-radius: 8px; padding: 8px 6px; font-size: 16px; cursor: pointer; }
.tx-editor { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tx-editor textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: inherit; }
.tx-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tx-row .grow { flex: 1; min-width: 120px; }
.tx-row input[type=range] { flex: 1; min-width: 0; }
.tx-color { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.tx-color input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
#txBold.on, #txItalic.on { border-color: var(--accent); background: var(--accent-soft); }
/* 🖼️ الطبقات فوق الفيديو */
.frame .pv-over { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.frame .pv-ov { position: absolute; pointer-events: auto; cursor: move; transform-origin: center; }
.frame .pv-ov .ov-media, .frame .pv-ov .ov-key { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; max-width: none; user-select: none; -webkit-user-drag: none; }
.frame .pv-ov.sel { outline: 1.5px solid #fff; outline-offset: 1px; }
.frame .pv-ov .ov-rot, .frame .pv-ov .ov-sz { display: none; }
.frame .pv-ov.sel .ov-rot { display: block; position: absolute; left: 50%; top: -22px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; border: 1px solid #0009; cursor: grab; }
.frame .pv-ov.sel .ov-sz { display: block; position: absolute; right: -6px; bottom: -6px; width: 10px; height: 10px; background: #fff; border: 1px solid #0009; border-radius: 2px; cursor: nwse-resize; }
.h-over, .t-over { height: 34px; }
.t-over { position: relative; }
.tl-over { position: absolute; background: #213f5e; border: 1px solid #3f74ab; border-radius: 5px; overflow: hidden; cursor: grab; box-sizing: border-box; }
.tl-over.selected { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.tl-over.disabled { opacity: .45; }
.tl-over img, .tl-over video { position: absolute; left: 0; top: 0; height: 100%; width: auto; opacity: .55; pointer-events: none; }
.tl-over .nm { position: absolute; top: 3px; left: 6px; right: 6px; font-size: 11px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; text-shadow: 0 1px 2px #000; }
.tl-over .h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 2; }
.tl-over .h.l { left: 0; } .tl-over .h.r { right: 0; }
.tl-over.selected .h, .tl-over:hover .h { background: rgba(255,255,255,.8); }
.bin-item .ovadd { position: absolute; top: 38px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: none; background: #2f6fb3; color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.ov-editor { display: flex; flex-direction: column; gap: 6px; }
.ov-chroma { display: flex; flex-direction: column; gap: 4px; padding-inline-start: 18px; }
#ovFlip.on { border-color: var(--accent); background: var(--accent-soft); }

/* 🎯 قوالب الإعلانات */
.ad-refs { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.ad-ref { margin: 0; width: 150px; display: flex; flex-direction: column; gap: 6px; }
.ad-ref img, .ad-ref .fm-ph { width: 150px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; }
.ad-ref figcaption { display: flex; gap: 6px; align-items: center; justify-content: space-between; font-size: 13px; }
.ad-jobs { display: grid; gap: 10px; margin-top: 10px; }
.ad-dur { margin-inline-start: auto; display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
.ad-dur input { width: 64px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 8px 0; }
.st-tpl { display: flex; flex-direction: column; gap: 3px; text-align: start; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.st-tpl.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.st-tpl b { font-size: 13px; }
.st-out { width: 220px; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
/* 🧠 عقل البراند: ستايلات وإنترو/أوترو */
.brain-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 8px 0; }
.brain-style { border: 1px solid var(--border, rgba(127,127,127,.25)); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.brain-style.on { outline: 2px solid var(--accent, #7fa2ec); }
.brain-style img, .brain-style-ico { width: 100%; aspect-ratio: 9/12; object-fit: cover; border-radius: 8px; background: var(--surface); display: grid; place-items: center; font-size: 34px; }
.brain-style b { font-size: 13px; }
.brain-vids { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.brain-vid-box video { width: 100%; max-height: 300px; border-radius: 10px; background: #000; }
.field.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }

/* 🤖 أوتوبايلوت كوتشي */
.ap-open { margin-bottom: 8px; }
.ap-dlg .ap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .ap-dlg .ap-grid { grid-template-columns: 1fr; } }
.ap-dlg h3 { margin: 8px 0 6px; font-size: 14px; }
.ap-dlg .ap-slots { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-dlg .ap-slots input { width: 110px; }
.ap-dlg .ap-list { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow: auto; display: grid; gap: 6px; }
.ap-dlg .ap-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.ap-dlg .ap-list li.off { opacity: .55; }
.ap-dlg .ap-list .grow { flex: 1; min-width: 0; }
.ap-dlg .ap-step { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--line); white-space: nowrap; }
.ap-dlg .ap-step.done { background: rgba(47,143,107,.18); }
.ap-dlg .ap-step.failed { background: rgba(232,64,47,.18); }
.ap-dlg .ap-err { color: #e8402f; font-size: 12px; }
.ap-dlg .ap-list input[type="datetime-local"] { font-size: 12px; padding: 3px 6px; max-width: 190px; }
.ap-dlg .ap-at { margin-top: 4px; }

/* ============ كالندر المواعيد ============ */
.cal-views { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; margin-inline-start: auto; }
.cal-views button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.cal-views button.on { background: var(--accent); color: #fff; }
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-title { font-weight: 500; min-width: 150px; text-align: center; }
.cal-legend { margin-inline-start: auto; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cal-legend .cal-dot { margin-inline-start: 8px; }
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--skip); flex: none; }
.cal-dot.sch { background: var(--accent); }
.cal-dot.act { background: var(--warn); }
.cal-dot.pub { background: var(--ok); }
.cal-dot.bad { background: var(--danger); }
.cal-dot.job { background: transparent; border: 1.5px dashed var(--muted); }

.cal-week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.cal-day { position: relative; background: var(--surface-2); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; border: 1.5px solid transparent; transition: border-color .15s, background .15s; }
.cal-week .cal-day { min-height: 340px; }
.cal-day.today { border-color: var(--accent); }
.cal-day.past { opacity: .72; }
.cal-day.out { opacity: .4; }
.cal-day.drop { border-color: var(--accent); border-style: dashed; background: var(--accent-soft); }
.cal-dh { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); }
.cal-dn { font-weight: 500; color: var(--text); }
.cal-day.today .cal-dn { color: #fff; background: var(--accent); border-radius: 999px; padding: 0 7px; }
.cal-list { display: flex; flex-direction: column; gap: 6px; }
.cal-card { background: var(--surface); border-radius: 10px; overflow: hidden; cursor: pointer; font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: transform .12s; }
.cal-card:hover { transform: translateY(-1px); }
.cal-card[draggable="true"] { cursor: grab; }
.cal-card.dragging { opacity: .4; }
.cal-card img, .cal-noimg { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; }
.cal-noimg { display: grid; place-items: center; font-size: 22px; background: var(--surface-2); }
.cal-meta { display: flex; align-items: center; gap: 4px; padding: 4px 6px 0; }
.cal-t { font-weight: 500; white-space: nowrap; }
.cal-n { display: block; padding: 0 6px 5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-pl { font-style: normal; font-size: 11px; opacity: .75; }
.cal-card.failed { box-shadow: inset 0 0 0 1.5px var(--danger); }
.cal-card.job { background: transparent; border: 1.5px dashed var(--muted); box-shadow: none; cursor: default; padding: 5px 6px; }
.cal-card.job .cal-n { padding: 0; }
.cal-card.mini { display: flex; align-items: center; gap: 4px; padding: 2px 5px; border-radius: 6px; }
.cal-month .cal-card.job { padding: 2px 5px; display: flex; gap: 4px; }
.cal-month .cal-card.job .cal-n { display: none; }
.cal-more { border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; align-self: center; }
.cal-add { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
@media (hover: none) { .cal-add { opacity: .8; } }

.cal-mh, .cal-mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-mh { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 4px; }
.cal-month .cal-day { min-height: 92px; padding: 4px; gap: 3px; }
.cal-month .cal-list { gap: 3px; }

dialog.cal-dlg { width: min(720px, 94vw); max-height: 90vh; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 16px; padding: 16px; position: relative; }
.cal-x { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.cal-dlg-body { display: grid; grid-template-columns: minmax(0, 240px) 1fr; gap: 16px; }
.cal-media video, .cal-media img { width: 100%; max-height: 62vh; border-radius: 10px; background: #000; display: block; object-fit: contain; }
.cal-info h3 { margin: 0; margin-inline-end: 24px; margin-bottom: 6px; font-size: 16px; }
.cal-info p { margin: 6px 0; font-size: 13px; }
.cal-cap { white-space: pre-wrap; max-height: 140px; overflow: auto; background: var(--surface); border-radius: 8px; padding: 6px 8px; }
.cal-info .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 640px) {
  .cal-dlg-body { grid-template-columns: 1fr; }
  .cal-media video, .cal-media img { max-height: 40vh; }
  .cal-month .cal-day { min-height: 64px; }
  .cal-month .cal-card.mini .cal-pl, .cal-month .cal-card.mini .cal-t { display: none; }
  .cal-legend { margin-inline-start: 0; }
  .panel-head:has(#calViews) { flex-wrap: wrap; }
  .cal-views button { padding: 4px 9px; white-space: nowrap; }
  /* الأسبوع على الموبايل: الأيام تحت بعض، وبوستات اليوم جنب بعض */
  .cal-week { grid-template-columns: 1fr; overflow: visible; }
  .cal-week .cal-day { min-height: 0; }
  .cal-week .cal-list { flex-direction: row; flex-wrap: wrap; }
  .cal-week .cal-card { width: calc(33.33% - 4px); }
  .cal-week .cal-card.job { width: 100%; }
  .cal-add { opacity: .8; }
}

/* ============ 🔔 جرس الإشعارات ============ */
.bell-btn, .stage-bell { position: relative; }
.stage-bell.has svg { color: var(--accent); }
.stage-bell .bell-n { inset-block-start: -6px; inset-inline-end: -6px; }
.bell-btn.has svg { color: var(--accent); animation: bell-ring 1.6s ease 1; transform-origin: 50% 10%; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-4deg); } }
.bell-n { position: absolute; inset-block-start: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.ntf-panel { position: fixed; z-index: 1000; top: 16px; left: 16px; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.35); padding: 12px; }
.ntf-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ntf-head b { flex: 1; font-weight: 500; }
.ntf-ask { border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--text); border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 12.5px; cursor: pointer; margin-bottom: 8px; text-align: start; }
.ntf-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.ntf-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--surface); cursor: pointer; transition: background .15s; }
.ntf-list li:hover { background: var(--glass-strong); }
.ntf-list li.unread { box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .ntf-list li.unread { box-shadow: inset -3px 0 0 var(--accent); }
.ntf-list li.unread.bad { box-shadow: inset 3px 0 0 var(--danger); }
[dir="rtl"] .ntf-list li.unread.bad { box-shadow: inset -3px 0 0 var(--danger); }
.ntf-list li:not(.unread) { opacity: .72; }
.ntf-ic { font-style: normal; width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-size: 13px; }
.ntf-list li.bad .ntf-ic { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ntf-txt { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.ntf-txt b { font-weight: 500; overflow-wrap: anywhere; }
.ntf-txt small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ntf-list li.ntf-empty { cursor: default; color: var(--muted); font-size: 13px; opacity: 1; }
@media (max-width: 640px) {
  .ntf-panel { max-height: calc(100vh - 110px); }
}
.nh-bell { position: relative; padding: 6px !important; }
.nh-bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.nh-bell.has svg { color: var(--accent); animation: bell-ring 1.6s ease 1; transform-origin: 50% 10%; }
.nh-bell .bell-n { inset-block-start: -6px; inset-inline-end: -8px; }

/* ============ 💬 صندوق الردود ============ */
.inbox-link { margin-bottom: 12px; display: inline-flex; align-items: center; gap: 6px; }
.inbox-link svg { width: 18px; height: 18px; }
.ib-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ib-bar .cal-views { margin-inline-start: 0; }
.ib-note { font-size: 12px; }
.ib-layout { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 14px; align-items: start; }
.ib-list-panel { max-height: calc(100vh - 230px); overflow-y: auto; padding: 8px; }
.ib-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ib-list li { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; cursor: pointer; position: relative; transition: background .15s; }
.ib-list li:hover { background: var(--surface-2); }
.ib-list li.on { background: var(--accent-soft); }
.ib-list li.unread .ib-snip { color: var(--text); font-weight: 500; }
.ib-thumb { width: 46px; height: 46px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-style: normal; }
.ib-av { position: relative; width: 34px; height: 34px; flex: none; border-radius: 50%; overflow: hidden; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-style: normal; font-weight: 600; font-size: 14px; }
.ib-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ib-li { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ib-top { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.ib-top b { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ib-top small { color: var(--muted); font-size: 11.5px; }
.ib-top a { font-size: 12px; margin-inline-start: auto; }
.ib-pl { font-style: normal; font-size: 12px; opacity: .75; }
.ib-snip { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-count { font-size: 12px; color: var(--accent); }
.ib-unread { position: absolute; inset-inline-end: 8px; inset-block-start: 8px; background: var(--accent); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 6px; }
.ib-req, .ib-wait { align-self: flex-start; font-size: 10.5px; border-radius: 999px; padding: 0 7px; background: var(--surface-2); color: var(--muted); }
.ib-wait { background: color-mix(in srgb, var(--warn) 18%, transparent); color: color-mix(in srgb, var(--warn) 70%, var(--text)); }
.ib-thread { min-height: 360px; max-height: calc(100vh - 200px); overflow-y: auto; }
.ib-post { display: flex; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.ib-post img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; flex: none; }
.ib-post > div { min-width: 0; flex: 1; }
.ib-cap { margin: 6px 0 0; font-size: 13px; white-space: pre-wrap; max-height: 84px; overflow: auto; }
.ib-filter { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 8px; }
.ib-comments { display: flex; flex-direction: column; gap: 10px; }
.ib-c { display: flex; gap: 10px; align-items: flex-start; }
.ib-c.reply { margin-top: 8px; }
.ib-c.reply .ib-av { width: 26px; height: 26px; font-size: 12px; }
.ib-cb { flex: 1; min-width: 0; }
.ib-cb > p { margin: 2px 0 2px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); padding: 7px 10px; border-radius: 12px; display: inline-block; max-width: 100%; }
.ib-c.mine > .ib-cb > p { background: var(--accent-soft); }
.ib-act { border: 0; background: none; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0 4px; }
.ib-compose { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border-radius: 12px; padding: 8px; }
.ib-compose textarea, .ib-compose input { width: 100%; font: inherit; font-size: 13.5px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; background: var(--surface); color: var(--text); resize: vertical; }
.ib-compose .ib-hint { font-size: 12px; }
.ib-compose .row { display: flex; gap: 6px; align-items: center; }
.ib-compose .spacer { flex: 1; }
.ib-chathead { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ib-chathead a { margin-inline-start: auto; font-size: 12px; }
.ib-chat { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; max-height: calc(100vh - 420px); min-height: 160px; overflow-y: auto; }
.ib-msg { align-self: flex-start; max-width: 78%; background: var(--surface-2); border-radius: 14px; padding: 7px 11px; }
.ib-msg.mine { align-self: flex-end; background: var(--accent); color: #fff; }
.ib-msg p { margin: 0; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ib-msg img { max-width: 220px; border-radius: 10px; display: block; margin-top: 4px; }
.ib-msg small { display: block; font-size: 10.5px; opacity: .7; margin-top: 2px; }
.ib-msg.mine a { color: #fff; }
.ib-thread .err { color: var(--danger); }
@media (max-width: 900px) {
  .ib-layout { grid-template-columns: 1fr; }
  .ib-list-panel { max-height: 300px; }
  .ib-thread, .ib-chat { max-height: none; }
}

/* ============ الشكل الجديد للصفحات (من البروتوتايب) ============
   أرضية سادة هادية، عنوان كبير وفوقه اسم القسم بالإنجليزي بحروف متباعدة، كروت بيضا ناعمة من غير براويز،
   وخطوات المشروع دواير بأرقام متوصلة بخط. */
:root { --page-bg: #F7F7F5; --card: #FFFFFF; --card-shadow: 0 4px 24px rgba(24, 23, 24, .06); --field: #F3F2EF; --label: #8C8C88; }

/* الشاشة نفسها: صفحة كاملة بدل الكارت الزجاج */
:root:root .stage { padding: 0; background: var(--page-bg); }
:root:root .stage-card, :root:root body.stage-settled .stage-card { border-radius: 0; border: 0; box-shadow: none; background: var(--page-bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
:root:root .stage-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto auto auto; align-items: center; column-gap: 12px; row-gap: 6px;
  grid-template-areas: "back . proj prev next bell client" "title title title flow flow flow flow";
  padding: 18px 40px 14px; border-bottom: 0;
}
:root:root .stage-head > .spacer { display: none; }
.stage-back { grid-area: back; justify-self: start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 2px; color: #6B6A66; font: inherit; font-size: 14px; cursor: pointer; }
.stage-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
[dir="ltr"] .stage-back svg { transform: scaleX(-1); }
.stage-back:hover { color: var(--accent); }
:root:root .stage-title { grid-area: title; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.stage-en { font-family: var(--display); font-size: 11.5px; letter-spacing: .36em; text-transform: uppercase; color: var(--accent); direction: ltr; unicode-bidi: isolate; }
:root:root .stage-title h2 { font-size: clamp(26px, 2.6vw, 38px); font-weight: 500; line-height: 1.2; }
:root:root .stage-project { grid-area: proj; justify-self: end; background: var(--card); box-shadow: var(--card-shadow); }
:root:root #stagePrev { grid-area: prev; } :root:root #stageNext { grid-area: next; }
:root:root .stage-bell { grid-area: bell; width: 44px; height: 44px; border: 0; background: var(--card); box-shadow: 0 4px 18px rgba(24, 23, 24, .08); }
:root:root .stage-client { grid-area: client; height: 44px; border: 0; background: var(--card); box-shadow: 0 4px 18px rgba(24, 23, 24, .08); padding: 0 14px 0 6px; }
:root:root [dir="rtl"] .stage-client { padding: 0 6px 0 14px; }
:root:root .stage-head .btn.pill { padding: 10px 20px; font-size: 14px; gap: 10px; }
:root:root .stage-head .btn.pill svg { width: 16px; height: 16px; }

/* خطوات المشروع: دواير بأرقام متوصلة بخط */
:root:root .flow { grid-area: flow; justify-self: end; align-self: end; gap: 0; padding: 0; border: 0; background: none; border-radius: 0; }
:root:root .flow button { position: relative; flex-direction: column; gap: 6px; width: 78px; padding: 0; background: none !important; color: #8C8C88; font-size: 12px; }
:root:root .flow button + button::before { content: ""; position: absolute; top: 17px; inset-inline-start: calc(-50% + 17px); width: calc(100% - 34px); height: 2px; background: #E3E2DE; }
:root:root .flow button i { width: 34px; height: 34px; font-size: 13px; background: #E3E2DE; color: #6B6A66; transition: box-shadow .3s; }
:root:root .flow button.done i, :root:root .flow button.active i { background: var(--accent); color: #fff; }
:root:root .flow button.done + button::before, :root:root .flow button.done + button.active::before { background: var(--accent); }
:root:root .flow button.active { color: var(--text); font-weight: 500; }
:root:root .flow button.active i { box-shadow: 0 0 0 6px var(--accent-soft), 0 8px 22px rgba(229, 97, 62, .45); }
:root:root .flow button:hover:not(.active) i { box-shadow: 0 0 0 4px #EDECE8; }
:root:root .stage-body { padding: 8px 40px 32px; }

/* الكروت */
:root:root .stage .panel { background: var(--card); border: 0; border-radius: 24px; box-shadow: var(--card-shadow); padding: 22px 24px; }
:root:root .stage .panel h2 { font-size: 19px; }

/* الأزرار: كبسولات، والأساسي متوهج */
:root:root .stage .btn { border-color: transparent; background: var(--field); }
:root:root .stage .btn:hover:not(:disabled) { border-color: transparent; background: #EBEAE6; }
:root:root .stage .btn.primary { background: var(--accent); color: #fff; box-shadow: 0 10px 26px -8px rgba(229, 97, 62, .55); }
:root:root .stage .btn.primary:hover:not(:disabled) { background: #D8552F; }
:root:root .stage .btn.ink { background: var(--ink); color: #fff; }
:root:root .stage .btn.danger { background: transparent; }

/* الحقول: مليانة من غير خط حواليها */
:root:root .stage :where(input[type=text], input[type=search], input[type=password], input[type=number], input[type=datetime-local], select, textarea) {
  background: var(--field) !important; border-color: transparent !important; }

@media (max-width: 900px) {
  :root:root .stage-head { padding: 12px 16px 10px; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "back . bell client" "title title title title" "flow flow flow flow" "proj proj prev next"; }
  :root:root .stage-project { justify-self: start; }
  :root:root .flow { justify-self: stretch; justify-content: space-between; }
  :root:root .flow button { width: auto; flex: 1; }
  :root:root .flow span { display: inline; font-size: 11px; }
  :root:root .stage-body { padding: 8px 16px 24px; }
}

/* الإيموجي اللي جوه الأزرار والعناوين: كوتشي بس اللي بيظهره (شكله القديم) */
:root:root .emo { display: none; }

/* الأقسام المتخصصة (كاروسيل، مسلسلات، إعلانات، معمل، تايبوجرافي، دبلجة): قايمة على الجنب وشغل كبير */
:root:root .car-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 24px; }
:root:root .stage :where(.ad-side, .car-list-panel) { gap: 12px; text-align: start; }
:root:root .stage :where(.ad-side, .car-list-panel) .hint { text-align: start; line-height: 1.75; }
:root:root .stage :where(.ad-side, .car-list-panel) .empty { text-align: start; }
:root:root .stage :where(.lab-libbtn, .ad-styles-go) { justify-content: flex-start; }
:root:root .stage .ad-up { padding: 13px 18px; font-size: 15px; }
:root:root .stage a.btn { text-decoration: none; }
:root:root .stage .ad-side > p.muted, :root:root .stage .ad-side .ad-list:empty + p { text-align: start; }
/* الصفحة الفاضية: كارت كبير ودايرة برتقالي في النص */
:root:root .stage :where(#carPlaceholder, #serEmpty, #adEmpty, #labEmpty, #dbEmpty, #tyEmpty):not([hidden]) {
  min-height: min(62vh, 560px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  text-align: center; color: var(--muted); font-size: 15px; }
:root:root .stage :where(#carPlaceholder, #serEmpty, #adEmpty, #labEmpty, #dbEmpty, #tyEmpty)::before {
  content: ""; width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E5613E' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 30px no-repeat; }
:root:root .stage :where(#carPlaceholder, #serEmpty, #adEmpty) p { margin: 0; }

/* القوالب: كروت ناعمة، والقالب اللي مالوش عينة خلفيته فاتحة بدل الأسود */
:root:root .stage .ts-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
:root:root .stage .ts-card { border: 0; border-radius: 22px; background: var(--field); box-shadow: none; }
:root:root .stage .ts-card:hover { box-shadow: 0 16px 34px -18px rgba(24, 23, 24, .3); }
:root:root .stage .ts-card.on { box-shadow: 0 0 0 2px var(--accent); }
:root:root .stage .ts-media { margin: 8px 8px 0; border-radius: 16px; overflow: hidden; max-height: 300px;
  background: linear-gradient(160deg, var(--card), color-mix(in srgb, var(--accent) 14%, var(--card))); }
:root:root .stage .ts-ph { font-size: 64px; filter: drop-shadow(0 10px 18px rgba(24, 23, 24, .18)); }
:root:root .stage .ts-info { padding: 12px 14px 14px; }

/* رفع الملفات: زرار كبسولة بدل زرار المتصفح الرمادي، ومنطقة السحب ناعمة */
:root:root .stage input[type=file] { font: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }
:root:root .stage input[type=file]::file-selector-button {
  font: inherit; font-size: 13px; color: var(--text); background: var(--field); border: 0; border-radius: 999px;
  padding: 8px 16px; margin-inline-end: 10px; cursor: pointer; transition: background .15s; }
:root:root .stage input[type=file]::file-selector-button:hover { background: #EBEAE6; }
:root[data-nh-theme="dark"]:not(.x) .stage input[type=file]::file-selector-button:hover { background: #3D3C3D; }
:root:root .stage .dropzone { border: 1.5px dashed var(--line); border-radius: 18px; background: transparent; padding: 22px; }
:root:root .stage .dropzone:hover, :root:root .stage .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
@media (max-width: 900px) { :root:root .car-layout { grid-template-columns: 1fr; } }

/* ============ الدارك مود للصفحات ============
   نفس اختيار الرئيسية (اللايت والدارك). الألوان الأساسية بتتقلب من المتغيرات، وتحت قواعد اتعملت لوحدها
   (tools/gendark_css.py) لكل حاجة خلفيتها فاتحة مكتوبة بالإيد: الرمادي بيبقى رمادي غامق، والملوّن (حالات) بيبقى نفس اللون شفاف. */
:root[data-nh-theme="dark"] {
  color-scheme: dark;
  --bg: #161516; --page: #1F1E1F;
  --glass: rgba(42, 41, 42, .72); --glass-strong: rgba(52, 51, 52, .92); --glass-line: rgba(255, 255, 255, .06);
  --surface: #2A292A; --surface-2: #343334; --line: rgba(255, 255, 255, .1);
  --text: #F2F1EE; --muted: #A3A29E; --accent-soft: #4A2E25; --ink: #3D3C3D; --skip: #4A494A;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .6);
  --page-bg: #1F1E1F; --card: #2A292A; --field: #343334; --label: #8E8D89; --card-shadow: 0 4px 24px rgba(0, 0, 0, .28);
}
:root[data-nh-theme="dark"] body { background: var(--page-bg); color: var(--text); }
:root[data-nh-theme="dark"] .stage .btn:hover:not(:disabled) { background: #3D3C3D; }
:root[data-nh-theme="dark"] .stage .btn.ink { background: #F2F1EE; color: #1F1E1F; }
:root[data-nh-theme="dark"] .flow button i { background: #3D3C3D; color: #A3A29E; }
:root[data-nh-theme="dark"] .flow button + button::before { background: #3D3C3D; }
:root[data-nh-theme="dark"] .flow button.done i, :root[data-nh-theme="dark"] .flow button.active i { background: var(--accent); color: #fff; }
:root[data-nh-theme="dark"] .flow button.done + button::before { background: var(--accent); }
:root[data-nh-theme="dark"] .flow button.active i { box-shadow: 0 0 0 6px var(--accent-soft), 0 8px 22px rgba(229, 97, 62, .5); }
:root[data-nh-theme="dark"] .stage-back { color: var(--muted); }
:root[data-nh-theme="dark"] :where(input[type=text], input[type=search], input[type=password], input[type=number], input[type=datetime-local], select, textarea) { background: var(--field) !important; color: var(--text) !important; border-color: transparent !important; }
:root[data-nh-theme="dark"] dialog { background: #2A292A; color: var(--text); border-color: var(--line); }
:root[data-nh-theme="dark"] .toast { background: #F2F1EE !important; color: #1F1E1F !important; }
:root[data-nh-theme="dark"] .toast.error { background: var(--danger) !important; color: #fff !important; }
:root[data-nh-theme="dark"] .alert { background: var(--surface-2); color: var(--text); }
:root[data-nh-theme="dark"] .empty, :root[data-nh-theme="dark"] .muted { color: var(--muted); }
:root[data-nh-theme="dark"] .icon-btn:hover { background: var(--surface-2); }
:root[data-nh-theme="dark"] .post-extra { background: var(--surface-2); }
:root[data-nh-theme="dark"] dialog { background: var(--surface-2); }
:root[data-nh-theme="dark"] .car-steps button.active { background: var(--surface-2); }
:root[data-nh-theme="dark"] .car-card .img { background: var(--surface-2); }
:root[data-nh-theme="dark"] .car-card .img .car-wait.over { background: var(--surface-2); }
:root[data-nh-theme="dark"] .brand-logo img { background: var(--surface-2); }
:root[data-nh-theme="dark"] .lib-card2 .lc-edit { background: var(--surface-2); }
:root[data-nh-theme="dark"] .lib-big img { background: var(--surface-2); }
:root[data-nh-theme="dark"] .lib-status.err { background: color-mix(in srgb, #fde2e2 16%, transparent); }
:root[data-nh-theme="dark"] .car-versions .ver { background: var(--surface-2); }
:root[data-nh-theme="dark"] .shot .frame .car-wait.over { background: var(--surface-2); }
:root[data-nh-theme="dark"] .take .retry { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ser-missing { background: color-mix(in srgb, #FFF5E6 16%, transparent); }
:root[data-nh-theme="dark"] .ser-missing .chip { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ser-banner { background: color-mix(in srgb, #EBF8FF 16%, transparent); }
:root[data-nh-theme="dark"] .prompt-new { background: color-mix(in srgb, #F0FFF4 16%, transparent); }
:root[data-nh-theme="dark"] .ad-status.err { background: color-mix(in srgb, #FFF0F0 16%, transparent); }
:root[data-nh-theme="dark"] .ad-style-card img,
:root[data-nh-theme="dark"] .ad-style-card .ph { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ad-ed-crop i { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ad-comp .img { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ad-next { border: 1px dashed var(--line, var(--line)); }
:root[data-nh-theme="dark"] .ad-stale { background: color-mix(in srgb, #FFF7E6 16%, transparent); }
:root[data-nh-theme="dark"] .ad-activity.busy { background: color-mix(in srgb, #EAF6F4 16%, transparent); }
:root[data-nh-theme="dark"] .ad-activity .ad-act { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ad-activity .ad-act:hover { background: color-mix(in srgb, #D6EFEB 16%, transparent); }
:root[data-nh-theme="dark"] .ad-fix-thumbs .th { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ad-cast-card .img { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ad-cast-card .img img { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ad-ments .ment { background: color-mix(in srgb, #EAF6F4 16%, transparent); }
:root[data-nh-theme="dark"] .ad-ments .ment img { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ad-lip { background: color-mix(in srgb, #EAF6F4 16%, transparent); }
:root[data-nh-theme="dark"] .lab-st.failed { background: color-mix(in srgb, #fde6e3 16%, transparent); }
:root[data-nh-theme="dark"] .lab-st.done { background: color-mix(in srgb, #e4f5ec 16%, transparent); }
:root[data-nh-theme="dark"] .lab-rv button.on.ok { background: color-mix(in srgb, #e4f5ec 16%, transparent); }
:root[data-nh-theme="dark"] .lab-rv button.on.bad { background: color-mix(in srgb, #fde6e3 16%, transparent); }
:root[data-nh-theme="dark"] .lab-st.skipped { background: color-mix(in srgb, #f3efe2 16%, transparent); }
:root[data-nh-theme="dark"] .lab-comp.ok { background: color-mix(in srgb, #f1faf5 16%, transparent); }
:root[data-nh-theme="dark"] .client-av img { background: var(--surface-2); }
:root[data-nh-theme="dark"] .lab-conn.ok { background: color-mix(in srgb, #f1faf5 16%, transparent); }
:root[data-nh-theme="dark"] .voice-sync { background: color-mix(in srgb, #fff4e0 16%, transparent); border: 1px solid var(--line); }
:root[data-nh-theme="dark"] .btn.warn-btn { background: color-mix(in srgb, #fff4e0 16%, transparent); border-color: var(--line); }
:root[data-nh-theme="dark"] .fm-sline.stale { border-color: var(--line); background: color-mix(in srgb, #fff8ea 16%, transparent); }
:root[data-nh-theme="dark"] .tr-x { background: rgba(255,255,255,.06); }
:root[data-nh-theme="dark"] .tr-opt { background: rgba(255,255,255,.06); }
:root[data-nh-theme="dark"] .tr-opt:hover { background: rgba(255,255,255,.06); }
:root[data-nh-theme="dark"] .tr-ic { background: rgba(255,255,255,.06); }
:root[data-nh-theme="dark"] .db-meta input { background: var(--surface-2); }
:root[data-nh-theme="dark"] .db-line textarea { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ts-new textarea { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ts-line textarea { background: var(--surface-2); }
:root[data-nh-theme="dark"] .ts-sf textarea,
:root[data-nh-theme="dark"] .ts-sf input { background: var(--surface-2); }

/* النشر: المنصات مربعات بأيقونات، وكروت الفيديوهات من غير براويز */
:root:root .stage .platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
:root:root .stage .platforms label.plat { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px;
  border: 0; border-radius: 18px; background: var(--field); color: #8C8C88; font-size: 11.5px; text-align: center; padding: 8px 6px; cursor: pointer; transition: background .2s, color .2s, transform .15s; }
:root:root .stage .platforms label.plat input { position: absolute; opacity: 0; pointer-events: none; }
:root:root .stage .platforms label.plat svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:root:root .stage .platforms label.plat:has(input:checked) { background: var(--text); color: var(--page-bg); }
:root:root .stage .platforms label.plat:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
:root:root .stage .platforms label.plat:active { transform: scale(.97); }
:root:root .stage .ready { background: transparent; border: 0; border-radius: 18px; }
:root:root .stage .ready video { border-radius: 18px; }
:root:root .stage .ready.selected video { box-shadow: 0 0 0 3px var(--accent); }
:root:root .stage .ready .body { padding: 8px 4px; }
:root:root .stage .ready .name { font-weight: 500; }
/* أيقونة المنصة في كوتشي (الشكل القديم): صغيرة جنب الاسم */
.platforms label.plat svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* الإعدادات: اختيار الوضع (فاتح / غامق) */
.theme-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.theme-picks button { border: 0; border-radius: 18px; background: var(--field, var(--surface-2)); padding: 8px 8px 10px; display: grid; gap: 8px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.theme-picks button.on { box-shadow: 0 0 0 2px var(--accent); }
.tp-art { display: block; height: 64px; border-radius: 12px; }
.tp-art.light { background: linear-gradient(135deg, #FFFFFF 0 50%, #F3F2EF 50%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.tp-art.dark { background: linear-gradient(135deg, #2A292A 0 50%, #1F1E1F 50%); }
.lang-picks { display: inline-flex; }

/* ============ الإعدادات (من البروتوتايب): 3 كروت جنب بعض، وتحتهم المساحة والباسورد ============ */
.set-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.set-grid.set-row2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-top: 20px; align-items: start; }
.set-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.set-card h2 { margin: 0; font-size: 20px; font-weight: 500; }
.set-card .hint { margin: 0; }
.set-k { font-family: var(--display); font-size: 10.5px; letter-spacing: .24em; color: var(--label, var(--muted)); direction: ltr; text-align: start; }
[dir="rtl"] .set-k { text-align: right; }
.set-acc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.set-acc li { display: flex; align-items: center; gap: 10px; background: var(--field, var(--surface-2)); border-radius: 14px; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.set-acc li.on { color: var(--text); }
.set-acc li > i { width: 8px; height: 8px; border-radius: 50%; background: #D6D6D2; flex: none; }
.set-acc li.on > i { background: #2EAF78; }
.set-acc li svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.set-acc li span { flex: 1; }
.set-acc li small { color: var(--muted); font-size: 12px; }
.set-acc li.err { background: color-mix(in srgb, #E5483E 12%, transparent); color: #B53A2E; font-size: 12.5px; }
.set-credit { display: flex; align-items: center; gap: 16px; background: var(--field, var(--surface-2)); border-radius: 18px; padding: 16px; }
.set-credit[hidden] { display: none; }
.set-credit svg { width: 64px; height: 64px; flex: none; transform: rotate(-90deg); }
.set-credit circle { fill: none; stroke-width: 3; }
.set-credit .trk { stroke: var(--line); }
.set-credit .val { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 0 101; transition: stroke-dasharray .6s; }
.set-credit span { display: flex; flex-direction: column; gap: 2px; }
.set-credit small { font-size: 12.5px; color: var(--muted); }
.set-credit b { font-family: var(--display); font-weight: 500; font-size: 26px; }
.set-seg { display: flex; background: var(--field, var(--surface-2)); border-radius: 999px; padding: 4px; }
.set-seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; font: inherit; font-size: 13.5px; padding: 8px; cursor: pointer; color: var(--muted); }
.set-seg button.on { background: var(--card, var(--surface)); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.set-fill { flex: 1; }
:root .stage .set-card .btn.set-out { background: transparent; border: 1.5px solid var(--text); border-radius: 999px; justify-content: center; padding: 11px; }
:root .stage .set-card .btn.set-out:hover:not(:disabled) { background: var(--text); color: var(--card, #fff); border-color: var(--text); }
.set-card form { display: flex; flex-direction: column; gap: 8px; }
.set-card form .btn { align-self: flex-start; }
@media (max-width: 1000px) { .set-grid, .set-grid.set-row2 { grid-template-columns: 1fr; } }

/* ============ الأصول (من البروتوتايب): تابات بالأيقونات الزجاج بين الشخصيات والتعليق الصوتي والموسيقى ============ */
.as-tabs { display: inline-flex; gap: 6px; background: var(--field, var(--surface-2)); border-radius: 999px; padding: 5px; margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
.as-tabs button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 999px; padding: 6px 16px 6px 8px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
[dir="rtl"] .as-tabs button { padding: 6px 8px 6px 16px; }
.as-tabs button:hover { color: var(--text); }
.as-tabs button.on { background: var(--card, var(--surface)); color: var(--text); box-shadow: 0 2px 10px rgba(24, 23, 24, .08); }
.as-tabs img { width: 30px; height: 30px; object-fit: contain; }
.as-tabs .ic-d, :root[data-nh-theme="dark"] .as-tabs .ic-l { display: none; }
:root[data-nh-theme="dark"] .as-tabs .ic-d { display: inline; }
/* كروت الشخصيات: الصورة مربعة جوه كارت ناعم */
:root:root .stage .coaches { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
:root:root .stage .coach { background: var(--field); border-radius: 20px; padding: 8px; display: flex; flex-direction: column; }
:root:root .stage .coach > img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--card); }
:root:root .stage .coach .body { padding: 10px 6px 4px; display: flex; flex-direction: column; gap: 4px; }
:root:root .stage .coach .name { font-weight: 500; font-size: 15px; }
/* التعليق الصوتي والموسيقى: صف فيه زرار تشغيل مدوّر وخط تقدّم بالبرتقالي */
:root:root .stage .audio-list { gap: 10px; }
:root:root .stage .audio-list li { background: var(--field); border: 0; border-radius: 18px; padding: 12px 14px; gap: 12px; }
:root:root .stage .audio-list li.playing { box-shadow: 0 0 0 2px var(--accent); }
:root:root .stage .audio-list .play { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--ink); color: #fff; }
:root:root .stage .audio-list li.playing .play { background: var(--accent); }
:root:root .stage .audio-list .name { font-weight: 500; }
:root:root .stage .audio-list .dur { background: none; font-family: var(--display); font-weight: 400; font-size: 12.5px; color: var(--muted); }
:root:root .stage .audio-list .progress { height: 4px; background: var(--line); }
:root:root .stage .audio-tools input, :root:root .stage .audio-tools select { border-radius: 999px; padding: 10px 16px; }
.kochi-old { display: flex; align-items: center; gap: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 16px; padding: 12px 14px; }
.kochi-old[hidden] { display: none; }
.kochi-old span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.kochi-old b { font-weight: 500; }
.kochi-old small { color: var(--muted); font-size: 12.5px; }

/* ============ النشر (من البروتوتايب): فين هينزل على اليمين، الفيديوهات الجاهزة في النص، والجدولة على الشمال ============ */
.pub-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.pub-k { font-family: var(--display); font-size: 10.5px; letter-spacing: .24em; color: var(--label, var(--muted)); direction: ltr; text-align: right; margin-bottom: 4px; }
[dir="ltr"] .pub-k { text-align: left; }
.pub-where { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.pub-where h2 { margin: 0; font-size: 17px; font-weight: 500; }
.pub-all { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pub-all:hover { color: var(--accent); }
:root .stage .pub-where .platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
:root .stage .pub-where .platforms label.plat { aspect-ratio: 1; padding: 0; border-radius: 16px; justify-content: center; }
:root .stage .pub-where .platforms label.plat span { display: none; }
:root .stage .pub-where .platforms label.plat svg { width: 22px; height: 22px; }
.pub-ready .panel-head { margin-bottom: 14px; }
:root .stage .pub-ready .ready-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
:root .stage .ready { cursor: pointer; }
.ready-art { position: relative; border-radius: 18px; overflow: hidden; }
:root .stage .ready-art video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #2B2724; border-radius: 18px; }
.ready-dur { position: absolute; bottom: 8px; inset-inline-end: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-family: var(--display); font-size: 11px; border-radius: 999px; padding: 2px 8px; direction: ltr; }
.ready-tick { position: absolute; top: 8px; inset-inline-start: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); display: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E"); background-size: 16px; background-position: center; background-repeat: no-repeat; }
.ready.selected .ready-tick { display: block; }
:root .stage .ready.selected .ready-art video { box-shadow: inset 0 0 0 3px var(--accent); outline: 3px solid var(--accent); outline-offset: -3px; }
:root .stage .ready .meta { gap: 8px; font-size: 12px; }
.ready .meta .st-pick { color: var(--accent); }
.ready .meta .st-sched { color: #2E8F63; }
:root .stage .ready .acts { opacity: 0; transition: opacity .2s; }
:root .stage .ready:hover .acts, :root .stage .ready.selected .acts { opacity: 1; }
:root .stage .ready .acts [data-act="pick"] { display: none; }
.pub-form #postSubmit { flex: 1; padding: 13px; font-size: 15px; }
.pub-form .row:has(#postSubmit) { flex-direction: row-reverse; }
@media (max-width: 1200px) { .pub-grid { grid-template-columns: 150px minmax(0, 1fr); } .pub-form { grid-column: 1 / -1; } }
@media (max-width: 800px) { .pub-grid { grid-template-columns: 1fr; } .pub-where { position: static; } :root .stage .pub-where .platforms { grid-template-columns: repeat(5, 1fr); } }

/* ============ المونتاج (من البروتوتايب) ============
   المعاينة كبيرة في النص على أرضية فاتحة، الأدوات عمود أيقونات على الجنب، والتايم لاين كارت فاتح في الوضع الفاتح */
.stage .ed-top { grid-template-columns: 240px minmax(0, 1fr) 400px; gap: 20px; }
.stage .ed-player { background: var(--card); border-radius: 24px; box-shadow: var(--card-shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.stage .ed-player .ty-wrap { background: var(--field); border-radius: 18px; }
.stage .ed-player .frame { border-radius: 16px; box-shadow: 0 20px 40px rgba(24, 23, 24, .2); }
.stage .ed-player .transport { background: none; border: 0; color: var(--text); padding: 0 6px; }
.stage .ed-player .transport .ic { background: var(--field); color: var(--text); border-radius: 50%; width: 36px; height: 36px; border: 0; }
.stage .ed-player .transport .ic.play { width: 46px; height: 46px; background: var(--ink); color: #fff; }
.stage .ed-player .transport .tc { font-family: var(--display); font-size: 12px; color: var(--muted); }
/* الأدوات: عمود أيقونات على الجنب بدل التابات اللي فوق */
.stage .ed-inspector { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 0 14px; align-content: start; max-height: 620px; padding: 14px 16px 14px 10px; }
[dir="rtl"] .stage .ed-inspector { padding: 14px 10px 14px 16px; }
.stage .ed-inspector > .tabs { grid-row: 1 / span 40; grid-column: 1; position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 6px; border: 0; background: none; padding: 0; margin: 0; }
.stage .ed-inspector > :not(.tabs) { grid-column: 2; min-width: 0; }
.stage #inspTabs button { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; padding: 9px 2px 7px; border: 0; border-radius: 16px; background: none; font: inherit; font-size: 11px; line-height: 1.2; color: var(--muted); cursor: pointer; white-space: normal; text-align: center; }
.stage #inspTabs button::before { content: ""; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.stage #inspTabs button:hover { color: var(--text); background: var(--field); }
.stage #inspTabs button.active { background: var(--ink); color: #fff; }
#inspTabs [data-tab="clip"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='14' rx='3'/%3E%3Cpath d='M10 9.5v5l4-2.5z'/%3E%3C/svg%3E"); }
#inspTabs [data-tab="audio"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M4 10v4M8 7v10M12 4v16M16 8v8M20 11v2'/%3E%3C/svg%3E"); }
#inspTabs [data-tab="text"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M5 6h14M12 6v13M9 19h6'/%3E%3C/svg%3E"); }
#inspTabs [data-tab="over"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Crect x='3' y='8' width='13' height='12' rx='2.5'/%3E%3Cpath d='M8 4h10.5A2.5 2.5 0 0 1 21 6.5V16'/%3E%3C/svg%3E"); }
#inspTabs [data-tab="caps"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='M7 14h4M13 14h4M7 10.5h10'/%3E%3C/svg%3E"); }
#inspTabs [data-tab="typo"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M4 19L9.5 5h1L16 19M6.2 14h7.6M17 11l3 8M20 11l-3 8'/%3E%3C/svg%3E"); }
#inspTabs [data-tab="scene"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M4 20L14 10M14 10l2-2M17 3v3M20 6h-3M19.5 9.5l-1.5-1.5M10 4l.6 1.4L12 6l-1.4.6L10 8l-.6-1.4L8 6l1.4-.6z'/%3E%3C/svg%3E"); }
#inspTabs [data-tab="logo"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.6 5.6 6 .7-4.5 4.1 1.2 6L12 16.4 6.7 19.4l1.2-6L3.4 9.3l6-.7z'/%3E%3C/svg%3E"); }
#inspTabs [data-tab="export"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4M7.5 8.5L12 4l4.5 4.5M5 14v4a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4'/%3E%3C/svg%3E"); }
/* شريط المشروع فوق: كبسولات، وزرار «صدّر الفيديو» البرتقالي */
.stage .project-bar { background: none; box-shadow: none; padding: 0; }
.stage .project-bar select, .stage .project-bar input { background: var(--card) !important; box-shadow: var(--card-shadow); border-radius: 999px !important; padding: 9px 16px; }
.stage .project-bar .mt-export { padding: 10px 22px; font-size: 14.5px; }
/* التايم لاين فاتح في الوضع الفاتح */
:root:not([data-nh-theme="dark"]) .stage .ed-timeline { background: var(--card); color: var(--text); border: 0; border-radius: 24px; box-shadow: var(--card-shadow); }
:root:not([data-nh-theme="dark"]) .stage :is(.tl-toolbar, .tl-ruler, .tl-keys) { border-color: #ECEBE7; }
:root:not([data-nh-theme="dark"]) .stage .tl-toolbar .sep { background: #E3E2DE; }
:root:not([data-nh-theme="dark"]) .stage .tl-toolbar :is(button, .ic) { color: var(--text); }
:root:not([data-nh-theme="dark"]) .stage .tl-heads { border-color: #ECEBE7; color: var(--muted); }
:root:not([data-nh-theme="dark"]) .stage .tl-heads > div, :root:not([data-nh-theme="dark"]) .stage :is(.tl-track, .ct-track) { border-color: #F1F0EC; }
:root:not([data-nh-theme="dark"]) .stage .tl-ruler { background-image: linear-gradient(to right, #DCDBD7 1px, transparent 1px), linear-gradient(to right, #B5B4B0 1px, transparent 1px); }
:root:not([data-nh-theme="dark"]) .stage .tl-ruler span { color: #8C8C88; }
:root:not([data-nh-theme="dark"]) .stage .tl-clip { background: #4A4440; }
:root:not([data-nh-theme="dark"]) .stage .tl-clip.outro { background: #181718; }
:root:not([data-nh-theme="dark"]) .stage .tl-audio.voice { background: #F9D9CC; }
:root:not([data-nh-theme="dark"]) .stage .tl-audio.music { background: #D6E3F3; }
:root:not([data-nh-theme="dark"]) .stage .tl-audio canvas { filter: brightness(.45) saturate(1.6); }
:root:not([data-nh-theme="dark"]) .stage .tl-audio .nm { background: rgba(255, 255, 255, .8); color: var(--text); }
:root:not([data-nh-theme="dark"]) .stage .tl-cap { background: #ECEBE7; color: #6B6A66; border-inline-start-color: #fff; }
:root:not([data-nh-theme="dark"]) .stage :is(.tl-clip, .tl-audio).selected, :root:not([data-nh-theme="dark"]) .stage .tl-cap.selected { border-color: var(--accent); outline-color: var(--accent); }
:root:not([data-nh-theme="dark"]) .stage .tl-playhead, :root:not([data-nh-theme="dark"]) .stage .tl-playhead span { background: var(--accent); }
:root:not([data-nh-theme="dark"]) .stage :is(.tl-empty-track, .tl-keys) { color: #8C8C88; }
:root:not([data-nh-theme="dark"]) .stage .tl-drop-hint { border-color: #DAD9D5; }
@media (max-width: 1300px) { .stage .ed-top { grid-template-columns: 210px minmax(0, 1fr) 360px; } }

/* ============ راس الصفحات بمقاسات البروتوتايب ============
   فوق: STUDIOMANIA على اليمين، والرصيد والكالندر والجرس والعميل كبسولات بيضا على الشمال.
   تحت: «رجوع»، واسم القسم بالإنجليزي بالبرتقالي، والعنوان الكبير. خطوات المشروع بتاعة كوتشي مستخبية. */
:root:root .stage-head { grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; column-gap: 12px; row-gap: 0;
  grid-template-areas: "logo . money cal bell client" "back back back back back back" "title title title title title title"; padding: 20px 40px 18px; }
.stage-logo { grid-area: logo; font-family: var(--display); font-size: 15px; font-weight: 500; letter-spacing: .32em; direction: ltr; height: 52px; display: flex; align-items: center; }
:root:root .stage-head :is(.flow, #flowNav, .stage-project, #stagePrev, #stageNext) { display: none !important; }
:root:root .stage-head .stage-back { margin-top: 18px; padding: 0; }
:root:root .stage-title { margin-top: 6px; gap: 6px; }
:root:root .stage-title h2 { font-size: 40px; font-weight: 500; letter-spacing: -.01em; }
.stage-en { font-size: 12px; }
:root:root :is(.stage-bell, .stage-money, .stage-cal) { width: 44px; height: 44px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; background: var(--card); box-shadow: 0 4px 18px rgba(24, 23, 24, .08); color: var(--text); cursor: pointer; }
.stage-money { grid-area: money; } .stage-money[hidden] { display: none !important; }
.stage-cal { grid-area: cal; }
.stage-cal svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.stage-money svg { width: 40px; height: 40px; overflow: visible; }
.stage-money circle { fill: none; stroke-width: 3; }
.stage-money .trk { stroke: var(--line); }
.stage-money .val { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 0 101; transform: rotate(-90deg); transform-origin: 20px 20px; transition: stroke-dasharray .6s; }
.stage-money text { font-family: var(--display); font-size: 10px; fill: var(--text); }
:root:root .stage-bell .bell-n { inset-block-start: 9px; inset-inline-end: 11px; min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; box-shadow: none; }
:root:root .stage-client { box-shadow: 0 4px 18px rgba(24, 23, 24, .08); font-size: 14px; }
:root:root .stage-client .client-av { width: 32px; height: 32px; background: #FBE4DA; color: #B7472A; font-weight: 600; }
:root:root .stage-body { padding: 8px 40px 32px; }
@media (max-width: 900px) {
  :root:root .stage-head { padding: 12px 16px 10px; grid-template-columns: minmax(0, 1fr) auto auto auto auto; grid-template-areas: "logo money cal bell client" "back back back back back" "title title title title title"; }
  .stage-logo { font-size: 12px; letter-spacing: .24em; height: 44px; }
  :root:root .stage-title h2 { font-size: 30px; }
  :root:root .stage-body { padding: 8px 16px 24px; }
}

/* ============ النشر بمقاسات البروتوتايب ============ */
.pub-grid { grid-template-columns: 170px minmax(0, 1fr) 380px; }
:root:root .stage .pub-where { align-items: center; text-align: center; padding: 22px 16px; gap: 14px; }
.pub-where .pub-k { text-align: center !important; line-height: 1.7; width: 9ch; margin: 0 auto; white-space: normal; }
.pub-where h2 { font-size: 13px !important; }
.pub-all { border: 1px solid #E8E7E3; border-radius: 999px; padding: 4px 12px; text-decoration: none; color: #6B6A66; align-self: center; }
:root .stage .pub-where .platforms { grid-template-columns: repeat(2, 52px); gap: 10px; margin: 0; }
:root .stage .pub-where .platforms label.plat { width: 52px; height: 52px; aspect-ratio: auto; border-radius: 16px; background: #F2F1EE !important; color: #8C8C88; box-shadow: none !important; }
:root .stage .pub-where .platforms label.plat:has(input:checked) { background: #181718 !important; color: #fff; }
:root[data-nh-theme="dark"] .stage .pub-where .platforms label.plat { background: #343334 !important; }
:root[data-nh-theme="dark"] .stage .pub-where .platforms label.plat:has(input:checked) { background: #F2F1EE !important; color: #181718; }
:root .stage .pub-where .platforms label.plat input { position: absolute; opacity: 0; pointer-events: none; }
:root .stage .pub-where .platforms label.plat svg { width: 20px; height: 20px; }
:root:root .stage .pub-ready { padding: 24px 26px; }
.pub-ready .pub-k { margin-bottom: 4px; }
.pub-ready .panel-head h2 { font-size: 20px; font-weight: 500; }
.pub-ready .panel-head h2 .muted { font-weight: 400; color: #8C8C88; }
:root:root .stage .pub-ready .panel-head .btn.primary { background: var(--card); color: var(--text); border: 1px solid #E8E7E3; box-shadow: none; font-size: 13px; padding: 10px 18px; }
:root:root .stage .pub-ready .panel-head .btn.primary:hover { background: var(--field); }
:root .stage .pub-ready .ready-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
:root .stage .ready-art video { aspect-ratio: 9 / 14; background: linear-gradient(160deg, #3A3836, #181718); }
.ready-dur { bottom: 10px; inset-inline-end: 10px; background: rgba(24, 23, 24, .7); font-size: 10.5px; padding: 3px 8px; }
.ready-tick { top: 10px; inset-inline-start: 10px; width: 26px; height: 26px; }
:root .stage .ready .body { padding: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
:root .stage .ready .name { font-size: 13.5px; font-weight: 500; }
:root .stage .ready .meta { font-size: 12px; color: #8C8C88; }
:root .stage .ready .meta .pill { display: none; }
.ready .meta .st-pick { color: #8C8C88; }
:root:root .stage .pub-form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.pub-form .pub-k { margin: 0 0 -12px; }
.pub-form .panel-head h2 { font-size: 20px; font-weight: 500; }
.pub-form #postForm { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.pub-form .field { font-size: 13px; color: #6B6A66; gap: 8px; }
:root:root .stage .pub-form textarea { border-radius: 16px; padding: 12px 14px; font-size: 14px; background: #F7F7F5 !important; }
:root:root .stage .pub-form input[type=datetime-local] { border-radius: 14px; padding: 12px 14px; font-size: 14px; background: #F7F7F5 !important; }
:root[data-nh-theme="dark"] .stage .pub-form :is(textarea, input[type=datetime-local]) { background: #343334 !important; }
.pub-form .post-video:has(> .muted:only-child) { display: none; }
:root:root .stage .pub-form .loc-row .btn { background: #F7F7F5; font-size: 12.5px; padding: 8px 14px; }
:root:root .stage .pub-form .quick-times .btn, :root:root .stage .pub-form .quick-times button { background: var(--card); border: 1px solid #E8E7E3; font-size: 12.5px; padding: 7px 13px; }
:root:root .stage .pub-form .quick-times .on, :root:root .stage .pub-form .quick-times button:focus-visible { background: #181718; color: #fff; border-color: #181718; }
.pub-form .row:has(#postSubmit) { margin-top: auto; gap: 10px; }
:root:root .stage .pub-form #postSubmit { padding: 14px; font-size: 15px; font-weight: 500; box-shadow: 0 10px 28px rgba(229, 97, 62, .45); }
:root:root .stage .pub-form #postNow { background: transparent; color: var(--text); border: 1.5px solid var(--text); padding: 13px 20px; font-size: 14px; }
:root:root .stage .pub-form #postNow:hover { background: var(--text); color: var(--card); }
.inbox-link { margin-bottom: 16px; }
:root:root .stage-head { grid-template-areas: "logo . money bell cal client" "back back back back back back" "title title title title title title"; }
.stage-money text { font-weight: 400; font-size: 9.5px; }
.pub-form .row:has(#postSubmit) { flex-direction: row; }
:root .stage .ready.selected .acts { opacity: 0; }
:root .stage .ready:hover .acts { opacity: 1; }
:root:root .stage .pub-form textarea { resize: none; }
.pub-grid { align-items: stretch; }
.pub-where { position: static; }
@media (max-width: 900px) { :root:root .stage-head { grid-template-areas: "logo money bell cal client" "back back back back back" "title title title title title"; } }
.stage-money text { stroke: none; }
.pub-where .pub-k { width: auto; }
:root[data-nh-theme="dark"] .stage .pub-form .loc-row .btn { background: var(--field); color: var(--text); }
:root[data-nh-theme="dark"] .stage .pub-form .quick-times button { border-color: var(--line); }
:root[data-nh-theme="dark"] .stage .pub-form .quick-times .on { background: #F2F1EE; color: #181718; }
:root[data-nh-theme="dark"] .pub-all, :root[data-nh-theme="dark"] .stage .pub-ready .panel-head .btn.primary { border-color: var(--line); }
:root:root .stage .pub-form .loc-row .btn.opt-chip.on { background: #181718; color: #fff; }
:root[data-nh-theme="dark"] .stage .pub-form .loc-row .btn.opt-chip.on { background: #F2F1EE; color: #181718; }
.pub-form .post-extra { margin-top: -4px; }
/* الراس بنفس عرض الصفحة (1500) على الشاشات الواسعة، عشان العنوان والكروت يبقوا على نفس الخط */
:root:root .stage-head { box-sizing: border-box; width: 100%; max-width: 1580px; margin-inline: auto; }
:root:root .stage-head { grid-template-columns: auto minmax(0, 1fr) auto auto auto auto auto; grid-template-areas: "logo . money bell inbox cal client" "back back back back back back back" "title title title title title title title"; }
:root:root .stage-inbox { grid-area: inbox; width: 44px; height: 44px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; background: var(--card); box-shadow: 0 4px 18px rgba(24, 23, 24, .08); color: var(--text); cursor: pointer; }
.stage-inbox svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.view[data-view="7"] > .inbox-link { display: none; }
@media (max-width: 900px) { :root:root .stage-head { grid-template-columns: minmax(0, 1fr) auto auto auto auto auto; grid-template-areas: "logo money bell inbox cal client" "back back back back back back" "title title title title title title"; } }

/* ============ المونتاج بمقاسات البروتوتايب ============
   راس صغير: رجوع، MONTAGE واسم المشروع، واتحفظ/معاينة/صدّر على الشمال.
   تحته: عمود الأدوات (84) ← كارت الأداة (360) ← المعاينة الكبيرة، والتايم لاين كارت تحت بعرض الصفحة. */
.stage.mt-mode .stage-head { grid-template-areas: "back back back back back back back"; padding-top: 14px; padding-bottom: 0; }
.stage.mt-mode .stage-head > :not(.stage-back) { display: none !important; }
.stage.mt-mode .stage-head .stage-back { margin-top: 0; }
.stage.mt-mode .stage-body { padding-top: 4px; }
/* شريط المشروع = الراس */
.stage .project-bar { gap: 12px; margin-bottom: 14px; min-height: 52px; }
.project-bar .mt-k { order: -3; font-family: var(--display); font-size: 10.5px; letter-spacing: .32em; color: var(--accent); direction: ltr; }
.stage .project-bar #projectName { order: -2; background: transparent !important; box-shadow: none !important; border: 0 !important; padding: 2px 4px !important; font-size: 22px; font-weight: 500; min-width: 120px; max-width: 360px; border-radius: 10px !important; }
.stage .project-bar #projectName:hover, .stage .project-bar #projectName:focus { background: var(--card) !important; }
.stage .project-bar #projectSelect { order: -1; font-size: 13px; padding: 8px 14px; }
.stage .project-bar .new-project { order: -1; }
.stage .project-bar #saveState { font-size: 13px; color: #8C8C88; }
.stage .project-bar #deleteProject { font-size: 13px; }
:root:root .stage .project-bar .mt-preview { background: transparent; border: 1.5px solid var(--text); padding: 10px 18px; font-size: 14px; }
:root:root .stage .project-bar .mt-preview:hover { background: var(--text); color: var(--card); }
:root:root .stage .project-bar .mt-export { padding: 11px 26px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 28px rgba(229, 97, 62, .45); }
/* الأدوات والكارت والمعاينة */
:root:root .stage .ed-top { grid-template-columns: 460px minmax(0, 1fr); gap: 16px; }
:root:root .stage .ed-inspector { order: -1; background: none; box-shadow: none; padding: 0; grid-template-columns: 84px minmax(0, 1fr); gap: 0 16px; max-height: none; overflow: visible; }
:root:root .stage .ed-inspector > .tabs { gap: 10px; align-items: center; }
:root:root .stage #inspTabs button { width: 72px; padding: 12px 0; border-radius: 20px; background: var(--card); color: var(--text); font-size: 11.5px; gap: 6px; box-shadow: none; }
:root:root .stage #inspTabs button:hover { background: var(--card); box-shadow: 0 4px 18px rgba(24, 23, 24, .08); }
:root:root .stage #inspTabs button.active { background: #181718; color: #fff; }
:root[data-nh-theme="dark"] .stage #inspTabs button.active { background: #F2F1EE; color: #181718; }
#inspTabs [data-tab="media"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='2'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='2'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='2'/%3E%3Cpath d='M17 13.5v7M13.5 17h7'/%3E%3C/svg%3E"); }
:root:root .stage .ed-inspector > .pane:not([hidden]) { background: var(--card); border-radius: 24px; box-shadow: var(--card-shadow); padding: 22px; min-height: 520px; max-height: 640px; overflow-y: auto; box-sizing: border-box; }
.stage .ed-inspector > .pane .panel-head { margin-bottom: 10px; }
.stage .ed-inspector > .pane.ed-media .bin-grid { max-height: none; }
:root:root .stage .ed-player { background: none; box-shadow: none; padding: 0; gap: 14px; }
:root:root .stage .ed-player .ty-wrap { background: #EDECE8; border-radius: 24px; flex: 1; min-height: 520px; display: flex; align-items: center; justify-content: center; }
:root[data-nh-theme="dark"] .stage .ed-player .ty-wrap { background: #2A292A; }
:root:root .stage .ed-player .frame { border-radius: 22px; box-shadow: 0 30px 60px rgba(24, 23, 24, .25); }
:root:root .stage .ed-player .transport { justify-content: center; gap: 8px; }
:root:root .stage .ed-player .transport > .spacer { flex: 0 0 8px; }
:root:root .stage .ed-player .transport .ic.play { width: 48px; height: 48px; background: #181718; color: #fff; }
:root[data-nh-theme="dark"] .stage .ed-player .transport .ic.play { background: #F2F1EE; color: #181718; }
/* التايم لاين: كارت تحت بعرض الصفحة */
:root:root .stage #montage .ed-timeline { margin-top: 16px; }
:root:not([data-nh-theme="dark"]) .stage .tl-heads { color: #6B6A66; }
:root:not([data-nh-theme="dark"]) .stage .tl-clip { border-radius: 10px; }
:root:not([data-nh-theme="dark"]) .stage .tl-audio { border-radius: 8px; }
:root:not([data-nh-theme="dark"]) .stage .tl-audio.voice { background: #FBE4DA; }
:root:not([data-nh-theme="dark"]) .stage .tl-audio.music { background: #E6EEF9; }
:root:not([data-nh-theme="dark"]) .stage .tl-cap { background: #EDECE8; border-radius: 6px; }
@media (max-width: 1200px) { :root:root .stage .ed-top { grid-template-columns: 400px minmax(0, 1fr); } }
@media (max-width: 900px) { :root:root .stage .ed-top { grid-template-columns: 1fr; } :root:root .stage .ed-inspector { grid-template-columns: 1fr; } :root:root .stage .ed-inspector > .tabs { flex-direction: row; overflow-x: auto; position: static; grid-row: auto; } }
/* المعاينة: مربع رمادي كبير والكادر في نصه، والتشغيل تحته */
:root:root .stage .project-bar { background: none !important; box-shadow: none !important; padding: 0 !important; border: 0; }
:root:root .stage .ed-player { border: 0; padding: 24px 0 0; gap: 14px; justify-content: flex-start;
  background: linear-gradient(#EDECE8, #EDECE8) top / 100% calc(100% - 64px) no-repeat; border-radius: 24px; }
:root[data-nh-theme="dark"] .stage .ed-player { background: linear-gradient(#2A292A, #2A292A) top / 100% calc(100% - 64px) no-repeat; }
:root:root .stage .ed-player .ty-wrap { background: none; min-height: 0; flex: none; display: block; align-self: center; border-radius: 0; margin-bottom: 18px; }
:root:root .stage .ed-player .mt-gbar:empty { display: none; }
:root:root .stage #inspTabs button { padding: 10px 0; }
:root:root .stage .ed-player { align-self: start; padding-bottom: 0; }
:root:root .stage .ed-inspector > .tabs { gap: 6px; }
:root:root .stage #inspTabs button { padding: 8px 0; gap: 4px; }
:root:root .stage .ed-inspector > .pane:not([hidden]) { min-height: 0; max-height: 600px; }
:root:root .stage .ed-inspector > .pane:not([hidden]) { min-height: 460px; }

/* ============ الإعدادات بمقاسات البروتوتايب ============ */
/* الأيقونة الزجاج (96) جنب العنوان */
:root:root .stage-head:has(#stageIc:not([hidden])) { grid-template-areas: "logo . money bell inbox cal client" "ic back back back back back back" "ic title title title title title title"; grid-template-columns: auto minmax(0, 1fr) auto auto auto auto auto; }
.stage-ic { grid-area: ic; width: 96px; height: 96px; align-self: end; margin-inline-end: 8px; }
.stage-ic[hidden] { display: none; }
.stage-ic img { width: 100%; height: 100%; object-fit: contain; }
.stage-ic .ic-d, :root[data-nh-theme="dark"] .stage-ic .ic-l { display: none; }
:root[data-nh-theme="dark"] .stage-ic .ic-d { display: block; }
.stage-head:has(#stageIc:not([hidden])) .stage-back { justify-self: start; }
/* الكروت على قد محتواها */
.set-grid { align-items: start; gap: 20px; }
.set-card { padding: 24px !important; gap: 16px; }
.set-card h2 { margin-top: -10px; }
.set-fill { display: none; }
/* الحسابات */
.set-acc li { padding: 10px 12px; }
.set-acc li small[dir="ltr"] { font-size: 12.5px; color: #6B6A66; }
/* المفاتيح */
.set-card form .field { font-size: 13px; color: #6B6A66; gap: 6px; }
:root:root .stage .set-card form input[type=password] { border-radius: 14px; padding: 12px 14px; font-size: 14px; background: #F7F7F5 !important; }
:root[data-nh-theme="dark"] .stage .set-card form input[type=password] { background: var(--field) !important; }
.set-card form .hint:empty { display: none; }
/* الوضع: الصورة على عرض الكارت وتحتها دايرة اختيار والاسم */
.theme-picks button { padding: 0; gap: 0; overflow: hidden; border-radius: 16px; background: var(--card) !important; box-shadow: 0 0 0 1px #E3E2DE; text-align: start; }
.theme-picks button.on { box-shadow: 0 0 0 2px var(--accent); }
.tp-art { height: 70px; border-radius: 0; }
.tp-art.light { background: #F7F7F5; box-shadow: none; }
.tp-art.dark { background: #1F1E1F; }
.tp-l { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13.5px; }
.tp-l i { width: 15px; height: 15px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #8C8C88; flex: none; }
.theme-picks button.on .tp-l i { box-shadow: inset 0 0 0 1.5px var(--accent), inset 0 0 0 4px var(--card), inset 0 0 0 8px var(--accent); }
:root[data-nh-theme="dark"] .theme-picks button { box-shadow: 0 0 0 1px var(--line); }
:root[data-nh-theme="dark"] .theme-picks button.on { box-shadow: 0 0 0 2px var(--accent); }
.set-seg { background: #EDECE8; }
:root[data-nh-theme="dark"] .set-seg { background: var(--field); }
:root .stage .set-card .btn.set-out { margin-top: 6px; }

/* ===== صفحة المواعيد (الكالندر) زي البروتوتايب: أسبوع في كارت أبيض كبير، كل يوم عمود رمادي ===== */
.stage.cal-mode .view[data-view="7"] > :not(.cal-panel) { display: none !important; }
.stage.cal-mode .cal-panel { position: relative; margin: 0 !important; padding: 0 !important; background: none !important; box-shadow: none !important; border: 0 !important; }
.stage.cal-mode .cal-panel > .panel-head { position: absolute; inset-inline-end: 0; top: 0; margin: 0; padding: 0; border: 0; }
.stage.cal-mode .cal-panel > .panel-head > :not(#calViews), .stage.cal-mode #calViews [data-v="list"],
.stage.cal-mode .cal-panel > :is(.posts, .empty, .orphans) { display: none !important; }
.stage.cal-mode #calViews { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--field, #EFEEEB); }
.stage.cal-mode #calViews button { border: 0; background: none; border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 13px; color: #8a857f; cursor: pointer; }
.stage.cal-mode #calViews button.on { background: var(--card, #fff); color: var(--ink, #181718); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.stage:not(.cal-mode) #calViews { display: none; }
.stage.cal-mode .cal-head { min-height: 40px; margin: 0 0 20px; padding-inline-end: 160px; justify-content: flex-end; gap: 20px; }
.stage.cal-mode .cal-head [data-nav="0"], .stage.cal-mode .cal-legend { display: none; }
.stage.cal-mode .cal-head [data-nav] { display: grid; place-items: center; flex: none; width: 40px; height: 40px; min-width: 0; padding: 0; line-height: 1; border-radius: 50%; border: 0; background: var(--card, #fff); box-shadow: 0 2px 10px rgba(24, 23, 24, .06); font-size: 18px; }
.stage.cal-mode .cal-title { font-size: 17px; font-weight: 500; min-width: 190px; text-align: center; }
.stage.cal-mode :is(.cal-week, .cal-month) { background: var(--card, #fff); border-radius: 24px; box-shadow: var(--card-shadow, 0 4px 24px rgba(24, 23, 24, .06)); padding: 20px; }
.stage.cal-mode .cal-week { gap: 12px; overflow: visible; }
.stage.cal-mode .cal-week .cal-day { min-height: 0; padding: 0; background: none; border: 0; gap: 10px; opacity: 1; }
.stage.cal-mode .cal-week .cal-dh { justify-content: center; gap: 6px; font-size: 13px; color: #8a857f; }
.stage.cal-mode .cal-week .cal-dh .cal-dn { color: var(--ink, #181718); }
.stage.cal-mode .cal-week .cal-day.today .cal-dn { color: #fff; }
.stage.cal-mode .cal-week .cal-list { flex: 1; min-height: max(360px, calc(100vh - 420px)); background: var(--page-bg, #F7F7F5); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 10px; border: 2px solid transparent; }
.stage.cal-mode .cal-week .cal-day.today .cal-list { border-color: var(--accent, #E5613E); background: transparent; }
.stage.cal-mode .cal-week .cal-day.drop .cal-list { border-color: var(--accent, #E5613E); border-style: dashed; }
.stage.cal-mode .cal-week .cal-day.past .cal-card { opacity: .8; }
.stage.cal-mode .cal-week .cal-card { border-radius: 12px; box-shadow: 0 2px 10px rgba(24, 23, 24, .06); background: var(--card, #fff); border: 2px solid transparent; }
.stage.cal-mode .cal-week .cal-card.failed { border-color: #E04A3A; }
.stage.cal-mode .cal-week .cal-card img, .stage.cal-mode .cal-week .cal-noimg { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: linear-gradient(160deg, #4a4542, #221e1b); font-size: 0; }
.stage.cal-mode .cal-week .cal-card > .cal-n { display: none; }
.stage.cal-mode .cal-week .cal-meta { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 12px; }
.stage.cal-mode .cal-week .cal-meta .cal-pl:first-of-type { margin-inline-start: auto; }
.stage.cal-mode .cal-bad { margin-inline-start: auto; color: #E04A3A; }
.stage.cal-mode .cal-week .cal-card.job { background: none; box-shadow: none; border: 1.5px dashed rgba(24, 23, 24, .2); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.stage.cal-mode .cal-week .cal-card.job .cal-n { display: block; color: #6B6A66; }
.stage.cal-mode .cal-week .cal-add { position: absolute; inset: auto 0 0; top: 40px; margin: auto; width: fit-content; height: fit-content; display: inline-flex; padding: 7px 16px; border: 1px solid var(--ink, #181718); border-radius: 999px; background: var(--card, #fff); color: var(--ink, #181718); font: inherit; font-size: 13px; opacity: 0; transition: opacity .15s; }
.stage.cal-mode .cal-week .cal-add span { display: none; }
.stage.cal-mode .cal-week .cal-add b { font-weight: 500; }
.stage.cal-mode .cal-week .cal-day:hover .cal-add, .stage.cal-mode .cal-week .cal-day:has(.cal-list:empty) .cal-add { opacity: 1; }
.stage:not(.cal-mode) .cal-add b { display: none; }
.stage.cal-mode .cal-month .cal-day { background: var(--page-bg, #F7F7F5); border-radius: 12px; }
:root[data-nh-theme="dark"] .stage.cal-mode .cal-week .cal-card.job { border-color: rgba(255, 255, 255, .22); }
:root[data-nh-theme="dark"] .stage.cal-mode .cal-week .cal-list, :root[data-nh-theme="dark"] .stage.cal-mode .cal-month .cal-day { background: rgba(255, 255, 255, .04); }
:root[data-nh-theme="dark"] .stage.cal-mode .cal-head [data-nav] { background: var(--field); color: #fff; }
@media (max-width: 900px) { .stage.cal-mode .cal-week { overflow-x: auto; grid-template-columns: repeat(7, 150px); } .stage.cal-mode .cal-head { padding-inline-end: 0; padding-top: 50px; } }
.stage.cal-mode .cal-head [data-nav="0"] { display: none; }
:root[data-nh-theme="dark"] .stage.cal-mode .cal-week .cal-dh .cal-dn, :root[data-nh-theme="dark"] .stage.cal-mode .cal-title { color: #f1f1f3; }
:root[data-nh-theme="dark"] .stage.cal-mode .cal-week .cal-day.today .cal-dn { color: #fff; }
:root[data-nh-theme="dark"] .stage.cal-mode .cal-week .cal-add { background: #1F1E1F; color: #f1f1f3; border-color: rgba(255, 255, 255, .6); }
:root[data-nh-theme="dark"] .stage.cal-mode #calViews button.on { background: #2a292a; color: #fff; }

/* ===== الكومنتات والرسايل زي البروتوتايب: قايمة البوستات في كارت على اليمين، والكومنتات في كارت كبير ===== */
:root:root .view[data-view="15"] .ib-bar { flex-direction: row-reverse; justify-content: flex-start; margin: 0 0 20px; }
:root:root #ibTabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--field, #EFEEEB); }
:root:root #ibTabs button { border: 0; background: none; border-radius: 999px; padding: 8px 20px; font: inherit; font-size: 14px; color: #8a857f; cursor: pointer; }
:root:root #ibTabs button.on { background: var(--card, #fff); color: var(--ink, #181718); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
:root:root #ibTabs .ib-n { font-weight: 400; margin-inline-start: 4px; }
:root:root #ibTabs button.on .ib-n { color: var(--accent, #E5613E); }
:root:root #ibRefresh { border-radius: 999px; }
:root:root .ib-layout { grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: stretch; }
:root:root .ib-list-panel, :root:root .ib-thread { background: var(--card, #fff); border: 0; border-radius: 24px; box-shadow: var(--card-shadow, 0 4px 24px rgba(24, 23, 24, .06)); height: calc(100vh - 290px); min-height: 420px; max-height: none; margin: 0; }
:root:root .ib-list-panel { padding: 12px; }
:root:root .ib-list { gap: 6px; }
:root:root .ib-list li { align-items: flex-start; gap: 12px; padding: 12px; border-radius: 16px; }
:root:root .ib-list li:hover { background: var(--page-bg, #F7F7F5); }
:root:root .ib-list li.on { background: #FDF1EC; }
:root:root .ib-thumb { width: 54px; height: 54px; border-radius: 12px; background: linear-gradient(160deg, #4a4542, #221e1b); color: #fff; }
:root:root .ib-list .ib-av { width: 44px; height: 44px; font-size: 16px; }
:root:root .ib-list .ib-top { justify-content: space-between; flex-wrap: nowrap; }
:root:root .ib-plat { font-size: 12px; color: #8a857f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root:root .ib-list .ib-top small { flex: none; font-size: 12px; color: #8a857f; }
:root:root .ib-list .ib-snip { color: var(--ink, #181718); font-size: 14px; margin-top: 2px; }
:root:root .ib-list .ib-name { font-weight: 500; font-size: 14px; margin-top: 2px; }
:root:root .ib-list li .ib-name + .ib-snip { color: #8a857f; font-size: 12.5px; }
:root:root .ib-count { font-size: 12.5px; color: #8a857f; margin-top: 2px; }
:root:root .ib-list li.on .ib-count { color: var(--accent, #E5613E); }
:root:root .ib-unread { inset-block-start: auto; inset-block-end: 14px; inset-inline-end: auto; inset-inline-start: 12px; }
:root:root .ib-thread { padding: 26px 28px; }
:root:root .ib-thread > .empty { margin-top: 30%; text-align: center; color: #8a857f; }
:root:root .ib-post { align-items: center; gap: 14px; border: 0; margin: 0 0 18px; padding: 0; }
:root:root .ib-post .ib-cap { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 500; max-height: 3em; overflow: hidden; white-space: normal; }
:root:root .ib-open { flex: none; font-size: 12.5px; color: #8a857f; }
:root:root .ib-post .ib-filter { flex: none; margin: 0; font-size: 13px; color: #6B6A66; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
:root:root .ib-comments { gap: 22px; }
:root:root .ib-c { gap: 14px; }
:root:root .ib-c > .ib-av { width: 38px; height: 38px; font-size: 15px; background: #E8EEF8; color: #3B5B92; }
:root:root .ib-c:nth-child(3n+2) > .ib-av { background: #E3F4EC; color: #2F8F6B; }
:root:root .ib-c:nth-child(3n) > .ib-av { background: #FDF1EC; color: var(--accent, #E5613E); }
:root:root .ib-cb > .ib-top b { font-size: 13px; }
:root:root .ib-cb > .ib-top small { font-size: 11.5px; color: #8a857f; }
:root:root .ib-wait { background: #FBEFD5; color: #B07A1E; padding: 1px 9px; font-size: 11px; }
:root:root .ib-cb > p { margin: 8px 0 0; padding: 9px 14px; font-size: 14px; border-radius: 16px; background: var(--page-bg, #F7F7F5); }
:root:root .ib-act { display: block; margin-top: 6px; padding: 0; color: #8a857f; font-size: 12.5px; }
:root:root .ib-act:hover { color: var(--accent, #E5613E); }
:root:root .ib-c.reply { margin-top: 12px; }
:root:root .ib-c.reply.mine > .ib-av { display: none; }
:root:root .ib-c.reply.mine > .ib-cb > .ib-top { display: none; }
:root:root .ib-c.mine > .ib-cb > p { background: #FBE3D9; color: #4a2a1e; margin: 0; }
:root:root .ib-compose { margin-top: 12px; padding: 14px; gap: 10px; border-radius: 20px; background: var(--page-bg, #F7F7F5); }
:root:root .ib-compose textarea { border: 0; border-radius: 14px; padding: 12px 14px; font-size: 14px; background: var(--card, #fff); min-height: 52px; resize: none; }
:root:root .ib-compose .ib-hint { border: 0; border-radius: 12px; padding: 8px 12px; background: transparent; font-size: 12.5px; }
:root:root .ib-compose .ib-hint:focus { background: var(--card, #fff); }
:root:root .ib-compose .row { gap: 8px; }
:root:root .ib-sug { border-radius: 999px; background: var(--card, #fff); border: 0; padding: 7px 16px; }
:root:root .ib-sug::before { content: "✲"; color: var(--accent, #E5613E); margin-inline-end: 6px; }
:root:root .ib-cancel { border-radius: 999px; background: none; border: 0; color: #8a857f; }
:root:root .ib-send { border-radius: 999px; padding: 9px 24px; box-shadow: 0 8px 20px rgba(229, 97, 62, .3); }
:root:root .ib-chathead { border: 0; padding: 0 0 14px; gap: 12px; font-size: 16px; }
:root:root .ib-chat { max-height: none; flex: 1; }
:root:root .ib-thread:has(.ib-chat) { display: flex; flex-direction: column; }
:root:root .ib-msg { background: var(--page-bg, #F7F7F5); border-radius: 16px; padding: 9px 14px; }
:root:root .ib-msg.mine { background: #FBE3D9; color: #4a2a1e; }
:root[data-nh-theme="dark"] .ib-list li.on { background: #3a2a24; }
:root[data-nh-theme="dark"] .ib-list li:hover, :root[data-nh-theme="dark"] .ib-cb > p, :root[data-nh-theme="dark"] .ib-compose, :root[data-nh-theme="dark"] .ib-msg { background: rgba(255, 255, 255, .06); }
:root[data-nh-theme="dark"] .ib-c.mine > .ib-cb > p, :root[data-nh-theme="dark"] .ib-msg.mine { background: #4A2E25; color: #fbe3d9; }
:root[data-nh-theme="dark"] .ib-list .ib-snip, :root[data-nh-theme="dark"] #ibTabs button.on { color: #f1f1f3; }
:root[data-nh-theme="dark"] #ibTabs button.on { background: #2a292a; }
:root[data-nh-theme="dark"] .ib-wait { background: #4a3c1e; color: #f0c56a; }
:root[data-nh-theme="dark"] .ib-c > .ib-av { background: rgba(255, 255, 255, .1); color: #f1f1f3; }
@media (max-width: 900px) { :root:root .ib-layout { grid-template-columns: 1fr; } :root:root .ib-list-panel { height: auto; max-height: 320px; min-height: 0; } :root:root .ib-thread { height: auto; } }

/* ===== ⭐ تقييم النتايج (العقل بيتعلم منها) ===== */
.br-rate { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.br-rate .br-q { font-size: 13px; color: var(--muted); margin-inline-end: 4px; }
.br-rate > button { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer;
  background: var(--field, #EFEEEB); color: var(--ink, #181718); transition: background .2s, color .2s; }
.br-rate > button:hover { background: #FBE3D9; }
.br-rate > button.on[data-rv="great"] { background: var(--accent, #E5613E); color: #fff; }
.br-rate > button.on[data-rv="bad"] { background: #181718; color: #fff; }
.br-why { display: flex; align-items: flex-end; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 14px; background: var(--card, #fff); box-shadow: 0 6px 20px rgba(24, 23, 24, .1); }
.br-why[hidden] { display: none; }
.br-write { flex: 1; min-height: 24px; font-size: 14px; line-height: 1.7; outline: none; white-space: pre-wrap; caret-color: var(--accent, #E5613E); }
.br-write:empty::before { content: attr(data-ph); color: #B5AFA8; }
.br-why > button { border: 0; border-radius: 999px; padding: 6px 14px; background: var(--accent, #E5613E); color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
/* على كروت الفيديوهات الجاهزة: زرارين صغيرين فوق الفيديو بيبانوا مع الهوفر */
.ready-art .br-rate.compact { position: absolute; top: 8px; inset-inline-start: 8px; margin: 0; gap: 4px; opacity: 0; transition: opacity .2s; z-index: 2; }
.ready-art:hover .br-rate.compact, .ready-art .br-rate.compact:has(.on), .ready-art .br-rate.compact:has(.br-why:not([hidden])) { opacity: 1; }
.br-rate.compact > button { width: 30px; height: 30px; padding: 0; justify-content: center; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.br-rate.compact .br-why { position: absolute; top: 36px; inset-inline-start: 0; width: 230px; }
:root[data-nh-theme="dark"] .br-rate > button { background: rgba(255, 255, 255, .08); color: #f1f1f3; }
:root[data-nh-theme="dark"] .br-rate.compact > button { background: rgba(30, 30, 32, .9); }
:root[data-nh-theme="dark"] .br-rate > button.on[data-rv="bad"] { background: #f1f1f3; color: #141416; }
:root[data-nh-theme="dark"] .br-why { background: #1F1E1F; }

/* 🚪 حساب عميل (من البوابة): أدوات الأدمن بتستخبى */
html[data-role="customer"] .admin-only { display: none !important; }
