/* ── dn° ─────────────────────────────────────────────────────────────────
   פחם, שמנת, מרווה. Calibri. בלי זוהר ובלי מדרגים.
   ───────────────────────────────────────────────────────────────────── */
:root {
  --charcoal: #3B3A38;
  --cream:    #F2F1EB;
  --sage:     #A8B8B1;
  --sage-dk:  #647A6C;
  --gray:     #979A93;
  --line:     #E2E0D8;
  --white:    #FFFFFF;
  --danger:   #A6584F;
  --radius:   10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: Calibri, "Segoe UI", system-ui, sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  direction: rtl;
  font-size: 16px;
  line-height: 1.5;
}

button, input, select, textarea { font-family: inherit; font-size: 16px; }

/* ── התחברות ─────────────────────────────────────────────────────────── */
#login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
#login .box {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px 32px; width: 100%; max-width: 340px; text-align: center;
}
#login .mark { font-size: 34px; letter-spacing: 2px; margin-bottom: 4px; }
#login .sub { color: var(--gray); margin-bottom: 26px; font-size: 15px; }
#login input {
  width: 100%; padding: 11px 12px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--cream);
}
#login button {
  width: 100%; padding: 11px; margin-top: 6px; border: 0; border-radius: 8px;
  background: var(--charcoal); color: var(--cream); cursor: pointer;
}
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 8px; }

/* ── מסגרת ───────────────────────────────────────────────────────────── */
#app { display: none; }
header {
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: 0 20px; display: flex; align-items: center; gap: 20px;
  position: sticky; top: 0; z-index: 20;
}
header .mark { font-size: 22px; letter-spacing: 2px; padding: 14px 0; font-weight: 600; }
nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; }
nav button {
  border: 0; background: none; color: var(--gray); cursor: pointer;
  padding: 16px 13px; white-space: nowrap; border-bottom: 2px solid transparent;
}
nav button:hover { color: var(--charcoal); }
nav button.on { color: var(--charcoal); border-bottom-color: var(--sage-dk); font-weight: 600; }
header .who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--gray); }
header .who button { border: 0; background: none; color: var(--gray); cursor: pointer; text-decoration: underline; }

main { padding: 22px; max-width: 1180px; margin: 0 auto; }
.page { display: none; }
.page.on { display: block; }

h2 { font-size: 21px; margin: 0 0 4px; font-weight: 600; }
.hint { color: var(--gray); font-size: 14px; margin: 0 0 18px; }

/* ── כרטיסים ─────────────────────────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.stat .n { font-size: 30px; font-weight: 600; line-height: 1.2; }
.stat .l { color: var(--gray); font-size: 14px; }
.stat.warn .n { color: var(--danger); }

.row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 150px; }
.row .t { font-weight: 600; }
.row .s { color: var(--gray); font-size: 14px; }
.empty { color: var(--gray); padding: 18px 0; text-align: center; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 13px; background: var(--cream); border: 1px solid var(--line); color: var(--charcoal);
}
.tag.sage { background: var(--sage); border-color: var(--sage); color: #2B322D; }
.tag.late { background: #F3E2DF; border-color: #E4C9C4; color: var(--danger); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ── טפסים וכפתורים ──────────────────────────────────────────────────── */
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.btn {
  border: 1px solid var(--line); background: var(--white); color: var(--charcoal);
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.btn:hover { border-color: var(--sage-dk); }
.btn.main { background: var(--charcoal); color: var(--cream); border-color: var(--charcoal); }
.btn.small { padding: 4px 10px; font-size: 14px; }
.btn.link { border: 0; background: none; color: var(--gray); text-decoration: underline; padding: 4px; }
.btn.danger { color: var(--danger); }

/* מתג תצוגה (רשימה/יומן) בגוש אחד ומודגש, כדי שלא יתערבב עם שורת הקטגוריות שמעליו */
.view-toggle { display:inline-flex; background:var(--cream); border:1px solid var(--line); border-radius:999px; padding:3px; gap:2px; }
.view-toggle .btn { border:0; border-radius:999px; padding:6px 16px; background:transparent; }
.view-toggle .btn.main { background:var(--charcoal); color:var(--cream); }

input, select, textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--charcoal);
}
textarea { width: 100%; min-height: 70px; resize: vertical; }
.form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
.form .wide { grid-column: 1 / -1; }
label { display: block; font-size: 14px; color: var(--gray); margin-bottom: 4px; }
label input, label select { width: 100%; }

