/* One look for every window (approved by the user 2026-11-11, sample «חלונות האתר»).
   Every rule starts with body.rf (see refresh-base.css). Loaded after
   refresh-windows.css / refresh-tools.css, so it wins where they differ.

   - no «ביטול» / «סגור» / «סיום» in a foot: the X in the head closes every
     window (utils.js modalFoot / confirmDialog draw none); an empty foot hides;
   - two widths on a computer: a window that was 600px or less → narrow (520),
     every other one → wide (1180). utils.js sizeWindow() sets the class;
     the picture / video viewer and «מיקסר» keep their own size;
   - a few windows get the shared frame they were missing (below, one block
     each, named by the window's on-screen title). */

/* ═════════════ the foot ═════════════ */
body.rf .modal :is(.modal-footer, .modal-foot)[hidden] {
  display: none !important;
}
/* the white card keeps its bottom margin when no foot follows it */
body.rf .modal .modal-body:has(+ :is(.modal-footer, .modal-foot)[hidden]) {
  margin-bottom: 12px;
}

/* ═════════════ two widths (computers; phones keep their bottom sheets) ═════════════ */
@media (min-width: 769px) {
  body.rf .modal-backdrop > :is(.modal, #modalBox).modal--narrow {
    width: min(520px, calc(100vw - 32px)) !important;
    max-width: min(520px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
  }
  body.rf .modal-backdrop > :is(.modal, #modalBox).modal--wide {
    width: min(1180px, calc(100vw - 32px)) !important;
    max-width: min(1180px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
  }
  /* «בחירת אזור» lives in its own layer (reference-crop.js) */
  body.rf .refcrop-panel {
    width: min(1180px, calc(100vw - 32px));
  }
}

/* ═════════════ «בחירת אזור»: the photo + the ratio row in ONE white card ═════════════ */
body.rf .refcrop-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  margin: 0 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .refcrop-card > .refcrop-stage {
  margin: 0;
}
body.rf .refcrop-card > .refcrop-tools {
  padding: 0;
}

/* ═════════════ «בחירת חלקים מהסרטון» (slip-source.js): the shared frame ═════════════
   It painted its own near-white window over the grey frame, with lines under
   the head and above the foot. */
body.rf .modal .slip-modal {
  background: transparent;
}
body.rf .modal .slip-modal > .modal-header,
body.rf .modal .slip-modal > .slip-footer {
  border: 0;
  background: transparent;
}
body.rf .modal .slip-modal > .slip-body {
  margin: 0 12px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .slip-control-panel {
  border: 0;
  border-radius: 14px;
  background: var(--rf-grey);
}
body.rf .modal :is(.slip-range-pill, .slip-part-tab--add) {
  background: var(--rf-card);
}
/* the one quiet note style (a grey box, amber icon) instead of the pink box */
body.rf .modal .slip-noslack {
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
  color: var(--text-2);
}
body.rf .modal .slip-noslack .ui-icon {
  color: var(--orange);
}

/* ═════════════ «אודיו קטע» (clip-audio-editor.js): no box inside the white card ═════════════ */
body.rf .modal .clip-audio-editor:not(.library-audio-editor) .cae-workspace {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .clip-audio-editor:not(.library-audio-editor) .cae-toolbar {
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .modal .clip-audio-editor:not(.library-audio-editor) .cae-toolbar-group--mix {
  background: var(--rf-card);
}
body.rf .modal .clip-audio-editor:not(.library-audio-editor) .cae-canvas {
  background: transparent;
}
body.rf .modal .clip-audio-editor:not(.library-audio-editor) .cae-lane {
  border-top: 1px solid var(--rf-line);
  background: transparent;
}

/* ═════════════ «עריכת שמע» (library-audio-editor.js): tools + wave + player in ONE card ═════════════ */
body.rf .modal .library-audio-editor > .cae-body {
  background: transparent;
}
body.rf .modal .library-audio-editor .lae-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 12px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .library-audio-editor .lae-card > :is(.lae-commandbar, .lae-transport) {
  background: transparent;
}
body.rf .modal .library-audio-editor .lae-card > .lae-commandbar {
  border-bottom: 1px solid var(--rf-line);
}
body.rf .modal .library-audio-editor .lae-card > .lae-transport {
  border-top: 1px solid var(--rf-line);
}
body.rf .modal .library-audio-editor .lae-footer {
  border-top: 0;
  background: transparent;
}
@media (max-width: 768px) {
  body.rf .modal .library-audio-editor .lae-card {
    flex: 0 0 auto;
    overflow: visible;
  }
}

/* ═════════════ «חיתוך לביט» (flicker-studio.js): the hint beside the buttons, one row ═════════════ */
body.rf .modal .fstudio-foot {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
body.rf .modal .fstudio-foot-hint {
  flex: 1 1 auto;
  min-width: 0;
}
body.rf .modal .fstudio-foot-actions {
  flex: none;
}

/* ═════════════ «אפקטים» / «תבניות» (design-studios.js) ═════════════
   With «ביטול» gone the main button keeps the far end on its own; «הסרת
   התבנית» and the picked line stay on the start side. */
body.rf .modal .ds-actions > .btn-primary {
  margin-inline-start: auto;
}

/* ═════════════ «סקירת קטעים»: no green — the same dots as the «קטעים» list ═════════════ */
body.rf .shots-overview-modal .ov-strip-seg.status-done {
  background: var(--rf-grey-2);
  color: var(--text);
}
body.rf .shots-overview-modal .ov-strip-seg.status-done:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--rf-grey-2));
}
body.rf .shots-overview-modal .status-pip {
  background: var(--text-muted);
  box-shadow: none;
}
body.rf .shots-overview-modal .status-pip.status-done {
  background: var(--text-2);
}
body.rf .shots-overview-modal .status-pip.status-editing {
  background: var(--text-3);
}
body.rf .shots-overview-modal .status-pip:is(.status-pick, .status-image) {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--text-2);
}

/* ═════════════ «לוגו»: the pictures to pick from = the same tiles as «שכבות» ═════════════ */
body.rf .modal .lm-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
body.rf .modal .lm-thumb {
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--rf-grey);
  box-shadow: 0 0 0 1px var(--rf-line);
}
body.rf .modal .lm-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 0;
}
body.rf .modal .lm-thumb.sel {
  box-shadow: inset 0 0 0 2px var(--accent);
}
body.rf .modal .lm-thumb.sel img {
  box-shadow: none;
}
body.rf .modal .lm-thumb-name {
  max-width: none;
  padding: 6px 8px;
  font-size: 11.5px;
  color: var(--text-2);
  text-align: center;
}

