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

   ONE frame for every window (approved 11-10, sample «חלונות»):
   - head: an icon in a small square · the name · ONE short line · the X;
   - foot, always the same order: side things on the start side (a thin
     hairline between them) · «ביטול» · the main button at the far end (left
     in RTL); red only for deleting;
   - a message / confirm (.modal--msg, confirmDialog) = «לבן»: a plain white
     window, icon in a grey square, no lines;
   - everything else = «ג»: the whole window light grey, the head and the foot
     on the grey (icon square, X and «ביטול» white) and the content in ONE
     white card, with grey fields and tiles inside it; chosen = white raised,
     or white + a teal ring for pictures / tiles.
   The shared markup comes from utils.js modalHead() / modalFoot(); the rules
   below also dress the windows that still build their own head or foot. */

body.rf {
  --win-shadow: 0 24px 70px rgba(10, 22, 40, 0.28);
  --win-card-shadow: 0 1px 3px rgba(14, 28, 48, 0.08);
  --win-pad: 22px;
}
[data-theme="dark"] body.rf {
  --win-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  --win-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ═════════════ the frame ═════════════ */
body.rf .modal-backdrop {
  background: var(--rf-backdrop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.rf .modal {
  padding: 0;
  color: var(--text);
}
/* The frame's colour, corners and shadow win over every window's own
   `.modal.modal-lg:has(.x)` rule (those set a white background): `:is()` with
   an id takes the id's weight, whichever of its parts matched. */
body.rf .modal-backdrop > :is(.modal, #modalBox) {
  border: 0;
  border-radius: 20px;
  background: var(--rf-grey);
  box-shadow: var(--win-shadow);
}

/* ═════════════ the head: icon · name + one line · X ═════════════ */
body.rf .modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
  padding: 18px var(--win-pad);
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .modal-head-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--rf-card);
  color: var(--text-2);
}
body.rf .modal .modal-head-icon .ui-icon,
body.rf .modal .modal-head-icon svg {
  width: 18px;
  height: 18px;
}
body.rf .modal .modal-head-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
body.rf .modal .modal-header .modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
}
body.rf .modal .modal-header .modal-sub {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-3);
}
body.rf .modal .modal-head-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
body.rf .modal .modal-header .modal-close,
body.rf .modal .modal-close {
  flex: none;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rf-card);
  color: var(--text-3);
  box-shadow: none;
}
body.rf .modal .modal-close:hover {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: var(--rf-raise);
}
body.rf .modal .modal-close .ui-icon,
body.rf .modal .modal-close svg {
  width: 14px;
  height: 14px;
}
/* the X always sits at the far end, whatever comes before it */
body.rf .modal .modal-header > .modal-close {
  margin-inline-start: auto;
}
body.rf .modal .modal-header > .modal-head-copy + .modal-close,
body.rf .modal .modal-header > .modal-head-actions + .modal-close {
  margin-inline-start: 0;
}

/* ═════════════ the content: ONE white card ═════════════ */
body.rf .modal .modal-body {
  margin: 0 12px;
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .modal-body:last-child {
  margin-bottom: 12px;
}

/* ═════════════ the foot: side things · ביטול · the main button ═════════════ */
body.rf .modal .modal-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 14px var(--win-pad);
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .modal-foot-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
body.rf .modal .modal-foot-line {
  flex: none;
  width: 1px;
  height: 22px;
  background: var(--rf-line-2);
}
body.rf .modal .modal-foot-sp {
  flex: 1 1 auto;
}
body.rf .modal .modal-footer > .btn,
body.rf .modal .modal-footer .modal-footer-extra-actions > .btn {
  min-height: 40px;
  height: auto;
  padding: 8px 20px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
body.rf .modal .modal-footer > .btn-secondary,
body.rf .modal .modal-footer .modal-footer-extra-actions > .btn-secondary {
  border: 0;
  background: var(--rf-card);
  color: var(--text);
  box-shadow: var(--rf-raise);
  font-weight: 600;
}
body.rf .modal .modal-footer > .btn-secondary:hover:not(:disabled),
body.rf .modal .modal-footer .modal-footer-extra-actions > .btn-secondary:hover:not(:disabled) {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--rf-line-2), var(--rf-raise);
}
body.rf .modal .modal-cancel,
body.rf .modal .modal-footer > .modal-cancel {
  flex: none;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 11px;
  background: var(--rf-card);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}
body.rf .modal .modal-cancel:hover:not(:disabled) {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: var(--rf-raise);
}
body.rf .modal .modal-footer .btn-danger {
  background: var(--red);
  color: var(--text-on-accent);
}
/* several answers: each keeps its own width and wraps only when the row is
   too narrow; «ביטול» never shrinks */
body.rf .modal .modal-footer:has(.modal-footer-extra-actions) > .btn,
body.rf .modal .modal-footer .modal-footer-extra-actions > .btn {
  flex: 0 1 auto;
  min-width: 0;
  white-space: normal;
}
body.rf .modal .modal-footer:has(.modal-footer-extra-actions) > .modal-cancel,
body.rf .modal .modal-footer:has(.modal-footer-extra-actions) > .modal-foot-side {
  flex: none;
}

/* ═════════════ «לבן»: a message / confirm ═════════════ */
body.rf .modal-backdrop > :is(.modal--msg, #modalBox.modal--msg) {
  background: var(--rf-card);
}
body.rf .modal.modal--msg .modal-head-icon,
body.rf .modal.modal--msg .modal-close,
body.rf .modal.modal--msg .modal-cancel,
body.rf .modal.modal--msg .modal-footer > .btn-secondary,
body.rf .modal.modal--msg .modal-footer .modal-footer-extra-actions > .btn-secondary {
  background: var(--rf-grey);
  box-shadow: none;
}
body.rf .modal.modal--msg .modal-close:hover,
body.rf .modal.modal--msg .modal-cancel:hover:not(:disabled),
body.rf .modal.modal--msg .modal-footer > .btn-secondary:hover:not(:disabled),
body.rf .modal.modal--msg .modal-footer .modal-footer-extra-actions > .btn-secondary:hover:not(:disabled) {
  background: var(--rf-grey-2);
  box-shadow: none;
}
body.rf .modal.modal--msg .modal-body {
  margin: 0;
  padding: 4px var(--win-pad) 18px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal.modal--msg .modal-body:last-child {
  margin-bottom: 0;
}
body.rf .modal.modal--msg .modal-body > p {
  line-height: 1.7 !important; /* confirmDialog writes 1.6 inline */
}

/* ═════════════ menus: a list to choose from (תיקון) ═════════════ */
body.rf .modal .frame-fix-chooser-list {
  gap: 8px;
}
body.rf .modal .frame-fix-chooser-btn {
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--rf-grey);
  box-shadow: none;
}
body.rf .modal .frame-fix-chooser-btn:hover {
  background: var(--rf-card);
  box-shadow: 0 0 0 1.5px var(--accent);
}
body.rf .modal .frame-fix-chooser-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--rf-card);
  color: var(--accent);
}
body.rf .modal .frame-fix-chooser-btn:hover .frame-fix-chooser-ico {
  background: var(--rf-grey);
}
body.rf .modal .frame-fix-chooser-label {
  font-size: 14px;
  font-weight: 700;
}
body.rf .modal .frame-fix-chooser-hint {
  font-size: 12.5px;
  color: var(--text-3);
}
body.rf .modal .frame-fix-chooser-go {
  flex: none;
  color: var(--text-muted);
}

