/**
 * MainOffice CRM — הגדלת גופנים במובייל + כפתור צף
 * חל רק כש-html.crm-mobile-font-scaling (מופעל ע"י mobile-font-scale.js במובייל בלבד).
 * שולחן: ללא השפעה.
 */
:root {
    --crm-mobile-font-scale: 1.12;
}

@media (min-width: 768px) and (pointer: fine) {
    .crm-mobile-font-fab-group {
        display: none !important;
    }
}

@media ((max-width: 1439px) and (pointer: coarse)), (max-width: 767px) {
    html.crm-mobile-font-scaling {
        font-size: calc(16px * var(--crm-mobile-font-scale, 1.12));
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    /* Tailwind arbitrary px — לא נמשכים מ-rem */
    html.crm-mobile-font-scaling .text-\[8px\] { font-size: calc(8px * var(--crm-mobile-font-scale, 1.12)) !important; }
    html.crm-mobile-font-scaling .text-\[9px\] { font-size: calc(9px * var(--crm-mobile-font-scale, 1.12)) !important; }
    html.crm-mobile-font-scaling .text-\[9\.5px\] { font-size: calc(9.5px * var(--crm-mobile-font-scale, 1.12)) !important; }
    html.crm-mobile-font-scaling .text-\[10px\] { font-size: calc(10px * var(--crm-mobile-font-scale, 1.12)) !important; }
    html.crm-mobile-font-scaling .text-\[11px\] { font-size: calc(11px * var(--crm-mobile-font-scale, 1.12)) !important; }
    html.crm-mobile-font-scaling .text-\[12px\] { font-size: calc(12px * var(--crm-mobile-font-scale, 1.12)) !important; }

    /* ── כפתורי צף הגדלה/הקטנת גופן — שכבה עליונה, מחוץ ל-overflow של האפליקציה ── */
    .crm-mobile-font-fab-group {
        position: fixed;
        left: max(12px, env(safe-area-inset-left, 0px));
        bottom: calc(var(--crm-mobile-nav-height, 56px) + env(safe-area-inset-bottom, 0px) + 14px);
        z-index: 2147483600;
        display: flex;
        flex-direction: column;
        gap: 8px;
        pointer-events: none;
        isolation: isolate;
    }

    .crm-mobile-font-fab-group[hidden] {
        display: none !important;
    }

    .crm-mobile-font-fab {
        pointer-events: auto;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.95);
        background: linear-gradient(145deg, #800020 0%, #a8243f 100%);
        color: #fff;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        cursor: pointer;
        font-family: 'Assistant', sans-serif;
        line-height: 1;
        transition: transform 0.15s ease, opacity 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .crm-mobile-font-fab:active:not(:disabled) {
        transform: scale(0.94);
    }

    .crm-mobile-font-fab:disabled {
        opacity: 0.38;
        cursor: not-allowed;
        box-shadow: none;
    }

    .crm-mobile-font-fab__icon {
        font-size: 1.15rem;
        font-weight: 900;
        line-height: 1;
    }

    /* דפים ללא תפריט תחתון */
    body.crm-mobile-layout:not(:has(.crm-mobile-bottom-nav)) .crm-mobile-font-fab-group {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }

    /* גיליונות מובייל — גלילה אנכית כשהגופן מוגדל */
    .crm-mobile-lead-sheet__panel,
    .crm-mobile-property-sheet__panel {
        display: flex;
        flex-direction: column;
        max-height: min(92vh, 92dvh);
        overflow: hidden;
    }

    .crm-mobile-sheet-panel__scroll {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .crm-mobile-lead-sheet__panel .crm-mobile-sheet-panel__header,
    .crm-mobile-property-sheet__panel .crm-mobile-sheet-panel__header {
        flex-shrink: 0;
    }

    /* הגדרות — טבלאות וטקסט קטן במובייל */
    html.crm-mobile-font-scaling .agents-compact-table {
        font-size: 0.78rem;
    }

    html.crm-mobile-font-scaling .agents-compact-table th {
        font-size: 0.68rem !important;
    }

    html.crm-mobile-font-scaling .agents-compact-table th.th-check,
    html.crm-mobile-font-scaling .agents-compact-table th.th-last-login {
        font-size: 0.64rem !important;
    }

    html.crm-mobile-font-scaling .agents-compact-table .agent-sub,
    html.crm-mobile-font-scaling .agents-compact-table .agent-madlan-id,
    html.crm-mobile-font-scaling .agents-compact-table .agent-last-login,
    html.crm-mobile-font-scaling .agents-compact-table .sp-badge {
        font-size: 0.72rem;
    }

    html.crm-mobile-font-scaling .sp-sub-tab-btn {
        font-size: 0.82rem !important;
    }

    html.crm-mobile-font-scaling .sp-section-subtitle {
        font-size: 0.82rem !important;
    }

    html.crm-mobile-font-scaling .push-matrix-table {
        font-size: 0.8rem;
    }

    html.crm-mobile-font-scaling #main-content input,
    html.crm-mobile-font-scaling #main-content select,
    html.crm-mobile-font-scaling #main-content textarea,
    html.crm-mobile-font-scaling #main-content button {
        font-size: max(0.9rem, 1em);
    }
}
