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

   Phones and small tablets (≤768px) keep their own arrangement: the old mobile
   rules (polish.css, workspace-*.css, settings.css, editor.css) still decide
   what stacks, what scrolls sideways and what sticks to the bottom, and most
   refresh-*.css layout lives in @media (min-width: 769px). This file only gives
   those phone screens the look of the refreshed computer screens — white
   cards, the one grey inside, the chosen thing white with a hairline, teal
   only for what is chosen / what you click / the main action, flat buttons,
   compact sizes — and mends the places where an old phone size fought a new
   one (a 44px button standing out of a 34px capsule, 22–25px targets too small
   for a finger, a foot that cut the card's round corners).
   Nothing is hidden, moved or added; every target this file sizes is at
   least 32px. */

@media (max-width: 768px) {
  /* ================================================================
     Shell: the top bar and the side-menu drawer
     ================================================================ */

  /* the top bar: white, a hairline under it, no shadow */
  body.rf .mobile-topbar {
    background: var(--rf-card);
    border-bottom: 1px solid var(--rf-line);
    box-shadow: none;
  }
  body.rf .mobile-topbar .mobile-toggle {
    border-radius: 10px;
    background: transparent;
  }
  body.rf .mobile-topbar .mobile-toggle:hover,
  body.rf .mobile-topbar .mobile-toggle[aria-expanded="true"] {
    background: var(--rf-grey);
  }

  /* the drawer: today's rows, one step lower than the old 44px (still easy to tap) */
  body.rf .side-nav .sidebar-actions .sidebar-new-btn {
    height: 40px;
    min-height: 40px;
    padding-block: 0;
  }
  body.rf .side-nav .sidebar-project {
    min-height: 40px;
  }
  body.rf .side-nav .nav-footer .nav-item-lg {
    min-height: 40px;
  }

  /* ================================================================
     The project bar: «עורך» as low as the tabs. The old phone rule gave
     every .btn 44px, so it stood out of the 34px capsule and made the
     capsule taller than its tabs.
     ================================================================ */
  body.rf .workspace-root .project-header .btn-open-editor {
    min-height: 0;
    padding-block: 0;
  }

  /* ================================================================
     «תכנון»
     ================================================================ */

  /* the foot keeps the card's round corners (it was square over them) */
  body.rf .pc-main > .pc-stage-actions {
    border-radius: 0 0 15px 15px;
  }

  /* «בלי תכנון»: the line under the title gets the whole width; what is
     still missing goes under it, instead of squeezing the line to one word
     a row */
  body.rf .pc-manual-head {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  body.rf .pc-manual-titles {
    flex: 1 1 100%;
  }
  body.rf .pc-manual-missing {
    max-width: 100%;
  }

  /* ================================================================
     «קטעים»
     ================================================================ */

  /* the column headers read like the computer's: no divider under them */
  body.rf .shot-rail .shot-rail-header,
  body.rf .videos-panel > .panel-header-row {
    margin-bottom: 0;
    border-bottom: 0;
  }

  /* the rail's teal tools: the same small icons, a finger-sized target */
  body.rf .shot-rail .rail-header-btn {
    width: 32px;
    height: 32px;
    margin: -5px 0;
    border-radius: 9px;
  }
  body.rf .shot-rail .rail-header-btn svg {
    width: 15px;
    height: 15px;
  }

  /* the sideways strip of shots sits on the one grey; the open shot is the
     white one with a hairline (the global refresh rules), like the rail on a
     computer and the strip on «עריכה» */
  body.rf .shots-layout > .shot-rail {
    padding-bottom: 12px;
  }
  body.rf .shot-rail .rail-list {
    margin-top: 8px;
    padding: 4px;
    gap: 2px;
    border-radius: 12px;
    background: var(--rf-grey);
  }
  body.rf .shot-rail .rail-item {
    border-radius: 10px;
  }
  body.rf .shot-rail .rail-thumb {
    border-radius: 6px;
  }

  /* the empty picture: «AI» / «העלאה» written under their icons, as on the
     computer (the old ≤480px rule left two bare 25px icons). A very narrow
     frame (≤140px) still shows icons only — refresh-shots.css decides that. */
  @container (min-width: 141px) {
    body.rf .shot-stage .frame-slot-empty-btn-label {
      display: block;
    }
  }

  /* ⇄ floats on the seam between the two frames here: a small white circle
     with a hairline, big enough for a finger */
  body.rf .shot-stage .frame-swap-btn,
  body.rf .shot-stage .frame-swap-btn:hover:not(:disabled) {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--rf-card);
    box-shadow: var(--rf-raise);
    color: var(--text-2);
  }

  /* the create bar sticks to the bottom of the screen: white behind it (the
     text no longer shows through around it), a hairline above, the card's
     corners, the phone's safe area under it */
  body.rf .shot-stage > .stage-card .video-card-footer {
    padding: 6px 12px max(8px, env(safe-area-inset-bottom, 8px));
    border-radius: 0 0 16px 16px;
    background: var(--rf-card);
    box-shadow: 0 -1px 0 var(--rf-line);
  }

  /* the bar itself: light teal, flat, the choices as the computer's small
     white fields, the button flat teal */
  body.rf .shot-stage .video-settings-row {
    border-radius: 12px;
    box-shadow: none;
  }
  body.rf .shot-stage .video-settings-row .duration-group .cselect-trigger {
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: 9px;
    background: var(--rf-card);
    box-shadow: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
  }
  body.rf .shot-stage .video-settings-row .generate-btn-with-price .video-generate-btn {
    border-radius: 9px;
    box-shadow: none;
    font-size: 13px;
  }

  /* ================================================================
     «עריכה»
     ================================================================ */

  /* the tool picker (the phone's tool list) on the card's white, no band;
     its button like the refreshed fields: white, a thin line, teal when open */
  body.rf .ws-area-options .ws-tool-picker {
    margin-bottom: 10px;
    padding: 12px 0 10px;
    border-bottom: 1px solid var(--rf-line);
    background: transparent;
  }
  body.rf .ws-area-options .ws-tool-picker-trigger {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--rf-line-2);
    border-radius: 10px;
    background: var(--rf-card);
    box-shadow: none;
  }
  body.rf .ws-area-options .ws-tool-picker-trigger:hover {
    border-color: var(--rf-line-2);
    background: var(--rf-grey);
  }
  body.rf .ws-area-options .ws-tool-picker.is-open .ws-tool-picker-trigger {
    border-color: var(--accent);
    background: var(--rf-card);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  /* «תיקון אוטומטי» back to its refreshed height (the old 44px touch rule
     made it the tallest thing on the screen) */
  body.rf .ws-area-options .btn.ws-auto-correct-btn {
    min-height: 36px;
    padding-block: 0;
  }

  /* ================================================================
     «קבצים»: the summary capsule and «ייבוא תיקייה» on one row again
     ================================================================ */
  body.rf .files-panel .files-jump-btn {
    gap: 5px;
    padding: 0 8px;
  }
  body.rf .files-panel .folder-import-pick {
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    border-radius: 9px;
  }

  /* ================================================================
     «העורך»: the phone keeps its own editor (sticky tools that scroll
     sideways, icons only); it gets the computer's look
     ================================================================ */

  /* the player and the timeline: the same 12px corners and one shadow */
  body.rf .editor-preview {
    border-radius: 12px;
  }
  body.rf .editor-timeline {
    border-color: var(--rf-line);
    border-radius: 12px;
    box-shadow: var(--rf-shadow);
  }

  /* the play row floats: a capsule across the player, ▶ a round teal button */
  body.rf .preview-transport {
    box-sizing: border-box;
    height: 52px;
    margin: 0 10px 10px;
    padding: 0 8px 0 4px;
    border: 1px solid color-mix(in srgb, var(--text-on-accent) 8%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-on-accent) 7%, transparent);
  }
  body.rf .tr-play {
    width: 42px;
    min-width: 42px;
    height: 42px;
    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: 13px;
    height: 13px;
  }
  /* the triangle sits a hair right of centre so it LOOKS centred */
  body.rf .tr-play .lucide-play {
    margin-left: 2px;
  }

  /* the tools bar: one white bar, thin lines between the groups instead of
     boxes, each icon in a small grey circle, a tool that is ON in soft teal */
  body.rf .timeline-tools-bar {
    border-bottom: 1px solid var(--rf-line);
    background: var(--rf-card);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.rf .timeline-tools-bar :is(.tb-segment, .tb-zoom, .tb-history) {
    position: relative;
    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: -3px;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: var(--rf-line-2);
    pointer-events: none;
  }
  /* the first group has nothing before it (the BPM group in front of it is
     always hidden on a phone, polish.css) */
  body.rf .timeline-tools-bar > :is(.tb-segment, .tb-zoom, .tb-history):first-child::before,
  body.rf .timeline-tools-bar > .tb-group:first-child > :is(.tb-segment, .tb-zoom, .tb-history):first-child::before,
  body.rf .timeline-tools-bar > .tb-group:first-child > .tb-bpm-group + .tb-segment::before {
    content: none;
  }
  body.rf .timeline-tools-bar .tb-btn > .ui-icon,
  body.rf .timeline-tools-bar .tb-history-btn > .ui-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--rf-grey);
  }
  body.rf .timeline-tools-bar .tb-btn svg,
  body.rf .timeline-tools-bar .tb-history-btn svg {
    width: 14px;
    height: 14px;
  }
  body.rf .timeline-tools-bar .tb-delete-clip > .ui-icon {
    background: var(--rf-danger-soft);
  }
  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);
  }

  /* «ייצוא» flat teal, the corners of the tool tiles; the group that holds it
     stays pinned at the bar's end on the card's white */
  body.rf .timeline-tools-bar .tb-export,
  body.rf .timeline-tools-bar .tb-export:hover {
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    box-shadow: none;
    color: var(--text-on-accent);
  }
  body.rf .editor-timeline .timeline-tools-bar .tb-group:has(.tb-export) {
    background: var(--rf-card);
    box-shadow: -10px 0 10px -4px var(--rf-card);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* ================================================================
     «הגדרות» and «מדריך שימוש»
     ================================================================ */

  /* the title and its gear at the computer's size */
  body.rf .settings-page .settings-header {
    gap: 12px;
  }
  body.rf .settings-page .settings-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  body.rf .settings-page .settings-header-icon svg {
    width: 20px;
    height: 20px;
  }
  body.rf .settings-page .settings-greeting h1,
  body.rf .settings-page .settings-greeting h2 {
    font-size: 22px;
  }
  body.rf .settings-page .ug-entry {
    height: 54px;
    margin-bottom: 18px;
  }

  /* the choices (language, display, network): a finger-sized row */
  body.rf .settings-page .settings-seg-btn {
    min-height: 32px;
  }

  /* «חזרה להגדרות» in the guide: a finger-sized target, the same look */
  body.rf .gd-back {
    height: 32px;
  }

  /* «עריכה»: the options card grows with its content (an old base rule,
     later in workspace-layout.css, put the computer's fixed height back over
     the narrow screen's height:auto — step 3's sliders were cut off) */
  body.rf .ws-area-options {
    height: auto;
    max-height: none;
    position: static;
  }

  /* ================================================================
     Phone check, 11-11 (a phone at 360 / 390 / 412px, every screen)
     ================================================================ */

  /* «הפרויקטים שלי»: two cards a row leave the name ~80px next to the two
     icons, so «No More Whining» showed as «…Whining». The icons move onto
     the picture's corner — small white squares, like ✨ / ☰ on a shot's
     picture — and the name gets the card's whole width. Their size stays
     the old 26px (the user, 11-11: «אותו גודל שהיה»). */
  body.rf .home .project-card {
    position: relative;
  }
  body.rf .home .project-card-row {
    position: static;
  }
  body.rf .home .project-group-btn,
  body.rf .home .project-delete-btn {
    position: absolute;
    top: 14px;
    z-index: 2;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--rf-card);
    box-shadow: var(--rf-raise);
    color: var(--text-2);
  }
  body.rf .home .project-delete-btn {
    inset-inline-end: 14px;
  }
  body.rf .home .project-group-btn {
    inset-inline-end: 44px;
  }
  body.rf .home .project-group-btn:hover:not(:disabled) {
    background: var(--rf-card);
  }
  /* a long name takes a second line instead of being cut («No More
     Whining · גרסה 2» was cut inside «גרסה») */
  body.rf .home .project-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    line-height: 1.35;
  }

  /* the project bar's ⋮: a finger-sized target; its menu opens toward the
     middle of the screen (it hung 3px past the left edge) */
  body.rf .workspace-root .project-menu-trigger {
    width: 30px;
    height: 30px;
  }
  body.rf .workspace-root .project-menu-dropdown {
    right: auto;
    left: 0;
  }

  /* «עריכה»: the shot names under the pictures were 10px */
  body.rf .workshop-grid > .workshop-shot-list .workshop-shot-title {
    font-size: 11px;
    line-height: 14px;
  }

  /* the picture windows («תמונת פתיחה - AI»): laid out like the create bar
     on «קטעים» (the user, 11-11: «כמו שיש ביצירת וידאו»). One row of the
     choices across the window, and under it the create button across the
     window with its price beside it. (The model's name was cut in the old
     single row; «ביטול» is gone from these windows, refresh-windows.css.) */
  body.rf .modal .ai-modal-action-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  body.rf .modal .ai-modal-action-row-controls {
    flex: 1 1 100%;
    gap: 6px;
    overflow: visible;
  }
  body.rf .modal .ai-modal-action-row-controls > * {
    flex: 1 1 auto;
    min-width: 0;
  }
  body.rf .modal .ai-modal-action-row .cselect-trigger {
    width: 100%;
    max-width: none;
    height: 34px;
    justify-content: space-between;
  }
  body.rf .modal .ai-modal-action-row .generate-btn-with-price {
    flex: 1 1 100%;
  }
  body.rf .modal .ai-modal-action-row .generate-btn-with-price .video-generate-btn {
    flex: 1 1 auto;
  }

  /* the logo in the top bar stood on the screen's very edge: it lines up
     with the edge of the page's cards now (12px) */
  body.rf .mobile-topbar {
    padding-inline-end: 12px;
  }
}