/* ═════════════ inside the white card: grey fields, grey tiles ═════════════ */
body.rf .modal .input,
body.rf .modal .textarea,
body.rf .modal .select,
body.rf .modal .cselect-trigger {
  border-color: transparent;
  border-radius: 11px;
  background-color: var(--rf-grey);
  box-shadow: none;
}
body.rf .modal .input:hover,
body.rf .modal .textarea:hover,
body.rf .modal .select:hover,
body.rf .modal .cselect-trigger:hover:not(:disabled) {
  border-color: transparent;
  background-color: var(--rf-grey-2);
}
body.rf .modal .input:focus,
body.rf .modal .textarea:focus,
body.rf .modal .select:focus,
body.rf .modal .cselect-trigger.open {
  border-color: var(--accent);
  background-color: var(--rf-card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
body.rf .modal .input-big {
  min-height: 46px;
  font-size: 16px;
}

/* a choice tile (style, route, season…): grey; chosen = white + a teal ring */
body.rf .modal .style-choice {
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
  box-shadow: none;
}
body.rf .modal .style-choice:hover:not(.active) {
  border: 0;
  background: var(--rf-grey-2);
}
body.rf .modal .style-choice.active {
  border: 0;
  background: var(--rf-card);
  box-shadow: 0 0 0 2px var(--accent);
}
body.rf .modal .style-choice.active .style-choice-label {
  color: var(--text);
}
body.rf .modal .style-choice.active .style-choice-swatch {
  border-color: transparent;
  box-shadow: none;
}
body.rf .modal .style-section-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
body.rf .modal .style-prefs-grid {
  border-top: 0;
}

/* ═════════════ form sheets: פרויקט חדש · קבוצה חדשה · הגדרות קבוצה · העברה לקבוצה ═════════════ */
body.rf .modal .form-sheet-header {
  padding: 18px var(--win-pad);
  border-bottom: 0;
}
body.rf .modal .form-sheet-heading.form-sheet-heading--icon {
  gap: 12px;
}
body.rf .modal .form-sheet-title-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--rf-card);
  color: var(--text-2);
}
body.rf .modal .form-sheet-heading-copy {
  gap: 1px;
}
body.rf .modal .form-sheet-sub {
  font-size: 12.5px;
  color: var(--text-3);
}
body.rf .modal .form-sheet-body {
  margin: 0 12px;
  padding: 18px;
  gap: 22px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .form-sheet-body:last-child {
  margin-bottom: 12px;
}
body.rf .modal .form-sheet-sec {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .form-sheet-sec-title {
  font-size: 13.5px;
}
body.rf .modal .form-sheet-sec-sub {
  font-size: 12px;
}
body.rf .modal .form-sheet-footer {
  padding: 14px var(--win-pad) max(14px, env(safe-area-inset-bottom, 14px));
  border-top: 0;
  background: transparent;
}
body.rf .modal .form-sheet-pill {
  min-height: 32px;
  border: 0;
  background: var(--rf-grey);
  color: var(--text-2);
  font-weight: 600;
}
body.rf .modal .form-sheet-pill:hover:not(.active) {
  border: 0;
  background: var(--rf-grey-2);
  color: var(--text);
}
body.rf .modal .form-sheet-pill.active {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: 0 0 0 1.5px var(--accent);
}
body.rf .modal .form-sheet-note {
  border: 0;
  border-radius: 11px;
  background: var(--rf-grey);
  color: var(--text-2);
}
body.rf .modal .form-sheet-note .ui-icon {
  color: var(--text-3);
}
/* the group's own boxes (characters, places, pictures) sit as grey tiles */
body.rf .modal .gsetup-cat {
  border: 0;
  border-radius: 14px;
  background: var(--rf-grey);
}
body.rf .modal .gsetup-composer {
  border-color: var(--rf-line-2);
  background: var(--rf-card);
}

/* «העברה לקבוצה»: grey tiles, the group's circle in its folder colour, the
   current group white + a teal ring + ✓ */
body.rf .modal .gpick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
body.rf .modal .gpick-tile {
  gap: 2px;
  padding: 14px 6px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--rf-grey);
}
body.rf .modal .gpick-tile:hover:not(.active) {
  background: var(--rf-grey-2);
}
body.rf .modal .gpick-tile.active {
  border: 0;
  background: var(--rf-card);
  box-shadow: 0 0 0 2px var(--accent);
}
body.rf .modal .gpick-avatar-wrap {
  margin-bottom: 6px;
}
body.rf .modal .gpick-avatar {
  width: 52px;
  height: 52px;
  border: 0;
  box-shadow: none;
  background: hsl(var(--gpick-hue, 210) var(--rf-g-s) var(--rf-g-l));
}
body.rf .modal .gpick-tile.active .gpick-avatar {
  border: 0;
}
body.rf .modal .gpick-initial {
  font-size: 20px;
  text-shadow: none;
}
body.rf .modal .gpick-avatar--none {
  border: 1.5px dashed var(--rf-line-2);
  background: transparent;
  color: var(--text-muted);
}
body.rf .modal .gpick-tile .gpick-avatar--new {
  border: 0;
  background: var(--rf-card);
  color: var(--accent);
}
body.rf .modal .gpick-check {
  inset-block-end: -2px;
  inset-inline-end: -2px;
  width: 20px;
  height: 20px;
  border: 0;
  box-shadow: 0 0 0 2px var(--rf-card);
}
body.rf .modal .gpick-name {
  font-size: 13px;
  font-weight: 700;
}
body.rf .modal .gpick-tile.active .gpick-name {
  color: var(--text);
}
body.rf .modal .gpick-sub {
  font-size: 11.5px;
}

/* «קבוצה חדשה»: the circle the group will get, drawn while its name is typed */
body.rf .modal .ngroup-avatar {
  border: 0;
  box-shadow: none;
}
body.rf .modal .ngroup-avatar.gpick-avatar--new {
  border: 1.5px dashed var(--rf-line-2);
  background: var(--rf-grey);
}

/* ═════════════ the form inside the card: labels, «הצעות» links ═════════════ */
body.rf .modal .modal-body .field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
body.rf .modal .modal-body .field-label-row .btn-ghost {
  padding: 2px 4px;
  min-height: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
body.rf .modal .modal-body .field-label-row .btn-ghost:hover:not(:disabled) {
  background: transparent;
  color: var(--accent-hover, var(--accent));
  text-decoration: underline;
}
body.rf .modal:has(> .speech-creator) {
  max-width: 560px;
}
body.rf .modal .speech-creator-body {
  gap: 16px;
}
body.rf .modal .speech-creator-body .cselect-trigger {
  min-height: 42px;
  padding-inline: 14px;
  font-weight: 600;
}
body.rf .modal .speech-creator-body .textarea {
  min-height: 78px;
}
body.rf .modal .speech-creator-result {
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .modal .speech-creator-footer {
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 0;
}
body.rf .modal .speech-price {
  margin-inline-end: 4px;
}

/* ═════════════ the lightbox: a picture with a quiet head ═════════════ */
body.rf .modal-backdrop > :is(.modal, #modalBox):has(> .lightbox) {
  background: var(--rf-card);
}
body.rf .modal .lightbox > .modal-header {
  padding: 2px 4px 12px;
}
body.rf .modal .lightbox > .modal-header .modal-title {
  font-size: 15px;
  font-weight: 600;
}
body.rf .modal .lightbox > .modal-header .modal-close {
  background: var(--rf-grey);
}
/* the head's icon (a picture / a film), on the white of this window a soft
   tinted square (the user, 11-11: «הייתי מוסיף להם איקון») */
body.rf .modal .lightbox > .modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.rf .modal .lightbox > .modal-header .modal-head-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--rf-grey);
  color: var(--accent);
}
body.rf .modal .lightbox > .modal-header .lightbox-title-row {
  flex: 1 1 auto;
  min-width: 0;
}

/* ═════════════ big tools (כתוביות and the studios built like it) ═════════════ */
body.rf .modal .sub-modal {
  background: transparent;
}
body.rf .modal .sub-modal-body {
  margin: 0 12px;
  padding: 18px;
  gap: 0;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .sub-modal-body > .sub-col {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .sub-modal-body > .sub-col + .sub-col {
  margin-inline-start: 18px;
  padding-inline-start: 18px;
  border-inline-start: 1px solid var(--rf-line);
}
/* «כתוביות פעילות»: a switch, not a green box */
body.rf .modal .sub-enable {
  min-height: 36px;
  padding: 0 4px;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text-2);
}
body.rf .modal .sub-enable.is-on {
  border: 0;
  background: transparent;
  color: var(--text);
}
body.rf .modal .sub-enable > .ui-icon {
  display: none !important; /* icon() writes display inline */
}
body.rf .modal .sub-enable-switch {
  position: relative;
  flex: none;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--rf-line-2);
  transition: background 0.15s;
}
body.rf .modal .sub-enable-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: inset-inline-start 0.15s;
}
body.rf .modal .sub-enable.is-on .sub-enable-switch {
  background: var(--accent);
}
body.rf .modal .sub-enable.is-on .sub-enable-switch::after {
  inset-inline-start: 14px;
}
body.rf .modal .sub-clear {
  min-height: 36px;
  padding: 0 6px;
  gap: 6px;
  color: var(--text-2);
}
body.rf .modal .sub-clear .ui-icon {
  color: var(--text-3);
}
body.rf .modal .sub-clear:hover {
  border-color: transparent;
  background: transparent;
  color: var(--red);
}