.code {
  font-family: Consolas, monospace; font-size: 13px; background: var(--cream);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px;
  direction: ltr; text-align: left; overflow-x: auto; white-space: nowrap;
  max-width: 100%;
}

details.box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); margin-bottom: 14px; }
details.box > summary { padding: 14px 18px; cursor: pointer; font-weight: 600; }
details.box > div { padding: 0 18px 18px; }

/* ── טלפון ───────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  header { padding: 0 12px; gap: 10px; flex-wrap: wrap; }
  header .mark { padding: 12px 0; font-size: 19px; }
  nav { order: 3; flex: 0 0 100%; width: 100%; }
  nav button { padding: 12px 10px; font-size: 15px; }
  main { padding: 14px; }
  .form { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px; }
}

/* עמודות של טבלת המשימות */
.row.cols .c-cat { width: 130px; }
.row.cols .c-own { width: 80px; }
.row.cols .c-due { width: 115px; }
.row.cols .c-st  { width: 118px; }
.row.cols .c-st select { width: 100%; padding: 5px 8px; font-size: 14px; }
.row.cols .c-x   { width: 66px; }

@media (max-width: 720px) {
  /* בטלפון העמודות נשברות לשורות, ושורת הכותרות מיותרת */
  .row.cols.head { display: none; }
  .row.cols .c-cat, .row.cols .c-own, .row.cols .c-due, .row.cols .c-st, .row.cols .c-x { width: auto; }
}

