:root {
            --brand-dark: #3C454E;
            --brand-primary: #0085FF;
            --brand-secondary: #111111;
            --brand-light: #E3E2E2;
            --brand-muted: #94A3B8;
            --brand-background: #F4F6F8;
            --brand-text: #3C454E;
            --brand-white: #FFFFFF;
            --brand-font: IBM Plex Sans Arabic;
            --brand-primary-soft: rgba(0, 133, 255, 0.1);
            --brand-primary-tint: rgba(0, 133, 255, 0.055);
            --brand-primary-shadow: rgba(0, 133, 255, 0.18);
            --brand-primary-hover: rgba(0, 133, 255, 0.88);
            --brand-primary-overlay: rgba(0, 133, 255, 0.68);
            --brand-primary-border: rgba(0, 133, 255, 0.24);
            --brand-secondary-soft: rgba(180, 154, 101, 0.12);
        }
        body { font-family: var(--brand-font), sans-serif; background-color: var(--brand-background); margin: 0; overflow: hidden; }
        .app-view { min-height: 100vh; }
        .editor-view { height: 100vh; flex-direction: column; overflow: hidden; }

        .login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--brand-background); }
        .login-panel { width: 460px; max-width: calc(100vw - 32px); background: white; border: 1px solid #e2e8f0; border-radius: 18px; padding: 28px; box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12); }
        .login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
        .login-logo { width: 50px; height: 50px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: white; }
        .login-brand h1 { font-size: 22px; font-weight: 900; color: var(--brand-text); margin: 0; }
        .login-brand p, .login-copy p { color: #64748b; font-size: 13px; margin: 0; line-height: 1.8; }
        .login-copy h2 { font-size: 28px; font-weight: 900; color: var(--brand-text); margin: 0 0 6px; }
        .mock-user-list { display: grid; gap: 10px; margin-top: 22px; }
        .mock-user-card { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; text-align: right; transition: 0.2s; }
        .mock-user-card:hover { border-color: var(--brand-primary); background: var(--brand-primary-tint); transform: translateY(-1px); }
        .mock-user-icon { width: 42px; height: 42px; border-radius: 14px; background: var(--brand-primary-tint); color: var(--brand-primary); display: flex; align-items: center; justify-content: center; }
        .mock-user-card strong { display: block; color: var(--brand-text); font-weight: 900; font-size: 14px; }
        .mock-user-card small { display: block; color: #64748b; font-size: 11px; direction: ltr; text-align: right; margin-top: 3px; }
        .cloud-login-form { display: grid; gap: 13px; margin-top: 24px; }
        .cloud-login-form label { display: grid; gap: 6px; color: var(--brand-text); font-size: 11px; font-weight: 900; }
        .cloud-login-form input { width: 100%; box-sizing: border-box; padding: 13px 14px; border: 1px solid #dbe3ec; border-radius: 13px; color: var(--brand-text); background: #fff; outline: none; direction: ltr; text-align: left; transition: .18s; }
        .cloud-login-form input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 4px var(--brand-primary-tint); }
        .cloud-login-form > button { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 13px; color: #fff; background: var(--brand-primary); font-size: 13px; font-weight: 950; box-shadow: 0 14px 28px var(--brand-primary-shadow); }
        .cloud-login-form > button:disabled { opacity: .6; cursor: wait; }
        .cloud-login-form > button svg { width: 17px; height: 17px; }
        .cloud-login-error { min-height: 17px; color: #dc2626; font-size: 10px; font-weight: 850; }
        .cloud-login-trust, .local-mode-note { display: flex; align-items: flex-start; gap: 7px; padding: 10px 12px; border-radius: 12px; color: #64748b; background: #f8fafc; font-size: 9px; font-weight: 750; line-height: 1.6; }
        .cloud-login-trust svg, .local-mode-note svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--brand-primary); }
        .platform-first-setup { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin-top: 15px; padding: 12px; border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, #e2e8f0); border-radius: 14px; background: linear-gradient(135deg, var(--brand-primary-tint), #fff); }
        .platform-first-setup > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
        .platform-first-setup > div > svg { width: 18px; height: 18px; color: var(--brand-primary); flex: 0 0 auto; }
        .platform-first-setup span { display: grid; gap: 1px; }
        .platform-first-setup b { color: var(--brand-text); font-size: 10px; font-weight: 950; }
        .platform-first-setup small { color: #64748b; font-size: 8px; font-weight: 750; line-height: 1.45; }
        .platform-first-setup > button { display: inline-flex; align-items: center; gap: 4px; padding: 8px 9px; border-radius: 10px; color: #fff; background: var(--brand-primary); font-size: 8px; font-weight: 900; white-space: nowrap; }
        .platform-first-setup > button svg { width: 12px; height: 12px; }
        .local-mode-note { margin-top: 13px; border: 1px dashed #cbd5e1; }
        .production-config-block { margin-top: 18px; padding: 22px; border: 1px solid #fecaca; border-radius: 17px; background: #fff7f7; color: #7f1d1d; text-align: center; justify-items: center; gap: 8px; }
        .production-config-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #b91c1c; background: #fee2e2; }
        .production-config-icon svg { width: 22px; height: 22px; }
        .production-config-block strong { font-size: 14px; font-weight: 950; }
        .production-config-block p { margin: 0; color: #991b1b; font-size: 11px; line-height: 1.8; }

        .dashboard-view { min-height: 100vh; background: var(--brand-background); overflow: auto; }
        .dashboard-header { height: 76px; background: white; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 40; }
        .dashboard-system-name { font-size: 18px; font-weight: 900; color: var(--brand-text); }
        .dashboard-org-name { font-size: 12px; color: #64748b; margin-top: 2px; }
        .dashboard-actions { display: flex; gap: 10px; align-items: center; }
        .cloud-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid #dbe3ec; border-radius: 999px; color: #64748b; background: #f8fafc; font-size: 9px; font-weight: 900; }
        .cloud-status-badge svg { width: 13px; height: 13px; }
        .cloud-status-badge.ready, .cloud-status-badge.synced { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
        .cloud-status-badge.connecting, .cloud-status-badge.loading, .cloud-status-badge.pending, .cloud-status-badge.syncing { color: #a16207; border-color: #fde68a; background: #fffbeb; }
        .cloud-status-badge.error { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
        .dashboard-secondary-btn, .project-back-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #f8fafc; color: #475569; font-size: 12px; font-weight: 900; border: 1px solid #e2e8f0; transition: 0.2s; }
        .dashboard-secondary-btn:hover, .project-back-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-primary-tint); }
        .dashboard-secondary-btn i, .project-back-btn i { width: 16px; height: 16px; }
        .dashboard-main { max-width: 1160px; margin: 0 auto; padding: 36px 28px 70px; }
        .dashboard-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 30px; }
        .dashboard-welcome { font-size: 14px; color: var(--brand-primary); font-weight: 900; margin-bottom: 6px; }
        .dashboard-hero h1 { margin: 0; font-size: 38px; font-weight: 950; color: var(--brand-text); }
        .dashboard-primary-btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 14px; background: var(--brand-primary); color: white; font-weight: 900; box-shadow: 0 16px 32px var(--brand-primary-shadow); }
        .dashboard-primary-btn i { width: 18px; height: 18px; }
        .projects-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
        .projects-toolbar h2 { font-size: 18px; font-weight: 900; color: var(--brand-text); margin: 0; }
        .projects-toolbar span { color: #64748b; font-size: 12px; font-weight: 800; }
        .projects-list { display: grid; gap: 12px; }
        .project-card { background: white; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; transition: 0.2s; }
        .project-card:hover { border-color: var(--brand-primary); box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08); }
        .project-card-title { font-size: 18px; font-weight: 900; color: var(--brand-text); margin-bottom: 8px; }
        .project-card-meta { display: flex; gap: 12px; flex-wrap: wrap; color: #64748b; font-size: 11px; font-weight: 800; }
        .project-card-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
        .project-open-btn, .project-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; border-radius: 11px; font-weight: 900; transition: 0.2s; }
        .project-open-btn { padding: 0 14px; background: var(--brand-primary); color: white; }
        .project-icon-btn { width: 38px; background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
        .project-icon-btn.danger { color: #dc2626; }
        .project-open-btn i, .project-icon-btn i { width: 16px; height: 16px; }
        .projects-empty { min-height: 250px; border: 1px dashed #cbd5e1; border-radius: 18px; background: white; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #64748b; gap: 8px; text-align: center; }
        .projects-empty i { width: 42px; height: 42px; color: var(--brand-primary); }
        .projects-empty strong { color: var(--brand-text); font-size: 18px; font-weight: 900; }
        .project-modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 5000; align-items: center; justify-content: center; padding: 24px; }
        .project-modal { width: 420px; max-width: 100%; background: white; border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2); }
        .project-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
        .project-modal-header h3 { font-size: 20px; font-weight: 900; color: var(--brand-text); margin: 0; }
        .project-modal-header button { width: 36px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: #f8fafc; color: #64748b; }
        .project-create-form { display: grid; gap: 16px; box-sizing: border-box; }
        .project-create-form .project-modal-header { margin-bottom: 0; }
        .project-create-field { display: grid; gap: 8px; min-width: 0; }
        .project-create-field .admin-label { margin: 0; }
        .project-create-field .admin-input { display: block; box-sizing: border-box; min-height: 52px; margin: 0; line-height: 1.5; }
        .project-create-submit { min-height: 52px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; cursor: pointer; line-height: 1; }
        .project-create-submit svg { width: 17px; height: 17px; }
        .project-create-submit:disabled { cursor: wait; opacity: .72; box-shadow: none; }
        .project-create-submit.is-loading svg { animation: project-create-spin 1s linear infinite; }
        @keyframes project-create-spin { to { transform: rotate(360deg); } }
        .project-create-error { display: none; padding: 10px 12px; border-radius: 11px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; font-size: 11px; font-weight: 800; line-height: 1.6; }
        .project-create-error.is-visible { display: block; }
        .platform-modal-backdrop { overflow-y: auto; align-items: flex-start; padding-top: 5vh; padding-bottom: 5vh; }
        .platform-modal, .platform-admin-modal { width: min(760px, 100%); background: #fff; border-radius: 22px; box-shadow: 0 32px 90px rgba(15,23,42,.28); overflow: hidden; }
        .platform-admin-modal { width: min(1080px, 100%); }
        .platform-modal-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 20px 22px; color: #fff; background: linear-gradient(135deg, var(--brand-dark), var(--brand-primary)); }
        .platform-modal-hero > span { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.14); }
        .platform-modal-hero > span svg { width: 22px; height: 22px; color: #fff; }
        .platform-modal-hero > div { display: grid; gap: 2px; }
        .platform-modal-hero b { font-size: 17px; font-weight: 950; }
        .platform-modal-hero small { color: rgba(255,255,255,.78); font-size: 10px; font-weight: 700; }
        .platform-modal-hero > button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: rgba(255,255,255,.12); }
        .platform-modal-hero > button:hover { background: rgba(255,255,255,.2); }
        .platform-modal-hero > button svg { width: 17px; height: 17px; }
        .platform-form { display: grid; gap: 13px; padding: 22px; }
        .platform-form.compact { padding: 0; gap: 10px; }
        .platform-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .platform-form-grid.two { gap: 10px; }
        .platform-form label { display: grid; gap: 6px; min-width: 0; }
        .platform-form label > span { color: var(--brand-text); font-size: 10px; font-weight: 900; }
        .platform-form input, .platform-form select { width: 100%; min-width: 0; box-sizing: border-box; padding: 11px 12px; border: 1px solid #dbe3ec; border-radius: 11px; color: var(--brand-text); background: #fff; outline: none; font: inherit; font-size: 11px; transition: .16s; }
        .platform-form input[type="email"], .platform-form input[type="password"] { direction: ltr; text-align: left; }
        .platform-form input:focus, .platform-form select:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .platform-form-note { display: flex; gap: 7px; align-items: center; margin: -2px 0 0; padding: 9px 10px; border-radius: 10px; color: #64748b; background: #f8fafc; font-size: 9px; font-weight: 750; }
        .platform-form-note svg { width: 14px; height: 14px; color: var(--brand-primary); }
        .platform-form-error { min-height: 18px; padding: 0 22px; color: #dc2626; font-size: 10px; font-weight: 850; }
        .platform-submit { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 12px; color: #fff; background: var(--brand-primary); font-size: 12px; font-weight: 950; box-shadow: 0 12px 24px var(--brand-primary-shadow); }
        .platform-submit:hover { filter: brightness(.97); transform: translateY(-1px); }
        .platform-submit:disabled { opacity: .6; cursor: wait; transform: none; }
        .platform-submit svg { width: 16px; height: 16px; }
        .platform-submit.small { min-height: 38px; font-size: 10px; box-shadow: none; }
        .platform-submit.small svg { width: 14px; height: 14px; }
        .platform-admin-summary { display: flex; align-items: center; gap: 8px; padding: 15px 22px; border-bottom: 1px solid #edf2f7; background: #fbfcfd; }
        .platform-admin-summary > span { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid #e2e8f0; border-radius: 10px; color: #64748b; background: #fff; }
        .platform-admin-summary svg { width: 14px; height: 14px; color: var(--brand-primary); }
        .platform-admin-summary b { color: var(--brand-text); font-size: 12px; }
        .platform-admin-summary small { font-size: 8px; font-weight: 800; }
        .platform-admin-summary > button { margin-right: auto; display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 9px; color: #64748b; background: #f1f5f9; font-size: 9px; font-weight: 850; }
        .platform-admin-summary > button svg { width: 13px; height: 13px; color: currentColor; }
        .platform-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px 22px 12px; }
        .platform-admin-card { padding: 16px; border: 1px solid #e2e8f0; border-radius: 17px; background: #fff; }
        .platform-card-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
        .platform-card-heading > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--brand-primary); background: var(--brand-primary-tint); }
        .platform-card-heading svg { width: 17px; height: 17px; }
        .platform-card-heading > div { display: grid; gap: 1px; }
        .platform-card-heading b { color: var(--brand-text); font-size: 12px; font-weight: 950; }
        .platform-card-heading small { color: #94a3b8; font-size: 8px; font-weight: 750; }
        .platform-directory { padding: 10px 22px 22px; }
        .platform-directory-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 5px 0 10px; }
        .platform-directory-heading b { color: var(--brand-text); font-size: 12px; font-weight: 950; }
        .platform-directory-heading small { color: #94a3b8; font-size: 8px; font-weight: 750; }
        .platform-organization-list { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; padding-left: 3px; }
        .platform-org-row { display: grid; grid-template-columns: auto minmax(120px,1fr) auto minmax(190px,1.3fr); align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #e8edf2; border-radius: 13px; background: #fff; }
        .platform-org-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-primary); background: var(--brand-primary-tint); }
        .platform-org-mark svg { width: 15px; height: 15px; }
        .platform-org-main { display: grid; gap: 1px; min-width: 0; }
        .platform-org-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand-text); font-size: 10px; font-weight: 950; }
        .platform-org-main small { color: #94a3b8; font-size: 8px; font-weight: 750; }
        .platform-org-members { display: grid; justify-items: center; min-width: 42px; padding: 3px 6px; border-radius: 9px; color: var(--brand-primary); background: var(--brand-primary-tint); }
        .platform-org-members b { font-size: 11px; font-weight: 950; line-height: 1; }
        .platform-org-members span { font-size: 7px; font-weight: 800; }
        .platform-org-user-list { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px; }
        .platform-org-user-list span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 6px; border-radius: 7px; color: #64748b; background: #f8fafc; font-size: 7px; font-weight: 750; }
        .platform-admin-loading, .platform-admin-empty { min-height: 98px; display: grid; place-content: center; justify-items: center; gap: 6px; color: #94a3b8; text-align: center; }
        .platform-admin-loading { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 850; }
        .platform-admin-loading svg { width: 16px; height: 16px; color: var(--brand-primary); animation: preznta-spin 1s linear infinite; }
        .platform-admin-empty b { color: #64748b; font-size: 10px; font-weight: 900; }
        .platform-admin-empty span { font-size: 8px; font-weight: 750; }
        .platform-admin-empty svg { width: 25px; height: 25px; color: var(--brand-primary); }
        @keyframes preznta-spin { to { transform: rotate(360deg); } }
        @media (max-width: 720px) { .platform-form-grid, .platform-admin-grid { grid-template-columns: 1fr; } .platform-org-row { grid-template-columns: auto 1fr auto; } .platform-org-user-list { grid-column: 2 / -1; } .platform-modal-backdrop { padding: 12px; } .platform-modal-hero { padding: 16px; } }
        .project-title-wrap { min-width: 260px; }
        .project-name-input { width: 260px; max-width: 30vw; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 900; color: var(--brand-text); outline: none; background: #fff; }
        .project-name-input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .autosave-status { color: #64748b; font-size: 10px; font-weight: 800; margin-top: 4px; padding-right: 2px; }

        .stage-wrapper { flex: 1; min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 60px; position: relative; }
        .canvas-viewport { width: 960px; height: 540px; flex: 0 0 auto; position: relative; }
        .canvas-area { 
            width: 960px; height: 540px; background: white; position: relative; 
            box-shadow: 0 30px 60px rgba(60, 69, 78, 0.15); border-radius: 4px; border: 1px solid var(--brand-light);
            background-size: cover; background-position: center; flex-shrink: 0; transform-origin: top left;
        }
        .canvas-area.external-drop-active { box-shadow: 0 0 0 4px var(--brand-primary-tint), 0 30px 60px rgba(60, 69, 78, 0.15); }
        .canvas-drop-overlay { position: absolute; inset: 0; z-index: 2600; display: grid; place-items: center; pointer-events: none; border: 2px dashed var(--brand-primary); border-radius: 4px; background: color-mix(in srgb, var(--brand-primary) 7%, transparent); }
        .canvas-drop-overlay > span { min-width: 240px; display: grid; justify-items: center; gap: 5px; padding: 16px 22px; border: 1px solid color-mix(in srgb, var(--brand-primary) 25%, #fff); border-radius: 18px; color: var(--brand-text); background: rgba(255,255,255,.94); box-shadow: 0 18px 45px rgba(15,23,42,.16); backdrop-filter: blur(10px); }
        .canvas-drop-overlay svg { width: 26px; height: 26px; color: var(--brand-primary); }
        .canvas-drop-overlay strong { font-size: 13px; font-weight: 950; }
        .canvas-drop-overlay small { color: #94a3b8; font-size: 9px; font-weight: 850; direction: ltr; }
        .canvas-drop-overlay.on-shape { place-items: start center; padding-top: 18px; background: color-mix(in srgb, var(--brand-primary) 3%, transparent); }
        .canvas-drop-overlay.on-shape > span { min-width: 280px; padding: 10px 18px; border-radius: 14px; }
        .element-wrapper.is-shape.shape-drop-target { z-index: 2500 !important; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--brand-primary) 55%, transparent)); }
        .element-wrapper.is-shape.shape-drop-target::after { content: 'أفلت داخل الشكل'; position: absolute; inset: -9px; z-index: 160; display: grid; place-items: center; border: 2px dashed #fff; border-radius: inherit; color: #fff; background: color-mix(in srgb, var(--brand-primary) 58%, transparent); font-size: 11px; font-weight: 950; pointer-events: none; }
        .canvas-drop-notice { position: fixed; left: 50%; bottom: 26px; z-index: 9000; display: flex; align-items: center; gap: 9px; max-width: min(440px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 14px; color: #fff; background: var(--brand-dark); box-shadow: 0 18px 42px rgba(15,23,42,.25); font-size: 11px; font-weight: 900; opacity: 0; transform: translate(-50%, 14px); transition: .2s ease; direction: rtl; }
        .canvas-drop-notice.visible { opacity: 1; transform: translate(-50%, 0); }
        .canvas-drop-notice.success svg { color: #5eead4; }
        .canvas-drop-notice.error { background: #991b1b; }
        .canvas-drop-notice svg { width: 18px; height: 18px; flex: 0 0 auto; }

        .element-wrapper { 
            position: absolute; cursor: move; padding: 12px; border: 1px solid transparent; 
            z-index: 10; display: inline-block; box-sizing: border-box; 
        }
        .element-wrapper.selected { border: 1.5px dashed transparent; border-radius: 12px; background: var(--brand-primary-tint); }
        .element-wrapper.selected > .element-content { position: relative; z-index: 1; }
        .element-drag-zone { position: absolute; display: none; z-index: 106; background: transparent; cursor: grab; touch-action: none; }
        .element-wrapper.selected .element-drag-zone { display: block; }
        .element-drag-zone:active { cursor: grabbing; }
        .element-wrapper.selected:has(.element-drag-zone:hover) { box-shadow: 0 0 0 4px var(--brand-primary-tint); }
        .drag-zone-top { height: 18px; left: -9px; right: -9px; top: -9px; }
        .drag-zone-bottom { height: 18px; left: -9px; right: -9px; bottom: -9px; }
        .drag-zone-right { width: 18px; top: 9px; bottom: 9px; right: -9px; }
        .drag-zone-left { width: 18px; top: 9px; bottom: 9px; left: -9px; }
        body.element-dragging, body.element-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
        /* شرائح الاستوديو: نفرض سلسلة ارتفاع كاملة كي يظهر المحتوى المُطلق (inset:0) */
        .element-wrapper.is-studio { display: block; padding: 12px; overflow: visible; }
        .element-wrapper.is-studio .element-content { width: 960px; height: 540px; position: relative; }
        .element-wrapper.is-studio .content { width: 960px !important; height: 540px !important; position: relative; overflow: hidden; }
        .element-wrapper.is-studio .studio-slide-root { width: 960px !important; height: 540px !important; }
        .element-wrapper.is-v3-html { cursor: default; }
        .element-wrapper.is-v3-html.selected { background: transparent; border-radius: 5px; }
        .element-wrapper.is-v3-html .p3-editor-host { cursor: default; }
        .element-wrapper.is-v3-html [data-editable="true"] { cursor: text; }
        .element-wrapper.is-shape { padding: 0; }
        .element-wrapper.is-shape .element-content { width: 100%; height: 100%; }
        .v3-toolbar { gap: 7px; }
        .v3-edit-hint { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; padding: 0 4px; }
        .v3-edit-hint i { width: 14px; height: 14px; color: var(--brand-secondary); }

        .smart-guides-layer { position: absolute; inset: 0; z-index: 1900; pointer-events: none; overflow: visible; }
        .smart-guide-line { position: absolute; background: #ec4899; box-shadow: 0 0 0 1px rgba(255,255,255,.75); }
        .smart-guide-line.vertical { top: -12px; bottom: -12px; width: 1px; }
        .smart-guide-line.horizontal { left: -12px; right: -12px; height: 1px; }
        .smart-guide-line::before, .smart-guide-line::after { content: ''; position: absolute; width: 5px; height: 5px; border: 1px solid #ec4899; background: #fff; border-radius: 50%; }
        .smart-guide-line.vertical::before { top: 10px; left: -2px; }
        .smart-guide-line.vertical::after { bottom: 10px; left: -2px; }
        .smart-guide-line.horizontal::before { left: 10px; top: -2px; }
        .smart-guide-line.horizontal::after { right: 10px; top: -2px; }
        .smart-spacing { position: absolute; color: #ec4899; border-color: #ec4899; font-size: 9px; font-weight: 950; }
        .smart-spacing.x { height: 8px; border-top: 1px solid; border-left: 1px solid; border-right: 1px solid; }
        .smart-spacing.y { width: 8px; border-right: 1px solid; border-top: 1px solid; border-bottom: 1px solid; }
        .smart-spacing-label { position: absolute; min-width: 24px; padding: 2px 5px; border-radius: 999px; color: #fff; background: #ec4899; text-align: center; line-height: 1.2; box-shadow: 0 2px 7px rgba(236,72,153,.25); }
        .smart-spacing.x .smart-spacing-label { left: 50%; top: -20px; transform: translateX(-50%); }
        .smart-spacing.y .smart-spacing-label { top: 50%; right: 13px; transform: translateY(-50%); }

        .resizer { position: absolute; width: 12px; height: 12px; background: white; border: 2.5px solid var(--brand-primary); border-radius: 50%; display: none; z-index: 110; }
        .element-wrapper.selected.is-resizable .resizer { display: none; }
        .resizer-e { right: -6px; top: 50%; transform: translateY(-50%) scale(var(--element-ui-scale, 1)); cursor: e-resize; }
        .resizer-w { left: -6px; top: 50%; transform: translateY(-50%) scale(var(--element-ui-scale, 1)); cursor: w-resize; }

        .floating-toolbar {
            position: absolute; top: var(--toolbar-offset, -85px); left: 50%; transform: translateX(-50%) rotate(var(--element-counter-rotation, 0deg)) scale(var(--element-ui-scale, 1)) !important;
            transform-origin: center bottom;
            background: var(--brand-dark); border-radius: 12px; display: none;
            align-items: center; padding: 8px 14px; gap: 4px; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); z-index: 1001; width: max-content;
        }
        .element-wrapper.selected.single-select .floating-toolbar { display: flex; }
        .canvas-floating-toolbar {
            position: absolute; display: none; transform: translate(-50%, -100%) !important;
            transform-origin: center; z-index: 2300; width: max-content;
        }
        .canvas-floating-toolbar.active { display: flex; }

        .t-btn { color: white; transition: 0.2s; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 6px; border-radius: 8px; font-weight: bold; background: none; border: none; }
        .t-btn:hover { color: var(--brand-primary); background: rgba(255,255,255,0.1); }
        .t-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.2); margin: 0 6px; }

        .brand-menu { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); background: white; padding: 10px; border-radius: 12px; display: none; box-shadow: 0 10px 20px rgba(0,0,0,0.1); border: 1px solid var(--brand-light); gap: 10px; z-index: 2000; }
        .c-circle { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 1px solid #eee; }
        .w-opt { padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--brand-text); transition: 0.2s; white-space: nowrap; font-weight: bold; text-align: center; }
        .w-opt:hover { background: var(--brand-primary-soft); color: var(--brand-primary); }

        .content { font-family: var(--brand-font), sans-serif !important; white-space: normal; word-wrap: break-word; line-height: 1.4; width: 100%; user-select: text !important; outline: none; cursor: text; }
        /* Structured components own their internal layout. The editor alignment belongs to
           their host only and must never flatten intentionally centred/edge-aligned parts. */
        .content.align-right, .content.align-right:not(.component-layout-content) * { text-align: right !important; }
        .content.align-center, .content.align-center:not(.component-layout-content) * { text-align: center !important; }
        .content.align-left, .content.align-left:not(.component-layout-content) * { text-align: left !important; }
        .content.align-justify, .content.align-justify:not(.component-layout-content) * { text-align: justify !important; text-justify: inter-word; }
        .content * { color: inherit; }
        [data-ready-icon], [data-ready-image] { cursor: pointer; }
        [data-ready-icon]:hover, [data-ready-image]:hover { outline: 2px solid var(--brand-primary); outline-offset: 3px; }
        .ready-image-fill { width: 100%; height: 100%; object-fit: cover; display: block; }
        .ready-icon-popover {
            position: fixed; width: 286px; z-index: 5001; direction: rtl; background: #fff;
            border: 1px solid #e2e8f0; border-radius: 16px; padding: 12px;
            box-shadow: 0 22px 52px rgba(15, 23, 42, 0.18);
        }
        .ready-icon-popover-title { color: var(--brand-text); font-size: 12px; font-weight: 900; margin-bottom: 8px; }
        .ready-icon-search {
            width: 100%; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px;
            color: var(--brand-text); font-size: 12px; font-weight: 700; outline: none;
        }
        .ready-icon-search:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .ready-icon-results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; max-height: 230px; overflow: auto; }
        .ready-icon-choice {
            min-width: 0; aspect-ratio: 1/1; border: 1px solid #eef2f7; border-radius: 12px; background: #fff;
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
            color: var(--brand-text); transition: 0.18s; padding: 6px;
        }
        .ready-icon-choice:hover { border-color: var(--brand-primary); background: var(--brand-primary-tint); color: var(--brand-primary); }
        .ready-icon-choice i, .ready-icon-choice svg { width: 20px; height: 20px; flex: 0 0 auto; }
        .ready-icon-choice span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: center; font-size: 8px; font-weight: 700; color: #94a3b8; }
        .ready-icon-empty { grid-column: 1 / -1; padding: 18px 0; text-align: center; color: #94a3b8; font-size: 12px; font-weight: 800; }

        .preznta-ready-smart { position:relative; width:100%; direction:rtl; box-sizing:border-box; text-align:right; }
        .preznta-ready-smart [data-ready-editable] { min-width:0; outline:none; cursor:text; white-space:pre-wrap; overflow-wrap:anywhere; }
        .preznta-ready-smart [data-ready-editable]:focus { border-radius:6px; box-shadow:0 0 0 3px color-mix(in srgb,var(--brand-primary) 18%,transparent); }
        .ready-task-card { margin-top:53px; padding:65px 32px 34px; border:1px solid color-mix(in srgb,var(--ready-text) 7%,transparent); border-radius:var(--ready-radius); color:var(--ready-text); background:var(--ready-surface); box-shadow:0 18px 48px color-mix(in srgb,var(--ready-text) 11%,transparent); }
        .ready-task-icon { position:absolute; top:-52px; left:50%; width:104px; height:104px; display:grid; place-items:center; transform:translateX(-50%); border-radius:var(--ready-icon-radius); color:var(--ready-icon-color); background:var(--ready-icon-bg); box-shadow:none; }
        .ready-task-icon svg { width:var(--ready-icon-size) !important; height:var(--ready-icon-size) !important; stroke-width:1.65; }
        .ready-task-heading { display:flex; align-items:baseline; justify-content:center; gap:10px; margin-bottom:23px; font-size:var(--ready-title-size); font-weight:900; line-height:1.25; text-align:center; }
        .ready-task-heading [data-ready-field="number"] { flex:0 0 auto; color:var(--ready-accent); font-size:var(--ready-number-size); direction:ltr; }
        .ready-task-heading [data-ready-field="title"] { color:var(--ready-title); }
        .ready-smart-points { display:grid; gap:10px; }
        .ready-smart-point { min-width:0; display:flex; align-items:flex-start; gap:11px; color:var(--ready-text); font-size:var(--ready-text-size); font-weight:650; line-height:1.55; }
        .ready-smart-point > i { width:9px; height:9px; flex:0 0 9px; margin-top:.58em; transform:rotate(45deg); border-radius:2px; background:var(--ready-accent); }
        .ready-smart-point [data-ready-field="items"] { flex:1; color:var(--ready-text); }
        .ready-numbered-box { min-height:260px; padding:50px 52px 40px; border:1px solid color-mix(in srgb,var(--ready-text) 8%,transparent); border-radius:var(--ready-radius); color:var(--ready-text); background:var(--ready-surface); box-shadow:0 18px 42px color-mix(in srgb,var(--ready-text) 9%,transparent); }
        .ready-number-badge { position:absolute; top:-27px; right:0; width:60px; height:60px; display:grid; place-items:center; border-radius:var(--ready-badge-radius); color:var(--ready-badge-text); background:var(--ready-badge); box-shadow:0 10px 22px color-mix(in srgb,var(--ready-badge) 18%,transparent); }
        .ready-number-badge [data-ready-field="number"] { width:100%; height:100%; display:grid; place-items:center; color:inherit; font-size:var(--ready-number-size); font-weight:950; line-height:1; direction:ltr; text-align:center !important; }
        .ready-number-content { display:grid; gap:23px; }
        .ready-number-title { padding-inline-end:34px; color:var(--ready-title); font-size:var(--ready-title-size); font-weight:900; line-height:1.35; }
        .ready-number-title [data-ready-field="title"] { color:inherit; }
        .ready-numbered-box .ready-smart-point > i { border-radius:1px; }

        .canvas-floating-toolbar.ready-smart-toolbar { gap:4px; padding:8px 11px; }
        .canvas-floating-toolbar.ready-smart-toolbar .t-btn svg { width:14px; height:14px; stroke-width:1.65; }
        .ready-block-properties-menu { top:52px; width:360px; max-height:490px; overflow:auto; flex-direction:column; gap:11px; padding:14px; direction:rtl; border-radius:18px; }
        .ready-quick-theme-menu { top:52px; width:244px; flex-direction:column; gap:9px; padding:11px; direction:rtl; border-radius:15px; }
        .ready-quick-theme-head { display:flex; align-items:center; gap:8px; color:var(--brand-text); }
        .ready-quick-theme-head svg { width:16px; height:16px; color:var(--brand-primary); stroke-width:1.7; }
        .ready-quick-theme-head span { display:grid; gap:1px; }
        .ready-quick-theme-head b { font-size:9px; font-weight:950; }
        .ready-quick-theme-head small { color:#94a3b8; font-size:6.5px; font-weight:750; }
        .ready-quick-theme-palette { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
        .ready-quick-theme-palette .shape-brand-swatch { width:27px; height:27px; border-radius:9px; }
        .ready-quick-theme-palette .shape-brand-swatch span { width:18px; height:18px; border-radius:6px; }
        .ready-menu-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:9px; border-bottom:1px solid #eef2f7; }
        .ready-menu-head > span { display:grid; gap:2px; }
        .ready-menu-head strong { color:var(--brand-text); font-size:12px; font-weight:950; }
        .ready-menu-head small { color:#94a3b8; font-size:8px; font-weight:800; }
        .ready-menu-head > svg { width:24px; height:24px; padding:5px; border-radius:8px; color:var(--brand-primary); background:var(--brand-primary-tint); stroke-width:1.65; }
        .ready-direct-edit-note { display:flex; align-items:center; gap:9px; padding:9px 10px; border:1px solid color-mix(in srgb,var(--brand-primary) 15%,#e2e8f0); border-radius:11px; color:var(--brand-primary); background:var(--brand-primary-tint); }
        .ready-direct-edit-note > svg { width:17px; height:17px; flex:0 0 auto; stroke-width:1.7; }
        .ready-direct-edit-note > span { display:grid; gap:1px; }
        .ready-direct-edit-note b { font-size:8px; font-weight:950; }
        .ready-direct-edit-note small { color:#64748b; font-size:7px; font-weight:750; line-height:1.55; }
        .ready-block-properties-menu section { display:grid; gap:7px; }
        .ready-block-properties-menu section > b { color:#64748b; font-size:9px; font-weight:900; }
        .ready-points-manager { display:grid; grid-template-columns:34px 1fr 34px; align-items:center; gap:6px; }
        .ready-points-manager button { height:32px; display:grid; place-items:center; border:1px solid #e2e8f0; border-radius:9px; color:var(--brand-primary); background:#fff; }
        .ready-points-manager button.remove { color:#ef4444; }
        .ready-points-manager button:disabled { opacity:.28; cursor:not-allowed; }
        .ready-points-manager button svg { width:14px; height:14px; stroke-width:1.8; }
        .ready-points-manager strong { height:32px; display:grid; place-items:center; border-radius:9px; color:var(--brand-text); background:#f8fafc; font-size:11px; font-weight:950; }
        .ready-point-chips { display:flex; flex-wrap:wrap; gap:5px; }
        .ready-point-chips button { min-width:0; max-width:105px; height:27px; display:grid; grid-template-columns:17px minmax(0,1fr) 12px; align-items:center; gap:3px; padding:3px 5px; border:1px solid #e2e8f0; border-radius:8px; color:#64748b; background:#fff; }
        .ready-point-chips button:hover:not(:disabled) { color:#ef4444; border-color:#fecaca; background:#fff1f2; }
        .ready-point-chips button:disabled { opacity:.58; cursor:default; }
        .ready-point-chips span { height:17px; display:grid; place-items:center; border-radius:5px; color:var(--brand-primary); background:var(--brand-primary-tint); font-size:7px; font-weight:950; }
        .ready-point-chips small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:right; font-size:6.5px; font-weight:800; }
        .ready-point-chips svg { width:10px; height:10px; stroke-width:1.8; }
        .ready-preset-row { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; }
        .ready-preset-row button { min-width:0; height:30px; display:grid; place-items:center; padding:0 3px; border:1px solid #e2e8f0; border-radius:8px; color:#64748b; background:#fff; font-size:7px; font-weight:900; }
        .ready-preset-row button:hover, .ready-preset-row button.active { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .ready-color-groups { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
        .ready-color-groups > div { min-width:0; display:grid; gap:5px; padding:7px; border:1px solid #eef2f7; border-radius:10px; background:#fff; }
        .ready-color-groups > div > span { color:#64748b; font-size:7px; font-weight:850; }
        .ready-color-groups .shape-brand-palette { gap:4px; }
        .ready-color-groups .shape-brand-swatch { width:21px; height:21px; }
        .ready-advanced-colors { border:1px solid #e8edf3; border-radius:11px; background:#fbfcfe; overflow:hidden; }
        .ready-advanced-colors summary { min-height:36px; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 10px; color:#64748b; cursor:pointer; list-style:none; font-size:8px; font-weight:900; }
        .ready-advanced-colors summary::-webkit-details-marker { display:none; }
        .ready-advanced-colors summary::after { content:'+'; width:18px; height:18px; display:grid; place-items:center; border-radius:6px; color:var(--brand-primary); background:var(--brand-primary-tint); font-size:12px; }
        .ready-advanced-colors[open] summary::after { content:'−'; }
        .ready-advanced-colors .ready-color-groups { padding:0 8px 8px; }
        .ready-opacity-control { display:grid; grid-template-columns:minmax(0,1fr) 58px; align-items:center; gap:8px; }
        .ready-opacity-control input[type="range"] { width:100%; accent-color:var(--brand-primary); }
        .ready-opacity-control label { height:30px; display:flex; align-items:center; gap:3px; padding:0 7px; border:1px solid #e2e8f0; border-radius:8px; color:#64748b; background:#fff; }
        .ready-opacity-control label input { width:32px; border:0; outline:0; color:var(--brand-text); background:transparent; font-size:8px; font-weight:900; text-align:center; }
        .ready-opacity-control label span { font-size:7px; font-weight:800; }
        .ready-menu-tip { padding:8px 9px; border-radius:9px; color:#64748b; background:#f8fafc; font-size:7px; font-weight:750; line-height:1.7; }

        .canvas-floating-toolbar.dynamic-element-toolbar { direction:rtl; gap:3px; padding:7px 10px; border-radius:14px; box-shadow:0 16px 34px rgba(15,23,42,.25); }
        .canvas-floating-toolbar.dynamic-element-toolbar .t-btn { min-width:29px; min-height:29px; padding:5px; font-size:12px; font-weight:800; }
        .canvas-floating-toolbar.dynamic-element-toolbar .t-btn svg { width:14px; height:14px; stroke-width:1.65; }
        .canvas-floating-toolbar.dynamic-element-toolbar .text-red-300 { color:#fda4af; }
        .canvas-floating-toolbar.dynamic-element-toolbar .text-red-300:hover { color:#fff; background:#dc2626; }
        .dynamic-toolbar-group { display:flex; align-items:center; gap:2px; }
        .dynamic-toolbar-group.size-tools .t-btn { border:1px solid rgba(255,255,255,.06); }
        .dynamic-toolbar-group.text-tools { gap:1px; }
        .dynamic-toolbar-group.text-tools .t-btn { min-width:27px; }
        .dynamic-bold-button { font-family:Arial,sans-serif; font-size:13px !important; line-height:1; }
        .dynamic-toolbar-color-menu, .dynamic-toolbar-weight-menu { top:52px; width:245px; flex-direction:column; gap:10px; padding:12px; direction:rtl; border-radius:15px; }
        .dynamic-toolbar-weight-menu { width:220px; }
        .dynamic-weight-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
        .dynamic-weight-options button { min-height:38px; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 9px; border:1px solid #e2e8f0; border-radius:9px; color:#334155; background:#fff; }
        .dynamic-weight-options button:hover, .dynamic-weight-options button.active { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .dynamic-weight-options span { font-size:9px; }
        .dynamic-weight-options small { color:#94a3b8; font-size:7px; font-weight:700; }
        .dynamic-toolbar-menu-head { display:flex; align-items:center; gap:8px; padding-bottom:8px; border-bottom:1px solid #eef2f7; color:var(--brand-text); }
        .dynamic-toolbar-menu-head > svg { width:18px; height:18px; flex:0 0 auto; padding:3px; border-radius:7px; color:var(--brand-primary); background:var(--brand-primary-tint); stroke-width:1.65; }
        .dynamic-toolbar-menu-head > span { display:grid; gap:1px; }
        .dynamic-toolbar-menu-head b { font-size:10px; font-weight:950; }
        .dynamic-toolbar-menu-head small { color:#94a3b8; font-size:7px; font-weight:750; }
        .dynamic-properties-menu { top:52px; width:310px; max-height:475px; overflow:auto; flex-direction:column; gap:10px; padding:13px; direction:rtl; border-radius:16px; }
        .dynamic-properties-menu section { display:grid; gap:7px; }
        .dynamic-properties-menu section > b { color:#64748b; font-size:9px; font-weight:900; }
        .dynamic-option-row { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
        .dynamic-option-row button { min-width:0; min-height:30px; padding:5px 3px; border:1px solid #e2e8f0; border-radius:8px; color:#64748b; background:#fff; font-size:7px; font-weight:900; }
        .dynamic-option-row button:hover, .dynamic-option-row button.active { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .dynamic-menu-action { min-height:35px; display:flex; align-items:center; justify-content:center; gap:7px; padding:7px 10px; border:1px solid color-mix(in srgb,var(--brand-primary) 20%,#e2e8f0); border-radius:10px; color:var(--brand-primary); background:var(--brand-primary-tint); font-size:8px; font-weight:900; }
        .dynamic-menu-action svg { width:14px; height:14px; stroke-width:1.7; }
        .dynamic-menu-actions { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; }
        .dynamic-menu-actions button { min-height:34px; display:flex; align-items:center; justify-content:center; gap:4px; padding:5px; border:1px solid #e2e8f0; border-radius:9px; color:#64748b; background:#fff; font-size:7px; font-weight:850; }
        .dynamic-menu-actions button:hover, .dynamic-menu-actions button.active { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .dynamic-menu-actions svg { width:12px; height:12px; stroke-width:1.7; }
        .content.toolbar-weight-override :where(h1,h2,h3,h4,h5,h6,p,span,li,strong,b,small,[contenteditable="true"]) { font-weight:var(--toolbar-font-weight) !important; }

        #selection-marquee { position: absolute; border: 1px solid var(--brand-primary); background: var(--brand-primary-soft); pointer-events: none; display: none; z-index: 2000; }

        .drawer { position: relative; width: 340px; flex: 0 0 340px; height: 100%; min-height: 0; background: white; border-left: 1px solid var(--brand-light); z-index: 200; padding: 24px; overflow-y: auto; display: none; box-sizing: border-box; }
        .sidebar-icon-btn { width: 60px; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--brand-text); opacity: 0.6; transition: 0.2s; border-radius: 12px; }
        .sidebar-icon-btn:hover, .sidebar-icon-btn.active { opacity: 1; background: var(--brand-primary-soft); color: var(--brand-primary); }

        .slides-panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--brand-text); font-size: 11px; font-weight: 950; }
        .slides-panel-heading small { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: var(--brand-primary); background: var(--brand-primary-tint); font-size: 9px; }
        .slide-thumb { position: relative; width: 100%; height: 100px; background: white; border: 2px solid var(--brand-light); margin-bottom: 16px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color .2s, box-shadow .2s, transform .2s, opacity .2s; background-size: cover; background-position: center; overflow: visible; }
        .slide-thumb.active { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .slide-thumb.is-dragging { opacity: .38; transform: scale(.97); }
        .slide-thumb.drop-before::before, .slide-thumb.drop-after::after { content: ''; position: absolute; left: 0; right: 0; height: 4px; border-radius: 999px; background: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); z-index: 20; }
        .slide-thumb.drop-before::before { top: -11px; }
        .slide-thumb.drop-after::after { bottom: -11px; }
        .slide-thumb-number { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: #64748b; background: rgba(255,255,255,.9); box-shadow: 0 4px 12px rgba(15,23,42,.1); font-size: 11px; font-weight: 950; }
        .slide-thumb.active .slide-thumb-number { color: #fff; background: var(--brand-primary); }
        .slide-thumb-actions { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%) translateY(4px); display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #e2e8f0; border-radius: 9px; background: rgba(255,255,255,.97); box-shadow: 0 8px 18px rgba(15,23,42,.14); opacity: 0; pointer-events: none; transition: .18s; z-index: 25; }
        .slide-thumb:hover .slide-thumb-actions, .slide-thumb.active .slide-thumb-actions { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
        .slide-thumb-actions button { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: #64748b; background: transparent; cursor: pointer; }
        .slide-thumb-actions button:hover { color: var(--brand-primary); background: var(--brand-primary-tint); }
        .slide-thumb-actions button:disabled { opacity: .25; cursor: default; background: transparent; }
        .slide-thumb-actions button.slide-drag-handle { cursor: grab; color: var(--brand-primary); }
        .slide-thumb-actions button.slide-drag-handle:active { cursor: grabbing; }
        .slide-thumb-actions button.slide-delete-btn { color: #dc2626; }
        .slide-thumb-actions button.slide-delete-btn:hover { background: #fff1f2; }
        .slide-thumb-actions svg { width: 13px; height: 13px; }

        .history-btn { padding: 8px; border-radius: 8px; color: var(--brand-text); opacity: 0.4; transition: 0.2s; }
        .history-btn.active { opacity: 1; cursor: pointer; background: #f1f5f9; }
        .selection-tools {
            position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(16px);
            display: flex; align-items: center; gap: 3px; padding: 8px 10px; border-radius: 16px;
            color: #fff; background: rgba(30,41,59,.97); border: 1px solid rgba(255,255,255,.12);
            box-shadow: 0 18px 44px rgba(15,23,42,.28); z-index: 2600; opacity: 0; pointer-events: none;
            transition: opacity .18s, transform .18s; backdrop-filter: blur(14px);
        }
        .selection-tools.visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
        .selection-tools-summary { display: flex; align-items: center; gap: 6px; padding: 0 7px; white-space: nowrap; color: #cbd5e1; font-size: 10px; font-weight: 850; }
        .selection-tools-summary b { color: #fff; }
        .selection-tools-summary svg { width: 14px; height: 14px; color: var(--brand-secondary); }
        .selection-tools-divider { width: 1px; height: 22px; margin: 0 4px; background: rgba(255,255,255,.16); }
        .selection-tools button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #e2e8f0; transition: .15s; cursor: pointer; }
        .selection-tools button:hover { color: #fff; background: rgba(255,255,255,.12); }
        .selection-tools button:disabled { opacity: .25; cursor: not-allowed; background: transparent; }
        .selection-tools button svg { width: 16px; height: 16px; }
        .selection-tools .selection-delete-btn { color: #fca5a5; }
        .selection-tools .selection-delete-btn:hover { color: #fff; background: #dc2626; }
        .selection-tools-menu-wrap { position: relative; }
        .selection-layer-menu {
            position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%) translateY(8px);
            width: 210px; padding: 7px; border-radius: 13px; background: #fff; border: 1px solid #e2e8f0;
            box-shadow: 0 18px 44px rgba(15,23,42,.2); opacity: 0; pointer-events: none; transition: .16s;
        }
        .selection-layer-menu.open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
        .selection-layer-menu button { width: 100%; height: auto; min-height: 35px; display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding: 8px 10px; color: #475569; font-size: 11px; font-weight: 850; text-align: right; }
        .selection-layer-menu button:hover { color: var(--brand-primary); background: var(--brand-primary-tint); }
        .selection-layer-menu button svg { width: 15px; height: 15px; flex: 0 0 auto; }

        .selection-transform-box {
            position: absolute; z-index: 1750; border: 1.5px dashed var(--brand-primary); pointer-events: none;
            box-sizing: border-box; transform-origin: center; border-radius: 12px;
        }
        .selection-transform-box.is-group::before {
            content: attr(data-label); position: absolute; right: 0; top: -25px; padding: 3px 7px;
            border-radius: 7px; color: #fff; background: var(--brand-primary); font-size: 8px; font-weight: 900; white-space: nowrap;
        }
        .selection-transform-handle { position: absolute; width: 9px; height: 9px; border: 1.5px solid var(--brand-primary); border-radius: 50%; background: #fff; pointer-events: auto; box-shadow: 0 1px 4px rgba(15,23,42,.14); transition: transform .12s, box-shadow .12s; }
        .selection-transform-handle:hover { box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .selection-transform-handle[data-direction="nw"] { left: -5px; top: -5px; cursor: nwse-resize; }
        .selection-transform-handle[data-direction="n"] { left: 50%; top: -5px; transform: translateX(-50%); cursor: ns-resize; }
        .selection-transform-handle[data-direction="n"]:hover { transform: translateX(-50%) scale(1.08); }
        .selection-transform-handle[data-direction="ne"] { right: -5px; top: -5px; cursor: nesw-resize; }
        .selection-transform-handle[data-direction="e"] { right: -5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
        .selection-transform-handle[data-direction="e"]:hover { transform: translateY(-50%) scale(1.08); }
        .selection-transform-handle[data-direction="se"] { right: -5px; bottom: -5px; cursor: nwse-resize; }
        .selection-transform-handle[data-direction="s"] { left: 50%; bottom: -5px; transform: translateX(-50%); cursor: ns-resize; }
        .selection-transform-handle[data-direction="s"]:hover { transform: translateX(-50%) scale(1.08); }
        .selection-transform-handle[data-direction="sw"] { left: -5px; bottom: -5px; cursor: nesw-resize; }
        .selection-transform-handle[data-direction="w"] { left: -5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
        .selection-transform-handle[data-direction="w"]:hover { transform: translateY(-50%) scale(1.08); }
        .selection-rotation-hotspot {
            position: absolute; left: 50%; top: -27px; width: 40px; height: 18px;
            transform: translateX(-50%); pointer-events: auto; cursor: grab; background: transparent;
        }
        .selection-rotation-hotspot:active { cursor: grabbing; }
        .shape-corner-control { position: absolute; width: 12px; height: 12px; border-radius: 50%; pointer-events: auto; z-index: 3; transition: transform .14s, box-shadow .14s; }
        .shape-corner-control:hover { transform: scale(1.22); }
        .shape-rotation-control { left: 10px; top: 10px; cursor: grab; background: #fff; border: 2px solid var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint), 0 3px 9px rgba(15,23,42,.18); }
        .shape-rotation-control:active { cursor: grabbing; }
        .shape-radius-control { right: 10px; top: 10px; cursor: nwse-resize; background: var(--brand-secondary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--brand-secondary), 0 3px 9px rgba(15,23,42,.18); }
        .shape-corners-menu { position: absolute; right: 22px; top: 22px; z-index: 12; width: 230px; display: grid; gap: 10px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 15px; color: var(--brand-text); background: rgba(255,255,255,.98); box-shadow: 0 18px 44px rgba(15,23,42,.2); pointer-events: auto; direction: rtl; }
        .shape-corners-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .shape-corners-menu-head > span { display: grid; gap: 1px; }
        .shape-corners-menu-head b { font-size: 10px; font-weight: 950; }
        .shape-corners-menu-head small { color: #94a3b8; font-size: 7px; font-weight: 800; }
        .shape-corners-menu-head > button { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: #64748b; background: #f1f5f9; }
        .shape-corners-menu-head svg { width: 13px; height: 13px; }
        .shape-corners-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; direction: rtl; }
        .shape-corners-grid button { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 7px; border: 1px solid #e2e8f0; border-radius: 9px; color: #64748b; background: #fff; transition: .15s; }
        .shape-corners-grid button > span { width: 20px; height: 20px; flex: 0 0 auto; border: 2px solid #cbd5e1; background: #f8fafc; }
        .shape-corners-grid button b { min-width: 0; font-size: 7px; font-weight: 900; white-space: nowrap; }
        .shape-corners-grid button.active { color: var(--brand-primary); border-color: var(--brand-primary); background: var(--brand-primary-tint); }
        .shape-corners-grid button.active > span { border-color: var(--brand-primary); background: #fff; }
        .shape-corners-grid .corner-tr > span { border-radius: 0 10px 0 0; }
        .shape-corners-grid .corner-tl > span { border-radius: 10px 0 0 0; }
        .shape-corners-grid .corner-br > span { border-radius: 0 0 10px 0; }
        .shape-corners-grid .corner-bl > span { border-radius: 0 0 0 10px; }
        .shape-corners-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
        .shape-corners-presets button { padding: 7px; border-radius: 8px; color: var(--brand-primary); background: var(--brand-primary-tint); font-size: 7px; font-weight: 950; }
        .shape-corners-tip { color: #94a3b8; font-size: 7px; font-weight: 750; line-height: 1.5; }
        body.element-transforming, body.element-transforming * { user-select: none !important; -webkit-user-select: none !important; }
        .image-content { max-width: 100%; pointer-events: none; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: block; }
        
        .ready-item-card { border: 1px solid #eee; border-radius: 12px; padding: 12px; cursor: pointer; transition: 0.2s; background: #fafafa; margin-bottom: 8px; text-align: right; }
        .ready-item-card:hover { border-color: var(--brand-primary); background: white; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

        .shape-library-intro { display: flex; flex-direction: column; gap: 4px; padding: 15px; border-radius: 16px; color: var(--brand-text); background: linear-gradient(135deg, var(--brand-primary-tint), #fff); border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, #e2e8f0); }
        .shape-library-intro span { color: var(--brand-primary); font-size: 9px; font-weight: 950; letter-spacing: .08em; direction: ltr; text-align: right; }
        .shape-library-intro strong { font-size: 15px; font-weight: 950; }
        .shape-library-intro small { color: #64748b; font-size: 10px; font-weight: 700; line-height: 1.7; }
        .shape-library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
        .shape-library-card { min-width: 0; min-height: 118px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 15px; color: #475569; background: #fff; transition: .2s; }
        .shape-library-card:hover { color: var(--brand-primary); border-color: var(--brand-primary); background: var(--brand-primary-tint); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15,23,42,.08); }
        .shape-library-card b { font-size: 10px; font-weight: 900; text-align: center; }
        .shape-library-preview { width: 64px; height: 54px; display: grid; place-items: center; color: var(--brand-primary); }
        .shape-library-preview svg { width: 48px; height: 48px; stroke-width: 1.6; }
        .shape-library-preview.preview-line svg { width: 58px; }

        .basic-shape-root { position: relative; width: 100%; height: 100%; min-width: 1px; min-height: 1px; }
        .basic-shape-surface, .basic-shape-fill, .basic-shape-media { position: absolute; display: block; }
        .basic-shape-surface { inset: 0; overflow: hidden; }
        .basic-shape-fill { pointer-events: none; }
        .basic-shape-media { width: auto; height: auto; max-width: none; pointer-events: none; transform-origin: center; user-select: none; -webkit-user-drag: none; will-change: transform; }
        .element-wrapper.shape-image-editing .basic-shape-media { pointer-events: auto; cursor: grab; }
        .element-wrapper.shape-image-editing .basic-shape-media:active, body.shape-image-panning * { cursor: grabbing !important; }
        .element-wrapper.shape-image-editing .element-drag-zone { display: none !important; }
        .element-wrapper.has-shape-image.selected:not(.shape-image-editing)::after { content: 'انقر مرتين لتحرير الصورة'; position: absolute; left: 50%; top: calc(100% + 8px); z-index: 18; transform: translateX(-50%); padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--brand-primary) 24%, #e2e8f0); border-radius: 999px; color: var(--brand-primary); background: #fff; box-shadow: 0 7px 18px rgba(15,23,42,.1); font-size: 8px; font-weight: 900; white-space: nowrap; pointer-events: none; }
        .shape-image-quick-edit { position: absolute; left: 50%; bottom: -38px; z-index: 2200; display: none; align-items: center; gap: 6px; transform: translateX(-50%) rotate(var(--element-counter-rotation, 0deg)) scale(var(--element-ui-scale, 1)); transform-origin: center; padding: 7px 11px; border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, #e2e8f0); border-radius: 10px; color: var(--brand-primary); background: #fff; box-shadow: 0 9px 22px rgba(15,23,42,.14); font-size: 8px; font-weight: 950; white-space: nowrap; cursor: pointer; }
        .shape-image-quick-edit svg { width: 13px; height: 13px; }
        .element-wrapper.has-shape-image.selected.single-select:not(.shape-image-editing) .shape-image-quick-edit { display: flex; }
        .element-wrapper.has-shape-image.selected.single-select:not(.shape-image-editing)::after { display: none; }
        .element-wrapper.shape-image-editing .basic-shape-root::after { content: 'اسحب الصورة لتحريكها داخل الشكل'; position: absolute; left: 50%; bottom: 10px; z-index: 6; transform: translateX(-50%); max-width: calc(100% - 20px); padding: 5px 9px; border-radius: 999px; color: #fff; background: rgba(15,23,42,.72); box-shadow: 0 5px 16px rgba(15,23,42,.2); font-size: 8px; font-weight: 900; white-space: nowrap; pointer-events: none; }
        .basic-shape-line-root { display: flex; align-items: center; justify-content: center; overflow: visible; }
        .basic-shape-line { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); border-radius: 999px; }

        .shape-properties-menu { top: 52px; width: 318px; flex-direction: column; gap: 11px; padding: 14px; direction: rtl; border-radius: 16px; }
        .shape-property-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid #eef2f7; }
        .shape-property-head > span { display: grid; gap: 2px; }
        .shape-property-head strong { color: var(--brand-text); font-size: 12px; font-weight: 950; }
        .shape-property-head small { color: #94a3b8; font-size: 8px; font-weight: 850; }
        .shape-property-head > svg { width: 20px; height: 20px; padding: 4px; border-radius: 7px; color: var(--brand-primary); background: var(--brand-primary-tint); }
        .shape-style-section { display: grid; gap: 7px; }
        .shape-style-section > b { color: #64748b; font-size: 9px; font-weight: 900; }
        .shape-brand-palette { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
        .shape-brand-swatch { position: relative; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; transition: .15s; }
        .shape-brand-swatch span { width: 20px; height: 20px; border-radius: 7px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(15,23,42,.08); }
        .shape-brand-swatch:hover { transform: translateY(-1px); border-color: var(--brand-primary); }
        .shape-brand-swatch.active { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .shape-brand-swatch.active::after { content: ''; position: absolute; left: -2px; top: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-primary); border: 2px solid #fff; }
        .shape-style-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 2px; }
        .shape-preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: #f1f5f9; }
        .shape-preset-row.compact { grid-template-columns: repeat(5, 1fr); }
        .shape-preset-row button { min-width: 0; padding: 6px 3px; border-radius: 7px; color: #64748b; font-size: 8px; font-weight: 900; transition: .14s; }
        .shape-preset-row button:hover { color: var(--brand-primary); background: #fff; }
        .shape-preset-row button.active { color: #fff; background: var(--brand-primary); box-shadow: 0 4px 10px var(--brand-primary-shadow); }
        .shape-direct-hint { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 8px 9px; border-radius: 10px; color: #64748b; background: #f8fafc; font-size: 8px; }
        .shape-direct-hint b { font-weight: 800; margin-left: 5px; }
        .shape-hint-dot { width: 8px; height: 8px; border-radius: 50%; }
        .shape-hint-dot.rotate { background: var(--brand-primary); }
        .shape-hint-dot.radius { background: var(--brand-secondary); }
        .shape-image-section { padding: 10px; border: 1px solid color-mix(in srgb, var(--brand-primary) 15%, #e2e8f0); border-radius: 12px; background: linear-gradient(135deg, var(--brand-primary-tint), #fff); }
        .shape-image-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .shape-image-section-head > span { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--brand-text); }
        .shape-image-section-head svg { width: 14px; height: 14px; color: var(--brand-primary); }
        .shape-image-section-head b { font-size: 9px; font-weight: 950; }
        .shape-image-section-head small { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #94a3b8; font-size: 8px; direction: ltr; }
        .shape-image-actions { display: grid; grid-template-columns: 1.2fr .8fr .8fr .75fr; gap: 5px; }
        .shape-image-actions button { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 5px; border: 1px solid #e2e8f0; border-radius: 8px; color: #64748b; background: #fff; font-size: 8px; font-weight: 900; }
        .shape-image-actions button svg { width: 12px; height: 12px; }
        .shape-image-actions button.active { color: #fff; border-color: var(--brand-primary); background: var(--brand-primary); }
        .shape-image-actions button.edit { color: var(--brand-primary); border-color: color-mix(in srgb, var(--brand-primary) 28%, #e2e8f0); background: var(--brand-primary-tint); }
        .shape-image-actions button.edit.active { color: #fff; border-color: var(--brand-primary); background: var(--brand-primary); }
        .shape-image-actions button.danger { color: #dc2626; }
        .shape-image-actions button.danger:hover { color: #fff; border-color: #dc2626; background: #dc2626; }
        .canvas-floating-toolbar .t-btn.is-active { color: #fff; background: var(--brand-primary); }
        .shape-image-edit-toolbar { position: absolute; z-index: 2400; display: flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; color: #fff; background: var(--brand-dark); box-shadow: 0 14px 34px rgba(15,23,42,.24); transform: translateX(-50%); direction: rtl; }
        .shape-image-edit-toolbar.place-above { transform: translate(-50%, -100%); }
        .shape-image-edit-label { display: flex; align-items: center; gap: 6px; padding: 0 5px; white-space: nowrap; }
        .shape-image-edit-label > span { display: grid; gap: 1px; }
        .shape-image-edit-label svg { width: 14px; height: 14px; color: var(--brand-secondary); }
        .shape-image-edit-label b { font-size: 9px; font-weight: 950; }
        .shape-image-edit-label small { color: #94a3b8; font-size: 7px; font-weight: 750; }
        .shape-image-edit-group { display: flex; align-items: center; gap: 4px; }
        .shape-image-edit-toolbar button { min-width: 29px; height: 29px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 7px; border-radius: 8px; color: #cbd5e1; background: rgba(255,255,255,.06); transition: .14s; }
        .shape-image-edit-toolbar button.labeled span { display: inline; font-size: 7px; font-weight: 900; white-space: nowrap; }
        .shape-image-edit-toolbar button:hover, .shape-image-edit-toolbar button.active { color: #fff; background: var(--brand-primary); }
        .shape-image-edit-toolbar button svg { width: 14px; height: 14px; }
        .shape-image-edit-toolbar button.done { color: #fff; background: var(--brand-primary); font-size: 9px; font-weight: 950; }
        .shape-image-edit-divider { width: 1px; height: 20px; background: rgba(255,255,255,.17); }
        .shape-image-zoom-value { min-width: 35px; color: #fff; font-size: 8px; font-weight: 900; text-align: center; direction: ltr; }

        .project-save-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .editor-cloud-status { width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; color:#64748b; background:#f1f5f9; }
        .editor-cloud-status svg { width:10px; height:10px; }
        .editor-cloud-status.ready, .editor-cloud-status.synced { color:#047857; background:#d1fae5; }
        .editor-cloud-status.pending, .editor-cloud-status.syncing, .editor-cloud-status.loading, .editor-cloud-status.retrying, .editor-cloud-status.uploading { color:#a16207; background:#fef3c7; }
        .editor-cloud-status.error { color:#b91c1c; background:#fee2e2; }
        .app-version-badge { padding: 2px 6px; border-radius: 999px; color: var(--brand-primary); background: var(--brand-primary-tint); font-size: 7px; font-weight: 950; direction: ltr; }

        .library-section-heading { font-weight: 800; color: #94a3b8; font-size: 11px; margin: 18px 0 10px; text-transform: uppercase; }
        .text-library-intro { display:grid; gap:5px; margin-bottom:13px; padding:14px; overflow:hidden; border:1px solid color-mix(in srgb,var(--brand-primary) 18%,#e2e8f0); border-radius:16px; color:var(--brand-text); background:linear-gradient(135deg,var(--brand-primary-tint),#fff); }
        .text-library-intro span { color:var(--brand-primary); font-size:8px; font-weight:950; letter-spacing:.08em; direction:ltr; text-align:right; }
        .text-library-intro strong { font-size:13px; font-weight:950; line-height:1.5; }
        .text-library-intro small { color:#64748b; font-size:8px; font-weight:750; line-height:1.7; }
        .library-card-btn { width: 100%; padding: 16px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; margin-bottom: 10px; text-align: right; transition: 0.2s; display: flex; flex-direction: column; gap: 4px; }
        .library-card-btn:hover { border-color: var(--brand-primary); background: var(--brand-primary-tint); transform: translateY(-1px); }
        .library-card-btn.has-preview { position: relative; min-height: 142px; display: grid; grid-template-columns: 112px minmax(0,1fr); align-items: center; gap: 13px; overflow: hidden; padding: 13px; border-radius: 17px; background: linear-gradient(145deg, #fff, var(--brand-primary-tint)); }
        .library-card-btn.has-preview::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 1px rgba(255,255,255,.85); }
        .library-card-btn.has-preview:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(15,23,42,.1); }
        .library-visual-preview { position: relative; width: 112px; height: 104px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(226,232,240,.85); border-radius: 13px; color: var(--brand-primary); background: linear-gradient(145deg,#fff,#f8fafc); box-shadow: 0 8px 18px rgba(15,23,42,.08); pointer-events: none; }
        .library-table-preview { position: relative; }
        .library-table-preview > svg { position: absolute; right: 7px; top: 7px; width: 16px; height: 16px; padding: 3px; border-radius: 5px; color: #fff; background: var(--brand-primary); }
        .mini-table { width: 88px; display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; padding: 5px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
        .mini-table b { height: 9px; background: var(--brand-primary); }
        .mini-table i { height: 8px; background: #eef2f7; }
        .library-live-preview { isolation: isolate; }
        .library-live-preview-stage { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(var(--library-preview-scale)); transform-origin: center; direction: rtl; font-family: inherit; }
        .library-live-preview-stage, .library-live-preview-stage * { box-sizing: border-box; }
        .library-live-preview-stage [contenteditable] { outline: none !important; }
        .library-preview-kind { position: absolute; right: 7px; top: 7px; z-index: 4; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 6px; color: #fff !important; background: var(--brand-primary); box-shadow: 0 4px 9px var(--brand-primary-shadow); }
        .library-preview-kind svg { width: 10px; height: 10px; stroke-width: 1.7; }
        .library-preview-fallback svg { width: 28px; height: 28px; stroke-width: 1.5; }
        .library-text-preview { background: linear-gradient(145deg,#fff,color-mix(in srgb,var(--brand-primary-tint) 60%,#fff)); }
        .library-text-preview-stage { width: 82px; min-height: 62px; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px; color: var(--brand-text); direction: rtl; }
        .library-text-preview-stage > i, .text-preview-lines i { height: 4px; display: block; border-radius: 999px; background: color-mix(in srgb,var(--brand-text) 28%,#e2e8f0); }
        .library-text-preview-stage i.short, .text-preview-lines i.short { width: 58%; }
        .text-preview-heading { display: block; color: var(--brand-primary); font-size: 27px; font-weight: 950; line-height: 1; text-align: right; direction: ltr; }
        .text-preview-subheading { display: block; color: var(--brand-text); font-size: 21px; font-weight: 850; line-height: 1; text-align: right; direction: ltr; }
        .text-preview-lines { display: grid; gap: 6px; }
        .text-preview-list { display: grid; gap: 8px; }
        .text-preview-list > i { display: grid; grid-template-columns: 8px 1fr; align-items: center; gap: 6px; background: none; }
        .text-preview-list b { width: 7px; height: 7px; display: block; border-radius: 50%; background: var(--brand-primary); }
        .text-preview-list em { height: 4px; display: block; border-radius: 999px; background: color-mix(in srgb,var(--brand-text) 26%,#e2e8f0); }
        .text-preview-number { color: var(--brand-primary); font-size: 27px; font-weight: 950; line-height: 1; direction: ltr; text-align: right; }
        .text-preview-quote { height: 22px; color: var(--brand-primary); font-family: Georgia,serif; font-size: 36px; font-weight: 950; line-height: 1; text-align: right; }
        .library-card-copy { min-width: 0; display: grid; gap: 6px; text-align: right; }
        .library-card-copy strong { color: var(--brand-text); font-size: 12px; font-weight: 950; }
        .library-card-copy small { color: #64748b; font-size: 8px; font-weight: 750; line-height: 1.65; }
        .library-card-add { position: absolute; left: 10px; bottom: 10px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--brand-primary); box-shadow: 0 7px 15px var(--brand-primary-shadow); }
        .library-card-add svg { width: 14px; height: 14px; }

        .canvas-floating-toolbar.text-toolbar { gap: 3px; padding: 7px 10px; }
        .canvas-floating-toolbar.text-toolbar .t-btn { min-width: 29px; min-height: 29px; }
        .canvas-floating-toolbar.text-toolbar .t-btn svg { width: 14px; height: 14px; stroke-width: 1.65; }
        .text-properties-menu { top: 52px; width: 344px; max-height: 470px; overflow:auto; flex-direction: column; gap: 11px; padding: 14px; direction: rtl; border-radius: 17px; }
        .text-menu-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:9px; border-bottom:1px solid #eef2f7; }
        .text-menu-head > span { display:grid; gap:2px; }
        .text-menu-head strong { color:var(--brand-text); font-size:12px; font-weight:950; }
        .text-menu-head small { color:#94a3b8; font-size:8px; font-weight:800; }
        .text-menu-head > svg { width:22px; height:22px; padding:4px; border-radius:7px; color:var(--brand-primary); background:var(--brand-primary-tint); stroke-width:1.6; }
        .text-properties-menu section { display:grid; gap:7px; }
        .text-properties-menu section > b { color:#64748b; font-size:9px; font-weight:900; }
        .text-marker-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
        .text-marker-grid button { min-width:0; display:grid; grid-template-columns:16px minmax(0,1fr); align-items:center; gap:5px; padding:7px 6px; border:1px solid #e2e8f0; border-radius:9px; color:#64748b; background:#fff; font-size:7px; font-weight:900; }
        .text-marker-grid button:hover, .text-marker-grid button.active { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .text-marker-grid svg { width:14px; height:14px; stroke-width:1.7; }
        .text-title-options { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
        .text-title-options button { display:flex; align-items:center; justify-content:center; gap:5px; padding:8px; border:1px solid #e2e8f0; border-radius:9px; color:#64748b; background:#fff; font-size:8px; font-weight:900; }
        .text-title-options button.active { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .text-title-options svg { width:13px; height:13px; stroke-width:1.7; }
        .text-preset-row { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; }
        .text-preset-row button { min-width:0; height:29px; display:grid; place-items:center; padding:0 3px; border:1px solid #e2e8f0; border-radius:8px; color:#64748b; background:#fff; font-size:7px; font-weight:900; }
        .text-preset-row button:hover, .text-preset-row button.active { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .text-menu-tip { padding:8px 9px; border-radius:9px; color:#64748b; background:#f8fafc; font-size:7px; font-weight:750; line-height:1.7; }
        .text-numbering-start { display:grid; grid-template-columns:74px minmax(0,1fr); align-items:center; gap:7px; }
        .text-numbering-start input { width:100%; height:34px; padding:0 9px; outline:none; border:1px solid #e2e8f0; border-radius:9px; color:var(--brand-text); background:#fff; font-size:11px; font-weight:900; direction:ltr; text-align:center; }
        .text-numbering-start input:focus { border-color:var(--brand-primary); box-shadow:0 0 0 3px var(--brand-primary-tint); }
        .text-numbering-start > div { display:grid; grid-template-columns:repeat(5,1fr); gap:4px; }
        .text-numbering-start button { height:30px; display:grid; place-items:center; border:1px solid #e2e8f0; border-radius:7px; color:#64748b; background:#fff; font-size:8px; font-weight:900; }
        .text-numbering-start button.active, .text-numbering-start button:hover { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .text-design-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:5px; }
        .text-design-grid button { min-width:0; display:grid; justify-items:center; gap:5px; padding:6px 3px; border:1px solid #e2e8f0; border-radius:9px; color:#64748b; background:#fff; }
        .text-design-grid button:hover, .text-design-grid button.active { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .text-design-grid button > span { width:38px; height:26px; display:grid; place-items:center; border:1px solid currentColor; border-radius:7px; background:color-mix(in srgb,currentColor 7%,#fff); }
        .text-design-grid button[data-design="minimal"] > span, .text-design-grid button[data-design="hero"] > span { border-style:dashed; background:transparent; }
        .text-design-grid button[data-design="ribbon"] > span, .text-design-grid button[data-design="pill"] > span { color:#fff; border-color:var(--brand-primary); background:var(--brand-primary); }
        .text-design-grid button[data-design="pill"] > span { border-radius:999px; }
        .text-design-grid button svg { width:13px; height:13px; stroke-width:1.6; }
        .text-design-grid button small { font-size:6.5px; font-weight:900; white-space:nowrap; }

        .smart-list-content { cursor:default; }
        .preznta-smart-list { width:100%; display:grid; gap:14px; color:var(--list-text); direction:rtl; }
        .preznta-list-title { width:100%; min-height:1.3em; outline:none; color:var(--list-text); font-size:var(--list-title-size); font-weight:900; line-height:1.35; cursor:text; }
        .preznta-list-title:focus, .preznta-list-item:focus { border-radius:5px; box-shadow:0 0 0 3px var(--brand-primary-tint); }
        .preznta-list-items { display:grid; gap:var(--list-gap); }
        .preznta-list-row { min-width:0; display:flex; align-items:flex-start; gap:12px; }
        .preznta-list-item { min-width:0; min-height:1.65em; flex:1; outline:none; color:var(--list-text); font-size:var(--list-size); font-weight:inherit; line-height:inherit; cursor:text; white-space:pre-wrap; overflow-wrap:anywhere; }
        .preznta-list-marker { width:22px; min-width:22px; height:1.65em; font-size:1.08em; text-align:center; pointer-events:none; }
        .preznta-list-marker.marker-square { font-size:.72em; }
        .preznta-list-marker.marker-dash { font-size:1.15em; }
        .preznta-list-marker.marker-diamond { font-size:.72em; }
        .preznta-list-marker.marker-check { font-size:.9em; }
        .preznta-list-marker.marker-gradient::before { content:''; width:10px; height:10px; display:block; border-radius:50%; opacity:var(--marker-opacity); background:linear-gradient(135deg,var(--marker-accent),color-mix(in srgb,var(--marker-accent) 35%,#fff)); box-shadow:0 3px 8px color-mix(in srgb,var(--marker-accent) 28%,transparent); }
        .preznta-list-marker.marker-decimal { width:28px; min-width:28px; font-size:.78em; direction:ltr; }
        .preznta-list-marker.marker-number { width:24px; min-width:24px; height:24px; margin-top:.15em; color:#fff !important; font-size:.62em; box-shadow:0 4px 9px color-mix(in srgb,var(--list-accent) 22%,transparent); }
        .preznta-list-marker.marker-number-circle { border-radius:50%; }
        .preznta-list-marker.marker-number-square { border-radius:6px; }

        .preznta-big-number { position:relative; width:100%; min-height:118px; display:flex; align-items:center; overflow:hidden; padding:22px 24px; border-radius:var(--number-radius); color:var(--number-text); direction:rtl; }
        .preznta-number-copy { position:relative; z-index:2; width:100%; display:grid; gap:7px; }
        .preznta-number-value, .preznta-number-label, .preznta-quote-body, .preznta-quote-source { min-width:12px; outline:none; cursor:text; }
        .preznta-number-value { display:block; color:var(--number-accent); font-size:var(--number-value-size); font-weight:950; line-height:1; direction:ltr; text-align:right; }
        .preznta-number-label { display:block; color:var(--number-text); font-size:var(--number-label-size); font-weight:inherit; line-height:1.45; }
        .preznta-number-value:focus, .preznta-number-label:focus, .preznta-quote-body:focus, .preznta-quote-source:focus { border-radius:6px; box-shadow:0 0 0 3px color-mix(in srgb,var(--brand-primary) 15%,transparent); }
        .preznta-number-accent { pointer-events:none; }
        .big-number-hero { padding-inline:4px; background:transparent; }
        .big-number-hero .preznta-number-accent { position:absolute; top:14px; right:4px; width:54px; height:5px; border-radius:999px; background:var(--number-accent); }
        .big-number-hero .preznta-number-copy { padding-top:12px; }
        .big-number-badge { border:1px solid color-mix(in srgb,var(--number-accent) 20%,#e2e8f0); background:#fff; box-shadow:0 14px 32px rgba(15,23,42,.1); }
        .big-number-badge .preznta-number-accent { position:absolute; left:18px; top:18px; width:40px; height:40px; border-radius:13px; background:color-mix(in srgb,var(--number-accent) 12%,#fff); }
        .big-number-badge .preznta-number-accent::after { content:''; position:absolute; inset:11px; border:3px solid var(--number-accent); border-radius:50%; }
        .big-number-split { border:1px solid color-mix(in srgb,var(--number-accent) 22%,#e2e8f0); background:linear-gradient(90deg,#fff 0 68%,color-mix(in srgb,var(--number-accent) 14%,#fff) 68% 100%); }
        .big-number-split .preznta-number-accent { position:absolute; right:0; top:0; bottom:0; width:8px; background:var(--number-accent); }
        .big-number-outline { border:2px solid var(--number-accent); background:transparent; }
        .big-number-outline .preznta-number-accent { position:absolute; left:20px; bottom:18px; width:42px; height:42px; border-left:2px solid var(--number-accent); border-bottom:2px solid var(--number-accent); border-radius:0 0 0 12px; opacity:.35; }
        .big-number-pill { justify-content:center; border-radius:999px; background:var(--number-accent); box-shadow:0 14px 30px color-mix(in srgb,var(--number-accent) 28%,transparent); text-align:center; }
        .big-number-pill .preznta-number-copy { justify-items:center; }
        .big-number-pill .preznta-number-value, .big-number-pill .preznta-number-label { color:#fff; text-align:center; }

        .preznta-smart-quote { position:relative; width:100%; min-height:138px; display:flex; align-items:center; gap:15px; overflow:hidden; padding:22px 24px; border-radius:var(--quote-radius); color:var(--quote-text); direction:rtl; }
        .preznta-quote-copy { position:relative; z-index:2; min-width:0; flex:1; display:grid; gap:10px; }
        .preznta-quote-body { display:block; color:inherit; font-size:var(--quote-size); font-weight:inherit; line-height:inherit; white-space:pre-wrap; overflow-wrap:anywhere; }
        .preznta-quote-source { display:block; color:var(--quote-accent); font-size:var(--quote-source-size); font-weight:900; line-height:1.4; }
        .preznta-quote-mark { position:relative; z-index:2; flex:0 0 auto; color:var(--quote-accent); font-family:Georgia,serif; font-size:62px; font-weight:950; line-height:.8; pointer-events:none; }
        .quote-sidebar { border-right:7px solid var(--quote-accent); background:#fff; box-shadow:0 12px 28px rgba(15,23,42,.08); }
        .quote-card { border:1px solid color-mix(in srgb,var(--quote-accent) 20%,#e2e8f0); background:#fff; box-shadow:0 18px 38px rgba(15,23,42,.12); }
        .quote-card .preznta-quote-mark { width:58px; height:58px; display:grid; place-items:center; padding-top:16px; border-radius:18px; color:#fff; background:var(--quote-accent); box-shadow:0 10px 22px color-mix(in srgb,var(--quote-accent) 25%,transparent); }
        .quote-minimal { padding-inline:5px; background:transparent; }
        .quote-minimal .preznta-quote-mark { align-self:flex-start; font-size:82px; opacity:.22; }
        .quote-highlight { border:1px solid color-mix(in srgb,var(--quote-accent) 24%,#e2e8f0); background:color-mix(in srgb,var(--quote-accent) 10%,#fff); }
        .quote-highlight::after { content:''; position:absolute; right:0; bottom:0; left:0; height:7px; background:linear-gradient(90deg,transparent,var(--quote-accent)); }
        .quote-ribbon { color:#fff; background:var(--quote-accent); box-shadow:0 16px 34px color-mix(in srgb,var(--quote-accent) 28%,transparent); }
        .quote-ribbon .preznta-quote-mark, .quote-ribbon .preznta-quote-body, .quote-ribbon .preznta-quote-source { color:#fff; }
        .quote-ribbon .preznta-quote-mark { opacity:.72; }

        .canvas-floating-toolbar.table-toolbar { gap: 3px; padding: 7px 10px; }
        .canvas-floating-toolbar.table-toolbar .t-btn { min-width: 28px; min-height: 28px; padding: 5px 6px; font-size: 10px; font-weight: 650; }
        .canvas-floating-toolbar.table-toolbar .t-btn svg { width: 13px !important; height: 13px !important; stroke-width: 1.55 !important; }
        .canvas-floating-toolbar.table-toolbar .t-divider { height: 17px; margin-inline: 4px; opacity: .7; }
        .table-dimension-group { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(255,255,255,.055); }
        .canvas-floating-toolbar .table-action-labeled { width: auto; gap: 3px; padding-inline: 6px; }
        .canvas-floating-toolbar .table-action-labeled span { font-size: 7px; font-weight: 800; white-space: nowrap; }
        .canvas-floating-toolbar.table-toolbar .table-action-labeled.subtle-danger { color: #fda4af; }
        .canvas-floating-toolbar.table-toolbar .table-action-labeled.subtle-danger:hover { color: #fff; background: rgba(239,68,68,.75); }
        .table-advanced-dimensions { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; }
        .table-advanced-dimensions button { min-height:32px; display:flex; align-items:center; justify-content:center; gap:3px; padding:5px 3px; border:1px solid #e2e8f0; border-radius:8px; color:#64748b; background:#fff; font-size:7px; font-weight:850; }
        .table-advanced-dimensions button:hover { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-primary-tint); }
        .table-advanced-dimensions svg { width:11px; height:11px; stroke-width:1.7; }
        .canvas-floating-toolbar.kpi-toolbar { gap: 4px; padding: 8px 11px; }
        .canvas-floating-toolbar.kpi-toolbar .t-btn svg { width: 14px; height: 14px; stroke-width: 1.65; }
        .kpi-properties-menu { top: 52px; width: 338px; flex-direction: column; gap: 11px; padding: 14px; direction: rtl; border-radius: 17px; }
        .kpi-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid #eef2f7; }
        .kpi-menu-head > span { display: grid; gap: 2px; }
        .kpi-menu-head strong { color: var(--brand-text); font-size: 12px; font-weight: 950; }
        .kpi-menu-head small { color: #94a3b8; font-size: 8px; font-weight: 800; }
        .kpi-menu-head > svg { width: 22px; height: 22px; padding: 4px; border-radius: 7px; color: var(--brand-primary); background: var(--brand-primary-tint); stroke-width: 1.6; }
        .kpi-properties-menu section { display: grid; gap: 7px; }
        .kpi-properties-menu section > b { color: #64748b; font-size: 9px; font-weight: 900; }
        .kpi-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
        .kpi-input-field { display: grid; gap: 5px; }
        .kpi-input-field.wide { grid-column: 1 / -1; }
        .kpi-input-field span { color: #64748b; font-size: 8px; font-weight: 900; }
        .kpi-input-field input { width: 100%; height: 34px; padding: 0 10px; outline: none; border: 1px solid #e2e8f0; border-radius: 9px; color: var(--brand-text); background: #fff; font-size: 10px; font-weight: 800; }
        .kpi-input-field input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .kpi-direct-edit-note { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px dashed color-mix(in srgb,var(--brand-primary) 28%,#e2e8f0); border-radius: 10px; color: var(--brand-primary); background: var(--brand-primary-tint); }
        .kpi-direct-edit-note > svg { width: 17px; height: 17px; stroke-width: 1.6; }
        .kpi-direct-edit-note > span { display: grid; gap: 1px; }
        .kpi-direct-edit-note b { font-size: 8px; font-weight: 950; }
        .kpi-direct-edit-note small { color: #64748b; font-size: 7px; font-weight: 750; }
        .kpi-surface-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
        .kpi-surface-options button { display: grid; justify-items: center; gap: 5px; padding: 7px 5px; border: 1px solid #e2e8f0; border-radius: 10px; color: #64748b; background: #fff; }
        .kpi-surface-options button:hover, .kpi-surface-options button.active { color: var(--brand-primary); border-color: var(--brand-primary); background: var(--brand-primary-tint); }
        .kpi-surface-options button > span { width: 52px; height: 28px; display: block; border-radius: 8px; }
        .kpi-surface-options .surface-soft { border: 1px solid #e2e8f0; background: #fff; box-shadow: 0 5px 10px rgba(15,23,42,.1); }
        .kpi-surface-options .surface-transparent { border: 1px dashed #cbd5e1; background: transparent; }
        .kpi-surface-options .surface-tinted { border: 1px solid color-mix(in srgb,var(--brand-primary) 24%,#e2e8f0); background: var(--brand-primary-tint); }
        .kpi-surface-options small { font-size: 7px; font-weight: 900; }
        .kpi-preset-row { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; }
        .kpi-preset-row button { height: 29px; display: grid; place-items: center; border: 1px solid #e2e8f0; border-radius: 8px; color: #64748b; background: #fff; font-size: 8px; font-weight: 900; }
        .kpi-preset-row button:hover, .kpi-preset-row button.active { color: var(--brand-primary); border-color: var(--brand-primary); background: var(--brand-primary-tint); }
        .kpi-preset-row.visual-thickness button i { width: 22px; max-height: 11px; display: block; border-radius: 999px; background: currentColor; }
        .kpi-progress-scale { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; color: #94a3b8; font-size: 7px; font-weight: 850; direction: ltr; }
        .kpi-progress-scale > div { height: 6px; overflow: hidden; border-radius: 999px; background: var(--brand-primary-tint); }
        .kpi-progress-scale > div i { height: 100%; display: block; border-radius: inherit; background: var(--brand-primary); }
        .kpi-menu-tip { color: #94a3b8; font-size: 7px; font-weight: 750; line-height: 1.6; }
        .kpi-content { cursor: default; }
        .kpi-inline-edit { min-width: .7em; display: inline-block; outline: none; border-radius: 5px; cursor: text; transition: background .15s, box-shadow .15s; }
        .kpi-inline-edit:hover { background: color-mix(in srgb,var(--brand-primary) 9%,transparent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--brand-primary) 8%,transparent); }
        .kpi-inline-edit:focus { background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb,var(--brand-primary) 24%,transparent); }
        .kpi-inline-value { direction: ltr; unicode-bidi: plaintext; }
        .kpi-inline-unit { pointer-events: none; }
        .kpi-inline-title { padding-inline: 2px; }
        .table-properties-menu { top: 52px; width: 330px; flex-direction: column; gap: 11px; padding: 14px; direction: rtl; border-radius: 17px; }
        .table-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid #eef2f7; }
        .table-menu-head > span { display: grid; gap: 2px; }
        .table-menu-head strong { color: var(--brand-text); font-size: 12px; font-weight: 950; }
        .table-menu-head small { color: #94a3b8; font-size: 8px; font-weight: 800; }
        .table-menu-head > svg { width: 21px; height: 21px; padding: 4px; border-radius: 7px; color: var(--brand-primary); background: var(--brand-primary-tint); }
        .table-properties-menu section { display: grid; gap: 7px; }
        .table-properties-menu section > b { color: #64748b; font-size: 9px; font-weight: 900; }
        .table-style-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
        .table-style-options button { display: grid; justify-items: center; gap: 5px; padding: 7px; border: 1px solid #e2e8f0; border-radius: 10px; color: #64748b; background: #fff; }
        .table-style-options button.active { color: var(--brand-primary); border-color: var(--brand-primary); background: var(--brand-primary-tint); }
        .table-style-options button > span { width: 58px; height: 30px; border: 1px solid #e2e8f0; border-radius: 5px; background: repeating-linear-gradient(to bottom,#fff 0 7px,#e2e8f0 7px 8px); }
        .table-style-options .style-executive { border-top: 8px solid var(--brand-primary); }
        .table-style-options .style-soft { background: repeating-linear-gradient(to bottom,var(--brand-primary-tint) 0 7px,#fff 7px 14px); }
        .table-style-options .style-minimal { border: 0; border-bottom: 1px solid #cbd5e1; border-radius: 0; }
        .table-style-options small { font-size: 7px; font-weight: 900; }
        .table-menu-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
        .table-menu-toggles button { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 6px; border: 1px solid #e2e8f0; border-radius: 9px; color: #64748b; background: #fff; font-size: 8px; font-weight: 900; }
        .table-menu-toggles button.active { color: #fff; border-color: var(--brand-primary); background: var(--brand-primary); }
        .table-menu-toggles svg { width: 12px; height: 12px; }
        .table-menu-tip { color: #94a3b8; font-size: 7px; font-weight: 750; line-height: 1.6; }

        .preznta-table-shell { width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; border: 1px solid color-mix(in srgb,var(--table-accent) 18%,#e2e8f0); border-radius: 20px; color: var(--brand-text); background: #fff; box-shadow: 0 14px 34px rgba(15,23,42,.09); direction: rtl; }
        .preznta-table-caption { min-height: 58px; display: flex; align-items: center; padding: 12px 16px; background: linear-gradient(135deg,color-mix(in srgb,var(--table-accent) 11%,#fff),#fff); }
        .preznta-table-caption > span { min-width: 0; outline: none; font-size: calc(var(--table-font-size) + 3px); font-weight: 950; line-height: 1.3; }
        .preznta-table-caption > span:focus { border-radius: 6px; box-shadow: 0 0 0 3px color-mix(in srgb,var(--table-accent) 17%,transparent); }
        .preznta-table-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb,var(--table-accent) 35%,#cbd5e1) transparent; }
        .preznta-table-shell table { width: 100%; height: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
        .preznta-table-cell { position: relative; min-width: 70px; padding: 10px 12px; outline: none; border-left: 1px solid #e8edf3; border-bottom: 1px solid #e8edf3; color: var(--brand-text); background: #fff; font-size: var(--table-font-size); line-height: 1.35; vertical-align: middle; transition: background .14s, box-shadow .14s; cursor: text; }
        .preznta-table-cell:last-child { border-left: 0; }
        .preznta-table-cell:focus, .preznta-table-cell.active { z-index: 2; background: color-mix(in srgb,var(--table-accent) 7%,#fff); box-shadow: inset 0 0 0 2px var(--table-accent); }
        .preznta-table-shell tr:last-child .preznta-table-cell { border-bottom: 0; }
        .table-style-executive th.preznta-table-cell { color: #fff; border-color: color-mix(in srgb,var(--table-accent) 78%,#000); background: var(--table-accent); }
        .table-style-executive tbody tr:nth-child(odd):not(:first-child) td { background: color-mix(in srgb,var(--table-accent) 4%,#fff); }
        .table-style-soft { border-color: transparent; background: color-mix(in srgb,var(--table-accent) 5%,#fff); box-shadow: none; }
        .table-style-soft .preznta-table-scroll { padding: 0 10px 10px; }
        .table-style-soft table { border-spacing: 0 5px; }
        .table-style-soft .preznta-table-cell { border: 0; background: #fff; }
        .table-style-soft th.preznta-table-cell { color: var(--table-accent); background: color-mix(in srgb,var(--table-accent) 13%,#fff); }
        .table-style-soft tr .preznta-table-cell:first-child { border-radius: 0 10px 10px 0; }
        .table-style-soft tr .preznta-table-cell:last-child { border-radius: 10px 0 0 10px; }
        .table-style-minimal { border: 0; border-radius: 0; box-shadow: none; }
        .table-style-minimal .preznta-table-caption { padding-inline: 0; background: transparent; border-bottom: 3px solid var(--table-accent); }
        .table-style-minimal .preznta-table-cell { padding-inline: 8px; border-left: 0; background: transparent; }
        .table-style-minimal th.preznta-table-cell { color: var(--table-accent); border-bottom: 2px solid var(--table-accent); }
        .library-card-btn:not(.has-preview) > span { font-size: 14px; font-weight: 800; color: var(--brand-text); }
        .library-card-btn:not(.has-preview) > small { font-size: 10px; color: #94a3b8; direction: ltr; text-align: right; }
        .template-card-btn { width: 100%; height: 122px; border: 1px solid #e2e8f0; border-radius: 14px; margin-bottom: 12px; background-size: cover; background-position: center; overflow: hidden; display: flex; align-items: end; justify-content: flex-start; padding: 10px; transition: 0.2s; }
        .template-card-btn:hover { border-color: var(--brand-primary); transform: translateY(-1px); box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08); }
        .template-card-btn span { background: rgba(255,255,255,0.9); color: var(--brand-text); border-radius: 8px; padding: 6px 10px; font-size: 11px; font-weight: 800; }
        .template-card-with-actions { position: relative; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 6px; cursor: pointer; }
        .template-card-with-actions .template-page-status { background: rgba(255,255,255,0.9); color: #94a3b8; border-radius: 8px; padding: 4px 8px; font-size: 9px; font-weight: 900; }
        .template-card-with-actions .template-page-status.enabled { color: var(--brand-primary); }
        .template-kind-badge { background: var(--brand-primary); color: #fff; border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 900; }
        .template-smart-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(15,23,42,.82); color: #fff; border-radius: 999px; padding: 4px 8px; font-size: 8px; font-weight: 900; }
        .template-smart-badge svg { width: 11px; height: 11px; }
        .template-config-btn { background: var(--brand-dark); color: white; border-radius: 9px; padding: 7px 10px; font-size: 10px; font-weight: 900; box-shadow: 0 8px 18px rgba(15,23,42,0.16); }
        .template-config-btn:hover { background: var(--brand-primary); }
        .template-settings-toolbar, .template-number-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; margin-bottom: 12px; }
        .template-settings-toolbar { display: grid; gap: 10px; }
        .template-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--brand-text); font-size: 12px; font-weight: 900; }
        .template-toggle input { accent-color: var(--brand-primary); width: 18px; height: 18px; }
        .template-number-start { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #64748b; font-size: 12px; font-weight: 900; }
        .template-number-start input, .template-number-grid input, .template-number-grid select { border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; outline: none; color: var(--brand-text); background: #fff; font-size: 12px; font-weight: 800; }
        .template-number-start input { width: 86px; }
        .template-export-btn, .template-save-btn, .template-cancel-btn { border-radius: 12px; padding: 10px 12px; font-size: 12px; font-weight: 900; transition: 0.2s; }
        .template-export-btn { background: #f1f5f9; color: #475569; }
        .template-export-btn:hover, .template-cancel-btn:hover { background: #e2e8f0; }
        .template-number-panel { border-color: var(--brand-primary); box-shadow: 0 12px 24px var(--brand-primary-tint); }
        .template-number-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
        .template-number-panel-head strong { color: var(--brand-text); font-size: 13px; font-weight: 950; }
        .template-number-panel-head span { color: #94a3b8; font-size: 10px; font-weight: 900; direction: ltr; }
        .panel-toggle { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: 10px; margin-bottom: 10px; }
        .template-number-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
        .template-number-grid label { min-width: 0; display: grid; gap: 4px; color: #64748b; font-size: 10px; font-weight: 900; }
        .template-number-grid input, .template-number-grid select { width: 100%; min-width: 0; }
        .template-number-actions { display: grid; grid-template-columns: 1fr 0.7fr; gap: 8px; margin-top: 12px; }
        .template-save-btn { background: var(--brand-primary); color: white; box-shadow: 0 10px 22px var(--brand-primary-shadow); }
        .template-save-btn:hover { filter: brightness(0.96); }
        .template-cancel-btn { background: #f1f5f9; color: #475569; }
        .empty-library { padding: 28px 12px; text-align: center; color: #94a3b8; font-size: 13px; font-weight: 700; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 14px; }
        .template-library-section { width: 100%; border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; background: #fff; }
        .template-library-section summary { cursor: pointer; list-style: none; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
        .template-library-section summary::-webkit-details-marker { display: none; }
        .template-library-section summary span { color: var(--brand-text); font-size: 14px; font-weight: 950; }
        .template-library-section summary small { display: block; color: #94a3b8; font-size: 10px; line-height: 1.7; margin-top: 3px; font-weight: 700; }
        .template-library-section summary b { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-primary); background: var(--brand-primary-tint); font-size: 11px; }
        .template-library-section-body { padding: 12px; border-top: 1px solid #eef2f7; background: #f8fafc; }
        .template-library-section-body .template-card-btn:last-child { margin-bottom: 0; }
        .template-section-empty { padding: 20px 12px; border: 1px dashed #cbd5e1; border-radius: 12px; color: #94a3b8; font-size: 11px; font-weight: 750; text-align: center; line-height: 1.8; background: #fff; }

        .page-number-overlay {
            position: absolute; z-index: 90; direction: rtl; box-sizing: border-box; pointer-events: none;
            display: flex; align-items: center; line-height: 1; white-space: nowrap; font-family: var(--brand-font), sans-serif;
        }
        .page-number-overlay.editing {
            pointer-events: auto; cursor: move; z-index: 140; border: 1.5px dashed var(--brand-primary);
            border-radius: 8px; background: var(--brand-primary-tint); padding: 0 3px;
        }
        .page-number-overlay.disabled-draft { opacity: 0.48; }
        .page-number-resize {
            position: absolute; left: -6px; bottom: -6px; width: 12px; height: 12px;
            border-radius: 50%; background: white; border: 2px solid var(--brand-primary); cursor: nwse-resize;
        }

        /* طبقات الغلاف الذكي: الصورة خلف SVG والشعارات فوقه */
        .template-slot-media-layer, .template-svg-overlay, .template-slot-controls-layer { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
        .template-slot-under-layer { z-index: 0; pointer-events: none; }
        .template-svg-overlay { z-index: 1; background-size: cover; background-position: center; background-repeat: no-repeat; pointer-events: none; }
        .template-slot-above-layer { z-index: 2; pointer-events: none; }
        .template-slot-controls-layer { z-index: 85; pointer-events: none; overflow: visible; }
        .template-slot-media { position: absolute; overflow: hidden; }
        .template-slot-media img { width: 100%; height: 100%; display: block; }
        .template-slot-logo-media { padding: 5px; box-sizing: border-box; }
        .template-slot-hitbox { position: absolute; pointer-events: auto; display: flex; align-items: center; justify-content: center; border: 1.5px dashed rgba(255,255,255,.85); border-radius: 13px; color: #fff; background: rgba(15,118,110,.44); box-shadow: 0 10px 25px rgba(15,23,42,.12); backdrop-filter: blur(3px); transition: .2s; }
        .template-slot-hitbox.image { border-radius: 22px; }
        .template-slot-hitbox:hover { border-color: #fff; background: var(--brand-primary-overlay); box-shadow: 0 0 0 3px rgba(255,255,255,.24), 0 14px 28px rgba(15,23,42,.2); }
        .template-slot-hitbox.has-value { background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; }
        .template-slot-hitbox.has-value:hover { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
        .template-slot-hitbox-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
        .template-slot-hitbox-content > svg { width: 25px; height: 25px; }
        .template-slot-hitbox-content strong { font-size: 14px; font-weight: 950; }
        .template-slot-hitbox-content small { color: rgba(255,255,255,.8); font-size: 8px; font-weight: 750; }
        .template-slot-hitbox.has-value .template-slot-hitbox-content { opacity: 0; transition: .2s; }
        .template-slot-hitbox.has-value:hover .template-slot-hitbox-content { opacity: 1; padding: 7px 12px; border-radius: 999px; background: var(--brand-primary); }
        .template-slot-hitbox.has-value .template-slot-hitbox-content small { display: none; }
        .template-slot-clear { position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #dc2626; background: #fff; box-shadow: 0 5px 13px rgba(15,23,42,.18); opacity: 0; transition: .2s; }
        .template-slot-hitbox.has-value:hover .template-slot-clear { opacity: 1; }
        .template-slot-clear.is-remove-slot { opacity: 1; color: #dc2626; }
        .template-slot-hitbox:hover .template-slot-clear.is-remove-slot { transform: scale(1.06); }
        .template-slot-clear svg { width: 13px; }
        .template-slot-restore-dock { position: absolute; right: 12px; bottom: 12px; max-width: 360px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px; border: 1px solid #e2e8f0; border-radius: 11px; background: rgba(255,255,255,.94); box-shadow: 0 8px 20px rgba(15,23,42,.13); pointer-events: auto; direction: rtl; }
        .template-slot-restore-dock > span, .template-slot-restore-dock button { display: flex; align-items: center; gap: 4px; font-size: 8px; font-weight: 900; }
        .template-slot-restore-dock > span { color: #64748b; padding: 0 3px; }
        .template-slot-restore-dock button { padding: 5px 7px; border-radius: 7px; color: var(--brand-primary); background: var(--brand-primary-tint); }
        .template-slot-restore-dock svg { width: 11px; height: 11px; }

        /* محرر مناطق الغلاف للمصمم */
        .cover-slot-editor-backdrop { position: fixed; inset: 0; z-index: 7000; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(15,23,42,.65); backdrop-filter: blur(5px); direction: rtl; }
        .cover-slot-editor-modal { width: min(1180px, calc(100vw - 30px)); max-height: calc(100vh - 30px); overflow: hidden; display: flex; flex-direction: column; border-radius: 25px; background: #fff; box-shadow: 0 35px 100px rgba(15,23,42,.35); }
        .cover-slot-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 23px 15px; border-bottom: 1px solid #eef2f7; }
        .cover-slot-editor-head h3 { margin: 0; color: var(--brand-text); font-size: 20px; font-weight: 950; }
        .cover-slot-editor-head p { margin: 4px 0 0; color: #64748b; font-size: 10px; }
        .cover-slot-editor-head > button { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; color: #64748b; background: #f8fafc; }
        .cover-slot-editor-head > button svg { width: 17px; }
        .cover-slot-editor-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 23px; border-bottom: 1px solid #eef2f7; background: #f8fafc; }
        .cover-slot-editor-toolbar button { display: flex; align-items: center; gap: 7px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; color: var(--brand-primary); background: #fff; font-size: 10px; font-weight: 950; }
        .cover-slot-editor-toolbar button:hover { border-color: var(--brand-primary); background: var(--brand-primary-tint); }
        .cover-slot-editor-toolbar button svg { width: 15px; }
        .cover-slot-editor-toolbar > span { margin-right: auto; color: #94a3b8; font-size: 8px; font-weight: 800; }
        .cover-slot-editor-main { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 245px; gap: 18px; padding: 19px 23px; overflow: auto; }
        .cover-slot-stage-wrap { min-width: 0; display: flex; align-items: center; justify-content: center; padding: 14px; border-radius: 16px; background: #e2e8f0; }
        .cover-slot-stage { position: relative; width: 100%; max-width: 820px; aspect-ratio: 16/9; overflow: hidden; border-radius: 4px; background-color: #fff; background-size: cover; background-position: center; box-shadow: 0 18px 40px rgba(15,23,42,.18); direction: ltr; }
        .cover-slot-draft { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; box-sizing: border-box; cursor: move; border: 2px dashed rgba(255,255,255,.96); border-radius: 13px; color: #fff; background: rgba(15,118,110,.48); box-shadow: 0 6px 20px rgba(15,23,42,.18); text-align: center; direction: rtl; }
        .cover-slot-draft.image { background: rgba(2,132,199,.43); }
        .cover-slot-draft.selected { border-color: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,.32), 0 8px 24px rgba(15,23,42,.2); }
        .cover-slot-draft > svg { width: 23px; height: 23px; }
        .cover-slot-draft > span { max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 950; }
        .cover-slot-draft > b { font-size: 7px; color: rgba(255,255,255,.78); }
        .cover-slot-resize { position: absolute; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #fbbf24; box-shadow: 0 3px 8px rgba(15,23,42,.24); opacity: 0; transition: opacity .15s, transform .15s; z-index: 4; }
        .cover-slot-draft.selected .cover-slot-resize, .cover-slot-draft:hover .cover-slot-resize { opacity: 1; }
        .cover-slot-resize:hover { transform: scale(1.18); }
        .cover-slot-resize.handle-nw { left: -7px; top: -7px; cursor: nwse-resize; }
        .cover-slot-resize.handle-n { left: calc(50% - 7px); top: -7px; cursor: ns-resize; }
        .cover-slot-resize.handle-ne { right: -7px; top: -7px; cursor: nesw-resize; }
        .cover-slot-resize.handle-e { right: -7px; top: calc(50% - 7px); cursor: ew-resize; }
        .cover-slot-resize.handle-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
        .cover-slot-resize.handle-s { left: calc(50% - 7px); bottom: -7px; cursor: ns-resize; }
        .cover-slot-resize.handle-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
        .cover-slot-resize.handle-w { left: -7px; top: calc(50% - 7px); cursor: ew-resize; }
        .cover-slot-inspector { min-height: 310px; padding: 15px; border: 1px solid #e2e8f0; border-radius: 15px; background: #fff; }
        .cover-slot-inspector-title { display: flex; align-items: center; gap: 7px; margin-bottom: 15px; color: var(--brand-text); }
        .cover-slot-inspector-title svg { width: 17px; color: var(--brand-primary); }
        .cover-slot-inspector-title strong { font-size: 12px; font-weight: 950; }
        .cover-slot-inspector label { display: grid; gap: 5px; margin-bottom: 10px; }
        .cover-slot-inspector label > span { color: #64748b; font-size: 8px; font-weight: 900; }
        .cover-slot-inspector input, .cover-slot-inspector select { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid #e2e8f0; border-radius: 9px; outline: none; color: var(--brand-text); background: #fff; font-size: 9px; }
        .cover-slot-inspector input:focus, .cover-slot-inspector select:focus { border-color: var(--brand-primary); }
        .cover-slot-coordinate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
        .cover-slot-delete { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; border-radius: 9px; color: #dc2626; background: #fff1f2; font-size: 9px; font-weight: 900; }
        .cover-slot-delete svg { width: 13px; }
        .cover-slot-inspector-empty { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #94a3b8; text-align: center; }
        .cover-slot-inspector-empty svg { width: 30px; color: var(--brand-primary); }
        .cover-slot-inspector-empty strong { color: var(--brand-text); font-size: 11px; }
        .cover-slot-inspector-empty span { max-width: 170px; font-size: 8px; line-height: 1.7; }
        .cover-slot-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 23px 18px; border-top: 1px solid #eef2f7; }
        .cover-slot-editor-actions > span { color: #64748b; font-size: 9px; font-weight: 900; }
        .cover-slot-editor-actions > div { display: flex; gap: 8px; }
        .cover-slot-editor-actions button { display: flex; align-items: center; gap: 7px; padding: 11px 15px; border-radius: 11px; font-size: 10px; font-weight: 950; }
        .cover-slot-editor-actions button svg { width: 15px; }
        .cover-slot-cancel { color: #64748b; background: #f1f5f9; }
        .cover-slot-save { color: #fff; background: var(--brand-primary); box-shadow: 0 10px 22px var(--brand-primary-shadow); }
        @media (max-width: 820px) { .cover-slot-editor-main { grid-template-columns: 1fr; } .cover-slot-inspector { min-height: 0; } .cover-slot-inspector-empty { min-height: 100px; } }

        .admin-panel { color: var(--brand-text); }
        .admin-note { padding: 16px; border-radius: 16px; background: #f8fafc; border: 1px solid #eef2f7; }
        .admin-label, .admin-section-title { display: block; font-size: 12px; font-weight: 800; color: #64748b; margin-bottom: 8px; }
        .admin-input { width: 100%; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; outline: none; color: var(--brand-text); background: white; }
        .admin-input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .admin-logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .admin-logo-preview { width: 52px; height: 52px; border-radius: 14px; background: #f8fafc; border: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center; color: #94a3b8; overflow: hidden; }
        .admin-logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
        .admin-secondary-btn { padding: 10px 12px; border-radius: 10px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 800; transition: 0.2s; }
        .admin-secondary-btn:hover { background: #e2e8f0; }
        .admin-color-grid { display: grid; gap: 10px; }
        .admin-color-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #eef2f7; border-radius: 12px; background: #fff; font-size: 12px; font-weight: 800; color: #64748b; }
        .admin-color-row input { width: 52px; height: 34px; border: 0; background: transparent; cursor: pointer; }
        .admin-details { border: 1px solid #eef2f7; border-radius: 14px; margin-bottom: 10px; overflow: hidden; background: white; }
        .admin-details summary { cursor: pointer; padding: 12px 14px; font-size: 13px; font-weight: 900; color: var(--brand-text); display: flex; align-items: center; justify-content: space-between; }
        .admin-details summary span { color: #94a3b8; font-size: 11px; }
        .admin-toggle-list { border-top: 1px solid #eef2f7; }
        .admin-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #f8fafc; }
        .admin-toggle-row:last-child { border-bottom: 0; }
        .admin-toggle-row strong { display: block; font-size: 12px; color: var(--brand-text); }
        .admin-toggle-row small { display: block; font-size: 10px; color: #94a3b8; direction: ltr; text-align: right; }
        .admin-toggle-row input { accent-color: var(--brand-primary); width: 18px; height: 18px; }
        .admin-save-status { display: none; padding: 11px 12px; border-radius: 12px; background: var(--brand-primary-tint); color: var(--brand-primary); font-size: 12px; font-weight: 900; line-height: 1.6; }
        .admin-primary-btn { width: 100%; padding: 13px; border-radius: 14px; color: white; background: var(--brand-primary); font-weight: 900; box-shadow: 0 12px 24px var(--brand-primary-shadow); }
        .admin-secondary-full-btn { width: 100%; padding: 13px; border-radius: 14px; background: #f1f5f9; color: #475569; font-weight: 900; }
        .presentation-assets-note { display: grid; gap: 5px; margin-bottom: 10px; }
        .presentation-assets-note strong { color: var(--brand-text); font-size: 12px; }
        .presentation-assets-note span { color: #64748b; font-size: 10px; line-height: 1.7; }
        .presentation-admin-group { border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; background: #fff; margin-bottom: 9px; }
        .presentation-admin-group summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px; }
        .presentation-admin-group summary::-webkit-details-marker { display: none; }
        .presentation-admin-group summary span { display: flex; align-items: center; gap: 8px; color: var(--brand-text); font-size: 12px; font-weight: 900; }
        .presentation-admin-group summary svg { width: 16px; height: 16px; color: var(--brand-primary); }
        .presentation-admin-group summary b { color: var(--brand-primary); background: var(--brand-primary-tint); border-radius: 8px; padding: 4px 8px; font-size: 10px; }
        .presentation-admin-body { border-top: 1px solid #eef2f7; padding: 10px; }
        .presentation-upload-btn { width: 100%; border: 1px dashed var(--brand-primary); color: var(--brand-primary); background: var(--brand-primary-tint); border-radius: 11px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 11px; font-weight: 900; }
        .presentation-upload-btn svg { width: 16px; height: 16px; }
        .presentation-admin-list { display: grid; gap: 7px; margin-top: 9px; }
        .presentation-admin-item { min-width: 0; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 7px; border: 1px solid #eef2f7; border-radius: 10px; }
        .presentation-admin-item img { width: 58px; aspect-ratio: 16/9; object-fit: cover; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; }
        .presentation-admin-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand-text); font-size: 10px; font-weight: 800; }
        .presentation-admin-item span small { display: block; margin-top: 2px; color: var(--brand-primary); font-size: 7px; font-weight: 900; }
        .presentation-admin-item button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #ef4444; background: #fff1f2; }
        .presentation-admin-item button.presentation-slot-config { color: var(--brand-primary); background: var(--brand-primary-tint); }
        .presentation-admin-item button svg { width: 14px; height: 14px; }
        .presentation-admin-empty { color: #94a3b8; text-align: center; font-size: 10px; padding: 8px; }

        /* --- تحسين مكتبة الأيقونات (Improved Icon Library UI) --- */
        .icon-search-box { position: sticky; top: -24px; background: white; padding: 0 0 14px; z-index: 10; }
        .icon-search-field { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--brand-primary); border-radius: 13px; transition: 0.25s; background: #fff; }
        .icon-search-field:focus-within { box-shadow: 0 10px 20px var(--brand-primary-soft); }
        .icon-search-field svg { width: 17px; color: var(--brand-primary); }
        .icon-search-input { width: 100%; padding: 12px 0; border: 0; font-size: 13px; outline: none; background: transparent; color: var(--brand-text); }
        .icon-search-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: #94a3b8; font-size: 9px; font-weight: 700; }
        .icon-search-meta span { color: var(--brand-primary); font-weight: 900; }
        .icon-library-group { width: 100%; border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; background: #fff; }
        .icon-library-group summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; }
        .icon-library-group summary::-webkit-details-marker { display: none; }
        .icon-library-group summary span { display: flex; align-items: center; gap: 8px; color: var(--brand-text); font-size: 13px; font-weight: 950; }
        .icon-library-group summary svg { width: 17px; height: 17px; color: var(--brand-primary); }
        .icon-library-group summary b { min-width: 28px; height: 26px; display: grid; place-items: center; padding: 0 6px; border-radius: 8px; color: var(--brand-primary); background: var(--brand-primary-tint); font-size: 9px; }
        .icon-library-body { padding: 12px; border-top: 1px solid #eef2f7; background: #f8fafc; }
        .icon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding-bottom: 8px; }
        .icon-card { 
            min-width: 0; aspect-ratio: 1/1; border: 1px solid #e9eef5; border-radius: 14px; display: flex; flex-direction: column; 
            align-items: center; justify-content: center; cursor: pointer; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
            background: #fff; gap: 8px; padding: 8px;
        }
        .icon-card:hover { 
            border-color: var(--brand-primary); background: var(--brand-primary-soft); transform: translateY(-4px); 
            box-shadow: 0 10px 15px -3px var(--brand-primary-soft), 0 4px 6px -2px var(--brand-primary-tint);
        }
        .icon-card { color: var(--brand-text); }
        .icon-card:hover { color: var(--brand-primary); }
        .icon-name { font-size: 9px; color: #94a3b8; font-weight: 500; text-transform: lowercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; text-align: center; }
        .no-icons { grid-column: span 3; padding: 40px 0; text-align: center; color: #94a3b8; font-size: 13px; font-weight: 500; }
        .icon-style-presets { margin-bottom: 11px; }
        .icon-style-presets > small { display: block; color: #94a3b8; font-size: 9px; font-weight: 900; margin-bottom: 7px; }
        #icon-style-presets { display: flex; gap: 7px; overflow-x: auto; padding: 1px 1px 6px; }
        #icon-style-presets button { flex: 0 0 76px; min-height: 72px; padding: 7px 5px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; color: #64748b; font-size: 8px; font-weight: 850; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; transition: .2s; }
        #icon-style-presets button:hover, #icon-style-presets button.active { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-primary-tint); box-shadow: 0 7px 16px var(--brand-primary-soft); }
        .icon-load-more { width: 100%; padding: 10px; border-radius: 11px; background: #fff; border: 1px solid #e2e8f0; color: var(--brand-primary); font-size: 11px; font-weight: 900; margin-top: 4px; }
        .organization-icon-card { background: #fff; }
        .organization-icon-preview { width: 42px; height: 42px; display: grid; place-items: center; color: inherit; }
        .organization-icons-library-empty { line-height: 1.8; font-size: 11px; }
        .organization-icons-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
        .organization-icon-admin-item { position: relative; min-width: 0; border: 1px solid #eef2f7; border-radius: 11px; background: #fff; padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
        .organization-icon-admin-item img { width: 32px; height: 32px; object-fit: contain; }
        .organization-icon-admin-item span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; color: #64748b; font-size: 8px; font-weight: 800; }
        .organization-icon-admin-item button { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: #fff1f2; color: #ef4444; opacity: 0; transition: .2s; }
        .organization-icon-admin-item:hover button { opacity: 1; }
        .organization-icon-admin-item button svg { width: 12px; height: 12px; }
        .organization-icons-empty { grid-column: 1 / -1; }

        /* نماذج شعارات الجهة — إعدادات المصمم */
        .organization-logos-admin-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 8px; }
        .organization-logos-admin-controls select { min-width: 0; padding: 9px 8px; border: 1px solid #e2e8f0; border-radius: 10px; color: var(--brand-text); background: #fff; font-size: 9px; font-weight: 850; outline: none; }
        .organization-logos-admin-controls select:focus { border-color: var(--brand-primary); }
        .organization-logos-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 9px; }
        .organization-logo-admin-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
        .organization-logo-admin-preview { height: 74px; display: grid; place-items: center; padding: 11px; background: #f8fafc; }
        .organization-logo-admin-preview.is-dark { background: var(--brand-dark); }
        .organization-logo-admin-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
        .organization-logo-admin-card strong, .organization-logo-admin-card span { display: block; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .organization-logo-admin-card strong { margin-top: 7px; color: var(--brand-text); font-size: 9px; font-weight: 950; }
        .organization-logo-admin-card span { padding-bottom: 8px; color: #94a3b8; font-size: 7px; font-weight: 800; }
        .organization-logo-admin-card > button { position: absolute; top: 5px; left: 5px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: #ef4444; background: rgba(255,255,255,.96); opacity: 0; transition: .2s; }
        .organization-logo-admin-card:hover > button { opacity: 1; }
        .organization-logo-admin-card > button svg { width: 12px; }
        .organization-logos-empty { grid-column: 1/-1; }

        /* مكتبة صور الجهة — إعدادات المصمم */
        .photo-library-admin-create { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-bottom: 10px; }
        .photo-library-admin-create .admin-input { padding: 10px 11px; font-size: 11px; }
        .photo-library-admin-create button { display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 10px; background: var(--brand-primary); color: #fff; font-size: 10px; font-weight: 900; }
        .photo-library-admin-create button:disabled { opacity: .58; cursor: wait; }
        .photo-library-admin-create button svg { width: 15px; }
        .photo-library-inline-status { display: none; margin: -3px 0 10px; padding: 8px 10px; border-radius: 9px; background: var(--brand-primary-tint); color: var(--brand-primary); font-size: 9px; font-weight: 850; line-height: 1.6; }
        .photo-library-inline-status[data-state="error"] { background: #fff1f2; color: #dc2626; }
        .photo-library-inline-status[data-state="success"] { background: #ecfdf5; color: #059669; }
        .photo-library-inline-status[data-state="loading"] { background: #f8fafc; color: #64748b; }
        .photo-admin-group { border: 1px solid #e2e8f0; border-radius: 13px; overflow: hidden; background: #fff; margin-bottom: 8px; }
        .photo-admin-group summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; }
        .photo-admin-group summary::-webkit-details-marker { display: none; }
        .photo-admin-group summary span { display: flex; align-items: center; gap: 7px; color: var(--brand-text); font-size: 11px; font-weight: 900; }
        .photo-admin-group summary svg { width: 15px; color: var(--brand-primary); }
        .photo-admin-group summary b { background: var(--brand-primary-tint); color: var(--brand-primary); padding: 4px 7px; border-radius: 7px; font-size: 9px; }
        .photo-admin-group-body { border-top: 1px solid #eef2f7; padding: 9px; background: #f8fafc; }
        .photo-admin-actions { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 6px; margin-bottom: 8px; }
        .photo-admin-actions input { min-width: 0; border: 1px solid #e2e8f0; border-radius: 9px; padding: 8px 9px; font-size: 10px; color: var(--brand-text); background: #fff; outline: none; }
        .photo-admin-actions input:focus { border-color: var(--brand-primary); }
        .photo-admin-delete-group { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #fff1f2; color: #ef4444; }
        .photo-admin-delete-group svg { width: 14px; }
        .photo-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
        .photo-admin-card { min-width: 0; position: relative; border-radius: 9px; overflow: hidden; border: 1px solid #e2e8f0; background: #fff; }
        .photo-admin-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
        .photo-admin-card span { display: block; padding: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: 8px; font-weight: 800; }
        .photo-admin-card button { position: absolute; top: 4px; left: 4px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: #ef4444; background: rgba(255,255,255,.94); opacity: 0; transition: .2s; }
        .photo-admin-card:hover button { opacity: 1; }
        .photo-admin-card button svg { width: 12px; }
        .photo-admin-empty { grid-column: 1 / -1; padding: 16px 8px; text-align: center; color: #94a3b8; border: 1px dashed #cbd5e1; border-radius: 9px; background: #fff; font-size: 9px; line-height: 1.7; }
        .photo-library-no-groups { font-size: 10px; }

        /* مكتبة الصور — واجهة المستخدم */
        .device-image-upload { width: 100%; display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px dashed var(--brand-primary); border-radius: 14px; color: var(--brand-primary); background: var(--brand-primary-tint); text-align: right; }
        .device-image-upload > svg { width: 24px; height: 24px; }
        .device-image-upload span { display: grid; gap: 2px; }
        .device-image-upload strong { font-size: 12px; font-weight: 950; }
        .device-image-upload small { color: #94a3b8; font-size: 9px; }
        .photo-library-search { display: flex; align-items: center; gap: 8px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 0 11px; }
        .photo-library-search:focus-within { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .photo-library-search svg { width: 16px; color: var(--brand-primary); }
        .photo-library-search input { width: 100%; min-width: 0; padding: 11px 0; border: 0; outline: 0; color: var(--brand-text); font-size: 11px; background: transparent; }
        .photo-library-user-head { display: flex; align-items: center; justify-content: space-between; color: #64748b; font-size: 10px; font-weight: 900; }
        .photo-library-user-head b { color: var(--brand-primary); }
        .photo-library-user-group { border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; background: #fff; margin-bottom: 9px; }
        .photo-library-user-group summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px; }
        .photo-library-user-group summary::-webkit-details-marker { display: none; }
        .photo-library-user-group summary span { display: flex; align-items: center; gap: 7px; color: var(--brand-text); font-size: 11px; font-weight: 950; }
        .photo-library-user-group summary svg { width: 15px; color: var(--brand-primary); }
        .photo-library-user-group summary b { color: var(--brand-primary); background: var(--brand-primary-tint); border-radius: 7px; padding: 4px 7px; font-size: 9px; }
        .photo-library-user-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 9px; border-top: 1px solid #eef2f7; background: #f8fafc; }
        .photo-library-card { min-width: 0; position: relative; overflow: hidden; border-radius: 11px; border: 1px solid #e2e8f0; background: #fff; transition: .22s; text-align: right; }
        .photo-library-card:hover { border-color: var(--brand-primary); transform: translateY(-2px); box-shadow: 0 9px 18px rgba(15,23,42,.09); }
        .photo-library-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
        .photo-library-card span { display: block; padding: 7px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: 9px; font-weight: 850; }
        .photo-library-card > svg { position: absolute; top: 7px; left: 7px; width: 23px; height: 23px; padding: 5px; border-radius: 50%; color: #fff; background: var(--brand-primary); opacity: 0; transition: .2s; }
        .photo-library-card:hover > svg { opacity: 1; }
        .photo-library-empty { grid-column: 1 / -1; padding: 24px 10px; text-align: center; color: #94a3b8; border: 1px dashed #cbd5e1; border-radius: 10px; background: #fff; font-size: 10px; }

        /* موحّد اختيار الصور للعناصر الجاهزة والصور المستقلة */
        .image-picker-backdrop { position: fixed; inset: 0; z-index: 6200; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15,23,42,.58); backdrop-filter: blur(4px); direction: rtl; }
        .image-picker-modal { width: min(760px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 32px 90px rgba(15,23,42,.3); }
        .image-picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 17px; border-bottom: 1px solid #eef2f7; }
        .image-picker-head h3 { margin: 0; color: var(--brand-text); font-size: 21px; font-weight: 950; }
        .image-picker-head p { margin: 5px 0 0; color: #64748b; font-size: 11px; font-weight: 650; }
        .image-picker-close { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #64748b; background: #f8fafc; }
        .image-picker-close:hover { color: var(--brand-primary); background: var(--brand-primary-tint); }
        .image-picker-close svg { width: 18px; }
        .image-picker-sources { padding: 17px 24px 12px; }
        .image-picker-device { width: 100%; min-height: 76px; display: flex; align-items: center; gap: 14px; padding: 14px 17px; border: 1px dashed var(--brand-primary); border-radius: 16px; color: var(--brand-primary); background: var(--brand-primary-tint); text-align: right; transition: .2s; }
        .image-picker-device:hover { transform: translateY(-1px); box-shadow: 0 10px 24px var(--brand-primary-soft); }
        .image-picker-device > svg { width: 27px; height: 27px; }
        .image-picker-device span { display: grid; gap: 2px; }
        .image-picker-device strong { color: var(--brand-text); font-size: 13px; font-weight: 950; }
        .image-picker-device small { color: #64748b; font-size: 9px; font-weight: 700; }
        .image-picker-library-label { display: flex; align-items: center; justify-content: space-between; margin-top: 17px; color: var(--brand-text); font-size: 11px; font-weight: 950; }
        .image-picker-library-label span { display: flex; align-items: center; gap: 7px; }
        .image-picker-library-label svg { width: 17px; color: var(--brand-primary); }
        .image-picker-library-label b { padding: 5px 8px; border-radius: 8px; color: var(--brand-primary); background: var(--brand-primary-tint); font-size: 9px; }
        .image-picker-search { margin: 0 24px 12px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #e2e8f0; border-radius: 12px; }
        .image-picker-search:focus-within { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .image-picker-search svg { width: 16px; color: var(--brand-primary); }
        .image-picker-search input { width: 100%; padding: 11px 0; border: 0; outline: 0; color: var(--brand-text); background: transparent; font-size: 11px; }
        .image-picker-groups { min-height: 130px; overflow: auto; padding: 0 24px 22px; }
        .image-picker-group { margin-bottom: 10px; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
        .image-picker-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; }
        .image-picker-group summary::-webkit-details-marker { display: none; }
        .image-picker-group summary span { display: flex; align-items: center; gap: 7px; color: var(--brand-text); font-size: 11px; font-weight: 950; }
        .image-picker-group summary svg { width: 16px; color: var(--brand-primary); }
        .image-picker-group summary b { color: var(--brand-primary); font-size: 9px; }
        .image-picker-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; padding: 11px; border-top: 1px solid #eef2f7; background: #f8fafc; }
        .image-picker-photo { position: relative; min-width: 0; overflow: hidden; border: 2px solid transparent; border-radius: 12px; background: #fff; text-align: right; transition: .2s; }
        .image-picker-photo:hover { border-color: var(--brand-primary); transform: translateY(-2px); box-shadow: 0 9px 20px rgba(15,23,42,.1); }
        .image-picker-photo:disabled { opacity: .65; cursor: wait; }
        .image-picker-photo img { width: 100%; aspect-ratio: 4/3; display: block; object-fit: cover; }
        .image-picker-photo span { display: block; padding: 7px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: 9px; font-weight: 850; }
        .image-picker-photo > svg { position: absolute; top: 7px; left: 7px; width: 24px; height: 24px; padding: 5px; border-radius: 50%; color: #fff; background: var(--brand-primary); opacity: 0; transition: .2s; }
        .image-picker-photo:hover > svg, .image-picker-photo.is-loading > svg { opacity: 1; }
        .image-picker-empty { grid-column: 1/-1; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 18px; border: 1px dashed #cbd5e1; border-radius: 12px; color: #94a3b8; background: #fff; text-align: center; font-size: 10px; }
        .image-picker-empty svg { width: 26px; color: var(--brand-primary); }
        .image-picker-empty strong { color: var(--brand-text); font-size: 12px; }
        .image-picker-status { min-height: 18px; padding: 0 24px 15px; color: #dc2626; font-size: 10px; font-weight: 850; }
        @media (max-width: 700px) { .image-picker-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

        /* مكتبة الشعارات */
        .logos-library-intro { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border-radius: 14px; color: var(--brand-primary); background: var(--brand-primary-tint); }
        .logos-library-intro > svg { width: 24px; flex: 0 0 auto; }
        .logos-library-intro div { display: grid; gap: 3px; }
        .logos-library-intro strong { color: var(--brand-text); font-size: 12px; font-weight: 950; }
        .logos-library-intro span { color: #64748b; font-size: 9px; line-height: 1.7; }
        .logos-library-section { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
        .logos-library-section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 13px; color: var(--brand-text); }
        .logos-library-section > summary::-webkit-details-marker { display: none; }
        .logos-library-section > summary span { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 950; }
        .logos-library-section > summary span svg { width: 16px; color: var(--brand-primary); }
        .logos-library-section > summary > svg { width: 15px; color: #94a3b8; transition: .2s; }
        .logos-library-section[open] > summary > svg { transform: rotate(180deg); }
        .logos-library-section-body { padding: 10px; border-top: 1px solid #eef2f7; background: #f8fafc; }
        .logo-kind-group + .logo-kind-group { margin-top: 14px; }
        .logo-kind-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: #64748b; font-size: 9px; font-weight: 950; }
        .logo-kind-title b { color: var(--brand-primary); }
        .logo-library-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
        .logo-library-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; text-align: right; transition: .2s; }
        .logo-library-card:hover { border-color: var(--brand-primary); transform: translateY(-2px); box-shadow: 0 9px 18px rgba(15,23,42,.09); }
        .logo-library-card:disabled { opacity: .62; cursor: wait; }
        .logo-library-preview { height: 82px; display: grid; place-items: center; padding: 12px; background: #fff; }
        .logo-library-card.is-dark .logo-library-preview { background: var(--brand-dark); }
        .logo-library-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
        .logo-library-preview > svg { width: 28px; color: var(--brand-primary); }
        .logo-library-card strong, .logo-library-card small { display: block; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .logo-library-card strong { margin-top: 7px; color: var(--brand-text); font-size: 9px; font-weight: 950; }
        .logo-library-card small { padding-bottom: 8px; color: #94a3b8; font-size: 8px; font-weight: 750; }
        .logo-library-card > svg { position: absolute; top: 6px; left: 6px; width: 23px; height: 23px; padding: 5px; border-radius: 50%; color: #fff; background: var(--brand-primary); opacity: 0; transition: .2s; }
        .logo-library-card:hover > svg, .logo-library-card.is-loading > svg { opacity: 1; }
        .logo-library-empty { padding: 22px 10px; border: 1px dashed #cbd5e1; border-radius: 10px; color: #94a3b8; background: #fff; text-align: center; font-size: 9px; line-height: 1.8; }
        .general-logo-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; }
        .general-logo-search:focus-within { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
        .general-logo-search svg { width: 15px; color: var(--brand-primary); }
        .general-logo-search input { width: 100%; min-width: 0; padding: 10px 0; border: 0; outline: 0; color: var(--brand-text); background: transparent; font-size: 10px; }
        .general-logo-api-note { display: flex; align-items: center; gap: 6px; margin: 8px 2px 10px; color: #94a3b8; font-size: 8px; font-weight: 800; }
        .general-logo-api-note svg { width: 13px; color: var(--brand-primary); }
        .general-logo-results .logo-library-grid { margin-top: 5px; }
        .logo-api-awaiting { min-height: 118px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 17px; border: 1px dashed var(--brand-primary); border-radius: 11px; color: #64748b; background: var(--brand-primary-tint); text-align: center; }
        .logo-api-awaiting svg { width: 27px; color: var(--brand-primary); }
        .logo-api-awaiting strong { color: var(--brand-text); font-size: 11px; font-weight: 950; }
        .logo-api-awaiting span { font-size: 8px; line-height: 1.7; }
        .general-logo-loading, .logo-library-error { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 90px; padding: 12px; border-radius: 10px; font-size: 9px; font-weight: 850; text-align: center; }
        .general-logo-loading { color: var(--brand-primary); background: var(--brand-primary-tint); }
        .general-logo-loading svg { width: 17px; animation: logo-spin 1s linear infinite; }
        .logo-library-error { color: #dc2626; background: #fff1f2; }
        .logo-library-error svg { width: 17px; }
        @keyframes logo-spin { to { transform: rotate(360deg); } }

        /* نظام ستايلات الأيقونات — اللون موروث من عنصر الشريحة وقابل للتخصيص */
        .preznta-icon-shell { width: var(--preznta-icon-size); height: var(--preznta-icon-size); display: inline-grid; place-items: center; box-sizing: border-box; color: inherit; position: relative; flex: 0 0 auto; transition: color .2s, background .2s, border-color .2s; }
        .preznta-icon-glyph { width: var(--preznta-glyph-size); height: var(--preznta-glyph-size); display: grid; place-items: center; color: inherit; position: relative; z-index: 2; }
        .preznta-icon-glyph > svg, .preznta-icon-glyph > i { width: 100% !important; height: 100% !important; display: block; color: inherit; }
        .preznta-colorizable-svg { color: inherit !important; fill: currentColor; }
        .preznta-colorizable-svg * { color: inherit !important; }
        .preznta-colorizable-svg [fill="none"] { fill: none !important; }
        .preznta-colorizable-svg [stroke="none"] { stroke: none !important; }
        .preznta-icon-plain { background: transparent; }
        .preznta-icon-soft-square { border-radius: 24%; background: color-mix(in srgb, currentColor 13%, transparent); }
        .preznta-icon-filled-square { border-radius: 24%; background: currentColor; }
        .preznta-icon-outline-square { border-radius: 24%; border: max(2px, calc(var(--preznta-icon-size) * .035)) solid currentColor; }
        .preznta-icon-soft-circle { border-radius: 50%; background: color-mix(in srgb, currentColor 13%, transparent); }
        .preznta-icon-filled-circle { border-radius: 50%; background: currentColor; }
        .preznta-icon-outline-circle { border-radius: 50%; border: max(2px, calc(var(--preznta-icon-size) * .035)) solid currentColor; }
        .preznta-icon-soft-hexagon, .preznta-icon-filled-hexagon, .preznta-icon-outline-hexagon { clip-path: polygon(25% 5%,75% 5%,100% 50%,75% 95%,25% 95%,0 50%); }
        .preznta-icon-soft-hexagon { background: color-mix(in srgb, currentColor 13%, transparent); }
        .preznta-icon-filled-hexagon, .preznta-icon-outline-hexagon { background: currentColor; }
        .preznta-icon-outline-hexagon::before { content: ''; position: absolute; inset: max(2px, calc(var(--preznta-icon-size) * .035)); background: color-mix(in srgb, currentColor 5%, white); clip-path: inherit; z-index: 1; }
        .preznta-icon-filled-square .preznta-icon-glyph, .preznta-icon-filled-circle .preznta-icon-glyph, .preznta-icon-filled-hexagon .preznta-icon-glyph { color: white; }


/* Export modal + true progress UI */
.export-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 5000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.export-modal { width: 520px; max-width: calc(100vw - 32px); background: #fff; border-radius: 28px; box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28); overflow: hidden; direction: rtl; }
.export-modal-header { padding: 24px 28px 16px; border-bottom: 1px solid #eef2f7; display: flex; align-items: center; justify-content: space-between; }
.export-modal-title { font-size: 20px; font-weight: 800; color: var(--brand-dark); }
.export-modal-subtitle { font-size: 12px; color: #64748b; margin-top: 6px; line-height: 1.8; }
.export-modal-body { padding: 22px 28px 28px; }
.export-quality-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 22px; }
.export-quality-card { border: 1.5px solid #e2e8f0; border-radius: 18px; padding: 14px; cursor: pointer; transition: 0.2s ease; background: #fff; }
.export-quality-card:hover, .export-quality-card.active { border-color: var(--brand-primary); background: var(--brand-primary-tint); box-shadow: 0 12px 24px var(--brand-primary-shadow); }
.export-quality-card .name { font-size: 13px; font-weight: 800; color: var(--brand-dark); margin-bottom: 4px; }
.export-quality-card .desc { font-size: 11px; color: #64748b; line-height: 1.6; }
.export-actions { display: flex; gap: 10px; margin-top: 18px; }
.export-btn { flex: 1; padding: 13px 16px; border-radius: 16px; font-weight: 800; transition: 0.2s; }
.export-btn-primary { background: var(--brand-primary); color: #fff; box-shadow: 0 16px 28px var(--brand-primary-shadow); }
.export-btn-secondary { background: #f1f5f9; color: #475569; }
.export-progress-wrap { display: none; padding-top: 4px; }
.export-progress-track { width: 100%; height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin: 16px 0 10px; }
.export-progress-bar { height: 100%; width: 0%; background: var(--brand-primary); border-radius: 999px; transition: width .25s ease; }
.export-progress-text { font-size: 13px; color: #475569; font-weight: 700; line-height: 1.8; }
.export-progress-small { font-size: 11px; color: #94a3b8; margin-top: 6px; }
body.exporting .floating-toolbar, body.exporting .resizer, body.exporting .brand-menu, body.exporting .ready-icon-popover, body.exporting #selection-marquee, body.exporting #selection-tools, body.exporting .smart-guides-layer, body.exporting .selection-transform-box { display: none !important; }
body.exporting .page-number-overlay.editing { border-color: transparent !important; background: transparent !important; }
body.exporting .page-number-resize { display: none !important; }
body.exporting .template-slot-controls-layer, body.exporting [data-export-ui="true"] { display: none !important; }


/* Export-safe rendering fixes */
body.exporting #canvas,
body.exporting #canvas *,
body.exporting .content,
body.exporting .content * {
    font-family: var(--brand-font), Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}
body.exporting #canvas * {
    transition: none !important;
    animation: none !important;
    caret-color: transparent !important;
}
body.exporting .p3-slide [data-editable="true"] {
    outline: none !important;
    background: transparent !important;
    caret-color: transparent !important;
}
body.exporting .element-wrapper {
    border-color: transparent !important;
    background: transparent !important;
}
body.exporting .image-content {
    max-width: 100% !important;
    display: block !important;
}
body.exporting .export-disable-mask {
    -webkit-mask-image: none !important;
    mask-image: none !important;
    -webkit-mask-composite: source-over !important;
    mask-composite: add !important;
}

/* Export Engine v2: مسرح التصدير خارج الشاشة
   ملاحظة مهمة: لا نستخدم visibility/opacity للإخفاء لأن مكتبات الالتقاط
   تنسخ الأنماط المحسوبة وستجعل الناتج فارغًا — الإزاحة خارج الشاشة هي الطريقة الآمنة. */
#export-stage { position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none; }
#export-canvas-clone {
    width: 960px; height: 540px; background: white; position: relative;
    border: none !important; box-shadow: none !important; border-radius: 0 !important;
    background-size: cover; background-position: center; overflow: hidden;
}

/* =============================================================================
 * اختيار ورفع الخطوط المخصصة في لوحة الهوية
 * ===========================================================================*/
.org-font-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.org-font-option {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px;
    background: #fff; cursor: pointer; transition: 0.2s;
}
.org-font-option:hover { border-color: var(--brand-primary); background: var(--brand-primary-tint); }
.org-font-option.active { border-color: var(--brand-primary); background: var(--brand-primary-tint); box-shadow: 0 0 0 1px var(--brand-primary) inset; }
.org-font-radio { display: flex; align-items: center; gap: 10px; }
.org-font-radio input { accent-color: var(--brand-primary); width: 16px; height: 16px; }
.org-font-name { font-size: 16px; font-weight: 700; color: var(--brand-text); }
.org-font-meta { display: flex; align-items: center; gap: 8px; }
.org-font-badge {
    font-size: 10px; font-weight: 800; color: #64748b;
    background: #f1f5f9; border-radius: 999px; padding: 3px 8px; font-family: var(--brand-font), sans-serif;
}
.org-font-del {
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid #fee2e2;
    background: #fef2f2; color: #dc2626; display: inline-flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.org-font-del:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.org-font-del i { width: 14px; height: 14px; }
.org-font-upload { display: flex; flex-direction: column; gap: 6px; }
.org-font-upload .admin-secondary-btn { display: inline-flex; align-items: center; gap: 8px; width: fit-content; }
.org-font-upload .admin-secondary-btn i { width: 16px; height: 16px; }
.org-font-hint { font-size: 11px; color: #94a3b8; line-height: 1.7; font-family: var(--brand-font), sans-serif; }

/* =============================================================================
 * Splash Screen — شاشة البداية الترحيبية (تعتمد على Brand Tokens)
 * ===========================================================================*/
#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow: hidden;
    background:
        radial-gradient(120% 120% at 80% 10%, var(--brand-primary-soft), transparent 55%),
        radial-gradient(120% 120% at 10% 90%, var(--brand-secondary-soft), transparent 55%),
        linear-gradient(150deg, var(--brand-background) 0%, #ffffff 55%, var(--brand-background) 100%);
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.6s ease;
}
#splash-screen.splash-leaving { opacity: 0; transform: scale(1.03); pointer-events: none; }

.splash-bg { position: absolute; inset: 0; overflow: hidden; }
.splash-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.5; will-change: transform; }
.splash-orb-1 { width: 420px; height: 420px; top: -120px; right: -80px; background: var(--brand-primary); animation: splashFloat1 14s ease-in-out infinite; }
.splash-orb-2 { width: 360px; height: 360px; bottom: -120px; left: -60px; background: var(--brand-secondary); animation: splashFloat2 18s ease-in-out infinite; }
.splash-orb-3 { width: 260px; height: 260px; top: 45%; left: 55%; background: var(--brand-primary); opacity: 0.28; animation: splashFloat3 22s ease-in-out infinite; }
.splash-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--brand-primary-tint) 1px, transparent 1px),
        linear-gradient(90deg, var(--brand-primary-tint) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 72%);
    mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 72%);
    opacity: 0.6;
}
@keyframes splashFloat1 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(-40px,30px) scale(1.08);} }
@keyframes splashFloat2 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(35px,-25px) scale(1.1);} }
@keyframes splashFloat3 { 0%,100%{transform:translate(-50%,-50%) scale(1);} 50%{transform:translate(-58%,-42%) scale(1.15);} }

.splash-content { position: relative; z-index: 2; text-align: center; max-width: 680px; }
.splash-badge {
    display: inline-flex; align-items: center; gap: 9px; padding: 8px 16px; border-radius: 999px;
    background: rgba(255,255,255,0.7); border: 1px solid var(--brand-primary-soft);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); margin-bottom: 26px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}
.splash-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-primary); box-shadow: 0 0 0 0 var(--brand-primary-shadow); animation: splashPulse 2.2s ease-out infinite; }
.splash-badge-text { font-size: 12px; font-weight: 800; color: var(--brand-text); letter-spacing: 0.2px; }
@keyframes splashPulse { 0%{box-shadow:0 0 0 0 var(--brand-primary-shadow);} 70%{box-shadow:0 0 0 12px rgba(0,0,0,0);} 100%{box-shadow:0 0 0 0 rgba(0,0,0,0);} }

.splash-line { margin: 0; line-height: 1.25; }
.splash-line-1 { font-size: clamp(34px, 6vw, 64px); font-weight: 950; color: var(--brand-text); }
.splash-line-2 { font-size: clamp(22px, 3.6vw, 38px); font-weight: 800; color: var(--brand-text); opacity: 0.85; margin-top: 4px; }
.splash-line-3 { font-size: clamp(28px, 4.6vw, 50px); font-weight: 950; color: var(--brand-text); margin-top: 6px; }
.splash-brand { background: linear-gradient(120deg, var(--brand-primary), var(--brand-secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }

.splash-start-btn {
    display: inline-flex; align-items: center; gap: 10px; margin-top: 38px; padding: 16px 38px;
    border: none; border-radius: 16px; background: var(--brand-primary); color: var(--brand-white, #fff);
    font-family: inherit; font-size: 17px; font-weight: 900; cursor: pointer;
    box-shadow: 0 18px 40px var(--brand-primary-shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.splash-start-btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 26px 54px var(--brand-primary-shadow); }
.splash-start-btn:active { transform: translateY(-1px) scale(0.99); }
.splash-start-btn svg { transition: transform 0.22s ease; }
.splash-start-btn:hover svg { transform: translateX(-4px); }
@keyframes splashBtnBob { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-5px);} }

.splash-content .splash-badge, .splash-content .splash-line, .splash-content .splash-start-btn {
    opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease;
}
#splash-screen.splash-in .splash-badge { opacity: 1; transform: none; transition-delay: 0.05s; }
#splash-screen.splash-in .splash-line-1 { opacity: 1; transform: none; transition-delay: 0.22s; }
#splash-screen.splash-in .splash-line-2 { opacity: 1; transform: none; transition-delay: 0.40s; }
#splash-screen.splash-in .splash-line-3 { opacity: 1; transform: none; transition-delay: 0.58s; }
#splash-screen.splash-in .splash-start-btn { opacity: 1; transform: none; transition-delay: 0.80s; animation: splashBtnBob 3s ease-in-out infinite 1.4s; }

@media (max-width: 520px) {
    .splash-orb-1 { width: 280px; height: 280px; }
    .splash-orb-2 { width: 240px; height: 240px; }
    .splash-start-btn { padding: 14px 30px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .splash-orb, .splash-badge-dot, .splash-start-btn { animation: none !important; }
    .splash-content .splash-badge, .splash-content .splash-line, .splash-content .splash-start-btn { transition: opacity 0.3s ease; transform: none; }
}

/* =============================================================================
 * AI Presentation Builder — منشئ العروض الذكي
 * ===========================================================================*/
.ai-sidebar-btn { color: var(--brand-secondary); }
.ai-sidebar-btn:hover { color: var(--brand-primary); }

.ai-modal-backdrop {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 24px;
    animation: aiFade 0.2s ease;
}
@keyframes aiFade { from { opacity: 0; } to { opacity: 1; } }

.ai-modal {
    width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto;
    background: #fff; border-radius: 24px; box-shadow: 0 30px 70px rgba(15, 23, 42, 0.3);
    display: flex; flex-direction: column;
    animation: aiSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes aiSlideUp { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }

.ai-modal-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 24px 26px 18px; border-bottom: 1px solid #eef2f7;
}
.ai-modal-titles h2 {
    display: flex; align-items: center; gap: 10px;
    font-size: 21px; font-weight: 950; color: var(--brand-text); margin: 0 0 6px;
}
.ai-modal-titles h2 i { color: var(--brand-primary); width: 22px; height: 22px; }
.ai-modal-titles p { font-size: 13px; color: #64748b; margin: 0; line-height: 1.7; }
.ai-modal-close {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
    background: #f1f5f9; color: #475569; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.ai-modal-close:hover { background: #e2e8f0; }

.ai-modal-body { padding: 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.ai-field-label { font-size: 13px; font-weight: 800; color: var(--brand-text); margin-bottom: 8px; display: block; }
.ai-textarea, .ai-input, .ai-select {
    width: 100%; border: 1.5px solid #e2e8f0; border-radius: 14px; padding: 13px 15px;
    font-family: inherit; font-size: 14px; color: var(--brand-text); background: #fff; transition: 0.2s; resize: vertical;
}
.ai-textarea:focus, .ai-input:focus, .ai-select:focus {
    outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint);
}
.ai-field-row { display: flex; gap: 14px; }
.ai-field-col { flex: 1; }

.ai-status { font-size: 13px; font-weight: 700; padding: 12px 14px; border-radius: 12px; line-height: 1.6; }
/* أصول الهوية في المنشئ الذكي */
.ai-assets { border: 1px solid #eef0f2; border-radius: 14px; padding: 4px 14px; background: #fcfcfd; }
.ai-assets > summary { cursor: pointer; font-size: 13px; font-weight: 800; color: var(--brand-text); padding: 12px 2px; list-style: none; }
.ai-assets > summary::-webkit-details-marker { display: none; }
.ai-assets-body { display: flex; flex-direction: column; gap: 16px; padding: 6px 0 14px; }
.ai-asset-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ai-asset-head .ai-field-label { margin-bottom: 0; }
.ai-asset-upload { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--brand-primary); cursor: pointer; padding: 6px 10px; border: 1px dashed var(--brand-primary); border-radius: 10px; }
.ai-asset-upload i { width: 14px; height: 14px; }
.ai-asset-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ai-asset-chip { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; min-width: 84px; max-width: 120px; padding: 10px; border: 1.5px solid #e7e9ec; border-radius: 12px; background: #fff; cursor: pointer; transition: 0.15s; }
.ai-asset-chip:hover { border-color: var(--brand-primary); }
.ai-asset-chip.selected { border-color: var(--brand-primary); background: var(--brand-primary-tint, #eafaf7); box-shadow: 0 2px 8px var(--brand-primary-shadow); }
.ai-asset-chip img { max-width: 88px; max-height: 46px; object-fit: contain; }
.ai-asset-chip span { font-size: 11px; font-weight: 700; color: #64748b; text-align: center; line-height: 1.3; }
/* صور العرض: مصغّرات أكبر تملأ البطاقة */
.ai-photo-chip { min-width: 104px; max-width: 132px; padding: 0; overflow: hidden; }
.ai-photo-chip img { max-width: none; width: 132px; height: 78px; object-fit: cover; border-radius: 10px 10px 0 0; }
.ai-photo-chip span { padding: 6px 8px; display: block; }
.ai-photo-chip.selected { box-shadow: 0 0 0 2px var(--brand-primary); }
.ai-asset-empty { font-size: 12px; font-weight: 600; color: #94a3b8; line-height: 1.6; padding: 8px 4px; }
.ai-status.loading { background: var(--brand-primary-tint); color: var(--brand-primary); }
.ai-status.success { background: #ecfdf5; color: #059669; }
.ai-status.error { background: #fef2f2; color: #dc2626; }

.ai-modal-foot {
    display: flex; justify-content: flex-start; gap: 12px;
    padding: 18px 26px 24px; border-top: 1px solid #eef2f7;
}
.ai-btn-primary {
    display: inline-flex; align-items: center; gap: 9px; padding: 13px 26px; border-radius: 14px;
    background: var(--brand-primary); color: #fff; font-weight: 900; font-size: 15px; cursor: pointer;
    box-shadow: 0 14px 30px var(--brand-primary-shadow); transition: 0.2s; border: none;
}
.ai-btn-primary:hover { transform: translateY(-2px); }
.ai-btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }
.ai-btn-primary i { width: 17px; height: 17px; }
.ai-btn-primary.is-loading i { animation: aiSpin 0.8s linear infinite; }
@keyframes aiSpin { to { transform: rotate(360deg); } }
.ai-btn-secondary {
    padding: 13px 22px; border-radius: 14px; background: #f1f5f9; color: #475569;
    font-weight: 800; font-size: 14px; cursor: pointer; border: none; transition: 0.2s;
}
.ai-btn-secondary:hover { background: #e2e8f0; }

@media (max-width: 520px) { .ai-field-row { flex-direction: column; } }

/* V7.1 Pilot — المنشئ الذكي معلن دون إتاحة الاستخدام */
.ai-sidebar-btn.is-coming-soon { position: relative; opacity: .68; cursor: not-allowed; filter: saturate(.55); }
.ai-sidebar-btn.is-coming-soon:hover { transform: none; background: transparent; }
.coming-soon-badge { position: absolute; left: -1px; top: -5px; padding: 2px 5px; border: 1px solid color-mix(in srgb,var(--brand-primary) 24%,#fff); border-radius: 999px; color: var(--brand-primary); background: #fff; box-shadow: 0 4px 10px rgba(15,23,42,.10); font-size: 7px; line-height: 1.25; white-space: nowrap; }

/* دور المشاهد: عرض وتنقل وتصدير فقط، دون أدوات تحرير. */
body.viewer-mode .editor-view > div.flex.flex-1 > aside:first-of-type,
body.viewer-mode #selection-tools,
body.viewer-mode .history-btn,
body.viewer-mode .project-save-meta { display: none !important; }
body.viewer-mode #canvas { pointer-events: none; }
body.viewer-mode .project-name-input { border-color: transparent; background: transparent; cursor: default; }

@media (max-width: 1180px) {
    .editor-view > header { padding-inline: 18px !important; gap: 12px; }
    .editor-view > header > div:first-child { gap: 12px !important; min-width: 0; }
    .editor-view > header #brand-title { display: none; }
    .project-title-wrap { min-width: 180px; }
    .project-name-input { width: 210px; max-width: 24vw; }
    .stage-wrapper { padding: 34px; }
}

@media (max-width: 920px) {
    .editor-view > header { overflow-x: auto; justify-content: flex-start !important; }
    .editor-view > header > div:last-child { margin-right: auto; flex: 0 0 auto; }
    #slides-panel { width: 160px !important; padding: 16px !important; }
    .stage-wrapper { padding: 24px; }
}

/* عدّاد استخدام منشئ العروض الذكي */
.ai-usage-line { font-size: 12px; color: #94a3b8; font-weight: 700; text-align: left; }
.ai-usage-line strong { color: var(--brand-primary); }
