:root{font-family:'DM Sans',system-ui,-apple-system,sans-serif; color-scheme:light;--bg:#f3f6ff;--surface:#fff;--surface-2:#f8faff;--text:#0f1b3d;--muted:#66738d;--border:#e5eaf5;--light:#edf2ff;--blue:#347bfa;--purple:#8047f8;--green:#12bd90;--shadow:0 12px 36px rgba(41,66,118,.06),0 2px 8px rgba(41,66,118,.035);--ring:0 0 0 4px rgba(104,105,255,.12)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(ellipse 48% 31% at 0% 0%,#ddeaff 0%,transparent 93%),radial-gradient(ellipse 50% 32% at 100% 5%,#f0e9ff 0%,transparent 85%),var(--bg);min-height:100vh;transition:background .25s,color .25s}body[data-theme=dark]{color-scheme:dark;--bg:#0b1022;--surface:#161c32;--surface-2:#1c243f;--text:#eff3ff;--muted:#a0acc6;--border:#303a57;--light:#293254;--blue:#70a6ff;--purple:#a47aff;--green:#3bdbac;--shadow:0 16px 40px rgba(0,0,0,.17)}body[data-theme=dark]{background:radial-gradient(ellipse 50% 30% at 0% 0%,#17274c 0%,transparent 95%),radial-gradient(ellipse 46% 31% at 100% 3%,#281d4c 0%,transparent 95%),var(--bg)}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--purple);outline-offset:3px}a{color:inherit;text-decoration:none}.icons{position:absolute;width:0;height:0;overflow:hidden}.icon{width:19px;height:19px;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round;fill:none;flex-shrink:0}.page{max-width:1384px;padding:28px 36px 24px;margin:0 auto}.header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:58px}.brand{display:flex;gap:12px;align-items:center}.brand-mark{width:47px;height:47px;display:grid;place-items:center;flex:none;border-radius:15px;box-shadow:0 9px 20px #6068ff40;background:linear-gradient(140deg,#248dff,#794aff 80%)}.brand-mark svg{width:29px;height:29px}.brand-name{font-family:'Plus Jakarta Sans',sans-serif;font-size:25px;font-weight:800;letter-spacing:-1.25px;line-height:1.15}.brand-name span{background:linear-gradient(95deg,#3577ff,#9851fa);background-clip:text;color:transparent}.brand-sub{font-size:11px;letter-spacing:.3px;font-weight:700;color:var(--muted);margin-top:4px}.header-controls{display:flex;align-items:center;gap:8px}.icon-btn,.dropdown-trigger{height:40px;display:inline-flex;justify-content:center;align-items:center;gap:8px;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:12px;box-shadow:var(--shadow);padding:0 12px;transition:transform .18s,border-color .18s,background .18s}.icon-btn{width:40px;padding:0}.icon-btn:hover,.dropdown-trigger:hover,.btn:hover{transform:translateY(-2px);border-color:#9caeff}.dropdown-shell{position:relative}.dropdown-trigger{font-weight:700;font-size:13px;white-space:nowrap}.dropdown-menu{position:absolute;z-index:40;top:calc(100% + 9px);right:0;min-width:200px;border-radius:16px;background:var(--surface);border:1px solid var(--border);padding:6px;box-shadow:0 16px 48px #0f1b3d2e;animation:slideIn .16s ease}.dropdown-menu button{width:100%;border:0;background:transparent;color:var(--text);padding:10px 12px;text-align:left;border-radius:10px;display:flex;align-items:center;gap:10px;font-weight:650}.dropdown-menu button:hover,.dropdown-menu button.active{background:var(--light);color:var(--purple)}.dropdown-menu button.active:after{content:'✓';margin-left:auto}.hero{display:flex;justify-content:space-between;gap:24px;align-items:center;padding:48px 4px 30px}.eyebrow{display:inline-flex;gap:7px;align-items:center;background:#e9eaff;color:#6651d5;border:1px solid #dedfff;font-size:11px;font-weight:800;letter-spacing:1.05px;padding:8px 13px;border-radius:999px}.eyebrow .icon{width:13px;height:13px}.hero h1{font-family:'Plus Jakarta Sans',sans-serif;font-size:clamp(32px,4.15vw,58px);line-height:1.12;letter-spacing:-2.5px;margin:16px 0 14px;font-weight:800}.hero h1 .gradient{background:linear-gradient(90deg,#2f91f9 0%,#8d4cfa 100%);color:transparent;background-clip:text}.hero p{max-width:670px;color:var(--muted);font-size:15px;line-height:1.7;margin:0}.hero-art{min-width:220px;position:relative;width:240px;height:130px;display:flex;align-items:center;justify-content:center}.hero-art .mini-board{transform:rotate(-9deg);background:var(--surface);padding:11px;display:grid;grid-template-columns:repeat(4,28px);gap:4px;border:1px solid var(--border);border-radius:15px;box-shadow:0 20px 35px #40548b29}.mini-board i{font-style:normal;font-weight:800;font-size:14px;display:grid;place-items:center;background:var(--light);color:var(--text);border-radius:6px;height:28px}.mini-board i.active{background:#b9d8ff;color:#244caa}.float-sparkle{position:absolute;top:4px;right:19px;color:#8e53fa}.float-sparkle svg{width:33px;height:33px;fill:#9361ff29}.sparkle2{top:auto;bottom:2px;left:12px;color:#2b97ee}.sparkle2 svg{width:23px;height:23px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 358px;gap:20px;align-items:start}.main-col,.side-col{display:grid;gap:18px}.panel{background:var(--surface);border:1px solid var(--border);border-radius:23px;box-shadow:var(--shadow)}.workspace-panel{padding:22px 24px 24px}.panel-head,.section-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.section-kicker{display:flex;align-items:center;gap:9px;font-size:13px;font-weight:800}.section-kicker .icon{color:var(--purple)}.pill{display:inline-flex;align-items:center;gap:6px;font-size:11px;padding:7px 10px;background:#e8f8f3;color:#07946d;border-radius:100px;font-weight:800}.pill .dot{height:6px;width:6px;border-radius:50%;background:currentColor}.preview-grid{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:20px;align-items:start;margin-top:20px}.board-shell{border:1px solid var(--border);background:var(--surface-2);border-radius:20px;padding:18px;min-width:0}.board-toolbar{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-bottom:16px}.board-toolbar strong{font-size:12px}.board-dim{font-size:11px;color:var(--muted);border:1px solid var(--border);padding:5px 8px;border-radius:9px;background:var(--surface)}.board{position:relative;margin:auto;max-width:490px;width:100%;aspect-ratio:var(--cols)/var(--rows);display:grid;grid-template-columns:repeat(var(--cols),1fr);grid-template-rows:repeat(var(--rows),1fr);border:1px solid var(--border);border-radius:13px;overflow:hidden;background:var(--surface);box-shadow:0 9px 25px #0d2c5711}.cell{display:grid;place-items:center;min-width:0;min-height:0;font-family:'Plus Jakarta Sans',sans-serif;font-size:clamp(10px,1.45vw,19px);font-weight:800;position:relative;color:var(--text);border-right:1px solid var(--border);border-bottom:1px solid var(--border);z-index:0}.board-ink{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1;overflow:visible}.board-ink line{stroke-linecap:round;transition:opacity .2s}.board .cell:last-child{border-right:0}.board-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-top:15px}.tiny{font-size:11px;color:var(--muted);line-height:1.5}.link-btn{border:0;color:var(--purple);background:transparent;font-size:12px;font-weight:800;display:inline-flex;align-items:center;gap:5px;padding:6px 0}.link-btn .icon{width:15px;height:15px}.link-btn:hover{text-decoration:underline}.upload-column{display:grid;gap:12px}.dropzone{border:1.6px dashed #b9c9e6;background:linear-gradient(160deg,var(--surface-2),var(--surface));border-radius:17px;text-align:center;padding:20px 10px;cursor:pointer;min-height:208px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:7px;transition:border-color .2s,transform .2s}.dropzone:hover,.dropzone.dragging{border-color:var(--purple);transform:translateY(-2px)}.drop-graphic{width:54px;height:54px;display:grid;place-items:center;border-radius:16px;background:linear-gradient(145deg,#dbedff,#f0e1ff);color:#5a67ec;margin-bottom:5px}.drop-graphic .icon{width:27px;height:27px}.dropzone strong{font-size:13px}.dropzone span{font-size:10px;color:var(--muted)}.image-stage{position:relative;touch-action:none;overflow:hidden;cursor:crosshair;line-height:0;border-radius:12px;background:var(--light)}.image-stage img{width:100%;height:auto;display:block;user-select:none;pointer-events:none}.crop-overlay{position:absolute;border:2px solid #9362ff;background:#8645ff20;box-shadow:0 0 0 999px #050f284e;pointer-events:none}.crop-overlay:after{content:'';position:absolute;inset:4px;border:1px dashed #ffffffc0}.photo-label{text-align:center;margin-top:9px;font-size:10px;color:var(--muted)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:43px;padding:11px 15px;border-radius:12px;border:1px solid transparent;font-size:12px;font-weight:800;transition:transform .18s,box-shadow .18s,background .18s;white-space:nowrap}.btn .icon{width:17px;height:17px}.btn-primary{color:#fff;background:linear-gradient(115deg,#2989fb,#7458f8);box-shadow:0 8px 18px #586cfb2a}.btn-purple{color:#fff;background:linear-gradient(115deg,#844af8,#a04af6);box-shadow:0 8px 18px #9351f724}.btn-secondary{background:var(--surface-2);border-color:var(--border);color:var(--text)}.btn-ghost{background:var(--surface);border-color:var(--border);color:var(--text)}.btn.full{width:100%}.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border-top:1px solid var(--border);margin-top:19px;padding-top:18px}.actions .btn{flex:1}.actions .btn:nth-child(2){flex:1.2}.card-heading{font-size:15px;font-weight:800;letter-spacing:-.3px;display:flex;gap:10px;align-items:center}.card-heading .icon{color:var(--purple)}.card-caption{font-size:12px;color:var(--muted);line-height:1.6;margin:8px 0 0}.search-panel{padding:22px}.search-badge{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:14px;background:#eee8ff;color:#7b4df6}.search-badge .icon{width:19px;height:19px}.search-top{display:flex;gap:10px;align-items:center}.search-box{display:flex;align-items:center;gap:7px;margin-top:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface-2);padding:5px 5px 5px 13px}.search-box:focus-within{box-shadow:var(--ring);border-color:var(--purple)}.search-box>svg{color:var(--muted)}.search-box input{border:0;outline:0;background:transparent;color:var(--text);width:100%;min-width:0;font-size:12px;font-weight:600}.search-box input::placeholder{color:#94a1b8}.search-box .btn{min-height:37px;padding:10px 12px}.chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:13px}.chip{border:1px solid transparent;background:var(--light);color:#6876b3;border-radius:30px;font-size:11px;font-weight:750;padding:8px 11px;transition:background .2s,transform .2s}.chip:hover{background:#e5dcff;color:#6a40e7;transform:translateY(-2px)}.results-panel{padding:21px 19px 17px}.results-count{background:#e3faf1;color:#069b76;font-size:11px;font-weight:800;border-radius:99px;padding:6px 10px}.results-list{display:grid;gap:9px;margin-top:17px;max-height:430px;overflow:auto;padding-right:3px}.word-item{width:100%;text-align:left;display:flex;gap:10px;align-items:center;background:var(--surface-2);border:1px solid var(--border);border-radius:13px;padding:12px 12px;color:var(--text);transition:all .17s}.word-item:hover,.word-item.active{border-color:var(--word);background:color-mix(in srgb,var(--word) 8%,var(--surface));transform:translateX(2px)}.word-check{width:24px;height:24px;flex:none;border-radius:8px;background:var(--word);display:grid;place-items:center;color:#fff}.word-check .icon{width:15px;height:15px;stroke-width:3}.word-name{font-size:13px;font-weight:850;letter-spacing:.15px}.word-meta{font-size:10px;color:var(--muted);margin-top:3px}.word-end{margin-left:auto;display:grid;place-items:center;color:var(--muted);font-size:19px}.no-results{text-align:center;padding:24px 12px;color:var(--muted)}.no-results .icon{color:var(--purple);width:27px;height:27px}.no-results strong{display:block;font-size:13px;color:var(--text);margin:9px 0}.tip-panel{padding:20px 22px;display:flex;align-items:center;gap:16px;background:linear-gradient(120deg,#e9f6ff,#eee9ff);border-color:transparent}.tip-panel .tip-icon{width:45px;height:45px;background:#fff;border-radius:16px;flex:none;display:grid;place-items:center;color:#428cf8}.tip-panel .tip-icon .icon{width:23px;height:23px}.tip-panel p{font-size:12px;color:#667493;line-height:1.55;margin:5px 0 0}.tip-panel strong{font-size:13px;color:#132450}.steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:20px}.step{padding:15px 17px;display:flex;align-items:center;gap:12px}.step-n{width:36px;height:36px;display:grid;place-items:center;flex:none;background:#e9eeff;color:#5575de;border-radius:12px;font-weight:900;font-size:14px}.step strong{font-size:12px}.step p{font-size:10px;line-height:1.4;margin:4px 0 0;color:var(--muted)}.step:nth-child(2) .step-n{background:#e6ddff;color:#8459f4}.step:nth-child(3) .step-n{background:#e0faf0;color:#10ad81}.step:nth-child(4) .step-n{background:#ffe6f3;color:#e15d9a}.footer{margin-top:36px;border-top:1px solid var(--border);padding:22px 0 4px;display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:11px;color:var(--muted)}.footer a{color:var(--purple);font-weight:800}.footer a:hover{text-decoration:underline}.footer .footer-brand{display:flex;align-items:center;gap:6px}.footer .footer-brand svg{width:17px;height:17px;stroke:var(--purple)}.processing{min-height:300px;display:flex;align-items:center;justify-content:center;gap:10px;flex-direction:column;text-align:center;color:var(--muted);font-size:12px}.processing .icon{width:38px;height:38px;color:var(--purple)}.empty-board{max-width:490px;min-height:280px;border-radius:14px;border:1px dashed var(--border);display:grid;place-content:center;gap:12px;text-align:center;margin:auto;padding:20px;color:var(--muted)}.empty-board .icon{width:38px;height:38px;color:var(--purple);margin:auto}.empty-board strong{font-size:13px;color:var(--text)}#modal-root:empty{display:none}.modal-backdrop{position:fixed;inset:0;z-index:110;display:grid;place-items:center;background:#060c1c9e;padding:20px;animation:fadeIn .15s}.modal{width:min(600px,100%);max-height:min(92vh,850px);overflow:auto;border-radius:24px;background:var(--surface);border:1px solid var(--border);box-shadow:0 25px 100px #0006;padding:27px}.modal-header{display:flex;align-items:start;justify-content:space-between;gap:14px}.modal h2{font-size:21px;margin:0;letter-spacing:-.6px}.modal h3{font-size:13px;margin:18px 0 9px}.modal p{color:var(--muted);font-size:12px;line-height:1.7;margin:8px 0 15px}.modal textarea{width:100%;min-height:110px;border:1px solid var(--border);border-radius:12px;resize:vertical;padding:13px;background:var(--surface-2);color:var(--text);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:13px;line-height:1.55}.modal textarea.grid-text{min-height:205px;letter-spacing:3px}.modal-actions{display:flex;justify-content:end;gap:10px;margin-top:20px}.modal-list{padding-left:18px;color:var(--muted);font-size:13px;line-height:1.8}.setting-line{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:14px 0;padding:15px;background:var(--surface-2);border:1px solid var(--border);border-radius:14px}.setting-line strong{display:block;font-size:13px}.setting-line small{display:block;color:var(--muted);font-size:11px;margin-top:5px}.setting-line .dropdown-menu{z-index:200}#toast{position:fixed;bottom:25px;right:25px;z-index:150;max-width:min(380px,90vw);padding:13px 17px;border-radius:14px;background:#17254d;color:#fff;font-size:12px;font-weight:750;box-shadow:0 12px 35px #0004;opacity:0;transform:translateY(12px);transition:all .2s;pointer-events:none}#toast.visible{opacity:1;transform:translateY(0)}.progress-track{height:7px;background:var(--light);border-radius:20px;overflow:hidden;width:min(220px,80%);margin-top:10px}.progress-track div{height:100%;background:linear-gradient(90deg,#3a91f9,#9155fd);transition:width .2s}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes slideIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:1100px){.page{padding:22px}.workspace{grid-template-columns:minmax(0,1fr) 320px}.preview-grid{grid-template-columns:minmax(0,1fr) 185px;gap:12px}.workspace-panel{padding:17px}.step{padding:12px}.step-n{width:29px;height:29px}.hero-art{width:175px;min-width:175px}}
@media(max-width:900px){.workspace{grid-template-columns:1fr}.main-col,.side-col{gap:15px}.side-col{grid-template-columns:1fr 1fr;align-items:start}.side-col .tip-panel{grid-column:1/-1}.preview-grid{grid-template-columns:minmax(0,1fr) 230px}.hero{padding-top:34px}.hero-art{display:none}.steps{grid-template-columns:repeat(2,1fr)}.cell{font-size:clamp(11px,2.6vw,20px)}}
@media(max-width:610px){.page{padding:15px 12px 24px}.header{align-items:center}.brand-mark{width:41px;height:41px;border-radius:14px}.brand-name{font-size:22px}.brand-sub{font-size:9px}.header-controls{gap:5px}.dropdown-trigger{padding:0 9px}.dropdown-trigger .lang-name{display:none}.hero{padding:38px 4px 24px}.hero h1{font-size:34px;letter-spacing:-1.9px}.hero p{font-size:13px}.eyebrow{font-size:9px}.preview-grid{grid-template-columns:1fr}.board-shell{padding:12px}.board{max-width:400px}.cell{font-size:clamp(11px,3.65vw,20px)}.upload-column{display:grid;grid-template-columns:1fr 1fr;align-items:stretch}.dropzone{min-height:135px;padding:13px 7px}.drop-graphic{width:39px;height:39px;border-radius:12px}.drop-graphic .icon{width:21px;height:21px}.dropzone strong{font-size:11px}.dropzone span{font-size:9px}.upload-column .btn{align-self:center}.cropHint{font-size:9px}.actions{gap:7px}.actions .btn{flex:auto;min-height:41px;padding:9px 8px;font-size:11px}.side-col{grid-template-columns:1fr}.results-list{max-height:330px}.steps{gap:9px}.step{padding:10px}.step strong{font-size:11px}.tip-panel{padding:16px}.footer{flex-direction:column;text-align:center}.modal{padding:19px}.modal h2{font-size:18px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

.tip-panel .mascot{width:90px;height:90px;flex:none;object-fit:contain;filter:drop-shadow(0 6px 8px #4781bd21)}@media(max-width:610px){.tip-panel .mascot{width:65px;height:65px}}

/* SopaLens 2026 design system */
:root{--bg:#F9FAF4;--surface:#FFFFFF;--surface-2:#F9FAF4;--text:#0C1D48;--muted:#51648a;--border:#dae5e5;--light:#eaf3f6;--blue:#3162E3;--purple:#3162E3;--green:#12A9BA;--ring:0 0 0 4px #12A9BA25}
body{background:radial-gradient(ellipse at top left,#d9f1ef 0,transparent 48%),#F9FAF4}
body[data-theme=dark]{--bg:#09152f;--surface:#122247;--surface-2:#192c52;--text:#f3f9ff;--muted:#b5c7e1;--border:#375071;--light:#1d3a5b;--blue:#91b0ff;--purple:#90D7CF;--green:#69d8ce;background:#09152f;color:var(--text)}
.brand-name b{color:#3264E4}.brand-name span{background:none;color:#90D7CF}.brand-mark{background:#f9faf4;box-shadow:none;overflow:hidden}.brand-mark img{width:100%;height:100%;object-fit:cover;border-radius:12px}.brand-mark svg{display:none}
.btn-primary{background:#3162E3}.btn-purple{background:#12A9BA}.hero h1 .gradient{background:linear-gradient(90deg,#3162E3,#12A9BA);background-clip:text}.search-badge{width:49px;height:45px;border-radius:13px;background:#dcefed;color:#3162E3}.search-badge .icon{width:25px;height:25px}.eyebrow{background:#e5f6f5;color:#3162E3;border-color:#d0ece7}
.round-flag{width:23px;height:23px;border-radius:50%;object-fit:cover;box-shadow:0 0 0 1px var(--border);flex:none}.dropdown-menu{max-height:295px;overflow:auto}.dropdown-shell{isolation:isolate}
.footer{justify-content:center;font-size:14px;text-align:center}.footer span{font-weight:550}.footer a{color:#3162E3;font-weight:850}
.privacy-note{text-align:center!important}.key-setting{flex-wrap:wrap}.key-setting input{width:100%;min-width:0;padding:12px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:12px}
.crop-modal-stage{margin:18px auto;max-height:51vh;width:fit-content;max-width:100%;border:2px solid var(--border);overflow:hidden}.crop-modal-stage img{max-width:100%;width:auto;max-height:48vh;object-fit:contain}.ocr-dimensions{display:flex;gap:14px;flex-wrap:wrap}.ocr-dimensions label{display:grid;gap:6px;font-size:12px;font-weight:800;flex:1}.ocr-dimensions input{background:var(--surface-2);border:1px solid var(--border);color:var(--text);border-radius:10px;padding:10px;width:100%}
.board{max-width:100%;width:max-content;min-width:0;display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:repeat(var(--rows),minmax(0,1fr));aspect-ratio:var(--cols)/var(--rows);max-height:min(65vh,750px);margin:auto}.board-shell{overflow:auto}.cell{aspect-ratio:1;line-height:1;font-size:clamp(8px,1.1vw,17px)}
body[data-theme=dark] .tip-panel{background:#1c3557}body[data-theme=dark] .tip-panel strong,body[data-theme=dark] .tip-panel p{color:var(--text)}body[data-theme=dark] .chip{color:#d2e1ff}body[data-theme=dark] .chip:hover{background:#284f68;color:white}body[data-theme=dark] .eyebrow{background:#19354e;color:#a7e7eb;border-color:#375071}body[data-theme=dark] .pill,body[data-theme=dark] .results-count{background:#153c43;color:#83ebce}body[data-theme=dark] .search-box input::placeholder{color:#aabfd9}body[data-theme=dark] .word-item{color:var(--text)}body[data-theme=dark] .dropdown-menu button.active{color:#a9efea}body[data-theme=dark] .step-n{background:#24456c;color:#b2dcff}body[data-theme=dark] .mini-board i.active{background:#285c7b;color:#e5faff}
@media(min-width:901px){.preview-grid{grid-template-columns:minmax(0,1fr) 240px}.board{width:100%;max-width:min(100%,700px)}}
@media(max-width:610px){.search-badge{width:44px;min-width:44px}.footer{font-size:13px}.board .cell{font-size:clamp(8px,2.1vw,15px)}}

/* SopaLens v3 responsive and interaction fixes */
.header,.header-controls,.brand{position:relative}.header{z-index:50}.header-controls{z-index:52}.dropdown-shell{position:relative;z-index:55}.dropdown-menu{position:absolute;z-index:9999;top:calc(100% + 8px);right:0;left:auto;min-width:250px;max-height:min(450px,65vh);overflow:auto;box-shadow:0 18px 45px #0c1d4838}
.hero .eyebrow{background:#fff}.steps{max-width:1100px;margin:18px auto 24px;justify-content:center}.steps .step{justify-content:center}.tip-panel{margin-top:18px}.search-badge{width:59px;min-width:59px;height:54px}.search-badge .icon{width:29px;height:29px}.help-close-wrap{display:flex;justify-content:center;margin-top:18px}
.board{width:100%!important;max-width:100%!important;max-height:none!important;aspect-ratio:var(--cols)/var(--rows)!important;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:repeat(var(--rows),minmax(0,1fr));}
.board .cell{min-width:0;font-size:clamp(10px,1.4vw,22px)}.board-ink{width:100%;height:100%}
@media(max-width:610px){.board-shell{padding:10px;min-width:0;overflow-x:auto}.board{min-width:min(340px,calc(var(--cols) * 24px));}.board .cell{font-size:clamp(13px,3.6vw,19px)}.board-ink{width:100%}.search-badge{width:52px;min-width:52px}.steps{grid-template-columns:repeat(2,minmax(0,1fr))}.steps .step{justify-content:flex-start}}

/* SopaLens editor and direct correction improvements */
.brand-name span{color:#B9D8FF}
.board-edit-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.board-cell-editor{appearance:none;width:100%;min-width:0;border:1px solid #3162E355;border-radius:5px;background:#fff;color:#0C1D48;text-align:center;font:inherit;font-weight:850;padding:0;outline-offset:1px}
.board-cell-editor:focus,.grid-cell-input:focus{outline:2px solid #12A9BA;z-index:2}
.board .cell.search-hit{background:#ffdc69;color:#0C1D48;box-shadow:inset 0 0 0 2px #e2a900}
body[data-theme=dark] .board-cell-editor{background:#eaf2ff;color:#0C1D48}
.modal:has(.editor-top-grid){width:min(980px,100%)}
.editor-top-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:18px;align-items:start}
.editor-section{min-width:0;border:1px solid var(--border);border-radius:16px;background:var(--surface-2);padding:14px}
.editor-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.editor-section-head h3{margin:0 0 12px;font-size:14px}
.editor-section-head span{font-size:11px;font-weight:800;color:var(--muted)}
.editable-grid{display:grid;grid-template-columns:repeat(var(--edit-cols),minmax(0,1fr));gap:5px;width:100%;overflow:auto}
.grid-cell-input{width:100%;min-width:0;aspect-ratio:1;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);text-align:center;text-transform:uppercase;font-size:clamp(10px,1.5vw,17px);font-weight:850;padding:2px;outline-offset:1px}
.editor-image-section{display:flex;flex-direction:column;min-height:100%}
.editor-source-image{display:block;width:100%;max-height:390px;object-fit:contain;object-position:top center;border-radius:11px;background:#fff;border:1px solid var(--border)}
.editor-no-image{min-height:190px;display:grid;place-content:center;justify-items:center;gap:10px;color:var(--muted);font-size:12px;text-align:center}
.editor-no-image .icon{width:32px;height:32px}
.word-editor-section{margin-top:15px}
.word-editor-section>p{margin:5px 0 12px}
.word-chip-list{display:flex;gap:8px;flex-wrap:wrap;min-height:35px}
.editable-word-chip{display:inline-flex;align-items:center;gap:7px;padding:7px 9px 7px 12px;border-radius:999px;background:#e9f0ff;color:#214aaf;font-size:12px;font-weight:850}
.editable-word-chip button{border:0;background:#d3e0ff;color:#214aaf;border-radius:50%;width:19px;height:19px;line-height:1;font-weight:900;cursor:pointer}
.word-add-row{display:flex;gap:9px;margin-top:12px}
.word-add-row input{flex:1;min-width:0;border:1px solid var(--border);border-radius:11px;padding:11px 13px;background:var(--surface);color:var(--text);outline:none}
.word-add-row input:focus{border-color:#12A9BA;box-shadow:var(--ring)}
@media(max-width:700px){.editor-top-grid{grid-template-columns:1fr}.editor-image-section{order:2}.editor-top-grid>.editor-section:first-child{order:1}.word-editor-section{order:3}.modal:has(.editor-top-grid){width:100%;max-height:94vh;padding:16px}.editable-grid{gap:3px}.grid-cell-input{border-radius:5px;font-size:clamp(9px,3vw,15px)}.editor-source-image{max-height:260px}.word-add-row .btn{padding:9px 10px}.board-edit-actions{gap:8px}}
@media(min-width:701px){.editor-section:first-child{overflow-x:auto}.editable-grid{width:max(100%,calc(var(--edit-cols) * 38px))}}

/* SopaLens layout refinement — desktop density and mobile help placement */
.mobile-tip-panel{display:none}
.brand-name span{color:#6dc5cf}
@media(min-width:1200px){
 .page{max-width:1280px;padding:24px 30px 22px}
 .hero{padding-top:40px;padding-bottom:24px}
 .hero h1{font-size:clamp(32px,3.8vw,53px)}
 .workspace{grid-template-columns:minmax(0,1fr) 330px;gap:18px}
 .workspace-panel{padding:20px 21px 22px}
 .panel{border-radius:20px}
 .steps{max-width:1020px;gap:10px}
 .step{padding:13px 15px}
}
body[data-theme=dark] .brand-name span{color:#B9D8FF}
@media(max-width:610px){
 .desktop-tip-panel{display:none}
 .mobile-tip-panel{display:flex;margin:0 0 15px;padding:15px 16px}
 .steps{margin-bottom:13px}
}

/* SopaLens V6: dual workflow and built-in word-search generator */
.mode-switch{display:flex;justify-content:center;gap:8px;margin:0 auto 22px;padding:5px;width:fit-content;max-width:100%;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.mode-tab{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:42px;padding:10px 18px;border:0;border-radius:11px;background:transparent;color:var(--muted);font-size:12px;font-weight:850;white-space:nowrap}
.mode-tab .icon{width:17px;height:17px}
.mode-tab.active{background:#e5f6f5;color:#176f83}
body[data-theme=dark] .mode-tab.active{background:#1b4658;color:#b9e9e6}
.generator-panel{max-width:900px;margin:0 auto;padding:24px}
.generator-panel form{display:grid;gap:12px}
.generator-label{font-size:14px;font-weight:850;color:var(--text)}
.generator-hint{font-size:12px;color:var(--muted);margin:-7px 0 0;line-height:1.6}
.generator-panel textarea{width:100%;min-height:135px;resize:vertical;border:1px solid var(--border);border-radius:14px;padding:14px;background:var(--surface-2);color:var(--text);font:600 13px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace;outline:none}
.generator-panel textarea:focus,.generator-options select:focus{border-color:#12A9BA;box-shadow:var(--ring)}
.generator-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.generator-options label{display:grid;gap:7px;color:var(--muted);font-size:11px;font-weight:800}
.generator-options select{width:100%;min-height:43px;padding:10px 12px;border:1px solid var(--border);border-radius:11px;background:var(--surface-2);color:var(--text);font:inherit;font-size:12px;font-weight:700}
.generator-submit{justify-self:start;min-width:210px}
.generator-privacy{display:flex;align-items:center;gap:7px;margin:15px 0 0;color:var(--muted);font-size:11px}
.generator-privacy .icon{width:15px;height:15px;color:#12A9BA}
.generated-result{max-width:1100px;margin:20px auto 0;padding:22px}
.generated-layout{display:grid;grid-template-columns:minmax(0,1fr) 230px;gap:20px;align-items:start;margin-top:18px}
.generated-board-wrap{min-width:0;padding:14px;border:1px solid var(--border);border-radius:17px;background:var(--surface-2)}
.generated-board{position:relative;width:min(100%,680px);aspect-ratio:var(--cols)/var(--rows);margin:auto;display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:repeat(var(--rows),minmax(0,1fr));overflow:hidden;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
.generated-board .cell{font-size:clamp(9px,1.5vw,19px)}
.generated-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.generated-actions .btn{flex:1;white-space:normal;font-size:11px;padding:10px}
.generated-words{padding:15px;border:1px solid var(--border);border-radius:15px;background:var(--surface-2)}
.generated-words h3{margin:0 0 12px;font-size:13px}
.generated-word-list{display:grid;gap:8px;max-height:390px;overflow:auto}
.generated-word{display:flex;align-items:center;gap:9px;font-size:12px;font-weight:800;color:var(--text)}
.generated-word span{width:10px;height:10px;border-radius:4px;flex:none}
.generator-warning{font-size:11px;line-height:1.5;color:#b76b12;margin:13px 0 0}
@media(max-width:700px){
 .mode-switch{width:100%;gap:5px}.mode-tab{flex:1;min-width:0;padding:9px 7px;font-size:10px;white-space:normal}
 .generator-panel{padding:17px}.generator-options{grid-template-columns:1fr 1fr}.generator-submit{width:100%}
 .generated-result{padding:15px}.generated-layout{grid-template-columns:1fr}.generated-board-wrap{padding:9px}.generated-board .cell{font-size:clamp(9px,3vw,16px)}
 .generated-actions{display:grid;grid-template-columns:1fr 1fr}.generated-actions .btn:last-child{grid-column:1/-1}
 .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
 .actions .btn,.actions .btn:nth-child(2){width:100%;min-width:0;flex:none;min-height:43px;padding:9px 6px;font-size:11px;white-space:normal}
 .actions #action-solution{grid-column:1/-1}
 .header-controls>.icon-btn:last-child{display:inline-flex}
}


/* SopaLens V7: desktop generator composition, clearer mode tabs and manual solving */
.mode-tab{font-size:13px}
.board-bottom{display:grid;justify-content:start;gap:8px;margin-top:5px;padding:10px 2px 0;border-top:1px solid var(--border)}
.board-bottom .tiny{max-width:260px}
.board-edit-actions{gap:14px}
.cell.manual-cell{appearance:none;-webkit-appearance:none;padding:0;border-top:0;border-left:0;border-radius:0;background:transparent;cursor:pointer;touch-action:manipulation}
.cell.manual-cell:hover{background:color-mix(in srgb,#12A9BA 13%,var(--surface))}
.cell.manual-cell.manual-selected{background:#12A9BA!important;color:#fff!important;box-shadow:inset 0 0 0 2px #087e8b;z-index:2}
.board .cell.search-hit{background:#ffdc69;color:#0C1D48;box-shadow:inset 0 0 0 2px #e2a900}
.manual-hint{margin:10px 0 0;text-align:center;color:var(--muted);font-size:11px;line-height:1.5}
.generator-script-note{margin:-4px 0 0;color:var(--muted);font-size:11px;line-height:1.55}
.generator-label{text-align:center}
.generator-submit{justify-self:center}
.generator-privacy{justify-content:center;text-align:center;line-height:1.5}
.generator-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,360px);gap:18px;align-items:start;max-width:1400px;margin:0 auto}
.generator-workspace .generated-result{max-width:none;margin:0;padding:20px;min-width:0}
.generator-workspace .generator-panel{max-width:none;margin:0;padding:22px;min-width:0}
.generator-workspace .generated-layout{grid-template-columns:minmax(0,1fr) 170px;gap:12px}
.generator-workspace .generated-words{padding:12px}
.generator-workspace .generated-board-wrap{padding:10px}
.generated-board .cell.manual-cell{min-width:0}
@media(max-width:1100px){.generator-workspace{grid-template-columns:minmax(0,1fr) 320px;gap:14px}.generator-workspace .generated-layout{grid-template-columns:minmax(0,1fr)}.generator-workspace .generated-words{display:block}.generator-workspace .generated-word-list{grid-template-columns:repeat(auto-fit,minmax(90px,1fr));max-height:150px}}
@media(max-width:820px){.generator-workspace{grid-template-columns:1fr}.generator-workspace .generated-result{order:1}.generator-workspace .generator-panel{order:2}.generator-workspace .generated-layout{grid-template-columns:minmax(0,1fr) 180px}.generator-workspace .generated-words{display:block}}
@media(max-width:700px){
 .mode-tab{font-size:11.5px;line-height:1.25;padding:10px 8px;gap:7px}
 .mode-tab .icon{width:16px;height:16px}
 .generator-workspace .generated-layout{grid-template-columns:1fr}
 .generator-workspace .generated-words{display:block}
 .generator-label{font-size:15px}
 .generator-submit{justify-self:stretch}
 .generator-privacy{align-items:flex-start}
 .board-bottom{gap:7px}
}

/* SopaLens V8: responsive board controls and custom generator selectors */
@media(min-width:701px){
 .board-bottom{display:grid;grid-template-columns:1fr;justify-content:start;align-items:start;gap:8px;margin-top:5px;padding:10px 2px 0;border-top:1px solid var(--border)}
 .board-bottom .tiny{max-width:260px}
 .board-edit-actions{display:flex;flex-wrap:wrap;gap:14px}
}
@media(max-width:700px){
 /* On phones, keep the helper and edit actions with the board instead of under Restore example. */
 .upload-column{display:contents}
 .upload-column>div:nth-child(2){display:contents}
 .board-bottom{order:1;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin-top:10px;padding:0;border-top:0}
 .board-bottom .tiny{max-width:none}
 .board-edit-actions{display:flex;flex-wrap:wrap;gap:10px}
 .upload-column>div:first-child{order:2}
 .upload-column #upload-again{order:3}
 .upload-column #open-crop{order:4}
 .upload-column #reset-crop{order:5}
 .upload-column #restore-demo{order:6}
}
.create-hero .hero-art{flex:0 0 220px}
.generator-options{display:grid;gap:16px;margin-top:4px}
.generator-control{min-width:0;display:grid;gap:8px}
.generator-control-title{font-size:12px;font-weight:850;color:var(--text);text-align:center}
.generator-select-shell{position:relative;width:100%;max-width:340px;margin:0 auto}
.generator-select-trigger{width:100%;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border:1px solid var(--border);border-radius:15px;background:linear-gradient(135deg,var(--surface),var(--surface-2));color:var(--text);text-align:left;box-shadow:0 5px 16px rgba(20,42,85,.045);transition:border-color .18s,box-shadow .18s,transform .18s}
.generator-select-trigger:hover,.generator-select-shell.is-open .generator-select-trigger{border-color:#78a0f3;box-shadow:0 8px 22px rgba(49,98,227,.12)}
.generator-select-trigger>.icon{width:17px;height:17px;color:var(--muted);transition:transform .18s}
.generator-select-shell.is-open .generator-select-trigger>.icon{transform:rotate(180deg)}
.generator-select-value{min-width:0;display:grid;gap:3px}
.generator-select-value strong{font-size:14px;font-weight:900;line-height:1.2}
.generator-select-value small{font-size:10px;color:var(--muted);font-weight:650;line-height:1.3}
.generator-select-menu{position:absolute;z-index:30;top:calc(100% + 8px);left:0;right:0;display:grid;gap:5px;padding:7px;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:0 18px 42px rgba(16,34,68,.18);max-height:270px;overflow-y:auto;animation:generatorMenuIn .16s ease-out}
@keyframes generatorMenuIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
.generator-select-option{width:100%;min-height:48px;display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid transparent;border-radius:11px;background:transparent;color:var(--text);text-align:left;transition:background .16s,border-color .16s}
.generator-select-option:hover{background:var(--surface-2);border-color:var(--border)}
.generator-select-option.active{background:linear-gradient(110deg,#eaf2ff,#f2edff);border-color:#a9c2f7;color:#2459bd}
body[data-theme=dark] .generator-select-option.active{background:linear-gradient(110deg,#1c385d,#30254f);border-color:#668fd8;color:#dce9ff}
.option-size-number{width:31px;height:31px;display:grid;place-items:center;flex:0 0 31px;border-radius:9px;background:#e7efff;color:#3569ce;font-size:12px;font-weight:900}
.generator-select-option.active .option-size-number{background:#d4e3ff;color:#2459bd}
.option-size-copy{min-width:0;display:grid;gap:2px;flex:1}
.option-size-copy strong{font-size:12px;font-weight:850;line-height:1.2}
.option-size-copy small{font-size:10px;color:var(--muted);line-height:1.25}
.generator-select-option>.icon{width:16px;height:16px;color:#168f78;flex:0 0 auto}
.generator-select-option .difficulty-mark{width:29px;height:29px;flex:0 0 29px;border-radius:9px}
.generator-select-option.difficulty-medium .difficulty-mark{background:#eee5ff;color:#8659e8}
.generator-select-option.difficulty-hard .difficulty-mark{background:#ffe9ef;color:#d45e88}
@media(max-width:700px){
 .create-hero .hero-art{display:none}
 .generator-options{gap:14px}
 .generator-select-shell{max-width:none}
 .generator-select-trigger{min-height:54px}
 .generator-select-menu{max-height:240px}
}
.generator-select-option .difficulty-mark{width:29px;height:29px;display:grid;place-items:center;border-radius:9px;background:#e4eaff;color:#5274d9;font-size:11px;font-weight:900}
