/* ═══════════════════════════════════════════════════════════════
   EasySale Visual Builder — Design System
   محرر بصري احترافي (ثيم داكن) — يدعم RTL بالكامل + English LTR
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ez-bg: #0b0f19;
  --ez-bg-2: #0f1626;
  --ez-panel: #111a2e;
  --ez-panel-2: #16213b;
  --ez-panel-3: #1c2a47;
  --ez-border: #22304f;
  --ez-border-soft: #1a2440;
  --ez-text: #e6ecf7;
  --ez-text-dim: #8fa3c0;
  --ez-text-faint: #5b6d8c;
  --ez-accent: #10b981;
  --ez-accent-2: #34d399;
  --ez-accent-soft: rgba(16, 185, 129, .14);
  --ez-gold: #f59e0b;
  --ez-danger: #f43f5e;
  --ez-danger-soft: rgba(244, 63, 94, .14);
  --ez-blue: #38bdf8;
  --ez-radius: 12px;
  --ez-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --ez-font: 'Tajawal', 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body.ez-app {
  height: 100%;
  margin: 0;
  background: var(--ez-bg);
  color: var(--ez-text);
  font-family: var(--ez-font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--ez-font); }
:focus-visible { outline: 2px solid var(--ez-accent); outline-offset: 2px; border-radius: 4px; }

/* ══════════ بوابة PIN ══════════ */
.ez-gate { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 700px at 50% -10%, #14324a 0%, var(--ez-bg) 55%); }
.ez-gate.hidden { display: none; }
.ez-gate-card { width: min(430px, 92vw); background: linear-gradient(180deg, var(--ez-panel-2), var(--ez-panel)); border: 1px solid var(--ez-border); border-radius: 22px; padding: 34px 30px; text-align: center; box-shadow: var(--ez-shadow); }
.ez-gate-logo { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: linear-gradient(135deg, #10b981, #0d9488); display: flex; align-items: center; justify-content: center; color: #052e1b; }
.ez-gate-card h1 { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -.02em; }
.ez-gate-card h1 span { color: var(--ez-accent-2); }
.ez-gate-card p { margin: 8px 0 20px; color: var(--ez-text-dim); font-size: 13px; }
.ez-gate-card form { display: flex; flex-direction: column; gap: 12px; }
.ez-gate-card input { height: 48px; border-radius: 12px; border: 1px solid var(--ez-border); background: var(--ez-bg-2); color: var(--ez-text); padding: 0 16px; font-size: 18px; text-align: center; letter-spacing: .3em; }
.ez-gate-card input:focus { border-color: var(--ez-accent); outline: none; box-shadow: 0 0 0 3px var(--ez-accent-soft); }
.ez-gate-card button[type=submit] { height: 48px; border: none; border-radius: 12px; background: linear-gradient(135deg, #10b981, #059669); color: #052e1b; font-weight: 900; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ez-gate-card button[type=submit]:hover { filter: brightness(1.08); }
.ez-gate-offline { margin-top: 10px; background: none; border: none; color: var(--ez-text-faint); font-size: 11px; cursor: pointer; text-decoration: underline; }
.ez-gate-offline:hover { color: var(--ez-text-dim); }
.ez-gate-error { min-height: 18px; margin: 10px 0 0; color: var(--ez-danger); font-size: 12px; font-weight: 700; }

/* ══════════ الشريط العلوي ══════════ */
.ez-topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px; background: linear-gradient(180deg, #131d33, #0f1626); border-bottom: 1px solid var(--ez-border); position: relative; z-index: 40; }
.ez-tb-group { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ez-tb-center { flex: 1; justify-content: center; }
.ez-brand { display: flex; align-items: center; gap: 9px; padding-inline-end: 6px; }
.ez-brand-badge { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #10b981, #0d9488); display: flex; align-items: center; justify-content: center; color: #052e1b; }
.ez-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.ez-brand-text strong { font-size: 12px; font-weight: 800; white-space: nowrap; }
.ez-brand-text small { font-size: 9.5px; color: var(--ez-text-faint); white-space: nowrap; }
.ez-tb-sep { width: 1px; height: 22px; background: var(--ez-border); margin: 0 4px; }

.ez-tool-btn { width: 32px; height: 32px; border: 1px solid transparent; background: transparent; color: var(--ez-text-dim); border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0; transition: background .12s, color .12s, border-color .12s; }
.ez-tool-btn:hover { background: var(--ez-panel-2); color: var(--ez-text); }
.ez-tool-btn.active, .ez-toggle.active { color: var(--ez-accent-2); background: var(--ez-accent-soft); border-color: rgba(16,185,129,.35); }
.ez-tool-btn:disabled { opacity: .35; cursor: default; }
.ez-lang-btn { width: auto; padding: 0 10px; font-weight: 800; font-size: 11px; letter-spacing: .05em; }

.ez-device-switch { display: inline-flex; background: var(--ez-bg-2); border: 1px solid var(--ez-border); border-radius: 10px; padding: 3px; gap: 2px; }
.ez-device-btn { width: 34px; height: 26px; border: none; background: transparent; color: var(--ez-text-dim); border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ez-device-btn:hover { color: var(--ez-text); }
.ez-device-btn.active { background: var(--ez-panel-3); color: var(--ez-accent-2); box-shadow: inset 0 0 0 1px rgba(16,185,129,.4); }

.ez-zoom-level { min-width: 52px; height: 32px; border: 1px solid var(--ez-border); background: var(--ez-bg-2); color: var(--ez-text-dim); border-radius: 8px; font-size: 11px; font-weight: 800; cursor: pointer; font-variant-numeric: tabular-nums; }
.ez-zoom-level:hover { color: var(--ez-text); }

.ez-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 10.5px; font-weight: 800; border: 1px solid transparent; }
.ez-chip-draft { background: rgba(245, 158, 11, .1); color: var(--ez-gold); border-color: rgba(245, 158, 11, .35); }
.ez-chip-saved { background: var(--ez-accent-soft); color: var(--ez-accent-2); border-color: rgba(16,185,129,.35); }
.ez-chip-saving { background: rgba(56, 189, 248, .12); color: var(--ez-blue); border-color: rgba(56,189,248,.35); }
.ez-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.ez-btn { height: 32px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent; font-weight: 800; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: filter .12s, transform .12s; white-space: nowrap; }
.ez-btn:active { transform: scale(.97); }
.ez-btn-ghost { background: var(--ez-panel-2); color: var(--ez-text); border-color: var(--ez-border); }
.ez-btn-ghost:hover { background: var(--ez-panel-3); }
.ez-btn-publish { background: linear-gradient(135deg, #10b981, #059669); color: #052e1b; box-shadow: 0 6px 18px rgba(16,185,129,.35); }
.ez-btn-publish:hover { filter: brightness(1.1); }
.ez-btn-publish:disabled { opacity: .5; cursor: default; }

/* ══════════ بانر عدم الاتصال ══════════ */
.ez-offline-banner { height: 34px; display: flex; align-items: center; gap: 8px; justify-content: center; background: rgba(245,158,11,.12); color: var(--ez-gold); font-size: 11.5px; font-weight: 700; border-bottom: 1px solid rgba(245,158,11,.3); }
.hidden { display: none !important; }

/* ══════════ جسم التطبيق ══════════ */
#workspace { display: flex; height: calc(100% - 52px - 26px - 34px); }
body.ez-app:not(.ez-offline) #workspace { height: calc(100% - 52px - 26px); }

.ez-panel { background: var(--ez-panel); border-inline-end: 1px solid var(--ez-border-soft); display: flex; flex-direction: column; min-height: 0; }
.ez-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--ez-border-soft); }
.ez-panel-head h2 { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; color: var(--ez-text-dim); text-transform: uppercase; display: flex; align-items: center; gap: 7px; }
.ez-panel-foot { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--ez-border-soft); color: var(--ez-text-faint); font-size: 10px; line-height: 1.5; }

/* ── مكتبة العناصر ── */
.ez-elements { width: 224px; flex-shrink: 0; border-inline-end: 1px solid var(--ez-border-soft); }
.ez-lib-tabs { display: flex; gap: 4px; padding: 8px 10px 0; }
.ez-lib-tab { flex: 1; height: 30px; border: 1px solid transparent; background: transparent; color: var(--ez-text-dim); font-size: 10.5px; font-weight: 800; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; }
.ez-lib-tab:hover { color: var(--ez-text); background: var(--ez-panel-2); }
.ez-lib-tab.active { color: var(--ez-accent-2); background: var(--ez-accent-soft); border-color: rgba(16,185,129,.35); }
.ez-lib-search { display: flex; align-items: center; gap: 7px; margin: 10px; padding: 0 10px; height: 32px; background: var(--ez-bg-2); border: 1px solid var(--ez-border-soft); border-radius: 9px; color: var(--ez-text-faint); }
.ez-lib-search input { flex: 1; min-width: 0; background: transparent; border: none; color: var(--ez-text); font-size: 11.5px; outline: none; }
.ez-elements-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 10px 12px; align-content: start; }
.ez-element-card { background: var(--ez-panel-2); border: 1px solid var(--ez-border-soft); border-radius: 12px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; color: var(--ez-text-dim); transition: border-color .12s, transform .12s, color .12s; }
.ez-element-card:hover { border-color: var(--ez-accent); color: var(--ez-text); transform: translateY(-2px); }
.ez-element-card .ez-el-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--ez-panel-3); display: flex; align-items: center; justify-content: center; color: var(--ez-accent-2); }
.ez-element-card span { font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.3; }
.ez-element-card small { font-size: 8.5px; color: var(--ez-text-faint); }

/* ── لوحة التصميم ── */
#canvasArea { flex: 1; min-width: 0; position: relative; background: var(--ez-bg); background-image: radial-gradient(circle at 50% 0%, #101c33 0%, var(--ez-bg) 60%); display: flex; flex-direction: column; }
.ez-device-frame-bar { height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: var(--ez-text-faint); font-size: 10.5px; font-weight: 700; border-bottom: 1px solid var(--ez-border-soft); }
.ez-page-size { font-variant-numeric: tabular-nums; }
.ez-stage-scroll { flex: 1; overflow: auto; display: flex; justify-content: center; padding: 18px 24px 60px; direction: ltr; }
.ez-stage-fit { transform-origin: top left; margin: 0 auto; direction: ltr; }
.ez-stage-zoom { transform-origin: top left; box-shadow: var(--ez-shadow); border-radius: 4px; overflow: hidden; background: #fff; direction: ltr; }
#storefrontFrame { display: block; border: none; width: 1320px; height: 900px; background: #fff; }
.ez-canvas-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: rgba(15, 22, 38, .92); border: 1px solid var(--ez-border); color: var(--ez-text-dim); font-size: 10.5px; font-weight: 700; padding: 7px 14px; border-radius: 999px; pointer-events: none; backdrop-filter: blur(6px); }

/* ── العمود الأيمن (RTL: الأيسر بصرياً) ── */
.ez-rightcol { width: 296px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; background: var(--ez-panel); border-inline-start: 1px solid var(--ez-border-soft); }

/* ── الخصائص ── */
.ez-properties { flex: 1.35; min-height: 0; border-bottom: 1px solid var(--ez-border-soft); }
.ez-prop-target { font-size: 10px; color: var(--ez-accent-2); font-weight: 800; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ez-properties-body { flex: 1; overflow-y: auto; padding: 10px 12px 16px; }
.ez-empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--ez-text-faint); text-align: center; font-size: 12px; padding: 12px; }

.ez-prop-section { border: 1px solid var(--ez-border-soft); border-radius: var(--ez-radius); padding: 8px 10px 10px; margin-bottom: 10px; background: var(--ez-bg-2); }
.ez-prop-section > h3 { margin: 0 0 8px; font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--ez-text-dim); display: flex; align-items: center; gap: 6px; text-transform: uppercase; }
.ez-prop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ez-prop-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.ez-field { display: flex; flex-direction: column; gap: 3px; }
.ez-field label { font-size: 9px; color: var(--ez-text-faint); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.ez-field input[type=number], .ez-field input[type=text], .ez-field select, .ez-field textarea { height: 28px; background: var(--ez-panel); border: 1px solid var(--ez-border-soft); color: var(--ez-text); border-radius: 7px; padding: 0 7px; font-size: 11px; outline: none; font-family: var(--ez-font); }
.ez-field textarea { height: auto; min-height: 52px; padding: 6px 7px; resize: vertical; line-height: 1.6; }
.ez-field input:focus, .ez-field select:focus, .ez-field textarea:focus { border-color: var(--ez-accent); }
.ez-field input[type=range] { accent-color: var(--ez-accent); height: 22px; }
.ez-inline-row { display: flex; gap: 6px; align-items: center; }
.ez-num-suffix { font-size: 9px; color: var(--ez-text-faint); }

.ez-color-row { display: flex; align-items: center; gap: 6px; }
.ez-color-swatch { width: 30px; height: 28px; border-radius: 7px; border: 1px solid var(--ez-border); padding: 0; background: none; cursor: pointer; }
.ez-color-hex { flex: 1; min-width: 0; height: 28px; background: var(--ez-panel); border: 1px solid var(--ez-border-soft); color: var(--ez-text); border-radius: 7px; padding: 0 8px; font-size: 10.5px; font-family: 'Inter', monospace; direction: ltr; text-align: left; outline: none; }
.ez-color-clear { width: 24px; height: 28px; border: none; background: transparent; color: var(--ez-text-faint); cursor: pointer; border-radius: 6px; }
.ez-color-clear:hover { color: var(--ez-danger); background: var(--ez-danger-soft); }

.ez-icon-toggle-group { display: flex; gap: 3px; }
.ez-icon-toggle { width: 28px; height: 28px; border: 1px solid var(--ez-border-soft); background: var(--ez-panel); color: var(--ez-text-dim); border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ez-icon-toggle.active { color: var(--ez-accent-2); border-color: var(--ez-accent); background: var(--ez-accent-soft); }

.ez-responsive-tabs { display: flex; background: var(--ez-panel); border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 8px; }
.ez-responsive-tab { flex: 1; height: 26px; border: none; background: transparent; color: var(--ez-text-dim); font-size: 10px; font-weight: 800; border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; }
.ez-responsive-tab.active { background: var(--ez-panel-3); color: var(--ez-accent-2); }

.ez-switch { position: relative; width: 32px; height: 18px; appearance: none; -webkit-appearance: none; background: var(--ez-panel-3); border-radius: 999px; cursor: pointer; outline: none; transition: background .15s; border: 1px solid var(--ez-border); flex-shrink: 0; }
.ez-switch:checked { background: var(--ez-accent); border-color: var(--ez-accent); }
.ez-switch::after { content: ''; position: absolute; top: 1px; inset-inline-start: 1px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ez-switch:checked::after { transform: translateX(-14px); }
html[dir="ltr"] .ez-switch:checked::after { transform: translateX(14px); }

.ez-upload-row { display: flex; gap: 6px; }
.ez-upload-row input[type=text] { flex: 1; }
.ez-switch-label { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; color: var(--ez-text-dim); cursor: pointer; user-select: none; }
.ez-hint-line { font-size: 9px; color: var(--ez-text-faint); line-height: 1.6; margin: 4px 0 0; }
.ez-element-disabled { opacity: .45; cursor: not-allowed; }
.ez-element-disabled:hover { transform: none; border-color: var(--ez-border-soft); color: var(--ez-text-dim); }
.ez-bp-badge { display: inline-block; font-size: 8.5px; background: rgba(56,189,248,.15); color: var(--ez-blue); border: 1px solid rgba(56,189,248,.35); padding: 1px 6px; border-radius: 5px; vertical-align: middle; }
.ez-block-card { position: relative; }
.ez-block-delete { position: absolute; top: 4px; inset-inline-end: 4px; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ez-text-faint); background: transparent; }
.ez-block-delete:hover { background: var(--ez-danger-soft); color: var(--ez-danger); }

/* ── الطبقات ── */
.ez-layers { flex: 1; min-height: 0; }
.ez-layers-actions { display: flex; gap: 4px; }
.ez-mini-btn { width: 24px; height: 24px; border: 1px solid var(--ez-border-soft); background: var(--ez-panel-2); color: var(--ez-text-dim); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ez-mini-btn:hover { color: var(--ez-text); border-color: var(--ez-accent); }
.ez-layers-body { flex: 1; overflow-y: auto; padding: 8px 8px 12px; }
.ez-layers-group-title { font-size: 9px; font-weight: 800; letter-spacing: .07em; color: var(--ez-text-faint); text-transform: uppercase; padding: 6px 6px 5px; display: flex; align-items: center; gap: 6px; }
.ez-sections-list, .ez-layers-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.ez-section-row, .ez-layer-row { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px; border-radius: 8px; background: var(--ez-panel-2); border: 1px solid transparent; color: var(--ez-text-dim); font-size: 10.5px; }
.ez-section-row .ez-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ez-layer-row { cursor: pointer; user-select: none; }
.ez-layer-row:hover { border-color: var(--ez-border); color: var(--ez-text); }
.ez-layer-row.selected { border-color: var(--ez-accent); background: var(--ez-accent-soft); color: var(--ez-accent-2); }
.ez-layer-row.ez-drop-above { box-shadow: 0 -2px 0 0 var(--ez-accent); }
.ez-layer-row.ez-drop-below { box-shadow: 0 2px 0 0 var(--ez-accent); }
.ez-layer-row.ez-layer-hidden .ez-row-name { opacity: .45; text-decoration: line-through; }
.ez-layer-icon { width: 18px; display: flex; justify-content: center; color: var(--ez-text-faint); flex-shrink: 0; }
.ez-layer-row.selected .ez-layer-icon { color: var(--ez-accent-2); }
.ez-drag-handle { cursor: grab; color: var(--ez-text-faint); flex-shrink: 0; display: flex; }
.ez-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ez-row-actions { display: flex; gap: 2px; flex-shrink: 0; }
.ez-icon-btn { width: 22px; height: 22px; border: none; background: transparent; color: var(--ez-text-faint); border-radius: 5px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ez-icon-btn:hover { color: var(--ez-text); background: var(--ez-panel-3); }
.ez-icon-btn.is-off { color: var(--ez-danger); }
.ez-group-badge { font-size: 8px; background: var(--ez-panel-3); border-radius: 4px; padding: 1px 4px; color: var(--ez-blue); flex-shrink: 0; }
.ez-layer-rename { flex: 1; min-width: 0; height: 22px; background: var(--ez-panel-3); border: 1px solid var(--ez-accent); border-radius: 5px; color: var(--ez-text); font-size: 10.5px; padding: 0 6px; outline: none; }
.ez-layers-empty { text-align: center; color: var(--ez-text-faint); font-size: 10.5px; padding: 14px 8px; line-height: 1.7; border: 1px dashed var(--ez-border-soft); border-radius: 10px; }
.ez-layer-visibility-off { opacity: .45; }

/* ══════════ شريط الحالة ══════════ */
.ez-statusbar { height: 26px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #0d1424; border-top: 1px solid var(--ez-border-soft); color: var(--ez-text-faint); font-size: 10px; font-weight: 700; position: relative; z-index: 40; }
.ez-status-sep { opacity: .4; }
.ez-statusbar-spacer { flex: 1; }
.ez-save-state { display: flex; align-items: center; gap: 5px; }
.ez-54-themes { display: flex; align-items: center; gap: 5px; color: var(--ez-gold); }

/* ══════════ أزرار صغيرة للأقسام ══════════ */
.ez-section-move { display: flex; flex-direction: column; gap: 1px; }
.ez-section-move button { width: 18px; height: 12px; border: none; background: var(--ez-panel-3); color: var(--ez-text-dim); border-radius: 3px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 8px; line-height: 1; }
.ez-section-move button:hover { color: var(--ez-text); background: var(--ez-border); }

/* ══════════ نوافذ منبثقة ══════════ */
.ez-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; }
.ez-modal-backdrop { position: absolute; inset: 0; background: rgba(4, 8, 18, .66); backdrop-filter: blur(3px); }
.ez-modal-card { position: relative; width: min(460px, 92vw); background: linear-gradient(180deg, var(--ez-panel-2), var(--ez-panel)); border: 1px solid var(--ez-border); border-radius: 18px; padding: 24px; box-shadow: var(--ez-shadow); max-height: 84vh; overflow-y: auto; }
.ez-modal-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.ez-modal-icon-publish { background: var(--ez-accent-soft); color: var(--ez-accent-2); }
.ez-modal-icon-history { background: rgba(56,189,248,.12); color: var(--ez-blue); }
.ez-modal-card h3 { margin: 0; font-size: 17px; font-weight: 900; }
.ez-modal-card > p { color: var(--ez-text-dim); font-size: 12px; line-height: 1.7; margin: 8px 0 14px; }
.ez-field-label { font-size: 10px; font-weight: 800; color: var(--ez-text-dim); display: block; margin-bottom: 5px; }
.ez-modal-card input[type=text] { width: 100%; height: 38px; border-radius: 9px; border: 1px solid var(--ez-border); background: var(--ez-bg-2); color: var(--ez-text); padding: 0 12px; font-size: 12.5px; outline: none; }
.ez-modal-card input[type=text]:focus { border-color: var(--ez-accent); }
.ez-modal-stats { display: flex; gap: 8px; margin: 12px 0 4px; }
.ez-modal-stat { flex: 1; background: var(--ez-bg-2); border: 1px solid var(--ez-border-soft); border-radius: 10px; padding: 8px; text-align: center; }
.ez-modal-stat strong { display: block; font-size: 17px; color: var(--ez-accent-2); font-variant-numeric: tabular-nums; }
.ez-modal-stat span { font-size: 9px; color: var(--ez-text-faint); font-weight: 700; }
.ez-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.ez-history-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ez-history-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--ez-bg-2); border: 1px solid var(--ez-border-soft); border-radius: 12px; }
.ez-history-item .ez-history-meta { flex: 1; min-width: 0; }
.ez-history-item strong { font-size: 12px; display: block; }
.ez-history-item small { font-size: 9.5px; color: var(--ez-text-faint); }
.ez-history-empty { text-align: center; color: var(--ez-text-faint); font-size: 11px; padding: 16px; border: 1px dashed var(--ez-border-soft); border-radius: 12px; line-height: 1.8; }
.ez-history-restore { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid rgba(56,189,248,.4); background: rgba(56,189,248,.1); color: var(--ez-blue); font-size: 10.5px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.ez-history-restore:hover { background: rgba(56,189,248,.2); }

/* ══════════ إشعارات Toast ══════════ */
.ez-toast-host { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.ez-toast { background: var(--ez-panel-2); border: 1px solid var(--ez-border); color: var(--ez-text); border-radius: 11px; padding: 10px 16px; font-size: 12px; font-weight: 700; box-shadow: var(--ez-shadow); display: flex; align-items: center; gap: 8px; animation: ezToastIn .22s ease; max-width: 90vw; }
.ez-toast.success { border-color: rgba(16,185,129,.45); color: var(--ez-accent-2); }
.ez-toast.error { border-color: rgba(244,63,94,.45); color: #fda4af; }
@keyframes ezToastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.ez-merge-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.ez-merge-option { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border: 1.5px solid var(--ez-border); background: var(--ez-bg-2); border-radius: 14px; cursor: pointer; color: var(--ez-text-dim); transition: border-color .15s, transform .15s; }
.ez-merge-option:hover { border-color: var(--ez-accent); transform: translateY(-2px); color: var(--ez-text); }
.ez-merge-option .ez-merge-badge { font-size: 11px; font-weight: 800; background: var(--ez-panel-3); padding: 3px 10px; border-radius: 999px; color: var(--ez-accent-2); }
.ez-merge-option strong { font-size: 18px; color: var(--ez-text); font-variant-numeric: tabular-nums; }
.ez-merge-option small { font-size: 9.5px; text-align: center; line-height: 1.5; }

/* ══════════ سكرول بار ══════════ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ez-border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2f4066; }

/* ══════════ LTR mode ══════════ */
html[dir="ltr"] .ez-panel { border-inline-end: none; border-inline-start: 1px solid var(--ez-border-soft); }
html[dir="ltr"] .ez-rightcol { border-inline-start: none; border-inline-end: 1px solid var(--ez-border-soft); }