/* ================================================================
   «עורך» as tall as the whole capsule that holds the four tabs (the user,
   11-11: «כפתור עורך צריך להיות בגובה של כל ה-4 הכפתורים, גם במצב רגיל
   גם בנייד»): its top and bottom on the capsule's top and bottom — 40px
   on a computer, 42px on a phone. (More specific than refresh-colour.css,
   which is linked after this file and sets 34px.)
   ================================================================ */
body.rf .workspace-root .project-header .project-header-bottom > .btn-open-editor {
  align-self: stretch;
  height: auto;
  min-height: 0;
}

/* ================================================================
   Tablet and phone shell (≤960px): the menu is a drawer and the 52px
   top bar is fixed over the page
   ================================================================ */

/* 769–960px (a tablet, a phone on its side, a narrow window): the computer's
   page padding (refresh-compact.css) replaced the room polish.css keeps for
   the fixed top bar, so the top of EVERY page — the project's name, ⋮ and
   undo, «הפרויקטים שלי», «הגדרות» — sat under the bar. #contentArea beats
   refresh-compact's .content-area, which is linked after this file. */
@media (min-width: 769px) and (max-width: 960px) {
  body.rf #contentArea {
    padding-top: calc(52px + 16px);
  }
  /* the top bar's logo on the line of the page's edge (24px here) */
  body.rf .mobile-topbar {
    padding-inline-end: 24px;
  }
  body.rf #contentArea:has(.editor-shell) {
    padding: calc(52px + 6px) 8px 6px;
  }
}

