/* Shared, lightweight shell: no remote fonts; controls remain reachable at 360px. */
:root{font-family:'Noto Sans','Noto Sans KR','Noto Sans JP','Noto Sans TC','Noto Sans SC',system-ui,'Malgun Gothic',Meiryo,sans-serif;color:#17233b;background:#f2f4f9;font-synthesis:none;--green:var(--brand-primary);--line:#dbe1eb;--muted:#58667b}*{box-sizing:border-box}body{margin:0}a{color:inherit;text-decoration:none}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button,.button{border:1px solid var(--line);border-radius:9px;background:white;padding:11px 15px;cursor:pointer;font-weight:600;color:inherit;display:inline-flex;align-items:center;justify-content:center;gap:8px}button:hover,.button:hover{background:#eef0ff}button:disabled{cursor:default;opacity:.45}.primary{background:var(--green);color:white;border-color:var(--green)}.primary:hover{background:#3343C4}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #4657e8;outline-offset:3px}[hidden]{display:none!important}.wrap{max-width:1200px;margin:auto;padding:0 32px}.header{height:86px;border-bottom:1px solid var(--line);background:#fff}.header .wrap{display:flex;align-items:center;justify-content:space-between;height:100%;gap:20px}.brand{font-weight:800;font-size:22px;display:flex;align-items:center;gap:10px;white-space:nowrap}.brand svg{width:35px;height:35px}.badge{font-size:12px;color:var(--green);background:#eef0ff;border-radius:30px;padding:8px 12px}.tabs{display:flex;gap:8px;overflow-x:auto;border-bottom:1px solid var(--line);padding-top:10px}.tabs a{padding:16px 20px;white-space:nowrap;color:var(--muted);font-size:14px;border-bottom:3px solid transparent}.tabs a[aria-current]{color:var(--green);border-color:var(--green);font-weight:700}.tabs small{font-size:10px;margin-left:4px}.eyebrow{color:var(--green);font-size:11px;letter-spacing:2px;font-weight:800;margin:0 0 15px}.hero{padding:46px 0 30px}.hero h1{font-size:36px;letter-spacing:-1.4px;margin:0 0 13px;line-height:1.3}.hero p{color:var(--muted);font-size:15px;line-height:1.8;margin:0}.hero .badge{display:inline-block;margin-top:17px}.ad{min-height:42px;display:flex;justify-content:center;align-items:center;border-top:1px solid #e7ebe4;border-bottom:1px solid #e7ebe4;color:#879188;font-size:10px;letter-spacing:2px;margin:18px 0}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:22px;align-items:start}.card{background:white;border:1px solid var(--line);border-radius:16px;padding:24px}.card h2{font-size:15px;margin:0 0 17px;display:flex;align-items:center;gap:10px}.step{width:23px;height:23px;display:inline-flex;border:1px solid var(--line);border-radius:50%;align-items:center;justify-content:center;font-size:11px;color:var(--green)}.drop{border:1.5px dashed #aeb9d0;border-radius:12px;background:#f8f9fd;text-align:center;padding:36px 16px;position:relative}.drop.drag{background:#e5f0df;border-color:var(--green)}.drop svg{width:38px;height:38px;color:var(--green);margin-bottom:10px}.drop strong{display:block;font-size:17px;margin-bottom:8px}.drop p{font-size:12px;color:var(--muted);margin:8px 0 18px;line-height:1.8}.drop label{cursor:pointer}.file-input{position:absolute;width:1px;height:1px;opacity:0;left:50%;bottom:30px}.drop:focus-within{outline:3px solid #4657e8}.tiny{font-size:12px;line-height:1.7;color:var(--muted)}.file-list{list-style:none;margin:16px 0 0;padding:0;max-height:210px;overflow:auto}.file-list li{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #e7eaf2}.file-list li>button:first-child{border:0;padding:5px;min-width:0;flex:1;justify-content:flex-start;background:none;text-align:left}.file-list li.selected{background:#eef0ff;border-radius:8px}.file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;font-size:12px;max-width:330px}.file-list small{font-size:11px;color:var(--muted);display:block;margin-top:4px}.file-list .remove{font-size:18px;padding:4px 10px;border:0}.file-list a{font-size:12px;white-space:nowrap;color:var(--green);font-weight:700;padding:8px}.file-icon{background:#eef0ff;padding:9px;border-radius:7px;font-size:10px;font-weight:700}.preview-head{display:flex;align-items:center;justify-content:space-between;margin:24px 0 12px;gap:10px}.preview-head h2{margin:0}.preview-head button{font-size:11px;padding:7px 10px}.preview{display:grid;grid-template-columns:1fr 1fr;gap:12px}.picture{position:relative;border-radius:10px;border:1px solid var(--line);overflow:hidden;background:repeating-conic-gradient(#f0f1ed 0% 25%,#fff 0% 50%) 50%/18px 18px;min-height:180px;display:flex;align-items:center;justify-content:center}.picture img{width:100%;height:230px;object-fit:contain;display:block}.picture span{position:absolute;top:9px;left:9px;font-size:10px;padding:5px 8px;border-radius:6px;background:#fffE;color:#17233b}.empty-preview{padding:50px 10px;text-align:center;background:#f2f4f9;border-radius:10px;color:#58667b;font-size:13px}.preview-note{font-size:12px;color:var(--muted);line-height:1.7;min-height:24px;margin-bottom:0}.settings label{display:block;font-size:12px;font-weight:600;margin-bottom:8px}.settings select,.settings input[type=number],.settings input[type=text]{width:100%;border:1px solid #c5cddb;border-radius:8px;padding:10px;background:white;color:inherit;min-height:41px}.settings input[type=range]{width:100%;accent-color:var(--green)}.settings .field{margin:0 0 21px}.row{display:flex;gap:8px;align-items:center}.row>*{min-width:0;flex:1}.row button{font-size:12px;padding:10px 4px}.row .check{flex:initial}.check{display:flex!important;gap:7px;align-items:center;font-weight:400!important;line-height:1.5;margin:10px 0!important}.check input{accent-color:var(--green)}.value{float:right;color:var(--green);font-weight:700}.separator{border:0;border-top:1px solid var(--line);margin:22px 0}.settings details summary{font-size:12px;cursor:pointer;padding:6px 0 15px;font-weight:700}.settings .primary{width:100%;padding:14px}.settings .actions{display:flex;gap:8px;margin-top:9px}.settings .actions button{flex:1;font-size:12px}.status{font-size:12px;line-height:1.7;margin:13px 0 0;overflow-wrap:anywhere}.error{color:#a53e30}.notice{padding:13px 16px;background:#eef0ff;border:1px solid #ccd3f8;border-radius:10px;font-size:13px;line-height:1.7;margin-bottom:18px}.notice button{font-size:12px;margin:6px}.guide{padding:38px 0;display:grid;grid-template-columns:1fr 1fr;gap:50px;line-height:1.9;color:var(--muted);font-size:13px}.guide h2{font-size:18px;color:#17233b;margin-top:0}.guide h3{font-size:13px;color:#17233b;margin:18px 0 3px}.guide p{margin:0 0 10px}.footer{border-top:1px solid var(--line);padding:28px 0;color:var(--muted);font-size:11px}.footer .wrap{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}.footer nav{display:flex;flex-wrap:wrap;gap:18px}.home-hero{padding:70px 0 48px}.home-hero h1{font-size:50px;max-width:650px;line-height:1.3;letter-spacing:-2px;margin:15px 0 22px}.home-hero p{color:var(--muted);line-height:1.9}.tools{display:grid;grid-template-columns:repeat(2,1fr);gap:18px;margin-bottom:55px}.tool{padding:30px;display:block}.tool:hover{border-color:#4657e8}.tool b{font-size:24px;color:var(--green)}.tool h2{font-size:20px;margin:20px 0 12px}.tool p{font-size:14px;color:var(--muted);line-height:1.7}.tool small{color:var(--green)}.prose{max-width:800px;line-height:1.9;padding:45px 0 80px}.prose h1{font-size:30px}.prose p{color:var(--muted)}.prose pre{white-space:pre-wrap;font-size:11px}.progress{width:100%;accent-color:var(--green);margin-top:12px}noscript{display:block;padding:20px;background:#fff4da}
.drop.compact{padding:13px}.drop.compact>svg,.drop.compact>strong,.drop.compact>p{display:none}.picture img{height:280px}
/* In narrow layouts, the comparison stays in view while controls scroll below. */
@media(max-width:760px){.wrap{padding:0 18px}.header{height:68px}.brand{font-size:19px}.header .badge{font-size:10px;padding:7px}.tabs{gap:0}.tabs a{padding:14px 12px;font-size:12px}.tabs small{display:none}.hero{padding:28px 0 16px}.hero h1{font-size:29px}.hero p{font-size:13px}.workspace{display:block}.card{padding:18px;border-radius:13px}#source-panel{display:contents}#upload-panel,#preview-panel{padding:16px;background:white;border:1px solid var(--line);border-radius:13px;margin-bottom:14px}#preview-panel:has(#preview:not([hidden])){position:sticky;top:0;z-index:3;box-shadow:0 5px 14px #17233b12}#preview-panel .preview-head{margin:0 0 10px}.drop{padding:25px 12px}.preview .picture{min-height:95px}.picture img{height:120px}.preview-note{font-size:10px;margin:8px 0 0;min-height:15px}.file-name{max-width:150px}.guide{grid-template-columns:1fr;gap:20px;padding:25px 0}.home-hero{padding:40px 0}.home-hero h1{font-size:35px}.tools{grid-template-columns:1fr}.tool{padding:24px}.footer nav{gap:14px}.ad{min-height:30px;margin:14px 0}.settings .primary{min-height:48px}.row button{min-height:42px}}
/* Converter revision: bright brand, full-resolution viewport and reserved ads.
   Fixed mobile actions own their safe-area; reserved slots never overlap them. */
:root{color:#17233b;background:#f2f4f9;--green:var(--brand-primary);--line:#dbe2ef;--muted:#58667b}
.wrap{max-width:1500px;padding:0 24px}.header{height:66px}.badge{color:#214ea9;background:#eaf1ff}.tabs{padding-top:0}.tabs a{padding:13px 20px}.hero{padding:26px 0 8px;position:relative}.hero h1{font-size:32px}.hero p{font-size:14px}.hero p br{display:none}.hero .badge{position:absolute;right:0;top:35px;margin:0}.eyebrow{color:#9A4600}.primary{background:var(--brand-primary);border-color:var(--brand-primary)}.primary:hover{background:#3343C4}button:hover,.button:hover{background:#edf3ff}.primary:hover{color:white}.workspace{grid-template-columns:minmax(0,1fr)320px;gap:24px}.card{border-radius:14px;padding:20px}.card h2{font-size:16px}.drop{background:#f7faff;border-color:#aec7fa}.drop.drag{background:#e9f2ff;border-color:var(--brand-primary)}.drop.compact{padding:9px}.drop.compact label{padding:9px 17px}.file-list{max-height:150px}.file-list li.selected{background:#edf4ff}.file-name,.file-list small,.file-list a,.file-icon{font-size:13px}.file-icon{background:#dceaff;color:#214ea9}.file-name{max-width:550px}.preview-head{margin:20px 0 12px}.preview-head button{font-size:13px}.size-summary{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0 18px}.size-summary strong{font-size:28px;display:block;letter-spacing:-.7px;margin-top:5px}.size-summary #size-kind{font-size:13px;color:#58667b}.size-arrow{color:#8291aa}.saving-badge{font-size:15px;font-weight:750;white-space:nowrap;padding:9px 13px;border-radius:24px;color:#076537;background:#c8f8da}.saving-badge.increase{color:#a4410b;background:#ffedd5}.viewer-toolbar{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.viewer-toolbar>div{display:flex;gap:5px;align-items:center}.viewer-toolbar button{font-size:13px;padding:8px 10px;min-height:36px}.viewer-toolbar output{font-size:13px;min-width:44px;text-align:center}.preview{height:520px;min-height:480px;display:block;position:relative;overflow:hidden;border-radius:10px;border:1px solid #cfdaea;background:repeating-conic-gradient(#e7ecf3 0% 25%,#f8faff 0% 50%) 50%/18px 18px;touch-action:none;cursor:grab}.preview:active{cursor:grabbing}.preview canvas{position:absolute;inset:0;width:100%;height:100%;display:block}.canvas-label{position:absolute;top:12px;padding:6px 10px;border-radius:6px;background:#fffffff0;color:#24364c;font-size:13px;pointer-events:none}.canvas-label.left{left:12px}.canvas-label.right{right:12px}#compare-handle{position:absolute;top:0;bottom:0;left:50%;width:32px;transform:translateX(-50%);cursor:ew-resize;touch-action:none}#compare-handle:before{content:'';position:absolute;top:0;bottom:0;left:15px;width:2px;background:white;box-shadow:0 0 3px #17233b}#compare-handle span{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:36px;height:36px;border:2px solid white;border-radius:50%;background:var(--brand-primary);color:white;display:grid;place-items:center;font-weight:700}.preview-note,.viewer-help{font-size:13px;color:#43536b;line-height:1.6;margin:10px 0 0}.viewer-help{color:#58667b}.settings label,.settings .tiny,.settings details summary,.settings button,.status{font-size:13px}.settings .field{margin-bottom:18px}.settings .tiny{margin:8px 0 0}.settings select,.settings input[type=number],.settings input[type=text]{min-height:42px}.settings input[type=range]{accent-color:var(--brand-primary)}.settings .check input{accent-color:var(--brand-primary)}.settings .separator{margin:18px 0}#action-bar{display:flex;gap:8px}#action-bar .primary{flex:1;width:auto}#action-bar #save-selected{background:#ecfdf3;color:#11643a;border-color:#a6e5be}#action-bar #cancel{background:#fff0e5;color:#a4410b}.mobile-only{display:none!important}.guide{font-size:14px}.guide h3{font-size:14px}.footer{font-size:13px}.ad{position:relative;border:1px dashed #d6deeb;background:#f1f4f9;border-radius:8px;letter-spacing:0;display:flex;justify-content:center;align-items:flex-end;margin:24px 0 32px;padding:20px 0 0;overflow:hidden}.ad>span{position:absolute;top:4px;font-size:11px;color:#68758a}.ad-top{height:112px}.ad-top .ad-slot{width:728px;height:90px;flex:none}.ad-bottom{width:324px;height:274px;margin:36px auto}.ad-bottom .ad-slot{width:300px;height:250px;flex:none}.ad-side{display:none}.ad-side .ad-slot{width:300px;height:600px;flex:none}.tool b{color:var(--brand-primary)}.tool small{color:var(--brand-primary)}.home-hero .eyebrow{color:#9A4600}
@media(min-width:1750px){.wrap{max-width:1740px}.workspace{grid-template-columns:minmax(0,1fr)320px 302px}.ad-side{display:flex;width:302px;height:624px;margin:0;grid-column:3;grid-row:1}}
@media(max-width:760px){body{padding-bottom:85px}.wrap{padding:0 16px}.header{height:60px}.header .badge,.tabs a,.tabs small,.eyebrow,.badge,.tiny,.footer,.file-list small,.file-icon,.file-list a{font-size:13px}.header .badge{padding:6px 8px}.brand{font-size:19px}.tabs a{padding:13px 11px}.hero{padding:18px 0 2px}.hero h1{font-size:27px}.hero p{font-size:13px}.hero .badge{position:static;margin:12px 0 0}.ad-top{height:122px;margin:18px 0 24px}.ad-top .ad-slot{width:320px;height:100px}.ad>span{font-size:13px;top:2px}.workspace{display:block}#source-panel{display:contents}#upload-panel,#preview-panel{padding:12px;margin-bottom:14px;background:white;border:1px solid var(--line);border-radius:12px}#preview-panel:has(#preview:not([hidden])){position:static;box-shadow:none}#preview-panel{scroll-margin-top:8px}.preview-head{margin:0 0 8px!important}.preview-head h2{font-size:15px}.preview-head button{font-size:13px;padding:7px}.size-summary{padding:3px 0 12px;flex-wrap:wrap;gap:6px}.size-summary strong{font-size:22px;letter-spacing:-.8px}.size-summary #size-kind{font-size:13px}.saving-badge{font-size:13px;padding:6px 9px}.viewer-toolbar{margin-bottom:8px;gap:5px}.viewer-toolbar button{font-size:13px;padding:7px;min-height:36px}.viewer-toolbar output{font-size:13px;min-width:34px}.viewer-toolbar .view-switch{display:none}.preview{width:100%;height:230px;min-height:0}.canvas-label{font-size:13px;padding:4px 6px;top:8px}.canvas-label.left{left:7px}.canvas-label.right{right:7px}.preview-note,.viewer-help{font-size:13px;margin:6px 0 0;line-height:1.45}.viewer-help{display:none}#quick-controls{margin-top:12px}#quick-controls .field{margin:10px 0}#quick-controls label{font-size:13px;display:block;margin-bottom:6px;font-weight:700}#quick-controls select{font-size:14px;width:100%;height:40px;border:1px solid var(--line);border-radius:8px;padding:8px;background:white}#quick-controls input[type=range]{width:100%;accent-color:var(--brand-primary);height:22px;margin:0}#quick-controls p{display:none}.file-name{max-width:170px}.file-list{max-height:125px}.file-list li{padding:7px 0}.file-list li>button:first-child{gap:7px}.drop.compact label{font-size:13px}.drop p{font-size:13px}.mobile-only{display:inline-flex!important}#action-bar{position:fixed;bottom:0;left:0;right:0;background:#fffffff5;border-top:1px solid var(--line);padding:10px 16px max(10px,env(safe-area-inset-bottom));z-index:20;box-shadow:0 -3px 20px #17233b12}#action-bar button{min-height:45px;padding:10px 12px;font-size:14px}#action-bar #convert{flex:1}#settings-panel{display:none;position:fixed;bottom:76px;left:12px;right:12px;max-height:70dvh;overflow:auto;overscroll-behavior:contain;z-index:19;box-shadow:0 0 0 100vmax #17233b55;padding:18px}#settings-panel.open{display:block}#settings-panel h2{display:flex;align-items:center}#close-settings{margin-left:auto;padding:5px 12px}#settings-panel .actions{margin-top:16px}.guide{font-size:14px;gap:20px}.guide h3{font-size:14px}.footer{font-size:13px}.footer nav{gap:13px}.ad-bottom{margin:32px auto}.home-hero h1{font-size:35px}}
/* Clip the mobile scroll surface above fixed actions so ads never sit behind
   a conversion/download button. This reserves physical, not cosmetic, space. */
#page-scroll{display:contents}
@media(max-width:760px){body{padding-bottom:0;overflow:hidden}#page-scroll{display:block;height:calc(100dvh - 76px - env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain}.step{font-size:13px}.settings .actions button{font-size:13px}}
/* Upload-result layout: UI-only revision authorized by converter review.
   Keep ads outside controls; removing this block restores the prior layout. */
.preview{min-height:0}
.has-images .hero{padding:12px 0}.has-images .hero h1{font-size:22px;margin:0}.has-images .hero p,.has-images .hero .badge{display:none}
.has-images #upload-panel{display:flex;align-items:center;gap:12px;min-width:0;padding-bottom:12px;border-bottom:1px solid var(--line)}
.has-images #upload-panel>h2{display:none}.has-images .drop.compact{order:2;flex:none;border:0;background:none;padding:0}
.has-images .file-list{display:flex;flex:1;gap:8px;min-width:0;max-height:64px;margin:0;overflow:auto}
.has-images .file-list li{flex:0 0 auto;max-width:100%;border:0;padding:0}.has-images .file-list small,.has-images .file-icon{display:none}
.has-images .file-list .file-name{max-width:280px}.has-images .file-list a{display:none}
#preview-panel{scroll-margin-top:8px}.has-images .preview-head{margin:12px 0 8px}
#action-bar #save-selected{background:var(--brand-primary);color:white;border-color:var(--brand-primary)}#action-bar #save-selected:hover{background:#3343C4}
.ad-settings{width:302px;height:274px;margin:28px auto 0;left:50%;transform:translateX(-50%)}.ad-settings .ad-slot{width:300px;height:250px;flex:none}
@media(min-width:1750px){.ad-settings{display:none}}
@media(max-width:760px){
 body:not(:has(#action-bar)){overflow:auto}body:not(:has(#action-bar)) #page-scroll{height:auto;overflow:visible}
 .has-images #upload-panel{padding:8px;gap:4px}.has-images .file-list .file-name{max-width:160px}.has-images .drop.compact label{padding:9px 7px}
 .has-images #preview-panel{padding:10px}.has-images .size-summary{padding-bottom:8px}.has-images .size-summary strong{font-size:20px;letter-spacing:-.7px}
 .has-images .preview-head{margin:0 0 6px!important}.has-images .preview-head .step{display:none}
 #quick-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:8px}#quick-controls .field{min-width:0;margin:0}#quick-controls select{font-size:13px;padding:6px}#quick-controls input[type=range]{height:40px}
 .ad-settings{display:none}
}
/* Goal controls and policy dialog own bounded UI state; no background navigation. */
.target-presets{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.target-presets button{font-size:13px;padding:7px}#target-fields>label{margin-top:10px}#target-result{font-size:14px;line-height:1.6;padding:10px;margin-top:10px;background:#edf4ff;border-radius:8px}#target-shrink{margin-top:8px;font-size:13px}.has-images .file-list small.error,.has-images .target-file-result{display:block;font-size:13px}
.policy-dialog{position:fixed;inset:0;width:min(820px,90vw);max-width:none;height:min(760px,88dvh);max-height:none;padding:0;border:1px solid var(--line);border-radius:16px;color:#17233b;background:#fff;box-shadow:0 24px 90px #10284740;overflow:hidden}.policy-dialog::backdrop{background:#14243c88}.policy-top{height:64px;display:flex;align-items:center;justify-content:space-between;padding:12px 22px;border-bottom:1px solid var(--line)}.policy-body{height:calc(100% - 64px);overflow:auto;overscroll-behavior:contain;padding:0 28px 24px}.policy-body .prose{padding:24px 0}.prose table{width:100%;border-collapse:collapse;font-size:14px}.prose th,.prose td{border:1px solid var(--line);padding:10px;text-align:left}.prose a{color:#245ac4;text-decoration:underline}.prose pre{overflow-wrap:anywhere}.policy-body h1{margin-top:0}.pending{background:#fff3dd;color:#7a4500;padding:12px;border-radius:8px}
@media(max-width:760px){#quick-controls #size-mode-field{grid-column:1/-1;order:3}#quick-controls #size-mode-field>label{display:none}#target-fields{padding-top:8px}#target-fields .row input{width:100%;min-width:0;padding:8px;border:1px solid var(--line);border-radius:8px}.policy-dialog{width:calc(100vw - 16px);height:calc(100dvh - 20px);border-radius:12px}.policy-top{padding:10px 16px}.policy-body{padding:0 18px 20px}.policy-body .prose{font-size:14px}.policy-body h1{font-size:24px}}
#source-note:empty{display:none}.policy-dialog pre{font-size:13px}.has-images .file-list:has(.target-file-result),.has-images .file-list:has(.error){max-height:90px}#target-fields .row input{width:100%;min-width:0}

/* Local converter format controls: readable on both layouts; hidden follows
   the native attribute, and every option remains keyboard reachable. */
.format-advice{font-size:13px;line-height:1.65;color:#243c5a;background:#edf5ff;padding:12px;border-radius:10px;margin:0 0 12px}
#format-options-field [data-format-controls]{margin:10px 0}
.icon-sizes{border:1px solid #cbd8e6;border-radius:8px;padding:10px;display:flex;flex-wrap:wrap;gap:12px}
.icon-sizes[hidden]{display:none}.icon-sizes legend{font-size:13px}.icon-sizes .check{margin:0}
@media(max-width:760px){#format-options-field{grid-column:1/-1;order:4}#quick-controls #compression-advice,#quick-controls #automatic-options{display:block}#format-options-field select{width:100%;font-size:14px;padding:10px}#format-options-field .check{font-size:13px}}

/* Measured alternatives remain separate from accepted output; mobile stacks
   cards above its existing action bar, and only explicit buttons apply them. */
.target-choices{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:16px 0}
.target-choice{min-width:0;padding:14px;border:1px solid #cbd8e6;border-radius:12px;background:#f8fbff}
.target-choice h3{font-size:15px;line-height:1.5;margin:0 0 10px}.target-choice img{width:100%;height:180px;object-fit:contain;background:#edf1f6;border-radius:6px}
.target-choice p{font-size:13px;line-height:1.7}.target-choice button{font-size:13px;width:100%;margin-top:7px;white-space:normal}
.target-choice [data-choice=resize]{background:var(--brand-primary);color:white}.target-choice button:disabled{opacity:.6}
@media(max-width:760px){.target-choices{grid-template-columns:1fr}.target-choice img{height:200px}}

/* Focused tools: real result and explicit save share the same accessible flow. */
.simple-picker{padding:20px;margin-bottom:20px}.simple-picker input[type=file]{max-width:100%;margin:12px 0}.simple-editor{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;scroll-margin-top:20px}.simple-stage,.simple-settings{padding:20px}.simple-stage img{display:block;max-width:100%;max-height:65vh;margin:auto;object-fit:contain}.simple-settings label{display:block;margin:14px 0}.simple-settings input:not([type=checkbox]),.simple-settings select{width:100%}.simple-actions{display:flex;gap:10px;margin:20px 0}#crop-canvas{width:auto;height:auto;max-width:100%;max-height:65vh;object-fit:contain;display:block;touch-action:none;cursor:crosshair}#simple-info{font-size:18px;font-weight:700}.simple-editor[hidden]{display:none}@media(max-width:760px){.simple-editor{display:flex;flex-direction:column}.simple-settings{order:-1}.simple-stage{padding:12px}.simple-actions{position:sticky;bottom:0;background:#fff;padding:12px;z-index:3}.simple-actions button{flex:1}.simple-stage img{max-height:55vh}}

@media(max-width:760px){body:has(.simple-editor:not([hidden])){padding-bottom:78px}.simple-settings{order:0;display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.simple-settings h2,.simple-settings p,.simple-settings>a{grid-column:1/-1}.simple-settings label{min-width:0}.simple-actions{position:fixed;left:0;right:0;bottom:0;margin:0;border-top:1px solid #d6deeb;box-shadow:0 -4px 16px #17243b12;z-index:25}}

.simple-settings input:not([type=checkbox]):not([type=range]),.simple-settings select{min-height:44px;border:1px solid #cbd5e1;border-radius:9px;padding:9px 10px;font:inherit;color:#17243b;background:#fff;margin-top:6px}.simple-settings input[type=range]{min-height:30px;accent-color:var(--brand-primary)}.simple-settings input:focus-visible,.simple-settings select:focus-visible{outline:3px solid #bfdbfe;outline-offset:2px}.simple-settings h2,.simple-stage h2{font-size:19px}.simple-settings label{font-size:14px;font-weight:600}.simple-settings .check{font-weight:400}.simple-settings p{font-size:13px;line-height:1.7}.tool-heading h1{font-size:32px;margin:12px 0}.tool-heading{padding:12px 0 16px}.simple-picker p{margin-bottom:0}.simple-picker:focus-within{outline:3px solid #bfdbfe}.simple-editor{margin-bottom:30px}
/* Original and saved crop remain in one viewport. Native dialog enlarges the
   actual saved image; narrow screens use a compact result with a large button. */
.crop-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,.4fr);gap:16px;align-items:start}.crop-source{min-width:0}.crop-source p{font-size:13px;margin:0 0 12px}.crop-stage #crop-canvas{max-height:65vh;margin:auto;outline-offset:3px}.crop-stage #simple-output{max-height:40vh}.simple-result{min-width:0}.simple-result h2{margin-top:0}.simple-result button{margin-top:12px}.resize-presets{display:flex;flex-wrap:wrap;gap:6px}.resize-presets button{font-size:13px;padding:8px;min-height:40px}#simple-dialog{border:0;border-radius:14px;padding:16px;max-width:94vw;max-height:92vh}#simple-dialog::backdrop{background:#10223ac9}#simple-large{display:block;max-width:88vw;max-height:78vh;object-fit:contain;margin-top:10px}.simple-stage img[hidden]{display:none}
@media(max-width:760px){.crop-stage{grid-template-columns:minmax(0,1fr);gap:10px}.crop-stage #crop-canvas{max-height:43vh}.crop-stage .simple-result{display:grid;grid-template-columns:1fr 90px;column-gap:10px;align-items:center}.crop-stage .simple-result h2{font-size:16px;margin:0}.crop-stage #simple-info{grid-column:1;font-size:14px;margin:6px 0}.crop-stage #simple-output{grid-column:2;grid-row:1/4;max-height:100px}.crop-stage #simple-enlarge{grid-column:1;justify-self:start;margin:0;min-height:40px}.resize-presets{grid-column:1/-1}}

/* Visible operation feedback shares the result card, including on mobile. */
.simple-result #simple-status{font-size:13px;line-height:1.5;margin:0 0 10px}.crop-stage .simple-result #simple-status{grid-column:1/-1}@media(max-width:760px){.crop-stage #simple-output{grid-row:2/5}}

/* B brand application: contrast-tested semantic colors, original 24px icon grid.
   No processing state is changed. Git restores this block and shared assets together. */
:root{--brand-primary:#4657E8;--brand-accent:#F46B45;--ink:#17233B;--muted:#58667B;--line:#DBE1EB;--green:var(--brand-primary);--success:#157347;--warning:#9A4600;--error:#B42336;color:var(--ink)}
:lang(ja){font-family:'Noto Sans JP','Noto Sans',Meiryo,system-ui,sans-serif}:lang(zh-TW){font-family:'Noto Sans TC','Noto Sans',system-ui,sans-serif}:lang(zh-CN){font-family:'Noto Sans SC','Noto Sans',system-ui,sans-serif}
.brand svg{width:36px;height:36px;flex:none}.brand-word{display:flex;flex-direction:column;line-height:1.15;letter-spacing:-.6px}.brand-word small{font-size:13px;font-weight:500;letter-spacing:0;color:var(--muted);margin-top:5px}
.tabs a{display:inline-flex;align-items:center;gap:8px}.tabs svg{width:19px;height:19px;flex:none}.tabs a[aria-current]{border-bottom-color:var(--brand-accent)}
.tool-icon{display:grid;width:50px;height:50px;place-items:center;background:#EEF0FF;border-radius:14px;color:var(--brand-primary)}.tool-icon svg{width:28px;height:28px}.tool:hover{border-color:var(--brand-primary);box-shadow:0 6px 22px #4657e810}.tool small{font-weight:700;color:var(--brand-primary)}
#action-bar #save-selected,.simple-actions #simple-save{background:var(--brand-accent);border-color:var(--brand-accent);color:var(--ink)}#action-bar #save-selected:hover,.simple-actions #simple-save:hover{background:#FF8B6B;border-color:#FF8B6B;color:var(--ink)}
input[type=range],.settings input[type=range],#quick-controls input[type=range]{accent-color:var(--brand-primary)}.size-summary{border-left:4px solid var(--brand-accent);padding-left:14px}.saving-badge{background:#DCFCE7;color:var(--success)}.saving-badge.increase{background:#FFF0D9;color:var(--warning)}.error{color:var(--error)}.home-hero .badge{background:#EEF0FF;color:var(--brand-primary)}
@media(max-width:760px){.tabs{gap:0}.tabs a{padding:13px 9px;gap:5px}.tabs svg{width:16px;height:16px}.brand-word small{font-size:13px}.brand{font-size:20px}.header .badge{display:none}.size-summary{padding-left:10px}}

/* Shared photo actions preserve explicit intent across tools. Undo is a real,
   bounded memory snapshot, never a cosmetic toast. No fixed layer covers ads. */
.photo-flow{margin:12px 0 0}.photo-actions{display:flex;flex-wrap:wrap;gap:8px}.photo-actions button{min-height:40px;font-size:13px;padding:8px 12px}.photo-origin{background:#fff0e5;border-left:3px solid var(--brand-accent);padding:10px;font-size:13px;line-height:1.6}.transfer-mode{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;margin:10px 0}.transfer-mode select{padding:8px;border:1px solid var(--line);border-radius:8px;background:white;color:inherit;max-width:100%}.photo-undo{position:fixed;bottom:100px;left:50%;transform:translateX(-50%);z-index:30;background:#17233b;color:white;padding:12px 16px;border-radius:12px;box-shadow:0 4px 20px #17233b33;max-width:calc(100vw - 24px);width:max-content;font-size:14px}.photo-undo button{color:#17233b;margin-left:8px}.incoming-choice{margin:12px 0}.incoming-choice button{font-size:13px}.simple-picker:has(.photo-flow){padding:12px 20px}.photo-origin button{font-size:13px;padding:5px 8px;margin-left:6px}@media(max-width:760px){.photo-actions{gap:6px}.photo-actions button{min-height:44px;padding:8px;font-size:13px}.photo-undo{font-size:13px;bottom:95px}.transfer-mode{font-size:13px}}
/* Global settings belongs to the common shell, distinct from per-photo settings.
   Native dialogs own focus/Escape; fixed mobile save controls remain reachable. */
.header-actions{display:flex;align-items:center;gap:12px}.global-settings-link{padding:9px 12px;font-size:13px}.save-actions{display:flex;flex-wrap:wrap;gap:8px}.settings-page{max-width:800px;width:100%}.settings-page h2{margin-top:28px}.settings-page select{display:block;padding:10px;border:1px solid var(--line);border-radius:8px;margin:8px 0 16px;background:white;color:var(--ink)}.settings-page label{font-size:15px}.settings-page input[type=checkbox]{width:18px;height:18px;accent-color:var(--brand-primary)}#stored-work{padding-left:20px}#stored-work li{margin:12px 0;overflow-wrap:anywhere}.vault-status{font-size:13px;color:var(--muted);line-height:1.6;margin:18px 0}.destination-dialog{max-width:min(560px,calc(100vw - 28px));padding:25px;border:1px solid var(--line);border-radius:16px;color:var(--ink);line-height:1.7}.destination-dialog::backdrop{background:#111b2e88}.destination-dialog h2{font-size:22px;margin-top:0}.destination-dialog p{font-size:14px}.settings-page .file-input{position:static;display:block;width:100%;height:auto;opacity:1;margin:12px 0}.storage-help{padding:24px 0}.storage-help h2{font-size:20px}
@media(max-width:760px){.header-actions{gap:0}.global-settings-link{padding:8px;gap:5px}.global-settings-link span{font-size:13px}.settings-page h1{font-size:26px}.save-actions button{min-height:44px}.destination-dialog{padding:20px}}

/* The old compact upload row now hosts a full-width shared action group. */
.has-images #upload-panel{flex-wrap:wrap;align-items:flex-start}.has-images #upload-panel .file-list{flex-basis:100%}.has-images #upload-panel .photo-flow,.has-images #upload-panel .incoming-choice{flex:1 1 100%;min-width:0}.has-images #upload-panel .drop.compact{position:absolute;width:1px;height:1px;overflow:hidden}.has-images #upload-panel .photo-flow{margin-top:0}.has-images #upload-panel .photo-actions{display:inline-flex}.has-images #upload-panel .transfer-mode{display:inline-flex;margin:0 0 0 14px}@media(max-width:760px){.has-images #upload-panel .transfer-mode{display:flex;margin:10px 0 0}.photo-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.photo-actions button{justify-content:center}}

/* Effect controls retain the common tool grid and mobile save bar. */
.filter-control{display:block;margin:10px 0}.filter-control output{float:right;font-variant-numeric:tabular-nums}.filter-control input{width:100%}.filter-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.filter-presets button{padding:4px;min-width:0;font-size:13px}.filter-presets img{display:block;width:100%;height:58px;object-fit:cover;border-radius:5px}.filter-presets button[aria-pressed=true]{outline:2px solid var(--brand-primary)}.view-tabs,.zoom-bar{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:8px 0}

.filter-presets button{display:flex;flex-direction:column;gap:4px}.filter-presets span{width:100%;text-align:center;overflow-wrap:normal;line-height:1.4}.filter-control input{display:block}.simple-settings:has(#filter-presets){align-self:start}@media(min-width:761px){.simple-settings:has(#filter-presets){max-height:80vh;overflow-y:auto}}
/* The divider is a hit area, not a solid stripe over the photo. */ button#compare-handle{background:transparent;border:0;padding:0;border-radius:0}

.ai-manager{margin:28px 0;max-width:800px}.ai-manager ul{list-style:none;padding:0}.ai-manager li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;overflow-wrap:anywhere}.ai-manager button{flex-shrink:0}#upscale-progress{width:100%}.destination-dialog progress{width:100%}

/* Shared choices and model table: controls keep 44px targets and overflow only
   within the table; selected states use the existing accessible theme tokens. */
.choice-row{display:flex;gap:8px;margin:10px 0}.choice-row button{flex:1;min-height:44px}.choice-row [aria-pressed=true]{outline:2px solid var(--brand-primary);outline-offset:1px}.ai-model-table{overflow-x:auto}.ai-model-table table{width:100%;font-size:14px}.ai-model-table th,.ai-model-table td{padding:12px;text-align:left;border-bottom:1px solid var(--line)}.ai-model-table td button{display:block;min-height:44px;white-space:nowrap;margin:4px 0}.ai-manager{margin:24px 0}.ai-manager [role=status]{overflow-wrap:anywhere}.toggle{display:flex;gap:8px;align-items:center}.toggle input{width:auto}

@media(max-width:760px){.ai-model-table thead{display:none}.ai-model-table table,.ai-model-table tbody{display:block}.ai-model-table tr{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:12px;margin:12px 0;padding:8px}.ai-model-table td{display:block;overflow-wrap:anywhere;border:0;padding:8px}.ai-model-table td::before{content:attr(data-label);display:block;font-weight:600;margin-bottom:4px}.ai-model-table .model-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}.ai-model-table .model-actions::before{display:none}.ai-model-table td:first-child,.ai-model-table td:nth-child(2),.ai-model-table td:nth-child(5){grid-column:1/-1}}

/* Model actions share destructive semantics across desktop tables/mobile cards.
   Wrapping the group never breaks a size value or stacks export/delete at desktop. */
.ai-model-table td:nth-child(3){white-space:nowrap;overflow-wrap:normal}
.model-action-group{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ai-model-table td .model-action-group button,.ai-manager .model-danger{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.ai-manager .model-danger{color:var(--error);border-color:var(--error)}
.model-danger svg{flex:none}.ai-model-table td{vertical-align:top}
#upscale-timing{font-size:13px;line-height:1.6}#upscale-timing small{display:block;font-size:13px;color:var(--muted)}

.model-action-group{min-width:190px}.model-action-group button[data-path-copy]{order:1;flex-basis:100%}

.ai-manager{max-width:1120px}.ai-model-table td{word-break:keep-all}.ai-model-table td:nth-child(4){white-space:nowrap}

/* All bulk deletions share the same semantic color/icon, including overlays.
   Mutation and confirmation stay in their existing data/photo/model owners. */
button.danger-action,button.danger-action:hover{color:var(--error);border-color:var(--error)}
button.danger-action svg{flex:none;width:16px;height:16px}

/* Locally hosted OFL font subsets: only the active script is downloaded.
   Missing/new glyphs fall back to the OS font; no text is sent to a font CDN.
   Source URLs, original hashes and redistribution licenses are in vendor-fonts. */
@font-face{font-family:'Miru Sans';src:url('/assets/immutable/NotoSans-f5271bc062ec80f5.woff2') format('woff2');font-weight:100 900;font-display:swap;unicode-range:U+0000-024E}
@font-face{font-family:'Miru KR';src:url('/assets/immutable/NotoSansKR-d6d0098913236549.woff2') format('woff2');font-weight:100 900;font-display:swap;unicode-range:U+1100-11FF,U+3130-318F,U+AC00-D7AF,U+3000-303F}
@font-face{font-family:'Miru JP';src:url('/assets/immutable/NotoSansJP-94e741513c462341.woff2') format('woff2');font-weight:100 900;font-display:swap;unicode-range:U+3000-30FF,U+3400-9FFF,U+FF00-FFEF}
@font-face{font-family:'Miru TC';src:url('/assets/immutable/NotoSansTC-20d74c8c077b2562.woff2') format('woff2');font-weight:100 900;font-display:swap;unicode-range:U+3000-30FF,U+3400-9FFF,U+FF00-FFEF}
@font-face{font-family:'Miru SC';src:url('/assets/immutable/NotoSansSC-6d0d7441d5090f19.woff2') format('woff2');font-weight:100 900;font-display:swap;unicode-range:U+3000-30FF,U+3400-9FFF,U+FF00-FFEF}
:root{font-family:'Miru Sans','Miru KR','Noto Sans KR',system-ui,'Malgun Gothic',sans-serif}
:lang(en){font-family:'Miru Sans',system-ui,sans-serif}
:lang(ja){font-family:'Miru Sans','Miru JP','Noto Sans JP',Meiryo,system-ui,sans-serif}
:lang(zh-TW){font-family:'Miru Sans','Miru TC','Noto Sans TC',system-ui,sans-serif}
:lang(zh-CN){font-family:'Miru Sans','Miru SC','Noto Sans SC',system-ui,sans-serif}
/* Phrase boundaries belong to the translated hero, not browser segmentation.
   Japanese stays two lines even without auto-phrase; fluid type keeps its
   twelve-character first phrase inside a 320px viewport. No copy is changed. */
:lang(ko){word-break:keep-all;overflow-wrap:break-word}
:lang(ja),:lang(zh){line-break:strict}
:lang(en) :is(h1,h2,h3,button,.button){text-wrap:balance}
:lang(ja) :is(h1,h2,h3,button,.button){word-break:normal}
@supports(word-break:auto-phrase){:lang(ja) :is(h1,h2,h3,button,.button){word-break:auto-phrase}}
:lang(ja) .home-hero h1{font-size:clamp(24px,3.1vw,44px);letter-spacing:-.03em}
:lang(ja) .hero-phrase{white-space:nowrap}
.hero-copy{min-width:0;max-width:100%}
@media(max-width:760px){
 :lang(ja) .home-hero h1{font-size:clamp(22px,7.2vw,44px);line-height:1.35}
 :lang(en) .home-hero h1{font-size:clamp(28px,9vw,38px)}
}
/* Keep common header labels horizontal at the narrowest supported width. */
@media(max-width:360px){
 :root .header{height:auto;min-height:68px;padding-block:8px}
 .header .wrap{height:auto;padding-inline:10px;gap:8px;flex-wrap:wrap}
 .header .header-actions{margin-left:auto}
 .header-actions #work-list-open{white-space:nowrap}
 /* A 300px ad slot fits the viewport at 320px, but not its padded content.
    Center the reserved container within the viewport; preserve slot dimensions. */
 .ad-bottom{width:min(324px,100vw);margin-inline:calc((100% - min(324px,100vw))/2)}
}

/* Option 4 semantic skin. Layout/codec ownership stays in existing components.
   Explicit themes share contracts; preview is neutral dark in either mode.
   Revert this sheet + brand assets to roll back without touching photo state. */
:root{--mark:#FFFFFF;--hero-a:#FF6345;--hero-b:#FF8BAA;color-scheme:dark;--canvas:#080C16;--surface:#111725;--surface-raised:#1A2334;--ink:#F5F6FA;--muted:#B4BED0;--line:#65748C;--accent:#FF8BAA;--accent-wash:#352033;--button:#FF286D;--button-ink:#080C16;--success:#7EE0B6;--success-bg:#16372D;--warning:#FFD180;--warning-bg:#352B17;--error:#FFB5A3;--error-bg:#3B241E;--brand-primary:var(--accent);--brand-accent:var(--accent);--green:var(--accent);background:var(--canvas);color:var(--ink)}
:root[data-theme=light]{--mark:#080C16;--hero-a:#B7341F;--hero-b:#B9144D;color-scheme:light;--canvas:#F5F6F9;--surface:#FFFFFF;--surface-raised:#EBEDF3;--ink:#080C16;--muted:#515D70;--line:#7A8496;--accent:#B9144D;--accent-wash:#FCE8EF;--button:#FF286D;--button-ink:#080C16;--success:#176A48;--success-bg:#E4F7ED;--warning:#825000;--warning-bg:#FFF1D8;--error:#A9271A;--error-bg:#FFF0E9}
body{background:var(--canvas);color:var(--ink)}.header,.card,#upload-panel,#preview-panel,.policy-dialog,.destination-dialog,#simple-dialog,#settings-panel,.simple-actions,#action-bar{background:var(--surface);color:var(--ink);border-color:var(--line)}
button,.button,input:not([type=range]):not([type=checkbox]),select,.settings select,.settings input[type=number],.settings input[type=text],#quick-controls select,#target-fields .row input,.simple-settings input:not([type=checkbox]):not([type=range]),.simple-settings select,.settings-page select,.transfer-mode select{background:var(--surface);color:var(--ink);border-color:var(--line)}
button:hover,.button:hover{background:var(--surface-raised);border-color:var(--accent)}
.primary,.primary:hover,.target-choice [data-choice=resize]{background:var(--accent);border-color:var(--accent);color:var(--canvas)}
#action-bar #save-selected,.simple-actions #simple-save,#action-bar #save-selected:hover,.simple-actions #simple-save:hover{background:linear-gradient(110deg,#FF6345,#FF286D);border-color:#FF286D;color:var(--button-ink)}
.brand{color:var(--ink);gap:9px}.brand svg{width:40px;height:40px}.brand-word{font-size:27px;letter-spacing:-1.3px;font-weight:800}.brand-word small{font-size:12px;letter-spacing:.6px}.brand-kit,.hero-mark b{color:#FF286D}
#theme-toggle{width:40px;height:40px;padding:0;font-size:23px;line-height:1;flex:none}.header-actions{gap:8px}.header .badge{background:transparent;color:var(--muted)}
.badge,.home-hero .badge,.tool-icon,.file-icon,.file-list li.selected,.notice,#target-result,.format-advice,.photo-origin{background:var(--accent-wash);color:var(--accent);border-color:var(--line)}
.drop,.empty-preview,.target-choice{background:var(--surface-raised);color:var(--ink);border-color:var(--line)}.drop.drag{background:var(--accent-wash);border-color:var(--accent)}
.guide h2,.guide h3,.prose h1,.prose h2,.prose h3{color:var(--ink)}.prose a,.eyebrow,.home-hero .eyebrow,.tool small,.tool b,.value,.tabs a[aria-current]{color:var(--accent)}.tabs a[aria-current]{border-color:var(--accent)}
.home-hero p,.hero p,.prose p,.tool p,.guide,.tiny,.status,.footer,.preview-note,.viewer-help,.size-summary #size-kind,.size-arrow,.brand-word small,.vault-status{color:var(--muted)}
/* Savings is a success state, not a brand accent; increasing bytes stays amber. */
.saving-badge{background:var(--success-bg);color:var(--success)}.saving-badge.increase,.pending,#action-bar #cancel{background:var(--warning-bg);color:var(--warning)}.error,.status.error,.prose .error{color:var(--error)}.error:not(:empty)::before{content:'⚠ ';font-weight:700}
.ad{background:transparent;border-color:var(--line)}.ad>span{color:var(--muted)}
.preview,.picture,.target-choice img,#simple-output,#simple-large,#crop-canvas{background:repeating-conic-gradient(#272B33 0% 25%,#30353E 0% 50%) 50%/18px 18px;border-color:var(--line)}.canvas-label{background:#111725;color:#F5F6FA}#compare-handle span{background:#080C16;color:#FFF}
.photo-undo{background:var(--surface-raised);color:var(--ink);border:1px solid var(--line)}.photo-undo button{color:var(--ink)}.file-list li,.icon-sizes{border-color:var(--line)}
input[type=range],input[type=checkbox],.settings input[type=range],#quick-controls input[type=range],.simple-settings input[type=range]{accent-color:var(--accent)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,.simple-settings input:focus-visible,.simple-settings select:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.drop:focus-within,.simple-picker:focus-within{outline-color:var(--accent)}
.home-hero{display:grid;grid-template-columns:1.3fr 1fr;align-items:center;gap:40px;padding:65px 0 55px}.home-hero h1{font-size:clamp(38px,4.5vw,64px);font-weight:800;line-height:1.2;letter-spacing:-2px;margin:18px 0 24px}.home-hero .eyebrow{font-size:12px;letter-spacing:2px}.home-hero .badge{display:inline-block;margin-top:12px}.brand-highlight{background:linear-gradient(100deg,var(--hero-a),var(--hero-b));color:transparent;background-clip:text}
.hero-mark{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px;color:var(--ink)}.hero-mark svg{width:210px;height:210px}.hero-mark>span{font-size:40px;font-weight:850;letter-spacing:-2px;margin-top:10px}.hero-mark b{font-weight:inherit}.tools{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.tool{padding:25px}.tool h2{font-size:19px}.tool p{min-height:72px}.tool:hover{border-color:var(--accent);box-shadow:none}.tool-icon{width:48px;height:48px}
@media(max-width:1000px){.tools{grid-template-columns:repeat(2,minmax(0,1fr))}.home-hero{gap:16px}.hero-mark svg{width:180px;height:180px}}
@media(max-width:760px){.header{height:68px}.brand-word{font-size:23px}.brand svg{width:36px;height:36px}.header-actions{gap:6px}.global-settings-link{padding:8px}.global-settings-link span{display:none}.home-hero{display:flex;flex-direction:column-reverse;align-items:flex-start;gap:18px;padding:26px 0 30px}.hero-mark{padding:0;flex-direction:row;gap:14px}.hero-mark svg{width:80px;height:80px}.hero-mark>span{font-size:33px;margin:0}.home-hero h1{font-size:38px;margin:14px 0 18px}.home-hero p{font-size:14px}.home-hero .eyebrow{font-size:10px}.tools{grid-template-columns:1fr;gap:12px}.tool{padding:22px}.tool p{min-height:0}.tool-icon{float:right;width:44px;height:44px}.tool h2{margin:4px 0 12px}.tabs a{padding:13px 8px}.tabs a svg{width:16px}.brand-word small{font-size:11px}.header .badge{display:none}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Mark color is literal white/navy; UI accents retain AA-adjusted tones. */
.brand svg,.hero-mark svg{color:var(--mark)}

/* Animate the palette once at its owner. Children inherit the same frame,
   avoiding stacked color transitions and instant gradient swaps. */
@property --canvas{syntax:"<color>";inherits:true;initial-value:#080C16}
@property --surface{syntax:"<color>";inherits:true;initial-value:#111725}
@property --surface-raised{syntax:"<color>";inherits:true;initial-value:#1A2334}
@property --ink{syntax:"<color>";inherits:true;initial-value:#F5F6FA}
@property --muted{syntax:"<color>";inherits:true;initial-value:#B4BED0}
@property --line{syntax:"<color>";inherits:true;initial-value:#65748C}
@property --accent{syntax:"<color>";inherits:true;initial-value:#FF8BAA}
@property --accent-wash{syntax:"<color>";inherits:true;initial-value:#352033}
@property --button{syntax:"<color>";inherits:true;initial-value:#FF286D}
@property --button-ink{syntax:"<color>";inherits:true;initial-value:#080C16}
@property --success{syntax:"<color>";inherits:true;initial-value:#7EE0B6}
@property --success-bg{syntax:"<color>";inherits:true;initial-value:#16372D}
@property --warning{syntax:"<color>";inherits:true;initial-value:#FFD180}
@property --warning-bg{syntax:"<color>";inherits:true;initial-value:#352B17}
@property --error{syntax:"<color>";inherits:true;initial-value:#FFB5A3}
@property --error-bg{syntax:"<color>";inherits:true;initial-value:#3B241E}
@property --mark{syntax:"<color>";inherits:true;initial-value:#FFFFFF}
@property --hero-a{syntax:"<color>";inherits:true;initial-value:#FF6345}
@property --hero-b{syntax:"<color>";inherits:true;initial-value:#FF8BAA}
@media(prefers-reduced-motion:no-preference){
 :root[data-theme-ready]{transition-property:--canvas,--surface,--surface-raised,--ink,--muted,--line,--accent,--accent-wash,--button,--button-ink,--success,--success-bg,--warning,--warning-bg,--error,--error-bg,--mark,--hero-a,--hero-b;transition-duration:300ms;transition-timing-function:ease}
 :root[data-theme-ready] .theme-sun,:root[data-theme-ready] .theme-moon{transition:opacity 300ms ease}
}
/* Stable SVG geometry; both theme glyphs share the same 300 ms color/opacity clock. */
.theme-moon{opacity:0}.theme-sun{opacity:1}
:root[data-theme=light] .theme-moon{opacity:1}:root[data-theme=light] .theme-sun{opacity:0}
.runtime-downloads{position:fixed;right:16px;bottom:90px;z-index:160;max-width:360px;width:calc(100% - 32px);max-height:45vh;overflow:auto}
.runtime-downloads:empty{display:none}.runtime-downloads section{padding:16px;margin-top:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);box-shadow:0 8px 28px #0005}
.runtime-downloads progress{width:100%;margin-top:12px;accent-color:var(--accent)}.runtime-downloads p{font-size:13px;margin:8px 0}
@media(prefers-reduced-motion:reduce){
 :root,:root *,:root *::before,:root *::after{transition:none!important}
}
/* One explicit locale menu across tools; overlay never pushes editor geometry. */
.language-menu{position:relative;font-size:13px;white-space:nowrap}.language-menu summary{cursor:pointer;list-style:none;padding:9px;border:1px solid var(--line);border-radius:8px}.language-menu nav{position:absolute;top:100%;right:0;z-index:80;min-width:130px;padding:8px;background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 30px #0005}.language-menu nav a{display:block;padding:10px;color:var(--ink)}.language-suggestion{display:flex;justify-content:center;align-items:center;gap:12px;padding:8px;background:var(--surface-raised);font-size:13px}.language-suggestion button{padding:2px 8px}.language-suggestion a{color:var(--accent)}
@media(max-width:600px){.header .brand{gap:5px}.header .brand svg{width:28px;height:28px}.header .brand-word{font-size:20px}.header .brand-word small{display:none}.header-actions{gap:4px}.header-actions #work-list-open{font-size:13px;padding:8px}.language-menu{font-size:13px}.language-menu summary{padding:8px}.global-settings-link{padding:6px}}
/* Mobile controls keep real, non-overlapping 44px hit boxes. Appearance only:
   labels retain native checkbox activation; no photo/settings state is changed.
   Remove this block to restore the previous sizing contract. */
@media(max-width:760px){
 :root .header{height:auto;min-height:68px;padding-block:8px}
 .header .wrap{height:auto;flex-wrap:wrap;gap:8px}
 .header .header-actions{margin-left:auto;flex:none}
 .header-actions #work-list-open,.language-menu summary{font-size:13px;min-height:44px;white-space:nowrap}
 .language-menu summary{display:flex;align-items:center;justify-content:center}
 .header #theme-toggle,.global-settings-link{min-width:44px;width:44px;min-height:44px;height:44px;justify-content:center}
 .language-menu nav a{min-height:44px;display:flex;align-items:center}
 .language-suggestion{gap:8px}
 .language-suggestion span{min-width:0}
 .language-suggestion a,.language-suggestion button{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;flex-shrink:0}
 .viewer-toolbar button,.zoom-bar button{min-width:44px;min-height:44px;white-space:nowrap;flex-shrink:0;padding:8px}
 .viewer-toolbar>div{flex-wrap:wrap}
 .viewer-toolbar output,.zoom-bar #zoom-value{min-width:34px;font-size:13px}
 label:has(input[type=checkbox]),.check{min-height:44px;min-width:44px;cursor:pointer}
 input[type=checkbox],.settings-page input[type=checkbox]{width:22px;height:22px;flex:0 0 22px}
}

/* Compact shared rows; popup and undo occupy the top layer, never document flow.
   Originals and retention belong to storage.js; these styles only present them. */
.work-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(640px,95vw);max-width:none;height:100dvh;max-height:none;overflow:auto;border:1px solid var(--line);background:var(--surface);color:var(--ink);padding:24px;overscroll-behavior:contain}
.work-drawer::backdrop{background:#080c1688}.work-top{display:flex;justify-content:space-between;align-items:center;gap:12px;position:sticky;top:-24px;background:var(--surface);z-index:1;padding:14px 0}.work-top h2{font-size:23px;margin:0}.work-stats{font-size:14px;color:var(--ink)}.work-notice,.mirror-status{font-size:13px;line-height:1.7;color:var(--muted)}
.work-item{display:grid;grid-template-columns:40px minmax(0,1fr) auto auto;align-items:center;gap:10px;min-height:62px;padding:8px 0;border-bottom:1px solid var(--line);position:relative}
.work-item>img,.work-thumbnail-empty{width:40px;height:40px;object-fit:contain;border-radius:6px;background:#282d36}.work-thumbnail-empty{display:flex;align-items:center;justify-content:center;color:#fff;font-size:10px}
.work-name{display:flex;font-size:14px;line-height:22px;white-space:nowrap;overflow:hidden;min-width:0}.work-name-prefix{min-width:0;overflow:hidden}.work-name-tail{flex:none}.work-time{font-size:13px;color:var(--muted);white-space:nowrap}.work-actions{display:flex;gap:4px;align-items:center}.work-actions button{font-size:13px;min-height:40px;padding:6px 10px}.work-actions .work-more{font-size:22px;min-width:40px;padding:2px 8px}.work-delete-all{margin-top:20px}
.recent-work{width:100%;margin-top:12px;border-top:1px solid var(--line)}.recent-work>summary{cursor:pointer;padding:12px 0;font-size:14px;font-weight:600}.recent-work>button{margin-top:10px;font-size:13px}.has-images .recent-work{display:none}
.work-popup{position:fixed;inset:auto;margin:0;z-index:10000;width:236px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:6px;box-shadow:0 12px 38px #0006}
.work-popup button{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;min-height:44px;border:0;background:transparent;text-align:left;padding:10px 12px;font-size:14px;border-radius:7px;white-space:normal;line-height:1.5}.work-popup button:hover,.work-popup button:focus-visible{background:var(--surface-2,#80808020);outline:2px solid var(--accent);outline-offset:-2px}.work-popup hr{border:0;border-top:1px solid var(--line);margin:6px 4px}.work-popup svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;flex:none}
.danger,.work-popup .danger{color:var(--error)}.work-popup .danger:hover{background:#d0303020}html[data-theme=light] .danger{color:var(--error)}
.work-toast{display:none;position:fixed;inset:auto 16px 92px auto;margin:0;max-width:calc(100vw - 32px);z-index:10001;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);box-shadow:0 8px 32px #0006;align-items:center;gap:16px;font-size:14px}.work-toast.visible{display:flex}.work-toast button{min-height:40px;white-space:nowrap;color:var(--accent)}
.work-sr-name{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.tool-help>summary,.storage-help>details>summary{font-size:16px;font-weight:600;cursor:pointer;padding:16px 0}.storage-help details details{border-top:1px solid var(--line);padding:14px 0}.storage-help summary{cursor:pointer;font-weight:600}.storage-help details p{font-size:14px}.tool-help .guide{margin-top:16px}
/* Empty tools offer input first. Format preselection remains available;
   unavailable preview and saving controls return only after a photo is loaded. */
body:not(.has-images) #preview-panel,body:not(.has-images) #action-bar{display:none}
.tabs{overflow-x:auto;white-space:nowrap}.tabs>a{flex-shrink:0}
/* Shared tool frame: the task's primary settings stay visible, secondary
   controls disclose on demand. No data or encoder contract changes here. */
.workspace,.simple-editor{align-items:start;grid-template-columns:minmax(0,1fr) 320px;gap:24px}.workspace>#source-panel,.simple-stage{align-self:start;min-width:0}
.photo-chips,.has-images .photo-chips.file-list{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0;padding:0;max-height:140px;overflow:auto;flex:1 1 auto}
.photo-chips li,.has-images .photo-chips.file-list li{display:flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:9px;padding:2px 4px 2px 10px;max-width:100%;background:var(--surface)}
.photo-chips li.selected{border-color:var(--accent)}.photo-chip-name{font-size:13px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:260px;color:var(--ink)}button.photo-chip-name{background:none;border:0;padding:5px 0;min-height:36px}.photo-chips .remove{min-width:36px;min-height:36px;border:0;padding:4px;background:transparent;color:var(--muted)}.photo-chip-note{font-size:13px;color:var(--error);white-space:normal}
.photo-flow{margin:8px 0 0}.photo-actions{display:flex;gap:8px;align-items:center}.photo-actions [data-photo=menu]{font-size:22px;min-width:40px;padding:0 10px}.photo-origin{border:0;background:none;padding:0;margin:6px 0;color:var(--muted)}.has-images #upload-panel .photo-flow{flex:0 1 auto}.has-images #upload-panel .photo-chips{flex-basis:auto}
.simple-stage .simple-picker{grid-column:1/-1;margin:0 0 16px;padding:0 0 12px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent}.simple-stage .simple-picker #simple-status:empty{display:none}
.simple-settings,.settings{padding:20px}.simple-settings h2,.settings h2{font-size:16px;margin:0 0 18px}.simple-settings label{font-size:13px;font-weight:600}.simple-settings p{font-size:13px;line-height:1.6}.simple-settings input:not([type=checkbox]),.simple-settings select{min-height:42px;border:1px solid var(--line);border-radius:8px;padding:8px;background:var(--surface);color:var(--ink)}
.tool-extra,#extra-settings{border-top:1px solid var(--line);margin-top:18px;padding:12px 0}.tool-extra>summary,#extra-settings>summary{font-size:14px;font-weight:600;cursor:pointer;padding:6px 0}.tool-extra[open]>summary,#extra-settings[open]>summary{margin-bottom:14px}.simple-actions,#action-bar{display:flex;gap:8px;margin:16px 0 0}.simple-actions .primary,#action-bar .primary{flex:1;min-height:46px;font-size:14px}
.is-compress #size-mode-field>label,.is-compress #size-mode{display:none}.is-compress #target-fields>label{font-size:16px;margin:0 0 10px}.is-compress #target-size{font-size:20px;font-weight:700}.is-compress #size-mode-field{margin-bottom:24px}
.preview[data-detail=source] .canvas-label.right,.preview[data-detail=source] #compare-handle,.preview[data-detail=source] #after{display:none}.preview[aria-busy=true]{outline:1px solid var(--accent)}
@media(max-width:760px){
 /* A single scrollable row keeps the photo visible. Fades reflect actual
    scroll position from common.js; links remain usable without JavaScript. */
 .tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;gap:0;scrollbar-width:thin;mask-image:linear-gradient(to right,transparent,#000 var(--tab-fade-left,0px),#000 calc(100% - var(--tab-fade-right,0px)),transparent)}
 .tabs[data-scroll-left]{--tab-fade-left:16px}.tabs[data-scroll-right]{--tab-fade-right:16px}
 .tabs>a{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:5px;padding:12px 10px;font-size:13px;min-width:44px;min-height:48px;white-space:nowrap}.tabs>a svg{width:18px;height:18px}
 #settings-panel{display:block;position:static;width:auto;max-height:none;overflow:visible;box-shadow:none;margin:14px 0;padding:16px;z-index:auto}#close-settings{display:none!important}
 body:not(.has-images) #settings-panel{display:none}.simple-settings{display:block;order:0;padding:16px}.simple-stage{padding:12px}.simple-stage .simple-picker{padding:0 0 10px}.photo-chips{width:100%}.photo-chip-name{max-width:230px}.photo-actions{display:flex}.photo-origin{font-size:13px}
 .simple-actions,#action-bar{position:fixed;inset:auto 0 0;margin:0;padding:10px 16px max(10px,env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line);z-index:25;box-shadow:0 -3px 20px #0002}.simple-actions button,#action-bar button{min-height:45px;font-size:14px;padding:10px 12px}.simple-actions .primary,#action-bar .primary{flex:1}
 body:not(.has-images) #page-scroll{height:100dvh}body.has-images:has(.simple-editor) #page-scroll{display:block;height:calc(100dvh - 76px - env(safe-area-inset-bottom));overflow:auto}body.has-images:has(.simple-editor){overflow:hidden;padding-bottom:0}
}
@media(max-width:760px){.work-drawer{width:100vw;padding:16px}.work-top{top:-16px}.work-item{gap:6px}.work-actions button{padding:6px;min-width:36px}.work-actions .work-more{min-width:36px}.work-name{font-size:13px}.work-time{font-size:13px}.work-toast{inset:auto 12px 86px 12px;max-width:none;justify-content:space-between}.header .brand-word small{display:none}#work-list-open{font-size:13px;padding:8px;min-height:40px}.header .brand-word{font-size:20px}.header .brand svg{width:28px;height:28px}.header .brand{gap:5px}.header .wrap{gap:8px}.header-actions{gap:4px}.tabs a{padding:13px 8px}}

/* Loaded work keeps the photo first. These presentation rules neither alter
   image data nor permissions; removing them restores the previous spacing. */
.has-images .tool-heading{padding:12px 0}.has-images .tool-heading h1{font-size:22px;margin:0}.has-images .tool-heading .eyebrow,.has-images .tool-heading>p{display:none}
.has-images .simple-stage .simple-picker{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.has-images .simple-stage .simple-picker .photo-flow{margin:0;flex:0 1 auto}.simple-picker #simple-status{flex-basis:100%}
#alternative-options{margin:16px 0;border-top:1px solid var(--line);padding-top:12px}#alternative-options>summary{cursor:pointer;font-size:14px;font-weight:600}

/* Flex-column mobile tools must stretch both preview and settings equally. */
@media(max-width:760px){.simple-editor{align-items:stretch}.simple-stage{align-self:stretch}.has-images .simple-stage .simple-picker .photo-chips{width:auto;flex:1 1 180px}}

/* Worker events drive these six phases; no timer invents completion. */
#target-progress{margin:12px 0 16px;padding:10px 12px;background:var(--surface);border:1px solid var(--line);border-radius:9px}#target-progress-label{display:block;font-size:14px;margin-bottom:6px}#target-progress-bar{display:block;width:100%;height:10px;accent-color:var(--accent)}

/* One visible size method; native buttons remain keyboard accessible. Help stays
   in the page's existing scroll container after image upload on mobile. */
.resize-methods{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;grid-column:1/-1}.resize-methods button{font-size:13px;padding:10px 4px;min-height:44px;white-space:nowrap}.resize-methods button[aria-pressed=true]{color:var(--accent);border-color:var(--accent);background:var(--accent-wash)}.resize-panel{grid-column:1/-1;min-width:0}#resize-panel-pixels{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}#resize-panel-pixels .check{grid-column:1/-1}#tool-guide{scroll-margin-top:16px;margin-bottom:24px}#tool-guide .tool-guide-content{padding-top:8px;max-width:850px}#tool-guide li{line-height:1.9;margin-bottom:12px}#simple-help{display:block;padding:12px 0;color:var(--accent);text-decoration:underline}

/* The incoming recipe is secondary to the photo and wraps without moving controls off-screen. */
.photo-applied{flex:1 0 100%;margin:6px 0 0;display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;color:var(--ink)}.photo-applied[hidden]{display:none}.photo-applied button{min-height:40px;font-size:13px;padding:6px 12px}

/* Read-only policy records: preserve table relationships on desktop; stack each
   provider/component on narrow screens. No horizontal page overflow or tool CSS
   changes; removal restores the original prose presentation. */
.policy-records{width:100%;table-layout:fixed}
.policy-records th,.policy-records td{overflow-wrap:anywhere;vertical-align:top}
.policy-records caption{text-align:left;font-weight:700;margin:18px 0}
.license-summary code{overflow-wrap:anywhere;white-space:normal}
.license-summary details{margin:20px 0}
.license-summary a,.policy-records a{text-decoration:underline;text-underline-offset:3px}
.prose pre{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}
@media(max-width:680px){
 .policy-records caption{display:block;width:100%}
 .policy-records,.policy-records tbody{display:block;width:100%}
 .policy-records thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .policy-records tr{display:block;margin:14px 0;border:1px solid var(--line);border-radius:12px;padding:12px}
 .policy-records td,.policy-records tbody th{display:block;width:auto;border:0;padding:8px 0;text-align:left}
 .policy-records [data-label]::before{content:attr(data-label);display:block;font-weight:700;color:var(--muted);margin-bottom:5px;font-size:13px}
}
