/* Shared styles for all Fourmeld scanner pages */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Segoe UI',Arial,sans-serif;background:#0f172a;color:#e2e8f0;min-height:100vh}
a{color:#818cf8;text-decoration:none}
nav{background:#13112a;border-bottom:2px solid rgba(124,58,237,.35);padding:12px 28px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100;box-shadow:0 4px 24px rgba(0,0,0,.5)}
.nav-logo{display:flex;align-items:center;gap:10px;text-decoration:none}
.nav-logo img{height:36px;width:36px;object-fit:cover;object-position:left center}
.nav-brand{font-size:1.2rem;font-weight:900;color:#818cf8}
.nav-links{display:flex;gap:20px}
.nav-links a{font-size:.85rem;font-weight:600;color:#94a3b8}
.nav-links a:hover{color:#e2e8f0}
.nav-right{display:flex;align-items:center;gap:6px}
@media(max-width:600px){.nav-links{display:none}nav{padding:12px 16px}}

.hero{text-align:center;padding:40px 24px 28px;background:linear-gradient(135deg,#1e1b4b 0%,#0f172a 100%)}
.hero-tag{display:inline-block;background:linear-gradient(135deg,#0891b2,#7c3aed);color:#fff;font-size:.72rem;font-weight:800;padding:4px 14px;border-radius:20px;margin-bottom:14px;text-transform:uppercase;letter-spacing:.06em}
.hero h1{font-size:1.8rem;font-weight:900;color:#e2e8f0;margin:0 auto 10px;line-height:1.25}
.hero p{font-size:.9rem;color:#94a3b8}
@media(max-width:600px){.hero h1{font-size:1.35rem}.hero{padding:30px 16px 22px}}

.wrap{max-width:960px;margin:0 auto;padding:28px 20px 60px}

/* scanner feature boxes */
.scan-tools{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;max-width:760px;margin:0 auto 28px}
.scan-tool{display:flex;flex-direction:column;align-items:center;gap:7px;padding:18px 10px 14px;border-radius:16px;text-decoration:none;border:1.5px solid rgba(255,255,255,.09);background:#1e293b;transition:transform .2s,border-color .2s,box-shadow .2s;position:relative;overflow:hidden}
.scan-tool::before{content:'';position:absolute;inset:0;opacity:.16;transition:opacity .2s}
.scan-tool:hover{transform:translateY(-3px);text-decoration:none}
.scan-tool:hover::before{opacity:.28}
.st-ic{width:46px;height:46px;border-radius:13px;display:flex;align-items:center;justify-content:center;font-size:1.35rem;position:relative;z-index:1}
.st-t{font-size:.78rem;font-weight:800;color:#e2e8f0;text-align:center;position:relative;z-index:1}
.st-s{font-size:.64rem;color:#94a3b8;text-align:center;position:relative;z-index:1}
.st-scan::before{background:linear-gradient(150deg,#7c3aed,transparent 65%)}
.st-scan .st-ic{background:linear-gradient(135deg,#7c3aed,#4f46e5);box-shadow:0 5px 16px rgba(124,58,237,.45)}
.st-scan:hover,.st-scan.active{border-color:#7c3aed;box-shadow:0 8px 26px rgba(124,58,237,.25)}
.st-restore::before{background:linear-gradient(150deg,#d97706,transparent 65%)}
.st-restore .st-ic{background:linear-gradient(135deg,#f59e0b,#d97706);box-shadow:0 5px 16px rgba(217,119,6,.4)}
.st-restore:hover,.st-restore.active{border-color:#d97706;box-shadow:0 8px 26px rgba(217,119,6,.22)}
.st-stamp::before{background:linear-gradient(150deg,#0891b2,transparent 65%)}
.st-stamp .st-ic{background:linear-gradient(135deg,#06b6d4,#0891b2);box-shadow:0 5px 16px rgba(8,145,178,.4)}
.st-stamp:hover,.st-stamp.active{border-color:#0891b2;box-shadow:0 8px 26px rgba(8,145,178,.22)}
.st-signature::before{background:linear-gradient(150deg,#db2777,transparent 65%)}
.st-signature .st-ic{background:linear-gradient(135deg,#ec4899,#db2777);box-shadow:0 5px 16px rgba(219,39,119,.4)}
.st-signature:hover,.st-signature.active{border-color:#db2777;box-shadow:0 8px 26px rgba(219,39,119,.22)}
.scan-tool.active{cursor:default}
.scan-tool.active::before{opacity:.3}
.scan-tool.active::after{content:'✓';position:absolute;top:8px;right:8px;width:20px;height:20px;border-radius:50%;background:#22c55e;color:#fff;font-size:.68rem;font-weight:900;display:flex;align-items:center;justify-content:center;z-index:2;box-shadow:0 2px 8px rgba(34,197,94,.55)}
@media(max-width:600px){.scan-tool.active::after{width:17px;height:17px;font-size:.58rem;top:6px;right:6px}}
@media(max-width:600px){.scan-tools{grid-template-columns:repeat(2,1fr);gap:9px}.scan-tool{padding:13px 8px 11px;border-radius:13px}.st-ic{width:38px;height:38px;font-size:1.1rem;border-radius:10px}.st-t{font-size:.7rem}.st-s{font-size:.58rem}}

/* filter chips */
.filters{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-bottom:20px}
.filter-chip{display:flex;flex-direction:column;align-items:center;gap:4px;background:#1e293b;border:2px solid rgba(124,58,237,.2);border-radius:14px;padding:12px 22px;cursor:pointer;transition:all .2s;color:#cbd5e1}
.filter-chip .fi{font-size:1.3rem}
.filter-chip .ft{font-size:.75rem;font-weight:800}
.filter-chip .fs{font-size:.62rem;color:#94a3b8}
.filter-chip:hover{border-color:#7c3aed}
.filter-chip.active{border-color:#7c3aed;background:linear-gradient(135deg,rgba(124,58,237,.28),rgba(79,70,229,.1));color:#fff}
@media(max-width:600px){.filter-chip{padding:9px 14px}.filter-chip .ft{font-size:.68rem}}

/* option groups (language selects) */
.opts{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-bottom:20px}
.opt-group{display:flex;align-items:center;gap:8px;background:#1e293b;border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:8px 14px}
.opt-group label{font-size:.78rem;font-weight:600;color:#94a3b8}
.opt-group select{background:#0f172a;color:#e2e8f0;border:1px solid rgba(124,58,237,.3);border-radius:8px;padding:6px 10px;font-size:.8rem;cursor:pointer}

/* ── creative capture card ── */
.capture{display:none;position:relative;max-width:560px;margin:0 auto 26px;border-radius:26px;padding:2px;background:linear-gradient(120deg,#7c3aed,#0891b2,#4f46e5,#7c3aed);background-size:300% 300%;animation:cap-border 6s ease infinite}
.capture.show{display:block;animation:cap-border 6s ease infinite,cap-in .35s ease}
@keyframes cap-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes cap-border{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
.capture-inner{position:relative;overflow:hidden;border-radius:24px;background:radial-gradient(120% 140% at 50% 0%,#1e1b4b 0%,#0f172a 70%);padding:26px 26px 30px;display:flex;align-items:stretch;justify-content:center;gap:8px;flex-wrap:wrap}
.cap-head{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:16px;position:relative;z-index:1}
.cap-head-ic{font-size:1.1rem}
.cap-head-t{font-size:.95rem;font-weight:800;color:#f1f5f9}
.cap-head-s{font-size:.7rem;color:#94a3b8}
@media(max-width:600px){.cap-head{flex-wrap:wrap;text-align:center}.cap-head-s{width:100%}}
.capture-inner::before{content:'';position:absolute;left:8%;right:8%;height:2px;top:0;background:linear-gradient(90deg,transparent,#22d3ee,#a78bfa,transparent);filter:blur(1px);animation:cap-beam 3.2s ease-in-out infinite;opacity:.85;pointer-events:none}
@keyframes cap-beam{0%,100%{top:12%}50%{top:86%}}
.cap-btn{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px;background:none;border:none;cursor:pointer;padding:10px 22px;border-radius:18px;transition:transform .2s;flex:1;max-width:210px}
.cap-btn:hover{transform:translateY(-4px)}
.cap-ic{position:relative;width:80px;height:80px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:2rem;z-index:1}
.cap-cam .cap-ic{background:linear-gradient(135deg,#7c3aed,#4f46e5);box-shadow:0 8px 28px rgba(124,58,237,.55)}
.cap-up .cap-ic{background:linear-gradient(135deg,#0891b2,#0e7490);box-shadow:0 8px 28px rgba(8,145,178,.5)}
.cap-cam .cap-ic::after{content:'';position:absolute;inset:-7px;border-radius:50%;border:2px solid rgba(167,139,250,.8);animation:cap-pulse 2s ease-out infinite}
@keyframes cap-pulse{0%{transform:scale(.92);opacity:.9}70%{transform:scale(1.22);opacity:0}100%{opacity:0}}
.cap-up .cap-ic::after{content:'';position:absolute;inset:-7px;border-radius:50%;border:2px dashed rgba(34,211,238,.55);animation:cap-spin 14s linear infinite}
@keyframes cap-spin{to{transform:rotate(360deg)}}
.cap-t{font-size:.92rem;font-weight:800;color:#f1f5f9}
.cap-s{font-size:.7rem;color:#94a3b8}
.cap-or{display:flex;align-items:center;justify-content:center;flex-shrink:0}
.cap-or span{width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);display:flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:800;color:#64748b;text-transform:uppercase}
.cap-msg{width:100%;text-align:center;font-size:.78rem;color:#fbbf24;margin-top:14px;min-height:0;position:relative;z-index:1;display:none}
.cap-msg.show{display:block;animation:cap-in .3s ease}
@media(max-width:600px){.capture-inner{padding:26px 12px 22px;gap:2px}.cap-btn{padding:8px 8px}.cap-ic{width:66px;height:66px;font-size:1.6rem}.cap-t{font-size:.8rem}.cap-s{font-size:.63rem}.cap-or span{width:30px;height:30px;font-size:.58rem}}

/* page thumbnails */
.pages{display:none;flex-wrap:wrap;gap:12px;justify-content:center;margin-bottom:20px}
.pages.has{display:flex}
.page-item{position:relative;width:110px;border:1.5px solid rgba(124,58,237,.35);border-radius:12px;overflow:hidden;background:#1e293b}
.page-item img{width:100%;height:140px;object-fit:cover;display:block;background:#fff}
.page-item .pn{position:absolute;top:6px;left:6px;background:rgba(0,0,0,.65);color:#fff;font-size:.65rem;font-weight:700;border-radius:6px;padding:2px 7px}
.page-item .px{position:absolute;top:4px;right:4px;background:rgba(220,38,38,.9);color:#fff;border:none;border-radius:6px;width:22px;height:22px;font-size:.75rem;cursor:pointer;line-height:1}
.page-item.loading::after{content:'';position:absolute;inset:0;background:rgba(15,23,42,.6) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="none" stroke="%237c3aed" stroke-width="5" stroke-dasharray="90 40"><animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.8s" repeatCount="indefinite"/></circle></svg>') center no-repeat}

/* action buttons */
.actions{display:none;gap:12px;justify-content:center;flex-wrap:wrap;margin-bottom:16px}
.actions.has{display:flex}
.act-btn{border:none;border-radius:12px;padding:13px 26px;font-size:.88rem;font-weight:800;cursor:pointer;transition:all .2s;display:flex;align-items:center;gap:8px}
.act-pdf{background:linear-gradient(135deg,#7c3aed,#4f46e5);color:#fff}
.act-pdf:hover{filter:brightness(1.15)}
.act-img{background:#1e293b;color:#e2e8f0;border:1.5px solid rgba(124,58,237,.4)}
.act-img:hover{border-color:#7c3aed}
.act-share{background:#1e293b;color:#e2e8f0;border:1.5px solid rgba(8,145,178,.5)}
.act-share:hover{border-color:#22d3ee}
.act-btn:disabled{opacity:.5;cursor:wait}
.status{text-align:center;font-size:.82rem;color:#94a3b8;min-height:22px;margin-bottom:8px}
.status.err{color:#f87171}
.status.ok{color:#34d399}

.ocr-out{display:none;background:#1e293b;border:1px solid rgba(255,255,255,.1);border-radius:14px;padding:18px;margin-top:10px;max-height:300px;overflow-y:auto;font-size:.85rem;line-height:1.7;color:#cbd5e1;white-space:pre-wrap}
.ocr-out.has{display:block}

/* theme toggle + hamburger */
.theme-toggle{background:none;border:1.5px solid rgba(124,58,237,.4);border-radius:50%;width:36px;height:36px;cursor:pointer;font-size:1rem;display:flex;align-items:center;justify-content:center;color:#818cf8;transition:all .2s;flex-shrink:0}
.theme-toggle:hover{background:rgba(124,58,237,.15);border-color:#7c3aed}
.ham-btn{background:none;border:1.5px solid rgba(255,255,255,.15);border-radius:8px;width:36px;height:36px;cursor:pointer;font-size:1.25rem;display:flex;align-items:center;justify-content:center;color:#e2e8f0;margin-left:6px;flex-shrink:0;transition:all .2s}
.ham-btn:hover{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.35)}
.ham-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:500;backdrop-filter:blur(3px)}
.ham-overlay.open{display:block}
.ham-sidebar{position:fixed;top:0;right:-240px;width:230px;height:100vh;background:#12102a;border-left:1.5px solid rgba(124,58,237,.3);z-index:501;transition:right .25s cubic-bezier(.4,0,.2,1);overflow-y:auto;box-shadow:-10px 0 40px rgba(0,0,0,.5);display:flex;flex-direction:column}
.ham-sidebar.open{right:0}
.ham-head{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;border-bottom:1px solid rgba(124,58,237,.2)}
.ham-title{font-size:.75rem;font-weight:800;color:#7c3aed;text-transform:uppercase;letter-spacing:.1em}
.ham-x{background:none;border:none;color:#64748b;font-size:1.4rem;cursor:pointer;line-height:1;padding:2px 6px;border-radius:6px;transition:all .15s}
.ham-x:hover{background:rgba(124,58,237,.15);color:#e2e8f0}
.ham-nav{padding:12px 0;flex:1}
.ham-nav a{display:flex;align-items:center;gap:10px;padding:10px 16px;color:#cbd5e1;text-decoration:none;font-size:.82rem;font-weight:600;transition:all .15s;border-left:3px solid transparent}
.ham-nav a:hover{background:rgba(124,58,237,.12);color:#e2e8f0;border-left-color:#7c3aed;text-decoration:none}
.ham-nav a .hi{font-size:1.1rem;width:22px;text-align:center}
.ham-footer{padding:11px 16px;border-top:1px solid rgba(124,58,237,.15);font-size:.72rem;color:#475569;text-align:center}

/* SEO + footer */
.seo-section{background:linear-gradient(135deg,#1e1b4b 0%,#0f172a 100%);padding:64px 24px;border-top:1px solid rgba(255,255,255,.07);color:#cbd5e1}
.seo-inner{max-width:1000px;margin:0 auto;color:#cbd5e1}
.seo-inner>h2{font-size:1.6rem;font-weight:800;color:#f1f5f9;margin:0 0 12px;letter-spacing:-.02em}
.seo-inner>p{font-size:1rem;line-height:1.7;color:#94a3b8;margin:0 0 40px;max-width:780px}
.seo-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:20px;margin-bottom:52px}
.seo-card{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:24px 20px}
.seo-card h3{font-size:.95rem;font-weight:700;color:#e2e8f0;margin:0 0 10px}
.seo-card p{font-size:.875rem;line-height:1.65;color:#94a3b8;margin:0}
.seo-faq h2{font-size:1.35rem;font-weight:800;color:#f1f5f9;margin:0 0 20px;letter-spacing:-.02em}
.seo-faq-item{border-bottom:1px solid rgba(255,255,255,.07);padding:4px 0}
.seo-faq-item summary{font-size:.95rem;font-weight:600;color:#cbd5e1;padding:14px 4px;cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center}
.seo-faq-item summary::-webkit-details-marker{display:none}
.seo-faq-item summary::after{content:'+';font-size:1.2rem;color:#7c3aed;margin-left:12px}
.seo-faq-item[open] summary::after{content:'−'}
.seo-faq-item p{font-size:.9rem;line-height:1.7;color:#94a3b8;margin:0 0 16px;padding:0 4px}
@media(max-width:600px){.seo-section{padding:44px 16px}.seo-inner>h2{font-size:1.3rem}.seo-grid{grid-template-columns:1fr}}

.lp-footer{background:#1a1a2e;color:#a0aec0;padding:52px 24px 24px}
.lp-footer-logo{display:flex;align-items:center;gap:12px;margin-bottom:36px;justify-content:center}
.lp-footer-logo img{height:42px;width:42px;object-fit:cover;object-position:left center}
.lp-footer-logo span{font-size:1.25rem;font-weight:900;color:#c4b5fd}
.lp-footer-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:32px;max-width:1120px;margin:0 auto 36px}
.lp-footer-col-title{color:#fff;font-size:.82rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;margin-bottom:14px}
.lp-footer-links{list-style:none}
.lp-footer-links li{margin-bottom:8px}
.lp-footer-links a{color:#a0aec0;text-decoration:none;font-size:.8rem}
.lp-footer-links a:hover{color:#c4b5fd}
.lp-footer-bottom{text-align:center;font-size:.75rem;color:#555;border-top:1px solid #2d2d4e;padding-top:20px;max-width:1120px;margin:0 auto}

/* ── Adobe-style editor screen (mobile default) ── */
.editor{display:none;position:fixed;inset:0;height:100vh;height:100dvh;background:#111;z-index:600;overflow:hidden}
.editor.open{display:flex}
.ed-shell{display:flex;flex-direction:column;width:100%;height:100%;min-height:0}
.ed-head{display:flex;align-items:center;justify-content:space-between;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;background:#000;flex-shrink:0}
.ed-head button{background:none;border:none;color:#e2e8f0;font-size:1.15rem;cursor:pointer;padding:6px 10px;border-radius:8px}
.ed-head button:hover{background:rgba(255,255,255,.1)}
.ed-head-left{display:flex;align-items:center;gap:2px}
.ed-head-right{display:flex;align-items:center;gap:2px}
.ed-brand{display:none;align-items:center;gap:8px;text-decoration:none;padding:4px 10px 4px 4px;border-radius:8px;margin-left:4px}
.ed-brand img{height:26px;width:26px;object-fit:cover;border-radius:6px}
.ed-brand b{font-size:.9rem;font-weight:800;color:#e2e8f0;letter-spacing:-.01em}
.ed-title{font-size:.88rem;font-weight:700;color:#e2e8f0}
.ed-main{flex:1 1 0;position:relative;overflow:hidden;min-height:0}
.ed-main img{position:absolute;inset:14px;margin:auto;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;box-shadow:0 8px 40px rgba(0,0,0,.6);border-radius:4px}
.ed-nav{position:absolute;top:50%;transform:translateY(-50%);background:rgba(0,0,0,.55);border:none;color:#fff;font-size:1.3rem;width:38px;height:38px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center}
.ed-nav:disabled{opacity:.25;cursor:default}
.ed-nav.prev{left:10px}
.ed-nav.next{right:10px}
#crop-canvas{position:absolute;inset:14px;margin:auto;max-width:100%;max-height:100%;width:auto;height:auto;touch-action:none;cursor:crosshair;border-radius:4px}
.ed-filters{display:none;gap:10px;padding:10px 14px;overflow-x:auto;background:#000;flex-shrink:0}
.ed-filters.open{display:flex}
.ed-filter{display:flex;flex-direction:column;align-items:center;gap:5px;background:none;border:none;cursor:pointer;flex-shrink:0}
.ed-filter img{width:78px;height:100px;object-fit:cover;border-radius:8px;border:2.5px solid transparent;background:#222}
.ed-filter.active img{border-color:#3b82f6}
.ed-filter span{font-size:.68rem;font-weight:600;color:#cbd5e1}
.ed-filter.active span{color:#60a5fa}
.ed-filter .ed-filter-spin{width:78px;height:100px;border-radius:8px;background:#222;display:flex;align-items:center;justify-content:center;color:#7c3aed;font-size:1.2rem}
.ed-tools{display:flex;justify-content:space-around;padding:8px 6px;background:#000;flex-shrink:0;border-top:1px solid rgba(255,255,255,.08)}
.ed-tool{display:flex;flex-direction:column;align-items:center;gap:4px;background:none;border:none;color:#cbd5e1;font-size:.66rem;font-weight:600;cursor:pointer;padding:6px 12px;border-radius:10px}
.ed-tool .ti{font-size:1.25rem}
.ed-tool:hover,.ed-tool.active{color:#60a5fa}
.ed-tool.active{background:rgba(59,130,246,.15)}
.ed-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px calc(16px + env(safe-area-inset-bottom));background:#000;flex-shrink:0}
.ed-keep{background:none;border:none;color:#e2e8f0;font-size:.95rem;font-weight:700;cursor:pointer;padding:12px 8px}
.ed-save{background:#2563eb;border:none;color:#fff;font-size:.95rem;font-weight:800;cursor:pointer;padding:13px 34px;border-radius:100px}
.ed-save:hover{background:#1d4ed8}
.ed-save:disabled,.ed-keep:disabled{opacity:.5;cursor:wait}
.ed-crop-actions{display:none;justify-content:space-between;padding:12px 18px calc(16px + env(safe-area-inset-bottom));background:#000;flex-shrink:0}
.ed-crop-actions.open{display:flex}
.ed-crop-btn{background:none;border:1.5px solid rgba(255,255,255,.25);color:#e2e8f0;font-size:.9rem;font-weight:700;cursor:pointer;padding:11px 30px;border-radius:100px}
.ed-crop-btn.apply{background:#2563eb;border-color:#2563eb;color:#fff}
.ed-status{text-align:center;font-size:.78rem;color:#94a3b8;padding:4px 12px;background:#000;flex-shrink:0;min-height:24px}
.ed-status.err{color:#f87171}
.ed-status.ok{color:#34d399}
.editor.cropping .ed-tools,.editor.cropping .ed-bottom,.editor.cropping .ed-filters{display:none}

/* ── Resize pages tool (Document Scan only) ── */
.ed-head-apply{display:none;background:none;border:none;color:#60a5fa;font-size:1.3rem;font-weight:900;cursor:pointer;padding:6px 14px;border-radius:8px;line-height:1}
.ed-head-apply:hover{background:rgba(96,165,250,.15)}
.editor.resizing #ed-head-right-normal{display:none}
.editor.resizing .ed-head-apply{display:flex;align-items:center}
.editor.resizing .ed-tools,.editor.resizing .ed-bottom,.editor.resizing .ed-filters,.editor.resizing .ed-crop-actions{display:none}
.resize-frame{position:absolute;inset:14px;margin:auto;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:4px;transition:aspect-ratio .2s}
.resize-frame.has-page{background:#fff;box-shadow:0 8px 40px rgba(0,0,0,.6)}
.resize-frame img{max-width:100%;max-height:100%;object-fit:contain}
.ed-resize{display:none;gap:16px;padding:14px 18px;overflow-x:auto;background:#000;flex-shrink:0}
.editor.resizing .ed-resize{display:flex}
.ed-size-opt{display:flex;flex-direction:column;align-items:center;gap:7px;background:none;border:none;color:#94a3b8;font-size:.63rem;font-weight:700;cursor:pointer;flex-shrink:0;padding:4px 2px;white-space:nowrap}
.ed-size-opt.active{color:#60a5fa}
.ed-size-opt .rz-ic{display:flex;align-items:center;justify-content:center;border:2px solid currentColor;border-radius:3px;opacity:.9;font-size:.8rem}
.ed-size-opt .rz-ic.rz-portrait{width:26px;height:34px}
.ed-size-opt .rz-ic.rz-landscape{width:34px;height:26px}
.ed-size-opt .rz-ic.rz-auto{width:30px;height:30px;border-style:dashed}
@media(max-height:640px){
  .ed-resize{padding:8px 14px;gap:12px}
  .ed-size-opt .rz-ic.rz-portrait{width:20px;height:27px}
  .ed-size-opt .rz-ic.rz-landscape{width:27px;height:20px}
  .ed-size-opt .rz-ic.rz-auto{width:24px;height:24px}
}

/* short viewports (landscape phones, small tablets) — shrink chrome so the
   save button never gets pushed off screen */
@media(max-height:640px){
  .ed-head{padding-top:calc(6px + env(safe-area-inset-top));padding-bottom:6px}
  .ed-main img,#crop-canvas{inset:6px}
  .ed-filters{padding:6px 12px}
  .ed-filter img,.ed-filter .ed-filter-spin{width:56px;height:72px}
  .ed-tools{padding:4px 6px}
  .ed-tool{padding:4px 10px}
  .ed-tool .ti{font-size:1.05rem}
  .ed-bottom{padding:8px 16px calc(10px + env(safe-area-inset-bottom))}
  .ed-save{padding:10px 26px}
  .ed-crop-actions{padding:8px 16px calc(10px + env(safe-area-inset-bottom))}
}

/* ── Desktop editor: contained card instead of full-bleed black ── */
@media(min-width:900px){
  .editor{background:rgba(10,12,20,.86);backdrop-filter:blur(6px);padding:28px;align-items:center;justify-content:center}
  .editor::before{content:'';position:fixed;inset:0;z-index:-1}
  .ed-shell{display:flex;flex-direction:column;width:100%;max-width:960px;height:100%;max-height:900px;background:#15131f;border-radius:20px;border:1px solid rgba(255,255,255,.08);box-shadow:0 30px 90px rgba(0,0,0,.55);overflow:hidden}
  .ed-head{background:#0f0d1a;padding:14px 20px;border-bottom:1px solid rgba(255,255,255,.06)}
  .ed-brand{display:flex}
  .ed-main{background:radial-gradient(120% 100% at 50% 0%,#1c1930 0%,#100e1a 75%)}
  .ed-main img,#crop-canvas,.resize-frame{inset:26px;border-radius:10px}
  .ed-filters{background:#0f0d1a;justify-content:center;padding:14px 20px}
  .ed-resize{background:#0f0d1a;justify-content:center;padding:14px 20px}
  .ed-tools{background:#0f0d1a;justify-content:center;gap:8px;padding:12px 10px}
  .ed-tool{padding:8px 22px;border-radius:12px}
  .ed-tool:hover{background:rgba(255,255,255,.06)}
  .ed-bottom{background:#0f0d1a;padding:16px 26px 22px}
  .ed-crop-actions{background:#0f0d1a;padding:16px 26px 22px;justify-content:center;gap:14px}
}

/* ── Light mode overrides ── */
body.light{background:#f8fafc;color:#0f172a}
body.light a{color:#7c3aed}
body.light nav{background:#ffffff;border-bottom:1.5px solid rgba(0,0,0,.08);box-shadow:0 2px 8px rgba(0,0,0,.05)}
body.light .nav-brand{color:#7c3aed}
body.light .nav-links a{color:#64748b}
body.light .nav-links a:hover{color:#0f172a}
body.light .theme-toggle{border-color:rgba(0,0,0,.15);color:#475569}
body.light .theme-toggle:hover{background:rgba(0,0,0,.06);border-color:#94a3b8}
body.light .hero{background:linear-gradient(135deg,#ede9fe 0%,#f1f5f9 100%)}
body.light .hero h1{color:#0f172a}
body.light .hero p{color:#64748b}
body.light .scan-tool{background:#ffffff;border-color:rgba(0,0,0,.1)}
body.light .scan-tool::before{opacity:.08}
body.light .scan-tool:hover::before,body.light .scan-tool.active::before{opacity:.14}
body.light .st-t{color:#0f172a}
body.light .st-s{color:#64748b}
body.light .filter-chip{background:#ffffff;border-color:rgba(0,0,0,.1);color:#374151}
body.light .filter-chip .fs{color:#64748b}
body.light .filter-chip.active{background:linear-gradient(135deg,rgba(124,58,237,.12),rgba(79,70,229,.05));border-color:#7c3aed;color:#0f172a}
body.light .opt-group{background:#ffffff;border-color:rgba(0,0,0,.1)}
body.light .opt-group select{background:#f8fafc;color:#0f172a;border-color:rgba(0,0,0,.15)}
body.light .capture-inner{background:radial-gradient(120% 140% at 50% 0%,#ede9fe 0%,#f8fafc 70%)}
body.light .cap-t{color:#0f172a}
body.light .cap-s{color:#64748b}
body.light .cap-head-t{color:#0f172a}
body.light .cap-head-s{color:#64748b}
body.light .cap-or span{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.1);color:#94a3b8}
body.light .page-item{background:#ffffff;border-color:rgba(0,0,0,.12)}
body.light .act-img{background:#ffffff;color:#0f172a;border-color:rgba(124,58,237,.35)}
body.light .act-share{background:#ffffff;color:#0f172a;border-color:rgba(8,145,178,.4)}
body.light .status{color:#64748b}
body.light .status.err{color:#dc2626}
body.light .status.ok{color:#059669}
body.light .ocr-out{background:#ffffff;border-color:rgba(0,0,0,.1);color:#1e293b}
body.light .ham-btn{border-color:rgba(0,0,0,.15);color:#475569}
body.light .ham-btn:hover{background:rgba(0,0,0,.06);border-color:#94a3b8}
body.light .ham-sidebar{background:#ffffff;border-left-color:rgba(0,0,0,.1);box-shadow:-6px 0 32px rgba(0,0,0,.12)}
body.light .ham-head{border-bottom-color:rgba(0,0,0,.08)}
body.light .ham-x:hover{background:rgba(0,0,0,.06);color:#0f172a}
body.light .ham-nav a{color:#374151}
body.light .ham-nav a:hover{background:rgba(124,58,237,.07);color:#0f172a}
body.light .ham-footer{border-top-color:rgba(0,0,0,.07);color:#94a3b8}
body.light .seo-section{background:linear-gradient(135deg,#ede9fe 0%,#f1f5f9 100%);border-top:1px solid rgba(0,0,0,.06)}
body.light .seo-inner>h2{color:#0f172a}
body.light .seo-inner>p{color:#475569}
body.light .seo-card{background:#ffffff;border-color:rgba(0,0,0,.08)}
body.light .seo-card h3{color:#0f172a}
body.light .seo-card p{color:#475569}
body.light .seo-faq h2{color:#0f172a}
body.light .seo-faq-item summary{color:#1e293b}
body.light .seo-faq-item p{color:#475569}
body.light .seo-faq-item{border-bottom-color:rgba(0,0,0,.08)}

/* ── Live camera auto-scanner ── */
.cam-view{display:none;position:fixed;inset:0;height:100vh;height:100dvh;background:#000;z-index:700;flex-direction:column;overflow:hidden}
.cam-view.open{display:flex}
.cam-head{display:flex;align-items:center;justify-content:space-between;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;flex-shrink:0;position:relative;z-index:2}
.cam-head button{background:rgba(0,0,0,.45);border:none;color:#fff;font-size:1.1rem;cursor:pointer;width:38px;height:38px;border-radius:50%;backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center}
.cam-head button:hover{background:rgba(0,0,0,.65)}
.cam-stage{flex:1 1 0;position:relative;overflow:hidden;min-height:0;background:#000}
.cam-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.cam-overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.cam-hint{position:absolute;left:16px;right:16px;bottom:18px;text-align:center;color:#fff;font-size:.85rem;font-weight:700;text-shadow:0 2px 10px rgba(0,0,0,.7);pointer-events:none;background:rgba(0,0,0,.35);padding:8px 14px;border-radius:100px;backdrop-filter:blur(3px);margin:0 auto;width:fit-content}
.cam-flash{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none;transition:opacity .1s}
.cam-flash.on{opacity:.85;transition:opacity .02s}
.cam-bottom{display:flex;align-items:center;justify-content:center;padding:18px 20px calc(22px + env(safe-area-inset-bottom));flex-shrink:0;position:relative;z-index:2}
.cam-shutter{width:68px;height:68px;border-radius:50%;background:#fff;border:4px solid rgba(255,255,255,.35);cursor:pointer;box-shadow:0 4px 22px rgba(0,0,0,.5);transition:transform .12s;flex-shrink:0;padding:0}
.cam-shutter:active{transform:scale(.88)}
.cam-error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:30px;text-align:center;color:#fff;background:#111;z-index:3}
.cam-error .ce-icon{font-size:2.2rem}
.cam-error p{font-size:.88rem;color:#cbd5e1;max-width:280px;line-height:1.6}
.cam-error button{background:#2563eb;border:none;color:#fff;padding:12px 26px;border-radius:100px;font-weight:700;cursor:pointer;font-size:.85rem}
.cam-error button:hover{background:#1d4ed8}