@media (max-width: 960px) {
  /* The activity button sat in the bottom-left corner over the page: over
     «צור וידאו» and the length on «קטעים», over «חורף» in «הגדרות הסרט»,
     over the files' delete buttons, over the editor's track names. Here it
     lives in the top bar, beside ☰, where nothing is under it; its panel
     drops down under the bar. The open drawer and any window still cover it
     (z-index 501 = the bar's own layer; polish.css drops it under a window). */
  body.rf .activity-center {
    top: calc(env(safe-area-inset-top, 0px) + 7px);
    bottom: auto;
    inset-inline-start: 62px;
    inset-inline-end: auto;
    z-index: 501;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0;
  }
  body.rf .ac-pill {
    height: 38px;
    box-shadow: none;
  }
  body.rf .ac-pill.ac-compact {
    width: 38px;
  }
  body.rf .ac-panel {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 60px);
    inset-inline: 12px;
    width: auto;
    max-width: 380px;
    max-height: min(460px, calc(100dvh - 80px));
  }
  /* the toasts no longer need to stand above the button */
  body.rf .toast-container.ac-lift {
    bottom: calc(
      max(16px, env(safe-area-inset-bottom, 16px)) + var(--ac-bar-clear, 0px)
    );
  }
}

/* a phone's top bar has room for the button, not for its words: the spinner
   or the moving logo says that something runs, the panel says what */