/* ═════════════ «מיקסר»: the how-to line in the foot, on the start side ═════════════ */
body.rf .modal .mx-wrap > .mx-foot {
  flex: none;
  padding: 12px var(--win-pad) 14px;
}
body.rf .modal .mx-foot-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ═════════════ «קבוצה חדשה» / «הגדרות קבוצה»: the middle part fills the wide window ═════════════ */
body.rf .modal .gsetup {
  width: 100%;
}

/* ═════════════ «הוסף ממאגר»: no stray line above the first caption ═════════════ */
body.rf .modal .global-library-picker-body > .global-library-divider:first-child {
  display: none;
}

/* ═════════════ «בחר אודיו»: the three create tiles in one row; the file row a grey tile ═════════════ */
body.rf .modal .audio-picker-quick--inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.rf .modal .audio-picker-quick--inline > .audio-picker-quick-btn {
  min-height: 112px;
}
body.rf .modal .audio-picker-row {
  border: 0;
  background: var(--rf-grey);
  box-shadow: none;
}

/* ═════════════ the picture tools: ONE white card, the controls on the grey below ═════════════ */
/* «תיקון מקומי» / «הסרת אובייקט» (image-eraser.js) */
body.rf .modal .ime-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
  min-height: 0;
  margin: 0 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .ime-card > .ime-stage {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .modal .ime-card > .ime-composer {
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .ime-toolbar .ime-controls {
  border: 0;
  background: transparent;
  box-shadow: none;
}
/* «תיקון אוטומטי» / «בדיקת צבע» / «פרימיום» (.iaf-*): quiet boxes inside the card */
body.rf .modal .iaf-modal .iaf-stage {
  border: 0;
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .modal .iaf-modal .iaf-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.rf .modal .iaf-modal .iaf-toolbar :is(.icc-strength, .iaf-controls) {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* ═════════════ «קטע תנועה»: ONE white card, the empty strips hide ═════════════ */
body.rf .modal .motion-src-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .motion-src-card > * {
  margin: 0;
}
body.rf .modal .motion-src-card > .motion-src-stage {
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .modal .motion-src-card > .motion-src-status:empty,
body.rf .modal .motion-src-card > .motion-src-trim[hidden] {
  display: none;
}

/* ═════════════ «בדיקת בימוי»: the summary + the list in ONE card, the buttons in the foot ═════════════ */
body.rf .modal .qc-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 12px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--rf-card);
  box-shadow: var(--win-card-shadow);
}
body.rf .modal .qc-card > :is(.qc-toolbar, .qc-list) {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
body.rf .modal .qc-card > .qc-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* ═════════════ the small panels beside a button: one head ═════════════
   (popovers.js panelHead: «V1», «כלים»; «סדר לביט» keeps its own row + a line) */
body.rf .popover .rf-pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--rf-line);
}
body.rf .popover .rf-pop-ico {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--rf-grey);
  color: var(--text-2);
}
body.rf .popover .rf-pop-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
body.rf .popover .rf-pop-copy b {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
body.rf .popover .rf-pop-copy small {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-3);
}
body.rf .popover .beatsync-tool-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
body.rf .popover .beatsync-tool-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
}
