/* ============================================================
   The editor's «כלים» windows — ONE frame (js/views/editor/tool-window.js).
   «אחד לוק», «חידוד», «בדיקת הסרט», «סרטונים חסומים» share: the same width,
   the shared head, ONE white card with a status line (progress bar on its
   edge while working) and a list of identical rows, the shared foot.
   Loading = «ג · מופיעות אחת אחת»: finished rows fade in once, one framed
   «בודק…» row under them. Chosen by the user 2026-11-11.
   Tokens only, so dark mode follows.
   ============================================================ */

/* the box: one width for every tool window */
body.rf .modal-backdrop > #modalBox:has(> .tw-modal) {
  width: min(920px, calc(100vw - 32px));
  max-width: min(920px, calc(100vw - 32px));
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.rf .modal .tw-modal {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-height: inherit;
  direction: rtl;
}

/* the card: status line on top, the list scrolls */
body.rf .modal .tw-modal > .modal-body.tw-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0; /* main.css gives every .modal-body a gap: here it sat between the status line and the list */
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
body.rf .modal .tw-status {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rf-line);
}
body.rf .modal .tw-status-text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text-2);
}
body.rf .modal .tw-status-text b {
  color: var(--text);
  font-weight: 600;
}
body.rf .modal .tw-prog {
  position: absolute;
  inset: auto 0 -1px 0;
  height: 3px;
  background: color-mix(in srgb, var(--accent-bright) 14%, transparent);
}
body.rf .modal .tw-prog > i {
  display: block;
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: var(--accent-bright);
  transition: width 0.4s ease;
}
body.rf .modal .tw-filter {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--rf-grey);
}
body.rf .modal .tw-filter[hidden] {
  display: none;
}
body.rf .modal .tw-filter-btn {
  padding: 4px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
body.rf .modal .tw-filter-btn[aria-pressed="true"] {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: var(--rf-raise);
  font-weight: 600;
}
body.rf .modal .tw-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
  min-height: 120px;
  padding: 12px;
  overflow: auto;
}
/* a scrolling flex column must not squeeze its rows to their min-height
   (taller rows - captions, wrapped phone rows - then overlap the next) */
body.rf .modal .tw-list > * {
  flex-shrink: 0;
}
body.rf .modal .tw-grp {
  padding: 4px 4px 0;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}

/* THE row */
body.rf .modal .tw-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .modal .tw-row.is-now {
  background: var(--rf-card);
  box-shadow: inset 0 0 0 1.5px var(--accent-bright);
}
body.rf .modal .tw-row.is-muted {
  opacity: 0.6;
}
body.rf .modal .tw-row.is-click {
  cursor: pointer;
}
body.rf .modal .tw-row.is-click:hover {
  box-shadow: inset 0 0 0 1px var(--rf-line);
}
body.rf .modal .tw-appear {
  animation: tw-appear 0.45s ease both;
}
@keyframes tw-appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
body.rf .modal .tw-cb {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
body.rf .modal .tw-th {
  position: relative;
  display: block;
  flex: none;
  width: 96px;
  height: 54px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--rf-grey-2, var(--rf-grey)) center / cover no-repeat;
}
body.rf .modal .tw-th :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.rf .modal .tw-th--icon {
  display: grid;
  place-items: center;
  color: var(--text-3);
}
body.rf .modal .tw-pair {
  display: flex;
  flex: none;
  gap: 3px;
}
body.rf .modal .tw-th--pair {
  width: 76px;
  height: 43px;
}
/* RTL: the first picture is on the right, so its outer corners are on the right */
body.rf .modal .tw-pair > .tw-th:first-child {
  border-radius: 3px 8px 8px 3px;
}
body.rf .modal .tw-pair > .tw-th:last-child {
  border-radius: 8px 3px 3px 8px;
}
body.rf .modal .tw-txt {
  flex: 1;
  min-width: 0;
}
body.rf .modal .tw-t {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
body.rf .modal .tw-s {
  color: var(--text-2);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
body.rf .modal .tw-side {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}
body.rf .modal .tw-side .btn {
  min-height: 0;
  padding: 6px 12px;
  font-size: 12.5px;
}
/* the soft teal «תקן» */
/* (--rf-teal-bar is almost the rows' own grey in the site's colours, so the
   soft teal is mixed from the accent instead - visible on any row) */
body.rf .modal .tw-side .tw-btn-soft {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent-bright) 20%, var(--rf-card));
  color: var(--rf-teal-ink);
  font-weight: 600;
}
body.rf .modal .tw-side .tw-btn-soft:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-bright) 28%, var(--rf-card));
}

