/* The 2026-11 look refresh — editor. Every rule starts with body.rf (see refresh-base.css). */

/* «העורך» (route editor), approved 11-10 in its own sample (memory
   design-editor-screen.md). Everything stays as today — no project header,
   ‹ back circle, 16:9 badge, dark player, tracks V1/A1/OL/FX/CC, orange
   selected clip, red playhead — except:
     1. ▶ is a round teal button;
     2. the play row floats: a capsule across the player's width;
     3. pointing at the progress bar shows that moment (film-glance.js);
     4. a thin strip of the WHOLE film over the ruler, «כל הסרט» (film-glance.js);
     5. the tools bar stands on its own between the player and the timeline,
        one white bar, thin lines between groups instead of boxes;
     6. each tool icon in a small grey circle, the word under it; a tool that
        is ON = tile and circle in one soft teal;
     7. «ייצוא» flat teal;
     8. player, tools bar and timeline: one shadow, 12px corners.
   Phones and touch screens keep their own editor (polish.css), so all of it
   is for a mouse and a wide window. */

body.rf {
  --rf-ed-bar-h: 44px; /* the tools bar standing on its own */
  --rf-ed-gap: 8px; /* the shell's gap between the three parts */
}

@media (hover: hover) and (min-width: 769px) {
  /* ── 8. the player: the same shadow and corners as the bar and the timeline ── */
  body.rf .editor-preview {
    border-radius: 12px;
    box-shadow: var(--rf-shadow);
  }

  /* ── 2. the play row floats: a rounded capsule across the player ── */
  body.rf .preview-transport {
    height: 42px;
    margin: 2px 12px 10px;
    padding: 0 8px 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    box-sizing: border-box;
  }

  /* ── 1. ▶ is a round teal button ── */
  body.rf .tr-play {
    width: 34px;
    height: 34px;
    margin-right: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--text-on-accent);
  }
  body.rf .tr-play:hover:not(:disabled) {
    background: var(--accent-hover);
  }
  body.rf .tr-play svg {
    width: 12px;
    height: 12px;
  }
  /* the triangle sits a hair right of centre so it LOOKS centred */
  body.rf .tr-play .lucide-play {
    margin-left: 2px;
  }

  /* ── 3. pointing at the progress bar: lighter fill to the pointer, a knob,
     and a small picture of that moment with «קטע N · mm:ss.ff» ── */
  /* an easier target than the 4px line itself (invisible) */
  body.rf .tr-scrub::before {
    content: "";
    position: absolute;
    inset: -8px 0;
  }
  body.rf .tr-scrub.is-hovering > .tr-scrub-hover-fill {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    pointer-events: none;
  }
  body.rf .tr-scrub.is-hovering > .tr-scrub-hover-knob {
    display: block;
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--text-on-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
  }
  /* the knob under the pointer replaces the one at the played point */
  body.rf .tr-scrub.is-hovering .tr-scrub-handle {
    opacity: 0;
  }
  body.rf .tr-scrub.is-hovering > .tr-scrub-tip {
    display: flex;
    position: absolute;
    bottom: 16px;
    z-index: 2;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transform: translateX(-50%);
    pointer-events: none;
  }
  body.rf .tr-scrub-tip-pic {
    display: block;
    border: 2px solid var(--text-on-accent);
    border-radius: 6px;
    background: black;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  }
  body.rf .tr-scrub-tip.no-pic .tr-scrub-tip-pic {
    display: none;
  }
  body.rf .tr-scrub-tip-label {
    padding: 1px 7px;
    border-radius: 5px;
    background: rgba(10, 10, 12, 0.85);
    color: var(--text-on-accent);
    font: 600 10.5px / 1.5 "SF Mono", "JetBrains Mono", Consolas, monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  /* ── 5. the tools bar stands on its own, between the player and the
     timeline. The DOM is unchanged (the bar is still the timeline's first
     child, so the old look still works): the timeline wrapper becomes
     see-through and its card is drawn by ::before, under the strip and the
     tracks only. ── */
  body.rf .editor-timeline {
    position: relative;
    isolation: isolate;
    overflow: visible;
    min-width: 0; /* overflow hidden used to hold the grid column to the window */
    gap: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body.rf .editor-timeline::before {
    content: "";
    position: absolute;
    inset: calc(var(--rf-ed-bar-h) + var(--rf-ed-gap)) 0 0 0;
    z-index: -1;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 5%, var(--surface)),
      var(--surface) 22%
    );
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--rf-shadow);
    pointer-events: none;
  }
  body.rf .editor-timeline > .tl-overview {
    margin: calc(var(--rf-ed-gap) + 1px) 1px 0;
  }
  body.rf .editor-timeline > .timeline-scroll {
    margin: 0 1px 1px;
    border-radius: 0 0 11px 11px;
  }

  /* one white bar, 12px corners, the same shadow as the other two parts */
  body.rf .timeline-tools-bar {
    --tb-h: 38px;
    height: var(--rf-ed-bar-h);
    min-height: 0;
    flex: 0 0 auto;
    gap: 0;
    padding: 0 3px 0 6px;
    box-sizing: border-box;
    background: var(--rf-card);
    border: 1px solid var(--rf-line);
    border-radius: 12px;
    box-shadow: var(--rf-shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.rf .timeline-tools-bar .tb-group {
    gap: 0;
  }
  /* no boxes: thin lines between the groups instead */
  body.rf
    .timeline-tools-bar
    :is(.tb-bpm-group, .tb-segment, .tb-zoom, .tb-history) {
    position: relative;
    height: 38px;
    margin-left: 5px;
    padding: 0 0 0 7px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  body.rf .timeline-tools-bar :is(.tb-segment, .tb-zoom, .tb-history)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 1px;
    background: var(--rf-line-2);
  }
  body.rf .timeline-tools-bar .tb-bpm-group {
    margin-left: 0;
    padding: 0;
  }
  body.rf .timeline-tools-bar .tb-bpm-group:focus-within {
    border-radius: 8px;
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  /* ── 6. the buttons: the icon in a 23px grey circle, the word under it ── */
  body.rf .timeline-tools-bar .tb-btn {
    height: 38px;
    min-width: 40px;
    padding: 1px 4px;
    gap: 2px;
    border-radius: 8px;
  }
  body.rf .timeline-tools-bar .tb-btn > .ui-icon {
    flex: none;
    justify-content: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: var(--rf-grey);
  }
  body.rf .timeline-tools-bar .tb-btn svg {
    width: 13px;
    height: 13px;
  }
  /* the words read right to left inside the left-to-right bar («סאונד AI») */
  body.rf .timeline-tools-bar .tb-btn-label {
    direction: rtl;
  }
  /* «מחק»: a light pink circle */
  body.rf .timeline-tools-bar .tb-delete-clip > .ui-icon {
    background: var(--rf-danger-soft);
  }
  /* a tool that is ON: tile and circle in one soft teal, the word bold */
  body.rf .timeline-tools-bar .tb-btn:is(.is-active, .has-value),
  body.rf .timeline-tools-bar .tb-btn:is(.is-active, .has-value):hover:not(:disabled) {
    background: var(--rf-teal-on);
    color: var(--rf-teal-ink);
    box-shadow: none;
  }
  body.rf .timeline-tools-bar .tb-btn:is(.is-active, .has-value) > .ui-icon {
    background: var(--rf-teal-on);
  }
  body.rf .timeline-tools-bar .tb-btn:is(.is-active, .has-value) .tb-btn-label {
    font-weight: 700;
    color: var(--accent);
  }

  /* undo / redo: the same circles, a little smaller */
  body.rf .timeline-tools-bar .tb-history {
    gap: 0;
  }
  body.rf .timeline-tools-bar .tb-history-btn {
    width: 28px;
    height: 38px;
    border-radius: 8px;
  }
  body.rf .timeline-tools-bar .tb-history-btn > .ui-icon {
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: var(--rf-grey);
  }
  body.rf .timeline-tools-bar .tb-history-btn svg {
    width: 13px;
    height: 13px;
  }

  /* zoom: a short slider; the bar's spare width goes before «בדיקות» */
  body.rf .timeline-tools-bar > .tb-group:has(> .tb-zoom),
  body.rf .timeline-tools-bar .tb-zoom {
    flex: 0 0 auto;
  }
  body.rf .timeline-tools-bar .tb-zoom {
    gap: 5px;
  }
  body.rf .timeline-tools-bar .tb-zoom input[type="range"] {
    flex: 0 0 36px;
    width: 36px;
  }
  body.rf .timeline-tools-bar .tb-zoom .tb-fit-all-btn {
    flex: 0 0 28px;
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    height: 38px;
    padding: 0;
  }
  body.rf .timeline-tools-bar > .tb-group:has(.tb-export) {
    gap: 4px;
    margin-inline-start: auto;
    background: var(--rf-card);
    box-shadow: -10px 0 10px -4px var(--rf-card);
  }

  /* A narrower bar (a 1280px window with the side menu) tightens the row so
     every tool, undo/redo included, still shows without scrolling. */
  @container editor-tools-bar (max-width: 1140px) {
    body.rf .timeline-tools-bar .tb-btn {
      min-width: 34px;
      padding-inline: 2px;
    }
    body.rf .timeline-tools-bar .tb-btn-label {
      font-size: 9px;
    }
    body.rf .timeline-tools-bar :is(.tb-segment, .tb-zoom, .tb-history) {
      margin-left: 3px;
      padding-left: 4px;
    }
    body.rf .timeline-tools-bar .tb-zoom input[type="range"] {
      flex-basis: 28px;
      width: 28px;
    }
  }

  /* ── 7. «ייצוא»: one flat teal, no gradient, no frame; same size and place ── */
  body.rf .timeline-tools-bar .tb-export {
    height: 34px;
    min-width: 64px;
    padding: 0 10px;
    gap: 6px;
    border: 0;
    /* the corners of the bar's tool tiles, not a pill (the user, 11-10) */
    border-radius: 8px;
    background: var(--accent);
    box-shadow: none;
    color: var(--text-on-accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
  body.rf .timeline-tools-bar .tb-export:hover {
    background: var(--accent-hover);
    box-shadow: none;
  }
  body.rf .timeline-tools-bar .tb-export svg {
    width: 13px;
    height: 13px;
  }

  /* ── 4. «כל הסרט»: the whole film in one thin strip over the ruler ── */
  body.rf .tl-overview {
    --tl-ov-empty: var(--rf-grey-2); /* a shot with no video yet */
    --tl-ov-wait: var(--text-muted); /* a video whose picture is still coming */
    display: flex;
    flex: none;
    align-items: center;
    height: 22px;
  }
  body.rf .tl-overview-label {
    flex: none;
    width: 52px;
    direction: rtl;
    text-align: center;
    font-size: 8.5px;
    font-weight: 600;
    line-height: 1;
    color: var(--text-muted);
  }
  body.rf .tl-overview-map {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 14px;
    margin-right: 4px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    touch-action: none;
  }
  body.rf .tl-overview-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
  }
  /* the part the timeline shows now: a teal frame, the rest dimmed */
  body.rf .tl-overview-window {
    position: absolute;
    top: 0;
    bottom: 0;
    min-width: 4px;
    box-sizing: border-box;
    border: 2px solid var(--accent);
    border-radius: 4px;
    box-shadow: 0 0 0 999px color-mix(in srgb, var(--rf-grey) 55%, transparent);
    pointer-events: none;
  }
  /* where the film stands */
  body.rf .tl-overview-head {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--red);
    pointer-events: none;
  }

  /* the loading skeleton follows the same layout */
  body.rf .sk-preview {
    border-radius: 12px;
  }
  body.rf .sk-transport {
    height: 42px;
    margin: 2px 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
  }
}

/* ================================================================
   «בחר מעבר» (the + between two shots on the timeline) — the user, 11-10:
   it still had the old look (heavy dark tiles, the name on a black strip, a
   thick ring). Now like the other pop-ups and the style tiles: a white card,
   grey tiles with the moving picture inside and the name under it, the chosen
   one white with a thin teal ring (its ✓ stays). Same tiles, same order.
   ================================================================ */
body.rf {
  --rf-tx-stage: #1b1e24;            /* the preview's own dark stage, both themes */
}
body.rf .tx-popover {
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--rf-card);
  box-shadow: var(--rf-pop-shadow, var(--shadow-lg));
}
body.rf .tx-popover-title {
  gap: 10px;
  margin-bottom: 8px;
}
body.rf .tx-popover-title-icon {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: var(--rf-grey);
  color: var(--text-2);
}
body.rf .tx-popover-title-main {
  font-size: 14px;
}
body.rf .tx-popover-title-sub {
  font-size: 11.5px;
  font-weight: 500;
}
body.rf .tx-family {
  margin: 10px 0 6px;
  background: var(--rf-card);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--text-3);
}
body.rf .tx-family::after {
  background: var(--rf-line);
}
body.rf .tx-family-count {
  font-size: 10.5px;
  font-weight: 500;
  opacity: 1;
  color: var(--text-muted);
}
body.rf .transition-grid {
  gap: 6px;
}
body.rf .transition-chip {
  aspect-ratio: 1.22;
  border: 0;
  border-radius: 10px;
  background: var(--rf-grey);
  box-shadow: none;
}
body.rf .transition-chip:hover {
  transform: none;
  background: var(--rf-grey-2);
}
body.rf .transition-chip.is-selected {
  background: var(--rf-card);
  box-shadow: 0 0 0 1.5px var(--accent);
}
body.rf .transition-chip.is-selected::after {
  top: 7px;
  inset-inline-end: 7px;
  box-shadow: 0 0 0 2px var(--rf-card);
}
/* the moving picture sits inside the tile, the name under it */
body.rf .transition-chip .tx-preview {
  inset: 4px 4px 22px 4px;
  border-radius: 7px;
  background: var(--rf-tx-stage);
}
body.rf .transition-chip .tx-name {
  min-height: 22px;
  padding: 0 4px;
  background: transparent;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: normal;
}
body.rf .transition-chip.is-selected .tx-name {
  color: var(--text);
  font-weight: 700;
}
body.rf .tx-popover .tx-slider-area:not(:empty) {
  border-top-color: var(--rf-line);
}

