/* Comfortable shared scale. Keep document geometry and worker limits independent. */
body:has(#oto-screen){font-size:16px;line-height:1.5}
body:has(#oto-screen) .topbar.oto-header{height:64px;min-height:64px;gap:20px}
body:has(#oto-screen) .oto-header .brand img{width:38px;height:38px}
body:has(#oto-screen) .oto-header .brand a>span{font-size:13px}
body:has(#oto-screen) .oto-header .brand strong{font-size:25px}
body:has(#oto-screen) .oto-header .primary-nav-link{font-size:15px;min-height:44px;padding:9px 12px}
body:has(#oto-screen) .oto-header .nav-count{font-size:12px}
body:has(#oto-screen) .oto-header .icon-button{width:42px;height:42px}
body:has(#oto-screen) .oto-header .icon-button svg{width:21px;height:21px}
body:has(#oto-screen .merge-workspace) .main{height:calc(100dvh - 64px);min-height:520px;padding:18px 28px 0}
body:has(#oto-screen .merge-workspace) .footer{font-size:12px;min-height:26px;gap:10px}
.merge-heading{min-height:86px;gap:16px;margin-bottom:16px}
.merge-heading>img{width:68px;height:68px;flex:none}
.merge-heading h1{font-size:30px;line-height:1.2}
.merge-heading p{font-size:15px;line-height:1.5;margin-top:5px}
.merge-benefits{font-size:13px;gap:8px 16px;margin-top:7px}
.merge-capacity{font-size:13px;line-height:1.6}
.merge-capacity strong{font-size:16px}
.merge-heading>div{min-width:0}
.merge-capacity{flex-shrink:0;max-width:360px;white-space:normal}
.merge-capacity small{display:block;font-size:12px;line-height:1.5;margin-top:3px;overflow-wrap:anywhere}
@media(max-width:700px){
 .merge-heading{flex-wrap:wrap}
 .merge-heading>div{flex:1;min-width:0}
 .merge-heading .merge-capacity{display:block;flex-basis:100%;max-width:none;margin:0;text-align:left;border-top:1px solid var(--oto-border);padding-top:8px}
 .merge-capacity strong{margin-top:1px}
}
.merge-drop{min-height:370px;padding:22px;gap:10px;flex:1 0 auto}
.workspace-feature-icon{display:block;width:160px;height:160px;object-fit:contain;flex:none;background:radial-gradient(ellipse at center,var(--oto-icon-bed) 0 48%,transparent 72%);filter:drop-shadow(0 4px 3px color-mix(in srgb,var(--oto-shadow-ink) 22%,transparent))}
.merge-drop h2{font-size:clamp(24px,2.2vw,32px);line-height:1.25;max-width:780px;margin:0;text-wrap:balance}
.merge-drop p{font-size:16px;line-height:1.5;margin:0;text-wrap:balance}
.merge-drop small,.merge-drop .merge-trust{font-size:14px;line-height:1.5}
.merge-drop>.button.primary{font-size:17px;min-height:52px;min-width:220px;padding:12px 28px;margin:4px 0}
.merge-workspace button,.merge-workspace input,.merge-workspace select{font:inherit}
.merge-workspace .button{font-size:15px;min-height:44px;padding:9px 14px}
.merge-workspace input:not([type=checkbox]),.merge-workspace select{font-size:16px;min-height:44px}
.merge-editor{grid-template-columns:minmax(0,1fr) 320px;gap:24px}
.merge-toolbar h2,.merge-flow h2{font-size:20px;line-height:1.3}
.merge-toolbar small,.merge-sort,.merge-sort label,.workspace-hint{font-size:14px;line-height:1.5}
.merge-sort{flex-wrap:wrap;gap:10px}
.merge-sort select{font-size:15px;min-height:40px}
.merge-toolbar-actions{gap:8px}
.merge-panel{padding:20px}
.merge-panel label,.merge-settings-content label{font-size:15px;line-height:1.5;margin:10px 0 6px}
.merge-settings-content small,.workspace-range-help,.merge-settings-content p,.merge-advanced,.pdf-advanced,.merge-panel .merge-trust,.merge-flow-scroll>small{font-size:14px;line-height:1.55}
.merge-settings-content small{display:block;color:var(--oto-muted);margin:6px 0 12px}
.merge-settings-content input:not([type=checkbox]),.merge-settings-content select{padding:10px;font-size:16px;min-height:44px;min-width:0}
.page-workspace .merge-settings-content h3{font-size:16px}
.merge-settings-content .pdf-option-grid{gap:10px}
.merge-settings-content .pdf-option-grid>div{min-width:0}
.merge-settings-content :is(.pdf-advanced,.merge-advanced)>summary{padding:10px 0;cursor:pointer}
.merge-settings-content .pdf-caution{padding:12px;background:var(--oto-warning-soft);color:var(--oto-text);border-radius:9px;font-size:14px}
.merge-summary,.page-workspace .merge-summary strong{font-size:18px;line-height:1.5}
.page-workspace .merge-summary small{font-size:14px;line-height:1.5}
.merge-panel .merge-primary>.button.primary{font-size:16px;min-height:50px}
.merge-flow-scroll>p{font-size:16px;line-height:1.5}
.merge-process-steps li,.merge-progress-heading span,.merge-panel-title small{font-size:13px}
.merge-status,.merge-support{font-size:13px;line-height:1.5}
.merge-status{max-height:60px}
.merge-support>summary{min-height:30px;cursor:pointer;padding:3px 0}
.merge-support[open]{max-height:150px}
.page-workspace #pdf-compatibility{font-size:14px}
.merge-result-simple .merge-panel-title h2{font-size:22px}
.merge-result-simple :is(.workspace-result-info,.workspace-result-total),.merge-result-simple label,.merge-result-notes,.merge-result-save .merge-save-note{font-size:15px;line-height:1.5}
.merge-result-simple .workspace-result-name,.workspace-result-select{font-size:16px;min-height:46px}
.merge-result-save>.button{font-size:17px;min-height:50px}
.merge-result-simple .merge-text-action{font-size:15px;min-height:44px}
/* A result is a form, not a viewport-height canvas. Never clip its selector
   behind a fixed save area, especially in short windows and browser panels. */
body:has(#oto-screen .merge-workspace[data-state=result]) .main{height:auto;min-height:calc(100dvh - 64px)}
.merge-workspace[data-state=result] .merge-editor{flex:none;grid-template-rows:auto;align-items:start}
.merge-workspace[data-state=result] .merge-panel{align-self:start;max-height:none;overflow:visible}
.merge-workspace[data-state=result] .merge-result-simple,.merge-result-simple .merge-flow-scroll{flex:none;overflow:visible;min-height:auto}
.merge-workspace[data-state=result] .merge-output-preview{position:sticky;top:24px;min-height:440px}
.merge-workspace[data-state=result] .merge-output-preview>div{height:420px;max-height:60dvh}
.workspace-save-all{width:100%;justify-content:center}
.workspace-archive-note{font-size:14px!important;color:var(--oto-muted);line-height:1.5}
.workspace-result-navigation{display:flex;gap:8px;margin:0 0 16px}
.workspace-result-navigation>.button{flex:1;min-width:0;font-size:13px}
@media(max-width:700px){
 body:has(#oto-screen .merge-workspace[data-state=result]) .main{height:auto;min-height:calc(100dvh - 60px)}
 .merge-workspace[data-state=result] .merge-editor{display:block}
 .merge-workspace[data-state=result] .merge-panel{max-width:520px;margin:0 auto}
 .merge-workspace[data-state=result] .merge-output-preview{display:none}
}
.merge-output-preview p{font-size:15px;text-align:center}
.merge-output-preview>div{height:min(420px,78%);width:300px}
.merge-list{grid-template-columns:repeat(auto-fill,minmax(190px,210px));gap:20px}
.merge-card{min-height:308px}
.merge-cover{height:170px}
.merge-card-top{font-size:13px}
.merge-copy strong{font-size:15px;line-height:1.4;height:42px}
.merge-copy small{font-size:13px;height:auto;line-height:1.5}
.merge-range{font-size:13px}
.merge-card-tools button{min-width:34px;min-height:34px;font-size:15px}
.merge-card-tools button:first-child{width:34px}
.merge-card-tools button:first-child:before{font-size:22px}
.rows .merge-card{min-height:86px;grid-template-columns:24px 48px minmax(0,1fr) auto}
.rows .merge-cover{height:64px}
.page-workspace{--pdf-card-width:190px}
.page-workspace .pdf-page-list{gap:20px}
.page-workspace .pdf-card-meta,.page-workspace .pdf-card-position,.page-workspace .pdf-card-identity{font-size:13px;line-height:1.5}
.page-workspace .pdf-card-name{font-size:15px;line-height:1.4;overflow-wrap:anywhere}
.page-workspace .pdf-page-actions button{min-width:34px;min-height:36px;font-size:17px}
.page-workspace .pdf-image-preview{height:210px;min-height:0;background:var(--oto-soft);border-radius:8px}
.page-workspace .pdf-image-preview img{width:100%;height:100%;object-fit:contain}
.page-workspace[data-card-size=compact] .pdf-image-preview{height:170px}
.page-workspace[data-card-size=large] .pdf-image-preview{height:285px}
.page-workspace .pdf-source-row strong{font-size:14px}
.page-workspace .pdf-source-row small{font-size:13px}
.merge-reader-controls{font-size:15px;gap:6px;padding:9px;flex-wrap:wrap}
.merge-reader-controls button{min-width:36px;min-height:40px;font-size:15px}
.merge-reader-controls input{font-size:16px;min-height:40px;width:54px}
.merge-reader-close{width:40px;height:40px;min-width:40px;min-height:40px}
.merge-reader-title{font-size:14px}
body dialog.app-dialog{font-size:16px;line-height:1.5}
body dialog.app-dialog h2{font-size:24px}
body dialog.app-dialog :is(p,label,input,select,.button){font-size:16px}
body dialog.app-dialog .button{min-height:44px}
.oto-tooltip{font-size:14px}
body:has(.web-home) .main{padding-top:18px;min-height:calc(100dvh - 64px)}
.home-welcome{min-height:80px}
.home-welcome h1{font-size:28px}
.home-welcome p,.home-find input{font-size:16px}
.home-biblo,.home-biblo img{width:70px;height:70px}
.home-find .search{min-height:48px}
.home-privacy strong{font-size:14px}.home-privacy small{font-size:13px}
.home-catalog h2{font-size:20px}
.home-catalog .count-pill,.home-catalog .category-tab small{font-size:13px}
.home-catalog .category-tab{font-size:14px;min-height:40px;padding:8px 10px}
.home-catalog .tool-card-content{min-height:112px;gap:12px;padding:15px 26px 15px 14px}
.home-catalog .tool-card-content>img{width:60px;height:60px;flex-basis:60px}
.home-catalog .tool-card h3{font-size:17px;line-height:1.3}
.home-catalog .tool-card p{font-size:14px;line-height:1.4}
.home-catalog .favorite-button{width:32px;height:32px}
.home-catalog .favorite-button svg{width:16px;height:16px}
.home-upcoming summary,.home-limits,.home-footer{font-size:14px;line-height:1.5}
@media(min-width:701px) and (max-width:1250px){
 .merge-editor{grid-template-columns:minmax(0,1fr) 300px;gap:18px}
 .home-catalog .tool-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .home-catalog-head{flex-wrap:wrap}
}
@media(min-width:701px) and (max-height:740px){
 .merge-heading{min-height:78px;margin-bottom:12px}
 .workspace-feature-icon{width:128px;height:128px}
 .merge-drop{min-height:340px;padding:16px;gap:8px}
 .merge-drop h2{font-size:28px}
 .merge-drop>.button.primary{min-height:48px}
 .merge-list{max-height:none}
}
@media(max-width:700px){
 body:has(#oto-screen) .topbar.oto-header{padding:0 12px;height:60px;min-height:60px;gap:10px}
 .oto-brand-prefix{display:none}
 body:has(#oto-screen) .oto-header .brand a>span{font-size:12px}
 body:has(#oto-screen) .oto-header .brand img{width:30px;height:30px}
 body:has(#oto-screen) .oto-header .brand strong{font-size:22px}
 body:has(#oto-screen) .oto-header .primary-nav{gap:2px}
 body:has(#oto-screen) .oto-header .primary-nav-link{font-size:13px;padding:8px;gap:4px}
 body:has(#oto-screen) .oto-header .topbar-actions{gap:6px}
 body:has(#oto-screen) .oto-header .icon-button{width:40px;height:40px}
 body:has(#oto-screen .merge-workspace) .main{height:calc(100dvh - 60px);padding:14px 14px 0;min-height:540px}
 /* Wrapped capacity details must push the footer down, not overlap it. */
 body:has(#oto-screen .merge-workspace[data-state=empty]) .main{height:auto;min-height:calc(100dvh - 60px)}
 .merge-heading{min-height:90px;gap:12px;margin-bottom:12px}
 .merge-heading>img{width:56px;height:56px}
 .merge-heading h1,.page-workspace .merge-heading h1{font-size:25px}
 .merge-heading p{font-size:14px}
 .merge-benefits{font-size:12px;gap:4px 10px}
 .merge-workspace:not([data-state=empty]) .merge-benefits{display:none}
 .merge-workspace:not([data-state=empty]) .merge-heading{min-height:70px;margin-bottom:10px}
 .workspace-feature-icon{width:120px;height:120px}
 .merge-drop{min-height:350px;padding:20px 16px;gap:9px}
 .merge-drop h2{font-size:25px}
 .merge-drop p{font-size:15px}
 .merge-drop small,.merge-drop .merge-trust{font-size:13px}
 .merge-drop>.button.primary{font-size:16px;min-height:48px;min-width:200px}
 .merge-editor{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:10px}
 .merge-panel{padding:0}
 .merge-workspace:is([data-state=processing],[data-state=result],[data-state=error]) .merge-panel{padding:18px;max-width:460px}
 .merge-toolbar h2{font-size:18px}
 .merge-toolbar small,.merge-sort,.page-workspace .merge-sort label,.page-workspace .merge-sort .button{font-size:13px}
 .merge-workspace .merge-toolbar .button,.merge-workspace .merge-sort .button{font-size:14px;min-height:40px;padding:8px 10px}
 .merge-primary{gap:10px;padding:10px 0}
 .merge-primary .merge-mobile-settings strong{font-size:14px}
 .merge-primary .merge-mobile-settings small{font-size:13px}
 .merge-panel .merge-primary>.button.primary{font-size:15px;min-height:48px;max-width:62%;white-space:normal;line-height:1.3}
 .merge-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .merge-card{min-height:288px}
 .merge-copy strong{font-size:14px;height:40px}
 .merge-copy small,.merge-card-top{font-size:12px}
 .merge-card-tools button{min-width:32px;min-height:32px}
 .merge-card-tools button:first-child{width:32px}
 .rows .merge-card{grid-template-columns:20px 36px minmax(0,1fr)}
 .page-workspace .pdf-page-list{gap:12px}
 .page-workspace .pdf-page-actions{flex-wrap:wrap;justify-content:center;gap:5px}
 .merge-reader{padding-bottom:120px}
 .merge-reader-controls{font-size:14px;max-width:calc(100vw - 20px);gap:4px;flex-wrap:wrap;width:max-content}
 .merge-reader-controls button{min-height:40px;min-width:32px;font-size:14px}
 .merge-reader-controls input{width:48px;font-size:16px}
 body:has(.web-home) .main{padding:14px;min-height:calc(100dvh - 60px)}
 .home-welcome h1{font-size:24px}.home-welcome p{font-size:14px}
 .home-biblo,.home-biblo img{width:56px;height:56px}
 .home-catalog .tool-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .home-catalog .tool-card-content{min-height:140px;flex-direction:column;align-items:flex-start;padding:14px;gap:8px}
 .home-catalog .tool-card-content>img{width:56px;height:56px;flex-basis:56px}
 .home-catalog .tool-card h3{font-size:16px;line-height:1.3}
 .home-catalog .tool-card p{font-size:13px;display:block}
 .home-catalog .category-tab{font-size:13px;min-height:40px}
 .home-catalog .favorite-button{width:32px;height:32px}
 .home-catalog .favorite-button svg{width:16px;height:16px}
 .home-upcoming summary,.home-limits,.home-footer{font-size:13px}
}
@media(max-width:380px){
 body:has(#oto-screen) .topbar.oto-header{padding:0 8px;gap:6px}
 body:has(#oto-screen) .oto-header .brand img{display:none}
 .merge-heading h1,.page-workspace .merge-heading h1{font-size:23px}
 .merge-heading>img{width:48px;height:48px}
 .merge-drop h2{font-size:23px}
}

/* Split result: one global download action; per-file controls are progressive. */
.split-workspace[data-state=result] .merge-heading{display:none}
.split-workspace[data-state=result] .merge-editor{display:block;flex:none;width:100%}
.split-workspace[data-state=result] .merge-panel{position:static;width:min(100%,860px);max-width:860px;margin:20px auto 8px;padding:36px 40px;border-radius:18px}
.split-workspace[data-state=result] .merge-output-preview{display:none}
.split-result{gap:20px;text-align:center}
.split-success-art{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 auto 14px}
.split-success-art img{object-fit:contain}
.split-success-art span{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:#208341;color:#fff;font-size:28px}
.split-result-hero h2{font-size:clamp(24px,3vw,34px);margin:0 0 8px;line-height:1.2}
.split-result .workspace-result-total{font-size:18px;margin:0;color:var(--oto-muted)}
.split-result-primary{width:min(100%,580px);margin:0 auto}
.split-result-primary>.button.primary{font-size:19px;min-height:56px;border-radius:10px}
.split-result .workspace-archive-note{margin:10px 0 0;font-size:14px;overflow-wrap:anywhere}
.split-result-details{text-align:left;border-top:1px solid var(--oto-edge);padding-top:20px}
.split-result-details>summary{display:flex;align-items:center;gap:16px;padding:18px;background:var(--oto-soft);border-radius:12px;cursor:pointer;list-style:none}
.split-result-details>summary::-webkit-details-marker{display:none}
.split-result-details>summary strong{display:block;font-size:17px}
.split-result-details>summary small{display:block;font-size:14px;margin-top:3px;color:var(--oto-muted)}
.split-result-summary-icon{font-size:34px;color:var(--oto-accent)}
.split-result-chevron{margin-left:auto;font-size:24px;transition:transform .15s}
.split-result-details[open] .split-result-chevron{transform:rotate(180deg)}
.split-result-list{max-height:420px;overflow:auto;scrollbar-width:thin;margin-top:8px}
.split-file-row{display:flex;align-items:center;gap:14px;padding:14px 4px;border-bottom:1px solid var(--oto-edge)}
.split-file-icon{font-size:11px;font-weight:700;color:var(--oto-accent);border:1px solid var(--oto-edge);border-radius:5px;padding:13px 5px;background:var(--oto-surface);flex:none}
.split-file-info{flex:1;min-width:0}
.split-file-info strong{display:block;font-size:15px;overflow-wrap:anywhere}
.split-file-info small{display:block;font-size:13px;color:var(--oto-muted);margin-top:4px}
.split-file-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.split-file-row .merge-text-action{color:var(--oto-accent);min-height:44px;white-space:nowrap}
.split-result-edit{margin-top:18px;border:1px solid var(--oto-edge);border-radius:9px;padding:12px 16px}
.split-result-edit>summary{cursor:pointer;color:var(--oto-muted);min-height:32px;font-size:14px}
.split-result-edit .workspace-result-info{margin:8px 0}
.split-result-edit .merge-save-note{font-size:14px;overflow-wrap:anywhere}
.split-result .split-result-actions{justify-content:center;gap:28px;flex-wrap:wrap}
.split-result .split-result-actions .merge-text-action{color:var(--oto-accent)}
.split-result .split-result-trust{color:var(--oto-muted);font-size:13px;margin:0}
.split-result .merge-result-notes{text-align:left}
@media(max-width:700px){
 .split-workspace[data-state=result] .merge-panel{width:100%;max-width:none;margin:8px auto;padding:24px 18px}
 .split-result{gap:18px}.split-success-art img{width:92px;height:92px}
 .split-result-primary>.button.primary{font-size:17px;min-height:52px}
 .split-result-details>summary{padding:14px;gap:12px}
 .split-file-row{flex-wrap:wrap;gap:10px}.split-file-info{min-width:calc(100% - 55px)}
 .split-file-row .split-file-actions{margin-left:44px;gap:24px}
 .split-result .split-result-actions{gap:10px 20px}
}
