/* חותך סרטונים · סגנון "כהה ונועז" (bold-dark) */
:root {
  --bg: #0C0C0F;
  --surface: #18181D;
  --surface-2: #232329;
  --text: #F4F4F6;
  --muted: #9A9AA5;
  --line: #2B2B33;
  --accent: #FFE14D;
  --on-accent: #111111;
  --red: #FF5A5F;
  --green: #3DDC97;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 12px 30px rgb(0 0 0 / .35);
  --font-head: 'Rubik', 'Heebo', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.55 'Heebo', system-ui, sans-serif; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
main { max-width: 640px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.15; }
h1 { font-size: 30px; font-weight: 900; }
h2 { font-size: 21px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
button { font: inherit; color: inherit; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* כותרת עליונה */
.top { display: flex; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 14px; }
.top .grow { flex: 1; min-width: 0; }
.top h1 { overflow-wrap: anywhere; }
.icon-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; flex: none; text-decoration: none; color: var(--text); }
.icon-btn:active { transform: scale(.96); }

/* כפתורים */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 0; border-radius: 999px; font-weight: 800; font-size: 16px; cursor: pointer; text-decoration: none; background: var(--surface-2); color: var(--text); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px rgb(255 225 77 / .22); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }

/* כרטיס ראשי לבחירת סרטון */
.hero { position: relative; overflow: hidden; padding: 26px 22px; border-radius: var(--radius-lg); background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.hero h2 { font-size: 26px; font-weight: 900; }
.hero p { margin-top: 6px; font-weight: 500; }
.hero .btn { margin-top: 18px; background: #111; color: var(--accent); box-shadow: none; }
.hero .deco { position: absolute; inset-inline-end: -34px; top: -38px; width: 150px; height: 150px; opacity: .13; stroke: #111; stroke-width: 1.4; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stack { display: grid; gap: 12px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 10px; }

/* חיפוש */
.search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }

/* רשימת פרויקטים */
.proj { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.proj .thumb { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); color: var(--accent); flex: none; }
.proj .meta { flex: 1; min-width: 0; }
.proj b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj small { color: var(--muted); font-size: 14px; }
.proj mark { background: rgb(255 225 77 / .25); color: var(--text); border-radius: 4px; padding: 0 2px; }
.snippet { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 30px 18px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--radius); }

/* התקדמות */
.progress { padding: 22px; }
.steps { display: grid; gap: 14px; margin-top: 18px; }
.step { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.step .dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; border: 2px solid var(--line); flex: none; font-weight: 800; font-size: 14px; }
.step.on { color: var(--text); font-weight: 700; }
.step.on .dot { border-color: var(--accent); color: var(--accent); }
.step.done .dot { background: var(--green); border-color: var(--green); color: #0C0C0F; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 18px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s; }

/* סיכום פרויקט */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px; text-align: center; }
.kpi b { display: block; font-family: var(--font-head); font-size: 26px; font-weight: 900; direction: ltr; }
.kpi small { color: var(--muted); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.label { font-weight: 700; margin-bottom: 8px; display: block; }

/* נושא */
.topic { padding: 0; overflow: hidden; }
.topic-head { padding: 18px 18px 14px; }
.topic-num { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 900; font-size: 15px; margin-inline-end: 8px; }
.topic-title { display: flex; align-items: flex-start; gap: 4px; }
.topic-title h3 { flex: 1; outline: 0; border-radius: 8px; padding: 2px 4px; margin: 2px -4px 0; }
.topic-title h3:focus { background: var(--surface-2); }
.topic .sum { margin-top: 8px; color: var(--muted); }
.times { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 15px; flex-wrap: wrap; }
.times .was { color: var(--muted); text-decoration: line-through; }
.times .now { font-weight: 800; color: var(--green); }
.topic-actions { display: flex; gap: 8px; padding: 0 18px 18px; flex-wrap: wrap; }
.topic-actions .btn { flex: 1 1 130px; }
.result { padding: 0 18px 18px; display: grid; gap: 10px; }
.result video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
.mini-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.mini-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* תמלול בתוך נושא */
details.tr { border-top: 1px solid var(--line); }
details.tr summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 0 18px; cursor: pointer; font-weight: 700; }
details.tr summary::-webkit-details-marker { display: none; }
details.tr[open] summary .chev { transform: rotate(180deg); }
.tr-hint { padding: 0 18px 8px; font-size: 14px; color: var(--muted); }
.lines { padding: 0 10px 14px; display: grid; gap: 2px; }
.line { display: flex; align-items: flex-start; gap: 6px; border-radius: 12px; }
.line .say { flex: 1; text-align: right; min-height: 48px; padding: 10px; border: 0; background: transparent; cursor: pointer; border-radius: 12px; line-height: 1.5; }
.line .say:active { background: var(--surface-2); }
.line .t { display: block; color: var(--muted); font-size: 13px; line-height: 1.2; margin-bottom: 2px; }
.line.off .say { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--red); }
.line.off .say::after { content: 'יורד'; margin-inline-start: 8px; font-size: 12px; font-weight: 800; color: var(--red); text-decoration: none; display: inline-block; }
.line .split { width: 44px; height: 44px; margin-top: 2px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.line .split:active { background: var(--surface-2); color: var(--accent); }
.line .split svg { width: 18px; height: 18px; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius); background: rgb(255 225 77 / .1); border: 1px solid rgb(255 225 77 / .35); }
.notice svg { color: var(--accent); margin-top: 2px; }
.notice.err { background: rgb(255 90 95 / .1); border-color: rgb(255 90 95 / .4); }
.notice.err svg { color: var(--red); }

/* הגדרות */
.field { display: grid; gap: 8px; }
.field input { height: 54px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; direction: ltr; text-align: left; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
ol.guide { margin: 0; padding-inline-start: 22px; display: grid; gap: 10px; }
ol.guide li::marker { font-weight: 900; color: var(--accent); }
a { color: var(--accent); }
.ok { color: var(--green); font-weight: 800; }

#toast { position: fixed; inset-inline: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; padding: 14px 18px; border-radius: 16px; background: #F4F4F6; color: #111; font-weight: 700; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 12px; opacity: 0; transform: translateY(20px); pointer-events: none; transition: .25s; z-index: 50; }
#toast.show { opacity: 1; transform: none; pointer-events: auto; }
#toast button { border: 0; background: transparent; font-weight: 900; color: #111; text-decoration: underline; min-height: 40px; cursor: pointer; }

@media (min-width: 760px) {
  main { padding-top: 32px; }
  h1 { font-size: 36px; }
}
