/* SubDoc Lite — לוח שעם + טיימליין. ממשק מימין לשמאל, פונט Rubik */
:root {
  --ink: #1d1d1b; --bg: #f5f5f1; --white: #fff; --line: #e3e2dc; --dim: #6b6a62; --soft: #f2f1ec;
  --paper: #fffdf6; --cork: #b9864f; --yellow: #ffe14d; --ok: #1e7d4f; --danger: #c0392b;
  --d0: #151618; --d1: #1c1d20; --d2: #26272b; --dline: #33343a; --dtext: #ececec; --ddim: #9a9ba1;
  --r: 8px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 'Rubik', system-ui, -apple-system, "Segoe UI", Arial, sans-serif; display: flex; flex-direction: column; overflow: hidden; }
/* שורות טקסט לא נשברות כך שמילה אחת נשארת לבד בשורה; כותרות מאוזנות */
body { text-wrap: pretty; }
h1, h2, h3, .dz-big, .dz-sub span, .hint, .media-q, .toast, .empty { text-wrap: balance; }
/* שורות מאוזנות בכל האתר: טקסטים קצרים ובינוניים נשברים לשורות באורך דומה. :where — בלי משקל, כדי שכלל ספציפי יגבר */
:where(p, li, dd, small, label, legend, summary, figcaption, button, .btn, .c-title, .c-text, .pool-title, .lane-dur, .insp-meta, .kc-note, .src-txt) { text-wrap: balance; }
h1 { font-size: 24px; margin: 0; font-weight: 600; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
h3 { font-size: 13px; margin: 14px 0 4px; color: var(--dim); font-weight: 600; }
.spacer { flex: 1; }
.ic { display: inline-grid; flex: none; }
.hint { color: var(--dim); font-size: 12.5px; margin: 0; }
.hint.big { font-size: 15px; }
.empty { color: var(--dim); font-size: 13px; padding: 14px 8px; text-align: center; }
.warn { color: #96560a; font-size: 12.5px; }
.ok { color: var(--ok); display: inline-flex; align-items: center; gap: 3px; }
.count { color: var(--dim); font-size: 12px; white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: flex-end; }
.row > label { flex: 1; min-width: 0; }
.row.center { justify-content: center; }

input, select, textarea { background: var(--white); color: var(--ink); border: 1px solid #d5d4cc; border-radius: 6px; padding: 7px 9px; font: inherit; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid #3b6bf5; outline-offset: 1px; }
textarea { resize: vertical; width: 100%; }
button { cursor: pointer; font: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--white); color: var(--ink); border: 1px solid #d5d4cc; border-radius: 8px; padding: 8px 14px; font-weight: 500; white-space: nowrap; min-height: 36px; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #33332f; }
.btn.yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink); font-weight: 600; }
.btn.dark { background: transparent; border-color: transparent; color: #fff; }
.btn.dark:hover { background: rgba(255, 255, 255, .14); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.big { padding: 12px 22px; font-size: 15px; min-height: 46px; }
.btn.icon { padding: 0; width: 36px; }
.btn.icon.small { width: 28px; min-height: 28px; border-radius: 6px; }
.btn[disabled] { opacity: .4; cursor: default; }
.link { background: none; border: 0; color: var(--dim); font-size: 12.5px; text-decoration: underline; padding: 0; }
.link:hover { color: var(--ink); }

/* ---- כותרת עליונה ---- */
.top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; background: var(--white); border-bottom: 1px solid var(--line); flex: none; position: relative; z-index: 20; }
.brand { font-weight: 700; font-size: 16px; }
.sep { width: 1px; height: 24px; background: var(--line); }
.proj-name { background: transparent; border-color: transparent; width: 150px; font-weight: 500; font-size: 15px; padding: 5px 6px; }
.proj-name:hover { border-color: #d5d4cc; }
.steps, .view-switch { display: flex; gap: 2px; background: var(--soft); border-radius: 10px; padding: 3px; }
.steps button, .view-switch button { display: flex; align-items: center; gap: 7px; background: none; border: 0; color: #4b4a44; padding: 7px 13px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.steps button b { width: 19px; height: 19px; border-radius: 50%; background: #dcdbd3; color: var(--ink); font-size: 11.5px; display: grid; place-items: center; font-weight: 600; }
.steps button.on { background: var(--ink); color: #fff; }
.steps button.on b { background: #fff; }
.steps button.done b { background: var(--ok); color: #fff; font-size: 0; }
.steps button.done b::after { content: "✓"; font-size: 11.5px; }
.view-switch button { font-size: 13.5px; padding: 6px 11px; }
.view-switch button[aria-pressed="true"] { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.save-status { color: var(--dim); font-size: 12px; white-space: nowrap; }
.save-status:empty { display: none; }
.status { color: var(--ink); font-size: 13px; white-space: nowrap; padding: 4px 12px; border-radius: 999px; }
.status.working { background: #fff3bf; color: #5c4400; box-shadow: inset 0 0 0 1px #f2c94c; }
.status.done { background: #d3f9d8; color: #1b5e20; box-shadow: inset 0 0 0 1px #69db7c; }
.status.done::before { content: "✓"; border: 0; animation: none; width: auto; height: auto; font-weight: 700; }
.status.working::before { border-color: #5c4400; border-top-color: transparent; }
.status::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-inline-end: 7px; border: 2px solid var(--ink); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.agent-badge { display: none; color: var(--ok); font-size: 12px; white-space: nowrap; }
.agent-badge::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-inline-end: 5px; }
.agent-on .agent-badge { display: inline; }
.lang-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.lang-toggle select { padding: 5px 7px; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; inset-inline-end: 0; top: 112%; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 5px; z-index: 30; min-width: 210px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
.menu-list button { background: none; border: 0; color: var(--ink); padding: 9px 11px; text-align: start; border-radius: 6px; }
.menu-list button:hover { background: var(--soft); }
.menu-list .danger { color: var(--danger); }

main { flex: 1; min-height: 0; display: flex; }
.view { flex: 1; min-width: 0; min-height: 0; }

/* ---- שלבים 1 ו-3: דפים פשוטים ---- */
.page-view { overflow-y: auto; }
.page-wrap { max-width: 780px; margin: 0 auto; padding: 32px 20px 60px; display: flex; flex-direction: column; gap: 14px; }
.ai-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); }
.ai-card.todo { border-color: #e2b84a; background: #fff7dc; }
.ai-card.ok { color: var(--ok); }
.ai-card span { display: inline-flex; align-items: center; gap: 4px; }
.drop-zone { border: 2px dashed #c9c8bf; border-radius: 14px; padding: 46px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--white); transition: border-color .15s, background .15s; }
.drop-zone.over { border-color: var(--ink); background: #fff7dc; }
.drop-zone.compact { padding: 14px; flex-direction: row; justify-content: center; }
.drop-zone.compact .dz-sub { display: none; }
.drop-zone.compact .dz-big { font-size: 15px; }
.dz-big { font-size: 20px; font-weight: 600; }
.dz-sub { color: var(--dim); max-width: 600px; }
/* כל משפט בשורה משלו, כך שמשפט לא נחתך באמצע */
.dz-sub span { display: block; }
.media-list { display: flex; flex-direction: column; gap: 10px; }
.media-item { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.media-item.missing { border-style: dashed; }
.media-head { display: flex; align-items: center; gap: 10px; }
.media-name { flex: 1; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-meta { color: var(--dim); font-size: 12.5px; }
.media-q { color: var(--dim); }
.media-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.media-ok { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.media-busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-inline-end: 8px; border: 2px solid var(--ink); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
.mat-next { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.page-wrap.wide { max-width: 860px; }
.exp-group { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.exp-group h2 { font-size: 16px; margin-bottom: 4px; }
.exp-opts { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; padding: 10px 12px; background: var(--soft); border-radius: 8px; }
.exp-opts label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--dim); }
.exp-opts .grow { flex: 1; min-width: 240px; }
.exp-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.exp-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.exp-row b { font-weight: 600; font-size: 14.5px; }
.exp-row span:not(.ic) { color: var(--dim); font-size: 13px; }
.relink { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 9px 16px; background: var(--ink); color: #fff; flex: none; font-size: 14px; }

/* ---- שלב 2: בניית הסרט ---- */
.build { display: flex; flex-direction: column; }
.b-top { flex: 1; min-height: 0; display: flex; position: relative; }

/* רשימת הקטעים */
.pool { width: 250px; flex: none; background: #efe6d3; border-inline-end: 1px solid #d9ccb0; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.search { display: flex; align-items: center; gap: 7px; background: var(--paper); border: 1px solid #d9ccb0; border-radius: 8px; padding: 0 10px; color: var(--dim); margin-top: 4px; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; padding: 8px 0; font-size: 13.5px; }
.pool-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.topic { display: flex; flex-direction: column; gap: 6px; }
.topic-head { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.topic-title { flex: 1; font-weight: 600; font-size: 14.5px; }
.topic-sum { color: var(--dim); font-size: 12px; }
.pool-clip { display: flex; align-items: center; gap: 6px; background: var(--paper); border-radius: 2px; padding: 5px 10px 5px 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); cursor: grab; font-size: 13.5px; }
.pool-clip:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, .28); }
.pool-clip.used { opacity: .6; }
.pool-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool-dur { color: var(--dim); font-size: 12px; }
.pool .btn.icon.small { background: transparent; border-color: transparent; }
.pool .btn.icon.small:hover { background: rgba(0, 0, 0, .08); }

/* אזור הלוח */
.board-area { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; }
.board-bar { position: absolute; top: 22px; inset-inline: 26px; z-index: 4; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.board-bar > * { pointer-events: auto; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); }
.board-bar .spacer { box-shadow: none; pointer-events: none; }
.film-sum { background: var(--paper); padding: 8px 14px; font-weight: 600; font-size: 14.5px; border-radius: 2px; }
.zoom-ctl { display: inline-flex; align-items: center; gap: 2px; background: var(--white); border-radius: 8px; padding: 0 4px; font-size: 12.5px; }
.zoom-ctl .btn { border: 0; background: transparent; font-size: 17px; width: 30px; }
.board-scroll { flex: 1; overflow: auto; background-color: var(--cork);
  background-image: radial-gradient(rgba(60, 35, 10, .22) 1px, transparent 1.6px), radial-gradient(rgba(255, 235, 200, .18) 1px, transparent 1.6px);
  background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 5px;
  box-shadow: inset 0 0 0 10px #8a5a2e, inset 0 0 0 12px #6e4520; }
.board { padding: 84px 30px 120px; min-width: 620px; display: flex; flex-direction: column; gap: 26px; }
.board-empty { background: var(--paper); box-shadow: 0 2px 3px rgba(0, 0, 0, .25), 0 14px 24px -10px rgba(0, 0, 0, .5); padding: 36px 30px; max-width: 520px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.board-empty h2 { font-size: 20px; }
.board-empty p { margin: 0 0 8px; color: var(--dim); }

.lane { display: flex; gap: 22px; align-items: flex-start; }
.lane-tag { flex: none; width: 190px; background: #f6ecd2; padding: 9px 12px 8px; box-shadow: 0 2px 3px rgba(0, 0, 0, .28); transform: rotate(-1.2deg); margin-top: 12px; display: flex; flex-direction: column; gap: 1px; }
.lane-k { font-size: 12px; font-weight: 600; color: var(--c); }
.lane-title { background: transparent; border: 1px solid transparent; font-weight: 700; font-size: 17px; padding: 1px 3px; margin: 0 -4px; width: calc(100% + 8px); color: #2a211b; }
/* שם המערכה בכמה שורות, כדי שלא ייחתך */
textarea.lane-title { resize: none; overflow: hidden; font-family: inherit; line-height: 1.25; field-sizing: content; min-height: 1.3em; max-height: 4em; text-wrap: balance; }
.lane-title:hover, .lane-title:focus { border-color: #cdbf9d; background: var(--paper); }
.lane-dur { font-size: 12.5px; color: #5b4e44; }
.lane-tools { display: flex; gap: 1px; margin: 5px -5px -3px; }
.lane-tools .btn { background: transparent; border-color: transparent; color: #5b4e44; width: 26px; min-height: 26px; }
.lane-tools .btn:hover { background: rgba(0, 0, 0, .09); color: var(--ink); }
.lane-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 24px; padding: 12px 0 4px; min-height: 150px; align-content: flex-start; }
.lane-hint { color: #fff6e6; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); align-self: center; padding: 0 10px; }
.lane-add { background: rgba(255, 253, 246, .16); border: 2px dashed rgba(255, 246, 230, .7); border-radius: 6px; color: #fff6e6; padding: 16px; font-weight: 500; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.lane-add:hover, .lane-add.over { background: rgba(255, 253, 246, .32); }
.marker { width: 5px; align-self: stretch; min-height: 110px; background: var(--ink); border-radius: 3px; flex: none; }

/* כרטיס נעוץ */
.card { position: relative; width: 172px; flex: none; background: var(--paper); padding: 10px 10px 9px; border-radius: 2px; box-shadow: 0 2px 2px rgba(0, 0, 0, .22), 0 12px 18px -8px rgba(0, 0, 0, .5); transform: rotate(var(--r, 0deg)); display: flex; flex-direction: column; gap: 5px; cursor: grab; transition: transform .12s; }
.card:hover { transform: rotate(0) translateY(-2px); z-index: 2; }
.card.sel { outline: 3px solid var(--ink); outline-offset: 3px; }
.card.dragging { opacity: .35; }
.pin { position: absolute; top: -8px; left: 50%; margin-left: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: inset -2px -3px 0 rgba(0, 0, 0, .25), 0 3px 4px rgba(0, 0, 0, .35); z-index: 1; }
.c-pic { position: relative; height: 86px; background: #6f6a60; display: grid; place-items: center; overflow: hidden; }
.thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.c-play { position: relative; width: 36px; min-height: 36px; border-radius: 50%; border: 0; background: rgba(255, 253, 246, .92); }
.c-play:hover { background: var(--yellow); }
.c-dur { position: absolute; bottom: 5px; left: 5px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; border-radius: 3px; padding: 0 5px; }
.c-head { display: flex; align-items: baseline; gap: 6px; }
.c-num { font-size: 12.5px; font-weight: 700; color: var(--c); }
.c-title { font-size: 14.5px; font-weight: 600; line-height: 1.25; color: #2a211b; }
.c-text { font-size: 12.5px; line-height: 1.4; color: #5b4e44; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-src { font-size: 11.5px; color: #6b5d50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-x { position: absolute; top: 4px; inset-inline-end: 4px; display: none; width: 22px !important; min-height: 22px !important; border-radius: 50% !important; z-index: 2; }
.card:hover .c-x { display: inline-flex; }
.c-x:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.card.note { width: 150px; min-height: 132px; background: #ffe873; padding: 16px 12px 10px; }
.tape { position: absolute; top: -9px; left: 44px; width: 62px; height: 20px; background: rgba(255, 255, 255, .55); transform: rotate(-4deg); }
.note-k { font-size: 11px; font-weight: 600; color: #7a6205; }
.note-text { flex: 1; background: transparent; border: 0; color: #3d3005; font-size: 14px; font-weight: 500; line-height: 1.4; resize: none; padding: 0; min-height: 86px; }
.note-text::placeholder { color: #9a8424; }

.sel-bar { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 10px; padding: 5px 5px 5px 14px; display: flex; align-items: center; gap: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); z-index: 6; white-space: nowrap; font-size: 13.5px; }
.sel-bar .btn { min-height: 32px; padding: 5px 11px; font-size: 13px; }

/* שורת הבקשה לעורך */
.ask { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 40px)); z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.ask-form { height: 52px; background: var(--white); border-radius: 14px; box-shadow: 0 3px 8px rgba(0, 0, 0, .22), 0 12px 28px rgba(0, 0, 0, .16); display: flex; align-items: center; gap: 10px; padding: 0 14px 0 8px; }
.ask-ic { color: #8a6d00; display: grid; }
.ask-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14.5px; padding: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { background: var(--white); border: 0; border-radius: 999px; padding: 6px 13px; font-size: 13px; box-shadow: 0 2px 5px rgba(0, 0, 0, .22); }
.chip:hover { background: var(--yellow); }
.chat-pop { position: relative; background: var(--white); border-radius: 12px; padding: 12px 14px; box-shadow: 0 3px 8px rgba(0, 0, 0, .22), 0 12px 28px rgba(0, 0, 0, .16); max-height: 220px; overflow-y: auto; }
.pop-k { font-size: 12px; font-weight: 600; color: #8a6d00; display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.pop-text { white-space: pre-wrap; font-size: 14px; line-height: 1.5; padding-inline-end: 24px; }
.pop-done { color: var(--ok); font-size: 12.5px; margin-top: 5px; display: flex; align-items: center; gap: 3px; }
.pop-x { position: absolute; top: 6px; inset-inline-end: 6px; border: 0 !important; }

/* נגן */
.player { background: #000; display: flex; flex-direction: column; }
.screen { position: relative; aspect-ratio: 16 / 9; background: #000; container-type: inline-size; overflow: hidden; }
.screen video { width: 100%; height: 100%; object-fit: contain; display: block; }
.overlay { position: absolute; inset: 0; pointer-events: none; }
.ov { position: absolute; left: 5%; right: 5%; text-align: center; color: #fff; text-shadow: 0 1px 4px #000, 0 0 2px #000; white-space: pre-wrap; }
.ov.sub { bottom: 5%; font-size: 3.6cqw; background: rgba(0, 0, 0, .55); width: fit-content; max-width: 90%; margin: 0 auto; padding: .15em .5em; border-radius: 4px; }
.ov.txt { font-weight: 700; line-height: 1.2; }
.ov.pos-top { top: 8%; }
.ov.pos-center { top: 50%; transform: translateY(-50%); }
.ov.pos-bottom { bottom: 20%; }
.player-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #b9b9b9; font-size: 13px; text-align: center; padding: 10px; }
.controls { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--d1); color: var(--dtext); flex: none; }
.play-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: #111; font-size: 13px; display: grid; place-items: center; flex: none; }
.play-time { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.play-title { flex: 1; min-width: 0; color: #c9cad0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-x { display: none; background: transparent; border: 0; color: var(--dtext); width: 28px; min-height: 28px; }
.mini-x:hover { background: var(--d2); }

/* הצד הכהה: נגן + הקטע הנבחר */
.side { background: var(--d1); color: var(--dtext); display: flex; min-height: 0; }
.inspector { padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.inspector .empty { color: var(--ddim); }
.inspector label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ddim); }
.inspector input, .inspector select, .inspector textarea { background: var(--d0); border-color: #3a3b40; color: #fff; }
.inspector .tc { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.insp-k { font-size: 12px; color: var(--ddim); }
.inspector h2 { font-size: 16px; }
.insp-text { font-size: 13.5px; line-height: 1.55; color: #c9cad0; max-height: 120px; overflow-y: auto; }
.insp-meta { color: var(--ddim); font-size: 12.5px; }
.help { color: var(--ddim); font-size: 13px; padding-inline-start: 18px; margin: 4px 0; }
.help li { margin-bottom: 4px; }

/* טיימליין */
.tl-wrap { flex: none; height: 290px; background: var(--d0); color: var(--dtext); display: flex; flex-direction: column; }
.tl-bar { flex: none; display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--d2); }
.btn.tool { background: transparent; border-color: transparent; color: #d6d7dc; font-weight: 400; font-size: 13px; padding: 5px 10px; min-height: 32px; }
.btn.tool:hover { background: var(--d2); }
.tl-bar label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #d6d7dc; padding: 0 10px; }
.tl-bar input[type=checkbox], .tl-bar input[type=range] { accent-color: #2ad1c9; }
.tl-bar input[type=range] { width: 120px; padding: 0; }
.tl-len { font-size: 12.5px; color: var(--ddim); font-variant-numeric: tabular-nums; }
.tl { flex: 1; overflow-x: auto; overflow-y: hidden; position: relative; }
.tl-inner { position: relative; height: 100%; min-width: 100%; }
.ruler { height: 24px; position: relative; cursor: pointer; }
.tick { position: absolute; top: 0; height: 100%; border-right: 1px solid #4a4b51; padding: 3px 4px 0 0; font-size: 10.5px; color: #8b8c92; font-variant-numeric: tabular-nums; pointer-events: none; }
.track { position: relative; margin-top: 6px; background: #1b1c1f; }
.atrack { height: 24px; }
.ctrack { height: 40px; }
.vtrack { height: 70px; }
.ttrack { height: 30px; }
.mtrack { height: 34px; }
.track-hint { position: absolute; right: 86px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: #5d5e65; white-space: nowrap; pointer-events: none; }
.tsep { width: 1px; height: 20px; background: var(--dline); margin: 0 6px; }
.track-label { position: sticky; right: 0; width: 74px; height: 100%; background: var(--d0); font-size: 11.5px; color: var(--ddim); pointer-events: none; z-index: 4; display: flex; align-items: center; padding-inline-start: 8px; font-size: 11px; }
.blk { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; overflow: hidden; touch-action: none; user-select: none; }
.blk.act { color: #fff; font-size: 11.5px; font-weight: 600; padding: 0 7px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; border-radius: 4px; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.blk.clip { cursor: grab; background-color: #55565c; background-size: auto 100%; background-repeat: repeat-x; border-top: 4px solid; }
.blk.clip::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .5), transparent 55%); pointer-events: none; }
.blk.text { cursor: grab; background: #7c5cff; }
.blk.cover { cursor: grab; background: #3f5a7a; border-top: 3px solid; }
.blk.audio { cursor: grab; background: #2f6b57; border-top: 3px solid; }
.blk.clip.only-a { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 2px, transparent 2px 6px) !important; background-size: auto; }
.blk.sel { box-shadow: inset 0 0 0 2px #fff; z-index: 2; }
.blk.moving { opacity: .75; z-index: 3; }
.blk-label { position: relative; z-index: 1; padding: 3px 10px; font-size: 11.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); pointer-events: none; }
.h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgba(255, 255, 255, .3); z-index: 2; opacity: 0; }
.blk:hover .h, .blk.sel .h { opacity: 1; }
.h:hover { background: #fff; }
.h.s { right: 0; } .h.e { left: 0; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-right: -1px; background: #fff; pointer-events: none; z-index: 5; }
.playhead::before { content: ""; position: absolute; top: 0; right: -6px; width: 14px; height: 12px; background: #fff; border-radius: 3px 3px 7px 7px; }

/* ---- תצוגה: לוח בלבד ---- */
.mode-board .tl-wrap, .mode-board .inspector { display: none; }
.mode-board .side { position: absolute; bottom: var(--pb, 20px); left: var(--px, 20px); top: var(--py, auto); width: 300px; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); z-index: 7; display: block; }
.mode-board .side:not(.open) { display: none; }
.mode-board .mini-x { display: inline-flex; }

/* ---- צבע ולשונית לכל קובץ מקור ---- */
.file-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #5b4e44; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.file-chip::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--f); flex: none; }
.inspector .file-chip, .outline .file-chip { color: var(--ddim); }
.blk-file { position: absolute; bottom: 3px; right: 8px; left: 8px; z-index: 1; color: #fff; font-size: 10.5px; text-shadow: 0 1px 2px #000; pointer-events: none; }
.file-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { background: rgba(255, 255, 255, .5); border: 0; border-top: 3px solid var(--f, #8a8a82); border-radius: 4px 4px 0 0; padding: 4px 9px; font-size: 12.5px; color: #4b4a44; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab[aria-pressed="true"] { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.pool-clip { border-inline-start: 4px solid var(--f, transparent); }
.mode-timeline .tab { background: var(--d2); color: var(--ddim); }
.mode-timeline .tab[aria-pressed="true"] { background: #3a3b40; color: #fff; }

/* ---- תצוגה: תמלול ---- */
.script-area { display: none; flex: 1; min-width: 0; min-height: 0; flex-direction: column; background: var(--bg); position: relative; }
.mode-transcript .script-area { display: flex; }
.mode-transcript .board-area, .mode-transcript .pool, .mode-transcript .tl-wrap, .mode-transcript .inspector { display: none; }
.file-tabs.big { padding: 12px 20px 0; border-bottom: 1px solid var(--line); gap: 6px; flex: none; }
.file-tabs.big .tab { font-size: 14px; padding: 8px 16px; max-width: 240px; background: var(--soft); border-radius: 8px 8px 0 0; }
.file-tabs.big .tab[aria-pressed="true"] { background: var(--white); box-shadow: none; outline: 1px solid var(--line); margin-bottom: -1px; }
/* לשוניות התמלול: גדולות ובולטות, הלשונית הפתוחה צבועה בצבע הקובץ */
.file-tabs.big .tab { font-size: 15px; font-weight: 500; padding: 10px 20px; border-top-width: 4px; color: var(--ink); }
.file-tabs.big .tab:hover { background: color-mix(in srgb, var(--f) 10%, white); }
.file-tabs.big .tab[aria-pressed="true"] { background: color-mix(in srgb, var(--f) 16%, white); font-weight: 700; outline: 2px solid var(--f); outline-offset: -2px; }
.tr-tools { display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: var(--white); border-bottom: 1px solid var(--line); flex: none; }
.tr-tools .search { margin: 0; width: 340px; background: var(--white); border-color: #d5d4cc; }
.tr-list { flex: 1; overflow-y: auto; background: var(--white); padding: 14px max(20px, calc(50% - 400px)) 90px; }
.ln { display: flex; gap: 14px; align-items: baseline; padding: 5px 10px; border-radius: 6px; border-inline-start: 4px solid transparent; cursor: text; user-select: none; }
.ln:hover { background: var(--soft); }
.ln-t { flex: none; width: 54px; background: none; border: 0; color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 2px 0; text-align: start; border-radius: 4px; }
.ln-t:hover { color: var(--ink); text-decoration: underline; }
.ln-x { flex: 1; font-size: 16px; line-height: 1.6; }
.ln.used { border-inline-start-color: var(--c); background: color-mix(in srgb, var(--c) 7%, #fff); }
.ln.now .ln-x { font-weight: 600; }
.ln.now { background: #eaf2ff; }
.ln.sel { background: #ffec99; }
.ln mark { background: #ffd43b; border-radius: 2px; padding: 0 1px; }
.res-file { margin: 14px 0 4px; }
.tr-bar { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 12px; padding: 6px 14px 6px 6px; display: flex; align-items: center; gap: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); white-space: nowrap; z-index: 5; }
.tr-bar select { background: #33332f; color: #fff; border-color: #55554f; padding: 6px 8px; max-width: 190px; }
.tr-bar .to { font-size: 13px; color: #c9c8bf; margin-inline-start: 8px; }
.mode-transcript .side { width: 380px; flex: none; flex-direction: column; }
.mode-transcript .stage { padding: 12px 12px 0; }
.mode-transcript .stage .player { border-radius: 8px; overflow: hidden; }
.outline { display: none; }
.mode-transcript .outline { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; padding: 14px; gap: 6px; color-scheme: dark; }
.ol-act { display: flex; align-items: center; gap: 7px; font-weight: 600; margin-top: 8px; }
.ol-act::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ol-act span { color: var(--ddim); font-weight: 400; font-size: 12.5px; }
.ol-item { display: flex; align-items: center; gap: 8px; background: var(--d2); border: 0; border-inline-start: 4px solid var(--f); border-radius: 6px; padding: 7px 10px; color: var(--dtext); text-align: start; font-size: 13px; }
.ol-item:hover { background: #33343a; }
.ol-item b { flex: 1; min-width: 0; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-item span { color: var(--ddim); font-size: 12px; }
.insp-hint { color: var(--ddim); font-size: 12px; line-height: 1.45; }
.inspector .tc { cursor: ew-resize; }
.inspector .tc:focus { cursor: text; }
.blk.clip .h { opacity: .55; }
.mode-timeline .pool, .tl, .inspector { color-scheme: dark; }

/* ---- תצוגה: טיימליין בלבד ---- */
.mode-timeline .board-area { display: none; }
.mode-timeline .pool { background: var(--d1); border-color: var(--dline); color: var(--dtext); width: 280px; }
.mode-timeline .pool .hint, .mode-timeline .pool .count, .mode-timeline .pool-dur, .mode-timeline .topic-sum { color: var(--ddim); }
.mode-timeline .search { background: var(--d2); border-color: var(--d2); color: var(--ddim); }
.mode-timeline .search input { color: #fff; }
.mode-timeline .pool-clip { background: var(--d2); box-shadow: none; border-radius: 6px; }
.mode-timeline .pool .btn.icon.small { color: var(--dtext); }
.mode-timeline .pool .btn.icon.small:hover { background: rgba(255, 255, 255, .12); }
.mode-timeline .side { flex: 1; min-width: 0; }
.mode-timeline .stage { flex: 1; min-width: 0; min-height: 0; background: #0f1012; display: grid; place-items: center; padding: 14px; }
.mode-timeline .stage .player { height: 100%; max-width: 100%; aspect-ratio: 16 / 10.2; border-radius: 6px; overflow: hidden; }
.mode-timeline .stage .screen { flex: 1; min-height: 0; aspect-ratio: auto; }
.mode-timeline .inspector { width: 300px; flex: none; border-inline-start: 1px solid var(--dline); }
.mode-timeline .tl-wrap { height: 370px; }
.mode-timeline .vtrack { height: 84px; }

/* ---- חלון הגדרות והודעות ---- */
dialog { background: var(--white); color: var(--ink); border: 0; border-radius: 14px; padding: 0; width: min(580px, 94vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dlg { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.dlg h2 { font-size: 18px; }
.dlg label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--dim); }
.dlg label.check { flex-direction: row; align-items: flex-start; gap: 8px; }
.dlg label.check input { width: auto; flex: none; margin-top: 2px; }
.dlg fieldset.ai-source { border: 0; padding: 0; margin: 0 0 4px; display: grid; gap: 6px; }
#incBox { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
#incWho { margin: 0; }
.dlg .grow { flex: 2; }
.dlg-actions { display: flex; gap: 8px; margin-top: 8px; }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 420px; }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); font-size: 13.5px; }
.toast.err { background: #8f2a1f; }

/* ---- נגן: תמונת כיסוי · פאנל: בחירת שימוש ועוצמה ---- */
.screen .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.seg { display: flex; background: var(--d0); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { flex: 1; background: none; border: 0; color: var(--ddim); padding: 6px 4px; border-radius: 6px; font-size: 12.5px; }
.seg button[aria-pressed="true"] { background: #3a3b40; color: #fff; font-weight: 600; }
.inspector input[type=range] { padding: 0; accent-color: #2ad1c9; }
.c-mode { position: absolute; top: 5px; left: 5px; background: var(--yellow); color: var(--ink); font-size: 10.5px; font-weight: 600; border-radius: 3px; padding: 0 5px; }

/* ---- לוגו, נגן מורחב, גרסאות, מפריד רשימת הקטעים ---- */
.logo { width: 30px; height: 30px; border-radius: 7px; flex: none; }
.pbtn { width: 30px; height: 30px; border-radius: 6px; border: 0; background: transparent; color: var(--dtext); display: grid; place-items: center; flex: none; }
.pbtn:hover { background: var(--d2); }
#player:fullscreen { width: 100vw; height: 100vh; }
#player:fullscreen .screen { flex: 1; min-height: 0; aspect-ratio: auto; }
#player:fullscreen .mini-x, #player:fullscreen #btnSize { display: none; }
.mode-board .side.big { width: 620px; }
.mode-transcript .side.big { width: min(720px, 55vw); }
.mode-timeline .side.big .inspector { display: none; }
.mode-timeline .side.big ~ * { display: none; }
.splitter { width: 7px; flex: none; cursor: col-resize; background: transparent; margin: 0 -3px; z-index: 6; position: relative; }
.splitter:hover, .splitter:active { background: rgba(59, 107, 245, .45); }
.mode-transcript .splitter { display: none; }
.note-btn { background: #ffe873; border-color: #ffe873; }
.note-btn:hover { background: #ffdf3d; }
#verList { min-width: 290px; inset-inline-end: auto; inset-inline-start: 0; }
.menu-note { color: var(--dim); font-size: 12.5px; padding: 8px 11px; }
.ver-row { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); }
.ver-row > button:first-child { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ver-row span:not(.ic) { color: var(--dim); font-size: 12px; }
.ver-row .btn { border: 0; }
.blk.moving { pointer-events: none; }

/* ---- הכרטיס שמתנגן · הסרט כטקסט ---- */
.card.playing { outline: 4px solid var(--yellow); outline-offset: 3px; box-shadow: 0 0 0 9px rgba(255, 225, 77, .35), 0 12px 18px -8px rgba(0, 0, 0, .5); transform: rotate(0) scale(1.03); z-index: 3; }
.card.playing::after { content: "מתנגן עכשיו"; position: absolute; top: -13px; inset-inline-end: 8px; background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 7px; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); z-index: 2; }
.ol-item.playing { background: #4a4520; outline: 2px solid var(--yellow); }
.film-tab { --f: #6741d9; }
.fs-top { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.fs-top h2 { font-size: 22px; }
.fs-act { display: flex; align-items: baseline; gap: 10px; font-size: 18px; font-weight: 700; color: var(--ink); margin: 26px 0 6px; padding-inline-start: 10px; border-inline-start: 5px solid var(--c); }
.fs-act span { font-size: 13px; font-weight: 400; color: var(--dim); }
.fs-clip { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; padding: 0 10px; }
.fs-clip b { font-size: 15px; }
.fs-clip .btn { margin-inline-start: auto; border-color: transparent; color: var(--dim); }
.fs-note { background: #fff6c7; border-radius: 6px; padding: 8px 12px; margin: 8px 0; color: #5a4a00; }
.fs-none { color: var(--dim); font-size: 13px; padding: 2px 14px; }
.fs-ln { cursor: default; align-items: center; }
.fs-ln .ln-t { cursor: default; text-decoration: none; }
.ln-del { visibility: hidden; border-color: transparent; color: var(--dim); }
.fs-ln:hover .ln-del { visibility: visible; }
.ln-del:hover { background: var(--danger); color: #fff; }

/* ---- הסתרת רשימת הנושאים בלוח · תיקון טקסט שורה ---- */
.mode-board.no-pool .pool, .mode-board.no-pool .splitter { display: none; }
.ln-edit { flex: 1; font-size: 16px; line-height: 1.6; padding: 2px 8px; resize: none; overflow: hidden; border: 2px solid #3b6bf5; border-radius: 6px; }

/* ---- מסך פתיחה ---- */
.intro { gap: 8px; padding: 26px 28px; }
.intro-logo { width: 54px; height: 54px; border-radius: 12px; }
.intro h2 { font-size: 22px; }
.intro-lead { margin: 0; font-size: 15px; color: #3d3c37; }
.intro-steps, .intro-list { margin: 4px 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.intro h3 { margin: 10px 0 0; color: var(--ink); font-size: 14px; }

/* ---- הסבר על מפתח AI ---- */
.keyhelp { border: 1px solid var(--line, #e3e0d8); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }
.keyhelp summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.keyhelp[open] { max-height: 46vh; overflow: auto; }
.keyhelp p { margin: 8px 0 0; }
.keyhelp h4 { margin: 12px 0 2px; font-size: 13.5px; color: var(--ink); }
.keyhelp ol { margin: 4px 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 3px; }
.keyhelp a { color: inherit; text-decoration: underline; direction: ltr; unicode-bidi: isolate; }

/* ---- מסך חומרי הגלם: צבע ורכות ---- */
:root { --blue: #2f6fed; --blue-soft: #eaf1ff; }
.page-sub { margin: -8px 0 4px; color: var(--dim); font-size: 15px; }
.drop-zone { border-color: #b9cdf7; background: linear-gradient(180deg, #f6f9ff, var(--white) 70%); }
.drop-zone.over { border-color: var(--blue); background: var(--blue-soft); }
.dz-icon { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.drop-zone.compact .dz-icon { width: 34px; height: 34px; } .drop-zone.compact .dz-icon svg { width: 18px; height: 18px; }
.url-toggle { display: none; font-size: 13.5px; }
body.agent-on .url-toggle { display: inline; }
.url-row { display: flex; gap: 8px; padding: 10px; border-radius: 12px; background: var(--blue-soft); }
.url-row[hidden], body:not(.agent-on) .url-row { display: none; }
.url-row input { flex: 1; min-width: 200px; }
.media-item { border-inline-start: 5px solid var(--f, var(--line)); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.media-name::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--f, #888); margin-inline-end: 8px; }
.pill { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; }
.pill.ok { background: #e4f4ea; color: var(--ok); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.ai-card.ok { background: #f1f9f4; border-color: #cfe8d8; }
/* הודעות שגיאה: רגועות, לא אדומות */
.toast.err { background: #fff6dd; color: var(--ink); border: 1px solid #e2b84a; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.toast small { color: var(--dim); font-size: 11.5px; direction: ltr; text-align: start; word-break: break-word; }

/* ---- סרטון הסבר: מפתח AI ---- */
.kv-open { align-self: flex-start; }
#dlgKeyVideo { width: min(680px, 94vw); }
.kv-dlg { gap: 12px; }
.kv { display: flex; flex-direction: column; gap: 10px; }
.kv-stage { position: relative; height: 290px; border-radius: 14px; background: #1f1f1d; color: #f3f1ea; overflow: hidden; }
.kv-stage > * { position: absolute; transition: all .9s cubic-bezier(.3,.8,.3,1); }
.kv-app, .kv-ai { top: 78px; width: 150px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.kv-app { right: 44px; } .kv-ai { left: 44px; }
.kv-app img, .kv-brain { width: 76px; height: 76px; border-radius: 18px; }
.kv-brain { display: grid; place-items: center; background: #3a3936; font-weight: 700; font-size: 24px; letter-spacing: 1px; }
.kv-stage small { color: #a9a79e; font-size: 12px; }
.kv-wire { top: 115px; left: 190px; right: 190px; height: 0; border-top: 3px dashed #55534e; }
.kv-wire i { position: absolute; top: -3px; left: 0; height: 3px; width: 0; background: #f2c94c; transition: width 1.4s ease .6s; }
.kv-key { width: 64px; height: 32px; top: 99px; left: 80px; color: #f2c94c; opacity: 0; }
.kv-feats { left: 0; right: 0; bottom: 26px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.kv-feats span { background: #f2c94c; color: #1d1d1b; border-radius: 99px; padding: 5px 13px; font-weight: 600; font-size: 13.5px; opacity: 0; transform: translateY(14px); transition: all .5s ease; }
.kv-list { inset: 0; margin: 0; padding: 26px 46px; display: flex; flex-direction: column; justify-content: center; gap: 13px; font-size: 16.5px; opacity: 0; pointer-events: none; }
.kv-list li { opacity: 0; transform: translateX(-18px); transition: all .6s ease; }
/* סצנה 1: המפתח עובר מהשירות לתוכנה */
.kv[data-s="1"] .kv-key, .kv[data-s="2"] .kv-key { opacity: 1; left: calc(100% - 215px); }
.kv[data-s="1"] .kv-wire i, .kv[data-s="2"] .kv-wire i { width: 100%; }
/* סצנה 2: מה נדלק בתוכנה */
.kv[data-s="2"] .kv-feats span { opacity: 1; transform: none; }
.kv[data-s="2"] .kv-feats span:nth-child(2) { transition-delay: .7s; } .kv[data-s="2"] .kv-feats span:nth-child(3) { transition-delay: 1.4s; } .kv[data-s="2"] .kv-feats span:nth-child(4) { transition-delay: 2.1s; }
/* סצנות 3–4: רשימות */
.kv[data-s="3"] .kv-stage > :not(.kv-pros), .kv[data-s="4"] .kv-stage > :not(.kv-steps) { opacity: 0; }
.kv[data-s="3"] .kv-pros, .kv[data-s="4"] .kv-steps { opacity: 1; }
.kv[data-s="3"] .kv-pros li, .kv[data-s="4"] .kv-steps li { opacity: 1; transform: none; }
.kv-list li:nth-child(2) { transition-delay: 1s; } .kv-list li:nth-child(3) { transition-delay: 2s; } .kv-list li:nth-child(4) { transition-delay: 3s; }
.kv:not([data-s="3"]):not([data-s="4"]) .kv-list li { transition-delay: 0s; }
.kv-steps { font-size: 19px; }
.kv-cap { min-height: 44px; font-size: 15.5px; font-weight: 500; }
.kv-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.kv-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .6s; }
@media (prefers-reduced-motion: reduce) { .kv-stage > *, .kv-stage span, .kv-stage li, .kv-wire i { transition: none !important; } }

.keyhelp ul { margin: 4px 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }

/* ---- מבנים סיפוריים ---- */
#dlgTpl { width: min(720px, 94vw); }
.tpl-btn { border-color: var(--blue); color: var(--blue); }
.tpl-len { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 14px !important; }
.tpl-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 52vh; overflow: auto; padding: 2px; }
.tpl { text-align: start; display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); font: inherit; color: var(--ink); cursor: pointer; }
.tpl:hover { border-color: var(--blue); background: var(--blue-soft); }
.tpl b { font-size: 16px; }
.tpl > span { color: var(--dim); font-size: 13.5px; }
.tpl-beats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tpl-beats i { font-style: normal; font-size: 11.5px; background: var(--soft); border-radius: 99px; padding: 2px 8px; color: var(--ink); }
.tpl-beats i:not(:last-child)::after { content: " ‹"; color: var(--dim); }
@media (max-width: 640px) { .tpl-list { grid-template-columns: 1fr; } }

/* ---- דיבור אל העורך ---- */
.mic-btn { border: 0; background: transparent; color: var(--dim); width: 36px; height: 36px; border-radius: 50%; }
.mic-btn:hover { background: var(--soft); color: var(--ink); }
.mic-btn.on { background: #e5484d; color: #fff; animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 50% { box-shadow: 0 0 0 7px rgba(229, 72, 77, .18); } }

/* ================= פחות עומס בלוח + רציף העורך ================= */
.board-bar { top: 16px; gap: 8px; }
.board-bar .film-sum { background: rgba(255, 255, 255, .16); padding: 1px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 500; margin-inline-start: 8px; box-shadow: none; }
.board-bar .film-sum:empty { display: none; }
.more-list { min-width: 250px; }
.more-list > button { display: flex; align-items: center; gap: 8px; }
.menu-sep { font-size: 12px; color: var(--dim); padding: 9px 11px 3px; border-top: 1px solid var(--line); margin-top: 4px; }
.ver-list { display: flex; flex-direction: column; max-height: 40vh; overflow: auto; }
.board-wrap { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.board { padding-bottom: 60px; }
.board-zoom { position: absolute; top: 12px; left: 16px; z-index: 4; display: inline-flex; align-items: center; gap: 1px; background: rgba(255, 255, 255, .92); border-radius: 9px; padding: 2px 4px; font-size: 12px; color: var(--dim); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.board-zoom .btn { border: 0; background: transparent; width: 28px; min-height: 28px; height: 28px; font-size: 16px; padding: 0; }
.board-zoom #zoomVal { min-width: 38px; text-align: center; }
.board-scroll { cursor: grab; }
.board-scroll.panning { cursor: grabbing; user-select: none; }
.board-scroll .card, .board-scroll button { cursor: pointer; }
.sel-bar { top: 70px; }

:root { --night: #14213d; --night-2: #1f3158; --gold: #ffd166; }
.ask { position: relative; inset: auto; left: auto; bottom: auto; transform: none; width: auto; z-index: 6; background: var(--night); color: #fff; padding: 12px 18px 12px; gap: 9px; box-shadow: 0 -6px 18px rgba(0, 0, 0, .28); }
.ask-row { display: flex; align-items: center; gap: 12px; max-width: 980px; width: 100%; margin: 0 auto; }
.ask-who { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; color: var(--gold); white-space: nowrap; }
.ask-form { flex: 1; height: 46px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; box-shadow: none; padding: 0 6px 0 14px; padding-inline: 14px 6px; }
.ask-form:focus-within { border-color: var(--gold); background: rgba(255, 255, 255, .14); }
.ask-form input { color: #fff; font-size: 15px; }
.ask-form input::placeholder { color: rgba(255, 255, 255, .55); }
.ask-send { background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 700; min-height: 34px; }
.ask-send:hover { background: #ffdc85; }
.ask .mic-btn { color: rgba(255, 255, 255, .75); }
.ask .mic-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.ask .chips { max-width: 980px; width: 100%; margin: 0 auto; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-inline-start: 76px; }
.ask .chips::-webkit-scrollbar { display: none; }
.ask .chips:empty { display: none; }
.ask .chip { background: transparent; color: rgba(255, 255, 255, .88); border: 1px solid rgba(255, 255, 255, .28); box-shadow: none; white-space: nowrap; flex: none; padding: 5px 12px; }
.ask .chip:hover { background: var(--gold); border-color: var(--gold); color: var(--night); }
.chat-pop { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); width: min(680px, calc(100% - 36px)); margin-bottom: 12px; background: var(--night-2); color: #fff; border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px 14px 14px 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.chat-pop .pop-k { color: var(--gold); }
.chat-pop .pop-done { color: #9be8bd; }
.chat-pop .pop-x { color: #fff; background: transparent; }

/* ---- צבע לכל שלב ולכל תצוגה ---- */
:root { --c-mat: #2f6fed; --c-mat-s: #eaf1ff; --c-build: #e08a1e; --c-build-s: #fff1dc; --c-exp: #1e7d4f; --c-exp-s: #e4f4ea; --c-vio: #7a4fd6; --c-vio-s: #f0eaff; }
/* שלבים */
.steps button[data-step="materials"].on { background: var(--c-mat); }
.steps button[data-step="build"].on { background: var(--c-build); }
.steps button[data-step="export"].on { background: var(--c-exp); }
.steps button.on b { color: var(--ink); }
.steps button[data-step="materials"]:not(.on):hover { background: var(--c-mat-s); }
.steps button[data-step="build"]:not(.on):hover { background: var(--c-build-s); }
.steps button[data-step="export"]:not(.on):hover { background: var(--c-exp-s); }
/* מצבי תצוגה */
.view-switch button[data-mode="board"] { --vc: var(--c-build); --vs: var(--c-build-s); }
.view-switch button[data-mode="transcript"] { --vc: var(--c-mat); --vs: var(--c-mat-s); }
.view-switch button[data-mode="timeline"] { --vc: var(--c-vio); --vs: var(--c-vio-s); }
.view-switch button .ic { color: var(--vc); }
.view-switch button:hover { background: var(--vs); }
.view-switch button[aria-pressed="true"], .view-switch button.on { background: var(--vs); color: var(--vc); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--vc); }
/* רקע עדין לכל מסך */
#viewMaterials, #viewExport { background-repeat: no-repeat; background-size: 100% 220px; }
#viewMaterials { background-image: linear-gradient(180deg, var(--c-mat-s), transparent); }
#viewExport { background-image: linear-gradient(180deg, var(--c-exp-s), transparent); }
#viewMaterials h1, #viewExport h1 { padding-inline-start: 14px; border-inline-start: 6px solid var(--c-mat); border-radius: 2px; }
#viewExport h1 { border-color: var(--c-exp); }
/* חומרי גלם */
#viewMaterials .btn.primary, #viewMaterials .mat-next .btn.primary { background: var(--c-mat); border-color: var(--c-mat); }
#viewMaterials .btn.primary:hover { background: #2559c4; }
#viewMaterials .mat-next .btn:not(.primary) { border-color: var(--c-mat); color: var(--c-mat); }
#viewMaterials .media-item.ready, #viewMaterials .media-item { background: linear-gradient(90deg, var(--white) 70%, color-mix(in srgb, var(--f, #888) 8%, var(--white))); }
/* ייצוא: צבע לכל קבוצה */
.exp-group { --g: var(--c-exp); --gs: var(--c-exp-s); border-top: 4px solid var(--g); box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.exp-group:nth-of-type(1) { --g: var(--c-mat); --gs: var(--c-mat-s); }
.exp-group:nth-of-type(2) { --g: var(--c-vio); --gs: var(--c-vio-s); }
.exp-group:nth-of-type(3) { --g: var(--c-build); --gs: var(--c-build-s); }
.exp-group:nth-of-type(4) { --g: var(--c-exp); --gs: var(--c-exp-s); }
.exp-group h2 { color: var(--g); display: flex; align-items: center; gap: 8px; }
.exp-group h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--g); }
.exp-opts { background: var(--gs); }
.exp-row .btn { border-color: var(--g); color: var(--g); background: var(--white); }
.exp-row .btn:hover:not(:disabled) { background: var(--gs); }
.exp-row .btn.primary { background: var(--g); color: #fff; }
.exp-row .btn.primary:hover:not(:disabled) { background: var(--g); filter: brightness(.92); }
.exp-row b { color: var(--ink); }

/* ---- מדד שימוש ב-AI ---- */
.use { position: relative; flex: none; }
.use summary { list-style: none; cursor: pointer; color: rgba(255, 255, 255, .8); font-size: 12.5px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 99px; padding: 5px 11px; white-space: nowrap; }
.use summary::-webkit-details-marker { display: none; }
.use summary:hover, .use[open] summary { border-color: var(--gold); color: var(--gold); }
.use-pop { position: absolute; bottom: calc(100% + 10px); inset-inline-end: 0; width: 300px; background: var(--white); color: var(--ink); border-radius: 12px; padding: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 8px; z-index: 30; }
.use-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.use-row span:last-child { font-weight: 600; text-align: end; }
.use-pop .btn { align-self: flex-start; }

/* ---- נושאים: הסתרה מהפאנל עצמו, גרסאות, מהירות ניגון ---- */
.pool-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pool-hide { min-height: 28px; width: 28px; padding: 0; background: transparent; border-color: transparent; color: var(--dim); }
.pool-hide:hover { background: rgba(0, 0, 0, .08); color: var(--ink); }
.build:not(.mode-board) .pool-hide, .pool-show { display: none; }
.mode-board.no-pool .pool-show { display: inline-flex; }
.rate-btn { width: auto; min-width: 38px; padding: 0 6px; font-size: 12.5px; font-weight: 600; }
.rate-btn.on { background: var(--yellow); color: var(--ink); }
.menu-link { display: block; color: var(--ink); padding: 9px 11px; border-radius: 6px; text-decoration: none; }
.menu-link:hover { background: var(--soft); }

/* ---- חלוקות מסך ---- */
.lay-btn { gap: 6px; font-size: 13px; white-space: nowrap; }
.mode-board.no-ask .ask { display: none; }
.mode-transcript.tr-big .side { width: min(720px, 55vw); }
.mode-transcript.tr-noside .side { display: none; }
.mode-timeline.tl-nopool .pool, .mode-timeline.tl-nopool .splitter { display: none; }
.mode-timeline.tl-noinsp .inspector { display: none; }
/* ---- על הסרט ---- */
#dlgCtx { width: min(640px, 94vw); max-width: none; }
.dlg.ctx { max-height: 86vh; box-sizing: border-box; }
.ctx-form:focus { outline: none; }
.ctx-form { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding: 2px 2px 6px; }
.ctx-q label { font-size: 14px; font-weight: 600; color: var(--ink); gap: 6px; }
.ctx-q input, .ctx-q textarea { font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); resize: vertical; }
.ctx-q input:focus, .ctx-q textarea:focus { outline: 2px solid var(--c-build); border-color: transparent; }
.ctx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ctx-chip { background: var(--c-build-s); color: #7a4a08; border: 0; border-radius: 99px; padding: 5px 12px; font-size: 13px; }
.ctx-chip:hover { background: var(--c-build); color: #fff; }

/* תמונות בטיימליין */
.blk.cover.pic { background-size: auto 100%; background-repeat: repeat-x; background-position: right center; }
.blk.cover.pic .blk-label { background: rgba(0, 0, 0, .55); padding: 1px 6px; border-radius: 4px; }

.exp-avid-paths { margin-top: 8px; }
.exp-avid-paths summary { cursor: pointer; }
.exp-avid-source { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px; align-items: center; margin: 6px 0; }
.exp-avid-source span { overflow-wrap: anywhere; }
.exp-avid-source input { width: 100%; min-width: 0; }
.path-field { display: flex; gap: 6px; align-items: center; }
.path-field input { flex: 1; min-width: 0; }
.path-field .btn { flex: none; white-space: nowrap; }
.path-tip { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.path-tip[hidden] { display: none; }
.exp-avid-guide { margin: 6px 0 2px; font-size: 13px; }
.exp-avid-guide summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.exp-avid-guide p, .exp-avid-guide ol { margin: 6px 0; line-height: 1.6; }
.exp-avid-guide ol { padding-inline-start: 20px; }

/* Project-wide transcript search, sharing the source player. */
.search-panel, .search-detail { display: none; }
.mode-search .board-area, .mode-search .pool, .mode-search .splitter,
.mode-search .script-area, .mode-search .tl-wrap, .mode-search .inspector,
.mode-search .outline { display: none; }
.mode-search .search-panel { display: flex; flex: 1; min-width: 0; min-height: 0; flex-direction: column; background: #fafaf7; }
.search-heading { padding: 24px 28px 14px; }
.search-heading h1 { font-size: 23px; margin-bottom: 5px; }
.search-controls { padding: 0 28px 14px; border-bottom: 1px solid var(--line); }
.search-query { display: flex; align-items: center; gap: 12px; background: var(--white); border: 1px solid #b9c7bc; border-radius: 10px; padding: 5px 14px; }
.search-query input { width: 100%; min-width: 0; border: 0; padding: 11px 0; background: transparent; font-size: 17px; }
.search-query:focus-within { outline: 2px solid var(--ok); outline-offset: 2px; }
.search-query input:focus-visible { outline: none; }
.search-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.search-filters label { display: flex; flex: 1 1 110px; min-width: 0; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
.search-filters select { min-width: 0; max-width: 100%; }
.search-count { padding: 10px 28px; color: var(--dim); font-size: 13px; min-height: 38px; }
.search-results { flex: 1; min-height: 0; overflow-y: auto; padding: 0 28px 28px; }
.search-result { border: 1px solid var(--line); border-radius: 10px; background: var(--white); margin-bottom: 12px; padding: 15px 18px; }
.search-result.selected { border-color: var(--ok); box-shadow: inset -3px 0 var(--ok); }
.search-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--dim); font-size: 12px; }
.search-meta .file-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.search-used { color: var(--ok); background: #eaf5ed; padding: 2px 7px; border-radius: 4px; }
.search-open { display: flex; flex-direction: column; gap: 7px; border: 0; background: transparent; width: 100%; text-align: start; padding: 14px 0; color: var(--ink); }
.search-hit { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.search-context { color: var(--dim); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.search-hit mark { background: #fff0a1; color: inherit; border-radius: 2px; }
.search-time { font-variant-numeric: tabular-nums; margin-inline-end: auto; }
.search-empty { display: flex; align-items: center; flex-direction: column; gap: 12px; color: var(--dim); padding: 50px 20px; text-align: center; }
.search-empty p { margin: 0; }
.mode-search .side { width: clamp(300px, 32vw, 480px); flex: none; flex-direction: column; overflow-y: auto; }
.mode-search .stage { padding: 16px; flex: none; }
.mode-search .player { border-radius: 8px; overflow: hidden; }
.mode-search .search-detail { display: flex; flex-direction: column; gap: 12px; padding: 4px 20px 24px; }
.search-detail .hint { color: var(--ddim); }
.search-detail .btn.ghost { color: var(--dtext); white-space: normal; }
.search-detail .btn.primary { background: var(--ok); border-color: var(--ok); }
.search-detail label { display: flex; flex-direction: column; gap: 5px; color: var(--ddim); font-size: 12px; }
.search-detail select, .search-detail input { min-width: 0; width: 100%; background: var(--d2); border-color: #505157; color: var(--dtext); }
.search-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.search-quote { margin: 0; line-height: 1.7; max-height: 150px; overflow-y: auto; }
.search-error { margin: 0; color: #ffb4a8; font-size: 12px; }
.search-error:empty { display: none; }
@media (max-width: 1100px) {
  .top:has(#viewSwitch:not([hidden])) { flex-wrap: wrap; height: auto; min-height: 56px; padding-block: 8px; gap: 8px; }
  .top:has(#viewSwitch:not([hidden])) #viewSwitch { order: 2; }
}
@media (max-width: 760px) {
  .mode-search .b-top { overflow-y: auto; display: block; }
  .mode-search .search-panel { min-height: 360px; }
  .search-results { max-height: 50vh; flex: auto; }
  .mode-search .side { width: 100%; }
  .mode-search .stage { max-width: 460px; width: 100%; margin-inline: auto; }
  .search-heading { padding: 18px 16px 12px; }
  .search-controls, .search-results { padding-inline: 16px; }
  .search-count { padding-inline: 16px; }
}

/* מיפוי ויזואלי בכרטיס הקובץ */
.media-visual { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.scene-list { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.scene-filter { margin-bottom: 6px; }
.scene { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.scene:hover { background: var(--soft); }
.scene-t { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 12.5px; min-width: 40px; }
.scene-type { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: #e9ecef; white-space: nowrap; }
.scene-type.t-interview { background: #dbe4ff; } .scene-type.t-b-roll { background: #d3f9d8; } .scene-type.t-title, .scene-type.t-graphic { background: #fff3bf; }
.scene-d { flex: 1; font-size: 13.5px; }

/* מתג נושאים / ויזואליה ברשימת הצד */
.pool-mode { display: flex; gap: 4px; margin: 6px 0; padding: 3px; background: var(--soft); border-radius: 10px; }
.pool-mode .seg { flex: 1; border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; color: var(--dim); }
.pool-mode .seg[aria-pressed="true"] { background: var(--white); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.scene-clip { gap: 6px; }
.scene-clip .pool-title { white-space: normal; }
.mode-timeline .pool-mode { background: var(--d2); }
.mode-timeline .pool-mode .seg { color: var(--ddim); }
.mode-timeline .pool-mode .seg[aria-pressed="true"] { background: #3a3b40; color: #fff; }

.btn.tool[aria-pressed="true"] { background: #2b3a55; color: #9ec5ff; }

/* בלוח: מה יש מעל הכרטיס בערוצי הכיסוי והסאונד */
.c-layers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.c-layer { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--f) 14%, white); border: 1px solid color-mix(in srgb, var(--f) 45%, white); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.drop-cover { outline: 3px dashed #2f9e44; outline-offset: 2px; }
.scene-type { color: #1d1d1b; }

/* ייצוא וידאו */
.exp-btns { display: flex; gap: 6px; flex: none; }
.render-dlg { position: fixed; inset: auto 50% 40px auto; transform: translateX(50%); z-index: 100; background: var(--white); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35); padding: 18px 22px; width: min(420px, 92vw); display: flex; flex-direction: column; gap: 8px; }
.render-dlg h2 { font-size: 17px; margin: 0; }
.render-dlg p { margin: 0; color: var(--dim); font-size: 13px; }
.render-bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.render-bar i { display: block; height: 100%; width: 0; background: #3b6bf5; transition: width .3s; }

/* חיבור תיקייה לקבצים חסרים */
.link-folder { display: flex; align-items: center; gap: 14px; justify-content: space-between; background: #fff9db; border: 1px solid #f2c94c; border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.link-folder .hint { margin-top: 4px; text-align: start; }

/* בלוח: פס אחיזה מעל הנגן הצף, כדי להזיז אותו */
.side-grip { display: none; }
.mode-board .side-grip { display: block; height: 16px; cursor: grab; background: #26262a radial-gradient(circle, #8a8a90 1.2px, transparent 1.6px) center / 8px 8px repeat-x; touch-action: none; }
.mode-board .side-grip:active { cursor: grabbing; }

/* ---------- טלפון (מתחת ל-768px): צפייה וניגון בלבד ---------- */
.phone-note { display: none; }
@media (max-width: 767px) {
  html, body { overflow-x: hidden; }
  .phone-note { display: block; padding: 7px 16px; background: #fff3bf; color: #5c4a00; font-size: 13px; text-align: center; text-wrap: balance; border-bottom: 1px solid #f0d97a; }
  /* כותרת: שורה אחת לשם ולתפריט, שורה שנייה לשלבים ולתצוגה */
  .top, .top:has(#viewSwitch:not([hidden])) { flex-wrap: wrap; height: auto; min-height: 0; padding: 8px 16px; gap: 8px; }
  .top .brand, .top .sep, .top .spacer, #btnBackup, .agent-badge, #btnLayout, #btnUndo, #btnRedo, #status, #saveStatus,
  .steps button[data-step="export"], #viewSwitch button[data-mode="search"], #viewSwitch button[data-mode="timeline"] { display: none !important; }
  .proj-name { flex: 1; min-width: 0; width: auto; }
  .steps, .top:has(#viewSwitch:not([hidden])) #viewSwitch { order: 3; }
  .steps button { padding: 6px 10px; }
  .menu-list { inset-inline-end: 0; inset-inline-start: auto; max-width: calc(100vw - 32px); }

  /* חומרי גלם וייצוא */
  .page-wrap { padding-inline: 16px; max-width: 100%; }

  /* לוח: בלי רשימת נושאים, בלי עורך ובלי כלי עריכה; המערכות אחת מתחת לשנייה */
  .phone .pool, .phone .splitter, .phone #btnPoolShow, .phone #verMenu, .phone #moreMenu, .phone .board-zoom, .phone .ask, .phone .sel-bar,
  .phone .c-x, .phone .lane-add, .phone .lane-hint, .phone .lane-tools .btn:not(:first-child), .phone #btnSize, .phone .side-grip, .phone .tr-bar { display: none !important; }
  .phone .board { min-width: 0; width: auto !important; zoom: 1 !important; padding: 64px 16px 260px; gap: 22px; }
  .phone .board-bar { top: 12px; inset-inline: 16px; }
  .phone .lane { flex-direction: column; gap: 8px; align-items: stretch; }
  .phone .lane-tag { width: auto; transform: none; margin-top: 0; }
  .phone .lane-title, .phone .note-text { pointer-events: none; }
  .phone .lane-body { gap: 14px; min-height: 0; padding-top: 4px; }
  .phone .card { width: calc(50% - 7px); transform: none; cursor: default; }
  .phone .card.note { width: calc(50% - 7px); min-height: 0; }
  .phone .card:hover { transform: none; }
  /* נגן: פס קבוע בתחתית המסך */
  .phone .mode-board .side, .phone .mode-board .side.big { inset: auto 0 0 0 !important; width: 100%; border-radius: 12px 12px 0 0; }
  .phone .mode-board .side .screen { max-height: 38vh; }

  /* תמלול: הנגן למעלה, התמלול מתחתיו */
  .phone .mode-transcript .b-top { flex-direction: column; }
  .phone .mode-transcript .side, .phone .mode-transcript .side.big { width: 100%; order: -1; flex: none; }
  .phone .mode-transcript .outline { display: none; }
  .phone .mode-transcript .stage { padding: 0; }
  .phone .mode-transcript .stage .player { border-radius: 0; }
  .phone .mode-transcript .screen { max-height: 32vh; }
  .phone .mode-transcript .script-area { flex: 1; min-height: 0; }
  .phone .tl-wrap { display: none !important; }
}

/* חיבור AI: בחירת דרך כקלפים + כרטיס לכל שירות עם קישור ליצירת מפתח */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dlg-sub { margin: -4px 0 2px; color: var(--dim); font-size: 14px; text-wrap: balance; }
.dlg fieldset.ai-source { grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg label.src-card { flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line, #e3e0d8); border-radius: 12px; cursor: pointer; color: var(--ink); background: var(--white); transition: border-color .15s, background .15s; }
.dlg label.src-card:hover { border-color: #b9c8ec; }
.dlg label.src-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.dlg label.src-card:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.src-card input { position: absolute; opacity: 0; pointer-events: none; }
.src-ic { font-size: 20px; line-height: 1.2; }
.src-txt { display: flex; flex-direction: column; gap: 3px; }
.src-txt b { font-size: 15px; }
.src-txt small { color: var(--dim); font-size: 12.5px; line-height: 1.45; text-wrap: balance; }
.key-cards { display: flex; flex-direction: column; gap: 10px; }
.key-card { border: 1px solid var(--line, #e3e0d8); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: #fcfbf7; }
.key-card:has(input:not(:placeholder-shown)) { border-color: #9fd3b6; background: #f3fbf6; }
.kc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kc-head b { font-size: 15px; }
.kc-badge { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #eceae3; color: #55534c; white-space: nowrap; }
.kc-badge.free { background: #dff3e7; color: var(--ok); font-weight: 600; }
.kc-link { margin-inline-start: auto; text-decoration: none; font-size: 13px; padding: 5px 12px; min-height: 0; white-space: nowrap; }
.kc-note { color: var(--dim); font-size: 12.5px; line-height: 1.45; }
.dlg label.kc-field input { background: var(--white); }
.key-status:empty { display: none; }
.adv { border-top: 1px solid var(--line, #e3e0d8); padding-top: 10px; }
.adv > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); }
.adv[open] { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 560px) { .dlg fieldset.ai-source { grid-template-columns: 1fr; } }
