:root{--bg:#f6f7fb;--card:#fff;--text:#1f2937;--muted:#6b7280;--primary:#4f46e5;--primary2:#7c3aed;--border:#e5e7eb;--danger:#dc2626;--ok:#059669}*{box-sizing:border-box}body{margin:0;font-family:'Tahoma','Arial',sans-serif;background:var(--bg);color:var(--text);direction:rtl}.auth-body{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#1e1b4b,#312e81,#7c3aed)}.auth-card{width:min(430px,92vw);background:white;padding:30px;border-radius:24px;box-shadow:0 20px 60px rgba(0,0,0,.25)}.brand{font-size:34px;font-weight:900;color:var(--primary);margin:0}.subtitle{color:var(--muted);margin:8px 0 22px}.input,label{display:block;width:100%}.input{border:1px solid var(--border);padding:13px;border-radius:12px;margin:7px 0 14px;font-size:15px}.btn{border:none;border-radius:12px;padding:11px 16px;background:var(--primary);color:white;font-weight:700;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:8px}.btn:hover{filter:brightness(.95)}.btn.alt{background:#111827}.btn.light{background:#eef2ff;color:#3730a3}.btn.danger{background:var(--danger)}.btn.ok{background:var(--ok)}.layout{display:grid;grid-template-columns:300px 1fr;min-height:100vh}.sidebar{background:#111827;color:white;padding:18px;position:sticky;top:0;height:100vh;overflow:auto}.sidebar .logo{font-size:26px;font-weight:900;margin-bottom:18px}.sidebar a{color:#e5e7eb;text-decoration:none;display:block;padding:11px 12px;border-radius:12px;margin:5px 0}.sidebar a:hover,.sidebar a.active{background:rgba(255,255,255,.1)}.main{padding:22px}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;gap:10px}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}.card{background:var(--card);border:1px solid var(--border);border-radius:18px;padding:18px;box-shadow:0 8px 22px rgba(15,23,42,.04)}.card h3{margin:0 0 8px}.muted{color:var(--muted)}.search{display:flex;gap:8px;margin-bottom:16px}.search .input{margin:0}.editor-wrap{display:grid;grid-template-columns:1fr 280px;gap:16px}.editor-card{background:white;border:1px solid var(--border);border-radius:18px;overflow:hidden}.editor-toolbar{display:flex;gap:8px;flex-wrap:wrap;padding:12px;border-bottom:1px solid var(--border);background:#fafafa}.editor-title{width:100%;border:none;font-size:30px;font-weight:900;padding:18px 20px 0;outline:none}.editor{min-height:520px;padding:20px;outline:none;line-height:1.85;font-size:17px}.editor:focus{background:#fff}.tools{background:white;border:1px solid var(--border);border-radius:18px;padding:16px;height:max-content}.tool-btn{display:block;width:100%;margin-bottom:8px;text-align:right;background:#f3f4f6;color:#111827}.alert{padding:12px;border-radius:12px;margin:10px 0;background:#fee2e2;color:#991b1b}.okmsg{background:#dcfce7;color:#166534}.public-page{max-width:900px;margin:35px auto;background:white;padding:40px;border-radius:22px;line-height:1.9}.kanban{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.kanban-col{background:#f3f4f6;border-radius:12px;padding:10px;min-height:90px}.block-box{border:1px dashed #c7d2fe;background:#eef2ff;border-radius:12px;padding:10px;margin:10px 0}@media(max-width:900px){.layout{grid-template-columns:1fr}.sidebar{height:auto;position:relative}.editor-wrap{grid-template-columns:1fr}.topbar{flex-direction:column;align-items:stretch}.kanban{grid-template-columns:1fr}}@media print{.sidebar,.topbar,.tools,.editor-toolbar{display:none}.layout,.editor-wrap{display:block}.main{padding:0}.editor-card{border:none}.editor{min-height:auto}.editor-title{padding:0}}

/* v2 additions */
.badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 10px;background:#eef2ff;color:#3730a3;font-size:12px;font-weight:700}
.toolbar-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0}
.dropdown-block{border:1px solid #e5e7eb;border-radius:14px;padding:10px;background:#fff;margin:8px 0}
.dropdown-block summary{cursor:pointer;font-weight:800}
.block-comment{border-right:4px solid #4f46e5;background:#f8fafc;padding:10px;border-radius:10px;margin:8px 0}
.site-card{border:1px dashed #cbd5e1;background:#fff;border-radius:18px;padding:16px}
.print-designer{max-width:820px;margin:auto;background:#fff;padding:35px;border:1px solid #e5e7eb}
.progress{height:10px;border-radius:999px;background:#e5e7eb;overflow:hidden}.progress>span{display:block;height:100%;background:#4f46e5}
@media(max-width:800px){.layout{display:block}.sidebar{position:fixed;bottom:0;left:0;right:0;top:auto;width:auto;height:auto;display:flex;overflow:auto;z-index:20;border-radius:22px 22px 0 0}.sidebar .logo,.sidebar hr,.sidebar p,.sidebar small{display:none}.sidebar a{white-space:nowrap}.main{margin:0;padding-bottom:96px}.editor-wrap{display:block}.tools{margin-top:14px}.topbar{display:block}.grid{grid-template-columns:1fr}.auth-card{width:92%}}
@media print{.sidebar,.topbar,.tools,.editor-toolbar,.btn,.search{display:none!important}.main{margin:0}.editor-card,.public-page,.print-designer{box-shadow:none;border:0}.layout{display:block}body{background:#fff}}

/* v3 additions */
.callout-block{background:#fff7ed;border:1px solid #fed7aa;border-radius:14px;padding:14px;margin:10px 0}
.note-button{border:0;border-radius:12px;background:#111827;color:white;padding:10px 14px;font-weight:700}
.media-preview{border:1px dashed #94a3b8;background:#f8fafc;border-radius:14px;padding:14px;margin:10px 0;word-break:break-word}
.block-box[draggable="true"], .editor > *[draggable="true"]{cursor:grab}
.print-panel{background:white;border:1px solid #e5e7eb;border-radius:18px;padding:18px;margin-bottom:16px}
.template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.template-card{background:white;border:1px solid #e5e7eb;border-radius:16px;padding:16px;box-shadow:0 8px 24px rgba(15,23,42,.06)}
.mobile-bar{display:none}
@media(max-width:800px){.mobile-bar{display:flex;position:fixed;bottom:0;left:0;right:0;background:white;border-top:1px solid #e5e7eb;z-index:30;justify-content:space-around;padding:8px}.main{padding-bottom:70px}.editor-wrap{grid-template-columns:1fr}.tools{order:-1}.sidebar{display:none}}
/* v4 admin and SaaS polish */
.notice{background:#ecfdf5;border:1px solid #a7f3d0;color:#065f46;border-radius:14px;padding:12px;margin:12px 0}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin:16px 0}.stat{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:18px;box-shadow:0 8px 20px rgba(15,23,42,.05)}.stat b{display:block;font-size:30px;color:#4f46e5}.stat span{color:#64748b}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;background:#fff}th,td{padding:12px;border-bottom:1px solid #e5e7eb;text-align:right}th{background:#f8fafc;color:#475569}.small{padding:8px 12px;font-size:13px}.mini-card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:10px}.mini-card label{font-size:13px;color:#475569}.mini-card input[type="checkbox"]{width:auto;margin-left:8px}.badge{display:inline-block;border-radius:999px;background:#eef2ff;color:#3730a3;padding:4px 10px;font-size:12px}.locked-note{border:1px dashed #ef4444;background:#fef2f2;color:#991b1b;padding:10px;border-radius:12px}

/* v10 */
.meta-grid{display:grid;grid-template-columns:2fr 1fr 180px;gap:10px;margin-bottom:10px}
.seo-box{background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:10px;margin:10px 0}
.seo-box textarea{min-height:70px;margin-top:8px}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:14px 0}
.stat-card{background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:14px;box-shadow:0 10px 28px rgba(15,23,42,.06)}
.folder-chip{display:inline-flex;gap:6px;align-items:center;background:#eef2ff;border:1px solid #c7d2fe;border-radius:999px;padding:7px 10px;margin:3px;text-decoration:none;color:#3730a3}
@media(max-width:800px){.meta-grid{grid-template-columns:1fr}.toolbar-row{flex-wrap:wrap}}
/* v11 */
.version-preview{margin-top:14px;padding:18px;border:1px solid #e5e7eb;border-radius:16px;background:#fff;max-height:420px;overflow:auto}
.folder-chip{display:inline-flex;gap:6px;align-items:center;padding:6px 10px;border-radius:999px;background:#f8fafc;border:1px solid #e5e7eb;margin:3px;color:#334155;text-decoration:none}
.meta-grid{grid-template-columns:1.4fr 1fr 1fr .8fr}
@media(max-width:900px){.meta-grid{grid-template-columns:1fr}}
/* v13 */
.mini-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));}
.mini-card{display:block;background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:14px;text-decoration:none;color:inherit}
.mini-card .btn{margin-top:8px}

/* v14 additions */
.toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.alert{padding:12px 14px;border-radius:14px;margin:10px 0}.alert.success{background:#dcfce7;color:#166534}.alert.danger{background:#fee2e2;color:#991b1b}.btn.danger{background:#dc2626;color:#fff}.public-page{background:#f8fafc}.public-note-wrap{max-width:920px;margin:32px auto;padding:16px}.note-content img{max-width:100%;height:auto;border-radius:12px}.table{width:100%;border-collapse:collapse}.table th,.table td{border-bottom:1px solid #e5e7eb;padding:10px;text-align:right}.comment{border-bottom:1px solid #e5e7eb;padding:10px 0}.grid.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}@media(max-width:800px){.grid.two{grid-template-columns:1fr}.toolbar .btn{width:100%;text-align:center}.table{display:block;overflow:auto}}

/* v15 */
.badge{display:inline-block;padding:4px 10px;border-radius:999px;background:#eef2ff;color:#3730a3;font-weight:700;font-size:12px}.comment{border:1px solid var(--border);border-radius:14px;padding:14px;margin:10px 0;background:#fff}.comment.resolved{background:#f0fdf4;border-color:#bbf7d0}.comment-head{display:flex;justify-content:space-between;gap:12px;align-items:center}.inline-form{display:grid;grid-template-columns:140px 1fr auto;gap:8px;align-items:center}.outline-list li,.public-outline li{margin:8px 0}.outline-list .level-2,.public-outline .level-2{margin-right:18px}.outline-list .level-3,.public-outline .level-3{margin-right:36px;color:var(--muted)}.public-outline{background:#f8fafc;border:1px solid var(--border);border-radius:16px;padding:14px;margin:16px 0}.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.stat{background:#fff;border:1px solid var(--border);border-radius:18px;padding:18px}.stat b{display:block;font-size:28px;color:var(--primary)}.stat span{color:var(--muted)}@media(max-width:850px){.inline-form{grid-template-columns:1fr}.stats{grid-template-columns:1fr}}


/* v20 Design & Engineering Files */
.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.design-card h3{margin-bottom:6px}
.btn.danger{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}
.design-upload-form .input{margin-bottom:10px}
.viewer-box iframe{border-radius:18px}
.layer-list{direction:ltr;text-align:left;background:#020617;color:#d1fae5;border-radius:12px;padding:12px;white-space:pre-wrap}
@media(max-width:760px){.two{grid-template-columns:1fr}.viewer-box{min-height:420px}.canvas-wrap{min-height:420px}.canvas-wrap canvas{width:100%;height:auto}}

/* v28 - Beautiful Marketplace Templates */
.market-hero{display:flex;justify-content:space-between;gap:18px;align-items:center;background:linear-gradient(135deg,#111827,#312e81,#7c3aed);color:#fff;border-radius:28px;padding:26px;margin-bottom:16px;box-shadow:0 20px 55px rgba(49,46,129,.25)}
.market-hero h1{font-size:34px;margin:6px 0}.market-hero p{max-width:760px;line-height:1.9;color:#e0e7ff}.eyebrow{font-weight:800;color:#fde68a}.hero-badge{min-width:130px;height:130px;border-radius:28px;background:rgba(255,255,255,.12);display:flex;flex-direction:column;justify-content:center;align-items:center;border:1px solid rgba(255,255,255,.25)}.hero-badge b{font-size:42px}.hero-badge span{color:#e0e7ff}
.marketplace-filter select{border:1px solid var(--border);padding:11px;border-radius:12px;background:#fff}.row.gap{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.template-showcase{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px}.pro-template-card{background:#fff;border:1px solid #e5e7eb;border-radius:24px;overflow:hidden;box-shadow:0 14px 35px rgba(15,23,42,.08);transition:.18s transform,.18s box-shadow}.pro-template-card:hover{transform:translateY(-4px);box-shadow:0 20px 55px rgba(15,23,42,.13)}.template-cover{height:128px;padding:20px;display:flex;justify-content:space-between;align-items:flex-start;color:#fff;background:linear-gradient(135deg,#4f46e5,#7c3aed)}.template-cover span{font-size:42px}.template-cover small{background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.25);padding:7px 10px;border-radius:999px;font-weight:800}.template-body{padding:18px}.template-body h3{font-size:21px;margin:0 0 8px}.template-body p{min-height:52px;color:#64748b;line-height:1.7}.template-meta{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.template-meta span{font-size:12px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:999px;padding:5px 9px;color:#475569}.type-legal .template-cover{background:linear-gradient(135deg,#92400e,#b45309,#f59e0b)}.type-course .template-cover{background:linear-gradient(135deg,#065f46,#059669,#10b981)}.type-project .template-cover{background:linear-gradient(135deg,#1e3a8a,#2563eb,#60a5fa)}.type-design .template-cover{background:linear-gradient(135deg,#831843,#db2777,#fb7185)}.type-meeting .template-cover{background:linear-gradient(135deg,#334155,#0f766e,#14b8a6)}.type-diary .template-cover{background:linear-gradient(135deg,#581c87,#9333ea,#c084fc)}.type-business .template-cover{background:linear-gradient(135deg,#0f172a,#475569,#94a3b8)}
.pretty-template{font-family:Tahoma,Arial,sans-serif;line-height:1.9}.pretty-template .cover{border-radius:22px;padding:26px;color:#fff;background:linear-gradient(135deg,#111827,#4f46e5);margin-bottom:18px}.pretty-template .cover h1{margin:0;font-size:30px}.pretty-template .section{border:1px solid #e5e7eb;border-radius:18px;padding:18px;margin:14px 0;background:#fff}.pretty-template h2{color:#312e81;margin-top:0}.pretty-template table{width:100%;border-collapse:collapse}.pretty-template th,.pretty-template td{border:1px solid #e5e7eb;padding:10px}.pretty-template .check{background:#f8fafc;border-radius:12px;padding:10px;margin:8px 0}.pretty-template .two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}@media(max-width:800px){.market-hero{display:block}.hero-badge{height:auto;width:100%;padding:18px;margin-top:14px}.template-showcase{grid-template-columns:1fr}.pretty-template .two-col{grid-template-columns:1fr}}


/* v29 Notion-like blocks */
.mz-block,.block-box{position:relative;margin:8px 0;padding:10px 12px;border-radius:12px;background:#f8fafc;border:1px solid #e5e7eb;min-height:24px}
.mz-check-block label{display:flex;gap:8px;align-items:center}.mz-check-block input{width:18px;height:18px}.mz-check-block span:empty:before{content:'اكتب المهمة...';color:#94a3b8}.mz-select-block{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.mz-select-block select{border:1px solid #dbe3f0;border-radius:10px;padding:7px;background:#fff}.mz-select-block span:empty:before{content:'اكتب الوصف...';color:#94a3b8}.mz-inline-plus{position:absolute;display:none;z-index:2000;width:28px;height:28px;border-radius:9px;border:1px solid #dbe3f0;background:#fff;color:#4f46e5;font-weight:900;box-shadow:0 8px 20px rgba(15,23,42,.12);cursor:pointer}.mz-inline-plus:hover{background:#eef2ff}.mz-block-menu{position:absolute;display:none;z-index:2100;width:220px;background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 18px 45px rgba(15,23,42,.16);padding:8px}.mz-block-menu .mz-menu-title{font-weight:900;color:#0f172a;padding:8px 10px;border-bottom:1px solid #eef2f7;margin-bottom:6px}.mz-block-menu button{display:block;width:100%;border:0;background:transparent;text-align:right;padding:9px 10px;border-radius:10px;cursor:pointer;color:#111827}.mz-block-menu button:hover{background:#eef2ff;color:#3730a3}.editor .mz-block:focus-within,.editor .block-box:focus-within{outline:2px solid #c7d2fe;background:#fff}

/* v30 */
.mz-notification-toast{position:fixed;left:18px;bottom:88px;background:#111827;color:#fff;z-index:9999;border-radius:18px;padding:14px 18px;box-shadow:0 18px 40px rgba(0,0,0,.25);max-width:360px;direction:rtl}.mz-notification-toast p{margin:6px 0;color:#dbeafe}.mz-notification-toast button{float:left;background:transparent;color:#fff;border:0;font-size:20px;cursor:pointer}.mz-notification-toast a{color:#bfdbfe}.mz-bottom-ad{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:9998;display:flex;align-items:center;gap:10px;min-width:280px;max-width:680px;background:rgba(15,23,42,.94);color:#fff;border:1px solid rgba(255,255,255,.16);border-radius:999px;padding:8px 14px;box-shadow:0 12px 36px rgba(15,23,42,.25);direction:rtl}.mz-bottom-ad a{color:#fff;text-decoration:none;display:flex;align-items:center;gap:10px}.mz-bottom-ad img{width:34px;height:34px;border-radius:50%;object-fit:cover}.mz-bottom-ad b{display:block;font-size:13px}.mz-bottom-ad span{font-size:13px;color:#e5e7eb}.mz-bottom-ad button{background:rgba(255,255,255,.16);color:#fff;border:0;border-radius:50%;width:24px;height:24px;cursor:pointer}.template-card-pro{position:relative;overflow:hidden;border:0!important;color:#0f172a}.template-card-pro:before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,var(--c1,#eef2ff),var(--c2,#fff));z-index:0}.template-card-pro>*{position:relative;z-index:1}.template-icon{font-size:36px;width:58px;height:58px;display:flex;align-items:center;justify-content:center;background:#fff;border-radius:18px;box-shadow:0 8px 20px rgba(15,23,42,.08)}.audio-block{border:1px solid #dbeafe;background:#eff6ff;border-radius:16px;padding:12px;margin:10px 0}.mz-block-menu button{display:block;width:100%;margin:4px 0}.mz-inline-plus{box-shadow:0 8px 18px rgba(79,70,229,.2)}

/* v31 selection transform toolbar */
.mz-selection-toolbar{position:absolute;display:none;z-index:2500;align-items:center;gap:4px;background:#111827;color:#fff;border:1px solid rgba(255,255,255,.14);border-radius:12px;padding:6px;box-shadow:0 18px 44px rgba(15,23,42,.25);direction:rtl;max-width:min(94vw,760px);overflow:auto}
.mz-selection-toolbar button{border:0;background:transparent;color:#fff;border-radius:8px;padding:7px 9px;font-weight:800;cursor:pointer;display:inline-flex;gap:6px;align-items:center;white-space:nowrap}
.mz-selection-toolbar button:hover{background:rgba(255,255,255,.14)}
.mz-selection-toolbar span{font-size:12px;font-weight:700}
@media(max-width:700px){.mz-selection-toolbar span{display:none}.mz-selection-toolbar button{min-width:36px;justify-content:center}}
