/**
 * Left Preview Panel System
 * פאנל תצוגה מקדימה בצד שמאל - מראה של הפאנל הימני
 *
 * שימושים:
 * 1. מצב "כתוב מחדש" - הצגת טקסט חדש לגמרי
 * 2. מצב השוואה - הצגת כל ההצעות מאוחדות (Google Translate style)
 */

/* ===================================
   CSS Variables
   =================================== */
:root {
    --left-panel-width: 320px;
    --left-panel-min-width: 250px;
    --left-panel-max-width: 600px;
}

/* ===================================
   Main Panel Container
   =================================== */
.left-preview-panel {
    position: fixed;
    top: 70px;
    /* מיקום דינמי - מחוץ למסך בהתחלה */
    left: calc(-1 * var(--left-panel-width, 320px) - 10px);
    width: var(--left-panel-width, 320px);
    height: calc(100vh - 112px);
    background: var(--bg-panel, #ffffff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* visibility מתעדכן אחרי האנימציה בסגירה */
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
    z-index: 998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* מונע הצגה בטעינה ראשונית */
    visibility: hidden;
}

.left-preview-panel.open {
    left: 8px; /* מרחק מקצה המסך - כמו הפאנל הימני */
    visibility: visible;
    /* visibility מתעדכן מיד בפתיחה */
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

/* ===================================
   Resize Handle - בצד ימין של הפאנל השמאלי
   =================================== */
.left-panel-resize-handle {
    position: absolute;
    top: 0;
    right: 0; /* בצד ימין! */
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
    z-index: 1001;
    transition: background-color 0.2s ease;
}

.left-panel-resize-handle:hover {
    background: linear-gradient(270deg, rgba(30, 58, 95, 0.3), transparent);
}

.left-panel-resize-handle.dragging {
    background: linear-gradient(270deg, rgba(30, 58, 95, 0.5), transparent);
}

.left-panel-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1px;
    transform: translateY(-50%);
    width: 3px;
    height: 40px;
    background: var(--border-medium, #cbd5e1);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.left-panel-resize-handle:hover::after {
    opacity: 1;
    background: var(--accent-primary, #1e3a5f);
}

/* ===================================
   Panel Header
   =================================== */
.left-panel-header {
    background: var(--bg-primary, #f8fafc);
    border-bottom: 1px solid var(--border-light, #e5e7eb);
    border-radius: 12px 12px 0 0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    flex-shrink: 0;
}

/* 🆕 מצב Track Changes ("עיבוד בסיסי") - הסתרת כפתורי ה-header של LeftPanelSystem.
   לתוצאות ה-Track Changes יש כפתורים משלהן (החל/דחה/קבל הכל) בתוך אזור התוכן. */
.left-preview-panel.track-changes-mode .left-panel-bulk-actions,
.left-preview-panel.track-changes-mode .left-panel-suggestion-actions {
    display: none !important;
}

/* ===================================
   🆕 פאנל-חכם שמאלי: שורת-טאבים (עוזר/סריקה/ניתוח/תוצאות) + גוף
   גוון "חכם" טורקיז — מובחן מכלי-העריכה הנייביים שבפאנל הימני (🧩 שפת-עיצוב עקבית)
   =================================== */
.left-panel-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0 8px;
    flex-shrink: 0;
    background: var(--bg-primary, #f8fafc);
    border-bottom: 1px solid var(--border-light, #e5e7eb);
    border-radius: 12px 12px 0 0;
    position: relative; /* לעוגן קו-האינדיקטור המחליק */
}
.left-panel-tabs .lp-tab {
    flex: 1 1 0; /* 🆕 טאבים שווים בגודלם */
    height: 40px; /* 🆕 גובה קבוע */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary, #64748b);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    position: relative;
}
.left-panel-tabs .lp-tab .lp-tab-logo { width: 16px; height: 16px; object-fit: contain; }
.left-panel-tabs .lp-tab i { font-size: 12.5px; }
.left-panel-tabs .lp-tab:hover { background: #eef2f7; color: var(--text-primary, #1e293b); }
/* 🆕 טאב פעיל — צבע בלבד; ההדגשה היא קו-תחתון מחליק (lp-tab-indicator) */
.left-panel-tabs .lp-tab.active { color: #0c6e63; font-weight: 700; }
/* 🆕 קו-תחתון צבעוני שמחליק לטאב הפעיל */
.left-panel-tabs .lp-tab-indicator {
    position: absolute;
    bottom: -1px; /* על קו-הגבול התחתון */
    height: 3px;
    background: #0d9488;
    border-radius: 3px 3px 0 0;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s;
    pointer-events: none;
    opacity: 0;
}
/* טאבים על-פי-דרישה (סריקה/ניתוח) — מוסתרים עד שמפעילים אותם */
.left-panel-tabs .lp-tab.lp-ondemand { display: none; }
.left-panel-tabs .lp-tab.lp-ondemand.lp-visible { display: inline-flex; }
.left-panel-tabs .lp-tab .lp-tab-spinner { margin-inline-start: 5px; font-size: 11px; color: #0c6e63; }
/* 🆕 כפתור סגירה קטן בתוך טאב (ניתוח) — מופיע בריחוף */
.left-panel-tabs .lp-tab .lp-tab-close {
    display: none;
    align-items: center; justify-content: center;
    width: 15px; height: 15px;
    border-radius: 50%;
    color: var(--text-secondary, #94a3b8);
    margin-inline-start: 2px;
}
.left-panel-tabs .lp-tab:hover .lp-tab-close { display: inline-flex; }
.left-panel-tabs .lp-tab .lp-tab-close:hover { background: #fee2e2; color: #dc2626; }
.left-panel-tabs .lp-tab .lp-tab-close i { font-size: 9px; }
.left-panel-tabs .lp-tab .scanner-tab-badge {
    min-width: 17px; height: 17px; padding: 0 4px;
    font-size: 10.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    background: #dc2626; color: #fff; border-radius: 9px;
}
.left-panel-tabs .left-panel-close-btn {
    flex: 0 0 auto; margin-inline-start: 2px;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--text-secondary, #64748b);
    border-radius: 7px; cursor: pointer; font-size: 13px;
}
.left-panel-tabs .left-panel-close-btn:hover { background: #fee2e2; color: #dc2626; }

/* טאב-אייקון (היסטוריית תיקוני-AI) — אייקון קטן בלבד */
.left-panel-tabs .lp-tab.lp-tab-icononly { flex: 0 0 auto; padding: 0 11px; }
.left-panel-tabs .lp-tab.lp-tab-icononly.active { color: #0c6e63; }

/* ===================================
   🆕 חץ קיפול/פתיחה של הפאנל השמאלי — על גבול הפאנל, גלוי תמיד
   =================================== */
.left-panel-collapse-btn {
    position: fixed;
    top: 84px;
    left: 0;
    z-index: 999;
    width: 20px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel, #ffffff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-inline-start: none;
    border-radius: 0 9px 9px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.15s ease, color 0.15s ease;
}
.left-panel-collapse-btn:hover { background: #eef2f7; color: #0c6e63; }
.left-panel-collapse-btn i { font-size: 11px; transition: transform 0.3s ease; }
/* פאנל פתוח — החץ צמוד לגבול הימני של הפאנל, מצביע שמאלה (=סגור) */
body.left-panel-open .left-panel-collapse-btn {
    left: calc(8px + var(--left-panel-width, 320px) - 1px);
}
/* פאנל סגור — החץ בקצה המסך, מסתובב להצביע ימינה (=פתח) */
body:not(.left-panel-open) .left-panel-collapse-btn i { transform: rotate(180deg); }

/* ===================================
   🆕 מצב-ריק בטאב "הצעות" — אין עדיין הצעות
   =================================== */
.lp-empty-suggestions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 44px 24px;
    text-align: center;
    color: var(--text-secondary, #64748b);
}
.lp-empty-suggestions i { font-size: 26px; color: #cbd5e1; }
.lp-empty-suggestions .lp-empty-title { font-size: 14px; font-weight: 700; color: var(--text-primary, #334155); }
.lp-empty-suggestions .lp-empty-text { font-size: 12.5px; line-height: 1.6; max-width: 260px; }

/* 🆕 כפתור "סיים וסגור" בתצוגת "הטקסט המקורי" (אחרי החלף) — סוגר את טאב ההצעות */
.tc-original-close-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 10px 14px 14px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: #0d9488;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.tc-original-close-btn:hover { background: #0c6e63; }
.tc-original-close-btn i { font-size: 12px; }
/* פאנל היסטוריית-AI בצד-שמאל */
.left-history-content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.left-history-content .ai-history-filters { flex: 0 0 auto; display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border-light, #e5e7eb); }
.left-history-content #aiHistoryContent { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 14px; }

/* גוף הפאנל — תוכן-חכם (עוזר/סריקה/ניתוח) + תוצאות (LeftPanelSystem) */
.left-panel-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.left-panel-body > #leftSmartContent { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.left-panel-body > #leftPanelContent { flex: 1 1 auto; min-height: 0; }
#leftSmartContent .scanner-panel-container { padding: 12px 14px; }
/* כניסה ל"ניתוח מפורט" בטאב עוזר */
.scanner-planning-actions { display: flex; justify-content: flex-end; margin: 4px 0 2px; }
.scanner-analysis-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; font-size: 12.5px; font-weight: 600; font-family: inherit;
    color: #0c6e63; background: #e9f7f4; border: 1px solid #bfe6df; border-radius: 8px; cursor: pointer;
    transition: all 0.15s ease;
}
.scanner-analysis-link:hover { background: #d7f0eb; }

/* ===================================
   🆕 פריסת Track Changes בפאנל שמאל ("עיבוד בסיסי")
   טאבים + 4 כפתורים + שורת ניווט - הכל קומפקטי
   =================================== */
.left-panel-content .panel-inline-results.tc-left-layout {
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 8px;
}

/* --- טאבים --- */
.tc-left-layout .tc-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.tc-left-layout .tc-tab {
    flex: 0 0 auto;
    padding: 4px 12px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary, #64748b);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tc-left-layout .tc-tab:hover { background: var(--bg-secondary, #f1f5f9); }
.tc-left-layout .tc-tab.active {
    color: var(--primary-color, #1e3a5f);
    background: rgba(30, 58, 95, 0.08);
    border-color: rgba(30, 58, 95, 0.2);
}
.tc-left-layout .tc-changes-count {
    margin-inline-start: auto;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    background: var(--primary-color, #1e3a5f);
    border-radius: 10px;
}

/* --- שורת 4 הכפתורים העליונה --- */
.tc-left-layout .tc-actions-row {
    display: flex;
    align-items: stretch;
    gap: 5px;
    flex-shrink: 0;
}
.tc-left-layout .tc-btn {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary, #1e293b);
    background: var(--bg-secondary, #f1f5f9);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.tc-left-layout .tc-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-left-layout .tc-btn i { font-size: 11px; flex-shrink: 0; }
.tc-left-layout .tc-btn:hover { background: #e8edf3; }
.tc-left-layout .tc-btn-primary {
    color: #fff;
    background: var(--primary-color, #1e3a5f);
    border-color: var(--primary-color, #1e3a5f);
}
.tc-left-layout .tc-btn-primary:hover { background: #16304f; }
/* "העתק" - אייקון קטן בלבד */
.tc-left-layout .tc-btn-icon {
    flex: 0 0 auto;
    padding: 6px 9px;
    color: var(--text-secondary, #64748b);
    background: transparent;
}
.tc-left-layout .tc-btn-icon span { display: none; }
.tc-left-layout .tc-btn-icon:hover {
    color: var(--primary-color, #1e3a5f);
    background: var(--bg-secondary, #f1f5f9);
    border-color: var(--border-light, #e5e7eb);
}
/* feedback אחרי העתקה (✓) */
.tc-left-layout .tc-btn.copied {
    color: #166534 !important;
    border-color: #bbf7d0;
    background: #dcfce7;
}
.tc-left-layout .tc-btn-icon.copied span { display: inline; }

/* --- שורת הניווט (תווית הסבר + חיצים + מונה + שינוי בודד) --- */
.tc-left-layout .tc-nav-hint {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    white-space: nowrap;
    flex-shrink: 0;
}
.tc-left-layout .tc-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
    row-gap: 6px;
    flex-shrink: 0;
    padding: 5px 8px;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 8px;
}
.tc-left-layout .tc-nav { display: flex; align-items: center; gap: 4px; }
.tc-left-layout .tc-nav-btn {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    background: #fff;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 6px;
    cursor: pointer;
}
.tc-left-layout .tc-nav-btn:hover { background: #e8edf3; }
.tc-left-layout .tc-nav-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    min-width: 38px;
    text-align: center;
}
.tc-left-layout .tc-single { display: flex; align-items: center; gap: 4px; }
.tc-left-layout .tc-single-btn {
    padding: 4px 8px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid transparent;
}
.tc-left-layout .tc-single-btn.apply { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.tc-left-layout .tc-single-btn.apply:hover { background: #bbf7d0; }
.tc-left-layout .tc-single-btn.reject { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
.tc-left-layout .tc-single-btn.reject:hover { background: #fecaca; }

/* 🆕 6ב: סרגל הטראק-צ'יינג' **מעל העורך** (ניווט + קבל/דחה שינוי בודד) — flex-child ראשון של .main-editor.
   ⚠️ יישור אופקי **בדיוק לרוחב #textEditor**: מראה את אותם margins של .text-editor בכל מצב פאנל (אחרת הסרגל
   נמתח לכל רוחב .main-editor — הבאג שדווח). */
.tc-editor-bar {
    /* 🆕 שורה אחת (nowrap), והתוכן מתפרס לשתי הקצוות (space-between): רמז בקצה אחד, כפתורי "בודד" בקצה השני,
       וניווט באמצע → מיושר בדיוק לשני צידי איזור הטקסט בעורך (כפי שביקש המשתמש). */
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-shrink: 0; flex-wrap: nowrap;
    padding: 7px 16px; direction: rtl;
    /* 🆕 מקור-אמת יחיד — תואם בדיוק את .text-editor בכל מצב-פאנל (var על body ב-main.css).
       אוחדו 4 חוקי-state ידניים שהיו כאן (panel-open / left-panel-open / both / tc-left-active). */
    margin: 2px var(--editor-space-right, 142px) 0 var(--editor-space-left, 110px);
    background: #f8fafc; border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); z-index: 5;
}
.tc-editor-bar-hint { font-size: 12px; font-weight: 600; color: var(--text-secondary, #64748b); white-space: nowrap; }
.tc-editor-bar-nav { display: flex; align-items: center; gap: 6px; }
.tc-editor-bar .tc-nav-btn {
    width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--text-secondary, #64748b); background: #fff;
    border: 1px solid var(--border-light, #e5e7eb); border-radius: 6px; cursor: pointer; transition: all 0.15s ease;
}
.tc-editor-bar .tc-nav-btn:hover { color: var(--primary-color, #1e3a5f); background: #e8edf3; }
.tc-editor-bar .tc-nav-counter { font-size: 13px; font-weight: 700; color: var(--text-primary, #1e293b); min-width: 48px; text-align: center; }
.tc-editor-bar-single { display: flex; align-items: center; gap: 8px; }
.tc-editor-bar .tc-single-btn {
    padding: 5px 12px; font-size: 12.5px; font-weight: 600; font-family: inherit;
    cursor: pointer; border-radius: 6px; border: 1px solid transparent; transition: all 0.15s ease;
}
.tc-editor-bar .tc-single-btn.apply { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.tc-editor-bar .tc-single-btn.apply:hover { background: #bbf7d0; }
.tc-editor-bar .tc-single-btn.reject { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
.tc-editor-bar .tc-single-btn.reject:hover { background: #fecaca; }
/* כשהסרגל פעיל — העורך (בעל height קבוע) מתכווץ ל-flex:1 כדי לפנות מקום לסרגל בלי לחרוג מהמסך */
.main-editor.tc-bar-active > .text-editor {
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* --- אזור התוכן (הטאב הפעיל ממלא את הגובה הנותר) --- */
.tc-left-layout .tc-tab-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.tc-left-layout .tc-tab-content > .corrected-text-panel {
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
}

/* --- מצב "הטקסט המקורי בלבד" (נשאר אחרי "החלף") --- */
.left-panel-content .tc-original-only {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 8px;
}
.tc-original-only-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    flex-shrink: 0;
}
.tc-original-only .corrected-text-content {
    flex: 1 1 auto;
    min-height: 0;
}

/* ===================================
   🆕 שלב 2 — פאנל 3 טאבים למשפחת הליטוש (הצעות / הטקסט המתוקן / הטקסט הרגיל)
   מעוצב בשפה של tc-left-layout. מוצג בתוך #leftPanelContent .panel-inline-results.
   =================================== */
.left-panel-content .panel-inline-results:has(.litush-tab-panel) {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.litush-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-height: 0;
}
/* שורת 4 הכפתורים */
.litush-actions-row { display: flex; align-items: stretch; gap: 5px; flex-shrink: 0; }
.litush-btn {
    flex: 1 1 0; min-width: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    padding: 6px 4px; font-size: 11.5px; font-weight: 600; font-family: inherit;
    color: var(--text-primary, #1e293b); background: var(--bg-secondary, #f1f5f9);
    border: 1px solid var(--border-light, #e5e7eb); border-radius: 8px;
    cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
}
.litush-btn span { overflow: hidden; text-overflow: ellipsis; }
.litush-btn i { font-size: 11px; flex-shrink: 0; }
.litush-btn:hover { background: #e8edf3; }
.litush-btn-primary { color: #fff; background: var(--primary-color, #1e3a5f); border-color: var(--primary-color, #1e3a5f); }
.litush-btn-primary:hover { background: #16304f; }
.litush-btn-icon { flex: 0 0 auto; padding: 6px 9px; color: var(--text-secondary, #64748b); background: transparent; }
.litush-btn-icon span { display: none; }
.litush-btn-icon:hover { color: var(--primary-color, #1e3a5f); background: var(--bg-secondary, #f1f5f9); border-color: var(--border-light, #e5e7eb); }
/* שורת הניווט */
.litush-nav-row {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    flex-shrink: 0; padding: 5px 8px; background: var(--bg-secondary, #f1f5f9); border-radius: 8px;
}
/* 🆕 בר אינדיקטור צ'ונקינג עליון (קבוע בראש הפאנל בזמן עיבוד מרובה-חלקים) */
.chunk-progress-top {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    flex-shrink: 0; padding: 6px 10px; margin-bottom: 4px;
    background: #eff6ff; color: var(--primary-color, #1e3a5f);
    border: 1px solid #bfdbfe; border-radius: 8px; font-size: 12px; font-weight: 600;
}
.chunk-progress-top .cpt-spinner {
    width: 12px; height: 12px; flex-shrink: 0;
    border: 2px solid #bfdbfe; border-top-color: var(--primary-color, #1e3a5f);
    border-radius: 50%; animation: cpt-spin 0.7s linear infinite;
}
@keyframes cpt-spin { to { transform: rotate(360deg); } }
.litush-nav-hint { font-size: 10.5px; font-weight: 600; color: var(--text-secondary, #94a3b8); white-space: nowrap; }
.litush-nav { display: flex; align-items: center; gap: 4px; }
.litush-nav .inline-nav-btn {
    width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--text-secondary, #64748b); background: #fff;
    border: 1px solid var(--border-light, #e5e7eb); border-radius: 6px; cursor: pointer;
}
.litush-nav .inline-nav-btn:hover { color: var(--primary-color, #1e3a5f); background: var(--bg-secondary, #f1f5f9); }
.litush-nav .inline-nav-counter { font-size: 12px; font-weight: 700; color: var(--text-primary, #1e293b); min-width: 44px; text-align: center; }
/* 🆕 ISSUE 5: כפתורי קבל/דחה הצעה בודדת בשורת המונה (ליטוש + כותרות) */
.litush-nav-single { display: flex; align-items: center; gap: 4px; }
.litush-nav-single .inline-nav-btn {
    width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; background: #fff; border: 1px solid var(--border-light, #e5e7eb); border-radius: 6px; cursor: pointer;
    transition: all 0.15s ease;
}
.inline-nav-btn.nav-accept-one { color: #16a34a; }
.inline-nav-btn.nav-accept-one:hover { color: #fff; background: #16a34a; border-color: #16a34a; }
.inline-nav-btn.nav-reject-one { color: #dc2626; }
.inline-nav-btn.nav-reject-one:hover { color: #fff; background: #dc2626; border-color: #dc2626; }
.inline-nav-btn.nav-accept-one:disabled, .inline-nav-btn.nav-reject-one:disabled { opacity: .4; cursor: default; background: #fff; color: inherit; }
/* פס הטאבים */
.litush-tabs { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.litush-tab {
    flex: 0 0 auto; padding: 4px 12px; font-size: 12.5px; font-weight: 600; font-family: inherit;
    color: var(--text-secondary, #64748b); background: transparent;
    border: 1px solid transparent; border-radius: 8px; cursor: pointer; transition: all 0.15s ease;
}
.litush-tab:hover { background: var(--bg-secondary, #f1f5f9); }
.litush-tab.active { color: var(--primary-color, #1e3a5f); background: rgba(30, 58, 95, 0.08); border-color: rgba(30, 58, 95, 0.2); }
.litush-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 16px; padding: 0 5px; margin-inline-start: 4px;
    font-size: 10.5px; font-weight: 700; color: #fff; background: var(--primary-color, #1e3a5f); border-radius: 9px;
}
/* תוכן הטאבים — גולל לגובה */
.litush-tab-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.litush-text-view .corrected-text-content {
    padding: 6px 2px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}

/* ===================================
   🆕 ניקוד בפאנל שמאל - הקופסה (טקסט מקורי / השוואה) מתרחבת לגובה
   כמו "הטקסט המתוקן" של "עיבוד בסיסי". מוגבל לפאנל השמאלי בלבד (הימני/צ'אט לא מושפעים).
   =================================== */
.left-panel-content .panel-inline-results:has(.nikud-result-panel) {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.left-panel-content .nikud-result-panel {
    flex: 1 1 auto;
    min-height: 0;
}
.left-panel-content .nikud-original-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.left-panel-content .nikud-original-section .nikud-section-header,
.left-panel-content .nikud-original-section .nikud-actions {
    flex-shrink: 0;
}
.left-panel-content .nikud-original-box {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none; /* ביטול ה-200px - שתתרחב למסך מלא */
}

.left-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    flex-shrink: 0;
}

/* Action buttons for current suggestion */
.left-panel-suggestion-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
}

.left-panel-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.left-panel-action-btn img {
    width: 16px;
    height: 16px;
}

.left-panel-action-btn.accept {
    background: var(--accent-primary, #1e3a5f);
}

.left-panel-action-btn.accept:hover {
    background: #152a47;
    transform: scale(1.05);
}

.left-panel-action-btn.reject {
    background: #ef4444;
}

.left-panel-action-btn.reject:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Bulk action buttons */
.left-panel-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.left-panel-bulk-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.left-panel-bulk-btn i {
    font-size: 12px;
}

.left-panel-bulk-btn.replace {
    background: var(--accent-primary, #1e3a5f);
    color: white;
}

.left-panel-bulk-btn.replace:hover {
    background: #152a47;
}

.left-panel-bulk-btn.insert {
    /* היפוך צבעים מכפתור החלף */
    background: white;
    color: var(--accent-primary, #1e3a5f);
    border: 2px solid var(--accent-primary, #1e3a5f);
}

.left-panel-bulk-btn.insert:hover {
    background: rgba(30, 58, 95, 0.1);
}

/* Close button */
.left-panel-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.left-panel-close-btn:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--text-primary, #1e293b);
}

/* ===================================
   Panel Content Area
   =================================== */
.left-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    direction: rtl;
}

/* Custom scrollbar */
.left-panel-content::-webkit-scrollbar {
    width: 6px;
}

.left-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.left-panel-content::-webkit-scrollbar-thumb {
    background: var(--border-medium, #cbd5e1);
    border-radius: 3px;
}

.left-panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary, #64748b);
}

/* ===================================
   Rewrite Mode - טקסט חדש
   =================================== */
.left-panel-rewrite-content {
    font-family: 'Heebo', 'Assistant', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary, #1e293b);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===================================
   Compare Mode - הצעות מאוחדות
   =================================== */
.left-panel-compare-content {
    font-family: 'Heebo', 'Assistant', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary, #1e293b);
}

/* סגמנט בודד (הצעה) */
.left-panel-segment {
    position: relative;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.left-panel-segment:hover {
    background: rgba(30, 58, 95, 0.05);
    border-color: var(--accent-primary, #1e3a5f);
}

.left-panel-segment.active {
    background: rgba(30, 58, 95, 0.08);
    border-color: var(--accent-primary, #1e3a5f);
}

/* כפתורי פעולה לסגמנט בודד */
.left-panel-segment-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.left-panel-segment:hover .left-panel-segment-actions {
    opacity: 1;
}

.left-panel-segment-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.left-panel-segment-btn.accept {
    background: var(--accent-primary, #1e3a5f);
    color: white;
}

.left-panel-segment-btn.reject {
    background: #ef4444;
    color: white;
}

/* ===================================
   Diff Styling - שימוש בצבעים הקיימים
   =================================== */
/* תוספות - כחול לוגו */
.left-panel-diff-added {
    background: rgba(30, 58, 95, 0.12);
    color: #1e3a5f;
    font-weight: 500;
    padding: 0 2px;
    border-radius: 2px;
    border-bottom: 2px solid #1e3a5f;
}

/* מחיקות - אדום */
.left-panel-diff-removed {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
    text-decoration: line-through;
    text-decoration-color: #ef4444;
    padding: 0 2px;
    border-radius: 2px;
    margin: 0 1px;
}

/* ===================================
   Toggle Buttons - כמו בכרטיסיות של מערכת ההצעות
   =================================== */

/* עטיפה לשינוי בודד - position: relative לאפשר overlay */
.left-panel-unified-view .diff-change-wrapper {
    display: inline;
    position: relative;
    cursor: pointer;
}

/* השינוי עצמו - ניתן ללחיצה */
.left-panel-unified-view .diff-change-wrapper .diff-added {
    cursor: pointer;
    transition: all 0.15s ease;
}

/* אפקט hover על השינוי - מראה שניתן ללחוץ */
.left-panel-unified-view .diff-change-wrapper:hover .diff-added:not(.rejected) {
    background-color: rgba(30, 58, 95, 0.2);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.3);
}

/* כפתור Toggle - overlay ממורכז על השינוי */
.left-panel-unified-view .change-unit-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* הצגה בהובר על העטיפה */
.left-panel-unified-view .diff-change-wrapper:hover .change-unit-toggle {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* כפתור X (דחייה) - בטקסט המוצע */
.left-panel-unified-view .toggle-reject {
    background: #fee2e2;
    color: #b91c1c;
    border: 2px solid #fca5a5;
}

.left-panel-unified-view .toggle-reject:hover {
    background: #fecaca;
}

/* כשהשינוי נדחה - הכפתור מתחלף ל-V ירוק */
.left-panel-unified-view .toggle-reject.is-rejected {
    background: #dcfce7;
    color: #15803d;
    border: 2px solid #86efac;
}

/* אפקט hover על שינוי שנדחה */
.left-panel-unified-view .diff-change-wrapper:hover .diff-added.rejected {
    background-color: #e5e7eb !important;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

/* מצב rejected - השינוי נדחה */
.left-panel-unified-view .diff-change-wrapper.rejected .diff-added,
.left-panel-unified-view .diff-added.rejected {
    background-color: #f3f4f6 !important;
    color: #9ca3af !important;
    text-decoration: line-through;
    opacity: 0.6;
    font-weight: 400;
    border-bottom: none !important;
}

/* הכפתור נשאר גלוי כשהשינוי נדחה */
.left-panel-unified-view .diff-change-wrapper.rejected .change-unit-toggle {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   Legacy - תמיכה בסגנון הישן (לתאימות אחורה)
   =================================== */
.left-panel-change-wrapper {
    position: relative;
    display: inline;
    cursor: pointer;
}

.left-panel-change-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 2px;
    vertical-align: middle;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.left-panel-change-wrapper:hover .left-panel-change-toggle {
    opacity: 1;
}

.left-panel-toggle-reject {
    background: #fee2e2;
    color: #b91c1c;
    border: 2px solid #fca5a5;
}

.left-panel-toggle-accept {
    background: #dcfce7;
    color: #15803d;
    border: 2px solid #86efac;
}

.left-panel-diff-added.rejected {
    background-color: #f3f4f6 !important;
    color: #9ca3af !important;
    text-decoration: line-through;
    opacity: 0.6;
    font-weight: 400;
}

.left-panel-diff-removed.rejected {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    text-decoration: none !important;
    font-weight: 600;
    opacity: 1;
}

/* ===================================
   Editor Highlight - הדגשה בעורך בעת hover
   =================================== */
.editor-highlight-from-left-panel {
    background: rgba(30, 58, 95, 0.15) !important;
    border-radius: 4px;
    transition: background 0.2s ease;
}

/* סימון מחיקה - קו חוצה אדום */
.editor-highlight-from-left-panel.editor-deletion-highlight {
    background: rgba(239, 68, 68, 0.15) !important;
    text-decoration: line-through;
    text-decoration-color: #ef4444;
    text-decoration-thickness: 2px;
    color: #b91c1c;
    border-radius: 2px;
    padding: 0 2px;
}

/* 🆕 #2: פלאש ירוק רגעי על טקסט שזה עתה הוחל (אישור חיובי, במקום אדום) - CSS Highlight API */
::highlight(lp-just-applied) {
    background-color: rgba(16, 185, 129, 0.28);
    color: #065f46;
}

/* ===================================
   Loading State - כמו בפאנל הימני
   =================================== */
.left-panel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

/* שימוש באותו logo-loader כמו הפאנל הימני */
.left-panel-loading .logo-loader {
    position: relative;
    width: 60px;
    height: 60px;
}

.left-panel-loading .logo-loader img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.left-panel-loading .logo-loader .logo-v,
.left-panel-loading .logo-loader .logo-x {
    width: 30px;
    height: 30px;
    opacity: 0;
    animation: leftPanelLogoFade 2s ease-in-out infinite;
}

.left-panel-loading .logo-loader .logo-x {
    animation-delay: 0.5s;
}

.left-panel-loading .logo-loader .logo-full {
    width: 50px;
    height: auto;
    opacity: 0;
    animation: leftPanelLogoFade 2s ease-in-out infinite;
    animation-delay: 1s;
}

@keyframes leftPanelLogoFade {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.left-panel-loading-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
}

.left-panel-loading-subtext {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
}

/* Progress bar */
.left-panel-loading-progress {
    width: 80%;
    max-width: 200px;
    height: 4px;
    background: var(--border-light, #e5e7eb);
    border-radius: 2px;
    overflow: hidden;
}

.left-panel-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary, #1e3a5f), #3b82f6);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* כפתור עצור */
.left-panel-stop-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-top: 8px;
    border: 1px solid var(--border-medium, #cbd5e1);
    border-radius: 8px;
    background: white;
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.left-panel-stop-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.left-panel-stop-btn i {
    font-size: 11px;
}

/* Legacy spinner - fallback */
.left-panel-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light, #e5e7eb);
    border-top-color: var(--accent-primary, #1e3a5f);
    border-radius: 50%;
    animation: leftPanelSpin 1s linear infinite;
}

@keyframes leftPanelSpin {
    to { transform: rotate(360deg); }
}

/* ===================================
   Chunking Progress - התקדמות עיבוד מקטעים
   =================================== */
#leftPanelProgress {
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(30, 58, 95, 0.1);
    border-radius: 6px;
    font-size: 13px;
    color: var(--accent-primary, #1e3a5f);
    text-align: center;
    font-weight: 500;
}

/* 🆕 אינדיקטור שמעבד עוד חלקים - מוצג לאחר הצגת תוצאות ראשונות */
.left-panel-chunking-indicator {
    display: flex;
    justify-content: center;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.08), rgba(30, 58, 95, 0.03));
    border: 1px solid rgba(30, 58, 95, 0.15);
    border-radius: 8px;
    animation: chunkingPulse 2s ease-in-out infinite;
}

.chunking-indicator-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--accent-primary, #1e3a5f);
    font-weight: 500;
}

.chunking-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(30, 58, 95, 0.2);
    border-top-color: var(--accent-primary, #1e3a5f);
    border-radius: 50%;
    animation: chunkingSpin 0.8s linear infinite;
}

@keyframes chunkingSpin {
    to { transform: rotate(360deg); }
}

@keyframes chunkingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* אנימציית החלפת סטטוס */
@keyframes fadeSwitch {
    0% { opacity: 0.5; transform: translateY(-2px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ===================================
   Empty State
   =================================== */
.left-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    gap: 12px;
    color: var(--text-secondary, #64748b);
}

.left-panel-empty i {
    font-size: 48px;
    opacity: 0.5;
}

.left-panel-empty p {
    font-size: 14px;
    margin: 0;
}

/* ===================================
   Editor Margin Adjustment
   =================================== */
/* 🆕 מרווחי-העורך (text-editor/footnotes) ומצב "שני-הפאנלים" אוחדו ל-var(--editor-space-*)
   ב-main.css (מקור-אמת יחיד). נשאר כאן רק ה-placeholder שמשתמש ב-`left`: */
body.left-panel-open .editor-placeholder-overlay {
    left: calc(var(--editor-space-left, 110px) + 20px);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 1200px) {
    .left-preview-panel {
        --left-panel-width: 280px;
    }
}

@media (max-width: 900px) {
    .left-preview-panel {
        --left-panel-width: 260px;
    }

    .left-panel-bulk-btn span {
        display: none;
    }

    .left-panel-bulk-btn {
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {
    /* במסכים קטנים - הפאנל יכסה יותר */
    .left-preview-panel {
        --left-panel-width: calc(100vw - 100px);
        border-radius: 0 12px 12px 0;
    }

    .left-preview-panel.open {
        left: 0;
    }
}

/* ===================================
   Animations
   =================================== */
.left-panel-segment {
    animation: leftPanelFadeIn 0.3s ease;
}

@keyframes leftPanelFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade out animation for dismissed segments */
.left-panel-segment.fade-out {
    animation: leftPanelFadeOut 0.2s ease forwards;
}

@keyframes leftPanelFadeOut {
    to {
        opacity: 0;
        transform: translateX(-10px);
        height: 0;
        padding: 0;
        margin: 0;
    }
}

/* ===================================
   Control Bar - פס בקרה עליון
   =================================== */
.left-panel-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--bg-primary, #f8fafc);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    gap: 12px;
}

.left-panel-suggestions-count {
    display: flex;
    align-items: center;
    gap: 6px;
}

.left-panel-suggestions-count .count-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--accent-primary, #1e3a5f);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
}

.left-panel-suggestions-count .count-label {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
}

.left-panel-control-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.left-panel-control-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.left-panel-control-btn i {
    font-size: 11px;
}

.left-panel-control-btn.accept-all {
    background: var(--accent-primary, #1e3a5f);
    color: white;
}

.left-panel-control-btn.accept-all:hover {
    background: #152a47;
}

.left-panel-control-btn.reject-all {
    background: white;
    color: var(--text-secondary, #64748b);
    border: 1px solid var(--border-medium, #cbd5e1);
}

.left-panel-control-btn.reject-all:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ===================================
   Unified View - תצוגה מאוחדת
   =================================== */
.left-panel-unified-view {
    line-height: 1.9;
    font-size: 16px;
}

/* ===================================
   Inline Suggestions - הצעות בתוך הטקסט
   =================================== */
.left-panel-inline-suggestion {
    position: relative;
    display: inline;
    background: rgba(30, 58, 95, 0.06);
    border-radius: 3px;
    padding: 1px 2px;
    margin: 0 1px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.left-panel-inline-suggestion:hover {
    background: rgba(30, 58, 95, 0.12);
}

/* 🔧 כשהכפתורים מוצגים, הישאר ב-hover state */
.left-panel-inline-suggestion:has(.left-panel-inline-actions:hover) {
    background: rgba(30, 58, 95, 0.12);
}

.left-panel-inline-suggestion:has(.left-panel-inline-actions:hover) .left-panel-inline-actions {
    display: flex;
}

.left-panel-inline-suggestion.active {
    background: rgba(30, 58, 95, 0.15);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.3);
}

/* כפתורי פעולה inline - 🆕 עם תוויות טקסט */
.left-panel-inline-actions {
    display: none;
    position: absolute;
    top: -40px;
    right: 50%;
    transform: translateX(50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    padding: 4px;
    gap: 4px;
    z-index: 10;
}

.left-panel-inline-suggestion:hover .left-panel-inline-actions,
.left-panel-inline-suggestion:focus-within .left-panel-inline-actions {
    display: flex;
    animation: tooltipFadeIn 0.15s ease;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateX(50%) translateY(5px); }
    to { opacity: 1; transform: translateX(50%) translateY(0); }
}

/* 🔧 אזור "גשר" שמחבר בין ההצעה לכפתורים - מונע היעלמות */
.left-panel-inline-actions::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
}

/* חץ קטן מתחת לתיבה */
.left-panel-inline-actions::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
    pointer-events: none;
}

/* כשהכפתורים מוצגים - הם גם שומרים על ה-hover */
.left-panel-inline-actions:hover {
    display: flex;
}

/* 🆕 כפתורים עם תוויות טקסט */
.left-panel-inline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.left-panel-inline-btn .btn-icon {
    font-size: 11px;
    font-weight: bold;
}

.left-panel-inline-btn .btn-label {
    font-size: 11px;
}

.left-panel-inline-btn.accept {
    background: var(--accent-primary, #1e3a5f);
    color: white;
}

.left-panel-inline-btn.accept:hover {
    background: #152a47;
    transform: scale(1.02);
}

.left-panel-inline-btn.reject {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.left-panel-inline-btn.reject:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* תוכן ההצעה */
.left-panel-inline-content {
    display: inline;
}

/* הצעה שנדחתה */
.left-panel-inline-suggestion.rejected {
    opacity: 0.5;
    background: #f3f4f6;
    cursor: default;
}

.left-panel-inline-suggestion.rejected .left-panel-inline-content {
    text-decoration: line-through;
    color: #9ca3af;
}

.left-panel-inline-suggestion.rejected .left-panel-inline-actions {
    display: none !important;
}

/* הצעה שהוחלה - מוצג הטקסט המתוקן */
.left-panel-inline-suggestion.applied {
    background: rgba(16, 185, 129, 0.1);
    cursor: default;
}

.left-panel-inline-suggestion.applied .left-panel-applied-text {
    color: #059669;
    font-weight: 500;
}

.left-panel-inline-suggestion.applied .left-panel-inline-actions {
    display: none !important;
}

.left-panel-inline-suggestion.applied .left-panel-diff-added,
.left-panel-inline-suggestion.applied .left-panel-change-wrapper {
    background: transparent !important;
    border-bottom: none !important;
}

/* הצעה שהתקבלה (legacy) - אנימציה ונעלמת */
.left-panel-inline-suggestion.accepted {
    animation: suggestionAccepted 0.3s ease forwards;
}

@keyframes suggestionAccepted {
    0% {
        background: rgba(16, 185, 129, 0.2);
    }
    100% {
        background: transparent;
        padding: 0;
        margin: 0;
    }
}

/* ===================================
   Responsive - Control Bar
   =================================== */
@media (max-width: 400px) {
    .left-panel-control-btn span {
        display: none;
    }

    .left-panel-control-btn {
        padding: 6px 8px;
    }

    .left-panel-control-bar {
        padding: 8px 10px;
    }
}
