
:root{color-scheme:dark;--bg:#080e19;--surface:#101c2b;--panel:#121f30;--edge:#2a3a4d;--muted:#9cacbf;--text:#f3f7ff;--teal:#45e5d0;--blue:#70b3ff;--warn:#ffce8f;--bad:#ff9ba1}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;background:radial-gradient(ellipse 75% 40% at 55% -10%,#173246 0,transparent 72%),var(--bg);color:var(--text);min-height:100vh}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}[hidden]{display:none!important}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,.drop:focus-visible{outline:3px solid #8bffec;outline-offset:3px}a{color:var(--teal)}.shell{max-width:1080px;margin:0 auto;padding:22px clamp(16px,4vw,42px) 70px}.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:46px}.brand{display:flex;align-items:center;gap:12px;color:#fff;font-weight:900;letter-spacing:.16em;font-size:14px}.brand-mark{display:grid;place-items:center;width:38px;height:38px;background:linear-gradient(145deg,#51e6d7,#388ab1);border-radius:11px;color:#08151b;font-size:26px;font-weight:1000;transform:skew(-5deg)}.brand small{display:block;color:var(--muted);letter-spacing:.06em;font-size:9px;font-weight:600;margin-top:2px}.lang{background:#132134;color:#caddf0;border:1px solid var(--edge);padding:9px 13px;border-radius:11px;font-size:13px}.hero{text-align:center;max-width:850px;margin:0 auto 35px}.eyebrow{color:var(--teal);letter-spacing:.15em;text-transform:uppercase;font-size:12px;font-weight:800;margin-bottom:16px}.hero h1{margin:0;line-height:1.13;letter-spacing:-.047em;font-weight:850;font-size:clamp(38px,6vw,66px)}.hero h1 span{background:linear-gradient(95deg,#65f5d7,#7bb9ff);-webkit-background-clip:text;background-clip:text;color:transparent}.hero p{font-size:clamp(15px,2.1vw,18px);color:#aec0d3;line-height:1.75;margin:20px auto 0;max-width:640px}.pillrow{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:23px auto 0}.pill{padding:7px 12px;border:1px solid #274053;background:#10202e;border-radius:22px;color:#b6d2d3;font-size:12px}.layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr);gap:16px;align-items:start}.panel{border:1px solid #29394b;background:linear-gradient(160deg,#15263a,#0f1b29);border-radius:21px;box-shadow:0 16px 48px #01061040}.workspace{padding:24px}.heading{display:flex;gap:11px;align-items:center;margin:0 0 18px}.step{width:29px;height:29px;border-radius:10px;background:#23443e;color:var(--teal);font-weight:800;display:grid;place-items:center;font-size:13px}.heading h2{font-size:17px;margin:0;letter-spacing:-.02em}.drop{border:2px dashed #355064;background:#0c1827;border-radius:17px;min-height:220px;padding:29px 18px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;transition:all .18s ease;cursor:pointer}.drop.hover{border-color:var(--teal);background:#143536}.drop svg{color:var(--teal)}.drop strong{font-size:16px}.drop em{font-size:13px;font-style:normal;color:var(--muted)}.btn{display:inline-flex;gap:8px;justify-content:center;align-items:center;border:0;border-radius:12px;padding:13px 18px;font-weight:750;transition:transform .15s,background .15s}.btn:active{transform:scale(.98)}.btn-primary{color:#061b22;background:linear-gradient(100deg,#51e8cc,#7dc2ff)}.btn-soft{color:#d7f5f2;background:#213a48;border:1px solid #33515c}.btn-ghost{color:#bccddd;background:#17283b;border:1px solid #34485d}.label{font-size:13px;color:#d7e2ee;font-weight:700;display:block;margin:19px 0 11px}.preset{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.preset button{background:#15283a;color:#b6cde2;border:1px solid #324559;border-radius:11px;padding:12px 7px;font-size:13px;font-weight:750}.preset button.selected{color:#051a1e;background:#6ae9d4;border-color:#70ffea}.tip{color:#a7b9cc;font-size:12px;margin:10px 0 0;line-height:1.6}.mini{font-size:13px;color:var(--muted)}details{margin-top:17px;background:#102132;border:1px solid #2b4052;border-radius:12px;padding:12px 15px}summary{font-size:13px;color:#dfebfa;font-weight:700;cursor:pointer}summary::marker{color:var(--teal)}.advanced{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin-top:15px}.field label{display:block;font-size:12px;color:#becfe0;margin-bottom:6px}.field input,.field select{width:100%;border-radius:9px;border:1px solid #38516a;background:#0a1726;color:#f5f8ff;padding:12px 9px;min-width:0}.field input[type=number]{appearance:textfield}.action{margin-top:20px;width:100%;padding:16px 12px;font-size:15px}.status{min-height:25px;font-size:13px;line-height:1.6;margin-top:14px;color:#b3cde0}.status[data-kind=error]{color:var(--bad)}.status[data-kind=good]{color:var(--teal)}.side{padding:22px}.side .heading{margin-bottom:15px}.result-list{display:grid;gap:10px;max-height:500px;overflow:auto}.empty{border-radius:14px;min-height:250px;background:#0d1a28;border:1px solid #22384a;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#8ca8bc;padding:30px;gap:9px}.empty .orb{font-size:44px;line-height:1}.empty strong{color:#e5f1f7}.file-card{background:#0b1726;border:1px solid #2a3c4f;border-radius:13px;padding:11px;display:grid;grid-template-columns:49px minmax(0,1fr);gap:11px;align-items:center}.file-card img{width:49px;height:54px;object-fit:cover;border-radius:9px;background:#273747}.file-name{font-size:12px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:6px;direction:ltr;text-align:left}.file-meta{color:#91aac0;font-size:11px;line-height:1.5}.file-meta strong{color:var(--teal)}.file-meta .notice{color:var(--warn)}.file-card .rowbtn{margin-top:8px;background:#1d3941;color:#7aefdb;border:1px solid #3f6d69;border-radius:8px;padding:6px 11px;font-size:11px;font-weight:750}.error-card{border-color:#6c3b4a}.error-card .file-meta{color:var(--bad)}.download-all{width:100%;margin-top:15px}.principles{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:25px 0 0}.feature{border-radius:15px;border:1px solid #23384a;background:#0c1927;padding:19px}.feature b{display:block;font-size:14px;margin-bottom:7px}.feature p{margin:0;font-size:12px;line-height:1.65;color:var(--muted)}.feature .glyph{font-size:25px;margin-bottom:12px;color:var(--teal)}footer{text-align:center;font-size:12px;color:#7c92a7;padding:35px 0 0}.smalllink{border:none;background:transparent;color:#b5e9e4;font-size:12px;text-decoration:underline;cursor:pointer;padding:4px}html[dir=rtl] body{font-family:Tahoma,Arial,sans-serif}html[dir=rtl] .hero h1{letter-spacing:-.02em}html[dir=rtl] .brand{direction:ltr}html[dir=rtl] .preset button{font-family:Tahoma,Arial}html[dir=rtl] .file-card{direction:ltr}html[dir=rtl] .file-meta{text-align:left}html[dir=rtl] .file-name{text-align:left}@media(max-width:760px){.shell{padding:17px 14px 42px}.top{padding-bottom:30px}.hero{margin-bottom:24px}.hero p{margin-top:15px}.layout{grid-template-columns:1fr}.workspace,.side{padding:17px}.side{order:2}.drop{min-height:200px}.principles{grid-template-columns:1fr}.feature{padding:15px}.advanced{grid-template-columns:1fr 1fr}.hero h1{font-size:39px}}@media(max-width:370px){.preset{grid-template-columns:repeat(2,1fr)}.advanced{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto;transition:none!important}}

/* V0.2: accessible navigation and content pages */
.top{padding-bottom:25px}.top-actions{display:flex;gap:8px;align-items:center}.mainnav{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin:0 0 28px}.mainnav a{color:#cfdee9;text-decoration:none;font-size:12px;font-weight:700;border:1px solid #293c4b;background:#0f1b2a;border-radius:18px;padding:8px 12px}.mainnav a[aria-current=page]{background:#24504b;color:#b6fff0;border-color:#346b5e}.mainnav a:hover{border-color:#54d6c1}.custom-limit{display:flex;align-items:center;gap:9px;justify-content:flex-start;margin-top:12px;font-size:13px}.custom-limit label{color:#ceddea}.custom-limit input{width:106px;background:#101e2e;color:#fff;border:1px solid #375167;border-radius:9px;padding:9px 10px}.custom-limit small{color:#afc2d4}.guide{margin:24px auto 0;border:1px solid #284054;border-radius:17px;background:#0d1c2b;padding:22px 25px;max-width:1080px}.guide h2{font-size:21px;margin:0 0 12px}.guide h3{font-size:16px;margin:21px 0 7px}.guide p,.guide li{font-size:14px;line-height:1.9;color:#bbcbd8}.guide ul{padding-inline-start:21px}.guide a{font-weight:700}.guide details{margin:10px 0;background:#101f2f}.guide details p{margin:8px 0 0}.guide summary{font-size:14px}.guide-note{color:#aed3ce!important;font-weight:700}.statline{font-size:12px;color:#aabfd1;margin:8px 0}.status{white-space:pre-line}.result-success{color:#6ce8cd;font-weight:800}.result-warning{color:#ffce8f;font-weight:800}.footerlinks{display:flex;gap:15px;flex-wrap:wrap;justify-content:center;margin-top:9px}.footerlinks a{color:#a3c7ca}.guide[lang=fa]{direction:rtl;text-align:right}.tool-page-hero{color:#93bdfc}.outline-btn{border:1px solid #365368;background:#142639;color:#bde5e4;border-radius:10px;padding:9px 12px;font-size:12px;font-weight:800;cursor:pointer}footer{line-height:1.9}
@media(max-width:760px){.top{padding-bottom:20px}.mainnav{margin-bottom:22px}.mainnav a{font-size:11px;padding:7px 9px}.guide{padding:18px}.guide h2{font-size:19px}.custom-limit{flex-wrap:wrap}}

.settings-heading{margin:24px 0 0}.file-name{overflow-wrap:anywhere}.file-card>div{min-width:0}
[hidden]{display:none!important}

/* V0.3: mobile-native image picking, immediate chosen-file previews */
.drop{position:relative;isolation:isolate;overflow:hidden}
.drop:focus-within{border-color:#72ead5;box-shadow:0 0 0 2px #72ead533}
.drop.has-files{border-color:#62e2cd;background:#102d32;min-height:138px;padding:14px;gap:9px}
.drop.has-files>svg,.drop.has-files>strong,.drop.has-files>em{display:none}
.drop.has-error{border-color:#f29ca3}
.drop>.native-file-input{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:0;cursor:pointer;z-index:4;border:0;display:block;}
.drop .btn{pointer-events:none}
.drop.has-files>.btn{padding:8px 14px;font-size:12px}
.selected-files{width:100%;display:grid;grid-template-columns:repeat(auto-fit,minmax(108px,1fr));gap:7px;max-width:100%;direction:ltr}
.selection-chip{min-width:0;display:flex;align-items:center;gap:7px;background:#0c202b;border:1px solid #2a5e5b;border-radius:11px;padding:6px;color:#eafaf9}
.selection-chip img{width:46px;height:48px;object-fit:cover;border-radius:7px;background:#204653;flex:none}
.selection-file-details{min-width:0;text-align:left;display:flex;flex-direction:column;gap:4px}
.selection-file-details strong{font-weight:650;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.selection-file-details span{font-size:10px;color:#a0ccca}
.selection-more{display:flex;align-items:center;justify-content:center;border:1px solid #2a5e5b;border-radius:10px;font-weight:800}
.selection-message{min-height:0;font-size:13px;line-height:1.6;margin-top:9px;color:#80ead6;font-weight:650}
.selection-message[data-kind=error]{color:#ff9eae}
.quick-action{margin-top:9px;width:100%;font-size:14px}
@media(max-width:760px){.selected-files{grid-template-columns:repeat(2,minmax(0,1fr))}.drop.has-files{min-height:144px}}


/* V0.4: menu, light theme, more presets, removable selected images */
:root{--bg-light:#f2f8fc;--surface-light:#ffffff;--panel-light:#ffffff;--edge-light:#d5e1ec;--muted-light:#587086;--text-light:#102131;--teal-light:#19b8b6;--blue-light:#4387ff}
body[data-theme=light]{color-scheme:light;--bg:var(--bg-light);--surface:var(--surface-light);--panel:var(--panel-light);--edge:var(--edge-light);--muted:var(--muted-light);--text:var(--text-light);--teal:var(--teal-light);--blue:var(--blue-light);--warn:#a87018;--bad:#c84b62;background:radial-gradient(ellipse 75% 40% at 55% -10%,#d4edf3 0,transparent 72%),var(--bg)}
body[data-theme=light] .panel,body[data-theme=light] .guide,body[data-theme=light] .feature,body[data-theme=light] details,body[data-theme=light] .file-card,body[data-theme=light] .empty,body[data-theme=light] .drop,body[data-theme=light] .mainnav a,body[data-theme=light] .pill,body[data-theme=light] .lang,body[data-theme=light] .menu-tile,body[data-theme=light] .app-menu,body[data-theme=light] .about-card,body[data-theme=light] .selection-chip,body[data-theme=light] .drop.has-files{box-shadow:none}
body[data-theme=light] .panel,body[data-theme=light] .guide,body[data-theme=light] .feature,body[data-theme=light] details,body[data-theme=light] .file-card,body[data-theme=light] .empty,body[data-theme=light] .drop,body[data-theme=light] .mainnav a,body[data-theme=light] .pill,body[data-theme=light] .lang,body[data-theme=light] .menu-tile,body[data-theme=light] .app-menu,body[data-theme=light] .about-card,body[data-theme=light] .selection-chip,body[data-theme=light] .drop.has-files{background:#fff;border-color:#d6e2eb}
body[data-theme=light] .hero p,body[data-theme=light] .tip,body[data-theme=light] .mini,body[data-theme=light] .feature p,body[data-theme=light] footer,body[data-theme=light] .file-meta,body[data-theme=light] .selection-file-details span,body[data-theme=light] .custom-limit small{color:#5e758a}
body[data-theme=light] .mainnav a[aria-current=page],body[data-theme=light] .preset button.selected{color:#072327;background:#86efe0;border-color:#74ddd3}
body[data-theme=light] .btn-soft{color:#204652;background:#eef6fa;border-color:#d1dee7}
body[data-theme=light] .btn-primary{color:#0d2430;background:linear-gradient(100deg,#63e7d3,#9fd2ff)}
body[data-theme=light] .drop.hover{background:#effbfb;border-color:#38cdb5}
body[data-theme=light] .drop.has-files{background:#f4fdfb;border-color:#70d7cb}
.brand-button{border:0;cursor:pointer}.lang-pill{min-width:62px;text-align:center}
.menu-backdrop{position:fixed;inset:0;background:#0008;backdrop-filter:blur(3px);z-index:19}
.app-menu{position:fixed;top:0;left:0;height:100vh;width:min(92vw,360px);background:linear-gradient(180deg,#13273b,#0b1623);border-right:1px solid #2b4052;box-shadow:0 18px 60px #0008;padding:20px 16px 26px;overflow:auto;z-index:20;transform:translateX(-104%);transition:transform .22s ease}
.app-menu.open{transform:translateX(0)}
html[dir=rtl] .app-menu{left:auto;right:0;border-right:none;border-left:1px solid #2b4052;transform:translateX(104%)}
html[dir=rtl] .app-menu.open{transform:translateX(0)}
.menu-header,.about-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.menu-brand{display:flex;align-items:center;gap:10px}.menu-brand strong{display:block}.menu-brand small{display:block;color:var(--muted);margin-top:3px}.menu-mark{width:34px;height:34px;font-size:22px}.menu-close{border:1px solid var(--edge);background:#162738;color:var(--text);width:34px;height:34px;border-radius:10px;font-size:22px;line-height:1}.menu-section{margin-top:18px}.menu-section h3{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:0 0 10px}.menu-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.menu-tile{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:12px;border:1px solid #2e4558;background:#101f2f;color:var(--text);border-radius:14px}.menu-tile span{font-size:22px;color:var(--teal)}.menu-tile b{font-size:13px;text-align:left}
.language-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.lang-option{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-radius:12px;border:1px solid #2e4558;background:#101f2f;color:var(--text);font-size:12px}.lang-option.active{border-color:#65e4cf;background:#15353c;color:#dffdfa}.lang-option strong{display:block;font-size:13px}.lang-option small{color:var(--muted)}
.menu-links{display:grid;gap:8px}.menu-links a{text-decoration:none;padding:10px 12px;border-radius:12px;border:1px solid #2e4558;background:#101f2f;color:#dfe8f2;font-size:13px;font-weight:700}.about-modal{position:fixed;inset:0;background:#0007;display:grid;place-items:center;padding:18px;z-index:21}.about-card{width:min(100%,540px);background:linear-gradient(160deg,#15263a,#0f1b29);border:1px solid #29394b;border-radius:20px;padding:18px 18px 20px;box-shadow:0 18px 60px #0007}.about-card p{color:#b9cad8;line-height:1.8;font-size:14px}.about-list{display:grid;gap:10px;margin-top:14px}.about-list div{border:1px solid #2d4255;border-radius:14px;padding:10px 12px;background:#0d1a28}.about-list strong{display:block;margin-bottom:4px}.about-list span{font-size:13px;color:#acc0d3}
.selection-chip{position:relative;padding-inline-end:30px}.selection-remove{position:absolute;top:5px;right:5px;width:20px;height:20px;border-radius:50%;border:1px solid #48706f;background:#173037;color:#d6fffa;font-size:13px;line-height:1;display:grid;place-items:center;padding:0}.selection-remove:hover{background:#244a53}.selection-chip img{margin-inline-end:2px}
.preset{grid-template-columns:repeat(auto-fit,minmax(92px,1fr))}
.footerlinks a{font-weight:700}
@media(max-width:760px){.menu-grid,.language-grid{grid-template-columns:1fr 1fr}.about-card{padding:16px}.menu-tile b,.menu-links a,.lang-option strong{font-size:12px}.selection-chip{padding-inline-end:28px}}

/* R06 critical UX fixes */
.drop>.native-file-input{z-index:4}
.selected-files{position:relative;z-index:6;pointer-events:none}
.selection-chip{position:relative;z-index:6;pointer-events:none}
.selection-remove{pointer-events:auto;z-index:8;min-width:28px;min-height:28px;width:28px;height:28px;top:2px;right:2px;font-size:20px}
.brand-button{display:grid;place-items:center;min-width:42px;min-height:42px;flex:none}
.brand-button:focus-visible,.selection-remove:focus-visible,.menu-close:focus-visible,.lang-option:focus-visible{outline:3px solid var(--teal);outline-offset:3px}
body[data-theme=light] .brand,body[data-theme=light] .eyebrow{color:#153846}
body[data-theme=light] .brand small,body[data-theme=light] .heading h2,body[data-theme=light] .feature b,body[data-theme=light] .guide h2,body[data-theme=light] .guide h3,body[data-theme=light] .drop strong,body[data-theme=light] .menu-section h3,body[data-theme=light] .menu-tile b,body[data-theme=light] .lang-option,body[data-theme=light] .menu-links a,body[data-theme=light] .about-card,body[data-theme=light] .about-list strong{color:#173246}
body[data-theme=light] .guide p,body[data-theme=light] .guide li,body[data-theme=light] .guide-note,body[data-theme=light] .about-card p,body[data-theme=light] .about-list span,body[data-theme=light] .menu-brand small{color:#486277!important}
body[data-theme=light] .menu-links a,body[data-theme=light] .lang-option,body[data-theme=light] .menu-close,body[data-theme=light] .about-list div{background:#f1f7fa;border-color:#d4e4ed;color:#193647}
body[data-theme=light] .preset button,body[data-theme=light] .custom-limit input,body[data-theme=light] .field input,body[data-theme=light] .field select{background:#f1f7fa;border-color:#cadce7;color:#183647}
body[data-theme=light] .selection-file-details strong{color:#193647}
body[data-theme=light] .selection-remove{background:#dbf7f4;border-color:#a6e5de;color:#23434a}
body[data-theme=light] .selection-file-details span,body[data-theme=light] .selection-message{color:#286e70}
body[data-theme=light] .menu-tile span{color:#087a80}
body[data-theme=light] .menu-brand strong{color:#173246}
body[data-theme=light] .lang-option.active{background:#d5f7ef}
body[data-theme=light] .file-card .rowbtn{background:#e1f6ef;color:#176f5c}
body[data-theme=light] .selection-chip img{background:#d5eaf0}
