/* ══════════════════════════════════════════════════════════════════════
   Mobile shell — פריסת-טלפון (מתחת ל-768 פיקסלי-CSS).
   גל 1, יחידה A: גובה וגלילה. יחידה B: ניווט - סרגל עליון, ניווט תחתון והגיליון "עוד".
   יחידה C: הפריסה הקומפקטית של כרטיס הלקוח. גל 2: רשימות ככרטיסים וטפסים בעמודה אחת. הדשבורד: רצועת-מדדים, לוח, אירועי היום הנבחר, דורש טיפול. משימות: כרטיסים במסך הראשי ובכרטיס הלקוח, טופס במסך מלא. אירועים: אותו דפוס. תזכורות: כרטיסים במסך הראשי, התאמת הרשימה הקיימת בכרטיס הלקוח.
   תכנית: docs/MOBILE_ADAPTATION_PLAN.md.

   🔑 כל כללי-הפריסה בקובץ הזה נמצאים בתוך `@media (max-width: 767.98px)` — ברוחב 768px ומעלה
      הם אינם משפיעים על דבר, ולכן פריסת-הדסקטופ אינה משתנה. הכלל היחיד שמחוץ ל-media הוא
      זה שמסתיר את אלמנטי-הטלפון עצמם (הם קיימים ב-DOM בכל רוחב, ומוצגים רק בפריסת-טלפון).

   🔑 שני מצבים, לפי מחלקה על <html> שהמסך עצמו מצהיר עליה (`{% block html_class %}`):
      • בלי המחלקה (ברירת-המחדל, כל מסך שעוד לא הותאם) — המסגרת הקבועה של הדסקטופ נשארת,
        והפאנלים הפנימיים ממשיכים לגלול כמו היום. הכלל היחיד כאן מתאים את גובה-המסגרת
        לאזור הנראה בפועל.
      • `m-page-scroll` — המסך כולו גולל כעמוד אחד (גלילת-מסמך). מסך מצטרף רק אחרי
        שהפאנלים הפנימיים שלו הותאמו לכך; כרגע: כרטיס הלקוח בלבד.

   🔒 הסלקטורים גוברים בזכות ספציפיות (`html.m-page-scroll …`), לא בזכות `!important`:
      נעילת-הגלילה של Bootstrap בזמן חלון פתוח (`style="overflow:hidden"` על <body>) ממשיכה
      לעבוד. `!important` מופיע רק מול ערכי `style` שנכתבים בשורה (מסומן ליד כל כלל).
   ══════════════════════════════════════════════════════════════════════ */

/* אלמנטי-הטלפון (templates/_mobile_nav.html, כותרת-הגיליון ב-base.html): מוסתרים בכל רוחב,
   ומוצגים רק בתוך ה-media שלמטה. */
.mnav, .mnav-backdrop, .mnav-sheet-head,
.m-sheet-head, .cv-m-only, .m-only { display: none; }
#files-select-bar .btn.m-files-actions { display: none; }   /* `#files-select-bar .btn` (בדף) גובר על `.m-only`: כפתור-טלפון בשורת-הבחירה (גל 3, יחידה A) */

