
:root{--brand:#7e22ce;--brand2:#5d5cde;--ink:#172033;--muted:#687386;--line:#e5e8f0;--surface:#fff;--surface2:#f7f8fc;--page:#f4f5fb;--shadow:0 18px 48px rgba(25,20,54,.08)}
html.dark{--ink:#edf0f8;--muted:#a6aec0;--line:#30394b;--surface:#1b2332;--surface2:#222c3d;--page:#111827;--shadow:0 18px 48px rgba(0,0,0,.24);color-scheme:dark}
*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:90px}
body{margin:0;background:var(--page);color:var(--ink);font-family:"Outfit","Tajawal",sans-serif;line-height:1.65}
html[lang="ar"] body{font-family:"Tajawal","Outfit",sans-serif}
a{color:inherit;text-decoration:none}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:not-allowed}img{display:block;max-width:100%}
.container{width:min(1160px,calc(100% - 36px));margin-inline:auto}
.site-header{position:sticky;top:0;z-index:100;background:color-mix(in srgb,var(--surface) 94%,transparent);border-bottom:1px solid var(--line);backdrop-filter:blur(16px)}
.header-inner{min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.brand{display:inline-flex;align-items:center;gap:10px;flex:0 0 auto;font-size:19px;font-weight:900;letter-spacing:-.04em}
.brand-mark{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(135deg,#e91e9a,#7e22ce 55%,#4256d8);color:#fff;font-size:16px;box-shadow:0 8px 20px rgba(126,34,206,.2)}
.nav-links,.header-actions{display:flex;align-items:center;gap:18px}.nav-links a{color:var(--muted);font-size:13px;font-weight:750}.nav-links a:hover{color:var(--brand)}
.header-actions{gap:8px}.lang-link,.icon-btn,.menu-btn{height:40px;min-width:40px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:800}.lang-link{color:var(--brand)}.icon-btn,.menu-btn{width:40px;padding:0}.menu-btn{display:none}
.mobile-menu{display:none;padding:10px 18px 16px;border-top:1px solid var(--line);background:var(--surface)}.mobile-menu.is-open{display:grid;gap:4px}.mobile-menu a{padding:10px 8px;color:var(--muted);font-weight:750}
.hero{padding:54px 0 28px;text-align:center}.eyebrow{display:inline-flex;align-items:center;gap:8px;padding:7px 13px;border:1px solid rgba(126,34,206,.18);border-radius:999px;background:rgba(126,34,206,.08);color:var(--brand);font-size:11px;font-weight:900;letter-spacing:.06em}
.hero h1{max-width:850px;margin:17px auto 10px;font-size:clamp(32px,5vw,52px);line-height:1.15;font-weight:950;letter-spacing:-.045em}.hero p{max-width:740px;margin:0 auto;color:var(--muted);font-size:16px;line-height:1.85}
.trust-row{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;margin-top:20px}.trust-pill{display:inline-flex;align-items:center;gap:7px;padding:8px 12px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--muted);font-size:11px;font-weight:800}.trust-pill i{color:#16a36a}
.workspace{display:grid;grid-template-columns:minmax(310px,.82fr) minmax(0,1.18fr);gap:18px;align-items:start;margin:22px auto 34px}
.panel{min-width:0;border:1px solid var(--line);border-radius:20px;background:var(--surface);box-shadow:var(--shadow)}.controls-panel{padding:20px}
.panel-heading{display:flex;align-items:center;gap:11px;margin-bottom:18px}.panel-icon{width:40px;height:40px;display:grid;place-items:center;flex:0 0 40px;border-radius:13px;background:rgba(126,34,206,.1);color:var(--brand);font-size:17px}
.panel-heading h2{margin:0;font-size:16px;font-weight:900}.panel-heading p{margin:3px 0 0;color:var(--muted);font-size:11px}
.upload-zone{position:relative;display:flex;min-height:240px;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:22px;border:2px dashed rgba(126,34,206,.35);border-radius:17px;background:linear-gradient(135deg,rgba(126,34,206,.045),rgba(93,92,222,.025));text-align:center;transition:border-color .2s,background .2s}
.upload-zone.is-dragover{border-color:var(--brand);background:rgba(126,34,206,.1)}.upload-icon{width:54px;height:54px;display:grid;place-items:center;border-radius:17px;background:rgba(126,34,206,.11);color:var(--brand);font-size:23px}
.upload-zone h3{margin:2px 0 0;font-size:15px;font-weight:900}.upload-zone p{max-width:300px;margin:0;color:var(--muted);font-size:11px;line-height:1.7}
.file-button,.primary-button,.secondary-button,.download-button{min-height:43px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 16px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:900;transition:transform .18s,border-color .18s,box-shadow .18s}
.file-button,.primary-button,.download-button{border-color:transparent;background:linear-gradient(110deg,var(--brand),var(--brand2));color:#fff;box-shadow:0 9px 20px rgba(126,34,206,.17)}
.file-button:hover,.primary-button:hover,.download-button:hover{transform:translateY(-1px);box-shadow:0 12px 24px rgba(126,34,206,.23)}.secondary-button:hover{border-color:rgba(126,34,206,.35);color:var(--brand)}
.file-note{font-size:10px!important}.file-summary{display:none;align-items:center;gap:11px;margin-top:13px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface2)}.file-summary.is-visible{display:flex}
.file-thumb{width:46px;height:46px;flex:0 0 46px;overflow:hidden;border-radius:9px;background:var(--surface)}.file-thumb img{width:100%;height:100%;object-fit:cover}.file-meta{min-width:0;flex:1}.file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:850}.file-details{margin-top:3px;color:var(--muted);font-size:10px}
.remove-file{width:32px;height:32px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--muted)}
.settings{margin-top:18px;padding-top:17px;border-top:1px solid var(--line)}.settings h3{margin:0 0 13px;font-size:13px;font-weight:900}.setting-row{display:grid;grid-template-columns:1fr;gap:8px;margin-bottom:15px}
.setting-label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;font-weight:850}.setting-help{color:var(--muted);font-size:10px;font-weight:500}
.quality-options,.background-options{display:flex;flex-wrap:wrap;gap:7px}.choice{position:relative}.choice input{position:absolute;width:1px;height:1px;opacity:0}.choice span{min-height:36px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border:1px solid var(--line);border-radius:9px;background:var(--surface2);color:var(--muted);font-size:11px;font-weight:800;cursor:pointer}.choice input:checked+span{border-color:var(--brand);background:rgba(126,34,206,.09);color:var(--brand);box-shadow:inset 0 0 0 1px rgba(126,34,206,.15)}
.color-control{width:40px;height:36px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.actions .primary-button{flex:1}
.progress-box{display:none;margin-top:15px;padding:13px;border:1px solid var(--line);border-radius:12px;background:var(--surface2)}.progress-box.is-visible{display:block}.progress-top{display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:11px;font-weight:800}.progress-track{height:8px;overflow:hidden;margin-top:10px;border-radius:99px;background:var(--line)}.progress-fill{width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--brand),var(--brand2));transition:width .18s}.progress-note{margin:8px 0 0;color:var(--muted);font-size:10px;line-height:1.6}
.status-message{display:none;margin-top:12px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;font-size:11px;line-height:1.6}.status-message.is-visible{display:block}.status-message.error{border-color:rgba(220,38,38,.24);background:rgba(220,38,38,.06);color:#dc2626}.status-message.success{border-color:rgba(22,163,74,.24);background:rgba(22,163,74,.06);color:#16834a}
.preview-panel{padding:17px}.preview-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 13px}.preview-head h2{margin:0;font-size:14px;font-weight:900}.preview-state{display:inline-flex;align-items:center;gap:6px;color:#159b65;font-size:10px;font-weight:900}.preview-state:before{content:"";width:7px;height:7px;border-radius:50%;background:#17b978;box-shadow:0 0 0 4px rgba(23,185,120,.12)}
.compare-stage{position:relative;display:none;min-height:360px;overflow:hidden;place-items:center;touch-action:pan-y;user-select:none;-webkit-user-select:none;cursor:ew-resize;border:1px solid var(--line);border-radius:16px;background-color:#eef0f6;background-image:linear-gradient(45deg,#dce0ea 25%,transparent 25%),linear-gradient(-45deg,#dce0ea 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#dce0ea 75%),linear-gradient(-45deg,transparent 75%,#dce0ea 75%);background-size:22px 22px;background-position:0 0,0 11px,11px -11px,-11px 0}
.compare-stage.is-visible{display:grid}.compare-image{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:12px}.compare-after{position:absolute;inset:0;overflow:hidden;clip-path:inset(0 0 0 50%);background:transparent}.compare-after img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:12px}
.compare-divider{position:absolute;top:0;bottom:0;left:50%;width:2px;background:#fff;box-shadow:0 0 0 1px rgba(23,32,51,.25);pointer-events:none}.compare-divider:after{content:"↔";position:absolute;top:50%;left:50%;width:34px;height:34px;display:grid;place-items:center;transform:translate(-50%,-50%);border:2px solid #fff;border-radius:50%;background:var(--brand);color:#fff;font-size:15px;font-weight:900;box-shadow:0 3px 12px rgba(0,0,0,.18)}
.compare-slider{position:absolute;inset:0;z-index:1;width:1px;height:1px;margin:0;padding:0;opacity:0;pointer-events:none;direction:ltr;appearance:none;border:0}.compare-stage:focus-within{outline:2px solid var(--brand);outline-offset:3px}.compare-stage.is-dragging{cursor:grabbing}.compare-image,.compare-after,.compare-after img{pointer-events:none;-webkit-user-drag:none}.compare-hint{display:none;justify-content:space-between;gap:12px;margin:9px 3px 0;color:var(--muted);font-size:10px;font-weight:800}.compare-hint.is-visible{display:flex}
.preview-empty{min-height:360px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:30px;border:1px dashed var(--line);border-radius:16px;background:var(--surface2);color:var(--muted);text-align:center}.preview-empty i{font-size:35px;color:rgba(126,34,206,.55)}.preview-empty strong{color:var(--ink);font-size:13px}.preview-empty span{max-width:280px;font-size:11px;line-height:1.7}
.result-actions{display:none;flex-wrap:wrap;gap:8px;margin-top:13px}.result-actions.is-visible{display:flex}.result-actions .download-button{flex:1}
.privacy-card{display:flex;gap:12px;margin-top:15px;padding:13px;border:1px solid rgba(22,163,74,.18);border-radius:13px;background:rgba(22,163,74,.045)}.privacy-card i{flex:0 0 auto;margin-top:2px;color:#16a36a}.privacy-card strong{display:block;margin-bottom:3px;font-size:11px}.privacy-card p{margin:0;color:var(--muted);font-size:10px;line-height:1.7}
.info-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin:0 auto 44px}.info-card{padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}.info-card i{width:36px;height:36px;display:grid;place-items:center;margin-bottom:11px;border-radius:11px;background:rgba(126,34,206,.1);color:var(--brand)}.info-card h3{margin:0 0 6px;font-size:13px;font-weight:900}.info-card p{margin:0;color:var(--muted);font-size:11px;line-height:1.75}
.faq-section{margin:0 auto 55px}.section-heading{text-align:center;margin-bottom:18px}.section-heading h2{margin:0;font-size:clamp(22px,3vw,30px);font-weight:950}.faq-list{display:grid;gap:9px;max-width:900px;margin:0 auto}.faq-item{overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.faq-item summary{padding:14px 16px;cursor:pointer;font-size:12px;font-weight:900}.faq-item p{margin:0;padding:0 16px 15px;color:var(--muted);font-size:11px;line-height:1.8}
.site-footer{padding:27px 0 18px;border-top:1px solid var(--line);background:var(--surface)}.footer-inner{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:14px}.footer-tag{margin:0;color:var(--muted);font-size:11px}.footer-links{display:flex;flex-wrap:wrap;gap:13px}.footer-links a{color:var(--muted);font-size:11px;font-weight:750}.footer-bottom{margin-top:18px;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font-size:10px;text-align:center}
@media(max-width:900px){.workspace{grid-template-columns:1fr}.controls-panel{order:1}.preview-panel{order:2}.compare-stage,.preview-empty{min-height:320px}}
@media(max-width:760px){.container{width:calc(100% - 24px)}.header-inner{min-height:64px;gap:8px}.nav-links{display:none}.menu-btn{display:inline-flex}.header-actions{gap:5px}.hero{padding:40px 0 18px}.hero h1{font-size:clamp(28px,8vw,38px)}.hero p{font-size:13px}.workspace{gap:12px;margin-top:15px}.controls-panel{padding:14px}.preview-panel{padding:12px}.compare-stage,.preview-empty{min-height:270px}.info-grid{grid-template-columns:1fr;gap:9px}.info-card{padding:15px}}
@media(max-width:420px){.brand{font-size:16px;gap:7px}.brand-mark{width:35px;height:35px;font-size:14px}.lang-link,.icon-btn,.menu-btn{height:35px;min-width:35px;width:35px;padding:0;font-size:10px}.header-actions{gap:4px}.hero h1{font-size:28px}.trust-pill{font-size:9px;padding:7px 9px}.compare-stage,.preview-empty{min-height:230px}.compare-image,.compare-after img{padding:6px}.controls-panel{padding:12px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}


/* Respect the HTML hidden attribute for all controls (notably Cancel processing). */
[hidden] { display: none !important; }
