@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');
:root{color-scheme:light;--brand:#2166e8;--bg:#f6f8fc;--surface:#fff;--surface2:#f1f5fb;--text:#14233a;--muted:#708096;--border:#e4eaf2;--shadow:0 16px 50px rgba(23,48,90,.055);--radius:18px}
html[data-theme=dark]{color-scheme:dark;--bg:#0d1423;--surface:#161f30;--surface2:#1c2a3e;--text:#eff4ff;--muted:#a3b1c5;--border:#2c3a51;--shadow:0 18px 50px rgba(0,0,0,.16)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Cairo,system-ui,sans-serif;color:var(--text);background:var(--bg);line-height:1.7}button,input,textarea,select{font:inherit}button{cursor:pointer}a{color:var(--brand);text-decoration:none}a:hover{text-decoration:underline}.tool-bg{background:radial-gradient(ellipse at 50% -24%,rgba(76,126,226,.16),transparent 60%),var(--bg)}.site-container{max-width:1150px;margin:auto;padding:0 24px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:23px 0;border-bottom:1px solid var(--border)}.tool-brand{display:flex;align-items:center;gap:11px;color:var(--text);font-size:17px;font-weight:700}.tool-brand strong{color:var(--brand)}.brand-mark{display:grid;place-items:center;width:43px;height:43px;border-radius:13px;background:var(--brand);color:#fff;font-size:27px;font-weight:800}.tool-brand img{width:145px;max-height:52px;object-fit:contain}.toolbar{display:flex;align-items:center;gap:9px}.privacy-pill,.pill{border:1px solid var(--border);border-radius:40px;padding:5px 12px;font-size:11px;color:var(--muted)}.privacy-pill{color:#168a66}.icon-btn{width:43px;height:43px;border-radius:13px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:19px;box-shadow:var(--shadow)}.hero{text-align:center;padding:68px 10px 40px}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:800;color:var(--brand)}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(29px,4vw,49px);line-height:1.45;margin:10px 0 13px;letter-spacing:-.4px}h2{font-size:21px;line-height:1.5}.hero p{color:var(--muted);font-size:16px}.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:28px;margin-bottom:23px}.workspace{max-width:890px;margin:0 auto 48px}.drop-zone{border:2px dashed #b6c8e7;border-radius:16px;padding:38px 18px;text-align:center;background:var(--surface2);transition:.2s}.drop-zone.dragging{border-color:var(--brand);background:rgba(69,113,229,.12)}.drop-zone h2{font-size:18px;margin-bottom:4px}.upload-symbol{display:grid;place-items:center;width:62px;height:62px;margin:0 auto 12px;border-radius:17px;background:var(--surface);font-size:36px;color:var(--brand)}.muted{color:var(--muted)}.tiny{font-size:12px}.btn{padding:10px 18px;border-radius:11px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-weight:700;font-size:13px;transition:.18s}.btn:hover:not(:disabled){transform:translateY(-1px);filter:brightness(.98)}.btn:disabled{opacity:.45;cursor:not-allowed}.btn.primary{background:var(--brand);color:#fff;border-color:var(--brand)}.btn.secondary{background:var(--surface2)}.btn.ghost{background:transparent}.btn.small{padding:6px 12px}.btn.wide{width:100%;margin-top:20px}.url-area{margin:25px 0 0}.url-area label,label{display:block;font-size:13px;font-weight:700;margin:12px 0 6px}.url-row{display:flex;gap:10px}.url-row input{flex:1}input:not([type=checkbox]):not([type=file]),textarea,select{width:100%;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:11px 12px;color:var(--text);min-width:0}input[type=file]{max-width:100%;display:block;margin:10px 0 20px}.status{max-width:890px;margin:0 auto 25px;padding:15px 20px;background:var(--surface);border:1px solid var(--border);border-radius:12px}.status.error{color:#d34b55;border-color:#f0a2a2}.results{margin:0 auto 52px}.result-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}.result-heading h2{margin:5px 0}.result-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.mini-check{display:flex;align-items:center;gap:6px;margin:0;font-size:12px;color:var(--muted)}.image-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.image-card{min-width:0;background:var(--surface);border:1px solid var(--border);border-radius:15px;overflow:hidden;box-shadow:var(--shadow)}.image-thumb{height:170px;display:grid;place-items:center;background:var(--surface2);padding:15px}.image-thumb img{max-width:100%;max-height:100%;object-fit:contain}.image-detail{padding:12px}.image-detail strong{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px}.image-detail small{display:block;color:var(--muted);font-size:11px}.image-actions{display:flex;justify-content:space-between;align-items:center;padding-top:8px}.privacy-bottom{text-align:center;font-size:12px;color:var(--muted);margin-bottom:60px}.tool-footer{border-top:1px solid var(--border);padding:28px 0 45px;display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;font-size:12px;color:var(--muted)}.tool-footer nav{display:flex;flex-wrap:wrap;gap:14px}.tool-footer nav a{color:var(--muted)}.admin-bg{min-height:100vh}.auth-card{max-width:460px;margin:8vh auto;padding:35px;background:var(--surface);border:1px solid var(--border);border-radius:22px;box-shadow:var(--shadow)}.auth-card h1{font-size:28px}.auth-card .brand-mark{margin-bottom:16px}.auth-card .tiny{margin-top:20px}.alert{padding:12px 16px;border-radius:11px;margin-bottom:20px;font-size:13px}.alert.danger{background:#ffe5e7;color:#a91e34}.alert.success{background:#e5f7ed;color:#137746}.admin-shell{display:flex;min-height:100vh}.sidebar{width:250px;flex-shrink:0;background:var(--surface);border-left:1px solid var(--border);padding:27px 18px;display:flex;flex-direction:column;gap:12px}.sidebar h2{font-size:17px;margin:10px 0 0}.sidebar p{font-size:12px}.sidebar nav{display:grid;gap:5px;margin:20px 0}.sidebar nav a{padding:10px 12px;color:var(--text);border-radius:10px;font-size:13px}.sidebar nav a.active,.sidebar nav a:hover{background:var(--surface2);color:var(--brand);font-weight:700}.admin-main{flex:1;min-width:0;max-width:1160px;padding:30px 36px;margin:auto}.admin-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.admin-top h1{font-size:31px;margin:0}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:24px}.stat{padding:20px;border-radius:14px;background:var(--surface);border:1px solid var(--border)}.stat small{display:block;color:var(--muted);font-size:12px}.stat b{font-size:18px}.admin-main .panel h2{font-size:18px;border-bottom:1px solid var(--border);padding-bottom:12px;margin-bottom:16px}.admin-main .panel h3{margin:24px 0 10px}.admin-main .panel .btn.primary{margin-top:16px}.switchline{display:flex;align-items:center;gap:8px;margin:11px 0}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.admin-logo{max-height:58px;max-width:160px;display:block;margin:10px 0}.translation,.link-entry{padding:16px 0;border-bottom:1px solid var(--border)}.translation:last-of-type,.link-entry:last-of-type{border-bottom:0}.action-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.danger-btn{color:#c63c47;background:transparent}.logline{padding:7px;border-bottom:1px solid var(--border);font-size:12px}.admin-foot{padding:20px 0;color:var(--muted);font-size:12px;text-align:center}
@media(max-width:850px){.image-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.result-heading{align-items:flex-start;flex-direction:column}.admin-shell{display:block}.sidebar{width:100%;padding:14px 20px;border-left:0;border-bottom:1px solid var(--border)}.sidebar .brand-mark,.sidebar h2,.sidebar p{display:none}.sidebar nav{display:flex;overflow:auto;gap:6px;margin:0}.sidebar nav a{white-space:nowrap}.sidebar>a,.sidebar>form{display:none}.admin-main{padding:20px}}@media(max-width:580px){.site-container{padding:0 15px}.privacy-pill{display:none}.tool-brand{font-size:13px}.tool-brand .brand-mark{width:35px;height:35px}.hero{padding:46px 0 28px}.hero p{font-size:14px}.panel{padding:18px}.drop-zone{padding:28px 10px}.url-row{flex-direction:column}.image-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.image-thumb{height:125px}.formgrid{grid-template-columns:1fr}.auth-card{margin:4vh 14px;padding:25px}}

/* v1.0.1 visitor results refinement */
.results{scroll-margin-top:18px;outline:none}.results.has-results .result-heading{border:1px solid var(--border);background:var(--surface);border-radius:16px;padding:18px 20px}.result-heading{flex-wrap:wrap}.result-actions{justify-content:flex-end}.clear-btn{width:38px;height:38px;border-radius:11px;background:transparent;border:1px solid var(--border);color:var(--muted);font-size:25px;line-height:1;display:grid;place-items:center}.clear-btn:hover{color:#d34b55;border-color:#d34b55}.image-card .image-detail{min-width:0}.image-detail strong{min-width:0;max-width:100%;direction:ltr;text-align:start}.drop-zone.is-busy{opacity:.68;pointer-events:none}.workspace{margin-bottom:30px}.drop-zone{padding-block:27px}.hero{padding-bottom:27px}.result-actions .mini-check{white-space:nowrap}@media(max-width:580px){.result-actions{justify-content:flex-start}.results.has-results .result-heading{padding:12px}.result-actions .btn{padding:8px 10px;font-size:12px}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* Native picker must never appear next to the custom picker. */
input[type=file][hidden], [hidden]{display:none!important}

/* v1.0.4: keep result header and actions inside the same panel at every width. */
.results.has-results .result-heading{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,auto);align-items:center;gap:18px;min-width:0}
.results.has-results .result-heading>div:first-child{min-width:0}
.results.has-results .result-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:10px;min-width:0;max-width:100%}
.results.has-results .result-actions .btn{white-space:nowrap;flex:0 0 auto;min-width:max-content}
.results.has-results .result-actions .mini-check{white-space:normal;flex:0 1 auto;min-width:0}
.results.has-results .result-actions .mini-check span{white-space:nowrap}
.results.has-results .result-actions .clear-btn{flex:0 0 40px;width:40px;height:40px;min-width:40px;padding:0;white-space:nowrap;line-height:1;overflow:hidden}
@media(max-width:1050px){.results.has-results .result-heading{grid-template-columns:minmax(0,1fr)}.results.has-results .result-actions{justify-content:flex-start}}
@media(max-width:580px){.results.has-results .result-actions{gap:8px}.results.has-results .result-actions .mini-check{flex-basis:100%}.results.has-results .result-actions .btn{font-size:12px;padding:8px 10px}}

/* v1.0.5: keep clear control as a single icon in both languages. */
.result-actions .clear-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;min-width:40px;height:40px;padding:0;white-space:nowrap;line-height:1;overflow:hidden}

/* v1.0.6: image preview and metadata are separate, non-overlapping regions */
.image-grid .image-card{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}
.image-grid .image-thumb{height:170px;min-height:170px;width:100%;min-width:0;flex:0 0 170px;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative;padding:12px}
.image-grid .image-thumb img{display:block;width:auto;height:auto;max-width:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain;flex-shrink:1}
.image-grid .image-detail{position:relative;z-index:1;display:flex;flex-direction:column;gap:3px;flex:1 0 auto;min-width:0;min-height:87px;padding:10px 12px 12px;background:var(--surface);border-top:1px solid var(--border)}
.image-grid .image-detail strong{display:block;max-width:100%;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;direction:ltr;text-align:left;line-height:1.6}
.image-grid .image-detail small{display:block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;direction:ltr;text-align:left;line-height:1.6}
.image-grid .image-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;padding-top:7px;min-height:32px}
.image-grid .image-actions .btn{white-space:nowrap}
@media(max-width:580px){.image-grid .image-thumb{height:125px;min-height:125px;flex-basis:125px;padding:8px}.image-grid .image-detail{min-height:86px;padding:9px 8px 10px}.image-grid .image-actions{gap:5px}}