@media (max-width: 767.98px) {

  /* ── (1) מסכים שלא הצטרפו: המסגרת הקבועה, בגובה האזור הנראה ─────────────
     המסכים האלה נועלים את העמוד (`html, body { height:100%; overflow:hidden }`) ונותנים
     ל-.main-content גובה `100vh`. בדפדפן-טלפון `100vh` גבוה מהאזור הנראה כשסרגלי-הדפדפן
     מוצגים, והתחתית נחתכת בלי אפשרות לגלול אליה. שרשרת-אחוזים מ-<body> מגבילה את המסגרת
     לגובה שנראה בפועל. מסך שכבר שחרר את הנעילה בעצמו (`html, body { height:auto }`) אינו
     מושפע: אחוז מגובה לא-מוגדר אינו מגביל דבר. */
  html:not(.m-page-scroll) body > .container-fluid { height: 100%; }
  html:not(.m-page-scroll) .main-content { max-height: 100%; }

  /* ── (2) גלילת-מסמך (מסך שהצטרף) ───────────────────────────────────────
     העמוד גולל; .main-content בגובה התוכן שלו, ולפחות בגובה המסך. */
  html.m-page-scroll,
  html.m-page-scroll body { height: auto; overflow: visible; }

  html.m-page-scroll .main-content {
    height: auto;
    /* לפחות גובה המסך, פחות המקום שנשמר לניווט התחתון (4.1) - כך עמוד קצר אינו נגלל סתם. */
    min-height: calc(100vh - var(--mnav-h, 0px));
    min-height: calc(100dvh - var(--mnav-h, 0px));
    overflow: visible;
  }

  /* ── (3) כרטיס הלקוח — האבות והפאנלים הפנימיים ─────────────────────────
     בדסקטופ כל שכבה כאן היא `height:100%` / `flex:1` בתוך מסגרת בגובה המסך, והתוכן גולל
     בפאנל הפנימי. בגלילת-מסמך כל שכבה בגובה התוכן שלה. המבנה, הלשוניות, בחירת התיק
     והכפתורים אינם משתנים; עיצוב הכותרת, בורר-התיקים והלשוניות שייך ליחידה C. */

  /* העטיפה שמתחת ל-.main-content נושאת `height:100%` ב-style. */
  html.m-page-scroll .cv-root { height: auto !important; } /* מול style */

  html.m-page-scroll .cv-body,
  html.m-page-scroll .cv-side-column,
  html.m-page-scroll .cv-work-card { height: auto; }

  /* פאנל "תיקי עבודה" אינו חלק מזרימת-העמוד בטלפון: הוא נפתח כגיליון מבורר-התיק (יחידה C, למטה). */
  html.m-page-scroll .cv-cases-list { min-height: 0; }

  html.m-page-scroll .cv-content-area { flex: 0 0 auto; }

  /* הלשוניות שגובהן נכתב ב-style ע"י `_applyTabHeights` (px, לפי גובה אזור-התוכן):
     בגלילת-מסמך הגובה הוא גובה התוכן. */
  html.m-page-scroll #files-tab-content,
  html.m-page-scroll #client-details-tab-content,
  html.m-page-scroll #petek-tab-content,
  html.m-page-scroll #reminder-tab-content,
  html.m-page-scroll #report-tab-content,
  html.m-page-scroll #procedure-tab-content { height: auto !important; } /* מול style */

  /* טבלאות המשימות והאירועים: טבלת-דסקטופ רחבה, עד שתוחלף בכרטיסים (גל 2). היא צריכה
     גובה מוגדר (Tabulator מצייר רק את השורות הנראות), ולכן נשארת אזור-גלילה מקומי
     בגובה קבוע; `_applyTabHeights` קורא את הגובה הזה ומעביר אותו לטבלה. `svh` ולא `dvh`:
     הגובה אינו משתנה כשסרגלי-הדפדפן מופיעים ונעלמים, והטבלה אינה מצוירת מחדש בכל גלילה. */
  html.m-page-scroll #tasks-table-wrap,
  html.m-page-scroll #meetings-table-wrap {
    flex: 0 0 auto !important;       /* מול style="flex:1" */
    min-height: 320px !important;    /* מול style="min-height:0" */
    height: 70vh;
    height: 70svh;
  }

  /* קבצים: בדסקטופ הרשימה (46%) והתצוגה המקדימה זו לצד זו, לכל גובה הלשונית. ברוחב-טלפון
     אין לשתיהן מקום זו לצד זו (סרגל-הכלים של הרשימה נחתך), ולכן הן זו מתחת לזו: הרשימה
     בגובה התוכן שלה, והתצוגה המקדימה בגובה מוגדר. כרטיסי-קבצים ותצוגה במסך מלא — גל 3. */
  html.m-page-scroll #files-split { flex-direction: column; }
  html.m-page-scroll #files-pane {
    flex: 0 0 auto;
    height: auto;
    border-left: 0;
    border-bottom: 1px solid var(--border-color, #dee2e6);
  }
  /* סרגל-הכלים של הרשימה (נתיב + שלושה כפתורים) רחב מרוחב-טלפון, והכפתור האחרון ("הוסף קבצים")
     נחתך. כאן הוא נשבר לשורות: הנתיב בשורה משלו, והכפתורים מתחתיו. */
  html.m-page-scroll #files-toolbar { flex-wrap: wrap; }
  html.m-page-scroll #files-breadcrumb { flex: 1 1 100%; }
  html.m-page-scroll #files-toolbar .files-upload-btn { height: auto; min-height: 44px; }   /* גל 3, יחידה A: 44px (היה 32px) */

  html.m-page-scroll #files-tab-content:not(.preview-collapsed) #files-preview-pane {
    flex: 0 0 auto;
    height: 70vh;
    height: 70svh;
    min-height: 320px;
  }

  /* ══ יחידה B — ניווט-טלפון ══════════════════════════════════════════════
     שלושה חלקים, כולם מאלמנטים קיימים או מ-_mobile_nav.html:
       • סרגל עליון  = סרגל-הניווט הקיים (`.gnav`: חזרה + פירורי-לחם), בגובה 48px, דביק לראש.
       • ניווט תחתון = `.mnav` - ארבעה יעדים ו"עוד".
       • "עוד"       = סרגל-הצד הקיים (`#mainSidebar`) כגיליון שעולה מלמטה.
     סרגל-הצד כבר אינו תופס רוחב. המקום לניווט התחתון נשמר במקום אחד בלבד (4.1). */

  :root {
    --mnav-h: calc(56px + env(safe-area-inset-bottom, 0px));
    --gnav-h: 48px;      /* גם שמירת-המקום של nav_strip.css נגזרת ממנו, ולכן אין קפיצה בטעינה */
    --gnav-gap: 8px;
  }

  /* ── (4.1) מקום לניווט התחתון - פעם אחת, לכל סוגי המסכים ──────────────────
     הריפוד יושב על `.container-fluid`, האב של כל מסך:
       • מסך בגלילת-מסמך - הריפוד הוא סוף העמוד, והתוכן האחרון נגלל אל מעל הניווט.
       • מסך במסגרת קבועה - שרשרת-האחוזים של (1) מודדת את המסגרת מתוך תיבת-התוכן של
         `.container-fluid`, ולכן המסגרת (והפאנלים שגוללים בתוכה) מסתיימת מעל הניווט.
     `!important` מול `.container-fluid { padding: 0 !important }` שכל מסך מגדיר לעצמו. */
  .mnav ~ .container-fluid { padding-bottom: var(--mnav-h) !important; }

  /* ── (4.2) סרגל-הצד אינו תופס רוחב ────────────────────────────────────── */
  html .main-content,
  html .main-content:not(.sidebar-collapsed) { margin-right: 0 !important; } /* מול app.css ≤768px */

  /* ── (4.3) הסרגל העליון ────────────────────────────────────────────────
     אותו אלמנט ואותו סקריפט של הדסקטופ (nav_strip.js ממקם אותו כילד הראשון של .main-content).
     מוצגים רק שני הפירורים האחרונים - האב (קישור) והמסך הנוכחי - בשורה אחת; "קדימה" מוסתר.
     מסך בלי סרגל-ניווט (הדשבורד, שיש לו כותרת משלו עם הגדרות והתראות) נשאר בלי סרגל עליון. */
  body:has(#guronNav) .main-content { padding-top: 0 !important; }
  .main-content > .gnav {
    position: sticky; top: 0; z-index: 20;
    margin-inline: -0.6rem;            /* עד קצות המסך: .main-content מרופד ב-0.6rem מכל צד */
    padding-inline: 2px 0.6rem;
    gap: 2px;
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--text-body);
  }
  .main-content > .gnav .gnav-history { gap: 0; }
  .main-content > .gnav .gnav-btn {
    width: 44px; height: 44px;
    border: 0; border-radius: 10px; background: transparent;
    font-size: 1.3rem;
  }
  .main-content > .gnav #gnavForward { display: none; }
  .main-content > .gnav .gnav-crumb:not(:last-child):not(:nth-last-child(2)) { display: none; }
  .main-content > .gnav .gnav-crumb:nth-last-child(2) > .gnav-sep { display: none; }
  .main-content > .gnav .gnav-crumb:nth-last-child(2) { flex: 0 2 auto; max-width: 45%; }
  .main-content > .gnav .gnav-crumb:last-child { flex: 0 1 auto; min-width: 0; }
  .main-content > .gnav .gnav-link,
  .main-content > .gnav .gnav-text,
  .main-content > .gnav .gnav-current {
    max-width: 100%;
    height: 44px; line-height: 44px; padding-block: 0;
  }

  /* ── (4.4) הניווט התחתון ───────────────────────────────────────────────── */
  .mnav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; inset-inline: 0; bottom: 0;
    height: var(--mnav-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface-card);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(20, 36, 60, 0.07);
    z-index: 1030;                     /* מתחת לחלונות (1050+), לתפריטים ולהודעות */
    font-family: "Segoe UI", Arial, sans-serif;
  }
  .mnav-item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    min-width: 0; min-height: 56px;
    padding: 4px 2px;
    border: 0; background: transparent;
    color: var(--color-text-secondary);
    font: inherit; font-size: 0.72rem; font-weight: 600; line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mnav-item > .bi { font-size: 1.35rem; line-height: 1; }
  .mnav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mnav-item.is-active { color: var(--text-heading); font-weight: 700; }
  .mnav-item.is-active::before {
    content: ""; position: absolute; top: 0; inset-inline: 22%;
    height: 3px; border-radius: 0 0 3px 3px;
    background: var(--focus-ring-color);
  }
  .mnav-item:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: -3px; border-radius: 10px; }
  .mnav-badge { position: absolute; top: 5px; inset-inline-start: calc(50% + 4px); margin: 0; }

  /* ── (4.5) "עוד" - סרגל-הצד הקיים כגיליון ─────────────────────────────────
     אותו DOM: אותם קישורים ותנאי-הרשאה, אותו מתג-ארגון ואותו טופס-התנתקות (POST + CSRF).
     סגור: מחוץ למסך ו-`visibility:hidden` (לא ניתן למיקוד, לא נקרא). פתוח: `.is-m-open` (mobile_sheet.js).
     מצב הכיווץ של הדסקטופ (`.collapsed`, שנכפה ברוחב צר) אינו משתנה ואינו נשמר - כאן רק
     מבטלים את השפעתו החזותית. `!important` - מול כללי `.sidebar.collapsed` ו-≤768px של app.css. */
  html .sidebar,
  html .sidebar:not(.collapsed) {
    display: block;
    top: auto; right: 0; left: 0; bottom: 0;
    width: 100% !important;
    height: auto;
    max-height: 88vh; max-height: 88dvh;
    overflow-x: hidden; overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
    z-index: 1046;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  html .sidebar.is-m-open {
    transform: none;
    visibility: visible;
    transition: transform 0.22s ease;
  }
  .mnav-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(8, 15, 28, 0.5);
    z-index: 1045;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
    touch-action: none;
  }
  html.m-sheet-open .mnav-backdrop { opacity: 1; visibility: visible; transition: opacity 0.2s ease; }

  .mnav-sheet-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    position: sticky; top: 0; z-index: 2;
    padding: 6px 8px 6px 20px;
    background: var(--guron-navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .mnav-sheet-title { margin: 0; color: #fff; font-size: 1.05rem; font-weight: 700; }
  .mnav-sheet-close {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 10px; background: transparent;
    color: rgba(255, 255, 255, 0.85); font-size: 1.1rem; cursor: pointer;
  }
  .mnav-sheet-close:focus-visible,
  .sidebar .sidebar-logout-btn:focus-visible,
  .sidebar .sidebar-org-switch .dropdown-toggle:focus-visible,
  .sidebar .sidebar-nav a:focus-visible,
  .sidebar .sidebar-nav-bottom a:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

  /* בגיליון: הלוגו, כפתור הכיווץ וארבעת היעדים שכבר נמצאים בניווט התחתון אינם מוצגים. */
  .sidebar .sidebar-brand-row,
  .sidebar .sidebar-toggle-bar,
  .sidebar [data-mnav-primary] { display: none; }

  .sidebar .sidebar-nav { flex: none; overflow: visible; padding: 6px 0; }
  html .sidebar .nav-label { opacity: 1 !important; }
  .sidebar .sidebar-nav a,
  .sidebar .sidebar-nav-bottom a {
    min-height: 48px; padding: 12px 20px;
    white-space: normal;               /* תווית ארוכה נשברת לשורה ולא נחתכת */
  }
  /* קבוצות (משימות / עריכת מסמכים / המשרד שלי): בגיליון כל הקבוצות פתוחות, והכותרת היא תווית
     בלבד - לא כפתור. ביטול מלא של מצב ה-flyout של הסרגל המכווץ. */
  .sidebar .nav-parent { pointer-events: none; min-height: 0 !important; padding-block: 12px 4px !important;
                         color: rgba(255, 255, 255, 0.55); font-size: var(--text-small); font-weight: 700; }
  .sidebar .nav-parent > .bi, .sidebar .nav-parent .nav-arrow { display: none; }
  html .sidebar .sidebar-submenu,
  html .sidebar.collapsed .sidebar-submenu,
  html .sidebar.collapsed .sidebar-submenu.flyout-open {
    position: static;
    width: auto; max-height: none !important;
    padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
    overflow: visible;
  }
  html .sidebar .sidebar-submenu a,
  html .sidebar.collapsed .sidebar-submenu.flyout-open a { padding: 12px 20px !important; border-radius: 0; font-size: var(--text-body); }
  html .sidebar .sidebar-submenu .flyout-title { display: none !important; }

  /* אזור-החשבון: פרטי חשבון (העיגול והשם - אותו קישור קיים), הארגון / מתג-הארגון, והתנתקות. */
  .sidebar .sidebar-user {
    flex-wrap: wrap; gap: 10px 12px;
    padding: 14px 20px 16px;
    white-space: normal; overflow: visible;
  }
  html .sidebar .sidebar-user-info { opacity: 1 !important; width: auto !important; overflow: visible; min-width: 0; }
  .sidebar .sidebar-avatar { width: 44px; height: 44px; min-width: 44px; }
  .sidebar a.sidebar-user-link { min-height: 44px; white-space: normal; overflow: visible; font-size: var(--text-body); color: #fff; }
  .sidebar a.sidebar-user-link::after {
    content: "פרטי חשבון"; display: block;
    color: rgba(255, 255, 255, 0.6); font-size: var(--text-small);
  }
  .sidebar .sidebar-org-name,
  .sidebar .sidebar-org-switch .dropdown-toggle { white-space: normal; overflow: visible; font-size: var(--text-secondary); }
  .sidebar .sidebar-org-switch .dropdown-toggle { min-height: 44px; }
  .sidebar .sidebar-org-switch .dropdown-item { min-height: 44px; white-space: normal; }
  .sidebar .sidebar-user > form { flex: 1 0 100%; }
  .sidebar .sidebar-logout-btn {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; margin: 0; padding: 8px 12px;
    font-size: var(--text-body);
  }
  .sidebar .sidebar-logout-btn::after { content: "התנתקות"; font-weight: 600; }

  /* ── (4.6) אלמנטים קבועים בתחתית המסך ─────────────────────────────────── */
  /* סרגל-השמירה של הגדרות-המשרד: מעל הניווט, לכל רוחב המסך (בדסקטופ - עד סרגל-הצד). */
  html .save-bar,
  html .save-bar.sidebar-collapsed { bottom: var(--mnav-h); width: 100% !important; }
  /* הודעות קצרות ("טוסט"): מעל הניווט ולא עליו. `!important` - המיקום שלהן נכתב ב-style. */
  .guron-toast { bottom: calc(var(--mnav-h) + 12px) !important; }
  .wsv-note { inset-block-end: calc(var(--mnav-h) + 12px); }

  /* ══ יחידה C — כרטיס הלקוח: פריסה קומפקטית ══════════════════════════════
     מטרה: תוכן הלשונית הפעילה נראה כבר במסך הראשון (360×800). מעל התוכן נשארים רק: הסרגל
     העליון (48), שורת שם-הלקוח, שורת בורר-התיק ורצועת-לשוניות אחת.
     פקדי-הטלפון (`.cv-m-only`) נוצרים ב-static/js/client_view_mobile.js ומפעילים את הפקדים
     הקיימים; כללים שמסתירים פקד-דסקטופ תלויים ב-`.cv-m-ready` / `.cv-m-fab`, כך שבלי
     הסקריפט הכפתורים המקוריים פשוט נשארים במקומם. */

  /* ── (5.1) גיליון משותף: פאנל התיקים ומגש הפתקים (mobile_sheet.js) ──────── */
  .m-sheet-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    flex: 0 0 auto;
    min-height: 52px; padding: 4px 6px 4px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-card);
  }
  .m-sheet-title { color: var(--text-heading); font-size: 1.02rem; font-weight: 700; }
  .m-sheet-close, .cv-m-icon-btn {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 10px; background: transparent;
    color: var(--text-heading); font-size: 1.1rem; cursor: pointer;
  }
  .m-sheet-close:focus-visible, .cv-m-icon-btn:focus-visible,
  .cv-m-case:focus-visible, .cv-m-notes:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: -2px; }

  html.m-page-scroll #cv-cases-panel,
  html.m-page-scroll #case-bottom-bar {
    position: fixed; inset-inline: 0; bottom: 0; top: auto;
    width: auto; height: auto; min-height: 0;
    max-height: 85vh; max-height: 85dvh;
    margin: 0; padding: 0 0 env(safe-area-inset-bottom, 0px);
    border: 0; border-radius: 16px 16px 0 0;
    background: var(--surface-card);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
    z-index: 1046;
    overscroll-behavior: contain;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  html.m-page-scroll #cv-cases-panel.is-m-open,
  html.m-page-scroll #case-bottom-bar.is-m-open {
    transform: none; visibility: visible; transition: transform 0.22s ease;
  }

  /* ── (5.2) כותרת הכרטיס: שם הלקוח, חץ לפרטי הלקוח, תפריט ⋮ ───────────────── */
  html.m-page-scroll .cv-hero {
    flex-direction: row; align-items: flex-start; gap: 0 2px;
    padding: 2px 2px 2px 12px; padding-inline: 12px 2px;
    border-radius: 12px;
  }
  html.m-page-scroll .cv-root { gap: 6px !important; } /* מול style */
  html.m-page-scroll .main-content > .gnav { margin-bottom: 6px; }
  html.m-page-scroll .cv-hero-main { flex: 1 1 auto; min-width: 0; padding-block: 10px; }
  html.m-page-scroll .cv-hero h1 {
    font-size: 1.12rem; line-height: 1.3;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; overflow-wrap: anywhere;
  }
  /* שורת-המטא (מזהה, סטטוס, מונים) נפתחת מהחץ; כשהיא פתוחה השם מוצג במלואו. */
  html.m-page-scroll .cv-hero .cv-hero-meta { display: none; margin-top: 6px; }
  html.m-page-scroll .cv-hero.is-m-meta-open .cv-hero-meta { display: block; }
  html.m-page-scroll .cv-hero.is-m-meta-open h1 { display: block; overflow: visible; }
  html.m-page-scroll .cv-hero.is-m-meta-open #cvMMetaBtn > .bi { transform: rotate(180deg); }
  .cv-m-hero-tools { display: flex; flex: 0 0 auto; align-items: center; }
  .cv-m-actions .qa-menu { min-width: 190px; }
  .cv-m-hero-tools .qa-item, #cv-add-dropdown .qa-item { min-height: 44px; font-size: var(--text-body); }

  /* שורת-הפעולות המקורית אינה תופסת מקום: "עריכת לקוח" ו"הדפס" נמצאים בתפריט ⋮, ו"הוספה" צף. */
  html.m-page-scroll .cv-m-ready .hero-actions { display: contents; }
  html.m-page-scroll .cv-m-ready .hero-actions > .hero-btn { display: none; }

  /* ── (5.3) "הוספה" כפתור צף, ו"הוסף דיווח" בתוכו ─────────────────────────
     יושב מעל הניווט התחתון (במרווח, לא עליו), ומתחת לגיליונות ולחלונות בציר-z.
     התפריט נפתח כלפי מעלה. */
  html.m-page-scroll #cv-add-dropdown {
    position: fixed; inset-inline-end: 14px;
    bottom: calc(var(--mnav-h) + 14px);
    z-index: 1029;
  }
  html.m-page-scroll #cv-add-dropdown > .hero-btn {
    min-height: 48px; padding: 0 20px;
    border-radius: 999px;
    font-size: var(--text-body);
    box-shadow: 0 6px 18px rgba(16, 35, 63, 0.32);
  }
  html.m-page-scroll #cv-add-dropdown > .qa-menu {
    top: auto; bottom: calc(100% + 8px);
    max-height: 60vh; max-height: 60dvh; overflow-y: auto;
  }
  /* מקום בסוף העמוד, כדי שהכפתור הצף לא יכסה את השורה האחרונה של התוכן. */
  html.m-page-scroll .main-content { padding-bottom: 76px; }
  /* הכפתור הירוק "הוסף דיווח" מוחלף בפריט שבתפריט; הקלט-המהיר שלו נפתח מעל הניווט, לכל הרוחב. */
  html.m-page-scroll .cv-m-fab .cbb-report-wrap { display: contents; }
  html.m-page-scroll .cv-m-fab .cbb-report-btn { display: none; }
  html.m-page-scroll .cv-m-fab #cbb-quick {
    position: fixed; top: auto; left: 10px; right: 10px;
    bottom: calc(var(--mnav-h) + 10px);
    width: auto; max-width: none;
    z-index: 1040;
  }
  html.m-page-scroll .cv-m-fab #cbb-quick::after { display: none; }

  /* ── (5.4) שורת-ההקשר: בורר תיק העבודה ומונה הפתקים ─────────────────────── */
  html.m-page-scroll .cv-body { display: block; }
  html.m-page-scroll .cv-side-column { display: contents; }
  html.m-page-scroll .cv-m-ready .cv-work-header { display: none; }
  .cv-m-ctx {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-card);
  }
  .cv-m-case {
    flex: 1 1 auto; min-width: 0; min-height: 44px;
    display: flex; align-items: center; gap: 8px;
    padding: 4px 12px;
    border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--surface-card-alt); color: var(--text-heading);
    font: inherit; font-size: var(--text-body); text-align: start; cursor: pointer;
  }
  .cv-m-case-label { flex: 0 0 auto; color: var(--color-text-secondary); font-size: var(--text-small); }
  .cv-m-case-value { flex: 1 1 auto; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* מספר-תיק ארוך נחתך בסופו, לא בתחילתו: הערך כולו משמאל-לימין, צמוד לימין. המלא - ב-title ובתווית-הנגישות. */
  .cv-m-case-value.is-number { direction: ltr; text-align: right; }
  .cv-m-case.is-empty .cv-m-case-value { font-weight: 600; color: var(--color-text-secondary); }
  .cv-m-case > .bi { flex: 0 0 auto; font-size: 0.8rem; color: var(--color-text-secondary); }
  .cv-m-level {
    flex: 0 0 auto; padding: 2px 8px; border-radius: 999px;
    background: var(--surface-card-alt); border: 1px solid var(--border-color);
    color: var(--color-text-secondary); font-size: var(--text-small); font-weight: 600; white-space: nowrap;
  }
  .cv-m-level[hidden] { display: none; }
  .cv-m-notes {
    flex: 0 0 auto; min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 0 10px;
    border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--surface-card); color: var(--color-text-secondary);
    font: inherit; font-size: var(--text-body); cursor: pointer;
  }
  .cv-m-notes.has-items { color: var(--text-heading); }
  .cv-m-notes-count { font-weight: 700; font-variant-numeric: tabular-nums; }

  /* פאנל התיקים בתוך הגיליון: הכותרת של הגיליון מחליפה את "תיקי עבודה"; הרשימה היא שגוללת. */
  html.m-page-scroll #cv-cases-panel .cv-cases-title { display: none; }
  html.m-page-scroll #cv-cases-panel .cv-cases-header { justify-content: flex-end; }
  html.m-page-scroll #cv-cases-panel .cv-cases-list { flex: 1 1 auto; min-height: 120px; padding: 6px 8px 12px; }
  html.m-page-scroll #cv-cases-panel .cv-case-edit-btn { width: 44px; height: 44px; }

  /* מגש הפתקים בתוך הגיליון: כותרת מהגיליון, הפתקים בשורות שנשברות, בלי חיצים ובלי כיווץ. */
  html.m-page-scroll #case-bottom-bar { display: flex !important; flex-direction: column; align-items: stretch; gap: 0; } /* מול style="display:none" כשאין פריטים */
  html.m-page-scroll #case-bottom-bar > .cbb-tray-toggle { display: none; }
  html.m-page-scroll #case-bottom-bar > .cbb-tray-body { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 14px 16px; }
  html.m-page-scroll #case-bottom-bar .cbb-tray-inner { display: block; overflow: visible; opacity: 1; visibility: visible; }
  html.m-page-scroll #case-bottom-bar .cbb-notes-scroll { overflow: visible; }
  html.m-page-scroll #case-bottom-bar #notes-preview-bar { width: auto; flex-wrap: wrap; }
  html.m-page-scroll #case-bottom-bar .cbb-arrow { display: none !important; } /* מול style */
  .cv-m-notes-empty { display: block; margin: 8px 0 4px; color: var(--color-text-secondary); font-size: var(--text-body); text-align: center; }
  .cv-m-notes-empty[hidden] { display: none; }

  /* ── (5.5) רצועת-לשוניות אחת, נגללת אופקית בתוך עצמה ───────────────────── */
  html.m-page-scroll .cv-tab-bar {
    flex-wrap: nowrap; gap: 6px; padding: 3px 8px;
    overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  html.m-page-scroll .cv-tab-bar::-webkit-scrollbar { display: none; }
  html.m-page-scroll .cv-tab { height: 44px; padding: 0 14px; }                  /* גל 5, יחידה A: 40 → 44 */
  html.m-page-scroll .cv-root :is(.section-edit-btn, .section-save-btn, .section-cancel-btn) { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }   /* "עריכה" / שמירה / ביטול בפרטי הלקוח */

  /* ── (5.6) פרטי לקוח: תווית וערך בשורה אחת לכל שדה, בלי חפיפה ────────────
     בדסקטופ כל שורת-טבלה מחזיקה שני שדות (תווית | ערך | תווית | ערך) ברוחב קבוע. כאן כל
     שורה נשברת לשתיים, והערך נשבר לשורות כשהוא ארוך (כתובת-דוא"ל, מזהה). טבלה עם כותרת
     (בעלי החברה) נשארת טבלה. */
  html.m-page-scroll #client-details-tab-content { padding: 10px 10px !important; } /* מול style */
  html.m-page-scroll .client-info-4col { display: block; table-layout: auto !important; } /* מול style */
  html.m-page-scroll .client-info-4col > colgroup { display: none; }
  html.m-page-scroll .client-info-4col > tbody { display: block; }
  html.m-page-scroll .client-info-4col > tbody > tr { display: flex; flex-wrap: wrap; }
  html.m-page-scroll .client-info-4col > tbody > tr > td { display: block; width: auto; padding: 8px 6px; min-width: 0; }
  html.m-page-scroll .client-info-4col > tbody > tr > td.field-label { flex: 0 0 38%; max-width: 38%; white-space: normal; }
  html.m-page-scroll .client-info-4col > tbody > tr > td.field-value { flex: 1 1 62%; max-width: 62%; overflow-wrap: anywhere; }
  html.m-page-scroll .client-info-4col > thead ~ tbody { display: table-row-group; }
  html.m-page-scroll .client-info-4col > thead ~ tbody > tr { display: table-row; }
  html.m-page-scroll .client-info-4col > thead ~ tbody > tr > td { display: table-cell; max-width: none; overflow-wrap: anywhere; }

  /* ══ יחידה D — תיקוני-גימור ═══════════════════════════════════════════════ */

  /* ── (6.1) הסרגל העליון בכרטיס הלקוח: קישור-האב ותווית "כרטיס לקוח" ───────────
     שם הלקוח מוצג בשורת-השם שמתחת, ולכן אינו חוזר כאן. הפירור הראשון (הרשימה שממנה הגיעו)
     נשאר קישור; שאר הפירורים אינם מוצגים בטלפון, ובמקומם התווית שנוספת ב-client_view_mobile.js. */
  html.m-page-scroll .main-content > .gnav.gnav--m-context .gnav-trail { display: flex; align-items: center; gap: 2px; }
  html.m-page-scroll .main-content > .gnav.gnav--m-context .gnav-crumbs { flex: 0 1 auto; }
  html.m-page-scroll .main-content > .gnav.gnav--m-context .gnav-crumb:not(:first-child) { display: none; }
  html.m-page-scroll .main-content > .gnav.gnav--m-context .gnav-crumb:first-child { display: flex; flex: 0 1 auto; max-width: none; }
  .gnav-m-label {
    display: inline-flex; align-items: center; gap: 2px;
    flex: 0 1 auto; min-width: 0;
    height: 44px;
    color: var(--text-heading); font-weight: 700; white-space: nowrap;
  }
  .gnav-m-label-text { overflow: hidden; text-overflow: ellipsis; padding: 0 5px; }

  /* ── (6.2) ערכת-הנושא הכהה: לשוניות וצ'יפים של סרגל-הלשונית ────────────────
     הרקע של לשונית לא-פעילה כתוב כצבע בהיר קבוע, והטקסט שלה לוקח את צבע-הטקסט של הערכה הכהה
     (בהיר) - בהיר על בהיר. הבעיה קיימת גם בדסקטופ וקדמה להתאמה לנייד; כאן היא מתוקנת לפריסת-
     טלפון בלבד, בטוקנים של הערכה. הלשונית הפעילה נשארת בכחול-הכהה עם טקסט לבן, ומקבלת מסגרת בהירה. */
  html.theme-dark.m-page-scroll .cv-tab,
  html.theme-dark.m-page-scroll .cv-type-chip {
    background: var(--surface-card-alt); border-color: var(--border-color); color: var(--text-primary);
  }
  html.theme-dark.m-page-scroll .cv-tab .badge,
  html.theme-dark.m-page-scroll .cv-type-chip .chip-count {
    background: var(--surface-card); color: var(--text-primary);
  }
  html.theme-dark.m-page-scroll .cv-tab.active,
  html.theme-dark.m-page-scroll .cv-type-chip.active {
    background: #1f3657; border-color: var(--focus-ring-color); color: #fff;
  }
  html.theme-dark.m-page-scroll .cv-tab.active .badge,
  html.theme-dark.m-page-scroll .cv-type-chip.active .chip-count { background: rgba(255, 255, 255, 0.18); color: #fff; }
  html.theme-dark.m-page-scroll .cv-tab:not(.active):hover,
  html.theme-dark.m-page-scroll .cv-type-chip:not(.active):hover { background: var(--surface-card); border-color: var(--focus-ring-color); color: var(--text-heading); }
  html.theme-dark.m-page-scroll .cv-tab-label { color: var(--color-text-secondary); }
  html.theme-dark.m-page-scroll .cv-tab-sep { background: var(--border-color); }
  /* הכפתור הצף "הוספה" כחול-כהה על רקע כהה: מסגרת בהירה מפרידה אותו מהתוכן שמאחוריו. */
  html.theme-dark.m-page-scroll #cv-add-dropdown > .hero-btn { border-color: var(--focus-ring-color) !important; } /* מול כלל הכפתורים של הערכה הכהה ב-theme.css */
  /* טבעת-מיקוד ברורה ללשונית בשתי הערכות (המקלדת, וגם מסך-מגע עם מקלדת חיצונית). */
  html.m-page-scroll .cv-tab:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 1px; }

  /* ══ גל 2 — רשימות ככרטיסים (static/js/mobile_list.js) ═══════════════════════
     הטבלה נשארת בעמוד (היא מקור הנתונים, הסינון והמיון) אבל אינה מוצגת; במקומה - רשימת
     כרטיסים במבנה קבוע לכל מסך, שאינו תלוי בעמודות שנבחרו בדסקטופ. הכללים המשותפים כאן;
     מה שמיוחד למסך - מתחתם. */
  .m-list { display: block; }
  .m-list-status { margin: 0 2px 8px; color: var(--color-text-secondary); font-size: var(--text-small); }
  .m-list-status:empty { display: none; }
  .m-cards { display: flex; flex-direction: column; gap: 8px; }
  .m-card {
    display: flex; flex-direction: column; gap: 6px;
    min-width: 0; padding: 12px 14px;
    background: var(--surface-card); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: 12px;
    box-shadow: 0 1px 4px rgba(20, 36, 60, 0.05);
    cursor: pointer;
  }
  .m-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
  .m-card-title {
    flex: 1 1 auto; min-width: 0;
    color: var(--text-heading); font-size: 1.02rem; font-weight: 700; line-height: 1.35;
    text-decoration: none; overflow-wrap: anywhere;
  }
  .m-card-title:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; border-radius: 4px; }
  .m-card-kind {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 999px;
    background: var(--surface-card-alt); border: 1px solid var(--border-color);
    color: var(--color-text-secondary); font-size: var(--text-small); font-weight: 600; white-space: nowrap;
  }
  .m-card-kind.is-company { color: var(--text-heading); border-color: var(--text-heading); }
  .m-card-sub { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--color-text-secondary); font-size: var(--text-secondary); }
  .m-card-field { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; }
  .m-card-label { font-size: var(--text-small); }
  .m-card-value { color: var(--text-primary); font-weight: 600; overflow-wrap: anywhere; }
  .m-card-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .m-card-chips .m-cell { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
  /* אזור-מגע של 44px; השוליים השליליים משאירים את הכרטיס בגובהו (השורה עצמה נשארת 32px). */
  .m-card-more > summary {
    display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin-block: -6px;
    color: var(--focus-ring-color); font-size: var(--text-small); font-weight: 600; cursor: pointer;
  }
  .m-card-more > summary:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; border-radius: 4px; }
  .m-card-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 4px 0 0; font-size: var(--text-secondary); }
  .m-card-dl dt { color: var(--color-text-secondary); font-weight: 400; }
  .m-card-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
  .m-list-empty[hidden] { display: none; }
  .m-list-empty {
    margin: 0; padding: 28px 16px; text-align: center; color: var(--color-text-secondary);
    background: var(--surface-card); border: 1px dashed var(--border-color); border-radius: 12px;
  }
  .m-list-more {
    display: block; width: 100%; min-height: 44px; margin-top: 10px;
    border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--surface-card); color: var(--text-heading); font: inherit; font-weight: 600; cursor: pointer;
  }
  .m-list-more[hidden] { display: none; }

  /* כפתור "סינון" בשורת-החיפוש, ופאנל-המסננים הקיים כאזור שנפתח מתחתיה. כפתור-הכיווץ והידית
     של הדסקטופ (ששומרים את ההעדפה `wbFiltersCollapsed`) אינם מוצגים בטלפון. */
  .m-filter-btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 0 14px;
    border: 1px solid var(--border-color); border-radius: 999px;
    background: var(--surface-card); color: var(--text-heading); font: inherit; font-weight: 600; cursor: pointer;
  }
  .m-filter-btn.has-active { border-color: var(--focus-ring-color); }
  .m-filter-btn[aria-expanded="true"] { background: var(--surface-card-alt); }
  .m-filter-count {
    min-width: 20px; padding: 0 6px; border-radius: 999px; text-align: center;
    background: var(--focus-ring-color); color: var(--surface-card); font-size: var(--text-small); font-weight: 700;
  }
  .m-filter-count[hidden] { display: none; }
  .m-filter-btn:focus-visible, .m-filter-reset:focus-visible, .m-sort-select:focus-visible,
  .m-sort-dir:focus-visible, .m-list-more:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; }
  html.m-page-scroll .main-content .wb-workbench,
  html.m-page-scroll .main-content .wb-main-col { display: block; }
  html.m-page-scroll .main-content .wb-filter-collapse-btn,
  html.m-page-scroll .main-content .wb-workbench .wb-filter-handle { display: none !important; } /* מול מצב-הכיווץ של הדסקטופ */
  html.m-page-scroll .main-content .wb-workbench .wb-filter-panel {
    display: none !important;                       /* סגור כברירת-מחדל; מול מצב-הכיווץ / הפתיחה של הדסקטופ */
    width: auto !important; max-height: none; overflow: visible; /* מול הרוחב הקבוע (230px) של הדסקטופ */
    margin: 0 0 10px;
  }
  html.m-page-scroll .main-content .wb-workbench.m-filters-open .wb-filter-panel { display: block !important; }
  /* בתוך הפאנל: לכל קבוצה - תווית, ומתחתיה הכפתורים בשורות שנשברות. */
  html.m-page-scroll .main-content .wb-filter-panel .toolbar-filters,
  html.m-page-scroll .main-content .wb-filter-panel .m-funnels {
    display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px;
  }
  html.m-page-scroll .main-content .wb-filter-panel .m-funnels { margin-top: 12px; }
  html.m-page-scroll .main-content .wb-filter-panel .wb-filter-label { flex: 1 0 100%; padding-inline-end: 0; }
  html.m-page-scroll .main-content .wb-filter-panel .wb-filter-label { color: var(--color-text-secondary); }   /* גל 5, יחידה A: 3.61:1 */
  html.m-page-scroll .main-content .wb-filter-panel .filter-btn { width: auto !important; min-height: 44px; } /* מול הרוחב המלא של הדסקטופ */
  .m-funnel-btn.col-filter-btn { opacity: 1; margin: 0; }   /* מול כללי משפך-העמודה (מופיע רק בריחוף) */
  .m-funnel-btn.col-filter-btn::after { content: " ▾"; }
  .m-sort { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
  .m-sort-label { margin: 0; color: var(--color-text-secondary); font-size: var(--text-small); font-weight: 700; white-space: nowrap; }
  .m-sort-select {
    flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 10px;
    border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--surface-card); color: var(--text-primary); font: inherit; font-size: max(16px, 1rem);
  }
  .m-sort-dir {
    flex: 0 0 auto; width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--surface-card); color: var(--text-heading); font-size: 1.15rem; cursor: pointer;
  }
  .m-sort-dir:disabled { opacity: 0.45; cursor: default; }
  .m-filter-tools { display: flex; justify-content: flex-end; margin-top: 12px; }
  .m-filter-reset {
    min-height: 44px; padding: 0 16px;
    border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--surface-card); color: var(--text-heading); font: inherit; font-weight: 600; cursor: pointer;
  }
  .m-filter-reset:disabled { opacity: 0.5; cursor: default; }
  /* שורת-החיפוש: שדה-החיפוש בשורה מלאה, ומתחתיו "סינון" ו"נקה חיפוש". */
  html.m-page-scroll .main-content .wt-search-row { gap: 8px; }
  html.m-page-scroll .main-content .wt-search-row .toolbar-search-input {
    flex: 1 1 100%; min-width: 0; height: 44px; font-size: max(16px, 1rem);
  }
  html.m-page-scroll .main-content .wt-search-row .toolbar-action-btn { min-height: 44px; }
  /* חלונית "סינון לפי ערכים" הקיימת: בדסקטופ היא נצמדת למשפך שבכותרת-העמודה (top / left בסגנון
     שהסקריפט כותב). בטלפון - לרוחב המסך, מתחת לסרגל העליון, כדי שלא תרד מתחת לתחתית המסך ושהמקלדת
     לא תכסה אותה. */
  html.m-page-scroll #col-filter-popup {
    top: calc(var(--gnav-h) + 8px) !important; left: 8px !important; right: 8px; /* מול style */
    max-height: min(60vh, 420px);
  }
  html.m-page-scroll #col-filter-popup label { white-space: normal; min-height: 44px; font-size: var(--text-body); }
  html.m-page-scroll #col-filter-popup .cpop-search { min-height: 44px; font-size: max(16px, 1rem) !important; } /* מול style */
  html.m-page-scroll #col-filter-popup .btn { min-height: 44px; font-size: var(--text-secondary) !important; } /* מול style */

  /* ── מסך הלקוחות ───────────────────────────────────────────────────────────
     הכותרת "לקוחות" כבר בסרגל העליון; "+ לקוח חדש" הוא כפתור צף מעל הניווט התחתון, כמו "הוספה"
     בכרטיס הלקוח. כרטיס-הטבלה אינו מוצג: הכרטיסים באים במקומו (אותם נתונים). */
  html.m-page-scroll .clients-hero { display: contents; }
  html.m-page-scroll .clients-hero > div:first-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  html.m-page-scroll .clients-hero .hero-actions {
    position: fixed; inset-inline-end: 14px; bottom: calc(var(--mnav-h) + 14px); z-index: 1029;
  }
  html.m-page-scroll .clients-hero .hero-actions > .hero-btn {
    min-height: 48px; padding: 0 20px; border-radius: 999px;
    font-size: var(--text-body); box-shadow: 0 6px 18px rgba(16, 35, 63, 0.32);
  }
  html.theme-dark.m-page-scroll .clients-hero .hero-actions > .hero-btn { border-color: var(--focus-ring-color) !important; } /* מול כלל הכפתורים של הערכה הכהה ב-theme.css */
  html.m-page-scroll .clients-table-card {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); pointer-events: none;
  }

  /* ── טופס "הקמת לקוח חדש" (העמוד /clients/new והחלון #newClientModal) ───────────
     אותם שדות, אותם אזורים מותנים (פרטי / חברה) ואותן פעולות; בטלפון - עמודה אחת. שורת "מזהה
     לקוח" וכפתורי "לקוח פרטי / חברה" נשברת לשתי שורות במקום לגלוש מהמסך. גודל-הטקסט בשדות אינו
     יורד מ-16px (דפדפן-טלפון מגדיל את העמוד במיקוד בשדה קטן יותר). */
  #newClientForm .row > [class*="col-"],
  #newClientFormPage .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  #newClientForm .row, #newClientFormPage .row { row-gap: 12px; }
  #newClientForm > .d-flex.bg-light,
  #newClientFormPage > .d-flex.bg-light { flex-wrap: wrap; gap: 8px 12px; }
  #newClientForm #nc_display_id, #newClientFormPage #nc_display_id { width: 10ch !important; } /* מול style: שדה ברוחב ברירת-המחדל דחף את השורה מחוץ למסך */
  #newClientForm #nc_display_id, #newClientFormPage #nc_display_id { min-height: 44px; font-size: max(16px, 1rem); }   /* גל 5, יחידה A: 26px */
  #newClientForm .form-control, #newClientForm .form-select,
  #newClientFormPage .form-control, #newClientFormPage .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  #newClientForm .owner-row .row.mb-1, #newClientFormPage .owner-row .row.mb-1 { margin-bottom: 12px !important; } /* מול mb-1: רווח אחיד בין שדות הבעלים */
  #newClientForm .btn, #newClientFormPage .btn { min-height: 44px; }                 /* גל 5, יחידה A: 40 → 44 */
  #newClientFormPage > .d-flex.justify-content-between .btn { min-height: 44px; padding-inline: 18px; }
  /* העמוד /clients/new עטוף בשני מיכלים עם ריפוד; בטלפון הפנימי מוותר על שלו, והשדות מתרחבים. */
  .container-fluid:has(> .card #newClientFormPage) { padding-inline: 0; }
  /* ערכה כהה: שורת "מזהה לקוח" היא `bg-light` (רקע בהיר קבוע) עם טקסט בהיר - לא קריא. בטלפון היא
     מקבלת משטח כהה; כפתורי-המתאר האפורים ("ביטול", "חזרה") מקבלים את צבע-הטקסט המשני. */
  html.theme-dark #newClientForm > .d-flex.bg-light,
  html.theme-dark #newClientFormPage > .d-flex.bg-light { background-color: var(--surface-card-alt) !important; } /* מול bg-light של Bootstrap */
  html.theme-dark #newClientForm #nc_display_id,
  html.theme-dark #newClientFormPage #nc_display_id { color: var(--focus-ring-color) !important; }               /* מול text-primary של Bootstrap */
  html.theme-dark #newClientForm .btn-outline-primary,
  html.theme-dark #newClientFormPage .btn-outline-primary { color: var(--focus-ring-color); border-color: var(--focus-ring-color); }
  html.theme-dark #newClientModal .btn-outline-secondary,
  html.theme-dark .card:has(#newClientFormPage) .btn-outline-secondary { color: var(--color-text-secondary); border-color: var(--border-color); }
  /* החלון - במסך מלא: כותרת למעלה, הטופס גולל באמצע, "שמור" ו"ביטול" תמיד בתחתית. */
  #newClientModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #newClientModal .modal-content { height: 100%; border: 0; border-radius: 0; }
  #newClientModal .modal-body { flex: 1 1 auto; max-height: none !important; overflow-y: auto; } /* מול style */
  #newClientModal .modal-footer .btn, #newClientModal .app-modal-footer .btn { min-height: 44px; }

  /* ══ גל 2, יחידה B — הדשבורד ═════════════════════════════════════════════
     סדר-הטלפון: כותרת קומפקטית · רצועת-מדדים · לוח-שנה · האירועים של היום הנבחר · "דורש טיפול".
     העמוד גולל כמסמך אחד (אין רשימה שגוללת בתוך כרטיס). הנתונים, בחירת-היום והפעולות הם הקוד הקיים
     של הדשבורד; כאן רק ההצגה. סדר שני הכרטיסים התחתונים: static/js/dashboard_mobile.js.
     הכללים של הדשבורד עצמו (בתבנית) אינם משתנים; אלה גוברים עליהם בספציפיות. */
  /* אין כאן כפתור צף, ולכן אין צורך ברווח-הסיום של 76px. */
  html.m-page-scroll .main-content:has(> .dash-hero) { padding: 10px 12px 16px; gap: 10px; }

  /* ── כותרת: ברכה ותאריך, וארבעת הפקדים בשורה אחת ───────────────────────────
     במסך צר הפקדים יורדים לשורה משלהם; כשיש מקום (טלפון רחב / מסך של 700px) הם נשארים לצד הברכה.
     הברכה מתכווצת ונשברת - היא לעולם אינה דוחפת את הפקדים אל מחוץ למסך. חלונית-ההתראות מעוגנת
     לכותרת כולה (ולא לפעמון), כך שהיא תמיד בתוך המסך. */
  html.m-page-scroll .dash-hero {
    position: relative; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 2px;
  }
  html.m-page-scroll .dash-hero .hero-title {
    flex: 1 1 14rem; min-width: 0;
    flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 10px;
  }
  html.m-page-scroll .dash-hero .hero-actions { flex: 0 1 auto; max-width: 100%; margin-right: auto; } /* בקצה השמאלי, כמו בדסקטופ (הסרגל עצמו `ltr`, ולכן צד פיזי) */
  html.m-page-scroll .dash-hero .kpi-alerts { position: static; }
  html.m-page-scroll .dash-hero .alerts-pop { inset-inline: auto 0; width: min(390px, 100%); }
  html.m-page-scroll .dash-hero h1 { font-size: 1.2rem; }
  html.m-page-scroll .dash-hero .sub { font-size: var(--text-small); }
  html.m-page-scroll .dash-hero .hero-actions { --hero-ctl-h: 44px; gap: 4px; justify-content: space-between; }   /* גל 5, יחידה A: 40 → 44 */
  /* גודל-הטקסט של הפקדים מוגבל ברוחב המסך: גם בגודל-טקסט רגיל / גדול ארבעתם נכנסים בשורה אחת ב-360px. */
  html.m-page-scroll .dash-hero .btn-new,
  html.m-page-scroll .dash-hero .scope-toggle { font-size: min(var(--text-secondary), 3.7vw); }
  html.m-page-scroll .dash-hero .btn-new { padding: 0 9px; gap: 5px; }
  html.m-page-scroll .dash-hero .btn-new i { font-size: min(0.95rem, 4.2vw); }
  html.m-page-scroll .dash-hero .btn-new .qa-caret { display: none; }
  html.m-page-scroll .dash-hero .scope-btn { padding: 0 7px; }
  /* גל 5, יחידה A: ארבעה פקדים של 44px אינם נכנסים בשורה אחת ב-360px (314px מול 303px). "חדש", ההגדרות
     וההתראות בשורה הראשונה; מתג אישי / משרדי בשורה משלו, ברוחב מלא, ושני חלקיו בגובה 44px. */
  html.m-page-scroll .dash-hero .scope-box { flex: 1 1 100%; }
  html.m-page-scroll .dash-hero .scope-toggle { display: flex; width: 100%; height: auto; padding: 0; }   /* החלקים עצמם 44px (בלי ריפוד-המסגרת) */
  html.m-page-scroll .dash-hero .scope-btn { flex: 1 1 0; min-height: 44px; }
  /* ערכה כהה (טלפון): "חדש" לבן על הכחול הראשי (#4d7fc4) 4.08:1, והחלק הנבחר של המתג 3.54:1. */
  html.theme-dark.m-page-scroll .dash-hero .btn-new { background-color: #2f5f9e; border-color: #2f5f9e; }
  html.theme-dark.m-page-scroll .dash-hero .scope-btn[aria-pressed="true"] { color: var(--focus-ring-color); }   /* הכחול הראשי על הגוון שלו */
  html.m-page-scroll .dash-hero .qa-item { min-height: 44px; }
  html.m-page-scroll .dash-hero .alerts-pop { max-height: min(70vh, 480px); max-height: min(70dvh, 480px); }
  html.m-page-scroll .dash-hero .alerts-close { width: 44px; height: 44px; }
  html.m-page-scroll .dash-hero .notif-read { min-height: 44px; }

  /* ── מדדים: רצועה אחת של חמישה תאים — מספר, ומתחתיו התווית ──────────────────
     אותם חמישה מדדים, אותם ערכים ואותם קישורים; בלי אריח-האייקון ובלי הריפוד של כרטיס מלא.
     התווית נשברת לשורות בתוך התא; גודל-הטקסט מוגבל ברוחב המסך, כדי שגם בגודל-טקסט גדול מילה
     ארוכה ומספר בן חמש ספרות ייכנסו בתא של 360px. */
  html.m-page-scroll .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  html.m-page-scroll .kpi-grid > .kpi-card,
  html.m-page-scroll .kpi-grid > .kpi-card:nth-child(n+4),
  html.m-page-scroll .kpi-grid > .kpi-card:last-child { grid-column: auto; }
  html.m-page-scroll .kpi-card { display: block; padding: 8px 3px 9px; min-height: 60px; text-align: center; }
  html.m-page-scroll .kpi-chip { display: none; }
  html.m-page-scroll .kpi-main { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  html.m-page-scroll .kpi-figure { display: contents; }
  html.m-page-scroll .kpi-num { order: 1; font-size: min(1.3rem, 5.8vw); line-height: 1.15; overflow-wrap: anywhere; }
  html.m-page-scroll .kpi-top { order: 2; justify-content: center; }
  html.m-page-scroll .kpi-label { font-size: min(0.75rem, 3.3vw); line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
  html.m-page-scroll .kpi-sub { order: 3; font-size: min(0.7rem, 3.1vw); line-height: 1.25; white-space: normal; }
  html.m-page-scroll .kpi-sub:has(.metric-today[hidden]) { display: none; }

  /* ── לוח-שנה: "לוח שנה" והניווט בשורה אחת, ומתחתם טווח-התאריכים ─────────────── */
  html.m-page-scroll .cal-head { flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 8px 12px 6px; }
  html.m-page-scroll .cal-titles { display: contents; }
  html.m-page-scroll .cal-head #calTitle { flex: 1 1 auto; min-width: 0; }
  html.m-page-scroll .cal-head #calLabel { order: 3; flex: 1 1 100%; font-size: var(--text-small); line-height: 1.4; }
  html.m-page-scroll .cal-head .cal-nav { margin-inline-start: auto; gap: 6px; }
  html.m-page-scroll .cal-nav-btn { min-width: 44px; height: 44px; }                 /* גל 5, יחידה A: 40 → 44 */
  html.m-page-scroll .cal-nav-ic { flex-basis: 44px; }
  html.m-page-scroll .cal-today-btn { height: 44px; padding: 0 14px; }

  /* ── שני הכרטיסים התחתונים: בגובה תוכנם, בלי גלילה פנימית ───────────────── */
  html.m-page-scroll .mid-row { gap: 10px; }
  html.m-page-scroll .mid-row .panel-head { padding: 11px 14px 6px; }
  html.m-page-scroll .focus-panel .panel-body,
  html.m-page-scroll .day-panel .panel-body { max-height: none; overflow: visible; padding: 0 6px 8px; }
  html.m-page-scroll .day-hero { margin: 0 6px; padding: 8px 12px; gap: 6px 12px; }
  html.m-page-scroll .day-tile { width: 46px; height: 46px; border-radius: 11px; }
  html.m-page-scroll .day-tile-num { font-size: 1.2rem; }
  /* יום בלי אירועים: שורה אחת קומפקטית, לא אריח גדול במרכז כרטיס גבוה. */
  html.m-page-scroll .day-block.is-alone .sc-empty { margin: 0; flex-direction: row; text-align: start; gap: 12px; padding: 10px; }
  html.m-page-scroll .day-block.is-alone .sc-empty-ic { width: 36px; height: 36px; border-radius: 10px; font-size: 1.1rem; }
  /* שורה: יעד-מגע של 48px לפחות; כותרת ארוכה נשברת לשתי שורות במקום להיחתך אחרי כמה מילים. */
  html.m-page-scroll .mid-row .sc-row { min-height: 48px; gap: 10px; padding: 6px 8px; }
  html.m-page-scroll .mid-row .sc-title {
    white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  html.m-page-scroll .mid-row .sc-time { flex-basis: 2.7rem; }
  html.m-page-scroll .mid-row .attn-badge { padding: 3px 8px; }
  /* טקסט-משנה קטן (שם-היום, התאריך העברי, שורת-הלקוח): בצבע-הטקסט המשני, שקריא יותר בגודל הזה
     על מסך-טלפון מאשר האפור העמום של הדסקטופ. */
  html.m-page-scroll .wk-dow,
  html.m-page-scroll .cal-heb-label,
  html.m-page-scroll .day-heb,
  html.m-page-scroll .mid-row .sc-meta,
  html.m-page-scroll .mid-row .sc-go { color: var(--color-text-secondary); }
  html.m-page-scroll .wk-tab.is-today .wk-dow { color: var(--color-primary); }

  /* ══ גל 2, יחידה C — משימות (static/js/tasks_mobile.js) ═══════════════════════
     מסך המשימות הראשי ולשונית "משימות" בכרטיס הלקוח: כרטיס-משימה קבוע מעל אותה טבלה (הטבלה נשארת
     מקור הנתונים, הסינון והמיון ואינה מוצגת), אזור "סינון ומיון" שנפתח מתחת לחיפוש, וטופס-המשימה
     במסך מלא. הכללים של מסך הלקוחות (יחידה A) אינם משתנים. */
  /* ── כרטיס-משימה ── */
  button.m-card-title {
    appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 0; margin: 0;
    font-family: inherit; text-align: start; cursor: pointer;
  }
  /* תיאור ארוך מאוד: עד שלוש שורות בכרטיס; הטקסט המלא - בטופס שנפתח בלחיצה. */
  .m-task .m-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .m-task { border-inline-start-width: 4px; }
  .m-task.is-overdue { border-inline-start-color: var(--color-danger); }   /* אותו כלל-שורה של הטבלה: באיחור */
  .m-task.is-soon { border-inline-start-color: var(--color-warning); }     /* ...וב-14 הימים הקרובים */
  .m-card-head > .m-cell { flex: 0 0 auto; }
  /* המשימה שהמסך בחר (כניסה מקישור למשימה מסוימת) - כמו השורה המסומנת בטבלה. */
  .m-card.is-selected { box-shadow: 0 0 0 2px var(--focus-ring-color); background: color-mix(in srgb, var(--focus-ring-color) 7%, var(--surface-card)); }
  .m-task-due { gap: 5px; color: var(--color-text-secondary); }
  .m-card-note { white-space: pre-wrap; overflow-wrap: anywhere; }
  .m-funnels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .m-funnels-label { flex: 1 0 100%; font-size: var(--text-small); font-weight: 700; color: var(--color-text-secondary); }
  .m-filter-tools { gap: 8px; flex-wrap: wrap; }

  /* ── מסך המשימות הראשי ──────────────────────────────────────────────────── */
  html.m-page-scroll .main-content .tasks-workbench,
  html.m-page-scroll .main-content .tasks-main-col { display: block; }
  html.m-page-scroll .main-content .tasks-workbench .wb-filter-handle { display: none !important; } /* מול מצב-הכיווץ של הדסקטופ */
  html.m-page-scroll .main-content .tasks-workbench .tasks-filter-panel {
    display: none !important;                       /* סגור כברירת-מחדל; מול מצב-הכיווץ / הפתיחה של הדסקטופ */
    width: auto !important; max-height: none; overflow: visible; /* מול הרוחב הקבוע (230px) של הדסקטופ */
    margin: 0 0 10px;
  }
  html.m-page-scroll .main-content .tasks-workbench.m-filters-open .tasks-filter-panel { display: block !important; }
  html.m-page-scroll .main-content .tasks-filter-panel .toolbar-filter-group {
    display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px;
  }
  html.m-page-scroll .main-content .tasks-filter-panel .toolbar-filter-group + .toolbar-filter-group,
  html.m-page-scroll .main-content .tasks-filter-panel .m-funnels { margin-top: 12px !important; } /* מול style */
  html.m-page-scroll .main-content .tasks-filter-panel .filter-row-label { flex: 1 0 100%; padding-inline-end: 0; }
  html.m-page-scroll .main-content .tasks-filter-panel .filter-btn { width: auto !important; min-height: 44px; } /* מול הרוחב המלא / הקבוע של הדסקטופ */
  html.m-page-scroll .main-content .tasks-filter-panel .filter-sep { display: none; }
  /* הכותרת "משימות" כבר בסרגל העליון; "+ הוספת משימה" הוא כפתור צף מעל הניווט התחתון. */
  html.m-page-scroll .tasks-hero { display: contents; }
  html.m-page-scroll .tasks-hero > div:first-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  html.m-page-scroll .tasks-hero .hero-actions {
    position: fixed; inset-inline-end: 14px; bottom: calc(var(--mnav-h) + 14px); z-index: 1029;
  }
  html.m-page-scroll .tasks-hero .hero-actions > .hero-btn {
    min-height: 48px; padding: 0 20px; border-radius: 999px;
    font-size: var(--text-body); box-shadow: 0 6px 18px rgba(16, 35, 63, 0.32);
  }
  html.theme-dark.m-page-scroll .tasks-hero .hero-actions > .hero-btn { border-color: var(--focus-ring-color) !important; } /* מול כלל הכפתורים של הערכה הכהה ב-theme.css */
  html.m-page-scroll .tasks-table-card {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); pointer-events: none;
  }

  /* ── לשונית "משימות" בכרטיס הלקוח ────────────────────────────────────────
     הטבלה אינה מוצגת, ולכן אין לה עוד אזור-גלילה מקומי (יחידה A של גל 1): הכרטיסים בזרימת העמוד. */
  html.m-page-scroll #tasks-table-wrap { height: auto; min-height: 0 !important; }       /* מול כלל-הגובה של גל 1 */
  html.m-page-scroll #tasks-table-wrap > #tasks-table {
    position: absolute; width: 1px; height: 1px !important; min-height: 0; overflow: hidden; /* מול הגובה שהטבלה כותבת */
    clip-path: inset(50%); pointer-events: none;
  }
  html.m-page-scroll #tasks-table-wrap > .m-list { padding: 8px 8px 4px; }
  /* הסרגל משותף לכל הלשוניות; הכללים האלה חלים רק כשלשונית "משימות" פעילה. שורה אחת: חיפוש + "סינון
     ומיון"; צ'יפי-הסוג, "הצג משימות מוסתרות", המשפכים, המיון והאיפוס - באזור שנפתח מתחתיה. תפריט
     "תצוגה" (עמודות ושמירה אישית) אינו מוצג בטלפון: הכרטיס קבוע. */
  html.m-page-scroll .cv-root .cv-m-taskbtn { display: none; }
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar { gap: 8px; }
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar #search-tasks {
    flex: 1 1 0; min-width: 0; width: auto !important; height: 44px; font-size: max(16px, 1rem); /* מול style */
  }
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar .cv-m-taskbtn { display: inline-flex; flex: 0 0 auto; }
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar > .flex-grow-1,
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar #cv-wsv-mount-tasks { display: none !important; } /* מול style */
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar:not(.m-filters-open) #task-type-chips,
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar:not(.m-filters-open) #toggleHiddenTasksLink { display: none !important; } /* מול style */
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar.m-filters-open #task-type-chips { flex: 1 1 100%; gap: 6px; }
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar.m-filters-open #task-type-chips .cv-type-chip { min-height: 44px; }
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar.m-filters-open #toggleHiddenTasksLink {
    flex: 1 1 100%; padding: 8px 2px; font-size: var(--text-secondary) !important;                /* מול style */
  }
  html.m-page-scroll .cv-root:has(#tab-btn-tasks.active) .cv-toolbar.m-filters-open .cv-m-taskpanel { display: block; flex: 1 1 100%; }
  .cv-m-taskpanel .m-sort { margin-top: 0; }
  .cv-m-taskpanel .m-funnels { margin-top: 12px; }
  .cv-m-taskpanel .m-funnel-btn {
    min-height: 44px; padding: 4px 13px; border-radius: 999px;
    border: 1px solid var(--border-color); background: var(--surface-card); color: var(--color-text-secondary);
    font: inherit; font-size: var(--text-secondary); font-weight: 600; cursor: pointer;
  }
  .cv-m-taskpanel .m-funnel-btn.active-filter { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
  /* חלונית "סינון לפי ערכים" של כרטיס הלקוח - כמו במסכים הראשיים: לרוחב המסך, מתחת לסרגל העליון. */
  html.m-page-scroll #cv-col-filter-popup {
    top: calc(var(--gnav-h) + 8px) !important; left: 8px !important; right: 8px; width: auto !important; /* מול style */
    max-height: min(60vh, 420px);
  }
  html.m-page-scroll #cv-col-filter-popup label { white-space: normal; min-height: 44px; font-size: var(--text-body); }
  html.m-page-scroll #cv-col-filter-popup :is(.cpop-search, input[type="text"], input[type="search"], input:not([type])) { min-height: 44px; font-size: max(16px, 1rem) !important; } /* מול style; בכרטיס הלקוח לשדה-החיפוש אין `cpop-search` (30px) */
  html.m-page-scroll #cv-col-filter-popup .btn { min-height: 44px; font-size: var(--text-secondary) !important; }   /* מול style */

  /* ── טופס המשימה (#taskModal - אותו טופס במסך המשימות, בכרטיס הלקוח ובדשבורד) ──────────
     במסך מלא: כותרת למעלה, השדות גוללים באמצע, והפעולות תמיד בתחתית. עמודה אחת; שדות בגובה 44px
     וטקסט של 16px לפחות (דפדפן-טלפון מגדיל את העמוד במיקוד בשדה קטן יותר). השדות, הבדיקות,
     ההרשאות והכפתורים הם הקוד הקיים. */
  #taskModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #taskModal .modal-content { height: 100%; border: 0; border-radius: 0; }
  #taskModal .modal-body { flex: 1 1 auto; max-height: none; overflow-y: auto; }   /* מול תקרת-הגובה של שפת-החלונות */
  #taskModal .modal-body .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  #taskModal .modal-body .row { row-gap: 8px; }
  #taskModal .modal-body .form-control,
  #taskModal .modal-body .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  #taskModal #div_followup_btns .d-flex { flex-wrap: wrap; gap: 6px !important; }    /* מול gap-1 */
  #taskModal #div_followup_btns .btn { flex: 1 1 30% !important; min-height: 44px; }  /* מול flex-fill: שלושה ושניים, לא ארבעה ואחד */
  #taskModal .app-modal-footer .btn { min-height: 44px; }
  #taskModal .app-modal-util { min-height: 44px; }
  #taskModal .modal-header .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; background-position: center; } /* יעד-מגע של 44px */
  /* ערכה כהה: צבע-התוויות הקבוע של שפת-החלונות (#6b7889) נותן 3.43:1 על רקע הטופס; כאן - הטקסט המשני של הערכה. */
  html.theme-dark #taskModal .form-label-sm, html.theme-dark #taskModal label.fw-bold { color: var(--color-text-secondary); }

  /* ══ גל 2, יחידה D — אירועים (static/js/events_mobile.js) ═════════════════════
     אותו דפוס של המשימות (יחידה C): כרטיס-אירוע קבוע מעל אותה טבלה, אזור "סינון ומיון" שנפתח מתחת
     לחיפוש, וטופס-האירוע במסך מלא. מסך האירועים הראשי בנוי על אותו שלד של מסך הלקוחות
     (`.wb-workbench` / `.wb-filter-panel`), ולכן רוב הכללים שלו כבר קיימים (יחידה A). */
  .m-event { border-inline-start-width: 4px; }
  .m-event.is-overdue { border-inline-start-color: var(--color-danger); }   /* כלל-השורה של הטבלה: אירוע פתוח שמועדו עבר */
  .m-event.is-soon { border-inline-start-color: var(--color-warning); }     /* ...וב-14 הימים הקרובים */
  .m-event .m-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

  /* ── מסך האירועים הראשי ── */
  html.m-page-scroll .main-content .wb-filter-panel .toolbar-filter-group {
    display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px;
  }
  html.m-page-scroll .main-content .wb-filter-panel .toolbar-filter-group + .toolbar-filter-group { margin-top: 12px !important; } /* מול style */
  html.m-page-scroll .main-content .wb-filter-panel .filter-sep { display: none; }
  html.m-page-scroll .meetings-hero { display: contents; }
  html.m-page-scroll .meetings-hero > div:first-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  html.m-page-scroll .meetings-hero .hero-actions {
    position: fixed; inset-inline-end: 14px; bottom: calc(var(--mnav-h) + 14px); z-index: 1029;
  }
  html.m-page-scroll .meetings-hero .hero-actions > .hero-btn {
    min-height: 48px; padding: 0 20px; border-radius: 999px;
    font-size: var(--text-body); box-shadow: 0 6px 18px rgba(16, 35, 63, 0.32);
  }
  html.theme-dark.m-page-scroll .meetings-hero .hero-actions > .hero-btn { border-color: var(--focus-ring-color) !important; } /* מול כלל הכפתורים של הערכה הכהה ב-theme.css */
  html.m-page-scroll .meetings-table-card {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); pointer-events: none;
  }

  /* ── לשונית "אירועים" בכרטיס הלקוח ── */
  html.m-page-scroll #meetings-table-wrap { height: auto; min-height: 0 !important; }       /* מול כלל-הגובה של גל 1 */
  html.m-page-scroll #meetings-table-wrap > #meetings-table {
    position: absolute; width: 1px; height: 1px !important; min-height: 0; overflow: hidden; /* מול הגובה שהטבלה כותבת */
    clip-path: inset(50%); pointer-events: none;
  }
  html.m-page-scroll #meetings-table-wrap > .m-list { padding: 8px 8px 4px; }
  html.m-page-scroll .cv-root .cv-m-eventbtn { display: none; }
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar { gap: 8px; }
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar #search-tasks {
    flex: 1 1 0; min-width: 0; width: auto !important; height: 44px; font-size: max(16px, 1rem); /* מול style */
  }
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar .cv-m-eventbtn { display: inline-flex; flex: 0 0 auto; }
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar > .flex-grow-1,
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar #cv-wsv-mount-meetings { display: none !important; } /* מול style */
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar:not(.m-efilters-open) #meeting-type-chips,
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar:not(.m-efilters-open) #toggleHiddenMeetingsLink { display: none !important; } /* מול style */
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar.m-efilters-open #meeting-type-chips { flex: 1 1 100%; gap: 6px; }
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar.m-efilters-open #meeting-type-chips .cv-type-chip { min-height: 44px; }
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar.m-efilters-open #toggleHiddenMeetingsLink {
    flex: 1 1 100%; padding: 8px 2px; font-size: var(--text-secondary) !important;                /* מול style */
  }
  html.m-page-scroll .cv-root:has(#tab-btn-meetings.active) .cv-toolbar.m-efilters-open .cv-m-eventpanel { display: block; flex: 1 1 100%; }
  .cv-m-eventpanel .m-sort { margin-top: 0; }
  .cv-m-eventpanel .m-funnels { margin-top: 12px; }
  .cv-m-eventpanel .m-funnel-btn {
    min-height: 44px; padding: 4px 13px; border-radius: 999px;
    border: 1px solid var(--border-color); background: var(--surface-card); color: var(--color-text-secondary);
    font: inherit; font-size: var(--text-secondary); font-weight: 600; cursor: pointer;
  }
  .cv-m-eventpanel .m-funnel-btn.active-filter { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

  /* ── טופס האירוע (#meetingModal - אותו טופס במסך האירועים, בכרטיס הלקוח ובדשבורד) ──────────
     כמו טופס-המשימה: במסך מלא, עמודה אחת, שדות בגובה 44px וטקסט של 16px לפחות, פעולות תמיד בתחתית.
     תאריך, שעת התחלה ושעת סיום - כל אחד בשורה משלו. השדות, הבדיקות והכפתורים הם הקוד הקיים. */
  #meetingModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #meetingModal .modal-content { height: 100%; border: 0; border-radius: 0; }
  #meetingModal .modal-body { flex: 1 1 auto; max-height: none; overflow-y: auto; }   /* מול תקרת-הגובה של שפת-החלונות */
  #meetingModal .modal-body .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  #meetingModal .modal-body .form-control,
  #meetingModal .modal-body .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  #meetingModal .modal-body .form-check-input { width: 1.4em; height: 1.4em; }
  #meetingModal .modal-body .form-check-label { padding-inline-start: 6px; line-height: 1.6; }
  #meetingModal .app-modal-footer .btn { min-height: 44px; }
  #meetingModal .app-modal-util { min-height: 44px; }
  #meetingModal .modal-header .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; background-position: center; } /* יעד-מגע של 44px */
  html.theme-dark #meetingModal .form-label-sm, html.theme-dark #meetingModal label.fw-bold { color: var(--color-text-secondary); }   /* כמו בטופס-המשימה */

  /* ══ גל 2, יחידה E — תזכורות (static/js/reminders_mobile.js) ═════════════════════
     מסך התזכורות הראשי בנוי על אותו שלד של מסך האירועים (אותן מחלקות: `.meetings-hero`,
     `.meetings-table-card`, `.wb-workbench`), ולכן הכללים שלו כבר קיימים (יחידות A ו-D); הכרטיס שלו
     נושא גם את המחלקה `m-event`. כאן: לשוניות "תזכורות" / "פתקים" בכרטיס הלקוח, והטופס שלהן. */

  /* ── כרטיס הלקוח: רשימת-הכרטיסים הקיימת (`.note-list` / `.note-item`) ───────────────
     המסך עצמו מצייר את הכרטיסים, ולחיצה אחת כבר פותחת את הטופס. בדסקטופ כל כרטיס בגובה קבוע של
     90px עם כותרת בשורה אחת; בטלפון - גובה לפי התוכן: שורה עליונה (מועד · סטטוס · מחיקה), כותרת בעד
     שתי שורות, ותוכן בעד שתי שורות. */
  html.m-page-scroll .note-list {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: auto;
    gap: 8px; padding: 8px; height: auto;
  }
  html.m-page-scroll .note-list.is-empty { min-height: 160px; }
  html.m-page-scroll .note-item { height: auto; }
  html.m-page-scroll .note-item-body {
    grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 12px; height: auto;
  }
  html.m-page-scroll .note-item-date { grid-column: 1; grid-row: 1; color: var(--color-text-secondary); font-size: var(--text-secondary); }
  html.m-page-scroll .note-item-side { grid-column: 2; grid-row: 1; justify-content: flex-end; gap: 6px; }
  html.m-page-scroll .note-item-main { grid-column: 1 / -1; grid-row: 2; }
  html.m-page-scroll .note-item-title {
    font-size: 1rem; white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  html.m-page-scroll .note-item-title.m-note-open:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; border-radius: 4px; }
  html.m-page-scroll .note-item-content { color: var(--color-text-secondary); font-size: var(--text-secondary); overflow-wrap: anywhere; }
  html.m-page-scroll .note-item .note-act { width: 44px; height: 44px; border-radius: 10px; font-size: 1rem; } /* יעד-מגע של 44px; הפעולה והאישור - הקוד הקיים */
  /* ערכה כהה: האדום של הדסקטופ (#c0392b) נותן 2.98:1 על רקע הכרטיס; כאן - אדום-הערכה, וריחוף / מיקוד שנשארים קריאים. */
  html.theme-dark.m-page-scroll .note-item .note-act.del {
    color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 45%, var(--surface-card));
  }
  html.theme-dark.m-page-scroll .note-item .note-act.del:hover,
  html.theme-dark.m-page-scroll .note-item .note-act.del:active {
    background: color-mix(in srgb, var(--color-danger) 18%, var(--surface-card));
  }
  html.m-page-scroll .note-item .note-act:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; }

  /* הסרגל המשותף בלשוניות "תזכורות" / "פתקים": שורה אחת - חיפוש + "סינון"; צ'יפי-הסטטוס באזור שנפתח. */
  html.m-page-scroll .cv-root .cv-m-notebtn { display: none; }
  html.m-page-scroll .cv-root:is(:has(#tab-btn-reminder.active), :has(#tab-btn-petek.active)) .cv-toolbar { gap: 8px; }
  html.m-page-scroll .cv-root:is(:has(#tab-btn-reminder.active), :has(#tab-btn-petek.active)) .cv-toolbar #search-notes {
    flex: 1 1 0; min-width: 0; width: auto !important; height: 44px; font-size: max(16px, 1rem); /* מול style */
  }
  html.m-page-scroll .cv-root:is(:has(#tab-btn-reminder.active), :has(#tab-btn-petek.active)) .cv-toolbar .cv-m-notebtn { display: inline-flex; flex: 0 0 auto; }
  html.m-page-scroll .cv-root:is(:has(#tab-btn-reminder.active), :has(#tab-btn-petek.active)) .cv-toolbar > .flex-grow-1 { display: none !important; }
  html.m-page-scroll .cv-root:is(:has(#tab-btn-reminder.active), :has(#tab-btn-petek.active)) .cv-toolbar:not(.m-nfilters-open) #note-status-chips { display: none !important; } /* מול style */
  html.m-page-scroll .cv-root:is(:has(#tab-btn-reminder.active), :has(#tab-btn-petek.active)) .cv-toolbar.m-nfilters-open #note-status-chips { flex: 1 1 100%; gap: 6px; }
  html.m-page-scroll .cv-root:is(:has(#tab-btn-reminder.active), :has(#tab-btn-petek.active)) .cv-toolbar.m-nfilters-open #note-status-chips .cv-type-chip { min-height: 44px; }
  html.m-page-scroll .cv-root:is(:has(#tab-btn-reminder.active), :has(#tab-btn-petek.active)) .cv-toolbar.m-nfilters-open .cv-m-notepanel { display: block; flex: 1 1 100%; }
  .cv-m-notepanel .m-filter-tools { margin-top: 0; }

  /* ── טופס הפתק / התזכורת (#noteModal - במסך התזכורות, בכרטיס הלקוח ובדשבורד) ──────────
     כמו טופסי המשימה והאירוע: במסך מלא, עמודה אחת, שדות בגובה 44px וטקסט של 16px לפחות, "שמור" ו"ביטול"
     תמיד בתחתית. הכללים חלים על הטופס הזה בלבד. */
  #noteModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #noteModal .modal-content { height: 100%; border: 0; border-radius: 0; }
  #noteModal .modal-body { flex: 1 1 auto; max-height: none; overflow-y: auto; }   /* מול תקרת-הגובה של שפת-החלונות */
  #noteModal .modal-body .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  #noteModal .modal-body .form-control,
  #noteModal .modal-body .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  #noteModal .modal-body .note-type-btn,
  #noteModal #note-status-row .btn { min-height: 44px; }                              /* הדף מחליף את מחלקות כפתורי-הסטטוס, לכן לפי השורה */
  #noteModal #note-quick-btns { flex-wrap: wrap; gap: 6px !important; }               /* מול gap-1 */
  #noteModal #note-quick-btns .btn { flex: 1 1 40% !important; min-height: 44px; }   /* מול flex-fill: שניים בשורה */
  #noteModal .modal-footer { padding-top: 10px !important; border-top: 1px solid var(--border-color) !important; } /* מול pt-0 / border-top-0: הפעולות מופרדות מהשדות הגוללים */
  #noteModal .modal-footer .btn { min-height: 44px; padding-inline: 18px; }
  /* יעדי-מגע קטנים בטופס הזה: סגירה (X) והסרת השיוך ללקוח. */
  #noteModal .modal-header .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; background-position: center; }
  #noteModal .wi-assoc-chosen { min-height: 44px; }
  #noteModal .wi-assoc-clear { min-width: 44px; min-height: 44px; }

  /* ══ גל 2, יחידה F — דוחות להגשה (static/js/filing_reports_mobile.js) ═════════════════
     המסך בנוי על אותו שלד של מסכי-העבודה (`.wb-workbench` / `.wb-filter-panel` / `.wt-search-row`),
     ולכן אזור "סינון ומיון" והחיפוש כבר מוגדרים (יחידות A ו-D). כאן: הכותרת (כבר בסרגל העליון; למסך
     אין כפתור-הוספה) וכרטיס-הטבלה אינם מוצגים, והכרטיס הוא כרטיס-משימה (`.m-task`). הפתיחה היא
     בטופס-המשימה שבכרטיס הלקוח (`#taskModal` - יחידה C). */
  html.m-page-scroll .filing-hero,
  html.m-page-scroll .filing-table-card {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); pointer-events: none;
  }
  html.m-page-scroll .filing-hero { white-space: nowrap; padding: 0; border: 0; }
  /* גל 5, יחידה A: הפקת-דוח שנכשלה (reports_mobile.js) - הודעה מעל התוצאות; תוצאות קודמות מסומנות. */
  html.m-page-scroll .m-report-error {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--color-danger) 45%, transparent); border-inline-start-width: 4px;
    border-radius: 10px; background: var(--surface-card); color: var(--text-primary);
  }
  html.m-page-scroll .m-report-error[hidden] { display: none; }
  html.m-page-scroll .m-report-error-text { flex: 1 1 220px; margin: 0; font-size: var(--text-secondary); overflow-wrap: anywhere; }
  html.m-page-scroll .m-report-retry {
    min-height: 44px; padding: 0 16px; border: 1px solid var(--color-danger); border-radius: 8px;
    background: transparent; color: var(--color-danger); font-weight: 600;
  }
  html.m-page-scroll :is(.report-result-body, .m-list).m-report-stale { opacity: 0.6; }
  /* גל 5, יחידה A: החודש והסינון לפי ערכים - קבוצות מתקפלות (filing_reports_mobile.js). מקופלת: התווית,
     הבחירה הפעילה (עם המונה שלה) ו"כל ה..." בלבד. */
  html.m-page-scroll .m-fgroup.is-collapsed :is(.month-filter-btn, .m-funnel-btn):not(.active-filter),
  html.m-page-scroll .m-fgroup.is-collapsed .filter-sep { display: none; }
  html.m-page-scroll .m-fgroup-toggle {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
    border: 1px dashed var(--border-color); border-radius: 999px; background: transparent;
    color: var(--color-primary); font-size: var(--text-small); font-weight: 600;
  }
  html.theme-dark.m-page-scroll .m-fgroup-toggle { color: var(--focus-ring-color); }

  /* ══ גל 2, יחידה G — טופס תיק העבודה, וסביבת-העבודה של סדר הדין ═══════════════════════
     (static/js/case_procedure_mobile.js). שום שדה, בדיקה, הרשאה או פעולה אינם משתנים. */

  /* ── טופס תיק העבודה (#caseModal - הוספה ועריכה) ──────────────────────────────
     העמודות כבר נערמות מתחת ל-768px (`col-md-6`); כאן, כמו שאר הטפסים: מסך מלא, השדות גוללים באמצע,
     "ביטול" / "שמור" תמיד בתחתית, שדות בגובה 44px וטקסט של 16px לפחות, ורווח בין שדות שנערמו. */
  #caseModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #caseModal .modal-content { height: 100%; border: 0; border-radius: 0; }
  #caseModal .modal-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
  #caseModal .modal-body .row { row-gap: 12px; }
  #caseModal .modal-body .form-control,
  #caseModal .modal-body .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  #caseModal .modal-title { min-width: 0; overflow-wrap: anywhere; }
  #caseModal .modal-header .btn-close { box-sizing: border-box; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; background-position: center; }
  #caseModal .modal-footer-custom { flex: 0 0 auto; }
  #caseModal .modal-footer-custom .btn { min-height: 44px; padding-inline: 18px; }
  /* הכניסה ליצירת תיק ושדה-החיפוש, בגיליון בחירת-התיק (יחידה C של גל 1): יעדי-מגע בלבד. */
  html.m-page-scroll #cv-cases-panel button[onclick="openAddCaseModal()"] { height: 44px !important; padding-inline: 16px !important; } /* מול style */
  html.m-page-scroll #cv-cases-panel #search-cases { height: 44px !important; font-size: max(16px, 1rem) !important; }                 /* מול style */

  /* ── סדר הדין: פס-השלבים ──
     מתחת ל-576px הפס היה רשימה אנכית של כל השלבים (כ-400px לפני הכרטיס הראשון). בטלפון הוא שורה אחת
     שגוללת בתוך עצמה - כמו ב-576px עד 860px - כל שלב נגיש בגלילה, והשלב הנצפה מסומן (רקע ומסגרת)
     ומוצג תמיד (הסקריפט גולל את הפס אליו). שלב מקביל מסומן בתוכו ("מקביל"), כמו בשורה של הדסקטופ. */
  html.m-page-scroll .cp-stages.is-graph,
  html.m-page-scroll .cp-stages.is-graph.has-parallel { flex-direction: row; overflow-x: auto; }
  html.m-page-scroll .cp-stages.is-graph .cp-stage,
  html.m-page-scroll .cp-stages.is-graph .cp-stage[data-parallel] {
    flex: 0 0 auto; width: auto; min-width: 132px; max-width: 72vw; margin-inline-start: 0;
  }
  /* שם-שלב ארוך אינו נקטע בשורה אחת: עד שתי שורות (בדסקטופ - שורה אחת עם שלוש נקודות). גם בפס של סדר דין ישן. */
  html.m-page-scroll .cp-stages .cp-stage { max-width: 72vw; }
  html.m-page-scroll .cp-stage-head { align-items: flex-start; }
  html.m-page-scroll .cp-stage-name {
    white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }

  /* ── סדר הדין: שורת-הכלים ──
     שורה אחת: כותרת, שבבי מסלול / צד, ו-⋮ בקצה; המונים בשורה שמתחתיה. ארבעת הכפתורים המקוריים
     נשארים בעמוד (מקור ההצגה, הטקסט וההרשאה) ואינם מוצגים: הם בתפריט ⋮. */
  html.m-page-scroll .cp-toolbar-title .cp-toolbar-actions,
  html.m-page-scroll .cp-toolbar-title #cp-stage-close { display: none !important; }      /* מול כלל-ההצגה של הכפתור */
  .cp-m-actions { display: block; flex: 0 0 auto; margin-inline-start: auto; }
  .cp-m-actions[hidden] { display: none; }
  .cp-m-actions .qa-menu { min-width: 210px; }
  .cp-m-actions .qa-item { min-height: 44px; font-size: var(--text-body); }
  .cp-m-actions .qa-item.is-danger, .cp-m-actions .qa-item.is-danger i { color: var(--color-danger); }
  html.m-page-scroll .cp-toolbar-main { flex: 1 1 100%; }
  html.m-page-scroll .cp-toolbar-main .cp-counters { flex: 1 0 100%; }

  /* ── סדר הדין: כרטיסי-הפעולה ──
     יעדי-מגע של 44px בלי להגדיל את הכרטיס: ריבוע-הסימון ו"..." נשארים במידתם, ושטח-הלחיצה שלהם
     מתרחב סביבם. "סמן כלא רלוונטית", הפעלת פעולת-רשות וקביעת מועד של אבן-דרך יורדים לשורה משלהם
     ככפתורים בגובה 44px (בדסקטופ הם בגובה שבב, 21px). */
  html.m-page-scroll .cp-check, html.m-page-scroll .cp-menu-btn { position: relative; }
  /* המידות נמדדות מקצה-הריפוד (בתוך המסגרת): 22px עם מסגרת 2px → ‎-13px; 18px → ‎-15px; 30px עם מסגרת 1px → ‎-8px. */
  html.m-page-scroll .cp-check::before { content: ""; position: absolute; inset: -13px; }
  html.m-page-scroll .cp-sub .cp-check::before { inset: -15px; }
  html.m-page-scroll .cp-menu-btn::before { content: ""; position: absolute; inset: -8px; }
  html.m-page-scroll .cp-subs-toggle { min-height: 44px; }
  html.m-page-scroll .cp-pills.has-ctl { flex-wrap: wrap; }
  html.m-page-scroll .cp-pills.has-ctl .cp-pills-set { flex: 1 1 100%; }
  html.m-page-scroll .cp-pills.has-ctl .cp-pills-ctl { flex: 1 1 100%; justify-content: flex-start; margin-inline-start: 0; gap: 8px; }
  html.m-page-scroll .cp-na-btn, html.m-page-scroll .cp-ctl-btn { min-height: 44px; padding: 0 14px; font-size: var(--text-small); }
  html.m-page-scroll .cp-na-btn .cp-na-text { display: inline; }                           /* מול כלל-המכל שמשאיר סמל בלבד כשצר */
  html.m-page-scroll .cp-pane .cp-btn-primary,
  html.m-page-scroll .cp-pane #cp-retry { min-height: 44px; }

  /* ── סדר הדין: תפריט-הפעולות של כרטיס ──
     מגירה תחתונה בכל רוחב-טלפון (עד עכשיו רק מתחת ל-576px; בין 576 ל-767 הסקריפט ממקם חלונית קטנה
     ליד הכפתור, ולכן `!important` מול ה-style שהוא כותב). */
  html.m-page-scroll .cp-menu {
    top: auto !important; left: 0 !important; right: 0; bottom: 0;
    max-height: 70vh; overflow-y: auto; border-radius: 14px 14px 0 0; padding: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
  html.m-page-scroll .cp-menu [role="menuitem"] { min-height: 44px; padding: 10px 14px; font-size: var(--text-body); }

  /* ── סדר הדין: החלונות (הפעלה, פעולה, יצירת פריט, היסטוריה) ──
     כמו שאר הטפסים בטלפון: מסך מלא, השדות גוללים, הפעולות בתחתית. השדות, הבדיקות והכפתורים - הקוד הקיים. */
  .cp-modal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  .cp-modal .modal-content { height: 100%; max-height: none; border: 0; border-radius: 0; }
  .cp-modal .modal-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
  .cp-modal .modal-body .form-control,
  .cp-modal .modal-body .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  .cp-modal .modal-body .btn { min-height: 44px; }
  .cp-modal .modal-body .form-check-input { width: 1.4em; height: 1.4em; }
  .cp-modal .cp-out-choice { min-height: 44px; }
  .cp-modal .cp-out-google .form-check-label { display: inline-flex; align-items: center; min-height: 44px; }   /* השורה כולה היא יעד-המגע של התיבה */
  .cp-modal .cp-hint { color: var(--color-text-secondary); }                 /* הטקסט המעומעם של הדסקטופ נותן 3.61:1 בערכה הבהירה */
  .cp-modal .app-modal-footer .btn { min-height: 44px; }
  .cp-modal .modal-header .btn-close { box-sizing: border-box; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; background-position: center; }
  .cp-modal .modal-title { min-width: 0; overflow-wrap: anywhere; }
  html.theme-dark .cp-modal .form-label-sm, html.theme-dark .cp-modal label.fw-bold { color: var(--color-text-secondary); }   /* כמו בטופס-המשימה */

  /* ══ גל 3, יחידה A — לשונית הקבצים (static/js/files_mobile.js) ═══════════════════════
     הטבלה נשארת בעמוד (מקור הבחירה, הלחיצות ותפריט-הפעולות) ואינה מוצגת; במקומה כרטיסי-קבצים קבועים.
     שורת-הבחירה צפה מעל הניווט, תפריט-הפעולות הוא מגירה תחתונה, והתצוגה המקדימה - שכבה במסך מלא. */
  /* המכל של הטבלה (כשיש בו טבלה) - לא הטבלה עצמה: טבלה אינה מתכווצת לגובה של 1px. הודעות הרשימה
     (טוען / ריקה / לא נמצאו / שגיאה) מוצגות כרגיל. */
  html.m-page-scroll #files-list-inner:has(> #files-table-el) {
    position: absolute; width: 1px; height: 1px; overflow: hidden !important; clip-path: inset(50%); pointer-events: none; /* מול wsv-min-overflow */
  }
  .cv-m-files { display: block; padding: 8px 8px 4px; }
  .cv-m-files[hidden] { display: none; }
  .m-file { gap: 0; padding: 6px 6px 6px 8px; }
  .m-file-row { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
  .m-file-check {
    flex: 0 0 44px; width: 44px; height: 44px; margin: 0;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .m-file-check input { width: 20px; height: 20px; margin: 0; cursor: pointer; }
  .m-file-icon { flex: 0 0 auto; margin-top: 11px; font-size: 1.3rem; line-height: 1; }
  .m-file-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 9px 2px 4px; }
  .m-file-name {
    display: block; width: 100%; padding: 0; border: 0; background: none; text-align: start;
    font: inherit; font-weight: 700; line-height: 1.35; color: var(--text-heading);
    overflow-wrap: anywhere; word-break: break-word;
  }
  .m-file-name:focus-visible, .m-file-menu:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; border-radius: 4px; }
  .m-file-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; color: var(--color-text-secondary); font-size: var(--text-secondary); }
  .m-file-type { font-weight: 700; color: var(--text-primary); }
  .m-file-path { color: var(--color-text-secondary); font-size: var(--text-small); overflow-wrap: anywhere; }
  .m-file-gone { color: var(--color-danger); font-size: var(--text-small); }
  .m-file-menu {
    flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 10px; background: transparent; color: var(--color-text-secondary); font-size: 1.05rem; cursor: pointer;
  }
  .m-file.is-selected { box-shadow: 0 0 0 2px var(--focus-ring-color); background: color-mix(in srgb, var(--focus-ring-color) 7%, var(--surface-card)); }
  .m-file.is-unavailable { cursor: default; }
  .m-file.is-unavailable .m-file-name { color: var(--color-text-secondary); }
  /* סרגל-הקבצים (נתיב, חזרה, שחזור מחיקות, תיקייה חדשה, הוספת קבצים): יעדי-מגע של 44px. */
  html.m-page-scroll #files-back-btn { min-height: 44px; }
  html.m-page-scroll #files-breadcrumb .files-crumb-root,
  html.m-page-scroll #files-breadcrumb button.files-crumb-item { min-width: 44px; min-height: 44px; }

  /* הסרגל המשותף בלשונית הקבצים: שורה אחת - חיפוש + "סינון ומיון"; צ'יפי-הסוג, המיון והסינון לפי
     ערכים באזור שנפתח. תפריט "תצוגה" (עמודות) אינו מוצג: הכרטיס קבוע. */
  html.m-page-scroll .cv-root .cv-m-filesbtn { display: none; }
  html.m-page-scroll .cv-root:has(#tab-btn-files.active) .cv-toolbar { gap: 8px; }
  html.m-page-scroll .cv-root:has(#tab-btn-files.active) .cv-toolbar #search-files-top {
    flex: 1 1 0; min-width: 0; width: auto !important; height: 44px; font-size: max(16px, 1rem); /* מול style */
  }
  html.m-page-scroll .cv-root:has(#tab-btn-files.active) .cv-toolbar .cv-m-filesbtn { display: inline-flex; flex: 0 0 auto; }
  html.m-page-scroll .cv-root:has(#tab-btn-files.active) .cv-toolbar > .flex-grow-1,
  html.m-page-scroll .cv-root:has(#tab-btn-files.active) .cv-toolbar #cv-wsv-mount-files { display: none !important; } /* מול style */
  html.m-page-scroll .cv-root:has(#tab-btn-files.active) .cv-toolbar:not(.m-ffilters-open) #files-type-filters { display: none !important; } /* מול style */
  html.m-page-scroll .cv-root:has(#tab-btn-files.active) .cv-toolbar.m-ffilters-open #files-type-filters { flex: 1 1 100%; gap: 6px; }
  html.m-page-scroll .cv-root:has(#tab-btn-files.active) .cv-toolbar.m-ffilters-open #files-type-filters .cv-type-chip { min-height: 44px; }
  html.m-page-scroll .cv-root:has(#tab-btn-files.active) .cv-toolbar.m-ffilters-open .cv-m-filespanel { display: block; flex: 1 1 100%; }
  .cv-m-filespanel .m-files-sort, .cv-m-filespanel .m-funnels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
  .cv-m-filespanel .m-files-sortbtn { min-height: 44px; }
  .cv-m-filespanel .m-files-sortbtn.active::after { content: " " attr(data-dir); }
  .cv-m-filespanel .m-funnel-btn {
    min-height: 44px; padding: 4px 13px; border-radius: 999px;
    border: 1px solid var(--border-color); background: var(--surface-card); color: var(--color-text-secondary);
    font: inherit; font-size: var(--text-secondary); font-weight: 600; cursor: pointer; opacity: 1;
  }
  .cv-m-filespanel .m-funnel-btn::after { content: " ▾"; }
  /* חלונית הסינון לפי ערכים: לרוחב המסך, מתחת לסרגל העליון (כמו בשאר המסכים). */
  html.m-page-scroll #files-col-popup {
    top: calc(var(--gnav-h) + 8px) !important; left: 8px !important; right: 8px; width: auto !important; /* מול style */
    max-height: min(60vh, 420px); overflow-y: auto;
  }
  html.m-page-scroll #files-col-popup .fcp-btn { min-height: 44px; }
  html.m-page-scroll #files-col-popup .fcp-search { min-height: 44px; font-size: max(16px, 1rem); }

  /* שורת-הבחירה: צפה מעל הניווט התחתון, ו"הוספה" עולה מעליה. התוכן מקבל מקום בסופו. */
  html.m-page-scroll #files-select-bar {
    position: fixed; inset-inline: 8px; bottom: calc(var(--mnav-h) + 8px); z-index: 1028;
    min-height: 0; padding: 6px 10px; gap: 6px 8px; flex-wrap: wrap;
    border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 6px 18px rgba(16, 35, 63, 0.22);
    font-size: var(--text-secondary);
  }
  html.m-page-scroll #files-select-bar .btn { height: auto; min-height: 44px; padding: 0 12px; font-size: var(--text-secondary); }
  html.m-page-scroll #files-select-bar > .bi-check2-square { display: none; }
  html.m-page-scroll #files-select-label { flex: 1 0 calc(100% - 210px); min-width: 0; }   /* השורה הראשונה מלאה: המונה, "בטל בחירה", "פעולות" */
  html.m-page-scroll #files-select-bar .m-files-actions { display: inline-flex; align-items: center; gap: 6px; }
  /* שני כפתורי-היעד חולקים שורה שנייה (כל אחד חצי), והטקסט שלהם נשבר בתוכם - כך השורה בשתי שורות בלבד. */
  html.m-page-scroll #files-select-bar .files-dest-btn { flex: 1 1 40%; justify-content: center; white-space: normal; line-height: 1.2; text-align: center; }
  html.theme-dark.m-page-scroll #files-select-bar .m-files-actions { color: var(--text-primary); border-color: var(--border-color); } /* כחול-המתאר נותן 2.56:1 על רקע השורה בערכה הכהה */
  html.m-page-scroll .cv-root.m-files-selecting #cv-add-dropdown { bottom: calc(var(--mnav-h) + 16px + var(--m-files-bar-h, 56px)); }
  html.m-page-scroll .cv-root.m-files-selecting .cv-m-files { padding-bottom: calc(var(--m-files-bar-h, 56px) + 72px); }

  /* תפריט-הפעולות של קובץ (וגם של הבחירה): מגירה תחתונה עם פריטים של 44px. `!important` מול
     ה-style שהסקריפט כותב (מיקום ליד הכפתור). */
  html.m-page-scroll #files-ctx-menu {
    top: auto !important; left: 0 !important; right: 0 !important; bottom: 0 !important; width: auto !important;
    max-height: 70vh; overflow-y: auto; z-index: 1060;
    border-radius: 14px 14px 0 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  html.m-page-scroll #files-ctx-menu .ctx-item { min-height: 44px; padding: 10px 14px; font-size: var(--text-body); }

  /* התצוגה המקדימה: אינה מוצגת מתחת לרשימה; כשנבחר קובץ - שכבה במסך מלא, מעל הניווט ו"הוספה".
     "חזרה לרשימה" והורדה בכותרת; הגוף גולל (ו-PDF / תמונה בתוכו) לפי הדפדפן. */
  html.m-page-scroll #files-tab-content:not(.m-files-preview) #files-preview-pane { display: none !important; } /* מול הכלל של גל 1 */
  html.m-page-scroll #files-tab-content.m-files-preview #files-preview-pane {
    position: fixed; inset: 0; z-index: 1045;
    width: auto; height: 100%; height: 100dvh; min-height: 0; max-height: none; flex: none;
    display: flex !important; flex-direction: column; border: 0; background: var(--surface-card);
  }
  html.m-files-preview-open, html.m-files-preview-open body { overflow: hidden; }
  html.m-page-scroll #files-tab-content.m-files-preview #files-preview-header {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 6px 8px;
    border-bottom: 1px solid var(--border-color); background: var(--surface-card-alt); font-size: var(--text-body);
  }
  html.m-page-scroll #files-tab-content.m-files-preview #files-preview-header > i.bi-eye,
  html.m-page-scroll #files-tab-content.m-files-preview #files-preview-toggle { display: none !important; }
  html.m-page-scroll #files-tab-content.m-files-preview #files-preview-name {
    display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
    flex: 1 1 auto; min-width: 0; font-weight: 700; color: var(--text-heading); overflow-wrap: anywhere;
  }
  html.m-page-scroll #files-tab-content.m-files-preview .m-preview-back {
    display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
    border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-card);
    color: var(--text-heading); font: inherit; font-weight: 600; cursor: pointer;
  }
  html.m-page-scroll #files-tab-content.m-files-preview .m-preview-download:not([hidden]) {
    display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-card); color: var(--text-heading); cursor: pointer;
  }
  html.m-page-scroll #files-tab-content.m-files-preview .m-preview-back:focus-visible,
  html.m-page-scroll #files-tab-content.m-files-preview .m-preview-download:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; }
  /* "תצוגה מקדימה אינה זמינה" (ענן: "הורד קובץ"; מקומי: "פתח קובץ"): הכפתור בגובה 44px. */
  html.m-page-scroll #files-preview-body .files-preview-empty .btn { min-height: 44px; display: inline-flex; align-items: center; }
  html.m-page-scroll #files-preview-body .files-preview-empty .btn i { display: inline; margin: 0 0 0 4px; font-size: 1em; opacity: 1; } /* מול `.files-preview-empty i` (סמל-ענק גם בתוך הכפתור) */
  html.m-page-scroll #files-tab-content.m-files-preview #files-preview-body {
    display: flex !important; flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* חלונות הקבצים: שחזור מחיקות, גרסאות מסמך - במסך מלא, פעולות בתחתית. */
  #filesRecycleModal .modal-dialog, #docVersionsModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #filesRecycleModal .modal-content, #docVersionsModal .modal-content { height: 100%; max-height: none; min-height: 0 !important; border: 0; border-radius: 0; } /* מול style */
  #filesRecycleModal .modal-body, #docVersionsModal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
  #filesRecycleModal #filesRecycleList { flex: 1 1 auto; height: auto !important; min-height: 0; }  /* מול style="height:300px" */
  #filesRecycleModal .modal-body .btn, #docVersionsModal .modal-body .btn, #filesRecycleModal .modal-footer .btn { min-height: 44px; }
  /* גרסאות המסמך: טבלה של שש עמודות - בטלפון כל גרסה היא שורה שנשברת (מספר, מועד, מי, פעולה, גודל, כפתורים). */
  #docVersionsModal #doc-ver-body thead { display: none; }
  #docVersionsModal #doc-ver-body table, #docVersionsModal #doc-ver-body tbody { display: block; width: 100%; }
  #docVersionsModal #doc-ver-body tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 2px; border-bottom: 1px solid var(--border-color); }
  #docVersionsModal #doc-ver-body td { display: block; width: auto !important; padding: 0; border: 0; text-align: start !important; } /* מול style */
  #docVersionsModal #doc-ver-body td:first-child::before { content: "גרסה "; }   /* כותרת-העמודה המקורית */
  #docVersionsModal #doc-ver-body td:last-child { flex: 1 1 100%; display: flex; gap: 8px; }
  #docVersionsModal #doc-ver-body td .btn { min-height: 44px; min-width: 44px; justify-content: center; padding: 0 14px !important; display: inline-flex; align-items: center; gap: 4px; } /* מול py-0 px-1 */
  #filesRecycleModal .modal-header .btn-close, #docVersionsModal .modal-header .btn-close {
    box-sizing: border-box; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; background-position: center;
  }

  /* ══ גל 3, יחידה B — קבצים באחסון מקומי (static/js/local_files.js + files_mobile.js) ═══════════
     הווידג'ט המקומי מצייר טבלה (בלי הגדרות-עמודות); בטלפון כל שורה היא כרטיס: תיבת-בחירה ושם (עם הסוג)
     בשורה הראשונה, ופעולות השורה - פתח / שנה שם / מחק - בשנייה. הסרגל: חזרה, הוספה ותיקייה חדשה
     גלויים; עורך / איחוד / חתימה / החלפה / ניתוק בתפריט "פעולות". */
  html.m-page-scroll .files-source-switch .fss-btn { min-height: 44px; padding: 0 14px; }
  /* בלשונית הקבצים הסרגל המשותף מחזיק רק חיפוש, צ'יפי-סוג, מיון וסינון - של טבלת-הענן. כשהתצוגה המקומית
     מוצגת (המחלקה - files_mobile.js) הוא מוסתר בטלפון, ולא נראה כאילו הוא מסנן את הרשימה המקומית. */
  html.m-page-scroll .cv-root.m-lf-view:has(#tab-btn-files.active) .cv-toolbar { display: none !important; }
  html.m-page-scroll #lf-container .lf-head { padding: 6px 2px 8px; }
  html.m-page-scroll #lf-container .lf-crumb { flex: 1 1 100%; overflow-wrap: anywhere; }
  html.m-page-scroll #lf-container .lf-toolbar .btn { min-height: 44px; display: inline-flex; align-items: center; }
  html.m-page-scroll #lf-container .lf-toolbar :is([data-lf="to-editor"], [data-lf="to-merge"], [data-lf="to-sign"], [data-lf="change"], [data-lf="unlink"]) { display: none !important; } /* בתפריט "פעולות" */
  html.m-page-scroll #lf-container .lf-m-actions { display: block; }
  html.m-page-scroll #lf-container .lf-m-actbtn { gap: 6px; }
  html.theme-dark.m-page-scroll #lf-container .lf-m-actbtn { color: var(--text-primary); border-color: var(--border-color); } /* האפור של btn-outline-secondary נותן 3.45:1 בערכה הכהה */
  html.m-page-scroll #lf-container .lf-m-actions .qa-menu { min-width: 220px; }
  html.m-page-scroll #lf-container .lf-m-actions .qa-item { min-height: 44px; font-size: var(--text-body); }
  html.m-page-scroll #lf-container .lf-m-actions .qa-item.is-danger, html.m-page-scroll #lf-container .lf-m-actions .qa-item.is-danger i { color: var(--color-danger); }
  html.m-page-scroll #lf-container .lf-state .btn { min-height: 44px; display: inline-flex; align-items: center; } /* גם "קשר תיקייה מקומית" (מחוץ ל-lf-btnrow) */
  html.m-page-scroll #lf-container .lf-listwrap { overflow: visible; }
  html.m-page-scroll #lf-container .lf-table, html.m-page-scroll #lf-container .lf-table tbody { display: block; width: 100%; }
  html.m-page-scroll #lf-container .lf-row {
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 4px; margin: 0 0 8px; padding: 4px 6px;
    border: 1px solid var(--border-color); border-radius: 12px; background: var(--surface-card);
  }
  html.m-page-scroll #lf-container .lf-row.is-dir { background: var(--surface-warning-subtle, var(--surface-card-alt)); }
  html.m-page-scroll #lf-container .lf-row td,
  html.m-page-scroll #lf-container .lf-row:hover td { display: block; padding: 0; border: 0; background: transparent; }
  html.m-page-scroll #lf-container .lf-sel { flex: 0 0 44px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
  html.m-page-scroll #lf-container .lf-check { width: 20px; height: 20px; margin: 0; }
  html.m-page-scroll #lf-container .lf-name {
    flex: 1 1 0; min-width: 0; min-height: 44px; display: flex; align-items: flex-start; gap: 8px; padding: 11px 2px 6px;
    font-weight: 700; color: var(--text-heading); overflow-wrap: anywhere; word-break: break-word;
  }
  html.m-page-scroll #lf-container .lf-name > i { flex: 0 0 auto; font-size: 1.15rem; line-height: 1.2; }
  html.m-page-scroll #lf-container .lf-name > span { min-width: 0; }
  html.m-page-scroll #lf-container .lf-name.m-lf-open:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; border-radius: 4px; }
  html.m-page-scroll #lf-container .m-lf-type { display: block; margin-top: 2px; font-size: var(--text-small); font-weight: 700; color: var(--color-text-secondary); }
  html.m-page-scroll #lf-container .lf-actions { flex: 1 1 100%; width: auto; display: flex; justify-content: flex-end; gap: 4px; }
  html.m-page-scroll #lf-container .lf-a { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; border-radius: 10px; }
  /* מצבים: לא נתמך (כל דפדפן-טלפון), אין תיקייה, נדרשת הרשאה, שגיאה. */
  html.m-page-scroll #lf-container .lf-state.lf-unsupported { flex-direction: column; align-items: center; text-align: center; padding: 22px 12px; }
  html.m-page-scroll #lf-container .lf-m-note { display: block; margin: 10px 0 0; color: var(--text-primary); font-size: var(--text-secondary); }
  html.m-page-scroll #lf-container .lf-empty-sub { max-width: none; }
  /* מסמכים שנשלחו לחתימה ממקור מקומי: "שמור לתיקייה המקומית" מוחלף בהסבר כשאין API; "הורד" ב-44px. */
  html.m-page-scroll #local-sig-panel .btn.lf-m-desktop-only { display: none; }   /* חזק מכלל ה-44px של הכפתורים בפאנל */
  html.m-page-scroll #local-sig-panel .lf-m-sig-note { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--text-small); color: var(--color-text-secondary); }
  html.m-page-scroll #local-sig-panel [data-sig-row] { flex-wrap: wrap; gap: 6px; }
  html.m-page-scroll #local-sig-panel .btn { min-height: 44px; display: inline-flex; align-items: center; }
  html.m-page-scroll #local-sig-panel [data-sig-row] > div:first-child { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; } /* שם-קובץ ארוך נשבר (יחידה C) */
  html.theme-dark.m-page-scroll #local-sig-panel .text-success { color: var(--bs-success-text-emphasis) !important; } /* הירוק של text-success: 3.57:1 בערכה הכהה */

  /* ══ גל 3, יחידה C — עריכת מסמך Word (#docEditModal) ו"שליחה לחתימה" (files_mobile.js) ═══════════
     העורך על כל המסך: כותרת (שם ארוך נשבר), הודעת-השמירה, סרגל-הכלים הקיים - נדבק לראש האזור הנגלל,
     נשבר לשורות, כל פקד 44px; העורך עצמו בגובה התוכן והאזור כולו נגלל. בתחתית: "ביטול", "עוד" (הורדות,
     גרסאות) ו"שמור" בשורה אחת. */
  #docEditModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #docEditModal .modal-content { height: 100%; max-height: none; border: 0; border-radius: 0; }
  #docEditModal .modal-header { align-items: flex-start; gap: 8px; padding: 6px 12px 6px 6px; }
  #docEditModal .modal-title { flex: 1 1 auto; min-width: 0; padding-top: 11px; line-height: 1.45; overflow-wrap: anywhere; }
  #docEditModal #doc-lock-badge { margin-inline-start: 0 !important; margin-top: 4px; white-space: normal; text-align: start; } /* מול ms-2 */
  #docEditModal .modal-header .btn-close { box-sizing: border-box; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center; }
  #docEditModal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 12px; }
  #docEditModal .modal-body > .alert { font-size: var(--text-small); padding: 6px 10px !important; margin-bottom: 8px; } /* מול py-2 px-3 */
  #docEditModal .doc-toolbar { gap: 4px; padding: 6px; top: -8px; }   /* נדבק לקצה האזור הנגלל (מעל ריווח-הגוף) */
  #docEditModal .doc-toolbar .rt-sep { display: none; }
  #docEditModal .doc-toolbar .rt-btn { min-width: 44px; height: 44px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1rem; }
  #docEditModal .doc-toolbar .doc-tb-select { height: 44px; font-size: max(16px, 1rem); }
  /* פלטות הצבע והמרקר: ברוחב הסרגל, מתחתיו (לא נחתכות בקצה המסך); כל דוגמית 44px. */
  #docEditModal .doc-toolbar .doc-tb-pop { position: static; }
  #docEditModal .doc-toolbar .doc-tb-menu { top: calc(100% + 4px); left: 6px; right: 6px; white-space: normal; }
  #docEditModal .doc-toolbar .doc-tb-pop.open .doc-tb-menu { display: flex; flex-wrap: wrap; gap: 6px; }
  #docEditModal .doc-toolbar .doc-sw { width: 44px; height: 44px; margin: 0; }
  #docEditModal #doc-edit-input { min-height: 45vh !important; max-height: none !important; font-size: max(16px, 1rem); overflow-wrap: anywhere; } /* מול style */
  #docEditModal #doc-edit-box .btn { min-height: 44px; display: inline-flex; align-items: center; margin-top: 6px; } /* מצב "נעול ע"י אחר" */
  #docEditModal .modal-footer { flex-wrap: wrap; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
  #docEditModal .modal-footer > * { margin: 0; }
  #docEditModal .modal-footer .m-doc-more-src { display: none !important; }   /* בתפריט "עוד" */
  #docEditModal .modal-footer > .btn, #docEditModal .m-doc-more { flex: 1 1 0; min-width: 0; }
  #docEditModal .modal-footer > .btn, #docEditModal .m-doc-more-btn {
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: var(--text-body);
  }
  #docEditModal .m-doc-more { display: flex; }
  #docEditModal .m-doc-more-btn { width: 100%; }
  html.theme-dark #docEditModal .m-doc-more-btn, html.theme-dark #docEditModal .modal-footer > .btn-outline-secondary { color: var(--text-primary); border-color: var(--border-color); } /* האפור של btn-outline-secondary: 3.29:1 בערכה הכהה */
  #docEditModal .m-doc-more .qa-menu { top: auto; bottom: calc(100% + 6px); min-width: 200px; }
  /* "שמור" בערכה הכהה: לבן על ‎--color-primary‏ (#4d7fc4) הוא 4.08:1, ו-hover (#6d9bd6) עוד פחות. בטלפון -
     הגוונים המוכהים שכבר משמשים את הכפתור הראשי בסדר הדין (case_procedure.css): 6.5:1, ו-hover / לחוץ 5.3:1. */
  html.theme-dark #docEditModal #doc-edit-save {
    --bs-btn-bg: #2f5f9e; --bs-btn-border-color: #2f5f9e;
    --bs-btn-hover-bg: #3a6db0; --bs-btn-hover-border-color: #3a6db0;
    --bs-btn-active-bg: #3a6db0; --bs-btn-active-border-color: #3a6db0;
    --bs-btn-disabled-bg: #2f5f9e; --bs-btn-disabled-border-color: #2f5f9e;
  }
  #docEditModal .m-doc-more .qa-item { min-height: 44px; font-size: var(--text-body); }
  #docEditModal #doc-edit-locked-note { flex: 1 1 100%; }

  /* שליחה לחתימה: ההסבר ("מהמחשב") - חלון קטן עם "הבנתי"; ובחלון-הסימון עצמו, אם הוא מוצג ברוחב
     טלפון, אותו הסבר במקום הסימון ו"ביטול" בלבד. */
  #mDesktopOnlyModal .modal-title { display: flex; align-items: center; gap: 8px; font-size: var(--text-h3, 1.1rem); }
  #mDesktopOnlyModal .modal-body p:last-child { margin-bottom: 0; }
  #mDesktopOnlyModal .modal-footer .btn { min-height: 44px; min-width: 120px; }
  #mDesktopOnlyModal .modal-header .btn-close, #signPlaceModal .modal-header .btn-close, #signLinkModal .modal-header .btn-close {
    box-sizing: border-box; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center;
  }
  #signPlaceModal .modal-body > .row, #signPlaceModal #spCreateBtn { display: none; }
  #signPlaceModal .m-sp-note { display: block; }
  #signPlaceModal .m-sp-note-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
  #signPlaceModal .m-sp-note p:last-child { margin-bottom: 0; }
  #signPlaceModal .modal-footer .btn, #signLinkModal .modal-footer .btn { min-height: 44px; min-width: 96px; }
  /* הקישור שנוצר (מוצג פעם אחת): השדה והעתקה זה מתחת לזה, ברוחב מלא. */
  #signLinkModal .input-group { flex-wrap: wrap; gap: 8px; }
  #signLinkModal .input-group > #signLinkInput, #signLinkModal .input-group > #signLinkCopyBtn {
    flex: 1 1 100%; width: 100%; min-height: 44px; margin: 0 !important; border-radius: var(--bs-border-radius) !important; /* מול input-group */
  }
  #signLinkModal #signLinkInput { font-size: max(16px, 1rem); }

  /* ══ גל 3, יחידה D — כספים: לשונית "כספים" בכרטיס הלקוח (static/js/finance_mobile.js) ════════════
     סיכומים: "יתרה לתשלום" ו"שולם" בשורה אחת, שלושת הסכומים המשניים בשורה שמתחתיהם - אותם ערכים
     מהשרת, מבודדים משמאל-לימין (המינוס נשאר משמאל למספר). הכרטסת - כרטיסים (finance_mobile.js);
     הטבלה נשארת בעמוד ומוצגת רק אם הכרטיסים אינם תואמים לה. */
  html.m-page-scroll #finance-tab-content { height: auto !important; overflow: visible !important; padding: 10px !important; } /* מול style */
  #finance-tab-content .card-body { padding: 12px; }
  #finance-tab-content .fin-sum-primary { flex: 1 1 50%; min-width: 0; padding: 8px 10px; }
  #finance-tab-content .fin-sum-minor { flex: 1 1 33.33%; min-width: 0; padding: 7px 8px; border-top: 1px solid var(--border-color); font-size: var(--text-secondary); }
  #finance-tab-content .fin-sum-grid > .fin-sum-minor:nth-child(3) { border-inline-start: 0; }   /* תחילת השורה השנייה */
  #finance-tab-content .fin-sum-cap { white-space: normal; font-size: var(--text-small); }
  #finance-tab-content .fin-sum-hero { font-size: 1.25rem; }
  #fin-sum-balance, #fin-sum-paid, #fin-sum-total, #fin-sum-subtotal, #fin-sum-vat,
  #fin-d-sub, #fin-d-vat, #fin-d-total {
    direction: ltr; unicode-bidi: isolate; text-align: right; overflow-wrap: anywhere;  /* "-882.00 ₪": המינוס משמאל */
  }
  #fin-d-sub, #fin-d-vat, #fin-d-total { display: inline-block; }
  html.theme-dark #finance-tab-content .fin-sum-primary { background: var(--surface-card-alt); }
  html.theme-dark #finance-tab-content .fin-sum-grid { background: var(--surface-card); border-color: var(--border-color); }
  #finance-tab-content .card-body > .d-flex > .fw-semibold > .text-muted { display: none; } /* "לחיצה כפולה לפתיחה" - בטלפון לחיצה אחת */
  #fin-ledger-actions { flex: 1 1 100%; margin-inline-start: 0 !important; }   /* מול ms-auto */
  #fin-ledger-actions .btn { flex: 1 1 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; }
  /* מסננים: חיפוש + "סינון"; תיק עבודה, סוג, סטטוס ו"נקה" נפתחים מתחת. "איפוס" של הרכיב המשותף אינו
     מוצג - "נקה" של המסך הוא האיפוס. */
  #fin-filter-bar { gap: 8px !important; align-items: center; }
  #fin-filter-bar #fin-f-text { flex: 1 1 0; width: auto !important; min-height: 44px; font-size: max(16px, 1rem); } /* מול style */
  #fin-filter-bar .m-fin-filterbtn { display: inline-flex; flex: 0 0 auto; }
  #fin-filter-bar .m-filter-tools { display: none !important; }
  #fin-filter-bar:not(.m-finf-open) > select, #fin-filter-bar:not(.m-finf-open) > .btn { display: none; }
  #fin-filter-bar.m-finf-open > select { flex: 1 1 100%; width: 100% !important; min-height: 44px; font-size: max(16px, 1rem); } /* מול style */
  #fin-filter-bar > .btn { min-height: 44px; }
  #fin-filter-bar #fin-filter-count { flex: 1 1 100%; order: 10; }
  #finance-tab-content:not(.m-fin-table) #fin-ledger-wrap { display: none !important; } /* מול style */
  #finance-tab-content.m-fin-table .m-fin-list { display: none; }
  #finance-tab-content .m-fin-list { display: flex; flex-direction: column; gap: 8px; }
  .m-fin .m-fin-amount { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; text-align: end; }
  .m-fin .m-fin-amount-cap { color: var(--color-text-secondary); font-size: var(--text-small); }
  .m-fin .m-fin-amount-val { color: var(--text-heading); font-size: 1.05rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .m-fin.is-pay .m-fin-amount-val { color: var(--bs-success-text-emphasis); }
  .m-fin.is-void { background: var(--surface-card-alt); }
  .m-fin.is-void .m-card-title, .m-fin.is-void .m-fin-amount-val { text-decoration: line-through; }
  .m-fin .m-card-value bdi, .m-fin .m-card-dl bdi { font-variant-numeric: tabular-nums; }
  .m-fin .m-fin-chips .badge { font-size: var(--text-small); white-space: normal; text-align: start; }
  .m-fin .m-fin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .m-fin .m-fin-act { flex: 1 1 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .m-fin .m-fin-act.btn-outline-secondary { color: var(--text-heading); border-color: var(--border-color); } /* האפור של btn-outline-secondary: 4.45:1 בהיר, 3.29:1 כהה */
  /* ערכה כהה: הכחול-הכהה הקבוע (style="color:#16305c") של הכותרות ו"סה"כ לחיוב" - 1.24:1; כפתורי ההוספה
     (3.4:1); היתרה ו"שולם" בגוני הטקסט המודגש של הערכה. */
  html.theme-dark #finance-tab-content [style*="color:#16305c"], html.theme-dark #finDetailModal [style*="color:#16305c"] { color: var(--text-heading) !important; } /* מול style */
  html.theme-dark #finDetailModal .modal-body > [style*="background:#f7fafd"] { background: var(--surface-card-alt) !important; } /* מול style */
  html.theme-dark #fin-ledger-actions .btn { color: var(--text-primary); }
  html.theme-dark #fin-sum-balance.text-danger { color: var(--bs-danger-text-emphasis) !important; }
  html.theme-dark #fin-sum-balance.text-success, html.theme-dark #fin-sum-paid.text-success { color: var(--bs-success-text-emphasis) !important; }
  html.theme-dark .m-fin .m-fin-act.btn-outline-danger { color: var(--bs-danger-text-emphasis); } /* 3.57:1 */
  html.theme-dark .fin-hours-mode .btn-check:not(:checked) + .btn-outline-secondary { color: var(--text-primary); } /* 3.29:1 */
  html.theme-dark .m-fin .badge.bg-light { background: var(--surface-card-alt) !important; color: var(--text-primary) !important; } /* תגית-הסוג: 1.24:1 בערכה הכהה */

  /* חלונות הכספים: הוספה (שעות עבודה / חיוב / תקבול) ופרטים-ועריכה - במסך מלא, עמודה אחת (שעת התחלה
     וסיום נשארות זו לצד זו), שדות 44px ו-16px; ביטול רישום - חלון קטן עם פקדים של 44px. */
  #finEntryModal .modal-dialog, #finDetailModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #finEntryModal .modal-content, #finDetailModal .modal-content { height: 100%; border: 0; border-radius: 0; }
  #finEntryModal .modal-header, #finDetailModal .modal-header { padding: 6px 6px 6px 12px; align-items: center; border-bottom: 1px solid var(--border-color) !important; } /* מול border-bottom-0 */
  #finEntryModal .modal-body, #finDetailModal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  #finEntryModal .modal-body .row > [class*="col-"], #finDetailModal .modal-body .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  #fin-e-range-row > [class*="col-"], #fin-d-range-row > [class*="col-"] { flex: 0 0 50% !important; max-width: 50% !important; }
  #finEntryModal .form-control, #finEntryModal .form-select, #finDetailModal .form-control, #finDetailModal .form-select,
  #finVoidModal .form-control { min-height: 44px; font-size: max(16px, 1rem); }
  #finEntryModal .fin-hours-mode, #finDetailModal .fin-hours-mode { display: flex; width: 100%; }
  #finEntryModal .fin-hours-mode .btn, #finDetailModal .fin-hours-mode .btn { flex: 1 1 0; min-height: 44px; display: flex; align-items: center; justify-content: center; white-space: normal; }
  #finEntryModal .fin-src-btn { min-height: 44px; }
  #finEntryModal .form-check, #finDetailModal .form-check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-inline-start: 0; margin-bottom: 0; }
  #finEntryModal .form-check-input, #finDetailModal .form-check-input { float: none; width: 22px; height: 22px; margin: 0; flex: 0 0 auto; }
  #finEntryModal .form-check-label, #finDetailModal .form-check-label { flex: 1 1 auto; min-height: 44px; display: flex; align-items: center; }
  #finDetailModal .col-md-4.d-flex { padding-bottom: 0 !important; }   /* "חייב במע"מ": מול pb-2 */
  #finDetailModal #fin-d-history { max-height: none !important; overflow: visible !important; } /* מול style - האזור כולו נגלל */
  #finEntryModal .modal-footer, #finDetailModal .modal-footer, #finVoidModal .modal-footer {
    gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) !important; border-top: 1px solid var(--border-color) !important; /* מול pt-0 / border-top-0 */
  }
  #finEntryModal .modal-footer > .btn, #finDetailModal .modal-footer > .btn, #finVoidModal .modal-footer > .btn {
    flex: 1 1 0; min-height: 44px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: var(--text-body);
  }
  #finEntryModal .modal-header .btn-close, #finDetailModal .modal-header .btn-close, #finVoidModal .modal-header .btn-close {
    box-sizing: border-box; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center;
  }
  #finVoidModal #fin-void-info { overflow-wrap: anywhere; }

  /* ══ גל 3, יחידה E — לידים: המסך /leads (static/js/leads_mobile.js) ═══════════════════════════
     אותו שלד של מסך הלקוחות (.clients-hero, .wb-workbench, .clients-table-card - הכללים שלמעלה): הכותרת
     מוסתרת, כרטיס-הטבלה אינו מוצג, וכפתורי-הכותרת צפים מעל הניווט. בלידים יש שניים ("הוסף ליד", "ייבוא
     Excel") ושורת-בחירה ("נבחרו", שינוי סטטוס, מחיקת נבחרים) - היא נפתחת מעליהם ברוחב מלא. */
  html.m-page-scroll .clients-hero:has(#bulk-actions) .hero-actions {
    inset-inline-start: 14px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; pointer-events: none;
  }
  html.m-page-scroll .clients-hero:has(#bulk-actions) .hero-actions > * { pointer-events: auto; }
  html.m-page-scroll .clients-hero:has(#bulk-actions) .hero-actions > .hero-btn:not(.primary) { background: var(--surface-card); }
  html.m-page-scroll .clients-hero #bulk-actions {
    flex: 1 1 100%; flex-wrap: wrap; gap: 8px !important; padding: 8px 10px; /* מול style */
    background: var(--surface-card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 6px 18px rgba(16, 35, 63, 0.22);
  }
  html.m-page-scroll .clients-hero #bulk-actions > span:first-child { flex: 1 1 100%; color: var(--text-primary) !important; font-weight: 600; } /* מול style */
  html.m-page-scroll .clients-hero #bulk-actions > span[style*="user-select"] { display: none; }   /* קו-ההפרדה של הדסקטופ */
  html.m-page-scroll .clients-hero #bulk-status-select { flex: 1 1 140px; min-height: 44px; font-size: max(16px, 1rem); }
  html.m-page-scroll .clients-hero #btn-bulk-delete { flex: 0 0 auto; min-height: 44px; }
  html.m-page-scroll .main-content:has(#bulk-actions[style*="inline-flex"]) { padding-bottom: 196px; } /* שורת-הבחירה מעל הכפתורים הצפים */
  .m-lead .m-card-head { align-items: center; }
  .m-lead .m-card-title { min-height: 44px; margin-block: -10px; display: flex; align-items: center; text-align: start; } /* כפתור-הפתיחה: 44px */
  .m-lead-check { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -10px -12px -10px 0; cursor: pointer; }
  .m-lead-check input, .m-lead-selall input { width: 20px; height: 20px; margin: 0; cursor: pointer; }
  .m-lead.is-checked { border-color: var(--focus-ring-color); box-shadow: inset -3px 0 0 var(--focus-ring-color); }
  .m-lead-contact { gap: 0 16px; }
  .m-lead-link {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-block: -8px; min-width: 0;
    color: var(--focus-ring-color); font-weight: 600; text-decoration: none; overflow-wrap: anywhere;
  }
  .m-lead-link:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; border-radius: 4px; }
  .m-lead-subject { margin: 0; color: var(--text-primary); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .m-lead-selall { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 2px 4px; font-weight: 600; color: var(--text-heading); cursor: pointer; }
  .m-lead-selall[hidden] { display: none; }

  /* חלונות הלידים: הוספה ועריכה - במסך מלא, עמודה אחת (שדה-הטלפון: קידומת ומספר בשורה אחת), שדות 44px
     ו-16px. בעריכה שש הפעולות בשתי עמודות - "ביטול" ו"עדכן ליד" בשורה האחרונה. היסטוריה - במסך מלא;
     קישור ללקוח וייבוא - חלון רגיל עם פקדים של 44px. */
  #addLeadModal .modal-dialog, #editLeadModal .modal-dialog, #leadHistoryModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #addLeadModal .modal-content, #editLeadModal .modal-content, #leadHistoryModal .modal-content { height: 100%; min-height: 0 !important; border: 0; border-radius: 0; } /* מול style */
  #addLeadModal .modal-body, #editLeadModal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  #addLeadModal .modal-body .row > [class*="col-"], #editLeadModal .modal-body .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  #addLeadModal .modal-body .row, #editLeadModal .modal-body .row { row-gap: 12px; }
  #addLeadModal .form-control, #addLeadModal .form-select, #editLeadModal .form-control, #editLeadModal .form-select,
  #linkClientModal .form-control, #importExcelModal .form-control { min-height: 44px; font-size: max(16px, 1rem); }
  #editLeadModal .modal-title { overflow-wrap: anywhere; }
  #editLeadModal #edit_linked_info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; overflow-wrap: anywhere; }
  #editLeadModal #edit_linked_info a, #editLeadModal #edit_linked_info .btn-link { min-height: 44px; display: inline-flex; align-items: center; }
  #editLeadModal .modal-footer { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; } /* מול d-flex */
  #editLeadModal .modal-footer > div { display: contents !important; } /* מול style */
  #addLeadModal .modal-footer, #editLeadModal .modal-footer, #leadHistoryModal .modal-footer, #importExcelModal .modal-footer {
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) !important; border-top: 1px solid var(--border-color);
  }
  #addLeadModal .modal-footer { gap: 8px; }
  #addLeadModal .modal-footer > .btn, #editLeadModal .modal-footer .btn, #leadHistoryModal .modal-footer .btn, #importExcelModal .modal-footer .btn {
    min-height: 44px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: var(--text-body);
  }
  #addLeadModal .modal-footer > .btn { flex: 1 1 0; }
  #addLeadModal .modal-header .btn-close, #editLeadModal .modal-header .btn-close, #leadHistoryModal .modal-header .btn-close,
  #linkClientModal .modal-header .btn-close, #importExcelModal .modal-header .btn-close {
    box-sizing: border-box; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center;
  }
  #leadHistoryModal .modal-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  #leadHistoryModal #leadHistoryList { flex: 1 1 auto; height: auto !important; min-height: 0; } /* מול style="height:480px" */
  #linkClientModal #link_search_results > div { min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; overflow-wrap: anywhere; }
  #importExcelModal .modal-body a { display: inline-flex; align-items: center; min-height: 44px; }
  #editLeadModal .modal-title span[style*="color"] { color: var(--color-text-secondary) !important; } /* "#מספר" (#6b8cba): 3.45:1 */
  .m-lead .gt-chip { color: #4f5968; }   /* תגית-המקור (#6b7688 על #f0f2f6): 4.1:1 - גם בערכה הכהה התגית בהירה */
  /* ערכה כהה: "עדכן ליד" / "שמור ליד" / "ייבא" - אותם גוונים מוכהים של "שמור" בעורך; "מחק" - האדום של הערכה
     הבהירה (בכהה: לבן על #e0808e, 2.75:1); "היסטוריה" ו"נתק קשר" בצבעי-הטקסט של הערכה. */
  html.theme-dark #addLeadModal .btn-primary, html.theme-dark #editLeadModal .btn-primary, html.theme-dark #importExcelModal .btn-primary {
    --bs-btn-bg: #2f5f9e; --bs-btn-border-color: #2f5f9e; --bs-btn-hover-bg: #3a6db0; --bs-btn-hover-border-color: #3a6db0;
    --bs-btn-active-bg: #3a6db0; --bs-btn-active-border-color: #3a6db0;
  }
  html.theme-dark #editLeadModal .btn-danger {
    --bs-btn-bg: #b42334; --bs-btn-border-color: #b42334; --bs-btn-hover-bg: #9c1f2d; --bs-btn-hover-border-color: #9c1f2d;
    --bs-btn-active-bg: #9c1f2d; --bs-btn-active-border-color: #9c1f2d;
  }
  html.theme-dark #editLeadModal .btn-outline-secondary { color: var(--text-primary); border-color: var(--border-color); }
  html.theme-dark #editLeadModal #edit_linked_info .btn-link { color: var(--bs-danger-text-emphasis) !important; } /* מול style */

  /* ══ גל 3, יחידה F — דוחות: לקוחות / משימות / תיקים (static/js/reports_mobile.js) ═══════════════════
     הכותרת "דוחות" כבר בסרגל העליון; הלשוניות בין הדוחות - שלוש בשורה, 44px. בטופס: התאריכים, החיפוש
     והכפתורים גלויים; קבוצות-הבחירה והמיון באזור "סינון ומיון". התוצאות - כרטיסים; הטבלה נשארת בעמוד
     (מקור התוצאות, המיון והיעד) ואינה מוצגת. */
  html.m-page-scroll .reports-page-header {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  html.m-page-scroll .reports-tabs { flex-wrap: nowrap; gap: 2px; }
  html.m-page-scroll .reports-tab { flex: 1 1 0; min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 6px; text-align: center; }
  html.m-page-scroll .report-table-wrap { flex: 0 0 auto; overflow: visible; min-height: 0; }
  html.m-page-scroll .main-content .card-body:has(.groups-bar) { padding: 10px 12px !important; } /* מול px-3 py-2 */
  html.m-page-scroll .card-body:has(.groups-bar) > .filter-row:first-child { gap: 10px !important; } /* מול gap-3 */
  html.m-page-scroll .card-body:has(.groups-bar) > .filter-row:first-child > div { flex: 1 1 100% !important; min-width: 0 !important; } /* מול style */
  html.m-page-scroll .card-body:has(.groups-bar) .filter-row .d-flex.align-items-center.gap-1 { gap: 6px !important; flex-wrap: wrap; }
  html.m-page-scroll .card-body:has(.groups-bar) .filter-row .d-flex.align-items-center.gap-1 > input.form-control { flex: 1 1 112px; } /* "dd/mm/yyyy" שלם ב-16px; הטווח נשבר לשתי שורות */
  html.m-page-scroll .card-body:has(.groups-bar) .filter-row input.form-control {
    flex: 1 1 0; min-width: 0; width: auto !important; min-height: 44px; font-size: max(16px, 1rem); /* מול style="width:118px" */
  }
  html.m-page-scroll .date-cal-btn { flex: 0 0 auto; width: 44px; height: 44px; padding: 0; font-size: 1.05rem; }
  html.m-page-scroll .card-body:has(.groups-bar) .m-report-filterbtn { display: inline-flex; flex: 0 0 auto; }
  html.m-page-scroll .card-body:has(.groups-bar):not(.m-rfilters-open) > .filter-row:has(> .groups-bar) { display: none; }
  html.m-page-scroll .filter-row:has(> .groups-bar) > .m-filter-tools { display: none !important; } /* "נקה הכל" הוא האיפוס */
  html.m-page-scroll .groups-bar { flex-direction: column; gap: 12px; }
  html.m-page-scroll .groups-bar .groups-sep { display: none; }
  html.m-page-scroll .groups-bar .filter-group { padding: 0; }
  html.m-page-scroll .groups-bar .pill-group { gap: 6px; }
  html.m-page-scroll .filter-pill { min-height: 44px; padding: 0 14px; border-radius: 22px; font-size: var(--text-secondary); display: inline-flex; align-items: center; white-space: normal; }
  html.m-page-scroll .filter-group-label { font-size: var(--text-small); color: var(--color-text-secondary); }
  html.m-page-scroll .filter-row:has(> .groups-bar) > .m-sort { margin-top: 12px; }
  html.m-page-scroll .card-body:has(.groups-bar) > .filter-row.d-flex.gap-2 { flex-wrap: wrap; }
  html.m-page-scroll .card-body:has(.groups-bar) > .filter-row.d-flex.gap-2 > .btn { flex: 1 1 0; min-height: 44px; padding: 0 8px; }
  html.m-page-scroll .report-result-card { height: auto !important; overflow: visible; } /* מול h-100 */
  html.m-page-scroll .report-result-card .table-card-actions { display: none; }      /* תפריט "תצוגה" - עמודות הדסקטופ */
  html.m-page-scroll .report-result-card > .m-list { padding: 8px 8px 4px; }
  html.m-page-scroll .report-result-body {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); pointer-events: none;
  }
  .m-report.is-static { cursor: default; }
  html.theme-dark.m-page-scroll .filter-pill:not(.active) { background: var(--surface-card); color: var(--text-primary); border-color: var(--border-color); }
  .m-report .gt-chip { color: #4f5968; }   /* תגיות סוג (#6b7688 על #f0f2f6): 4.1:1 - גם בערכה הכהה התגית בהירה */
  /* ערכה כהה: "נקה הכל" (3.29:1), "יצוא לאקסל" (3.4:1) והלשוניות שאינן פעילות (3.9:1) - בצבעי-הטקסט של הערכה. */
  html.theme-dark.m-page-scroll #btn-clear.btn-outline-secondary { color: var(--text-primary); border-color: var(--border-color); }
  html.theme-dark.m-page-scroll #btn-export.btn-outline-success { color: var(--bs-success-text-emphasis); border-color: var(--bs-success-text-emphasis); }
  html.m-page-scroll .reports-tab:not(.active) { color: var(--color-text-secondary); }   /* #6c757d: 4.45:1 בהיר, 3.9:1 כהה */
  html.m-page-scroll .reports-tab.active { color: var(--focus-ring-color); border-bottom-color: var(--focus-ring-color); } /* #0d6efd: 4.27 / 4.07:1 */
  html.theme-dark.m-page-scroll #btn-run.btn-primary {   /* "הפק דו"ח": אותם גוונים מוכהים של "שמור" בעורך (4.08:1 -> 6.46:1) */
    --bs-btn-bg: #2f5f9e; --bs-btn-border-color: #2f5f9e; --bs-btn-hover-bg: #3a6db0; --bs-btn-hover-border-color: #3a6db0;
    --bs-btn-active-bg: #3a6db0; --bs-btn-active-border-color: #3a6db0;
  }

  /* ══ גל 4, יחידה A — קישורים, טיוטות מסמכים, תבניות מסמכים ═══════════════════════════════════
     שלושת המסכים מציירים את כל הרשימה בעצמם (אין דפדוף ואין שורות וירטואליות); בטלפון השורות / האריחים
     הם כרטיסים, בלי לשנות את המבנה. */

  /* קישורים (static/js/links_mobile.js): כותרת-העמוד בסרגל העליון (כללי .clients-hero של מסך הלקוחות),
     "הוסף קישור" צף מעל הניווט. כל אריח - כרטיס ברוחב מלא: פס בצבע שנבחר לקישור, הכותרת, הכתובת,
     ועריכה / מחיקה גלויות תמיד (44px). */
  html.m-page-scroll .main-content:has(#linksGrid) .clients-table-card,
  html.m-page-scroll .main-content:has(.links-empty) .clients-table-card {
    position: static; width: auto; height: auto; overflow: visible; clip-path: none; pointer-events: auto; flex: 0 0 auto; /* מול הכלל של מסך הלקוחות */
  }
  html.m-page-scroll .links-card-body { overflow: visible; padding: 10px; }
  html.m-page-scroll .links-grid { flex-direction: column; gap: 10px; }
  html.m-page-scroll .link-tile {
    width: auto; min-height: 0; padding: 10px 12px 10px 10px; align-items: stretch; justify-content: flex-start; text-align: start;
    flex-direction: row; flex-wrap: wrap; gap: 4px 10px;
    background: var(--surface-card) !important; color: var(--text-heading);           /* מול style: הצבע עובר לפס */
    border: 1px solid var(--border-color); border-inline-start: 8px solid var(--link-color, #0d6efd);
    box-shadow: 0 1px 4px rgba(20, 36, 60, 0.05);
  }
  html.m-page-scroll .link-tile:hover { transform: none; }
  html.m-page-scroll .link-tile:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; }
  html.m-page-scroll .link-tile-title { flex: 1 1 0; min-width: 0; display: flex; align-items: center; min-height: 44px; font-size: 1.02rem; overflow-wrap: anywhere; }
  html.m-page-scroll .link-tile .m-link-url { display: block; flex: 1 1 100%; order: 3; color: var(--color-text-secondary); font-size: var(--text-small); overflow-wrap: anywhere; text-align: left; }
  html.m-page-scroll .link-tile-actions { position: static; display: flex; order: 2; gap: 6px; }
  html.m-page-scroll .link-tile-btn {
    width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-card-alt); color: var(--text-heading); border: 1px solid var(--border-color); border-radius: 10px; font-size: 1rem;
  }
  html.m-page-scroll .link-tile-btn .bi-trash { color: var(--color-danger); }
  #addLinkModal .form-control, #editLinkModal .form-control { min-height: 44px; font-size: max(16px, 1rem); }
  #addLinkModal .color-swatches, #editLinkModal .color-swatches { gap: 8px; }
  #addLinkModal .color-swatch, #editLinkModal .color-swatch { width: 40px; height: 40px; }
  #addLinkModal .modal-footer .btn, #editLinkModal .modal-footer .btn { min-height: 44px; min-width: 96px; }
  #addLinkModal .btn-close, #editLinkModal .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center; }

  /* טיוטות מסמכים: הכותרת והסינון (הכל / עורך PDF / איחוד) בראש; כל טיוטה - כרטיס: שם, סוג, מועד העדכון,
     הלקוח / התיק, ופתח / שנה שם / מחק בשורה של 44px. "פתח" ממשיך לכלי שאינו נתמך בטלפון - ראו ההסבר. */
  html.m-page-scroll .main-content:has(#drafts-table) .merge-panel,
  html.m-page-scroll .main-content:has(#drafts-table) .merge-panel-body { overflow: visible; flex: 0 0 auto; }
  html.m-page-scroll .merge-hero:has(#drafts-filter) { padding: 10px 12px; }
  html.m-page-scroll .merge-hero:has(#drafts-filter) h1 { font-size: 1.25rem; }
  html.m-page-scroll .drafts-filter { display: flex; width: 100%; }
  html.m-page-scroll .drafts-filter-btn { flex: 1 1 auto; min-height: 44px; }
  html.m-page-scroll .drafts-table, html.m-page-scroll .drafts-table tbody { display: block; }
  html.m-page-scroll .drafts-table thead { display: none; }
  html.m-page-scroll .drafts-table tbody tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px; margin: 8px;
    background: var(--surface-card); border: 1px solid var(--border-color); border-radius: 12px;
  }
  html.m-page-scroll .drafts-table tbody td { display: block; padding: 0; border: 0; background: none !important; }
  html.m-page-scroll .drafts-table tbody td:first-child { flex: 1 1 100%; }
  html.m-page-scroll .drafts-table tbody td:nth-child(3)::before { content: "עודכן: "; color: var(--color-text-secondary); }
  html.m-page-scroll .drafts-table tbody td.drafts-ctx { flex: 1 1 100%; overflow-wrap: anywhere; }
  html.m-page-scroll .drafts-table tbody td.drafts-ctx a { display: inline-flex; align-items: center; min-height: 44px; }
  html.m-page-scroll .drafts-table .drafts-col-actions { flex: 1 1 100%; width: auto; }
  html.m-page-scroll .drafts-actions { display: flex; gap: 8px; width: 100%; }
  html.m-page-scroll .drafts-actions .btn { flex: 1 1 0; min-height: 44px; font-size: var(--text-secondary); padding: 0 6px; }
  #draftDeleteModal .app-modal-footer .btn { min-height: 44px; min-width: 96px; }
  #draftDeleteModal .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center; }

  /* תבניות מסמכים: הכותרת בסרגל העליון; "העלאת תבנית" נשארת בראש; חיפוש + "נקה חיפוש" בשורה; כל תבנית -
     כרטיס: שם, קטגוריה, סוג-הקובץ, התאריך, ו"צור מסמך" / "מחק" (44px). */
  html.m-page-scroll .tmpl-hero { flex-direction: row !important; align-items: center !important; padding: 10px 12px; gap: 8px; }
  html.m-page-scroll .tmpl-hero h1 { font-size: 1.25rem; }
  html.m-page-scroll .tmpl-hero .sub { display: none; }
  html.m-page-scroll .tmpl-hero .hero-btn { min-height: 44px; }
  html.m-page-scroll .tmpl-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
  html.m-page-scroll .tmpl-toolbar .toolbar-search-input { flex: 1 1 100%; min-height: 44px; font-size: max(16px, 1rem); }
  html.m-page-scroll .tmpl-toolbar .toolbar-action-btn { min-height: 44px; }
  html.m-page-scroll .tmpl-table-card, html.m-page-scroll .tmpl-table-wrap { overflow: visible; flex: 0 0 auto; }
  html.m-page-scroll .tmpl-table, html.m-page-scroll .tmpl-table tbody { display: block; }
  html.m-page-scroll .tmpl-table thead { display: none; }
  html.m-page-scroll .tmpl-table tbody tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px; margin: 8px;
    background: var(--surface-card); border: 1px solid var(--border-color); border-radius: 12px;
  }
  html.m-page-scroll .tmpl-table tbody tr.hidden-row { display: none; }
  html.m-page-scroll .tmpl-table tbody td { display: block; padding: 0; border: 0; background: none !important; }
  html.m-page-scroll .tmpl-table tbody td:first-child { display: none; }            /* "#" - מספר-שורה בלבד */
  html.m-page-scroll .tmpl-table tbody td:nth-child(2) { flex: 1 1 100%; overflow-wrap: anywhere; }
  html.m-page-scroll .tmpl-table tbody td:nth-child(5) { order: 9; flex: 1 1 100%; display: flex; gap: 8px; white-space: normal !important; } /* מול style */
  html.m-page-scroll .tmpl-table tbody td:nth-child(5) > .tmpl-btn, html.m-page-scroll .tmpl-table tbody td:nth-child(5) > form { flex: 1 1 0; margin: 0 !important; } /* מול style */
  html.m-page-scroll .tmpl-table tbody td:nth-child(5) .tmpl-btn { width: 100%; min-height: 44px; justify-content: center; }
  html.m-page-scroll .tmpl-table tbody td:nth-child(6) { color: var(--color-text-secondary); }
  #uploadModal .form-control, #createDocModal .form-control { min-height: 44px; font-size: max(16px, 1rem); }
  #uploadModal .modal-footer .btn, #createDocModal .modal-footer .btn, #createDocMsg .btn { min-height: 44px; }
  #uploadModal .btn-close, #createDocModal .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center; }

  /* עורך ה-PDF ואיחוד המסמכים (static/js/mobile_desktop_only.js): חלון-ההסבר בנקודות-הכניסה, ומסך-ההסבר
     בכתובת הכלי - במקום הכלי, שאינו מאותחל (`m-tool-phone`); כלי שכבר רץ והחלון הוצר - מוסתר (`m-tool-narrow`). */
  #mToolDesktopOnlyModal .modal-title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
  #mToolDesktopOnlyModal .modal-body p:last-child { margin-bottom: 0; }
  #mToolDesktopOnlyModal .modal-footer .btn { min-height: 44px; min-width: 120px; }
  #mToolDesktopOnlyModal .btn-close { box-sizing: border-box; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center; }
  html.m-tool-phone, html.m-tool-phone body { height: auto !important; overflow: visible !important; } /* מול נעילת-העמוד של הכלי */
  html.m-tool-phone .main-content { height: auto !important; min-height: calc(100dvh - var(--mnav-h, 0px)); overflow: visible !important; display: flex; flex-direction: column; }
  html.m-tool-phone .main-content > .gnav, html.m-tool-narrow .main-content > .gnav { order: -1; } /* הסרגל העליון מעל ההסבר */
  html.m-tool-phone .main-content > :not(.m-tool-explain):not(.gnav),
  html.m-tool-narrow .main-content > :not(.m-tool-explain):not(.gnav) { display: none !important; } /* הסרגל העליון נשאר */
  html.m-tool-phone .m-tool-explain, html.m-tool-narrow .m-tool-explain {
    display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    margin: 12px 4px; padding: 28px 18px; background: var(--surface-card); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: 16px;
  }
  .m-tool-explain .m-tool-explain-icon { font-size: 2.6rem; color: var(--focus-ring-color); }
  .m-tool-explain .m-tool-explain-title { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--text-heading); }
  .m-tool-explain p { margin: 0; max-width: 34em; }
  .m-tool-explain-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }
  .m-tool-explain-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  /* ערכה כהה - ההסבר (שני החלונות ומסך-הכלי): הכפתור הראשי בגוונים המוכהים (במיקוד / ריחוף #6d9bd6: 2.87:1). */
  html.theme-dark #mToolDesktopOnlyModal .btn-primary, html.theme-dark #mDesktopOnlyModal .btn-primary, html.theme-dark .m-tool-explain .btn-primary {
    --bs-btn-bg: #2f5f9e; --bs-btn-border-color: #2f5f9e; --bs-btn-hover-bg: #3a6db0; --bs-btn-hover-border-color: #3a6db0;
    --bs-btn-active-bg: #3a6db0; --bs-btn-active-border-color: #3a6db0;
  }
  html.theme-dark .m-tool-explain .btn-outline-secondary { color: var(--text-primary); border-color: var(--border-color); }
  /* טיוטות ותבניות: צבעים קבועים של העמוד שאינם קריאים - בטלפון בצבעי-הערכה (בהיר: תאריך / מונה 2.9:1;
     כהה: כותרות ושמות 1.1-1.2:1, תיאור 2.98:1, "שנה שם" 3.45:1). */
  html.m-page-scroll .tmpl-table tbody td[style*="color"] { color: var(--color-text-secondary) !important; } /* מול style */
  html.m-page-scroll #tmpl-count { color: var(--color-text-secondary); }
  html.theme-dark.m-page-scroll .tmpl-hero, html.theme-dark.m-page-scroll .tmpl-table-card, html.theme-dark.m-page-scroll .tmpl-table-card-header,
  html.theme-dark.m-page-scroll .merge-hero:has(#drafts-filter), html.theme-dark.m-page-scroll .main-content:has(#drafts-table) .merge-panel { background: var(--surface-card); border-color: var(--border-color); }
  html.theme-dark.m-page-scroll .tmpl-hero h1, html.theme-dark.m-page-scroll .tmpl-table-title, html.theme-dark.m-page-scroll .merge-hero:has(#drafts-filter) h1 { color: var(--text-heading); }
  html.theme-dark.m-page-scroll .tmpl-hero .sub, html.theme-dark.m-page-scroll .merge-hero:has(#drafts-filter) .sub { color: var(--color-text-secondary); }
  html.theme-dark.m-page-scroll .tmpl-table tbody td, html.theme-dark.m-page-scroll .tmpl-table tbody td strong { color: var(--text-primary); }
  html.theme-dark.m-page-scroll .tmpl-toolbar .toolbar-search-input, html.theme-dark.m-page-scroll .tmpl-toolbar .toolbar-action-btn { background: var(--surface-card); color: var(--text-primary); border-color: var(--border-color); }
  html.theme-dark.m-page-scroll .drafts-actions .btn-outline-secondary { color: var(--text-primary); border-color: var(--border-color); }
  html.theme-dark.m-page-scroll .drafts-actions .btn-outline-danger { color: var(--bs-danger-text-emphasis); border-color: var(--bs-danger-text-emphasis); } /* 3.57:1 */
  html.m-page-scroll .tmpl-empty, html.m-page-scroll .links-empty, html.m-page-scroll .drafts-empty { color: var(--color-text-secondary); } /* הודעות-ריק: #aab4c2 / #7a8899 */

  /* ══ גל 4, יחידה B — הגדרות (settings/_shell.html: me / office / users / data) ודף-הנחיתה ══════════
     בדסקטופ אזור ההגדרות הוא מסך קבוע שבו גוללת רק `.settings-pane`. בטלפון המסמך הוא הגולל היחיד: הכותרת,
     בורר-הקטגוריה ושורת-הטאבים נגללים עם התוכן, ושורת-השמירה של הגדרות המשרד צפה מעל הניווט התחתון. */
  html.m-page-scroll:has(.settings-shell), html.m-page-scroll:has(.settings-shell) body { overflow: visible; height: auto; } /* מול settings_shell.css */
  html.m-page-scroll .main-content.settings-shell { overflow: visible; }
  html.m-page-scroll .settings-shell .settings-shell-content { flex: 0 0 auto; display: block; min-height: 0; }
  html.m-page-scroll .settings-shell .settings-pane { overflow: visible; display: block; flex: 0 0 auto; margin-inline: 0; padding: 2px 0 16px; scrollbar-gutter: auto; }
  html.m-page-scroll .settings-shell .settings-catnav { display: none; }                  /* בורר-הקטגוריה - גם בין 721 ל-767px */
  html.m-page-scroll .settings-shell .settings-catselect { display: block; margin-bottom: 10px; }
  html.m-page-scroll .settings-shell .settings-catselect .form-select { font-size: max(16px, 1rem); }
  html.m-page-scroll .settings-shell .settings-shell-header { margin-bottom: 8px; }
  html.m-page-scroll .settings-shell .settings-console-link { min-height: 44px; }
  /* טאבי-המקטע: שורה אחת שגוללת בתוך עצמה (settings_mobile.js מביא את הפעיל לתצוגה). */
  html.m-page-scroll .settings-shell .settings-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
  html.m-page-scroll .settings-shell .settings-tabs::-webkit-scrollbar { display: none; }
  html.m-page-scroll .settings-shell .tab-btn { flex: 0 0 auto; min-height: 44px; padding: 0 14px; white-space: nowrap; }
  /* שדות ופקדים: 44px ו-16px (דפדפן-טלפון מגדיל את העמוד במיקוד בשדה קטן יותר). */
  html.m-page-scroll .settings-shell .form-control, html.m-page-scroll .settings-shell .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  html.m-page-scroll .settings-shell .btn { min-height: 44px; }
  html.m-page-scroll .settings-shell .form-check:has(> .form-check-input) { display: flex; align-items: center; gap: 8px; min-height: 44px; }
  html.m-page-scroll .settings-shell .form-check > .form-check-input { margin-top: 0; flex: 0 0 auto; }
  html.m-page-scroll .settings-shell .form-check > .form-check-label { flex: 1 1 auto; }
  html.m-page-scroll .settings-shell .ct-list { max-height: none; overflow: visible; }      /* גולל יחיד: המסמך */
  html.m-page-scroll .save-bar { padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
  html.m-page-scroll .save-bar .btn { min-height: 44px; }

  /* טבלאות ההגדרות - כרטיס לכל שורה (כותרות-העמודות כתוויות). רוחבי-העמודות של הדסקטופ אינם משתנים. */
  html.m-page-scroll .settings-shell .stbl-scroll { overflow: visible !important; max-height: none !important; } /* מול stbl-scroll--tall */
  html.m-page-scroll .settings-shell table.stbl, html.m-page-scroll .settings-shell table.stbl > tbody { display: block; width: auto !important; min-width: 0 !important; } /* מול style */
  html.m-page-scroll .settings-shell table.stbl > thead, html.m-page-scroll .settings-shell table.stbl > colgroup { display: none; }
  html.m-page-scroll .settings-shell table.stbl > tbody > tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 12px; margin-bottom: 8px;
    background: var(--surface-card); border: 1px solid var(--border-color); border-radius: 12px;
  }
  html.m-page-scroll .settings-shell table.stbl > tbody > tr > td {
    display: block; width: auto !important; max-width: none !important; min-width: 0; height: auto; padding: 0; border: 0;
    position: static !important; background: none !important; white-space: normal !important; overflow: visible; overflow-wrap: anywhere; /* מול העמודה הדביקה */
  }
  html.m-page-scroll .settings-shell table.stbl > tbody > tr > td::before { color: var(--color-text-secondary); font-weight: 400; }
  html.m-page-scroll .settings-shell table.stbl > tbody > tr > td.stbl-actions,
  html.m-page-scroll .settings-shell table.stbl > tbody > tr > td:last-child:has(button, a) { flex: 1 1 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  html.m-page-scroll .settings-shell .stbl-act { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  html.m-page-scroll .settings-shell table.stbl > tbody > tr > td.stbl-rownum { display: none; }
  html.m-page-scroll .settings-shell table.stbl > tbody > tr > td[colspan] { flex: 1 1 100%; text-align: center; }   /* שורת "אין נתונים" */
  /* משתמשים: # · שם משתמש · שם מלא · אימייל · תפקיד · פעולות */
  html.m-page-scroll .settings-shell table.users-table > tbody > tr > td:nth-child(1) { display: none; }
  html.m-page-scroll .settings-shell table.users-table > tbody > tr > td:nth-child(3) { order: -1; flex: 1 1 100%; font-weight: 700; color: var(--text-heading); }
  html.m-page-scroll .settings-shell table.users-table > tbody > tr > td:nth-child(2)::before { content: "שם משתמש: "; }
  html.m-page-scroll .settings-shell table.users-table > tbody > tr > td:nth-child(4) { flex: 1 1 100%; }
  html.m-page-scroll .settings-shell table.users-table > tbody > tr > td:nth-child(5)::before { content: "תפקיד: "; }
  /* שדות לקוח: # · שם שדה · סוג · עבור · מוצג ב־ · פעולות */
  html.m-page-scroll .settings-shell #cf-table > tbody > tr > td:nth-child(2) { flex: 1 1 100%; font-weight: 700; color: var(--text-heading); }
  html.m-page-scroll .settings-shell #cf-table > tbody > tr > td:nth-child(3)::before { content: "סוג: "; }
  html.m-page-scroll .settings-shell #cf-table > tbody > tr > td:nth-child(4)::before { content: "עבור: "; }
  html.m-page-scroll .settings-shell #cf-table > tbody > tr > td:nth-child(5)::before { content: "מוצג ב־: "; }
  /* פריטי חיוב: שם · תיאור · מחיר · כמות · מע"מ · פעיל · סדר · קוד · פעולות */
  html.m-page-scroll .settings-shell #fin-items-table > tbody > tr > td:nth-child(1) { flex: 1 1 100%; color: var(--text-heading); }
  html.m-page-scroll .settings-shell #fin-items-table > tbody > tr > td:nth-child(2) { flex: 1 1 100%; }
  html.m-page-scroll .settings-shell #fin-items-table > tbody > tr > td:nth-child(3)::before { content: "מחיר ברירת מחדל: "; }
  html.m-page-scroll .settings-shell #fin-items-table > tbody > tr > td:nth-child(4)::before { content: "כמות: "; }
  html.m-page-scroll .settings-shell #fin-items-table > tbody > tr > td:nth-child(5)::before { content: "חייב במע״מ: "; }
  html.m-page-scroll .settings-shell #fin-items-table > tbody > tr > td:nth-child(7)::before { content: "סדר תצוגה: "; }
  html.m-page-scroll .settings-shell #fin-items-table > tbody > tr > td:nth-child(8)::before { content: "קוד פנימי: "; }
  /* פעילות: תאריך ושעה · משתמש · תחום · פעולה · פירוט · קישור */
  html.m-page-scroll .settings-shell #act-table > tbody > tr > td:nth-child(4) { order: -1; flex: 1 1 100%; font-weight: 700; color: var(--text-heading); }
  html.m-page-scroll .settings-shell #act-table > tbody > tr > td:nth-child(3)::before { content: "תחום: "; }
  html.m-page-scroll .settings-shell #act-table > tbody > tr > td:nth-child(5) { flex: 1 1 100%; }
  html.m-page-scroll .settings-shell #act-table > tbody > tr > td:nth-child(5):empty, html.m-page-scroll .settings-shell #act-table > tbody > tr > td:nth-child(6):empty { display: none; }
  html.m-page-scroll .settings-shell #act-table > tbody > tr > td:nth-child(6) a { display: inline-flex; align-items: center; min-height: 44px; }
  /* סל מיחזור: נמחק בתאריך · סוג · שם · לקוח · נמחק ע"י · פעולות */
  html.m-page-scroll .settings-shell #rb-table > tbody > tr > td:nth-child(3) { order: -1; flex: 1 1 100%; font-weight: 700; color: var(--text-heading); }
  html.m-page-scroll .settings-shell #rb-table > tbody > tr > td:nth-child(1)::before { content: "נמחק: "; }
  html.m-page-scroll .settings-shell #rb-table > tbody > tr > td:nth-child(4)::before { content: "לקוח: "; }
  html.m-page-scroll .settings-shell #rb-table > tbody > tr > td:nth-child(5)::before { content: "נמחק ע\"י: "; }

  /* חלונות ההגדרות: עמודה אחת, שדות 44px, הפעולות בתחתית. "שדה לקוח" (הארוך) - במסך מלא. */
  #caseTypeModal .modal-body .row > [class*="col"], #chargeItemModal .modal-body .row > [class*="col"], #clientFieldModal .modal-body .row > [class*="col"],
  #addUserModal .modal-body .row > [class*="col"], #editUserModal .modal-body .row > [class*="col"] { flex: 0 0 100%; max-width: 100%; }
  #caseTypeModal .form-control, #caseTypeModal .form-select, #chargeItemModal .form-control, #chargeItemModal .form-select,
  #clientFieldModal .form-control, #clientFieldModal .form-select, #addUserModal .form-control, #addUserModal .form-select,
  #editUserModal .form-control, #editUserModal .form-select, #stPurgeModal .form-control { min-height: 44px; font-size: max(16px, 1rem); }
  #caseTypeModal .modal-footer .btn, #chargeItemModal .modal-footer .btn, #clientFieldModal .modal-footer .btn,
  #addUserModal .modal-footer .btn, #editUserModal .modal-footer .btn, #stPurgeModal .modal-footer .btn { min-height: 44px; min-width: 96px; }
  #caseTypeModal .btn-close, #chargeItemModal .btn-close, #clientFieldModal .btn-close, #addUserModal .btn-close, #editUserModal .btn-close, #stPurgeModal .btn-close {
    box-sizing: border-box; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center;
  }
  #caseTypeModal .form-check, #chargeItemModal .form-check, #clientFieldModal .form-check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
  #caseTypeModal .form-check-input, #chargeItemModal .form-check-input, #clientFieldModal .form-check-input { margin-top: 0; flex: 0 0 auto; }
  #clientFieldModal .modal-dialog, #addUserModal .modal-dialog, #chargeItemModal .modal-dialog { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
  #clientFieldModal .modal-content, #addUserModal .modal-content, #chargeItemModal .modal-content { height: 100%; border: 0; border-radius: 0; }
  #addUserModal .modal-content > form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
  #clientFieldModal .modal-body, #addUserModal .modal-body, #chargeItemModal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

  /* ההגדרות שלי: כרטיסים בעמודה אחת; פקדי תמונת-הפרופיל, יומן Google והעדפות-התצוגה 44px. */
  html.m-page-scroll .settings-shell .ps-action, html.m-page-scroll .settings-shell .ps-profile-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  html.m-page-scroll .settings-shell .ps-row .value { overflow-wrap: anywhere; }
  html.m-page-scroll .settings-shell .pdp-radio-row label { min-height: 44px; }

  /* ניגודיות בטלפון בלבד (הדסקטופ ללא שינוי - ראו התכנית, סעיף 15): טקסט-המשנה של ההגדרות (#7a8899, 3.43:1)
     בצבע-המשני; תוויות ומספרים בצבע קבוע או בצבעי Bootstrap שאינם קריאים על הרקע. */
  html.m-page-scroll .settings-shell { --text-muted: var(--color-text-secondary); }
  html.m-page-scroll .settings-shell #usersFilterReset { color: var(--color-text-secondary); }
  html.m-page-scroll .settings-shell .text-warning { color: #8a6100 !important; }               /* #ffc107 על לבן: 1.63:1 */
  html.m-page-scroll .settings-shell .text-danger { color: #b02a37 !important; }
  html.theme-dark.m-page-scroll .settings-shell .text-warning { color: var(--color-warning) !important; }
  html.theme-dark.m-page-scroll .settings-shell .text-danger { color: var(--color-danger) !important; }
  html.theme-dark.m-page-scroll #planUsageCards .fw-bold { color: var(--text-heading) !important; } /* מול style: #1a2e4a */
  html.theme-dark.m-page-scroll .settings-shell .btn-primary,
  html.theme-dark.m-page-scroll .settings-shell .pdp-radio-row input[type="radio"]:checked + label { background-color: #2f5f9e; border-color: #2f5f9e; }
  html.theme-dark.m-page-scroll .settings-shell .btn-primary:hover { background-color: #3a6db0; border-color: #3a6db0; }
  html.theme-dark.m-page-scroll #saveBar .btn-primary { background-color: #2f5f9e; border-color: #2f5f9e; }   /* שורת-השמירה - מחוץ ל-.settings-shell */
  html.theme-dark.m-page-scroll #saveBar .btn-primary:hover { background-color: #3a6db0; border-color: #3a6db0; }
  html.theme-dark.m-page-scroll .settings-shell .btn-outline-primary { color: var(--color-primary-hover); border-color: var(--color-primary-hover); }
  html.theme-dark.m-page-scroll .settings-shell .btn-outline-primary:hover { color: #fff; background-color: #2f5f9e; }
  /* אותם תיקונים בחלונות ההגדרות (מחוץ ל-.settings-shell). */
  :is(#caseTypeModal, #chargeItemModal, #clientFieldModal, #addUserModal, #editUserModal, #stPurgeModal) { --text-muted: var(--color-text-secondary); }
  html.theme-dark :is(#caseTypeModal, #chargeItemModal, #clientFieldModal, #addUserModal, #editUserModal, #stPurgeModal) .btn-outline-secondary { color: var(--color-text-secondary); }
  html.theme-dark :is(#caseTypeModal, #chargeItemModal, #clientFieldModal, #addUserModal, #editUserModal, #stPurgeModal) .text-danger { color: var(--color-danger) !important; }
  html.theme-dark :is(#caseTypeModal, #chargeItemModal, #clientFieldModal, #addUserModal, #editUserModal, #stPurgeModal) .btn-primary { background-color: #2f5f9e; border-color: #2f5f9e; }
  html.theme-dark :is(#caseTypeModal, #chargeItemModal, #clientFieldModal, #addUserModal, #editUserModal, #stPurgeModal) .btn-primary:hover { background-color: #3a6db0; border-color: #3a6db0; }
  html.theme-dark #stPurgeModal .btn-danger { background-color: #b02a37; border-color: #b02a37; color: #fff; }

  /* דף-הנחיתה (leads_landing_settings.html): הטופס ומתחתיו התצוגה המקדימה, העמוד גולל כולו. */
  html.m-page-scroll:has(#lp-row), html.m-page-scroll:has(#lp-row) body { overflow: visible; height: auto; } /* מול style */
  html.m-page-scroll .main-content:has(#lp-row) { overflow: visible; padding: 10px; }
  html.m-page-scroll .main-content:has(#lp-row) .page-hero { padding: 10px 14px; flex-wrap: wrap; }
  html.m-page-scroll .main-content:has(#lp-row) .page-hero h1 { font-size: 1.25rem; }
  html.m-page-scroll #lp-row { display: block; overflow: visible; }
  html.m-page-scroll #col-settings { max-width: none; overflow: visible; }
  html.m-page-scroll #col-settings .settings-card { padding: 16px; }
  html.m-page-scroll #col-preview { margin-top: 1rem; }
  html.m-page-scroll #col-preview .preview-wrap { padding: 16px; }
  html.m-page-scroll #col-preview .preview-frame-wrap iframe { flex: none; height: 560px; }
  html.m-page-scroll #col-settings .form-control, html.m-page-scroll #col-settings .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  html.m-page-scroll #col-settings .form-control-color { width: 56px; flex: 0 0 auto; }
  html.m-page-scroll #col-settings input[id$="_color_hex"] { direction: ltr; text-align: left; }   /* "#1f3657" ולא "f0f4f9#" */
  html.m-page-scroll #col-settings .url-box { flex-wrap: wrap; }
  html.m-page-scroll #col-settings .btn-copy, html.m-page-scroll #col-settings .toolbar-action-btn { min-height: 44px; }
  html.m-page-scroll #col-settings .btn-save { height: auto; min-height: 44px; }
  html.m-page-scroll #col-settings .form-switch { min-height: 44px; display: flex; align-items: center; }
  /* ניגודיות (טלפון בלבד): ההערות הקטנות (#8a9bb0 ב-style, 2.53:1) בצבע-המשני; בערכה הכהה העמוד שומר על
     צבעים בהירים קבועים - הכרטיסים והכותרות עוברים לצבעי הערכה. */
  html.m-page-scroll .main-content:has(#lp-row) [style*="#8a9bb0"] { color: var(--color-text-secondary) !important; }
  html.theme-dark.m-page-scroll .main-content:has(#lp-row) :is(.page-hero, .settings-card, .preview-wrap) { background: var(--surface-card); border-color: var(--border-color); }
  html.theme-dark.m-page-scroll .main-content:has(#lp-row) :is(.page-hero h1, .settings-card h5, .preview-wrap h5) { color: var(--text-heading); border-color: var(--border-color); }
  html.theme-dark.m-page-scroll .main-content:has(#lp-row) :is(.page-hero .sub, .form-label, #active-label) { color: var(--color-text-secondary) !important; } /* מול style */

  /* ══ גל 4, יחידה C — מסכי מנהל-המערכת (סקירה, ארגונים, תחזוקה, פרטי ארגון, יומן, עורך עמוד-הנחיתה) ══
     המסמך הוא הגולל היחיד (בדסקטופ חלק מהמסכים גוללים בתוך עמודות). הטבלאות הן כרטיסים - אותן שורות,
     ולכן הסינון, הספירות, העימוד והטפסים לא השתנו; כותרות-העמודות הן תוויות. הניווט: עוד → רשימת המערכת.
     כל פעולה נשארת הטופס / האישור הקיים. static/js/sysadmin_mobile.js: הקשה על כרטיס ארגון, מיקוד אחרי חלון. */
  html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters), .lnd) { overflow: visible; padding: 10px; }

  /* ── ארגונים ── */
  html.m-page-scroll .main-content:has(#orgsTable) .page-header { flex-wrap: wrap; gap: 8px; }
  html.m-page-scroll .main-content:has(#orgsTable) .page-header .btn { min-height: 44px; }
  html.m-page-scroll .stats-row > [class*="col-"] { flex: 0 0 25%; max-width: 25%; }       /* ארבעה מדדים בשורה אחת */
  html.m-page-scroll .stats-row .stat-card { padding: 6px 4px; height: 100%; }
  html.m-page-scroll .stats-row .stat-card .stat-num { font-size: 1.15rem; }
  html.m-page-scroll .stats-row .stat-card .stat-label { font-size: var(--text-badge); line-height: 1.25; color: var(--color-text-secondary); }
  html.m-page-scroll #orgsTable, html.m-page-scroll #orgsTable > thead, html.m-page-scroll #orgsTable > tbody { display: block; }
  html.m-page-scroll #orgsTable > thead > tr:first-child { display: none; }
  /* שורת המסננים - שתי עמודות, עם תווית לכל מסנן */
  html.m-page-scroll #orgsTable > thead > tr.orgs-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; padding: 10px 12px; }
  html.m-page-scroll #orgsTable > thead > tr.orgs-filters > th { display: block; position: static; height: auto; padding: 0; border: 0; box-shadow: none; background: none; }
  html.m-page-scroll #orgsTable > thead > tr.orgs-filters > th:not(:has(input, select)) { display: none; }
  html.m-page-scroll #orgsTable > thead > tr.orgs-filters > th::before { display: block; margin-bottom: 3px; font-size: var(--text-small); font-weight: 600; color: var(--color-text-secondary); }
  html.m-page-scroll #orgsTable > thead > tr.orgs-filters > th:nth-child(2)::before { content: "שם"; }
  html.m-page-scroll #orgsTable > thead > tr.orgs-filters > th:nth-child(3)::before { content: "Slug"; }
  html.m-page-scroll #orgsTable > thead > tr.orgs-filters > th:nth-child(4)::before { content: "תוכנית"; }
  html.m-page-scroll #orgsTable > thead > tr.orgs-filters > th:nth-child(5)::before { content: "סטטוס מנוי"; }
  html.m-page-scroll #orgsTable > thead > tr.orgs-filters > th:nth-child(10)::before { content: "ארגון פעיל"; }
  html.m-page-scroll #orgsTable .form-control, html.m-page-scroll #orgsTable .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  /* כרטיס לכל ארגון: # · שם · slug · תוכנית · מנוי · משתמשים · אחסון · מכסה · תפוגה · פעיל · פעולות */
  html.m-page-scroll #orgsTable > tbody > tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px;
    border-top: 1px solid var(--border-color); cursor: pointer;
  }
  html.m-page-scroll #orgsTable > tbody > tr > td { display: block; padding: 0; border: 0; min-width: 0 !important; background: none; box-shadow: none; white-space: normal; overflow-wrap: anywhere; } /* מול style */
  html.m-page-scroll #orgsTable > tbody > tr > td::before { color: var(--color-text-secondary); font-weight: 400; }
  html.m-page-scroll #orgsTable > tbody > tr > td[colspan] { flex: 1 1 100%; text-align: center; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(2) { order: -3; flex: 1 1 calc(100% - 70px); font-size: var(--text-body); color: var(--text-heading); }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(1) { order: -2; flex: 0 0 auto; font-size: var(--text-small); }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(1)::before { content: "#"; }
  html.m-page-scroll #orgsTable > tbody > tr > td:is(:nth-child(4), :nth-child(5), :nth-child(10)) { order: -1; flex: 0 0 auto; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(3) { flex: 1 1 100%; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(3)::before { content: "Slug: "; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(6) { flex: 1 1 100%; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(6)::before { content: "משתמשים / מכסה: "; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(7) { flex: 1 1 100%; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(7)::before { content: "אחסון בשימוש"; display: block; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(8)::before { content: "מכסת אחסון: "; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(9)::before { content: "תפוגה: "; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(11) { flex: 1 1 100%; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(11) .btn { min-height: 44px; min-width: 72px; display: inline-flex; align-items: center; justify-content: center; }
  html.m-page-scroll #createOrgModal .form-control, html.m-page-scroll #createOrgModal .form-select { min-height: 44px; font-size: max(16px, 1rem); }

  /* גדלים ("10 GB") בכרטיסים: הערך משמאל-לימין והתווית מימינו - אחרת בהקשר RTL הוא מוצג "GB 10". */
  html.m-page-scroll :is(#orgsTable > tbody > tr > td:nth-child(8), #orgsTable > tbody > tr > td:nth-child(7):not(:has(.progress)), #tab-maint .table-responsive > table > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5)), .so-wrap #backups .mini td:nth-child(3)) {
    direction: ltr; display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 0.3em;
  }
  html.m-page-scroll :is(#orgsTable > tbody > tr > td:nth-child(8), #orgsTable > tbody > tr > td:nth-child(7):not(:has(.progress)), #tab-maint .table-responsive > table > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5)), .so-wrap #backups .mini td:nth-child(3))::before { direction: rtl; }
  html.m-page-scroll #orgsTable > tbody > tr > td:nth-child(7):not(:has(.progress))::before { display: inline; content: "אחסון בשימוש: "; }

  /* ── תחזוקה וגיבויים ── */
  html.m-page-scroll #tab-maint .table-responsive { overflow: visible; }
  html.m-page-scroll #tab-maint .table-responsive > table, html.m-page-scroll #tab-maint .table-responsive > table > tbody { display: block; }
  html.m-page-scroll #tab-maint .table-responsive > table > thead { display: none; }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 2px; border-top: 1px solid var(--border-color); }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td { display: block; padding: 0; border: 0; background: none; box-shadow: none; }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td::before { color: var(--color-text-secondary); }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td:nth-child(1) { order: -2; flex: 1 1 auto; font-weight: 600; color: var(--text-heading); text-align: right !important; } /* מול text-end */
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td:nth-child(2) { order: -1; }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td:nth-child(3)::before { content: "גודל כולל: "; }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td:nth-child(4)::before { content: "מסד נתונים: "; }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td:nth-child(5)::before { content: "קבצים: "; }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td:nth-child(6)::before { content: "אימות: "; }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td:nth-child(7) { direction: rtl; text-align: right !important; } /* מספר בלבד; התווית מימין */
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td:nth-child(7)::before { content: "קבצים שהשתנו: "; }
  html.m-page-scroll #tab-maint .table-responsive > table > tbody > tr > td:nth-child(8)::before { content: "עותק חיצוני: "; }

  /* ── סקירת מערכת ── */
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .kpi-card { min-height: 0; padding: 8px 10px 9px; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .kpi-num:not(.is-text) { font-size: 1.4rem; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .kpi-num.is-text { font-size: var(--text-body); line-height: 1.3; }     /* "נדרש טיפול דחוף", "81 GB / 100 GB" */
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .dash-hero { padding: 10px 14px; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .panel-head { flex-wrap: wrap; padding: 12px 14px 8px; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .see-all { min-height: 44px; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .mini, html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .mini > tbody { display: block; table-layout: auto; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .mini > thead { display: none; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .mini > tbody > tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 8px 2px; border-bottom: 1px solid var(--border-color); }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .mini > tbody > tr:last-child { border-bottom: 0; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .mini > tbody > tr > td { display: block; padding: 0; border: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; color: var(--color-text-secondary); }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .mini > tbody > tr > td.c-main { flex: 1 1 auto; color: var(--text-heading); }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .mini > tbody > tr > td.mini-empty { flex: 1 1 100%; text-align: center; }
  html.m-page-scroll .main-content.so-wrap:has(.kpi-grid) .mini a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
  html.m-page-scroll .so-wrap #backups .mini td:nth-child(1) { text-align: right !important; } /* מול style */
  html.m-page-scroll .so-wrap #backups .mini td:nth-child(3)::before { content: "גודל: "; }
  html.m-page-scroll .so-wrap #backups .mini td:nth-child(4)::before { content: "עותק חיצוני: "; }
  html.m-page-scroll .so-wrap #orgs .mini td:nth-child(3)::before { content: "משתמשים: "; }
  html.m-page-scroll .so-wrap #orgs .mini td:nth-child(4)::before { content: "תוכנית: "; }
  html.m-page-scroll .so-wrap #users .mini td:nth-child(2) { order: 1; flex: 1 1 100%; }
  html.m-page-scroll .so-wrap #users .mini td:nth-child(2)::before { content: "ארגון: "; }
  html.m-page-scroll .so-wrap #users .mini td:nth-child(4) { order: 2; }
  html.m-page-scroll .so-wrap #users .mini td:nth-child(4)::before { content: "כניסה אחרונה: "; }
  html.m-page-scroll .so-wrap #users .mini td:nth-child(5) { order: 3; }
  html.m-page-scroll .so-wrap #users .mini td:nth-child(5)::before { content: "פעילות אחרונה: "; }
  html.m-page-scroll .so-wrap #leads .mini td:nth-child(1) { flex: 1 1 100%; }
  html.m-page-scroll .so-wrap #leads .mini td:nth-child(2) { flex: 1 1 100%; }
  html.m-page-scroll .so-wrap #leads .mini td:nth-child(2)::before { content: "ארגון: "; }
  html.m-page-scroll .so-wrap #leads .mini td:nth-child(3)::before { content: "מקור: "; }
  html.m-page-scroll .so-wrap #leads .mini td:nth-child(4)::before { content: "גיל: "; }

  /* ── פרטי ארגון ── */
  html.m-page-scroll .main-content:has(.org-grid) { padding-bottom: 76px; }       /* מקום לכפתור השמירה הצף */
  html.m-page-scroll .org-topbar { gap: 8px; }
  html.m-page-scroll .org-topbar h4 { order: -1; flex: 1 1 100%; overflow-wrap: anywhere; line-height: 1.3; }       /* השם, ומתחתיו חזרה והתגיות */
  html.m-page-scroll .org-topbar > .btn { min-height: 44px; display: inline-flex; align-items: center; }
  /* "שמור שינויים" גלוי תמיד, כמו בדסקטופ (שם הכותרת אינה נגללת): צף מעל הניווט התחתון. */
  html.m-page-scroll .org-topbar > button[form="orgEditForm"] {
    position: fixed; inset-inline-end: 14px; bottom: calc(var(--mnav-h) + 14px); z-index: 1029;
    min-height: 48px; padding: 0 20px; border-radius: 999px; box-shadow: 0 6px 18px rgba(16, 35, 63, 0.28);
  }
  html.m-page-scroll .org-grid { gap: 10px; }
  html.m-page-scroll .org-col { overflow: visible; gap: 10px; }
  html.m-page-scroll .org-col .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  html.m-page-scroll .main-content:has(.org-grid) .form-control, html.m-page-scroll .main-content:has(.org-grid) .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  html.m-page-scroll .main-content:has(.org-grid) textarea.form-control { min-height: 88px; }
  html.m-page-scroll .main-content:has(.org-grid) .btn { min-height: 44px; }
  html.m-page-scroll .main-content:has(.org-grid) .btn-link { display: inline-flex; align-items: center; }
  html.m-page-scroll .main-content:has(.org-grid) .card-title-row { flex-wrap: wrap; }
  html.m-page-scroll .main-content:has(.org-grid) .form-check:has(> .form-check-input) { display: flex; align-items: center; gap: 8px; min-height: 44px; }
  html.m-page-scroll .main-content:has(.org-grid) .form-check > .form-check-input { margin-top: 0; flex: 0 0 auto; }
  html.m-page-scroll .main-content:has(.org-grid) :is(code, .text-break, [dir="ltr"]) { overflow-wrap: anywhere; }
  /* חברי ארגון, והרשאות מנהל מערכת (ארגון המערכת) - כרטיסים */
  html.m-page-scroll .main-content:has(.org-grid) :is(.members-table, #sysadminPrivSection table),
  html.m-page-scroll .main-content:has(.org-grid) :is(.members-table, #sysadminPrivSection table) > tbody { display: block; }
  html.m-page-scroll .main-content:has(.org-grid) :is(.members-table, #sysadminPrivSection table) > thead { display: none; }
  html.m-page-scroll .main-content:has(.org-grid) :is(.members-table, #sysadminPrivSection table) > tbody > tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 2px; border-top: 1px solid var(--border-color); }
  html.m-page-scroll .main-content:has(.org-grid) :is(.members-table, #sysadminPrivSection table) > tbody > tr > td { display: block; padding: 0; border: 0; background: none; box-shadow: none; overflow-wrap: anywhere; white-space: normal !important; } /* מול text-nowrap */
  html.m-page-scroll .main-content:has(.org-grid) :is(.members-table, #sysadminPrivSection table) > tbody > tr > td::before { color: var(--color-text-secondary); font-weight: 400; }
  html.m-page-scroll .main-content:has(.org-grid) :is(.members-table, #sysadminPrivSection table) > tbody > tr > td[colspan] { flex: 1 1 100%; text-align: center; }
  html.m-page-scroll .main-content:has(.org-grid) .members-table > tbody > tr > td:nth-child(1) { flex: 1 1 100%; font-size: var(--text-body); }
  html.m-page-scroll .main-content:has(.org-grid) .members-table > tbody > tr > td:nth-child(2) { flex: 1 1 100%; }
  html.m-page-scroll .main-content:has(.org-grid) .members-table > tbody > tr > td:nth-child(2)::before { content: "שם משתמש: "; }
  html.m-page-scroll .main-content:has(.org-grid) .members-table > tbody > tr > td:nth-child(6),
  html.m-page-scroll .main-content:has(.org-grid) #sysadminPrivSection table > tbody > tr > td:nth-child(3) { flex: 1 1 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; text-align: start !important; } /* מול text-start */
  html.m-page-scroll .main-content:has(.org-grid) .members-table > tbody > tr > td:nth-child(6) form { display: inline-flex !important; } /* מול d-inline */
  html.m-page-scroll .main-content:has(.org-grid) #sysadminPrivSection table > tbody > tr > td:nth-child(3) form { margin: 0 !important; } /* מול ms-1 */
  html.m-page-scroll .main-content:has(.org-grid) #sysadminPrivSection table > tbody > tr > td:nth-child(1) { flex: 1 1 100%; }
  html.m-page-scroll .main-content:has(.org-grid) #sysadminPrivSection table > tbody > tr > td:nth-child(1) code { display: block; margin: 2px 0 0 !important; }
  /* חלונות פרטי הארגון ו"ארגון חדש": עמודה אחת, שדות 44px, פעולות 44px */
  :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal) .form-control,
  :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal) .form-select { min-height: 44px; font-size: max(16px, 1rem); }
  :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal) .modal-body .row > [class*="col"] { flex: 0 0 100%; max-width: 100%; }
  :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal) :is(.modal-footer .btn, .add-tab-btn) { min-height: 44px; min-width: 96px; }
  :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal) .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center; }
  #addUserModal .add-user-tabs { flex-wrap: wrap; }
  #addUserModal :is(#formNew, #formExisting) .btn { min-height: 44px; min-width: 96px; }   /* פעולות הטפסים שבתוך הלשוניות */
  #addUserModal .add-tab-btn { flex: 1 1 auto; }
  #addUserModal .form-check:has(> .form-check-input) { display: flex; align-items: center; gap: 8px; min-height: 44px; }
  #addUserModal .form-check > .form-check-input { margin-top: 0; flex: 0 0 auto; }

  /* ── יומן מערכת ── */
  html.m-page-scroll .main-content:has(.al-filters) .dash-hero { padding: 10px 14px; }
  html.m-page-scroll .main-content:has(.al-filters) .al-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; }
  html.m-page-scroll .main-content:has(.al-filters) .al-field:has(#f-q),
  html.m-page-scroll .main-content:has(.al-filters) .al-actions { grid-column: 1 / -1; }
  html.m-page-scroll .main-content:has(.al-filters) .al-field :is(select, input) { min-height: 44px; font-size: max(16px, 1rem); }
  html.m-page-scroll .main-content:has(.al-filters) .al-actions { flex-direction: row; }
  html.m-page-scroll .main-content:has(.al-filters) .al-actions :is(.btn-apply, .btn-clear) { min-height: 44px; }
  html.m-page-scroll .main-content:has(.al-filters) .table-scroll { overflow: visible; }
  html.m-page-scroll .main-content:has(.al-filters) .mini, html.m-page-scroll .main-content:has(.al-filters) .mini > tbody { display: block; }
  html.m-page-scroll .main-content:has(.al-filters) .mini > thead { display: none; }
  /* אירוע: פעולה · זמן · משתמש · ארגון · יעד · פירוט · IP · "פירוט" */
  html.m-page-scroll .main-content:has(.al-filters) .mini > tbody > tr:not(.collapse) { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 12px; padding: 10px 2px; border-bottom: 1px solid var(--border-color); }
  html.m-page-scroll .main-content:has(.al-filters) .mini > tbody > tr:not(.collapse) > td { display: block; padding: 0; border: 0; overflow-wrap: anywhere; color: var(--color-text-secondary); }
  html.m-page-scroll .main-content:has(.al-filters) .mini > tbody > tr > td::before { color: var(--color-text-secondary); font-weight: 400; }
  html.m-page-scroll .main-content:has(.al-filters) .mini > tbody > tr > td.mini-empty { flex: 1 1 100%; text-align: center; }
  html.m-page-scroll .main-content:has(.al-filters) .mini td.c-main { order: -2; flex: 1 1 auto; color: var(--text-heading); }
  html.m-page-scroll .main-content:has(.al-filters) .mini td.c-when { order: -1; font-size: var(--text-small); }
  html.m-page-scroll .main-content:has(.al-filters) .mini td:nth-child(3) { flex: 1 1 100%; }
  html.m-page-scroll .main-content:has(.al-filters) .mini td:nth-child(3)::before { content: "משתמש: "; }
  html.m-page-scroll .main-content:has(.al-filters) .mini td:nth-child(4) { flex: 1 1 100%; }
  html.m-page-scroll .main-content:has(.al-filters) .mini td:nth-child(4)::before { content: "ארגון: "; }
  html.m-page-scroll .main-content:has(.al-filters) .mini td:nth-child(4) a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
  html.m-page-scroll .main-content:has(.al-filters) .mini td:nth-child(5)::before { content: "יעד: "; }
  html.m-page-scroll .main-content:has(.al-filters) .mini td.c-sum { flex: 1 1 100%; max-width: none; white-space: normal; overflow: visible; text-overflow: clip; }
  html.m-page-scroll .main-content:has(.al-filters) .mini td.c-ip { flex: 1 1 auto; }
  html.m-page-scroll .main-content:has(.al-filters) .mini td:nth-child(8):not(:empty) { margin-inline-start: auto; }
  html.m-page-scroll .main-content:has(.al-filters) .det-toggle { min-height: 44px; min-width: 64px; padding: 0 12px; }
  html.m-page-scroll .main-content:has(.al-filters) .mini > tbody > tr.collapse.show,
  html.m-page-scroll .main-content:has(.al-filters) .mini > tbody > tr.collapsing { display: block; }
  html.m-page-scroll .main-content:has(.al-filters) .mini > tbody > tr.collapse > td { display: block; }
  html.m-page-scroll .main-content:has(.al-filters) .det-grid { grid-template-columns: minmax(0, 1fr); }
  html.m-page-scroll .main-content:has(.al-filters) .det-v { overflow-wrap: anywhere; }
  html.m-page-scroll .main-content:has(.al-filters) .panel-foot .pager { margin-inline-start: 0; flex: 1 1 100%; justify-content: space-between; }
  html.m-page-scroll .main-content:has(.al-filters) .pager :is(a, span.disabled) { min-height: 44px; }

  /* ── ניגודיות (טלפון בלבד; הדסקטופ ללא שינוי - התכנית, סעיף 15): טקסט-המשנה (#7a8899, 3.43-3.61:1) בצבע-המשני,
     צבעי Bootstrap על תגיות ורקעים בהירים (3.4-3.9:1, הצהוב 1.63:1) בגוון כהה יותר; בערכה הכהה - צבעי הערכה,
     וכרטיסים / כותרות שצבעם קבוע (#fff, #1a2e4a) עוברים לצבעי הערכה. */
  html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal) { --text-muted: var(--color-text-secondary); }
  :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-success { color: #146c43 !important; }
  :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-danger { color: #b02a37 !important; }
  :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-warning { color: #8a6100 !important; }
  :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-primary { color: #0a58ca !important; }
  :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-secondary { color: #495057 !important; }
  :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .badge.bg-warning { color: #212529 !important; }
  :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .sub-canceled { color: #495057; }
  html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)) .att-row .att-body { color: var(--text-primary); }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-success { color: var(--color-success) !important; }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-danger { color: var(--color-danger) !important; }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-warning { color: var(--color-warning) !important; }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-primary { color: var(--focus-ring-color) !important; }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .text-secondary { color: var(--color-text-secondary) !important; }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) :is(.btn-primary, .btn-apply) { background-color: #2f5f9e; border-color: #2f5f9e; color: #fff; }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .btn-danger { background-color: #b02a37; border-color: #b02a37; color: #fff; }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .btn-outline-primary { color: var(--color-primary-hover); border-color: var(--color-primary-hover); }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) :is(.btn-outline-danger, .btn-link.text-danger) { color: var(--color-danger) !important; border-color: var(--color-danger); }
  html.theme-dark :is(html.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)), :is(#createOrgModal, #editMemberModal, #addUserModal, #cloudPurgeModal)) .btn-outline-success { color: var(--color-success); border-color: var(--color-success); }
  html.theme-dark.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)) .pill-ok { background: rgba(111, 207, 142, 0.16); }
  html.theme-dark.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)) .stat-card { background: var(--surface-card); border-color: var(--border-color); }
  html.theme-dark.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)) .stat-card--accent { background: var(--surface-card-alt); }
  html.theme-dark.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)) .stat-card .stat-num { color: var(--text-heading); }
  html.theme-dark.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)) .stat-card--accent .stat-num { color: var(--focus-ring-color); }
  html.theme-dark.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)) :is(.page-header h4, .org-topbar h4, .section-title, .subsection-title, .storage-figure) { color: var(--text-heading); }
  html.theme-dark.m-page-scroll .main-content:is(:has(#orgsTable), :has(#tab-maint), :has(.org-grid), .so-wrap:has(.kpi-grid), :has(.al-filters)) code { color: var(--color-text-secondary); }
  html.theme-dark #addUserModal .add-tab-btn { color: var(--color-text-secondary); border-color: var(--border-color); }
  html.theme-dark #addUserModal .add-tab-btn.active { color: var(--text-heading); border-color: var(--text-heading); }

  /* ── עורך עמוד-הנחיתה ── */
  html.m-page-scroll .lnd { gap: 12px; }
  html.m-page-scroll .lnd-bar { padding: 14px; gap: 10px; }
  html.m-page-scroll .lnd-actions { margin-inline-start: 0; flex: 1 1 100%; }
  html.m-page-scroll .lnd :is(.lnd-btn, .lnd-tab, .lnd-seg-btn), html.m-page-scroll .lnd-modal .lnd-btn { min-height: 44px; }
  html.m-page-scroll .lnd-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px 10px 0; }
  html.m-page-scroll .lnd-tabs::-webkit-scrollbar { display: none; }
  html.m-page-scroll .lnd-tab { flex: 0 0 auto; white-space: nowrap; }
  html.m-page-scroll .lnd-panels { max-block-size: none; overflow: visible; padding: 14px; }       /* גולל יחיד: המסמך */
  /* רשימות חוזרות: השדה ברוחב מלא, כפתורי הסדר / ההסרה מתחתיו (44px) */
  html.m-page-scroll .lnd-repeat-row { grid-template-columns: minmax(0, 1fr); }
  html.m-page-scroll .lnd-row-tools { flex-wrap: wrap; justify-content: flex-end; }
  html.m-page-scroll .lnd .lnd-icon-btn { min-height: 44px; min-width: 44px; }
  html.m-page-scroll .lnd-media-row { grid-template-columns: 64px minmax(0, 1fr); }
  html.m-page-scroll .lnd-media-row > :last-child { grid-column: 1 / -1; justify-self: end; }
  html.m-page-scroll .lnd-subcard { padding: 12px; }
  html.m-page-scroll .lnd :is(.lnd-media, .lnd-subcard, .lnd-field) { grid-template-columns: minmax(0, 1fr); }
  html.m-page-scroll .lnd input[type="file"] { max-width: 100%; min-width: 0; }      /* רוחב-הבסיס של שדה-קובץ דחף את כרטיסי "תמונות" מחוץ למסך */
  html.m-page-scroll .lnd :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { min-height: 44px; font-size: max(16px, 1rem); }
  html.m-page-scroll .lnd-preview-bar { padding: 10px 12px; }
  html.m-page-scroll .lnd-frame-wrap { padding: 8px; }
  html.m-page-scroll .lnd-versions { padding: 14px; }
  html.m-page-scroll .lnd-live { padding: 14px; }
  /* `--lnd-ink-2` מפנה ל-`--text-secondary`, שהוא אסימון של **גודל** - הצבע אינו תקף ונופל לצבע הראשי. בטלפון: הצבע המשני. */
  html.m-page-scroll :is(.lnd, .lnd-modal) { --lnd-ink-2: var(--color-text-secondary); }
  /* ערכה כהה (טלפון): העורך שומר רקעים בהירים קבועים בעוד צבע הטקסט עובר לבהיר (עד 1.15:1) - הרקעים עוברים לצבעי הערכה. */
  html.theme-dark.m-page-scroll :is(.lnd, .lnd-modal) :is(.lnd-btn, .lnd-icon-btn) { background: var(--surface-card); color: var(--text-primary); border-color: var(--border-color); }
  html.theme-dark.m-page-scroll :is(.lnd, .lnd-modal) .lnd-btn-primary { background: #2f5f9e; border-color: #2f5f9e; color: #fff; }
  html.theme-dark.m-page-scroll :is(.lnd, .lnd-modal) .lnd-btn-danger { background: #a3271f; border-color: #a3271f; color: #fff; }
  html.theme-dark.m-page-scroll :is(.lnd, .lnd-modal) .lnd-btn-warn { background: #fbf3e4; border-color: #d9b46a; color: #5b3d11; }
  html.theme-dark.m-page-scroll .lnd-modal-card { background: var(--surface-card); }
  html.theme-dark.m-page-scroll .lnd :is(.lnd-chip:not(.lnd-chip-dirty), .lnd-tab.is-on, .lnd-seg, .lnd-plan-id code) { background: var(--surface-card-alt); color: var(--text-primary); }
  html.theme-dark.m-page-scroll .lnd .lnd-seg-btn.is-on { background: var(--surface-card); color: var(--text-heading); }
  html.theme-dark.m-page-scroll .lnd :is(.lnd-frame-wrap, .lnd-subcard) { background: var(--surface-card-alt); }
  html.theme-dark.m-page-scroll .lnd .lnd-input { background: var(--surface-card); color: var(--text-primary); border-color: var(--border-color); }
  html.theme-dark.m-page-scroll .lnd .lnd-live-now { color: var(--color-text-secondary); }
  html.theme-dark.m-page-scroll .lnd .lnd-subcard-n { color: var(--focus-ring-color); }
  html.m-page-scroll .lnd .lnd-plan-id code { color: var(--text-primary); }      /* ורוד Bootstrap על #EDF3FA: 4.03:1 */
  html.theme-dark.m-page-scroll .lnd .lnd-check.is-ok, html.theme-dark.m-page-scroll .lnd-modal .lnd-check.is-ok { color: var(--color-success); }
  html.theme-dark.m-page-scroll .lnd .lnd-check.is-missing, html.theme-dark.m-page-scroll .lnd-modal .lnd-check.is-missing { color: var(--color-danger); }
  /* החלונות מעל הניווט התחתון (z 1030), וגוללים בתוכם כשהם ארוכים מהמסך */
  html.m-page-scroll .lnd-modal { z-index: 1055; padding: 12px; }
  html.m-page-scroll .lnd-modal-card { padding: 18px 16px; max-block-size: calc(100dvh - 24px); overflow-y: auto; }
  html.m-page-scroll .lnd-modal-actions { flex-wrap: wrap; }
  html.m-page-scroll .lnd-modal input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; font-size: max(16px, 1rem); }

  /* ══ גל 4, יחידה D — ניהול סדרי דין (sysadmin_procedures.html: סכמות וגרסאות · שלבים · פעולות · הגדרת פעולה;
     לוחות מועדים) ══════════════════════════════════════════════════════════════════════════════════════
     מתחת ל-992px המסך כבר אקורדיון אנכי (פאנל פתוח אחד) בגלילת-עמוד. כאן רק הטלפון: המסמך הוא הגולל היחיד,
     שורות השלבים / הפעולות - השם בשורה מלאה והכלים (עריכה, הזזה למעלה / למטה - אותן פקודות מיידיות של הדסקטופ,
     תפריט) מתחתיו ב-44px, שדות 44px / 16px, ושורת השמירה של הגדרת-הפעולה דביקה מעל הניווט התחתון.
     אין גרירה במסך הזה - הסדר משתנה רק בלחיצים. */
  html.m-page-scroll .pa.main-content { padding: 10px; }
  html.m-page-scroll .pa .pa-hero { gap: 10px; }
  html.m-page-scroll .pa .pa-tab { min-height: 44px; }
  html.m-page-scroll .pa .pa-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  html.m-page-scroll .pa :is(.pa-btn, .pa-ws-head, .pa-issue-btn) { min-height: 44px; }
  html.m-page-scroll .pa .pa-icon-btn { width: 44px; height: 44px; }
  html.m-page-scroll .pa :is(.pa-prereq-row, .pa-out-row) > .pa-btn { min-width: 44px; justify-content: center; }   /* הסרת תנאי / אפשרות */
  html.m-page-scroll .pa :is(.form-control, .form-select), html.m-page-scroll .pa-modal :is(.form-control, .form-select) { min-height: 44px; font-size: max(16px, 1rem); }
  html.m-page-scroll .pa textarea.form-control { min-height: 88px; }
  html.m-page-scroll :is(.pa, .pa-modal) .pa-check { min-height: 44px; }
  html.m-page-scroll .pa .pa-choice-row { flex-wrap: wrap; }
  /* שורת שלב / פעולה: השם והתגיות ברוחב מלא, הכלים בשורה מתחת */
  html.m-page-scroll .pa .pa-row { flex-wrap: wrap; align-items: center; }
  html.m-page-scroll .pa .pa-row-main { flex: 1 1 100%; min-height: 44px; }
  html.m-page-scroll .pa .pa-row-tools { margin-inline-start: auto; gap: 4px; padding: 0 4px 4px; }
  html.m-page-scroll .pa .pa-row-edit { margin: 0 4px 4px; }
  html.m-page-scroll .pa .pa-action-rows .pa-row-name { flex-basis: 100%; }
  html.m-page-scroll .pa .pa-row-meta .pa-chip { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }   /* "תת-פעולה: <שם האב>" */
  html.m-page-scroll .pa .pa-editor .pa-field-row > .pa-field { flex: 1 1 100%; max-width: none; }
  html.m-page-scroll .pa :is(.pa-field-row, .pa-builder, .pa-d-order) { flex-wrap: wrap; }
  /* שמירת הגדרת-הפעולה: דביקה מעל הניווט התחתון כל עוד הטופס על המסך */
  html.m-page-scroll:has(.pa.main-content) { scroll-padding-block: 60px calc(var(--mnav-h) + 132px); }   /* מיקוד / גלילה-לשדה לא נעצרים מתחת לשורת השמירה */
  html.m-page-scroll .pa #pa-form > .pa-save-row {
    position: sticky; bottom: var(--mnav-h); z-index: 6; flex-wrap: wrap; gap: 6px;
    margin-inline: -6px; padding: 8px 6px; background: var(--surface-card); border-top: 1px solid var(--border-color);
  }
  /* שלושת הלחיצים בשורה אחת (שמירה · ביטול · מחיקה) - שורה של 44px במקום שתיים */
  html.m-page-scroll .pa #pa-form > .pa-save-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html.m-page-scroll .pa #pa-form > .pa-save-row > .pa-btn { justify-content: center; padding: 4px 6px; white-space: normal; line-height: 1.15; text-align: center; }
  html.m-page-scroll .pa #pa-form > .pa-save-row > .pa-dirty { grid-column: 1 / -1; margin: 0; }
  html.m-page-scroll .pa #pa-form > .pa-save-row > .pa-dirty:empty { display: none; }
  html.m-page-scroll .pa summary { min-height: 44px; display: flex; align-items: center; }
  /* תפריט שורת-השלב (גיליון תחתון מתחת ל-576px): מעל הניווט התחתון, פריטים 44px */
  html.m-page-scroll .pa .pa-menu [role="menuitem"] { min-height: 44px; }
  html.m-page-scroll .pa .pa-menu { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  @media (max-width: 575.98px) { html.m-page-scroll .pa .pa-menu { top: auto !important; left: 0 !important; right: 0 !important; } }   /* מול style: המיקום של הדסקטופ מתח את הגיליון */
  /* לוחות מועדים: שנים, חודשים ועורך המועד */
  html.m-page-scroll .pa .pc-months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html.m-page-scroll .pa .pc-year-list li { flex-basis: 100%; }
  html.m-page-scroll .pa .pc-date-btn { min-height: 44px; }
  html.m-page-scroll .pc-datepop .pc-datepop-nav { width: 44px; height: 44px; }
  html.m-page-scroll .pc-datepop .pc-datepop-grid td { padding: 0; }
  html.m-page-scroll .pc-datepop .pc-dp-day { min-height: 44px; }      /* ימי החודש: 44px (שבעה טורים ברוחב 314px) */
  @media (max-width: 575.98px) { html.m-page-scroll .pc-datepop { bottom: calc(var(--mnav-h) + 8px); } }   /* כאן הוא גיליון תחתון */
  /* ניגודיות (טלפון בלבד; הדסקטופ ללא שינוי): טקסט-המשנה (#7a8899, 3.43-3.61:1) בצבע-המשני; עזרה על כרטיס / יום נבחר
     (#dbeafe, 4.29:1); תוויות החלונות (4.49 / 3.43:1); בערכה הכהה - כותרות הפאנלים, החודש העברי ולחיץ-השמירה (#4d7fc4). */
  html.m-page-scroll :is(.pa, .pa-modal, .pc-datepop) { --text-muted: var(--color-text-secondary); }
  html.m-page-scroll .pa .pa-card:has(input:checked) .pa-card-help, html.m-page-scroll .pc-datepop .pc-dp-day.is-selected .pc-dp-heb { color: var(--text-primary); }
  html.m-page-scroll .pa-modal .form-label-sm { color: var(--color-text-secondary); }
  html.theme-dark.m-page-scroll .pa .pa-ws-name, html.theme-dark.m-page-scroll .pc-datepop .pc-dp-hmonth { color: var(--focus-ring-color); }
  html.theme-dark.m-page-scroll .pa-modal .app-btn-primary { background-color: #2f5f9e; border-color: #2f5f9e; color: #fff; }
  /* חלונות הסכמה / השלב / הפעולה וכו' */
  html.m-page-scroll .pa-modal :is(.app-modal-footer .btn, .modal-footer .btn) { min-height: 44px; }
  html.m-page-scroll .pa-modal .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; margin: 0; background-position: center; }
}

@media print {
  .mnav, .mnav-backdrop, .mnav-sheet-head, .m-sheet-head, .cv-m-only, .m-only { display: none !important; }
}

/* מסך-ההסבר של עורך ה-PDF / איחוד המסמכים (גל 4, יחידה A) - מוצג רק בטלפון (למעלה). */
.m-tool-explain { display: none; }