/* הווי שליד כל משימה */
.row.cols .c-v { width: 40px; }
.tick {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--white);
  color: transparent; font-size: 15px; line-height: 1; padding: 0;
  transition: background .12s, border-color .12s, color .12s;
}
.tick:hover { background: var(--sage); border-color: var(--sage-dk); color: #2B322D; }
.row.cols .c-st { display: none; }

@media (max-width: 720px) {
  .row.cols .c-v { width: 36px; }
}

/* פס התקדמות קטן על כרטיס המסלול */
.bar-mini { display:inline-block; width:90px; height:7px; border-radius:4px; background:var(--line); overflow:hidden; }
.bar-mini i { display:block; height:100%; background:var(--sage-dk); }

/* פאנל העריכה של משימה */
.edit-panel {
  background: var(--cream); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin: 0 0 12px;
}
.edit-panel .notes { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.note { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.note:last-child { border-bottom: 0; }

/* לוח השנה של השיווק */
.cal-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.cal { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; background:var(--line);
       border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.cal-name { background:var(--cream); padding:8px 6px; text-align:center; font-size:14px; color:var(--gray); }
.cal-cell { background:var(--white); min-height:104px; padding:6px; }
.cal-cell.empty { background:var(--cream); }
.cal-cell.out { background:var(--cream); opacity:.55; }
.cal-cell.is-today { background:#FAF8F2; box-shadow:inset 0 0 0 2px var(--sage); }
.cal-day { font-size:13px; color:var(--gray); margin-bottom:4px; }
/* הרקע של הפריט הוא הסטטוס. הצבע נקבע ב-app.js, כאן רק הצורה. */
.cal-item { border-radius:7px; padding:5px 7px; margin-bottom:5px; cursor:pointer;
            border-right:4px solid; transition:transform .1s, filter .1s; }
.cal-item:hover { filter:brightness(.96); transform:translateX(-1px); }
.cal-item.cal-urgent { font-weight:700; box-shadow:0 0 0 2px #E39985 inset; }
.cal-t { display:block; font-size:13px; line-height:1.3; font-weight:600; }
.cal-t.done, .open-task.done { text-decoration:line-through; opacity:.6; }
.cal-sub { display:block; font-size:12px; opacity:.75; }

/* ריבוע סימון כהושלמה בלוח השנה, במקום וי: משימה שהושלמה מקבלת קו על הכותרת */
.cal-check { display:inline-block; width:13px; height:13px; margin-left:6px; vertical-align:-2px;
             border:1.5px solid; border-radius:3px; cursor:pointer; flex-shrink:0; }
.cal-check:hover { filter:brightness(.9); }
.cal-item .cal-t.open-task { cursor:pointer; }
.cal-item .cal-t.open-task:hover { text-decoration:underline; }

/* משבצת המקרא, ואותו קוד צבע גם ברשימה */
.legend { display:inline-block; padding:3px 10px; border-radius:20px; font-size:13px;
          border:1px solid; white-space:nowrap; margin-inline-start:4px; }

@media (max-width: 720px) {
  /* בטלפון הלוח נגלל לצדדים במקום להצטמצם למריחה */
  .cal { min-width: 620px; }
  #mkBody { overflow-x: auto; }
}

/* משימה של היום שלא נעשתה. הכל כאן רגוע, אז זה מה שקוטע את הרוגע.
   ליים זוהר על פחם, ופס עבה בצד כדי שייתפס גם בגלילה מהירה. */
.row.cols.is-today {
  background: #E9FF3D;
  box-shadow: inset 4px 0 0 #B4C400;
  margin: 0 -18px; padding-inline: 18px;
  border-bottom-color: #C9D400;
}
.row.cols.is-today .t { color: #1F2400; font-weight: 700; }
.row.cols.is-today .s { color: #4A5200; }
.row.cols.is-today .tag { background: #FFFFFF; border-color: #B4C400; color: #3A4200; }
.row.cols.is-today .tick { border-color: #7E8A00; }
.row.cols.is-today .tick:hover { background: #1F2400; border-color: #1F2400; color: #E9FF3D; }

/* באיחור. אותו עיקרון, צבע אחר, כדי שלא יתבלבל עם היום. */
.row.cols.is-late {
  background: #FFE2DC;
  box-shadow: inset 4px 0 0 #D9614A;
  margin: 0 -18px; padding-inline: 18px;
}
.row.cols.is-late .t { color: #6E2417; font-weight: 600; }

.tag.hot { font-weight: 700; }

/* תוכן שאמור לצאת היום ולא יצא, גם בלוח וגם ברשימה */
.cal-item.cal-hot { font-weight: 700; box-shadow: 0 0 0 2px #B4C400 inset; }
.cal-item.cal-hot .cal-sub { opacity: 1; font-weight: 600; }
.card.mk-hot { box-shadow: inset 4px 0 0 #B4C400; }
.card.mk-hot .t { font-weight: 700; }

/* היום עצמו בלוח, טבעת ברורה יותר */
.cal-cell.is-today { background: #FDFFF0; box-shadow: inset 0 0 0 2px #B4C400; }
.cal-cell.is-today .cal-day { color: #5E6B00; font-weight: 700; }

/* פס דוגמיות הצבע של המותג, לדגימה מהירה בבניית דפים */
.swatch-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.swatch-btn {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--white);
  border-radius: 20px; padding: 5px 12px 5px 6px; cursor: pointer;
  font-size: 13px; color: var(--charcoal); transition: border-color .12s, background .12s;
}
.swatch-btn:hover { border-color: var(--sage-dk); }
.swatch-btn.copied { background: var(--sage); border-color: var(--sage-dk); }
.swatch-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.swatch-name { color: var(--gray); }
.swatch-hex {
  font-family: Consolas, monospace; direction: ltr; unicode-bidi: plaintext;
  min-width: 62px; text-align: left;
}

/* חלון הגדרות */
.modal { position:fixed; inset:0; background:rgba(59,58,56,.35); display:flex;
         align-items:center; justify-content:center; z-index:50; padding:20px; }
.modal-box { background:var(--white); border-radius:12px; padding:24px; width:100%; max-width:420px;
             border:1px solid var(--line); }
.modal-box input { width:100%; }

/* ── עורך התוכן ─────────────────────────────────────────────────────────── */
.ek-title { margin: 4px 0 14px; }
.panel-t { margin: 18px 0 8px; font-size: 17px; color: var(--charcoal); }
.btn.big { padding: 9px 20px; font-size: 15px; }
.btn.tiny { padding: 3px 8px; font-size: 12px; line-height: 1.4; }
.writing { color: #5D4B78; font-weight: 600; }
.writing::after { content: ' ●'; animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: .25 } 50% { opacity: 1 } }
.err-line { color: #8E4F35; }
.open-box { margin-top: 10px; }

/* רשת השקפים. כל שקף מוצג בגודל אמיתי ומוקטן, כדי שמה שרואים הוא מה שיֵצא */
/* ── רשת השקפים, בארבעה גדלים ──────────────────────────────────────────
   התצוגה היא השקף האמיתי ברוחב 1080, מוקטן. הקנה מידה חייב להתאים בדיוק
   לרוחב התא, אחרת השקף יוצא חתוך או צף באוויר. */
.slide-grid { display: grid; gap: 14px; justify-content: flex-start; margin-bottom: 12px; }
.slide-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  background: var(--white); display: flex; flex-direction: column; gap: 5px;
}
.slide-shot {
  position: relative; overflow: hidden; border-radius: 6px; background: #EAE9E4;
}
.slide-frame {
  position: absolute; top: 0; right: 0; width: 1080px; height: 1350px;
  border: 0; transform-origin: top right; pointer-events: none;
}
.slide-shot[data-kind="רילס"] .slide-frame,
.slide-shot[data-kind="סטורי"] .slide-frame { height: 1920px; }

.zoom-s  { grid-template-columns: repeat(auto-fill, 216px); }
.zoom-s  .slide-card { width: 216px; }
.zoom-s  .slide-shot { width: 196px; height: 245px; }
.zoom-s  .slide-shot[data-kind="רילס"], .zoom-s .slide-shot[data-kind="סטורי"] { height: 348px; }
.zoom-s  .slide-frame { transform: scale(.18148); }

.zoom-m  { grid-template-columns: repeat(auto-fill, 320px); }
.zoom-m  .slide-card { width: 320px; }
.zoom-m  .slide-shot { width: 300px; height: 375px; }
.zoom-m  .slide-shot[data-kind="רילס"], .zoom-m .slide-shot[data-kind="סטורי"] { height: 533px; }
.zoom-m  .slide-frame { transform: scale(.27778); }

.zoom-l  { grid-template-columns: repeat(auto-fill, 450px); }
.zoom-l  .slide-card { width: 450px; }
.zoom-l  .slide-shot { width: 430px; height: 538px; }
.zoom-l  .slide-shot[data-kind="רילס"], .zoom-l .slide-shot[data-kind="סטורי"] { height: 764px; }
.zoom-l  .slide-frame { transform: scale(.39815); }

.zoom-xl { grid-template-columns: repeat(auto-fill, 620px); }
.zoom-xl .slide-card { width: 620px; }
.zoom-xl .slide-shot { width: 600px; height: 750px; }
.zoom-xl .slide-shot[data-kind="רילס"], .zoom-xl .slide-shot[data-kind="סטורי"] { height: 1067px; }
.zoom-xl .slide-frame { transform: scale(.55556); }

.zoom-bar { align-items: center; gap: 6px; margin: 18px 0 8px; }
.slide-no { font-size: 12px; color: var(--gray); }
.slide-card textarea {
  width: 100%; min-height: 84px; font-size: 13px; line-height: 1.5; resize: vertical;
}
.slide-controls { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.slide-controls select { font-size: 12px; padding: 3px 6px; flex: 1; min-width: 62px; }
.slide-note { font-size: 11px; color: var(--gray); line-height: 1.4; }

/* שרשור ההערות */
.note-row { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0;
            border-bottom: 1px solid var(--line); }
.note-row:last-of-type { border-bottom: 0; }
.note-row.done { opacity: .5; }
.note-who { width: 26px; height: 26px; border-radius: 50%; display: flex;
            align-items: center; justify-content: center; font-size: 13px;
            font-weight: 700; flex-shrink: 0; }
.note-text { font-size: 14px; line-height: 1.5; }

/* מה שהמנוע לא ידע. בולט בכוונה, כדי שלא ייצא מספר מומצא לקהל */
.ask-box {
  border: 1px solid #D6BE7C; background: #FBF3DE; border-radius: 10px;
  padding: 12px 16px; margin: 12px 0;
}
.ask-t { font-weight: 700; color: #7A5F22; margin-bottom: 6px; }
.ask-box ul { margin: 0 18px 6px 0; padding: 0; }
.ask-box li { font-size: 14px; line-height: 1.6; color: #5B4715; }

/* פקדי הנראות של שקף: מספר פיקסלים, קו ולוגו */
.px-box { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--gray); }
.px-box input { width: 62px; font-size: 12px; padding: 3px 6px; }
.chk { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--gray); cursor: pointer; }
.chk input { margin: 0; }

/* שורת הרקעים מעל רשת השקפים */
.bg-bar { margin: 6px 0 10px; }
.slide-controls input[type=range] { flex: 1; min-width: 70px; accent-color: var(--sage-dk); }

/* ── אוטומציית אינסטגרם: עורך עם תצוגה מקדימה חיה, לצד הטופס ────────────── */
.ig-editor { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.ig-step {
  font-size: 13px; font-weight: 700; color: var(--sage-dk);
  margin: 16px 0 -2px; padding-top: 12px; border-top: 1px solid var(--line);
}
.ig-step:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ig-arrow { color: var(--gray); font-weight: 400; margin: 0 2px; }
.ig-advanced { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
.ig-advanced > summary { padding: 10px 14px; cursor: pointer; font-size: 14px; color: var(--gray); }
.ig-advanced > div { padding: 4px 14px 14px; }

.ig-preview-col { position: sticky; top: 76px; }
.ig-preview {
  background: var(--charcoal); border-radius: 22px; padding: 16px 12px;
  box-shadow: 0 6px 20px rgba(59,58,56,.18);
}
.ig-preview-head { color: var(--cream); opacity: .55; font-size: 11px; text-align: center; margin-bottom: 12px; }
.ig-bubble {
  background: var(--white); border-radius: 14px; padding: 10px 12px;
  margin-bottom: 8px; font-size: 13px; line-height: 1.45; max-width: 92%;
  white-space: pre-wrap; word-break: break-word;
}
.ig-bubble.public {
  background: transparent; border: 1px dashed rgba(242,241,235,.35); color: var(--cream);
  opacity: .8; font-size: 11px; padding: 6px 10px; text-align: center; max-width: 100%;
}
.ig-bubble-btn {
  display: block; text-align: center; margin: 8px -12px -10px; padding: 9px 12px;
  border-top: 1px solid var(--line); color: #3897F0; font-weight: 600; font-size: 13px;
}
.ig-bubble-btn.fixed { color: var(--gray); }
.ig-note { color: var(--cream); opacity: .5; font-size: 11px; text-align: center; margin-top: 6px; }

@media (max-width: 900px) {
  .ig-editor { grid-template-columns: 1fr; }
  .ig-preview-col { position: static; max-width: 300px; margin: 4px auto 0; }
}

/* פקדי הנראות, כל אחד עם תווית שרואים. בלי תוויות היא לא מוצאת אותם. */
.look-row { display: flex; align-items: center; gap: 6px; }
.look-lbl { font-size: 11px; color: var(--gray); min-width: 42px; flex: 0 0 42px; }
.look-row select { flex: 1; min-width: 0; font-size: 12px; padding: 3px 6px; }
.look-row input[type=number] { width: 54px; font-size: 12px; padding: 3px 6px; }
.look-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--sage-dk); }
.slide-card { gap: 5px; }

/* תצוגה שאפשר לגרור עליה את התמונה, כמו בעריכת סטורי */
.slide-shot.draggable { cursor: grab; }
.slide-shot.draggable:active { cursor: grabbing; }
.look-row input[type=color] { width: 30px; height: 24px; padding: 0; border: 1px solid var(--line);
  border-radius: 5px; background: none; cursor: pointer; flex: 0 0 auto; }

/* הנחיה לשקף בודד, ורשימת האלמנטים הקטנים */
.ask-slide { display: flex; gap: 5px; margin-top: 4px; }
.ask-slide input { flex: 1; min-width: 0; font-size: 12px; padding: 4px 7px; }
.el-box { border-top: 1px dashed var(--line); margin-top: 5px; padding-top: 5px;
          display: flex; flex-direction: column; gap: 4px; }
.el-row { display: flex; gap: 4px; align-items: center; }
.el-row input[type=text], .el-row input:not([type]) { flex: 1; min-width: 0; font-size: 12px; padding: 3px 6px; }
.el-row input[type=number] { width: 46px; font-size: 12px; padding: 3px 4px; }

/* עיצוב טקסט וסוג הערה */
.fmt-bar { display: flex; gap: 4px; }
.note-kind { display: inline-block; background: #DFD7EC; color: #5D4B78;
  border-radius: 10px; padding: 1px 8px; font-size: 11px; margin-left: 6px; }
.note-kind.gen { background: #EAE9E4; color: #7A786F; }

/* ── ספריית המדיה ────────────────────────────────────────────────────────
   רשת של thumbnails עם תג קצר על כל אחד, מסננים למעלה, ופרטי הקובץ בצד.
   אותו מסך משמש גם כלשונית וגם כחלון בחירה מתוך שקף. */
.al-modal .modal-box { max-width: 1180px; width: 96vw; height: 88vh; display: flex; flex-direction: column; padding: 18px; }
.al-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.al-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.al-tools input, .al-tools select { font-size: 13px; padding: 5px 8px; }
.al-tools input#alQ { flex: 1; min-width: 180px; }
.al-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 300px; gap: 14px; }
#p-media .al-body { height: calc(100vh - 250px); }
.al-grid { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
           align-content: start; padding-bottom: 8px; }
.al-card { border: 1px solid var(--line); border-radius: 8px; background: var(--white); padding: 6px; cursor: pointer;
           display: flex; flex-direction: column; gap: 3px; }
.al-card.sel { border-color: var(--sage-dk); box-shadow: 0 0 0 2px var(--sage); }
.al-thumb { position: relative; aspect-ratio: 4 / 5; background: #EAE9E4; border-radius: 6px; overflow: hidden; }
.al-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al-badge { display: inline-block; background: #232323; color: #F2F1EB; font-size: 10px; letter-spacing: .06em;
            padding: 2px 6px; border-radius: 4px; font-weight: 700; font-family: Consolas, monospace; direction: ltr; }
.al-thumb .al-badge { position: absolute; top: 6px; right: 6px; }
.al-thumb .al-badge.vid { right: auto; left: 6px; background: #5E7466; }
.al-st { position: absolute; bottom: 6px; right: 6px; font-size: 10px; padding: 2px 6px; border-radius: 4px;
         background: #F1E3BE; color: #7A5F22; }
.al-st.processing { background: #DFD7EC; color: #5D4B78; }
.al-st.failed { background: #F6D9CB; color: #8E4F35; }
.al-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-side { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--white); padding: 12px; }
.al-side img { width: 100%; border-radius: 6px; margin-bottom: 8px; }
.al-side label { display: block; font-size: 12px; color: var(--gray); margin-top: 8px; }
.al-side input, .al-side select, .al-side textarea { width: 100%; font-size: 13px; padding: 5px 8px; }
.al-side textarea { min-height: 64px; }
@media (max-width: 900px) { .al-body { grid-template-columns: 1fr; } .al-side { max-height: 40vh; } }

/* ── הוויזואל של השקף: תפקיד, הקובץ שנבחר, הצעות ─────────────────────── */
.vis-box { border: 1px solid var(--sage); background: #F4F7F5; border-radius: 8px; padding: 7px;
           display: flex; flex-direction: column; gap: 5px; }
.vis-mode { font-size: 10px; padding: 2px 7px; border-radius: 10px; background: #EAE9E4; color: #7A786F; flex: 0 0 auto; }
.vis-mode.manual { background: #C9E4CE; color: #2F5638; }
.vis-mode.legacy { background: #F1E3BE; color: #7A5F22; }
.vis-sel { display: flex; gap: 8px; align-items: center; }
.vis-sel img { width: 44px; height: 55px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.vis-name { font-size: 12px; word-break: break-all; line-height: 1.4; }
.vis-empty { padding: 2px 0; }
.vis-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.vis-sugg { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; min-height: 0; }
.vis-thumb { position: relative; width: 46px; height: 58px; border: 1px solid var(--line); border-radius: 4px;
             padding: 0; background: #fff; cursor: pointer; overflow: hidden; }
.vis-thumb:hover { border-color: var(--sage-dk); }
.vis-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vis-thumb .al-badge { position: absolute; bottom: 2px; right: 2px; font-size: 8px; padding: 1px 3px; }

/* ── הבמאי הוויזואלי ואזהרות הגיוון ─────────────────────────────────────── */
.vd-bar { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.vd-plan { font-size: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.vd-warn { border: 1px solid #D6BE7C; background: #FBF3DE; border-radius: 8px; padding: 8px 12px; }
.vd-warn-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 13px; padding: 3px 0; }

/* ── Phase 2: מבנים, סטריפ הקרוסלה, גלריית המבנים ─────────────────────── */
.vis-layout { font-size: 12px; flex: 1; color: var(--charcoal); }
.ov-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px; }
.ov-card { flex: 0 0 auto; width: 84px; cursor: pointer; text-align: center; }
.ov-shot { position: relative; width: 84px; height: 105px; overflow: hidden; border-radius: 4px; background: #EAE9E4; border: 1px solid var(--line); }
.ov-shot[data-kind="סטורי"], .ov-shot[data-kind="רילס"] { height: 149px; }
.ov-shot iframe { position: absolute; top: 0; right: 0; width: 1080px; height: 1350px; border: 0; transform: scale(.07778); transform-origin: top right; pointer-events: none; }
.ov-shot[data-kind="סטורי"] iframe, .ov-shot[data-kind="רילס"] iframe { height: 1920px; }
.ov-lbl { font-size: 10px; color: var(--gray); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-card:hover .ov-shot { border-color: var(--sage-dk); }
.slide-card.flash { box-shadow: 0 0 0 3px var(--sage); }
.vd-warn-acts { display: flex; gap: 4px; flex: 0 0 auto; }
.lg-box { max-width: 1240px; }
.lg-grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, 228px); gap: 12px; align-content: start; }
.lg-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--white); display: flex; flex-direction: column; gap: 4px; }
.lg-card.cur { border-color: var(--sage-dk); box-shadow: 0 0 0 2px var(--sage); }
.lg-card.off { opacity: .55; }
.lg-shot { position: relative; width: 212px; height: 265px; overflow: hidden; border-radius: 5px; background: #EAE9E4; }
.lg-shot[data-kind="סטורי"], .lg-shot[data-kind="רילס"] { height: 377px; }
.lg-shot iframe { position: absolute; top: 0; right: 0; width: 1080px; height: 1350px; border: 0; transform: scale(.19630); transform-origin: top right; pointer-events: none; }
.lg-shot[data-kind="סטורי"] iframe, .lg-shot[data-kind="רילס"] iframe { height: 1920px; }
.lg-name { font-size: 13px; font-weight: 700; }

/* ── Phase 3: ביקורת מותג ─────────────────────────────────────────────── */
.bc-box { border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 10px 12px; }
.bc-overall { font-size: 14px; margin: 2px 0 8px; padding: 8px 10px; background: #F4F7F5; border-radius: 6px; }
.bc-note { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; }
.bc-note .bc-dot { width: 8px; height: 8px; border-radius: 50%; background: #B3A4D0; flex: 0 0 auto; }
.bc-note.warn .bc-dot { background: #DFA98D; }
.bc-note span:nth-child(2) { flex: 1; }

/* ── Phase 4: המוח התוכני ─────────────────────────────────────────────── */
.mk-quick { flex: 1; min-width: 220px; font-size: 14px; padding: 8px 12px; }
.mk-quick-kind { font-size: 13px; padding: 6px 8px; }
.brain-box { margin-top: 10px; }
.brain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 14px; }
.brain-grid .look-lbl { display: block; min-width: 0; margin-bottom: 2px; }
.brain-grid .wide { grid-column: 1 / -1; }
.brain-missing { background: #FBF3DE; border: 1px solid #D6BE7C; border-radius: 8px; padding: 8px 12px; }
.hook-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.hook-opt.on { border-color: var(--sage-dk); box-shadow: 0 0 0 2px var(--sage); }
.hook-opt .hook-txt { font-weight: 700; display: block; }
.hook-opt input { margin-top: 5px; }
.ev-row { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.ev-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.ev-add input { flex: 1; min-width: 160px; font-size: 13px; padding: 5px 8px; }
.ev-add select { font-size: 13px; padding: 5px 8px; }
@media (max-width: 900px) { .brain-grid { grid-template-columns: 1fr; } }

.bc-note.error .bc-dot { background: #C0392B; }
.bc-note.error { font-weight: 700; }

/* סרטוני הסבר */
.ex-card { margin: 14px 0; }
.ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ex-head h3 { margin: 0 0 4px; }
.ex-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ex-job { background: #F2F1EB; border-radius: 8px; padding: 8px 12px; margin: 10px 0; }
.ex-job.ok { background: #e3ebe5; }
.ex-job.err { background: #f6e6e0; }
.ex-vids { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.ex-vid { margin: 0; width: 220px; }
.ex-vid video { width: 220px; aspect-ratio: 9/16; background: #3B3A38; border-radius: 8px; display: block; }
.ex-vid figcaption { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin-top: 6px; word-break: break-all; }
.ex-stills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ex-stills img { width: 90px; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; }

/* ── החלטות ── */
.dec .dec-body { white-space: pre-wrap; font-size: 15px; margin-bottom: 4px; }
.dec.dec-old { opacity: .6; }
.dec .dec-link { cursor: pointer; text-decoration: underline; }
.dec.dec-flash { box-shadow: 0 0 0 2px var(--sage-dk); }
.tag.warn { background: #F6EBD9; border-color: #E6D2AE; color: #6B4E1A; }
.d-view.on { background: var(--charcoal); color: var(--cream); border-color: var(--charcoal); }

/* מחולל הסרטונים */
.reel-main { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.reel-main video { width: 270px; aspect-ratio: 9/16; background: #33312E; border-radius: 12px; }
.reel-side { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 12px; }
.reel-q { background: #FBF3D9; border: 1px solid #E8D9A8; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.reel-q ul { margin: 6px 0 0; padding-inline-start: 18px; }
