/* ═══════════════════════════════════════════════════════════════
   nz-v2.css — مفردات تصميم V2 المشتركة بين المحرّر وصفحات المنتجات
   (منسدلات nz-dd، مفاتيح nz-sw، شارات nz-hint-pill، شريط تبويبات v2tabs)
   كل القواعد مسبوقة بـ .nr-v2 فلا تمسّ الصفحات الكلاسيكية.
   ═══════════════════════════════════════════════════════════════ */

/* ── قائمة منسدلة مخصّصة ── */
.nr-v2 .nz-dd { position: relative; }
.nr-v2 .nz-dd-btn {
    width: 100%; height: 44px; display: flex; align-items: center; gap: 10px;
    direction: rtl; padding: 0 12px; background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border-2); border-radius: 12px; cursor: pointer;
    font-size: 13.5px; font-weight: 600; box-sizing: border-box;
}
.nr-v2 .nz-dd-btn:hover { border-color: var(--border-2); }
.nr-v2 .nz-dd-lbl { white-space: nowrap; }
.nr-v2 .nz-dd-ic { display: inline-flex; align-items: center; }
.nr-v2 .nz-dd-sp { flex: 1; }
.nr-v2 .nz-dd-chev { color: var(--text-3); font-size: 11px; }
.nr-v2 .nz-dd-panel {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 30;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .12); padding: 6px; direction: rtl;
}
.nr-v2 .nz-dd-item {
    width: 100%; display: flex; align-items: center; gap: 10px; direction: rtl;
    padding: 10px 12px; background: transparent; border: 0; border-radius: 10px;
    cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text);
}
.nr-v2 .nz-dd-item:hover { background: #f7f9ff; }
.nr-v2 .nz-dd-item.sel { background: var(--bg-tint); color: #2563eb; }
.nr-v2 .nz-dd-item.sel svg [stroke] { stroke: #2563eb; }

/* ── مفتاح تبديل (iOS) ── */
.nr-v2 .nz-sw-row {
    display: flex; align-items: center; justify-content: space-between;
    direction: rtl; gap: 10px; margin: 4px 0 10px;
}
.nr-v2 .nz-sw-lbl { font-size: 13.5px; font-weight: 700; color: var(--text); }
.nr-v2 .nz-sw { position: relative; display: inline-block; flex: 0 0 auto; }
.nr-v2 .nz-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.nr-v2 .nz-sw-track {
    display: block; width: 44px; height: 26px; border-radius: 999px;
    background: #e5e7eb; transition: background .15s ease; cursor: pointer;
}
.nr-v2 .nz-sw-thumb {
    position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px;
    border-radius: 50%; background: var(--bg-card); box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .15s ease;
}
.nr-v2 .nz-sw input:checked + .nz-sw-track { background: #2563eb; }
.nr-v2 .nz-sw input:checked + .nz-sw-track .nz-sw-thumb { transform: translateX(-18px); }

/* ── شارة إرشاد ── */
.nr-v2 .nz-hint-pill {
    background: var(--bg-soft-2); color: #6b7280; border-radius: 10px;
    padding: 10px 12px; font-size: 12.5px; font-weight: 600;
    text-align: center; direction: rtl;
}

/* ── شريط تبويبات V2 (نمط المحرّر) ── */
.nr-v2 .v2tabs {
    display: flex; gap: 22px; direction: rtl; align-items: flex-end;
    border-bottom: 1px solid var(--border); margin: 6px 0 14px;
}
.nr-v2 .v2tabs button {
    flex: 1;
    background: none; border: 0; padding: 10px 2px 9px; cursor: pointer;
    font-size: 14px; font-weight: 800; color: var(--text-3);
    border-bottom: 2.5px solid transparent;
}
.nr-v2 .v2tabs button.on { color: var(--text); border-bottom-color: #2563eb; }

/* ── صفّ منزلق برقمٍ يميناً (اصطلاح V2) ── */
.nr-v2 .nzrow { display: flex; align-items: center; gap: 10px; }
.nr-v2 .nzrow input[type=number] {
    flex: 0 0 80px; width: 80px; padding: 8px; text-align: center;
    border: 1px solid var(--border-2); border-radius: 8px; box-sizing: border-box;
}
.nr-v2 .nzrow input[type=range] { flex: 1; min-width: 0; }

/* ── ذيل القوس: ألوان أزرار التصدير بنمط V2 ── */
.nr-v2 .arc-pro-stl { background: #5D556B; }
.nr-v2 .arc-pro-stl:hover { background: #4a4358; filter: none; }
.nr-v2 .arc-pro-3mf { background: #970090; }
.nr-v2 .arc-pro-3mf:hover { background: #7d0077; }

/* ── معاينة 2D المتجهية للنماذج الثابتة ── */
.nr-v2 .arc2d-wrap {
    background: var(--bg-card);
    background-image: radial-gradient(#e2e8f0 1px, transparent 1.2px);
    background-size: 16px 16px;
    border: 1px solid var(--border); border-radius: 14px;
    padding: 18px; min-height: 320px;
    display: flex; align-items: center; justify-content: center;
}
.nr-v2 .arc2d-wrap svg { width: 100%; max-height: 520px; display: block; }

/* ── FontSelect: منتقي خطوط بمعاينة حيّة (عامّ لكل الصفحات) ── */
.nzfs { position: relative; flex: 1; min-width: 0; }
.nzfs-btn {
    width: 100%; min-height: 46px; display: flex; align-items: center; gap: 10px;
    padding: 6px 12px; background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border-2); border-radius: 12px; cursor: pointer;
    font-size: 19px; box-sizing: border-box;
}
.nzfs-btn:hover { border-color: var(--border-2); }
.nzfs-val { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.5; }
.nzfs-chev { color: var(--text-3); font-size: 11px; flex: 0 0 auto; }
.nzfs-backdrop { position: fixed; inset: 0; z-index: 35; background: transparent; }
.nzfs-panel {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 40;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .14); padding: 6px;
    max-height: 320px; overflow-y: auto;
}
.nzfs-item {
    width: 100%; display: block; text-align: start;
    padding: 9px 12px; background: transparent; border: 0; border-radius: 10px;
    cursor: pointer; font-size: 20px; color: var(--text); line-height: 1.55;
}
.nzfs-item:hover { background: #f7f9ff; }
.nzfs-item.sel { background: var(--bg-tint); color: #2563eb; }
.nzfs-item.nzfs-empty { font-size: 13px; color: #64748b; font-weight: 700; }

/* ── شارة «قريباً» وشبكة طرق التثبيت (نص سطري) ── */
.nz-soon {
    display: inline-block; font-size: 10px; font-weight: 800; color: #92400e;
    background: #fef3c7; border-radius: 999px; padding: 1px 7px; margin-inline-start: 5px;
}
.nr-v2 .nz-mount-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.nr-v2 .nz-mount {
    border: 1px solid var(--border-2); background: var(--bg-card); color: #374151;
    border-radius: 12px; padding: 12px 8px; cursor: pointer;
    font-weight: 800; font-size: 13.5px; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.nr-v2 .nz-mount.on { border: 2px solid #2563eb; background: var(--bg-tint); color: #2563eb; }
.nr-v2 .nz-magcnt {
    flex: 1; border: none; border-radius: 10px; padding: 10px;
    font-weight: 800; font-size: 14px; cursor: pointer; font-family: inherit;
    background: var(--bg-soft-2); color: #6b7280;
}
.nr-v2 .nz-magcnt.on { background: #111827; color: #fff; }

/* ── مساحة العمل (صدفة المعاينة الموحّدة) ── */
.nr-v2 .ws-title { font-weight: 800; font-size: 15px; color: var(--text); margin: 0 2px 8px; }
.nr-v2 .ws-topbar {
    display: flex; direction: rtl; align-items: center; gap: 8px;
    flex-wrap: wrap; margin-bottom: 10px;
}
.nr-v2 .ws-lbl { font-weight: 800; font-size: 14px; color: var(--text); margin-inline-end: 2px; }
.nr-v2 .ws-seg {
    display: flex; background: var(--bg-soft-2); border-radius: 999px; padding: 3px;
}
.nr-v2 .ws-seg button {
    border: 0; background: transparent; color: var(--text-2); cursor: pointer;
    font-weight: 800; font-size: 13px; padding: 6px 16px; border-radius: 999px;
    font-family: inherit;
}
.nr-v2 .ws-seg button.on { background: #0b57d0; color: #fff; }
.nr-v2 .ws-icon {
    width: 45px; height: 42px; border: 1px solid var(--border-2); background: var(--bg-card);
    border-radius: 12px; cursor: pointer; font-size: 21px; color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: inherit;
}
.nr-v2 .ws-icon:hover { border-color: var(--border-2); }
[data-theme="dark"] .nr-v2 .ws-icon.on { border-color: #3b5db8; color: #8ab4ff; }  /* v1149 */
.nr-v2 .ws-icon.on { background: var(--bg-tint); border-color: #c7d2fe; color: #1d4ed8; }
.nr-v2 .ws-spacer { flex: 1; }
.nr-v2 .ws-msg { font-size: 12px; }
.nr-v2 .ws-save {
    display: inline-flex; align-items: center; gap: 7px;
    border: 0; cursor: pointer; color: #fff; font-weight: 800; font-size: 13.5px;
    padding: 10px 18px; border-radius: 12px; font-family: inherit;
    background: linear-gradient(135deg, #2dd4bf, #0d9488);
    box-shadow: 0 4px 12px rgba(13, 148, 136, .25);
}
.nr-v2 .ws-dims {
    display: flex; direction: rtl; align-items: center; gap: 14px; flex-wrap: wrap;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
    padding: 11px 16px; margin: 10px 0 4px; font-size: 13px; color: #334155;
}
.nr-v2 .ws-dims-t { font-weight: 800; color: var(--text); margin-inline-end: 4px; }
.nr-v2 .ws-dims i { width: 1px; height: 16px; background: #e5e7eb; }
.nr-v2 .ws-dims b { color: var(--text); }
/* تصدير V2: حبّتا Pro البنفسجيتان بلا ✨ */
.nr-v2 .nr-export .nz-tt:nth-of-type(1) .button { background: #5D556B !important; border-radius: 11px !important; padding: 11px 16px !important; font-weight: 800 !important; }
.nr-v2 .nr-export .nz-tt:nth-of-type(2) .button { background: #970090 !important; border-radius: 11px !important; padding: 11px 16px !important; font-weight: 800 !important; }
.nr-v2 .nr-export .button > span:first-child { display: none; }

/* حبوب الحالة أسفل مساحة العمل (يسار) */
.nr-v2 .ws-status { display: flex; justify-content: flex-start; margin-top: 10px; }
.nr-v2 .ws-status .status-row { margin: 0; }

/* ── تصدير Pro مستقلّ (صفحات اللوحة/اللوحة المعدنية) ── */
.nr-v2 .ws-export-t { font-weight: 800; color: var(--text); margin-bottom: 8px; }
.nr-v2 .ws-export-row { display: flex; gap: 10px; }
.nr-v2 .ws-pro {
    flex: 1; border: 0; cursor: pointer; color: #fff; font-weight: 800; font-size: 14px;
    padding: 12px; border-radius: 12px; font-family: inherit;
}
.nr-v2 .ws-pro-stl { background: #5D556B; }
.nr-v2 .ws-pro-3mf { background: #970090; }

/* ── ذيل المحرّر V2: شريط واحد (ألوان يمين · تصدير يسار) كنمط المصمّم ── */
.nr-v2 .nr-bottomrow {
    flex-direction: row-reverse; justify-content: space-between; align-items: center;
    background: var(--bg-card); border: 1px solid #ececf0; border-radius: 18px;
    padding: 12px 18px; box-shadow: 0 1px 2px rgba(16,24,40,.05);
    border-top: 1px solid #ececf0; margin-top: 12px; gap: 16px;
}
.nr-v2 .nr-bottomrow .nr-export,
.nr-v2 .nr-bottomrow .nr-colors { flex: 0 0 auto; min-width: 0; }
.nr-v2 .nr-bottomrow .nr-export-label { font-weight: 800; font-size: 18px; color: var(--text); margin-bottom: 0; }
.nr-v2 .nr-bottomrow .nr-export { display: flex; align-items: center; gap: 10px; }
.nr-v2 .nr-bottomrow .nr-export .actions { margin-top: 0 !important; }
.nr-v2 .nr-bottomrow .nr-colors { display: flex; align-items: center; gap: 14px; }
.nr-v2 .nr-bottomrow .nr-colors > div { margin-top: 0 !important; }

/* ── ذيل مساحة العمل الموحّد: ألوان (يمين) · تصدير (يسار) ── */
.nr-v2 .ws-foot {
    position: relative; overflow: visible;
    display: flex; direction: rtl; flex-wrap: wrap; gap: 16px;
    justify-content: space-between; align-items: center;
    background: var(--bg-card); border: 1px solid #ececf0; border-radius: 18px;
    padding: 12px 18px; box-shadow: 0 1px 2px rgba(16,24,40,.05); margin-top: 12px;
}
.nr-v2 .ws-foot-colors,
.nr-v2 .ws-foot-export { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nr-v2 .ws-foot-t { font-weight: 800; font-size: 18px; color: var(--text); }
.nr-v2 .ws-sw { display: flex; align-items: center; gap: 7px; position: relative; }
.nr-v2 .ws-sw span { font-size: 12px; color: #6b7280; }
.nr-v2 .ws-sw input[type=color] {
    width: 34px; height: 34px; padding: 0; border: 1px solid #d1d5db;
    border-radius: 9px; cursor: pointer; background: transparent;
}
.nr-v2 .ws-foot-export .ws-pro {
    border: 0; cursor: pointer; color: #fff; font-weight: 800; font-size: 13px;
    padding: 11px 18px; border-radius: 11px; font-family: inherit;
    white-space: nowrap; min-width: 96px; text-align: center; line-height: 1;
}
.nr-v2 .ws-foot-export .nz-tt { display: inline-flex; }

/* سواتش الذيل الموحّد */
.nr-v2 .ws-sw .nz-swatch { width: 34px; height: 34px; border-radius: 9px; }

/* ═══════════════════════════════════════════════════════════════
   حركات الواجهة — تُدار من /settings/animations
   كل حركةٍ لها بوّابة تعطيل: .anim-off-{key} على جذر التطبيق (.nz-app)
   ═══════════════════════════════════════════════════════════════ */

/* ── ١) رسم أسهم القياس (dims) ── */
.nzdim-line {
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: nzDimDraw .55s ease-out .05s forwards;
}
@keyframes nzDimDraw { to { stroke-dashoffset: 0; } }
.nzdim-pill {
    opacity: 0; transform-box: fill-box; transform-origin: center;
    animation: nzDimPop .32s cubic-bezier(.34,1.56,.64,1) .5s both;
}
@keyframes nzDimPop { from { opacity: 0; transform: scale(.45); } to { opacity: 1; transform: scale(1); } }
.anim-off-dims .nzdim-line { animation: none; stroke-dashoffset: 0; }
.anim-off-dims .nzdim-pill { animation: none; opacity: 1; }

/* ── ٢) التبويبات (tabs): الخطّ النشط ينمو + دخول المحتوى ── */
.nr-tabs button, .nr-v2 .v2tabs button { position: relative; }
.nr-tabs button.on { border-bottom-color: transparent !important; }
.nr-v2 .v2tabs button.on { border-bottom-color: transparent !important; }
.nr-tabs button::after, .nr-v2 .v2tabs button::after {
    content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2.5px; border-radius: 2px;
    transform: scaleX(0); transform-origin: center;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.nr-tabs button::after { background: #16a34a; }
.nr-v2 .v2tabs button::after { background: #2563eb; }
.nr-tabs button.on::after, .nr-v2 .v2tabs button.on::after { transform: scaleX(1); }
.nr-v2 .field, .nr-v2 .nz-sw-row, .nr-v2 .nz-hint-pill, .nr-v2 .nz-mount-grid {
    animation: nzTabIn .22s ease backwards;
}
@keyframes nzTabIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.anim-off-tabs .nr-tabs button::after,
.anim-off-tabs .v2tabs button::after { transition: none; }
.anim-off-tabs .nr-v2 .field,
.anim-off-tabs .nr-v2 .nz-sw-row,
.anim-off-tabs .nr-v2 .nz-hint-pill,
.anim-off-tabs .nr-v2 .nz-mount-grid { animation: none; }

/* ── ٣) القوائم المنسدلة ومنتقي الخطوط (dropdowns) ── */
.nr-v2 .nz-dd-panel, .nzfs-panel {
    transform-origin: top center;
    animation: nzDdPop .22s cubic-bezier(.34,1.56,.64,1) backwards;
}
@keyframes nzDdPop { from { opacity: 0; transform: scale(.88) translateY(-6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.nzfs-item { animation: nzRowIn .26s ease backwards; }
@keyframes nzRowIn { from { opacity: 0; transform: translateX(-7px); } to { opacity: 1; transform: none; } }
.nzfs-item:nth-child(1) { animation-delay: .02s; }
.nzfs-item:nth-child(2) { animation-delay: .05s; }
.nzfs-item:nth-child(3) { animation-delay: .08s; }
.nzfs-item:nth-child(4) { animation-delay: .11s; }
.nzfs-item:nth-child(5) { animation-delay: .14s; }
.nzfs-item:nth-child(6) { animation-delay: .17s; }
.nzfs-item:nth-child(7) { animation-delay: .19s; }
.nzfs-item:nth-child(8) { animation-delay: .21s; }
.nzfs-item:nth-child(9) { animation-delay: .23s; }
.nzfs-item:nth-child(10) { animation-delay: .25s; }
.nzfs-item:nth-child(n+11) { animation-delay: .26s; }
.anim-off-dropdowns .nz-dd-panel,
.anim-off-dropdowns .nzfs-panel { animation: none; }
.anim-off-dropdowns .nzfs-item { animation: none; }

/* ── ٤) دخول المجسّم (model3d) — فئة تُضاف من preview.js عند توليدٍ جديد ── */
.nz3d-in { animation: nz3dIn .45s cubic-bezier(.22,1,.36,1); }
@keyframes nz3dIn { from { opacity: .25; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.anim-off-model3d .nz3d-in { animation: none; }

/* ── ٥) تأكيد الحفظ (save) + دخول عناصر المكتبة ── */
.ws-save-done {
    animation: nzSavePulse .55s cubic-bezier(.34,1.56,.64,1);
    background: linear-gradient(135deg, #34d399, #059669) !important;
}
@keyframes nzSavePulse { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }
.lib-item { animation: nzLibIn .3s cubic-bezier(.34,1.56,.64,1) backwards; }
@keyframes nzLibIn { from { opacity: 0; transform: scale(.82) translateY(6px); } to { opacity: 1; transform: none; } }
.anim-off-save .ws-save-done {
    animation: none;
    background: linear-gradient(135deg, #2dd4bf, #0d9488) !important;
}
.anim-off-save .lib-item { animation: none; }

/* ── ٦) لوحة الألوان (palette) — بوّابة حركة v890 القائمة ── */
.anim-off-palette .nz-pal { animation: none; }
.anim-off-palette .nz-pal button { animation: none; opacity: 1; transform: none; }

/* ── احترام تفضيل «تقليل الحركة» في النظام ── */
@media (prefers-reduced-motion: reduce) {
    .nzdim-line, .nzdim-pill,
    .nr-v2 .field, .nr-v2 .nz-sw-row, .nr-v2 .nz-hint-pill, .nr-v2 .nz-mount-grid,
    .nz-dd-panel, .nzfs-panel, .nzfs-item,
    .nz3d-in, .ws-save-done, .lib-item,
    .nz-pal, .nz-pal button { animation: none !important; }
    .nr-tabs button::after, .v2tabs button::after { transition: none !important; }
    .nzdim-line { stroke-dashoffset: 0 !important; }
    .nzdim-pill, .nz-pal button, .nzfs-item { opacity: 1 !important; transform: none !important; }
}

/* ── ٧) معاينة 2D (preview2d): تلاشٍ عند التجديد + لمعان أثناء الانشغال ── */
.nz2d-in { animation: nz2dIn .3s ease; }
@keyframes nz2dIn { from { opacity: .35; transform: scale(.995); } to { opacity: 1; transform: none; } }
.nz2d-busy { position: relative; overflow: hidden; }
.nz2d-busy::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.6) 50%, transparent 60%);
    background-size: 220% 100%;
    animation: nzShimmer 1.15s linear infinite;
}
@keyframes nzShimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
.anim-off-preview2d .nz2d-in { animation: none; }
.anim-off-preview2d .nz2d-busy::after { animation: none; opacity: 0; }

/* ── ٨) حبوب الحالة (status): اهتزاز تنبيهي عند الانفصال + انتقال لوني ── */
.status-row .ok, .status-row .bad {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.status-row .bad { animation: nzShake .5s cubic-bezier(.36,.07,.19,.97); }
@keyframes nzShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}
.anim-off-status .status-row .ok,
.anim-off-status .status-row .bad { transition: none; animation: none; }

/* ── ٩) شبكة التثبيت (mount): نبضة مرنة عند الاختيار ── */
.nr-v2 .nz-mount.on, .nr-v2 .nz-magcnt.on { animation: nzSpring .35s cubic-bezier(.34,1.56,.64,1); }
.nr-v2 .nz-mount:active, .nr-v2 .nz-magcnt:active { transform: scale(.95); }
@keyframes nzSpring { 0% { transform: scale(.92); } 55% { transform: scale(1.05); } 100% { transform: scale(1); } }
.anim-off-mount .nz-mount.on, .anim-off-mount .nz-magcnt.on { animation: none; }
.anim-off-mount .nz-mount:active, .anim-off-mount .nz-magcnt:active { transform: none; }

/* ── ١٠) تجهيز التصدير (export): لمعان داخل الحبّة ── */
.nz-exporting { position: relative; overflow: hidden; pointer-events: none; opacity: .92; }
.nz-exporting::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.45) 50%, transparent 60%);
    background-size: 220% 100%;
    animation: nzShimmer 1.1s linear infinite;
}
.anim-off-export .nz-exporting { pointer-events: auto; opacity: 1; }
.anim-off-export .nz-exporting::after { animation: none; opacity: 0; }

/* (holeghost يُدار من JS بقراءة .anim-off-holeghost على الجذر) */

/* توسيع احترام تقليل الحركة للخمس الجديدة */
@media (prefers-reduced-motion: reduce) {
    .nz2d-in, .nz2d-busy::after,
    .status-row .bad,
    .nz-mount.on, .nz-magcnt.on,
    .nz-exporting::after { animation: none !important; }
    .status-row .ok, .status-row .bad { transition: none !important; }
}

/* ── ١١) انتقال الصفحات (pagenav) ── */
.nz-page { animation: nzPageIn .28s cubic-bezier(.22,1,.36,1) backwards; }
@keyframes nzPageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.anim-off-pagenav .nz-page { animation: none; }

/* ── ١٢) الدُرج الجانبي (drawer) ── */
.nz-nav-wrap { transition-timing-function: cubic-bezier(.22,1,.36,1); transition-duration: .32s; }
.nz-overlay.show { animation: nzOverlayIn .25s ease backwards; }
@keyframes nzOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.nz-nav-wrap.open .nz-nav-link { animation: nzNavLinkIn .3s ease backwards; }
@keyframes nzNavLinkIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.nz-nav-wrap.open .nz-nav-link:nth-of-type(1) { animation-delay: .03s; }
.nz-nav-wrap.open .nz-nav-link:nth-of-type(2) { animation-delay: .06s; }
.nz-nav-wrap.open .nz-nav-link:nth-of-type(3) { animation-delay: .09s; }
.nz-nav-wrap.open .nz-nav-link:nth-of-type(4) { animation-delay: .12s; }
.nz-nav-wrap.open .nz-nav-link:nth-of-type(5) { animation-delay: .15s; }
.nz-nav-wrap.open .nz-nav-link:nth-of-type(6) { animation-delay: .18s; }
.nz-nav-wrap.open .nz-nav-link:nth-of-type(7) { animation-delay: .21s; }
.nz-nav-wrap.open .nz-nav-link:nth-of-type(8) { animation-delay: .24s; }
.nz-nav-wrap.open .nz-nav-link:nth-of-type(n+9) { animation-delay: .26s; }
.anim-off-drawer .nz-nav-wrap { transition-duration: .26s; transition-timing-function: ease; }
.anim-off-drawer .nz-overlay.show { animation: none; }
.anim-off-drawer .nz-nav-wrap.open .nz-nav-link { animation: none; }

/* ── ١٣) بطاقات صفحة المكتبة (library) ── */
.libp-card {
    animation: nzLibIn .3s cubic-bezier(.34,1.56,.64,1) backwards;
    transition: transform .18s ease, box-shadow .18s ease;
}
.libp-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,23,42,.10); }
.libp-card:nth-child(1) { animation-delay: .02s; }
.libp-card:nth-child(2) { animation-delay: .05s; }
.libp-card:nth-child(3) { animation-delay: .08s; }
.libp-card:nth-child(4) { animation-delay: .11s; }
.libp-card:nth-child(5) { animation-delay: .14s; }
.libp-card:nth-child(6) { animation-delay: .17s; }
.libp-card:nth-child(7) { animation-delay: .19s; }
.libp-card:nth-child(8) { animation-delay: .21s; }
.libp-card:nth-child(9) { animation-delay: .23s; }
.libp-card:nth-child(10) { animation-delay: .25s; }
.libp-card:nth-child(n+11) { animation-delay: .26s; }
.libp-card.libp-out { animation: nzCardOut .26s ease forwards; pointer-events: none; }
@keyframes nzCardOut { to { opacity: 0; transform: scale(.85); } }
.anim-off-library .libp-card { animation: none; transition: none; }
.anim-off-library .libp-card:hover { transform: none; box-shadow: none; }
.anim-off-library .libp-card.libp-out { animation: none; opacity: .3; }

/* ── ١٤) المنزلقات (sliders): إبهام حيّ + فقاعة قيمة ── */
input[type=range]::-webkit-slider-thumb { transition: transform .16s cubic-bezier(.34,1.56,.64,1); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.3); }
input[type=range]::-moz-range-thumb { transition: transform .16s cubic-bezier(.34,1.56,.64,1); }
input[type=range]:active::-moz-range-thumb { transform: scale(1.3); }
.nz-slider-bubble {
    position: fixed; z-index: 9998; pointer-events: none; direction: ltr;
    background: #111827; color: #fff; font-weight: 800; font-size: 12px;
    padding: 4px 10px; border-radius: 8px;
    opacity: 0; transform: translate(-50%, 4px) scale(.6);
    transition: opacity .15s ease, transform .18s cubic-bezier(.34,1.56,.64,1);
}
.nz-slider-bubble::after {
    content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--text);
}
.nz-slider-bubble.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.anim-off-sliders input[type=range]:active::-webkit-slider-thumb { transform: none; }
.anim-off-sliders input[type=range]:active::-moz-range-thumb { transform: none; }

/* توسيع reduced-motion للدفعة الثالثة */
@media (prefers-reduced-motion: reduce) {
    .nz-page, .nz-overlay.show, .nz-nav-wrap.open .nz-nav-link,
    .libp-card, .libp-card.libp-out { animation: none !important; }
    .nz-nav-wrap { transition: none !important; }
    .libp-card, input[type=range]::-webkit-slider-thumb, input[type=range]::-moz-range-thumb { transition: none !important; }
    .nz-slider-bubble { display: none !important; }
}

/* ── ١٥) منتقي الرموز (symbols) ── */
.picker-menu { transform-origin: top center; animation: nzDdPop .22s cubic-bezier(.34,1.56,.64,1) backwards; }
.picker-item { animation: nzRowIn .24s ease backwards; }
.picker-item:nth-child(1) { animation-delay: .02s; }
.picker-item:nth-child(2) { animation-delay: .05s; }
.picker-item:nth-child(3) { animation-delay: .08s; }
.picker-item:nth-child(4) { animation-delay: .11s; }
.picker-item:nth-child(5) { animation-delay: .14s; }
.picker-item:nth-child(6) { animation-delay: .16s; }
.picker-item:nth-child(7) { animation-delay: .18s; }
.picker-item:nth-child(8) { animation-delay: .20s; }
.picker-item:nth-child(9) { animation-delay: .22s; }
.picker-item:nth-child(10) { animation-delay: .24s; }
.picker-item:nth-child(n+11) { animation-delay: .25s; }
.picker-item.selected { animation: nzSpring .3s cubic-bezier(.34,1.56,.64,1); }
.anim-off-symbols .picker-menu, .anim-off-symbols .picker-item,
.anim-off-symbols .picker-item.selected { animation: none; }

/* ── ١٦) مناطق الرفع (upload) ── */
.nz-dz-over {
    outline: 2px dashed #2563eb; outline-offset: 3px; border-radius: 12px;
    animation: nzDzPulse .9s ease infinite;
}
@keyframes nzDzPulse { 0%, 100% { outline-color: #2563eb; } 50% { outline-color: #93c5fd; } }
*:has(> .file-overlay) { transition: transform .15s cubic-bezier(.34,1.56,.64,1); }
*:has(> .file-overlay):hover { transform: scale(1.06); }
.anim-off-upload .nz-dz-over { animation: none; outline: none; }
.anim-off-upload *:has(> .file-overlay):hover { transform: none; }

/* ── ١٧) عدّادات النص (counters) ── */
.nz-cnt { display: inline-block; animation: nzCntIn .22s cubic-bezier(.34,1.56,.64,1); }
@keyframes nzCntIn { from { opacity: 0; transform: translateY(7px) scale(.85); } to { opacity: 1; transform: none; } }
.anim-off-counters .nz-cnt { animation: none; }

/* ── ١٨) رسائل الحالة (toasts) ── */
.ws-msg { display: inline-block; animation: nzMsgIn .3s cubic-bezier(.34,1.56,.64,1) backwards; }
@keyframes nzMsgIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.anim-off-toasts .ws-msg { animation: none; }

/* ── ١٩) بطاقات الإعدادات (settingscards) ── */
.settings-card { animation: nzTabIn .28s ease backwards; }
.settings-card:nth-child(1) { animation-delay: .03s; }
.settings-card:nth-child(2) { animation-delay: .07s; }
.settings-card:nth-child(3) { animation-delay: .11s; }
.settings-card:nth-child(4) { animation-delay: .15s; }
.settings-card:nth-child(5) { animation-delay: .19s; }
.settings-card:nth-child(6) { animation-delay: .22s; }
.settings-card:nth-child(n+7) { animation-delay: .24s; }
.settings-icon { transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
.settings-card:hover .settings-icon { transform: rotate(-8deg) scale(1.08); }
.anim-off-settingscards .settings-card { animation: none; }
.anim-off-settingscards .settings-card:hover .settings-icon { transform: none; }

/* توسيع reduced-motion للدفعة الرابعة */
@media (prefers-reduced-motion: reduce) {
    .picker-menu, .picker-item, .picker-item.selected,
    .nz-dz-over, .nz-cnt, .ws-msg, .settings-card { animation: none !important; }
    .settings-icon, *:has(> .file-overlay) { transition: none !important; }
}

/* ── ٢٠) تموّج الأزرار (ripple) ── */
.ws-save, .ws-pro, .arc-pro-btn, .nr-v2 .nz-mount, .nr-v2 .nz-magcnt, .nr-v2 .ws-seg button {
    position: relative; overflow: hidden;
}
.nz-ripple {
    position: absolute; border-radius: 50%; pointer-events: none;
    background: rgba(255,255,255,.45); transform: scale(0);
    animation: nzRipple .55s ease-out forwards;
}
.nr-v2 .ws-seg button:not(.on) .nz-ripple { background: rgba(37,99,235,.22); }
@keyframes nzRipple { to { transform: scale(1); opacity: 0; } }
.anim-off-ripple .nz-ripple { display: none; }

/* ── ٢١) هيكل تحميل المكتبة (skeleton) ── */
.libsk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.libsk-card {
    background: var(--bg-card, #fff); border: 1px solid var(--border, var(--border-2));
    border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.libsk-thumb, .libsk-line {
    border-radius: 8px;
    background: linear-gradient(105deg, #eef1f5 40%, #f8fafc 50%, #eef1f5 60%);
    background-size: 220% 100%;
    animation: nzShimmer 1.15s linear infinite;
}
.libsk-thumb { height: 120px; }
.libsk-line { height: 13px; }
.libsk-line.short { width: 55%; }
.anim-off-skeleton .libsk-thumb, .anim-off-skeleton .libsk-line { animation: none; background: #eef1f5; }

/* ── ٢٢) توهّج التركيز (focusglow) ── */
.nr-v2 input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]),
.nr-v2 textarea, .nr-v2 select,
.nzfs-btn, .nr-v2 .nz-dd-btn {
    transition: border-color .18s ease, box-shadow .18s ease;
}
.nr-v2 input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):focus,
.nr-v2 textarea:focus, .nr-v2 select:focus,
.nzfs-btn:focus, .nr-v2 .nz-dd-btn:focus {
    outline: none; border-color: #2563eb;
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, .13);
}
.anim-off-focusglow .nr-v2 input:focus, .anim-off-focusglow .nr-v2 textarea:focus,
.anim-off-focusglow .nr-v2 select:focus, .anim-off-focusglow .nzfs-btn:focus,
.anim-off-focusglow .nr-v2 .nz-dd-btn:focus {
    transition: none; box-shadow: 0 0 0 2px rgba(37, 99, 235, .35);
}

/* ── ٢٣) قوائم الرأس (headermenus) ── */
.nz-dropdown { transform-origin: top center; animation: nzDdPop .22s cubic-bezier(.34,1.56,.64,1) backwards; }
.nz-icon-btn { transition: transform .13s ease; }
.nz-icon-btn:active { transform: scale(.88); }
.anim-off-headermenus .nz-dropdown { animation: none; }
.anim-off-headermenus .nz-icon-btn:active { transform: none; }

/* ── ٢٤) لمساتٌ دقيقة (micro) ── */
.nz-plate-ic { display: inline-block; animation: nzPlateSpin .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes nzPlateSpin { from { transform: rotate(-180deg) scale(.55); opacity: .3; } to { transform: none; opacity: 1; } }
.nr-v2 .ws-seg button.on { animation: nzSpring .3s cubic-bezier(.34,1.56,.64,1); }
.nr-v2 .ws-icon { transition: transform .13s ease; }
.nr-v2 .ws-icon:active { transform: scale(.9); }
.anim-off-micro .nz-plate-ic { animation: none; }
.anim-off-micro .ws-seg button.on { animation: none; }
.anim-off-micro .ws-icon:active { transform: none; }

/* reduced-motion للدفعة الخامسة */
@media (prefers-reduced-motion: reduce) {
    .nz-ripple { display: none !important; }
    .libsk-thumb, .libsk-line, .nz-plate-ic, .ws-seg button.on { animation: none !important; }
    .nr-v2 input, .nr-v2 textarea, .nr-v2 select, .nzfs-btn, .nr-v2 .nz-dd-btn, .ws-icon, .nz-icon-btn { transition: none !important; }
    .nz-dropdown { animation: none !important; }
}

/* ── تحصين التراصّ: الحاوية ذات اللوحة المفتوحة تعلو أشقّاءها ── */
.nzfs:has(> .nzfs-panel) { z-index: 46; }
.nr-v2 .nz-dd:has(> .nz-dd-panel) { z-index: 46; }
.nr-v2 .ws-sw:has(> .nz-pal) { z-index: 46; }
.symbol-picker:has(.picker-menu) { position: relative; z-index: 46; }

/* ── شارة «اسم النموذج» أعلى لوحة التحكم ── */
.nr-v2 .nz-modelname { margin-bottom: 12px; }
.nr-v2 .nz-modelname label { display: block; font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 7px; }
[data-theme="dark"] .nr-v2 .nz-modelname-badge { background: var(--bg-tint); border-color: #2a3d5e; color: #8ab4ff; }  /* v1148 */
.nr-v2 .nz-modelname-badge {
    width: 100%; box-sizing: border-box; text-align: center;
    background: #eef4ff; border: 1.5px solid #cfdcff; color: #0b57d0;
    border-radius: 12px; padding: 11px 12px; font-weight: 800; font-size: 15px;
}

/* ── خلفية معاينة 2D (زرّ ◐ في وضع 2D): أبيض → رمادي → أسود ── */
.nr-v2 .svg-wrap, .nr-v2 .arc2d-wrap { transition: background-color .25s ease; }
/* v973: خلفيّة 3D تطابق 2D — النقاط الفاتحة افتراضاً، وbg2d-gray/black تتغلبان عند التفعيل */
.nr-v2 .canvas-wrap.nz-ws-dots { background: radial-gradient(#e6e6ef 1.1px, transparent 1.2px) 0 0/22px 22px #fbfbfd; }
html[data-theme="dark"] .nr-v2 .canvas-wrap.nz-ws-dots { background: radial-gradient(#4d5666 1.1px, transparent 1.2px) 0 0/22px 22px #12161d; }  /* v1153 */
/* v1154: الوضعان اليدويان لزر ◐ — كانا صنفين بلا تعريف (زرٌّ ميت بصرياً) */
.nr-v2 .canvas-wrap.nz-ws-dots.bg2d-white,
.nr-v2 .svg-wrap.bg2d-white { background: radial-gradient(#e6e6ef 1.1px, transparent 1.2px) 0 0/22px 22px #fbfbfd !important; }  /* v1156 */
.nr-v2 .canvas-wrap.nz-ws-dots.bg2d-gray,
.nr-v2 .svg-wrap.bg2d-gray { background: radial-gradient(#c9cfd8 1.1px, transparent 1.2px) 0 0/22px 22px #e8ebf0 !important; }
.nr-v2 .canvas-wrap.nz-ws-dots.bg2d-black,
.nr-v2 .svg-wrap.bg2d-black { background: radial-gradient(#4d5666 1.1px, transparent 1.2px) 0 0/22px 22px #12161d !important; }

/* v1258: خلفية «متحركة» — بتلاتٌ متساقطة (ساكورا). طبقتان من بتلات SVG
   مضمّنةٍ في CSS تهبطان بميلٍ هادئ بسرعتين مختلفتين (عمقٌ حقيقي)، والحلقة
   مُحكمةٌ لأن إزاحة كل طبقةٍ عند 100% مضاعِفٌ صحيحٌ لبلاطتها. الحِمل على
   مركّب GPU وحده — لا JavaScript ولا إعادة رسم. */
.nr-v2 .canvas-wrap.nz-ws-dots.bg2d-motion,
.nr-v2 .svg-wrap.bg2d-motion {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23e894ac' fill-opacity='.55' transform='translate(28 30) rotate(35) scale(1.0)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23f2b3c4' fill-opacity='.5' transform='translate(105 70) rotate(-20) scale(0.8)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23e17d9d' fill-opacity='.45' transform='translate(60 120) rotate(60) scale(1.1)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23e894ac' fill-opacity='.5' transform='translate(130 135) rotate(15) scale(0.7)'/></svg>") 0 0/150px 150px,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23f2b3c4' fill-opacity='.35' transform='translate(70 60) rotate(25) scale(1.9)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23e894ac' fill-opacity='.3' transform='translate(220 140) rotate(-35) scale(2.3)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23e17d9d' fill-opacity='.32' transform='translate(140 250) rotate(50) scale(1.7)'/></svg>") 0 0/300px 300px,
    linear-gradient(180deg, #fdf8f7, #faf3f5);
  animation: nzPetals 34s linear infinite;
  will-change: background-position;
}
html[data-theme="dark"] .nr-v2 .canvas-wrap.nz-ws-dots.bg2d-motion,
html[data-theme="dark"] .nr-v2 .svg-wrap.bg2d-motion {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23e9a0c0' fill-opacity='.55' transform='translate(28 30) rotate(35) scale(1.0)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23c98bd8' fill-opacity='.5' transform='translate(105 70) rotate(-20) scale(0.8)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23f0b7cf' fill-opacity='.45' transform='translate(60 120) rotate(60) scale(1.1)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23e9a0c0' fill-opacity='.5' transform='translate(130 135) rotate(15) scale(0.7)'/></svg>") 0 0/150px 150px,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23c98bd8' fill-opacity='.35' transform='translate(70 60) rotate(25) scale(1.9)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23e9a0c0' fill-opacity='.3' transform='translate(220 140) rotate(-35) scale(2.3)'/><path d='M0 -9 C6 -5 6 5 0 9 C-6 5 -6 -5 0 -9' fill='%23f0b7cf' fill-opacity='.32' transform='translate(140 250) rotate(50) scale(1.7)'/></svg>") 0 0/300px 300px,
    linear-gradient(180deg, #191024, #130d1d);
  animation: nzPetals 34s linear infinite;
  will-change: background-position;
}
@keyframes nzPetals {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: -150px 600px, -300px 300px, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .nr-v2 .bg2d-motion { animation: none !important; }
}
html[data-theme="dark"] .nr-v2 .svg-wrap:not(.bg2d-gray):not(.bg2d-black):not(.bg2d-motion) { background: radial-gradient(#4d5666 1.1px, transparent 1.2px) 0 0/22px 22px #12161d; }  /* v1155 */
.nr-v2 .bg2d-gray { background: #d8dbe0 !important; }
.nr-v2 .bg2d-black { background: #17181c !important; }

/* ── هيكل تحميل صفحات النماذج (skeleton — غطاءٌ فوق المحتوى المتهيّئ) ── */
.nr-root { position: relative; }
.grid.nr-v2 { position: relative; }
.lp-grid { position: relative; }
.grid { position: relative; }
.wssk-ov { position: absolute; inset: 0; z-index: 50; background: var(--bg, #f6f7f9); }
/* شبكة الهيكل تحاكي شبكة الصفحة الحقيقية: التحكّم (380px) يميناً والمعاينة يساراً.
   الاتجاه ltr يضع العمود الأول (المعاينة 1fr) يساراً، بينما تبقى البطاقتان rtl داخلياً. */
.wssk-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; direction: ltr; }
@media (max-width: 980px) {
    .wssk-grid { grid-template-columns: 1fr; }
    .wssk-panel { order: -1; }   /* على الجوال: التحكّم أولاً كالصفحة الحقيقية */
}
.wssk-main, .wssk-panel {
    background: var(--bg-card); border: 1px solid #ececf0; border-radius: 18px;
    padding: 16px; display: flex; flex-direction: column; gap: 12px;
    direction: rtl;
}
.wssk-row { display: flex; align-items: center; gap: 8px; }
.wssk-sp { flex: 1; }
.wssk-pill, .wssk-canvas, .wssk-bar, .wssk-line, .wssk-tabs i {
    border-radius: 10px;
    background: linear-gradient(105deg, #eef1f5 40%, #f8fafc 50%, #eef1f5 60%);
    background-size: 220% 100%;
    animation: nzShimmer 1.15s linear infinite;
}
.wssk-pill { height: 38px; width: 64px; border-radius: 11px; }
.wssk-pill.sq { width: 45px; height: 42px; }
.wssk-pill.teal { background: linear-gradient(105deg, #c9ece7 40%, #e2f6f3 50%, #c9ece7 60%); background-size: 220% 100%; }
.wssk-canvas { height: 380px; border-radius: 14px; }
.wssk-bar { height: 44px; border-radius: 14px; }
.wssk-tabs { display: flex; gap: 14px; }
.wssk-tabs i { display: block; flex: 1; height: 34px; }
.wssk-line { height: 42px; }
.wssk-line.short { width: 60%; }
.anim-off-skeleton .wssk-pill, .anim-off-skeleton .wssk-canvas, .anim-off-skeleton .wssk-bar,
.anim-off-skeleton .wssk-line, .anim-off-skeleton .wssk-tabs i { animation: none; background: #eef1f5; }
@media (prefers-reduced-motion: reduce) {
    .wssk-pill, .wssk-canvas, .wssk-bar, .wssk-line, .wssk-tabs i { animation: none !important; }
}

/* ═══ صفّ رقم+منزلق الموحّد (v934) — عالميّ، محصّن ضد قواعد العرض العامة ═══ */
.nz-nr { display: flex !important; align-items: center; gap: 12px; }
.nz-nr input[type=number] {
    width: 68px !important; flex: 0 0 68px; text-align: center; padding: 9px 4px;
    border: 1px solid var(--border-2); border-radius: 10px; box-sizing: border-box;
    font-weight: 800; font-size: 15px; font-family: inherit;
}
.nz-nr input[type=range] { width: auto !important; flex: 1 1 auto; min-width: 0;  accent-color: var(--text) !important;}


.ws-mname { display: none; }

/* ═══ v991: لمعة شعار الموقع — كلّ ٣٠ ثانية وعند التحويم (تعطيل: anim-off-logoshine) ═══ */
.nz-logo-wrap { position: relative; display: inline-block; overflow: hidden;
    border-radius: 10px; line-height: 0; }
.nz-logo-wrap::after {
    content: ''; position: absolute; top: -30%; bottom: -30%; width: 45%; left: -70%;
    background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,.08) 30%,
        rgba(255,255,255,.9) 50%, rgba(255,255,255,.08) 70%, transparent 100%);
    transform: skewX(-18deg); pointer-events: none;
    animation: nzLogoShine 30s linear infinite;
}
.nz-logo-wrap:hover::after { animation: nzLogoShineHover .8s ease-out; }
@keyframes nzLogoShine { 0% { left: -70%; } 3.2% { left: 170%; } 100% { left: 170%; } }
@keyframes nzLogoShineHover { from { left: -70%; } to { left: 170%; } }
.anim-off-logoshine .nz-logo-wrap::after { animation: none; content: none; }
@media (prefers-reduced-motion: reduce) { .nz-logo-wrap::after { animation: none; content: none; } }
.nz-mob-only { display: none; }
.nz-htitle { display: none; }


/* v981: أساس الشبكة هنا (ملف خام) — لا اعتماد على أنماط المكوّن للتخطيط */
.nr-grid { display: grid !important; grid-template-columns: 340px 300px 1fr 200px; gap: 18px; align-items: start; }

/* ═══════════════ الجوّال (v981): معاينة لاصقة 40% أعلى + تحكم 60% أسفل ═══════════════ */
@media (max-width: 1100px) {
    /* clip لا يكسر sticky (بخلاف hidden الذي يعطّله — علّة v980) */
    .nr-root { overflow-x: clip; padding: 4px 4px 88px !important; }   /* أسفلها شريط السلة الثابت */
    /* v986: استغلال الهوامش — الحاويتان العلويّتان بلا حشوٍ على الجوّال */
    .nz-main, .nz-page { padding: 0 !important; margin: 0 !important; }
    /* v982: مطرقة اللاأدريّة — التخطيط يستقيم سواءٌ حُسبت الشبكة grid أم flex خفيّاً:
       كلّ لوحةٍ سطرٌ كامل العرض، مع إبطال flex:1 القديم على لوحة المعاينة قسراً. */
    /* v983: القاعدة الجراحية — تقهر «display:flex !important» القديمة في المكوّن
       (NewLayoutEditor:1386، تحديد 0,2,0) بتحديدٍ أعلى (0,2,1) فتعود الشبكة grid. */
    .nr-root.nr-v2 .nr-grid,
    .nr-grid { display: grid !important; grid-template-columns: 1fr !important;
        grid-auto-flow: row; gap: 10px !important; flex-wrap: wrap; }
    .nr-grid > * { min-width: 0; width: 100% !important; box-sizing: border-box; }
    .nr-preview-panel { flex: 0 0 auto !important; }

    /* فيض المحتوى الداخلي يُقصّ داخل بطاقته لا خارج الشاشة، والحقول تنكمش */
    .nr-panel { overflow-x: clip; }
    .nr-panel input, .nr-panel select, .nr-panel textarea { min-width: 0; max-width: 100%; }
    .nz-hintg { white-space: normal; }


    /* مكتبتي: مخفية مؤقتاً على الجوّال (بطلب أحمد — v980) */
    #libPanel { display: none !important; }

    /* 1) المعاينة أولاً — لاصقة بأعلى الشاشة بارتفاع 40% وتُمرَّر لوحات التحكم تحتها */
    .nr-preview-panel,
    .card.preview,
    .lp-preview { scrollbar-width: none; }
    .nr-preview-panel::-webkit-scrollbar,
    .card.preview::-webkit-scrollbar,
    .lp-preview::-webkit-scrollbar { display: none; }

    .nr-preview-panel { order: -1; position: sticky; top: 4px; z-index: 40;
        transition: height .28s ease;
        padding: 8px 10px 6px !important;
        height: 40vh; height: var(--nz-pvh, 40dvh); overflow-y: auto; overflow-x: hidden;
        box-shadow: 0 14px 26px -16px rgba(0,0,0,.35); }
    .nr-preview-panel .svg-wrap,
    .nr-preview-panel .canvas-wrap { min-height: 0 !important; height: calc(40dvh - 84px); }
    .nr-preview-panel .preview-svg,
    .nr-preview-panel #preview3dCanvas { height: 100% !important; }

    /* v997: مساحة عمل الجوّال — المعاينة + [🔖 ◐ 3D|2D] + سطر الأبعاد */
    .nr-preview-panel .ws-title,
    .nr-preview-panel .ws-lbl,
    .nr-preview-panel .ws-spacer,
    .nr-preview-panel .ws-msg,
    .nr-preview-panel .nr-bottomrow,
    .nr-preview-panel .ws-status { display: none !important; }
    .nr-preview-panel .ws-icon { display: none !important; }
    .nr-root.nr-v2 .nr-preview-panel .ws-icon[title^="الخلفية"] { display: inline-flex !important;
        width: 32px !important; height: 32px !important; min-width: 0 !important; min-height: 0 !important;
        padding: 0 !important; font-size: 15px !important; border-radius: 9px !important;
        align-items: center; justify-content: center; }
    .nr-preview-panel .ws-save { display: inline-flex !important;
        width: 32px !important; height: 32px !important; min-width: 0 !important;
        padding: 0 !important; border: 0 !important; border-radius: 9px !important;
        align-items: center; justify-content: center; overflow: visible !important;
        background: #14b8a6 !important; box-shadow: 0 2px 8px rgba(20,184,166,.4); }
    .nr-preview-panel .ws-save:active { transform: scale(.93); }
    /* v1003: تقهر قاعدة المعرّف القديمة (#libSaveBtn 9px 16px/#0FA3B1) التي كانت
       تصفّر عرض المحتوى فتُخفي كل أيقونة — تحديد (1,2,0) ضد (1,1,0) */
    .nr-v2 #libSaveBtn.ws-save { padding: 0 !important; width: 32px !important;
        height: 32px !important; min-height: 0 !important; border-radius: 9px !important;
        background: #14b8a6 !important; box-shadow: 0 2px 8px rgba(20,184,166,.4) !important; }
    .nr-v2 #libSaveBtn.ws-save.ws-save-done { background: #10b981 !important; }
    .nr-preview-panel .ws-save span { display: none; }
    /* v1002: الأيقونة المحصّنة (سمات inline) — كل svg آخر داخل الزر مخفي */
    .nr-preview-panel .ws-save svg { display: none !important; }
    .nr-preview-panel .ws-save svg.nz-msave-ic { display: block !important; }
    .nr-preview-panel .ws-save.ws-save-done { background: #10b981; }
    /* v1006: سطر الأبعاد — مخفيٌّ افتراضياً، تُظهره الإدارة (الإعدادات ← نسخة الجوّال) */
    .nr-preview-panel .ws-dims { display: none !important; }
    .mob-on-dims .nr-preview-panel .ws-dims { display: flex !important; justify-content: center;
        gap: 12px; flex-wrap: wrap; padding: 6px 2px 0; font-size: 12.5px; }
    .nr-preview-panel .ws-topbar { justify-content: center; margin-bottom: 6px; }

    /* v997: صفّ التحكم فوق المعاينة — [🔖 ◐] … [3D|2D] كالمخطط */
    .nr-preview-panel .ws-topbar { position: static; transform: none; left: auto; width: auto;
        margin: 0 0 6px; background: transparent;
        display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
    .nr-preview-panel .ws-seg { order: 1; margin-inline-start: 0; }
    .nr-preview-panel .ws-icon[title^="الخلفية"] { order: 2; margin-inline-start: auto; }
    .nr-preview-panel .ws-save { order: 3; }
    .nr-root.nr-v2 .nr-preview-panel .ws-seg { background: var(--bg-soft-2); border: 1px solid var(--border-2);
        border-radius: 999px !important; box-shadow: none; padding: 2px !important;
        height: 32px !important; min-height: 0 !important;
        display: inline-flex !important; align-items: center; box-sizing: border-box; }
    .nr-root.nr-v2 .nr-preview-panel .ws-seg button { height: 26px !important; min-height: 0 !important;
        padding: 0 14px !important; font-size: 12px !important; line-height: 1 !important;
        border-radius: 999px !important; display: inline-flex !important; align-items: center; }

    /* v988: عناصر الجوّال فقط + تبويب «الألوان» */
    .nz-mob-only { display: block; }
    .nr-tabs button.nz-mob-only { display: inline-block; flex: 0 0 auto; }
    .nz-mob-colors { padding: 2px 2px 10px; display: flex; flex-direction: column; gap: 14px; }
    .nz-mc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
    .nz-mc-row > label { font-size: 14px; font-weight: 700; color: var(--text-2); min-width: 84px; }
    .nz-mc-input { width: 54px; height: 42px; padding: 2px; border: 1px solid var(--border-2);
        border-radius: 10px; cursor: pointer; }
    .nz-mob-pal { display: flex; flex-wrap: wrap; gap: 8px; }
    .nz-mob-pal button { width: 30px; height: 30px; border-radius: 8px;
        border: 1px solid rgba(0,0,0,.12); cursor: pointer; padding: 0;
        transition: transform .1s ease; }
    .nz-mob-pal button:active { transform: scale(.8); }

    /* v1000: ترويسة الجوّال — المفضلة والسلة فقط */
    .nz-topbar-end > * { display: none !important; }
    .nz-topbar-end > a[title="المفضلة"],
    .nz-topbar-end > a[title="السلة"] { display: inline-flex !important; }

    /* v1006: تبويب «تصدير» — مخفيٌّ افتراضياً، تُظهره الإدارة */
    #nzTabExport, .nz-mob-export { display: none !important; }
    .mob-on-exporttab #nzTabExport { display: inline-block !important; }
    .mob-on-exporttab .nz-mob-export { display: flex !important; }

    /* v997: تبويبا «مكتبتي» و«تصدير» + شريط السلة الثابت */
    .nz-mob-lib { padding: 4px 2px 10px; }
    .nz-mob-lib .nzlib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
    .nz-mob-export { display: flex; flex-direction: column; gap: 12px; padding: 6px 2px 12px; }
    .nz-mob-cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        background: var(--bg-card); border-top: 1px solid var(--border-2); box-shadow: 0 -8px 24px rgba(0,0,0,.08);
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }

    /* v997: اسم النموذج انتقل إلى وسط الترويسة (كالمخطط) */
    .nz-htitle { display: block; flex: 1; min-width: 0; text-align: center; font-weight: 800;
        font-size: 16px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nz-brand-name, .nz-ver { display: none; }
    .ws-mname, .nz-modelname, .nz-cntbar { display: none !important; }

    /* v985: مربّع النصّ سطرٌ واحدٌ ينمو مع المحتوى */
    .nr-settings textarea { field-sizing: content; height: auto; min-height: 48px;
        max-height: 32dvh; overflow-y: auto; resize: none; }
    .nr-preview-panel .ws-seg button { padding: 8px 22px; font-size: 14px; }
    /* الارتفاع المحرَّر يذهب كلّه للمعاينة (بقي المبدّل وحده ~52px) */
    .nr-preview-panel .svg-wrap,
    .nr-preview-panel .canvas-wrap { height: calc(var(--nz-pvh, 40dvh) - 76px);
        transition: height .28s ease; }
    .mob-on-dims .nr-preview-panel .svg-wrap,
    .mob-on-dims .nr-preview-panel .canvas-wrap { height: calc(var(--nz-pvh, 40dvh) - 104px); }

    /* 2) 60% للتحكم والتبويبات */
    .nr-settings { order: 1; }
    .nr-col-mid  { order: 2; }

    /* 3) التبويبات: صف واحد يُسحب أفقياً بلا التفاف */
    .nr-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .nr-tabs::-webkit-scrollbar { display: none; }
    .nr-tabs button { white-space: nowrap; padding: 10px 16px; flex: 0 0 auto; }

    /* ═══ v992: تعميم تجربة الجوّال — الطوق/الغرس/الحصالة/القهوة/الغطاء/اللوحة ═══ */
    .nr-v2.grid, .nz-page > .grid, .lp-grid {
        display: grid !important; grid-template-columns: 1fr !important; gap: 10px !important; }
    .nr-v2.grid > *, .nz-page > .grid > *, .lp-grid > * {
        min-width: 0; width: 100% !important; box-sizing: border-box; }
    .card.preview, .lp-preview { order: -1; position: sticky; top: 4px; z-index: 40;
        height: 40vh; height: var(--nz-pvh, 40dvh); overflow-y: auto; overflow-x: clip;
        box-shadow: 0 14px 26px -16px rgba(0,0,0,.35); }
    .card.preview .svg-wrap, .card.preview .canvas-wrap,
    .lp-preview .svg-wrap, .lp-preview .canvas-wrap { min-height: 0 !important;
        height: calc(var(--nz-pvh, 40dvh) - 64px) !important; }
    .card.preview .preview-svg, .card.preview canvas,
    .lp-preview .preview-svg, .lp-preview canvas { height: 100% !important; }
    .card.preview .ws-topbar, .lp-preview .ws-topbar { justify-content: center; }

    /* ═══ v992: مقبض تغيير ارتفاع المعاينة (يُحفَظ اختيارك) ═══ */
    .nz-pvgrip { position: sticky; bottom: 0; height: 20px; margin-top: 4px;
        display: flex; align-items: center; justify-content: center;
        cursor: ns-resize; touch-action: none; z-index: 5;
        background: linear-gradient(transparent, rgba(255,255,255,.96) 45%); }
    .nz-pvgrip::before { content: ''; width: 46px; height: 5px; border-radius: 99px;
        background: #cbd5e1; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
    .nz-pvgrip:active::before { background: #94a3b8; }

    /* 4) لمس مريح + منع تكبير iOS التلقائي عند التركيز */
    .nr-root input, .nr-root select, .nr-root textarea { font-size: 16px; }
    .nr-root select, .nr-root input[type="text"], .nr-root input[inputmode="decimal"] { min-height: 42px; }
    .ws-icon { width: 40px; height: 40px; }
}

/* الوضع الأفقي على الجوّال: عمودان — معاينة 45% بكامل الارتفاع + تحكم يتمرر بجوارها */
@media (max-width: 1100px) and (orientation: landscape) and (max-height: 520px) {
    .nr-root.nr-v2 .nr-grid,
    .nr-grid { display: grid !important; grid-template-columns: 45% 1fr !important; align-items: start; }
    .nr-preview-panel { order: -1; position: sticky; top: 4px;
        height: calc(100dvh - 8px); grid-row: 1 / span 9; }
    .nr-preview-panel .svg-wrap,
    .nr-preview-panel .canvas-wrap { height: calc(100dvh - 82px); }
    .nr-settings, .nr-col-mid { grid-column: 2; order: initial; }
}