/* inside the card: grey capsules (chosen white raised), the chosen font
   white + a teal ring, grey fields without borders */
body.rf .modal .sub-tabs,
body.rf .modal .sub-toggles {
  padding: 3px;
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .modal .sub-tab,
body.rf .modal .sub-toggles .sub-toggle {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  box-shadow: none;
}
body.rf .modal .sub-tab.is-on,
body.rf .modal .sub-toggles .sub-toggle.is-on {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: var(--rf-raise);
}
body.rf .modal .sub-toggle {
  border: 0;
  background: var(--rf-grey);
}
body.rf .modal .sub-toggle.is-on {
  background: var(--rf-card);
  box-shadow: 0 0 0 1.5px var(--accent);
}
body.rf .modal .sub-font-grid {
  padding: 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.rf .modal .sub-font-card {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
}
body.rf .modal .sub-font-card:hover:not(.is-on) {
  background: var(--rf-grey);
}
body.rf .modal .sub-font-card.is-on {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: 0 0 0 1.5px var(--accent);
}
body.rf .modal .sub-upload-btn {
  min-height: 32px;
  border: 0;
  border-radius: 10px;
  background: var(--rf-grey);
  color: var(--text-2);
}
body.rf .modal .sub-upload-btn:hover {
  border: 0;
  background: var(--rf-grey-2);
  color: var(--text);
}
body.rf .modal .sub-textarea {
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .modal .sub-textarea:focus {
  background: var(--rf-card);
  box-shadow: 0 0 0 1.5px var(--accent);
}
body.rf .modal .sub-summary,
body.rf .modal .sub-hint {
  border: 0;
  border-radius: 10px;
  background: var(--rf-grey);
}
body.rf .modal .sub-summary.is-ok {
  border: 0;
  background: var(--rf-grey);
  color: var(--text-2);
}
body.rf .modal .sub-hint {
  background: transparent;
  padding-inline: 2px;
}
body.rf .modal .sub-style-preview-head .sub-replay {
  border: 0;
  background: var(--rf-grey);
}

/* ═════════════ ייצוא ═════════════ */
body.rf .modal .export-modal > .modal-header {
  padding: 18px var(--win-pad);
}
body.rf .modal .export-body {
  margin: 0 12px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .export-info-area {
  margin: 12px 12px 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .modal .export-fn-input {
  border-color: transparent;
  background: var(--rf-card);
}
body.rf .modal .export-footer {
  padding: 14px var(--win-pad);
}
body.rf .modal .export-check-panel {
  margin: 10px 12px 0;
  border: 0;
  border-radius: 14px;
  box-shadow: var(--win-card-shadow);
}
/* «ייצוא הסרטון המעוצב» */
body.rf .modal .ts-music-body > p:first-child {
  margin: 0;
}
body.rf .modal .ts-music-field input:not([type='checkbox']):not([type='range']):not([type='color']),
body.rf .modal .ts-music-field select {
  border-color: transparent;
  border-radius: 11px;
  background-color: var(--rf-grey);
}

/* ═════════════ a card in two parts: fixed tools on top, the list scrolls ═════════════
   (הרץ הכל, סקירת קטעים) — one white card to the eye */
body.rf .modal .run-all-modal,
body.rf .modal .shots-overview-modal {
  background: transparent;
}
body.rf .modal .run-all-chrome,
body.rf .modal .shots-overview-chrome {
  margin: 0 12px;
  padding: 16px 18px 12px;
  border: 0;
  border-bottom: 1px solid var(--rf-line);
  border-radius: 16px 16px 0 0;
  background: var(--rf-card);
}
body.rf .modal .run-all-body,
body.rf .modal .modal-body.shots-overview-body {
  margin: 0 12px;
  border-radius: 0 0 16px 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .modal-body.shots-overview-body {
  padding: 12px 16px 16px;
}
body.rf .modal .modal-body.shots-overview-body:last-child {
  margin-bottom: 12px;
}
body.rf .modal .run-all-hint {
  border: 0;
  border-radius: 10px;
  background: var(--rf-grey);
}
body.rf .modal .run-all-body .planning-gen-pick-list {
  border: 0;
  box-shadow: none;
  background: transparent;
}
body.rf .modal .run-all-chrome .planning-gen-advanced .video-advanced {
  background: var(--rf-grey);
}
body.rf .modal .shots-overview-header .modal-head-actions {
  flex: 1 1 auto;
  justify-content: flex-end;
}
body.rf .modal .ov-metric {
  border: 0;
  border-radius: 10px;
  background: var(--rf-card);
}

/* ═════════════ library pickers: «בחר תמונת פתיחה», «הוסף ממאגר»… ═════════════
   grey tiles in the white card; the picture in use = white + a teal ring +
   «עכשיו»; upload / take-a-frame first with teal icons */
body.rf .modal .global-library-picker-body {
  margin: 0 12px 12px;
  padding: 18px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .global-library-group-label {
  gap: 8px;
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
body.rf .modal .global-library-local-label {
  margin-top: 0;
}
body.rf .modal .global-library-group-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}
body.rf .modal .global-library-divider {
  background: var(--rf-line);
}
body.rf .modal .assign-picker-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
body.rf .modal .assign-picker-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
  overflow: visible;
}
body.rf .modal .assign-picker-item:hover {
  border: 0;
  background: var(--rf-card);
  box-shadow: 0 0 0 1.5px var(--rf-line-2);
}
body.rf .modal .assign-picker-item.is-current,
body.rf .modal .assign-picker-item.is-selected {
  border: 0;
  background: var(--rf-card);
  box-shadow: 0 0 0 2px var(--accent);
}
body.rf .modal .assign-picker-thumb {
  border-radius: 8px;
  overflow: hidden;
}
body.rf .modal .assign-picker-name {
  padding: 0 2px;
  font-size: 11.5px;
  color: var(--text-2);
}
body.rf .modal .assign-picker-now {
  position: absolute;
  top: 11px;
  inset-inline-start: 11px;
  z-index: 3;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 10.5px;
  font-weight: 700;
  font-style: normal;
}
/* the two action tiles: a white box with a teal icon, the word in dark */
body.rf .modal .assign-picker-upload,
body.rf .modal .assign-picker-video-frame {
  border: 0;
  background: var(--rf-grey);
  opacity: 1;
}
body.rf .modal .assign-picker-upload-thumb,
body.rf .modal .assign-picker-video-frame-thumb {
  background: var(--rf-card);
  color: var(--accent);
}
body.rf .modal .assign-picker-upload:hover .assign-picker-upload-thumb {
  color: var(--accent);
}
body.rf .modal .assign-picker-upload .assign-picker-name,
body.rf .modal .assign-picker-video-frame .assign-picker-name {
  font-weight: 600;
  color: var(--text);
}
body.rf .modal .assign-picker-empty {
  border-radius: 12px;
  background: var(--rf-grey);
}

/* the one line under a window's name stays short: two lines at most */
body.rf .modal .modal-header .modal-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═════════════ image tools: חיתוך · קח פריים מסרטון ═════════════ */
body.rf .modal .fcm-modal > .modal-body {
  gap: 14px;
}
body.rf .modal .vfp-layout {
  margin: 0 12px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
  overflow: hidden;
}

/* ═════════════ «צור תמונה עם AI» / «AI - תמונת …» (frame-slot.js) ═════════════ */
body.rf .modal .ai-modal-header {
  align-items: center;
}
body.rf .modal .ai-modal-subtitle {
  margin-top: 1px;
  font-size: 12.5px;
}
body.rf .modal .ai-modal-body {
  margin: 0 12px;
  padding: 18px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .ai-modal-body:last-child {
  margin-bottom: 12px;
}
body.rf .modal .ai-modal-body .prompt-composer,
body.rf .modal .ai-modal-send-board.ai-modal-refs-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .ai-modal--fix .ai-modal-action-row,
body.rf .modal .ai-modal--create .ai-modal-action-row {
  padding: 14px var(--win-pad);
  border-top: 0;
  background: transparent;
}
body.rf .modal .ai-modal-action-row .cselect-trigger {
  background-color: var(--rf-card);
}
body.rf .modal .ai-modal-action-row .modal-cancel {
  margin-inline-start: auto;
}
body.rf .modal .ai-modal-action-row .video-generate-btn {
  min-height: 40px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
}

/* ═════════════ the studios' own heads (built before the shared one) ═════════════
   same look as modalHead(): icon in a white square · name + one line · X */
body.rf .modal :is(.overlay-modal-head, .logo-modal-head, .fstudio-head, .seam-cmp-head, .enh-head, .cae-modal-head, .mx-head, .fstub-head, .img-search-head, .ds-header, .auto-soundtrack-head) {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 18px var(--win-pad);
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal :is(.overlay-modal-title, .logo-modal-title, .fstudio-head-title, .seam-cmp-title, .enh-title, .cae-modal-title, .mx-title, .fstub-title, .slip-title-main, .img-search-head-title, .ds-title, .auto-soundtrack-title, .flow-review-title, .cae-title-main) {
  flex: 1 1 auto;
  min-width: 0;
  gap: 12px;
}
body.rf .modal :is(.overlay-modal-title-icon, .logo-modal-title-icon, .fstudio-head-icon, .seam-cmp-title-icon, .enh-title-icon, .cae-modal-title-icon, .mx-title-icon, .fstub-title-icon, .slip-title-icon, .sub-modal-title-icon, .img-search-head-icon, .ds-title-icon, .auto-soundtrack-title-icon, .flow-review-title-icon, .cae-title-icon) {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: var(--rf-card);
  color: var(--text-2);
}
body.rf .modal :is(.overlay-modal-title-copy, .logo-modal-title-copy, .fstudio-head-copy, .seam-cmp-title-copy, .enh-title-copy, .cae-modal-title-copy, .mx-title-copy, .fstub-title-copy, .slip-title-copy, .img-search-head-copy, .ds-title-copy, .auto-soundtrack-title-copy, .flow-review-title-copy, .cae-title-copy) {
  gap: 1px;
}
body.rf .modal :is(.overlay-modal-title-main, .logo-modal-title-main, .fstudio-head-main, .seam-cmp-title-main, .enh-title-main, .cae-modal-title-main, .fstub-title-main, .img-search-head-main, .auto-soundtrack-title-main),
body.rf .modal .mx-title-copy > :first-child,
body.rf .modal .ds-title-copy h2,
body.rf .modal .flow-review-modal .modal-head .modal-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
}
body.rf .modal :is(.overlay-modal-title-sub, .logo-modal-title-sub, .fstudio-head-sub, .seam-cmp-title-sub, .enh-title-sub, .cae-modal-title-sub, .fstub-title-sub, .slip-title-sub, .img-search-head-sub, .auto-soundtrack-title-sub, .flow-review-title-sub, .cae-subtitle, .iaf-subtitle, .singing-range-sub),
body.rf .modal .mx-title-copy > span,
body.rf .modal .ds-title-copy p {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-3);
}

/* the studios' own feet: on the grey, no line */
body.rf .modal :is(.overlay-modal-footer, .logo-modal-footer, .fstudio-foot, .seam-cmp-footer, .enh-footer, .cae-modal-footer, .fstub-footer, .img-search-foot, .ds-actions, .flow-review-footer, .motion-src-actions) {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px var(--win-pad);
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal :is(.overlay-modal-footer, .logo-modal-footer, .fstudio-foot, .seam-cmp-footer, .enh-footer, .cae-modal-footer, .fstub-footer, .img-search-foot, .ds-actions, .flow-review-footer, .motion-src-actions) > .btn {
  min-height: 40px;
  padding: 8px 20px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
}
body.rf .modal :is(.overlay-modal-footer, .logo-modal-footer, .fstudio-foot, .seam-cmp-footer, .enh-footer, .cae-modal-footer, .fstub-footer, .img-search-foot, .ds-actions, .flow-review-footer, .motion-src-actions) > .btn-secondary {
  border: 0;
  background: var(--rf-card);
  box-shadow: var(--rf-raise);
  font-weight: 600;
}
body.rf .modal :is(.overlay-modal-footer, .logo-modal-footer, .fstudio-foot, .seam-cmp-footer, .enh-footer, .cae-modal-footer, .fstub-footer, .img-search-foot, .ds-actions, .flow-review-footer, .motion-src-actions) > .modal-cancel {
  padding: 8px 16px;
  font-weight: 600;
}
/* side things in a foot: quiet, no box */
body.rf .modal :is(.lm-bg-toggle, .lm-remove) {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-2);
}
body.rf .modal .lm-bg-toggle:hover:not(:disabled) {
  background: var(--rf-card);
  color: var(--text);
}
body.rf .modal .lm-bg-toggle.is-on {
  border: 0;
  background: var(--rf-card);
  color: var(--text);
  box-shadow: 0 0 0 1.5px var(--accent);
}
body.rf .modal .lm-remove:hover {
  border: 0;
  background: transparent;
  color: var(--red);
}

/* ═════════════ the studios' bodies: ONE white card ═════════════ */
body.rf .modal :is(.logo-modal, .overlay-modal) {
  background: transparent;
}
body.rf .modal .logo-modal-body {
  margin: 0 12px;
  padding: 18px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .logo-modal-body:last-child {
  margin-bottom: 12px;
}
body.rf .modal .logo-modal-layout {
  gap: 0;
}
body.rf .modal .logo-modal-layout > .lm-col {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .logo-modal-layout > .lm-col + .lm-col {
  margin-inline-start: 18px;
  padding-inline-start: 18px;
  border-inline-start: 1px solid var(--rf-line);
}
body.rf .modal .lm-upload {
  border: 0;
  border-radius: 10px;
  background: var(--rf-grey);
  color: var(--accent);
}
body.rf .modal .overlay-modal-body {
  margin: 0 12px;
  padding: 18px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
/* the toggles under the list sit in the same card, below a hairline */
body.rf .modal .overlay-modal-body:has(+ .ov-toggles:not([hidden])) {
  border-radius: 16px 16px 0 0;
  box-shadow: none;
}
body.rf .modal .ov-toggles {
  margin: 0 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--rf-line);
  border-radius: 0 0 16px 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}

/* the flow report's head (views/editor.js, «בדיקת הסרט») */
body.rf .modal .flow-review-modal .modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 18px var(--win-pad);
  border: 0;
  background: transparent;
}
/* «נחסם»: the warning in the icon square keeps its colour */
body.rf .modal .bpf-head .modal-head-icon {
  color: var(--orange, var(--text-2));
}

/* ═════════════ more studio bodies: ONE white card ═════════════ */
body.rf .modal :is(.sub-modal, .logo-modal, .overlay-modal, .enh-modal, .seam-cmp-modal, .fstub-modal, .clip-audio-editor, .design-studio, .auto-soundtrack-modal, .flow-review-modal, .img-search-modal, .mx-wrap, .iaf-modal, .flicker-studio) {
  background: transparent;
}
/* a single card */
body.rf .modal :is(.cae-modal-body, .fstudio-body, .singing-range-body) {
  margin: 0 12px;
  padding: 16px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .flicker-studio {
  padding: 0;
}
body.rf .modal .fstudio-foot {
  align-items: stretch;
  margin-top: 0;
}
body.rf .modal .fstudio-foot-actions .modal-cancel {
  margin-inline: auto 0;
}
/* a card in two parts: tools above, the list below */
body.rf .modal :is(.enh-bulk, .fstub-status, .seam-cmp-status, .img-search-toolbar) {
  margin: 0 12px;
  padding: 14px 18px 10px;
  border: 0;
  border-bottom: 1px solid var(--rf-line);
  border-radius: 16px 16px 0 0;
  background: var(--rf-card);
}
body.rf .modal :is(.enh-list, .fstub-list, .seam-cmp-body, .img-search-body) {
  margin: 0 12px;
  border: 0;
  border-radius: 0 0 16px 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .modal-body.img-search-body {
  padding: 14px 18px 18px;
}
body.rf .modal .enh-footer .enh-summary {
  margin-inline-start: 0;
}
/* «תבניות» / «אפקטים»: one card, the parts divided by hairlines */
body.rf .modal .ds-body {
  margin: 0 12px;
  padding: 0;
  gap: 0;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
  overflow: hidden;
}
body.rf .modal .ds-body > :is(.ds-stage, .ds-gallery, .ds-panel) {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .ds-body > .ds-panel {
  border-inline-start: 1px solid var(--rf-line);
}
body.rf .modal .ds-body > .ds-gallery {
  border-top: 1px solid var(--rf-line);
}
/* the studio foot: side things · «ביטול» · the main one at the far end */
body.rf .modal .ds-actions > * {
  order: 0;
}
body.rf .modal .ds-actions > .modal-cancel {
  order: 1;
  margin-inline-start: auto;
}
body.rf .modal .ds-actions > .btn-primary {
  order: 2;
}
body.rf .modal .ds-actions .ds-remove {
  margin-inline-end: 0;
}
/* the image tools: the body is the card */
body.rf .modal .iaf-body {
  margin: 0 12px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .iaf-toolbar {
  padding: 14px var(--win-pad);
  border: 0;
  background: transparent;
}
/* «קטע תנועה»: the parts flow in one card */
body.rf .modal .motion-src-modal > :is(.motion-src-hint, .motion-src-overflow, .motion-src-stage, .motion-src-trim, .motion-src-status) {
  margin: 0 12px;
  padding: 6px 18px;
  background: var(--rf-card);
}
body.rf .modal .motion-src-modal > .modal-header + * {
  padding-top: 18px;
  border-radius: 16px 16px 0 0;
}
body.rf .modal .motion-src-modal > .motion-src-status {
  padding-bottom: 18px;
  border-radius: 0 0 16px 16px;
}
/* «מה באמת נשלח למודל» (style-tab.js): the line and the list in one card */
body.rf .modal .ref-check > p.modal-sub {
  margin: 0 12px;
  padding: 18px 18px 8px;
  border-radius: 16px 16px 0 0;
  background: var(--rf-card);
}
body.rf .modal .ref-check > .ref-check-grid {
  margin: 0 12px 12px;
  padding: 8px 18px 18px;
  border-radius: 0 0 16px 16px;
  background: var(--rf-card);
}

/* ═════════════ «בחירת אזור» (reference-crop.js): its own layer, the same frame ═════════════ */
body.rf .refcrop-backdrop {
  background: var(--rf-backdrop);
}
body.rf .refcrop-panel {
  border: 0;
  border-radius: 20px;
  background: var(--rf-grey);
  box-shadow: var(--win-shadow);
}
body.rf .refcrop-head {
  gap: 12px;
  padding: 18px var(--win-pad);
  border: 0;
  background: transparent;
}
body.rf .refcrop-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--rf-card);
  color: var(--text-2);
}
body.rf .refcrop-title {
  font-size: 17px;
  font-weight: 700;
}
body.rf .refcrop-sub {
  font-size: 12.5px;
  color: var(--text-3);
}
body.rf .refcrop-head .modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rf-card);
}
body.rf .refcrop-foot {
  padding: 14px var(--win-pad);
  border: 0;
  background: transparent;
}
body.rf .refcrop-foot .btn {
  min-height: 40px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
}
body.rf .refcrop-foot .btn-ghost {
  background: var(--rf-card);
  color: var(--text-2);
  font-weight: 600;
}

/* «סאונד לסרט»: the kind on top and the two columns below = one card */
body.rf .modal .auto-soundtrack-mode-step {
  margin: 0 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--rf-line);
  border-radius: 16px 16px 0 0;
  background: var(--rf-card);
}
body.rf .modal .auto-soundtrack-body,
body.rf .modal .auto-soundtrack-scenes-panel {
  margin: 0 12px;
  padding: 14px 18px 18px;
  gap: 0;
  border-radius: 0 0 16px 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .auto-soundtrack-body > .auto-soundtrack-col {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .auto-soundtrack-body > .auto-soundtrack-col + .auto-soundtrack-col {
  margin-inline-start: 18px;
  padding-inline-start: 18px;
  border-inline-start: 1px solid var(--rf-line);
}
/* «מיקסר»: a big tool - the toolbar and the lanes in one card */
body.rf .modal .mx-close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rf-card);
  color: var(--text-3);
}
body.rf .modal .mx-close:hover:not(:disabled) {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: var(--rf-raise);
}
body.rf .modal .mx-wrap > .mx-toolbar {
  margin: 0 12px;
  padding: 10px 14px;
  border-radius: 16px 16px 0 0;
  background: var(--rf-card);
}
body.rf .modal .mx-wrap > .mx-stage {
  margin: 0 12px;
  background: var(--rf-card);
}
body.rf .modal .mx-wrap > .mx-inspect {
  margin: 0 12px 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--rf-line);
  border-radius: 0 0 16px 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}

/* every window's own root stands on the frame's colour */
body.rf .modal-backdrop > :is(.modal, #modalBox) > :is(.qc-modal, .ime-modal, .iaf-modal, .run-all-modal, .shots-overview-modal, .export-modal, .ai-modal, .vfp-modal, .fcm-modal, .speech-creator, .voice-designer, .add-shot-modal, .ishot-modal, .motion-src-modal, .singing-range-modal, .clip-audio-editor, .ref-check, .template-track-help, .ts-music-export, .confirm-dialog) {
  background: transparent;
}

/* reports «בקרת איכות», «בדיקת קליפים», «בדיקת בימוי», «דוח רגרסיה»: the
   tools on top and the list below = one card */
body.rf .modal .qc-modal-header {
  align-items: center;
}
body.rf .modal .qc-modal-subtitle {
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--text-3);
}
body.rf .modal .qc-toolbar {
  margin: 0 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rf-line);
  border-radius: 16px 16px 0 0;
  background: var(--rf-card);
}
body.rf .modal .qc-list {
  margin: 0 12px 12px;
  border-radius: 0 0 16px 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .qc-empty {
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
}
/* the image tools («הסרת אובייקט», «תיקון אוטומטי», «בדיקת צבע», «אולפן פרימיום») */
body.rf .modal :is(.iaf-header, .ime-header) {
  align-items: center;
}
body.rf .modal .ime-toolbar {
  padding: 14px var(--win-pad);
  border: 0;
  background: transparent;
}
body.rf .modal .ime-stage {
  margin: 0 12px;
  border-radius: 16px;
}

/* «בחר אודיו»: the picker in the white card, grey tiles inside */
body.rf .modal .audio-picker-modal > .audio-picker-body {
  margin: 0 12px 12px;
  padding: 18px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .audio-picker-modal .audio-picker-quick-btn {
  border: 0;
  border-radius: 14px;
  background: var(--rf-grey);
}
body.rf .modal .audio-picker-modal .audio-picker-quick-btn:hover {
  background: var(--rf-card);
  box-shadow: 0 0 0 1.5px var(--accent);
}
body.rf .modal .audio-picker-modal .audio-picker-quick-icon {
  background: var(--rf-card);
  color: var(--accent);
}
body.rf .modal .audio-picker-modal .audio-picker-empty {
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
}

/* ═════════════ phone: today's bottom sheet, with the new head and foot ═════════════ */
@media (max-width: 768px) {
  body.rf .modal-backdrop > :is(.modal, #modalBox) {
    border-radius: 20px 20px 0 0;
  }
  body.rf .modal::before {
    margin: 8px auto 0;
  }
  body.rf .modal .modal-header,
  body.rf .modal :is(.overlay-modal-head, .logo-modal-head, .fstudio-head, .seam-cmp-head, .enh-head, .cae-modal-head, .mx-head, .fstub-head, .img-search-head, .ds-header, .auto-soundtrack-head) {
    padding: 12px 16px;
  }
  body.rf .modal .modal-body,
  body.rf .modal .form-sheet-body {
    margin-inline: 8px;
    padding: 14px;
  }
  body.rf .modal.modal--msg .modal-body {
    margin: 0;
    padding: 2px 16px 12px;
  }
  body.rf .modal .modal-footer {
    flex-wrap: wrap;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom, 12px));
  }
  /* side things take their own row; «ביטול» and the main button share the next */
  body.rf .modal .modal-foot-side {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  body.rf .modal .modal-foot-sp {
    display: none;
  }
  body.rf .modal .modal-footer > .btn,
  body.rf .modal .modal-footer > .modal-cancel {
    flex: 1 1 0;
    min-width: 0;
  }
  body.rf .modal .modal-footer:has(.modal-footer-extra-actions) {
    flex-wrap: wrap;
  }
  body.rf .modal .modal-footer:has(.modal-footer-extra-actions) > .btn,
  body.rf .modal .modal-footer .modal-footer-extra-actions > .btn {
    flex: 1 1 auto;
  }
  body.rf .refcrop-panel {
    border-radius: 20px 20px 0 0;
  }
}

/* ═════════════ the loading skeleton's header (utils.js buildProjectLoadOverlay) ═════════════
   «עורך» as the real header draws it: the film's small frame with ▶ and the
   word. The shell hides the skeleton's old ▶ svg; this one is the thumb's. */
body.rf .workspace-root .ws-sk-open-editor .editor-thumb-play svg {
  display: block;
}
@media (max-width: 480px) {
  body.rf .modal .gpick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The picture windows («תמונת פתיחה - AI», both «צור חדש» and «תקן את
   התמונה»): the size of «קבוצה חדשה» on a computer — its width and its
   height, min(92vh, 900px) (the user, 11-11: «בגודל והרוחב כמו של החלון של
   קבוצה חדשה»). «תקן את התמונה» was 800px wide and both were 86vh tall.
   On a phone they stay bottom sheets. */
@media (min-width: 769px) {
  body.rf .modal.modal-lg:is(:has(.ai-modal--create), :has(.ai-modal--fix)) {
    width: min(980px, 96vw);
    max-width: min(980px, 96vw);
    height: min(92vh, 900px);
    max-height: min(92vh, 900px);
  }
}
/* …and no «ביטול» in them (the user, 11-11): the window's X closes it */
body.rf .modal :is(.ai-modal--create, .ai-modal--fix) .ai-modal-action-row .modal-cancel {
  display: none;
}
