/* ============================================================
   MilaWindow — חלונית אחידה בסגנון-וורד: גרירה + הגדלה, צבעי-המותג.
   namespace ייחודי (.ww-*) כדי לא להתנגש במחלקות-המודאל הקיימות.
   z-index בטווח המודאלים (10000+), מתחת לטולטיפים הגלובליים (100000).
   ============================================================ */
.ww-root { position: fixed; inset: 0; z-index: 10000; }
.ww-backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.35);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.ww-window {
    position: fixed; direction: rtl;
    display: flex; flex-direction: column;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
    min-width: 320px; max-width: 96vw; max-height: 92vh;
    font-family: 'Rubik', 'Heebo', sans-serif;
    animation: wwIn 0.16s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes wwIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

/* סרגל-כותרת (אזור-הגרירה) — גרדיאנט-המותג */
.ww-titlebar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px; cursor: move; user-select: none; flex-shrink: 0;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    color: #fff;
}
.ww-title { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; min-width: 0; }
.ww-title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ww-title i { font-size: 14px; opacity: 0.92; flex-shrink: 0; }
.ww-actions { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ww-close, .ww-max {
    width: 30px; height: 30px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.12); border: none; border-radius: 7px;
    color: #fff; cursor: pointer; font-size: 14px; transition: background 0.15s ease;
}
.ww-close:hover, .ww-max:hover { background: rgba(255, 255, 255, 0.28); }

/* non-modal (backdrop:false): השורש לא חוסם קליקים — אפשר לעבוד על העורך במקביל */
.ww-root.ww-nomodal { pointer-events: none; }
.ww-root.ww-nomodal .ww-window { pointer-events: auto; }

/* גוף — גליל פנימי */
.ww-body { flex: 1; overflow: auto; padding: 16px; min-height: 0; color: var(--text-primary, #1e293b); }

/* 🆕 הסבר-מתחת-לקלט (מגבלות/מה מותר) — אחיד לכל החלוניות */
.ww-hint {
    font-size: 12px; color: var(--text-muted, #64748b); line-height: 1.5;
    margin: 5px 2px 0; display: flex; align-items: flex-start; gap: 6px;
}
.ww-hint i { font-size: 11px; margin-top: 3px; opacity: 0.8; flex-shrink: 0; }
/* 🆕 הודעת-שגיאה ברורה בתוך החלונית */
.ww-error {
    font-size: 12.5px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 8px; padding: 8px 11px; margin: 8px 0 0; line-height: 1.5;
    display: none; align-items: flex-start; gap: 7px;
}
.ww-error.show { display: flex; }
.ww-error i { margin-top: 2px; flex-shrink: 0; }

/* ידית-הגדלה (פינה שמאלית-תחתונה — מתאים ל-RTL) */
.ww-resize { position: absolute; bottom: 0; left: 0; width: 20px; height: 20px; cursor: nesw-resize; z-index: 2; }
.ww-resize::before {
    content: ''; position: absolute; bottom: 4px; left: 4px; width: 9px; height: 9px;
    border-left: 2px solid var(--border-medium, #cbd5e1);
    border-bottom: 2px solid var(--border-medium, #cbd5e1);
    border-bottom-left-radius: 3px;
}
@media (prefers-reduced-motion: reduce) { .ww-window { animation: none; } }