/* small parts */
body.rf .modal .tw-shim {
  position: relative;
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--rf-grey-2, var(--rf-grey));
}
body.rf .modal .tw-row.is-now .tw-shim {
  background: var(--rf-grey);
}
body.rf .modal .tw-shim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    color-mix(in srgb, var(--rf-card) 80%, transparent) 50%,
    transparent 80%
  );
  transform: translateX(100%);
  animation: tw-sweep 1.4s ease-in-out infinite;
}
@keyframes tw-sweep {
  to {
    transform: translateX(-100%);
  }
}
body.rf .modal .tw-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
}
body.rf .modal .tw-dot--ring {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--text-2);
}
body.rf .modal .tw-dot--light {
  background: var(--text-3);
  opacity: 0.45;
}
body.rf .modal .tw-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--rf-card);
  box-shadow: var(--rf-raise);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}
body.rf .modal .tw-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12.5px;
}
body.rf .modal .tw-warn {
  color: var(--orange);
  font-size: 12.5px;
  font-weight: 600;
}
body.rf .modal .tw-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 12px;
  color: var(--text-2);
  text-align: center;
}
body.rf .modal .tw-empty-ic {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rf-grey);
  color: var(--accent);
}

@media (max-width: 700px) {
  body.rf .modal .tw-row {
    flex-wrap: wrap;
  }
  body.rf .modal .tw-side {
    flex-wrap: wrap;
    width: 100%;
  }
  body.rf .modal .tw-th {
    width: 80px;
    height: 45px;
  }
}

/* ── אחד לוק (unify-look.js) ── */
/* a row is taller than 70px here (pictures + captions): never squeeze it
   when the list scrolls (min-height:70px would let flex shrink it) */