@media (max-width: 520px) {
  body.rf .ac-pill {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
  body.rf .ac-pill .ac-pill-label {
    display: none;
  }
}

/* The editor's tools bar at a tablet's / small window's width: the words
   under the icons were cut in the middle («ר לביט», «ודיו קטע») and ran into
   each other. Below 900px of bar the tools show their icons only, like on a
   phone (each keeps its name as a tooltip). */
@container editor-tools-bar (max-width: 900px) {
  body.rf .timeline-tools-bar .tb-btn-label {
    display: none;
  }
}

/* ================================================================
   English names inside the Hebrew page («No More Whining», «rimg-4», the
   song's words): a long one was cut at its START («…ore Whining»), because
   the cut side follows the page's direction. Each name now takes its own
   direction from its first letter, so an English name is cut at its end
   («No More Wh…»); it still lines up with the Hebrew around it.
   ================================================================ */
body.rf .home .project-title,
body.rf .files-panel .file-item-name,
body.rf .pc-idea-preview {
  unicode-bidi: plaintext;
}
body.rf .home .project-title:dir(rtl),
body.rf .files-panel .file-item-name:dir(rtl),
body.rf .pc-idea-preview:dir(rtl) {
  text-align: right;
}
body.rf .home .project-title:dir(ltr),
body.rf .files-panel .file-item-name:dir(ltr),
body.rf .pc-idea-preview:dir(ltr) {
  text-align: left;
}