/* The tools bar on a wide screen: its spare width is shared by the tool
   buttons, a few px each (capped at 54px a button), instead of being left as
   an empty stretch before «בדיקות» (the user, 11-10: «שיהיה רווח… אבל גם לא
   להגזים»). Undo/redo, the zoom and «בדיקות / ייצוא» keep their size. */
@media (hover: hover) and (min-width: 769px) {
  body.rf .timeline-tools-bar > .tb-group:not(:last-child),
  body.rf .timeline-tools-bar .tb-segment {
    flex: 1 1 auto;
  }
  /* past the cap (very wide screens) the rest spreads evenly between them */
  body.rf .timeline-tools-bar .tb-segment {
    justify-content: space-around;
  }
  body.rf .timeline-tools-bar .tb-segment > .tb-btn {
    flex: 1 1 auto;
    max-width: 54px;
  }
}

/* The timeline zoom slider, longer where the bar has room (the user, 11-10:
   «הפס הזה… שיהיה יותר גדול»): 36px on a 1280 screen (where the bar is full),
   growing with the screen up to 84px. */
@media (hover: hover) and (min-width: 769px) {
  body.rf .timeline-tools-bar .tb-zoom input[type="range"] {
    --rf-zoom-w: clamp(36px, calc((100vw - 1300px) * 0.25 + 36px), 84px);
    flex: 0 0 var(--rf-zoom-w);
    width: var(--rf-zoom-w);
  }
}