body.rf .modal .tw-unify .tw-list > .tw-row {
  flex-shrink: 0;
}
/* the side: «לפני» picture ← «אחרי» picture, each with a tiny caption */
body.rf .modal .tw-unify .tw-ul-pic {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
body.rf .modal .tw-unify .tw-ul-cap {
  color: var(--text-3);
  font-size: 11px;
  line-height: 14px;
}
/* centred on the pictures, not on pictures + captions */
body.rf .modal .tw-unify .tw-ul-arrow {
  display: grid;
  flex: none;
  place-items: center;
  margin-bottom: 17px;
  color: var(--text-3);
}
/* a picture still coming: the soft sweep in the picture's own size */
body.rf .modal .tw-unify .tw-shim.tw-ul-shim {
  width: 96px !important;
  height: 54px;
  border-radius: 8px;
}
body.rf .modal .tw-unify .tw-ul-note {
  color: var(--text-2);
  font-size: 12.5px;
}
@media (max-width: 700px) {
  body.rf .modal .tw-unify .tw-shim.tw-ul-shim {
    width: 80px !important;
    height: 45px;
  }
}

/* ── חידוד (enhance-clips.js) ── */
/* a long title can wrap: never squeeze a row when the list scrolls */
body.rf .modal .tw-sharpen .tw-list > .tw-row {
  flex-shrink: 0;
}
/* status line: sentence · «הכל / רק המומלצים» · «נקה» · one tool for the ticked */
body.rf .modal .tw-sharpen .sharp-bulk {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}
body.rf .modal .tw-sharpen .sharp-bulk[hidden] {
  display: none;
}
body.rf .modal .tw-sharpen .sharp-clear {
  padding: 5px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
body.rf .modal .tw-sharpen .sharp-clear:hover {
  background: var(--rf-grey);
  color: var(--text);
}
body.rf .modal .tw-sharpen .sharp-bulk .cselect-trigger {
  width: 178px;
  min-height: 0;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12.5px;
}
/* the row: «640×360» + the verdict pill; on the side the tool and its price */
body.rf .modal .tw-sharpen .sharp-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
body.rf .modal .tw-sharpen .sharp-res {
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
}
body.rf .modal .tw-sharpen .sharp-busy {
  color: var(--text);
  font-weight: 600;
}
body.rf .modal .tw-sharpen .tw-row .cselect-trigger {
  width: 236px;
  min-height: 0;
  padding: 7px 11px;
  border-radius: 10px;
  background-color: var(--rf-card);
  font-size: 12.5px;
}
body.rf .modal .tw-sharpen .tw-row .cselect-trigger:hover:not(:disabled) {
  background-color: var(--rf-card);
  box-shadow: var(--rf-raise);
}
body.rf .modal .tw-sharpen .tw-row .cselect-trigger:disabled {
  cursor: default;
  opacity: 0.7;
}
body.rf .modal .tw-sharpen .sharp-price {
  min-width: 42px;
  color: var(--rf-teal-ink);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: left;
  unicode-bidi: isolate;
}
/* the foot: replace-in-timeline · «4 מסומנים · כ־$0.10» */
body.rf .modal .tw-sharpen .sharp-replace {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
body.rf .modal .tw-sharpen .sharp-sum {
  color: var(--text-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 700px) {
  body.rf .modal .tw-sharpen .tw-status {
    flex-wrap: wrap;
  }
  body.rf .modal .tw-sharpen .tw-row .cselect-trigger {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
}

/* ── בדיקת הסרט (continuity-review.js + editor.js) ── */
/* a long sentence can wrap: never squeeze a row when the list scrolls */
body.rf .modal :is(.cr-win, .cr-panel) .tw-list > :is(.tw-row, .tw-grp) {
  flex-shrink: 0;
}
/* «תקן» on a row: the soft teal is the row's own grey in the planning
   colours, so it gets a touch more teal to read as a button */
body.rf .modal :is(.cr-win, .cr-panel) .tw-side .tw-btn-soft {
  background: color-mix(in srgb, var(--accent-bright) 20%, var(--rf-card));
}
body.rf .modal :is(.cr-win, .cr-panel) .tw-side .tw-btn-soft:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-bright) 28%, var(--rf-card));
}
/* «הראה», «בדוק שוב», «החזר כמו שהיה»: the icon close to its word */
body.rf .modal :is(.cr-win, .cr-panel) .tw-side .btn,
body.rf .modal .cr-win .modal-foot-side .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
/* the export modal's slim panel: the same status line and rows, no frame */
body.rf .modal .export-check-panel.cr-panel {
  overflow: hidden;
  background: var(--rf-card);
}
/* the export window is narrow: the sentence keeps its line, the buttons
   go under it when they do not fit beside it */
body.rf .modal .cr-panel > .tw-status {
  flex: none;
  flex-wrap: wrap;
  row-gap: 6px;
  min-height: 46px;
  padding: 8px 14px 8px 8px;
}
body.rf .modal .cr-panel > .tw-status > .tw-status-text {
  flex: 1 1 240px;
}
body.rf .modal .cr-panel > .tw-status > .tw-side {
  margin-inline-start: auto;
}
body.rf .modal .cr-panel > .tw-list {
  min-height: 0;
  padding: 10px;
}
body.rf .modal .cr-panel .tw-status > .tw-side .export-check-close {
  margin: 0;
}
/* the export form stays in view above the panel: with a 0 basis (editor.css)
   it collapsed to nothing in a window of no fixed height */
body.rf .modal .export-modal.has-export-check .export-body {
  flex: 1 1 auto;
}

/* ── ייצוא (export.js) ──
   User, 2026-11-11: everything must fit without scrolling (it overflowed by
   ~65px at his 1520×782), and the problems found at the «ייצא» click are ONE
   short line (.export-check-bar) whose button opens «בדיקת הסרט». Rows with a
   choice of buttons put their name BESIDE the buttons instead of above. */
body.rf .modal .export-info-area {
  padding: 10px 14px;
}
body.rf .modal .export-source-match {
  margin: 8px 12px 0;
  padding: 6px 10px;
  line-height: 1.35;
}
body.rf .modal .export-controls {
  padding: 10px 18px 12px;
}
body.rf .modal .export-controls .export-form-row:has(> .export-segment) {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  padding: 6px 0;
}
body.rf .modal .export-controls .export-form-row:has(> .export-segment) > .export-form-label {
  grid-column: 1;
}
body.rf .modal .export-controls .export-form-row:has(> .export-segment) > :not(.export-form-label) {
  grid-column: 2;
}
body.rf .modal .export-controls .export-form-row:has(> .export-segment) > .export-mode-hint {
  margin-top: 0;
}
body.rf .modal .export-advanced {
  margin-top: 2px;
  padding-top: 2px;
}
body.rf .modal .export-advanced .export-form-row:first-child {
  padding-top: 6px;
}
body.rf .modal .export-opt {
  margin: 6px 0 0;
}
/* the one line about problems, between the card and the buttons */
body.rf .modal .export-check-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 12px 0;
  padding: 8px 10px 8px 8px;
  border-radius: 12px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
  color: var(--text);
  font-size: 13px;
}
body.rf .modal .export-check-bar[hidden] {
  display: none;
}
body.rf .modal .export-check-bar-icon {
  display: grid;
  flex: none;
  place-items: center;
  color: var(--orange);
}
body.rf .modal .export-check-bar-text {
  flex: 1;
  min-width: 0;
}
body.rf .modal .export-check-bar-open {
  flex: none;
  min-height: 0;
  padding: 5px 10px;
  font-size: 12.5px;
}
